[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 22
File: 1422385664777_1.jpg (342 KB, 2500x1000) Image search: [Google]
1422385664777_1.jpg
342 KB, 2500x1000
Old /dpt/ at >>51244389

What are you working on?
>>
>>51246807
>portable code
newfags believe this is important
>>
2nd for racket
>>
3rd for Go
>>
>>51246807
>What are you working on?
A blender plugin for materials. Specifically, sharing them.
>>
>>51246830
in fairness, so do old fags. And good programmers in general.
>>
>>51246838
How does it tell if the materials blend?
>>
>>51246835
Every parentheses pair is like a little hug :3 Racket loves me, and I love Racket. Purely platonic, you understand.
>>
>>51244950
is this an autism test?
if so, I passed it
what is the solution?
>>
>>51246842
>cross-compiler code
>cross-platform program
newfags believe these are the same
>>
>>51246830
'portability' is probably the biggest complexity and bloat catalyst in most large software, like trying to support dx9-dx12, gl 3-4.0+ es2/3 can destroy your code base with thousands upon thousands of scaffolding shit.
>>
>>51246847
Will it blend? That's the question.
>>
>>51246830
B-B-B-But anon if my code doesn't run on x86, x64, x86-64 (with optimized paths for SSE2, SSE3, SSE4.1, SSE4.2, AVX, and AVX512) Itanium, NEON, ARM, MIPS, and MIX then how will my customers use my software?
>>
>>51246865
>isn't a formula or a hardcoded key to decrypt basically the same for safety purposes?
Yes. But there are actual benefits to compressing your data rather than munging it, for instance, disk space.
>>
>>51246881
multiverse solution:
if their platform isn't compatible, they should kill themselves
>>
>>51246866
Vulkan will save us.
>>
>>51246904
>implying Vulcan isn't just a vaporware meme that'll never reach market
So do they have the specs yet?
>>
>>51246904
it will suck. just like his grandpa opengl it will remain behind of glorious directx
>>
File: 153189.jpg (38 KB, 460x450) Image search: [Google]
153189.jpg
38 KB, 460x450
Currently reading "C Programming Language 2nd Edition"

Hey guys
>>
File: 3rd.jpg (21 KB, 300x387) Image search: [Google]
3rd.jpg
21 KB, 300x387
>>51246928
Tell us when you get to the third edition
>>
>>51246966
Friendly reminder that the best and most maintainable C++ code looks just like C.
>>
What's the best free bulk geocoder?
>>
>>51246971
Friendly reminder that the best and most maintainable C code looks like this

int main() { return 0; }
>>
>>51246988
>not even ANSI-compliant
Maintainable my ass.
>>
>>51246966
That picture is perfect for the experience of learning and using C++. Dangerous and unpredictable.

I hate Rust due to the CoC but even Rust+CoC is better than C++. Sad when a bunch of social justice warriors can make a hippie language that's better than Bjarne's shit.
>>
Friendly reminder that the best and most maintainable code is in Java
>>
>>51247010
>impure languages
>maintainable

How can you maintain it when you don't even know if passing the same parameters to a function is always going to return the same thing?
>>
>>51247022
What are you talking about? It does as much as any pure language.

>FP users don't realise objects with member methods are closures
>>
>>51246855
it has got to be a troll

"checkmate in two turns" was added by some fag with mspaint
>>
File: 1733-081115.png (621 KB, 4000x2560) Image search: [Google]
1733-081115.png
621 KB, 4000x2560
Reversing this program, and trying to create a keygen for it. So many crypto routines.. And I've done 2.
>>
>>51247022
the method just has to fulfill its contract. different returned values at different times can be desirable.
>>
How do I get only the code (c, linux kernel) that will actually get compiled (i.e. with open #defines, omitted #if branches that are false etc)?
I know about -E switch but have no idea how to make it work with a big project like the kernel (made what I suppose is a retarded attempt with "make CFLAGS=-E" which didn't seem to do anything.)
Basically I want to see what goes into allnoconfig linux without having to wade through a shitton of irrelevant code. Any tips?
>>
>>51247087
>implying there is anyone in FP who doesn't know that objects are just a poor man's closure
>>
>>51247022
>>51247087
C++:
some_class::method(object_pointer, arguments ... );

>>51247133
MSVC++ has an option to output the preprocessed source to a file (but this doesn't generate an obj or an o or whatever)
>>
>>51247121
>IDA Pro
holy fuck man, how did you afford that?
>>
>>51247140
>objects
>closures
you fucking what
>>
>>51246966
is there third edition available or you are messing with me senpai ?
>>
>>51247159
>>51247140
>>51247123
>>51247087
>>51247022
>>51247010
Friendly reminder the most harmful thing in software today is complexity, and functional programming helps mitigate it.

http://shaffner.us/cs/papers/tarpit.pdf
>>
>>51247159
A closure is a method with a bound argument.
Object.classmethod(args) is basically classmethod(object, args). The . is basically binding the object to the function.

This is also how they're implemented in C++
class::method(object_pointer, arguments)
>>
>>51247189
>(pure) functional programming helps anything
>>
>>51247108
yep, I don't think there is a way to do checkmate in 2 steps. that's why I said "autism test". usually the idea of said tests is to make you waste time ttrying to solve an unsolvable problem
>>
>>51247022
>>51247140
>>51247189

>tfw an fp user realises you can do more efficient pure fp in an imperative language with generics
>>
>>51247189
>Friendly reminder the most harmful thing in software today is complexity, and functional programming helps mitigate it.
Why mitigate it when you can eliminate it?
Forth is the most simple language to implement and use.
>>
>>51247286
Forth and lisp will simply never be beat and all non-trivial programs will eventually internally implement at least one these languages (poorly), if not both (really poorly).
>>
File: amateur.png (11 KB, 664x364) Image search: [Google]
amateur.png
11 KB, 664x364
In the last thread I mentioned that I was trying to automate a login/management process and I wasn't getting a response from the server. Based anon commented that my json may be malfromed or the content-header may be missing.

It was simpler than that. I was missing a single line from my code.

It was amateur, fizzbuzz level amateur.

I'm supposed to be a Software Engineer. I'm supposed to have a masters degree. On Friday I had a major say in a go-or-no-go feature branch integration that may move the regression to mid-christmas and It took me an hour to fix this.

Hold me /g/ ;_; also see if you can spot it.
>>
>>51247154
I'm sure you can guess that... including the hexrays decompiler.

Not the latest version, but I'm still in v6.
>>
>>51247354
>software engineer
>java
>major say in software
>java
>masters
>java

Why is this allowed?
>>
>>51247399
6.6 or is anything newer available now?
>>
>>51247006
Jesus fucking Christ. I always thought the Rust CoC was a troll
>Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
Except that's incorrect you filthy fucking hippies.
REEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>51247354
use the println, luke

you have to close the rd? I dunno.
>>
>>51247414
Java is everywhere now. Face it, NEET.
>>
>>51247430
>you are now forced to accept shitty code because it might hurt someone's feelings to say it is shitty and fix it
yep, rust is most assuredly trash, unless the developers themselves throw out their code of conduct
>>
>>51247414
>implying java is not a pl
java is the most used pl over other pl.
>i dont like is so its not a pl
lel
>>
>>51247430
Rust code written by those who don't follow the code of conduct is ill-formed. Standard-conforming compilers are to stop and raise an error upon attempting to compile this code.
>>
>>51247354
realizing the time spent studying for class would have been more useful doing actual development and debugging
>>
>>51247354
No new lines to pass through JSON parser? I've no idea.
>>
File: gIgasTO.png (4 KB, 499x92) Image search: [Google]
gIgasTO.png
4 KB, 499x92
Extremely sorry for posting this here, but I didn't see a Beginner's Programming Thread, so here goes.

I'm trying to concatenate two strings of numbers and afterwards convert them to double in C++; here's the code
string a="123.4";
string b="56666";
string c;
double d;
c=a+b;
d=atof(c.c_str());
cout<<d;

Thing is, I get a rounded decimal (pic related) as an output. What am I doing wrong?
>>
>>51247414

Because Java powers some huge systems and is the heavyweight in the enterprise software world.

Some of the greatest programming minds I've ever met worked in enterprise Java - you have to be a genius to understand the 150+ level call stack and deal with years of technical debt.

>>51247436

Correct
>>
>>51247477
http://stackoverflow.com/questions/554063/how-do-i-print-a-double-value-with-full-precision-using-cout
>>
>>51247468
>writing a comment that this section is bad and should be optimized later stops compilation and deletes all files for violating the CoC
>>
>>51247477
Well, you're storing it as a double which is /double precision/, use a float instead.
>>
>>51247501
Thanks, didn't know it was a cout issue, I'll stick to printf from now on.
>>
Any1 got experience with XAMARIN C#? Is it worth getting into oit r should i just learn Java for android dev.?
>>
>>51247494
>Correct
after many years I still remember this shit
kill me please

>>51247477
floating point numbers are, let's say, special. I guess that's your problem. could be cout cutting the output, though
>>
>>51246897
>Windows manchildren
>>
>>51247518
std::cout.setprecision(...); or
std::cout << std::setprecision (...) << ...
>>
>>51247507
float is less precise than double
>>
>>51247468
pls let this not me true

I wanna name my variables anything I want. If I want to name my variable amount_of_niggers_hung. I should be able to
>>
>>51247556
>not getting the joke
>admitting windows is the most supported os
>>
>>51247558
And how do you reset the precision of cout to what it was before you shifted the output by setprecision bits?

printf is simply superior in every respect.
>>
>>51247577
>>admitting windows is the most supported os
Why should I feel bad about admitting that. It is unfortunately.
>>
>>51247551
>floating point numbers are, let's say, special.
well they aren't magic, 123.456666 certainly shouldn't become 123.457 not even with single precision
>>
>>51247578
auto x = std::cout.precision();
std::cout << x << ...
>>
>>51247429
Don't know, nor does it matter too much. I disliked the v5 interface, v6 is great, and things dock well. The engine itself probably won't be overhauled too drastically in between incremental updates, so no real need to get the new IDA until v7 comes about.
>>
>>51247578
not the anon you replied to, but...
did you even read the link in >>51247501 ?

>printf is simply superior in every respect.
cout is simpler. if you are just learning, don't complicate yourself.
>>
>>51247609
>unfortunately
>so vested and in denial you feel the need to blame random chance
>>
>>51247631
What are you even getting at?
>>
>>51247640
There are reasons windows is the most popular and supported operating system
>>
>>51247624
I'm the anon who asked the question at >>51247477 but not >>51247578, let's not get confused here.
>>
>>51247657
baka senpia
>>
>>51247657
Yeah, as with most things, it was first.
>Most popular and supported.
They beget each other.
>>
>>51247664
>people will unironically think this justifies tripcodes
>>
>>51247664
The only people who are confused are those who recommend cout instead of printf.
>>
>>51247121
Where do you start with reverse engineering?
>>
>>51247734
Start with learning assembly.
>>
>>51247734
Engineering, I'd assume
>>
Still trying to stream Webm to my client from a c server.

Is it because I want to do webm with sound that it refuses to cooperate with me? Maybe I should use fread instead?
>>
>>51247734
Not him. But I recommend checking out this free ebook: http://beginners.re/
>>
>>51247734
http://www.reddit.com/r/netsec/wiki/start
http://opensecuritytraining.info/Training.html
>>
How safe is a 'readLine' function when reading data from the client socket? What if some genius decides to send over 1gb followed by a newline?
>>
>>51245864
They really don't know that the organization of computer memory is based on the mathematical concept of array instead of the other way around.

No wonder we get so much "diploma guy" code.
>>
>>51247880
You'd need to make a new kind of readline which allowed bounds.
>>
Why do people always say the preprocessor in C sucks?
>>
>>51248043
the preprocessor in C sucks
>>
>>51247568
Actually that would mean the compiler can't compile itself, (Rust is self-hosted right?) because in order to detect politically incorrect vocabulary you have to include it.

And just in case you non-white autistic queer women were thinking of a really clever workaround to encode the words in such a way that the thought police mechanism doesn't detect it, remember that some straight white male might use it too, so you have to outsmart this technique with an even kluger technique, and so on. Now your only hope is to use feminist logic to refute my demonstration by negating the excluded middle axiom...
>>
File: couleur.jpg (683 KB, 1840x1088) Image search: [Google]
couleur.jpg
683 KB, 1840x1088
>>51248115
forgot pic
>>
>>51248043
If you get more and more involved in C, you'll realize preprocessor statements suck.

The two problems I know are what happens if you #include a file twice and what happens if you fuck up adefine statement

If you include a file that doesn't have guards twice, it'll include the file twice without telling you and it could be difficult to find out how what exactly went wrong

If you define a variable twice. It'll just overwrite shit and again will not tell you what the fuck went wrong
>>
>>51248043
http://stackoverflow.com/questions/652788/what-is-the-worst-real-world-macros-pre-processor-abuse-youve-ever-come-across
>>
>>51247921
The real problem is that people want to use toy examples to "prove" things. Higher level languages have more general constructs. People, say, shit on linked lists, because in their mind a linked list is just a sequence of simple values and pointers. But this is the most trivial linked list. A tree is a kind of linked list where the values aren't simple, but are lists themselves. And who would argue that trees are shitty? What's the real alternative for a tree?

And what about when the values are simple but different? For instance a list consisting of an enumeration, a string, and an arbitrary tail of integers. What if you have a sequence of unknown length of enumerations before the string? (Consider "the interpreter pattern" for a laugh.)

In (say) lisp the same representation is used for all these things. This can lead to optimization problems. But the cases where optimization is a problem are exactly the cases that aren't any easier in other languages with less-generic constructs. To make the lower-level code act the same you're going to end up doing the exact same thing the lisp runtime does, only probably less efficiently, hence greenspun's tenth.
>>
File: d62b.png (103 KB, 1029x946) Image search: [Google]
d62b.png
103 KB, 1029x946
Why and when should i pick java over c++?
>>
>>51248181
>The two problems I know are what happens if you #include a file twice

Always use header guards, anon
>>
>>51248184
>He had two other quirks: A convex mirror mounted above his monitor "For knowing who is watching", and an occasional sudden exit from his chair to do a quick ten pushups. He explained this last one as "Compiler found error in code. This is punishment".
>>
Never. If you want ebin abstraction, look somewhere else.
>>
>>51248213
Read ahead and I mentioned header guards you fucking faggot
>>
>>51248252
fuck the fuck off you lousy cunt
>>
>>51248213
inb4 pragmas and ``real compilers''
>>
>>51248252
You can't list it as a problem if it has a solution. That's like saying free() sucks because you can double-free memory
>>
>>51248256
Don't make me suck your fucking dick you homo
>>
>>51248265
It is a problem you cunt. Just try to do the same thing with any non c/c++ language. It just werks
>>
>>51248043
It's too limited.
It would be great if you could hook into the token reader process and manipulate it fully like a reader-macro, evaluate arithmetic, evaluate the type of expressions, do pattern matching.
>>
>>51248187
>A tree is a kind of linked list where the values aren't simple, but are lists themselves. And who would argue that trees are shitty? What's the real alternative for a tree?
Lisp has pairs of pointers and/or constants, not lists or trees.
>To make the lower-level code act the same you're going to end up doing the exact same thing the lisp runtime does, only probably less efficiently, hence greenspun's tenth.
This is a typical Lisp response i.e. pointer/constant pairs are "higher level" while abstract (implementation-independent) "heaps, queues, stacks, and hashmaps" are "lower level code" and "probably less efficiently."
>>
File: 1440014133330.gif (4 MB, 431x236) Image search: [Google]
1440014133330.gif
4 MB, 431x236
>>51248184
The first few were funny. Then I got all the way down the page.
>I maintain code that has gotos in macros.
>>
is casting between signed and unsigned integers in C++ safe as long as the value of the integer is > 0?
>>
>>51248572
you are doing something wrong
>>
>>51248605
not really
just some dumbfuck over in C++ land that decided it would make perfect sense for an stl size() function to return a signed integer instead of an unsigned and now im getting annoying compiler warnings
>>
>>51248572
yes, it is safe.
>>
>>51248652
You mean Qt?
>>
>>51248572
The rules are basically this:
- Integer types have 'ranks' (char < short < int < long < long long), a lower ranked one is generally always converted to the higher ranking one (but not strictly always)
- Integer conversions try to be value conserving, if a signed integer type can contain all unsigned integer values (result type is a signed integer with higher rank, think unsigned short (16 bit) cast to signed long (64 bit) for example) the value is copied as-is.
- When the result type is unsigned it uses modular arithmetic (mod 2^n-1)
- If you have an unsigned value which cannot be represented in the signed type the behavior is implementation defined (depends on signed integer representation)

BUT for all practical purposes:
- Everything you will ever come across is two's complement, signed <-> unsigned are bit identical representations, casting from one to the other are no-ops.
>>
Enterprise Java Development


Second Servlet Assignment

Write an HTML page with a form for the user to select a favorite food. Develop a servlet to save the client’s response in a database, and output the number of clients who prefer each food.

Output of the number of clients who prefer each food
>>
>>51248815
>Java Servlets
>2015
Dude, your school is shit. Sorry.
>>
>>51248231
The convex mirror sounds pretty nice, actually.
>>
>>51248840
Why does that make it shit? I don't understand
>>
>>51246928
>>51246966
>>51247168

You're reading "The C Programming Language," of which there are only 2 editions. You're fine.

There are 4 editions of "The C++ Programming Language". Anon who told you that you're an edition behind is both incorrect and also an edition behind.
>>
Ok, apparently the gratis version of GNAT doesn't allow you to use it for proprietary software.

Where can I get an up to date gratis Ada compiler that doesn't have RMS's cock up its ass?
>>
File: repl crash.webm (939 KB, 1600x786) Image search: [Google]
repl crash.webm
939 KB, 1600x786
Anyone here using Atom?
I tried setting up a project and running some Haskell code posted on the other thread, but while it runs on WinGHC it just closes the REPL window in Atom.

A shame, because it would be really cool to get it working.
>>
I don't know how to program and I want to learn. Anyone have any advice or websites that can teach me?

I want to start off with C++.
>>
agdg > dpt
at least we do real progress.
;^)
>>
>>51249012
>libgdx for anything
what, agdg laughed at you so you came here to post?
>>
>>51249012
Not using Unity or Game maker studio
>>
>>51249034
what's wrong with libgdx?
It's one of the libraries agdg use next to unity and GM.
>>
Made a prime generator.

let primes = 
Seq.unfold (fun (n, f) -> Some((n, f), (n + 1I, f * n))) (2I, 1I)
|> Seq.choose (fun (n, f) -> if (f + 1I) % n = 0I then Some n else None)
>>
>>51248923
the joke wouldn't work if i'd picked the fourth edition

>>51248986
get visual studio 2015 community
http://www.cplusplus.com/doc/tutorial/
http://www.tutorialspoint.com/cplusplus/
>>
>>51248815
Can someone help?
>>
>>51249109
Thanks
>>
>>51248936
>Ok, apparently the gratis version of GNAT doesn't allow you to use it for proprietary software.
gnat is part of gcc and covered under the same gcc runtime library exception: https://www.gnu.org/licenses/gcc-exception.html
>>
>>51249122
you could just google it
>>
>>51249158
Too lazy for that
>>
>>51249012
>#include "unity.h"
>run_unity_fps_game();
>look, I'm a programmer!
>>
>>51249012
are you the guy that posted a bunch of if(/*long list of checks*/) yesterday?

>Captura de pantalla 2015-11-08 14.32.12.png
as usual, the worst shitposters (as in retarded) are spanish speakers...
>>
>>51248861
Majority of companies don't use Java Servlets anymore. It's a waste of time to learn about them. It's technology from the mid-2000's.
>>
File: Untitled.png (318 KB, 1920x1080) Image search: [Google]
Untitled.png
318 KB, 1920x1080
Why is clipping polygons so fucking weird

I add one fucking world to viewport transformation and suddenly everything is retarded

I hate computers I'm gonna drop out and become a business major jesus christ
>>
File: nob.jpg (11 KB, 202x249) Image search: [Google]
nob.jpg
11 KB, 202x249
>Tfw no programming bf to program things together with

I am a trap btw
>>
>>51249234
>long list of if checks
what?

>shitposters
I dunno, at least I'm not argentinian.
they're the worst.
>>
>>51249152
That's not true.
It says clear as day on adacore website that anything compiled by GNAT must be released as GPL.
>>
>>51248519
>Lisp has pairs of pointers and/or constants, not lists or trees.
You're confusing the semantic level with the implementation level.

>pointer/constant pairs are "higher level" while abstract (implementation-independent) "heaps, queues, stacks, and hashmaps" are "lower level code" and "probably less efficiently."
That is nowhere near what I said.
>>
>>51249245
No you're not, a trap is a man who looks like a woman thereby tricking someone else. You're not a trap in the same sense than a mouse trap without cheese is not a mouse trap.
>>
>>51249245
you can come to my place and pair program if you don't use C++
>>
>>51249245
>>51249245
>tfw no programming bf
>bf
>i am a trap btw
you now understand why you have no bf
>>
>>51249342
>It says clear as day on adacore website that anything compiled by GNAT must be released as GPL.
Then they are wrong.
>>
>>51249360
I identify as female and I am a real woman. Check your white male privilege
>>
How long did it take you guys to get competent enough to start doing your own personal projects?
>>
>>51249418
year and few months
>>
>>51249418
I think most of us started out doing our own simple projects. It's the best way to learn. But if you can't think of simple enough projects, then it's going to take longer.
>>
>>51249418
I consider myself competent. Haven't done any personal projects, seems pointless. I could've done a few in C or Lua after my first year. Had to do a big project after 1 month though for my intro class, that was quite the learning experience.
>>
>>51249418
I started coding around mid 2012 and now I can code shit like A*
planing on trying to learn to code a bezier line without luck.
>>
File: Screenshot (15).png (839 KB, 1920x1080) Image search: [Google]
Screenshot (15).png
839 KB, 1920x1080
>>51246807

made a screenfetch for winblows win
>>
>go to IT school to get some credits before I go to programming school
>the only langage they learn is VB
It's fun but is there any concept I could use when I'll learn new langage? It seems pretty useless to me atm
>>
>>51249409
No instance of constructor Woman matches the argument list
Argument types are: (Man)
>>
>>51249401
The Ada runtime library of GNAT libre version has a different license than GNAT pro and FSF gnat.
So you're wrong.
>>
>>51249342
Just download the FSF GNAT Ada compiler, like off the repo if you're using Linux. Avoid the Ada Core license trap at all costs
>>
>>51249532
you know, it's not like you could learn anything on your home using youtube bro.
>>
>>51249557
I know, I just want to know if my time spent learning VB will all go to waste once I learn C, python etc
>>
>>51249535
This is why you are single
>>
>>51249529
neat
>Groove Music
>>
>>51249587
the concepts are the same though.

you could still use VB to make anything you wish, like games.
>>
>>51249537
Then use adacore gnat pro or fsf gnat.
>>
>>51249622
I can use pretty much any langage in VB right?
>>
what's the best source to starting learning APL?
>>
>>51249640
I think I'll just use GNAT libre, make proprietary software, and not tell anybody :^)
What are they going to do, raid my house and seize my PC?
>>
>2015
> Not programming in Java day and night

What's your excuse?
>>
>>51249640
>Then use adacore gnat pro
paying to use an open source compiler
shig.jpg
>>
>>51249655
A language is just a tool.

there's no such thing as superior language, only languages that are better for certain things or have better libraries and documentation.

I would care more about the language having good documentation and the libraries having good tutorials+documentation than what fags think here.

I use java BTW and most people, your customers won't give a shit about your language.

Just like most people didn't give a shit about minecraft being made on java.
>>
>>51249688
Why would you pay?
It's GPL, just find someone to make you a copy.
>>
>>51249696
> I use java btw

Opinion discarded
>>
>>51248936
> GNAT gratis doesn't let you produce nonfree software so you get some incentive to buy GNAT pro
> FSF GNAT doesn't just like
> every FSF compiler ever
> proceed to talk shit about St Ignucius's male organ
moron
>>
>>51249683
no tco
>>
> the year is Lisp Machine 1 + 40
> still not using an lisp machine day and night

where did we go wrong?
>>
>>51249705
So, what?
I use java to make mobile stuff.

I didn't say I use ONLY java.
>>
>>51249683
retarded type system to afford retrocompatibility
>>
>>51249712
FSF gnat does let you produce nonfree software, though, since it has the runtime library exception, just like GNAT pro.
>>
File: smith.jpg (24 KB, 400x250) Image search: [Google]
smith.jpg
24 KB, 400x250
>>51248184
#define return if (std::random(1000) < 2) throw std::exception(); else return


This is the most evil thing I've ever seen, it's incredible
>>
>>51249683
I'm not retarded enough : (
>>
>>51248212
when programmer productivity is more important then the program's execution time because java is easier to work with. the IDE helps you out a lot more with java than with C++ and you don't have to wait for your program to compile before you can run it.
>>
>>51249718
Not all problems we care about require the expressiveness of lisp so we optimized.
>>
>>51249669
It might sound funny now, but you might actually get good at some point, you might actually contribute a snippet of code to a commercial project forgetting it came from that old compiler and the project gets slammed with hefty license lawsuits
>>
>>51249754
I meant 'doesn't not let you'. Now that you said it, I must admit that I'm no native speaker. Can someone confirm I should think 'FSF gnat does' ?
>>
>>51248854
it's kinda creepy though. there was some youtube promo vid posted here some time ago and the guy obviously had the mirror set up so he could check out the grill sat next to him
>>
You are all professional god like programmers here how come none of you wrote any business applications to sell for a lot of money?
>>
could anyone help me with extracting the second digit from a three digit number? here's what I have now, I need to extract every single digit

 #include <stdio.h>

int main(void) {
int n = 0;
int digits = 0;

printf("Insert a three digit number: ");
scanf("%d", &n);

int FirstDigit = n;

while(FirstDigit >= 10) {
FirstDigit /= 10;
}

int LastDigit = n % 10;

printf("%d %d\n", FirstDigit, LastDigit);

return 0;
}


yes this is a homework-related question
>>
>>51249828
forgot to remove int digits
>>
>>51249812
i'm making a gayme
>>
>>51249812
Most people here are learning. The people here who are good most likely have high paying jobs
>>
>>51248212
>this picture
I couldn't stop laughing for five minutes, thanks bro.
>>
>>51249783
It is a sound advice in general, but here we aren't concerned about copypasting a free software snippet once, we are talking about constantly running your code through a free software compiler everyday. Kinda impossible to forget, dontcha think ?
> Enterprise projects in Ada
>>
>>51249828
use an array and fill it with digits inside the loop
>>
>>51249828
try
% 100
/ 10
* 10
>>
>>51249783
>Ada
>Commercial project
I'm not planning on programming fighter jets

Also, how are they going to know where the source came from if I never release it? Reverse engineer the binary? The entire premise just sounds silly to me. How does anyone prove anything when it comes to that?
Also also,
>write code in a text editor
>compile with GNAT
>code retroactively becomes GPL
Fucking retarded. Robbing people off their intellectual property is okay when RMS does it :^)
>>
>>51249799
>just looking at a girl is ``creepy''
rust programmer detected
>>
>>51249883
* disregard the last one
>>
>>51249828
number = 12356
digit = 3 (from right)
base = 10
number = floor(number / (base^digit)) = floor(1235 / (10^3)) = floor(12.356) = 12
number = number % base = 12 % 10 = 2
>>
>>51249912
in the calculations 1235 should be 12356
desu i just wrote this ad hoc and havent done it before, it might not work
>>
>>51248329
>Just try to do the same thing with any non c/c++ language. It just werks

If writing broken code works then it is not "the same thing"
>>
>>51249880
>>51249890
Ada is very modular, you can forget you are linking to an old library you made a long time ago. Seriously if you're at all serious about being a professional, don't fall into a license trap like that
>>
>>51249828
scan the number to an array as a string. then you can just print out the chars.
>>
>>51249064
it is encouraging something like an "immediate mode" which opengl ditched because it was stupid as fuck and no place in computer graphics other than the lowering entry level for opengl. not to mention it is java, so each opengl calls has another level of abstraction.

we were using it on my previous workplace, maybe it is libgdx or maybe it is mobile platforms but performance was shit. albeit harder to use, our ndk project was a lot better.
>>
>>51249890
Code you write never 'becomes' any license other than whatever you choose to do with it.
GPL (or any other license really) only applies if you actually distribute something using someone else's code (for example a program containing some runtime library code)
>>
>>51249967
>performance was shit
What were you doing that was pushing performance?
>>
>>51250025
Drawing things.
>>
>>51249012
Fuck off to your cancer hole.
>Implying you actually get any work done.
>>
>>51249812
why do you thing we are not doing it?
>>
>>51249967
>albeit harder to use, our ndk project was a lot better
this. libgdx might be decent if you're a beginner and just want something that works (but the magic fairies fuck you up and i think it's better to learn everything from the ground up) but you should really move on once you've gotten familiar with how game programming works
>>
>>51250048
like what? Kind kind of software/games were you making?
>>
>>51250020
You don't understand how Ada works, all modules in Ada have to compile independently of the rest of the project, this is enforced by the compiler. It's not like C/C++ where you can just add some header files to the project and no one knows about it
>>
>>51250086
Games. I don't know if it is libgdx to blame but changing shaders was pretty slow for example.

Another thing I hated on libgdx was its gui library. it was unusable mess to work with different screen sizes. Is it still same? When you ditch gui stuff and you are worried that all those immediate opengl calls, libgdx adds nothing useful on top of jogl (it was using jogl right?)

At that point you are better just switching jogl or better move to native
>>
>>51250170
monogame is also a decent option for mobile
>>
>>51250170
dunno m8, but expecting phones to be like high end pc is something silly I guess.
>>
Is SICP only worth a read if you're learning or have learnt lisp?
>>
>>51250208
libgdx not helping it by its retarded design though
>>
>>51250238
SICP is for intro CS courses. It's not worth reading unless you've never touched CS or programming before
>>
>>51250258
I'm not very good at coding but I'm currently going through java for my course
>>
>>51250255
>shaders
>on fucking phones
nigga what?

you should have waited at least some years when the average phone is better than a PS4.
>>
>>51250123
You don't understand how licenses work.
It doesn't matter how 'a language works', what matters is what software is included in the thing you're distributing - if the program is linked against libraries written by someone else then you need to adhere to their license.
That's all there is to it.

The confusion comes from the fact that gcc implicitly statically links against something called libgcc which has things like intrinsic functions and various runtime support facilities, and since libgcc is GPL that would normally make the final executable covered by GPL as well, but this is why the gcc runtime library exception exists.
>>
File: Capture.png (12 KB, 328x265) Image search: [Google]
Capture.png
12 KB, 328x265
what
>>
>>51250258
have you read it ?
>>
>>51249828
nth digit = (number / pow(10, n - 1)) % 10

or if you're gonna extract them all

while (number > 0) {
digit = number % 10;
number /= 10;
}
>>
>>51250285
you're moving the pointer
>>
>>51249551
Can I just get the latest mingw-w64 if I'm on winblows?
I hope GCC supports ada 2012
>>
>>51250294
nvm the other part, that's just gonna run forever

you'd need to change the condition
>>
>>51250282
> damage control
How are you going to copy paste a file into your project with an object file that you're never recompiling, and go on unharmed ? Especially if there is the RUNTIME SYSTEM of a language like Ada (position of ignorance from me) which is surely going to cause complaints since we're talking about it not even being the same compiler... You've lost, just admit it. Bravery is surrendering while it's still time.
>>
>>51250285
Oh, he doesn't understand pointer arithmetic. Welcome to C/C++.
>>
>>51250291
you already know the answer is 'no' just from his response
>>
File: 1439203488037 (1).gif (447 KB, 245x175) Image search: [Google]
1439203488037 (1).gif
447 KB, 245x175
>>51250285
>Victoria
spotted the wannabe trap faggot
>>
>>51250285
Good job, you almost made tornado text.
>>
>>51250294
 int SecondDigit = (n / 10) % 10;

holy shit that works anon, thanks a lot. that's exactly what I was looking for

>>51249881
>>51249958
even though I'm pretty sure that'd work better I don't know how to do that yet

>>51249883
none of these worked, thanks for trying though

>>51249912
we've never used floor() in before which doesn't mean I couldn't try that but I was looking for something more simple, thanks anyway
>>
>>51249890
The GPL virus has it that, in your case, if you compile some code with the GPL-infected GNAT gratis compiler, the object file that results is infected. But your source code isn't, and you're safe the second you change compilers. Not sure how much difference there is between these two compilers tho.
>>
>>51250359
> damage control
What?
>How are you going to copy paste a file into your project with an object file that you're never recompiling, and go on unharmed ?
Non sequitur.

Again, I¨'ll make it simple for you:

does program.exe contain code other than what you wrote? If so, you need to consult whatever license that code uses, if it's GPL the act of distributing program.exe is considered a derivative work and *then* your code would need to be GPL.
If you never distribute program.exe or if it doesn't contain any statically linked GPL libs, then no license applies.
>>
>>51250277
Then you can probably learn something from SICP

>>51250291
Yes
>>
>>51250452
hardly

>>51250370
hmm it's just different notation you could have just told me that

cout >> "benis " >> i >> endl
>>
>>51250478
I agree, but we are talking about unadvertently slipping some GPL code from GNAT gratis into a larger project, and that fact going unnoticed for so long that you get a lawsuit. Rerread thread
>>
anyone has experience writing polymorphic/metamorphic code?
im writing a bunch of RAII security modules for simple inclusion in just about any project, but after reading a bit about i realised it might not be possible to do it that easily
>>
>>51250208
you can have fairly good graphics and/or performance if it's properly programmed (not using libgdx)
>>
>>51250285
Java "programmer" detected

Learn the fucking language before you use it, retard
>>
>>51250370
i thought string literals were interpreted as std::string in C++ tho?
havn't used it in a while
>>
>>51250512
It's far more than different notation. After you've finished basic arithmetic, you're probably going to look into pointers next.
>>
>>51250463
floor rounds down, if you're using ints you don't need this
>>
>>51250562
no, they're const char*
>>
>>51250522
So lets just ignore the fact that it's possible to link your project with precompiled libraries that were compiled in another compiler different from the one you're using
>>
>>51250558
yeah, but it's simply better for the economy to force people to get better hardware.

are u against that?
>>
>>51250562
>>51250587
dunno how new the _s literal is

"this is const char*"
"this will be a std::string"s
>>
>>51250560
>Learning a language
>confused by a concept he hasn't learned yet
>"Java "programmer" detected

Learn the fucking language before you use it, retard"
>>
>>51250463
int digits[3];
int i = 0;
int numberOfDigits = 0;
while(n > 0) {
digits[i++] = n % 10;
n /= 10;
++numberOfDigits;
}
>>
>>51250562
>i thought string literals were interpreted as std::string in C++ tho?

If you thought that then you're still an idiot, because even if that was the case your code wouldn't work.
>>
>>51250601
it's better for your economy if your shitty 2D game doesn't run like ass on a $1000 smartphone
>>
File: helpmeobiwan.jpg (20 KB, 400x228) Image search: [Google]
helpmeobiwan.jpg
20 KB, 400x228
case SDLK_KP_PLUS:
while (Actors[focus].getInitiative() < 100){
Actors[focus].addSpeed();
if (focus >= player_count){
focus = 0;
}
else{
++focus;
}
}
Actors[focus].takeTurn();
break;

I'm committing a sin here. But I'm retarded. Somehow I'm going out of bounds and too stupid to see where.

takeTurn subtracts 40 from initiative.
addSpeed adds the speed value to initiative.

>iterate the actor list adding respective speeds to actor and loop back to 0 until someone's initiative is over 99. At which point remove 60 from that person's initiative.

It breaks on player count values of 1, 3 or 4, 7 or 8, 11 or 12, 15 or 16, etc etc. 3 more than the last and the next.

if speed = 11, or 10, it takes 7 turns to somehow reach actors[1] and for speed = 9, it takes 6 turns.

Apparently I lucked into using a good value until now.
>>
File: 1391718956645.jpg (9 KB, 250x237) Image search: [Google]
1391718956645.jpg
9 KB, 250x237
>>51250512
>cout
>
>>
Thread replies: 255
Thread images: 22

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.