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

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

Thread replies: 255
Thread images: 34
File: 1334682645405.jpg (475 KB, 1024x1076) Image search: [Google]
1334682645405.jpg
475 KB, 1024x1076
Old /dpt/ at >>51974888

What are you working on?
>>
LEGIT THREAD
>>
Any programming challenges, /g/uys?
>>
>>51980294
Create an wordsearch generator
>>
>>51980217
I'm working on an abstraction for web browser View rendering, and an abstraction for communications between web browser and server, both use the Adapter pattern.

I'm also working on glueing multiple modules together (including the two mentioned above) to form a framework
>>
File: hun.webm (3 MB, 1066x600) Image search: [Google]
hun.webm
3 MB, 1066x600
Ask your favorite programming literate anything.
>>
>>51980483
LL or LALR?
>>
>>51980483
Kill yourself.
>please, no bully
Kill yourself.
>>
>>51980330
>>
>>51980536
yes
>>
File: PYsvgTz.png (2 MB, 1218x3205) Image search: [Google]
PYsvgTz.png
2 MB, 1218x3205
>>51980427
>both use the Adapter pattern.
muh oop
>>
>>51980611
>most of these patterns are natural constructs in functional programming
>>
File: 1431557016533.png (127 KB, 546x486) Image search: [Google]
1431557016533.png
127 KB, 546x486
>>51980294
why don't you just study something you're interested?
If you really want it just google it.
>>
>>51980611
>51980611
thanks for the pic
>>
So i have a Qt application with 50+ ui elements, with tables, input fields. Also im loading huge, 100MB+ images and processing them in different stages. I need to create a save/load project function and im not sure how i should do it.

I dont know if saving the data to a zip file or just putting them into a folder would be best. Either way with all the images the save would take almost 1Gb.

Also how do i save and set the state of the ui elements without hiccups? I need to block signals globally thats for sure.
>>
>>51980536
Alright, here it goes.

>I'm walking up to the entrance and two trench coats move in from my right, a man and a woman.
>The shopping center is extremely ritzy so I think nothing of it.
>The guy does this really weird maneuver and holds the door for the girl and steps in front of me and walks in.
>Think to myself about how that was strange
>I'm on the first floor looking at math books; finish then head to the technology section upstairs.
>up the escalator, to the left, two bookstacks
>round the corner into the aisle formed by these stacks
>See the figures from early and I stop frozen in my tracks
>Guy and girl both wearing trench coats with t shirts, jeans, and gym shoes
>Girl is your average not-attractive-whatsoever girl, nothing special about her
>The guy: receding hair line, greasy, slicked-back with his lack-of-shower pomade; posture like the golem of bad posture (GOLEM YE BE GONE)
>She's leafing through C++ books
>Of fucking course. He's looking through Linux books
>Linux Command Line, some other Linux book
>He looks at what she's doing
>Grabs a giant C++ for dummies book, seriously that thing is like a medical journal
>"THIS IS A GOOD BOOK."
>"That's for beginners."
>He shuffles a couple of steps away and keeps looking at Linux books.
>Offers to buy her any two books
>She mumbles something and they scuttle away

I was mortified.
>>
File: 2015-05-27 15.36.57.png (123 KB, 1065x816) Image search: [Google]
2015-05-27 15.36.57.png
123 KB, 1065x816
>>51980659
So no bitching about go?
>>
An IoT-enabled dragon dildo
>>
Why the fuck can't I have an unused import in my Go project? I added it because I need it in 5 mins, just going to try this other thing out first.
>>
>>51980611
OOP was a mmistake
>>
Hey /dpt/, I could use a small nudge in the right direction.

I have a large data set which contains pairs of IDs, representing connections between nodes. I can also look up the value of each node.

How would I go about efficiently calculating:
- Which nodes are exactly X connections away from a specific node (while going the shortest route)
- Which nodes are exactly X connections away from *any* node with a specific value

I'm having trouble finding resources for this specific case. Any ideas on algorithms to use, or just general approach to the problem? I'd rather not brute-force it and have my program take hours to complete.
>>
>haskell
>all libraries are shit
>muh whitespace
>many bugs in any single iteration of GHC
>laziness makes it unnecessarily hard to reason about runtime/memory requirements
>typesystem isn't as strong as it could be

>ocaml
>Object caml
>nobody actually knows how to use, or uses, objects
>no parallelism in 2015
>different operators for floats and ints
>standard library is borderline unusable, so everyone uses either batteries or core, with lwt or async for concurrency, in any combination, increasing fragmentation
>effort gets repeated from scratch every few years instead of being built upon (see: parallelism, jane street and some dude for his PhD both tried, both from scratch, and ocamlpro's current attempt is also from scratch)
>poor windows support, i.e. poor multiplat capabilities

>sml
>lolnodocs
>10 incompatible implementations
>one fast, parallel implementation, but it doesn't have a repl
>one windows-heavy implementation that's quite fast and has parallelism and a repl, but poor (if existent at all) non-windows support, and very poor target platform support
>no middleground
>no libraries

>1ML
>NEVER EVER

Why is the ML family of languages so cucked?
Why is the lisp family of languages even more cucked (shit or missing type system, no TCO in clojure, barely functional constructs in CL and no standard update since 1994 with no plans to, most don't do parallelism either, none have a significant userbase except CL and racket, a lot are full of bugs and leak memory, etc.)?
Why is there no good functional programming language that is actually usable in practice?

Is functional programming just a meme?
>>
>>51980773
It's too generic to bitch about.
>>
>>51980921
You can't, it's NP-complete.
>>
>>51980965
Fug. So, what are my options then? Just accept any solution's going to be super slow?
>>
>>51980949
>all libraries are shit
What

>muh whitespace
Can be subverted using {;}

>laziness
Strictness annotations, strict modules/functions

>type system
It's still got the strongest out of those options, by far
>>
What language would be useful to learn?
>>
File: 1430846672005.jpg (129 KB, 527x620) Image search: [Google]
1430846672005.jpg
129 KB, 527x620
>>51980714
np, have this one too

>>51981071
literally any. Learn a couple different paradigms too, so you can use the one the fits better the problem
so java, c++, c#, python, clojure, common lisp, racket, prolog, julia, whatever
>>
>>51976518
// assuming p = fmt.Printf
for i:=97;i<123;i++{
p("%c\n",i)
}


>>51980773
Go is perfect.

>>51981071
Go
>>
>>51981071
Learn Awk if you haven't already. You will be glad you did.
>>
>>51980965
>>51981007
Wait, no. My list of connections is static and will never change, so I could just calculate the connection counts once, store the results, and work with those. Duh.
>>
>>51980844
Just use go imports.
>>
>>51981275
ignore it, it's a new troll, just like "you can't average two numbers in C", "this compiles in gcc: <some C++ shit>" and so on
>>
>>51981322
It's completely true, though.
>>
>>51980844
haha very funny xD
well meme'd, my friend
upboated, +1!
>>
What are some obscure programming languages that you like, /dpt/?
>>
>>51981375
Erlang/Elixir. You should learn it because it's used in telephony!
>>
>>51981375
I really like Agda.
>>
>>51981375
Julia
>>
>>51981409
What is it like to use compared to Haskell? Are libraries in Agda tightly coupled?
>>
>>51981424
It's not really comparable to Haskell besides the fact that it's functional and the syntax is similar. Like, you wouldn't ever use it for something that Haskell is perfectly good for.
>>
>>51981409
Seconded.
>>
>>51981375
Nitra, looks promising as fuck for developing whatever languages you'll ever need. It's far from completion though.
>>
>he needs a debugger to understand code
Better flip burgers m8
>>
>>51980427

> 2015
> hard dependency on jQuery
>>
>>51980611
>>51981141
>pics
>memorizing a load of trivial word definitions instead of having actual skill
this is what normies actually believe
>>
>>51981506
Pff, int 0x80 is my debugger.
>>
>>51981551
>normies
curryniggers actually. most normies would be incapable of learning/memorizing those concepts properly
>>
>>51981551
patterns are not for "pick one to continue writing this program", they are for communication/code documentation instead.
>>
>>51981646
Patterns are for shoehorning ordinary functional concepts into OOP. Most of them are just closures. And, for example, Chain of Responsibility is a monoid.
>>
>>51981702
> for shoehorning
No, they are for describing common patterns in OOP design. Whether those are easier to implement in/native to functional programming is irrelevant.
>>
>>51981450
Just use flex and bison you fucking hipster.
>>
>>51981726
Why have all these different names for obscure special cases of object relationships when they are mostly straightforward and self-explanatory using functional concepts?
>>
File: 1450608948672.jpg (85 KB, 600x859) Image search: [Google]
1450608948672.jpg
85 KB, 600x859
So I just downloaded the entire gentoomens library, all 32.7 gigs. Gonna seed for at least as long it took me to DL.

So, any pointers on where to start?
>>
I GOT AN EMAIL TELLING ME TO STOP TORRENTING FROM MY UNIVERSITY INTERNET. WTF? WHAT KIND OF SHIT IS THIS? DENMARK IS SUCH A NAZI COUNTRY. What can I do to get away with stuff like this?
>>
>>51981743
> flex and bison
Why not x86 assembler? Just read what Nitra actually is (going to be).

>>51981749
Because those naming conventions developed being ignorant of functional programming, and therefore don't require the user of an OOP language with little/no support of functional concepts to learn them.
>>
>>51981775
>university
They let 11 year-olds into university in Denmark?
>>
>>51981783
>Why not x86 assembler?
Because then it won't work on ARM
>>
>>51981783
>an OOP language with little/no support of functional concepts
I don't think this is a thing any more.
>>
>>51981749
i think OOP is great but things like these diagrams and stupid names n shit for basic concepts pisses me off
>>
>>51981797
shut up and tell me what to do
>>
>>51981800
I don't follow java development, is it actually catching up? Then probably. Still it's not like patterns appeared yesterday, they were useful for something at one time for sure.

>>51981799
Good point.
>>
>>51981825
Java finally has lambdas, yes. The types are still a bit wonky, since lambdas implement a "functional interface" which is any given interface with only one method.
>>
>>51981775
use a VPN or something? but the amount of traffic will still be suspicious if you download/upload a lot
>>
>>51981775
torrents use lots of resources
>>
>>51981883
>>51981890
which VPN? and how do i decrease the resources?
>>
>>51981783
Nitra is literally a parser generator and works exactly like flex+bison. Fuck off back to shilllang, shill.
>>
>>51981904
>which VPN
set up your own if you need to
>how do i decrease the resources
download less
>>
>>51982007
how do you set up your own so you can download?
>>
>>51981905
Out of a grammar description you write in a nice-looking DSL instead of flex+bison shitshow you get
>an _extensible_ parser with automated error recovery.
As in, you can add a compiled module describing extensions to a language which will be picked up for easily adding/removing features from your language on demand.
+non-shit error reporting.

an automatically generated Resharper plugin (for now, later it should be Visual Studio extension afaik) for your language with
>syntax highlighting, symbol highlighting (such as class and method names etc.), navigation (goto declaration, find usages, etc.), validation and real-time error reporting/highlighting.

all this on top of regular parser generator's job of getting you AST + Parse tree with symbols etc
idk if you weren't retarded you'd be shilling for it too
>>
>>51982065
>an automatically generated Resharper plugin (for now, later it should be Visual Studio extension afaik) for your language with
This is pretty neat, although I'd be more chuffed if there was a parser combinator library that could generate plugins like that.
>>
>>51982065
[shilling intensifies]
>Why have you not installed Windows(tm) 10(r) and the best IDE, Visual(c) Studio(tm) yet, good goy?
Have you considered killing yourself yet? You should, I bet you'd have a lot of fun!
>>
>>51982094
>Visual Studio
>Not the best IDE
>>
>>51982065
>>51982073
And for ordinary text editors, not just fucking Microsoft ecosystem bullshit.
>>
>>51982094
>Visual(c) Studio(tm)
I share you distaste for the platform but the developers say that they ARE developing Nitra as backend-indpendent as they can and there will be api to allow supporting other IDEs. Although it's going to be a long wait because time to finish Nitra + time someone writes llvm (or w/e) backend + some writes support for w/e IDE gonna take awhile.
>>
I know Vim decently and Emacs a little. Will I gain much if I switch from Vim to Emacs with Evil mode?
>>
>>51982188
You will gain nothing and lose much.
>>
>>51982153
Holy shit, you're so retarded it hurts!
>>
>>51982306
I hope it hurts a lot, fucking nigger.
>>
>>51982293
What would I lose?
>>
>>51982356
dignity
>>
File: lua.png (15 KB, 563x210) Image search: [Google]
lua.png
15 KB, 563x210
Can someone help me with this? I created a function that return 3 values and store in a property of table "brick", but how can I access those values from "brick.color"?
>>
>>51982356
The ability to feature in 4chan reaction images depicting you tipping your fedora and overlaid with the text "I use Emacs"
>>
>>51982356
Your keybinds because evil mode is garbage. Tabs, folds, minibuffers, buffers like the error and location buffer, jumping to a matching delimiter (you'll have to write the function yourself), and your tendon.
>>
how does one start to use SQL? my employer wants me to learn this. what program do i use/where do i download a DB to tinker with?
>>
>>51982485
See this cock? You can suck it.
>>
>>51982485
>learn SQL
nigga it's just english, you just tell it what to do and it does it
>>
>>51982401
Brick is a table.
That table has an index named color with 1 value assigned to it (yes one, not three, you disregard the latter two).
You iterate over the brick table as if it was an array of elements.
You then try to print brick.color[0] which is an integer, not a table.

Also, Lua indexes start from 1. Read the tutorial & introduction, you've no idea what you're doing as of yet.
>>
>>51982516
You sound angry. Wanna talk about it, sport?
>>
File: HFO5Rz8.png (356 KB, 691x426) Image search: [Google]
HFO5Rz8.png
356 KB, 691x426
>>51982516
sorry, can't see that infected quist
>>
>>51982562
I know Lua indexes starts from 1, the for loop was just my way to discover if I can do something, but I didn't know the last two are excluded in the assignment.
>>
>>51982608
Your loop doesn't make much sense anyway, you iterate over the brick table (which has just one element named color), and for each iteration you print brick.color[0]. I think you want something like this instead:

local function GetRandomColor()
return math.random(0, 255), math.random(0, 255), math.random(0, 255)
end

local brick = {}
brick.color = {}
brick.color[1], brick.color[2], brick.color[3] = GetRandomColor()

for _, v in pairs(brick.color) do
io.write(('Color: %d\n'):format(v))
end
>>
File: dsfff.gif (403 KB, 640x360) Image search: [Google]
dsfff.gif
403 KB, 640x360
How do I learn JS?
>>
>>51980483
What animu is that?
>>
>>51982643
F12 in the browser console and start typing.
>>
>>51982628
Yes, this:
brick.color = {}
brick.color[1], brick.color[2], brick.color[3] = GetRandomColor()

this was the last thing I was thinking. Thanks
>>
I know this might be beyond basic but I've literally just started with this.

In C programming, why don't my equations show decimal places?

e.g when I do variable=10/4 I get 2, and not 2.5.
>>
File: 3428975.png (621 KB, 626x482) Image search: [Google]
3428975.png
621 KB, 626x482
>>51982682
Please learn what things like data types, variables, and assignment are before posting here
>>
>>51980921
>Which nodes are exactly X connections away from a specific node (while going the shortest route)
https://en.wikipedia.org/wiki/Breadth-first_search
>Which nodes are exactly X connections away from *any* node with a specific value
execute the above for every node; you might be able to throw some optimizations in, if it's a unidirectional graph
>>
File: e.png (165 KB, 1920x1160) Image search: [Google]
e.png
165 KB, 1920x1160
>>51982655
What do I type senpai?
>>
>>51982682
Because you're doing an integer division which results in an integer, you want to do this:
variable = 10 / 4.f
>>
>>51981758
0x7ffe65be4f48

xDDD
>>
>>51982712

sudo apt-get install gentoo
>>
>>51982720
>48-bit pointer
What is this shit?
>>
>>51982712
setInterval(function(){alert("lol penis")}, 3000)
>>
>>51982738
why not just

while(true) { alert("lol penis"); }

senpai?
>>
>>51982712
var x = "";
for(var i = 2; i < 100; ++i) {
var p = True, m = Math.sqrt(i);
for(var j = 2; j <= m; ++j) {
if(i % j == 0) { p = False; break; }
}
if(p) { x += i + ","; }
}
alert(x);

::))))
>>
>>51982757
Because the statement in the console will never terminate and your browser will just crash.
>>
File: mvp.png (547 B, 107x32) Image search: [Google]
mvp.png
547 B, 107x32
>>51982696

Not really helpful.

>>51982718

Thanks, that worked for me. Say I don't know if the final answer is an integer or not, is it useful to append any equations with .f or is this a bad idea?
>>
>>51982774
>
p = True

should be
p = true

>
p = False

should be
p = false
>>
>>51982628
brick.color = {GetRandomColor()}
>>
>>51982728
leading zeros are omitted
>>
>>51982728
% cat /proc/cpuinfo
address sizes : 39 bits physical, 48 bits virtual
>>
>>51982791
>Not really helpful.
No seriously, read up on types, it will all make sense then.
>>
>>51982485
DBA here.

answer incoming
>>
>>51982791
>Say I don't know if the final answer is an integer or not, is it useful to append any equations with .f or is this a bad idea?
Eh do you mean if a particular equation has only integer solutions or not?
In terms of programming it's what YOU want as the result - if truncation towards zero is ok, use integers.
If you want floating point, use floats.
If you want exact rationals, use a pair of numerator/denom numbers, etc.
>>
>>51982836
Where's the advantage in using 48 bit pointers instead of just the full 64? Which applications take advantage of the spared storage?
>>
>>51982774
You're supposed to declare all your variables at the top of a function scope and you're supposed to use triple equals, baka.
>>
>2016
>not using Java
>https://www.techempower.com/benchmarks/#section=data-r11&hw=peak&test=plaintext
>>
>>51982867
>You're supposed to declare all your variables at the top of a function scope
Not unless you or your users are really too dumb to understand JS's scope rules without doing that. You should be using the let keyword wherever possible, anyway.

>you're supposed to use triple equals
Yes.
>>
>>51980427
>2010+5
>jquery at all
>>
>>51982867
>you're supposed to use triple equals
only when the types differ
>>
>>51982791
you are not using equations, stop using that word
>>
>>51982728
No motherboard even has 64 bit wide physical bus lanes today, canonical form for all 64 bit implementations has top 16 bits all 1's or 0's (and in terms of virtual address space 64 bit kernels tend to assume the if top 16 bits are all 1's or 0's it either belongs to the kernel or userspace or has other kinds of protection tags)
>>
>>51982899
No, always, otherwise you're incurring performance hits and easily introducing bugs thanks to Javascript's desire to coerce your values into nonsense.

"Infinity" == Infinity
true


Thanks Javascript!
>>
>>51982866
Gotta ask that the jews at intel.
Maybe some savings in the page-frame-table and memory address translation?
>>
I don't have a VM handy right now. Is this correct syntax under UNIX to remove group read rights and give group execute rights in one command?

chmod file g-r,g+x

or would it look like this
chmod file g-r+x
>>
>>51982907

Why aren't I? My line says d=(4+(5*6))/3.f;

I'm equating one side of an expression to another, that's the definition of an equation right?
>>
>>51982925
This is like every single weakly typed languages, not just ES.
>>
>>51982925
>otherwise you're incurring performance hits
How does not comparing the type worsen performance, or do I have a too simplistic view of comparison operators?
>>
File: 1450534949272.jpg (110 KB, 561x426) Image search: [Google]
1450534949272.jpg
110 KB, 561x426
It's late, I'm bored, and I'm slightly autistic
here's a poll for trivial shit for you gsg

http://poal.me/snis8x
http://poal.me/snis8x
http://poal.me/snis8x
http://poal.me/snis8x

Why a class and not some free func/what I have in mind for usage:
>feed in control points, it caches a matrix resulting from multiplying the geometry and basis matrices for that curve & control points
>get a set of sample points for the curve based on a fed in sample count or get samples individually
>other stuff on that curve like the derivative/tangent to the curve
>>
>>51982945
latter, switch the file path and the mask's places though
>>
>>51982932
>Maybe some savings in the page-frame-table and memory address translation?
Yeah that makes sense, didn't think of other hardware using the pointers.
>>
File: Girls.png (490 KB, 449x401) Image search: [Google]
Girls.png
490 KB, 449x401
>>51981506
>>
>>51982951
Yeah, but JS is the only one that does it poorly.
"5" + 5 => 10
"5" .. 5 => 55
"5" == 5 => false
>>
>>51982885
>You should be using the let keyword wherever possible, anyway.
Not really senpai, there isn't much support for it yet.
>>
File: Selection_021.png (6 KB, 286x145) Image search: [Google]
Selection_021.png
6 KB, 286x145
>>51982978

PHP however thinks true = false
"foo" == TRUE, and "foo" == 0… but, of course, TRUE != 0.
>>
>>51982955
=== doesn't compare the types, then perform == if they're the same. It's a comparison operator without coercion. Because == still has to check the types of both arguments, and then tries various ways of coercing each one, it's slower than ===.
>>
>>51982992
> What is a transpiler?
>>
>>51982978
>
"5" + 5 => 10
"5" .. 5 => 55
"5" == 5 => false

Which implementation is that?
>>
>>51982967
thanks
>>
>>51982992
>>51982712
>>51982643
Please, mc fucking kill yourself.
>>
>>51983009
>Because == still has to check the types of both arguments, and then tries various ways of coercing each one, it's slower than ===.
I see, thanks
>>
File: php-loose-comparisons.png (23 KB, 715x408) Image search: [Google]
php-loose-comparisons.png
23 KB, 715x408
php is gr8
>>
>>51983004
>true = false
what
>>
>>51982845

OK I get it now. Even though I declared c as a float, I am getting an integer as an answer because I am dividing an integer by an integer.

float c;

c = (4 + (5 * 6)) / 3.f;
>>
File: 1450463515813.png (583 KB, 740x571) Image search: [Google]
1450463515813.png
583 KB, 740x571
>>51983039
>it's not even symmetric
>>
>>51983004
That's pretty dumb. Who thought it was a good idea for equality to coerce types?

>>51983017
It's Lua
>>
>>51983039
Not even JS is retarded enough to make things like "a" == true evaluate to true (although a non-empty string is a truthy value).
>>
>>51983039
>>51983059
Okay, nevermind it's not that bad
Still
>>
>>51983045
in PHP:
> echo "foo" == TRUE;
1
> echo "foo" == 0;
1
> echo 0 == FALSE;
1

Therefore TRUE == FALSE.
PHP is complete shit.
>>
>>51983093
this, desu
>>
>>51983093
you take that back
>>
>>51983104
>desu
oh since when is t~b~h replaced with desu?
>>
>>51983129
literally months ago
>>
>>51983129
desu senpai cuck
>>
>>51983129
>t~b~h
No idea what that is tbqh familia
>>
>>51982643
This is a good exercise:
https://jsfiddle.net/m66tpc4c/1/
>>
I'm in need of some optimization algorithm help.

I have x number of objects that have a start and an end coordinate. I need to determine the order of these objects so that the distance in between them (distance from the end of object 1 to the start of object 2 + from the end of object 2 to the start of object 3 and so on..) is as short is possible.

I can't really brute force it, because the number of ordering permutations is the factorial of the number of objects, so it grows ridiculously large after a small amount of objects.

What can I do? Does anyone know of any algorithms for this task?
>>
>>51981775

What the fuck uni do you go to? Most don't give a fuck about torrents as long as you keep it in moderation
>>
>>51982978
>JS is the only one that does it poorly

>>51983004
>>51983093

I'm pretty sure it's just weakly typed languages in general, anon.
>>
>>51983197
In JS true is not equal to false. Neither is it in Python.
>>
>>51983197
I'm sure that there are SOME weakly typed languages out there that don't violate transitivity.

Also, C is weakly typed but doesn't suffer from any of this shit thanks to static typing.
>>
>>51983129
Awhile ago, cuck was filtered too but I persistently whined on /qa/ and got it back.
>>
>>51983197
>JS is the only one that does it poorly
I don't know what runtime this anon is using, but it's neither Firefox nor Chrome.
("5" == 5) == True in both.
>>
>>51983179
>Aw, Snap!
>>
>>51983216
JS doesn't violate transitivity as far as I know (unless you count NaN, I guess).

>>51983211
Python is strongly typed, not weakly typed. You're mixing up strong/weak vs. static/dynamic.
>>
File: 1364267347_6129d0f4ee.jpg (79 KB, 333x500) Image search: [Google]
1364267347_6129d0f4ee.jpg
79 KB, 333x500
>>51983219
good job anon, I knew you could do it
>>
File: uruguay_04.jpg (36 KB, 700x471) Image search: [Google]
uruguay_04.jpg
36 KB, 700x471
what do you do when you're really tired but have like 2 weeks to finish something big and really really important?

I don't want to hire indians or anyone really, my codebase is too shit for that
>>
>>51983219
Great effort m8
>>
>php
0 === ceil(0)
is false
>>
>>51983292
>like 2 weeks

What is the issue here? Get to it, you lazy sack of shit.
>>
>>51983292
what do you have to do and in what language
>>
>>51983292
make someone else to do it for you, for free
>>
File: 1372988731571.gif (109 KB, 209x193) Image search: [Google]
1372988731571.gif
109 KB, 209x193
>php
md5('240610708') == md5('QNKCDZO')

The secret is that
md5('240610708') is '0e462097431906509019562988736854' and
md5('QNKCDZO') is '0e830400451993494058024219903391'.

Both are of the form 0e{bunch of digits}, a valid scientific notation. So when PHP's == decides to convert both sides to numbers to see if it can get a match, they're both converted to float(0), and thus the equality is true.
>>
I'm using visual studio for C, am I a bad person?
>>
>>51983420
No, you're just stupid.
>>
>>51983402
Fortunately, PHP also has === which should always be used.

>>51983420
I dunno about bad person, but Microsoft's C/C++ implementations are notoriously behind the times.
>>
>>51983446
>which should always be used.
Why does == exist then?
>>
>>51983446

Oh really? It's only temporary for a single semester. We've been told that we will be using better tool chains once we start doing embedded C.
>>
>>51980949

>scala
>>
>>51983474
Because PHP was made by idiots for idiots, and has an absurd paradigm of abandoning all pretense of consistency or logic in favor of "making sense" (in the way 2 == "2" makes sense).
>>
>>51983474
It's kinda useful when comparing input from a 3rd party and you don't care too much about type.

> wonder if the dba was a fucktard and made that column a varchar instead of an int...
> never fear, == is here
>>
File: 1438441304668.png (181 KB, 256x733) Image search: [Google]
1438441304668.png
181 KB, 256x733
How do I learn HTML?
>>
>>51983525
They could have also made it a string and your PHP code would happily report true for "dicks" == TRUE and keep chugging. Never use ==.
>>
>>51983420
Microsoft ignores anything past C89
>>
>>51983541
dude html is so easy its laughable. go do to the god damn codeacademy tutorial and you'll be an expert
>>
>>51983541
right click -> view page source
>>
>>51980949
>>ocaml
>>Object caml
>>nobody actually knows how to use, or uses, objects
sorry to tell you this but the C++/Java style of OO is actually a minor niche of what OO was originally designed to be in the orginal Carl Hewitt's actor model. C++ basically bolted on a very static concept of OO by combining C structs with functions. The OO system in Ocaml is far in advance of the rudimentary OO that has become standard in most languages

>>no parallelism in 2015
if you want to build huge scalable servers you should be using Erlang/Elixir

>>different operators for floats and ints
part of the type inference system, floats and ints would have to be explicity defined without these operators

>>standard library is borderline unusable, so everyone uses either batteries or core, with lwt or async for concurrency, in any combination, increasing fragmentation
by unusable you mean there is no standard library ecosystem that does everything for you do you dont have to write any of your own libraries. This is a sad fact that universities produce code monkeys who are incapable of even implementing a library on their own and are completely dependent on having others make black box libraries that they use blindly without even understanding how these libraries are implemented. Its should be noted that most bloated software today is a result of overuse of libraries and implicit trust that libraries will always seamlessly integrate with eachother.

>>effort gets repeated from scratch every few years instead of being built upon (see: parallelism, jane street and some dude for his PhD both tried, both from scratch, and ocamlpro's current attempt is also from scratch)
The fact that Ocaml has a set of different sets of libraries is a testament to the fact that Ocaml is not concerned with non-changing standards but is always striving for personalized interpretations that evolve the language

>>poor windows support, i.e. poor multiplat capabilities
dead platform
>>
>>51983573
I was about to post this
>>
>>51983575
>>>no parallelism in 2015
>if you want to build huge scalable servers you should be using Erlang/Elixir

>trying to defend no parallelism
I SHIGIDIGGIDY
>>
>>51983575
>part of the type inference system
Well apparently type class inference works just fine.
>>
>>51983575
>C++ basically bolted on a very static concept of OO by combining C structs with functions.

Not that there's anything wrong with that, considering 99% of C projects ended up being tons of structs + related functions.
>>
>>51982648
Utawarerumono: Itsuwari no Kamen
>>
>>51983640
>Status: Currently Airing
dropped.
thanks, anyway <3
>>
>>51983560
> example that has nothing to do with the situation from the quoted post

Tell me why anyone would actually compare something that might be an integer or a string to TRUE.
>>
Besides that book of autism, SICP, what are your favourite programming books, /g/?
>>
>>51983723
"dicks" == 0 is true, too. So if you're testing for equality to 0 and use == just in case they made the field a string and put "0" in it, you'll get fucked. Stop trying to justify shitty coding practice through contrived examples.
>>
>>51983622
>Well apparently type class inference works just fine.
except ML types not need to be grouped like Haskell type classes which makes ML programs more translatable and composable with outside programs because ML is more deeply based in theorem proving then lazy evaluation
>>
>>51983730
composing programs
>>
>>51983772
Okay, well, they need not be grouped, but that's why you have to use different operators for different types.
>>
>>51983730
dater strukurs n amgavibems
>>
>>51983730
Structure and Interpretation of computer programs is pretty good book too.
>>
>>51983818
What is that, Swedish?
>>
>>51983219
nice
>>
Using tried and tested solutions to problems means you're a "backwards thinking" conservative in politics.

Why is it socially acceptable to use tried and tested solutions in programming, /g/?
>>
>>51983772
>>51983804
Also what about ML is more related to theorem proving than Haskell?
>>
>>51983874
Because they work
>>
>>51983855
it's not swedish. google translate won't detect it properly but i'm guessing it's some very poorly written non-scandinavian language like dutch or someshit
>>
>>51983292
post it on open source or a code review site, and ask whats wrong with it, someone will fix it for you because autism
>>
>>51982945
>>51982967
^ is correct, should look like

chmod g-r+x file
>>
>>51983874

Think of it this way: 'functional revolution' shitters are liberals.

Sometimes it's better to be a conservative.
>>
>>51983219
Circa 2007
>>
>>51983877
because thats what ML was designed for, it was an automated theorem prover. the language just happened to turn out to be a good general purpose language as well
>>
>>51983874
good programmers are often conservative. fags use unproven shit like haskell, racket, crystal
>>
>>51983907
It's always better to be a conservative.
>>
>>51983945
>theorem prover based on only System F
What
>>
>>51980949
>durr
>>51983575
>write any of your own libraries
Cripple fight.
>>
>>51983896
MUH DATER STRUGERS AM AMGAMIBIMS
>>
>>51983945
>>51983982
>it was conceived to develop proof tactics
Being a tactic language is completely different from being a theorem prover.
>>
>>51984009
or some stereotypical swedish-like gibberish made up by an english-speaking person
>>
hey guys i have an idea for a really cool game but i need one of you to make it
>>
>>51984080
that'll be $100k a year plus tax
>>
>>51984053
Data structures and algorithms.
Is that more clear for you?
fug.
>>
>>51984090
Nah man, we'll split the profits, it'll end up being much better for you I promise!
>>
>>51984108
I'll start on the logo now.
>>
I'll be learning lua soon, what ide/editor should I use?
>>
>>51984080
What if
You add 2hu assets
And let them fight against each other
>>
>>51984108
your idea by itself is worth nothing

either you do the work or you pay someone up front for the work

it's unlikely you can find a serious partner unless you can bring something to the table like artwork or something other than just the idea
>>
I have a controversial idea for a website, which I know will cause a huge fuss and get a lot of traffic.

I don't want people finding out I'm the owner, but I also want it to be a legit website.

What do?
>>
>>51984090
I'll pay you in exposure and cheap beer
>>
AoC Day 21 somewhat refined solutions. I could still make it nicer by reading weapon, cost and armor data from a file:
w=[[8,4,0],[10,5,0],[25,6,0],[40,7,0],[74,8,0]]

a=[[0,0,0],[13,0,1],[31,0,2],[53,0,3],[75,0,4],[102,0,5]]

r=[[0,0,0],[0,0,0],
[25,1,0],[50,2,0],[100,3,0],
[20,0,1],[40,0,2],[80,0,3]]

def fight(myDam, myArm):
myHP,hisHP,hisDam,hisArm=100,104,8,1
myTDam,hisTDam=max(myDam-hisArm,1),max(hisDam-myArm,1)
myHits=hisHP/myTDam+(hisHP%myTDam>0)
hisHits=myHP/hisTDam+(myHP%hisTDam>0)
return myHits<=hisHits

minCost=9999
maxCost=0

for i in range(len(w)):
for j in range(len(a)):
for k in range(len(r)):
for l in range(len(r)):
if k!=l:
currCost,currDam,currArm=(sum(m[n] for m in (w[i],a[j],r[k],r[l])) for n in range(3))

if fight(currDam, currArm):
minCost=min(minCost,currCost)
else:
maxCost=max(maxCost,currCost)

print minCost
print maxCost
>>
>>51984080
Dear Sir,
I will develop your game for $200 in any language.
>>
>>51984201
>but I also want it to be a legit website.
make a list of things that you need for this, like hosting, certificates, etc
And then see if you can pay with bitcoins, if you can use something like [email protected]
>>
>>51984219
brainfuck. failure to complete this by Jan 1st will result in termination.
>>
>>51984201
you can get the domain name registered with the provider's name instead of yours. might cost a bit extra. i just registered mine normally and i got a fairly non-descript registrant name (not my full name)
>>
>>51982774
Speaking as a developer of 20 years. I must comment on the absolute horror that is your code. In all of my time as a programmer, my eyes have not been set on text as nausea inducing as yours. I truly hope that you stumped upon here from /v/ /pol/ or /b/ and if so, may you kindly go back. I sit here in disbelief at how any sentient humanoid can cobble together anything as disgusting as what you have presented.
>>
>>51984215
>refined
>4 nested loops
>>
>>51984219
Wtf is up with indians calling everybody 'sir' in every sentence btw? Do they all go through the same 'formal english' class that teaches them that?
>>
File: id_like_to_murder_my_wife4.png (102 KB, 849x476) Image search: [Google]
id_like_to_murder_my_wife4.png
102 KB, 849x476
>>51983402
>md5('240610708') == md5('QNKCDZO')

Damn, I never realised type juggling could be this evil. Are all weakly typed languages vulnerable to this kind of problems? Or has PHP gone too far? I mean, I understand casting string to float/int, but what happens here is casting string to expression: 0 * 10^a.
>>
>>51984249
Can you please tell me what I should improve?
>>
>>51984219
make a crysis 3 clone from scratch in x86 assembly
>>
>>51984297
Your life goals.
>>
>>51984258
ffs lad, alright I'll cut it down more
>>
>>51984313
Thank you for your contribution to this thread.
>>
>>51984270
weak and dynamic typing is always disgusting
>>
Did trap fag finally lose
>>
>>51984367
he still gets to make them and the jans seem to keep trap threads posted before the bump limit while deleting non-trap threads like >>51978383 but he's getting nowhere near each and every thread like he used to
>>
I have a question here.

I'd like to generate a mistake-based password in a text spelling a word I enter.

What I mean for example is a text with mistakes, and when you put the mistaken letters together, it spells a word.

Any idea where to start? This is a bit tricky.
>>
File: hui.jpg (46 KB, 306x523) Image search: [Google]
hui.jpg
46 KB, 306x523
We're going uncomfy slow again.
>>
>>51984452
You're making barely any sense.
Give an example for a text with mistakes.
>>
File: 1409904101002.jpg (205 KB, 750x1189) Image search: [Google]
1409904101002.jpg
205 KB, 750x1189
>>51984476
>hui.jpg
pfui
>>
>>51984478
Yeah, this is a bit hard to explain. Basically it's an old way to put messages in text, mostly used during WW2.

Example:

I want to hide the word TREE in my text.

My text could be something like this:

" Dear John;

I'd like to have your atention for a second, because what I am about to say is really impotant. Excpt if you don't have any time this week, could you pleas go and visit mom this weekend? I'd appreciate that.

Yours Truly,
Sally "

You can also mistake letters like this: Heartakhe instead of Heartache for example.

It's just a bit hard to see how I can do this. The text would always be the same, but depending of the word, it would randomly put mistakes in the text to spell that word.
>>
>>51984476
>tfw no nationalist qt3.14 programmer gf
Why even live?
>>
Why does:

int x;

for (x=0;x=10;x++)
{
printf("test\n");
};

Yield an infinite loop and not stop when x=10?
>>
>>51984540
find the first occurance of T, remove/replace it, repeat for R E E
Thread replies: 255
Thread images: 34

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

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.