[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: 339
Thread images: 34

File: fizzbuzz.jpg (111KB, 1363x721px) Image search: [Google]
fizzbuzz.jpg
111KB, 1363x721px
Brainfuck edition
>>
First for C
>>
OCaml is salvation. OCaml is truth. Convert, heathen!
>>
>>52335496
esoteric = fuccboi
>>
java
>>
File: 1451751832808.png (17KB, 418x359px) Image search: [Google]
1451751832808.png
17KB, 418x359px
>people in the last thread who didn't understand operator precendence
>in python of all languages
>>
File: 1452046560661.gif (6KB, 133x63px) Image search: [Google]
1452046560661.gif
6KB, 133x63px
Daily reminder to use Free Pascal. It's fast, portable and has a nice GUI builder.
Write once, compile anywhere!
http://www.freepascal.org/advantage.var
>>
File: 1452205269733.jpg (752KB, 1920x1080px) Image search: [Google]
1452205269733.jpg
752KB, 1920x1080px
>>
>>52335569
yeah, it does tick me off a bit when people try to sound smart when they clearly have no clue.
>>
>>52335602
Can you explain what the Units option in the installer is please? I don't want to enable it if I don't have to.
>>
>>52335603
really needs more enterprise tier challenges suitable for python/django and javaEE/spring environments.

if it doesn't involve an application context and an abstract factory it doesn't count
>>
>>52335617
It's the standard library.
Heavily recommended that you include it.
>>
>>52335694
Thanks.
>>
File: mascot-medal.jpg (20KB, 300x450px) Image search: [Google]
mascot-medal.jpg
20KB, 300x450px
>>52335496
A fizzbuzz in BF? You're officially /dpt/ autistic mascot.
>>
>>52335716
Also, don't forget to download Lazarus if you want to make GUI applications or want a pascal-tailored IDE.
>>
>>52335740
it's okay he got it from me
>>
File: 1445271545852.jpg (9KB, 400x654px) Image search: [Google]
1445271545852.jpg
9KB, 400x654px
I wrote my first scraper in python today, /dpt/ :3
>>
>>52335767
This. I'm not that autistic yet.

I am currently running a Mandelbrot pattern made in BF, and then after a Sierpinski triangle from an archive of BF programs
[ This program prints Sierpinski triangle on 80-column display. ]
>
+ +
+ +
[ < + +
+ +
+ + + +
> - ] >
+ + + + + + + +
[ >
+ + + +
< - ] >
> + + > > > + >
> > + <
< < < < < < < <
< [ - [ - > + <
] > [ - < + > > > . < < ] > > >
[ [
- > + +
+ + + +
+ + [ > + + + +
< - ] >
. < < [ - > + <
] + > [ - > + +
+ + + + + + + + < < + > ] > . [
- ] > ]
] + < < < [ - [
- > + < ] + > [
- < + > > > - [ - > + < ] + + >
[ - < - > ] < <
< ] < < < < ] + + + + + + + + +
+ . + + + . [ - ] < ] + + + + +
* * * * * M a d e * B y : * N Y Y R I K K I * 2 0 0 2 * * * * *
>>
>>52335780
was it less than a hundred lines?
>>
I do independent contract work for my boss on the side, and right now I'm working on:

1) A CRUD application for an access database, because access is too hard for the employees to learn

2) 15 variations of an excel dashboard to be used depending on different data sources, along with python scripts to parse csv files and import them properly

3) A pdf scraper

I don't know how much more of this I can take, guys
>>
>>52335843
Stop it anon. You'll damage your brain.
>>
>>52335602
It's slow, unportable, and powerless, but at least has a GUI builder!
>>
>>52335901
> slow
False
>unportable
False
>powerless
False.

Opinion discarded due to retardation.
>>
>>52335866
>>52335895
You forgot the image ):
>>
>>52335846
Yeah, it's pretty simple, like 20ish lines total, just a good exercise in learning requests and beautifulsoup
>>
how many lines of code can you write a day?

I'm talking about production quality code. Really struggling with getting down more than 200-300 lines.
>>
>>52335916
>slow
Benchmarkgames, it's 5x slower or worse than java.
>unportable
Look at the platforms supported. Definition of unportable.
>powerless
Compare with any modern language, even C++. It's like being stuck with C89. Couldn't be less powerful if it tried.

Shill harder next time.
>>
>>52335866
>A CRUD application
Dynamic, mobile-friendly, cloud-stored and with options for social media, I hope?
>>
>>52335961
With my busy days, I pump out about 100-200 lines a day, and they're spent mostly on memes
>>
>>52335971
>comparing multi threaded benchmarks to single threaded ones
I've already exposed your retardation, no need to embarrass yourself further.
>>
>>52335993
I compared everything with single-core. It's even worse with multicore, where java becomes over 20x faster. Keep embarrassing yourself though, shill.
>>
>>52335985
post code maymays
>>
>>52335961
It depends on the project. Some days I turn out only a few lines and sometimes a couple hundred to thousand.
>>
>>52336062
Over the past few weeks here:
>Brainfuck interpreter
>Ook! interpreter
>Bresenham's circle
>Meme triangle
>Meme swastika
>4chan post code executor
>4chan thread, threads, board images downloader
>4chan thread regex searcher
>4chan dubs & primes posts counter
Which one do you want to see m8?
>>
>>52335975
I said access, not mysql
>>
>>52336104
Oh forgot
>synacor VM implementation
>>
>>52335961
I always say its better to delete lines than create lines. That's why I've written negative lines of code every day for the past 20 years.
>>
>>52336104
meme triangle
>>
>>52336043
Why are you being intellectually dishonest?
>>
>>52335961
At work I can get out a few hundred a day, for shitty projects at home I can put out several thousand
>>
File: memetriangle.jpg (128KB, 1067x535px) Image search: [Google]
memetriangle.jpg
128KB, 1067x535px
>>52336175
>>
>>52335866
>Access Database

I'm so sorry... At least my boss let me pick any database I want. Heck, even the langauge. Heck, IM THE CTO since no one questions my tech decisions.
>>
File: mandelbrot.jpg (277KB, 1041x441px) Image search: [Google]
mandelbrot.jpg
277KB, 1041x441px
Dozing off, I'll leave this running over night. After this, I've got a Brainfuck Game of Life player
>>
>>52336181
Shilling belongs on >>>/b/
>>
Why do so many people here use python? There are so many better alternatives, the only reason to use python is if you're stupid and can't live without a library to do everything for you
>>
>>52336187
what range would you say you put on a working day if you had to guess?
100-300,300-600, 600-900 or 900+?
>>
>>52336237
>the only reason to use python is if you're stupid and can't live without a library to do everything for you
You just answered your own question.
>>
>>52336107
>windows server on Azure
>install Access on the server
>host an ASP.NET web API on server with connection to Access db
The cloud is always a solution, my friend.
>>
>>52336232
It is spouting falsehoods knowingly that belongs on >>>/b/.
>>
>>52336237
are you dumb? the libraries abstract common functionality, which is typically easy to implement on your own, but if you're building on top of that functionality, it helps to have the library so you can focus on the details of your own problem, rather than reinventing the wheel

also, it's quick to get programs up and running, so it suits the pacing of this board
>>
>>52336237
python is convenient, easy and quick

what is a better alternative? does it have better libraries? does the code look cleaner? is it quicker to write? is it better supported? No.

if you care about speed you're using the wrong tool.
>>
>>52335603
is this a roll? rolling, I guess.
>>
>>52336274
>does the code look cleaner? is it quicker to write? is it better supported?
Yes.
>>
What's fizzbuzz actually? I want to give it a shot.
>>
>>52336237
>Reinventing the wheel because IM HARD CORE
>import math? I write my own math module bitch.
>>
>>52336302
Fuck of faggot, filtered.
>>
>>52336302
The "Fizz-Buzz test" is an interview question designed to help filter out the 99.5% of programming job candidates who can't seem to program their way out of a wet paper bag. The text of the programming assignment is as follows:
>"Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”."
>>
>>52336240
On an average day I'd say probably around 300 lines.
>>
File: Sierpinski.jpg (29KB, 707x551px) Image search: [Google]
Sierpinski.jpg
29KB, 707x551px
Couldn't be bothered with mandelbrot
>>
>>52336302
for (i<=100) if i%3==0 print "fizz" else if i%5==0 print "buzz" else if i%15==0 print "fizzbuzz" else print i
>>
>>52336330
I actually googled it too right after posting, I'm going to try it out, seems easy enough.
>>
>>52336332
ok, I guess I'm not that bad after all.
>>
>>52336330
are they serious about that though?

99.5% seems pretty fucking high
>>
>>52336403
It's a meme, I wouldn't take it too seriously.
>>
>>52336349
Yes, it is basically the easiest possible programming test you could come up with. There is a single tricky point, which should be obvious to anyone who has half a brain.
>>
>>52336403
>reading comprehension
99.5% of programming job candidates who can't seem to program their way out of a wet paper bag
>>
>>52336347
Well, okay, you spoiled it a bit. I'm going to do it in VB because I'm a special snowflake, I assume no /g/entoomen here uses an ide made by microsoft. I had to use visual studio because of uni, now I manage 3 sites from home for a living.
>>
>>52336256
We actually use MS 365 in addition to having a physical server, so I could just open connections to a database hosted on there for every kind of operating system, but I think I'd rather cut my own dick off if given the choice
>>
>>52336446
holy christ fuck off
>>
>>52336403
99.5% is too high, but there are a surprising number of applicants who seem to think they, with no programming knowledge AT ALL, will pick it up on the job, because they are good with computers, or good with math, or because they are mentally deficient. Even worse if you work somewhere that doesn't do technical screening like this well.
>>
>>52336446
this:
>>52336456
>>
The head of my penis is about two times thicker than the shaft.
>>
>>52336482
That's what people in the trade call a mushroom.
>>
am looking over some source code with no comments, it's programming a board to do perform an arranged light display
 (define (blink)
(config-pin giod 12 pin-mode-out)
(config-pin giod 13 pin-mode-out)
(config-pin giod 14 pin-mode-out)
(config-pin giod 15 pin-mode-out)

can anyone decypher what giod stands for? I'm guessing it's the GPIO-output-pin identifier (pin 1, pin 2 etc) but I can't find anywhere referencing this
>>
>>52336303
If you're a hobbyist programmer, or a professional programmer writing code at home as a hobby, you shouldn't be using 3rd party libraries to do your work for you as that kind of defeats the point of having a hobby, no? If you don't enjoy the writing code part of programming, why are you programming without it being your job? I assume it's noone's job to make shitty python meme programs on /g/, at least.
>>
Wew lad

for (int i = 1; i <= 100; i++) {
if ((i % 3 != 0) && (i % 5 != 0)) {
std::cout << i;
} if (i % 3 == 0) {
std::cout << "Fizz";
} if (i % 5 == 0) {
std::cout << "Buzz";
}
std::cout << std::endl;

}
>>
>>52336482
My boyfriend's penis just gets bigger as it goes down.
>>
>>52336535
I remember when I made my first hello world, too! Don't worry buddy, you'll get better with time!
>>
>>52335961
I write one huge-ass line a day
>>
>>52336544
>performing 4 modulus calculations

It's shit.
>>
>>52336523
general input/output (something beginning with 'd')
>>
>>52336426
>reading comprehension
I didn't say of all programmers faggot
>>
>>52336544
you're doing it wrong LOL
>>
>>52336549
Yeah I bet it was fun importing that helloworld library
>>
>>52336566
destination? I think it is the pin identifier
>>
>>52336535
so let me get this straight: you're implying that there is no code that can be written in python that hasn't been written before?

And if not, then what is the better way of writing this previously unwritten bit of code:
1) Using well written and supported libraries that allow you to create this new and quite possibly successful program in a convenient way.
2) Rewriting this library first, and then spending a long time tuning it to make it as good as the already available version and then doing (1)

Silly you! Silly, stupid, cretinous idiot you! Of course doing (1) is better!
>>
>>52336609
Then why aren't you using purely C?
>>
>>52336562
I did it in a couple minutes. If you have an optimal solution feel free to post.

>>52336592
Well, I tested it before posting and it gives the correct answer.
>>
>>52336609
If you're writing release software (which you don't do in python) then sure, go ahead and use 3rd party libs. If you're programming as a hobby, why would you just import libraries instead of writing your own? So you can look at your program afterwards and go "Yeah, that's really cool, I don't know how it works but importing that library and writing 10 lines of my own code was really challenging and rewarding!"

It's even worse when these shitters post their stuff here expecting people to be impressed that they managed to type import a bunch of times
>>
>>52335603
rawl
>>
>>52336626
Because as I quite clearly mentioned, python provides a large number of well written libraries that let me get things done faster and more conveniently.

That was the whole point of that post. Read it again. Go on then son. Give it a go and then get back to me.
>>
Can we agree to write everything in Javascript and be done with it?
>>
>>52336649
your idiocy is tiring.

I don't like writing code that has already been written better by someone else. I write new code.

Which is better: spending your hobby programming new things or reinventing the wheel like you suggest?

Do you not understand?
>>
>>52336635
fizzbuzz x =
case (x `rem` 3, x `rem` 5) of
(0, 0) -> "FizzBuzz"
(0, _) -> "Fizz"
(_, 0) -> "Buzz"
(_, _) -> show x

main = mapM_ (putStrLn . fizzbuzz) [1..100]
>>
>>52336635
lol. this should be the correct output

     for(int i=1; i<101; i++){
if (i%15==0) std::cout << "fizzbuzz\n";
else if(i%3==0) std::cout << "fizz\n";
else if (i%5==0) std::cout << "buzz\n";
else std::cout << i << "\n";
}
>>
>>52336677
This language's syntax looks terrible.
Which functional language is this so that I can actively avoid it?
>>
>>52336654
>literally contradicting yourself this hard
Pythontards everyone!
>>
>>52336677
_ == 1

WOT
>>
>>52336694
Haskell. What don't you like about it?
>>
import fizzbuzz

fizzbuzz()
>>
>>52336707
(x, y) pattern-matches against 2 free variables.
(0, y) pattern-matches against 1 free variable as well as the value 0. Hence, (3, 5) doesn't match, but (0, -18) does, and will bind y to -18.
_ = don't care.
>>
>>52336566
>>52336605

we've done it, congrats guys
>>
File: Unbenannt.png (5KB, 61x734px) Image search: [Google]
Unbenannt.png
5KB, 61x734px
>>52335496
Rolling and
>that
for (int i = 1; i <= 100; i++)
if ((i % 3) == 0 )
if ((i%5)== 0)
Console.WriteLine("FizzBuzz");
else
Console.WriteLine("Fizz");
else
if ((i%5)== 0)
Console.WriteLine("Buzz");
else
Console.WriteLine(i);
>>
>>52336718
le symbols le hard to read xd
>>
>>52336729
ah I see how it works
>>
>>52336677
>Haskell

Well, I have learning haskell on my to-do list.

I thought of that solution too, just making two divisions. But I did it straight forwardly.

>>52336683
What? You don' need else m8. Mine check all conditionals (yeah, that's what else is for).

So if it's multiple of both 3 and 5 it outputs FizzBuzz.

http://ideone.com/Eu9FA2
>>
>>52336718
The names of what I assume to be standard functions mapM_ lead me to believe that they have some sort of arcane coding style.

Same with putStrLn. Clearly there is some sort of trickery in the language, possibly in the type system, that they seriously thought that "putStrLn" is better than "print".

I also hate how you have operators that look exactly like strings.
>>
unsigned char n, i;
for(i = 1; i < 101; i++) {
if(i % 3) {
n + 0x10;
}
if(i % 5) {
n++;
}
if(n & 0x11) {
printf("%s\n", "FizzBuzz");
} else if(n & 0x1) {
printf("%s\n", "Fizz");
} else if(n & 0x10) {
printf("%s\n", "Buzz");
} else {
printf("%d\n", i);
}
n = 0;
}
>>
>>52336753
oh I didn't see !=

carry on
>>
>it's a fizzbuzz thread

for fuck's sake
averaging two ints was better than this shit
>>
>>52336760
you know, I thought pretty much the exact same way before learning Haskell. The names are still sometimes ugly to look at but the semantics of the language are great and you can always just redefine the functions to a different name.
Oh, and the `rem` thing isn't an operator, the backticks turn it into an infix function.
>>
>>52336760
>The names of what I assume to be standard functions mapM_ lead me to believe that they have some sort of arcane coding style.
mapM_ is mapM that throws away the output. It's needed because main is a "procedure" (type IO ()).

>Same with putStrLn. Clearly there is some sort of trickery in the language, possibly in the type system, that they seriously thought that "putStrLn" is better than "print".
print works on more than strings. putStrLn is for "putting a string and starting a new line".

>I also hate how you have operators that look exactly like strings.
That's an artifact of the 4chan code tags. Any real Haskell syntax highlighting will give stuff in `` the same colour as any other operator.
>>
File: Naamloos.png (68KB, 1920x1080px) Image search: [Google]
Naamloos.png
68KB, 1920x1080px
Took me a while because I had to install visual studio to do it in vb as asshole anon spoiled it, but here it is. Simple as fuck. Am I Cisco-Certified now?
>>
>>52336753
you still goofd
>>
>>52335603
rolg
>>
>>52335603
Roll
>>
>>52336753
you can do it in the same amount of lines either way

    for(int i=1; i<101; i++){
if (i%3!=0 and i%5!=0) cout << i;
if(i%3==0) cout << "Fizz";
if (i%5==0) cout << "Buzz";
cout << '\n';
}
>>
File: 2199t6p.gif (345KB, 173x270px) Image search: [Google]
2199t6p.gif
345KB, 173x270px
>>52335603
k
>>
>>52336820
int avg1(int x, int y) {
int sum = (x / 2) + (y / 2);
int mod = (x % 2) + (y % 2);
int nsig = (sum < 0) - (sum > 0);
return sum + nsig * (nsig == mod) + mod / 2;
}

int avg2(int x, int y) {
int sum = (x / 2) + (y / 2);
int mod = (x % 2) + (y % 2);
sum -= (sum > 0) * (mod == -1);
sum += (sum < 0) * (mod == 1);
return sum + mod/2;
}

int32_t avg3(int32_t x, int32_t y) {
return ((int64_t)x+y)/2;
}

int avg4(int a, int b)
{
if ((a < 0 && b > 0) || (a > 0 && b < 0))
return (a+b)/2;
else
return a/2 + b/2 + (a%2 + b%2)/2;
}

int avg5(int a, int b)
{
int t = (unsigned)(a^b)>>((8*sizeof(int))-1);
return ((a/2+b/2+(a%2+b%2)/2)*!t) | (t*(((t*a)+b)/2));
}

int avg6(const int x, const int y)
{
if ((x > 0) == (y < 0))
return (x + y) / 2;
return x/2 + y/2 + (x%2 & y%2);
}
>>
>>52336334
for what purpose?
>>
I think I have found the joy of programming.
For the first time in years, I am truly happy.
>>
>>52336675
>written better by someone else
Your problem, and every python import babby's, is precisely this. "Someone else has already done it better than me so I won't even try, I'll just use their code". The reason they can do it better than you is because you're a fucking baby and won't even try to do it yourself. Why not try and write your own that's better than the existing ones? Do you think that if a python library exists it's perfect code and noone can write a better version? The only case of this is in really trivial stuff, which is stupid to use libraries for anyway when you can do it yourself in a couple of minutes.

With your mindset you may as well just copy and paste (Literally no different to importing libraries) all your code from someone on the internet who's already done it, because why bother reinventing the wheel right? Chances are with python if you're making something someone else has already done it before, and probably "better than you can" as you say.

Imagine a big solid stone wheel, you would be content to use that because it gets the job done, it's not like you could make a better one yourself right? And besides, why reinvent the wheel? Someone else looks at it and goes "I could just use this, or I could make a better version" and then creates a nice lightweight spoked wheel that works far better than your shitty copy+paste stone wheel

This is the difference between a python "programmer" and a programmer
>>
>>52336968
what is it?
>>
>>52336869
Huh?

>>52336913
Oh, I think you couldn't do that with the older standards. It stuck back then, I guess.
>>
File: splash_logo.png (90KB, 450x300px) Image search: [Google]
splash_logo.png
90KB, 450x300px
>>52336977
It's Pascal.
>>
import std.stdio;
import std.conv;

void main(string[] args)
{
foreach(int i; 1 .. 101)
{
writeln(i % 15 == 0 ? "Fizzbuzz" : i % 5 == 0 ? "Buzz" : i % 3 == 0 ? "Fizz" : to!string(i));
}
}

:^)
>>
>>52336968
happy little integers...
>>
>>52337005
I laughed.
>>
>>52337019
nice meme
>>
>>52336237
>prototyping
>automation scripts
>best analytical tools for medium sized data sets
>>
>>52337018
>perpetuating the python meme
>>
whats the best ide and why is it vim
>>
>>52337057
>NOT WRITING MACHINE CODE IN MICROSOFT WORD
>>
>>52337018
>uses a one-liner
>uses Allman style
why tho
>>
>>52337050
toppest kek
>>
>>52337053
u wot
>>52337083
>one-liner
cuz
>Allman
cuz
>>
>>52337069
>>
File: 1447396292065.jpg (126KB, 1440x1080px) Image search: [Google]
1447396292065.jpg
126KB, 1440x1080px
>>52337057
>vim is so great because there's no bloat
>just let me install these 50 different plugins to turn it into a poor-man's IDE with tons of bloat and conflicts and shit
>>
File: 1418158514594.jpg (45KB, 711x273px) Image search: [Google]
1418158514594.jpg
45KB, 711x273px
>>52337069
>not painting Skylake microcode on oil canvas, taking a Polaroid, and scanning the picture to get it on your computer
>>
>>52337118
>use visual studio
>still install 50 plugins
no conflicts tho
>>
>>52335569
python users are dumb as shit pisskids
>>
>>52335603
rolling
>>
>>52336743
now make it print Fizz for each 3 in a number and Buzz for each 5 in a number:

13 should now print Fizz, 33 FizzFizzFizz, 55 BuzzBuzzBuzz, 15 FizzBuzzBuzz... you get the idea.
>>
File: 1444612076641.jpg (1MB, 1462x1462px) Image search: [Google]
1444612076641.jpg
1MB, 1462x1462px
>>52337140
>not cutting a long sheet of paper such that when it's put through a shredder and recorded, the audio data compressed to MP3 320 kbps produces an AutoHotKey script to design an integrated circuit in Verilog
>>
>>52337159
>best argument here obviously
>>
This is going to sound retarded, but I can't seem to get Google to cooperate.

In C#, I want to get a character from the alphabet using an int.

How do I get "C" from "3"?

I was going to just make a list with each letter, but that seemed lazy and needless, not going to learn anything doing that.
>>
File: da0.png (9KB, 273x312px) Image search: [Google]
da0.png
9KB, 273x312px
>mfw readme files are 100 pages long
>>
>>52337223
http://www.asciitable.com/
>>
File: asciifull.gif (27KB, 715x488px) Image search: [Google]
asciifull.gif
27KB, 715x488px
>>52337223

>>52337224
>reading readme files
>>
I learned C++ in 2005. I believe the books I were using and the classes I took were using the 98 standard. Well in the last couple weeks I've started browsing /g/ and I've noticed people mentioning the 03, 11, and 14 standards.

How useful is my 98 knowledge now? What's changed? What are the big improvements?
Does C++ still let you get close to the hardware like before?

Also how efficient is octave?

I posted this in an old thread and didn't see the answer before it disappeared.
>>
>>52337223
use the ascii table.

for (int i = 0; i < str.length; i++)  
Console.Write(((int)str[i]).ToString());
>>
>>52337242
I linked you that presentation by Herb Sutter
Watch it
>>
>>52337242
This book by the creator of C++ covers the 11 standard http://mazonka.com/shared/Straustrup4th.pdf
>>
So what are all the abstract data types (not graphs of any type)?
I know there are lists, sets, maps, multisets, and muiltimaps. I'm sure there are more, but they seem less useful.
>>
>>52337223
you have to map the letters to numbers somehow, might as well use a list
>>
>>52337118
>>52337141
>>52337057
>not using notepad++ with a couple of keyboard shortcuts
I've written an entire 3D video game in notepad++, what's your excuse?
>>
>>52337224
>integrated search by keyword

or

 less readme | grep keyword 
>>
>>52337269
Deque, of which stack and queue are special cases
>>
>>52337242
I've been interviewing lately and everyone is asking questions about C++11. They're not necessarily using it, and we weren't using it at my last company, but it's probably a good thing to be aware of it at least.

The "old" C++ is still 90% of what's important anyway.
>>
File: 1448870372218.gif (3MB, 550x309px) Image search: [Google]
1448870372218.gif
3MB, 550x309px
>>52337271
>probably using something super high-level like C
>>
>>52337242
>Also how efficient is octave?
It's okay. Doing vector and matrix ops is where it shines. Anything else it performs like utter dogshit, just like MATLAB.
>>
>>52337280
deque is love
>>
>>52337280
They are data structues; just special cases of a list (ordered, repeats possible, singular value).
>>
>>52337297
>superhigh level
>C

pick one
>>
what's a good resource to get to grips with concurrency, preferably with a good theoretical background?
>>
>>52337326
I was 'avin a giggle
>>
>>52335603
fuck
>>
>>52337242
https://arch.b4k.co/g/thread/52331088/#52334870
>>
>>52337336
Concurrency is just about the least theoretical part of programming

It's really easy on paper, the hard part is getting it to play nice in real life
>>
Any decent dictionary API's?

Coming up with a password generator, and I want to be able to generate actual memorable words instead of just random characters.
>>
>>52337407
/etc/words or just a list of words downloaded from somewhere, stupud JS cuck.
>>
>>52337407
/usr/share/dict/words
>>
>>52337430
>Linux
>Implying

>>52337419
>JS
>Implying
>>
>>52337446
cuck
>>
>>52335603
rolling with the times
>>
>>52335936
you do understand that this is like the fizzbuzz of python right
>>
>>52335961
maybe a thousand max
haven't written much of anything in the past month though
lost the fire that I had going for a few months there
it'll come back in time, I just need something interesting to make
>>
>>52336974
> being this autistic
>>
>>52336974
>wall of text
>on 4chan

leave
>>
>>52337523
>A handful of lines is a "wall of text"
Sounds about right for a python baby, I'm sure you're only used to seeing a couple of lines of "import" in your texts

>>52337500
Good to see you've realised I'm right python baby
>>
Does anyone have any clue at all about this?

I'm looking all over. Ideally I'd love a JSON text file just filled up with a whole stack of English words, but I'd settle for anything honestly.
>>
>>52337259
I didn't see it. Did you link this one? This is what looked the most relevant on google.

https://channel9.msdn.com/Events/GoingNative/GoingNative-2012/C-11-VC-11-and-Beyond

Looks like he has a bunch of good videos. I'm going to check that out.

>>52337268
I had been meaning to dig through the Straustrup book on 98 but never got around to finding a copy. Thanks.

>>52337296
>The "old" C++ is still 90% of what's important anyway.
Glad to hear that. I haven't written anything since 2008 and it was this: http://sourceforge.net/projects/kdircbot/files/?source=navbar

I looked it up and someone else is using the name kdbot. There are tutorials and everything. I was like holy shit people are using it? I am so let down.

>>52337298
So if I built a digital signal processing equalizer that did lots of floating point multiply and add operations on individual components of a vector representing a PCM *.wav file, it would run pretty well? I'm trying to test something out before I design something for a FPGA and build it on that.
>>
what's the best 2d game engine

>inb4 I'm a major faggot
>>
>>52337588
SDL for 2d stuff but check out SFML as well
>>
>>52337588
>>>/vg/agdg

yes, you are.
>>
>>52337588
Unity
>>
>>52337242
C++11 has a lot of neat features that can make your life easier, but your C++98 knowledge will still mostly be applicable
>>
>>52337354
Thanks. Why couldn't I find it in the archive that 4chan links to. Last time I browsed 4chan we didn't have an archive or a catalog. I feel like a caveman.
>>
>>52337271
Why wouldn't you use an IDE for that?
>>
>>52337546
>it would run pretty well?
Well I did a class in uni last semester on dsp and we used MATLAB and everything was fairly quick. Very easy to code as well. So I'd say yeah. Just get in the practice of writing idiomatic MATLAB code. I'm going through some code right now where the person wrote MATLAB like it was C. It performs like dogshit.
>>
>>52337546
https://www.youtube.com/watch?v=xnqTKD8uD64
>>
File: g_in_a_nutshell.png (46KB, 536x536px) Image search: [Google]
g_in_a_nutshell.png
46KB, 536x536px
What's the next step after completing codeacedemy python course?

Just start doing projects?
>>
>>52337706
Kill yourself because you just wasted 5 hours of your life that you'll never get back
>>
>>52337701
What an autist. Seriously.
>>
>>52337612
SFML is best avoided.
>>
>>52337759
Herb is a great speaker, what are you on about
>>
>>52337706
>python
Oh boy, you fell for the meme.

Just import some libraries and post your epic generic 4chan image scraper #943285 here, that's about all you can do in python
>>
>>52337682
Cool. I'm digging through the Octave manual now. I came across a part while scanning through it where it says to add to vectors just do A+B instead of adding each element because it will optimize it for you using some special assembly instructions. I assume that's what you're talking about. Any other hints?

>>52337701
Thanks.
>>
>>52337336
Watch Stanford's CS107 Lectures 14-18 to get an idea of what's going on at the hardware level, and then just look up the documentation for the multithreading library in whatever language you're using.

It starts 25 minutes in to lecture 14, but it's taught in C, so if you haven't been exposed to it before you might get a little lost.
>>
>>52337763
What's bad about it?
>>
>when you're stuck for hours on one tiny little thing that should be super simple and should just work the way it is
fucking pisses me off
>>
>>52337706
>memecademy

you fell for it
>>
>>52337784
It's slow and can only be linked against in very specific circumstances, while also being available on less platforms than SDL. SFML1's last version even couldn't work on AMD hardware and that was never fixed - shows you the kind of people developing it.
>>
File: 1452085432800.jpg (56KB, 1600x1064px) Image search: [Google]
1452085432800.jpg
56KB, 1600x1064px
>>52337005
I like Pascal's logo but pls stop shilling already.
>>
>>52337706
>python
kill yourself
>>
>>52337808
Take a break
>>
>>52337808
jack off or something
>>
>>52337774
>I assume that's what you're talking about
Yeah, MATLAB (and Octave I'd assume) use special vector and matrix libraries (LAPACK) to optimize.
You can also do arithmetic between a every element in a vector and scalar using vector .op scalar notation. There is a lot more to it, but I haven't found any good guides on writing performant idiomatic code. Most should complete in less than a minute either way.
>>
>>52336446
you went from innocent to asshat real fast
>>
>>52335603
has anyone actually finished all of these challenges? care to post your solutions in a zip or public repository.
>>
>>52337955
I guarantee you can find an example of each one on github
>>
>>52337828
What's going on with Pascal? Is someone bringing it back? The first programming language I learned was Pascal in high school. My teacher had some old Borland compiler and the version of Pascal we used didn't even support OOP.

So from what I gather C++ 14 now supports threads. Is this right? I don't have to use boost any more to do threads?
>>
>>52338012
Yes. Many of the new features of the standard library originated with Boost. Of course, being in the standard library rather than Boost has made them significantly better to use.
>>
File: T2qJSgU.png (43KB, 1176x408px) Image search: [Google]
T2qJSgU.png
43KB, 1176x408px
Literally why?

It just seems to hate me using a text file in my "Resources" folder.

It obviously exists, and I set the build action to "Embedded resource" but it still isn't happy with me trying to use it.
>>
>>52338012
C++11 had threads and mutexes and the like. But MSVC doesn't support threads, at least not yet.
>>
File: needful.jpg (10KB, 193x262px) Image search: [Google]
needful.jpg
10KB, 193x262px
making a 4chan image downloader,
wget `sed -n '"$i"p' < files.tmp`

Something is fucked here and I'm not good enoguh at bash to know what. we're trying to pull a file url stored on line $i from the files.tmp list, and wget it. it's inside a while loop. I'm just fucking up my arguments.

please do the needful
>>
>>52338056
Sweet I never actually got around to learning multitasking because there wasn't a standard way of doing it.

>>52338074
What's the go to method for multitasking in MSVC then?

I'm so glad virtual machines have pci pass through now. I can run gaymen on a vm now and stay in Linux/BSD all day. I can't wait until save up for a PC to replace my broken one.
>>
>opengl tutorial uses a shitload of third party libraries
nigger, I'm here to learn opengl, not another library I'll probably never use.
Faggot.
>>
File: SqAsqlq.gif (2MB, 400x248px) Image search: [Google]
SqAsqlq.gif
2MB, 400x248px
>>52337808
>tfw a refactor works on the first try
>>
>>52338119
nvm im retarded using wget -i instead thanks for nothing shitlords
>>
>>52337745
>>52337768
>>52337816
>>52337829
These are all me.
>>
>>52338156
Boost. It has full threads, coroutines, and now fibers.
>>
>>52338207
>being this wrong
>>
>>52335603
Rolling for later
>>
>>52338303
Too easy. Rerolling.
>>
>>52338074
MSVC supports threads out the ass, what the hell are you talking about
I implemented an entire semester's worth of programming assignments in C++ for my class that focused on multithreaded programming and data structures.

In fact I dicked around just last week and wrote a min/max function using sleepsort() using pure C++11.
>>
>>52337706
>males
y-yeah
>>
File: Screenshot (13).png (134KB, 1920x1080px) Image search: [Google]
Screenshot (13).png
134KB, 1920x1080px
>>52338322
Didn't upload picture for some reason
>>
>>52338334
Why is your editor screaming at you?
>>
>>52335603
rolling
>>
>>52338324
post tits or GTFO
>>
>>52338342
What? It's not.
I put a breakpoint at the end because it's the easiest way to stop the program in the IDE.
>>
>>52335603
rolll
>>
>>52338008
thanks, ill take a look after ive had a serious attempt at each one.
>>
>>52338296
>not getting the joke

Autism.
>>
>>52338320
Are you fucking serious. Rerolling once more otherwise I'm just picking myself
>>
>>52338357
>>>/b/
>>
>>52338062
What's the actual filename of the resource?
>>
>>52338378
this isn't /brit/ lad
>>
>>52338324
Pls b in dondon??
>>
>>52337706
Bitch, if I had ideas I wouldn't be giving them to other people I'd be programming them myself.
>>
>>52335603
Roll
>>
>>52338324
Are you a grill? Mind if I warm my meat in you?
>>
>>52337706
learn django framework
>>
>>52335603
r0lll
>>
>>52338391
alri?!
>>
>>52335603
roll fuckos
>>
>>52338163
Unless you want to figuratively pull your fingernails out, you at least need GLEW and one of GLFW/SDL2/SFML etc.
>>
>>52338462
GLEW is deprecated and SFML is cancer incarnate.
>>
>>52338462
That's the thing, I use SDL2, but the nigger from the tutorial uses GLFW+ some obscure libraries nobody cares about.

Why not use SDL2? It does everything.
>>
>>52338438
what you doing up at this time you muggy git
>>
File: 1444519564740.png (280B, 5x8px) Image search: [Google]
1444519564740.png
280B, 5x8px
>>52338517
I'm actually one of the leaves, but for some reason I have been banned from /int/
>>
>>52338485
Hand-tuned opengl is much faster. You should use SDL to open the context and opengl to handle the actual rendering.
>>
>>52338542
>being a leaf
there's your reason

probably rubbish at programming as well
>>
>>52338587
"no"
>>
File: crying umaru.jpg (36KB, 600x337px) Image search: [Google]
crying umaru.jpg
36KB, 600x337px
Why does learning opengl have to be so hard?
Nearly every tutorial is written by idiots who cobble together dozens of libraries and have no idea what the fuck they're doing.
>>
>>52338580
That's what I'm doing.
But I also use SDL2 for pretty much everything else, like texture loading, sound, key input, etc. Because it just werks.
While everyone else seems to use separate libraries for context+key input, audio, file loading, etc.
>>
>>52338587
this

all leaves need banning imho

hope when trump's re-elected he builds a second wall
>>
>>52338665
jog on yank

could use the exercise
>>
Remember to always use strncpy() instead of strcpy()
>>
>>52335603
Just rolling on this
>>
>>52338646
it'd be really easy to import one function from one library if just that one function didn't rely on 20 other functions from 5 additional libraries......

and decoupling it all is just such a goddamn pain in the ass.
>>
>>52338689
explain
>>
>>52338651
For key input, SDL2 is fine. For audio, I don't think SDL2 has any of the cool things more heavyweight libraries offer, like full 3D sound and complex audio composition. For file loading, I don't think SDL2 is multithreaded so you might be better off with another solution. The point of SDL2 after all is to serve as a light, portable wrapper and not a full-fledged engine.
Of course, if you don't need more capabilities than what SDL2 offers, you should keep using SDL2 instead of bashing your head against meaningless walls.
>>
>>52338678
>yank
I'm British you fucking yank

You're not British, you're not American and you're not European. You never will be.

You're worthless and will never amount to anything.

Fucking leaf scum.
>>
How would I make it so the user typing the output to the file can make line breaks within it? Typing "\n" didn't work for whatever reason.

I expected it to go like this:
The user types: "Hello \n World"
The text file has:
"Hello
World"

int main()
{
cout << "Name of the text file? ";
string text_file_name;
cin >> text_file_name;
ofstream os_text_file {text_file_name + ".txt"}; //Will create the file if not there

cout << "Write stuff: ";
vector<string> contents;
for(string c; cin >> c;)
{
contents.push_back(c);
}

for(int i = 0; i < contents.size(); ++i)
{
os_text_file << contents[i] << " ";
}

return 0;
}
>>
>>52338722
strcpy fucks up
>>
>>52338722
Do you want possible overflows in your code anon?
>>
>>52338729
what kind of british are you? :3
>>
>>52337178
no
>>
File: memes.jpg (46KB, 695x431px) Image search: [Google]
memes.jpg
46KB, 695x431px
>>52338730
>typing \n didn't work
>>
>>52338749
                                                                                                                            Irish
>>
>>52338733
only if you're retarded and copy strings to a destination smaller than the source.

The language shoudn't have to baby you.
It's retarded programmers who drove gets() to extinction.
>>
>>52338749
English, obviously.
>>
>>52335603
made the 4chan image downloader, see my github :^)

https://github.com/tylcha/scripts
>>
>>52335603

I almost certainly won't do this, but roll.
>>
>>52338775
And if the user puts in a large input that is much larger than the destination?
>>
>>52338775
>It's retarded programmers who drove gets() to extinction.
Can you shut the fuck up?
>>
>>52338809
>not sanitizing your inputs
>not dynamically reallocating enough space in your destination to store your input string

Fucking python babbies want everything done for them.
>>
>>52338764
do you have a qt accent?

>>52338781
me too! I like functional programming
>>
>>52338880
No, only a gtk accent.
>>
>>52338880
anyone that stands up for Canada is not really English
>>
>>52338890
Anyone that stands up for Canada is not really human.
>>
Anyone know if it's possible to solve/estimate the value of a bunch of variables that feels like it might be solvable with algebra?

something like 31 variables with like 100+ different equalities.

Like:
1x+y+z=1
2y+z+a=5
.... etc.. etc..

Any thoughts?

This is like just a pure thought experiment for me at the moment.

Could anyone point me to something I could read? I've already googled this, but had no success.
>>
>>52338473
Glew isn't deprecated is it? What should you use instead?
>>
>>52335603
rolang
>>
#define N 8192

void
reload(char *buffer, FILE *file)
{
size_t i = fread(buffer, 1, N, file);

/* Set EOF if we have reached end of file */
if (i < N) {
buffer[i] = 0;
}
}

void
parse(const char *filename)
{
/* Open file, create buffer and set up pointers */
FILE *file = fopen(filename, "r");
char *left = malloc(N*2+2);
char *right = left + N + 1;
char *token = left, *forward = left;

/* Insert sentinal at end of buffer halves */
left[N] = right[N] = 0;

/* Initial load */
reload(left, file);

/* Parse loop */
bool done = false;
while (!done) {
switch (*forward) {
case 0: /* Hit sentinal */
if (forward == left + N) {
reload(right, file);
forward = right;
} else
if (forward == right + N) {
reload(left, file);
forward = left;
} else
done = true;
break;
default:
printf("%c", *forward);
}
++forward;
}
}


Implemented a parse buffer from chapter 3 of the dragon book. Can anyone tell me if I did it right?
>>
>>52338875
You can try sanitizing inputs all you want, but in C there's always the risk of someone putting in more characters than a character array can hold
>>
>>52338940
It's actually glu (and glut) that's deprecated, not glew.
>>
>>52338950
You incorrectly spelled "sentinel," so no.
>>
>>52338972
If this is really an issue for you, just implement a vector and store all your text in vectors.
>>
>>52338950
>sentinal
>>
>>52338939

if you have at least as many equations as variables
put them in a matrix, multiply the inverse by the results

e.g.

1x + y - z = 1
x + 2y + z = 5
4x + 6y = -5

/ 1 | 1 | -1 \ / x \ .. / 1 \
| 1 | 2 | 1 | | | .y | = | 5. |
\ 4 | 6 | 0 | / \ z / .. \ -5 /
>>
File: file.png (12KB, 476x216px) Image search: [Google]
file.png
12KB, 476x216px
Not sure if this is where to ask, but i'm pretty much a newfag to programming.

I downloaded and installed code::blocks, created a new console application with a .cpp file and made a quick hello world program.
However, whenever I run the program, it brings up the console with nothing in it. I can't input and it doesn't output anything. Even if I try to use cin to type something it doesn't let me.
Additionally, every time I run it I get another process in my task bar for the program. Whenever I try to close them it doesn't go away, even using process explorer.
After googling it I added the minGW/bin folder to PATH in the windows environment, but it didn't seem to help anything. Nothing I try to code in has any affect on the output and I can't close out the processes in task manager.

Sorry if this is the wrong place/i'm asking something retarded, i'm new to programming and I appreciate any help I can get.
>>
>>52338939
use LAPACK
>>
>>52338976
>>52338993
T-Thanks. What about the actual code?
>>
>>52339028
>I downloaded and installed code::blocks
Stopped reading here. Shill or terminal retard spotted.
>>
>>52339044
I literally googled "C++ IDE" and it came up. Any recommendations if it's no good?
>>
>>52338975
Yeah, I thought that might be what you meant. Glut is ancient, but it seems that freeGlut is still getting *some* development? Though it looks pretty dead, they actually had a 3.0 release earlier this year.
>>
File: testBlur.png (90KB, 300x300px) Image search: [Google]
testBlur.png
90KB, 300x300px
Implementing edge detection in Java.
>>
>>52339070
make a program to automatically recolour ethnic minorities
>>
>>52339014
I was considering something like this, but I've never tried to do this with like data from a database before. I'd like to get an estimate for each variable like I described, but I'm stuck at how to begin and if it's even possible.

I tried looking into using gnu octave and numpy for python to load all the stuff from a .csv and solve it with a basic linear algebra method like I feel like you described. I'm not sure how to do what I'm thinking of, it feels like it's possible.

>>52339030
Thanks for the suggestion, I'll look into it. Could you read what's in this message and tell me if it sounds feasible?


Thank you for your time and input.
>>
>>52339053
Code::Blocks is a bit shit, but it's fine as far as non VS c++ IDE's on windows go. Since you have mingw set up on your path (recommendation, the mingw project is basically dead at this point, all future development is happening in mingw-w64. mingw doesn't even have plans for 64 bit, but mingw-w64 happily supports both), you should see what happens when you try and compile from the command line, with no added weird arguments etc that code::blocks could be fucking with. Does the same thing happen if you run the built binary outside of codeblocks also? It should run without any errors as the stdc++.dll and libgcc.dll are in your path now, but be aware that if you distribute your program you will need to distribute these files.
>>
Should I get fish sticks or chicken nuggets?
>>
>>52339193
Well, unless he is a masochist learning by running a transpiler, chances are he is on Windows if he is using a version of mingw.
>>
>>52339044

It's just a beginner faggot

>>52339053

Codeblocks should work fine but config is ridiculous. I'd recommend switching to C++dev just for beginning
>>
>>52339028
Never mind, I'm retarded. If you're doing C++ on Windows just use VS, it's compiler is pretty good these days and you can't beat its IDE.
>>
>>52339220
I mean Dev-C++ it's been a while lol
>>
>>52339231
Shill confirmed.
>>
>>52339122
M = (coefficients)
V = (variables, unknown value)
R = (constants)
MV = R
V = (M^-1)R

alternatively do the smart thing and use differential evolution or particle swarm optimisation
>>
>>52339251
>smart thing
>differential evolution or particle swarm optimisation
I cringed in real life.
>>
>>52339226
I've been trying Jetbrains' new C++ ide, it uses Cmake to control the underlying structure of the project. It's promising, but it's just not there yet. Intellij has everything you could want and more for Java, but Clion is currently a bit spartan on features. But you get a nice optional gui for gdb, and it's easier than trying to setup 50 Vim plugins to get the same effect.
>>
>>52339275

say you have
5x + 3y = 3
2x - y = 6

you want to put in two values x and y, and minimise the difference between (5x + 3y, 2x-y) and (3, 6)
>>
>>52339317
LAPACK
>>
>>52339337
What if you have a 47 dimensional problem?
>>
>>52335603
roll for flappy bird
>>
>>52339251
What's the formula described? MVR? Do you think it's possible to use any of these three things for like 30 variables and 100+ equations? I feel like it should be possible to just load the csv file and spit out values with a library in like less than 15 lines of code? Does that seem naive?

I'll look into differential evolution and particle swarm, thanks.
>>
>>52335603
dfsfssdfsd
>>
>>52339375
30 variables and 30 equations
might take a while to do matrix inversion
(the rest are at best redundant and at worst make it impossible)
>>
>>52339317
Pardon my ignorance, which one are you talking about? differential evolution or particle swarm optimisation?
>>
>>52339441
Either. you're optimising the difference between your results and the expected results to get as close to 0 as possible
>>
NEW THREAD!

>>52339459
>>52339459
>>
File: file.png (97KB, 1019x762px) Image search: [Google]
file.png
97KB, 1019x762px
>>52339193
Windows 7, my bad.

>>52339123
To be honest my understanding of what exactly mingw is is lacking, It came with codeblocks.

>Compile from the command line
I'm not sure how to do that. Sorry, i'm literally just getting started in this stuff. I have a basic idea of syntax but I've never actually set up any of this before.

>>52339226
Alright, i'll switch if I can't get this stupid thing working.


I tried using Eclipse Luna as well, but i'm having problems here as well. I really wish I just came here before I got started and asked you guys what to use instead of trusting random googled webpages. Should I just uninstall everything and start over?
>>
>>52339351
LAPACK is literally designed for very large problems. If your problem was trivial, you'd just bruteforce it.
>>
>>52339462
5x + 3y = 3
2x - y = 6

as a naive example, say your predicted x is X and your predicted y is Y
5X + 3Y = A
2X - Y = B

minimise (abs(A-3) + abs(B-6)) for input X and Y
>>
>>52339464
Have you ever used GNU/Linux? mingw is Minimal GNU on Windows. Minimal GNU refers to a selection of software that is commonly used to build and compile software on GNU/Linux. mingw and mingw-w64 are ports of those software to windows. If you have your mingw bin in your path, you can compile software by opening cmd, and typing "g++ mySourceFile.cpp", and it will output an a.exe in the same folder. This is what your IDE is trying to do in the background.
>>
>>52339470
I kind of feel like my problem should be trivial, but I'm not sure how to brute force it. That is like where I'd like to start I suppose.

if you have a bunch of:
2x+2y+a+3w=5
1z+100a+2z=6
3e+2f+100f=7 ... etc. for like 30 variables and 100+ equalities...

Would that be trivial?
>>
>>52339417
Any idea how to do the matrix inversion with python or java? I tried using the numpy plugin for python to do what I described, but I got stuck and it seems harder to do than I imagined.
>>
>>52339545
You really want to use LAPACK if you have hundreds of equations, but you can also implement a naive simplex and get away with it if you have the hardware and time.
>>
>>52339545

are they all the same variables, you could do it more efficiently

if you've got

3x + 2y = 6
and
4x + 7y = 3

and
3x + 6y + 1z + 4w + 6q + 7p = 43

just solve the first two to get x and y, then you've reduced any equations that have x and y in

it's like if you've got
2x = 6
3x + 4y = 12
1x + 3y = 3
just do the first one first
>>
>>52339569
http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.linalg.inv.html#numpy.linalg.inv
>>
>>52335603
last one was way too easy. rolling
>>
>>52335603
roll
>>
Help me, I am retarded.

int x = 30;
printf("%xs", "Say hell!");
return(0);

I want printf to print how many spaces I give my x variable

instead it prints out garbage.
>>
>>52339973
http://stackoverflow.com/questions/14678948/how-to-repeat-a-char-using-printf
>>
>>52340006
>"%*s", x
that worked
thanks fucker
>>
>>52339214
chicken nuggets
>>
File: 1330245049907.png (5KB, 493x402px) Image search: [Google]
1330245049907.png
5KB, 493x402px
>>52335496
Do you do printf-oriented programming, brah?

https://media.ccc.de/v/32c3-7163-new_memory_corruption_attacks_why_can_t_we_have_nice_things#video&t=2752
>>
last
Thread posts: 339
Thread images: 34


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