[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: 342
Thread images: 39
File: code-horror.gif (41 KB, 600x394) Image search: [iqdb] [SauceNao] [Google]
code-horror.gif
41 KB, 600x394
Old thread >>52518289

What are you working on, /g/?
>>
>>52523263
First for go
>>
>>52523263
FUCK OFF AND STOP CREATING THREADS YOU FUCKING NIGGER.
>>
Why is that bg image full of html?
>>
>>52523329
Looks like perl to me
>>
>>52523357
What are all those <8d> things about? Is Perl a step up from brain fuck or something?
>>
>>52523376
Those are representations of single characters provided by the terminal. Not exactly sure what they map to
>>
>>52523376
Probably where the editor found an 0x8d byte and didn't know any other way to represent it
>>
>>52523398
>>52523409
>>52523357
Thanks guys. It doesn't look as stupid now. I might give some Perl a read.
>>
>>52523437
The creator of Perl named it after the concept of The Pearl of Heaven, that the language is as beautiful as heaven itself. What do you think, is it as beautiful? Here's an example of a Perl program:
 
$_='while(read+STDIN,$_,2048){$a=29;$b=73;$c=142;$t=255;@t=map{$_%16or$t^=$c^=(
$m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t^=(72,@z=(64,72,$a^=12*($_%16
-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271);if((@a=unx"C*",$_)[20]&48){$h
=5;$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])[email protected];s/...$/1$&/;$
d=unxV,xb25,$_;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=$t&($d>>12^$d>>4^
$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9,$_=$t[$_]^
(($h>>=8)+=$f+(~$g&$t))[email protected][128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval
>>
>>52523263
import faggot
print you're a faggot
>>
>>52523452
 
$/=$_;$,=shift;$w=$a=shift;$k{+shift}=1;socket S,2,1,6;bind S,&a;for(listen
S,5;$SIG{ALRM}=\&i;m! (\S+) ([e-i])([^/]*)/!s&&($k{$w=$1}=$,eq$`)&&&$2){alarm
9;(accept(C,S),alarm 0)?read C,$_,1e6:($_="$, $a f".shift)}sub i{}sub t{socket
C,2,1,6;$k{$w}&&=(connect C,&a)?print C"$, ".pop:0;close C}sub h{t"$_ i/"for
keys%k}sub a{$w=~/:/;pack'CxnC4x8',2,$',split'\.',$`}sub f{$w=$_,t"$1 $3/"for
keys%k}sub e{open C,'>',$3;print C $'}sub g{open(C,'<',$3)&&t"$a e$3/".<C>;&h}
>>
>>52523452
Just beautiful.
>>
>>52523452
looks like a condensed terminal script...
>>
Today i wrote a .bat :
@echo off
:a
%random% > %random%.txt
goto a
>>
>>52523263
I am working on filling a bucket next to me with my puke. Also trying to create a parser for a programming language but that's not really working out right now for obvious reasons.
>>
>>52523642
Link it properly.
>>
>>52523721
Got it!

hey guys, I can't think of anyone else more math/tech literate in all of 4chan besides /sci/ so I come to you with this question:

>>>/sci/7797236

I posted it here originally and then by request on /sci/ yet I don't think it's getting answered in there. It wouldn't be the first time I asked there.

Maybe one of you here knows?
>>
File: sGajuGs.png (46 KB, 1446x275) Image search: [iqdb] [SauceNao] [Google]
sGajuGs.png
46 KB, 1446x275
Anyone got a better way to filter common words than just a long ass list?
>>
>>52523745
What are you asking exactly? Common as in average or common as frequently occuring?

I don't think it's possible to derive such a solution to frequently occuring words...
>>
>>52523745
HashSet
>>
>>52523745
Alphabetize the words in their own respective hash set.
>>
>>52523745
Stop word list?
>>
>>52523745
Store words under 8 letters long in an sqlite table along with their frequency, which ++ each time the word is parsed. Implement with something like http://stackoverflow.com/questions/4009756/how-to-count-string-occurrence-in-string
>>
>>52523263

>>52523249
>>
>>52523862
Eh, no.
>>
>>52523870
kill yourself
>>
File: 1452088285597.jpg (46 KB, 500x324) Image search: [iqdb] [SauceNao] [Google]
1452088285597.jpg
46 KB, 500x324
>>52523880
>>
>>52523618

Now with the correct lines of right ascension and declination!
>>
>>52523862
>>52523880
>Created before bump limit
>Fag shit
>12 replies
vs
>Created at the correct time
>28 replies
Sorry, you degenerate fuck, but this thread won.
>>
>>52523926
ok now that you put it this way i agree that this should be the legit thread

just that recently mods/jans have been keeping the earliest posted thread

and i'm not even a weebshit but it's easy to ignore those black and white comics, they don't invade your senses like traps, feces etc
>>
File: 1406803019377.jpg (103 KB, 1280x720) Image search: [iqdb] [SauceNao] [Google]
1406803019377.jpg
103 KB, 1280x720
>>52523942
It's from the same fag manga that keeps getting spammed here.
It's degenerate shit.
>>
Quick reminder that a negative opinion of traps is reddit.
>>
>>52523960
kys
>>
File: fdsaffdsa.png (36 KB, 268x237) Image search: [iqdb] [SauceNao] [Google]
fdsaffdsa.png
36 KB, 268x237
Daily reminder that there are people in this thread RIGHT NOW who still use statically typed languages.
>>
>>52524097
kill yourself
>>
>>52523960
Are you talking about debug traps?
>>
>>52524113
Concur. Why hop along one instruction at a time, when you can run like the wind on two?
>>
>>52524097
maybe it's because I'm a girl, but what's wrong with statically typed languages?
>>
>>52524097
Every time i hear static typing i think of something like this.
>>
Work continues on baby's first RTS game engine.

We have multilayered map rendering working now. I'm racking my brain how to architect the viewport/ui/camera stuff currently. Should have that done some time tomorrow though.
>>
>>52524256
looks good, how are you doing multiplayer code?
>>
>>52524252
Absolutely nothing
>>
>>52524268
We aren't even close to that point yet.

I have literally zero experience with network programming honestly. I am le plebian webdev who just has my ajax api and json usually.

Need to look into what love supports, and do a bunch of reading about network programming.
>>
>>52524252
Static typing is memey enough.
>>
>>52524252
They are not needed unless you're writing software for low level hardware.
>>
>>52524252
Nothing. They are superior in every way, and everyone who tells you otherwise has a both a god complex and incorrect programs.
>>
>>52524252
static typing is the only sensible option for ANY program regardless of size, but especially for larger programs.
>>
>>52524275
>>52524295
>>52524306
I thought so, thanks
>>
File: normalMapMiniTut.jpg (738 KB, 1280x4096) Image search: [iqdb] [SauceNao] [Google]
normalMapMiniTut.jpg
738 KB, 1280x4096
>>52524268
>looks good
srsly
>>
>>52524268
what are you asking exactly?
not him, but most multiplayer engines (source among others) work something like this:
>server running game simulation
>clients pack user input/actions into input packages and send to the server at a set rate (usually around 60 times a second)
>server collects these packages, processes them in order (based on a bunch of things like timestamps, latency prediction etc)
>server sends gamestate packages to the clients at a set interval (commonly referred to as tickrate)
they are obviously a lot more complex then this, but thats the basic idea
since its an RTS game i doubt they will have client lag prediction, otherwise theres that too
>>
File: Untitled.png (45 KB, 642x414) Image search: [iqdb] [SauceNao] [Google]
Untitled.png
45 KB, 642x414
>>52524097
>>
>>52524317
see this poll for further confirmation that dynamic typing is shit. the poll was at 75% in favor of static typing until memers voted against it out of spite.

https://strawpoll.me/6398631
>>
>tfw programming for over 10 years and still don't know what terms like dynamic/static typing, linking etc mean

T-thanks Java
>>
>>52524345
>google dyamic/static typing
>read
woow that was hard
>>
>>52524332
Dynamic Typing : the belief that my computer is more autistic than me when it cones to knowing everu type in my program.
>>
>>52524097
Forth here, who needs types?
>>
int main()
{
auto val = 5;
val += 70;
val.writeln;
writeln("static typing feels good mang");
return 0;
}


Static typing can get pretty infuriating when you need to combine data of different types inside generics and having to keep declaring intermediate types for this shit.
>>
>>52524345
this guy
>>52524389
explains it pretty well
>>
>>52524345
https://www.youtube.com/watch?v=20BySC_6HyY
>>
>>52524407
That's about weak typing, not dynamic typing.
>>
>boss asks me to implement a complex search function
>looks complicated as fuck
>open up code
>make a list of person "keys"
>create a "key" from every person which is basically just their information joined together into one huge string (Name + Address + PostalNumber + PIN + etc...)
>the search function literally just runs a case insensitive regex as the search criteria on the keys
>call it a day
it worked surprisingly well
>>
What are the small differences between the syntax of Ocaml and F# (I don't even know if that's "syntax", I mean things like whitespace, the "in" and # I see sometimes in Ocaml code, semicolons, and also naming conventions)?

I know some F# btw
>>
>>52524407
irrelevant
>>
Jaysus cuntflicking christ it's alive
$ ./maths
>def pi = 3.141592
>def circumference(r) = 2*pi*r
>eval circumference(10)
= 62.8318
>end


probably only like 500-700 loc too
I'll count it maybe
or maybe I won't
>>
>>52524324
I was just wondering in general since it's in lua

but thanks for the impromptu explanation
>>
>>52524424
Why not hash the huge string?
>>
>>52524443
>tfw working on a lexer for the past month and this anon makes one in a few hours

I-I should just give up ;_;
>>
>>52524454
How would that be easy to search?
>>
>>52524454
It sounds like he just wants end-users to search through person data using an expression.
No idea why he creates an extra list.
>>
>>52524443
$ ./maths
>def foo(a) = bar(a)
>def bar(a) = foo(a)
>eval bar(1)
[email protected](62): Too few arguments for function bar

fuck
infinite recursion fucks the interpreter up, but in the wrong way

>>52524467
My lexer is literally 35 lines of code, and I wrote it in less than 15 minutes. Either you're writing more than just a lexer or you're lexing some serious shit

what are you trying to do?
>>
>>52524501
I'm trying to write a compiler
>>
I have a python script that logs in to my ISP's website and parses the last 3 months' internet usage into lists and then writes everything to a .csv
Everything is working fine I guess, but what is the correct/best way to handle this kind of data?
Anything better than json/.csv?
>>
>>52524519
What are you compiling? C++?
>>
>>52524556
>implementing C++
I wouldn't wish to inflict that on anybody.
>>
>>52524556
Ada
>>
File: catj.webm (1 MB, 406x720) Image search: [iqdb] [SauceNao] [Google]
catj.webm
1 MB, 406x720
Ask your much beloved programming literate anything.

>>52524345
obviously,

static typing when typing is done in the static environment.
dynamic typing when typing is done in the dynamic environment.

other definitions are wrong or too far stretched.
>>
>>52524549
import array
>>
>>52524576
Hi NASA.
>>
So, is type inference good or not?
>>
>>52524576
My approach was to define a list of things which will always terminate a lexeme (whitespace)
then define a list of things which will always be interpreted as an independent lexeme (operators)

Since ada's operators / punctuation can be more than a single character, unlike in my interpreted lang, you're probably going to have to define a more complicated version of the second rule

what does your code look like so far?
>>
>>52524612
I only know OCaml's.
It seems ass backwards; You save explicitly stating types in a function definition, where I'd actually want to have everything explicit. And for that you lose overloading, so you have to be explicit in function applications.
>>
Is there any reason to make class members private? I feel like all it causes me to do is create workarounds and spiderwebs of trivial getters and setters.
>>
>>52524638
well it's all in C and I'm mostly having trouble with how to read from files and copying strings etc.

I want to just go through the file and copy out strings as tokens but it's really hard
>>
>>52524677
I think you're being too hard on yourself desu

all I did was basically throw together a simple calculator program, which is a lot less complicated than lexing a proper language

I do want to see what your lexer looks like so far though
>>
$ ./maths
>def foo(a,b) = 2*a*b^2
>!lsdefs
foo(a,b) = 2 a * b 2 ^ *
>def bloo(a) = 120*a
>eval foo(2,bloo(2))
= 230400
>end


I wonder how deep I can nest it before it fucks up
>>
>>52524739
$ ./maths
>def foo(a) = 2*a
>def bar(a) = a^2
>def boo(a) = a+2
>def far(a) = a/2
>foo(bar(boo(far(10))))
ERROR: Unrecognised command: foo
>eval foo(bar(boo(far(10))))
= 98
>!lsdefs
bar(a) = a 2 ^
far(a) = a 2 /
boo(a) = a 2 +
foo(a) = 2 a *
>def foo(a,b) = 2*a+b
>!lsdefs
bar(a) = a 2 ^
far(a) = a 2 /
boo(a) = a 2 +
foo(a,b) = 2 a * b +

I still absolutely cannot believe that this works

I'm gonna change def to only work if the function isn't already defined, and then add a redef command, and an undef command

I'm gonna fuck it up something major when I try to implement hardcoded functions like sqrt, log, sin, etc.
maybe tomorrow because it's 11:00 here
>>
>>52524664
In Java? Even if you don't care about encapsulation, you might still want to do it because it's more consistent and because you can't use variable fields in interfaces.
>>
>>52524677
Just use something like flex
>>
>>52524612
any language that doesn't support it is garbage.
>>
File: photo.jpg (14 KB, 270x270) Image search: [iqdb] [SauceNao] [Google]
photo.jpg
14 KB, 270x270
post dream jobs
>>
>>52524660
>where I'd actually want to have everything explicit
If you want things to be explicit, there's nothing stopping you from explicitly declaring what the types are.

>And for that you lose overloading, so you have to be explicit in function applications.
Not sure about ocaml, but you can do overloading just fine in F#.
>>
>>52524899
Working 3 months out of the year as a business intelligence architecture consultant.
>>
>>52524920
>If you want things to be explicit, there's nothing stopping you from explicitly declaring what the types are.
Negating any advantage of type inference, at least in OCaml
>>
>>52524404
>Babby can't format strings
>>
>>52524942
>Negating any advantage of type inference, at least in OCaml
Well, most people appreciate not needing to declare types everywhere. Also just writing
let num = 10

is type inference.
>>
Can anyone tell me the difference between Strategy and Template design patterns?
Examples and analogies are well appreciated.
>>
>>52523862
lolnewp.
>>
>>52524972
>let num = 10
So, I don't know immediately if num is an int, long, some kind of BigNum?
Great.
>>
>>52523942
>they don't invade your senses like traps
>posts trap shit
riiiiight
>>
>>52524960
>implying that I didn't write it like that on purpose
>implying that writeln(var, " asdf") is so hard
>>
>>52525004
no, you immediately know it's an int. Ocaml is not weakly typed garbage. At least i presume it's like F# in this way.
>>
>>52523960
quick reminder that
>>>/tumblr/

>>52524256
neat. good job anon, keep working it.
>>
>>52525004
>int, long, some kind of BigNum
The better question is: Why should you care? Do you honestly think you know better than a compiler optimized for the architecture you're compiling for?
>>
>>52524899
Don't, it's shit.
>>
>>52524972
>let num = 10
you're right anon that was so much easier than writing int num = 10
>>
>>52525024
That requires me to know exactly how literals are handled in the language.
It's simply less clear, just to save me from writing 3 letters.

>>52525044
Because I need to know the size?
>>
>>52525072
doesn't save much typing in that case, but it does in other cases.

Also it makes the code more clean, you're not writing redundant information. It's obvious that
let num = 10

is an int, you don't need to say so on the left side for as well for the compiler to be able to figure it out.
>>
>>52525073
>Because I need to know the size?
What for?
>>
>>52525073
>It requires me to actually be familiar with the language
Don't cry Prajeet. You can have a good career with just Java.
>>
File: dpt.jpg (196 KB, 720x720) Image search: [iqdb] [SauceNao] [Google]
dpt.jpg
196 KB, 720x720
please use the official /dpt/ pic from now on to start threads

don't let weebs get their way
>>
>>52525117
Ignore my ignorant question, OCaml doesn't have a decent numberic tree.
>>
>>52525023
Meant in reference to
>having to keep declaring intermediate types
>>
>>52524602
>Hi NASA.
Lol no, we don't touch that stuff here. All Java, all the time anon.

https://www.youtube.com/watch?v=3SdSKZFoUa8
>>
>>52525135
>female
. . .
>[INSERT DARWIN LAUGH]
>>
>>52525044
>Why should you care?
okay, how would a dynamically typed language take care of this sort of thing
let num = 10 // I presume it becomes the smallest type capable of containing it, so a ubyte

num = 256 // Does this magically convert it into a ushort?

num = 65537 // Magically converts it into a uint?

num = -1 // Magically converts it into a signed byte, or a signed int?


What's the performance overhead of this magical conversion? Does it have to reallocate whenever num changes size - either that or it just makes everything the largest type (which would be dumb)

if the values are known at compile time, will it just declare an int? What if I want to input the values, or base them on input somehow?

I like to know what my code is doing, so I could write
int num = 10


at the start, and know that the compiler hopefully hasn't fucked around with any magical conversions
it's good for optimising
>>
>>52525176
Actually, it's probably just the trap spammer
>>
>>52525184
see >>52525137

Also when you reassign variables in dynamic languages you always end up with a new object, there is no conversion.
>>
>>52524443
>I'll count it maybe
:set nu

maybe even
cat gayshit.babby | wc -l

whoa. magic.
>>
>>52524899
>speaking specifically about CERN:
>"If you're interested in high-energy physics, becoming a software developer is probably the easiest way to get into it. Certainly much easier than becoming a particle physicist."
>-Bjarne Stroustrup
>>
>>52525108
How is having the type in there not clean?
Especially since everyone's using syntax highlighting, which makes it very easy to gloss over type information should you not care about it.

>>52525123
Forcing everyone to know all the implicit details of a language is just stupid. It makes it very easy to forget some detail and make mistakes.
>>
>>52525211
It's like 8 files fuccboi
>>
>>52525229
cat *.{c,h} | wc -l
>>
>>52525056
why?
>>
>>52525248
it's like 3 folders fuccboi
>>
>>52525269
don't pretend to be other people senpai
>>
>>52525224
>How is having the type in there not clean?
The type is there, it's just not of the left side as well. redundant information is unclean.

>which makes it very easy to gloss over type information should you not care about it.
Or you can just remove the need for that.

can you guess what type personList is here? Think real hard.
let personList = List<Person>()


I don't see what makes people prefer to have shit like this instead:
List<Person> personList = List<Person>()
>>
>>52525269
cat */*.{c,h} | wc -l

or for any directory structure:
find . -name "*.c" -o -name "*.h" | xargs cat | wc -l
>>
>>52525224
>Forcing everyone to know all the implicit details of a language is just stupid.
If you don't know how to write number literals in any language you are a pretty shit programmer who's time would probably be wasted on ocaml anyways.

>It makes it very easy to forget some detail and make mistakes.
Please describe an example
>>
>>52525304
it's got like 2 spaces fuccboi
>>
>>52525248
605
I pretty much only imported std.stdio and std.conv so a fair bit of that is from defining my own stack datatype and writing my own functions for processing arrays (index of elements, that sort of shit), as well as a few io functions to make it neater
>>
>>52525290
>redundant information is unclean.
says who? it doesn't get in the way if you don't need it (thanks to syntax highlighting) and it's there when you need it.

>can you guess what type personList is here?
let personList = getListOfPersons()

what now?
>>
>>52524899
getting paid to get drunk, do drugs and fuck chicks.
instead all i get paid to do is shitpost. it works though.
>>
>>52525330
>spaces in code files
disgusting

also
find . -name "*.c" -o -name "*.h" -print0 | xargs -0 cat | wc -l
>>
>>52525336
>it doesn't get in the way if you don't need it (thanks to syntax highlighting)
What are you talking about?

>what now?
List<Person>
>>
>>52525368
>List<Person>
No, it's actually ArrayList<Person>
>>
>>52525374
Why is it called getListOfPersons then?

In any case, show me how this creates a problem in the code. If I treat personList as a List<Persons> anywhere by using members that don't exist in ArrayList<Person>, I'll get a compile time type error.
>>
>>52525336
>what now?
This has nothing to do with dynamic typing though. There are quite a few statically typed languages that allow exactly those constructs.

>>52525400
>implying an ArrayList is not a list
>>
>>52525400
So you want me to put the exact type in every function name?
How the fuck is that "cleaner" and better than just writing down the damn type.
>>
>>52525408
We're not talking about dynamic typing.
Keep up.
>>
>>52525422
I am sorry senpai
>>
>>52525409
>So you want me to put the exact type in every function name?
Just not a misleading name. getPeople() is better than getListOfPeople() if it's not actually returning List<T>
>>
>>52525469
That is better. But you really can't expect a common word like "list" to refer to the type List.

Also, getPeople() doesn't have an obvious return type either.
>>
>>52525498
>But you really can't expect a common word like "list" to refer to the type List.
Except that's exactly what happens in every code base I've ever worked on. You don't say you are returning a "list" when there is a type in core language called List and you aren't returning that, because that's confusing.

>Also, getPeople() doesn't have an obvious return type either.
Exactly, it just implies a collection of Person is returned, but doesn't imply the type. That is good code.

like i said, you still don't run into any problems with
let people = getPeople()

because you will get compiler errors if you treat it as the wrong type.
>>
>>52524097
What is the dynamic/static typing debate anyway?
>hurr you can change the type of a variable
Is that all?
>>
>>52524899
Uni professor
>>
>>52525577
Surprisingly, this subtle difference results is wide and very common classes of bugs to be caught at compile time instead of runtime, which saves a lot of development time.
>>
>>52524612
it's very bad. nothing wrong with explicit type specifiers
>>
>>52525004
num is just 10
this is its type
(at least in my language)
>>
>>52524664
you make them private when they're irrelevant to the class's interface. the only public members should be the ones that clients are expected to use.
>>
Is there anything fairly large like gitgud.io for social coding and hosted git repos? I don't like hithub or gitlab because they are anti free speech, but gitgud seems too gamergate oriented for my liking and even worse it has it's official irc channel on rizon. What is a similar alternative?
>>
>>52525599
Only if you are language or implementation a shit
>>
File: late_to_the_party.jpg (12 KB, 300x191) Image search: [iqdb] [SauceNao] [Google]
late_to_the_party.jpg
12 KB, 300x191
I'm working on a JavaScript library that's kind of like jQuery but isn't. (:
>>
>>52524612
Both. It's good if used correctly, it's bad if abused. But since /g/ is a bunch of autistic losers who can't into code style it's bad of course.
>>
>>52525543
>because you will get compiler errors if you treat it as the wrong type.
And making people run into compiler errors all the time, is somehow better than just making shit clear and obvious in the first place?

Not to mention using a type wrong doesn't necessarily result in a compile error but more subtle errors. I might assume my collection is an ArrayList but it's actually a Set and try to add duplicate entries.
>>
>>52525643
there is no conceivable benefit except that it saves having to write some characters in some cases. why you would prefer 'var' or 'let' in place of 'int' when you definitely want an int is beyond me.
>>
>>52525632
>Only if you are language or implementation a shit
Prajeet, pls
>>
>>52525628
If you want social coding only github is the solution as many people have an account.
Hosting it yourself is the best solution if you are not interested about social coding.
Mirroring it to github/gitgut or other services is a good way for backup
>>
/android programming/

I have to write service that download files from ftp. It will download files only one time after user push button or it will work in background and download files every hours (5:05am, 6:05am... etc).

What is a better way to write it:

1.
Different service for downloading on button and another service where it works in background, check time and perform download

or

2.
One service that is responsible for downloading files (by button and that works permamently in background

and another service that work in background, check time and call download service every hour


What is the better way?

In second case, app would have to call 2 services every hour.
>>
>>52523745
build a binary tree while parsing the text, it's easy and efficient
>>
>>52525672
There is also no conceivable benefit of writing List<SomeLongTypeName> l = new List<SomeLongTypeName>.
The only thing this does is to increase the signal-to-noise ratio.
>>
>>52523660
In the past year, ive been created a lexical analyzer generator for Python using FDA. The script is capable to receive actions for each token and accept functions and scripts "made in home". All be in 1 day :v if u like i can send u the gist link
>>
>>52525672
q.e.d.
>>
>>52525800
in java you can't instantiate List itself as it's an interface.

instead you would do

List<SomeDescriptiveName> list = new ArrayList<SomeDescriptiveName>();


in that case it is good that you specify that the variable is a List and not an ArrayList.
>>
>>52523745
Lexical analyzer, u can use flex or similar.

For java use ANTLRworks but this is a waste of time
>>
>>52525800
In that case I don't mind inference in the style of
List<SomeLongTypeName> l = new List<>
>>
Would any anons be interested in a neural net that detects anime images?

This could be used for auto hiding them on the internet and stuff.

Someone would need to make a large set of images, about half of them being anime, and we would need some way to label them as anime or not. Maybe a website where anons can spend time identifying anime images to improve the neural net.
>>
>>52525839
>in that case it is good that you specify that the variable is a List and not an ArrayList.
That example is bullshit as this is absolutely required in this case.

>>52525859
Still more retarded than the alternative.
>>
>>52523745
Why not just grab the top common words based on frequency from online, save the list to a file, then populate an array by reading reach line into the array? You can automatically filter out anything that's two letters long.
>>
>>52525873
no it isn't.

ArrayList<SomeDescriptiveName> list = new ArrayList<SomeDescriptiveName>();


is also valid and what a sane type inferrer would do.
>>
>>52525870
God, please yes.
>>
>>52525873
>Still more retarded than the alternative.
It isn't. It saves redundancy in writing without being any less exact about the used types.
>>
>>52525870
yes

even like a greasemonkey script that just hides specific pics from 4chan would be nice
>>
>>52525839
But an ArrayList is a List and can always be treated as one. There's rarely a reason to write code like that. You could find that code in any code base and replace it with
var list = new ArrayList<SomeDescriptiveName>();

(pretending here that Java supports C# style type inference), and it would compile and behave exactly the same.
>>
what majors can i choose from if i want to program but want more programming and less science than CS
i might add i've already been programming for 3 years and been employed as one for 1 year, i need for easier advancement and bigger paychecks basically
>>
>>52525190
reasonably attractive, not bad
>>
File: 0061 - U1kOPPL.jpg (66 KB, 680x591) Image search: [iqdb] [SauceNao] [Google]
0061 - U1kOPPL.jpg
66 KB, 680x591
>>52525870
yes please
>>
>>52525924
if you have a non-const variable then the assumption is that it can be reassigned. and if you're supposed to be able to accept any List then it will fuck up if you assign anything other than an ArrayList to it. idiot.
>>
>/dpt/
>nobody posts code
>everyone feels entitled to argue over their shit opinions over programming languages and styles
>nobody ever actually programs anything
Yep, this is about the most worthless thread on 4chan. And that includes everything on /lgbt/.
>>
>>52525924
Except you can't just treat it like any other type of list. ArrayList and for example LinkedList have different complexities for their operations.
>>
>>52525135
kill yourself FAG
>>
>>52525949
Nothing is as useless as a meta-post complaining about useless posts.

(Yes, I'm aware of the irony)
>>
>>52525949
PROGRAMMING ISN'T ONLY ABOUT CODE YOU FUCKING CODE MONKEY REEEEEEEEEEEEEEE

for(int i = 0; i < 10; ++i) {
puts("TARD");
}


THERE YOU HAVE SOME CODE ARE YOU HAPPY NOW
>>
>>52525942
Software "Engineer", but desu nowadays you don't learn too much of the science part in an average CS course
>>
>>52525978
Good.

>>52525982
>nobody ever actually programs anything
>>
>>52525948
In this case it makes sense to specify the type on the left. But otherwise it's just noise.

>>52525963
>Except you can't just treat it like any other type of list.
yes, the same is true if you have
List<SomeDescriptiveName> list = new ArrayList<SomeDescriptiveName>();
>>
>>52525800
>The only thing this does is to increase the signal-to-noise ratio
>implying that's a bad thing
>>
>>52526020
he meant to say "reduce the noise-to-signal ratio"
>>
>>52526044
Or maybe they're using terms without actually understanding what they mean.
>>
>>52525989
just because people don't post all their code doesn't mean they don't actually program anything
>>
>>52526080
it means having too much noise is bad
>>
>>52525870
So much this!!
>>
Is there a function in C like scanf or fget that doesn't wait for a return key? I just want to quickly scan the console and if there's a /n just move on.
>>
>>52526090
i'd argue that 'auto', 'var', 'let' has a worse signal-to-noise ratio than 'TypeName' since it doesn't tell you anything about the type
>>
>>52526094
Use setvbuf and (f)getc
>>
>>52526125
var asd = new ArrayList<string>()
Tells you everything about the type.
>>
>>52525949
I do a shit ton of programming.

It's just pointless to post it here because nobody would know what I'm doing unless they read my entire codebase.

Posting snippets of my code is dumb. It's the equivalent of posting a paragraph from a novel someone is writing, and asking for opinions.
>>
auto foo = bar();


vs

DescriptiveName foo = bar();


which is clearer?
>>
>>52526125
But you don't need to know about the type. The compiler will tell you if it's fucked up, otherwise you're golden.
>>
>>52526139
see >>52526148

and it's more consistent like if you declare an uninitialized member variable you will always have to specify the type so it's more consistent to just always specify the type
>>
>>52526001
You could have some inference for the special case of constructors "T var = T();", can't think of a case where that would be ambiguous. But you (or whoever started this discussion) advocated inference for everything, including normal methods.
>>
>>52526155
code is not for the compiler. code is for humans to read, first and foremost.
>>
>>52526148
in the real world you tend to have code more like this:
auto foo = getDescriptiveName();

vs
DescriptiveName foo = getDescriptiveName();
>>
>>52526183
no it would be more like

auto foo = calculateSomeSpecificValue();


vs

double foo = calculateSomeSpecificValue();
>>
>>52526183
A descriptive method name always includes the exact type for you?
>>
>>52525672
It saves writing lots of characters, and allows you to not really care which enumerable implimentation object you're inheriting.

If I do something like:
var tits = supplier.Orders;


supplier.Orders
could be a IEnumerable<Order>, ObservableCollection<Order> or BindingList<Order>, and I really don't care which it is, because I'm just going to end up doing
foreach(var order in tits)
{
someList.Add(order.Subtotal);
}


and the whole time, intellisense works because Visual Studio knows what properties and whatnot are available.
>>
>>52526172
I did. It's great for normal methods. What's the problem? The method name will imply what kind of data is returned. Writing the type on the left will specify exactly what the type or subtype of the of the returned data is, but that could be wrong. And in most cases, it's just noise. In languages with type inference, you can always specify what you expect the type to be if you want, but there's rarely a real benefit to it.
>>
>>52526203
>>52526213
kill yourselves
>>
>>52526203
if that's all you're doing why declare an extra variable in the first place?
>>
>>52526175
Precisely anon. Glad you agree.
>>
>>52526231
but you DO need to know the type you fucking melt
>>
>>52526226
I might use it elsewhere, say to bind to a GUI element, or in a LINQ statement.

It'd be easier to write 'tits' 7 times than supplier.Orders.
>>
>>52526198
exactly. So it will imply a number is returned. What the point is documenting it as a double? That might not even be correct. In Java it might return a float, and writing double will implicitly upcast it.

Why do you need to know it's a double? just use it for whatever, and you'll get told what it is by the compiler if you misuse it. If you need to know what the type is then you can read the method's type signature, which you need to do to write double anyways.

Writing double does not somehow guarantee the returned type is double. You have to figure out yourself what the return type is no matter what.
>>
>>52523745
Use a trie.
>>
>>52526246
yes, but why do you need to write it on the left of a variable declaration? You are writing the declaration, so you need to check the type returned manually to know what type to use. Why not have it be implicit?
>>
>>52526213
>The method name will imply what kind of data is returned.
What kind of data does list.get(x) return?
>>
>>52526282
KILL YOURSELF SHIT TARD
>>
>>52526301
I might not be the one who wrote the declaration?
Or wrote it so long ago, you forgot?
>>
File: qutAysm.png (21 KB, 545x711) Image search: [iqdb] [SauceNao] [Google]
qutAysm.png
21 KB, 545x711
>>52523745
It's working fine for me, the best improvement would be to make the data object indexable.
>>
>>52525949
>everything on /lgbt/
heh apparently you know 'everything' that goes on there friend. wait...
> are you the trap-spammer?
>>
>>52526305
I don't know. looks like a shit method name. lists usually have something like getIndex() or something. and the list will generally be called something like gameObjects or people.

the return type of list.get(x) is still a problem without type inference you know. This is why you don't write code like that.
>>
I WISH HITLER WOULD HAVE WON THEN MAYBE WE WOULDN'T HAVE AS MANY DYNAMIC AND IMPLICIT TYPING AND TRAP FAGS AROUND HERE
>>
>>52525943
perhaps. except for the whole dick thing.
>and the gay thing.
>>
>>52526354
What are you talking about?
How would you specify the type in the method name to get an item of a generic list?
>>
>>52526324
then the type will generally be obvious from reading the code. In any case, the type is generally not that important compared to what kind of data is being passed around and being used for what.

This is why dynamic languages work. The problem with them of course is lack of type safety, but type inference makes statically typed languages as easy to read as dynamic ones, with complete type safety.
>>
File: 36914334.jpg (116 KB, 400x400) Image search: [iqdb] [SauceNao] [Google]
36914334.jpg
116 KB, 400x400
Neither? 01/20/16(Wed)10:10:08 No.52526345 [This post has been deleted] ▶

>>52525949
>everything on /lgbt/
heh apparently you know 'everything' that goes on there friend. wait...
> are you the trap-spammer?

lol did i rustle you hotpockets?
>>
>>52526388
you dont, you specify the type in the list itself
>>
File: 1452393391148.png (454 KB, 585x610) Image search: [iqdb] [SauceNao] [Google]
1452393391148.png
454 KB, 585x610
>>52526369
And maybe we wouldn't have as many insufferable shitposters like yourself.
>>
>>52526388
i'd call list.getItemOfIndex(x), which is pretty common.

like i said, the problem is the same without type inference. which is why the list will likely be called people like people, so programmers know what people.getItemOfIndex(x) returns.
>>
>>52526395
type inference makes it HARDER to find out the type in the first place and then forces you to keep track of the type in your head or mouse over everything in your IDE or even worse fucking TRIAL BY ERROR like >>52526282 suggests
>Why do you need to know it's a double? just use it for whatever, and you'll get told what it is by the compiler if you misuse it.
OBJECTIVELY PIG DISGUSTING FUCKING KILL YOURSELF
>>
>>52526224
>>52526311
>>52526424
Did you forget to take your autism medicine?

Type inference can be a good thing in some cases, and it can be a bad thing if overused.
>>
>>52526408
Says the fucking weeaboo who makes it his life mission to post weeb pics on every post he makes while being a constant disappointment to his parents, whom he still lives with.
>>
>>52526444
if you write quality code (not that you would know what that is) you will have explicit types EVERYWHERE.
>>
>>52526467
>if you write quality code (not that you would know what that is) you will have explicit types EVERYWHERE.
Java programmers never fail to bring the comedy. Never change Rafeek :D.
>>
>>52526467
if you write quality code (not that you would know what that is) you will use implicit and explicit typing interchangeably to maximize the readability of each line of code.
>>
File: 1453180938368.jpg (77 KB, 1280x720) Image search: [iqdb] [SauceNao] [Google]
1453180938368.jpg
77 KB, 1280x720
Have you ever made something that is used regularly by more than 1,000 users, /dpt/?
>>
>>52526369
If Hitler won, anime would be real.
>>
File: 084.png (102 KB, 300x256) Image search: [iqdb] [SauceNao] [Google]
084.png
102 KB, 300x256
>>52526492
>being inconsistent makes it more readable
>>
>>52526404
So you're just putting all the extra typing in variable names.

Take your "orders" example, that might be a list of some native struct representing order information, or could it be some serialized form to send somewhere else, or could be an object you use to commit the order, etc..
To have the exact kind represented in the name introduces lots of redundancy too.
And much much worse: it depends on the programmer's discipline and conventions, so it's also open to interpretation.

Having the type written explicitly avoids all that.
Types are exact. Names aren't.
>>
>>52526501
I wrote something that is launched once every 20 seconds on average. downloaded by 100,000+ people. Feels good mang.
>>
>>52523456

>forgetting quotes.
>not using an escape sequence to make sure the apostophy was printed.
>having a useless import.

We all know who the real faggot is here.
>>
>>52526518
>launched once every 20 seconds on average
glad i didn't fall into you're botnet trap anon
>>
>>52526518
I'm curious as to what it is, sounds good though!
Personally I created a website which gets a couple of million hits a month, but a piece of software that people download is really awesome.
>>
>>52526492
clarity of intent and type safety is much more important than being able to read the code quickly.
>>
File: 1452446300011.png (229 KB, 628x708) Image search: [iqdb] [SauceNao] [Google]
1452446300011.png
229 KB, 628x708
>>52526452
>while being a constant disappointment to his parents, whom he still lives with.

Anon, I won't bully you because I know this is how you feel about yourself.

You're not a disappointment to your parents, anon. Stop thinking this.
>>
>>52526452
>while being a constant disappointment to his parents, whom he still lives with.
spotted the projecting faggot
>>
>>52526557
Typical weebshit response.
>i know you are but what am I.
Maybe one day you'll grow up and stop jerking off to cartoons.
>>
>>52526540
yeah, it's a little sneaky. But i only know this because it checks for updates when it launches, and it have analytics on how many times the file on the myserver that says when there's an update is downloaded.

>>52526541
wish I could say.

>Personally I created a website which gets a couple of million hits a month
I'm jealous. The landing site I made for this software get's maybe 8k hits a month. Also have hardly made any money off of it. It's cool to see so many people really liking it though. Will try monetise it better in the future.
>>
>>52524097

>implying c is bad
>implying java is bad
>implying all of the languages people actually get hired to write are bad

Jeez senpai, I never knew you were a retard.
>>
>>52526565
Nigger I'm posting from my office at work and I don't live at home.
>projecting
Pointing out the obvious.
>>
What about anonymous types?

I might want to do something like:
var ayy = new { ID = 1, name = "lmao" };


I'm not advocating for anything here, just wondering how you would do this otherwise.
>>
File: 1452446496816.png (616 KB, 895x892) Image search: [iqdb] [SauceNao] [Google]
1452446496816.png
616 KB, 895x892
>>52526601
>I don't live at home.
Whatever you say, anon.

In the end, you know the truth. It doesn't matter what people on the internet think.
>>
>>52526593
I've not monetised, don't like ads & its a video streaming site so the content isn't exactly mine to advertise on.
Shame you can't say, but its always cool to have a project people appreciate.
>>
>>52526593
OK, fair enough. At least be kind enough to offer you're users the opt-out from phoning home then, yea?
>>
>>52526614
looks like what you want is a javascript object.

should be written like this:

var ayy = {id: 1, name: "lmao"};
>>
>>52526642
No, what I just posted is valid C# for an anonymous type.

I'm asking how you would do that if implicit casting wasn't a thing.
>>
>>52526621
>don't like ads
I know those feels. Same reason I don't get money. I could be a dick and ad loads of ads, but I'd rather it be a really impressive project. I think it serves me well in job interviews to say i made this.

How much are server costs then? Do you lose money?
>>
>>52526619
>weeb tard cant possibly imagine other /g/entoomen not being neets like them

shouldnt you be in the desktop thread or something
>>
>>52526648
C# has dynamic typing
>>
>>52526648
Ah, I see. I don't know C#, but in Java you could do something like:

Map<String, Object> ayy = new HashMap<>();
ayy.put("ID", 1);
ayy.put("name", "lmao");


You would need to do an explicit cast whenever you retrieve the data, though.
>>
>>52526649
Server cost is £60 ($100) per month. All covered by donations, if you spend time making something nice and (here's the important part) build a community around it, then people will contribute.
>>
>>52526621
cytube?
instasynch?
connectcast.tv?
>>
>>52526614
you'd use a design that's not hacked together in 3 minutes and if it's still actually necessary then make it into a class.
>>
>>52526614
{int id, String name} ayy = new ...
>>
>>52526690
>video streaming site
>millions of views
>$100 a month
what the fuck?
am i being rused?
>>
>>52524427
F# has significant whitespace, ocaml does not. F# allows overloading, ocaml uses module-level, scoped overriding instead (e.g. Int32.(x + y * z - w) or Int64.(x + y * z - w) overrides the infix operators for the correct type, but Int32.(3 + 4) is invalid since 3 and 4 are of type int and not Int32). Due to not having significant whitespace, ocaml uses ; to sequence effect-less actions. something (); is equivalent to let () = something () in, which means that if the expression doesn't return () [i.e. unit], the pattern matching with the let will fail and you will get a compile-time error.
>>
>>52526735
I'm assuming he just routes to other video streaming site(s), not actually hosting the videos on his hardware.
>>
>>52526682
yes... but that code isn't dynamic
>>
>>52526735
>>52526765
Yeah sounds like an aggregate site.

Still pretty impressive with those numbers.
>>
>>52526687
That's dynamic though. The C# code is static.
>>
>>52526728
There doesn't seem to be an equivalent to this in C#.

Is this Javascript or what?
>>
File: 1452530965310.png (193 KB, 397x547) Image search: [iqdb] [SauceNao] [Google]
1452530965310.png
193 KB, 397x547
The average person is an idiot, right?

Why is it wrong for me to exploit the average person using proprietary software?

Why should I have feelings for these people?
>>
>>52526749
>F# has significant whitespace, ocaml does not.
wut?
>>
>>52526614
Note that this is static/read-only.
>>
>>52526813
>>>/a/
>>
>>52526819
What?
>>
>>52526813
>The average person is an idiot, right?
Yes
>Why is it wrong for me to exploit the average person using proprietary software?
It's not.
>Why should I have feelings for these people?
We shouldn't.
>>
>>52526830
how does ocaml not have significant whitespace?
>>
>>52526802
It's just an example who one could do this in a hypothetical language without inference.

But I think you can do something similar to that in C.
>>
>>52526847
So the 'example' you posted isn't actually a thing?

Nigga, show me a one-liner static/read-only variable with multiple properties and explicit typing.

Whew, that was a lot of buzzwords.
>>
>>52526842
OCaml literally doesn't have significant whitespace. Are you being retarded on purpose?
>>
>>52526702
Instasynch is fucking awesome, I wish I had started that. Nah its an anime streaming site.
>>52526735
Nope. Check out OVH, we use a single dedicated server and they take care of everything.
>>52526765
>>52526796
I didn't want to advertise, but just to show you that its possible, twist.moe. I screenshot the analytics so you can see. If it were just an aggregate site then I wouldn't pay more than £5 to run this kind of thing. I did post about this once before about 18 months ago if I recall correctly.
>>
>>52526869
If you insist, here is it in C:

const struct {int a; int b;} var = {1, 2};
>>
>>52526801
Object ayy = new Object() {
int id = 1;
String name = "lmao";
};
>>
>>52526735
a million views isn't that special these days
>>
>>52526890
White space defines scope in ocaml from what i can tell, just like F#. Am I missing something?
>>
>>52526905
Now write some code that accesses those fields.
>>
>>52526922
DANCE MONKEY DANCE
>>
>>52526922
int x = ayy.id;
String y = ayy.name;
>>
>>52526690
nice one dude. Make any profit from donations?

I think i know your site. I think you mentioned it ages ago in another /dpt/, but i won't say what it is. It's really nice though.

You are one of the few do-ers on /dpt/.
>>
>>52524730
this is how far I got but it doesn't even compile (sorry for taking so long I had to go to class)

struct astnode {
int number;
struct token token;
struct astnode *children;
size_t size;
};

struct ast {
struct astnode value;
};

struct token {
const char *s;
size_t length;
};

struct token parsetoken(const char *source, const char **out)
{
struct token token = { .s = source };
size_t length = 0;

while (*source && isalnum(*source++)) {
++length;
}

*out = source;
token.length = length;

return token;
}

struct ast parse(const char *source)
{
struct ast ast;
const char **i = source;

while (**i) {
skipwhitespace(i);

if (isalpha(**i)) {
struct token token = parsetoken(*i, i);

addtoken(&ast, token);
} else if (isdigit(**i)) {
int number = parsenumber(*i, i);

addnumber(&ast, number);
} else {
break;
}
}

return ast;
}

void ensuresize(struct ast *ast, int size)
{
if (ast->value->size < size) {
ast->value->size = size;
ast->value->children = realloc(size * sizeof (struct astnode));
}
}

void addtoken(struct ast *ast, struct token token)
{
ensuresize(ast, ast->value->size + 1);
ast->value->children[size - 1].token = token;
}

void addnumber(struct ast *ast, int number)
{
ensuresize(ast, ast->value->size + 1);
ast->value->children[size - 1].number = number;
}
>>
>>52526950
>Type error: Object does not contain a member field called 'id'
Java once again confirmed for garbage. Big surprise.
>>
>>52526969
oh man, i was actually doing it in Groovy and it seemed to work.
>>
>>52523452
Write only language.
>>
File: why.jpg (19 KB, 220x219) Image search: [iqdb] [SauceNao] [Google]
why.jpg
19 KB, 220x219
>>52526959
>struct ast {
> struct astnode value;
>};
>>
>>52526912
>getting it THIS wrong
lmao
>>
>>52526954
Its alright, I've mentioned it now just to show people what can be done on a budget. Working on something else now but I like to mention that one, usually in whiney "adblock kills the web" threads and occasionally chipping in to other things.
I think most people who come on here are do-ers, its just hard to find an interesting problem.
>>
>>52526959
Make a state machine
>>
>>52526989
how am i wrong? Every ocaml example i see has whitespace for scoping.
>>
>>52526990
>I think most people who come on here are do-ers, its just hard to find an interesting problem.
I sadly disagree. I find a lot of people here like learning languages, but struggle to actually make something of value.
>>
File: Capture.png (3 KB, 73x127) Image search: [iqdb] [SauceNao] [Google]
Capture.png
3 KB, 73x127
should I comment out these blocks or just not give a shit about the icons changing? Feel like it's a time waster but I don't know if it's a bad practice
>>
>>52526988
I-I don't know. this is like the 20th iteration of my code so I'm not sure about anything anymore
>>
>>52527007
>I'm retarded and no-one can stop me!
>>
File: fractal.png (104 KB, 512x512) Image search: [iqdb] [SauceNao] [Google]
fractal.png
104 KB, 512x512
Made a fractal render in Python with pygame.
Colouring is pretty basic for now.
>>
File: lua.gif (5 KB, 256x255) Image search: [iqdb] [SauceNao] [Google]
lua.gif
5 KB, 256x255
oh Lua, you silly thing

sunday = "monday"; monday = "sunday"
t = {sunday = "monday", [sunday] = monday}
print(t.sunday, t[sunday], t[t.sunday])
>>
>>52526904
Is 'var' the name of the variable here?

Would you access it with
int x = var.a;
?
>>
To the faggot that keeps spamming the hime anime:
>1st ep, 2:57 until the end
Holy fuck this can't be possible, who the fuck thought of putting something so upsetting and unrealistic in an anime?
>>
>>52527185
Maybe you can try some big boy shows? Maybe even a documentary or something?
>>
>>52526904
Can you declare a struct within a method in C?
>>
>>52527182
Yes you fucking simpleton.
>>
>>52527248
There are no methods in C.

>>52527222
But I like anime.
>>
>>52527248
Inside function yes, it will only be visible inside that function definition.
>>
>>52527248
You can put function pointers but not actual functions
>>
>>52527083
you should pretty much never have errors lying around in your code base. like my desktop-target project is full of errors but that's only because i'm doing android right now and intend to do the porting to desktop later on. i would never have errors lying around in my android or main parts of my project
>>
>>52527248
Before further confusion, here's my whole test code:

#include <stdio.h>

int main() {
const struct {int a; int b;} var = {1, 2};

int bar = var.b;
printf("%d %d\n", var.a, bar);

return 0;
}
>>
File: 1452448886287.png (248 KB, 413x695) Image search: [iqdb] [SauceNao] [Google]
1452448886287.png
248 KB, 413x695
Anyone else feel like something big is going to happen in Europe very soon?

The lion is going to wake up again, I can feel it, the last time that happened 6 million Jews died.
>>
>>52527330
what's a lion?
>>
>>52527330
Hey, shitposting weebfuck. That has nothing to do with programming. Why don't you piss off back to /a/ for a while?
>>
>>52527248
>Can you declare a struct within a method in C?
Sure. It will be scoped to that function ofc. However that's not what anon was doing there, he just defined and initialized a struct in one statement.
>>
>>52527324
Thanks, anon.

I'm kind of playing around with some objects in C# to do something similar, but it looks like it's not really possible.

Basically, doing an anonymous type declaration like this:
var ayy = new { ID = 1 , name = "lmao" };

gives me everything but explicitness in the declaration of properties.

I'm trying to find a way to do an anonymous type variable with explicit properties.
>>
File: 1442679913825.jpg (162 KB, 1920x1200) Image search: [iqdb] [SauceNao] [Google]
1442679913825.jpg
162 KB, 1920x1200
>>52527330
no there is a rise in nationalistic political parties in europe but they're kinda soft and won't do genocide and even if they would they won't get all that much power.
>>
File: dwad.png (2 KB, 267x261) Image search: [iqdb] [SauceNao] [Google]
dwad.png
2 KB, 267x261
Can someone help me to write a graph function that'd work with C++ Builder's image canvas?

I tried
int x, y;

Image1->Canvas->Rectangle(0,0,257,257);

Image1->Canvas->MoveTo(Image1->Width/2,Image1->Height-15);
Image1->Canvas->LineTo(Image1->Width/2,15);
Image1->Canvas->MoveTo(15,Image1->Height/2);
Image1->Canvas->LineTo(Image1->Width-15,Image1->Height/2);
Image1->Canvas->MoveTo(Image1->Width/2,Image1->Height-15);

for ( x = -128; x < 129; x++ )
{
y = (a*a*x) + (b*x) + c;
Image1->Canvas->Pixels[x][y] = clRed;

if ( x == -100 )
Label15->Caption = y;
}

but it didn't work, as shown on the image.
Anyone? I'm just really tired and I'd appriciate the help.
>>
>>52527390
I don't know C# but you could just put explicit casts in front of the literals?
>>
>>52527402
Oh, and uh, this is where a = 1, b and c = 0
>>
File: t6pc7MT.png (8 KB, 1005x158) Image search: [iqdb] [SauceNao] [Google]
t6pc7MT.png
8 KB, 1005x158
>>52527412
Nope, doesn't allow it.
>>
File: 1452442695678.png (208 KB, 481x560) Image search: [iqdb] [SauceNao] [Google]
1452442695678.png
208 KB, 481x560
>>52527396
No, it's going to happen soon, anon. I can feel it in the air.

I'm a bit excited.
>>
>>52527454
Kill yourself.
>>
>>52527438
Those aren't casts (unless C# is really weird about them)
I meant something like "id = (int) 1"
>>
>>52527454
Can't wait for all the garbage races to be kicked out of europe. Jewish/asian master race!
>>
>>52527438
(int)ID
(string)name
These work
>>
File: 1448380553493.jpg (203 KB, 900x506) Image search: [iqdb] [SauceNao] [Google]
1448380553493.jpg
203 KB, 900x506
>>52527485
jews won't kick them out. jews are the ones that brought them in in the first place. pic related is a real quote and he probably meant sandniggers in place of asians.
>>
>>52527485
Isn't it strange that the only smart Jews or the ones with European ancestry (Ashkenazim)?

Why is that? Coincidence?
>>
>>52523906
Looks like aeronautical charts
>>
>>52527526
different people have different attributes
>>
>>52524295
sarcasm or true because I want it to be true
>>
>>52527557
it is true

explicit is better than implicit
>>
>>52527563
>>52527563
>>52527563
>>52527563

NEW
>>
>>52527526
Ashkenazim deeply share genetic lineage while the others don't. Hence, they are a group united by a religion but that includes a specific genetic group, or population, distinct from other Europeans, for being isolated by policies of their host countries across the ages.
>>
>>52527470
>>52527505
Ah, that makes sense.
>>
>>52527505
Oh, this doesn't work btw. You have to do the type values, not the properties.

It's:
var ayy = new { ID = (int)1 , Name = (string)"lmao" };
>>
>>52525870
Didn't somebody do this already? I remember seeing a thread sometime ago about this. It could recognize stuff in the images, e.g. boy/girl, sweater, hair color. It would even identify characters and their series.
>>
File: 1448746989029.jpg (427 KB, 800x1000) Image search: [iqdb] [SauceNao] [Google]
1448746989029.jpg
427 KB, 800x1000
>>52523745
>{get; set;}
Thread replies: 342
Thread images: 39
Thread DB ID: 448399



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