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

/fdpt/ - Friendly 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: 344
Thread images: 32

File: 1408701369469.jpg (276KB, 800x499px) Image search: [Google]
1408701369469.jpg
276KB, 800x499px
What are you working on?

*** Please keep your language war faggotry in >>59317445, notice the "Friendly" in every Friendly Daily Programming Thread ***
>>
>using that shitty thread's name
Trash.
Dropped.
Fuck off back to some other website.
>>
>>59317533
Rust is better than Cancer
>>
>>59317580
>>59317610
>Rust
Lel. It's fucking shit.
>>
>>59317610
i'm waiting for aliens to land
>>
I'm trying to implement a very generic finite element method solver in C++. So far it works well for 1D order 1 and 2 elliptic PDEs and supports 2D geometry and assembling. Design is inspired from Fenics except I use Eigen as the back-end and the interface is C++. I'll post some screenshots/samples when I get my exporter done.
>>
>>59317636
>C++
Fuck off, kid.
>>
yet another neural network/genetic algorithm/box2d thing, in Lua. might make a video about it if it turns out well.
>>
>>59317704
>friendly thread
What is your major malfunction numbnuts? Didn't mommy and daddy show you enough attention when you were a child? You like the kind of boy who could suck a golf ball through a garden hose.
>>
>>59317715
>Lua
This is a programming thread, you retard. Leave your pleb bullshit somewhere else.
>>
>>59317770
>This is a programming thread
no it's not
>>
>>59317770
is lua shit because it's easy to use? sorry, didn't know. i'll stop using it :^)
>>
File: 9204550.jpg (16KB, 400x400px) Image search: [Google]
9204550.jpg
16KB, 400x400px
>>59317569
>>59317580
>>59317624
>>59317704
>>59317770

Never change /g/, never change.
>>
>>59317848
>/g/
it's just one faggot
>>
File: off to a good start.png (176KB, 1857x849px) Image search: [Google]
off to a good start.png
176KB, 1857x849px
"Friendly" might be a poorly-chosen wording. Maybe make it "strict" or something else I don't know. I don't mind people being highly critical of other's inputs or questions, but clearly maybe 10% of /dpt/'s posts don't violate GR6.
>>
>>59317832
it's not even a language. please leave, retard
>>
>>59317930
Yeah, trying to control what people may or may not do on a fine-grain level always end well.
>>
>>59317952
do you have any actual arguments? i would love to talk about it.
>>
>>59318005
yes, my argument is - you should fuck off back to plebbit
>>
>>59318011
dude sorry but you need to update your vernacular, it's not 2013 anymore. the only people that still actually talk like you are people who go on r/4chan
>>
is mayonnaise a programming language
>>
>>59318041
if you can use it to communicate instructions to a machine
>>
>>59318034
>r/4chan
it seems like i was correct.
why would a non-redditor know how "people" talk there?
>>
>>59317580
>Cancer
Is C too hard for your little retarded brain? Yeah, that's understandable.
>>
>>59318099
why would someone in 2017 think bitching about redditors is relevant? all of your posts scream desperation to fit in. just post a little less until you "get" the groove of this board, then we'll accept you :)
>>
Im trying to make a 3d rotating cube
In MIPS
>>
>>59318201
>MIPS
Is that for an embedded project with a display or are you using an emulated OS.
>>
>>59318187
bitching about subhumans like yourself is always relevant. since they are the price we (humanity) have to pay to remain human.
>>
>>59318201
Good. At least you aren't a mentally deficient pleb like the rest of this thread
>>
>>59318220
>subhumans
you're taking the internet a little too seriously, it's seriously not healthy. you should go for a walk and reprioritize anon
>>
>>59318219
Im currently using an IDE with bitmap emulation
If it works, it can be used in real hardware
>>
>>59318256
it's a battle of sorts between "light" and "dark". someone who displays redditor traits will always be a subhuman and I will always be opposed to them. it's in our nature.
of course in the future these traits will be called something different, but it wouldn't change the essence of them since they predate our species.
>>
>>59318300
anyone who expresses actual loyalty to 4chan has either spent almost no time here or way too much. is this really what you want to do with your time? 4chan is shit and it always will be, it doesn't need people to "defend" it
>>
>>59318120
nah, I just finished Pointers on C actually, which was great. now i can
int*(*(*(*fizzbuzz)())[666])();
all day. also dont give much fucks about rust since nothing im interested in uses it. but you suck dick for biting that bait anyway and calling me retard for nothing, so fuck off. and if you cant read my fizzbuzz or use cdecl, fuck you
>>
File: spiral.jpg (20KB, 644x183px) Image search: [Google]
spiral.jpg
20KB, 644x183px
how would you solve this?
>>
>>59318367
Without having thought too much about it, I'd implement it like a sort of game of snake. Basically store the direction and how far you've moved so far. Then at each step give the case the head of the snake is on the number.
>>
>>59318396
But the number of travels is different, first 4 steps, next time , then again 3
>>
>>59318359
It's just an autist, just point and laugh
>>
>>59318359
>anyone who expresses actual loyalty to 4chan
i don't know why you think this has anything to do with 4chan.
what i'm talking about predates the internet so there isn't any real way my loyalty would be to either 4chan or any other imageboard.
>4chan is shit and it always will be
correct.
>it doesn't need people to "defend" it
we are currently on the offensive. we've been defending for far too long. as you can see the current state of the world reflects this quite well.
>>
File: pic.png (36KB, 640x400px) Image search: [Google]
pic.png
36KB, 640x400px
>>59318409
Basically start with the outer layer. Iterate once by doing the whole thing in red. Then reposition on the layer under (cyan) and proceed again. This could even be done recursively.
>>
>>59318367
>ignoring my answer (>>59316764)
Why are you doing this? You're tearing me apart, anon.
>>
>>59318475 here.
>>59318622 is pretty much the 4x4 version of what I explained and drew, so it comforts me in thinking it's the most intuitive way to proceed.
You should try implementing it.
>>
>>59318367
recursively
>>
File: set-2.jpg (150KB, 1230x513px) Image search: [Google]
set-2.jpg
150KB, 1230x513px
>>59317533
OOP javascript
>>
>>59318802
That's the worst graphical representation of a loop I've ever seen.
>>
Posting in a gender neutral thred.
>>
>>59318802
Why is there that god-awful line between the iterations and why is one of the lines in between them straight and the other wavy? Could you possibly make it worse to look at?
>>
>>59318802
>>59318927
>OOP
Back to your subreddit.
>>
There is literally nothing wrong with being jewish
>>
I'm sending a lot of data from some lab equipment. There's 60 channels running at 40khz each, so a decent amount of data. Currently I'm sending everything over a single socket, would it be better to use multiple sockets in a threaded solution? For instance 12 sockets each sending data from 5 channels?

If it's not clear cut, how would you test each solution?
>>
>>59318419
>4chan culture
>>
>>59319055
First I would stop using plebbit spacing.
>>
>>59319055
No idea I've never done something like that but
>If it's not clear cut, how would you test each solution?
Are you sending your data to a single receiver or can you split it? Also I don't know about your equipment but maybe the outputting method isn't the bottleneck
>>
>>59319107
who are you quoting?
>>
do you guys participate in competitive shit like topcoder?
>>
>>59319121
>No idea I've never done something like that but
Of course, since you are probably a Python tier pleb.
>>
>>59319134
let's see.....
nope, i'm not an idiot like you. so no.
>>
>>59319055
>Homework help thread
How the hell do you think you would test every solution?
>>
>>59319183
Jesus fucking Christ. Get the fuck out of here you moron.
>>
>>59319183
No, I'm thinking more along the lines of different parameters such as fairness metrics rather than just raw throughput.

What the fuck kind of school did you go to where this would be homework? Come on dude...

>>59319111
>plebbit spacing
see pic
>>
>>59319238
>see pic
Learn to use this website properly, redditor.
>>
>>59319134
Only thing I do is online code challenges. The only competition is yourself.
>>
File: High Quality Chink Clinton.png (662KB, 1631x900px) Image search: [Google]
High Quality Chink Clinton.png
662KB, 1631x900px
>>59319238
Any engineering college, numbnuts.

>Any decent one

>>59319198
Nice b8, m8. I r8 8 out of 8.
>>
File: confused black man.jpg (5KB, 243x207px) Image search: [Google]
confused black man.jpg
5KB, 243x207px
>>59319247
ups, here
Now, are you gonna share some of your epic oldfag knowledge?
>>
>>59319153
I forgot that topcoder arena doesn't support rust
sorry man
>>
File: trals.jpg (60KB, 611x560px) Image search: [Google]
trals.jpg
60KB, 611x560px
>>59319287
I guess that's why it's mostly americans posting about computer science being a meme-degree if that's the case :^)
>>
>>59319333
>tfw pajeets can now use quantum booleans
>>
>>59319333
CS is a meme degree for pooloos and codemonkeys. :^)
>>
>Nice b8, m8. I r8 8 out of 8.
>epic
>:^)
What timeline is this?
>>
>>59319153
>>59319134
last time i heard a question like this, it boiled down to americans defending themselves by claiming they are too buzy making money to compete with ivans, vladimirs and jacky chans
>>
>>59319443
The one where Hitler did nothing wrong and reddit rules the world. What the fuck do you think?
>>
>>59319467
I just saw something very strange when I woke up .
>>
What is the appropriate Big O of this?

O(nlog(m) + 2m^2 + nm)


Is it:
O(m^2 + nm)
>>
>>59319358
Actually pajeets have been doing this for a long time, only with true, false and undefined in php.

>>59319421
haha that's really epic!
>>
Posting because this is the friendly thread


how do I implemetn the last case? I want to take the head of the list, drop the next n-1 elements and then call the function.
skip :: a -> [a] -> [a]
skip n l
| length l < n = []
| length l == n = head l
| otherwise = head l : skip.drop (n-1) l
>>
>>59319495
O(n^2)
>>
>>59319551
>leans into mic

Wrong.
>>
>>59319566
(nigger)log(nigger)
>>
>>59319566
I was just testing you
:^)

The real answer is O(m^2.7)
>>
>>59319612
>>59319620
get on my level

Here's a hint: [spoiler]There's two distinct inputs[/spoiler]
>>
>>59319551
what if m is O(n^3)
>>
>>59319134
my god why would anyone do that
how is crowd sourcing legal
pls dont waste your precious hours on that site
>>
>>59319641
breh, stop tipping your fedora and just fuckin tell us already

i know you've got a mad boner for melodrama but in truth nobody gives a fuck
>>
>>59319526
>FP garbage
Get the fuck out, retard.
>>
>>59319664
>breh
Is this some sort of new plebbit meme?
>>
File: fox-samantha-549037a833975.jpg (247KB, 1920x1080px) Image search: [Google]
fox-samantha-549037a833975.jpg
247KB, 1920x1080px
help help heeelp /g/ other thread go full shitpost

making some drawing program (lel).
When i clicked, little rectangle point must be the same location with grids intersection points. what should i add to code?

http://pastebin.com/BuTihxNW
>>
>>59319715
>still frightened of the 'other tribe' boogeyman

nice spooks you have there fampai
>>
>>59319719
Fuck off, your kind isn't welcome here.
>>
>>59319647
Then you're fired.
>>
>>59319495
Yes but it depends on your definition of multivariate big O. In this case it's quite unambiguous as there exists a constant c such that f(n,m) =< c*|m^2 + n*m| for big enough n and m.
>>
>>59319526
I'm not really sure what you're trying to achieve here, add input and expected output
>>
>>59319757

fugg
>>
>>59319756
What did i say wrong? ;_;
>>
>>59319744
>>59319784
These posts reek of plebbit.
>>
File: you.jpg (220KB, 600x324px) Image search: [Google]
you.jpg
220KB, 600x324px
>>59319798
takes one to know one
>>
>>59319772
Prelude> skip 4 [1,2..]
[1,5,9,13,

something like this
>>
>>59319798
>muh sekrit club

dunno how you've manage to maintain the delusion that 4chan is some kind of confidential haven of higher-taste, 13 years after launch

step it up
>>
>>59319810
so you're claiming that I have to be a dog to conclude that something is a dog?
>>59319827
>muh sekrit club
>dunno how you've manage to maintain the delusion that 4chan is some kind of confidential haven of higher-taste
who are you quoting, plebbitor?
>>
>>59319860
If it walks like a duck and quacks like a duck then it's most likely a duck.
>>
>>59319819
Is that fucking Husklell? How does [x,y, make any sense? Why isn't there a closing ']'? What a retarded language.
>>
File: High Quality Chink Shirt.png (299KB, 1565x775px) Image search: [Google]
High Quality Chink Shirt.png
299KB, 1565x775px
>>59319827
4chan is not 4chan without the delusion that it is not a bunch of NEET pedophiles arguing about inconsequential bullshit while fapping to My Little Pony and buying chickshit with their good boy points.
>>
>>59319877
correct. but how does a person pointing it out somehow make them a duck?
>>
>>59319819
You're gonna need a helper function

>>59319888
obviously the ']' should be there
>>
>>59319919
So why isn't it there then? What sort of meme language could allow this? Oh yeah, forgot. It's Husklel.
>>
>>59319888
>[x,y, make any sense? Why isn't there a closing ']'?
because the input is a fucking infinite list and I can't put the closing brackets on one, can I?
>>
>>59319938
I think he goes into an autistic fit whenever someone posts unclosed braces.

(
>>
>>59319929
>>59319888
>t. salty fag

that isn't even the output, the function isn't fucking working, how the fuck do you think it's giving an output? I fucking typed out the "Prelude> " and everything to show your retarded ass how my program should work even though there was a 90% complete function to which you responded initially.
>>
>>59319860
>who are you quoting, plebbitor

further proof that only outsiders are concerned with 'new and oldfags'

learn how the may may arrows work fampai and stop being so insecure
>>
 
int main(int argc, char *argv[])
{

HTMLRetrieve(argv, Filename);

}

int HTMLRetrieve(char *URL[], char Filename[])
{


Is something wrong here? argv is not passing to the function
>>
 Write a program, which finds the maximal sequence of increasing elements in an array arr[n]. It is not necessary the elements to be consecutively placed. E.g.: {9, 6, 2, 7, 4, 7, 6, 5, 8, 4} -> {2, 4, 6, 8}.


I don't even understand the question, can anyone explain?
>>
My favorite programming quote:
>Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious.
>-Fred Brooks

Shows how different and stupid programming is today. It's clearly not valid anymore, that's really bad.
>>
>>59319995
your brain is too infected by plebbit if you think that wasn't somehow me literally asking "Who are you quoting?"
>>
>>59319995
>may may
What is this, some reddit meme?
>>
>>59320011
It's pretty easy, compare two elements and if the first element is larger then comapre the next two.
If the first is smaller, store it in a list. Compare the next two with the last element in the list. add the smaller element to the list. Then compare the next two to the list and do this until the input list ends.
>>
>>59320063
and, yeah, the smaller element must be larger than the last element of the list.
>>
>>59320007
try changing char *URL[] to char *URL
>>
>>59320007
Do you get any error output? Also what additional content do you have in your functions? This works for me
anon@debian:~/dev$ cat test.c 
#include <stdio.h>

int f(char* args[]) {
printf("%s\n", args[0]);
return 2;
}

int main(int argc, char* argv[]) {
f(argv);
return 0;
}
anon@debian:~/dev$ ./a.out
./a.out
anon@debian:~/dev$
>>
>>59320189
>>59320193
never mind got it working
>>
File: 1487074809554.jpg (48KB, 501x839px) Image search: [Google]
1487074809554.jpg
48KB, 501x839px
What anime program should I make to learn C?
>>
>>59320761
You should probably insert some unsafe code in a popular open-souce software's code.
>>
>>59322290
That wouldn't be necessary considering the software is already written in C.
>>
File: really makes ya think.jpg (381KB, 979x832px) Image search: [Google]
really makes ya think.jpg
381KB, 979x832px
Is "scope" just a nice business way to say "fuck off, we're not doing that"

Part of me is dying inside now that i have to do project management but I have to figure out what these words mean
>>
>>59323987
Post an anime image in exchange for an answer.
>>
File: 1387631486947.gif (2MB, 350x253px) Image search: [Google]
1387631486947.gif
2MB, 350x253px
Are american programming jobs really being taken over by H1B pooloos?

I'm finishing up my undergrad CS degree right now. Should I try going into academia? Seems more fun than enterprise java drudgery anyways
>>
>>59323987
In some ways, where you will use it it will probably mean "we don't have time", "we don't have money", "we are too dumb" or "we don't like you as a client and want to be over with this asap". But it can also be proposed as a boundary for clarity. If your a team with a specialized concern you probably should stick to that in that context it's more grey but you're protecting your team from spreading themselves thin, programmers are often workaholics. Giving them too much to do can seriously hurt them long term (as it did to my mom).

>>59324214
Yes this happens. The fact that H1B is utilized is more or less proof of it. The abuse of H1B for hiring low-skill employees is a modern form of slavery and is certainly the bigger concern.
>academia vs private sector
For the most part these are very different things and your preference for either shouldn't be determined by H1Bs.
>>
>>59324286
Thanks for the response

>For the most part these are very different things and your preference for either shouldn't be determined by H1Bs.
I haven't decided which path I want to take, but I have tried my best to keep both paths open to me, should I make up my mind. I have done a couple internships which should help in pursuing a private sector job, but most of these jobs seem to be your average enterprise development positions.
Not only would such a job be boring, my skills would get rusty doing absolutely nothing of value for 8 hours per day for the rest of my life.
All the interesting low-level programming and security analysis jobs seem to require a Master's or PhD with published research, so I was considering going to grad school with the goal of getting a more interesting and valuable job.
>>
How does XOR works when I want to perform it on multiple values at once? Will I not eventually end up with a value made of all 1s?
>>
    int num;
for (num = 2; num < SIZE; num++){
if (x[num]==0){ // we want to print this number
printf("%d ",num);
if (num % 10 == 0){ // add a line fracture for every 10 numbers it prints
printf("\n");
}
}
}
}


Why doesn't it add any line fractures at all?
>>
>>59317533
I finally understood why ocaml uses the camel as its mascot. caml is pronounced like camel.

I feel like such an idiot for not realizing this immediately.
>>
Where are sum gud places and books to learn up to CS level math

mit ocw
edx


Going to relearn the fundamentals of math first

I want to learn it all 2 hours a day in a year senpai
>>
>>59324385
It xors each value, one at at a time. The bits will toggle according to each value.

>Will I not eventually end up with a value made of all 1s?
No, that's OR.
>>
>>59324430
Cormen?
>>
File: thanks mr shark.png (675KB, 740x836px) Image search: [Google]
thanks mr shark.png
675KB, 740x836px
thanks mr shark
>>
>>59324440
So if I do ans = x ^ y ^ z, it will be the same as:
a = x ^ y
and then
ans = a ^ z?
>>
>>59324480
leave my internet alone mr shark
>>
>>59324490
Yes.
>>
>>59324415
Because
if (x[num]==0 && num % 10 == 0)

Is never true? It depends on what's in the x array.

The simplest way to get what your comment says
// add a line fracture for every 10 numbers it prints 

Would be something like this:
    int num;
int printedNums=0;
for (num = 2; num < SIZE; num++){
if (x[num]==0){ // we want to print this number
printf("%d ",num);
printedNums++;
if (printedNums % 10 == 0){ //when we've printed 10 numbers we print a newline
printf("\n");
printedNums=0; //Overflow autism
}
}

}
}
>>
>>59324513
Huh, I thought I had already tried that. I must have messed something up. Thanks anon.
>>
>>59324498
he just wants what's best
>>
>browse random blogs on optimization because that can never hurt
>https://mklammler.wordpress.com/2015/10/04/conditional-modulo/
>Branching on modulus to handle the case where there's no transformation is faster than just doing modulus all the time
>about to skip because nothing new, then read:
>This is astonishing because it violates just about every principle we’ve learned about writing fast code.
>Don’t try to outsmart the compiler’s optimizer.
>Avoid unnecessary branches.
Is there people who are seriously into optimizing and profiling that still hold these as truths? I really didn't think so. But this was written in 2015, so that's fairly recent. And looking at the talk it got a laugh out of the Cpp-con crowd who are relatively good at this stuff.

Is this really surprising to people? I thought it'd be pretty obvious.
>>
Which is better, type parameters or type members?

trait MyType1[X] {
}

trait MyType2 {
type X;
}
>>
>>59324575
not everyone is a genius like you
>>
>>59324983
That's very kind but I'm not even that good.
It's just that these ideas are quickly beaten out of your head when you disassemble your first piece of code and actually understand it (most don't have x64 asm as their native language). So for people who are in this specific part of computer engineering it's surprising. It's like someone who paints houses for a living who doesn't know that you should use undercoat.

And here it's even your basic intuition right? If you can use what's in abstract a cheaper operation to avoid an expensive operation that will make your program run faster naturally.
Now that's to true for all cases but it's the most intuitive view imo.
>>
var buttcheeks = ((" "));

String.prototype.in_the_anus = function()
{
console.log(this.toString());
}

var anus = "gayness in anus".split(buttcheeks);

for(gayness in anus)
{
gayness = anus[gayness];

gayness.in_the_anus();
}
>>
>>59324575
Is it obvious that comparing is cheaper than division? I mean I remember that division is the most expensive. Or does ternary get some sort of a special treatment in asm?.
>>
If I want to develop a GUI desktop application in 2017, what language, frameworks, and libraries should I be using?
>>
>>59324918
It's universal vs. existential quantification.
>>
>>59325301
What is existential quantification (when done with types) useful for?
>>
>>59325298
Well, there is electron but
>javascript on desktop

Java, qt, gtk and wx are all still here I believe
>>
>>59325298
ncurses
>>
Does anyone use BASIC anymore? I just got offered a job maintaining a bunch of legacy BASIC software for a business with several locations

They do all their sales in this BASIC program and write all the data to a CD once a week and mail it to the main office, that's how they manage their sales data.

They don't want to change the way they do things. Would I be shooting myself in the foot to spend a year or two maintaining this software given that the pay is very good (60k per year) or would it stunt my growth and career to have that on my resume?

the program was originally written in 1988 and runs now on linux and is very convoluted
>>
>>59325280
Well conditionals break the pipeline of older cpus (newer ones can predict it most of the time).
>>
>>59325327
If you want to associate a specific type with the implementer of the trait, you use the second. If you want it to work for all types, you use the first.
>>
Daily Reminder

The meme programs /dpt/ writes won't make any money
>>
>>59325378
I'm still having difficulty seeing it: got any quick and easy examples?
>>
>>59325356
Holy fuck, where do you live? Kyrgyzstan?
>>
>>59325327
data Showable = forall a. (Show a) => S a

-- S :: Show a => a -> Showable

instance Show Showable where
show (S x) = show x

main = mapM print [S "hello", S 3, S True, S (Just [12])]
>>
>>59325384
that's a good thing

money ruins computing
>>
>>59324286
>Yes this happens. The fact that H1B is utilized is more or less proof of it. The abuse of H1B for hiring low-skill employees is a modern form of slavery and is certainly the bigger concern.

they only allow 65,000 people per year to come in on those visas in a 300,000,000 million person country, it's fucking insignificant, they are not taking yer jerbs
>>
>>59325356
Oh god my sides. 60k a year to maintain legacy BASIC from 1988 - for a year or two? You're fucking kidding, right?
>>
File: 1488460547456.png (203KB, 474x307px) Image search: [Google]
1488460547456.png
203KB, 474x307px
>>59325356
That's a major lol anon

Any cute lil basic pieces of code to share?
>>
>>59325396
>Holy fuck, where do you live? Kyrgyzstan?

Alabama
>>
File: oh_amazon.png (97KB, 326x374px) Image search: [Google]
oh_amazon.png
97KB, 326x374px
>>
>>59325414
What's wrong with maintaining legacy code Anon?
>>
>>59325412
If it's insignificant then we can just shut down the program and save money by not having to administer it any longer.
>>
>>59325414
>Oh god my sides. 60k a year to maintain legacy BASIC from 1988 - for a year or two? You're fucking kidding, right?

not kidding in the slightest, the current guy they have doing it is leaving (he's old), he only works 3 days a week. I assume I would only have to do about 10 hours of actual work per week

It's the highest paying job I have been offered by far and don't see me making more money right now at my skill level doing anything else

but would it be bad for my career to have that on my resume?
>>
>>59325412
>300kk programmers

How do I acquire a h1b btw
>>
>>59325443
>If it's insignificant then we can just shut down the program and save money by not having to administer it any longer.

how would it save money

if they "Shut it down" that would remove the 65k cap and then you would really have a problem with pajeets
>>
>>59325394
This is Rust which is hopefully similar enough to Scala to get an idea:
// universally quantify the type of the other operand to permit arithmetic with multiple types
trait Add<T> {
// existentially quantify the type of the result as it only depends on the implementer type and the other operand type
type Output;
fn add(&self, other: &T) -> Output;
}

If the type depends on the type of the implementer and/or any of the universally quantified type parameters, make it existential. If not, it can be a type parameter.

Another example would be iterating a collection. You'd have a trait defining a method to get an iterator that universally quantifies over the element type but existentially quantifies the iterator type since the iterator type depends on the collection type.

>>59325400
That's not going to help him at all.
>>
>>59325474
No, if it were shut down then no more H-1B visas would be issued.
>>
File: 1356204807547.jpg (29KB, 320x320px) Image search: [Google]
1356204807547.jpg
29KB, 320x320px
>>59325466
>How do I acquire a h1b btw


apply for it

not all or most HIBs are programmers anon, many are nurses and shit like that
>>
>>59325280
>Is it obvious that comparing is cheaper than division?
It's a bit of a complicated topic for reasons but a compare and jump alone is not too expensive when you don't escape the instruction cache (and if you skip so much that you would then you probably should take that hit anyway).
http://www.agner.org/optimize/instruction_tables.pdf
This is a pretty good document to get an idea of things. If you look at Nehalem (which I tend to target because it's on the low end of my users and it's common) its Fast for compare, jumps and reciprocal jumps.
But their idiv are very bad. Especially when you consider the reciprocal throughput.
Chandler Carruths (guy who presented this at a talk which amazed the author of the article) code would have shown less of a difference if he had more instructions behind the modulus. But it'd still be there. Overall this isn't a particularly interesting case, it's the attitude that bothers me, not the details of the situation.
>>59325360
Yeah this stopped being an issue in the early 00's mostly (new computers at that time, obviously).
>>
>>59325414
>Oh god my sides. 60k a year to maintain legacy BASIC from 1988 - for a year or two? You're fucking kidding, right?

why do you find this so out of the ordinary
>>
>>59325426

i could have saved some, i am not at work right now

the code looks a lot like python desu

should i d o it?
>>
>>59325412
>they are not taking yer jerbs
I didn't say it was major job stealing going on but they are taking jerbs, its not an explanation for youth unemployment or anything it's just a factor. And I made it pretty clear that it's the morality of the situation with regards to the situation of the people who take these jobs that's the major concern.
>>
>>59325461
well if it is unironically 10h of work, shit's awesome

>get paid
>hit on sales agents
>write some cool shit in your free time
>read books
>shitpost in /dpt/
>>
>>59325480
I'm not sure what that gets you over making Output be a type parameter: any valid instance can be represented both ways, surely? i.e.

trait Add<T, Output> {
fn add(&self, other: &T) -> Output;
}


(I don't know Rust so the syntax might be wrong)

>Another example would be iterating a collection. You'd have a trait defining a method to get an iterator that universally quantifies over the element type but existentially quantifies the iterator type since the iterator type depends on the collection type.
Similarly, can't that be just expressed like this?

trait HasIterator[It[_], A] {
def getIterator(): It[A]
}

class List[A] extends HasIterator[ListIterator, A] {
// ...
}
>>
>>59325547
>well if it is unironically 10h of work, shit's awesome

I am thinking of rewriting everything in python as a project, even if they don't use it I can put on my resume that I wrote the sales and accounting software for an 18 store location business in python and have the data write to a proper database. And I could do that on the clock.

I am just worried that "I maintained a 30 year old BASIC accounting program for 2 years" would look like shit on my resume
>>
>>59325556
I guess the main difference in practice is that the type can't be inferred if it's universally quantified. You would have to annotate the type of the expression x.add(y) in order to be able to get the implementation of add.
>>
>>59325461
>would it be bad for my career to have that on my resume?
No, that's never the case.
If you think there's some startup you would want to work for that you (for whatever reason) think wouldn't like it just omit that piece of information when applying.
>>
>>59325487
doesn't that require receiving an offer from some us company?
>>
File: bg.jpg (12KB, 480x360px) Image search: [Google]
bg.jpg
12KB, 480x360px
>>59325272
>>
>>59325608
>If you think there's some startup you would want to work for that you (for whatever reason) think wouldn't like it just omit that piece of information when applying.

I can't omit the only thing I would have done for several years from a resume anon, it would look like I had done nothing

It's never the case that programming in an obsolete language looks bad on a resume? This is good info if true
>>
>>59325590
>I am just worried that "I maintained a 30 year old BASIC accounting program for 2 years" would look like shit on my resume
If it's 10 hours of work you can spend some portion of the rest of the work week on making other merits.

If you've been employed a hobby project counts for more since it shows more tangible enthusiasm than someone who gets paid.
>>
>>59325500
Pretty neat doc, thanks anon. Time to refresh asm memories
>>
>>59325620
>doesn't that require receiving an offer from some us company?

you have to be sponsored to apply
>>
>>59317533
Programming isn't for the thin skinned.

Compilers don't ask you "pretty please can you fix this error?"
They tell you bluntly "this shit in invalid, fix it retard".

I'd tell you to grow a pair, but I guess the whole point of your HRT is to make your already tiny balls shrink so tiny they become impossible to see with the naked eye.
>>
>>59325636
>>I am just worried that "I maintained a 30 year old BASIC accounting program for 2 years" would look like shit on my resume
>If it's 10 hours of work you can spend some portion of the rest of the work week on making other merits.

I could do this, the owner has even offered to pay for me to get my masters in cs and let me go to class during the work week

there is no sysadmin and there is no database, everything is done in BASIC and they literally mail CDs of the program to the main office every week from every point of sale system where the secretary manually totals all the sales figures
>>
File: 1441318950440.jpg (26KB, 588x421px) Image search: [Google]
1441318950440.jpg
26KB, 588x421px
>>59325676
>they literally mail CDs of the program to the main office every week from every point of sale system where the secretary manually totals all the sales figures
>>
never work with a pajeet
>>
>>59325634
Why would it be bad? As you say it's a waste of time at worst.
>>59325676
>I could do this, the owner has even offered to pay for me to get my masters in cs and let me go to class during the work week
Jesus anon, go for it. This is an exceptionally good deal.
>>59325667
Yes you need to have thick enough skin to handle a machine telling you it doesn't understand your intent perfectly.
>>
>>59325694

I'm not even kidding anon, you should see it they are running linux desktops that only boot and run this point of sale program, it literally can be run on a 486 machine with 4mb of ram
>>
>>59325696
>Why would it be bad? As you say it's a waste of time at worst.

I just fear that after doing this and going to apply to my next job they are going to laugh at me for doing this for several years. It's not like I ever see a job posting asking for X years of BASIC experience
>>
>>59319238
Only plebbits are allowed to use paragraphs now?

How long have you been off the pills m8?
>>
>>59325676
>he owner has even offered to pay for me to get my masters in cs
kek

and what exactly are you contemplating about, take the job
>>
Implementing deterministic GC for C.
>>
>>59318041
no but it's a fucking great drug
>>
>>59325716
Anon people aren't like that, most companies aren't exactly swimming in competent potential hires. If you really want to guard yourself that much spend your free time on something as I said.
>>
>>59325272
8/10, would be 10 if you used php instead of javascript.
>>
>>59325667
Project ideas

Extreme bully and antibully output plugins for Visual Studio

error C2143: syntax error : missing ';' before 'type'.. you fucking idiot you, how on earth did you forget
>>
>>59325780
error C2143: Your error is so dumb that i'm not gonna tell you where it is
>>
>>59325723
>and what exactly are you contemplating about, take the job

well I just feel learning an obsolete language is not a marketable skill, am i wrong?

having my classes paid for would be a big bonus, I have my bachelors in MIS

>>59325759
>Anon people aren't like that, most companies aren't exactly swimming in competent potential hires. If you really want to guard yourself that much spend your free time on something as I said.

I am surprised to hear that they would not look down on someone just maintaining BASIC code, thanks for the info I just got it in my head it would look bad
>>
>>59325797
>"here is my cv"
>"basic? wtf"
>"but look I remade the whole thing in python and made a bunch of other cool shit and got masters, dem old fuckers amirite haha"
>"haha you're hired"
>>
File: wew.jpg (14KB, 300x168px) Image search: [Google]
wew.jpg
14KB, 300x168px
>>59325793
>>
>>59325828
>>"but look I remade the whole thing in python and made a bunch of other cool shit and got masters, dem old fuckers amirite haha"

good point anon thanks
>>
>>59325605
I'm not saying it works in general, but Scala seems to be able to figure it out in simple cases:

$ bin/scala
Welcome to Scala 2.12.1 (OpenJDK 64-Bit Server VM, Java 1.8.0_121).
Type in expressions for evaluation. Or try :help.

scala> trait Add[A, Out] { def add(other: A): Out }
defined trait Add

scala> implicit def addStringList(self: String): Add[String, List[String]] = new Add[String, List[String]] { def add(other: String) = List(self, other) }
addStringList: (self: String)Add[String,List[String]]

scala> "foo".add("bar")
res0: List[String] = List(foo, bar)

scala> def adder[A, Out](first: A, second: A)(implicit add: A => Add[A, Out]): Out = first.add(second)
adder: [A, Out](first: A, second: A)(implicit add: A => Add[A,Out])Out

scala> adder("foo", "bar")
res1: List[String] = List(foo, bar)


More idiomatic Scala:

$ bin/scala
Welcome to Scala 2.12.1 (OpenJDK 64-Bit Server VM, Java 1.8.0_121).
Type in expressions for evaluation. Or try :help.

scala> trait Add[A, Out] { def add(first: A, second: A): Out }
defined trait Add

scala> implicit val addStringList: Add[String, List[String]] = new Add[String, List[String]] { def add(first: String, second: String) = List(first, second) }
addStringList: Add[String,List[String]] = $anon$1@6bfaa0a6

scala> def add[A, Out](first: A, second: A)(implicit adder: Add[A, Out]): Out = adder.add(first, second)
add: [A, Out](first: A, second: A)(implicit adder: Add[A,Out])Out

scala> add("foo", "bar")
res0: List[String] = List(foo, bar)

scala> implicit class AddSyntax[A](self: A) { def add[Out](other: A)(implicit adder: Add[A, Out]): Out = adder.add(self, other) }
defined class AddSyntax

scala> "foo".add("bar")
res1: List[String] = List(foo, bar)


I may have misunderstood what you were getting at, though.
>>
>>59325828
>>59325843
Don't insult old employers without good reason.
So if you see them frowning on Basic, sure. But don't do it as a default.
>>
>>59325590
>"I maintained a 30 year old BASIC accounting program for 2 years"

BASIC from 30 years ago was pretty much a training language for people who would eventually be working in assembly. It's nothing like VB.
>>
>>59325879
Yet there's tons of code in Basic still in use.

What's your perspective on COBOL?
>>
Fucking Java, it tries so hard to be like C++ yet fails in every fucking way
>>
>>59325950
Fucking C#, it tries so hard to be like Java yet fails in every fucking way
>>
File: quotes-4388.png (9KB, 458x951px) Image search: [Google]
quotes-4388.png
9KB, 458x951px
>>
>>59325950
elaborate right this fucking instant
>>
>>59324214
Yes, but don't worry unless you are doing C++ or web development. Pajeets love C++ and web development takes two days to learn.
>>
>>59325962
That's a good thing, though.
>>
>>59325864
>Don't insult old employers without good reason.

I would not do that, I am just worried about looking like I only have experience in something that is now useless and thus no meaningful experience

>>59325879
>BASIC from 30 years ago was pretty much a training language for people who would eventually be working in assembly. It's nothing like VB.

I know, it's all GOTO this line or that line
>>
>>59325978
>can't declare a function outside of a class
>everything is a fucking Object
>templates are trash
>>
>>59325963
The same can be said about any POO language.
>>
>>59325963
I would say this about Python, Java and Javascript
>>
>>59326007
>can't declare function outside class
That's oop, has nothing to do with a multiparadigm language like C++
>everything is an object
OOP.
>templates are trash
Didn't even know java had those. Yeah, templates are toys for the sandbox not construction equipment.
>>
File: languages3.png (17KB, 522x384px) Image search: [Google]
languages3.png
17KB, 522x384px
>>59326048
>>59326038
>>59325963
>>
>>59325963

BASIC job guy here

well shit
>>
why do people hate Java?

Because of long method names, forced OOP and forced boilerplate code.
...That's basically it. It's just the cool kid thing to do for kids to hate on Java even though it's a great language to make things like servers and multithreaded applications with managed thread pools much simpler than something like C.

I get the feeling most of the Java hate come from either:
- Memers
- People who write in dynamically typed languages and static type checking fucks them in the ass.
- People that don't ever write in a lower level language like C to appreciate some of the things java makes easy, or "front end engineers".
And finally:
- People with actual complaints about java because of fucked up industry standards, or just hate the forced abstractions pattern which can make for some really, really bad code. When OOP is originally taught, people are taught inheritance too freely and need to understand that it's in general a bad practice to do over composition and can cause for some horrible boilerplate code passing, which can usually be solved by interfacing then defining implementations there.

The language definitely has its downs and its ups, and has developed a use case now. It's not a language to use for every scenario, but it's an industry standard for a reason.

tl;dr kiddies
>>
>>59326062
He'd say the same about C++ and java.
http://chrisdone.com/posts/dijkstra-haskell-java
>>
>>59317533
If I know everything from here http://www.cplusplus.com/doc/tutorial/

does it make me a C++ expert? What topics does this miss?
>>
>>59326078
Don't forget functional programmers also tend to dislike Java for separate reasons.
>>
>>59326078
C++14 covers all that shit already and with C++17 coming there won't be any reason to use Java anymore
>>
>>59326007
>can't declare a function outside of a class
Java 8 introduces some neat functional language features
>everything is a fucking Object
No.
>>
>>59326060
I pick Haskell and Idris
>>
>>59326102
Great choice, anon.
>>
>>59326082

sounds like he doesn't like anything
>>
you gotta BE THE LANGUAGE
>>
>>59326114
He just didn't like garbage and sloppy methods.
>>
>>59326078

because no pointers and slow
>>
>>59326091
>C++ expert

There's no such thing
>>
>>59326138
A C++ expert is someone who knows not to use C++.
>>
File: 2017-03-10-014348_215x706_scrot.png (32KB, 215x706px) Image search: [Google]
2017-03-10-014348_215x706_scrot.png
32KB, 215x706px
>>59326091
Pls respond. What other things one should know besides pic related
>>
>>59326114
He liked functional programming languages. But I'd agree, he's a computer scientist. Programming is an invasion in that pure mathematical world. His letter makes that perfectly clear:
>The additional advantage of functional programming with “lazy evaluation” is that it provides an environment that discourages operational reasoning.
Basically saying that an implementation is not the concern of his students or himself. So he's far dislocate from being an engineer.
>>
>>59326062
it's ok

Alan Kay said something like "arrogance, in computer science, is measured in nanodijkstras." Academia generally hates real world languages, my math buddy loathes c++ and java like madman
>>
>>59326116
>you must BECOME poo
>>
>>59326082
>functional programming elegantly admits solutions that are very hard (or impossible) to formulate with the programming vehicle of their high school days
>impossible

Is he saying that imperative languages aren't "real languages"?
>>
>>59326158
>Alan Kay said something like "arrogance, in computer science, is measured in nanodijkstras." Academia generally hates real world languages, my math buddy loathes c++ and java like madman

what do they like? assembly and FORTRAN?
>>
File: cia man 307.jpg (46KB, 569x802px) Image search: [Google]
cia man 307.jpg
46KB, 569x802px
>>59317533
Tell me about Knuth! Why does he writes the book?
>>
>>59326168
I do think he's hyperbolic. If it were impossible his programs wouldn't compile. But there are ways of expressing yourself in functional languages that aren't really done in imperative.
>>
>>59326129
speed does not matter so much for server side, which is where Java excels. and Java is way faster than Python and all FP langugages.
>no pointers
there are pointers, you just can't explicitly manipulate them.
>>
>>59326172
to get to the other side
>>
>>59326191
>wouldn't compile
Into a correct program that is.
>>
>>59326196
If I take your book, will you die?
>>
>>59326171
math people tend to get wet from haskell as far as I can say

buddy sent me this recently https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
>>
>>59326227
pull yourself together
>>
>>59326172
>Tell me about Knuth! Why does he writes the book?
Decades ago Knuth wanted to write a book on compilers.
"OK, but I need to explain some basics first."
The first 4 volumes of TAOCP are the basics, just the introduction to his compiler book.
>>
>>59326192
>java is faster than woefully slow
Yes.
>servers no need speed
They do, they're some of the most performance intensive situations around outside of amateur applications
>pointers
Yes there's references. I haven't heard of genuine memory addressing pointers though. Which is what a pointer is.
Don't conflate references with pointers.
>>
>>59326254
That's one hell of a way to do it. Will he ever finish it? There are 7 volumes planned according to Wikipedia and he's 79. The first compiler related book, Vol. 5, is estimated for a 2025 (!) release. That's 8 years!
>>
>>59326288
fucking semantics. and network optimization is way more important than a speedy server application
>>
>>59326339
>dude just get a faster connection lmao
>>
>>59326232
Pretty good article but some of the snark and condescending/unqualified ideas about what's 'hard for programmers' could be left out. It's better to state things like that (something) is foreign to the programmers domain and hence doesn't translate easily.

But more than anything this convinces me that computer scientists should stay out of programming. I don't see why they need to limit themselves to programming languages. Their job isn't to make things run at all.
>>59326339
Anon that's just you speaking out your ass and letting your brain think it was something you thought when you smell it. If you have a server application that's genuinely maxing out your bandwidth when processing general requests that aren't simply downloading or uploading long streams of data then you should contact Facebook and Google. They will pay you amazing sums for your consulting.
>>
>>59326301
>That's one hell of a way to do it. Will he ever finish it? There are 7 volumes planned according to Wikipedia and he's 79. The first compiler related book, Vol. 5, is estimated for a 2025 (!) release. That's 8 years!

why do these hardcore guys get caught up in these unfinishable projects, like stallman and GNU/herd

like any single person is every going to read all seven volumes
>>
>>59326373
>But more than anything this convinces me that computer scientists should stay out of programming. I don't see why they need to limit themselves to programming languages. Their job isn't to make things run at all.

what is their job, what are they supposed to do?
>>
>>59326378
The worst part is that it won't even produce a good programmer. Being a teacher isn't easy.
>>
File: [].png (59KB, 205x229px) Image search: [Google]
[].png
59KB, 205x229px
I know C.
>>
>>59326418
Show me.
>>
BASIC job guy here, just found out the guy who currently works on the program agreed to stay on for a few months part time and teach me the ins and outs of it.

I'm going to do it bros

30 years ago here I come
>>
>>59326378
>like any single person is every going to read all seven volumes
I don't know anyone who even read 1 entire volume, completely from cover to cover. That includes CompSci PhDs.
>>
>>59325556
>Similarly, can't that be just expressed like this?
The problem is Rust doesn't have HKT's as far as I know, so you can't do that
>>
>>59326389
Do mathematics related to computation.
This isn't exactly a revolutionary thought. That's their job. But they love to try and make themselves more than 'lesser' mathematicians which seems to be the perception from them. I appreciate a lot of CS stuff so I don't feel that way. But how would you explain a construction worker making art with cement. They're not satisfied with where they are. (not all of them obviously)
>>
>>59326425
Challenge me.
>>
File: hqdefault.jpg (22KB, 480x360px) Image search: [Google]
hqdefault.jpg
22KB, 480x360px
>>59326389
prove theorems, observe the world
it's science after all. math people get triggered so hard tho "CS IS NOT A PART OF MATH FUCK OFF"

>>59326373
>that computer scientists should stay out of programming
sure, "software engineering" and "computer science" are different things
>>
>>59326439
>I don't know anyone who even read 1 entire volume, completely from cover to cover. That includes CompSci PhDs.

sounds like he's writing it as an opus to his own vanity
>>
>>59326455
Yeah. But that article means to 'bridge the gap'. Which is nonsense. What you'd need is to translate your papers to languages engineers understand if you see an issue there. You don't tell everyone to learn haskell so that we have this common ground.
>>
>>59326451
Write fizzbuzz.
>>
File: 1483353423237.png (285KB, 720x720px) Image search: [Google]
1483353423237.png
285KB, 720x720px
>>59326378
>hardcore guys
>stallman
>GNU
>>
File: 1488404059576.jpg (43KB, 680x598px) Image search: [Google]
1488404059576.jpg
43KB, 680x598px
Ok, gonna start reading Vol. 1 of The Donald right now /dpt/, it's been on my bookshelf since forever. Wish me luck. I assume I will return as a literal god. It says on the cover that Bill Gates will hire me.
>>
>>59326450
>Do mathematics related to computation.

so are they dealing with something like a theoretical perfect computer and it's IBM's job to try to make hardware that can do their math?

>>59326455
>prove theorems, observe the world

sounds like math

>>59326455
>it's science after all. math people get triggered so hard tho "CS IS NOT A PART OF MATH FUCK OFF"

If a computer scientist does not code and does not deal with creating computer hardware, what does he do on a day to day basis that influences computing?
>>
>>59326458
>sounds like he's writing it as an opus to his own vanity
I don't believe it's vanity, but a deep passion for the subject. That's great.
How gray would a world be where everything must be useful? People like Knuth or Terry Davis inspire.
If they can summon that much energy to fulfill their dream, maybe I can get off my lazy ass and finish my little project at least.
>>
>>59326152
Just start learning and calm the fuck down. It's not what you want to hear but it's the truth.
>>
>>59326506
>>hardcore guys
>>stallman
>>GNU

I would say GNU Herd is an unfiinishable project that stallman says is "under heavy development"
>>
>>59326510
Bill Gates here, I'll be expecting your application soon
>>
>>59326512
>what do CS people do that influences computing
You mainly see it through algorithms. There's algorithms for so much stuff. If you have a problem you usually have some smart guy that thought about it in abstract. It's a great help.
>>
>>59326541
Which would be true, but I wouldn't call it (by "it" I mean stallman) a hardcore guy.
>>
>>59326526
>I don't believe it's vanity, but a deep passion for the subject. That's great.
>How gray would a world be where everything must be useful? People like Knuth or Terry Davis inspire.
>If they can summon that much energy to fulfill their dream, maybe I can get off my lazy ass and finish my little project at least.

it's a free country he can do what he wants. It's past practical what he is doing though, if you do something for your own enjoyment and passion that does not really benefit others what's the difference between writing a 7 volume computer manifesto and gardening? I am not dissing the guy but it seems like maybe he should not be so quoted by regular computer fags, he's left humanity behind and is not really relateable
>>
>>59326570
>it
If you want a gender neutral word to describe a singular person then they is what you should use. English is a bit weird but it is how it is.
>>
>>59326570
>Which would be true, but I wouldn't call it (by "it" I mean stallman) a hardcore guy.

if he's not hardcore I would hate to see hardcore
>>
>>59326490
#include <stdio.h>

int main() {
for (char i = 1; i < 100; i++) {
printf("\n%i - ", i);
if (i%3 == 0) printf("fizz");
if (i%5 == 0) printf("buzz");
}

return 0;
}
>>
>>59326604
Stallman is autistic (by 4chan diagnostic standards). He's an oddball. Don't confuse that with being amazing at programming/computer science.
>>
you aren't a real programmer until you have made money programming
>>
>>59326613
4/10
>>
>>59326600
No, I mean "it" as in something you would use to refer to an animal.
>>
>>59326613
That's not fizzbuzz.
>>
>>59326624
Improve.
>>
>>59326620
>Don't confuse that with being amazing at programming/computer science.

but he is/was few single humans have accomplished what he has in a career, even if he does not program anymore and has gone off the deepend you have to look at what he did earlier in life, it was pretty much as hardcore as you can get imo
>>
my pronoun is they you may refer to me as they
>>
>>59326604
Someone I would consider hardcore has already been mentioned here.
>>
>>59326613
Brace for the fizzbuzz experts who will inform you of the exact problem definition for the generic fizzbuzz that has nothing to do with actual programming ability.
>>
>>59326632
It is.
>>
Terry Davis is hardcore
>>
>>59326613
>failing fizzbuzz
wew
>>
>>59326646
>Someone I would consider hardcore has already been mentioned here.

pajeet?
>>
>>59326451
Write a function that takes as input two integers and outputs their average. Hard mode: no division.
>>
>>59326512
>are they dealing with something like a theoretical perfect compute
yeah

>what does he do on a day to day
for example, they tell us which problems are literally unsolvable or which can be solved "good", analyze algorithms and come up with solutions

computational complexity theory is bretty fascinating in particular imo. "Computers and Intractability" and "Computability: An Introduction to Recursive Function Theory" are interesting to read
>>
>>59326677
Do you want the output rounded, rounded in a particular way, or fractional?
>>
>>59326654
No, it doesn't fulfil the spec.

>>59326653
Do you think "oh, well it's almost right" is good enough for actual programming?

YOU HAVE TO FOLLOW THE SPEC ANON. OTHERWISE YOU'RE FUCKED.
>>
>>59326677
Impossible in C.
>>
>>59326636
Emacs is the biggest bestest piece of software he has written in my opinion. And while it's good it's not like he did it alone and it's not like its some divine piece of software. He's more of an activist. Very socially interested in computers more than anything. He doesn't give talks on programming or computer science or anything like that. Fame doesn't make you a better programmer.
>>
>>59326690
Integer. Bonus for no modulo.
>>
>>59326698
>He's more of an activist.
Which makes him less than human considering the type of stuff he advocates for aside from things related to computing.
>>
I want to learn python by starting a small project. It's an ambitious project, a full working poker site for fake money. I have some different games I want to do.

Anyways, my question. What website or book do you recommend I bookmark? I am looking for an easy to use website with all the syntax and examples, I haven't been able to find one, so I came here to ask.

Thanks FRIENDLY anons.
>>
>>59326634
>(-10) not traditional fizzbuzz output
>(-5) excludes 100
>(-5) needless "optimization" for the i variable, likely doesn't cause any gain of efficiency at all
>(-2) forgot arguments to main (or (void) )
>(-1) not K&R style
>>
>>59325426
The HARDCOREST of guys right here
>>
>>59326694
The thing about fizzbuzz is that it's a program that isn't a clearly defined operation because it's completely arbitrary. Unless the IEEE has adopted it now or something. I don't look into these things. It'd be another thing if he was to implement something like IEEE float without using the FPU or something.
>>
>>59326723
I think you should just read the doc from the python website then use the Django documentation tbqh. The framework used (probably still is) to be very popular so there is a big community and web development is different enough from regular so that you won't miss too much by not diving in the basics first.
>>
>>59326726
Ooh, do mine!

#include <stdio.h>
#include <stdbool.h>

struct rule {
const unsigned factor;
const char *string;
};

static const struct rule rules[] = {
{ 3, "Fizz" },
{ 5, "Buzz" },
};

int main(int argc, char **argv)
{
for (unsigned i = 1; i <= 100; ++i) {
bool matched_any_rule = false;

for (size_t r = 0; r < sizeof(rules) / sizeof(rules[0]); r++) {
if (i % rules[r].factor == 0) {
printf("%s", rules[r].string);
matched_any_rule = true;
}
}

if (! matched_any_rule) {
printf("%u", i);
}

printf("\n");
}

return 0;
}
>>
>>59326698

I agree he's basically an activist now but let's face it most people in the field wind up working as a codemonkey somewhere they don't really like, stallman got to do what maybe 1% of people in CS get to do and that is code what he was passionate about without regard for money for many years at the highest level academically possible, that's hardcore to me
>>
>>59326726
>needless optimization
Is it really though? What compilers will automatically pre-increment the value for you?
>>
>>59326748
Will do. I am on the site right now reading it over. p.s. im just jumping into programming, can python handle server processing and front end graphics?
>>
>>59326758
>most people in the field wind up working as a codemonkey somewhere they don't really like
In my country most people in the field work as codemonkeys for 5-10 years, then manage other codemonkeys since the industry is flooded with more codemonkey (but there still is the myth of the shortage of programmers).
>>
>>59326723
>I want to learn python by starting a small project. It's an ambitious project, a full working poker site for fake money. I have some different games I want to do.

that is a very ambitious project anon, I would say it would take a team of at least a handful of skilled coders over a year working full time to get working properly
>>
>>59326778
>can python handle server processing
That's what the framework is for m8 (it's called the back-end, basically the logic/data retrieving that happens).
>front end graphics
Didn't think about that, oops (I was too focused on you mentioning Python), but you should get away with some basic HTML, CSS and Javascript at first.
>>
>>59326757
>(-5) too much code
>(-1) use of "unsigned" instead of "unsigned int"
>(-1) inconsistent: ++i vs r++

Personally, I would've not used stdbool.h, and I would have made the rules array null terminated, but I won't mark off points for personal preference.
>>
>>59326818
Thanks!

>>(-5) too much code
I'm not sure how to make it smaller while still being easy to add more cases to.
>>
>>59326758
Plenty of people work on software they like. I can't say how it was in the past. But I thought we were talking about accomplishment, not how lucky he was to get to do more fun things.
I don't have anything against anyone liking the guy I'm just saying that if you're looking for the Ussain Bolt of programming at least look at someone like John Carmack. A proper engineer.
>>
>>59326773
I'm talking about using char
You likely won't get better space efficiency since the stack is word-aligned, and you likely won't get speed efficiency since operations on words are usually just as fast anyways. If you check the assembler output, it probably extends the char into a word before doing modulo, so that means its actually slower.
>>
>>59326837
I say you should ignore that opinion. It's not too much code if it's easily understood.
>>
>>59326837
Just because it's in an array doesn't mean it's easier to add cases to; just because it's in a function doesn't mean you can't modify it to add more cases.
>>
>>59326789
>>59326810
Is there a good forum to use for python questions?
>>
>>59326848
It probably doesn't respect that you're using char because there's Value Range Propagation (I'm pretty sure) on most compilers. If it finds there won't be overflows it selects the best option for the device compiling for right?
>>
>>59326818
Can you review my fizzbuzz too? It compiles to C so I guess it can be treated as C in some sense.
activate.
prepare functions : num (x) (x) , fizz (x) (x mod 3) , buzz (x) (x mod 5).
prepare list of Int : [1...10000000000000]. ----- compiler : optimize -----
assign : last prepare := n.
make : tuple => (fizz x, buzz x).
assign : last make := t.
call functions in tuple : t.
assign : last call functions in tuple := c. ----- compiler : inline, optimize -----
check if c :
(0,0) ---> fizzbuzz!!!. ----- compiler : optimize -----
(0,_) ---> fizz.
(_,0) ---> buzz.
_ ---> num (future n). ----- compiler : optimize -----
run multiple times : (iterate n) ∧ c (current n).
run on each n : print result of last : check if.
return to _ : 0.
deactivate.
>>
>>59326873
http://irc.netsplit.de/channels/details.php?room=%23python&net=freenode
Is pretty good. It's relatively active. But it's for shorter questions though. Very helpful bunch.
>>
>>59326884
>If it finds there won't be overflows it selects the best option for the device compiling for right?
That sounds reasonable.
Meanwhile, using char is prone to bugs.

Pop quiz: is this an infinite loop?
for (char i = 0; i < 128; i++)
>>
>>59326861
That's true, so would you have been satisfied if I'd just had a sequence of if-statements in the main function instead of iterating through a collection of rules?
>>
>>59326861
Nah it's certainly easier to use the interface provided here rather than altering the code for a normal fizzbuzz.
>>
>>59326907
>Pop quiz: is this an infinite loop?

no
>>
>>59326907
It depends.
>>
>>59326907
Yeah I agree char is pointless and worse. Just saying it won't actually be slower most likely.
>>
>>59326907
>Comparisons between numbers in different sets
Only in C :)
>>
>>59326060
honestly bretty accurate
>>
>>59326060
>triangle diagram
>pick one
But that's not what that is for!
>>
>>59326935
>>59326933
It would make the code a lot simpler if you did that. And technically it makes it easier to add new cases, since now you can add cases for different conditions other than being a factor of.

>>59326937
Why don't you try it?

>>59326943
:)
>>
>>59327042
>why don't you try it
But we'd only know if it doesn't infinitely loop if we try it and it stops. We won't know if it would stop in a couple of years.

This is where proofs come in handy.
>>
>>59326818
It is not that much code. He was just a whitespace nigger and used way too much. It makes it look like more code than it is.
>>
>>59327104
>This is where proofs come in handy.
You could construct a proof that it never terminates. You wouldn't be able to embed the proof inside C, that's for sure, but you could make a semi-formal mathematical proof about its termination
>>
Who here /dependent types/?
>>
>>59327242
o/
>>
New thread:

>>59327254
>>59327254
>>59327254
>>59327254
>>
File: 1445920989815.jpg (74KB, 640x640px) Image search: [Google]
1445920989815.jpg
74KB, 640x640px
>>59327242
Thread posts: 344
Thread images: 32


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