[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: 325
Thread images: 46

File: Dennis_Ritchie_2011.jpg (201KB, 503x662px) Image search: [Google]
Dennis_Ritchie_2011.jpg
201KB, 503x662px
Old thread: >>59141169

What are you working on, /g/?
>>
>>59147279
>His face when he made C and saw somebody actually use it
>>
Finished my extensible Go image/video/audio/etc. thumbnailing library, if anyone cares: https://github.com/bakape/thumbnailer
>>
File: tmp_7716-1485290787417333125441.png (594KB, 788x1024px) Image search: [Google]
tmp_7716-1485290787417333125441.png
594KB, 788x1024px
>>59147279
>>
>>59147279
>2017
>Falling for C cancer
shiggydiggy
>>
Resposting because why not:

I'm messing a little bit with libnotify in Python.
Any idea how can I make the portraits of the girls bigger? I can barely see their faces.

I'm using GdkPixbuf for the images.
>>
>Graduate from University with bachelors in EE
>Go for job interviews
>Get hired in one to do production scripts in Python
>Lucked out because I did my Final Year Project in Python, Adrino and C
>Do well for 1 year
>Optimize shit real good
>Anon, we want to make your production scripts a product - My boss

Here we fucking go. I don't have the first clue what goes into making a script into a working product. With a fucking GUI interface as well.

It doesn't have to be python specific but I can someone point me in the right direction in terms of documentation and shit for a program. Cause I have a feeling I might want to leave the company after this project.

Oh I don't have any mentors or anyone to turn to for help as well.
>>
>>59147576
What operating system are you using?
>>
>>59147279
my machine learning framework
it supports linear and logistic regression currently
haven't tested on neural nets, but it should work there too, since it's the same matrix operations it will use

will also implement a k-means algorithm, just to round it off a little
>>
>>59147601
Experience with Windows and Linux. Confined to windows at work cause of VM off the main server. Given enough reason I can try convince my boss to let me bring my laptop to work. But hopefully I don't have to.
>>
>>59147633
see if you can use pyqt5 on windows
>>
>>59147684
Yeah I am not worried about making the program itself. It is the documentation and stuff that I am worried about. I have no idea how a development cycle works.

Bug testing? Code documentation?

I mean I can pajeet my work and make it so it works but only I understand it but it is my first major project in the working world and I want to do it well. Plus such skills can be put on my resume.
>>
>>59147713
If the program does well nobody will really care about documentation and bug testing that much. You can simply use a documentation generator like doxygen and the GUI could simply be a colorful way to insert arguments to your app, slap a pyunit for unit testing just so it doesn't look like your app is without testing. If you arent trying to turn it into a library then you dont need to make an API reference, for usage itself a README.md will be sufficient.
>>
>>59147779
I will look those up.
Oh boy it looks like it is going to be a long year ahead for me. Gonna start by learning how to make a simple GUI.

Thanks anon. I better get a fucking good grade if I pull this off.
>>
>>59147842
appjar
>>
>>59147842
Lol you better charge something or get something valuable for all the bullshit ass work you'll have to put to make those scripts retard friendly, it might take more effort than writing the code itself
>>
>>59147861
Not even that anon, but this looks great. Tkinter for mocking something up is painful and this looks great for bypassing the pain of Tkinter.
>>
>>59147866
>Lol you better charge something or get something valuable for all the bullshit ass work you'll have to put to make those scripts retard friendly

Lmao. I get paid a fix sum every month. I am salaried. Which is why I am most likely leaving at the end of this project. There is no one I can learn from. What I learn I learnt on the internet and on my free time. I am considered the de facto "best" programmer currently and I am fucking shit (at python).
>>
>>59147901
>I am considered the de facto "best" programmer currently and I am fucking shit (at python)
This is the worst feeling. I'm feeling it currently.
>>
>>59147899
>>59147861
What about making something portable. Just in case my boss wants me to make it so it can run without an IDE. I heard Pyinstaller and the likes which "freezes" code. Does that work with GUI as well?

>>59147927
>I'm feeling it currently
It gets better (hopefully). I been bugging HR to hire a legit Software Engineer for awhile. Nope. They want more geographers.
>>
>>59147901
Lol the best programmer in there is a python and arduino programmer? Hope you ditch em as soon as possible anon
>>
>>59147973
Yeah. But they were the only company without the Entry level job but 4 year working experience meme.

And let the record show that I am actually a very competent arduino and know C quite well.
>>
>>59148010
>Entry level job but 4 year working experience meme
This meme needs to die ASAP but no one seems to actually want to kill it outside of writing blog/plebbit posts about it, it's stupid.
>>
>>59147964
>I heard Pyinstaller and the likes which "freezes" code. Does that work with GUI as well?
Yeah, it does. We had an intern at my job and he cooked up some zaney python script to read excel files, just finished cleaning it and work with company needs; he used tkinter for some graphical input needs and it worked just fine with py2exe
>>
>>59148043
The worst part is I have interned but when I went for interviews, I get told that doesn't count as work. Simply fucking ebin. Anyway, I am pretty sure by the time the project is up, I will have 2 years working with VM, python and on my own free time continue to program in C for Raspberry Pi and hopefully headed my own successful project. Hopefully that gets me a good job somewhere else. Hopefully.
>>
Am I retarded? Trying to pass in a function that adds or subtract a number from (fromEnum char) and convert it back to a char using toEnum. For example: (toCharFun (+3) 'a') "==" 'd'

toCharFun :: (Int -> Int) -> (Char -> Char)
toCharFun f ch = toEnum (f (fromEnum ch)) :: Char
>>
>>59148180
you could define inEnum :: Enum e => (Int -> Int) -> e -> e and make that generic, not sure if there's a better way of doing that
>>
>>59148180

withInt :: Enum a => (Int -> Int) -> (a -> a)
withInt f = toEnum . f . fromEnum

(exact same as what you gave)

>withInt (+1) 'a'
>'b'

If you're only doing a few, you can do this:
>succ 'a'
>'b'
>foldr (const succ) 'a' [1..4]
>'a' + 4
>'e'
>>
>>59147474
I don't get it. How are lisp and stacks related and how is C immune to stack issues?

From my vantage point C's ultimate failing was being too tied to a single hardware stack making coroutines impossible and the zeitgeist of threading models that were developed to work around that fact difficult to use and less performant overall.
>>
Does anybody know how software like Fraps works? Do you need to do something like DLL hooking/injection, or making a proxy DirectX DLL, something like that?

I want an overlay which can tell me my CPU & GPU temperatures in addition to frames per second, and I may as well try implementing it myself.
>>
>>59148532
obs-studio is relevant if you want to see how it does stuff https://github.com/jp9000/obs-studio/tree/master/plugins/win-capture
>>
>>59148532
I think they intercept DirectX and OpenGL calls or something.
>>
>>59148657
thanks senpai
>>
>>59148657
Thanks for the link

>>59149079
That's what I thought since that's how ENB and other vidya mods work

>>59149633
Why you pretending to be me famalam?
>>
>>59147279
I've been trying to write a ascii map generator in haskell for school and I have no idea where to even start
>>
>>59149852

Step 1. Learn haskell
>>
>>59149852
presumably it's cell-based

define a cell
>>
>>59149941
how is your progress coming along?
>>
>>59150037

Slow.
>>
File: atlas_yukarimeter.png (3MB, 1615x1077px) Image search: [Google]
atlas_yukarimeter.png
3MB, 1615x1077px
Anyone familiar with the Anderson acceleration scheme? Not even my supervisor has heard of it.
>>
File: whyLua.png (553KB, 406x898px) Image search: [Google]
whyLua.png
553KB, 406x898px
what do I use Lua for?
>>
If you were to design an instruction set for a processor or programming language virtual machine, what instructions would you include?
>>
>>59149941
>>59150037
>>59150059
what is this tripfaggotry?
this isn't reddit
>>
std::reply << 59150202
How new?
>>
>>59150180
Letting users add functionality to your program
>>
i want to make a program that can do some modular arithmetic and also save/recall data, but ive only mucked about with c++ a bit and havent figured it out yet
>>
I have an assignment creating a basic compiler using bison and lexx for the first time, pretty interesting, too bad I suck at programming
>>
>>59150202

upvoted ;)
>>
>>59150222
So like modding? Does it matter which language my program is written in or does it have to be something like C++?

I know for games like Payday2 and WoW you can write lua scripts to make add-ons or mods but they are written in C++ I think.
>>
>>59147317
lol
>>
If Rust is so great Why doesn't Terry use it for his OS?
Atheists serve'd again!
>>
>>59150300
>Does it matter which language my program is written in
It has to have support for LUA interoperability, which practically every major programming language does because LUA is so popular.
>>
>Walk into office
> So tell me what do you know about OOP?
>OOP IS PURE GARBAGE AND IT MAKES CODE INTO SPAGHETTI CODE
>Can you please leave right now
>*autistic screeching*
>>
>>59150574
>things that didn't happen in the office i never visited to do the job i never had
>>
File: notify.png (89KB, 1218x1015px) Image search: [Google]
notify.png
89KB, 1218x1015px
>>59147517
Thanks for letting me know about this library, it's pretty cool dude. On debian though the notifications don't really show up, you have to seek them out to find them. Pretty annoying. Unless I'm doing something wrong.
>>
File: 1481079842349.jpg (105KB, 492x661px) Image search: [Google]
1481079842349.jpg
105KB, 492x661px
>>59150553
>LUA

It's Lua you fucking faggot. Did you not read the Lua author's fucking wishes on the matter? Fucking kill yourself.
>>
>>59150202
just filter them
>>
>>59150202
I would give u gold but I can't see ur name fugggK
>>
>>59150712
gib jew gold plz
>>
>>59150581
I'm glad you found it interesting. I suggest you read https://wiki.archlinux.org/index.php/Desktop_notifications if you're interest in implementation in other languages.

btw, I'm using Arch Linux + KDE and the notifications show up normally. It's probably your DE.
>>
>>59150591
Stay triggered, LUAser.
>>
Will C programming change after Unified Memory?

What's the best candidate today for unifying RAM and HDD/SDD? Memory that's as fast as RAM but non-volatile like HDD/SDD? How long until it's available for consumers?
>>
>>59150194
Depends whether you want it to be stack based or register based. Since it's a virtual machine stack-based would probably make more sense as you don't gain anything from using registers in memory vs a stack in memory, but if you wanted to do dynamic recompilation (instead of interpretation), your programs would run faster if you could translate virtual registers into physical registers rather than having to still do everything on the stack. Java and C# can translate stack operations into register operations though so basically it doesn't matter.
>>
>>59150868
>Unified Memory
That's stupid. By the time we have persistent memory as fast as modern RAM, RAM will be even faster than that.
>>
File: le epik funnay maymay.png (17KB, 506x123px) Image search: [Google]
le epik funnay maymay.png
17KB, 506x123px
>>59150788
I figured out why I wasn't seeing them. Now I'm having a similiar issue as you trying to get bigger images. I'll let you know if I discover anything.
>>
>>59150943
Stack-based.

I also thought about adopting the split stacks model formerly used by Go, Rust and implemented by GCC. This would make for comfortable memory allocation as the stack becomes unbounded and would also allow advanced stuff such as delimited continuations.

I think including an explicit "split the stack at this point" instruction is vital to avoid the "hot split" problem Go had. This way you can generate code that creates a new stack before loops, stopping the constant allocation and deallocation Go experienced

>dynamic recompilation

I thought about creating a really small VM with a general system call interface, initially for x64 Linux. Then I'd implement things like I/O on top of the VM without using stuff like libc.

With this minimal interface it's possible to allocate executable pages and write a good JIT tailored for a programming languafe. So the basic interpreter doesn't even have to be fast
>>
File: 1167 - Z8BHwCY.png (9KB, 401x367px) Image search: [Google]
1167 - Z8BHwCY.png
9KB, 401x367px
>>59150581
time for https://atom.io/
>>
>>59151068
That sluggish piece of trash? You're not serious, are you?
https://pavelfatin.com/typing-with-pleasure/
If you were suggesting I man up and get better at vim I'd understand. Atom is garbage.
>>
File: 69aeb49f5f2cccd9c0d7b241b757b6f9.jpg (652KB, 850x1200px) Image search: [Google]
69aeb49f5f2cccd9c0d7b241b757b6f9.jpg
652KB, 850x1200px
Filling out a stupid performance document.
I don't know if I'll continue with Haskell. This may sound obvious, but it doesn't feel practical. I'm sure it's great for academics, but I don't care about theoretical masturbation. Everything feels counter intuitive from a practical point of view. Even doing I/O is a nightmare because Haskell is a pure language.
I'm currently looking at the following languages: OCaml, Scheme and Common Lisp. I know that some impressive software is written in OCaml, like FFTW. I'm slightly familiar with Scheme. I don't know about Common Lisp.
Any suggestions on what to do next?
>>
File: file.png (157KB, 1630x833px) Image search: [Google]
file.png
157KB, 1630x833px
>>59150180
Personally I'm using it to write features for my game, the core is written in C++ though.
>>
>>59151130
IO is easy in Haskell
>>
>>59150591
>Did you not read the Lua author's
Yes I did, that's exactly why I call it LUA.
>>
File: 1484143370773-1.png (977KB, 1920x1088px) Image search: [Google]
1484143370773-1.png
977KB, 1920x1088px
>tfw don't want to work for Mr. Shekelstein because I think it's a waste of time
>not creative enough to be an entrepeneur
>not sure if I'll like the academy

Do you feel like this, /dpt/?
>>
>>59151470
please don't use bill gates picture for the abomination called windows 10
>>
>>59151470
Yeah, except I'm too introvert to be an entrepeneur.
>>
>>59151130
Why not a real programming language like C?
>>
>>59151170
I find it really frustrating compared to other languages.
>>59151744
I'm actually leaning towards using C again. That shit just works.
>>
>>59151777
Common Lisp feels weird to me, with it's weird syntax and lack of constructs like static typing, but I kind of like it.
>>
>try learning x86 Intel assembly
>if my machine differs from the textbook author's in any way, everything is fucked up
JUST
>>
File: lost sleep wojak.png (34KB, 633x758px) Image search: [Google]
lost sleep wojak.png
34KB, 633x758px
>In CS class
>Group project with a friend
>Last year, we ended up with two idiots
>One of them spouted memes, the other wouldn't shut up about fucking his GF
>They made three total commits to the repository, and we had to finish everything ourselves
>Declare that this year will be different
>Get in a group with a self-proclaimed "web development expert" who had an internship and a nice enough guy
>First group meeting, one of them starts talking about how much he loves memes
>notthisshitagain.html
>It becomes increasingly clear that they don't know what they're doing
>"Web dev expert" has never heard of bootstrap
>It's two semesters into the project, they have made one commit each and my friend and I have over 50 apiece
>They commit to the repository by downloading the .zip from github and reuploading things they have edited

College is a joke.
>>
File: image.jpg (331KB, 750x1334px) Image search: [Google]
image.jpg
331KB, 750x1334px
Test
>>
>>59151940
>Two semesters
what
>>
>>59151940
Grow some balls and be the team leader you beta male pussy.
>>
>>59151940
>First group meeting, one of them starts talking about how much he loves memes

That's such a weird thing to do. Can you expand on what he said exactly? How does his love of memes even crop up in conversation.
>>
>>59147279
Dennis has big eyes
>>
>>59151980
It's a two semester long project. And it's hell.

>>59151990
They don't know how to program. We make them do everything non programming related. At this point, I wouldn't want them to touch the code.

>>59151997
As we were sitting there trying to work, he started pulling up memes on his laptop to show to everyone. No one was laughing but he kept at it, talking about which memes he thought were especially hilarious.
>>
>>59151940
I simply hate alumni who can't learn by themselves. CS is a course for autoditacts.
>>
File: 1488196323931.png (98KB, 1105x1185px) Image search: [Google]
1488196323931.png
98KB, 1105x1185px
>>59152065
>he started pulling up memes on his laptop to show to everyone
ALWAYS
>>
File: 1486916586115.jpg (47KB, 600x291px) Image search: [Google]
1486916586115.jpg
47KB, 600x291px
faggots lmao
>>
>>59152091
I'm beginning to worry that no one in my school is actually learning anything. What will they do when they graduate and try to find employment?
In my class, half the groups didn't have a single thing to show for their group project after working for four months.
FOUR MONTHS, and they didn't have a demo.
I'm not exaggerating. These were four person teams and they couldn't show anything off after four months of work.

>>59152112
I'd really like to make friends in the CS program but most of them are meme-spouting mouthbreathers.
>>
>>59152112
I hate it when someone thinks its HILARIOUS to show you some """funny""" youtube clip that you have to force a chuckle to. My strategy is to repeat the joke back while 'laughing'. It allows you to move on while not looking like a dick.
>>
>>59152065
>>59152151
Christ. Are you towards the end of your degree? There really needs to be some kind of superior retard culling mechanism where your ability to hammer out projects and labs isn't the only metric that pushes you forward, would have totally prevented this know-it-all meme kiddo in my current night class from being able to register. No, no one wants to hear your interrupt class because you want to say some stupid shit about Arch Linux or stutter out "H-HOW ABOUT I-INSTALLING GENTOO"

>What will they do when they graduate and try to find employment?
They won't. I know for a fact three people in my class won't find employment or move on because they're the exact same kind of person you're describing. They're the people who become /g/tards posting about how "university is a meme" after doing that garbage for 2-4 years depending on how they arrived.

>>59152091
>alumni
That's not how alumni works. You're looking for undergrad or student.
http://www.dictionary.com/browse/alumni
https://www.merriam-webster.com/dictionary/alumni
>>
File: IMG_0401.jpg (38KB, 308x308px) Image search: [Google]
IMG_0401.jpg
38KB, 308x308px
>>59147279
I volunteered to making a website for the "club" I attend.
>>
>>59152184
Oh, my bad. I'm clearly not from the US and here alumni literally means "students", in a common way. Sorry about that.
>>
>>59147576
There's PyQt available.
>>
>>59152184
Yes, I'm about to graduate.
You know what's scary? The self-proclaimed "web dev" who didn't know what Bootstrap was already has a job once he graduates. A company has already hired him.
He wrote on his resume that he knows "assembly." By this he means, we took a rudimentary assembly class. We didn't even learn how to print strings to console in that class. The most advanced thing we did was basic arithmetic with an assembler.
This guy doesn't know how to use github.
This guy doesn't know what Angular is.
He doesn't know the difference between "backend" and "frontend."
His personal site looks like shit.

He's going to have a job with a $70,000 salary when he graduates. They've already hired him.
>>
>>59148076
>I get told that doesn't count as work

Holy fucking shit. Being an intern doesn't count as work experience? Fuck those people, they're fucking retarded.
>>
File: 1455504543506.png (895KB, 1058x1080px) Image search: [Google]
1455504543506.png
895KB, 1058x1080px
>>59152261
You can't be serious. Even a pajeet would do a better job.
>>
>>59151130
Learn Racket instead of regular Scheme.
>>
>>59152261

Don't people like him get fired and blacklisted though? Or not?
>>
>>59152329
I've read through Realm of Racket and I liked it. I haven't build anything with it though...
>>
>>59152261
He better have the most silver tongue in the land for $70k/year. I should have just bit the bullet on the time and price tag for a CS degree if literal brainlets can put their courses, html, css, and javascript on their resume and get $70k. I'd be making six-figures if he can make mid 5.

>>59152339
He probably will be once that company finds out that he's not just lacking in intellect/ability because he's a student.
>>
>>59152323
100% serious. My friend and I are losing our minds over this.

>>59152339
God, I hope so. I hope they give him a rude awakening when he gets hired.
>>
>>59152261

I deal with this faggots every semester, but anon, let's be real, he's really ahead of you, and you're mad about it let's see:

>used you for making his project
>landed a job
>getting paid for not knowing how to do shit
>you are actually talking about it on 4chinzz while he's working on a monday on an actual job that makes him money, and it is related to your field
>when you graduate, he's gonna have at least a year of 'expirience' while you have 0
>>
>>59152151
"No one in my school hasn't learned anything" please tell me thats not the case in college. I want to go into CS for knowledge.
>>
What are the pitfalls I should look out for when I have a class that has dynamically sized data elements. I'm dynamically allocating an array in my constructor based on a size parameter passed in. So different instances of this class have different sizes. Does this prevent the compiler from being able to automatically make me a copy constructor? And what happens if create a pointer to class, then have it point to the address of a class instance? How does it know how big the class is?
>>
>>59152504
He's not working now. This project isn't even on his portfolio. He got hired before we started the project, his resume is just entirely lies.

>>59152514
I've barely learned anything in class, but I had about 4 years of self-teaching before I went to school. My recommendation is, do as many out of class projects as you can. That's the only way you'll get good unless you go to a quality school.
>>
>>59152514

Not who you replied to, but at uni you have to push yourself to not only study, but go to the job fairs, contact companies for internships, learn advanced material (of the subject you're interested in), etc. You could do just the curriculum, but find what you're interested in, talk to professors about your choices, and start networking.

And it's going to feel very very strange for the average /g/entooman at first, but you have to learn to talk to people.
>>
>>59152514
you can go through college without learning anything just barely getting by, or you can learn a lot.

It is not like highschool where you have people holding your hand -- it is moreof what you make it yourself.

The first few semesters maybe you get more guidance, but later on you are mainly on your own in what you make of things.

That is not to say there is no point, a large part of universities and colleges is to have an atmosphere of peers and professors etc to share knowledge and exchange information with, as well as facilities like libraries and laboratories.

It is possible to achieve success on your own too, but you have more opportunities with the various accommodations a university gives.

A secondary and tertiary aspect is that the university can to some extent certify your progress through exams, and I guess various companies can reach out to graduates to recruit too.
>>
>>59152582
who the fuck cares, you start by lying but he's one true job ahead of you.

you need to take a better look at the world around you or you'll get tossed around like nothing, you CAN lie, and in most situations you will have to, at the begining.

he's doing it right, and you're mad about it.

>>59152586
and he probably also does this too. Don't waste your time, not everything is knowing how to do X properly, you have to have your way around people, and stop people like these from leeching you, throw them off your group on the first chance
>>
>>59152514
A lot of professors are hacks who no longer give a shit because they have tenure and are close to retiring anyway.
>>
>>59152514
>Undergrad
you can learn a lot if you try, you can also drift through
>Graduate
Way more accountable and you are forced to learn or drop out
>>
>>59150416
Terry already has his own language HolyC
Besides, based on his philosophy, he's very against safety.
>>
>>59147317
fpbp
>>
>>59151997
I Fucking Love Memes
>>
>>59152932
>safety
That's for cowards.
>>
Bunch of nigger cattle in this thread
>>
How can I make it from Europe to Silicon Valley as a programmer?
I want to live the American dream, with a big house, big cars, a big wife and big kids.
>>
Hey guys! I made a command-line minesweep in two different languages, C++ and Clojure. The first one is object-oriented, while the second one is pure functional. Which one is harder to read?

https://github.com/saolof/simpleMinesweep/blob/master/simpleMinesweep/simpleMinesweep.cpp

https://github.com/saolof/clj-minesweep/blob/master/minesweep.clj
>>
>>59153233
the american dream is dead
t. trump
>>
Hey /g/, my roommate in college stole some of my code/assignments for my class and now I'm on an academic integrity mess

Because my account is differing from his (the nigger said I willingly shared the code which is false) they're deciding to punish both of us and this shit will be on my record


How fucked am I with employers assuming worst case scenario and I get disciplined? I've heard there's a file they can access for about 7 years and a shit stain on my unofficial transcript (not the official, thank god), but do they check/ask for this kind of shit?

I might need to get a lawyer if needed cause this is bullshit
>>
>>59153332
Beat him hard until he says he stole your code.
>>
>>59153332
Your own fault for not writing all your code under GPL licence
>>
>>59153370
Thought seriously about it, but it would backfire hard
>>
>>59153332
>>59153370
this desu
Talking with this kind of guy won't do shit. Unless, of course, you use underhanded methods.
>>
>>59153234
The Clojure one is too clever and uses ugly dynamic typing tricks and macros. Functional vs OOP/Procedural doesn't have much to do with it desu.
>>
>>59153390
Yeah do they check this shit or in case they do should I just be straight about it?

Fuck this to all hell man
>>
>>59153411
There's a reason why people put a licence on their code projects. I'm just mentioning it since you are talking about getting a lawyer.
>>
>>59153453
Lesson learned I guess. I'm mad as fuck.
>>
File: krautbbs.png (53KB, 816x550px) Image search: [Google]
krautbbs.png
53KB, 816x550px
I'm working on a BBS simulator using data from a certain german imageboard.
So far you can do everything you need to do to lurk more.
I'm planning to include a mass per-thread-downloader as well as a image to ANSI converter to preview images.
And once that is done, I'll do one for 4chan because lurking in a terminal is comfy as fuck.
>>
File: shiny.png (441KB, 575x575px) Image search: [Google]
shiny.png
441KB, 575x575px
>>59152657
Nice meme.

>tenure
Doesn't mean shit m8, they have no more job security than anyone one who is working full-time on a salary.

Professors are not hard to get rid of because of muh sekrit club contracts, but because their knowledge is specialised and finding someone to replace them takes time.

If anything, it's the other way around, they have clauses restricting how much notice they have to provide before leaving without any repercussions.
>>
struct A
{
struct
{
unsigned a, b, c /* etc... */;
} const value = { };
A() { *this = reinterpret_cast<A>(get_values()); };
static auto get_values(){ /* ... */ }
}

this seemed fun but it's not allowed apparently.
>>
File: 1474325315193.jpg (44KB, 636x616px) Image search: [Google]
1474325315193.jpg
44KB, 636x616px
Employed Haskell programmer here
>>
Daily Reminder

java programming is king
>>
>>59153702
Didn't you make the exact same post with the exact same image a couple threads ago?

I'm still interested to know what you use Haskell for though.
>>
>>59153759
Do you want fries with that?
>>
>>59153579
Pretty cool desu
>>
Need help with implementing generics

class Main() {

ListOfStuff<Integer> listOfStuff = new ListOfStuff<Integer>;

}

class ListOfStuff<T>() {

public T[] stuff = new T[100];

}


How do I make an array out of generics in ListOfStuff? Alternatively, how do I make my code recognize the Main class converted the generic T to an integer?
>>
>>59153874
dont you miss something like template T above class ListOfStaff
not sure sure

language? looks like pseudocode
>>
>>59153874
>class Main()
Are you sure you should be working on generics right now
>>
Building a graph of the network infrastructure of a national ISP

They have all their network information, including interface names, in DNS, so as a proof of concept I wanted to build a graph.

It has a very simple architecture, where all the local access routers are redundantly connected to two distribution routers. Those distribution routers are then connected to the peering router.
>>
File: shader.png (58KB, 785x355px) Image search: [Google]
shader.png
58KB, 785x355px
Someone good with Unity Shaders?
I want a shader for a cube, so only the edges are visible. Works already, but if one side is much bigger the line is thicker, since everything are percentages atm.

Is there a way to get the model length in the shader? so i can calculate the shorter side and use its thickness?

Shadercode: http://pastebin.com/UKVMvFzm

relevant part atm is:
>fixed4 frag(v2f i) : COLOR
> {
> fixed4 answer;
>
> float lx = step(_LineWidth, i.texcoord1.x);
> float ly = step(_LineWidth, i.texcoord1.y);
> float hx = step(i.texcoord1.x, 1.0 - _LineWidth);
> float hy = step(i.texcoord1.y, 1.0 - _LineWidth);
>
> answer = lerp(_LineColor, _GridColor, lx*ly*hx*hy);
>
> return answer;
> }
>>
>>59153980
This is what I meant, the big dark connections are to the distribution routers. Those distribution routers also pull full routing tables.
>>
>>59153935
>not naming the class with your main method Main
>>
>>59147633
DON'T bring your laptop to work if you have projects on it that you are working on at home

at least if you don't want them to claim those projects as their property
anything you bring into work or do on work time is their property
>>
>>59153999
thats a big graph
>>
File: wew.jpg (14KB, 300x168px) Image search: [Google]
wew.jpg
14KB, 300x168px
>>59154014
That's not how entry points work.
>>
>>59153874
public T[] stuff = new Object[100];
>>
>>59154067
Alright, then if someone instantiates ListOfStuff as ListOfStuff<Integer> how do I convert Object in this line to int?
>>
>>59154034
407 nodes and 658 edges
And there's approximately 20% of the edges still missing because they were not in DNS
>>
>>59154084
What do you mean?
>>
>>59154040
its obvious not real code.

And you can call your class whatever you want.
compiler will find the class with your main method and use it as your entry point.
>>
anons why are you still using a plebian language and not asm x86?
>>
>>59154034
for you
>>
File: 4u.png (28KB, 950x666px) Image search: [Google]
4u.png
28KB, 950x666px
>>59154133
>>
>>59154121
Because I'm not a compiler.
>>
>>59154121
>plebian
I hope your programs' syntax is better than your spelling.
It's "plebeian", not "plebian".
>>
>>59154148
Assembly doesn't have syntax.
>>
Still working on my twisty puzzle collection free game.
>>
>>59154200
GitHub?
>>
>>59154232
Yes.
>>
>>59148180
UCF?
>>
>>59154251
I was hoping for a link when I asked that
>>
>>59154200
Neat. I'd play it, You could totally throw some ads on there and release it for phones and shit. Make dat appshill money
>>
>>59154200
yep you should do this >>59154282 and bring it on the market.
>>
Help. I want to change a 2d dynamic array with a function.

But something like
void help(int **i){
i = (int**)malloc(sizeof(int*) * 10);
for(int c = 0; c < 10; c++){
i[c] = (int*)malloc(sizeof(int));
*i[c] = c;
}
}

int main(){
int **i;

help(i);

for(int c = 0; c < 10; c++)
printf("%d\n", *i[c]);
...

Gives me a segmentation fault.

Why doesn't this work and how do I fix it?
>>
>>59154282
B-but anon... it goes against my principles...!!!
>>
>>59154269
I know, but right now I am too ashamed of my code.

>>59154282
If I can compile it to android (it's made with OCaml) I will release it for free (no ads) on android.

>>59154282
>>59154299
For now you can play for free on android (no ads) Squareminx , which is a great inspiration for me.
>>
File: sicp.gif (2MB, 320x240px) Image search: [Google]
sicp.gif
2MB, 320x240px
How does anyone maintain any Joie de Programmation? Most of my 12 years of experience has been trying to work with someone else's mess, and often the simplest thing is a major undertaking because the toolset is fucked up GNU shit that doesn't even compile in its unpatched state). And don't get me started on standards. Are there any other fields where the most poorly designed piece of fucking wank always proliferates?

>>59154200
Are those garbage collection pauses or is my Firefox just starting to stutter when playing webms again?
>>
>>59154341
>garbage collection pauses
What are you talking about? Download the webm and play it in a video player. My game is reactive, if there are pauses it's because I stop moving my mouse.
>>
>>59154302
You're just modifying a local variable.
Any change to i like that inside 'help' will not affect the i in main.
You would actually need a int *** for what you're doing there.
>>
>>59154146
whats a compiler, anon?
>>
>>59154302
1. in the line help(i) you're operating on an uninitialized pointer
2. in help you are assigning to the parameter, which will only give you a useful value for the duration of the function
3. stop casting the return of malloc, and stop using sizeof(type)
4. can't be bothered to continue
>>
>>59154371
You're right, it's not stuttering in mpc.
>>
>>59154383
Something that takes (something which is neither assembly or machine code) as input and produces assembly or machine code as output.
>>
>>59154421
A compiler doesn't have to output assembly or machine code
>>
>>59154372
Thanks

>>59154385
>3. stop casting the return of malloc, and stop using sizeof(type)
What's wrong with this
>>
>>59154515
>What's wrong with this
There is absolutely no advantage of doing it, and just duplicates information.
>>
>>59154515
Casting the return of malloc masks a range of programmer errors that can arise, and using sizeof(type) can introduce crashes where the type of the lvalue changes at a later date (and the sizeof(type) does not get changed with it).

The idiom is:
p = malloc(sizeof *p);
if(p == NULL)
panic("shit's fucked\n");
>>
I've been doing some project euler problems, and I find that that stuff is more aimed at math concepts. Not so much at computer science or in general programming.

Anyone know an alternative to project euler for more computer science concepts?
>>
>>59154475
Technically it does. If it "compiles" one high level language to another, then it's technically a transpiler or automatic code generator. If it targets a virtual machine instruction set, then it's still emitting assembly or machine code, the compiler doesn't care if the target machine is implemented in hardware or software.
>>
>>59154668
Just goes to show that maths people are pretentious wankers, and they're usually shit programmers too.

And unfortunately no, because I've been wondering this too. I have no personal need of any new programs, so I need some fairly attainable busywork projects.
>>
>>59154668
>Anyone know an alternative to project euler for more computer science concepts?

Come up with your own project?
>>
File: smug51.jpg (66KB, 418x466px) Image search: [Google]
smug51.jpg
66KB, 418x466px
>>59154668
>I find that that stuff is more aimed at math concepts. Not so much at computer science or in general programming.
Newsflash boy, comp sci is a branch of math.
>>
>>59154571
If your changing the lvalue to a type of greater size, then u need to realloc.
I dont see how this can be avoided.
>>
File: 1477003285630.jpg (229KB, 627x720px) Image search: [Google]
1477003285630.jpg
229KB, 627x720px
>>59154703
what
>>59154771
yeah i think this is what i'll need to do. ill try doing euler shit anyway since i might as well know these concepts. the math isn't hard anyway

>>59154836
and every single project i will participate in will be based on math? right
>>
>>59154939
What I'm saying is you no longer have a single point of truth, and you or anyone else can easily overlook this fact:
- Shit *p = malloc(sizeof(Shit));
+ Cocks *p = malloc(sizeof(Shit));
>>
>>59147444
Could be interesting to use within a video streaming service.
Problem is that I don't like cgo very much, it doesn't provide Go utilization and diffusion, rather it "patches" the lack of native libraries through expensive external bindings.
Better use C/C++ directly, then.
>>
>>59154992
>single point of truth
Are you intentionally speaking abstractly?
What point are you trying to make?
Does it have to do with sizeof()?
>>
>>59147576
Wow, you're in my shoes 5 years ago. Hold on to your ass kid because it's going to be rough, but the end goal is so sweet. Engineering title, easy software development job, and virtually untouchable job security.
>>
>>59155018
In p = malloc(sizeof *p) there is one point of truth: p. If the type of p changes then sizeof *p also changes without any alteration by you.

In p = malloc(sizeof(type)) there are two points of truth: p and sizeof(type). If the type of p changes, sizeof(type) does not change without your intervention. And if you don't change it, the program will probably crash.
>>
>>59151470
I don't consider myself terribly creative or outgoing but I have managed to be sustainable and self-employed for three years thus far. The academy is something I know nothing about, but corporate is insane. I couldn't do it once my second kid was born. Too much commuting, too many "crunch," time operations, and no respect at all for life outside the concrete bubble.
>>
>>59155133
How do you change the type of p?
>>
>>59155171
You must understand that we are talking about source code, not run-time changes.
>>
>>59152091
>CS is a course for autoditacts.
That's correct. It's also why many of the higher caliber programmers are dropouts and self-starters. There's a low chance for someone who needs to be lead by the nose through curriculum in college to become a successful developer in the long term. Fortunately we live in a world where these incompetents can be code monkeys.
>>
>>59155197
Ohhhh...
i was trying to find where your retarded.
and there it is, thanks.

If changing
int *c = malloc(sizeof(int));
to
float *c = malloc(sizeof(float));

Is too much for you, you should stop giving advice.
>>
>>59152323
I believe it. We've got 70+ on staff at my company in New York, about a quarter of those are new to the company, young, mostly new grads. Half of them are jaw-dropping incompetents who crammed for the interview and otherwise learned nothing in their college years. Frankly if they ever push me into a hiring position I'm going to put people with CS degrees lower in the stack. It's that bad.
>>
>>59155244
p = malloc(sizeof *p);
is nicer to read AND offers less scope for bugs than
p = malloc(sizeof(type));
you nigger

if you do not use this standard idiom you should not be writing C
>>
>>59155260
I use structs with variable size, in which that would not alloc enough data.
Youll learn about it in CS102.
>>
>>59152514
>I want to go into CS for knowledge.
Then do the MIT Open shit, buy some high quality textbooks, and get the knowledge. Being in a university setting doesn't give you knowledge, it gives you potential connections. If you value those connections, learn ahead of time, then breeze through college and spend as much time there as possible connecting with employers, wealthy peers, and professors who have other connections.
>>
>>59155288
Show me a "struct with variable size" for which sizeof *p would not give the correct size.

>Youll learn about it in CS102.
And you'll learn that parts of industry have banned sizeof(type) due to the number of times human error has caused crashes. MISRA prohibits it, NASA JPL prohibits it.

Standard idioms. Use them.
>>
>>59147279
working on changing the project layout of a small-ish c project. going from a 1 file 2000 line DLL and about 10 other .c files to something more manageable and modular. Holy shit was this a mistake, every include was an include to a c file not a header. There were tons of globals. What's the proper way to handle globals across files? I tried putting them in a common header but the compiler hates that telling me I've defined them twice. Don't lecture me on globals, it's not my project. I just need to get it to a compilable state before I start attacking method signatures to get rid of the globals.
>>
>>59155329
struct varSize {
char array[];
}
>>
>>59155339
sizeof *p is the same as sizeof(varSize)
>>
File: 14757469481860.png (8KB, 640x480px) Image search: [Google]
14757469481860.png
8KB, 640x480px
>>59147279
>var you = ugly.split("");
>if (alibi == NULL) {
return you;
}
>>
>>59155244
>i was trying to find where your retarded.

wow
>>
File: 1464737172711.png (5KB, 250x159px) Image search: [Google]
1464737172711.png
5KB, 250x159px
this might be the most beautiful language i have ever seen
>>
>>59155378
i guess i could do malloc(*p + additional data).
Didnt think of it that way.
>>
>>59155260
What about void pointers for abstract types?
>>
File: laughsuperlative.jpg (331KB, 517x768px) Image search: [Google]
laughsuperlative.jpg
331KB, 517x768px
>>59155459
yeah how is sizeof supposed to know how much data you're going to want in the future? let's not be ridiculous now

>>59155484
sizeof(realtype)
>>
Why learn anything but C and Assembly?
Anime isn't real by the way.
>>
File: 1443604195353.jpg (125KB, 800x720px) Image search: [Google]
1443604195353.jpg
125KB, 800x720px
C++ or self-made OOP in plain C?
>>
>>59155509
malloc(sizeof(type)+additional data)
>>
>>59155533
C, and no OOP at all.
>>
File: Capture.png (119KB, 1542x842px) Image search: [Google]
Capture.png
119KB, 1542x842px
i'm trying to learn oop programming by making a project with 3 classes to calculate medical bills for a patients hospital stay in c++.

whenever i try to add surgery costs to the total amount of the bill it will only add one and wont keep adding more as i select more surgeries, then when i move out of the while loop it goes back to the base cost. hope i explained that well enough. can anyone tell me where i fucked up? i can post more screenshots if needed
>>
>>59155533
C with function pointers WHERE APPROPRIATE.
>>
>>59155544
Sounds like you make a new object inside the loop.
Once you leave the loop it forgets about those newly made objects and goes back to the original.

>>59155509
what is realtype?
Stop making up terminology
>>
What is the most proper method of inline commenting? Double tabs?
import std.format;
import std.stdio;
import std.string;

string format_name(string first, string second){
return capitalize(first)~" "~capitalize(second); //only because I was instructed to use the ~ operator
}

void print_name(){
write("Enter your name: ");
string input = strip(readln());
string first_name, second_name, overflowed_name;

uint number_parsed_input = formattedRead(input, " %s %s %s", &first_name, &second_name, &overflowed_name);

if (number_parsed_input < 2){
writeln("Input underflow. Please enter both of your first and the last name.");
print_name(); //start over
} else if (number_parsed_input > 2){
writeln("Input overflow. Please only enter your fist and the laste name.");
print_name();
} else { //if number_parsed_input == 2
writeln("Hello, ", format_name(first_name, second_name), ".");
}
}

void main(){
print_name();
}


$ ldc2 test.d && ./test
Enter your name: test
Input underflow. Please enter both of your first and the last name.
Enter your name: test test test
Input overflow. Please only enter your fist and the laste name.
Enter your name: test test
Hello, Test Test.
>>
>>59155525
because fortran is faster in number crunching than c
>>
>>59155601
There is obviously no "proper" way,
But google has articles filled with people opinions.
>>
File: Capture.png (49KB, 1322x547px) Image search: [Google]
Capture.png
49KB, 1322x547px
>>59155575
is this part creating a new object instead of passing the one from main so it can be accessed by the functions in the surgery class?
>>
>>59155544
pass patient by reference when you add the charges and use "->" instead of "."
>>
GCC 7 WHEN?
also
sepples modules when?
>>
File: 47656126.png (378KB, 1450x1080px) Image search: [Google]
47656126.png
378KB, 1450x1080px
>>59154668
Pic related
>>
>>59155685
>------
I don't use C++ but shouldn't you be using proper formatting methods to produce horizontal lines?
>>
>>59155685
Java only passes by value, not pass by refrence, as far as i remember. Try googling those terms.

http://stackoverflow.com/questions/40480/is-java-pass-by-reference-or-pass-by-value
>>
>>59155717
i'll make it look nicer when i get it running
>>
File: take_responsibility.png (315KB, 558x534px) Image search: [Google]
take_responsibility.png
315KB, 558x534px
>>59155533
>tfw using C++ and not doing any OOP
DEVILISH
E
V
I
L
I
S
H
>>
>>59155727
it's C++

>>59155685
it should be
surgeryCharges(int num, PatientAccount& patient)
...
patient->addCharges(surgery)

the way you call it at the moment is pass by value, so surgeryCharges is takes a copy of the object you give it that only exists at the scope of surgeryCharges. To modify an object you need to pass it by reference/pointer. "->" basically means access member of structure/class that is at whatever address (as you aren't passing the object, but actually it's address in memory).
>>
>>59155785
fuck
>the way you call it at the moment is pass by value, so surgeryCharges is takes a copy of the object you give it that only exists at the scope of surgeryCharges. To modify an object you need to pass it by reference/pointer. "->" basically means access member of structure/class that is at whatever address (as you aren't passing the object, but actually it's address in memory).
>>
>>59155711
good idea, i had forgotten about this. fuck project euler honestly.
>>
>>59155785
>>59155803
thanks dude it's working now
>>
File: ThanksAndrei.png (11KB, 1024x768px) Image search: [Google]
ThanksAndrei.png
11KB, 1024x768px
>>59155601
>>
>>59155883

t. Baklava
>>
File: v2.png (10KB, 1024x768px) Image search: [Google]
v2.png
10KB, 1024x768px
>>59155968
version 2
>>
>get program working on linux
>try compiling on windows with mingw/msys
>can't find ftw.h
For fuck's sake, why can't this shit just work?
>>
>>59155260
Doesn't work if you're trying to allocate an array.
>>
File: SussmanAbelsonBTFO.png (7KB, 1024x768px) Image search: [Google]
SussmanAbelsonBTFO.png
7KB, 1024x768px
>>
>>59156250
Yes it does, idiot.
>>
>>59156250
n*sizeof(*p)
>>
>>59155883
>>59156008
Your fonts are so trash it's making it hard for me to read. Can you atleast post in code blocks?
>>
>>59156117
MinGW does have conio.h though.
>>
>>59156318
That's bad style because you're using asterisk to mean two different, unrelated things in the same expression.
>>
>>59156384
So?

What the hell is wrong with these people? If they're not going to make something that works then they should fuck off and stop claiming that their shit works.
>>
>>59156404
>C
>portability
>>
>>59156400
haha
>>
What's the modern equivalent to shitty Flash games on Newgrounds and Kongregate?
>>
>>59156511
unity

to be fair i know of no "modern" engines that aren't a big heap of steaming sepples inheritance, and nobody has time for that
>>
>>59156363
lel, that's my Gentoo VM that I use when I'm on Windows. Command line only, so no CodeBlocks

http://pastebin.com/d3VZqJ8U
>>
>>59156428
Fuck it, I'm going to use Rust for future code. C++ isn't going to be any better.
>>
>>59156547
It's
code blocks
, not Code::Blocks
>>
>>59156551
Good choice. If I had to make a software that gives a shit about bugs and preventable exploits I'd use Rust.

I would never program a system for a powerplant with C
>>
>>59156576
Should have said code tags m8
>>
Imagine you're trying to submit a programming problem to a contest, but with no success.

but you have an executable of the solution.

can you do anything with it?

even testing some test cases with the solution you can't find any differences from yours to the solution
>>
>>59156603
>but with no success.
why
>>
>>59156593
I'd use Go or Ada thank you very much.
>>
>>59156621
i can't get accepted no matter what.

it always say wrong answer, and yet every test case i do is correct
>>
I did not expect this to work
template<std::size_t size>
union [[gnu::packed]] split_uint
{
struct[[gnu::packed]]
{
split_uint<size / 2> lo;
split_uint<size / 2> hi;
};
std::uint64_t value : size;
constexpr split_uint() : value(0) { }
constexpr split_uint(std::uint64_t v) : value(v) { };
constexpr operator std::uint64_t() { return value; }
};

template<>
union [[gnu::packed]] split_uint<8>
{
std::uint8_t value;
constexpr split_uint() : value(0) { }
constexpr split_uint(std::uint8_t v) : value(v) { }
constexpr operator std::uint8_t() { return value; }
};

using split_uint16_t = split_uint<16>;
using split_uint32_t = split_uint<32>;
using split_uint64_t = split_uint<64>;

int main()
{
split_uint64_t v { 0x12345678 };
std::cout << std::hex << v.lo.lo.lo << std::endl;
std::cout << sizeof(split_uint64_t) << std::endl;
std::cout << sizeof(split_uint<8>) << std::endl;
}

but it do
>>
>>59154187
Yes it does you fucking retard. You have to follow the syntax rules of whatever assembler you're using
>>
>>59156688
"putting tokens in the right order" is not "syntax".
>>
Does anyone here know anything about QB64? I'm taking what is essentially introduction to introduction to programming and the professor has us using this shit but doesn't really provide any learning resources for it.
>>
>>59155747
Post some example code
>>
>>59156627
Patrician choice
>>
>>59156744
it's a quickbasic clone right?
QB had a useful contextual help, that's how I learned programming. press F1 on any keyword and it tells you what it does, with examples.
if QB64 doesn't have this, it's shit.
>>
>>59156744
There's a pretty extensive online wiki for it.
http://www.qb64.net/wiki/index.php/Main_Page
>>
File: 1488248151444.jpg (233KB, 503x662px) Image search: [Google]
1488248151444.jpg
233KB, 503x662px
>>59156428
>>
>>59156788
It does, but it's shit anyways. But something about it, maybe the syntax, just fucking bugs me since I already know bits of actual programming languages.
>>59156805
That's what I've been using to do some of the assignments if I got stuck.
>>
>>59156831
What "style" does your professor/book prefer to use? Is it the old way with line numbers and gotos, or is it more the structured style?
>>
How would I get started with making a text-based messaging app between two computers on the same network? I'm thinking of making it in Python
>>
>>59156882
>NET SEND
>>
>>59154956
correct me if im wrong but data sorting (for databases) has to do with logic and automata, the rest is gui design.
>>
>nvm fixed :^)
>>
>>59156726
Yes it is fucktard.
Are you fucking brain dead or something?
>>
>>59156941
No, it isn't. That would be like saying pocket calculators have syntax.
>>
>>59156975
Uh, they do
The ordering of tokens is LITERALLY the definition of syntax
You cannot really be this retarded
Oh I know, you're just baiting me right? That would make sense
>>
namespace stuff
{
void a() { b(); } // ERROR
void b() { }
}
struct stuff
{
static void a() { b(); } // this is okay
static void b() { }
}

>2017
why does this problem still exist?
>>
>>59157018
>why does this problem still exist?
Only because it's not Rust
>>
can someone explain how precisely this works to me like im retarded? i could understand how this would work if it was recursively expanding nodes and maintaining a path value, but it doesnt appear to be.
>>
File: newtab.png (2MB, 1516x789px) Image search: [Google]
newtab.png
2MB, 1516x789px
>lost the code to my custom newtab page
>remake it
>it's better
r8 h8
It filters out links based off of text entered. i.e. entering "adv" leaves 2 links, I can press 0 to take me to the first and 1 to take me to the second. Pretty good to use.
>>
So, is the kernel just a compiler with no limits?
>>
>>59156603
>but you have an executable of the solution.

It's called reverse engineering.
>>
>>59157115
What the fuck are you talking about?
>>
>>59157063
It's like reverse-recursion

Rather than recursively traverse the tree, you're adding elements (nodes) to the enumerable (frontier) and then starting the loop over, so eventually you either find a path or run out of nodes to explore
>>
>>59151628
this, no reason to tarnish a good man's name like that
>>
>>59157018
you don't know how static works?
>>
>>59157169
but like, how is it keeping track of the actual path? because the explored set is also going to contain all the dead end nodes too, right?
>>
>>59157200
I don't think that's part of the pseudocode because it says "return the corresponding solution"

I assume since you start with the leaf nodes, once you find the "goal" node you can just traverse up to the root?
>>
>>59157311
its a pathfinding algorithm, there is no up
>>
>>59157333
You can "shake out" the graph so that whatever node you're currently in is the root, and then starting from the leaf nodes work your way back up
>>
>>59147279
How do I become a high payed programmer?
>>
>>59157384
You start your own company and make big money aka become an executive.
>>
>>59157384
Learn Rust
>>
File: 48-laws-of-power.jpg (56KB, 350x404px) Image search: [Google]
48-laws-of-power.jpg
56KB, 350x404px
>>59157384
>>
>>59157407
>>59157407
But what should I study and what books should I read? And how many hours of programming should I do a daily?
>>
>>59157359
but why would you do that, when you could easily maintain a list of nodes in a path and return that?
>>
>>59157384
A combination of both luck and skill.
>>
>>59157614
Because then you can just say something like this (example given in C# without going through compiler, so excuse any errors):

List<Node> path = new List<Node>();

while(currentNode != root)
{
path.Add(currentNode);
currentNode = currentNode.Parent;
}

return path.Reverse();


which is sufficiently simple, and gives you the path to your destination
>>
>>59157697
there is no one parent though, its not a tree structure per se, because its trying to find a route through nodes that connect to other nodes in a non-hierarchical manner.
>>
>>59157744
I assumed that the graph could be interpreted as a tree because they say "choose a leaf node", so if it wasn't a tree you could run into a situation where there are no leaf nodes available

If this is incorrect, then you're right, you could end up in a situation where you can't interpret the graph as a tree with your current position as the root. In that case I don't see how the pseudocode would be useful besides proving a path exists.
>>
>>59157819
pretty much, but this is a supplied algorithm in norvigs book on AI, i would have assumed that im missing something obvious
>>
>>59157063
Hey, if you have the book, look at the previous diagram that shows the tree. Now imagine that the leaf nodes could somehow interconnect freely with any other nodes. That's really the only difference between the graph and the tree problems.
>>
>>59158027
thats a big difference though, with a tree you dont necesarrily need to record your steps, because you cant get stuck in infinite loops or make superflous node traversals
>>
>>59158048
Yep, and that's why you have that "explored" set, so that you can test the expansion nodes for membership before you add them to your frontier.
>>
>>59158069
Not the person who posted the question: How does that actually get you the path though? I agree that eventually you either run out of remaining nodes or end up at the destination node, but how do you then "return the corresponding solution"? The explored set doesn't necessarily contain an ordered path to the destination, but only nodes which were involved in reaching it, right?
>>
>>59147279
Guys, I feel like a really shitty programmer because I hate using """advanced""" data structures and struggle implementing anything involving something more complicated than a Linked List.
Is it possible to be a really shitty programmer and still work in [spoiler]Academia and research? I fell for the degree meme after dropping math because I couldn't stomache Analysis [/spoiler]
>>
>>59158175
Just go work for a big corp with lots of Java code.
>>
>>59158094
>>59158069
guy who posted it here, turns out he deliberately ommitted it so he could talk about it in a later section, but didnt mention it in the preceding or immediately following text.
>>
>>59158094
To you and the person who posted the original question, the authors expand on "getting the solution" in the section after introducing that graph search. If you have access to the newest edition, pg. 78. Essentially, they use a separate data structure to keep track of this. To your latter question, yeah. It's just all the nodes you've seen before.
>>
>>59158187
Coincidentally, Java is the one I have the most issues with, although thats probably because its what I'm most comfortable using. I made exactly one Linked List in the C++ class I took awhile back and couldn't recover a runaway pointer at some point and gave up on it
>>
>>59158175
Implementing data structures is a waste of time because someone has already written an optimally-performing version in whatever language you're working in. As long as you understand how to use them and any associated constraints (ex. ArrayList will need to resize, need to traverse entire Linked List to find an element, etc.) you don't need to worry about implementing them. If you mean that you have trouble using them in practical code, then I'd say that you should struggle through writing and re-writing them until you understand the ideas behind them.

>>59158206
>>59158214
So what is the actual answer?
>>
>>59158243
an entire section dedicated to relevant data structures from the looks of it
>>
>>59158236
I think I can honestly say in my five years of working in software that I've never had to implement a linked list. The majority of corporate software development is bashing out CRUD apps and dull GUIs.
>>
>>59158243
that sounds like a good idea but my jewish ass didn't bother buying the book for my Data Structures course I never ass myself into properly learning the material until its too late for the current project

>>59158263
that's what I figured the first time I ever delved into .NET stuff. Unfortunately I'm a masochist who's too afraid to leave the university life. I just want to teach CS, really
>>
>>59158309
>I just want to teach CS, really
You gonna need a PHD or a lot of working experience in the relevant field
>>
>>59158309
You don't need a book as long as you think critically about what the structure you're making should do - the only exception to this I can think of is weird esoteric structures that you honestly will probably be fine without ever knowing (like red-black trees or the graph traversal stuff being talked about).

However, if you're actually serious about wanting to teach CS without being able to write a linked list, you're probably in for a rough ride.
>>
315
>>
>>59158243
Each node has parent (the node that generated the current node) data associated with it, so my thought is once you hit a solution, travel backwards to the start.
>>
>>59158372
naice
>>
>>59158379
Glad to know I called the solution an hour and a half ago with >>59157311, my e-peen can sleep soundly now.
>>
>>59158338
>>59158366
I know, though my shitty state university allows Masters holders to be lectures which may whet my appetite for a bit
I promise I'm not retarded, I really relish in the all the theory behind most topics, especially those closer to math
I just really feel like kicking my own ass for not learning trees and shit properly years ago
>>
>>59158408
Its not too late. Just be prepared to sink in a lot of time. You are better off studying about those in your university library than on 4chan.
>>
>>59147279
stale bread

>>59157910
>>59157910
>>59157910
new bread
>>
>>59158423
Well, I'm far enough into my degree to where I only have to deal with such structures once in a blue moon (albeit, they're project worth half of my grade so I kinda fucked up this time around)

I'm working on an RSA program right now in Python and its going well, so all is not lost
>>
File: CS68934091.jpg (58KB, 615x540px) Image search: [Google]
CS68934091.jpg
58KB, 615x540px
>>59153233
>>
>>59154200
what did you use to make this? looks good man
Thread posts: 325
Thread images: 46


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