[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
/dpt/ - Daily Programming Thread
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

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

Thread replies: 341
Thread images: 23
verbosefags not allowed edition
>>
>>52353941
kill yourself

so you wrote "fizzbuzz of the christ" what an accomplishment
>>
>>52353965
no need to be blasphemous anon
>>
>Posted before the bump limit
>Not link to old thread
>Meme snake
Delete this thread and kill yourself
>>
print("\n".join(["fizzbuzz" if x%15==0 else "fizz" if x%3==0 else "buzz" if x%5==0 else str(x) for x in range(1,101)]))


I-is this to verbose senpai?
>>
Nothing atm.

Can't think of anything to make.
>>
>>52353941
are we seriously arguing about fizzbuzz jesus christ
>>
Python is bad and you should FEEL bad!
>>
>>52353981
yes
>>
>>52353981
>he posted it twice
>he's trying to get praise for a fizzbuzz on /g/ instead of doing something useful

time to rethink your life
>>
>>52353991
they're saying >>52352868 is """"""""verbose"""""""" compared to other fizzbuzz implementations
>>
Beginners post fizzbuzz (or if you still have a fizzbuzz from when you started out, post that)

        private async void btnRun_Click(object sender, RoutedEventArgs e)
{
for (int i = 1; i <= 100; i++)
{
string Output;
if (i % 15 == 0) { Output = "FizzBuzz"; }
else if (i % 3 == 0) { Output = "Fizz"; }
else if (i % 5 == 0) { Output = "Buzz"; }
else { Output = i.ToString(); }
lstOutput.Items.Add(Output);
lstOutput.SelectedIndex = i - 1;
lstOutput.ScrollIntoView(lstOutput.SelectedItem);
await Task.Delay(500);
}
}


>Even if I could one line it, I wouldn't.
>>
>>52354005
Th-thank y-you very much mi-mister
>>
>>52353434
Anyone?
>>
>>52353899
Posted this in the last thread, but does anyone have experience preprocessing csv's and parsing text with VBScript? Would it be as horrible as it sounds?
>>
One liners are shit if you intend your code to be read (and maintained by others). If it's a "make the most conciest code which makes X" type of challenge it's ok, but elsewhere... it's stupid.
>>
>>52354022
it's very fucking verbose
>>
>>52354022
It does look like it. You could probably either:
1: slice it and choose i if the slice is empty or
2: check if the number isn't 0 when doing mod 3 or 5 then print i, otherwise print the sliced version

No need to do all those checks
>>
>>52354065
>not sharing your cheeky one-liners
do you hate fun?
>>
>>52354069
it's very fucking standard and the others aren't better in any way except for using fewer bytes of source code
>>52354072
>slice
kill yourself
>>
When will hasklel finally have a non-shit AD or SD library?
>>
>>52354065
this

>>52354085
doesn't mean normal solutions are shit
>>
₣ÏŽŽßŪŽŽ
>>
>>52354086
>kill yourself
It's the verb term used for substrings. Do you have a preferred verb for it? If so, imagine I posted that
>>
Reminder that OCaml is the GOAT language and nothing you say or do can change that.
>>
>>52354055
https://docs.python.org/2/library/csv.html

>>52354085
I'm talking about projects shared in github or made at work, mostly. Don't expect most to understand one-liners.

I'm okay if it's fun but don't expect everybody to understand what it does.
>>
>>52354096
It might help if you didn't use meaningless acronyms.
>>
>>52354065

[|1..100|] |> Array.map function
| MultipleOf 15 -> "FizzBuzz"
| MultipleOf 5 -> "Buzz"
| MultipleOf 3 -> "Fizz"
| x -> string x
|> System.Console.WriteLine
>>
>>52354119
Implying OCaml is not just a stupid and useless C wrapper.
>>
>not just importing fizzbuzz
>>
>>52353990
>File Deleted
Ha, I thought it was a bit too lewd.

She was in a bikini though.
>>
>>52354108
>doesn't mean normal solutions are shit
nobody is making that claim

>>52354120
>don't expect everybody to understand what it does
none of the one-liners we've ever posted were ever complex
>>
>>52354122
looks literally retarded
>>
>>52354122
oops
|> Array.iter System.Console.WriteLine
>>
>>52354065
>One liners are shit if you intend your code to be read (and maintained by others)

>I'm serious ENTERPRISE programmer
>readability and maintainability is everything
>especially on scripts that are fucking on line
>>
>>52354122
>System.Console.Write
who comes up with these names?
>>
>>52354143
>I'm used to code that makes me throw everything away to slightly change functionality

>>52354159
(printfn "%A") is an alternative
>>
>>52354133
I laughed!
>>
>>52354159
well you are accessing the console from the system and then writing to it
>>
File: 1278813155815.jpg (3 KB, 126x126) Image search: [iqdb] [SauceNao] [Google]
1278813155815.jpg
3 KB, 126x126
>doing a c programming course
>exam in 2 days
>have to understand memory pointing/pointers
>I literally cant grasp the concept
>tried bashing my head to various tutorials
>exam creeping up
>feeling literally retarded
Am I too stupid to live? Should I end it?

Can anyone help? (I dont blame you if you just tell me off and tell me to kill myself instead)
>>
>>52354121
If you weren't retarded, you'd know it stands for automatic and symbolic differentiation and that there's even a (very shitty) hasklel library named simply "ad".
>>
>>52354120
>https://docs.python.org/2/library/csv.html
I know how to do it in python, but the computer's at my office don't have the runtime installed and I don't know if I can convince IT to let me install it on my computer. I want to know if it can be done in VBScript relatively easily so I wouldn't have to install anything.
>>
>>52354142
I'm not talking about this thread, get some reading comprehension.

>>52354151
When you program for/with others, expect people to know better or worse than you. Don't go full leet or full noob, take a middle ground.
>>
>>52354193
http://www.dummies.com/how-to/content/basics-of-pointers-in-c-programming.html

>Memorize this sentence: A pointer is a variable that contains a memory location.
>>
>>52354118
you shouldn't need to use substrings for fucking fizzbuzz. do you have any idea how slow that is vs using string literals? fucking pisskid
>>
>>52354193
Every place in memory has an address

A pointer simply stores that address
>>
>>52354206
>When you program for/with others
Because you need 10 Pajeets to write one line of code?
>>
>>52354225
I havent tried this

I will read it and try to fist my brain with the concept.

>Memorize this sentence: A pointer is a variable that contains a memory location
I know this much, I just fail to grasp the application of it.
>>
>>52353774
>Parentheses, just like any other similar form (f g x -> f (g x))
which is literally the same thing as braces would be
>let fn (x:Int32) (y:Int32) : Int32 = Int32.add x y
that's not the same thing. i could do
let fn : Int32 -> Int32 -> Int32 = Int32.add

just as easily (or even use fun -> there to name the arguments). that makes the line longer and doesn't work as well for any type system slightly more complex than OCaml's (i.e. for dependent typing, where would implicit arguments go?)
btw i'm not trying to hate on OCaml here, I'm just saying that the ML syntax is very specific to the semantics of MLs and doesn't carry over well to other types of languages
>>52354133
lol okay kid
>>
>>52354228
>slow
>fizzbuzz
tippity toppity kek
>>
>>52354172
>>I'm used to code that makes me throw everything away to slightly change functionality
what the hell does that even mean? are you saying it's impossible to write reusable code in other languages?
>>
>>52354181
1 point for me.
>>
Can you even write FizzBuzz in one line in Java?
>>
>>52354245
No, if you're tasked to write some function(s) and Pajeet is expected to write functionality that uses those function(s) he should understand without the need you explaining a one-liner because it's "concise and looks better".
>>
>>52354271
He's a baby duck F# fag.
>>
>>52354193
A pointer literally is a variable containing an address to a location in memory. The type of a pointer indicates which data type is being stored at the location in the pointer.
>>
for(int i=1;i<101;++i)
cout<<(i%15?i%5?i%3?to_string(i):"fizz":"buzz":"fizzbuzz")<<endl;


see, i can play this game too. doesn't mean that it's sensible to program in this way.
>>
>>52354271
I'm saying that what you call stupid is significantly more reusable than other styles

>>52354289
>F# is shit
ok
>>
>>52354193
http://duramecho.com/ComputerInformation/WhyCPointers.html

thank me later.
>>
>>52354315
Why don't you use OCaml proper? You'll certainly like it more if you like F#.
>>
>>52354251
>that makes the line longer
Then put it in an interface instead.
>doesn't work as well for any type system slightly more complex than OCaml's
Bullshit.
>for dependent typing, where would implicit arguments go?
After the type, obviously.
>>
>>52354309
the difference is in some languages you can make it shorter, neater and easier to read
>>
>>52354250
>I just fail to grasp the application of it.
Let's say you have 10 people standing in a circle. One of them is "it". With whoever is "it", they lose $1 and has to choose another person to be "it". That's like how pointers work, you don't always know what you're pointing at, but you can do things to variables and objects that you find yourself pointing at.

In a game (let's ignore design patterns for now), I might want to move to the nearest enemy. Once I find it, I want to have a pointer variable that can reference that enemy for moving to. This can change any frame
>>
>>52354151
some people work on things other than writing python scripts to brag about online
>>
>>52354193
pointer points to a variable just like an address points to your house
>>
>>52354329
There isn't a good enough IDE
>>
>>52354355
and some people work in agile environments or challenging environments where such things are useful
>>
>>52354340
just because it's shorter doesn't mean it's neater. a kiddy book is short but most adults have no use for reading kiddy books.
>>
Threadly reminder that you should not refer to the act of programming as coding. It is improper and makes you look like a 16 year old

You are a programmer, not a coder

Software Alchemist is GOAT
Developer is okay
Magician is okay
Software Magus is okay
Software Engineer is okay
Software Architect is okay
Code Guru is okay


Archmage is reserved for only the most senior of programmers

Writing in HTML and CSS is not programming, therefore it should be referred to as designing
>>
>>52354365
is it possible to destroy that pointer pointing to my house so I can't be traced?
>>
>>52354373
literally fuck off to >>>/g/wdg
>>
>>52354368
>this M$ VS baby trying to lecture people on what good languages are
>>
>>52354251
Actually, it would work fine for dependent types with implicit arguments.
let id {a : Type} (x : a) : a = x

I vastly prefer Haskell syntax, though, which most importantly lets you declare something's type before defining it, and I like the whitespace/brace+semicolon compromise.
>>
>>52354386
using python == coding
>>
>>52354386
Wizard > Software Alchemist
>>
>>52354402
lmao get a job pal
>>
>>52354394
No, not since C99.
>>
>>52354394
enjoy your memory leak lmao
>>
>>52354394
yeah just bore a hole into your RAM at the exact location where that pointer is
>>
>>52354427
you'll be obsolete within a decade webcuck
>>
>>52354379
Good thing I didn't say that, I said it could be all three at once

>>52354405
What's your fucking problem?
>>
>>52354420
module type S = sig
val id : a -> a
end
module M : S = struct
let id x = x
end

It can be declared in advance like this. Even better, it can be split between a .mli (interface file) or .ml (implementation file). This is useful in particular to have documentation separate from the implementation, so that you have 500 lines of implementation, and a separate 500 lines of interfaces and comments, making browsing either much easier.

It's still true that the inline syntax for haskell is better though.
>>
>>52354425
Computer Magus > Wizard.
>>
>>52354394
if you move your house you'll get a dangling pointer

delete the pointer and you're leaking memory
>>
I don't know why I'm programming in racket or reading sicp anymore, think I should just go back to haskell
>>
>>52354525
Arch-Linux > Arch-mage
>>
>>52354535
I call it the 'engine' because it's not strictly related to the application on top of it and provides the functionality I'd need for multiple things(game things, but not necessarily)
framework maybe would've been a better name but who cares really
>>
>>52354489
writing off a language because "There isn't a good enough IDE" is pretty loathsome, m8
>>
>>52354331
>Then put it in an interface instead.
that's both inefficient for the programmer and the compiler to go back and check the other file to find something that can't be inferred.
>Bullshit.
even once you start dealing with relatively simple things like type classes it becomes a pain in the ass having to balance putting the type annotation either in a different file or stuffing the information into a single line along with the rest of the function and its arguments, etc. interface files are okay for some things but there's a reason why Haskell lets you do it right above the definition
>After the type, obviously
wat
how could you put it after the type if the type that comes before it depends on the value of the implicit argument?
>>52354368
Emacs + Merlin
>>52354420
yeah but what i mean is the line becomes crowded as fuck once you start putting the type annotations as part of the declaration like that. eventually you'll end up with shit like
let map {a : Type} {b : Type} {t : Type -> Type} (f : a -> b) (x : a t) : b t = function
(* ... *)

and that's already above 80 chars.
>>52354502
for dependent typing the type annotations are not just for documentation, but mainly because some type inference is literally undecidable without them. splitting up between files would be a huge pain in the ass and would slow down the compiler a lot because of the extra IO operations etc. putting the module type right above is _okay_ but it still doesn't put things in the place that takes the least thinking to write. it's not a bad idea to have both, even, because i will admit interface files are awesome for documentation. it's just not optimal for when you actually have to write out the code yourself
>>
>>52354616
>yeah but what i mean is the line becomes crowded as fuck once you start putting the type annotations as part of the declaration like that.
Fair enough.
>>
In C, it is possible to know when a variable goes out of scope?
>>
any good guides to callback-oriented programming
>>
>>52354647
Here -> }
>>
File: sls44.png (2 KB, 355x58) Image search: [iqdb] [SauceNao] [Google]
sls44.png
2 KB, 355x58
>>52353842
this program gets the numbers of the timeline parallel to ours that has already done the next lottery. the chance of it being the numbers of our lottery isn't that high due to diversion but you should have a higher chance of winning if you play these numbers than random ones. ur welcome : O )
>>
>>52354608
>writing off
Did I say it wasn't a good fucking language?
No, I said that's the reason I don't try it
>>
Is UML just some gay shit IS/business majors like?
>>
>>52354405
Is Visual Studio even good for F#? I tried playing around with it before but the F# repl seemed like shit.
>>
>>52354699
It's really good for F#
Make sure you're using the REPL properly
>>
BeOS master race
>>
>>52354690
I don't know anyone who actually uses them.
>>
>>52354690
never used at either of the two companies I've worked at

I really like the idea of it but it's too inconvenient imo
>>
>>52354690
>gay shit IS
h-hey

dont shit on my feelings ;-;
>>
>>52354690
Good for some documentation, IMO. Pain in the ass to make.
>>
>>52354714
Breast expansion OS? Sounds hot
>>
>>52354661
I meant inside the program. That is, write a program that can tell if a variable is in scope or not.
>>
>>52354690
My c++ professor pushed it often. I think it's just a business cuck language
>>
>>52354677
Woah haha I didn't know C++ could get data from other timelines... thanks friend! =l:^)-I--<
>>
>>52354760
No. For what purpose?
>>
>>52354690
considering how cluster-fucked my company's software is, I'd say it has its uses, conceptually at least
>>
>>52354773
Writing a pointer wrapper who free itself when it goes out of scope.
>>
package main

import "fmt"

func main() {
for i := 1; i < 101; i++ {
if i%3 == 0 {
fmt.Print("Fizz")
}
if i%5 == 0 {
fmt.Print("Buzz")
}
if i%3 != 0 && i%5 != 0 {
fmt.Print(i)
}
fmt.Print("\n")
}
}


Did I do good /g/?
>>
>>52354794
Use C++.
>>
File: 1451751832808.png (17 KB, 418x359) Image search: [iqdb] [SauceNao] [Google]
1451751832808.png
17 KB, 418x359
>>52354800
>C++
Looks like we got us some new guys chaps
>>
>>52354799
No.
>>
>>52354799
We'll call you :^)
>>
I'm fairly new to C, give me something semi-easy to write.
>>
>>52354854
Fizzbuzz :^)
>>
>>52354854
Chip-8 interpreter/emulator
>>
>>52354854
transliterate english into canadian aboriginal syllabics
>>
File: 1452438717574.jpg (475 KB, 1920x1080) Image search: [iqdb] [SauceNao] [Google]
1452438717574.jpg
475 KB, 1920x1080
>>52354854
knock yourself out
>>
>>52354867
>35 opcodes
sounds more interesting than the 21 opcode python vm I wrote before. I'll try it
>>
>>52354854
cmd line irc client
>>
>>52354854
convert between roman and arabic numerals
print out all the primes to 100,000,000 in under a minute
>>
>>52354690
it's very very gay

the idea of it is okay, like a flow chart so you can communicate a program's design with others. but no, just no.
>>
>>52354938
>the idea of it is okay
not even, because it focuses on planning dumb shit like inheritance over the program's actual logic that's a lot harder to design and more likely to have bugs
>>
>>52354910
it's not about size it's about how you use it
r-right guys
>>
I'm trying to keep track of the number of each possible combination of 2 letters in a given file.
>test sentence
E.G te, es, st, se, en, nt, te, en, nc, ce
So 'te' and 'se' appears twice but everything else only once.

I have a 2d array of size [26,26] and two variable holding the current number and the temporary number, but for some reason when I print the array at the end it is totaling the numbers in a row instead of displaying them individually, so every item in the row displays the total for that row.

These are the two bits of related code:
for (i=65; i<91; i++)
{
for (j=65; j<91; j++)
{
if ((temp == i || temp == (i+32)) && (prev == j || prev ==(j+32)))
{
bigrams[i-64,j-64]++;
}
}
}

and
 printf("     a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p   q   r   s   t   u   v   w   x   y   z\n");
for (i = 1; i < 27; i++)
{
printf("%c ", (i+96));
for (j=1; j<27; j++)
{
printf(" ");
if (bigrams[j,i] < 100)
{
printf(" ");
if (bigrams[j,i] < 10)
{
printf(" ");
}
}
printf("%d", bigrams[j,i]);
}
printf("\n");
}
>>
>>52354867
he said easy, not 9 levels of hell.
>>
>>52354982
Chip-8 is a pretty simple emulation project m8, it's nowhere near as complicated as shit like the Z80 or 6502 that people write big emulators for
>>
File: 1451621766585.png (285 KB, 800x655) Image search: [iqdb] [SauceNao] [Google]
1451621766585.png
285 KB, 800x655
What's the difference between local storage and cookies?
>>
>>52354193
int main() {
// Initialize the pointer variable
char* ptr;

// INSERT BREAKPOINT
// enter the command "p ptr"
// output should be xx00, or the null address
// this is because you initialized the pointer,
// but not set it to anything
// Typing the command "p *ptr", or the value
// at the address the ptr is set to will give
// an error, because that value doesn't
// exist

ptr = malloc(8 * sizeof(char))

// INSERT BREAKPOINT
// The pointer is now set to a reserved piece
// of memory that 8 segments long, each
// segment being the size of one char
// If you type "p ptr" now, you won't see a
// null address, but if "p *ptr" does print,
// the value will be nonsensical because
// it will just be what was residing at the
// address before the program started

strcpy(ptr, "pointer");

// INSERT BREAKPOINT
// Don't worry about strcpy, it just copies the
// second arg to the memory that the first
// is pointing to
// Now, when you type "p ptr" you'll get an
// address, and when you type "p *ptr",
// the char 'p' comes up because the
// address has finally been set by you.
// Do the same thing with "p p+1", "p *(p+1)",
// "p p+2", "p *(p+2)", etc. and you will see
// each character of the string "pointer" in
// sequence.

free(ptr)
// Just "unreserves" the memory. If you
// want, set a breakpoint here and print out
// the same pointer values and you will
// see they haven't changed. They can
// just be overwritten by other malloc calls
// now
return 0;
}


See if this helps, I know I couldn't grasp it until I learned a little bit of gdb and actually saw what was going on with the pointers.
>>
>watching this guy work
>no where near that skill
>5 years of experience
>fucking kill me

https://www.youtube.com/watch?v=rpLoS7B6T94

I know it's sped up
>>
>>52355102
>Shalom
I'm suspicious of him already.
>>
>>52355102
You can't teach yourself autism.
>>
>>52355102
>Bisqwit
This guy is so weird, all his videos where he's actually in them, they look and sound like they're from the 80s.
Also, he's what, a finjew?
>>
>>52355102
Everything about his programming environment makes me want to throw up
>>
>>52355159
throw up dank code
>>
You seen that hackernews post on "How to C in 2016"? Did you like it?
>>
>>52355102
it's okay m8 he's autistic
>>
>>52355130
>>52355159
He has some really cool videos, but the weird it turned up to max.
>>
>>52355102
fucking love bisqwit
>>
>>52355102
In the video, he says the project took him two weeks, with around 3 days of design. He doesnt just sit down and start typing.
>>
>CHIP-8
>hard
literally just 35 opcodes
>>
>>52355193
>portal 2 lets player
into the trash
>>
What's the last language/tehnology you've tried /g?
>>
>>52355302
haskell. Wasn't too bad.
>>
>>52355302
Racket. I like programming in functional style, but I was doing this alongside SICP and the shit in there is hard.
>>
>>52355049
Local storage is a JS API that allows for significantly more space and sophistication in how you store your data. It's entirely client side.

Cookies are associated with HTTP and, while they can be modified by JS, were originally meant for the server to set on the client (without JS) through HTTP headers.

Cookies are a pain to use in general compared to local storage. (when you have the choice of either)
>>
I'm a scrub starting out. What is a reasonable time frame to learn the basics of java?
>>
>>52355102
>>watching this guy work
>>no where near that skill
>>5 years of experience
>>fucking kill me
He doesn't even program for a living.
>>
>http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/
This is pretty tight. Who else is up for emulator programming?
>>
>>52355324

But, not everyone browser uses local storage, and it's fucked if your client has JavaScript switched off (which is unlikely).
>>
>>52355321

So Racket is essentially a LISP dialect?
>>
>>52355302
don't like trying new meme languages tbqh

rather spend that time improving the language I do know
>>
>>52355349
:(
>>
>>52355401

That's not an answer.
And you could have just told us about the new techniques you've had to learn in Java.

Which is obviously your jam.
>>
>>52355390
The way I understand it, SICP uses Scheme, a dialect of LISP, and Racket is closer to that Sceme than the later Schemes are
>>
>>52355353
stepping it up
http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf
>>
How can I learn game development with SFML and C++? And I don't mean learning SFML's api, I mean learning how to do game architecture and shit like that.
>>
>>52355102
5 years experience for you, or him?
>>
>>52355455
Read Game Programming Patterns by Robert Nystrom. Personally the SICP of game dev for me
>>
>>52355424
really don't like this hate on Java meme

not saying I'm not a poo-in-loo just that java is a decent enough language
>>
File: 1449016502839.jpg (38 KB, 450x267) Image search: [iqdb] [SauceNao] [Google]
1449016502839.jpg
38 KB, 450x267
>>52355324
thank you anon
>>
>>52355435
Racket is based off of scheme, and I think the scheme guys are working on it now, but you have to use some special subset of the language to follow sicp with it or else it won't work
>>
File: 1438972291006.jpg (342 KB, 536x640) Image search: [iqdb] [SauceNao] [Google]
1438972291006.jpg
342 KB, 536x640
This fucking guy
https://www.youtube.com/watch?v=HQYsFshbkYw
>>
>>52355480
He's right though, he asked a simple question, you gave a pansy answer like a woman

Now then:
DESIGNATED
>>
>>52355493
meanwhile you are arguing about fizzbuzz
>>
>>52355572
>not enjoying a cheeky fizzbuzz in between wanks
>>
>>52355480

Absolutely nothing wrong with Java.
It's just the culture and community.

And it's spreading...

Fast.

Just look at the start of JavaScript.
There's a new MVC library every 4 days now.
Each one has a corresponding website selling branded clothing.

It's fucking stupid.
>>
>>52355577
>not wanking and writing your fizzbizz concurrently
you some kind of bender, boy?
>>
>>52355493
john madden?
>>
I don't understand why anyone in their right mind would use Java outside of being forced to for school/work.
>>
yeah, there's always new frameworks appearing but in Java at least they tend to stick around for while. Learn spring, javaEE and hibernate and you'll be fine.

With javascript the situation is a lot less tenable.
>>
>>52355639
Java 8 is pretty slick.
>>
Is GTK hard to learn?
>>
>>52355455
Skimming a bit through that book made me realize that I should probably brush up on design patterns before I try applying them to game dev.

Any books you can recommend senpai?
>>
File: 1451754656606.png (17 KB, 418x359) Image search: [iqdb] [SauceNao] [Google]
1451754656606.png
17 KB, 418x359
>mfw beating the gf cause her fizzbuzz implementation was longer than mine
>>
>>52355670
read
>>52355476
>>
>>52355650
What did they add besides lambdas?
>>
>>52355493
the way he makes it looks so fluid without planning triggers me hard
>>
>>52355676
Is that pic an illustration of what she looked like after you finished beating her?
>>
>>52355455
>SFML
KEKEK
>>
>>52355688
Optional and Streams
>>
>>52355723
>java is actually improving
WOW! In 2 decades it might even be good!
>>
File: 1451779320598.png (20 KB, 418x359) Image search: [iqdb] [SauceNao] [Google]
1451779320598.png
20 KB, 418x359
>>52355713
>"mfw" standing for anything else
>>
>>52355730
Java is good now.
>>
>>52355746
nice try sandeep
>>
>>52355730
>C# is good (despite being incredibly "inspired" by java)
>python is good
>haskell is good
>java is unbelievably bad
epic meme
>>
>>52355302
Julia. I used some MATLAB and python before and saw that it's an alternative which can replace them. It's pretty new (0.4 version when I started, like October last year) and powerful programming language.
>>
>>52355762
but anon
3/4 of those are correct
>>
>>52355747
it has a lot of advantages
But i agree Python is the future
>>
>>52355723
That's it? So they just copied LINQ from C# and Maybe from F#?

Reading about Optionals, they seem strange. Kinda seems like a slightly more explicit way of saying "this might be null", even though every reference type in Java can be null.
>>
>>52355762
this
>>52355783
>>
File: uui9.png (481 KB, 626x988) Image search: [iqdb] [SauceNao] [Google]
uui9.png
481 KB, 626x988
>>52355324
It was easier to use than I thought it would be.

function downloadImages(folder){
forEach("div.thread a.fileThumb", function(elem, index) {
var url = "https:" + elem.getAttribute("href");
var downloaded = localStorage.downloaded;

var type = url.split(".");
type = type[type.length - 1];

if(downloaded === undefined) {
localStorage.setItem("downloaded", "");
downloaded = localStorage.downloaded;
}

if(types[type] && downloaded.indexOf(url) === -1) {
chrome.runtime.sendMessage({
url: url,
folder: folder
});

localStorage.downloaded += url;
}
});
}


How long does this storage last and what's the max limit? Does it auto delete when it reaches the max limit?
>>
>>52355790
If it wasn't so slow python would be the shit
>>
>>52355808
Optionals are much more useful when you have a language without null pointers, because they put the responsibility of handling null on the user with the type system and are very composable. If you can type a function such that it cannot be passed a null pointer, you don't need to do a wasteful null pointer check defensively (which is standard in Java).
>>
>>52355847
>Optionals are much more useful when you have a language without null pointers
oh, I completely agree. Optionals are based. But feel a bit weird in Java.
>>
>>52355762
C# is java without all the massive fuckups
>>
>>52355808
>So they just copied LINQ from C# and Maybe from F#?
LINQ is like the only valid excuse Csharts has for why C# would be better than java
>>
>>52355885
>A completely new language.
>>
>>52355935
How about working generics?
Or properties?
Or easy native interop?
Or unsigned integers?
Or struts?
Or pointers?
>>
>>52355493
>fewer than 600 lines of manually typed code
damn son
http://bisqwit.iki.fi/jutut/kuvat/programming_examples/portalrendering/prender.c
>>
>>52355972
>b-but you don't need any of that
>r-right tool for the right job!
>>
>>52355972
my boss sanjay doesnt care about any of that stuff xd
>>
>>52355321
any questions on racket? it's a little easier to learn if you use their docs / tutorials instead of SICP
>>
#include <string>
#include <functional>
int main(int argc, char** argv) {
std::function<int (int)> d=[&](int i){
#define a(b,c) !(i%b)?c:
return i?d(i-1)&&puts(a(15,"FizzBuzz")a(3,"Fizz")a(5,"Buzz")std::to_string(i).c_str()):1;
};
d(100);
return 0;
}


Still readabler than lisp
>>
>>52354811
>C++ literally has very easy to use first-class constructs for when a variable goes out of scope
>makes reference counted/unique pointer wrappers VERY trivial to implement
>they're actually part of the std lib, you don't have to reimplement everything yourself in C++!
Why use C when you want C++ features?
Oh yeah, because you're autistic
>>
>>52355936
I never said that, but it's way better than java
>>
>>52355353
An emulator's going to be my next project, man

It's going to be awesome
>>
>>52356018
None tbqh. It's simple to use, but sicp itself is a real beast to work with.
>>
File: 124.png (819 KB, 1600x900) Image search: [iqdb] [SauceNao] [Google]
124.png
819 KB, 1600x900
>>52355102
nice
>>
>>52355840
what do you expect from an interpreter?
>>
>>52355840
>dynamic typing
>not shit
oh anon ; 33
>>
>>52356045
Same. Not sure if I want to do it in C++ or Java. I've been doing vms in python, but I need to go back to something bigger and scalable, as python's class system is quite lacking
>>
>>52356028
>readabler
Good English, fucktard.
>>
>>52356055
I think Neil has a racket package that implements all the stuff that's different / missing between MIT Scheme and Racket.
But yeah SICP is a bit of a brain bender
>>
File: DESIGNATED.jpg (90 KB, 983x455) Image search: [iqdb] [SauceNao] [Google]
DESIGNATED.jpg
90 KB, 983x455
>>
>>52356035
>tfw he doesn't get your joke
>>
File: file.png (32 KB, 659x435) Image search: [iqdb] [SauceNao] [Google]
file.png
32 KB, 659x435
Sorry, I still haven't managed to figure out what's wrong.


#include <iostream>
using namespace std;

int main(){
int x = 0;
while(x != 1){
cout << "Enter 1 to end" << endl;
cin >> x;
}
return 0;
}


When I compiled and executed this I get pic related. Top part is the console that comes up and the bottom part is from my processes in task manager. They're apparently being used by SYSTEM and I can't close them out.. Compiling from the command prompt doesn't give me the console but it does add another test.exe to the task manager.

What did I fuck up? Anyone have any clue what's wrong? Sorry for being retarded in advance.
>>
>>52355972
>unsigned integers
>structs
>pointers
completely unnecessary in a high-level language

>native interop
JNI is fine if you know how to use it

>properties
haven't even heard of it
>>
What have you been listening to while programming? https://www.youtube.com/watch?v=rprf7LEraU4
>>
>>52356117
You enter the character 1 (which doesn't evaluate to the number 1). Try while(x != '1') instead.
>>
>>52356137
Sorry, the problem is the console isn't accepting any input. It's also not displaying the "Enter 1 to end". Compiling it from cmd doesn't even give me the console window.
>>
File: 1447090709173.jpg (76 KB, 414x340) Image search: [iqdb] [SauceNao] [Google]
1447090709173.jpg
76 KB, 414x340
>>52356124
>>
>>52354193

Think of an array. The purpose of an array is to store an indeterminate amount of data. To access a specific element in that array, you use an integer, called an "index". Strings are one type of array, used for storing textual data. If one is using 8 bit ASCII, it is easy to see that the nth character of the string would be the string as an array subscripted by an index of n-1.

Memory, is basically a giant array of bytes, containing all of the data you store. If one is using physical addresssing, one might imagine that the range of indexes would go from 0 to 4 billion (or 8 billion or 16 billion; I don't know how much memory you've got on your box). Mind you, your applications are most certainly not using physical addressing (you're using what's called virtual addressing, so those memory addresses in your application are being translated by hardware into physical addresses), but nonetheless, a pointer is ultimately just an index into a huge fucking array.

What do we use this for? Well, pretty much everything. Say I want to make a function that operates on a string. Maybe I want to take "Hello World" and reverse it. What arguments should that function have? Well, at bare minimum, we're going to want a pointer. After all, how is the function supposed to know where to look for your string? You might also want to pass in another argument to tell the function how big the string is. Why? Well, unless you're using a special character to tell it "this is where the string ends" (a number of C functions do this), then your function might not know when to stop reading/writing characters, and just access successive indexes into that big blob of memory until it hits an invalid memory address).

That's the simplest use. Pointers are also helpful when one needs indirection, such as in a linked list/tree/graph. Ultimately, you use pointers when you need to operate on a block of data, so you can tell your function "this is where the data is".
>>
>>52356124
>this post
jesus christ lads
>>
>>52356074
That's awesome, anon.

For me, I'm going to do it in C++. I'm going to try to do dynamic translation, which means it'll actually get translated to the native language on-the-fly.

I'm opinionated, but if I were you, I would go with C++, since it gives you a lot of freedom to design it however you want (good for personal projects, sometimes bad for teams, imo).
>>
>>52356124
>completely unnecessary in a high-level language
hahhahhahha. I love talking to Javafags.

>JNI is fine if you know how to use it
it's at least 10x more time consuming to use than pinvoke in C#, with no benefits.

>haven't even heard of it
To be expected of the typical Java programer.

Never change anon. You are the standard for all good programmers to strive against.
>>
>>52356124
>haven't even heard of it
It makes "get"/"set" functions transparent, callable just by using normal access/assignment syntax.
// Java:
class Fuck {
public int getFoo () { return 3; }
public void setFoo (int value) { }
}
...
fuck.setFoo(fuck.getFoo() + 1);

// C#
class Fuck {
public int Foo {
get { return 3; }
set { }
}
}
...
fuck.Foo += 1;
>>
>>52356131
http://www.di.fm/darkdnb
>>
>>52356155
>The purpose of an array is to store an indeterminate amount of data.

You literally can't resize an array.
>>
>>52356124
>completely unnecessary in a high-level language
Why do Javafags willingly limit themselves
>>
>>52356152
>>52356159
>>52356163
please dont bully. post code instead.
>>
thanks for the (You)s butthurt Csharts
>>
>>52356160
>to the native language
You mean CHIP-8's language?

I was leaning to C++ anyway, so I guess that's what it'll be in. Cheers m8, and have fun
>>
>>52356190
np bby
>>
>C#/F# have their own weird language like sql
damn
these languages have everything
they make php seem like a nothing language
>>
>>52356183
then just use C++ instead of limiting yourself with C#
>>
>>52356200
php has been phasing out for a while
>>
>>52356205
>C# isn't better than Java because C++ is better than C#
>>
>>52356200
F# is the shit
You can create your own embedded language like query

It's effectively a library feature and not a language feature
>>
>>52356200
is this Haskell?
>>
>>52356205
I use D though
>>
>>52356124
>completely unnecessary in a high-level language
I might agree about the unsigned integers, but pass-by-value structs are incredibly important due to both performance and for semantics. We aren't at a point where memory is fast enough to heap allocate everything like Java does

>>52356215
They occupy a different niche

>>52356227
Read the post? It's F#, similar to Haskell but less "pure"
>>
>>52356227
it F# baby
>>
>>52356196
Dynamic binary translation is where you translate from the architecture you're emulating to the architecture you're running on on-the-fly. So in my case, if I were writing a DCPU-16 emulator, my C++ code would translate the instructions to equivalent x86 and then run that.

If the program can/does modify its own code in memory, then it gets tricky.
>>
File: Cover.jpg (884 KB, 2400x2400) Image search: [iqdb] [SauceNao] [Google]
Cover.jpg
884 KB, 2400x2400
>>52356131

>>52356169
You're pretty good
>>
>>52356215
even if you think C# is better than java you should at least admit that they are somewhat similar. "C# is incredibly good while java is horrible" is a stupid meme or something that only a peabrain like a murrifat can believe since murrifats only think in extremes with no sensible middle ground.
>>
>>52356249
Isn't that just another word for JIT compilation?

Dealing with self modifying code wouldn't be that big of a deal. Just translate it in chunks, and if a chunk gets mutated or if you jump inside a chunk rather than to the beginning, either switch back into interpreted mode or re-compile it.
>>
>>52356270
>C# is incredibly good while java is horrible
Nobody said that.
>>
In which ways is D better than C++?
>>
>>52356200
F# is tits. Don Syme confirmed for king of /dpt/
>>
>>52356284
it has been said in previous threads, both implicitly and explicitly
>>
>>52354605
However, Sorcerer Linux > Arch
>>
My only complaint about F# is the syntax. I don't like that commas are only used for tuples


let add x y = x + y

just looks weird.
>>
>>52356124

>structs
>unnecessary

Okay Anon, think about things like this... I want to have a data type that concerns a lot of related data of different types. Like a class... except I also want to guarantee with 100% certainty that it will be on the stack... and if it's in a container, I want the data to be contiguous, rather than accessed through indirection. If A is a structure containing a 64 bit integer and a 64 bit float, I want a vector of it to be laid out in memory like this:

(i64 f64) (i64 f64) (i64 f64) ...

And not like this:

(ptr to A) (ptr to A) (ptr to A) ...

A C# programmer can do this, a Java programmer cannot. A C++ programmer or a Rust programmer will laugh at both because they can do these easily without C#'s inability to actually mutate those structs. Ultimately though, while C#'s structs are immutable, at least they allow for writing cache efficient code. The Java programmer lacks such options.

>>52356181

No, but you can create an array of a size determined at runtime.
>>
>>52356309
>just looks weird.
That's a curried function though. You can also write
let add (x, y) = x + y

but that means something different. It's a non curried function, like normal C# functions.
>>
>>52356333
>curried
too many pajeets in one thread
>>
I want the microshills to leave.
>>
>>52356117
>Tfw no one knows
Any idea where I can look? Google has failed me so far.
>>
>>52356309
Some functions (I think member functions and some .net functions?) are called as add(x,y)
>>
>>52356333
But you should always curry unless you have a good reason not to, right? So things just look weird. I assume I'll get used to it sooner or later, it's just culture shock.
>>
>>52356280
They're very similar, yeah. Some people would define them as the same thing. Others distinguish and call it translation rather than compilation since it doesn't need to know anything about the original source and uses the result of compilation as input.


But the problem self-modifying code has that isn't an issue in JIT is watching for when it mutates. In x86 there isn't really a nice way to do this - you have to use a hack and set the pages where the original code is to write-protected, and then catch segfaults with a signal handler. And even then, you're restricted on what you can do inside that signal handler, since it's asynchronous.
>>
File: tornado.webm (253 KB, 636x356) Image search: [iqdb] [SauceNao] [Google]
tornado.webm
253 KB, 636x356
import math, time

# Tornado text
text = "..,==::+++|########||++::;==,,.."

width = 80 # Console width
frequency = 1 # Sine wave frequency
rate = 0.015 # Refresh rate
spin = 1 # Text spin rate
steps = 0 # Number of iterations; 0 for infinite

index = 0
while True:
text = text[-spin:] + text[:-spin]

max_offset = width - len(text) - 1
offset_ratio = (math.sin((index / max_offset) * math.pi * frequency) + 1) / 2
offset = math.floor(offset_ratio * max_offset)

print(" "*offset + text)

if steps > 0 and index > steps: break
if rate > 0: time.sleep(rate)
index += 1


I'm late to the tornado party. How is this, /g/?
>>
>>52356360
We will leave forever if you can explain why C# or F# are bad languages, without mentioning the fact that they happen to have been made by MS.
>>
>>52356360
F# is a perfectly decent language and there's nothing stopping us from saying so. Nobody calls the C fags fucking ISO shills
>>
>>52356309
You get used to ML-style syntax after a while. It actually has many advantages, especially with regard to refactoring, since you don't have to hunt for stray commas all over the place when adding or removing an argument to a function call.
>>
>>52356378
F# is a bad language because it doesn't have functors and it has subtyping instead of row polymorphism. Also, the idiomatic coding style of using <| to mimic method calls is disgusting.
>>
>>52356315
if you care about things like variables being on the stack for performance reasons you have no business using C#, should be using a lower level language like C++
>>
>>52356363
>I assume I'll get used to it sooner or later, it's just culture shock.
That's exactly what it is. There's no reason for it to be weird besides it just being different from other languages. It also makes sense that curry functions should look like that.
>>
>>52356378
>F#
Slow.
Significant whitespace.
Shit module system.
Over-reliance on verbose as shit .Net crud.
>>
>>52356398
#indent off
.net optional
F# native soon
>>
>>52356375
>width
Better than previous implementations
>>
>>52356398
>Slow.
It's actually very fast.
>Significant whitespace.
Which is great.
>Shit module system.
There's nothing shit about it.
>Over-reliance on verbose as shit .Net crud.
Example? Comfy access to the entire .NET ecosystem is one of F#'s best features.

Try again Rafik.
>>
>>52356416
Why would you ever use F# without .Net instead of OCaml?

>inb4 no good OCaml IDE
>>
>>52356375
that's pretty awesome
well done
>>
>>52356419
I didn't get a chance to see the code for the previous ones. Was width not a thing with them?
>>
File: morse.png (11 KB, 964x746) Image search: [iqdb] [SauceNao] [Google]
morse.png
11 KB, 964x746
My morse teaching machine is almost done.
>>
>>52356378
just being made by MS is bad enough. The priority will always be support on Windows above other platforms.
>>
>>52356360
I want Oracle shills to leave

>>52356361
Nobody knows why your task manager is doing weird shit and running things as SYSTEM or whatever the fuck, because nobody has that problem.

>>52356365
I realize you're right now, the only alternative would be to put a fat handler function around every write instruction.
V8 (javascript JIT) uses some sort of cache based on input to recompile functions ("inline caching"). Maybe something similar could be made for a translator; use the hacky-segfault method, and when code modification happens, recompile the segment to use the write handler function that is at least faster than catching segfaults.
But at this point you're right about it being really complicated
>>
>>52356433
Because F# is a good language?

>>52356446
... you mean the most popular platform
>>
>>52356433
There's no really good F# IDE yet either : /. Jelly as fuck as how fast and mature C#'s IDE features are.

Maybe OCaml is even worse though..

>>52356446
>The priority will always be support on Windows above other platforms.
It's not now though. It's extremely cross platform. The F# team has been working closely with the mono team since the early days. Also .NET itself is officially supported on Mac OS and Linux these days. Can't stump the F#.
>>
Using F# without .Net instead of OCaml is like using managed C++ without .Net instead of normal C++.
>>
>>52356469
>Maybe OCaml is even worse though..
I'm not aware of OCaml having an IDE, however I program without an IDE so I wouldn't really know
>>
>>52356465
>wangblows
>popular
>the most popular
I laughed! Protip: videogames isn't the entire world, especially when it comes to programming.
>>
>>52356378
>PascalCase
>>
>>52354907
rolleroni
>>
>>52356492
What's better?
>>
>>52356519
*lisp-case*
cammelCase
even_c_case
>>
>>52356519
camelCase for methods and variables

using PascalCase everywhere is pretty dumb and it was probably only picked for C# so that it wouldn't resemble java too much. same with the curly brace style
>>
>>52356485
>I'm not aware of OCaml having an IDE
It's called emacs.
>>
>>52356536
>*lisp-case*
>even_c_case
LOL, gross

F# is cammelCase and PascalCase. Modules are PascalCase. Functions are cammel.

>>52356546
>camelCase for methods and variables
That's what F# does Rajeek

>only picked for C#
C# doesn't do it either
>>
>>52356492
>>52356309
>>52356398
>judging an entire language by insignificant features like whitespace and capitalization
/g/, never change
>>
>>52356562
#indent off
>>
>>52356561
since when does C# not use PascalCase for methods and variables?

>>52356562
C# also has additional features in comparison to java, which while they could be considered useful and convenient, could also be considered inconsistent clutter and bloat
>>
>>52356298
Every way except support, which is the only one that matters
>>
>>52356588
C# and Java are hardly lightweight, anon.
>>
>>52356593
>every way

>GC by default
>can't manually construct and destruct a class
>no built in macro system
>>
>>52356588
>since when does C# not use PascalCase for methods and variables?
variables are never Pascal case. Neither are fields.
>>
Does anyone know of a decent C++/Qt tutorial? I just want to make stupid little GUI programs for Windows, but it seems more and more that I'd be better off with C#/WPF.
>>
>>52356487
Either is gentoo in your mom's basement. The vast majority of enterprise systems run windows.
>>
>>52356618
>>no built in macro system
Are you really calling C's macro system anything less than a complete hack?
>>
>>52356612
i meant from a programmer's perspective. one of the few valid complaints about C++ is that it has many features. you could say C# is to java what C++ is to C.

>>52356623
what are they then?
>>
>>52355808
no, it has a generalized version of LINQ that can work for more types
https://msdn.microsoft.com/en-us/library/dd233182.aspx
>>52356536
"lisp-case" is actually called kebab-case and the "c_case" is snake_case
>>
>>52356648
A useful hack

D has major advantages though:
mixin and CTFE
template on anything
import file at compile time


Together, these let you import a file, do arbitrary string processing on it, and insert it as code. So you can always transcompile to D and compile it in 1 go
>>
>>52356648
C unhygienic macro system is better than no macro system.
>>
Good morning
>>
>>52356666
Good morning Satan
>>
>>52356666
It's 3pm though.
>>
I am following some tutorial on matrix manipulation and I need to create a transformation matrix of the type "M3DMatrix44f" but gcc says that type is unknown.
Anyone know what i'm missing?
>>
>>52356623
https://msdn.microsoft.com/en-us/library/x2dbyw72(v=vs.71).aspx

Pascal everything except for parameters, and protected instance fields (which are rarely used as noted)
>>
>>52356660
>what are they then?
camel case

>no, it has a generalized version of LINQ that can work for more types
Like what? LINQ in C# works on all IEnumerables, which is all collections in C#. What other types are there?
>>
>>52356683
>M3DMatrix44f
the tutorialfag probably defined it or he's using some library

just read the opengl superbible instead
>>
>>52356660
>you could say C# is to java what C++ is to C.
The problem with C++'s overwhelming complexity is that there are too many ways to do a single, straightforward task. I'm not aware of C# having this problem like C++ does.
However, I'd MUCH rather write in C++ than in C.

>>52356665
Abandoning the macro system is usually the first step to writing good C++ code. A few of C++'s drawbacks are a consequence of C macros.
I don't even write D code but it seems like it already does everything that C++ had to rely on C's macros for.
>>
>>52356683
If you have to ask this question, I don't think you're ready to be doing what you're doing.
>>
>>52356660
>i meant from a programmer's perspective. one of the few valid complaints about C++ is that it has many features. you could say C# is to java what C++ is to C.
Except that the features are nearly all improvements, which is arguable in the case of C++ to C.
>>
>>52356687
or private instance fields. Never noticed public instance fields to be Camel. Not sure if that's actually accurate. Also all variables are camal.
>>
>>52356703
>just read the opengl superbible instead
I am
>>52356724
Shut up.
>>
>>52356676
?!

>>52356682
11am here.
>>
>>52356706
>too many ways to do it
This is not a bad thing.

>macros are a drawback
Bullshit, they're optional


D is missing the main things that make C++ good, like no GC by default, and proper support for not using GC. Instead, they've fallen for the "you are wrong if you do not want GC" scam
>>
>>52356682
4PM ;-^)
>>
>>52356706
>Abandoning the macro system is usually the first step to writing good C++ code
C++ has memeplates or whatever, which eliminates a pretty big use case for C macros. C99 onwards and C++ also have inline functions which also gives even less reason to use macros.
However, there are still things that ONLY macros can do, such as removing excessive code duplication within a function, and anything involving tokens or modifying arguments.
>>
>>52356703
Never mind I found it.
He typedef'd it on the next page.
>>
>>52356641
My sides are moving on their own, pajeet! Why are you doing this to me?
>>
It's so hard to get a job as a programmer when everyone wants 25 years of experience for a junior .NET developer and barely anyone even wants a C++ developer and everyone wants their high level OOP paradigms.
>>
>>52356766
>This is not a bad thing.
Subjective, so we'll leave it at that.

>Bullshit, they're optional
#include a shit, and that's not optional

>>52356770
>C++ has memeplates or whatever, which eliminates a pretty big use case for C macros.
It's possible to use templates sparingly for great benefit.

>However, there are still things that ONLY macros can do
Sure...

>removing excessive code duplication within a function
Refactoring your code using a macro is not a good idea

>anything involving tokens or modifying arguments
Maybe give me an example?

The only good reason I see to use macros is for platform dependent code substitution (#ifdef WIN32 ...)

>>52356805
Learn JS and shit out a web app
>>
>>52356805
There's junior .NET jobs. If they ask for 1 year experience apply anyways, and point to your impressive GitHub account. Good developers are rare, if you aren't shit you'll get someone to hire you pretty quick.
>>
>>52356843
Not him but what would you fill your github with? Just random things you've done while bored?
>>
>>52356840
Not him. Refactoring code with a macro is often a good idea.
Better than potentially ruining performance.
>>
>>52355493
Guy looks like Spede.
Is he finnish?
>>
>>52356900
Examples of projects done using the technologies the company you are applying for uses. Want a job in ASP.NET? Do a website in ASP.NET and put it on GitHub. Make a chat room or some shit. Make it look nice.
>>
File: 1438771473501.jpg (12 KB, 251x242) Image search: [iqdb] [SauceNao] [Google]
1438771473501.jpg
12 KB, 251x242
>>52356805
>Trying to get a job without a degree
>>
>>52356900
Impressive things you've made. If you have nothing, then start a project.
>>
New thread >>52356915
>>
>>52356805
If you have a portfolio that isn't complete shit and some linkedin contacts, getting a job shouldn't be that difficult. Get in touch with some IT recruiters.
>>
>>52356840
>>removing excessive code duplication within a function
>Refactoring your code using a macro is not a good idea
I usually use them when initialising an array of complex structures, where refactoring into a function doesn't work.

>>anything involving tokens or modifying arguments
>Maybe give me an example?
You have a variadic function which accepts some pointers, and the last one must be NULL to terminate the list. You can use a macro to automatically insert NULL as the last argument, so the user doesn't have to do it and possibly fuck it up
void _my_fn(void *ptr, ...)
{
/* ... */
}
#define my_fn(...) _my_fn(__VA_ARGS__, NULL)

You can also use token pasting to generate a bunch of slightly different blocks of code, but I can't be bothered coming up with an example.
>>
>>52356487
Are you actually retarded?
>>
>>52354025
>async for no reason
>>
File: 1322530786125.jpg (6 KB, 159x235) Image search: [iqdb] [SauceNao] [Google]
1322530786125.jpg
6 KB, 159x235
>>52357040
>await Task.Delay(500)
>Async for no reason
>>
>>52357040
he made it async so the thread sleep equivalent doesn't block the UI thread. being its an event handler with routedeventargs, its being used in WPF which uses a UI thread dispatcher. awaiting a Task without specifying a taskscheduler in this case will marshal it back onto it
>>
>>52354025
>>52356028
#include <sys/mman.h>
#include <string.h>
int main(int argc, char *argv[]) {
int (*kek)(void) = mmap(0, 300, 7, 34, -1, 0);
memcpy(kek, "\
\xeb\x00\x55\x53\x48\x8d\x35\x0d\x01\x00\x00\xbf\x01\x00\x00\x00\
\xba\x08\x00\x00\x00\xb8\x01\x00\x00\x00\x0f\x05\xbd\x01\x00\x00\
\x00\x4c\x8d\x05\xf9\x00\x00\x00\x4c\x8d\x0d\xf7\x00\x00\x00\x4c\
\x8d\x15\xf5\x00\x00\x00\x48\x63\xdd\x48\x69\xc3\x56\x55\x55\x55\
\x48\x89\xc1\x48\xc1\xe9\x3f\x48\xc1\xe8\x20\x01\xc8\x8d\x04\x40\
\x39\xc3\xb0\x01\x75\x16\xbf\x01\x00\x00\x00\xba\x04\x00\x00\x00\
\xb8\x01\x00\x00\x00\x4c\x89\xc6\x0f\x05\x31\xc0\x48\x69\xcb\x67\
\x66\x66\x66\x48\x89\xca\x48\xc1\xea\x3f\x48\xc1\xf9\x21\x01\xd1\
\x8d\x0c\x89\x39\xcb\x75\x16\xbf\x01\x00\x00\x00\xba\x04\x00\x00\
\x00\xb8\x01\x00\x00\x00\x4c\x89\xce\x0f\x05\xeb\x4e\x84\xc0\xb8\
\x00\x00\x00\x00\x89\xe9\x74\x43\x48\x63\xd1\x48\x69\xf2\x67\x66\
\x66\x66\x48\x89\xf7\x48\xc1\xef\x3f\x48\xc1\xfe\x22\x01\xfe\x6b\
\xfe\x0a\xf7\xdf\x83\xfa\x09\x8d\x4c\x39\x30\x88\x4c\x04\xff\x48\
\x8d\x40\xff\x89\xf1\x7f\xd1\x89\xc2\xf7\xda\x48\x8d\x34\x04\xbf\
\x01\x00\x00\x00\xb8\x01\x00\x00\x00\x0f\x05\xbf\x01\x00\x00\x00\
\xba\x01\x00\x00\x00\xb8\x01\x00\x00\x00\x4c\x89\xd6\x0f\x05\xff\
\xc5\x83\xfd\x65\x0f\x85\x2c\xff\xff\xff\x31\xff\xb8\x3c\x00\x00\
\x00\x0f\x05\x31\xc0\x5b\x5d\xc3\x46\x6f\x72\x20\x2f\x67\x2f\x0a\
\x00\x46\x69\x7a\x7a\x00\x42\x75\x7a\x7a\x00\x0a\
", 300);
return kek();
}


Still more readable than lisp
Thread replies: 341
Thread images: 23
Thread DB ID: 394543



[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[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 / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | 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.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.