[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: 313
Thread images: 23

What are you working on, /g/?

Old thread: >>59755577
>>
>>59761113
Justify the existence of these packages, /dpt/.

https://www.npmjs.com/package/is-zero
https://www.npmjs.com/package/is-negative-zero
>>
>>59761154
>>>/g/wdg
>>
>>59761154
>negative zero
>positive zero

web devs everyone
>>
>>59761128
>It's not the literal code being used
Apparently you changed more than you thought because the anon you're replying to got your posted code to work with those fixes. Obviously there is something in your code that is not in the posted code, and that thing is causing the problem. I wish people wouldn't try so hard to reduce their test case when they don't even know anything about the problem.
>>
>>59761154
Sometimes you want to return error on positive zero, but not negative zero.
>>
>>59761154
Why the fuck do web devs keep appearing here?
>>
>>59761154
The wonders of a vibrant open source community.

>they'll write 30 LOC of test cases for 3 inefficient useless functions, but they won't even accept my simple pull request
>>
>>59761168
I hope you're just pretending to be retarded.
>>
why is web development such a cluster fuck? whose idea was this? serious question
>>
>start typing question
>while typing question i figure it out after struggling with it forever

anyone else do this all the time? i wonder if theres a name for this phenomenon
>>
>>59761193
the same reason IT/information systems is such a clusterfuck, it's marginally easier than the rest of the "field" so it attracts idiots
>>
>>59761224
Yeah it is called being retarded
>>
>>59761224
It's not the name of the phenomenon per se but this is known as "rubber duck debugging". What happens is that as you analyze the problem to explain it to someone else, you find something that you missed before.
>>
How is it possible for Rust to have a worse type system than C++, a language that is over 30 years old?

C++ templates can be used to do HKTs. Nothing in Rust can.
>>
>>59761305
HKTs are unsafe
>>
>>59761341
>HKTs are unsafe
No, they're not.
>>
What is the math, or in other words, which math topics in specific do I need to learn before diving into "Introduction to Algorithms, CLRS". I hate to admit it, but I got overwhelmed by the proofs. I understand the algorithms, and how they work. However, when it came to the mathematical proofs, I just simply choked. I am currently learning how to program, and I know I may not "need" the math for programming, but I still want to learn it. I truly believe that said math will only help me understand algorithms even better. So, if you would please lead me in the right path, the path of de-retardation.
>>
>>59761367
If you don't have trig, calc and stats down, don't even bother trying to read CLRS.
>>
>>59761367
What is your education level?
High school math?
College math?
>>
>>59761384
Currently finishing Calc 1 in college. I have already taken Trig(though, I need to dust off my knowledge on it).
>>
>>59761378
Alright, so I better leave it for later, and start reading other algorithm books. I am currently reading "Algorithms Unlocked" by MIT. I was planning on reading CLRS after finishing this one, but I guess I better get proficient with Calc, Trig, and Stats before I even think about touching that book.
>>
>>59761399
If your are in a STEM major the amount of maths modules you take should be enough for you. Anything more and that would be a more math focused major route (stats, maths)
>>
>>59761341
What does that have to do with anything?
Rust still allows unsafe code, and most would argues, /requires/ it for anything meaningful
>>
>>59761422
It's really not that important.
You can understand algos without the rigorous proofs.
Once you get past a certain level, it's all academic wank that gets further and further from applied computer science.
>>
>>59761305
It's worse in that way alone, better in every other conceivable way. I agree with your sentiment, though, it's an egregious omission.
>>
>>59761305
>>59761453
I'm gonna be honest here, Rust not having HKTs is the only reason that I'm making my own language right now. If it did, I could live without dependent types, but I might as well implement them since I'm making my own language anyway.
>>
>>59761443
Oh, for sure. I know math is "really" not that important for programming. It's just that I feel kind of, empty, if I don't "truly" understand a proof. I guess I gotta take baby steps, and learn them little by little, and not get discouraged whenever I don't understand something(I suffer from this a lot).
>>
>>59761494
What major are you doing in college?
Because unless you are doing something really steeped into maths, there is no need to understand a proof.
>>
>>59761113
Well, I've decided to start working a on a project. My aim is to make some kind of game using pdcurses and C. I have no clue wtf im doing, but I'm sure I'll figure this shit out one way or another. Maybe some kind of adventure game and then I'll work my way up to a roguelike or something else.

Any recommended readings?
>>
>>59761478
I want to do this, anon, but I don't have enough time on my hands.
I might during summer after finals.
>>
>>59761524
Computer Science.
>>
>>59761524
t. retarded code monkey.
Don't listen to this guy.
Math is proofs and math is important.
>>
>>59761571
I am not sure about your college but when I did mine, my uni did require me to do a bit of modules that required me to do proofs.
>>
anons,

I've started to take CS50 and enjoy the general problem solving elements of programming. My problem is I don't know what to do with any of my knowledge and I feel like CS50 moves slowly. I'd much rather just pick up a book and start learning. One tip I heard was to find a project and try to build it but I don't really know anything I'd like to do that isn't super mundane. I guess I'm interested in creating my own basic Android app, and I guess trying to learn Java in order to achieve that. Is this a good idea or should I start smaller? What are some big projects that inspire you all?
>>
>>59761583
>Math is proofs and math is important.
Yeah I am sure the engineers that built 99% of the shit that you are currently using know the proof behind the maths they are using when they design/build a product. Fuck off with your academic wank fest.

Application of maths is far more important than proof of maths.
>>
>>59761571
Dumb nigger. You're not studying cs if proofs are optional, if proofs are something that you just want to dabble around in in your own time.
If proofs isn't something that's being drilled into you in many courses then you're not studying cs.
Fucks like you give cs a bad name.
>>
>>59761604
Most big projects start off as small ideas that got more complex as time pass and more and more stuff are tacked on. My advice is not picking a project based on it complexity or difficulty but really doing a project that you are interested in and learning from that.
>>
Friendly reminder that there exists a 200 page proof explaining why 1+1=2.
>>
>>59761608
If all you're doing is applying what other people have made then you're not really programming, you're just gluing libraries together. If you ever write your own non-trivial algorithms, you should be able to prove that they work.
>>
is there a good book / reference for C# programming and learning .NET? I don't want to just learn C#, I want to learn how to develop on the .NET platform (build tools, configurations, project setup, etc...)
>>
>>59761608
No but maths is literally proofs.
If you're not doing proofs, you're not doing math, you're doing computation and you might as well have a machine doing it.
As for engineers, sure they get babby-tier, engineering math (most places) but we're in a programming thread and the anon you were originally replying to is studying cs, which is a heavily mathematical field.
In any way memorising the algorithms isn't enough.
If you can't rigorously prove their correctness and do complexity analysis then you're just a retarded code monkey that has absolutely no place in CS or any interesting field of tech.
>>
>>59761645
You don't need a math degree to write your own algorithms.
>>
>>59761645
Getting proofs drilled into your head =/= Learning how to prove they work
>>
>>59761638
That's helpful. I guess my issue is that I always want to see the grand scale side to my hobbies, which can be somewhat self-stultifying. It's like, "oh you can't come up with the next big thing then why begin?"
>>
>>59761652
Which is sad since CS degrees churn out the most code monkeys and most of the actual proofs for new algorithms are relegated to Masters and beyond.
>>
>>59761608
>Yeah I am sure the engineers that built 99% of the shit that you are currently using know the proof behind the maths they are using when they design/build a product. Fuck off with your academic wank fest.
They probably do btw if you're not using very, very crappily engineered products as most math engineers need is calculus, diff eqs and maybe a bit of lin alg.
Proper courses on these topics have you do proofs.
>>
>>59761696
enjoy rotting away in academia forever, just like ruby
>>
Reminder that CS is not math.
>>
>>59761608
>the people who derived and figured out all of the formulas that touch every aspect of engineering don't matter, only the engineers themselves matter
>>
>>59761701
Proofs are taught or at least explained in Engineering but they are almost never tested since the application of formula is more important than how these formulas are obtained. Oh and you are oversimplifying the amount of maths engineering needs, depending on field alone the maths would be different, a signal engineer requires a different set of equations from a power engineer.
>>
>>59761609
I don't understand why you are being so angry. Isn't the fact that I am trying to learn proofs on my own time instead of waiting for a professor to teach it to me a good thing? Like I literally can't see why you are getting so goddamn butt hurt about the subject.
>>
>>59761174

Do you really need a function for it?
Do you really need that function to be in its own package?

>>59761305

As nice as HKTs are for C++, I don't think I've ever used one or had a use for one. I don't think many Rust programmers will find themselves too restricted by a lack of HKTs.
>>
>>59761639
Thank god we now formalize mathematics in such a way that 1+1 just computes to 2 and nothing needs to be shown.

>>59761658
I didn't say you did.

>>59761677
Obviously you can rely on existing, valid theorems and whatnot. I meant proving your own algorithms correct, which I suppose is arguably an application of maths but not in the sense that most people would consider applied maths.
>>
Programming is NOT math.
>>
>>59761658
If they're non-trivial you ought to have some cs knowledge though. This includes proofs.
>>59761677
>Implying you can truly know how they work without knowing why they work (ie proofs).
>>
>>59761721
There are thousands of "ideas" and "concepts" in academia that rot away in papers because no one test them or apply them. Guess who are the folks that field test and apply these concepts.
>>
>>59761695
Then pick a project you are passionate about that can scale upwards. Doing the next big thing would make you get up in the morning to code, doing something you are interested in would make you get up in the morning to code.
>>
why is general software development not respected? we're called "code monkeys". forklift drivers are called forklift drivers. nurses are called nurses. mechanics are called mechanics. but mention that you are a software developer and you get shit on and called a code monkey. it's just another profession, no need to be so hostile. we're not computer scientists
>>
>>59761756
Because of the image software developers get. Particularly when majority of the population think Pajeet when you say you are a software developer.
>>
>>59761756
code monkeys refers to UNSKILLED programmers who scrape by only because they glue together other people's libraries and could never write a library on their own.

Most programmers fall under this category, sadly.
>>
>>59761769
>majority of the population think Pajeet when you say you are a software developer
>majority of the population
The world extends beyond just /g/, anon
>>
>>59761756
Because the people doing it ought to have a CS, CE, maths, physics or other such heavily mathematical background.
I have no respect for software dev degrees or the people who hold them.
>>
>>59761788
Most programmers can write their own library, they don't need to because there is an available one that is more competent than whatever they can write. I don't know why people think programmers need to write everything from scratch and if they don't they are not "real" programmers.
>>
is semantic web a meme field? or not?
>>
>>59761788
>>59761756
Because 'code monkies' are sitting at a comfy desk job copying/using their resources to make their job a cake walk while muhamed at MIT is working 24/7 on his theorem to prove some computational model. Guess who is jealous of the other to the point where they call them names?
>>
>>59761749
Thanks anon
>>
>>59761756
>wow you just sit in front of a computer all day typing, thats not real work!
>>
>>59761817
>muhamed at MIT
What? Muhamed isn't an indian or chinese name.
>>
>>59761814
There's another codemonkey thing, "NEVER ROLL YOUR OWN LIBRARIES!!!".

Modern programming ideology shits on people inventing a better wheel for any reason.
Except in webdev, where literally everyone does it to pad out their resume.
>>
>>59761788
obviously there is a spectrum. one on end is typical Pajeet or Jessica, web developers who only know frameworks and CRUD and can barely write a basic for loop. other end are your super "10x" software engineers that have dozens of side projects and can easily write their own libraries.
but I would say even Pajeet demands a base level of respect. even what he is doing requires at least a little bit of skill. certainly more respectable than flipping burgers or mopping floors.
>>
>>59761813
most software development does not require advanced math and deep knowledge of computer architecture.
>>
I don't understand this paragraph from "The Art of The Metaobject Protocol"
>In a language based upon our metaobject protocols, the language implementation itself is structured as an object-oriented program. This allows us to exploit the power of object oriented programming techniques to make the language implementation adjustable and flexible. In effect, the resulting implementation does not represent a single poin in the overall space of language design, but rather an entire region within the space.

Is it saying that the language need be object oriented. How does this lead to a "region"
>>
>>59761843
Why are you getting so defensive?
Did I insult your honor?
Go learn to shit in the toilet before you get all uppity with me again.
>>
>>59761855
Yes and?
The people doing it still ought to have it.
>>
>>59761113

If I take two points on a grid with integer coordinates, and then XOR their X and Y coordinates together, what properties will the 3rd point have?
>>
What the fuck is a higher kinded type and what are they useful for?
Btw I'm not an FP programmer and never used an FP Lang before.
>>
>>59761856
object oriented programming? OOP is POO. go back to india PAJEET. OOP is garbage!
>>>/r/eddit is that way friendo
>>
>>59761843
>even what he is doing requires at least a little bit of skill.
absolutely not
webdevs are the mobile games of traditional software development
>>
>>59761873
you will have combined both integers together.
you can actually swap numbers this way without a temp variable by doing
x = x ^ y;
y = x ^ y;
x = x ^ y;
>>
>>59761838
You are not going to invent a better wheel when the wheel has thousands of man hours put into it from people with higher education than you and thousands of dollars worth of R&D in it.

There is a difference between "re-inventing" an open source wheel that Joe put 5 hours into making and re-inventing a commercially made wheel that is supported by a company.

I hate idiots like you who think they can waltz into a project and go "lets rewrite X library" when X library license probably cost more annually to license than what they pay you annually.

Yeah I am sure you and your CS degree can invent a better wheel. As a project manager, I have seen plenty of your kind already. You just haven't got your reality check. Maybe when you actually graduate and find a job.
>>
>>59761756
At least when I say it, "code monkey" means someone on a project who isn't in charge of any design decisions and exists solely so that the designers don't have to waste time on trivial but time-consuming tasks like writing getters/setters or implementing algorithms in the language itself instead of pseudocode.
>>
File: wew lad4.png (328KB, 672x706px) Image search: [Google]
wew lad4.png
328KB, 672x706px
>>59761916
>appeal to ignorance
>appeal to popularity
>strawman
>strawman
>ad hominem
>>
>>59761838

>Just yuuze boost.
>Just yuuze eigen again and again.

>FOSS == reliable

You fly in aircraft for which the control software is part FOSS.

>If its in the standard library, it is automatically superior to everything.

>I like what <insert celebrity programmer> said about smart pointers, yet have no useful criticism of my own. We should therefore just yoooze it.

>Re-write the whole thing? B-but we spent a decade building it, and have no clear idea of what the requirements are.
ITS TIME TO FUCKING FIGURE THAT OUT, THEN.

>Unmaintainable PhD spaghetti meme code is better than any rewrite.

>FOSS saves time and money.
>>
>>59761916
>e probably cost more annually to license
Okay M$,Google,Apple, and Facebook, you can go now
>>
guarantee these gatekeeping transsexual weeaboo NEETs have never written anything non-trivial or ever had a real job in software development
>>
>>59761939
I can say the same for your arguments
>>
>>59761986
You're not worth responding to, dumb codemonkey.
>>
>code worked yesterday
>wake up today
>black screen, nothing happens
and I don't remember what I did last night. fuck.
>>
>>59761967
>IF YOU CAN'T WRITE A BETTER LIBRARY THAN A COMMERCIAL LIBRARY YOU ARE NOT A "REAL" PROGRAMMER REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>59761994
>No arguments because he is wrong
>Y-y-you b-baka
Post more anime reaction pictures to prove I am wrong you NEET
>>
!5..1
calm down lad
>>
>>59761946
LET ME FUCKING DUMP MY SHIT LIST HERE

>Our project uses Qt
>Our project uses wxWidgets
>We use the FBX library
>Bullet physics are accurate with smaller step sizes, NASA uses it after all!
>We use ODE, but can't figure out why our curve constraints don't work correctly, or why the whole damn thing is jittery like a pile of fucking jello
>RK4 is sufficiently accurate for orbital simulations

DONT FORGET:
>SCRUM meetings help managers and team members stay on top of project developments.
>Sure, lets just have a teleconference
>Oh, we could have just sent eachother emails instead of fucking around on webcams for two hours
>>
>>59761907

No shit

If you add two numbers you combine them as well
>>
>>59761884
A higher kinded type is a type constructor, like a generic.
If you think about it, a generic is like a function
Type -> Type
You give it a type parameter, it gives you back a type.
But you can have something that takes a generic as a parameter - a function
(Type -> Type) -> Type

e.g.

struct Test<f> {
f<Int> x;
f<Float> y;
}
>>
>>59762025
Just write your own library or are you a codemonkey?
>>
>>59762037
Trash.
>>
>>59761884
>>59762037
And you can also be polymorphic over higher kinded types, and have them in traits.

For example, you could say that there exist classes of containers that take a parameter for the element type, e.g. C<e>
You can then generalize over the C, by saying
"given some container type C that supports insertion and deletion, I can sort it given that e can be ordered"
>>
File: it's just a joke XDDD.jpg (244KB, 1440x1920px) Image search: [Google]
it's just a joke XDDD.jpg
244KB, 1440x1920px
How far can I get with graphics programming if I'm stuck on opengl 2.1 because my hardware is 10 years old?

Will my software run on future hardware for the next decade?
>>
>>59762053
No
>>
>>59762034
xor swap isn't affected by overflow
>>
>>59762042

I make that point everywhere I go.

>WE CANT POSSIBLY RE-WRITE SOMETHING THAT REDUCES TO ABOUT 2KSLOC WHEN ALL THE CRUFT IS REMOVED
>WHAT EVER WILL WE FUCKING DO?

Here, let's spend 4 months fixing stupid problems caused by upgrading at a shitty miserable pile of Qt spaghetti instead of spending a few weeks just making a new goddamn UI library that suits our needs.

Hey, at least its based on motherfucking Qt for which we are paying a license fee instead of, you know, stuff we could own and maintain easily.
>>
>>59761884
>>59762050
And when you sort it, you get back a container of the same type.

If you look at LINQ in C#, everything decays to IEnumerable.
What if you want to filter/Where a set, and get back a set?
>>
>>59761884
List<A> is a type. List itself is a higher kinded type (HKT). Think of it like values vs. functions, just at the type level. A language is said to support HKTs if you can require a generic parameter to be one. C++, for instance, supports HKTs with so-called "template templates". Of course, Haskell supports them as well. Unfortunately I can't think of any trivial but non-contrived example, so here's something contrived that uses HKTs:
template<template<class> class F>
struct Foo {
F<int> x;
F<float> y;
}

// allowed if we pretend std::vector actually only has one parameter, really it has two and the second has a default value
// hopefully you still get the idea
using FooVector = Foo<std::vector>;
/*
struct FooVector {
std::vector<int> x;
std::vector<float> y;
}
*/

// disallowed because int has no parameters
using FooInt = Foo<int>;


A less trivial but very useful example is with monads. A monad is a type family of one parameter (e.g. List) equipped with two operations. If you want to write a function that works for any monad (which is the only reason to treat anything as a monad), the language must support HKTs.
>>
>>59762071
So you are telling me that you can make a better UI library as a side project that is not what your company does better than a UI library is that support by a company?

Why haven't you made that library and made a million bucks licensing it yet?
>>
File: 903.jpg (7KB, 200x135px) Image search: [Google]
903.jpg
7KB, 200x135px
>>59761946
Who are you quoting?
>>
>>59761813
My school's Software Engineering program is about as hard as the CE/CS program and the entrance requirements are more strict.
>>
File: bm_ash_smug.jpg (61KB, 680x506px) Image search: [Google]
bm_ash_smug.jpg
61KB, 680x506px
>>59762100
>side project
No time, my dude

>Qt has decent support
FUCKING NOPE

>making money on library licensing
pic related

>>59762105
The rum, my dear. The rum.
>>
>>59762120
Sure.
You're a fucking useless disgusting code monkey.
Kill yourself anyday you mindless corporate cocksucker.
>>
>>59761916
Thank you for summing this up nicely.

Fucking hate faggots like >>59761838
>>
>>59762037
>>59762050
>>59762076
>>59762095
I'm failing to see how they can be useful.
Can you give an example where a HKT would be a better solution to how most people would do it?
>>
>>59762205
>I'm failing to see how they can be useful.
It gives them something to complain about.
>>
>>59762205
What languages are you familiar with?
Are you familiar with Rust?
Are you familiar with the concepts proposal for C++?
>>
>>59762205
HKTs aren't really an alternative to anything besides doing the exact same thing with a macro or simply writing the same code multiple times just with a type constructor changed.
>>
>>59762244
unless you have runtime generics
>>
>>59761171
It is literally the same, with the exception of char* token being set equal to getenv("HOME")
>>
>>59762063

u r stupid my man
>>
>>59762257
"Runtime generics" makes me think more of higher-rank polymorphism. With dynamic types you don't have type families at all and thus talking about HKTs doesn't make sense.
>>
>>59762300
Fix is a HKT
>>
>>59762184
Stay mad because I have that sweet 220k Cali job angry faggot.
>>
>>59762308
>Cali
So sorry
>>
>>59762300
With dynamic types you're giving up and saying you don't understand your code.
>>
>>59762306
Congratulations.

>>59762501
I agree.
>>
>>59762308
>220k Cali job
Thats like a 3-40k job in regular land with commieforinia's CoL.
>>
>>59762242
I'm experienced in C and C++, and am currently learning Rust.
I'm familiar with the concepts proposal for C++.
>>
>>59762308
How's that shared apartment treating you?
>>
guys I had this idea and I could use some advice.
I have a bunch of pixel structs with different layouts and I want them all to be implicitly convertible to each other. I got that done by making a template class which inherits from its template parameter, then doing the conversion in there. somewhat like this:
struct rgba_ffff { /* ... */ };
struct rgba_8888 { /* ... */ };
struct rgba_8880 { /* ... */ };
struct rgba_5650 { /* ... */ };
struct rgba_5551 { /* ... */ };


template<typename P>
struct pixel : public P
{
// conversion operators, alpha blending etc
};

using pxf = pixel<rgba_ffff>;
using px32 = pixel<rgba_8888>;
using px24 = pixel<rgba_8880>;
using px16 = pixel<rgba_5650>;
using px15 = pixel<rgba_5551>;


now I'd want some kind of type-erased pixel type to use as generic pointer/reference, like so:
px* p = new px32 { };
px24 q = *p;

any ideas how to get that done? I tried making an empty base class and having all rgba types inherit from that, but that didn't seem to work.
>>
>>59762186
>>59761916

There is a distinction to be made. Let's first address
> from people with higher education than you and thousands of dollars worth of R&D in it.

Big fat MAYBE on that one. For example, we have BS designed for games, like Bullet, making its way into scientific applications (robot training). Iterative projection IS NOT physically accurate, no matter how small that step size is made. There is plenty out there published on the subject of using garden-variety Newton-Raphson to more accurately solve constraints as a whole - and I don't mean "correct over the course of the simulation" nonsense in the Witkin paper - and given how long that pile of stinking refuse has festered alongside ODE without even a single attempt at an implementation is beyond appalling.

Just because a library sees wide adoption doesn't mean it is written correctly or coherently by any stretch of imagination.

Private libraries are even worse than FOSS. There's this POS geometry written by 3D systems that can't hold a candle to Eigen, and Eigen is a fucking mess. We were paying licensing fees for using something that would have taken maybe 2-3 months to write correctly.

Then there's the unspeakable horror that is OpenCASCADE. Box arithmetic for curve intersections - for which the algorithms converge linearly on average - and yet there is no validated model. They are using intervals, and not interval newton, intersections are not validated, but instead just fucking noise. The entire goddamn library is a massive joke.

>Oh, but it saves us the trouble of writing our own shape engine.
Yes, and in exchange you get to deal with the product of their insufferable ineptitude. They are not geometers, they are not mathematicians, they have written themselves into such a corner that, for purely architectural reasons, they can't consider use any state-of-the-art methods.
>>
>>59762653
...and continued

Lastly, but most assuredly not least, we have "free" shit like CGAL. You can easily find therein examples of every antipattern in the book - starting with the abomination that is a "Geometry Kernel". From a bunch of "highly qualified" experts, I would hope for something along the lines of "Group", "Group Action Over A Space" or "Manifold", but instead we have god-objects with an assortment of random, conceptually unrelated functionality tossed into them.
>>
File: back to gedit.png (437KB, 546x758px) Image search: [Google]
back to gedit.png
437KB, 546x758px
>>
>>59762685
Jokes on you, Stallman uses Emacs.
>>
>>59762703
Let me interject here. What you are reffering as Emacs is in fact GNU Emacs or how I recently started calling it, GNU+Emacs.
>>
speaking of freedom-man.
What has he been up to lately?
>>
>>59761367

Discrete math and combinatorics, the foundations of CS
>>
>put kali linux on live usb
>reaver 1.5
>been using reaver 1.2 on openwrt routers/debian
>realize pixie wpd is on there

so im working on a shell script to "war drive" in a way wps enabled routers, and run pixie attack to see if any of them are vulnerable.
>>
>>59763074
Dumb script-kiddie.
>>
>>59763110
>script kiddie

lol.

sorry im not using C, does that trigger you?
>>
>>59763116
>lol
I assume you're 14 years old, as well.
>>
>>59763023
>combinatorics
Thanks anon. Another topic for me to review.
>>
>>59761113

working on a wacom tablet lisp environment, the REPL will use pen strokes instead of keyboard entry and allow the artist/developer to combine procedural graphics with finer hand drawing

https://github.com/olewhalehunter/wa

added wacom functionality to cl-evdev to get that driver working, next up is making a markov word builder for building text system binds inside the environment with fluid strokes instead of a clunky virtual keyboard or OCR
>>
>>59763509
>evdev
Would it be less of a pain in the ass to use something like libinput?
>>
>>59763540
>Would
Wouldn't*
>>
>>59763540
>>59763509

not really no, there's literally no difference, api wise you can't get any simpler than raw event reads, and it makes testing a lot easier, also the input driver part is already done anyway
>>
>>59763509
sorry what? so instead of typing (print "Hello World"), they will write it with their tablet?
>>
File: Tim_Teitelbaum.png (14KB, 659x205px) Image search: [Google]
Tim_Teitelbaum.png
14KB, 659x205px
>>59763611

you're still thinking in the text dimension my boy!
>>
>>59763634
I fail to see how handwriting your program is a new paradigm.
>>
>>59763652

handwriting is still text, which you're correct, but this system won't be processing that except during the bootstrapping process
>>
>>59762095
Why can't we do
using FooVector = Foo<std::vector>;

I understand the second parameter in this case is the allocator for the vector, but it has a default value which should be assigned when it gets 'bound' to <int> or <float> right?
>>
File: cgm.png (14KB, 979x512px) Image search: [Google]
cgm.png
14KB, 979x512px
            userNew.yearOfBirth = Console.ReadLine();
Console.WriteLine("What year were you born? (4 digits)");
userNew.monthOfBirth = Console.ReadLine();
Console.WriteLine("Which month in " + userNew.yearOfBirth + "? (2 digits)");
userNew.dayOfBirth = Console.ReadLine();
Console.WriteLine("And on what day of the month? (2 digits)");

why isn't the var showing when i call it in the writeline?
how to fix?
>>
I gotta make a GUI application in Python, but I have no experience with Python's set of libraries.
Frankly, I've been spoiled with how great GUI development is with C#, and am wondering what is the least ass way to develop a GUI with Python.
While the absolute best is probably Python + HTML/JS, I would prefer working entirely in Python, because I have to learn it anyway because my job will require it when I graduate.

I've found TKinter and Kivy, probably leaning towards Kivy. What do you guys think?
>>
>>59763768
Maybe it's because C# has trouble taking method calls as arguments? Sorry, not really sure, I'm not a C# person.
>>
File: 1462625286160.jpg (86KB, 650x650px) Image search: [Google]
1462625286160.jpg
86KB, 650x650px
What assembler should I be using to learn x86 assembly?
>>
>>59763797
PyQt. PyQt even comes with it own designer that lets you drop elements into a GUI like C#.
>>
>>59763862
fasm.
>>
>>59763862

start with Turbo Assembler (TASM) on the DOSbox emulator to learn about the evolution of the architecture, IBM PCs, and retro programming

just search "tasm dosbox" and there should be sites with documentation on how to set it up
>>
File: 2400fps.jpg (148KB, 1024x768px) Image search: [Google]
2400fps.jpg
148KB, 1024x768px
I accidentally made a screensaver with SSE support.
>>
File: 1491216655610.png (111KB, 314x314px) Image search: [Google]
1491216655610.png
111KB, 314x314px
>>59763862
>no question mark above the anime girl even though she is clearly in a questioning pose
>>
whats the easiest way of implimenting generic download and parse functionality i can use in any activity on android?

right now ive got a subclass in an activity that extends asyncTask and writes directly to the UI elements, but id ideally like to be able to download JSON data from elsewhere and return it as an object
>>
File: listening.png (26KB, 285x413px) Image search: [Google]
listening.png
26KB, 285x413px
>>59763768
please? maybe i'm just stupid. but please tell me how i am stupid on this.
>>
>>59763768
>>59764019
I am not sure what language you are using but if I had to guess it because the year is int and you can't concatenate an int with a string ?
>>
>>59762000
use scm for EVERYTHING cunt
>>
>>59763862
Nasm
>>
>>59763862
masm
everyone else was obviously maymaying
>>
Would it be possible to load a 32bit protected mode kernel from a dos application, replacing the dos kernel in the process?

Overwriting the IVT and re setting up the CPU should be enough to remove any dos influence right? And from there you would load the kernel to it's expected location and boot like normal.

Also, what's the best dos emulator for Linux? And why shouldn't I just run something like freedos in qemu?
>>
>>59764130
And to add, what's the best C++ toolchain to use on dos that supports the latest standard?
>>
>>59764130
DOS is basically just one interrupt (0x21). clear that and it's gone.

>>59764140
djgpp
>>
>>59763969
add it to a field of the activity in onPostExecute
>>
>>59764145
What's the boot process of a dos system?
>>
>>59764150
i dont want to be relying on GUI elements being in the activity, id sooner have something where i can return an array or JSON object or something directly
>>
>>59763893
>GPL
Well, it's definitely popular, and it's Qt, so I guess it's worth trying.
>>
>>59764162
have a list json objects and add new ones from the asynctask
>>
>>59764156
idk the specifics but dos is basically one executable file (kernel.sys in the case of freedos) the bootloader finds and loads that into memory, then calls it.
>>
>>59764121
>maymaying
Thanks for letting me know that your post is worthless right away.
>>
>>59764196
Is the dos command line integrated into the kernel or is it a seperate application that it loads from somewhere?
>>
>>59764202
I may be maymaying as well, but my maymaying is general maymaying and not related to the previously referenced maymaying and thus does not impact the quality of my suggestion
>>
>>59764220
the shell is a separate program, normally called command.com but you can load a different shell (even bash, iirc) by specifiying "shell=program.exe" in config.sys
>>
>>59764039
C#
it's a string and it's assigned. just confused, since it works elsewhere
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace numnums
{
class Program
{
static void Main(string[] args)
{
UserOfNumNums userNew = new UserOfNumNums();
Console.WriteLine("Let's get your numbers!");
Console.WriteLine("What name do you go by most?");
userNew.commonName = Console.ReadLine();
Console.WriteLine("Nice to meet you, " + userNew.commonName + ". ");
Console.Write("Now please type your First Name: ");
userNew.firstName = Console.ReadLine();
Console.WriteLine("GREAT! And your Middle Name(s)? ");
userNew.middleName = Console.ReadLine();
Console.WriteLine("Finally, your Last Name? ");
userNew.lastName = Console.ReadLine();
Console.WriteLine(userNew.firstName + " " + userNew.middleName + " " + userNew.lastName);
userNew.yearOfBirth = Console.ReadLine();
Console.WriteLine("What year were you born? (4 digits)");
userNew.monthOfBirth = Console.ReadLine();
Console.WriteLine("Which month in " + userNew.yearOfBirth + "? (2 digits)");
userNew.dayOfBirth = Console.ReadLine();
Console.WriteLine("And on what day of the month? (2 digits)");
Console.ReadLine();
}
class UserOfNumNums
{
public string idNumber { get; set; }
public string commonName { get; set; }
public string firstName { get; set; }
public string middleName { get; set; }
public string lastName { get; set; }
public string dayOfBirth { get; set; }
public string monthOfBirth { get; set; }
public string yearOfBirth { get; set; }
public string dateOfBirth { get; set; }
public string lifePathNum { get; set; }
public string soulNum { get; set; }
public string personalityNum { get; set; }
public string powerNameNum { get; set; }
public string birthdayNum { get; set; }
public string attitudeNum { get; set; }
public string destinyNum { get; set; }
public string emailAddress { get; set; }
public string myNumbers { get; set; }
}}}
>>
>>59764185
but how? the async task doesnt return a value unless i can somehow set up a callback system in it.
>>
>>59764257
Sorry for all the questions, but how does a dos application return to whatever shell application that launched it after it exits?
>>
>>59764271
actually doesn't the get() method give u the result?
>>
>>59764290
does it? but wouldnt that freeze the UI process if i did something like that?
>>
>>59764264
Try printing the number of years alone and see if it works. If it doesn't that means when you are asking the user to make the input he is fucking it up.

Example would be the program expects
"19" which is a string instead 19 which is an int. I don't know C# so I have no idea how readline works. Does it autoconvert the input into the given type of the variable?
>>
>>59764303
if you're using it in an activity then just add to a global List of some JSON type man, it's really not that difficult. It's exactly like modifying a view in onPostExecute but you're just modifying something else.
>>
>>59764289
there are several ways to return, but all involve calling dos again (int 0x21 or int 0x20). not sure how that works exactly but I guess the parent program is stored in the PSP somewhere.
>>
>>59764326
im collecting a bunch of different JSON files and i dont want purpose specific code in the download method m8, i just want the easiest solution to be able to use it as if it were any other class
>>
>>59764360
wtf m8 then write a wrapper class around an AsyncTask with a List member or whatever you need.
>>
File: 25.png (6KB, 979x512px) Image search: [Google]
25.png
6KB, 979x512px
>>59764315
fairly sure it makes it a string as that's what is called for.
see pic:
>>
>>59764393
like, how? how do i write a wrapper to facilitate with another thread without callbacks?
>>
>>59764403
What happens when you just print userNew.yearOfBirth?
>>
>>59764289
by the way, if you need to buid a dos cross-compiler, check this out: https://github.com/andrewwutw/build-djgpp
also I don't mind the questions, I probably know a few more things about dos so ask ahead.
>>
>>59761113
Not totally /dpt/ but this is the most serious programming thread I guess:

I know my fair share of python, some C++ and pretty much of JavaScript.
I'm having some off time (~1-2 months) and wondering if I could learn something fun before getting some fun in Robotics.
What programming book would you recommend? I know very little C so would like to know about that, is K&R still okay? Does SICP really improve my understanding of computers? Or could I better spend the time learning something like Go which is like C but more accessible from python.

Any great lower-level books that you'd recommend?
>>
>>59764409
public class PooSON {
private List<JSON> pooList;
private class MyPooAsyncDownloader extends AsyncTask<Shit, Shit, Shit> {
@Override
onwhateverbackgroundthing(params...) {

}
@Override
onPostExecute(JSON result) {
pooList.add(result);
}
}

public JSON getJSON(int pos) { return pooList.get(pos); } // or just return a copy of pooList
}
>>
>>59764417
can't get it to print anything... very strange
>>
>>59764437
Thanks. I think that's all the questions I had.
>>
>>59764475
Well there you go, you narrowed down the list of possible suspects to

>The way the variable is declared
>The way the you capture the input

Check your syntax again. There is no reason you can capture and print other numbers but not this one.
>>
>>59764457
yeah, but ive still got to call getJSON from outside of it, thats the actual bit im stuck on, how to do that properly without freezing the UI thread
>>
>>59764495
that doesn't freeze the UI thread
>>
>>59764518
its an asynchranous network process, if i call that before its done it will return null, in which case i will have to try again after some time has elapsed, which if i understand correctly will make android think the UI thread has frozen.
>>
File: fixed.png (12KB, 979x512px) Image search: [Google]
fixed.png
12KB, 979x512px
>>59764475
>>59764417
>>59764403
>>59764315
>>59764264
>>59764039
>>59763768
>>59764493

it's always the dumb stuff.
i got it fixed, like a nube,
userNew.yearOfBirth = Console.ReadLine();
Console.WriteLine("What year were you born? (4 digits)");


should have been:
Console.WriteLine("What year were you born? 
userNew.yearOfBirth = Console.ReadLine();
>>
>>59764534
wrong order
>>
>>59764534
>>59764538
Glad you fixed it and I hope you learnt how to troubleshoot your own program in the future.
>>
File: 90.png (294KB, 448x311px) Image search: [Google]
90.png
294KB, 448x311px
>>59764553
i was beating my head against a wall for an hour before coming here.
sometimes a sounding board is a good way to figure things out.
i appreciate those who attempted to help though! :)
and yes, sometimes we all need someone to poke us in the eye for us to see where we fail.
>>
What can I do with Calculus in terms of programming? I'm done with Algebra (though I might study Linear Algebra again as a refresher) and I'm knowledgeable on Java, C# and C++.
>>
>>59764628
number crunching for CERN
>>
I'm making a piano/song maker as an exercise to learn javascript.

I'm surprised I couldn't find anything like what I am trying to make.
>>
>>59764646
Those Physicists at CERN can use Python to automate their number crunching.
>>
>>59764671
>Crunch large numbers
>Python
CERN is rich enough to buy everyone MatLab license
>>
>>59764685
Then they should fire their programmers if they can buy MATLAB licenses for every single employee at CERN (From the head physicist to the janitor).
>>
>>59764692
Pretty sure their programmers also double up as actual scientist. Or rather they are scientist first and programmers after.
>>
>>59761113
I've just finished reading the 2nd chapter of opengl superbible. that shit is confusing.
>>
yo guys , cant figure out what's interfering my JS script at the end (the var $bank_account, on it's own without the rest of the previous script it works fine
but when i add it to the rest of the original learning/testing script it doesn't wanna work). Seems weird since nothing else in the HTML is id= demo.
https://jsfiddle.net/3atuuz2w/

The previous script is from a video from codeacademy btw, still trying to fully understand it on how it works
>>
>>59764849
web dev is down the street senpai
>>
>>59764857
oh shit my bad m8, keep forgetting theres /wdg/ and /dpt/
>>
File: 1489268801010.jpg (38KB, 250x250px) Image search: [Google]
1489268801010.jpg
38KB, 250x250px
https://sourceware.org/ml/libc-alpha/2017-03/msg00461.html
>Someone finally picked up the C11 threads patches for glibc
It's about time. I hope it gets merged soon.
>>
>>59764932
>c supposed to be easy to implement
>takes 6 years for major compiler to implement just one fucking feature
Is the C standard committee the worst committee ever?
>>
sepples question. I have something like this:
struct a 
{
void f(int) { }
virtual void f(char*) { }
}

struct b : public a
{
virtual void f(char*) override { }
}

struct c : public b
{
virtual void f(char*) override { }
}

b* qwerty;
b->f(5); // ok

c* asdf;
asdf->f(5); // error

why won't it let me call f(int) from a pointer of type c?
>>
>>59764999
>major compiler
This is a C library issue, not a compiler issue. GCC was actually pretty quick at getting most of the C11 stuff in.
glibc is notoriously slow at getting shit in. It doesn't help that they were an optional feature, so it's not really a pressing issue.
Other C libraries (musl for example) have had C11 threads for quite a while.
>>
>>59765037
edit: I meant qwerty->f(5); obviously but you get the idea
>>
>>59765044

struct a 
{
virtual void f(char*) { }
};

struct b : public a
{
virtual void f(char*) override { }
};

struct c : public b
{
virtual void f(char*) override { }
};


int main(){
char ch = '5';

b* qwerty = new b();
qwerty->f(&ch); // ok

c* asdf = new c();
asdf->f(&ch); // error

return 0;
}


you never initialized b or c
>>
>>59765202
well duh, but that was not my question. I'm trying to call a::f(int) but it won't let me.
>>
>>59765229
oh, in that case you want to do this

struct a 
{
void f(int a) {}
virtual void f(char* ch) { }
};

struct b : public a
{
void f(int val) { a::f(val);}
virtual void f(char* ch) override { }
};

struct c : public b
{
void f(int val) { a::f(val);}
virtual void f(char* ch) override { }
};
>>
>>59765302
>void f(int a) {}
whoops, this should have been int val like the others since the struct is "a"
>>
>wake up
>suddenly want to write a telegram bot
>>
>wake up
>suddenly wish to never have woken up
>>
>wake up
>lost will to program even though I haven't had it work weeks
>>
first for python
>>
>wake up
>can't wake up
>>
how can i use
pthread_cond_signal
on 2 threads? as opposed to just 1 thread or all the threads with
pthread_cond_broadcast
>>
>>59765422
just call it twice
>>
Best book for learning C?
I've got C++ The Complete Reference at the moment. Is that good enough?
>>
>>59762568
#include <cstdio>

struct format_base
{
virtual ~format_base() {}

unsigned test = 1234;
};

struct format_rgba_ffff: public format_base
{
unsigned test2 = 4321;
};

int main(int, const char **)
{
format_base *base = new format_rgba_ffff{};
format_rgba_ffff *derived = dynamic_cast<format_rgba_ffff *>(base);

std::printf("%u, %u, %u", base->test, derived->test, derived->test2);
return 0;
}
>>
What to learn after Python ?
>>
(format t "~{~{~:[~;Fizz~]~:[~;Buzz~]~:[~*~;~d~]~}~%~}"
(loop as n from 1 to 100
as f = (zerop (mod n 3))
as b = (zerop (mod n 5))
collect (list f b (not (or f b)) n)))
>>
>>59765733
C
>>
int32_t bla(uint32_t a, uint32_t b) {
int32_t v2, result;
v2 = (uint16_t) a^ (a>>16);
if ( ((uint16_t)b^v2^(b>>16)) >= 16 ) {
return (int32_t) (unsigned __int16)b | ((a ^ (a >> 16) ^ (unsigned __int16)b) << 16);
} else {
return (int32_t)b;
}

}


What does this function do?
>>
>>59765037
>char overload

gee i wonder
>>
>>59766093
It makes cofee
>>
>>59762308
Enjoy your single room studio
>>
>>59766093
Simplified:

int32_t bla(uint32_t a, uint32_t b)
{
uint16_t ta = (a & 0xFFFF) ^ a>>16;
uint16_t tb = (b & 0xFFFF) ^ b>>16;

if (ta ^ tb >= 16)
return (b & 0xFFFF) | (ta ^ b)<<16;
else
return b;
}


That's what it does, xors all the high/low 16 bits of a/b. If it's larger than or equal to 16, bla, bla, bla.
>>
>>59766382
I think the more important question here is, what does that accomplish?
>>
>>59766476
Nothing meaningful as far as I can tell.
>>
>>59766382
Simplified:

int32_t bla(uint32_t a, uint32_t b)
{
uint16_t ta = (a & 0xFFFF) ^ a>>16;
uint16_t tb = (b & 0xFFFF) ^ b>>16;

return (ta ^ tb >= 16) ?
((b & 0xFFFF) | (ta ^ b)<<16) : b;
}
>>
File: 1439648511159.jpg (116KB, 469x469px) Image search: [Google]
1439648511159.jpg
116KB, 469x469px
>Send unsolicited pull request to some github repo and they accept it
>They even said thanks
It's a nice feeling.
>>
>>59766631
That's not much simpler, I just thought it would be easier to read if you removed all the casts and stuff. But if you want to play shit like that.

int32_t bla(uint32_t a, uint32_t b){uint16_t m=0xFFFF,x=a&m^a>>16,z=b&m^b>>16;return b^(x^z&0xF0)?(x^b)<<16:0;}
>>
>>59766631
no you dumbfuck
>>
>>59761478
Faggotry like this is the reason of imminent and ultimate deterioration of the culture of /g.

Fuck you sir and good day.
>>
>>59766771
Simplified ;^)

uint16_t m=0xFFFF,s=16,x=a&m^a>>s;return b^!!(x^b&m^b>>s>=s)*((x^b)<<s);
>>
Does anyone know how to deal with crippling depression?
Alternatively does anyone know of any easily digestible programming material like videos or audio I could listen to to feel like I'm going somewhere while I'm actually just waiting for death?
>>
>>59766827
HKTs are great

>>59761478
please use runtime generics and not templates
that way you can implement fix
>>
>>59766886
SSRI
S
R
I
>>
>>59766901
I've had them for ~9 months. Didn't do anything. Took 1.5x maximum allowed dosage before cutting it.
The only way I can infer they actually do something is the massive amounts of dizziness and cold sweats I had while increasing or decreasing dosage.
>>
holy shit my alpha blending thing actually works.
template<typename V, std::enable_if_t<!V::has_alpha, bool> = { }>
constexpr pixel& blend(const pixel<V>& src)
{
auto copy = src.cast<P>();
this->b = src.b;
this->g = src.g;
this->r = src.r;
return *this;
}

template<typename V, std::enable_if_t<!P::has_alpha && V::has_alpha, bool> = { }>
constexpr pixel& blend(const pixel<V>& src)
{
this->b = ((src.b * max<V>(P::bx) * src.a) / max<V>(V::bx) + this->b * (src.ax - src.a)) / max<V>(V::ax);
this->g = ((src.g * max<V>(P::gx) * src.a) / max<V>(V::gx) + this->g * (src.ax - src.a)) / max<V>(V::ax);
this->r = ((src.r * max<V>(P::rx) * src.a) / max<V>(V::rx) + this->r * (src.ax - src.a)) / max<V>(V::ax);
return *this;
}

template<typename V, std::enable_if_t<P::has_alpha && V::has_alpha, bool> = { }>
constexpr pixel& blend(const pixel<V>& src)
{
this->b = ((src.b * max<V>(P::bx) * src.a) / max<V>(V::bx) + this->b * (src.ax - src.a)) / max<V>(V::ax);
this->g = ((src.g * max<V>(P::gx) * src.a) / max<V>(V::gx) + this->g * (src.ax - src.a)) / max<V>(V::ax);
this->r = ((src.r * max<V>(P::rx) * src.a) / max<V>(V::rx) + this->r * (src.ax - src.a)) / max<V>(V::ax);
this->a = ((src.a * max<V>(P::ax) * src.a) / max<V>(V::ax) + this->a * (src.ax - src.a)) / max<V>(V::ax);
return *this;
}

this mess blends all types of rgba pixel structures together: 8888, 8880, 6668, 5551, 5650, and floating-point.
>>
>>59761113
thought this would be the best place to ask this, looking for help for 2 bat scripts one to reveal system folders the other to set back to hidden anyone help?
>>
>>59766987
>attrib -s -h /s /d c:\
>>
>>59766979
Holy fucking shit, pajeet, DRY.
>>
>>59766979
>not const auto
>not having an = operator on the pixel
>not having vector operations and pointwise operations
>repeating so much
are you even human
>>
>>59767009
wont that set all files and folders to shown?, i only want to change whats shown, not change the folder/files settings themselves

basicly skipping going into folder options and selected show system folders
>>
>>59767129
>>59767155
try improving that code.
don't forget this shit is completely generic, it works with any possible rgba bitfield and avoids floating-point math when possible.
>>
>>59767249
pixel_mul(pixel, val)
pixel_mul(pixel, pixel) // pointwise
pixel_div(pixel, val)
pixel_div(pixel, pixel) // pointwise
pixel_add(pixel, pixel)
pixel_sub(pixel, pixel)
pixel_assign(pixel, pixel)

// TODO
>>
>>59761243
I bet you feel real tough about that comment
>>
>>59761245
This. I do this with my cat sometimes.
>>
>>59765759
what's this garbage-level language ?
>>
>>59767388
C
>>
>>59767239
You can set those in the registry.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
- Hidden
- ShowSuperHidden


You can do that with reg in batch but you also need to force a refresh of explorer(e.g. sending it F5). I don't know if you can do that in batch. You could probably use powershell:

https://technet.microsoft.com/en-us/library/ff731008.aspx

Or C#, whatever.
>>
>>59765759
Hello, fellow FORMATter. Here is mine:
#.(loop for i from 1 to 100 do
(format t "~:[~:[~a~;Buzz~]~;Fizz~:[~;Buzz~]~]~%~@*" (zerop (mod i 3)) (zerop (mod i 5)) i))
>>
File: Untitled.png (2KB, 200x200px) Image search: [Google]
Untitled.png
2KB, 200x200px
Making a code counter for java, counting the number of characters for code, single line comment, multi line comment, and java doc comment using the state pattern. Ik im pajeet

    public void readFile(String file){
try{
InputStream x = new FileInputStream(file);
Reader javaFileReader = new InputStreamReader(x);

int c;
System.out.println("memes");
while ((c = javaFileReader.read()) != -1) {
char ch = (char) c;
switch(ch){
case '/':
getCurrentState().slash(this);
break;
case '*':
getCurrentState().star(this);
break;
case '\"':
getCurrentState().quotes(this);
break;
case '\\':
getCurrentState().backslash(this);
break;
case '\n':
getCurrentState().newLine(this);
break;
case '\r':
getCurrentState().newLine(this);
break;
default:
getCurrentState().character(this);
break;
}


}
System.out.println("Code Count: " + getCodeChar());
System.out.println("Single Line Comment Count: " + getsLCChar());
System.out.println("Multi Line Comment Count: " + getmLCChar());
System.out.println("Java Doc Comment Count: " + getjDocCChar());

javaFileReader.close();

}
.
>>
>>59766382
Pokemon PID reroll for shinyness.
>>
File: 1481883613210.jpg (32KB, 640x640px) Image search: [Google]
1481883613210.jpg
32KB, 640x640px
how do you add configuration without making a huge clusterfuck of dependencies?
>>
>>59767648
What about whitespace?
>>
>>59761113
Hi
Finnished my school project. I have time to lose, so trying to determinate what print function is the faster in C language.
I'm creating a function that time printf, puts, write etc... to see which is the fastest
i've learned cool things.
>>
>>59761113
Working on a new imageboard: 4kev.org
Pls don't spam
>>
>>59767956
Professor wants to count whitespace. However he does not want newlines counted. I have methods within my states to handle all of that. Each space is added to the counters based on the state I am in.
>>
>>59767648
Why do java folks take code idioms used by many programmers for a long time and give them fancy names like Le State Pattern?
>>
File: 1424933369558.jpg (57KB, 800x850px) Image search: [Google]
1424933369558.jpg
57KB, 800x850px
>>59768088
that's a pretty neat, nice clean site. Are you hosting it with a VPS or something?
>>
>>59768584
I'm in the middle of my undergrad and this is the project were making implementing the "code idiom". I'm not le hacker man big time basement dwelling NEET like you.
>>
>>59768721
>ah, i see you used the declare3variablesandthenusethem pattern
>>
>>59768754
>daddy tells me im a disappointment
>go on 4chan and make fun of beginner programmers

exciting
>>
>>59768754
I don't get it
>>
>>59768088
wow
french chan
>>
is there any way to access the page table from a ring3 program?
>>
while n != 1000:
n +=1
r = n**(1000-1) % 1000
if r == 1:
print(n, "is prime")

What is wrong with my program ?
>>
>>59768965
It's impure
>>
File: 979829774975768669.jpg (40KB, 579x509px) Image search: [Google]
979829774975768669.jpg
40KB, 579x509px
>have a problem in my program that can be easily solved with a 'lazy' workaround
>workaround works but it's not very optimized and my autism won't allow such a thing in my code
>proper way to solve the problem is overly complicated, but I don't wanna waste time coding it and make a mess of my code
>tfw sit in front on the IDE just doing nothing and going nowhere for hours
>>
>>59768905
/dev/mem?
>>
>>59766892
>HKTs are great
I know, right?
>>
>>59769174
what do you care?
your time is worthless
>>
me@shell-web:/problems/f49abea6827cafa20a035340d3812d09$ ls -la
total 64
drwxr-xr-x 2 root root 4096 Mar 31 08:00 .
drwxr-x--x 573 root root 36864 Apr 1 23:13 ..
-rw-r--r-- 1 hacksports just-no_9 2 Mar 31 08:00 auth
-r--r----- 1 hacksports just-no_9 33 Mar 31 08:00 flag
-rwxr-sr-x 1 hacksports just-no_9 7800 Mar 31 08:00 justno
-rw-r--r-- 1 hacksports just-no_9 838 Mar 31 08:00 justno.c
a71@shell-web:/problems/f49abea6827cafa20a035340d3812d09$ cat justno.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>

int main(int argc, char **argv){
FILE* authf = fopen("../../problems/f49abea6827cafa20a035340d3812d09/auth","r"); //access auth file in ../../../problems/f49abea6827cafa20a035340d3812d09
if(authf == NULL){
printf("could not find auth file in ../../problems/f49abea6827cafa20a035340d3812d09/\n");
return 0;
}
char auth[8];
fgets(auth,8,authf);
fclose(authf);
if(strcmp(auth,"no")!=0){
FILE* flagf;
flagf = fopen("/problems/f49abea6827cafa20a035340d3812d09/flag","r");
char flag[64];
fgets(flag,64,flagf);
printf("Oh. Well the auth file doesn't say no anymore so... Here's the flag: %s",flag);
fclose(flagf);
}else{
printf("auth file says no. So no. Just... no.\n");
}
return 0;
}


how can i spoof the auth file for this? i tried creating a text file called "../../problems/f49abea6827cafa20a035340d3812d09/auth" but i can't because permission denied
>>
>>59769579
let's team up
>>
r8 my scheme dialect. It's called meme.
It uses [] brackets so that you don't have to press shift.
Strings are wrapped in `` for the same reason.
There's not much else, two syntactic forms, three keywords

[
; Modulo function: `[mod 25 3]` returns `25 % 3 = 1`
[def! mod [x y]
[return [- x [* y [/ x y]]]]
]

; Fizzbuzz loop
[def x 1]
[while [< x 100]
[
[def out empty]
[ if [= 0 [mod x 3]]
[def out fizz]
[]
]
[ if [= 0 [mod x 5]]
[def out [+ out buzz]]
[]
]
[ if [= out empty]
[print x]
[print out]
]
[def x [+ x 1]]
]
]
]
>>
>>59769666
i like your reasons for using brackets and backticks but it looks ugly desu
>>
>>59769603
you doing picoctf too? what's teaming up even do, just combine your points?
>>
File: kotlin_250x250.png (5KB, 250x250px) Image search: [Google]
kotlin_250x250.png
5KB, 250x250px
What's the verdict on Kotlin?
>>
>>59768674
I'm not sure what a VPS is.. but yea it's on a hosting site
>>
>>59769695
yeah, stuck on binexp for level 3.
>>
>>59765733
Haskell
>>
>>59769666
>while
>scheme
kys, satan
>>
>>59769666
>Strings are wrapped in ``
well that's hard to type in my keyboard but lisps have them anyway so 8.5/10. but then what will you use for macros?
>>
>>59765733
Common Lisp
>>
>>59769666
Fuck you.
I do not use US keyboard. I have to press shift anyways.
>>
>>59761113
not programming, but i'm trying to decide which cluster manager to use: spark or mesos.
>>
>>59769579
Do you have write access to at least somewhere(e.g. /tmp), just change your working directory so that ../../problems/blah/auth points to your file.

mkdir -p /tmp/attempt/problems/f49abea6827cafa20a035340d3812d09
echo yes > /tmp/attempt/problems/f49abea6827cafa20a035340d3812d09/auth
cd /tmp/attempt/problems/f49abea6827cafa20a035340d3812d09
/problems/f49abea6827cafa20a035340d3812d09/justno
>>
>>59769928
setxkbmap us
>>
>>59763761
You would think, but no, it doesn't work like that unfortunately.

>>59766892
The language uses template-style generics but still supports polymorphic recursion in the same way that it supports higher rank polymorphism.
>>
>>59769726
ahh i just passed level 1 with the grandmaster challenge a minute ago. not sure i'd be much help. i'm not sure how the final challenge for level 1 worked, i know i ran javascript code through my browser url, but why wouldn't that just have run on my machine? how'd i actually get their server to run it?
>>
>>59769986
In fact, while having a Spanish keyboard I use Latin American layout ("latam" in X) because it's better for programming.
>>
>QA finds different undesired outcome with different steps to reproduce
>they fail an unrelated bug ticket on the same page, causing a mess and demoralizing my team for no reason
>they find a new side effect of a bug we already had with the exact same steps to reproduce in the exact same input element
>posts an entirely new bug, again, making a mess
kill all non developers
>>
>>59770037
challenge server is unavailable here, can you screencap the challenge?
>>
>>59769979
ahhhhhh so the c program works based on the user's current working directory, not the location of the file?
>>
>>59770004
You can't do fix then
>>
new thread when
>>
NEW THREAD!!

>>59770318
>>59770318
>>
>>59770276
Yes, all processes do that.

Why do you think there is a current working directory? If it used the directory of the executable, imagine trying to use ls where it always lists the contents of /bin.
>>
>>59770385
replied to you in the new thread
Thread posts: 313
Thread images: 23


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