[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: 328
Thread images: 36

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>57838637

What are you working on /g/?
>>
First for fuck anime
>>
Anime is amazing and so is Haskell
>>
finishing little touches on book maker. im gona come back to doing the async stuff and forking out the final processes.
>>
>>57846555
Also being a NEET too, right?

Those three always go together.
>>
File: anime.png (786KB, 1000x1300px) Image search: [Google]
anime.png
786KB, 1000x1300px
>>57846544
>>57846555
>dubs vs trips
I guess that settles it
>>
I want to learn haskell. What are the best books/references?
>>
>>57846610
probably LYAH (it's a bit outdated though) and the haskell wiki
feel free to ask questions here
>>
how to become a magician?
>>
>>57846610
>>57846618

here is a long list of tutorials
https://wiki.haskell.org/Tutorials

ideally you should install Haskell Platform
>>
>>57846618
>>57846631
Thanks, I think I'll start through this one
https://www.haskell.org/tutorial/
>>
>>57846670
looks good, but remember that's Haskell 98
the tutorial is from 2000

it's mostly the same, if you get any errors just ask
>>
btw the API is good to go. i have done well i thinks.
>>
>>57846670
>>57846703
this is also really good, but it's very in depth
https://en.wikibooks.org/wiki/Haskell
>>
>>57846618
I prefer the Haskell Book (Haskell from first principles?) to LYAH... LYAH presents a lot of concepts in weird ways/weird orders IMO. although it's a hard language to get into so you should try balancing out different resources (example: don't get monads as explained in the Haskell Book? try the monad chapter of LYAH)
>>
>>57846834
Is that one free though?
>>
>>57846841
there's a PDF floating around somewhere. I think I have it on my phone somewhere but I'm about to go to sleep and don't feel like looking for it
>>
>>57846841
oh damn I actually found it pretty fast https://u.teknik.io/WIepg.pdf
>>
>>57846876
>Haskell From First Principles
>a paragraph dedicated to Scurvy
>>
>make hello world in haskell
14 gigabytes
>>
>>57846906
actually it's only 2 gigabytes
>>
homework help
i had to make a coin counting thing in java, it works except I don't know how to make it so when someone enters something thats not a number, it tells them to try again.

Probably basic enough but googling this was difficult, its kind of specific and its probably not even part of the assignment i'd just like to cover all bases

    import java.util.Scanner;
public class coins{
public static void main(String args[]) {

Scanner console=new Scanner(System.in);
boolean run = true;
while (run) {
System.out.println("How many cents do you have?");
String answer=console.nextLine();
Integer cents= Integer.parseInt(answer);

while (cents>=25) {
System.out.println("Quarter");
cents-=25;

} while (cents>=10) {
System.out.println("Dime");
cents-=10;

} while (cents>=5) {
System.out.println("Nickel");
cents-=5;

} while (cents>=1){
System.out.println("Penny");
cents-=1;

} if (cents==0) {
System.out.println("");

} else
System.out.println("Please enter a number between 1 and 100");


}
}
}
>>
>>57846921

Integer cents = 0;
Boolean input = false;

while (!input) {
try {
cents = Integer.parseInt(answer);
input = true;
} catch (NumberFormatException nfe)
;
}
>>
>>57846940
cool, thx
>>
>>57846906
>make hello world in Java
>source code file is 50gb of boilerplate
>>57846876
oh yeah, there's also a website like "things I wish I knew before learning Haskell" and it's pretty helpful
>>
>>57846940
whoops
you need to get a new line from the console in that while loop
>>
>>57846620
>>57845951
>>
File: chatlogs.jpg (38KB, 426x960px) Image search: [Google]
chatlogs.jpg
38KB, 426x960px
how do i into makefiles
>>
>>57846921
loop for input and catch the exception thrown by parseInt
>>
Haskell is garbage collected. What went wrong?
>>
import Control.Monad.Loops (untilJust)
import Text.Read (readMaybe)

readLn' = untilJust (readMaybe <$> getLine)


>>57846989
reference cycles
though it's getting linear types back again soon, wonder if that'll help

it is worth pointing out Data.Foreign has pointers and malloc and free
>>
>>57846996
or it was, at least
it would definitely be nice if you had more low level control in Haskell, and could e.g. guarantee a function doesn't allocate
>>
I MAEK PORN MOAD
window.setInterval(() =>
Array.from(document.getElementsByClassName('post reply'))
.filter(domE => domE.getElementsByClassName('file').length == 0)
.forEach(reply => reply.style.display = "none")
, 1000 * 10)


Now what's the best way to make this into an extension - greasemonkey?
>>
My pom.xml is bigger than most of my code.
Where did everything go so right?
>>
>>57846620
create a demon summoning program

by the way holy shit Tk sucks in C
>>
>>57846996
But since the language is purely functional wouldn't it be possible to plan memory management at compile time?
>>
>>57846989
It collected itself
>>
>>57847125
Whatever code you write, however simple, the haskell GC will be running
>>
>>57846975
Look up an example and then just change stuff for your project. Then look up options on makefiles and fiddle around with the example
>>
>>57847125
Yes.
But there's still tradeoffs between memory footprint and efficiency. Ideally for computation speed you'd allocate every piece of memory the program could ever need at once. Ideally for memory footprint you'd free every piece of memory as soon as it has been finished with it (or reuse the memory block if it's the same size).

Haskell does GC.
Which is good at neither of these things. Because if you cared you wouldn't be using haskell.
>>
>>57846610
If you can't google them yourself, then I question your future as a programmer.
>>
>>57847196
the motivation is being able to write GC-less code
and if all of the code is GC-less, then being able to run without the GC
>>
>>57847206
Anon he's clearly putting our opinions ahead of everyone elses. He should have searched the archive if anything.

But of course you can question the idea that /dpt/ is the best place to ask people how to learn haskell.
>>
>>57847207
Not sure I get you anon.
>>
>>57847206
but anon, I don't trust Google and I like posting in /dpt/
>>
>>57847238
I think he meant you could write a GC on top of GC-less code?
>>
>>57847252
How did you get that from what I said?

>>57847238
You should be allowed to write code in Haskell that is guaranteed to not use the GC.
If none of the code in your program uses GC, the compiled program shouldn't even have the GC.
>>
>>57847238
>>57847258

For instance:

print' x = observe x >>= print
main = runIO $ do
x <- new 0
print' x
modify (+10) x
print' x
release x
>>
>>57847258
so then you're advocating that everyone use destructors and that's all?

as far as my understanding about haskell goes, it works at a level that pretty much puts it alongside the wire, kind of like c, except it also offers that monad like structures be the basis and so expects you to write code as if you were working on the wire rather than from the data table. But I'm still only researching and haven't done much coding myself. That means that code that wasn't fitted for running off a wire will rely on several existing monads to complete process rather than pass through the one.
>>
>>57847309
No, I'm saying it should be possible to write code in Haskell that does not make use of GC, and if the entire program is made of that code, there shouldn't be a GC
>>
>>57847309
here again

I hope you understand that means that we would essentially be defining our own gc sequence in parts...
>>
>>57847342
I don't understand how you're not getting this.
I've written it quite explicitly, multiple times.

Do you just not believe that languages without GC exist? That all languages use GC? That even the first GCs made us of GC to GC their GCing?
>>
How stupid is it to unroll a linked list into a flat array every time you want to do searches on it from the very end of the the linked list?

int list_search(struct list *ls, struct point *pt)
{
unsigned i, found = 0;
if (ls->head != NULL)
{
struct point **arr = malloc(sizeof(struct point *) * ls->depth);
struct point *node = ls->head;
for (i = 0; i < ls->depth; i++) /* unroll */
arr[i] = node, node = node->next;
for (i = ls->depth - 1; i > 0 && !found; --i)
if (is_equal(*arr[i], *pt))
found = !found;
free(arr);
}
return found;
}
>>
>>57847320
Yeah, so it should be possible because..
a) I hate that the gc takes up cycles
b) I hate writing my own gc from the basis of a neutral algorithmic strategy
c) I hate gc for my own reasons

???

gc is good for keeping current memory more relevant but in the purest theory doesn't prescribe a solution to the problem of data management beyond narrowing our attention on the matter. Like the prison, healthcare, environmental systems that plague our country.

If so, are you an advocate of the open source and freedom of thought movement?
>>
>>57847387
What the fuck are you fucking talking about you insane maniac?
Have you never fucking touched a language without GC before?
They're real, I'm fucking telling you, they exist
>>
>>57846544
Polska = Anime >>>>>>> nie anime
>>
Should I dip into functional programing by learning lisp (sicp) or haskell?
>>
>>57847427
Haskell
>>
>>57847410
Can you stop writing like that? Not everyone on earth is a degenerate weed weeb faggot.
>>
File: 201607221946411006167005.png (5KB, 238x212px) Image search: [Google]
201607221946411006167005.png
5KB, 238x212px
> "const in C does not mean something is constant. It just means a variable is read-only"
>>
>>57847471
what's the difference
>>
File: umdgyv.png (53KB, 850x529px) Image search: [Google]
umdgyv.png
53KB, 850x529px
What is with this inconsistency?? Only the penny is fucking up
>>
>>57847510
Float or double rounding.
>>
File: 1452403462016.png (79KB, 307x400px) Image search: [Google]
1452403462016.png
79KB, 307x400px
>>57847510
floating point rounding errors.
>>
>>57847410
I use C for the most part but I have used java, cpp, csharp and vbasic, and the issue of gc comes up in lieu of recognizing unused variables that have been exacted memory. This makes for a distinction in volatile and constant memory which reduces a buffer strategy into parts amd thus slows the execution of the program. And with the advent of the gui, splits the current strategy to even more parts since it's not possible to tell if any of the data is even pertinent and thus must be type checked and planned for.

So having said that gc issues arise from the fact that people don't know how it fits and that sometimes it's nice to have the freedom to go back and check the data for one's self as a constant and reliable location in memory. The issues largely reside in the avenue of thought that advocates we all take responsibility for our own actions and that there shouldn't be a prescribed notion that should deal with any data we have apparently released from the stream that is tied to iteration about the data table.

Gc is mostly bad because it treats you like a retard and throws an error at you when you decide to check for the memory you released from the structure it was tied to. It's a nag.

I brought up the freedom of information and open source movement because just like gc bothers people for reasons to do with volatile memory, standardizing protocol the way closed source programs do through interface <=> data obfuscation allows the system creators and capitalists ( as in those that funded it and have no liability but profit margin loss in the matter ) to do with the particulars of human participation as simply a notion of viability by enabling them to "do" as they will and call it "established". Kind of how apple products have been selling you the 70s in a black box and call it new and cutting edge.

I dont know what you are talking about really. It sounds like opinion for the sake of keeping the conversation on haskell but away from the particulars.
>>
>>57847271
Yeah makes sense.
Not sure why this simply isn't the case.
>>
>>57847510
Actually, to store money you use Dollars*100, i.e. cents and integer values
>>
>>57847528
Were colors a mistake?
>>
>>57847485
Compile time vs runtime
>>
>>57847471
That's like saying an emergency exit isn't a door, it's salvation.
>>
>>57847510
>Only the penny is fucking up
better call leonard then
>>
>Americans are so backwards they use a currency with floating points.

top kek
>>
>>57847547
>zimbabwe XDDD
Get the fuck out of here, with that reddit-tier "joke".
>>
>>57847510
Floating point is not exact in the mathematical sense.
It's deterministic so there's no strange rounding going on really. It's just that you can't store exactly 0.1 in floating point due to its representation.

If you aren't already using a double change your float to a double if you require specific accuracy.

In the case of dealing with money I'd probably just count the lowest unit in integers rather than dealing with floating point.
So have a variable called 'cents' for instance.
>>
>>57847554
you sure know a lot about reddit
>>
File: 1480555043126.gif (2MB, 500x309px) Image search: [Google]
1480555043126.gif
2MB, 500x309px
>>57847549
>Americans pay in exact change
>>
>>57847471
Because you can cast it away. There's no decent uses for the word const. Compilers can't really optimize anything relevant based on it. (I've heard from google's LLVM guy there's only one or two situations where it's used).
So use an enum or #define if you want an actual constant.
>>
File: 1479876792025.png (17KB, 882x758px) Image search: [Google]
1479876792025.png
17KB, 882x758px
>>57847577
>python 2 handles unicode like shit
>python 3 is incompatible with python 2
>people are lazy to switch to python 3 because it's not a turing-complete language and it will require rewriting a shitton of stuff
>i gotta work with python
I hate this garbage language, fuck it, I'll be learning Perl.
It's one of the languages where garbage collectors don't work.
>>
>>57847573
God that's cute.

How do I program a cat?
>>
File: 1376182921994.jpg (65KB, 445x488px) Image search: [Google]
1376182921994.jpg
65KB, 445x488px
>>57847577
>not a turing-complete language
I don't want to defend memesnek, but you're full of shit.
>>
File: uflowy.png (88KB, 1044x649px) Image search: [Google]
uflowy.png
88KB, 1044x649px
>>57847568
>>57847540
>>57847519
>>57847528
thanks

i make big
big work
>>
>>57847589
I know WHY it works the way it does. It doesn't make it less stupid.
>>
>>57847600
well im dumb and didnt really show it but i just multiplied the input by 100 and added zeroes\removed decimals
>>
>>57847589
const is useful when other people need to read your code

also const functions
>>
File: 1403317853854.jpg (36KB, 848x900px) Image search: [Google]
1403317853854.jpg
36KB, 848x900px
>>57847573
>Americans don't put taxes in prices
>Americans tip
>>
>>57847607
But it makes perfect sense. You need a way to say 'don't modify this normally' and you need a way to have things that can't be modified.
const do catch bugs for careless programmers. You can cast to const. Which is probably one of the most useful uses of the keyword.
>>57847611
Yes ok. But it's not a valuable thing from within the language.
>>
>>57847383
Potentially slow.
Why not just store your data in a array?
>>
>>57847589
I think the difference then is that const is "created" "dynamically" upon use
at the processor/kernel level. As in, it is "redrawn" by the processor, by value, rather than handed over as a reference. And while enum might be similar in use but impractical for single values, it retains a position, for use, in a higher order than the value and reference one. Also, they are intended to override state and seek no approval, as a concept, where const will simply contend as a bit in an AND operation where enum would require a whole apparatus for creating a state change as an order of principle.
This means you'd have to train engineers rather than train coders. This implies much more than simply changing a value this way or that way.

I would guess this really doesn't matter to you or, probably, anyone in this thread, though, as language design or the basis for the syntaxed approach doesn't really pay out in dollars, just sense. You also can't insult people if there is no competition on the basis of trivial features and/or trivial knowledge. Trivial in the trivia sense rather than meaningless.
>>
File: 1479654848793.jpg (66KB, 500x545px) Image search: [Google]
1479654848793.jpg
66KB, 500x545px
>>57847599
>he's not up with latest memes
https://learnpythonthehardway.org/book/nopython3.html
>>
>>57847673
>learn X the hard way
I'm not going to open that link. Zed Shaw is a hack, and you shouldn't listen to anything he says.
>>
File: 1479624415418.jpg (44KB, 394x406px) Image search: [Google]
1479624415418.jpg
44KB, 394x406px
>>57847614
>American systems involve more than just weapons and profit from skimming value off of immigrant workers and over charging for services to make up for wages offered in lieu of indentured servantry and slavery
>I don't have a big dick
>>
>>57847683
I don't, it's just a meme
>>
>>57847683
>Zed Shaw
The original SV drama queen .
>>
>>57847684
What the fuck are you on about?
>>
>>57847705
anon and I were having fun until you came along. Go awat.
>>
File: 1443604195353.png (263KB, 800x720px) Image search: [Google]
1443604195353.png
263KB, 800x720px
How do you differ scripting languages from real languages?
>>
>>57847751
Scripting language is english, real language is japanese
>>
>>57847751
scripting languages come pre-arranged and function mostly on the software level. "real" languages use hardware to come up with values and references from the ground up to create a software basisbfor computation, if necessary.

So with that said scripting languages might make several late passes over unimportant info where you could program a real language to create the info on the spot using hardware resources. scripting languages hide the back of the thing from you, hence pre arranged. real languages expect you to know when it's time to poop and when it's time to eat.
>>
>>57847787
>american english

>enlgish and japanese are two different syntax approaches to the linguistic approach to knowledge and understanding

in spoken english wa sounds like a question, in japanese it acts as a participle for "in question". in english writing it looks like a phonic strip, a phoneme, for some word or concept. in japanese it is an acting particle delimeter or just another phoneme. The difference made clear by the establishment of a change in character for the japanese particle delimeter so that it is understood the character isn't part of the subject but rather denoting a fold in the prescribed notion.
>>
What is meant by garbage collector?
>>
>>57847924
see this for a bit of background after this post
>>57847532
gc is just a garbage collector and acts as a tidying mechanism. it clears all value tables that have "deferred" from data in active use. So, like, if you dynamically allocate values to a structure or array and replace the values in those same locations using a reference rather than writing over the same address they are already using, the gc will go in at the end of the pass, as part of the reverse iteration, and clear the dislocated references by setting them to null.

sometimes, often really, this means that address spaces closer to the front of the heap will be left empty and create extra spaces to traverse over while attempting to access the new data values.
>>
File: 1475808398454.png (151KB, 498x383px) Image search: [Google]
1475808398454.png
151KB, 498x383px
>that is not the right answer
>you have submitted an incorrect answer 25 times now, so you are now blocked for 24 hours
>>
>>57847989
Thnak you
>>
Could someone post the pasta about what name is acceptable for a programmer to call himself?
>>
Are articulate people better programmers?
>>
>>57848081
Not necessarily. You could always go into the dictionary and articulate your meaning more succinctly or clearly but is that better? is it better to be subjective or general/objective? depends on the goal, i suppose. Articulate folk just allow themselves more tools in approaching a problem. if there are fewer angles, a lot of those words simply go into the design but don't necessarily make the program different than the "inarticulate" programmer's. But in that case neither is the better programmer and both may as well be designing over scripts.

The difference in a programmers to a degree, I believe, is that some programmers will work for a case of efficacy and others will work for approval. Better then might defined in collateral aspects and will diverge ultimately to a point of speculation over the nature of values and how they apply to work and proper resolution of problems represented by the work at hand. If one's work is just making pretty looking websites that can help you defend product brand and motto through the use of discrete value sets as displaced by a margin of profit to be put to use in marketing and defending such product placements ( by any means necessary ) versus the making and maintaining of systems to stand the tide of change in our understanding of the world in the many forms it will take throughout the course of humanity, or for as long as there are people looking to learn/understand about the world via the works of simulations and abstraction principles then I would say articulate people have a higher chance of contributing upon reaching the emergence of a new understanding whereas inarticulate programmers may relay on whim and apparel to speculate over a body of work in order to guide the peoples in helping create the means for profit and corrolary action ( fuck paid activists , btw ) cont.
>>
>>57848238
within a society or discourse that offers no resolution to the unwitted and unabiding populace. But if we were forced to abide a sense of action and any extra info would be disregarded, as in the case of a specialized coder versus an engineer with coding knowledge, then maybe one's time would be better served focusing more intently on the mamma jamma of info that resides within circles more suited to jerking. Just don't ask me for help.
>>
>>57848238
>>57848246
>Namefagging
Fuck off.
>>
File: maki.jpg (172KB, 850x850px) Image search: [Google]
maki.jpg
172KB, 850x850px
>social phobia
>can't go to kitchen to eat until noon because maid is cleaning today
How am I supposed to program on an empty stomach? This is truly hell.
>>
>>57848265
I had put that up during a honework help thread to let thevmain poster know that I was continuing the prior post. It turned out faggot mod, probably you, deleteed the thread between my posts.

Why don't you contribute instead?

This is an example of a scripting language user "contributing" to the circle jerk rather than the topic. Think long and hard about their kind of contribution. It may just be guiding you to just below them and never allow you to move without their consent.
>>
>>57848296
or approval. removing name mow.
>>
File: 38.png (591KB, 3200x1610px) Image search: [Google]
38.png
591KB, 3200x1610px
Meanwhile on /a/
>>
>>57848296
>to let thevmain poster know that I was continuing the prior post
It's usually obvious from context, you idiot. Also, your posts are unnecessarily long and filled with a bunch of irrelevant shit.
>deleteed the thread between my posts
Maybe you shouldn't be replying to cancerous threads, such as homework threads.
>Why don't you contribute instead?
Who says I haven't? I have posted several times in this thread, as an anonymous poster.
Also, telling shitty posters to fuck off is a thing that people on here don't do enough of any more.
We have community standards to maintain.
>This is an example of a scripting language user "contributing" to the circle jerk rather than the topic. Think long and hard about their kind of contribution. It may just be guiding you to just below them and never allow you to move without their consent.
I have no fucking idea what you're trying to get at here. You're really just spouting a bunch of nonsense.
>>
>making a fuss about namefagging in 2016
Just die already.
>>
>>57848508
Namefags are just as bad as (if not worse than) tripfags.
99% of the time, they're just some retarded redditor that strayed over here and shits the place up.
>>
>>57848523
Anonymize.
Or go back to /b/.
>>
>>57848555
It's to do with the quality of their posts and their inability/unwillingness to follow community norms.
Hiding their names changes nothing.
>>
>>57848570
So what was particularly bad about
>>57848238
>>57848246

Other than that you may not agree.
>>
>>57848573
The posts are complete tripe.
They're spewing on about a bunch of unrelated shit that nobody asked about, and a written in an incoherent style where there is no obvious point being argued.
They also unnecessarily use "big words" in a failed attempt to make themselves appear smarter.
>>
>>57848610
>The posts are complete tripe.
I agree but I told you to ignore that.
>They're spewing on about a bunch of unrelated shit that nobody asked about
Rambling isn't rare on 4chan.
>smart words
It's on the topic of being articulate. Of course you get self-conscious about it.

I don't see this as a general case with namefagging/tripfagging at all.
>>
>>57848497
case in point

you should leave if it bothers. trust me, nothing of value will be lost in your absence. the case for anonymity lies in the congestion of the thoughts as neutral. in your case it seems to stem your degree of entitlement and allows you to blather as a scope of precedence to something you only highly esteem as a port of meme. I've been here for 10+ years and the only problem with namefags was that they'd try to correct people and later ask people to remember them by name which would make them prevalent among manu people and their cultures if the topic ever became pervasive enough that a sourcebwould need to be cited. Like at a convention where a tv group asks to know about anonymous and they like it for reasons not like you.

And since you're anonymous you can actively try to discredit me on the grounds that I'm not properly hip to square just like "normies" do to nerds and hipsters in real life. You're literally representing everything you are claiming to hate about namefags within this culture. I have helped with plenty and it's all relevant. See the sticky post forbwhy I brought up freedom of thought and open source software.

You're a piece of shit. I'm hising all your posts.

See? I can be immature too. It's not like being known as the guy that helps procrastinators with their homework ( cue over-achievers on /g/, oh wait ) and the guy with an awfully verbose writing style is going to do me any good in the real world. So why not leave me to it and just hide my posts? Oh, because I didn't give them the one particular answer they wanted? Have you ever heard of the saying that goes "teach a man to fish and he'll eat for a day, but teach him how to swim and he might get laid too?" It means fuck you, faggot. Go spread your misery elsewhere.
>>
>>57848706
Do you even speak English properly? Are you just mentally deficient?
Your post is filled with missing words, bad grammar, bad spelling, and you're using idioms improperly.
It's taking quite a lot of effort to even figure out what you're even trying to argue.

For example:
>I'm hising all your posts
What the fuck do you mean by that?
"Hissing"? You're not a fucking snake, and NOBODY would say that they "hiss" at things.
I seriously cannot figure out what you actually meant to say.
>>
also my post about being articulate was the difference between programmers and scripters as a concept of approaching problems in the real world. Clearly you use javascript and/or python. In that case, great. Go sell your ideas of anonymous communities somewhere else or apply some philosophy of math to your studies and attempt the values I attempted to convey with my posts. I want to see how far you'd get rambling the way you do in a truly anonymous community the likes of which you'd find on tor and such. Your tone would change so fucking quickly if you knew how fancy their words can make your modes of thought seem. ( I'm saying they are pretty barbaric and wouldn't spare an inch to see you, through your camera phone, squeal at least once every day ) I know this from experience.

Scripters value prestige. I'm arguing from the point of view of programmers who value a sense of efficacy and respect for their craft. Dignity, some would call it. You are arguing for your super secret cool goys club funhouse etiquette and are taking up posts that could be used for relevant posts or questions that would help push the understanding we create here at dpt. The public forum for programmers. Any of them. Even, Ruby, who happens to be a Master in the field is appreciated here as a vapid brony and tripfag.

Also, hi ruby!
>>
>>57848081
There's no connection to my mind. If anything articulate people might be stuck in the language specifics if we were to assume articulate people care about language. I think they most certainly make better computer science people though.
And 'better programmers' is subjective anyway.
There's those who favor people who get done fast and in 'acceptable' ways and there's those that want perfection.
>>
File: I HATE PROGRAMMING.png (81KB, 2560x1410px) Image search: [Google]
I HATE PROGRAMMING.png
81KB, 2560x1410px
I've been sitting here for two hours trying to make a goddamn LED light up.

WHY won't this work /g/.

Talk to me like I'm a fucking idiot because I can't code my way out of a paper bag.
>>
>>57848774
>And 'better programmers' is subjective anyway.
No, we can objectively say that programmers who use OOP are worse than those who don't.
>>
>>57848783
No because not every OOP programmer is worse than every non-OOP programmer.
I've taught entry level high school programming so I know.
>>
File: 1480554975424.gif (776KB, 300x226px) Image search: [Google]
1480554975424.gif
776KB, 300x226px
>>57848756
So you have an fault intolerant system and can't manage metaphor and analogy if one word is mispelled. Also, I used no true by the book idiomatic sequencing. I function at the word for word level for the sake of being concise. As a programmer should. You are arguing we should all import argument, while I'm telling you that each and every word and expression used carries with it a clear cut understanding of the merits to be posited TOWARDS your work as a programmer. You keep saying I don't talk like an ameriburger, I am an american but I speak english for the sake of communication not americana, but we're here arguing for clarity or what the rules are and demonstrating why they were created yet all you seem to say is "you don't write how I like to speed read and what you say makes it difficult to scan over your posts without digesting them a bit and then breathing between sentences here and there". You're a glutton, anon.
Take your time piecing it all out and you'll see just how much I've actually prepared for you.

As a concession, I'm on my phone so I won't be clearing up all typos. I'm really going to stop responding to you now.
>>
>>57848795
>that gif
They go hard. Soccer would be more interesting like this.
>>
>>57848788
>entry level high school programming
How on earth is that indicative of anything? High schoolers are at best, complete novices who have absolutely no background in computer science.

>>57848782
Read the error messages.
>>
>>57848795
>I'm on my phone
>Typing out fucking essays on your phone
Anyway, get out, you cancerous namefag phoneposter.
>>
>>57848795
He's obviously being pedantic, but you're being a moron for falling for his bait.
>>
>>57848803
But they can't understand the simplest shit.
Control flow confuse them. Especially the conditions you use. They can often not think through a procedure and keep the state in memory even if it's just one value.
I like to think I'm not a bad teacher but of course I can't be sure.
OOP programmers come in all flavors.
>>
Trying to return a pointer to a specific position in a string, but I get warning "return makes pointer from integer without a cast".
/* Skip white space in string */
char *moveToNextNonSpaceChar( char *s )
{
for(int i = 0; s[i]!='\n'; i++)
{
if(s[i]!=' ')
{
return s[i];//WARNING
}
}
return 0;
}
>>
>>57848803
Believe me, I tried. I don't know what they mean.

ANSEL and ANSELH shouldn't need to be declared. It's literally an analog select command not a variable.

I don't know what unqualified-id before numeric constant means. I googled it and it told me I'm missing semicolons. I put semicolons in and I still get it.

The error messages are absolutely useless.
>>
>>57848817
Imagine how much better they'd be if you taught them Clojure instead of Java.
>>
>>57848758
Well, is your identity any relevant to your posts?

>>57848826
You mean, Haskell.
>>
>>57848817
>I like to think I'm not a bad teacher but of course I can't be sure.
There are somewhat convincing "theories" saying that a large number of people are just incapable of learning how to program. They cannot form a correct and consistent mental model of how a program works.
>>
>>57848795
>I'm on my phone
Yeah that was obvious from the start. I hope everyone caught how poorly paragraphed this is.
>>57848820
>return 0;
0 is an integer.
you may want to
>return (char*)NULL;
>>57848826
'C++' actually.
It was really just a subset of C++ which is similar to C to start with. Not my choice.
I gave them the entire turing machine history and explanation of computers too.
It's something I felt I missed. Everything in a computer seems like magic without making the fact that all comptuers do is take input and produce output and every step inbetween is operations on data. It seems obvious now but back then you could easily imagine a lot of magical things.
>>
>>57848820
Right, because you're returning the VALUE of the string at some position. You want to return the pointer, either by
return &s[i];
or
return s + i;
>>
>>57848822

#include <pic.h>
>>
>>57848855
>>57848858
Thanks.
>>
>>57848855
>>return 0;
>0 is an integer.
>you may want to
>>return (char*)NULL;
Maybe I am a terrible teacher.
I'm not even reading the problem carefully.
Ignore this. >>57848820
>>
>>57848820
This is because you're return the value of the ith character in the array.
Try this, instead.
char *f(char *s) {
while (*s && *s == ' ') {
*s++;
}

return s;
}


The first part of the conditional '*s' checks that we have not reached the end of the string.
>>
>>57848861
No such file or directory.
>>
>>57848873
you should also add in a check for *s != '\n' BTW i forgot to put it in:

whlie (*s && *s != '\n' && *s == ' ')
>>
>>57848782
I've never messed with one of these. What's the specific technology? I'll look over a manual or something and try to get back to you promptly. Have you tried adding an underscore between led and port and setting the value to B0?

The setup() part there will most likely be the function called to arrange the manner in which the data will be read off the board. But like I said, I've never messed with one of those things.
>>
>>57848837
Haskell and the work that Simon Peyton Jones has done have advanced the field in a lot of ways.
However, teaching effect-less programming to a novice would probably turn them off to programming in general.
<your favorite> Lisp dialect teaches the novice far more about core CS fundamentals, like parse trees, than Haskell would.
Teach Haskell to a novice would be like trying to teach a novice piano player Moonlight Sonata when they don't understand the concept of a chord.
>>
>>57848837
it's not an identity. I just forgot to remove it before I came back to this thread. That's just one of the mods bickering at me aobI become agitated or scared and stop treating sjw/tumblrina CoC and it's many various forms like they are the problem.
>>
File: PortalStencils.jpg (195KB, 747x976px) Image search: [Google]
PortalStencils.jpg
195KB, 747x976px
Portals now support masking and general non-VR support is working entirely

Almost done with these, finally.
>>
File: FEST.webm (540KB, 836x406px) Image search: [Google]
FEST.webm
540KB, 836x406px
>>57848921
>>
>>57848911
what the fuck man, i changed it to nned girlfriend and now its back.

i may have to make a better one.
>>
>>57848932
That popup scared me for a second, then I realized I will never be able to use Windows again
>>
File: PIC.png (740KB, 2067x720px) Image search: [Google]
PIC.png
740KB, 2067x720px
Here's some pinouts and stuff. I have this chipkit board but I eventually intend to use the chip standalone so I don't want to get really comfortable with the chipkit pinout which is numbered differently.

The programming environment was more designed for an Arduino I think. There's some overlap but a lot that's different too. Using the standard blink program from the examples works but I want to do it the more "correct" way I guess for my MPU. I'm really mostly having trouble with naming IO pins correctly.

I tried setting up MPLAB which is an IDE more designed for PIC but I had some trouble getting it setup and it's very powerful and has so many features. I don't have the slightest clue how to set it up properly, what features I need and what I don't etc. It's too powerful for anything I need to do right now or have the capability to do.
>>
>>57848956
meant for
>>57848889
>>
>>57848895
You should teach them effect-less from the start
>>
>>57848966

yeah i got that, startpaging now.
>>
File: 39.png (2MB, 8000x4025px) Image search: [Google]
39.png
2MB, 8000x4025px
>>57846534
I fixed image exporting and improved performance a bit.
http://korbo.ga/g/thread/57846534
http://korbo.ga/{board}/thread/{thread}

I'll stop working on it now, got kinda bored of programming in Javascript..
>>
>>57847820
>scripting languages come pre-arranged and function mostly on the software level.
Does this make Java and C# scripting languages?
>>
>>57849333
Don't listen to his inane ramblings.
>>
>>57848895
I wanted to learn chopins 11th I think it was when I got into pianos and the separate parts of such a masterpiece helped me get familiar with it all on a deep level. I just lacked anything sufficiently intelligent to talk about. However my ear was a redeeming factor in the matter and people appreciated that, at the least. I was injured shortly after that, though, and kind of drifted away from it. I think maybe rearing has a lot to do with how we take to things, a sense of adventure can act as recompence in lieu of a viable standard, and I say after realizing that severe and grievous injury, both to head mind and body, were not able to keep from learning at the rate and deoth that I do. Though doing so during the time of the injuries filled me remorse about who and what I was, sometimes regret, I never thought that my efforts would hold as I knew them even in coming to as the person I kinda sorta remembered myself to be.

That daid, if they want to learn and think a certain, I do believe they can. But if it's for the sake of gaining momentum on a dirt road then perhaps teaching them through a scaled artifact of mode and "pension" might be more rewarding to some with ulterior motives in mind. Things like being first or getting an A too.
>>
File: 03.jpg (83KB, 500x718px) Image search: [Google]
03.jpg
83KB, 500x718px
WAIT is the OP yuki?
>>
>>57848419
gib link to your site anon
>>
Learn haskell for a greater good VS the haskell wikibook?
Which ia better?
The wikibooks seems broader, but it's a wikibook so I have my prejudices
>>
File: 1429198964924.jpg (113KB, 984x927px) Image search: [Google]
1429198964924.jpg
113KB, 984x927px
>>57849443
yes
>>
>>57849457
This >>57849099

Also, the source https://aww.moe/hiiujc.zip
>>
File: 1480553447607.gif (2MB, 540x373px) Image search: [Google]
1480553447607.gif
2MB, 540x373px
>>57849333
No, because Java is literally built on the foundation of a "real" programming language and does so in real time, through an assembly contract that can be altered at any time. The JVM isn't etched in stone. You can literally edit any part of it, including keywords and such. That would just be a more involved process and leave you rather open to attacks if you don't abide ( condone? ) the system designed as it was prescribed from the perspective of security.

C# is literally C with more keywords and a more descript library set. It also functions from a central hub, like the Java to the JVM, but is also tied to the operating system from which it confers. The two cannot be separated and thus act as compiler, environment and language rather than simply an interface.
Javascript is an interface in the sense that it ties itself to a functional quality of the mark up and styling nuance tied to that and lets you create an observable range of "function" over that environment. Never does it let you access memory directly. Instead of that it allows you to re-term the idea of function as a qualitative request for re-formatting and waits idly as the languages that undercurrent the platform it rests on manage the request as they are intended to and waits for a reply in the form of string information that represent the requested format and styling functions that were returned as declarative.

Java, I believe, was created over a cpp information set that helped define a variable construct which the JVM can set itself to and amaglamate from so as to create and set a standard through which we can manage information more comfortably or more in tune with an existing pragma as set by the specific standard of appreciation of set data qualities.

Hence the jokes about poo in the loo. It's clear they edited the systems to sound, look and feel, react and assert more like things do India. This is why I am using startpage. I speak english most comfortably. I will not learn Indian.
>>
>>57849513
Take your meds.
>>
>>57849513
>C# is literally C with more keywords
Are you fucking serious. I've kept going on about how your posts are inane and full of bullshit, but that's just a level of retardation that I can't comprehend.
I'm starting to think that this is just bait at this point.
>>
>>57847471
The variable is read only, you can't change it's value. But you can access the memory address it refers to directly and change it's value.
>>
>>57848966
hey is this homework? Imma be doing other things while reading over the manual and some blogs, just finished texting a friend, and am also answering any quick questions that pop up. I don't really know much about circuitry so I will be jumping to wiki and pdfs for answers to what things are and thought I'd let you know how far my own research process goes. I may catch an answer sooner than later but I really don't like having a mod working off of a cms talk down to me about my prowess on the matter when there isn't much said but several people chiming in on the latter course to madness I have taken. I am here every day, but as I said I don't want to risk any grousers.
>>
>>57849589
Correct me, pooh bear. There's certainly.been enough time and air in you for that to happen.

Also, that is a terrible wavefront algorithm.
>>
Ladies and gentlemen, MIPS' very own George and Grace.
>>
>>57849615
No. It's not homework. Just learning for personal projects. I already passed a Microcontrollers class... somehow. We worked with a PIC16 chip programming in basic. My professor was awful. I learned virtually nothing.
>>
>>57849631
>Correct me
Ok. Here is a C program that is not a valid C# program:
int main() { }

It's literally the most basic C program that can exist, and C# is not compatible with it.

>pooh bear
>enough time and air in you
Who the fuck says things like this?

>Also, that is a terrible wavefront algorithm.
What?
>>
>>57849707
Okay, you got me. It's not literally the same language. To think they'd have to find out something like that. My professional career is doomed.

And fyi I say things like that.

Also, don't worry about that last part, It's likely just on a need to know basis.
>>
>>57849679
Alright well at least you're still awake. I'll keep reading. That's the blinking light program, right? From what I've in the arduino styled ones you just set the button to off, redirect output from it and then use the setup function to set a high pass, whatever the fuck that is, a low pass, a what?, and then resign the program to sending the same two signals with a delay between each of the signals. It shouldn't be too hard but I felt my balls shrivel at the sight of the controller and part names. Can't have that happen with every new sentence. Might have to fap once or twice between readings.
>>
>>57849744
>>57849772
It sounds like you're a reasonable person, who's somewhat well-informed, but also drunk or on some other drugs right now.
>>
Does anybody have a surface pro 4, 4GB core M version? If so, how is it for programming in an IDE as heavy as netbeans and/or visual studio?

How is it for light photoshop usage?
>>
>>57849790
>well-informed
No. He's an idiot.
>>
>>57849790
>reasonable
>drunk
Pick one.
>>
File: Taskmgr_2016-12-05_07-14-36.png (4KB, 781x35px) Image search: [Google]
Taskmgr_2016-12-05_07-14-36.png
4KB, 781x35px
>>57849793
Visual Studio really doesn't need that much CPU/RAM to use.

The main complaint about it being heavy is that install sizes can be 15GB or more on disk with enough dev tools installed, like Xamarin (includes multiple Android emulators and a few SDKs) and other languages.

I've got a multi-project solution open for a Xamarin app + GUI editors and this is the resource usage. This jumps up a bit during a build but settles back in afterwards.
>>
>>57849494
Is there something more like that?
>>
>>57849790
Don't worry about that. Just have fun. I avoid the issues that come from speaking more languages than one, something your typical American will not do, and preferring some languages to others for addressing certain principles. That applies to my programming, rhetoric, philosophy, maths and then some. Like I said before, that kid is a mod, the girl also a mod. What they do is harass people to keep the culture quality as low as possible and hope that people will funnel out of the arguments and into the shill threads.

I am what some would call a mwgtow, for lack of a better term ( but really I avoid any emotional aspects, that means women, platitudes, rhyming and spoon feeding, bc of all the kids on here that shouldn't be here but are anyway ), and that means thay my valid points will not be clear enough to the male who goes along with his mother and too crazy to comprehend for the female that can do bad all by herself.

I'm going to get back to reading my startpage results.
>>
AoC 2016, Day 5.

Part 1:
from hashlib import md5

def main():
input = 'abbhdwsy'
output = ''
index = 0

while len(output) < 8:
hash = md5('{}{}'.format(input, index).encode()).hexdigest()
if hash.startswith('00000'):
output += hash[5]

index += 1

print(output)

if __name__ == '__main__':
main()


Part 2:
from hashlib import md5

def main():
input = 'abbhdwsy'
output = [None] * 8
index = 0

while not all(output):
hash = md5('{}{}'.format(input, index).encode()).hexdigest()
index += 1

if hash.startswith('00000'):
pos = hash[5]
# 0-7 range
if ord(pos) < 48 or ord(pos) > 55:
continue

if output[int(pos)] is not None:
continue

output[int(pos)] = hash[6]

print(''.join(output))

if __name__ == '__main__':
main()
>>
>>57848921
>>57848932
now ur thinking with protalds :d
>>
Where are static variables stored in C?
Are they on some sort of a stack?
Can you blow it by having too huge static pool of data?
>>
>spend all my time writing easily extensible general tools for my coworkers
>instead of extending it and following my patterns they either try to force my tools to work in incovenient ways or create some bizarre solution
>when I'm not doing this they just duplicate everything and write monolithic code
Is there anything I can do?
>>
>>57850008
Fire and hire.
>>
>>57850008
This may not make sense to you but it's because they want to take pure credit for it while you went fifty million different ways and came off like an idiot. Don't take praise for it next time.
>>
>>57850008
If by "easily extensible general tools" you mean OOP I don't see what's wrong with your colleagues.
>>
>>57850047
>OOP
What is that?
>>
>>57850044
That sounds like a very specific situation. Are you sure it applies here?
>>57850047
We're a functional programming shop. The majority of what I write for them involves function transformation, but they also fail on basic utilities and structure.
>>
File: 1413090181218.png (68KB, 1000x984px) Image search: [Google]
1413090181218.png
68KB, 1000x984px
Can't even make a simple game like Snake from scratch.
>>
>>57850120
what do you think the problem is?
>>
File: Flandre.Scarlet.full.1902442.jpg (332KB, 541x750px) Image search: [Google]
Flandre.Scarlet.full.1902442.jpg
332KB, 541x750px
>mfw clang warnings
why isn't it more popular, am i missing something?
>>
>>57850180
she is a cute
>>
File: bell.jpg (25KB, 450x215px) Image search: [Google]
bell.jpg
25KB, 450x215px
>>57850180
Same reason Reddit is more popular than 4chan
>>
>>57850004
before entering the main() function, the runtime must allocate all global/static variables. usually, those are stored in the data segment.
>>
>>57850221
4chan is shitpost central. People want the civil (curated) discussion of Reddit, not endless shitposting retardation of 4chan.
>>
>>57850225
Can the data segment be arbitrarily large?
Will I run into problems if I have big static arrays?
>>
>>57850263
yes and yes.
>>
File: ISO-IEC-9899-1999-cover.png (173KB, 1651x2338px) Image search: [Google]
ISO-IEC-9899-1999-cover.png
173KB, 1651x2338px
What C should I seek for?
Is it true, that if I want to make most portable code, I should write in ANSI C?
Should I drop ANSI C?
>>
>>57850281
Oh, and if I were to teach C, I should teach ANSI C or C11?
>>
>>57850281
No reason not to use C11.
>>
Testing something
[Prettyprint]Hello code box[/Prettyprint]
>>
File: 1440643290806.png (28KB, 520x620px) Image search: [Google]
1440643290806.png
28KB, 520x620px
Can anyone help with events in python? Say I have a program that displays a 3x3 board and the user has to select one tile he'd like to play his next piece. For the user input I have a function that gets it via raw_input() and all the user needs to do is type the tiles position [x, y]

[0, 0, 0]
[0, 0, 0]
[0, 0, 0]
"Select position [x, y]"


Then raw_input would be called and he'd type the desired position. Now, it's working perfectly and initially everything was running on console. Later I made a GUI using Tkinter and added a button event that takes the mouse position when clicked and is able to select the position from the screen. So in our previous example if I clicked on [1,1] for example, the GUI would print [1, 1] on the console.

However, my problem comes when I need to "pass" said parameter to the other file (say the file with raw_input() is called raw.py and the GUI is called gui.py). So I have two files, one that takes the user input from keyboard and the other that tries to get it from the mouse event. In our example, how can I return "[1,1]" to raw.py? Can it be done without resorting to threads or not?
>>
>>57850312
Might I use C++ as well?
>>
Anyone know how to post that white code box?
>>
File: Robert_Tappan_Morris.jpg (63KB, 474x480px) Image search: [Google]
Robert_Tappan_Morris.jpg
63KB, 474x480px
I'm doing a C tutorial. It is an old one and it uses gets() and after getting a warning and looking up some help on stackoverflow I have found that I should be using fgets(). Now everything is peachy as I have been progressing through the tutorial.

The following works:
/*
* 12-5-2016
* Demonstrate the equivalence of stream input and output
*
*/
#include <stdio.h>

#define BUF 256

int main()
{
char buffer[BUF];

/* input line then immediately output it */
puts( fgets(buffer, BUF, stdin) );

return 0;
}


The following doesn't run.
/*
* 12-5-2016
* Demonstrate the equivalence of stream input and output
*
* NOTE: gets() is not safe.
*
* equiv-0.c:16:11: warning: implicit declaration of function ‘gets’
*
* equiv-0.c:16:11: warning: passing argument 1 of ‘puts’ makes
* pointer from integer without a cast
*
* equiv-0.c:(.text+0x2a): warning: the `gets' function is dangerous
* and should not be used.
*
* RESULT:
* Segmentation fault (core dumped)
*/
#include <stdio.h>


int main()
{
char buffer[256];

/* input line then immediately output it */
/* p335 Because gets() returns a pointer to the string, it can be
* used as the argument to puts(), which displays the string
* onscreen
*/
puts( gets(buffer) );

return 0;
}

Why does the above code generate a segFault if I input something less than 256 chars? It is not safe, but if I just hit enter without typing any chars why is it segfaulting?

I'm using a linux distro (gcc) if that matters.

I'm guessing pic related, but I don't understand why.
>>
>>57850359
Read the sticky, newfag.

>>57850364
What would you even need a thread for?
Just make a function in the file that takes the coordinates as an argument, then import the function in the other module, and call it from there.
>>
>>57850386
>Just make a function in the file that takes the coordinates as an argument, then import the function in the other module, and call it from there.
Hmm, you are right, I was just being dumb and stubborn. Oh well, guess I'll rewrite how this agent plays the game then
>>
>>57850249
Do you realize that being civilized literally means being memed? I've rarely seen valuable discussions on Reddit ignoring the numerous cat pics and cancerous imgur shitposting. After all why don't you go and join them then?
>>
>>57850249
I come to 4chan for unbiased opinion, you pack of shit
c: POUR TOUS
>>
>>57850383
>Why does the above code generate a segFault if I input something less than 256 chars?
You probably mean "segFault if I input something MORE than 256 chars?"
Because that's a buffer overflow.
If you mean less see:
>char * gets(char *str)
>This function returns str on success, and NULL on error or when end of file occurs, while no characters have been read.
So you're passing null to puts and that's what fails.

Something I suggest you do when you have issues is split up calls like these into multiple lines. So you get the error in a more productive manner. i.e.:
int main()
{
char buffer[256];

/* input line then immediately output it */
/* p335 Because gets() returns a pointer to the string, it can be
* used as the argument to puts(), which displays the string
* onscreen
*/
gets(buffer);
puts(buffer);

return 0;
}

This would generate an error on the puts line and not the gets line. Which lets you narrow down your problem a little bit more.

Also I'm not sure why you favor putting gets inside the puts like that. Do you have any particular misconceptions that would make you think that's preferable or is it just stylistic preference?
>>
>>57850447
>4chan for unbiased opinion
I get what you mean but you don't mean unbiased. You mean pure unadulterated opinion.
But with /pol/ and their attitude spreading like the cancer they are you find that people more often than not push agendas.
>>
>>57849679
Hey so i found this code for it, says it'll work for any arduino thing but I'm remembering that you mentioned wanting to do it your own way.

int ledPin = 43;                 // LED connected to digital pin 26
void setup()
{
pinMode(ledPin, OUTPUT );
}
void loop()
{
digitalWrite(ledPin, HIGH );
delay(1000 );
digitalWrite(ledPin, LOW );
delay(1000 );
}
>>
File: ardui-yes.jpg (76KB, 550x477px) Image search: [Google]
ardui-yes.jpg
76KB, 550x477px
just got one of these arduino pro-micros. Any ideas for projects?
>>
>>57850465
so going over the code, you find what pin your led is set to and create a variable to store the value that applies to it. That would be what you were doing in the #define section, which really you can change to anything since you're just creating a named variable to keep track of your values and for readability. An on paper list should do just fine. I'm almost certain LED_PORT B0 should do just fine if indeed it works that way but I'm gcc doesn't have an environment variable for setting LED_PORT from a static context. That would mean that you are going to need to create a variable, hopefully through regular C syntax, unless it's super important to you that the LED pin be set in the stack ( though any info pertaining to the components themselves will be searched for out of the gcc context and rather as an appropriation of the signal sent to the chips through the same means as any other signal. Hence my hoping that it is sent through the regular variable space, make it static if you have a nerve for pet peeves, and just avoid the need for including header files you will only use a single time.
>>
>>57850462
oh well, thanks.
>>
>>57850470
Next, I suppose you'll want to figure out the value to set a single led to on, which I do not yet know, I do know, though that a value of 5hz or Mhz, I forget which I read, sets 14pins to 'on' instead of waiting for for all pins to turn on one by one as would be the usual course. There should be some way to divide that 5Mhz into a single significant signal, though I'm sure dividing it by 14 won't do. I will keep looking for that single LED signal value. For now, have you tried this website/forum? The thread it opens to has a brief checklist on how to get working on your chipKIT32 without any arduino or chipKIT bull diddle:

http://chipkit.net/forum/viewtopic.php?f=19&t=2963
>>
>>57850480
I figure using the signals should be easy enough but there seems to be layers to this thing that will probably make that difficult, like drawing to the screen and using the sound card are almost impossible when using C on any operating system.

Okay, the signal for any one LED is 0xAA, I think. Going off of the buffer for one the code snippets. That means that the high value will be set as 0xAA and the low 0x00. Now that we have those two values we can go in to the function implementations, possibly found in the header files, which you will need to include in order for the C compiler to even access the correct paths or channels. I'm really not sure, just putting a thought process out in the open for you to ponder over.

I figure it goes like with any computer. Processor is described an action or event and then it uses the values and types as hints to look for a way to use the existing configration of "peripherals" and chips to produce the proper signals to put into effect the particular action or event. This means that in order for the code produced, the way you want to produce it anyway, to produce any results, you need to send the particular chip signals to the right chip and in the right order while abiding the list of routines and protocol limits so that your signals don't accidentally leak to the incorrect chipbamd make your machine go haywire, which by any professional standard should be difficult and will just be making your components perform strikingly different.

So you will be checking the pic32xxx.h file for any indication on what values are set to which variable and how that fits into the greater scope of your machine. This may require you to check the header files to your header files and so on until you reach a blank slate from which you can tread upwards back to the gcc context or the plain board as you would see fit.
>>
>>57850431
>being civilized literally means being memed?
>being memed
/dpt/ is getting too retarded.
>>
Is it worth not using virtual functions in favor of function pointers in C++
>>
>>57849679
>>57850465
>>57850470
The two of you would probably want to view this:
http://www.crash-bang.com/arduino-digital-io/
>>
>>57850495
It saves 200 cycles every now and then.
It's not really worth it for most people.
What you really should be doing if you cared is to sort your objects (I presume). Use switch cases and explicitly call the stuff you want to call on a large set of them.
That can be a significant difference compared to virtual functions or function pointers.
Just having function pointers like that is really unnecessary hassle for the most part.
>>
>>57847383
just make it a doubly linked list and store a foot pointer
>>
>>57847383
It could actually be faster depending on the nature of the search.
But I'd see this as a sign that you shouldn't have a linked list.
>>
>>57850453
Thanks for the reply.

>You probably mean "segFault if I input something MORE than 256 chars?"
No, I mean less. If I run the program (the second one) and I just hit enter then it segfaults. I would expect a segfault with something more than 256 (actually more than 255 I guess because it would add a null?..I'm not sure about that).

>Something I suggest you do when you have issues is split up calls like these into multiple lines.
Geez, I didn't think of trying that.

Well, it worked. Still don't understand why. Must be something funky with the gets().

I still get the following warning:
equiv-0.c: In function ‘main’:
equiv-0.c:31:5: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration]
gets(buffer)

Is gets() not part of stdio.h? I don't know. I really don't need to understand I guess. I won't be using this function.

>Also I'm not sure why you favor putting gets inside the puts like that.
I used C about 15 years ago. I am more familiar with python today. I would never do that in my code for any language. But with this example, since it was only a few lines long I copied it straight out of the book.

For the longer examples I wouldn't have done that. But I should have done it here as I now see the issue is with gets().

TL;DR
    # Works
gets(buffer);
puts(buffer);


and
    # SegFault
puts( gets(buffer) );


Think I'm going to move on to the other stream function examples. Thanks for the input!
>>
>>57850492
Being uncivilized doesn't necessarily mean being a barbarous individual.
You could have proper manners if you knew exactly why you were living this way and not another one.
>>
I am not done with that yet, I may buy one for practice, but I think for now that's a good direction to take. From where I'm standing it seems like there's a software layer that directs to the gcc layer which is transmistted to the to the processor through a layer of disassembly/assembly ( depending on how you look at it ) which is then running a configuration to keep to the firmware layer which describes the limits to keep all components running on equal measures of power ( probably as a masking regiment for any noise or probably as a lack thereof ), an. possibly a set of routines that keep the order of things from burning at the sense of thing. as they naturally perceivable in your environment. Think about the direction water flows when you flush a toilet. I'm almost certain there's a bit of planning for that as it applies to directions proper to certain environments.

Like running carrier signals on a different polarity might lend itself to caching information on the opposite endian wave if they were to collide with any existing wavelenghts already in the air.

Does that sound crazy? After all this computer research I don't think that sounds crazy at all...
>>
Where i learn how to be a hacker?
>>
>>57850592
Learn PHP and replace the background of /b/
>>
>>57850573
Ok I just answered my own question.

>I still get the following warning:
>Is gets() not part of stdio.h?
https://stackoverflow.com/questions/34031514/implicit-declaration-of-gets
>You are right that if you include proper headers, you shouldn't get the implicit declaration warning.

>However, the function gets() has been removed from C11 standard. That means there's no longer a prototype for gets() in <stdio.h>. gets() used to be in <stdio.h>.

The compiler will always spit out that message if I use gets().
>>
>>57850592
01000011 01101111 01101110 01100111 01110010 01100001 01110100 01110101 01101100 01100001 01110100 01101001 01101111 01101110 01110011 00101110 00100000 01011001 01101111 01110101 00100111 01110010 01100101 00100000 01100001 00100000 01101000 01100001 01100011 01101011 01100101 01110010 00100000 01101110 01101111 01110111
>>
>>57850573
Ah well you misunderstood me.
>No, I mean less. If I run the program (the second one) and I just hit enter then it segfaults.
Ok good we've confirmed that. Now the reason you segfault in that case is because (this random C library documentation I found) https://www.tutorialspoint.com/c_standard_library/c_function_gets.htm says explicitly that the return value of gets is the pointer you pass in if all is well (you input some characters). But if you don't input any characters or there's an error it returns null.
The reason the
# Works
gets(buffer);
puts(buffer);

works now is because it's not using the return value. gets doesn't change the parameter, so it's still pointing to the stack where you have your buffer.
puts( gets(buffer) );

will not work in that case because while buffer still points where it should it's not the return value of gets, the return value of gets when you don't input characters is NULL. Which puts later dereferences that NULL and segfaults.
>I copied straight out of the book
I don't like your book but I probably don't have better recommendations. It seems dumb to introduce things in this way without explicitly mentioning the exact error you just got.
>implicit declaration of function 'gets'
I just googled this. I haven't used gets in forever but apparently:
http://stackoverflow.com/questions/34031514/implicit-declaration-of-gets
It's no longer in the standard.
>I won't be using this function.
Yeah that's advised. Use fgets if you want a similar api.
>>
>>57850375
set a bb code for code
 and close it with 

it might help you to know that [] refers to the data table in some circumstances and that referring objectively to a property or command will often return value or behavior. In that case it changes the mark up to that of a particular style and the closing tag renders it an obsolete command. I hope that doesn't sound crazy. Also, I'm sure [] is sanitized so that [].somethingHere will not return something in there. Just thought you should know that.
>>
>>57850577
Being uncivilized in the traditional definition (not the "WELL CIVILIZED MEANS DIFFERENT THINGS TO DIFFERENT SOCIETIES" bullshit that people use to move the goalposts) carries the implication that one lacks the ability to function within a group of some kind while maintaining basic social pleasantries, putting thought into one's discourse with the group, and having enough moral fiber to not scream buzzwords, canned arguments, and catchphrases at people aka knowing when to shut the fuck up before you shove your foot in your mouth.

"Being memed" isn't a definition.
>>
>>57850592
Watch defcon talks and see if you're silly enough to be a hacker.
>>
How to learn java to make android apps?
>>
>>57850636
Thank you.
>>
>>57850664
There's not that much Java to learn really. On android you will mostly be dealing with the android API.
I honestly think even this https://www.youtube.com/watch?v=WPvGqX-TXP0 shitty java introduction could suffice.
It's not that there's anything wrong with it it's just that you only need the light familiarity with Java to write Android.
>>
>>57850383
you may have set the values leading up to the end as null, which means the iterator, while still expecting to finish out its current process, will return the proper error, a segfault, and close out. Try setting all the values to 0 rather than null.

>>57850644
I meant [ c ode] without the space in the word and adding the escape character / before the word code in order to close it.
>>
>>57850744
[
code]test[/
code]
>>
>>57850632
01010010 01100101 01100001 01101100 01101100 01111001 00100000 01101110 01101111 01101001 01100011 01100101 00101100 00100000 01101110 01101111 01110111 00100000 01110000 01101111 01110011 01110100 00100000 01000011 01010000 
>>
>>57850758
[.code][/code]
Remove the '.'
>>
read the fucking sticky >>51971506
>>
>>57850664
download android studio

theres bazillions of tutorials

use a library like libgdx for ez graphics if you need it
>>
>>57850763
>>
>>57850758
a good rule of thumb when dealing with code is no spaces unless you mean to change topics.
>>
>>57850788
You put the code inbetween the code tags.
>>
>>57850760
01001111 01101000 00101110 00100000 01001111 01101011 01100001 01111001 00101110 00100000 01001100 01100101 01110100 00100000 01101101 01100101 00100000 01101010 01110101 00101110 00101110 00101110 00100000 01101110 01101001 01100011 01100101 00100000 01110100 01110010 01111001 00101100 00100000 01000110 01000010 01001001
>>
>>57850805
That was cute. Admit it!
>>
>>57850819
Very cute. Good girl.
>>
>>57850805
<?php
echo "the code";
?>
>>
>>57850803
and when dealing with particular languages that ignore white space you'll notice that sometimes expressions function in parts, so that you can create differentiations to all those parts. in the C style languages you can refer to those parts as lvalues, operators and rvalues.
>>
File: 1480554879020.gif (2MB, 360x203px) Image search: [Google]
1480554879020.gif
2MB, 360x203px
>>57850819
am not anon. am not grill.
>>
>>57846631
>ideally you should install Haskell Platform
ideally you should be using a real distro that has a package manager
>>
>>57846906
Just add
-dynamic
to make it dynamically linked

Running a quick test, that takes it from 2 MB (statically linked) down to 15 kB (dynamically linked) on my machine.
>>
>>57847125
>>57847258
Y'all people need to read this link

https://ghc.haskell.org/trac/ghc/wiki/LinearTypes
>>
>>57850939
Never mind, I'm retarded and stopped reading backwards just one post before somebody else mentioned linear types already.

Oh well, still a good link
>>
Then again, what's the power of impossibleness to change the program state?
What can be some real life purpose examples?
>>
>>57850957
Could you rephrase your question in english?
>>
>>57850957
>>57850965
I really can't get it either.
Anon here must be super smart.
>>
>>57850957
Being explicit about the effects a piece of code can have help with safety, readability, optimization, etc.
>>
>>57850893
or you could just install stack and work off the command line so you could treat it like a package manager. I like the whole deal with linux and a package manager too but in the case of win10 users a lot of people might be dissuaded. By what some are calling difficulties booting from the uefi system. I didnt really read the rest of that so I'm assuming its uefi.
>>
>>57850975
>>57850965
how can you not understand him, did you have a long day or something
>>
I'm trying to write the quick sort algorithm in C. It should be easy but I guess I struggle with the mathematical side of CS more than I thought.
>>
>>57850922
Is there no way to statically link, but only the parts that are actually needed? There is no way those 2 megs don't contain a lot of dead code.
>>
>>57850977
Well, what are downsides then? Where it can't be appicable?
>>
>>57850992
>or you could just install stack and work off the command line so you could treat it like a package manager.
Yeah, or I could be using a real package manager instead of a make-believe language homegrown bullshit “package manager” that fails at everything from resolving diamond dependencies to upgrading reverse dependencies.

>I like the whole deal with linux and a package manager too but in the case of win10 users a lot of people might be dissuaded.
Don't need cancerous winfags touching programming anyway
>>
>>57851023
>Is there no way to statically link, but only the parts that are actually needed? There is no way those 2 megs don't contain a lot of dead code.
To my understanding, that's how static linking already works. Only symbols you actually reference get pulled in.
>>
>>57850957
from 1 to 10? it shouldn't be too crazy considering you outlined the program yourself. So I'd say create an array entry for each variable and just create another array in a 2d array sequence for the variable states and run through the indices assigning the proper value to its composite environment variable, You would do better by creating a struct array but the array of arrays examples illustrates it rather well.
>>
>>57851022
What can't you understand?
>>
>>57851024
Slightly more effort, I guess, even though effects can be inferred.
>>
>>57851034
that's right you tell 'em
>>
>>57851061
Most of it :/

It's mostly implementation. I can demonstrate how a quick sort works with a physical example, but have no idea what I'm doing when it comes to actually writing the program.
>>
>makes a game in c++ using sfml
>can't run on another pc because of dll problems
>makes the same game in c#
>it runs flawlessly
why is c# so comfy
>>
>>57851002
I dunno, it just doesn't make sense at all. What does ‘program state’ mean in his arbitrary unspecified context?
>>
>>57851191
can't you just add the dlls to the c++ folder or something that adds the dlls to the program?
>>
>>57851191
how can a programming language be comfy?
you do realize that's how you make words lose meaning?
>>
>>57851191
>he wants things to work
smuganimegirllaughingatyourpatheticlife.png
>>
>clone large ass emulation project release branch
>there's a blatant syntax error
sometimes i get tired of open source shit, this would never have happened in a company with a reputation to keep
>>
>>57851220
this poster is trying to start a fight

why
>>
>>57851228
im not, how would you react if you saw this shit in the public release of your choice?
void operator()(const Vector3& p, uint32 Idx)
{
if (Idx >= objects_size)
{ return false; }

if (const T* obj = objects[Idx])
{ cb(p, *obj); }
}
>>
Is it weird I pre-plan all my hobby projects for the year, finished all my projects for this year so no programming till next year anyone else do this?
>>
>>57851216
the visual c++ redistributable thing is missing, and I get an error when I try to install it.
>>
>>57851272
That's a problem with MSVS, just compile with GCC instead using -static-libstdc++ -static-libgcc
>>
>>57851191
Because 1. you're retarded, 2. windows is terrible, and 3. you're only comparing windows PCs
>>
I'm trying to learn Haskell, I'm sorry for the newbie question but the wiki did not really help
Prelude> foldl (-) 0 [1..3]
-6
Prelude> foldr (-) 0 [1..3]
2

Shouldn't be both results equal?
>>
>>57851218
It has a meaning, one that is perfectly valid when applied to programming languages. Perhaps you just don't understand its meaning in context?
>>
>>57851304
foldl is left-associative, foldr is right-associative

(1 - 2) - 3
1 - (2 - 3)

compare
>>
>>57851297
>you're only comparing windows PCs
there is no reason to compare non-windows pcs. I want actual people playing my games, not hipsters or neckbeards.
>>
>>57851317
Nigger what?
>>
>>57851317
Now it makes sense, I thought it worked like
0 - 1 - 2 - 3
0 - 3 - 2 - 1
>>
>>57851337
I mean exactly what I said

compare those two expressions. work them out on paper if you need to
>>
>>57851140
I can suppose you using two values of the beginning of the list and of the end of the list as arguments.
>>
>>57851140
you are letting the heavier value float up to the higher indices, one space at a time, or letting the lower values take up residence upon the higher values, one step at a time.
>>
>>57851311
i do though. the usage of this word is simply wrong here
>>
>>57851351
No, fold* is always order-preserving w.r.t the operand order

Granted, my picture is more relevant for foldr1 / foldl1 but the idea is the same. R vs L just changes the association i.e. placement of parentheses

With the non-1 versions, it's more like

((0 - 1) - 2) - 3)
vs
1 - (2 - (3 - 0))
>>
File: 2016-12-05-170503_732x444_scrot.png (55KB, 732x444px) Image search: [Google]
2016-12-05-170503_732x444_scrot.png
55KB, 732x444px
>>57850632
tfw a hacker
>>
>>57851378
Then I'm convinced you do not understand its meaning, at least not in the sense >>57851191 and I both seem to understand it.

I suppose you are at an odds here. If I had to take a guess, I would assume you understand ‘comfy’ on a purely physical state of comfort level, rather than on a more metaphorical state of bliss or contentness with the state of things.
>>
>>57850651
a lot of them are memes. most of them don't even know how to program.
>>
>>57851502
>I would assume you understand ‘comfy’ on a purely physical state of comfort level
nope.
>rather than on a more metaphorical state of bliss or contentness with the state of things.
it can be this as well. it just doesn't apply to languages, especially programming ones
>>
>>57851502
oh you mean subjective in accordance to your desires? of course not. it would be stupid to assume such a thing.

you like wearing fedoras. i like finding new and interesting things to do.
>>
I want to die
>>
>>57851628
its okay, im going to fap and go to sleep. ill leave soon enough.
>>
>>57850699
Is code academy good enough? I fucking hate video tutorials because it's just copying code without knowing what the fuck it all means.
>>
which one is better: gcc/g++ or clang?
>>
>>57851660
llvm
>>
>>57851645
Codecademy is cancer. At best you'll learn syntax, at worst you'll learn syntax and forget it after a day.
>>
Can you still call yourself a programmer if Python is your main language?
>>
Guys as a twenty something year old virgin I had always thought I liked females - which I think I do like females. Last night though this guy was really qt. We were talking and I was talkingabout some stuff when he litearlly put his hand on my thigh. This type of openess was just nice I hate being touched too but this was like something about it that was genuine. I mean it might have been weird but this guy was kinda one of them very attractive gay university guys. He was talking about how his hometown should be seperated from the state probably in reference to politics and anti LGTBQ people being there.

Like I really fucking hope I'm not gay but jesus christ this weird. I'm trying to program but my mind is freaked out about it.
>>
>>57851696
Yeah I fucking hate it. It just spoonfeeds you can I get overwhelmed.
>>
>>57851713
invite him for some pair programming
(bring a skirt)
>>
>>57851696
literally first day programming python i did codeacademy and realized it was meme.

basically they had me do some string slicing stuff but other then that i left feeling hopeless.

he needs to read something about programming pragmatically aka actually learning syntax as he goes because syntax is just that useless syntax - what is important is the logic and problem solving skills.

im going to be the meme nigger and say it - if you're self teaching LEARN by doing projects because this is the best way to learn.
>>
>>57851660
I prefer clang. Faster compilation, better diagnostics, great code ecosystem, performance completely comparable to gcc, and a kick-ass logo.
>>
>>57851351
>>57851391
Btw, the picture you painted:

(((0 - 1) - 2) - 3)
and
(((0 - 3) - 2) - 1)

if we flip that last expression tree around (i.e. swap all arguments of the - operator) it becomes

(1 - (2 - (3 - 0)))
which is what ‘foldr’ amounts to in practice

In other words, what you thought of as a “left fold” was more like a right fold with the operator flipped:

λ foldl (-) 0 [1..3]
-6

λ foldr (flip (-)) 0 [1..3]
-6

λ foldr (-) 0 [1..3]
2

λ foldl (flip (-)) 0 [1..3]
2


This produces the same results in this case because (-x) commutes, but it wouldn't work for something like exponentiation (^)
>>
>>57851799
>performance completely comparable to gcc
good meme
>>
>>57851799
>better diagnostics
What do you mean by this? The only thing I was ever really aware of was the error messages, and GCC really stepped it up in that department some versions ago.

Personally, I use GCC for its hardening mainly, since I run a hardened system with SSP, ASLR, PIE etc. and clang is still lacking in that department
>>
>>57851745
He's not cs101. I think he is probably studying humanities. You know all these gay guys crush on me I didn't quite realize it for a long time (i do now) then females? zero interest and I thought I didn't have the awareness to perceive their advances (i did). So maybe I am gay and can only give out friendly vibes to guys so my flirting component just doesn't exist with females?

Also I've never giggled or laughed at a female but around guys just their presence or outlook can make me laugh hysterically.
>>
Why shouldn't I learn racket? And why shouldn't I use it for my projects?

Will it make me feel like a better human being?
>>
>>57851834
Here's a suit of benchmarks: http://www.phoronix.com/scan.php?page=article&item=gcc-61-clang39&num=1. They are very balanced. From personal experience clang's optimizations are very good.

>>57851839
I meant better error messages. GCC has improved but they are still behind clang.
>>
New thread:

>>57851952
>>57851952
>>57851952
>>
>>57851191
>why is c# so comfy
Fuckhuge standard library and really really good frameworks to use.

Fantastic language features like LINQ and auto-properties, with more good stuff coming in the next version (some pattern matching, inline functions, etc.)
>>
>>57851984
>Fantastic language features like LINQ and auto-properties, with more good stuff coming in the next version (some pattern matching, inline functions, etc.)
How long until they ditch the stupid type system in favor of something that actually permits higher-order abstraction?
>>
>>57852050
Maybe never. They need to add support to that shit at the CLR level for it to work properly. Who knows.
>>
>>57852050
>>57852096
It's such a shame that C# is developed by people with such great ideas but it all goes to waste because they had to follow the stupid OOP meme crowd

http://joeduffyblog.com/2016/11/30/15-years-of-concurrency/
Thread posts: 328
Thread images: 36


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