Last: >>53633479
What are you working on /g/?
how should I name my structs/unions/enums in C?
CamelCase?
>>53642857
>i can't read it so it's shit
>>53643060
Underscore_Title_Case
or if you wanna be a REAL hardcore Cfaggot, Shrtnme
>>53643078
Bugs Bunny is great. I miss old cartoons.
naming variables is the hardest part about programming
>>53643180
The hardest part about programming for me is being sober. That's why I program at work, but even then it's hit and miss.
>>53643180
g_rglpszStrings
Post more programming maymays.
Is there a portable command line program that scans C Sharp source files for comments and generates pretty HTML documentation pages? All the programs I found either require configuration files, are visual, run on Perl (what the fuck) or cost money.
>>53643354
Just use Doxygen.
>>53643354
Couldn't you just use something like doxygen
>>53643354
Try Doxygen, anon!
>>53643377
>>53643382
>>53643398
FUCK OFF I'M MAKING MY OWN IN ANSI C
What do you guys think of doing ProjectEuler/HackerRank etc... In respect with the goal being to be able to put this on your resume. I know the answers are hovering around all over the place but I'm sure it still carries weight if you did 50-100 of them.
>>53643377
>>53643382
>>53643398
>require configuration files
If I'm a fucking faggot and i just want to learn programming languages for the sake of having them on my resume and hoping some HR fuck sees it or some fucking shit, are there any I should look into aside from HTML, CSS, JavaScript and SQL?
>>53643484
Eh.
Maybe if you have them all in your github or something.
>>53643484
it wouldn't carry as much weight as an impressive project
>>53643516
java
python (it's SHIT but it's the hottest meme for HR fucks)
I know python, javascript, powershell. And C#, all for work. Should I learn C or Haskell next as a hobby language?
>>53643570
C.
Haskell a shit.
Putting EmulationStation on my new Raspberry Pi 3 Model B to play some old Playstation and NES games. Not really programming, but I program as a job.
>>53643570
C or C++
fuck haskell
Covariant return types
>>53643593
Not sure what's the thing you're building but since it seems to be C++ is there any reason why they (you?) are using pthread as opposed to std::thread?
>>53643517
I am not deleting them so I could do that.
>>53643527
My problem with this approach is I don't think I know enough and I don't know what the minimum is to begin approaching a project in the first place, nor do I know of any projects worth doing.
In green is what I would say I know the basics of as to not be afraid to expand upon.
>>53642250
Go is actually one of the few languages that has been promoting dependency hygiene.
Get ready to get rekt, the truth is in pic related, if you have weak heart then don't open it or you will get heart attack and depression! See ya!
>>53643996
Sweet opinion you got there.
>>53642808
I want to learn java what software (needs to be lightweight) do I use on arch linux?
>>53644055
you use Intellij IDEA
>>53644055
Why java? If that's your first language, learn something hackable.
>>53644118
too cpu intensive
>>53644152
I want something that runs on linux mac and windows IIRC java outputs a .jar
>>53644180
>too cpu intensive
I have pentium 4 and runs smooth as fuck, the fuck you have? an IBM with floppy discs station? gtfo
>>53644180
>Java
>IDE
>Lightweight
Barking up the wrong tree, mate.
>>53644191
x220
>>53644196
Nigger, that has an i5 in it.
>>53644055
vim
javac
>>53644180
>I want something that runs on linux mac and windows IIRC java outputs a .jar
That has nothing to do with being hackable.
>>53644196
>>53644191
How about a piece of paper with pencil? This will be 0% cpu intense
I would appreciate some help /g/. I cannot for the life of me get the number from an imported text file to actually become a usable variable throughout my code.
the .txt fileDoe, John K.
93.2
Andrews, Susan S.
84.7
Monroe, Marylin
75.1
Gaston, Arthur C.
62.8
It needs to print out likeDoe, John K. 93.2 A
Andrews, Susan S. 84.7 B
Monroe, Marylin 75.1 C
Gaston, Arthur C. 62.8 D
Here is the code I have currently
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
using namespace std;
enum letter_grade { A, B, C, D, F };
int main()
{
string lastName, firstName, middleName, fullName, line;
int average, i = 0, line_number = 0;
string total;
int dicks = 0;
ifstream transferSchoolFile;
transferSchoolFile.open("student_status.txt");
std::ifstream input("student_status.txt");
while (input && std::getline(input, line))
{
if (dicks > 0)
{
total.append(" ");
}
total.append(line);
if (dicks > 0)
{
total.append(" ");
total.append("RELATE SIZE OF GRADE HERE");
total.append(" ");
total.append("\n");
dicks = 0;
}
else
{
dicks++;
}
}
cout << total;
transferSchoolFile.close();
return 0;
}
>>53642808
What do you think of Cello to teach programming basics?
https://www.youtube.com/watch?v=bVxfwsgO00o
>inb4 teach original C
>>53644248
Still? Jesus dude. Didn't you post this about a week ago?
Please do not use an anime image next time. Thanks.
>>53644297
>FUCK THE POLICE
>>53644248
I have no idea why you have and input and an open. Just useifstream input("student_status.txt");
while (getline(input, line) { /* ... */}
You may want to keep track of the line number and check if it's odd or even. If it's even, then you have a grade and you can do something likedouble average;
average << atoi(line.c_str());
>>53644245
he's saying he doesn't care about hackability. he is rejecting your statement that he should be using something hackable, because he instead values something that runs of linux mac and windows
>>53644277
I also plan using this since seems pretty straight forward to me
http://c.learncodethehardway.org/book/
>input
>>53644055
>>53644180
>>53644196
>key words: cpu, poorfag, linux, neckbeard, poor, x220
>output
I recommend Javascript
Any interesting interview-esque programming questions/prompts?
>>53644731
Average two fizzbuzzes in C
Do live usb's use virtualization ?
Working on my file server with torrent support. Got a file system monitor running which keeps the database in sync with the stored files. Too bad the lazy niggers haven't implemented recursive monitoring yet. Next up is to create a simple web front end that displays all files. Than I'll tag the code as version 0.1.
I didn't know SQLite was that much slower than PostgreSQL. Inserts are 30x as slow, but SQLite is comfy as fuck and requires no setup so I'll use that for now.
>>53644412
>Learn C the hard way
No, just no
>>53644802
Nice blog
>>53644731
I got asked to reverse a string using pseudocode
I can't imagine how bad the average applicant must be for those questions to be necessary.
>>53644731
Fizzbuzz part 2:
From 1 to 100:
If a number is evenly divisible by 3, print Fizz.
If a number is evenly divisible by 5, print Buzz.
If a number is evenly divisible by 7, print Baz.
If a number is evenly divisible by 8, print Norf.
If a number satisfies more than 1 of these rules, concatenate them
i.e. 15 says FizzBuzz, 24 says FizzNorf
>>53644489
>JavaScript
Unironically a better language than Java
>>53644843s[::-1]
Checkmate, atheists.
>>53644802
>I didn't know SQLite was that much slower than PostgreSQL.
SQLite isn't really meant for high I/O on a server.
How does PostgreSQL compare to MySQL?
>>53644846
That seems too easy to be asked on an interview, right?
>>53644906
If it's so easy then do it. Think of it as practice for your interview
If you do a long if-elseif chain I'm throwing your resume in the garbage.
#!/usr/bin/python
#!/usr/bin/env python
#!$(which env) python
which one
>>53644916
I'm not even that guy, I was just wondering
>>53644894
I understand SQLite being slow, but I didn't think it would be that slow. Apparently there are some tricks to really speed that shit up: http://stackoverflow.com/questions/1711631/improve-insert-per-second-performance-of-sqlite. I'll look into that when all the must haves have been implemented.
I'm not really into databases, but AFAIK PostgreSQL performs better than MariaDB/MySQL. The only reason MySQL is so popular, is because of muh LAMP stack.
>>53644966
Interviewers always start off with easy questions to make sure you aren't a helplessly-bad tier programmer.
If you get past those without trouble ,then they bring out the big guns.
>ctrl+f: algorithm
>0 results
code monkeys pls go code an indian version of 4chan
>>53644879
>>53644843
print reverse(s);
>>53644916
>if-elseif chain
No Anon, just an if chain.
>>53644984
alright, nice
>>53645043
That's bad too.
>>53644916
>>53645059
What about a case/switch?
>>53645059
Why is it bad? It's easy to understand.
If you respond with "it takes longer to compute" I will destroy you.
>>53645078
It doesn't satisfy his autism.
>>53645078
Don't be simple, anon.
>>53645105
No interviewer would say that.
In fact, it's great if you can solve things in a simple but still efficient way. It makes your code easier to understand for your co-workers.
So, if I download c++ and start typing a bunch of random shit, I will create a video game?
>>53645117
It means you aren't special. Pajeet lives behind the McDonalds a couple blocks away and he can chain if statements, too. Why should we hire you instead of him?
>>53645136
Given an infinite amount of time, yes
>>53644916String fizz;
for (int i = 1; i <= 100; i++) {
fizz = "";
if (i % 3 == 0) {
fizz += "Fizz";
}
if (i % 5 == 0) {
fizz += "Buzz";
}
if (i % 7 == 0) {
fizz += "Baz";
}
if (i % 8 == 0) {
fizz += "Norf";
}
if (fizz != "") {
System.out.println(fizz);
} else {
System.out.println(i);
}
}
;^D
>>53645136
Download Unity and start clicking random shit.
Why aren't you in on four dimensional programming?
>>53645137
"I have a folder of cute anime girls I'll happily share with you"
>>53645137
You shouldn't because I wouldn't apply for a shitty coding job anyway. You're implying they look for special people, but they don't.
>>53645144
this still uses a 5th comparison, any way to do this with only 4 comparisons AND string concatenation ?
>>53644846
Took me a second to work out what the fuck you meant by evenly divisible (could have meant is the result of division even).
>>53645070
The only advantage to using a switch is if you want to drop down into other cases without breaking, but there's no point because you'd need to check conditions again anyway.
Given the number of permutations, it's most efficient to just check each of the 4 modulo results.
What are the benefits of functional programming?
Actually benefits. No academic reasoning. Immutability implies a need for more memory, and "easier to reason about" still means absolutely fuck all, when you're trying to find an argument error in a 8+ function callstack.
>>53645157
>Many times I have thought that to myself that computers would work better if you could just "add a two" in binary code
#relatable
>>53645194
Some code looks cleaner when written functionally.
>>53645183
How are you confused by 'evenly divisible' anon? This is elementary tier math. I thought programmers nowadays had to know at least calculus?
Let me put your resume in a special folder I like to call 'the trash can.'
>>53644846def fizz():
divDict = {3: 'Fizz', 5: 'Buzz', 7: 'Baz', 8: 'Norf'}
for i in range(1, 101):
s = ""
for key in divDict:
if i % key == 0:
s += divDict[key]
print s
>>53645180
None that I can think off
>>53645277
It's more compact, but is it really more efficient than something as simple as >>53645144?
>>53645297
>but is it really more efficient than something as simple as >>53645144
no
>>53645194
Absolutely none. Mainstream functional languages (like Haskell) tend to use less code for certain tasks than mainstream OOP languages (like Java). That's about it.
They're not comparing the functional paradigm, just the implementations of certain languages.
The way people talked about OOP in the early 90s, functional programming was an outdated and failed meme. OOP subsumed functional programming: pure functions are just one kind of object. Then Java came along and the functional programming community pretended it's the epitome of OOP. Java explicitly avoided things like multiple inheritance. How can it be the epitome of OOP if some things aren't even objects?
In the past, they would compare their language to C. Not even C++ or Ada, plain C (before C89, too). Some parts of their language are worse than a language that was called "portable assembly" since the 70s. What an accomplishment!
>>53645160
"I'm sorry, hiring you would be against labor laws, as we are not allowed to hire children under the age of 16"
NPM EXPOSED AS INHERENTLY INSECURE
https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c
If you use NPM to manage your Node packages, stop building NOW. Massive security exploits are possible with namespace attacks.
nodefags BTFO
people fucking suck at agar.io
fucking minecraft-playing shitkids
>>53645355
are there children above the age of 16 then? :3
>>53645363
>node
kindly fuck off to >>>/g/wdg
>>53645194
it's just fun
the code won't be magically cleaner and it definitely won't run faster
try it, maybe you'll like it
>>53645382
Until you're 18 you're still a child.
>>53645194
none, really. of course you can have "pure" functions and immutable variables, but basing the entirety of your program around it is fucking retarded
>>53645256
"Evenly divisible" is meaningless without context.
If you mean "divides to an integer with no remainder", then why don't you say what you mean?
Yes, it's elementary tier, so is explaining yourself without being ambiguous.
>>53645471
Child generally means pre-pubescent, not below 18.
>>53645611
Until you're able to be independent, you're a child.
"Dependent Adult" is still a child in my books.
>>53642808
this thread is being monitored! TAKE CARE!
>>53645626
But that's more of an expletive using the word child, rather than using the word child in its commonly understood meaning.
Nerd.
>>53645611
you're still a minor until the age of majority, which is 18 basically everywhere
>>53645638
Bitch, you're not getting the job.
I SAID GOOD DAY, CHILD.
>>53645626
>tfw you can't afford to become an adult
life is suffering
>>53645611
ok kid
>>53645656
What job? I just walked in here and people are yelling dumb things.
Why is there 17 forms of FizzBuzz on that whiteboard?
Is that...Brainfuck?
>>53645676
You're in the wrong place. This is the general where everyone is still waiting for their medication but the handlers abandoned a LONG time ago.
>le pure FP means everything has to be immutable meme
No SIDE effects. Effects are fine.
>>53643060
No, camelCase.
>spergs arguing the meaning of the word 'child' as if there is one true definition that applies in all contexts and as if it even matters in the first place
niggas pls
>>53645626
>>53645643
>I'll use my own shitty definitions instead of the actual definitions!
Why though
>>53645669
>Implying I'm not a balding 23 year old
life is suffering
>>53645194
Concurrency, shorter code and lazy evaluation
>>53645705
A side effect is any effect that isn't the result of a function.
>>53645735
My definition is the only one which matters.
Also, 26, dog bites kinda, been greying since i was 19. the goatee part of my beard is all grey. thinking of dyeing it.
>>53645747
I love FP but in all practicality lazy evaluation is rarely a benefit.
>>53645755
Exactly. FP models effects as results of functions.
>>53643272
girls like dolls though
>>53645194
Immutability also means that programs can be better tested because variables can't be changed by other parts of the program
I have a C++ related question:
I have a character array with the value of nullptr that needs to be printed to the console. How can I make this happen, if at all possible?
>>53645832
That has nothing to do with functional programming though.
>>53645815
B-Boys do too ;_;
>>53645194
>"easier to reason about" still means absolutely fuck all, when you're trying to find an argument error in a 8+ function callstack
Can you expand on this because "argument error" is a pretty vague expression.
>Tfw you all suck at programming and none of you have ever made an application that makes money
>>53645194
>Immutability implies a need for more memory
No, it does not.
>>53645889
>projecting hard
i'm good af, haven't released my game yet but i'm gonna, and i'm gonna make good af games
>>53645921
Until you make money from it you are a noprogrammer all no programmers need to leave
>>53645889
Wow Anon, your projection level is off the charts. Did you just get your first $.69 paycheck from Google Play Store?
>>53645858
you're not a boy anymore anon
Functional programming is pretty shit for systems programming (where verification is actually really useful) without linear types, I'll concede that much. And given that there's only a few properly linearly-typed languages out there, and they're all academic wankery, it probably looks pretty bad to anyone who isn't more interested in the development of languages rather than the usage of languages.
>>53645973
I am, I try to be!
>>53645986
Systems programming is all about access to particular memory addresses for memory management and hardware devices. The important part is the specific addresses, not the fact that they are accessed once (presumably to remove the need for GC). There's no reason why an operating system can't have a GC once the memory management parts are implemented. There were OSes with GC in the 70s and some OSes like Singularity depend on GC for all programs as part of the security model.
>>53645986
>linearly-typed languages
What's that?
>>53644846
I know, I've "optimized" the string concatenation but not the amount of checks, it's very clean like this though.
I've been posting my progress on a spacey crafting game. I'm using webgl which g seems to have a bit of apprehension for. Anyway, I'm working on some positional lighting code which I don't understand very well, so I'm creating some tools to help me debug the situation. I've made the classic mistake of copy and pasting code but not actually making sure I completely understand it, so I'm going through it all line by line to learn exactly what everything is for. The attached video is a basic cube with axis placeholders so I can still see my objects positions if my lighting code blows prick. This is just test code, so now I have to go back into my engine and create a shader manager so I can switch shaders from the ones that draw those simple lines to the dysfunctional lighting shader.
If you think you can't do much with webgl check out this site:
http://goocreate.com/gallery
That site has a lot of interesting programs people have made from the goo webgl engine. My guess is a lot of you haven't looked at webgl since the early days and imHo you should take another look at it. If you have the time, sign up and create a new project out of the spaceship demo.
To be honest, whether the opengl "window" is attached to your browser or a gui window shouldn't really matter, and I know the real issue is that the code is running in the browser which is going to be much slower than native code, but I still think it's neat.
If you guys want me to post my code somewhere let me know. Does github offer free public repos?
>>53646150
Linearity with regard to memory management doesn't mean you only get to access memory once and then it's thrown away (although that could be the semantics if you really wanted...), it's that you can make types that ensure that there's exactly one point at any given time where a piece of memory can be mutated OR many points where it can only be read.
And I understand that certain forms of garbage collection like regions can be faster than allocating and freeing everything individually, but they're not suitable for all use cases. And even if an OS has a GC available for software to use, it's not part of the language used to write it. To write an OS you need something with little to no runtime - something with a good GC built in won't fit the bill. And of course for real-time software you don't want a built in GC either.
>>53646215
If a variable has a linear type, it must be used exactly once. Kind of like noncopyable objects in C++ or Rust, but those are uniqueness (affine) types which means that they can be used 0 or 1 times. Linearity is good for modeling effects and especially for memory management, like monads, but it's more primitive and generally more flexible.
This is a good paper on the subject:
http://homepages.inf.ed.ac.uk/wadler/papers/linear/linear.ps.gz
>>53646249
JS sucks. Running GL applications in the browser is stupid and slow.
Use a decent language and regular OpenGL.
Yes, github has free repos. So does bitbucket
>>53646249
lighting isn't too hard, i mean if you're bad at math you're going to struggle with the more advanced lighting models, but you had lambert diffuse shading working the last time you posted, right?
>>53646281
>it must be used exactly once
Isn't this like https://en.wikipedia.org/wiki/Uniqueness_type?
>>53646281
>it's that you can make types that ensure that there's exactly one point at any given time where a piece of memory can be mutated OR many points where it can only be read
Those are useless when writing an OS.
>>53646307
Yes, I did, but I didn't really understand it, I had just copied the code.
>>53646336
Yeah, uniqueness types are a bit weaker though because you can implicitly "drop" a unique variable.
>>53646337
I don't know about that.
>>53646367
What do you mean by drop? Just stop using it?
>>53646356
these might help
https://www.youtube.com/watch?v=IyUgHPs86XM
simonstechblog.blogspot.com/2011/12/microfacet-brdf.html
>>53646384
You don't use it and it's destructed. Fine in most cases for issues of memory management and ownership, but certainly not for modeling effects (you don't want to drop the world!) or what are called "borrowed references" in Rust (they're truly linear while objects are only affine).
>>53646367
>I don't know about that.
>In the linear system, each operation that introduces (and allocates) a value is paired with exactly one operation that eliminates (and deallocates) that value.
>Hence, after an application the storage occupied by the function may be reclaimed, and after a case analysis the storage occupied by the node analysed may be reclaimed. No reference counting or garbage collection is required.
There is no storage to be "reclaimed" in an OS. There are just addresses in a finite state machine. All of the storage already exists.
I spent two days getting reddit set up on a server (it would've been way easier if I wasn't such a retard), thinking I could jump into the source code, make a bunch of contributions and become a super programmer, but now that I have it working, I'm stuck. My laziness is kicking in again, and I'm not quite sure what the fuck to do.
I want to be able to get a programming job by the middle of the year, but I'm stuck in this mediocre gross NEET purgatory. I'm also trying to work on a command line email client, but that's not going very well either. I'm having a hard time getting into the GMail API (I need to figure out how to "agnostically" access it, like with just OAuth and the standard Python imap/smtp libraries).
My life is hell.
>>53646430
Yes, but you need some way to know that the storage is safe to reclaim in the first place. God forbid you suggest using a garbage collector for that.
>>53646440
>I spent two days getting reddit set up on a server
That's definitely a bad sign. It should take an hour tops. (unless it has changed dramatically since the last time I contributed.)
> I'm also trying to work on a command line email client, but that's not going very well either. I'm having a hard time getting into the GMail API
You're a lost cause as far as getting a job this summer.
>My life is hell.
Try working 8 hours a day
public class Base64 {
private final String[] CHARS = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"};
private String plaintext;
public Base64(String p) {
plaintext = p;
}
public void pad() {
while (plaintext.length() % 3 != 0)
plaintext += 0;
}
public String encrypt() {
String output = "";
for (int i = 0; i < plaintext.length(); i += 3) {
output += CHARS[plaintext.charAt(i) >> 2];
output += CHARS[((plaintext.charAt(i + 1) & 0x00F0) >> 4) | ((plaintext.charAt(i) & 0x0003) << 4)];
output += CHARS[((plaintext.charAt(i + 1) & 0x000F) << 2) | ((plaintext.charAt(i) & 0x00C0) >> 6)];
output += CHARS[plaintext.charAt(i + 2) & 0x003F];
}
return output;
}
}
how likely am I getting hired?
Do any of you guys code for a living without a degree? Just wondering if it's possible. I don't care if I won't get paid much--I just want to get a foot in the door and earn a livable wage and go to school later on.
>>53646529
>base64
>encrypt()
>>53646531
No, but I had an internship at a coding company a while ago and I can confirm that you don't necessarily need a degree if you're good. Met quite a few people who didn't have one.
greetings senpaitachi, I was logged into the ol' 4chan yesterday and I posted some code and asked for a critique and some nice anon posted his superior implementation.
Prompt:You are given a string s composed of letters and numbers, which was compressed with some algorithm. Every letter in s is followed by a number (possibly with leading zeros), which represents the number of times this letter occurs consecutively. For example, "aaaaaaaabbbbbbcc" would be given as "a8b6c2".
Decompress s, sort its letters and return the kth (1-based) letter of the obtained string.
Here's my code:def Expand_It(s, k):
import re
length = 0
count = 0
s = filter(None, (re.split('(\d+)', s))) # parse s, store as list, remove empty strings with filter
t = {}
for i in range(0, len(s), 2): # consolidate s into dict, {letter:count}
if s[i] not in t:
t[s[i]] = int(s[i+1])
else:
t[s[i]] += int(s[i+1])
for key in sorted(t):
length += t[key] # calculate total decompressed length
if count < k:
count += int(t[key])
letter = key # keep track of letter at position 'k'
else:
break
if k > length:
return -1
else:
return letter
Here's his implementation:import re
from collections import defaultdict
def decompress(s, k):
partsList = re.split('(\d+)', s)
#print partsList
letters = defaultdict(int)
for letter, number in zip(partsList[::2], partsList[1::2]):
letters[letter] += int(number)
result = ''
for letter in sorted(letters.keys()):
result += letter * letters[letter]
#print result
return result[k-1]
basically, I wrote my implementation the way that I did because that is the limit of my knowledge right now. Can anyone explain what's going on in anon's implementation for me, tell me what I should look up/learn, etc.? I'd appreciate it
>>53643662
What course is this in the screencap?
>>53646695
Looks like an intro to programming in Java course. Recursion and Data Structures are usually covered in a A&DS class.
Java and C# and dynamically typed languages should be illegal
>>53646910
>muh algorithms
>muh data structures
>>53646926
No one gives a fuck about your opinions.
Any data scientists here?
>>53646984
Data scientist is code for excel monkey
>>53646932
Learn to only post when your post isn't shit.
Other day I was trying to finding a software for joining images so I could post a series of screenshots as only one image, but I couldn't find any. Then, I making my own. Is there demand for that or it's something seldom people use? If there is, I could post it on the store.
>>53647086
i'm pretty sure you can do that in one imagemagick command
>>53647007
Because spouting your retarded subjective opinions is such a contributing post. Fuck off back to your anime where you belong.
Working on a meme form. Basically a Windows form application written in C# full of the edgiest things.
I'm bored as fuck. Kill me.
If I know opengl v3+, can I write webgl, or is it just a pile of shit?
>>53646993
Who would do this shit in excel?
>With 4 moves per stone, the branching factor could be well over 100!
What did he mean by this?
Did he mean the factorial or was he getting excited because 100 is a large number?
WHICH IS IT?
Fuck that notation
>writing documentation
fuck everything
>>53647258
For what?
>>53647102
Windows Phone user. Only things I found are for making collages and other limiting stuff with weird borders and no control.
>>53647274
write an app that uses imagemagick
just realize that literally nobody but you will install your app
>>53647263
classified atm
>>53647288
Come on, Anon. I can keep a secret. You don't need to go into detail.
>>53646660import re #import regex
s = "a2b3c2a1" #here be a string
r = "" #holder thing
i = 6 #Target index
l = re.split('(\d+)', s) #split string into list
l.pop() #there'll be a blank at the end, remove that
for i in range(0, len(l), 2): #increment by 2
for j in range(0, int(l[i+1])): #Repeat operation by number of times specified in string
r += l[i] #add letters to result
r = ''.join(sorted(r)) #Sort that shit and smash it all together
print(r[i-1]) #print result
This is a similar version with comments. In his version anon is basically using a dict instead of sorting.
>>53646453
I think garbage collection in OSes is the future. Desktop OSes already have enough things that aren't real-time that they might as well have GC.
Intel, Xerox, Symbolics, Bell Labs, and Microsoft (still experimental) have all built computers or OSes that use a GC, and garbage collected languages like Smalltalk, Java, Haskell, Oberon, Cedar, Algol 68, and Lisp each had at least a couple OSes.
>>53643078
>Shrtnme
That's not how us C faggots name things fucktard.
We name them like_this
>>53647116
Nice temper tantrum, kid
>>53647470
>strcat
>atoi
>malloc
if your function name is longer than 6 characters that's bloat
>>53647488
Says the kid who needs to have his opinions heard from afar.
>>53647422
>using the variable name "i" twice with overlapping scope
>>53647434
>I think garbage collection in OSes is the future.
Linear types enable the guarantees of GC without the overhead.
The core problem is: how do we prevent unreachable leaked memory, and how do we prevent dangling pointers from being used?
A GC modifies the run time semantics to make the concept of a dangling pointer or truly unreachable (from the GC's perspective) memory absurdity.
Linear types modify the type checker to make the program not compile if it's not provably respecting these laws.
I don't know about you, but I'd rather my OS doesn't fritter away all of my hardware resources.
>>53647525
Yes. Now please, keep on crying.
>>53643652
std::thread is typically using pthreads under the hood. Even on Windows with MinGW-w64, winpthreads is used.
In python 3 how do I check for duplicates?
>>53647675
duplicates.check()
>>53647675import duplicates
>>53647814
>>53647783
it says there's no module called duplicates
Just met N.J Sloane. Talked about an integer sequence I was studying (he didn't seem too interested) and working with Aho. unfortunately I missed the lecture, I'm not CS and wasn't informed.
>>53647876
import module.
>>53647876
>joke
>your head
>>53647900
>joke
>your head
>me & ur mum
>>53647917
>joke
>your head
>me & ur mum
>python
Ask your favorite programming literate anything (IAMA).
>>53642808
>What are you working on /g/?
r/dailyprogrammer #237 [Intermediate].
made an one pass, streamable, solution.
>>53647604
>Even on Windows with MinGW-w64, winpthreads is used.
there are two distributions of MinGW-w64, one that uses pthread and one that uses winapi.
>>53647675
you could automatically avoid duplicates by using a set objectIn [1]: set([1, 1, 2, 1, 3, 2, 3, 4, 4])
Out[1]: {1, 2, 3, 4}
>>53647936
I'm seriously depressed every single time I see you post because I realize you still haven't offed yourself. My birthday is coming up in August, do me this solid.
>>53647936
And I'm pretty sure winpthreads is using the WinAPI behind the scenes.
>>53647936
For my program I need to have the user enter a list, then the program has to spit back the list with all the duplicates removed. When I use set it gives everything in a jumbled order
>>53647884
Turns out the sequence I was studying he had already characterized.
>>53647936
>you could automatically avoid duplicates by using a set object
>>53647675
Alternatively, if you simply want to detect them:
all(map(lambda x: x > 1, collections.Counter(seq).values()))
>>53647983set(list).sort()
>>53647986
hurrrrr, I'm dumbmax(Counter(seq).values()) > 1
>>53648002
He probably means he wants to remove duplicates, and preserve order. Probably remove all but the first occurence.
>>53648044
yeah that's what I mean
>>53648044
>>53648055
sorry bud, using prefab libraries and built in meme functions is all python ""should"" be used for
>>53647675import doyourownhomeworkfag
>>53648055
Well think about it. Iterate through the list and if a value has been encountered before, remove it. Or doesn't that make sense?
>>53644961
None. Always use versioned python command, so either python2 or python3. Don't assume that default python implementation on any computer is the same you use.
>>53648125
What did I miss?
>>53648132
>remove vowels from "treehouse"
>trhuse
Whoops, didn't mean to quote. I am ashamed.
>>53647952
Please, don't bully.
>>53647978
yes, you can't bypass winapi on windows since microsoft never documented the system calls.
>>53647983
>>53648044
set(list) preserves the order and a set object doesn't have a sorting operation. if you want a sorted set, you must pass a already sorted list.l.sort() # in place
foo = set(l)
How do I become Payet?
>>53648125
>modifying string as you iterate over it.
Lol?
>>53646984
machine learning and data scientist, wo bist hier.
>>53648177
with a normal for loop it would be fine
>>53648164
https://www.microsoft.com/en-us/learning/mcsd-certification.aspx
>>53647422
this solution sucks, what happens when the string is like
a500000000000000b9999999999999c9999999999999999
you run out of memory even on modern systems
>>53646695
>>53646910
Yeah, definitely intro to Java. I believe the book is "Starting out with Java: Early Objects"
Trying to make a REST API in node.js using express and mongodb (mongoose ORM), to make a task planner. After that, use React to create a front-end for it and maybe react native to make an Android app.
It was tough making the switch from PHP, but I'm glad I did it. PHP feels very oldschool now.
Does anyone have a good tutorial on how to use React? Preferably how to integrate it with a REST interface.
>>53648179
I want to start with those, do you've any resources to start with?
>>53644055
I program Java, for Java SE i recommend Eclipse, for EE also Eclipse, if doing Android then IntelliJ
Skip OpenJDK, its a meme
>>53648249
>node.js
do not use node until the dust settles or you will be exposing yourself - see
>>53645363
>>53648157
You could feasibly reverse engineer Kernel32.dll and such, but they could change the system calls between Windows versions and just update Kernel32.dll to use the new system calls.
>>53642808
Kendo fucking motherfucking cocksucking grid
>>53648249
vertx > nodejs
>>53648293
dont use vertx either, or any project that uses npm for dependency management.
>>53648185
How so? It doesn't check for the length of string every iteration, only at the start. Unless you mean normal, non-python for.
>>53648271
Sure: http://www-bcf.usc.edu/~gareth/ISL/
And pic related are grear for starting. There's a book on pattern recognition and image analysis that also has good explanations, but it's old and I can't find it.
>>53648318
i've used vertx, but i've never used npm so it's possible to use vertx without it
>>53648342
>Unless you mean normal, non-python for.
yes, for(pre; cond; post)
>>53648249
please kind sir, i would suggest that you fuck off to >>>/g/wdg
>>53648281
Somebody got schooled for using a corporate name in his package and being kind of a dick in mails. Had he been polite to the Kik team, this wouldn't have happened.
Having said that, this doesn't link to any known security exploits.
>>53648293
>Java
>ever
lol
>>53648423
Yeah I noticed, sorry, reposted it there.
>>53648461
java >>> js
Can someone help me get my code to compile whenever I delete System.out.println(....) in the below code?
public class AccessList {
public static void main(String[] args) {
System.out.println(access(new int[] {},20));
}
public static String access(int[] rights, int minPermission){
String s = "";
if (rights.length == 0){
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++){
if(rights[i]<minPermission){
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
That compiles ^ but whenever I try to remove system.out.println it gets fuzzy and I have no idea what to do.
I want to get this code to compile:
public class AccessList {
public static void main(String[] args) {
public static String access(int[] rights, int minPermission){
String s = "";
if (rights.length == 0){
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++){
if(rights[i]<minPermission){
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
}
Can someone help?
>>53648405
Seems that the situation is more of an issue of mutable objects being shitty instead of Python's for being a bad idea.
If someone could make Python, that isn't slow as shit, with immutable objects, stackful generators and a nice (dynamic) type system it would be one of the most perfect languages to work in.
>>53648461
Kik told him to rename his package. He said no.
They went to NPM. NPM then took ownership of the package and renamed it.
The developer was rightly pissed, and pulled all his packages from NPM. Then NPM decided to put them back because he'd pulled their pants down.
Basically NPM are corporate dick suckers. Also Kik is fucking shit and has ruined Omegle.
I'm trying to make a program in C that will run through a text file and copy each word and and a "1" to the end of it. There's only one word per line, this is for editing a word-list. I could use the sed command, but i'd like to do it using C. I think I'm close because the code I have reads the first word in the file then adds a "1" to the end and quits after that, and I cannot figure out why. Can anyone help point me in the right direction? Below is the code for what I've got so far... It's supposed to read until the end of the file, but stops after the first newline (10).#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
FILE *fHandle;
char filename[64];
char newString[64];
int ch;
printf("Enter file name: ");
scanf("%s", filename);
fHandle = fopen(filename, "a+");
if(!fHandle) {
printf("Failed to open < %s >!\n", filename);
exit(0);
}
while((ch = fgetc(fHandle)) != EOF) {
if(ch != 10) {
newString[x] = ch;
x++;
} else {
newString[x] = '1';
newString[x + 1] = '\0';
fprintf(fHandle,"%s\n", newString);
x = 0;
}
}
fclose(fHandle);
puts("Operation Complete");
return(0);
}
>>53648494
Mind your brackets. You are getting rid of one you need. Also[ code ] [ /code ]tags. Use them.
>>53648522
How do you paste your code like that?
Which version of C should I learn?
Also, since I'm new, I want to learn Python first cause I've heard its a good starting language. What's so good about it?
>>53648522
Why not just use fgets(line, sizeof(line), fp) and append a 1 to the end based on strlen if there's only one word per line?
>>53648547
[ code ] [ / code ]
Read sticky
>>53648546
Thanks, I'm getting frustrated and don't see the bracket issue. Can you help me spot it? I'm a novice.
public class AccessList {
public static void main(String[] args) {
public static String access(int[] rights, int minPermission){
String s = "";
if (rights.length == 0){
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++){
if(rights[i]<minPermission){
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
}
>>53648548
C99
Don't learn Python, there is nothing good about it
>>53648547
put it between "" and "" without the quotes.
>>53648548
python is high level, you can do useful things in fewer lines compared to c
in c you'll spend a lot of lines of code on memory management and having to write functions that included in python
>>53648548
>Version of C
Like C standard? C11, or ANSI if you are going to be writing for corporate entities, they usually don't ever use C standards past 89 because the only people who know C well are old as fuck.
>>53648575
>public static void main(String[] args) {
>>53648498
See the following article:
https://medium.com/@mproberts/a-discussion-about-the-breaking-of-the-internet-3d4d2a83aa4d#.m3uzsfg12
Kik asked Azer politely if he could rename his package, and Azer probably was legally complied to do so. I'm not a lawyer so I'm not sure.
If I were Azer, I'd keep in mind that I'm talking to a great corporation with expensive lawyers.
>hahah, you’re actually being a dick. so, fuck you. don’t e-mail me back.
>Yeah, you can buy it for $30.000 for the hassle of giving up with my pet project for bunch of corporate dicks
Even the autists over at >>>/r9k/ could write better emails. The simple fact is that if you as a powerful person (patent guy over at an enormous company) get mails like this from, well, just a programmer, you start acting like a dick.
Had Azer been polite about it, maybe he stood a chance.
Note that I agree that it's a dick move of npm, I just don't pity Azer since he was a real dick to Kik as well.
>>53648594
You can do more in less with Haskell, and the compiler won't let you be sloppy.
>>53648522
>Writing and reading from the same file, at the same time
I don't think that's going to work how you want it to.
>>53648611
yeah but you don't need a phd in quantum physics to write python
>>53648607
>Kik asked Azer politely
Nope. They said "rename your package or we get lawyers involved".
Fuck kik. I hope one of the other companies named kik fucks them in the ass.
>>53648522
>ch != 10
What is this supposed to do? Why are you doing it?
>return(0);
Why the parens here?
>a+
>fprintf(fHandle
Why?
>newString[x] = ch;
>x++;
You could just write newString[x++]
>printf("Enter file name: ");
Take it as an argument from main.
Here is my suggestion, dowhile((ch = fgetc(fHandle)) != EOF)
if (ch == '\n')
puts ("1");
else
putchar (ch);
>exit(0);
0 is for success, and since you are in main use return EXIT_FAILURE (from stdlib.h).
>>53648568
If he used fgetc correctly it would have been better use than fgets as he would not need buffers.
>>53648548
If you want to learn a good beginner's language consider Scheme while reading SICP.
As for C, the differences between versions are minor.
>>53648381
Many thanks. I'm going to check them out. Also, for the record, what languages do you use in a daily basis to work with ML and data analysis?
>>53648636
You don't need one to write Haskell either. Please stop spreading FUD.
>>53646249
not sure if this is chrome related, but like 95% of applications that use WebGL for some 3D based component in a webpage, NEVER load or work.
"Oopse, WebGL hit a snag." Reload Ignore
After refreshing several times it still doesn't work, only once in a blue moon will it actually load and display correctly. So while the language might not be so bad, its support on modern webrowsers is still spotty at best.
>>53648603
I tried to match all my brackets, shit still isn't compiling... what am I missing?public class AccessList {
public static void main(String[] args){
public static String access(int[] rights, int minPermission){
String s = "";
if (rights.length == 0){
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++){
if(rights[i]<minPermission){
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
}
>>53648603
>ANSI
C11 is an ANSI standard.
>>53648636
It's funny you say that because some guys at my university actually developed a Haskell library (EDSL style) for quantum programming.
>>53648679
You're defining access inside of main.
>>53648635
I think you're right anon, reading and writing the same file simultaneously has failed trying multiple methods. I think i'll read the file in output the updated strings/lines to a new text file entirely.
>>53648652
No, they didn't. Read more carefully.
They had a trademark to protect, and [I'm guessing] could have just as easily sued his ass. Instead, they were politely asking if they could reach an agreement.
Azer could have taken the chance to politely ask for a sum of money for the namespace for example.
He could also have explained that confusion will rise ifnpm install -g kiksuddenly does something different.
Instead, he replies "haha ur dicks xD is my project hurr durr". Then people with power got angry and started to be real dicks, skipping the agreement.
He was acting very childish and that's a fact.
Apology for bad English.
I need help with Java threading, my friends. I am writing a simple Server/Client application, it works with one Client, but not with several Clients. I think I need to use Threads, but i'm not sure how to implement it.
Let's say I have this code:
ServerSocket server = new ServerSocket(50000);
Socket accepter = server.accept();
How do i use threads here?
I was thinking of having the class extend Thread and then putting the last line into a run() method and calling it within the constructor, but in all examples i look at it, it seems like Threads require calling a new object, and not just a single method.
>>53648659
Python(pandas, numpy, scikit, Theano), C++ for muh gpu and deep learning, and MATLAB when I get free sponsored licenses.
@53648461
@53648607
@53648731
Kik(e) shill please go.
>>53648679
Jesus dude it's not hard to properly format code.public class AccessList {
public static void main(String[] args) {
public static String access(int[] rights, int minPermission) {
String s = "";
if (rights.length == 0) {
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++) {
if(rights[i]<minPermission) {
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
}
>>53648703 and this I guess.
>>53648495
nice meme
with immutable objects you'd still have to remove the vowels somehow, you'd get the same end result, it's just a different way of thinking about it
>>53648700
No, it's ISO. C89 is the only ANSI C standard.
>>53648775
>C89 is the only ANSI C standard.
C89 is the only C standard.
>FTFY
>>53648770
Recursion is the only sensible way to work continuously over data that you're mutating.
>>53648731
Nope. kik were acting childish. The name was already taken, they should have chosen a different one for their package.
They wouldn't have been able to sue him and win. He wasn't infringing their trademark. They were just trying to bully him out of it, and when that failed, they went over his head and (successfully) bullied npm.
>>53648703
what should I do instead? I am new to java and getting fustrated.
My original code invokes a method call to access, with specific input parameters to test the correctness of the program. Now I know the logic works and want to remove that. But I don't know how. What should I do? I'm using another program that feeds this program various inputs and calls the methods inside my program to test against the outputs.
Here is my oroginal codepublic class AccessList {
public static void main(String[] args){
System.out.println(access(new int[] {},20));
}
public static String access(int[] rights, int minPermission){
String s = "";
if (rights.length == 0){
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++){
if(rights[i]<minPermission){
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
>>53648738
second example on this page
http://www.oracle.com/technetwork/java/socket-140484.html#
>>53643570
>Haskell
Funk it.
Just learn C
>>53648775
>INCITS/ISO/IEC 9899-2011[2012]
>Adopted by INCITS (InterNational Committee for Information Technology Standards) as an American National Standard.
>Date of ANSI Approval: 5/23/2012
>Published by American National Standards Institute,
BTFO
>>53648786
Only K&R C is C.
>>53648795
You can remove lines 2-4 i.e. the definition of main. Your other program can continue to use the access method of AccessList. (I think that's what you want?)
>>53648792
Yeah and I agree that it's bad that Kik did that.
But Azer shouldn't write emails like that, no matter the circumstances. It gives you an awful name and it's very childish.
>>53643593
How are you enjoying your PI 3 ?
>>53648830
No.
>>53648770
>you'd still have to remove the vowels somehow
remove them normally?
>for i in string
the string is a reference to data that is kept immutable during the for operation.
>string.remove
you are updating the reference string to point to new data that is the previous data updated.
At the end of the operation the 'string' data used in the for loop is not referenced by any variable and it collected.
Additionally, you can make string.removes mutable if there is only one reference to the data pointed to by 'string'.
Immutability is possible and unless you do something particularly stupid, not a performance drain in a well designed language.
>>53648833
He's not obliged to be polite to people trying to screw him out of something.
Colorful and abrasive words are a part of our rich and expressive language, and should be used with full fervor when appropriate.
>>53648831
Basically I have another program feeding this program various input cases, and it calls my program to do the computation with those inputs and test for correctness on the output (thats how they test if our code works correctly).
Whenever I delete lines 2-4 it gives me an error saying I need a mainpublic class AccessList {
public static String access(int[] rights, int minPermission){
String s = "";
if (rights.length == 0){
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++){
if(rights[i]<minPermission){
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
I can't get this fucking shit to compile
>>53648885
Yes.
>>53648756
Fair enough. Thank you for lend me your time, anon!
>>53644180
>too cpu intensive
VIM + javac
>>53648208
Nigga read the assignment description.
>>53647529
I knew I'd do that, side effect of programming while in a meeting.
>>53648812
It took some digging, but it looks like it is. Seems like this is something Wikipedia would have up on their page.
>>53648797
Thank you
>>53648652
Kik is actually the name of a clothing store brand in my country, it's been around for many many years, and it's infamous as a clothing store for poor people, so everyone makes fun of it.
>>53648905
if you're trying to run AccessList.java you need a main
if you're running SomethingElse.java which uses AccessList you need a main in SomethingElse.java but not in AccessList.java
i'm looking at this and i'm a little confused. is it assuming that the solution for every length is already solved before you do anything?
package DynamicProgramming;
public class RodCutting {
public static int profitDP(int[] value, int length) {
int[] solution = new int[length + 1];
solution[0] = 0;
for (int i = 1; i <= length; i++) {
int max = -1;
for (int j = 0; j < i; j++) {
max = Math.max(max, value[j] + solution[i - (j + 1)]);
solution[i] = max;
}
}
return solution[length];
}
public static void main(String[] args) {
int[] value = { 2, 3, 7, 8, 9 };
int len = 5;
System.out.println("Max profit for length is " + len + ":"
+ profitDP(value, len));
}
}
>>53648905
Oh - you're trying to call it from another process?
I think I understand now. Put those lines back in. You will need to get the input parameters from the args variable, which is an array of the strings passed to the program on the command line.
For example, if you runjava AccessList a b c
Then args will contain "a", "b", and "c".
>>53644412
This is a fucking good book
>>53644813
Should be called the right way.
>>53648969
Okay, I need a main. How do I correct the code to take any input and then produce the output? What I have now is testing a specific parameter.
This shit compiles but it's on a specific input.public class AccessList {
public static void main(String[] args){
System.out.println(mayAccess(new int[] {},20));
}
public static String mayAccess(int[] rights, int minPermission){
String s = "";
if (rights.length == 0){
return s;
} else if (rights.length > 0) {
for (int i=0; i<rights.length; i++){
if(rights[i]<minPermission){
s= s+"D";
} else {
s=s+"A";
}
}
}
return s;
}
}
I want something more general to allow the tester to feed it input.
something likepublic class AccessList {
public String mayAccess(int[] rights, int minPermission) {
// fill in code here
}
}
But I don't know what to do and it's pissing me off. This is one of my first java programs.
>>53648984
No, it's shit.
>>53648969
Actually I don't think I need a main here. So how do I re-write the code?
My original quesiton is here:
>>53649031
these cryptic notations/variable names are driving me crazy
>>53648978
I hate those unaligned accesses to memory LMAO
>>53649031
https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html
http://stackoverflow.com/questions/11871520/how-can-i-read-input-from-the-console-using-the-scanner-class-in-java
>>53648978
it's solving it in the nested for loop
>>53642808
Where's the new thread?
>>53649097
>Anonymous 03/23/16(Wed)18:33:14 No.53649097 â–¶
>>>53649031 (You)
>https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html
>http://stackoverflow.com/questions/11871520/how-can-i-read-input-from-the-console-using-the-scanner-class-in-java
thanks
NEW THREAD!!
>>53649121
>>53649121
>>53649115
Bump limit is 320
>>53649115
>>53649126
Thanks.
>>53649130
Oh. Didn't know that. It was 300 the last time I was more active here.
>>53649130
310
>>53648786
Kill yourself. C99 and C11 (especially C99) add shitloads of nice features that makes the language MUCH nicer to write in, while still being true to the "C spirit".#include <stdio.h>
int main()
{
int a;
puts("Hello World!");
int b;
}
>That code is invalid C89
>>53649078
Either they're just placeholders for angles like the thetas/phis or they're defined elsewhere in the paper. Omega looks to be the incoming/outgoing light directions.
>>53649111
so what's actually inside the solution array? is it just the value of the maximum profit for a given length of rod, or does it actually tell you how to chop it up? the website i got this from doesn't say http://algorithms.tutorialhorizon.com/dynamic-programming-rod-cutting-problem/
>>53649130
seriously?? since when
>>53649168
This week, don't know which day exactly.
>>53649160
Moreover, they add restricted pointers which helping compilers with vectorization. Although C99 adds it, I think C11 makes it standard
>>53649162
i figured out what they meant. instead of using dot(N,V) and dot(N,L) they use H=normalize(V+L) and dot(N,H)
this is some pretty deep shit if you're no good at math but i find it interesting and useful
>>53649160
What exactly is invalid about this?
>>53649234
All declarations MUST appear at the top of a block in C89.
>>53649130
>>53649198
https://api.4chan.org/boards.json suggests otherwise
>>53649275
well we're only on page 4 at 330, page 2 at 320
>>53649275
Clear your cache.
>>53649249
well yeah, why would you declare a variable without using it?
>>53649295
So? /g/ isn't ridiculously fast, so threads won't be pushed down the board that quickly.
>>53649320
My example was contrived. There are lots of situations where you want to declare variables after you've already run some code. Also, it makes sense to declare variables where they're needed, not front-loading all of it.
>>53646231
I hate these fuking c#
>>53646531
>>53646609
So I had a workmate that use to write the worse code that I and my other workmates ever seen. He had no ideia about what he was doing. But he thought he knows more than anyone.
If you are going to learn by yourself, please learn the base. Don't just get some way to get it done. Learn and understand what you are doing.
>>53649249
>All declarations MUST appear at the top of a block in C89.
And that's a sane design choice.
>>53646695
It's from the book in my image.
>>53650168
How are you liking this book ?
>>53650168
big yava
early yobyects.
>>53645858
>>53645815
>>53645973
>remember playing with dolls
>Realize that I have been a degenerate since I was a kid
I also remember playing sims and people being confused of why I had a female avatar. I just couldn't resist the lewdnes of seeing her take a shower
>mfw discovering how to stay naked through costumes
/blog
>>53650212
It's alright, I think it helped me understand the basics in the first 7 chapters but after that you kind of need to start reaching out on your own and supplementing. If anything the programming questions always give me something to do, my biggest issue was finding some work I could do to implement what I'm learning and this book does that.
>>53650309
>friends ask me why I use the female pokemon character
>>53648938
>Nigga read the assignment description.
I guess your answer works given that, but the test cases on the site where this came from required huge numbers (>251)
>>53649600
any recommendations?
>>53650168
thanks dude, do you have a link to a torrent or anything?
>>53650789
It can be found easily on the pirateship
>>53650416
I suggest you to keep yourself more about to deep learn OOP than Java.
Java is a great language to program OOP.
But if you don't really understand it, you might end making a shit code.
>>53650819
>I suggest you to keep yourself more about to deep learn OOP than Java.
What?
>Java is a great language to program OOP. But if you don't really understand it, you might end making a shit code.
Any book recommendations for this? I am sticking to Java since I probably know it the most out of any other language.
>>53650802
ok thanks comrade
>>53650448
HOW DOES HE DRINK FROM THE CUP?
>>53651260
He doesn't.
>>53650853
effective java, 2nd editon