[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: 342
Thread images: 38

File: 1435372828296.png (750KB, 854x853px) Image search: [Google]
1435372828296.png
750KB, 854x853px
Fuck off to >>>/g/wdg edition

Previous thread: >>55918090

What are you working on, /g/?
>>
Writing a text editor for emacs
>>
>>55924562
Who's that tranny, OP?
>>
ICFP 2016 CONTEST

This shit is hard.
>>
>>55924588
https://css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/
>>
>>55924606
kys, thx
>>
I'm gonna repeat my question:

How do I know when I should use a try catch? Most of the time when I write code (which admittedly, is not a lot. Two somewhat complex web applications) and I think there might be a problem I normally write some checks but never a try catch. Then there's some problems that I don't foresee that could've used some additional checks or a try catch to handle it but I didn't think of it for whatever reason.

I also don't know when to use a custom exception. Are these things that come with more experience?
>>
>>55924629
1) When your boss tells you to
2) When you're dealing with someone else's throwing code
>>
>>55924612
Fuck me.

Kids these days expect to get a programming job without being able to write code.
>>
>>55924618
this
>>
File: HDDraft, 4.0.png (2MB, 3840x2160px) Image search: [Google]
HDDraft, 4.0.png
2MB, 3840x2160px
>>
>>55924654
>hungry for more
>not topcoder there

pls
>>
>>55924612
>The whole fixbuzz thing is a huge joke. I have never used the or heard of PHP’s modulous operator before or since I failed the fizzbuzz test.

>I’m also learning that if you have mastered all the skills listed in the description then why would you be interested in their company? You’d be at Google or something.

wew
>>
>>55924612
>FizzBuzz does have its place, but definitely not for the average web developer. If they wanted someone who did serious backend engineering, then it would be a decent way to see how someone steps through logic, but very few web dev jobs really need anyone who does that.

I'm fucking dying
>>
Did anything ever come of that ren'py mode for Emacs from awhile back?
>>
File: 1464468332536.jpg (80KB, 766x960px) Image search: [Google]
1464468332536.jpg
80KB, 766x960px
>>55924612
>go to programming job interview
>don't know how to program
every time this makes me so mad
more angry than whenver I see
1
2
3 4
>>
File: received_10209782983909139.jpg (10KB, 512x536px) Image search: [Google]
received_10209782983909139.jpg
10KB, 512x536px
Been working on a NES game. Going pretty well so far, just needs sound. Pretty simple concept, but I have a repro guy who's going to make carts.
>>
>>55924726
he wasn't alone.
>>
>>55924612

This got posted in an IRC I was in a while ago and it drove me nuts.

WAHHH, THEY WANTED A JAVASCRIPT DEVELOPER FAMILIAR WITH OBJECT ORIENTED DEVELOPMENT WHICH WAS MENTIONED IN THE FUCKING AD BUT I DECIDED TO GLOSS OVER.

Also, if all she knows is jQuery and had to google how to do something as simple as FizzBuzz then she absolutely is what she said she was afraid of here:

"In my impostor-prone state, I felt called out as a just-good-at-Googling-and-maybe-jQuery developer. I was embarrassed."

The problem with impostor syndrome is that it lets incompetent morons feel like they're not incompetent morons but rather insecure geniuses.
>>
>>55924770
>good-at-Googling
hate this meme
being able to use Google doesn't make you good at it
>>
>>55924618
Are you jewish?
>>
>>55924860
what do you mean? I got a Google-cert.

Employers always value that in a resume
>>
>>55924872
Maybe...
>>
>>55924899
Do you visit /o/? /v/ is great too. /e/cchi not so great. /n/ is somewhat good.
>>
>>55924770
The comments are even more ridiculous
>The point being even if you can go on stack exchange and find a solution these peoples expectations are that you are able to explain, down to the semicolon, what the code does.
Like no shit you can find it on stack exchange, but its not the point. You're only proving that they should take the random on stack exchange over yourself.

and of course
>BTW – I’m a physics/math grad and unless you’ve taken some abstract algebra recently, you will be totally loss.
Where do these people graduate from? some "physics" grad is legitimately calling fizzbuzz abstract?
>>
>>55924932
Why are you interested in whether I'm Jewish?
>>
Why would you ever make a member variable of a class private instead of protected?
>>
>>55924958
it's just a pure coincidence
>>
Why should I learn Java?
>>
>>55924978
>Why would you ever make a member variable of a class protected instead of private?
>>
So I need a C compiler for my virtual architecture, what parser/lexer generator should I use?
I do not want to spend too much time on the compiler, i want to focus on the machine itself, and an operating system for it.

>inb4 LLVM backend
Yeah nah, after reading the documentation for that I've come to the conclusion that just writing my own compiler with a parser/lexer generator as a frontend is way faster than writing an LLVM backend.
Optimization isn't a concern.
>>
File: 1337230584059.jpg (45KB, 240x320px) Image search: [Google]
1337230584059.jpg
45KB, 240x320px
>>55924612
>After spending a few hours coming up with something that semi-worked, I found the solution on StackOverflow and, in my honesty, linked to it in the code.
>After spending a few hours
>>
>>55924978
Because there are variables that subclasses do not need free access to.
>>
>>55925020
>parser/lexer generator should I use?
Lex and yacc
>>
>>55925020
Also bonus points if the generator can generate C++ code.
>>
class MyOOPClass {
public:
int getX() const;
int setX(int);
private: int x;
}

MyOOPClass X;
int& x = *((int*)(&x));

>>55925020
Parsec or similar
>>
http://www.cs.nott.ac.uk/~pszgmh/monparsing.pdf
>>
Are there any good general cases where recursion is hands down better than iteration?
>>
>>55925120
Are there any good general cases where iteration is hands down better than recursion?
>>
>>55925120
None, because you can convert recursion to iteration in every possible case by storing each different list of inputs in a stack.
>>
>be me
>check githib repo
>.editorconfig
>.gitignore
>.travis.yml
>package.JSON

what the hell is all this shit?
>>
>>55925154
Iteration is very simple to implement with recursion, in many ways it's more natural than recursion with iteration
>>
>>55925148
Pretty much anything with a sizable number of runs, iteration uses a lot less memory, doesn't it?
>>
>>55925187
Not vs an optimised tail recursive function, or recursion via goto
>>
>>55925167
That recursion too is implemented with iteration deep down.
>>
>>55925198
Oh okay, thank you.
>>
>>55925206
No, it's implemented with goto, which is neither more like iteration or recursion
>>
>>55924996
That's a really stupid response.
>>
>>55925120
No. Iteration is what a processor does best, and most of the time recursion is optimized into a loop by the compiler.
>>
>>55925032
Should you default to protected then unless that's the case?
>>
>>55925165
>>.editorconfig
The owner uploaded their editor config settings to try to force everyone to use the same style who contributes
>>.gitignore
tells git what files to ignore, like build output files (also the editor config could be listed if the maintainer didn't want it being added to source control)
>>.travis.yml
I think this is some online build tool, not sure -> I only see if used on javascript shit
>>package.JSON
This is package files for a project, it tells a package manager what libraries and resources to download. I assume it's some javascript shit in this case as well.
>>
>>55925323
You should always have the most encapsulation possible. Unless your subclasses needs the variable to be visible (eg. for computation in a method) it shouldn't have access to it.
>>
>>55925362
You don't know if someone will want to extend that class in the future, or if you will want to.
There is literally no reason to follow that methodology.

On an unrelated note, pic related is from my professor. She's a women in STEM.
>>
Are there any good tutorials on using flex with bison?
>>
>>55925438
>tfw devs arbitrarily name their libraries/frameworks so they can be a meme
What the hell is this?
>>
>>55924978

Why would you ever make a variable private or protected?

>>55925362

I'm LMAOing @ your life, javalet

> If we don't block access to data, pajeets won't know what to do with it and start overwriting them with cuckporn torrents

you should encapsulate a bullet into your skull

-t. Python
>>
>>55925413
Fuck me lad.
>>
>>55925473
>hey, let's let people add subclasses to things that break if subclasses are added, what could go wrong?
>>
>>55925413
did you suggest to her

return isFull() || connectFourAnywhere();

or are you just going to keep it to yourself
>>
I want to be able to select only a limited number of posts from a table, but each post might have multiple pieces of media.
What would you guys suggest as the best way to do this?

Here was my last setup:
>posts table
>media table
>select posts at a LIMIT and OFFSET
>Then selected all media with those ids associated to them
>Finally, used PHP to concatenate them in a foreach loop before echoing the posts
>>posts were echoed once the id changed

Is this the best way? I feel there's something rather inefficient about this.
OTHER THAN NOT USING PHP AND MYSQL, is there anything to improve here? Or is this ACTUALLY how it would normally be done?
>>
>>55925504
I suppose it's possible she's using it to teach if-statements.
>>
>>55925518
oh yeah, here's where I feel the inefficiency might also have been. I was concatenating the post ids, and making a long query of 'thisID OR thatID OR theOtherID OR [...]'
>>
>>55925413
>>55925473
>java
information hiding is in every language. If you don't write good, robust interfaces your library will just end up being a mess, and when you change it, all the programs using your library will either have to stay on a deprecated API or be torn down and made anew.

>encapsulation is only for variables
of course i'm talking to a literal cs dropout who only writes fizzbuzz
>>
File: qqqqq.jpg (127KB, 500x500px) Image search: [Google]
qqqqq.jpg
127KB, 500x500px
Is anyone here not a NEET?
>>
I can't decide to whether give all hardware resources to the OS in my exokernel with the exokernel doing only prevention of access violations etc or omit doing controlling of resources and just let the OS fuck systems shit up?
>>
>>55925534
You can use IN (...) instead of a big disjunction.
>>
>>55925538
I took early retirement to shitpost on /g/
>>
>>55925473
>Why would you ever make a variable private or protected?
I'd only make a member private or protected if it's value shouldn't be set directly; i.e. if it's calculated from other values, and this calculation may be accessed more than once between each change in those values.

Elementary example:

Rectangle class with length and width. I'd store the area in a member variable privately. When you want to get the area of the rectangle, it will check if length or width have been changed since the last calculation. If they have, calculate the new value assign the area variable the new area and return it. if they haven't, just return area.
Or even better, just set the new area value any time width and height are changed.
Depends on the case I guess.

Obviously this is retarded for this example, but for any process that is expensive to do, I think this is a good idea, so you're not doing the same calculation on the same values for no reason.
>>
>>55925562
proud of you, anon! Keep up the good work!
>>
>>55925535
>>Java
I know it's a huge meme, I hate it too.
>>
>>55925549
hmmmm ok. Yeah, I totally forgot about that one.

Anything else that can be improved there?
really appreciate it already. thanks
>>
Just starting to learn Haskell
I'm using LYAH but looking for other methods.

Does anyone have any advice other than kys
>>
>>55925588
What editor/plugins are you using?
>>
>>55925538
I'm still in college, and before going away for the summer I had both a shit job for several months AND THEN a consulting position for about 2 months.

Planning on looking for some consulting things when I get back while my website is still new, as well.
I don't mind working mostly from home
>>
>>55925535
Python users would extend Bool if they could.

data Bool = True | False | Perhaps | Sometimes | LemmeCheckAgain (IO Bool)
>>
>>55925588
I am learning through this
http://haskellbook.com/

definitely an in depth book and has been good so far

doing it on Windows with haskell platform 8 install
>>
>>55925588
Thinking Functionally with Haskell is the best resource. I really didn't find LYAH very helpful.
>>
>>55925583
Not sure, would help to see your whole query. I'm going to bed but some other anon may be able to help.
>>
Significant frame rate increase by ensuring batched draw calls of intersecting polygons don't share the same Z axis value, when using an orthographic projection. Moral of the story: Don't confuse the rasterisation process.
>>
>>55925588
Don't use LYAH.
>>
>>55925648
You making a 2D game anon?
>>
>>55925606
uh I'm just reading for theory right now, I don't have anything set up yet

can you recommend a gnu-Linux compatible editor?

I don't like vim or emacs, I'd like one with a mouse interactive GUI that I dont have to spend a month memorizing key combos in order to use effectively.

There was something similar to Atom a while ago but I can't remember the name. It might have had lime in the name?
>>
>>55925620
>this coming from data Bool = True | False | Undefined
>>
File: Hasklig.png (24KB, 418x466px) Image search: [Google]
Hasklig.png
24KB, 418x466px
>>55925666
yes you can use atom
https://github.com/simonmichael/haskell-atom-setup

good because you can have ligatures setup
>>
>>55925666
I'm pretty sure Atom works on Linux, and I'd recommend it
There are a bunch of good plugins
Autocomplete, something like intellisense, hlint & type inspection will massively improve your productivity
>>
>>55925666
Have you tried vim properly?

If not, set aside an hour or so, and try going through vimtutor.
>>
>>55925685
Which plugin gives those ligatures?
I've only got one that does:

::, ->, <-, =>, forall
>>
>>55925672
We don't talk about that.
>>
>>55924580
This post makes my head hurt
>>
>>55925662

Just a simple Newtonian gravity simulation. I recently moved all the CPU physics logic to an OpenGL compute shader as well! It's crazy going from being able to render 1024 particles at 60fps to 32768 at 60fps with plenty of time to spare for regular CPU computation.
>>
>>55925638
well, the old query was about 3 revisions ago. I've started completely remaking the tables.

but, just generally, is the setup, otherwise, good?
still keep media and posts separate and run as 2 queries for the page?

I'll keep looking a bit more. I was originally hoping I might be able to somehow use the group by, but I can't think of a way that might actually work, because I'd need an array from BOTH the posts table AND the media table for each post, and I'm not sure how/if you can limit by a number of different IDs as opposed to number of records.
is there a way to do that?
>>
Finishing wrapping xcb-ewmh in Rust so I can finish my Lumen port and release it.

That shit is huge.
>>
>>55924654
rolling
>>
>>55925703
not a plugin, but font
https://github.com/i-tu/Hasklig

just put this within atom-text-editor block in atom stylesheet to enable ligatures for the font
atom-text-editor {
text-rendering: optimizeLegibility;
}
>>
>>55925717
I don't really know desu, I'm just slightly familiar with SQL.
>>
>>55925711
You can do physics in a shader? Dafuq?
>>
>>55925691
not really and honestly Haskell is already presenting itself as mind-bendingly difficult, at least in the way that it's being taught to me, and I'd rather not worry about having to mess around with my wm again because I'm using a really comfy/lazy keybind setup that uses multiple base keys and would conflict with vim
Maybe I'm just making excuses to be a pussy tho
>>
>>55925756

It's a bit shit, but I just wanted to get it working:

https://github.com/OllieReynolds/Simulation/blob/master/cs_particle_physics.glsl
>>
>>55925567

So you would make area the return value of getArea() and don't have a self.area.

It's that simple.

>>55925535

I don't see how python makes it hard to write good libraries.
>>
>>55925743
alright. I can't find anything about using GROUP BY that way on other sites, anyway...

I'll just stick with this. I can always optimize the queries at a later point. Just get them working now.

I was just kinda concerned about whether the tables should be split or as one, but this probably makes the most sense, really.

I'll stick with it for now.
>>
File: Screenshot_2016-08-05-00-09-32.png (193KB, 1080x1920px) Image search: [Google]
Screenshot_2016-08-05-00-09-32.png
193KB, 1080x1920px
>>55925777
Fugg that's nice font
Also checkem
>>
>>55925777
I had no idea you could do that. V cool, anon
>>
>>55925672
>>55925704
wait was Undefined included in Haskell bool once upon a time?
>>
>>55925740
Does it not have ligatures for >=, <= ?
>>
>>55925822
Yep.
>>
>>55925822
All types in Haskell have an extra possible value, undefined, because of non-terminating computations & exceptions
>>
>>55925797
><>calculating the area every time they call getArea()
It's like you didn't read my post.
>>
>>55925797
>I don't see how python makes it hard to write good libraries.
You wouldn't, would you?
>>
File: all_ligatures.png?raw=true.png (330KB, 1836x1796px) Image search: [Google]
all_ligatures.png?raw=true.png
330KB, 1836x1796px
>>55925824
guess not, try this for everything
https://github.com/tonsky/FiraCode
>>
>>55924580
Snorted, hard
>>
>>55925871
>no =>>, <<=
Why do Haskell fags hate comonads so much?

also
.........._
>[] -> [_]
the fuck
>>
>>55925892
oh wait, nvm, i am retarded
>>
File: Screenshot (10).png (223KB, 1366x768px) Image search: [Google]
Screenshot (10).png
223KB, 1366x768px
I made an AI that can solve problems like Zebra's Puzzle with logic reasoning, without testing a complete solution against the rules to check if it's valid. You can even see the partial solution with the known relationships as you insert more rules. There's a mode where you insert the rules into a unknown but valid puzzle and it gives it the answer and a mode where you give the answer and it only allows you to insert rules that are valid, also giving you the relations that the inserted rule affects on-the-fly.

Do you think there's a market for that? Sorry that the image is in portuguese.
>>
>>55925841
but it isn't true anymore right?
https://hackage.haskell.org/package/base-4.9.0.0/docs/src/GHC.Base.html

data  Bool  =  False | True
>>
#include <cs50.h>
#include <stdio.h>

int main(void)
{
printf ("height: ");
int height = GetInt();
if (height < 0){
printf ("height: ");
height = GetInt();
}
if (height > 23){
printf ("height: ");
height = GetInt();
}
int count = 0;
while (count < height){
int spaces = 0;
while (spaces + 1 + count < height){
printf(" ");
spaces++;
}
int hashtags = 1;
while (hashtags + spaces < height + 2){
printf("#");
hashtags++;
}
printf("\n");
count++;
}
}

Simple program, took me WAY longer than it had any right to, but I fucking solved it. I don't even care that I'm clearly such a shit programmer, I'm just stoked to be making progress. I forgot how much fun coming up with a solution is after not having programmed since I was really young.
>>
>>55925955
All haskell types have an extra possible value

data Bool = False | True
x :: Bool
x = undefined
y :: IO Bool
y = undefined
z :: Either [(IO (), Bool)] (Maybe Integer)
z = undefined
>>
>>55925998
where is this defined?
>>
>>55926040
it isn't
>>
funnier example from the wiki
x :: ()
x = undefined
>>
>>55925960
Good work lad
>>
>>55926049
oh so because of divergence?
>>
>>55926126
yes


also exceptions
>>
>>55926124
Thank you!
>>
>>55924654
roll
>>
>>55926159
oh fuck off that's just busy work. rules are rules I guess I have to do it /:
>>
>>55925538
I work full time as a software dev, so, no?
>>
>>55924745
what program are you using for GUI? genuinely curious,
>>
>>55925960
you see here:

 if (height < 0){
printf ("height: ");
height = GetInt();
}

What you want is a while loop
This will repeat the code inside as long as the condition is false (i.e. as long as height is below 0)

 if (height > 23){

and this bit, you can use
|| - or
this will check that either condition is true
while ((height < 0) || (height > 23))
so long as: height is less than 0, or, height is greater than 23
ask the user again for input

alternatively you can do this, which is the same:
! (not)
&& (and)
while (!((height > 0) && (height < 23)))
read as: so long as it is not true that (the height is between 0 and 23)
i.e., until the input is valid

int count = 0;
while (count < height, ...)
count++
here you can use a for loop
for (int count = 0; count < height; count++)
this is exactly the same
>>
>>55926186
You mean my emulator? It's FCEUX
>>
>>55925308
Is it? Or is this anon trying to get another anon thinking?
>>
>>55926234
oh sorry I thought you were creating a nes style game from the ground up, but your creating a nes game for an emulator? very neat. What language is it?
>>
>>55926217
Thanks man!
As you can see I'm new to C, well rather I'm relearning it after quite a few years without having written a line, had totally forgotten about ||, and a while would fit perfectly there

Originally I had used for statements on the lower whiles as well, but I'd switched to a while as the more spread out nature was easier to conceptualize, and by extension debug when the program wasn't doing what I needed it to

Thanks for the help.
>>
>>55926269
The main use of for loops is because often you'll do the whole pattern in one:

for (statement1; expression; statement3) {
block;
}


->

statement1;
while (expression) {
block;
statement3;
}


For instance, if you've got an array of some sort
for (int index = 0; index < arrayLength; ++index) {
array[index] += 2;
}
>>
>>55924770

>"In my impostor-prone state, I felt called out as a just-good-at-Googling-and-maybe-jQuery developer. I was embarrassed."

Nah, it wasn't the impostor syndrome, it was the Dunning–Kruger effect:
>https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
>>
>>55926312
The funny thing about the dunning kruger effect is that you know anyone who brings it up is equally likely to be employing it themselves
>>
>>55926256
It's all in 6502 assembler. I'm using an emulator to debug and such, but it runs on real hardware. I use a flash cart to test my roms on the NES, and it is possible to flash EPROMS and solder them into a NES cartridge.
>>
Just spent a solid 2 hours figuring out how to even do type inference with row polymorphism and I finally got some code to work:
[> `A a] 
and
[> `A Int]
now successfully unify. i still need to finish the algorithm so that it adds variants that aren't in both types, but that should be trivial to do.

also, im pretty sure my type checker is going to be like O(n↑n) or some crazy shit like that but who cares
>>
>>55926347
Because there's never a need to refer to it by name.

>sounds like you're a victim of the Dunning-Kruger effect
>guess you aren't as good at ____ as you thought you were
Which one screams autism?
>>
>>55926388
Neither, one's a reference to a study, the other's a snarky comment.
>>
>>55926373
Why doesn't Haskell have row polymorphism?

>>55926402
One's a technical term used only in psychology that effectively refers to conceit
The other is the word conceit
>>
>>55926413
but neither screams autism
>>
>>55926307
i always use while instead of for

to me it's simpler and more descriptive than for's unique syntax (smth;smth;smth) that literally nothing else uses
>>
>>55926439
Dunning-Kruger screams "I have Dunning-Kruger"
>>
>>55926449
Dunning-Kruger != autism
>>
>>55926439
>>55926460

If you use the phrase Dunning-Kruger at every opportunity, that screams autism
>>
>>55924654
rellin
>>
These are probably the most cancerous and pretentious threads on /g/ by far.

/dpt/ is to /g/ as /sci/ is to 4chan. Hope you all die real soon.
>>
>>55926413
>Why doesn't Haskell have row polymorphism?
idk, im honestly surprised there's no GHC extension for it. it's one of the most useful features in a type system I've yet to find and it's not like it wouldn't go with Haskell's type system. maybe it's just because it would be difficult to use typeclasses with structural types?
>>
Currently trying to understand Lenses in Haskell. Does the rabbit hole of abstractions ever end?
>>
>>55926490
Sounds like you have Dunning-Kruger.
>>
>>55926490
but /sci/ is less cancerous than /pol/ and /v/

>>55926498
apparently you can implement some parts of it with library solutions, provided you enable virtually all extensions

i'd imagine there's some kind of GADT soltn
>>
>>55926498
>>55926517
for instance

https://github.com/acowley/Frames/blob/master/src/Frames/CoRec.hs
>>
>>55926548
I'm pretty sure ../Rec.hs is about polymorphic records (products) but I'm not certain
>>
>>55926502
>Does the rabbit hole of abstractions ever end?
no. if you reach the bottom, you can always go sideways. although IMO there is a very clear line to when abstractions become negative.
>>55926517
>>55926548
>>55926568
interesting. i wonder how well type inference would work for that and how weird those types would behave in actual use. desu this is a lot more elegant looking than i expected it to be, but knowing GHC extensions it's probably really fragile
>>
Are there any .NET Core compatible GUI frameworks for cross platform development?
>>
>>55924612
As naive and incompetent as the author is, she brings up a good point at the end:

"I feel like it's pointless to rant without proposing a solution, so here are some suggestions for whomever is in charge of this hiring stuff:

[...]

- List tangible, example tasks that are relevant to the position. Particularly if JavaScript is listed in the role (can you tell I'm a little sore about this?). Something like:
Implement image sliders and smooth scrolling
Migrating our CSS pipeline to Sass
Make quick design decisions about interactive elements, such as button hover states and form styles.
Create a registration form using AngularJS.
Use regular expressions to detect any date within text content.
Recommend improvements to our Rails deployment workflow.
- Hell, put code examples in the description. Why not? Seriously. If I saw that I would be expected to sanitize data with pure JavaScript, I wouldn't have bothered."


Entitled self-indulgence aside, I agree that if you post an ad with something vague as fuck like "generates reports for the Lead Analyst" then you have absolutely no room to bitch about getting unqualified candidates. Flesh it out a little and you'll reduce unnecessary work for everyone on both sides of the hiring process.
>>
>>55926587
Type inference is probably why Haskell doesn't have those things in the first place

Here are demo s of the full library
https://github.com/acowley/Frames/tree/master/demo
https://github.com/acowley/Frames/blob/master/demo/Main.hs
>>
>>55926629
https://github.com/acowley/Frames/blob/master/demo/Tutorial.hs
>>
>>55926629
i don't think the type inference is really that complex, i'm just to lazy to read any of the literature about it (or dig through the OCaml compiler's typing/ directory). i did find this paper: http://caml.inria.fr/pub/papers/garrigue-structural_poly-fool02.pdf but i never actually decided to read it, so im kind of diving in blind here. but if the GHC maintainers wanted to, it would probably be trivial to implement that [for someone who knows as much about typesystems as them]
>>
>>55924939
The first comment is just retarded. The second one could be coming form a math grad without any programing experience. A course listed as "abstract" or "modern" algebra is typically the first time you use modular arithmetic as a math major, and it's a junior/senior level course.
>>
>>55926697
I think you can use existential types to achieve the same things, for instance

data Showable = forall a. Show a => Showable a
forall a, where a instantiates Show, there is a constructor Showable a
in GADTs
Showable :: Show a -> Showable
(notice how a doesn't appear in the final result)

x :: [Showable]
x = [Showable 3, Showable 'X', Showable False]
main = x `forM_` print
-- anything that can be "show"n can be printed


In terms of polymorphic tuples, when you needed "at least" so many elements or certain elements you could use cons and uncons
(Showable "abcd") : [ Showable 3, Showable 'X', Showable False ]
(uncons reverses this if it can, giving a Maybe tuple type)

You'd want something like this, but + type indexing
You could go on further to add some kind of map that works like extensible records
>>
>>55926764
hm, with dependent typing that seems really simple to do actually. although for that to work you have to be able to come up with some common use-case for all the values you use (instead of Show here). being able to infer that is probably more complex than just implementing row polymorphism in the straightforward way. i guess being a tiny bit more explicit, this would work really well (but what i think is really the best part of using polymorphic variants is that you never have to define ADTs at all)
>>
File: existentially quantified types.png (8KB, 555x202px) Image search: [Google]
existentially quantified types.png
8KB, 555x202px
>>55926764
here's the example with
-XExistentialQuantification
you can use : or other regular list functions to "put something in" to the record

i think this is sort of similar to the dual of polymorphic variants, which i think are called co records
>>
>>55924612

Eh. This whole thing gets way too much play.

In my opinion, she (?) just freaked out at a completely unfamiliar request, not taking the time to think of a method to solve it even without modulo. However, it's ENTIRELY POSSIBLE for someone to be competent at creating real business value without ever having actually learned about modulo, along with any number of other specific things that so many of us assume that *everyone* competent must know.

So yeah, I learned of it in my 1st high school CS class when we had to write a program to make change. First, he assigned the problem. The next day, he explained modulo. Suddenly our godawful hacks became reasonable.

The industry does have a *SERIOUS* problem with wanting absolutely everything out of a job candidate. Great people are rejected for utterly petty reasons, and incompetent people get jobs because they happened to have previously researched every question that comes up.

Having conducted a reasonable number of interviews, and attended many more, I really think that essentially nobody in tech has any fucking clue how to determine who will or won't be a productive engineer. There's so much retarded bias going on that it's laughable.

Every shop has some stuck up cunt who thinks you're an idiot if you can't talk about some random thing he finds really interesting[1], and most of the shops end up with you gated by some HR shithead who wants to talk about your weaknesses, or who asks you if computers are "just a job or more of a passion"[2].

[1] like when I applied to a very specific Windows-oriented SE position that I was very much suited for, and the suuuuuper gay SE asked me how I would build a search engine because, "I think that's an interesting problem" - motherfucker, if THAT is what you find interesting, why are you working at a Windows desktop shop?!

[2] - I was asked this verbatim by the HR tard at my first job out of school. I was stunned that he would be so fucking stupid.
>>
>>55926821
Oh, Showable is the only thing you define (Imho there should be something in the extension to automaticlaly turn any class like Show or Eq into an existential type)

This isn't row polymorphism because it's about extensible records rather than extensible variants, but the idea is that while Showable must be defined, the ADT for [Showable] doesn't need to be - it's an extensible tuple (as lists are) of values of types that are Showable
>>
>>55925607
>I'm still in college, and before going away for the summer I had both a shit job for several months AND THEN a consulting position for about 2 months.

CONSULTING implies that you have knowledge and experience that employers want to consult your for.

You had a CONTRACT position.
>>
>>55926821
>>55926857
just found this btw
https://wiki.haskell.org/CTRex
>>
Golang question:

Do I need to explicitly prototype functions? If so, how?
>>
>>55926857
>This isn't row polymorphism because it's about extensible records rather than extensible variants,
actually, row polymorphism includes both, since rows are simply labelled types (so for records the labels are the fields and for variants the labels are the tags). you can also use it to implement something similar to structural subtyping for objects (OCaml does this in addition to polymorphic variants, although sadly does not include row-polymorphic record types). i think having Showable defined kind of ruins the point for more complex use-cases where you'd need to use the values in a variety of different ways (though that trick is pretty cool and i haven't seen it before).
i think extensible tuples are out of the scope of row polymorphism (due to the lack of labels... but maybe ordering is equivalent to labels?), but could still be structurally subtyped
>>55926878
oh, that looks very nice. i want to try this out in my next Haskell project
>>
>>55925871
full retard
>>
asd
>>
wait, how do I get these ligatures on vim?
>>
>>55925120
When tail calls are optimized, so loops can be completely modularized instead of all in one location
>>
>>55925317
What about tail calls to arbitrary functions?
That's not a loop.
>>
>>55926923
Oh I haven't really explained this very clearly at all

Basically the idea is a tuple is a pair of open ended variants, and a list is an extensible tuple

With showable, the idea is it's purely a constraint.
It's kind of like an ocaml extensible record, except you know it's only extensible with Showables

The ADT part is the list

Rather than defining
(Show a, Show b, ...) => (a, b, ...)
You just have
[Showable]

e.g.
data Any = forall a. Any a
This is kind of like an open ended variant, except you can't do anything interesting with the values (because you don't have any constraints)
So if you had a type Any (which existential types let you have),
you could use [Any] as an extensible tuple, or [(String, Any)] as an extensible record
Then you could use regular list operations to go between (head, tail) tuples and lists
You would need some kind of way to get the runtime type out of an existential type, like being able to create a type ID or something
>>
>>55926917
No
>>
>>55924654
roll
>>
>>55927023
yeah I mean I get that, I think it's useful but it's not as powerful as a tuple is (for a static length). it's a really cool trick either way and there's definitely uses for it, but it's not a replacement for tuples. I think the Any type is the crux of what I'm trying to get at here (there's little you can do without some type class that defines behavior) since all your type info is lost as soon as you wrap an item with Any. it actually works as a replacement for a lot of the OOP things in OCaml (since you can't cast objects back and forth), so that really does effectively replace row polymorphic objects. I guess you could do things like define:

class MyRecord r where
a :: r -> Int
b :: r -> Float

and then use that with a variety of different record types that hold a and b. that way you could basically use type classes as OOP interfaces (like how you can have List<Object> in Java but you can't really do much with it if you don't use runtime types). this would work really well in something like Idris where you could do

-- I forgot the syntax lol
data Any = Any (a:Type, a)

and then recover the type at runtime
>>
>>55927042
Would you happen to know why?
>>
What is the most efficient sorting method? Would it be either binary or merge? Which one uses the least amount of memory?
>>
>>55927201
>most efficient
It depends on the nature of what you're sorting.
>>
>>55927158
Oh, the point I'm trying to make with tuples is that you can take a
[Showable], and get a
Maybe (Showable, [Showable])

So you can have strict lengths by using actual tuples
(Showable, Showable, [Showable])

And then show subtyping / get back to lists using cons

(x, y, xs) -> x:y:xs
>>
>>55927282
ah I see. that's pretty cool. (about to go to bed it's like 3am almost. night /dpt/)
>>
>>55927303
goodnight
>>
>>55927201
depends.

https://www.toptal.com/developers/sorting-algorithms
>>
>>55926592

In theory, you could probably get GTK# working with the CoreCLR.

>>55927201

Most efficient really depends on what you're sorting and what you're trying to optimize. For least amount of memory, you're going to want to use an in-place sort. Heap sort fits that bill best. It's O(n log(n)) best and worst time complexity, and uses O(1) extra space. It's not the fastest sorting algorithm out there, but it's good if you're fucked for memory. Introsort is also an interesting sorting algorithm that more or less combines quicksort and heap sort. It starts with quicksort, and if a certain recursion depth is exceeded, switches to heap sort. Consequently, introsort is a common implementation choice for sorting algorithms used in various languages' standard libraries.
>>
Does anyone know how if it's possible to intercept a video feed from rtmfp://p2p.rtmfp.net?
A lot of people in my house use omegle and I can sniff their conversations but it would be cool if I could also see the video, I capture the password needed for the video feed.
Any thoughts?
I've never messed with rtmfp.
>>
>>55925020
>what parser/lexer generator should I use?
Making your own recursive descent parser would be the best option.
>>
>>55926256
>>>55926234
>oh sorry I thought you were creating a nes style game from the ground up, but your creating a nes game for an emulator? very neat. What language is it?
>oh sorry I thought you were creating a nes style game from the ground up, but your creating a nes game for an emulator?
Christ dude, you're a moron.
>>
>>55925504
That's what I wrote instead

>>55925532
She's not, this isn't an intro to programming course. She actually is very bad at programming.

A worse example from the same project: to check if the board is full, she iterated through the entire board, and counted up how many full cells there are. At the end, she checks if the amount of full cells equals 42, the amount of cells. If it is equal, set the Full variable to true. (it was initialized to false).

Since it's connect four, I changed it to iterate through the top row, return false if the current cell is empty, and just return true if we get all the way through the top row without finding an empty cell.

She is not qualified to teach.
>>
File: 2.jpg (222KB, 700x1019px) Image search: [Google]
2.jpg
222KB, 700x1019px
Can anyone tell me what's wrong? I'm trying to work on re-learning c++ with a book but everytime I use g++ I get this:

#include <iostream>

using namespce std;

int main()
{
int kek, kik;

kek = 33;
std::cout << "hory " << kek << "\n" << std::endl;
std::cin >> kik;
std::cout << kik;
}


output from g++
nenel@localhost ~/D/e/cjjtut> g++ main.cpp 
main.cpp:3:7: error: expected nested-name-specifier before ‘namespce’
using namespce std;
^~~~~~~~


I want to use cout rather than std::cout but wtf is going on, google doesn't bring good answers
>>
File: CPP.jpg (78KB, 515x648px) Image search: [Google]
CPP.jpg
78KB, 515x648px
how do people usually write cross-platform C++ apps for linux, win and mac ?

I'll write something for linux but I'd like to make it run on the others too if it's not too much work
>>
>>55928053
simply don't use platform specific API
>>
>>55928027
namespace not namespce
>>
>>55928027
Read that line very carefully.
>>
>>55924654
highroller
>>
>>55928053
Use libraries.
Eg. You want to have a grapical interface, you don't write directly to X, you use something like Qt which would work on many platforms.
>>
>>55928027
>expected nested-name-specifier before ‘namespce’

namespce
namespace
[name][space]
spce->space
>>
>>55928090
>>55928115
thank you for the non-shit answer, ill go kill my self now
>>
>>55926600
This is totally bullshit. According to this logic, an ad to hire a woodworker would look like this:
>Experience in using drills to create holes in the wood
>Preferably some knowledge in reducing length of wood planks using tools such as saws
>Extensive knowledge of the Hammer/Nail or Screw/Screwdriver stacks

Looks retarded? Because it is. If you claim yourself to be a woodworker you better know everything there is to know about working wood if you don't want to be unemployed. I don't understand why programming would be an exception.
>>
>>55928027
>std::cout .. std::endl
>std::cin
>std::cout

#define condom namespace std

using condom;

cout ... endl
cin
cout
>>
>>55928098
My fresh Mathematics/CS Degree might not be enough for this..
>>
is there an irc channel for these threads?
>>
>>55928516
/g/sicp @ rizon
>>
>>55927561
>>55925020
this so much, lexers aren't actually hard to make

I wrote a "naive" lexer all the way to producing tokens in 500 lines and only then I started reading literature on the matter and it helped me a ton
>>
typedef struct varinfo 
{
unsigned int varno;
int16 varattno;
} Varinfo;

typedef Varinfo VarList;


// test.c

int varlist_length = 2;
int i;

VarList *varlist = malloc(varlist_length * sizeof(Varinfo));

for(i = 0; i < varlist_length; i++)
{
varlist[i].varno = fillFoo1();
varlist[i].varattno = fillFoo2();
}


// llvm part

llvm::LLVMContext context;



how do i change my c array of structs to llvm and access it?
>>
>>55927201
http://bigocheatsheet.com/

Skip down to sorting algorithms.

Mind you that the last four sorting algorithms are circumstantial.
>>
>>55924654
roll
>>
class Person:
def __init__(self, name):
self.name = name

def greet(self, other_name):
return "Hi {0}, my name is {1}".format(other_name, name)
>>
>>55928979
Correct this code so that the greet function returns the expected value.
>>
>>55928331
this
>>
>>55926845
>asks you if computers are "just a job or more of a passion"
it's an entirely valid question. there are plenty of people who are passionate about computers and that's what they were looking for, not some code monkey who's just putting in the bare minimum of effort to get his paycheck.
>>
redpill me on singletons
>>
>>55924654
rolling rolling rolling
>>
>>55929096
singleton instances are nearly as lonely as you
>>
>>55924654
Roll, but colors do not correlate with difficulty
>>
>>55929280
Ouch
>>
What is a linux alternative for pywin?
>>
>>55924612
>http://notlaura.com/
>You know that expression:
>Give a man (or woman) a fish and feed him (or her) for a day, teach a man (or woman) to fish and feed him (or her) for a lifetime.
No there is no (or woman) in the proverb you autistic feminazi
>>
I have a JFrame with all the properties set as I need them.

Now I'm trying to get every new JFrame to inherit those properties.

How can I do this?

I could set them one by one in the constructor but there's probably a better way.
>>
Saw some code like this in C

void(*x)(var *y)


Can someone tell me what this is called? Is it creating a function or something like that?
>>
>muh row polymorphism
You don't need it
>>
File: 1466480437908.jpg (234KB, 900x904px) Image search: [Google]
1466480437908.jpg
234KB, 900x904px
>>55925760
>Haskell is already presenting itself as mind-bendingly difficult
>>
>>55929491
function pointer
>>
>>55929491
A function pointer
>>
Does anyone know, if Ada is any good?
>>
>>55929499
It's because he/she is using LYAH, which isn't a great resource. I wish people would stop recommending it.
>>
>>55929500
>>55929504
Thx ^^
>>
>>55929515
but it is
>>
>>55929505
It's a great language for avionics. It doesn't support recursion schemes so it's kind of useless for anything else, though.
>>
>>55929522
It doesn't teach you real understanding of the concepts presented. It makes you like JS 'devs' who get by by pasting StackOverflow answers together.
>>
>>55929515
>>55929539
>This resource is shit
>Provides no alternative

Quality shitposting
>>
>>55929516
You're welcome mate *smooch*
>>
>>55929543
>haskell
>ever not being shit
>>
>>55929543
Just fucking Google it, ya dunce.
>>
File: 1469999297992.gif (950KB, 500x500px) Image search: [Google]
1469999297992.gif
950KB, 500x500px
Anyone have any good resources for building a web crawler? Preferably Python, but Java is appreciated too
>>
>>55929564
I hear BeautifulSoup is all you need in Python.
>>
>>55929564
>Python
>Java
Fuck off

(doing my bit to improve the quality of /dpt/ right here)
>>
File: 1470139229116.jpg (213KB, 540x852px) Image search: [Google]
1470139229116.jpg
213KB, 540x852px
>>55929435
>not using JavaFX

Also, I'm sure you could just use a method that has the properties you want defined to create a JFrame, then you change or add any other properies manually

    public JFrame createSpecificFrame(){
JFrame jframe = new JFrame();
// Properties Here

return jframe;
}

>>
>>55929563
Google Haskell tutorials and the most popular and well received one is LYAH.

You're fucking clueless kid, stay out of the conversation.
>>
>>55929579
No, you're part of the cancer, faggot.
>>
>>55929579
>>Java
nice meme fag
>>
>>55929579
>Fuck off
Explain? I'm at uni, this is for a project, and I am studying Java and Python. Why should I spend time learning a new language to suit your autistic sense of superiority?
>>
File: PhotoEditor-1470395934485.jpg (205KB, 717x1006px) Image search: [Google]
PhotoEditor-1470395934485.jpg
205KB, 717x1006px
>>55929584
>>55929588
>>55929592
>>55929612
Delicious
>>
>>55929612
>muh C
>muh Haskell
>muh "Python, Java, C#, Javascript, or anything else popular must be shit"
>>
File: HaskellFags.png (2KB, 836x36px) Image search: [Google]
HaskellFags.png
2KB, 836x36px
Haskell fags will always be irrelevant.

http://www.tiobe.com/tiobe-index/
>>
>>55929674
If everyone was jumping off my bridge, would you do it too, in order to be 'relevant'?
>>
>>55929691
>implying that's a proper comparison

Go be useless somewhere else, just like your language.
>>
>>55929645
I wish this guy hadn't learned my favourite language
He's a cunt
>>
>>55924654
I'll roll
>>
>>55929707
I bet you couldn't grok monads. It's okay, you can get by with side effects and plumbing values through by hand. I hope you have a decent setup to avoid carpal tunnel from all the extra typing you'll be doing.
>>
File: zzz.png (13KB, 1244x138px) Image search: [Google]
zzz.png
13KB, 1244x138px
>>55929744
>>55929766
>the redditor literally deletes his post over a single typo
>>
>>55929744
>I hope you have a decent setup to avoid carpal tunnel from all the extra tipping you'll be doing.
>>55929766

Freudian slip?
>>
>>55929785
>>55929790
I can see I should have let it stand, you're all doing some mighty fine tipping right now.
>>
>>55929766
(You) >>= Trash
>>
>>55924654
rollin'
>>
>>55929558
>implying haskell is anything but a speck in your imagination
>>
File: polite conversation.png (311KB, 2072x1984px) Image search: [Google]
polite conversation.png
311KB, 2072x1984px
If your programming language was a fruit or vegetable, what would it be?
>>
>>55930497
a coffee bean
>>
>>55930497
ALL of your five a day
>>
File: wP5a4KI.jpg (50KB, 650x365px) Image search: [Google]
wP5a4KI.jpg
50KB, 650x365px
>>55930508
ENOUGH
>>
File: painted4.jpg (57KB, 744x1323px) Image search: [Google]
painted4.jpg
57KB, 744x1323px
Just painted my clown flower pot
>>
>>55930557
creepy af
>>
>>55930557
It appears that you have trouble telling the difference between flowers and a can of paint.
>>
>>55924580
I was thinking about making a music player for it wanna help?
>>
File: painted3.jpg (58KB, 744x1323px) Image search: [Google]
painted3.jpg
58KB, 744x1323px
>>55930589
>>55930590
I'm bringing it as a gift to a wedding!
>>
>>55930607
got to ask, how old are you?
>>
File: GlPlsDi.jpg (173KB, 3184x2335px) Image search: [Google]
GlPlsDi.jpg
173KB, 3184x2335px
>>55930607
>>
Why do people prefer dynamic typing? Why would you not want to catch errors at compile time? Why would you not want meaningful method signatures?

What the fuck am I missing here?
>>
>>55924654
Rolling
>>
File: baking mistake.jpg (39KB, 744x1323px) Image search: [Google]
baking mistake.jpg
39KB, 744x1323px
>>55930627
27

>>55930630
My original pot was made of the wrong type of clay and deformed in the oven, so I had to make an air dry one this time.
>>
>>55924654
Rolling''
>>
>>55930634
I can understand it if they think static type systems are all like Java and C#.
>>
>>55930655
I just don't like clowns anon.
>>
>>55924654
roll'"''
>>
File: face2.jpg (56KB, 744x1323px) Image search: [Google]
face2.jpg
56KB, 744x1323px
>>55930670
Well, I hope the couple like clowns.

>>55930634
Decreases development time and the time of individual iteration, especially if you wrote the code yourself. Of course it makes for a maintainability mess. I'm reviewing some Python code right now at work and am glad I'm mostly working on C++ now.
>>
>>55924993
Doesn't matter the language just program
>>
>>55930764
Language absolutely matters.

If it doesn't then why don't you go write everything in Brainfuck?
>>
>>55930782
There are brainfuck derivatives with macros
>>
File: 1447704846332.jpg (15KB, 400x387px) Image search: [Google]
1447704846332.jpg
15KB, 400x387px
How does one know whether their software idea is retarded or not, and whether it would be useful to anyone at all? I had programmed a few pieces of software in the past, and I think most of them were useless. They were complex and performed their function well, but they didn't really find many applications.
>>
>>55924654
rolling
>>
>>55930817
stupid frogposter
>>
I wanna learn programming. Does it make sense to start with swift? Or should I start with python? Any good ressources? I like the way how codeacademy is teaching it.. it's fun
>>
File: 1445301533911.jpg (9KB, 250x242px) Image search: [Google]
1445301533911.jpg
9KB, 250x242px
>55930829
>>
File: Capture.png (104KB, 1711x966px) Image search: [Google]
Capture.png
104KB, 1711x966px
Trying to do this example in C, but it's not working for some reason. I searched for the error but it doesn't really help.
>>
>>55930634
dynamic typing is honestly a dead meme

mainstream programming languages are finally catching up to the idea of good type inference + strong static typing
>>
>>55930872
>a
>&a
>>
>>55930872
Run whatever you're writing with as administrator.
>>
File: Capture.png (14KB, 913x685px) Image search: [Google]
Capture.png
14KB, 913x685px
>>55930890
I did it that way and it still gave me the error.

>>55930905
I am.
>>
>>55930911
does the file exist
>>
>>55930634
>Why do people prefer dynamic typing?
Ostensibly laziness, which is ironic due to the amount of work runtime errors can create for a non-trivial application.
>>
>>55930924
There's nothing harder than doing things the easy way!
>>
>>55930846
SICP
>>
Best way to do dynamic dispatch in C++?
>>
>>55930754
>Of course it makes for a maintainability mess.
Yeah no kidding. God fucking help you if you need to do any sort of major refactoring.
>>
>>55930941
Inheritance
>>
>>55924978
Encapsulation is a meme. You do it because encapsulation.
Whatever you're doing stop it. Make everything public and if you can't handle that stop using classes the way you do. Learn procedural programming before you try to learn OOP or any other paradigm.
That's the path you take if you want to be a good programmer.
>>
>>55930962
Like a single layer inheritance in a context local namespace?
Is that worth it? vtables are bad right?
>>
File: Capture.png (2KB, 646x26px) Image search: [Google]
Capture.png
2KB, 646x26px
>>55930915
I figured it out.

The program was already running from a previous attempt, but the window in Sublime Text didn't accept and input and I accidentally recompiled it but the first one never closed. Pic related.

Can I do something about that in the code?
>>
>>55930994
You can use a proper IDE that handles debuggable instances for you.
>>
>>55930634
Proponents argue they're finding themselves repeating themselves all the time in statically typed languages. Which is a minor issue, changing your code can be a large refactoring step. With dynamic typing the changes happen only where it needs to happen (say you change a string to an into and do stoi somewhere).
I disagree that it's worth it. It makes your program abstract for no reason.
>>
File: test.webm (1MB, 1280x720px) Image search: [Google]
test.webm
1MB, 1280x720px
>>55930911
You do something wrong
>>
>>55924629

In general, avoid exceptions if you can because they make cover difficult to follow. That being said, you throw an exception when the normal operating conditions are not met. Hence why they're called exceptions.

So for example, if your function requires an array of two elements and you get an array with 3, you can throw an exception there.

Whether exceptions are checked our unchecked is usually dependent on whether they're related to the inputs or to the outputs. In general, unchecked exceptions should be raised with inputs. Checked exceptions with regards to outputs.
>>
File: 1459913118512.png (209KB, 510x346px) Image search: [Google]
1459913118512.png
209KB, 510x346px
>>55931013
but everyone said not to use an IDE.
>>
>>55930497
an eggplant
>>
>>55924629
If the code can throw an exception you do a try catch. Always.

And like the rest of the sane world you will realise that exceptions are horrible. Because they are. Avoid libraries that do error handling through exceptions. Avoid people that use exceptions. Avoid languages that encourage use of exceptions.

Nobody likes exceptions. Its one of those nightmares a damaged mind like Stroustrops comes up with. Don't let the madness spread.
>>
File: Capture.png (27KB, 960x650px) Image search: [Google]
Capture.png
27KB, 960x650px
>>55931030
I got it to work.

It doesn't work from inside the Sublime Text console though.
>>
>>55926600
Not really. The truth is that there's no use for someone who can only do html+css. Doing front-end js requires knowledge of the former, so people who can do js have that in their toolbelt, likewise any nontrivial website requires a fair bit of js to be functional.
>>
>>55931033
You've been listening to morons.
What they possibly mean is don't edit in an IDE. I don't think it matters much.
>>
>>55931096
Use emacs, srsly
>>
>>55931088
Possible that your folder doesn't have permissions to edit in mingw. Do chmod 777 myFolder from the mingw shell.
>>
File: Capture.png (41KB, 952x963px) Image search: [Google]
Capture.png
41KB, 952x963px
>>55931088
>>55931127
I figured that out too.

I'm just a dummy, that section of Sublime Text isn't the console. Pic related is.
>>
>>55931122
>use buggy old editor which should die
I'd rather use 4coder. Or atom even.
>>
>>55931137
emacs is more relevant than ever.
>>
rate my timecode to seconds converter

int getSecs(const char arr[]) {
QueryPerformanceCounter(&a);
int hrs1 = arr[1] - 48;
int hrs10 = arr[0] - 48;
int min1 = arr[4] - 48;
int min10 = arr[3] - 48;
int sec1 = arr[7] - 48;
int sec10 = arr[6] - 48;

int res = (hrs10 * 10 + hrs1) * 60 * 60
+ (min10 * 10 + min1) * 60
+ (sec10 * 10 + sec1);
return res;
}

int main() {
char timecode[] = { "12:34:56" };


cout << getSecs(timecode) << endl;

cin.get();
}
>>
>>55931137
>old
The latest release of GNU emacs was 10 days ago.
>>
>>55931158
Oh god it's soo ugly. Use STL chrono
>>
>>55931158
Ew, why aren't you writing it in JS? Nobody uses Java any more
>>
>>55931158
not pythonic enough
>>
>>55931158
>C++
>- 48
>Not ISO 8601
>Not parsing shit properly
>Absolutely no error handling
>Memestreams
>cin.get();
Absolute garbage.
>>
File: Capture.png (54KB, 754x547px) Image search: [Google]
Capture.png
54KB, 754x547px
>>55931096
What should I use?
>>
>>55931238
Emacs
>>
>>55931238
Code::blocks
>>
>>55931158
>using STD's
0/10
Practically malware.
>>
>>55925413
>On an unrelated note, pic related is from my professor. She's a women in STEM.
That's only a meme in America because American women expect to get into STEM and stay there without actually knowing shit.

Where I'm at any women that's in STEM is there because she's better than at least 90% of males. Smartest CS teacher I ever had was my undergrad/bachelor programming prof who was also a woman
>>
>>55931208
actually arrays are passed as reference by default
>>
>>55931238
Visual studio. What you wanted is a debugger. Sadly there's no competition.
But edit in something else if you prefer. Code::blocks suck ass though. I thought people were OK for using a free alternative. Boy was I wrong. Its a terrible program. It doesn't even warn you about outside of IDE code changes, doesn't save code where you expect it to. Have issues building what you want in certain situations.

It doesn't even have all the basic debugging features you want. At least not for C++. Fuck software. I hate computer people so much, please die, all of you. Sooner rather than later.
>>
>>55931374
I know how a pointer works and about pointer decay.
That doesn't have anything to do with what I said.
>>
>>55931312
This. My math professor for 3 years was a doctorate in pedagogic math. She was amazing at her job. She could teach the dumbest undergraduate student basic things. Its amazing.
>>
>>55931374
>passed as reference by default
No they're not. Not at all.
What kind of garbage are you spouting. They're passed by value, they're just pointers though.
>>
>>55924654
ROLL
>>
>>55931312
Same experience here. Elite British university, in my year in CS there were about 70 men and 5 women.
>>
I've spent two days at work trying to hack together some wpf databinding stuff. I think I'm finally understanding some of it.
>>
>>55931238
You're on Windows.

There's no excuse not to us Visual Studio.
>>
>>55929575
Thanks mate will take a look at this
>>
>>55931552
New Thread
>>55931552
>>55931552
>>55931552
>>
>>55931564
What happen?
>>
>>55931564
>>55931609
I forgot to put /dpt/ in subject or post.

Will make one in 90 seconds unless someone else does.
>>
>>55931623
I'll do it
>>
NEW THREAD
>>55931637
>>55931637
>>55931637
NEW THREAD
>>
>>55924629
The most acceptable time is when an error could occur that is out of your hands entirely which is either impossible or extremely difficult to handle nicely. Basically, if there were a ton of different possible issues which could arise with from some outside factor then exceptions are useful and justified.
>>
>>55924654
What does it mean by calculate the first thousand digits of pi iteratively? I mean technically, you could just compute a convergent series a certain number of times and that would be iteration.
Also rolling.
Thread posts: 342
Thread images: 38


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