[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: 346
Thread images: 49

What are you working on, /g/?

Old thread: >>58094819
>>
And the parallel functional programming thread:

>>58076404
>>
>>58099362
Finally a separate thread for those retards.
>>
File: aoba code monkey.jpg (174KB, 1280x720px) Image search: [Google]
aoba code monkey.jpg
174KB, 1280x720px
Programming related anime?
new game doesn't count, you could change the setting to a high school and it wouldn't change a damn thing
>>
To the dude making the decentralized TV:

can you explain the point of your project. It seems interesting, but why would I, a humble normie, want to use decentralized and encrypted television?
>>
File: s.gif (178KB, 360x359px) Image search: [Google]
s.gif
178KB, 360x359px
>>58098296
Any other takers? Posting mine.

f[] := Partition[RandomSample[{0, 1, 1, 1, 1, 1, 1, 1, 1}], 3]
g[x_] := If[x == 1, f[], Table[0, 3, 3]]
s[n_] := NestList[ArrayFlatten@Map[g, #, {-1}] &, f[], n - 1]

Export["~/Pictures/s.gif", ArrayPlot /@ s[8], "DisplayDurations" -> .75]


:^)
>>
How would you make a program to pick a random subreddit from a list, go into that subreddit and just make a thread saying "NIGGERNIGGER FAGGOTNIGGER ANLA YOUR UGLY GOOSEMOM"?

Python? js? is there a reddit api?

t. noob
>>
>>58099512
Neato. Mathematica?
>>
>>58099512
haskell btfo'd
>>
>>58099541
>is there a reddit api?
http://lmgtfy.com/?q=is+there+a+reddit+api
>>
>>58099541
python + reddit API

you'll probably get banned in days
>>
>>58099542
Yep. The real lifesaver is the Map[ ... {-1}] bit.
>>
File: lordjesussaveusfromthis.jpg (7KB, 300x168px) Image search: [Google]
lordjesussaveusfromthis.jpg
7KB, 300x168px
>>58099430
Since the infrastructure for BasicTV is free, you don't have to pay anything to use it.

The entire network functions as a decentralized DVR as well (quality may vary), so you can infinitely rewind or fast forward (up until it is live).

You also can watch television in 4K and 8K, 3D (red and blue, Oculus Rift (possible, but APIs are beyond me), and others), multi channel sound, multiple different languages (dubbed and subbed), multiple physical screens, multiple windows (tiles like tmux).

You can donate Bitcoin to the nodes who run the network, along with the content provider (if you feel inclined to).

It can also be set up as a cheap Chromecast audio system (although I haven't tried that, nor is it ready). It would be pretty technical, but it isn't beyond /g/ to use

It can also do some geekier things which I think is cool (extensible macros with IR remotes, exporting MP4, FLAC, and others to SSH, FTP, DVDs, BD-Rs, and others), but those won't be things that most people use.

The best part of all is that it should all run on a Raspberry Pi (working on a Kodi frontend so not everybody needs a dedicated unit for this).

It is also possible to double-encrypt the stream information, so it goes out to the network before it is "live". Once this happens, and everybody who is interested in watching it has downloaded it, then upload the corresponding public key so it can be decoded in 1-minute chunks (customizable) in "real time", so you can get 1080p over dial-up if you put it far enough in advance

It can also do some really cool technical stuff (open up 20+ Tor circuits so more content can be downloaded and forwarded anonymously), but that falls outside of what a "humble normie" would want
>>
What can I do about mediocre developers on my team who are willing to learn? Every result online is philosophical drivel. I need practices, strategies, and material. Firing is not an option for a few months
>>
>>58099638
>mediocre developers
what did you mean by this?

what's a mediocre dev?
>>
>>58099626
>>58099430
It can also do a TV Guide and different refresh rates
>>
>>58099638
Come up with a solid architecture for your application and divide up the work.
Fire people who are ineffective.
That's the only way to get anything done.
>>
>>58099638
Give them concrete tasks with explicit requirements for quality.
>>
>>58099555
Hmm, make it create new random account on some email service? Would it work to do it via TOR to counteract site-wide IP-ban?
>>
>>58099679
don't know but what's the fucking point?

annoy redditors?

waste of time desu
>>
>>58099653
A mediocre dev is a dev that makes things more complicated, not more simple. You can throw every anti pattern in the world at them through code review and their fundamental architecture still won't reflect the real world. Their code works, but try to add something and it needs to be refactored. Refactor it, and it breaks. The mediocre dev is one that writes code and it works, but it doesn't work well. The mediocre dev still works hard but is just missing some piece.
>>
>>58099694
doesn't your company have code guidelines?
>>
>>58099710
We're not old enough for mature code guidelines. I add bad design patterns to it as often as they come up, but that's just treating the symptom. Inevitably more bad patterns just pop up when they encounter something new. I can guide them on new tasks, I can even create an entire skeleton for them, and they will only lack understanding, resulting in them not taking advantage of built in extensibility but instead stapling their own bad designs on top.
>>
>>58099776
(your own | your company | your startup) fault, in hiring them in first place
>>
>>58099812
I know that. And if were up to me, they would be gone tomorrow. There must be something I can do to improve the situation.
>>
File: Intervention.jpg (99KB, 728x452px) Image search: [Google]
Intervention.jpg
99KB, 728x452px
>>58099839
>>
>>58099776
This might be drastic but have you considered having a whitelist of good practices rather than a blacklist of bad ones?
>>
>>58099871
That's a good start. I still feel bad not instilling fundamentally good skills in devs themselves though.
>>58099672
We are introducing mandatory test coverage soon. At least that will help refactoring.

I'm also going to be helping to write a technical blog that will introduce more abstract fundamental ideas than I can inside work.
>>
>>58099920
where are you from?

USA?
>>
>>58099934
Canadia.
>>
>>58099946
and then people wonder why they import indians to write code
>>
>>58099985
The imported Indians are the worst programmers I've ever seen. They payed for their degrees and they literally never even owned a computer. No one wants them. We're all about those Asians. I'm lucky to work for a nationalist company though. It's good for the economy to not export our money.
>>
>tfw solved a project euler problem with the solution I got after solving half the problem and don't want to go back and do the rest, especially if I can't confirm that it's working
>>
Is there a good way to ingrain the finer intricacies of C-Pointers in practice?

For example a extensive set of exercises.

>https://grisha.org/blog/2013/04/02/linus-on-understanding-pointers/
I wonder if something like this would come to me naturally.

On the other hand: My lacking experience with this topic might simply be due to my limited experience with C in my coursework.

I guess reimplementing common data structures in C (incl. Free-handling or reeuse of Objects from a fixed pool) would help.

(
I'd also like to get deeper into locking and locality while I am at it.

A different sticking point would be "good enough" solutions or limited applicability to real world projects / very big input datasets.
)
>>
>>58100022
It might also be good in the long run too avoid poorly written shit.

IoT Botnets are a very fun kind of accumulated garbage.

That stuff should require more robustness before you release it into the wild.
>>
button2 = (Button) findViewById(R.id.add_button);
button2.setOnClickListener(new View.OnClickListener() {
public void onClick (View v) {
if ((newGrade.matches("Grade")) || (newCredits.matches("Credits"))) {
Toast.makeText(getBaseContext(), "Missing input", Toast.LENGTH_SHORT).show();
} else {
gradesArray[i] = newGrade;

switch (newGrade) {
case "A":
newGradeInt = 4;
break;
case "B":
newGradeInt = 3;
break;
case "C":
newGradeInt = 2;
break;
case "D":
newGradeInt = 1;
break;
default:
break;
}

gradesIntArray[i] = newGradeInt;
newCreditsInt = Integer.parseInt(newCredits);
creditsIntArray[i] = newCreditsInt;

//shit breaks right here, mang.
gradeList = (ListView) findViewById(R.id.muhlist);
listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, gradesArray);
gradeList.setAdapter(listAdapter);

i++;
}
}
});


trying to pass string array content to a listview. my shit breaks on the 3rd to last line on the "else" section. What gives. complete noob btw.
>>
File: momiji_wolfram.png (480KB, 600x849px) Image search: [Google]
momiji_wolfram.png
480KB, 600x849px
>>58099323
>What are you working on
Wolfram Research's new advertising campaign.
>>
>>58100212
post the fucking error
>>
>>58100212
Does Java allow using strings for switch statements? That might be it.
>>
>>58100291
well if i comment the 'listAdapter = new ArrayAda..." then it works. when I add that on there is crashes the app. currently the whole (this. etc...) part is underlined and red and I don't know how to read into it. I was basically just copying a tutorial on youtube and don't know why it doesn't work for me.
>>
File: arguing intensifies.png (172KB, 1361x749px) Image search: [Google]
arguing intensifies.png
172KB, 1361x749px
Looking for some clever, visual way to represent certain words from a page in terms of their frequency. Now the challenge is to make them not overlap. Pic related, a scan of the Windows 10 discussion thread.
>>
>>58100355
>windows just never works faggot
lmao
>>
File: animu.png (308KB, 522x1007px) Image search: [Google]
animu.png
308KB, 522x1007px
>>
>>58100391
3/6 master race
>>
>>58100391
I was in that /co/ thread too aha :)
>>
>>58100405
my nigro
>>
>>58100391
I used to have a gif where they stitched all the pictures together, it was mesmerising.
>>
>>58100355
http://reference.wolfram.com/language/ref/WordCloud.html
>>
Since the functional thread is pretty much dead. Is there any way to get a slime like repl with scala in emacs?
>>
>>58100533
Neat. Thing is, I only have a coordinate for the bottom left corner of the word.
>>
>>58100581
No I mean just do this.
>>
>>58100739
what language is this?


dafuq
>>
>>58100755
Mathematica/Wolfram Lang.
>>
>>58100787
neat
>>
>>58100739
Where's the fun in that?
>>
>>58100823
You can try it out and look at little sample programs here if you're interested
http://www.wolfram.com/programming-lab/?source=nav

>>58100850
You get to do other fun stuff.
>>
>>58100884
>You can try it out and look at little sample programs here if you're interested
>http://www.wolfram.com/programming-lab/?source=nav

can you install it on your computer like python or C++?
>>
Should I use the below to get variables/objects from other classes?

private OrthographicCamera gameCam;

public CheckGameOver(OrthographicCamera gameCam) {
this.gameCam = gameCam;
}


Or should I make the original public and static so I can access it from anywhere

public static OrthographicCamera gameCam;


What's the best for performance?
>>
>>58100892
Yeah of course. It costs money though (unless you do something else...)

Also comes preinstalled on Raspbian.
>>
>>58100911
Mathematica/Wolfram Lang sounds great and all, but the thought of paying for using a programming language..

fuckin jews
>>
>>58100932
I wouldn't call it a programming language.
>>
>>58100932
Yeah I got it heavily discounted through university. It's the same with Matlab except you've got open-source stuff like Octave that's basically as good. No one has come close to replicating what Mathematica does. Sage is trying but it's still a long way off.

>>58100954
What's your definition of a programming language?
>>
>>58100979
It's scripting/querying at best.

Can you use it to write an actual program?
>>
>>58100991
Wolfram Alpha is written in Mathematica. Yes you can use it to write actual programs with it.

It is technically a scripting language I guess. But you can compile parts of your code into C and load it back into the interface.
http://reference.wolfram.com/language/ref/Compile.html
>>
>>58100355
>Now the challenge is to make them not overlap.
-give each word a radius based on its size
-calculate the distance between the center of each and the direction between them
-move them apart until the distance is >= the sum of the radii
>>
I have a question, in g++, does it include functions that are never called in the executable?

What about variables? If I define a variable, does it actually exist on the executable?

And if it does, what if I have sections of code that can be skipped over at compile time
Eg
bool debugging = false;
// code
if(debugging)
cout << "var " << var << endl;

Is it safe to do something like this? Would the cout be in the executable?
>>
>>58101148
does it actually exist if I never use it*
>>
File: g.png (109KB, 1319x718px) Image search: [Google]
g.png
109KB, 1319x718px
>>58101112
Still working on that. Obviously it's gonna depend on the length of the word and its size.
>>
>>58101208
This seems like it could be useful:
http://static.mrfeinberg.com/bv_ch03.pdf
>>
File: react.png (791KB, 1264x1608px) Image search: [Google]
react.png
791KB, 1264x1608px
How does this make you feel, /g/?
>>
>>58099396
It's bad.

I checked it out because I really like Clojure, but that thread is filled to the brim with smug functional weenies who seem to care more about language pissing contests than actually making anything neat with the things they champion.
>>
Are all future developers doomed to have to learn and use JavaScript?
>>
>>58101324
indifferent, i don't do web so i don't have to deal with it
>>
>>58101324
>separate HTML, JS and CSS
>CSS does jack shit without html
>html is shit without css
>js does shit
This guy is retarded
>>
>>58101360
If you plan on doing anything web related, yea probably. You could always learn an alternative that compiles to js though.
https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js
>>
>>58101424
separate in the sense you don't write them all in one file but rather in separate unit files
>>
>>58101324
Makes me feel bad for him as he has not understood the benefit of declarative UI programming.
>>
>>58101324
I use angular 2 for web development, so it's a non-issue for me
>>
>>58101474
I'm not really a web guy but I don't see that being very viable if you want to create html in your JS files. PHP seems much worse though but even then it's not really a problem
>>
>>58101360
Just learn Typescript instead.
>>
>>58101498
it is
if you ever worked with something like that and then switched to a proper template system it's a hell and heaven difference
>>
>>58099323
>tfw you will never make a OS for evangelion
>>
>>58100175
Try implementing a linked list for starters.
>>
>>58101515
And then a doubly linked list
And then binary trees, etc
>>
I just wrote the dumbest thing trying to do an insert for a binary search tree, I feel like a retard after seeing how it's normally done
>>
Can someone explain anonymous functions as simply as possible please? I don't understand when you would use them.

Preferably with some kind of example of real world usage.
>>
>>58101673
They're simply functions that aren't assigned to a variable.

For example consider this C++ lambda as a sort callback to sort the objects by their age field.

struct Person {
int age = 0;
};

std::vector<Person> people{};
// fill the data

std::sort(people.begin(), people.end(), [](const Person &a, const Person &b) -> bool {
return a.age > b.age;
});
>>
File: 1454010683342.png (10KB, 122x120px) Image search: [Google]
1454010683342.png
10KB, 122x120px
>>58095408
I think you are looking for
(Math/pow ...)


Also you should try to avoid using def when you can. loop and recur allow you to bind and rebind values, kinda like a let. So instead of def-ing your way through, you can:
(loop [pass 1
total base]
(if (< pass power)
(recur (inc pass) (* total base))
total))


This is better because you aren't setting anything. In Clojure you very rarely need to set anything, you would instead rely on functions and temporary bindings. So, uh, using def for intermediary things is kinda bad. Sorry. There are little things that you learn soon that help you get past a lot of this though.

As for the second block, you are using loop for a range of things, so here's how I would generally approach a problem like your powers function, I would first realize two things:
> I want a range of something (powers in this case), so I will likely use (range ...)
> I have a function that can give me the power of something (Math/pow ...)

So, the result would basically just be mapping the two:
(defn powers [base power]
(map #(Math/pow base %) (range 1 (+ 1 power))))


Also, if you are allergic to all the nesting, you can use ->> to limit that to one step per line.
You should use -> and ->>, because they are amazing.

(defn powers [base power]
(->> (+ 1 power)
(range 1)
(map #(Math/pow base %))))


>>58101673
anonymous functions are a quick way to pass your own logic into a function in the same way you would pass your own values into a function.

It's kinda hard to explain, but basically, it makes things like this possible: https://asciinema.org/a/7jlodigt8vkldvjjzq40393z3

The argument to the .map call basically the same thing as an anonymous function, and what it is doing is transforming a messy list of values into a nice list of information we care about.
>>
>>58101673
Functions with no names

It offers really easy solutions like
reduce(lambda x,y: x+y, range(101)) #sum of all numbers from 0 to 100
>>
>>58101673
Imagine a callback function except you can define it as a function literal and pass it as a variable.
>>
how do i write C code and compile it and execute it in the simplest way (what text editor, compiler, etc). I'm on Windows unfortunately
>>
>>58101750
>>58101792
>>58101800
>>58101815
I think I understand now. Thanks.
>>
>>58101673
A function that doesn't have an identifier. You can sort of imagine it as the data that represents the function.

>I don't understand when you would use them.
Delegates/callbacks. Maps. Generic functions.

eg: I could implement a sorting algorithm, but instead of writing one for every reasonable use case and telling the user he's shit out of luck if they wanna sort something else, I could make it so that my sorting function takes a compare function which can do the comparison between to objects, so they can use my algorithm for anything they can write a compare function for (and if you can't write a compare function, sorting is impossible anyway). Sure, you could use a named function to pass in, but maybe the function is really small and you don't want to clutter up the environment with identifiers that people could potentially misuse, and you don't wanna scroll any more than necessary just to follow the natural flow of the program, so you declare it inline.

example:
function sort(data, compare)
-- ...
if compare(a, b) == 1 then
-- ...
end

sort(vectors, function(v, w) return v.x * v.x + v.y * v.y > w.x * w.x + w.y * w.y end);
>>
>>58101853
with an ubuntu live image, gedit, and gcc
>>
insert(node){
if head = null
head = node
else
currentnode = head
notinserted= true
while(notinserted){
if current = null
current = node
notinserted=false

else if current < node
current = current.right

else if current > node
current = current.left
}
}

Should I give up if this is what I thought of doing for a binary search tree insert instead of a recursive function
>>
Having a problem in Ruby. Making an RPG with RPGMaker and we are trying to get text to display on screen during a battle after a skill is used.

https://hastebin.com/rodosiheyi.rb

@window = MyClass.new


is the line i'm talking about specifically, it will work if you manually go and type that in to an event script, but just trying to have it autorun as part of any of the main scripts will result in an error.
>>
>>58101882
>gedit
>simplist
nano or vi
recommend vim though
>>
>>58101853
I don't know what you mean by "simple" but on Windows I install msys2, add it to my path, install clang & make via pacman, then compile shit via the cli. I use a native Windows version of GVim as my text editor but you should use whatever. Same with the compiler, use what you want.

Learn how to write a makefile then all you'll have to do is write the C project and type `make` in the project directory to build, if it's portable you shouldn't even have to worry about the compiler, have a default compiler that you use but let the user define one for make to use if they want/need.

If you meant simple for development, maybe code::blocks, I'm not really sure.
>>
>>58101928
Is it being called too often?
>>
>>58101907
That looks roughly correct. What's wrong with it?
>>
>>58101324
MVC is a shit paradigm for OOPajeets anyways.
>>
File: ruby script.png (17KB, 608x446px) Image search: [Google]
ruby script.png
17KB, 608x446px
>>58101959
It should only be called once.
>>
>>58102019
When is this script ran?
>>
>>58101928

>just trying to have it autorun as part of any of the main scripts results in an error
How are those scripts calling this one? And what is the error you're getting?
>>
>>58102001
struct node* search(struct node* root, int key)
{
// Base Cases: root is null or key is present at root
if (root == NULL || root->key == key)
return root;

// Key is greater than root's key
if (root->key < key)
return search(root->right, key);

// Key is smaller than root's key
return search(root->left, key);
}

Is so much cleaner and smaller
>>
>>58101148
it gives you a warning so it's definitely aware, but I doubt it outright removes that without an optimization flag
just use #define and #ifdef/#ifndef for what you want though
>>
>>58101907
Things will be a lot easier for you if you keep track of the parent of the node you are visiting.
>>
>>58102036
>>58102056
Anything you put in "material" header runs automatically on the game start
(unless something else calls it)
I've just created a class to bring up a window
and immediately below the class, i'm creating the window
which doesn't work in that script, but if i were to make an event on the map (like talking to an NPC or something) and create the window on him instead, and then talk to him it works fine
>>
>>58102064
As someone who has a boner for recursion, I can assure you that recursion isn't always the best solution. It's usually cleaner, but it's basically always slower. Though, if you're lucky, it will get turned into a loop by the compiler's optimizer.

No, you shouldn't give up just because you didn't immediately think of a nicer looking solution.
>>
File: example3.jpg (553KB, 1499x744px) Image search: [Google]
example3.jpg
553KB, 1499x744px
>>58101928
>>58102091
>>58102056
>>58102036
>>58102019
Here's another example.
>>
>>58101792
wait, you can partially apply a func in clojure?
>>
>>58102144
recursion is just goto+stack
>>
>>58102091

>Anything you put in "material" header runs automatically on the game start
First and foremost, Ruby has no concept of "header". An .rb file is an .rb file is an .rb file. What I am asking you is how it is loaded by the main program. Is it using load or require? Because the latter will not load a file twice, while the former will. And there's a few other semantic differences I think. It also begs the question of where in that script it is being loaded. It is in theory possible that @window referred to something else in the program that you just overwrote.

>I've just created a class to bring up a window
>and immediately below the class I'm creating the window
That much is obvious. You just showed us. But we can't judge the nature of your problem from just this code alone. The error is likely arising from how other code is interacting with it. Speaking of, you have yet to describe the nature of the error. Error messages are pretty fucking important, as they often tell you exactly what the fuck is wrong with your code.
>>
>>58102144
>>58102158
Are you allowed to create windows at the start of the game?
>>
>>58102144

>Though, if you're lucky, it will get turned into a loop by the compiler's optimizer.

GCC's -O2 will do this 100% of the time with tail recursion, and with certain types of technically non-tail recursion (i.e. factorial).
>>
File: 53t.png (6KB, 398x151px) Image search: [Google]
53t.png
6KB, 398x151px
>>58102183
>>
>>58102316

Now that... that is a fuckload more helpful.

In Ruby, an uninitialized instance variable (@variable), class variable (@@variable), or global variable ($variable), rather than producing a name error when referenced, evaluates to nil. The nil object basically only responds to messages that any other object would, but it has no new methods defined on top of it. So right now the script calling this thinks it's talking to an object that's a Window_Base or a subclass of it, and in reality, it's talking to an uninitialized variable, which doesn't know what a window_tone is.
>>
what are the differences between the 1st and 2nd editions of K&R? on amazon, the first edition is $8 and the 2nd is $50
>>
>>58102531
Are you retarded? The 2nd one is newer and more up to date.
>>
>>58102593
is it worth being 6x the price?
>>
File: Selection_004.png (19KB, 1070x71px) Image search: [Google]
Selection_004.png
19KB, 1070x71px
>>58099323
>What are you working on, /g/?
>>
>>58102611
any price is a ripoff when google will hand you the pdf on a silver platter.

if you insist on the dead tree edition or have morals or something, cough up
>>
>the area of a spherical zone or a spherical cap is simply 2pi*rh
>suddenly the area of a sphere (4pi*r^2) makes sense because of this (h=2r => 2pi*rh=4pi*r^2)
life is beautiful
>>
File: sumfib.png (37KB, 897x758px) Image search: [Google]
sumfib.png
37KB, 897x758px
Hey /g/,
first time posting. I'm trying out Euler's Problems, I'm on #2 where it asks you to print out the even numbers in Fibonacci's sequence up to 4 million.
My code doesn't result in any errors, but it also doesn't print anything. I've tested it by printing within the loop and before it. Any tips would be brilliant.
>>
>>58102760
I'm not sure why it isn't printing anything but there's a bug in your code. You are printing the sum of the first 4 million fibonnaci numbers that are even, rather than the fibonnaci numbers up to 4 million.
>>
>>58102760
>>58102803
Also please fix your indentation.
>>
>>58102760
It's not printing anything because it's trying to calculate the first 4 million Fibonnaci numbers, which will take a very long time with your implementation. You just need Fibonnaci numbers up to 4 million.
>>
>>58102634
How do you handle the login to download the files, cookies?
Also, care to share the source?
>>
File: namegenerator.png (14KB, 800x600px) Image search: [Google]
namegenerator.png
14KB, 800x600px
I'm a beginner, just started working on a project list to get a foundation. My name generator works like 7/10 times, but gives an error saying I called out of my list index. Its basic, but i could still use help.
>>
>>58102760
I don't think you're suppose to calculate fib each time. Just do it iteratively
>>
>>58102876
random.randint(0, len(firstsyllable)) will return len(firstsyllable) some of the time, which is out of bounds of the array. The allowed indices of a list range from 0 to len(list).
>>
>>58102736
volume of a sphere - (4pi/3) r^3

differentiate this with respect for r
>>
>>58102858
>cookies?
yepp

>Also, care to share the source?
no, not yet at least

also, downloads still cost GP, working on user confirmation right now, so not to spend unnecessary chinese cartoon porn dollarinos
>>
File: Cy1H_HVVQAADF-6.jpg (161KB, 867x1227px) Image search: [Google]
Cy1H_HVVQAADF-6.jpg
161KB, 867x1227px
>>58102939
Ohh, I had a similar idea, but instead make a scrapper, just to save on shekels.
>>
File: 1445991425563.png (261KB, 569x563px) Image search: [Google]
1445991425563.png
261KB, 569x563px
>>58102980
Yeah, I was planning to add that as an option later, still gotta remember you have an image limit that regenerates somewhat slowly.
>>
>>58102914
thanks. changed the limit (0,(len(firstsyllable)-1)) and it works.
>>
>>58102760
your program doesn't look incorrect, just inefficient. project euler is a lot about finding efficient algorithms to problems. if you use a for loop and go through the fibonacci sequence like 1 1 2 3 5 etc you don't need to calculate every number from scratch, to get the next one you just need to add the last two together. also, try to look for a pattern to see if you can sum the even numbers without even needing an if statement.
>>
What kind of stuff do you have on your github
>>
>>58103111
Programs!
>>
Where is the best place to learn how to write makefiles? I can write simple ones but I don't want to have to list every dependency and shit
>>
>>58102162
Yep!
user> (map (partial + 2) (range 4))
(2 3 4 5)
user>


Though what you are looking at in the post you quoted isn't a partial, that's the threading operator, which basically turns code like this
(reduce + (take 10 (filter even? (range))))


Into code like this by having the last argument being the previous result:
(->> (range)
(filter even?)
(take 10)
(reduce +))


It's lazy too, (range) on its own gives you an infinite list of numbers.

There is another variant that works with the first argument, so:
(-> (range 10) rest rest rest rest rest rest first (+ 3))


...is the same as

(+ (first (rest (rest (rest (rest (rest (rest (range 10)))))))) 3)


As you can see, it can really clean up your code.
>>
>>58103185
man make


or https://learnxinyminutes.com/docs/make/
>>
>>58103204
I should elaborate. The reason why -> and ->> aren't partials is because it's not actually currying anything between the steps.

-> and ->> are macros that turn the code inside them into their equivalent messy versions when you give it to the compiler.

So when I say they are equivalent, I really mean it.
>>
File: fragzeichen.jpg (91KB, 1280x720px) Image search: [Google]
fragzeichen.jpg
91KB, 1280x720px
At this point in time, does it make sense to use bitwise operators in C? Like for something like floor or ceiling? Are they really any faster?
>>
>>58103532
Just use standard functions. There obviously are reasons to use bitwise operators in C if there isn't a standard function for example.
Anything that you make that you want to use very little memory you probably will use bitwise operators too, such as having flags.
ex:
// groups byte into 00111222 where 0 is op, 1 is firstval, 2 is secondval

#define OPMASK 0xc0
#define FIRSTMASK 0x38
#define SECNDMASK 0x07

#define OP(I) (I) & opmask
#define FIRST(I) (I) & firstmask
#define SECND(I) (I) & secondmask


An example more relevant to your question:
#define times2(N) (n << 1) /* good for chars and ints */
>>
>>58103642
I wrote that in the comment box so dont mind the inconsistent capitalization
>>
Is there anything wrong with this shortcut?

    public static void print(String string0) {
System.out.println(string0);
}
>>
>>58103936
yes
>string0
>code smell
>java
>allman style
>>
File: Selection_006.png (29KB, 1078x120px) Image search: [Google]
Selection_006.png
29KB, 1078x120px
>>58102634
>>
>>58104010
>code smell

curry and poo?
>>
Why are there still millions of high-paid developer jobs in the US and Europe?

IT is literally the easiest thing to outsource to Pajeet.
>>
>>58103936
import static System.out;

...

out.println(whatever);

Also works for int, char, Object, and so on.
>>
>>58104184
Too many development firms are still developer driven.

Once the MBA slimeballs take over entirely, you will see far more outsourcing.
>>
>>58104184
Pajeet is cheap.
But Pajeet delivers shit straight from the street.
It's just not feasible to have Pajeets deliver your software if you need it to be done fast, and with changes along the way.

Just ask anyone who's ever worked with Pajeet's code.
>>
Post githubs
>>
File: 1469550813682_1437181421076.jpg (168KB, 528x686px) Image search: [Google]
1469550813682_1437181421076.jpg
168KB, 528x686px
God damn it! How the hell do people use Lua? Hi it's me the Nub that trapped himself in Lua and likes art again dumping another half solved problem on you.

This time it's sprite management.
Quick overview on how I want to handle sprite by having an array of love's image objects that get indexed into by an entity attribute
o.sprite
.
these images are currently being loaded with the following function that somehow returns a plain number according to the errors.
function loadImages()
local list = {
'assets/vis/sam.png',
'assets/vis/brick.png',
}
for i=1, #list do
list[i] = love.graphics.newImage(list[i])
end
return list
end


What stumps me is that using(what I thought to be) equivalent code worked perfectly fine in the first draft of the game.

Thanks again for that parsing help. It's working great now.
>>
File: 2016-12-21-035306_386x150_scrot.png (15KB, 386x150px) Image search: [Google]
2016-12-21-035306_386x150_scrot.png
15KB, 386x150px
https://arxiv.org/pdf/1506.05869v1.pdf
>>
>>58104236
quality has never really mattered in any industry

just look at how much chinese garbage infests your house

we're already moving towards lower standards in code. see any internet of shit device
>>
File: Psycho2.jpg (8KB, 170x170px) Image search: [Google]
Psycho2.jpg
8KB, 170x170px
>Exception in thread "main" java.lang.NullPointerException
>>
>>58104267
I don't have any chinese shit in my house.
Most of it is decades old stuff I've inherited.

It's the difference between Ekornes and Ikea. Ekornes costs 5 times as much for a chair, but it will last 10 times as long.

Yeah, Ikea is making more money than Ekornes, but both are healthy companies.
>>
Does anyone know of any programming communities in the dark?
>>
>>58104311
hackforums
>>
>>58104311
>implying any of us have our lights on
>>
>>58104336
In the dark as in darknet. Hoping to get a voucher for kickass hackers on there
>>
>>58104392
There's jack shit in there, last i checked it was just a dump of old coding ebooks.
>>
>>58104432
So basically the Gentoomen library?
>>
>>58103936
yes

use autocomplete, eclipse has syso ctrl+space
>>
>>58104464
and you can configure your own ones of course
>>
>>58104267

Shit quality = shit security = MAJOR costs down the road.
>>
>>58104500
>capitalism
>EVER thinking long term

good one
>>
>>58104249
Your problem probably isn't in that function.
>for i=1, #list do
I would probably do that as
for i, v in ipairs(list) do
list[i] = love.graphics.newImage(v)
end

but that is just a style thing. I don't think it has any actual effect on the semantics of the code.
>>
>>58104506

A fool and their money are soon departed. Those who do not give consideration to the long term deserve to lose all of their profits, as a warning for the rest.
>>
>>58104535
>deserve to lose

deserve to, but dont actually do.
the reality is that managers today are rewarded in three or six month cycles. long-term investment becomes a scarcity.
>>
>>58104549
Wow, it's like capitalism is trying to mimic democracy with the same hilarious results in both!
>>
>>58104549

You are talking about the managers. I am talking about the company itself. If a company rewards managers who make risky, short term decisions, they may find themselves losing money as a result. The manager has already made their money, but the company has lost. Therefore, upper level managers who want to see the company move in a more positive direction would be wise to make better decisions about who they hire for the lower level managers, and what they want them to prioritize.
>>
>>58104614

so you are a revisionist capitalist piggy that blindly believes in the long-term viability of the system.

i thought you are a revolutionary like us. a comrade.
>>
>>58101853
Ubuntu in a VM with your dev tools installed. I also found using Apache web server is 10 times easier than setting up a virtual network drive for file transfers.
>>
>>58104737
>Apache web server is 10 times easier than setting up a virtual network drive
Setting up SSH and using SFTP is completely trivial.
>>
>>58104624

The flaws of capitalism are the flaws of humanity, and they would be exacerbated in any other system. Government socialism merely places the short-sighted managers in charge of a much larger corporation which a much broader scope, without a profit motive to possibly convince them to make better decision. If we are to believe that true socialism/communism is anarchy/stateless, we will see soon enough society's nature will again force a nation state again upon the people. Capitalism is by no means perfect, but at the very least it allows those who make bad decisions to fail. Where capitalism fails is where those in power intervene to stop failure from occurring.

>>58104737

>Installing another operating system to write programs for your own operating system
Just use mingw-w64.
>>
>>58101515
>>58101561
I already did those in C years ago. Even a recursive variant with tripple pointers. But I guess you are right.
>I guess reimplementing common data structures in C would help.

(Though I must say I was hoping more for recommendations of specific goal-oriented exercises. But I guess I can think about those myself.)

I did a quick-and-dirty remove yesterday according to the proposed variant in a different example I found.
https://grisha.org/blog/2013/04/02/linus-on-understanding-pointers/
http://www.thegeekstuff.com/2012/08/c-linked-list-example

void remove_from_list(int to_remove){
//struct test_struct *head // Global list head
//struct test_struct *curr // Global list tail
struct test_struct **pp = &head; /* pointer to a pointer */
struct test_struct *entry = head;
struct test_struct *lastvalid = NULL;
struct test_struct *todel = NULL;

while (entry) {
if (entry->val == to_remove){
todel = entry;

*pp = entry->next;

// pp is not overwritten!
// last pp is still valid
entry = entry->next;

free(todel);
}else{
lastvalid = entry;

pp = &entry->next;
entry = entry->next;
}
}

if(todel){ // Adjust tail-pointer
if(head) curr = lastvalid;
else curr = NULL;
}
}
>>
>>58104749
Yeah that'll work too. Just thinking of the easiest way not necessarily the best way.
>>
>>58104781
>Where capitalism fails is where those in power intervene to stop failure from occurring.

because we would have something as bad as the Great Depression if the real estate crash of 2008 were allowed to unfold in the way it would in an actually free market.

the central banks of today are intervening to a massive extent everywhere around the globe, because the income/wealth inequality caused by financial capitalism would lead to deflation/negative growth otherwise.
>>
>most retarded tripfag on /g/ proves himself even more retarded by defending capitalism

wew. is there any low he won't sink to?
>>
>>58104814
>most retarded tripfag
GTP?
>>
>>58104814
>most retarded tripfag on /g/

rachit has not posted today -- yet.
>>
Give me a not too complicated program I can make in Java to put in my portfolio
>>
>>58104800

If a great depression would have happened, oh well. This is a short term suffering necessary to ensure a long term market correction. What we did created a moral hazard. Companies know that if they fuck up, the government will bail them out if they're big enough. What they need to be feeling is that if they fuck up, the CEO is going to be homeless.
>>
>>58104886
I love people like you.
>>
Fuck you, give me money.
>>
>>58104881
C++ Compiler
>>
>>58104940
Wrong general
>>
>>58104940
>Can't wait for a paperweight.
>>
>>58104922
 Runtime.getRuntime().exec("clang");
>>
>>58104953
clang is a C compiler, doofus.
>>
>>58104963
I'm about to clang you over the head, dingus.
>>
Is CodeAcademy good for learning?
>>
>>58105079

for learning the basics of the basics of a language, yes.
>>
>>58104881

Write a program that replaces SafetyNet on Android and tells every application that asks it whether it's been rooted that the phone is completely fine and there's nothing to see here.
>>
>>58105091
Is this an honest answer? I would imagine you run a program in the background that listens for rootcheck calls and answers it instead of the system rootcheck but I'm not sure how you would go about interrupting system calls.
>>
>>58105091
>SafetyNet
https://koz.io/inside-safetynet/

Seems complicated to circumvent. Bascially Google monitors EVERY Android device CONTINUOUSLY.

Apps can ask Google if the current Device is ok and verify the response on their API-Server.

The SafetyNet-monitoring daemon is loaded dynamically from Google's servers and executed after verification.
>>
>>58105153

>Is this an honest answer?
Of course not. Safety Net is not something you could easily trick with a user level program.

Although if you wanted to interrupt a system call... simply overwrite the system call table completely with a kernel module.

>>58105244

Could you use a hosts file to redirect all of the Google server requests to a server on the phone?
>>
File: 1482055600767.png (818KB, 1280x719px) Image search: [Google]
1482055600767.png
818KB, 1280x719px
New /fpt/:

>>58105321
>>
File: 1481436909623.gif (89KB, 400x400px) Image search: [Google]
1481436909623.gif
89KB, 400x400px
>>58099323
>too lazy to learn to code

feels comfy man
>>
>>58105381
Kill yourself, you retarded frogposter.
>>
File: VID_20161221_121656260.webm (2MB, 1920x1080px) Image search: [Google]
VID_20161221_121656260.webm
2MB, 1920x1080px
>>
>>58105381
>be frog
>have no daylight lamp
what a stupid piece of shit.
>>
>>58105353
>Could you use a hosts file to redirect all of the Google server requests to a server on the phone?
Certificate pinning.

1. Device requests Nonce from App-API-Server
2. Device sends Nonce to Google and asks for (signed) Attestation.
3. Device sends the result to App-API-Server for verification.
4. Server denies API-Access if something is wrong.

Currently the way to go is hiding yourself and hoping that they don't detect you.
https://koz.io/hiding-root-with-suhide/
https://koz.io/inside-safetynet/
>>
File: based C.png (237KB, 361x480px) Image search: [Google]
based C.png
237KB, 361x480px
#include <stdio.h>
int main()

{
int numValue;
printf("Type a number: ");
scanf("%d", &numValue);
printf("You entered %d", numValue);
return 0;
}


Glad I made the switch from C++ to C as my first language today. I think I'll get a lot more to learn out of C.
>>
>>58105458

>4. Server denies API-Access if something is wrong.
What I'm suggesting is that the server never gets contacted in the first place. All requests from the application using the API get redirected to another application on the phone. Granted, this can't fake Google's private key, but in theory if part of the client side SafetyNet could be corrupted to accept whatever garbage the fake server is sending it, that would be all find and dandy.

More or less, what I'd like to do is lobotomize the client.

>Currently the way to go is hiding yourself and hoping that they don't detect you.
>SuHide
The problem is that SuHide right now requires SuperSU. That's a proprietary root application, which might as well be a fucking botnet. If it can't be done with PHH's Superuser, it's not worth doing at all.

Hence why I have stopped playing Pokemon Go. That and the fact that Niantic is just really shitty about everything, and time spent playing that game would be better spent on Sun and Moon.
>>
File: synt.png (17KB, 895x376px) Image search: [Google]
synt.png
17KB, 895x376px
>>58105381
It's hard. The only thing motivating you is yourself. Hating yourself because you're so stupid, can't even grasp basic structure of a language from 50 years ago made to be easy. It's just discouraging all the time, I hope things start clicking together soon. keep fucking up syntax and semantics
>>
>>58105542
Are there missing lines?
Where is that from?

>>58105540
Well. You could lobtomize the client if you did not need its Access to the specific API's.

Trying to lobotomize SafetyNet seems hard (sending a stream of innocent data their way).

Yet dooable (even if its hard) until they include hardware attestation or decide to poke around directly on the device with hardware support to detect root kits.
>>
File: synta.png (21KB, 891x764px) Image search: [Google]
synta.png
21KB, 891x764px
>>58105647
oh an excerpt from the book "C Primer Plus" fifth edition. there was a sample code with errors you had to fix, and then it started talking about syntax and semantics and I got confused so I took a break.
>>
File: VID_20161221_124625822.webm (1MB, 1920x1080px) Image search: [Google]
VID_20161221_124625822.webm
1MB, 1920x1080px
>>58105412
it fetches temperature data from another raspberry, which acts as a weather station :-)
>>
>>58105679
>it started talking about syntax and semantics and I got confused
A syntax error means that the code itself is malformed, and the compiler cannot accept it.
A semantic error just means that the program doesn't actually do what you intend for it to do, but is still valid code
>>
>>58105647

>if you did not need its Access to the specific API's.

As my phone is rooted and always will be rooted, I do not need an API to tell me so. The fact that I can launch su from a terminal should always be sufficient.

What I would like to do is corrupt any library code and any kernel level code associated with SafetyNet so that any user level application looking to SafetyNet to see if the device is clean will find that it is universally.

What would be even more useful is if a SafetyNet check could result in prompting me for a response, just as I am prompted to confirm when I want to give an application root access. But that could be added in after the fact.
>>
#include <stdio.h>

#define MAXLINE 1000 /* maximum input line size */

int max; /* maximum length seen so far */
char line[MAXLINE]; /* current input line */
char longest[MAXLINE]; /* longest line saved here */

int getline(void);
void copy(void);

/* print longest input line; specialized version */
main()
{
int len;
extern int max;
extern char longest[];

max = 0;
while ((len = getline()) > 0)
if (len > max) {
max = len;
copy();
}
if (max > 0) /* there was a line */
printf("%s", longest);
return 0;
}

/* getline: specialized version */
int getline(void)
{
int c, i;
extern char line[];

for (i = 0; i < MAXLINE - 1
&& (c=getchar)) != EOF && c != '\n'; ++i)
line[i] = c;
if (c == '\n') {
line[i] = c;
++i;
}
line[i] = '\0';
return i;
}

/* copy: specialized version */
void copy(void)
{
int i;
extern char line[], longest[];

i = 0;
while ((longest[i] = line[i]) != '\0')
++i;
}
>>
>>58105737
>extern char line[];
>extern char line[], longest[];
These are unnecessary.
They are already in scope.
>main()
Returning an int implicitly isn't valid C anymore. But if you're reading K&R, they do it, so I'll give you a pass on that.
In the future, you should do
int main


But for beginner code, that is decent.
>>
>>58105728
I meant API's the App itself uses to fetch data. Map tile urls for example.

(Unrelated to the SafetyNet Check).
>>
>>58104781
>Capitalism is by no means perfect, but at the very least it allows those who make bad decisions to fail

We've just gone over how that's not true
>>
>>58105808

Fuck. Making this work right would require quite a bit of research.

>>58105889

It has the capacity to do so. It doesn't always do so when it needs to.

Oh well. At least in capitalism, the poor are fat.
>>
I'm already finishing the virus to kill all socialists. It'll be active very very soon
>>
>>58105999

Make sure it takes out the national socialists too. Better dead than red.
>>
>>58106008
Yeah it sure will. I said socialists, which obviously includes them even if they don't like to admit that.
>>
>>58106008
But the US and Russia share the same national colors.
>>
File: cicadian-rythm.png (185KB, 958x1400px) Image search: [Google]
cicadian-rythm.png
185KB, 958x1400px
Dealing with production outages, no time to code anything.
>>
CharSequence str = input();
for (int i = 0; i < str.length(); i++) work(str.charAt(i));


versus

CharSequence str = input();
int length = str.length();
for (int i = 0; i < length; i++) work(str.charAt(i));
>>
>>58106052
I would pick the third option, where you're not using Java.
>>
>>58106052
see >>58106061
>>
>>58106052
input().Select(x => Work(x));
>>
>>58106052
for (char c : str.toCharArray()) {
work(c);
}
>>
>>58099323
I decided to make cat simulator. Im googling atm to find out all i can about cant procretaion, progeny statistics and so on. Idea is to spawn bunch of cats and watch population grow and expand. It will be glorious.
>>
I got a stupid question about this book, The C Programming language, are you supposed to solve these exercises from the information book provides, or are you allowed to use other sources?

I am trying to rewire my messed up thinking pattern after codemonkeycadamy etc
>>
>>58106930
I assume the exercises are there to test you on the knowledge of the previous chapter so if you don't get what to do then maybe you need to re read it idk
>>
>>58106930
You do you.

Solve the problems in whatever way possible, and have someone verify that your solution isn't shit.
>>
>>58106930
Why do you think searching for other resources would be a no no? Just do the exsercises, try by yourself if no look it up....
>>
>>58099427
High schools don't have 80 hour work weeks.
>>
File: insubordinate clause.jpg (265KB, 515x700px) Image search: [Google]
insubordinate clause.jpg
265KB, 515x700px
LOL

Us programmers, right?

system.out.printline("LAUGHING");
>>
>>58107041
but I'm a code evangelist
>>
>>58106944
>>58106956
K, that seems to be the best way
I was wondering if the book is trying to make you think up optimal solution from what you learned, but I just saw it's online solution, I think they expect you to take reference help from internet too.
>>
File: screenshot2016-21-12.png (42KB, 633x410px) Image search: [Google]
screenshot2016-21-12.png
42KB, 633x410px
hello fellow geeks o7 , why isnt my sores code compiling? :#
>>
58107172
You'll need to do much better than that.
>>
>>58107041
wh-what
>>
File: image.png (110KB, 1680x1050px) Image search: [Google]
image.png
110KB, 1680x1050px
>>58099323
>What are you working on, /g/?

Getting ready for some more exploration. Who TDD here?
>>
>>58107218
Is it true you need TDD because you're using racket and it's worse than Javascript?
>>
>>58107218
what a horrendous interface
>>
>>58107246
Yes.
>>
>>58107218
i like your nyan cat ~:3c
>>
We all faced this problem.

You have to return the first element of a list where element.attribute = value.

What is the best way to solve this in Java?
>>
>>58107453
Doesn't Java have an equivalent to this:
myList.First(x => x.attribute == "value")
?
>>
>>58107470

No clue, hence I am asking, lel.
I already did similar stuff in C++.
>>
>>58107453
== or equals()
>>
>>58107453
What problem? any monkey can figure this out.
>>
>>58107531

There are lots of cheap methods, but what is the best one?
>>
Hi guys, a small javascript-question. Look at this:
myObject = { one: "blabla", two: "something_else" };

I can get value from this object by key, an example:
myObject.one; //"blabla"

If i don't know keyname, but i know his value, how can i get the key?
>>
>>58107620
Object.prototype.getKeyByValue = function( value ) {
for( var prop in this ) {
if( this.hasOwnProperty( prop ) ) {
if( this[ prop ] === value )
return prop;
}
}
}

var test = {
key1: 12345,
key2: 99999
};

test.getKeyByValue( 12345 ); // returns 'key1'
>>
>>58107708
Thanks, man.
>>
>>58107041
LMAO
>>
File: IMG_3767.jpg (539KB, 3000x2000px) Image search: [Google]
IMG_3767.jpg
539KB, 3000x2000px
Nice, now just gotta add an anime picture.
>>
Why are IDEs with integrated, interactive documentation, like JavaDoc, bad, according to /g/?
How is not having that better?
>>
File: IMG_3770.jpg (639KB, 3000x2000px) Image search: [Google]
IMG_3770.jpg
639KB, 3000x2000px
>>58108019
>>
>>58108019
>according to /g/
IDEs are a good thing.

An IDE is a text editor with many features related to programming.

If they can help you, you should use them.

If not, then don't use them.
>>
>>58108019
Because /g/ loves fucking useless garbage language with no real ides
>>
>>58108059
If it's in a book, it must be true.
>>
>>58108099
No.
It's just the authors opinion (and I like his opinion).
>>
File: we comfy now.jpg (2MB, 3648x2736px) Image search: [Google]
we comfy now.jpg
2MB, 3648x2736px
CS students of /dpt/: What do you use to take notes in class?

Looking for a markdown editor that accommodates both fixed-width code blocks and in-line mathematical formulae (preferably LaTeX)
>>
>>58105693
>>58105412
>Spending $100 on this instead of sticking your hand out the window
>>
>>58108259

>taking notes

pull up a actualy text editor or IDE instead
>>
>>58108259
we're not allowed to use computers in a lecture class
>>
>>58108259
Pen and paper because I'm not a faggot

Seriously, the only people using laptops in lecture halls are dicks.
>>
>>58102803
>>58102846
>>58102879
>>58103092
I just woke up, definitely appreciate all the feedback. Wasn't sure what kind of answers I would get haha. Gonna get to work.
>>
>>58108279
>he doesn't realize having a nice project improves your learning motivation
>>
>>58108296
>>58108304
What is this autism? Why wouldn't you use a small laptop to test and compile things that the professor is demonstrating?
>>
does anyone know how i can export an OLE object from Microsoft Access? theres an image path in the object and i have no idea how to get it
>>
>>58108296

Unbelievable. Change schools. Now.
>>
>>58107259
show yours faggot
>>
I dug myself a grave going static arrays, so before I start fucking around with linked lists, is there any way to remove garbage from dynamic memory outside the compiler?
>>
>>58108342
>autism
I wouldn't be surprised if you felt the need to copy his hand gestures too
>>
>>58108371
What's wrong with static arrays?
>>
>>58108342
Because you should pay attention and reproduce it AFTERWARDS, nigger.
>What is spaced repetition?

Fuck. I hate faggots like you. Stupid retards.
>>
>>58108259
HAROOPAD
A
R
O
O
P
A
D
>>
>>58108348
Pretty easy with
System.Data.OleDb
if you're using C#.

I'd need to see what you're actually doing, but it probably wouldn't be more than a few lines of code.
>>
>>58108259
Back when I was in school, I used an Asus Transformer with the little dock.

Worked out pretty well for my purposes, but if I had a blank check and was in college now, I'd probably get a Surface Book.
>>
>>58099323
>What are you working on, /g/?

Completing a entrance exam for a company. I have to write a class library in Java that parses a file.

Technically, the code does everything it is supposed to do, but I feel like it could be much better. There are lots of subtleties that newfriends dont get.
>>
>>58108436
It's literally just parsing delimited text, or what?

Seems trivial.
>>
>>58108426

i'm not using C#, I guess it's vb script that i can run inside Access, but i'm not sure what code and even where to enter it. Basically, i'm exporting tables into csv files. Text and number data show up just fine in each column/field. However the "image-path" field is left blank. When I went to see what data type it was using it's an OLE object. I wish it would tell me the image path. Blah I hate M$....
>>
My first android app. Since it's gonna be a widget and it has to by dynamic, I'm drawing it all programmatically as paths, which is kind of a pain. I won't be able to accomplish all the visual effects I was hoping for (background blur, etc).
>>
File: 1400887551155.jpg (195KB, 500x484px) Image search: [Google]
1400887551155.jpg
195KB, 500x484px
>be me
>send out two applications for pretty nice companies
>both develop different sensors n shit
>put cellphone number in application
>change number two days after

sent out the application like two weeks ago. I am afraid that they tried to call me and can't reach me :(
My Email is inside that application though. Maybe they just don't have time.
>>
>>58108450

Lots of additional functionality, like checking and creating complex objects out of the information contained in the file, as well as managing the database of the created objects.

Its do-able. They do not evaluate whether you manage to do it, but how you do it.

A senior with decades of experiences probably knows a framework that does exactly that, I had to write lots of things from scratch.
>>
>>58108411
I need more control over the size, which depends on the size of a file. For some reason arrays don't accept this kind of input.
>>
>>58108506
Did you consider using a parser monad?
>>
>>58108470
dumb frogposter

Also, holy shit you stupid ass, call them and let them know that you changed numbers so they can make note of that on your application.
>>
>>58108522
Use a vector and keep the size the same.
In C you get automatic arrays that let you do this.
>>
>>58108532
No it's too late now :(
>>
>>58108411

what happens if you need the array to change size?

;)
>>
Did the CIA niggers ever surrender to our savior Terry A. Davis?
>>
>>58108551
They surrendered to his car
>>
>>58108259
Pen and paper, unless it's a practical class. Stop being a faggot.
>>
>>58108527

No, lel.
What is that
>>
>>58108541
It's fine, I needed a refresher anyway. I just wanted to know if there was anyway to unfuck dynamic memory.
>>
File: anal beads.png (64KB, 509x291px) Image search: [Google]
anal beads.png
64KB, 509x291px
>>58108570
Have you ever made a burrito?
>>
File: parsec.png (10KB, 374x249px) Image search: [Google]
parsec.png
10KB, 374x249px
>>58108570
It's a way of expressing parsing, in an effectful manner comparable to IO
>>
File: 2016-12-21_13-58-54.jpg (327KB, 1347x347px) Image search: [Google]
2016-12-21_13-58-54.jpg
327KB, 1347x347px
Wow. made haskell great again!
>>
>>58108592
Whoops, thought this image was code.
But if you look at the last example, I just wrap the regular parser (called parser) with many1, and instantly it gives me back lists of parsed results - many1 is a higher order parser
>>
>>58108579
Honestly, I've always been confused by Chipotle. Too many choices for configuring my burrito. I prefer Taco Bell, it just werkz.
>>
>>58108603
Are you implying that this can't be done in a non-meme language?
>>
What's the best assembly to learn? Should I learn high level assembly first? MIPS?

Or should I just dive straight into x86?
>>
>>58108638
No, it can be done in a non-meme language.
It's best to do it monadically.
>>
I just wrote a package in Java. How do I export it nicely over E-Mail?

pls serious answers
>>
>>58108638
He's implying that he's smarter than you but it's probably not true.
>>
>>58108651
Are you implying that non-meme languages can't do monads?
>>
File: nice meme.png (43KB, 500x411px) Image search: [Google]
nice meme.png
43KB, 500x411px
>>58108638
>meme language
Go away
>>
>>58108668
No, of course non-meme language can do monads. Like Haskell.
>>
>>58107039
>80 hour work weeks
That's so exaggerated.
Really videogame development is not that bad at all if you have competent coworkers
>I don't
Ah.
>>
>>58108638
>>58108651
>>58108677
>using meme interchangeably with "joke"
Please go back to whichever site you came from
>>
>>58108694
>he fell for the joke is the new meme meme
>>
>>58108701
>meme is a meme meme meme in meme
Ok, sure
>>
>>58108694
That's not what "meme" means in the context of those posts.

It sounds like you're projecting your own assumption of the meaning into those posts, as you've got only a shallow understanding of the nuances of the word "meme".
>>
>>58108701
>he fell "joke is the new meme is a meme" meme
>>
>>58108694
Haskell isn't a joke language either
>>
>>58108725
No language is a joke. There's no "right" way to program.
>>
>>58108714
"meme" has only one real meaning but it also has a reddit meaning similar to what "joke" means. Redditors like yourself sometimes like to call "funny" images memes
>>58108725
Where did I try to argue for or against that? My post has nothing to do with Haskell
>>
>>58108694
>>58108720
It kind of makes sense since memes are more often than not jests, or satire.
>>
>YouTube programming tutorial starts
>Everything looks fine
https://www.youtube.com/watch?v=tkzJsP7NP54
>Narrator starts to talk with Indian accent
>>
File: 1479948925226.jpg (23KB, 255x222px) Image search: [Google]
1479948925226.jpg
23KB, 255x222px
>>58108740
>There's no "right" way to program.
>>
>>58108744
It doesn't though. Learn the actual definition of "meme" and stop using it like a foreigner if you aren't one
>>
>>58108742
>"meme" has only one real meaning
This is patently false, and the word had evolved before reddit even existed.

That's like saying "faggot" has only one real meaning.

Attributing something you don't like to reddit does not a solid argument make.
>>
>>58108763
>J__
>Eclipse
Didn't you take the hint?
>>
>>58108763
I really don't know what you expected, anon.

Who the fuck learns programming from videos?
>>
is it convention to leave the main method completely empty if you write a class library?

or should it print out Hello World!, at least?
>>
>>58108806
>method
fuck off.
>>
How long do you guys think it will be before every other word will just be 'meme'?
>>
>>58108806
You shouldn't need to write a main method for a library
>>
>>58108818

ah, thats right.

>>58108811

>autism
you too
>>
>>58108763
There is literally nothing wrong with being Indian and some of the best programmers at my company are Indian. And I say this as a white guy.

Why is 4chan so infected by /pol/-tier racism?
>>
>>58108832
>method
>autism
fuck off, retard.
>>
I have an array of vec3 vertices and an array of vec3 colors and an array of glushort indices. How do I draw this model with opengl es 3? I tried several examples but nothing shows up, except the screen clearing color.
>>
>>58108796
I do
>>
>>58108834
4chan has literally always been like this, but it has gradually become much more tame over the years.

/pol/ now is what the entire site was like about a decade ago.

>>58108811
>>58108844
What's wrong with using the term 'method'? In many languages, method and function are interchangeable.
>>
>>58108844

you are autistic for being triggered by the word method, autist.
>>
New thread:

>>58108860
>>58108860
>>58108860
>>
>>58108867
>thinking that autist is a pejorative
>method
fuck off, retard.
>>
>>58108865
Nah, I was here a decade ago and the entire website wasn't as bad as /pol/ is now, people wouldn't randomly scream about the DAY OF THE ROPE or degeneracy in blue board threads
>>
>>58107620
http://stackoverflow.com/questions/8711580/how-to-get-the-key-value-in-json-object/8711637#8711637
>>
>>58108059
Which book is that from?
>>
>>58108371
What is wrong with malloc/free?
>>
so i am working on a raspberry pi keylogger i am just unsure how i could get that to word...

anyone got ideas?
Thread posts: 346
Thread images: 49


[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.