[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
/dpt/ - 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: 35
File: commodore.jpg (877 KB, 1200x910) Image search: [Google]
commodore.jpg
877 KB, 1200x910
Old thread: >>54864614

What are you working on, /g/?
>>
>>54874365
1st for C#
>>
second for Python
>>
File: sicp.png (297 KB, 640x480) Image search: [Google]
sicp.png
297 KB, 640x480
a game
>>
>>54874454
Visual Novels aren't games.
>>
I am working on a parser.
>>
File: c#.png (4 KB, 353x191) Image search: [Google]
c#.png
4 KB, 353x191
>>54874391

Nice. Here's some C#.
>>
>>54874391
kys

>>54874444
kys
>>
>>54874365
6502 ASM... I wish my days were like this once again.
>>
>>54874487


no
>>
I know this might not be the thread but somebody shed me some light

I want to print files to pdf in the command line on wangblows and i can't find anything just bloated stuff
>>
>>54874516
>print files to pdf
nice meme
>>
>>54874516
What kind of file, anon?
>>
>>54874557
The kind that stores data
>>
File: 2016-06-02 11_22_06-Greenshot.png (369 KB, 922x830) Image search: [Google]
2016-06-02 11_22_06-Greenshot.png
369 KB, 922x830
What language should I use to build my universe simulator?
>>
>>54874365
I'm learning some JavaScript. What is a beginner project I can work on?
>>
I hope I live long enough to see the day when we can just say "fuck it" and throw away the hacky stuff like UTF-8, UTF-16, UCS-2 and all that crap and just store *ALL* strings in arrays of 32-bit unsigned integers. One array element per codepoint. To those who'd to code for low-memory environments, we could tell them to "fuck off and go get more memory". Those who use the wrong byte order, well, they can swap the bytes themselves.

It won't fix all the shit that's combining characters, normalization and all that, but it would go a long way towards saner world.

UTF-8 may be fine for storage, but when you have to start editing Unicode text... may $(DEITY) help you. You'll soon find yourself in a world of immense pain. Surrounded by character encodings, surrogate pairs, variable-length encodings and other horrors that lurk in the darkness and poke you from all directions. And you haven't even touched the combining characters yet.

---

Why yes, I've been dealing with Unicode and character encodings for several days now. I don't know how much longer I take it. I wonder how many death threats I would receive if I really converted everything to std::vector<uint32_t>'s. The thought is alluring.

A man can dream.
>>
>porting PHP to Python

I sure enjoy web """development""", I'd rather suck dicks
>>
File: error.jpg (122 KB, 1531x680) Image search: [Google]
error.jpg
122 KB, 1531x680
Whats wrong with this?

I am a beginner so please fuck my shit up.
>>
>>54874616
Node.js
>>
>>54874616
>elon musk
kek
>>
>>54874616
C
>>
>>54874655
while( (cin >> nliteral) != n_word[i])
>>
>>54874616

C, probably. It explains all the undefined behavior that's been ruining things for the past 200,000 years that humans have been around.
>>
>>54874668
>segmentation fault
>the universe collapses
>have to redo billions of years worth of simulation
nah
>>
>>54874557
All of them but i suppose it can only print files supported by the system right?
>>
File: 1444498958176.gif (2 MB, 494x640) Image search: [Google]
1444498958176.gif
2 MB, 494x640
>>54874650
I am willing to do both
>>
>>54874655
>>54874673
std::iostream 's >> operator returns the stream
(std::cin >> nliteral) returns std::cin
You want
(std::cin >> nliteral) && (nliteral != n_word[i])

The first bit casts std::cin to a bool, which returns whether or not the stream the stream has failed or run out
>>
File: physics001.png (1 MB, 1912x989) Image search: [Google]
physics001.png
1 MB, 1912x989
>>54874616
JavaScript for prototype, CUDA or OpenCL for high-perf implementation. I have tried and abandoned this project though.
>>
>>54874673

Thats what I did but the same error persist.
>>
>>54874701
javascript is shit there's no reason not to "prototype" in java or C++ or C
>>
>>54874695
Well, you would need to leverage a PDF converter from whatever filetype you're working with.

Only Windows 10 actually comes with a built-in Print-To-PDF.

Otherwise, you'd need to install Sumatra or something and leverage it from there.
>>
>>54874688

It seems to be what is driving our current universe, though.

Major error in Human v1.0:
- dnacpy is unsafe. If src does not contain terminator, dest gets filled with cancer. Please use dnancpy.
>>
>>54874761
the error is liberalism
>>
File: wormactuated1cn.webm (1 MB, 880x732) Image search: [Google]
wormactuated1cn.webm
1 MB, 880x732
>>54874727
There is a reason: 3-4x shorter dev time due to dynamism, GC and higher order functions, also a very good debugger and graphical environment.

If you write your prototypes in statically typed languages you don't value your time.

Serious people (scientists and engineers) understood these facts long ago, and so they develop their prototypes in python or matlab. Making a high-perf implementation is a programmers' job.
>>
>>54874739
i found this
http://www.pdfforge.org/pdfcreator/manual/command-line-parameters
how ever i have to
>install
>set up
>set up autosave
>add file to path
JUST

Basically that is all i want to do but i can't find something that will do it

Windows 7 doesn't have it
>>
>>54874616
>pic
wtf is this shit, maybe it's possible but you have no reason to assume that it's almost certain

there's probably a natural explanation for planck time other than it being the time step in some computer simulation
>>
How does one go about learning (variadic) templates and applying the correct reference qualifiers in C++?
Those things are as unreadable at times as they can be.
>>
File: photons02.png (50 KB, 640x480) Image search: [Google]
photons02.png
50 KB, 640x480
Another one of mine "create a Universe" attempts:
>>
File: arms are the cure.png (33 KB, 307x150) Image search: [Google]
arms are the cure.png
33 KB, 307x150
>>54874780

Truthfully. Wish we could get rid of it.
>>
>>54874701

Just because you couldnt doesnt mean others cant anon.
>>
>>54874792
KILL YOURSELF js is fucking shit there's no question about it, it's not even faster to write e.g. a js function as opposed to a function in other languages, yet you get all the drawbacks and bugs of dynamic shitlangs
>>
>>54874816
>variadic templates
easy
template <typename ... T>
auto somefunction(T&&... args)
(T& ... args)
(T ... args)
(std::vector<T>...&& args)
(std::tuple<T...> && args)
etc
>>
>>54874816
>correct reference qualifiers
impossible
>>
>>54874792
>>54874829
the only reason you might get 3-4x shorter dev time is if you know js and don't know other languages, if your experience with languages was the other way around it'd take 3-4x longer instead
>>
>>54874829
>a buttblasted C++ fanboi

How is it, still debugging these template "cannot be deduced" errors and segmentation faults? (^:
>>
>>54874900
retard
>>
>>54874900
he's right though, js is shit
>>
>>54874803
>planck time

He didn't mention planck time here, only that given the current rate of technological expansion (or any adjusted rate) that eventually human tech could create a realistic universe.
>>
>>54874883
Nope. It has been proven that functional and dynamic languages make for shorter dev time and shorter code.

Static languages, especially low level pointer-based static langs like C++ are super complex (grammar and semantics wise) and it is not uncommon to see several-level deep template type declarations, see any boost C++ source.

In javascript you don't need these verbose class delcarations just to push some elements into the array.

If you LOVE C++, you are a cuck. Even Carmack approves of dynamic functional programming languages (racket).
>>
>>54874943
but what's simulating the universe that's supposedly simulating us? and so on... is it turtles all the way down?
>>
>>54874983
The problem with most dynamic languages is that they're really just dictionary based languages
>>
>>54874913
>js a shit cause I said so
It's a stupid meme

1) HTML5/JS is a powerful platform that delivers applications to billions of people around the world, it runs on billions of devices.
2) Javascript is a descendant of Scheme and Self, so it is pretty cool language, especially if you forgive it its small defects. Solving the same problem in javascript seems to require 3-4x less code and 2-3x less dev time than solving it in C/C++/Java.
3) Fastest compilers/runtimes ever written for a dynamic languages were written for JS: V8, Chakra, Spidermonkey, Javascriptcore. JS is the fastest dynamic functional language in the world.
>>
>>54874825
>not having a 4chan passâ„¢
>>
>>54874983
carmack is an overrated meme almost as much as elon musk
>>
>>54875006

I won't give money to Hiroshimoot until he formally apologizes for Pearl Harbor.
>>
>>54874997
This isn't the problem, this is an enlightened solution to
template template interfact inherits extends class struct accessor getter setter

Let the computer just store your data with type tag, don't be a class-cuck.
>>
>>54874797
What kind of files are you trying to print to PDF, faggot?

That could make your life easier.

MS Office files?

Text files?

It matters.

Nothing can convert 'all files' to PDF.
>>
>>54875001
>haha i called it a meme so he's wrong
>>
>print files to pdf
>All of them
>>
>>54874459
It is the bare minimum of what can be considered a game, but it's still a game.

They're also piss easy to make.
>>
>>54875024
>hahaha dynamic typing is great, watch me compare it to shitty OOP programming in verbose C++
>>
>>54875028
>No constructive criticism
What else did I even expect of /g/, home of college "do mai homework" freshmen?
>>
>>54875001
>>54875024
you're clueless
>>
>>54875059
>home of >do my homework >freshmen
n e w f a g
>>
>>54875059
>/g/, home of college "do mai homework" freshmen
and shitty webcuck retards like you that unironically think js, one of the worst languages of all time, is good

kill yourself
>>
>>54875054
Compared to you I'm not a stupid meme child. I know and use C, C++, JavaScript and other languages. My point is that JS is good for rapid development while C and C++ are often necessary for achieving maximum performance.

Writing everything in C++ is fanboism.
>>
File: ucla gunman.png (487 KB, 418x578) Image search: [Google]
ucla gunman.png
487 KB, 418x578
>They stole his code
>He stole their lives

I wonder what he was writing, dpt?
>>
>>54875097
you're using the same algorithms and writing the equivalent code, it's not any better
>>
>>54875088
>unironically calls js one of the worst languages of all time
>codes in C
Hello 1970s anon! How is your PDP-10 doing?

(^:
>>
>>54875025
The user will be asked for a file so I just want to print anything it can be any document that's the thing it can be an image xml ms office text
>>
>>54875125
not sure if trolling or retarded

kys
>>
>>54875097
>compared to you I'm not a stupid meme child
>JS is good for rapid developme...

>it's another "lol C/asm" episode
when will people learn higher level languages don't need to be as slow as dictionary langauges
>>
>>54875121
Not needing to write 5-layed declarations for your datastructure and having real higher-order functions and GC helps greatly.

If you don't use these boons of engineering you are cucking yourself.
>>
>>54875160
nice meme shitkid
>>
>>54875170
>hahaha meme
Are you the same guy that unironically posts kys like it's his first day off the boat from reddit?

>>54875160
Dynamic typing doesn't need to be dictionary based & can feature static type annotations
>>
>>54875201
fuck off and die webshit
>>
>>54875053
it's not a game autismo
>>
>>54875149
>when will people learn higher level languages don't need to be as slow as dictionary langauges
V8 is very fast, just 4x slower than C++ on my benchmark.

Perhaps you mean strongly typed functional languages by
>higher level languages
?

I'm not into puzzles, I'm into programming. Sorry.
>>
>>54875201
>Dynamic typing doesn't need to be dictionary based & can feature static type annotations

I agree with that. Optional typing is cool. I used it in Common Lisp, could be done better.
>>
File: FATAL.png (43 KB, 529x508) Image search: [Google]
FATAL.png
43 KB, 529x508
Take notes, loli farming simulator dev-kun.
>>
>>54875219
Explain why they aren't games.
>>
File: collision01.webm (451 KB, 608x624) Image search: [Google]
collision01.webm
451 KB, 608x624
>>54875212
A daily reminder that you wouldn't be able to write picrelated in any language of your choice

... due to lack of algorithm and numeric knowledge

It is written in JS, by the way.
Turns out webshit is better programmer than you (^:
>>
>>54875285
Reminds me of that simulation that has like 80 dicks falling on top of each other.

And then one really long spaghetto dick.
>>
>>54875285
literally delusional and pathetic
>>
>>54875308
>>54875212
>>54875145
I would ask you to use a trip, but it's quite obvious which posts are you.
>>
File: EL3bTZ0.gif (684 KB, 500x281) Image search: [Google]
EL3bTZ0.gif
684 KB, 500x281
Anyone else think hobby coding is fun as fuck when on amphetamines?

One of my favorite things to do ever. I get addicted to solving those fucking bugs and optimizing code.
>>
>>54875328
you think those webms are impressive because it's the best you could come up with after "much effort" (for a webshit) and you gave up on it anyway lmfao kill yourself
>>
>dynamic typing is the only solution to type declarations
>>
>>54875347
It is dangerous, you will fuck your reward pathway with this shit.
>>
>>54875285
I bet that thing could run in 4KB of ram if written in C and not 600MB as it currently does.
>>
>>54875348
I'm not even the JS guy you're responding to.

I don't know why I always respond to your bait posts.
>>
>>54875348
You are conflating me with other poster, rageboi
>>
>>54875359
>type declarations are the only problem with statically typed languages
>>
>>54875385
What else is wrong with static typing?
>>
>>54875381
the js babby's first physics engine is not very impressive stop acting so smug about it
>>
>>54875359
>solution to type declarations
What's wrong with type declarations?
>>
Help me out /g/.

I'm trying to create a JQuery function that allows me to change the text color in randomly generated colors every second.

So far, I have
$(document).ready(function() {

spectrum();

function spectrum(){
var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
$('#text1').animate( { color: hue }, 1000);
spectrum();
}

});


Why isn't it working?
>>
make something new and improved instead of gloating about the same old webms for months on end
>>
>>54875406
They are a pain anywhere but on top level expressions.
>>
>>54875285
The only thing about that that's hard to implement in a real language would be the visual representation, but you'll probably find some framework to do that. The actual physics behind that is not that hard. I'm impressed that you bothered with Javascript for this for so long. Usually when I prototype I just check whether the idea works out and move on to a better language for the purpose.
>>
>>54875415
I disagree.
>>
>>54875406
>>54875415
Well, maybe I should say type ANNOTATIONS instead, not just type declarations, because type declarations in dependently-typed languages are just values.

>>54875424
Okay.
>>
>>54875373
There is always 4 MB for framebuffer anyway (that code rendered to 2d canvas)
Also
>Implying I can't just port the JS code to C once I'm done tweaking numbers and datastructures

As I have said: there is exploratory programming phase and optimization phase. If you are using C for exploratory phase you are cucking yourself out of time.

>>54875359
It isn't the only one, but it is the one that is widespread and works good enough.
>>
File: indians6.gif (60 KB, 1024x874) Image search: [Google]
indians6.gif
60 KB, 1024x874
>>54875412
>>
>>54875412
Post the error message, or if you don't have one, explain what the actual behaviour is. Did you really believe I was going to install and fire up Meme.js just to help you out, you entitled Pajeet?
>>
>>54875414
I'm trying to, anon. I'm trying.
>>
>>54875412
>I'm trying to create a JQuery function that allows me to change the text color in randomly generated colors every second.
There is a good reason why your computer decided that this function is not allowed to run.
>>
>>54875456
>>54875441
>explain what the actual behaviour is.
The color stays black.
>you entitled Pajeet?
I'm new here so I don't understand this meme. I'm sorry.
>>
>>54874683
This definitely explains quantum mechanics desu.

Randomness in particles? Probably some sort of floating point errors.
>>
>>54875475
shouldn't you have something by now with dat dere rapid prototyping
>>
>>54875431
>As I have said: there is exploratory programming phase and optimization phase

You know what they say, do it nice or do it twice.
There's no reason to start with javascript unless you asked your monolingual webdev retards to prototype your software.
>>
File: errors_temp.png (24 KB, 550x396) Image search: [Google]
errors_temp.png
24 KB, 550x396
>>54875406
>>
>>54875511
That's 100% the STL's fault, though.
>>
>>54875489

Exactly. It's IEEE-754 in action.
>>
>>54875492
Well, I have new celullar automata and I also have small symbolic differentiating code.

There are other projects going on though.

Implementing this one http://arxiv.org/abs/1605.06640 would be insanely cool, but I'm far from it.
>>
>>54875498
he's got a point
>>
>>54875489
>>54875529
hallo

That doesn't even make sense why woudl the universe be programmed in a language that the universe invented
>>
>>54875391
Rules of the type system must always be followed, even when they're too rigid
Poor (if any) support for anonymous types
Poor (if any) support for apply/spread operator functionality

>>54875406
This poster is Pajeet-tier. Java is the love of his life.
>>
>>54875498
this
>>
File: gccoutput.png (273 KB, 1904x838) Image search: [Google]
gccoutput.png
273 KB, 1904x838
>>54875527
So how do you cure it, add some BOOST peer reviewed high quality libraries? (^:
>>
File: 1452395055662.gif (44 KB, 600x600) Image search: [Google]
1452395055662.gif
44 KB, 600x600
>>54875362
Some truth to this, definitely. Amphetamines take discipline or they will curb stomp you.

Plenty of people are dumb with them though and don't even chug fluids, vitamins, food, don't sleep, etc. and that's where the worst of stimulants comes into play.
If you're smart about usage (and dosage) and have self control (yes, it's not common) then they are extremely effective. Also already making some serious dough.

https://en.wikipedia.org/wiki/Paul_Erd%C5%91s#Personality
>>
>>54875561
>Java is the love of his life
I don't program in Java.
>>
>>54875424
Me too. They're a pain everywhere.
>>
>>54875558
Hallo Freund, wie geht's
>>
>>54875511
I suggest you change your font color from red since that color elicits an instinctual response of anxiety due to a correlation with ones own blood and the fear of death.

You might have an easier time debugging with a soothing blue error text.
>>
>>54872798
LuaJIT doesn't work properly on 64bit x86-64 - specifically the runtime needs to be given memory which exists in the lower 4gb of address space which on some platforms (like OSX) is a PITA to do properly, not to mention it can restrict your memory usage if not worked around.
>>
File: 1440323535261.jpg (229 KB, 600x794) Image search: [Google]
1440323535261.jpg
229 KB, 600x794
I am not a programmer nor really that interested in programming, but lately I've been feeling an "itch" so I decided to start doing c++ today just for fun.

Today I've downloaded the compiler and after roughly 30 minutes of googling what is what and vague recollections (last time I touched C++ (or any programming language for that matter) was roughly 10 years ago) I've managed to make that FizzBuzz loop.

Do you guys have any recommendation on what I should try to do next? Should I just continue to fuck around and learn it bit by bit?
>>
>>54875069
Not an argument.
>>
>>54875602
>LuaJIT64bit x86-64runtimememory 4gb OSXPITA restrict
>>
>>54875561
>Rules of the type system must always be followed
Obviously.

>even when they're too rigid
Strictly speaking, a type system will always be either too rigid, or it will be unsound (t. Gödel). What exactly do you mean by "too rigid"?

>anonymous types
Structural typing.

>apply/spread operator functionality
That's a tricky one, but perfectly doable with dependent types.
>>
>>54875619
>Not an argument.
not an argument.
>>
>>54875617
>Do you guys have any recommendation on what I should try to do next?
Pick up something more reasonable to program in for personal hobbies, like Python or C#.
>>
simulation != reality

there's no evidence to suggest that we're living in a simulation
>>
>>54875558
>implying floating point errors are specific to C

There's probably some really advanced Alien programming language that uses it
>>
>>54875617

http://learnpythonthehardway.org/book/
Python 2.7 or 3.4
IDE: PyScripter

Thank me later.
>>
>>54875633
>Strictly speaking, a type system will always be either too rigid, or it will be unsound (t. Gödel). What exactly do you mean by "too rigid"?

I'm interested in creating systems, not in creating systems-while-solving-applied-CS-computability-type-theory-problems.

The best programming experience would be just telling the machine what to do in natural language and seeing it execute your order.
>>
>>54875658
That "book" is awful, though.
>>
>>54875488
Can you confirm
$(document).ready(function() {
$('#text1').animate({ color: 'rgb(255,255,255)'], 1000);
}
would work?

...

Wait, spectrum is tail-recursive? Nothing fundamentally wrong with that, but I don't think JQuery supports tail recursion (don't quote me on that). Have you done a noble language before or did you get the idea yourself?

I should note that there's nothing stopping your function from looping more than once a second, so maybe the "animate" part starts but never gets to finish? Or maybe the call to animate blocks?
>>
>>54875676
You didn't answer my question.
>>
>>54875681
this

anything by z.s. is fucking shit

anything python is also shit
>>
>>54875692
Ya I fucked up the brace but you get the idea?
>>
>>54875693
I'm not him.
>>
>>54875650
The funny thing about this is that we just can't know. We are talking about something that is by definition 100% disjunct from the perceivable world, so we can't ever find any evidence for or against it. It makes no sense.
>>
>>54875634
>not an argument.

you're the one that have to prove your argument.


do you know what burden of proof is you fucking faggot?
>>
>>54875693
He might be saying that _any_ restrictions are too rigid.
>>
Can someone post a good resume for someone just entering the industry? I could use some inspiration.
>>
>>54875719
i don't have to prove that js is shit or that statically typed code doesn't look like
template template interfact inherits extends class struct accessor getter setter


idiot
>>
>>54875725
There's a thousand examples and templates online, just remember to keep it at one page.
>>
File: enginestuff.png (49 KB, 1041x719) Image search: [Google]
enginestuff.png
49 KB, 1041x719
Crossposted from >>>/vg/143964450

I've been thinking about developing a Minecraft Clone engine for years now. I've more-or-less worked out the architecture of the engine (but not the rendering algorithms, since those depend on the hard question of "How pretty do I want it to look, at the expense of not letting poorfags play?").

What I want is a few highly-optimized native code modules, which are imported (embedded? I don't really know the terminology) by a scripting language, which then does all of the glue and high-level code. Message-passing would be used heavily, and a lot of stuff would work off of some standard APIs which could have any number of backing implementations.

So, what I'm wondering, is...

For the native code, do I use C or Rust?

and

For the scripting language, do I use Python or something else? Python is really designed around the kind of architecture I have in mind, but the problem is that Python really hates multithreading. Stackless Python is weird but I could look into that, I guess. Lua is for putting into your C applications, not the other way around. I have never used Ruby. JavaScript is hahaha no.


Excuse the informal-ass mspaint diagram, it's simplistic and vague on purpose because I'm just musing right now.

>>54874444
Is Stackless gud?
>>
File: resume10-fs8.png (104 KB, 808x1134) Image search: [Google]
resume10-fs8.png
104 KB, 808x1134
>>54875725
here you go
>>
>>54874444
wait shit I just noticed

Nice quad quads, snek friend.
>>
File: 1439465217401.jpg (22 KB, 604x438) Image search: [Google]
1439465217401.jpg
22 KB, 604x438
>>54875640
Well, I feel somewhat more comfortable with C++ since it's the only thing I can even vaguely recall and >>54875681 and >>54875699 don't seem to have a very high opinion about python.
>>
>>54875749
Why not C++ and Lua?
>>
File: is this real life.jpg (88 KB, 500x351) Image search: [Google]
is this real life.jpg
88 KB, 500x351
why and how do i have a consciousness what is this
>>
>>54875746
>i don't have to prove that js is shit
yes you have.

otherwise shut the fuck up
>>
>>54875791
take it to >>>/g/wdg or leddit or HN webshit
>>
Should I declare/initialize incrementers above the block where they're used or should I put them at the top with the other variable declarations? And is there a way to write all of these nested loops more succinctly?

    ignored = 0
scraped = 0
for q in queries:
for j in range(1, query_page_limit+1):
# page 0 returns same data as page 1 for search_users()
page = api.search_users(q, page=j)
count = 0
for user in page:
if user.id in ignored_ids or user.default_profile_image:
ignored += 1
else:
data[scraped_file][user.id] = date()
scraped += 1
count += 1
write_data()
print("Scraping query: %s | " % q + \
"Scraped: %d | Ignored: %d count %d" % \
(scraped, ignored, count), same_line = True)
i += 1
if i > total_page_limit:
print("Hit limit!")
>>
>>54875749
If the choice is between C and Rust, for new software, I would always choose Rust.

You can use anything for scripting, really. Because a lot of the glue is going to be marshalling between native modules, you don't even need an in-depth FFI as you don't want to "convert" to the scripted representation and back, just pass around opaque pointers.
>>
>>54875809
Nice rebuttal faglord.
>>
>>54875746
template <typename g, typename pos>
using nextPosition =
Position<
(pos::x + 1) % g::width,
pos::x + 1 == g::width ? pos::y + 1 : pos::y>;

template <typename g>
struct GridZipPositions {
template <typename p, typename c>
struct apply {
using pos = car<p>;
using grid = caar<p>;
using type = List<
nextPosition<grid, pos>,
grid_put<pos, List<pos, c>, grid>>;
};
};

template <typename g>
using grid_zip_positions =
caar<fold<
GridZipPositions<g>,
List<Position<0, 0>, g>,
g>>;
>>
>>54875819
https://whydoesitsuck.com/why-does-javascript-suck/
https://wiki.theory.org/YourLanguageSucks#JavaScript_sucks_because
https://www.leaseweb.com/labs/2013/07/10-very-good-reasons-to-stop-using-javascript/
http://archive.oreilly.com/pub/a/javascript/excerpts/javascript-good-parts/bad-parts.html

kys
>>
>>54875488
>>54875692
>>54875703
Ok, so I just got my primer on JQuery and now I'm off to eat. Check out the "Basic Usage" example on this page: http://api.jquery.com/animate/, it solves the delaying problem. Also proves that not using a loop for spectrum was a very good idea: kudos to you, webfriend.
>>
>>54875749
just clone https://github.com/fogleman/Craft
>>
>>54875777
/g/ is full of memes, don't take it seriously

dynamic languages are a boon, especially to a single dev
>>
>>54875760
Thank you, I appreciate this. What program did you make it in?
>>
>>54875871
kys retard
>>
>>54875561
To add to this:

Language is either slow to compile or develops warts to avoid slow compile times.
Language tends to accumulate more features, which means more poor interactions between features.
Language tends to encourage more complicated solutions.

>>54875693
I gave examples in my original post and the other anon communicated a sentiment similar to mine. I'm not necessarily defining "too rigid" in terms of what is and isn't possible, but in terms of what is and isn't well-supported. If implementing something boils down to an awkward incantation or an hour's research, that's a problem.

You seem to have the opinion that the soundness of a type system is by far its most important quality, which is a feeling I've never understood. When the focus is on catching errors at all costs, you end up with a really complicated language and it harms productivity.
>>
void readConfig(FILE* fd, int *conf){
int i;
char* str;

str = calloc(UNIX_PATH_MAX+1, sizeof(char));
for(i = 0; i < 5; i++){
do{
if(fgets(str, UNIX_PATH_MAX, fd) == NULL){
errno = EIO;
}
}while(str[0] == '#');

str = strchr(str, '=');
if(str == NULL){
errno = EINVAL;
}
str++;
conf[i] = atoi(str);
}
}


I have this code, and Valgrind says that on the line
if(fgets(str, UNIX_PATH_MAX, fd) == NULL)
I have an invalid write of size 1, which would make sense if I was allocating UNIX_PATH_MAX space, but I'm using the above calloc with UNIX_PATH_MAX+1, and I can't figure the error.
>>
>>54874997
lel, no.
>>
>>54875814
for q, j in product(queries, range(1, query_page_limit+1)):

product is from itertools. taking advantage of the fact that the range doesn't depend on the value of q
>>
>>54875887
>When the focus is on catching errors at all costs, you end up with a really complicated language and it harms productivity.

Haskell pioneered puzzle-oriented programming paradigm. It is a language that attracts attention of autistic-but-not-bright users that happen to like to solve puzzles while programming.

Literally I heard from haskell/scala people that they find it way more "fun" to solve problems in these PLs, lol.

Make programming puzzling again! (^:
>>
I'm not working on it anymore, it's pretty much finished now. I wrote a program which converts data to sound, which can store data on cassette tapes and retrieve it reliably.
>>
>>54875921
>autistic-but-not-bright
aka spergs
>>
>>54875777
People like to get buttmad at Python for reasons (slow, whitespace issues, etc) but it's really easy to pick up if the last time you did something was years ago, especially if you don't want to do anything major like working for a/starting your own company and just wanna make thing. I don't recommend anything by Shaw, though; the guy means well but he's another example of someone in the programming field who is probably good at what he does (I actually have no idea if he is) but is completely unable to teach what he knows in an acceptable manner. Stick with O'Reilly and Boku no Google Search when stuck.
>>
>>54875784
>Why not C++
My hipster friends would hate me if I used C++. ;_;

(also they wouldn't be entirely wrong, since C++ has some pretty weird intrinsic problems resulting from it having a billion features, like the new vs malloc thing)

>Why not ... Lua?
Partly I explained why, and partly because I hate certain things about the syntax / featureset. If I wanted to use Lua I'd end up forking it, 100%. This is not a joke option however and I think I could really get into coding an extended fork of Lua, so that's not the worst idea.

>>54875816
>If the choice is between C and Rust, for new software, I would always choose Rust.
Aight, neat.

Rust is supported on many fewer platforms and by many fewer other pieces of software. Also, its lifetime system is confusing as a motherfucker. On the other hand, C is VERY DIFFICULT to build useful abstractions in. Rust has a bunch of cool modern language shit while also being more stable than C and roughly as fast.

>as you don't want to "convert" to the scripted representation and back, just pass around opaque pointers.

Yeah, absolutely - this is also important for performance reasons. Pretty much every mainstream scripting language has a
>>
>>54875947
Python is not even slow if one uses PyPy.
>>
>>54874616
This argument is infinitely generalizable; in other words, any civilization with sufficiently complicated simulations can make this argument - even the True Base Reality.

Turtles all the way down, Musk says. He thinks it's more likely that there are simulations on simulations on simulations. But who is he to say that there are one billion turtles and we are arbitrarily any one of them? These are observations fundamentally outside of our control.

All we can know is that there is not an infinite amount of simulations and there can be no platonic Universe simulator; only statistically accurate comparisons. If Musk builds a perfect simulator, then Musk's simulation must simulate Musk, who builds a perfect simulation simulator. Continue for infinity until you have computation that is inherently infinite - a violation of the Heat death of the Universe. Either entropy is not increasing towards a state of energy homogony in the Base Universe, thusly making our simulation fundamentally inaccurate due to a false law of thermodynamics, or we ARE the base Universe.
Musk says that the Bayesian probability distribution is heavily skewed towards the right - the median probability that we are the base Universe is p < 1/10^9. I wonder why.
>>
>>54875921
> autistic-but-not-bright

Are you this French troll with a useless PhD that does not need no functional programming?
>>
>>54875882
That's latex. I am not that guy, but I've seen the format he used before (I use it myself), you can find it at

http://www.latextemplates.com/template/moderncv-cv-and-cover-letter

The site has other templates as well.
>>
>>54875972
Or Cython (apparently)
>>
>>54875871
>>54875947
Not him but I run into this problem where dynamically-typed languages are harder for me to write than statically-typed ones.

I think I'm not in the right mindset - for me, a type system can be the code equivalent of an outline for an essay. I lay out what I'm going to do when I declare variables and define functions, and then that helps me focus on what to do when I actually write code. I don't really have a process for writing dynamically-typed code.

Plus I have this weird anxiety where whether a variable exists on a class or not feels like a pointer that could be null, so I almost want to put checks like "Does this class actually have this variable?" around every single time I do anything.
>>
>>54875777
If you're comfortable with C++, C# would be an easy switch and make your life much easier.

Doing anything with GUI is trivial, and unlike C++, most basic functions for doing nearly anything can be reduced to a line or two.

Less time programming, more time actually doing stuff.
>>
>>54876025
Nope, I don't even have a degree. Fuck degreed aristocracy.
>>
>>54876074
Dynamic languages require iterative development and testing, if you do it this way it will work.
>>
>>54876029
>Or Cython (apparently)
Cython is fucking magical, it's so cool. I don't know why more people aren't writing actual software (as opposed to C library wrappers) in it.
>>
How do I get started with code and programming in general?

I know nothing about it, but I'm taking my first general CS class in September, and I'd like to get a head start with some good information and practice.
>>
>>54875125

>C
>PDP-10

Wrong.
>>
>>54876074
I agree completely.

I simply cannot do Python because I expect a variable to be what it should be, because later down the line, I'm going to want to treat it a certain way and I don't want to have to keep tabs on everything manually.
>>
>>54876113
>iterative development and testing
in other words the dev time is not 3-4x shorter
>>
>>54875901
thanks this works perfectly
not sure I understand it desu
>>
>>54876137
http://programarcadegames.com/
>>
>>54876137
What's your preferred settings and player count for a game of Super Smash Brothers?

I can likely recommend you a language based on this.
>>
>>54876137
https://docs.oracle.com/javase/tutorial/

WHATEVER YOU DO DON'T GO WITH PYTHON FOR FUCK'S SAKE
>>
>>54876167
Not that guy.
I don't like SSB because my friends only do 1v1 no items omega stages to be pros and I suck at the game.
Go on suggest me something.
>>
>>54876146
Well the thing is I'm >>54876074
and I'm not shitting on Python, I just don't understand how to be productive in it. I want to be good at dynamic language coding but it somehow doesn't click.

>>54876113
Thanks. People have been telling me to get my head out of waterfall-land for years, gotta try harder to do that.
>>
>>54876151
There is research showing that it is shorter, though by lesser amount. Iterative development is fast. Testing isn't necessary, and it is useful for static languages too.

I'm tired of this argument, I use both types of languages anyway.
>>
File: sad_clown.jpg (39 KB, 400x442) Image search: [Google]
sad_clown.jpg
39 KB, 400x442
>>54875947
>>54876076

Aye. Thanks for the input. I guess I'll try Python and C# next.

Also as a side question, how many billion steps above FizzBuzz would making a simple pacman game in console be?
Just for the reference.
>>
>>54876122
I've been learning Python so that I could start using it and see what it's like, just haven't had much time with work during the week.
I like the concept itself, nice way to get the best of both Python and C
>>
>>54876167
In 4?

2 stocks, 6 minutes, 2 players.

4 players if im with buddies. But if a random guy, 1v1 is better for me.
>>
>>54876196
http://programarcadegames.com/ not much
>>
>>54876170
Whats wrong with python?
>>
>>54876189
>I suck
python
>>
>>54876167
Lives/stock with 5 lives.

3 or 4 players.

Items enabled but not bullshit powerful ones like the smash ball or the invulnerability star.
>>
>>54876189
>because my friends only do 1v1 no items omega stages to be pros
Okay, good.

First of all, you're going to want something more casual and easy to do stuff with.

C# and Python are probably the best hobby languages right now.

Python writes and reads like English, but is not very similar to other langauges.

C# writes and reads in a C-like syntax, but it's still extremely abstracted and easy to work with.

Pick your poison, both are very popular and don't require you to be hardcore to get stuff done.
>>
>>54876207
>>54876234
java followed by C++
>>
>>54876170
why not both?
a lot of dev ops today rely on Python
>>
>>54876226
nothing wrong with it if you're a reddit tier casual but then you might as well drop out already
>>
>>54875855
I want to write my own because I'm academically interested in this shit
>>
>>54876294
AlphaGO was programmed in Tensorflow, thus in Python.

Instagram and Reddit are based on python.

Cutting edge machine learning research is dominated by scientific python stack.
>>
>>54876314
>Instagram and Reddit are based on python.
and bleed money like crazy because of server hosting expenses
>>
>>54874983
>It has been proven that functional and dynamic languages make for shorter dev time and shorter code.

No it hasn't
>>
>>54876279
Python looks pretty great for dev ops.

However, a sysadmin buddy of mine was Python-only for a long time, and I start showing him how stupid easy it was to do some of the stuff he was doing in C#, and he ended up switching over.

It certainly helps that basically 100% of enterprise environments use Windows for their users, but I've written automation pieces for unix systems in C#, too.

I think it really amounted to the fact that I was better at C# than he was at Python, so it was easier for me to write the meat-and-bones of something and him follow up, rather than the other way around.
>>
>>54876314
>AlphaGO was programmed in Tensorflow, thus in Python.
AlphaGo was programmed with Torch and C++ for your information.
>>
>>54876028
Cool, thanks!
>>
File: smug_sakura.jpg (29 KB, 337x404) Image search: [Google]
smug_sakura.jpg
29 KB, 337x404
>Haskell fanobois hype their language as "mathy" and good to develop research code in

>In 2010-2016 we have explosion of deep learning research, many impossible tasks were conquered

>Deep learning researchers use python, lua, C and CUDA

>Nobody uses haskell for AI/ML research

>mfw
>>
>>54875777

C++ is all right, but it can be confusing as fuck for a casual coder. Things are changing fast in the C++ world, what with the new standards. If you're on UNIX or Mac, C or C++ is a good option, 'cause that's the most common language in UNIX.

I personally dislike Python, but it's a capable language with a lot less dark corners and gotchas than C++. It's got tons of libraries available, and it's pretty easy to pick up. The documentation is excellent - you may not need a book at all. (The reasons I don't like it are all subjective personal stuff, nothing against the language itself.)

There's a shitload of youtube videos out there. Maybe try writing a game or something? Breakout's easy enough to do.
>>
>>54876170
>>54876231
>>54876294
fyi you're a memer

t. a C coder who doesn't enjoy puerile e-penis measuring contests
>>
>>54876359
I thought so until I read that AlphaGO used google's TPUs, TPU support is native to tensorflow. Maybe they used both.
>>
>>54876323
might as well program in JavaScript kek
>>
>>54876378
Oh, the irony.

>lol I don't epeen measure
>btw I'm a C 'coder', no big deal
>>
>>54876378
this guy: >>54876241 suggested almost the same
>something more casual and easy to do stuff with
>C# and Python
>>
>>54876394
IBM uses and promotes node.js : https://developer.ibm.com/node/sdk/
>>
Does anyone know a good resource for learning SQL?

Ive been looking for something to play with that doesnt require me to set up a sever somewhere.
>>
Is it possible for someone who has no programming experience to learn the basics of Java and then start learning Android development to get a Android job in a year?
>>
File: harp.jpg (49 KB, 934x525) Image search: [Google]
harp.jpg
49 KB, 934x525
>>54876367
>Haskell fanbois hype their language as "mathy"
>write extremely easy mathy op task
>Haskell fanbois don't understand
>>
>>54876413
no pajeet
go work in a field
>>
>>54876413
yes
>>
>>54876413
Certainly not impossible.
>>
>>54876380
>Maybe they used both.
I checked some emails, this was indeed the case so I guess my info was a bit wrong as well. Even so, the codebase was mainly C++.
>>
>>54876413
Possible? Yes

Probable? Absolutely not.

If you have a lot of free time sure, but learning Java is hard enough, doing enough work in a year to show that you know what you're talking about and actually get a job doing android development?

The fact that you have to ask on /g/ if it's possible already shows that you don't have the chops to do that
>>
>>54876447
>emails
Wow, did you mail relevant people directly?

I have my conclusion purely from public information.
>>
>>54876408
IBM used and promoted smalltalk, you can see how that turned out.
>>
>>54876413
Yes, if you treat it like an internship.

And by that, I mean that you should spend at least 40 hours a week actively learning, writing code, and testing.

Don't play video games all day and you can pretty much learn anything.
>>
>>54876460
Uber uses Node.

Uber is 25 billion company.
>>
>This is what C++ fanbois do in their spare time

http://blog.mattbierner.com/stupid-template-tricks-super-template-tetris/
>>
I need help finding something to create or work on, how did you guys go about creating or helping with a presentable project?
>>
>>54876496
search github
copy
>>
>>54876491
old news

>hasklel will never be this powerful
>>
>>54876491
blogfags are irrelevant, there are countless JS blogfags that are far worse
>>
>>54876459
I've been in computer go circles for several years as a hobby. It's a very friendly community, and over time you get to know people. Might have something to do with the fact that researches like to talk about their work.
>>
>>54876496

Do something you need.

I needed my girlfriend to be able to bring up or down the firewall from her desktop. She's on Windows, the firewall is OpenBSD.

So I wrote a server that listened for packets and did the firewall manipulation, and then a little client that ran in her systray that she would control it with. It was fun and was the first time I wrote GUI code in Python.
>>
>>54876529
http://davidbkemp.github.io/jsqubits/
(^:
>>
>>54876546
you fucking suck if you think a "JavaScript quantum computer simulator" impressive
>>
>>54876471
>>54876454
>>54876439

Fuck you faggots I just wanted someone to say something I wanted to hear. Fukc programming i bet you faggots don't even play sports.
>>
File: normiesunwanted.jpg (464 KB, 1131x1600) Image search: [Google]
normiesunwanted.jpg
464 KB, 1131x1600
Where were you when the great functional programming revolution happened, Anon ?
>>
>>54876454
>learning Java is hard
ok pajeet

>The fact that you have to ask on /g/ if it's possible already shows that you don't have the chops to do that
tru tru
>>
>>54876542
Perfect response, thanks i was looking for something like this. I recently finished up writing some frontend interaction for the Transmission server daemon, guess ill kick it up a notch like you said and start making my own listener. Just gotta find something to listen and manipulate now.
>>
>>54876477
Uber's success is more due to its unique business model, not technical performance really.

>Facebook was originally written in PHP

>PHP

>fucking PHP
>>
>>54876616
>unique business model
it's literally illegal in many countries, it's not very unique it's just that they had the arrogance to pull this off without giving a shit about legislation
>>
>>54876577
Functional programmers would never support communism
>>
>>54876616
I look at this from another point: choice of language is almost irrelevant (if it is dynamic), almost any business can succeed using almost any language.
>>
>>54876649
>choice of language is almost irrelevant (if it is dynamic)
kill yourself
>>
>>54876631
I can't say that freelance taxishit is inherently a bad idea, but Uber's management are assholes yeah.

>>54876649
No argument there! You're right. That doesn't mean certain languages aren't better than others for certain tasks, but that has less to do with how successful the business is and more to do with how much the people who have to maintain the code will have to suffer.
>>
>>54876660
Hello language fanboi (^:
>>
>>54876674
>Uber's management are assholes
to say the least

>Uber Technologies Inc, an American international Technology company. Uber B.V. is owned by Netherlands based company Rasier Pacific V.O.F. They are the subject of ongoing protests and legal action from taxi drivers, taxi companies, and governments around the world. Uber is "mostly illegal in most jurisdictions."[1]
>Uber is involved in at least 173 lawsuits.[2] As of mid-2015, protests had been staged in Germany, Spain, France, and the United Kingdom, among other nations, and dangerous incidents involving passengers have been documented.[3][4] Uber executives were arrested in France in June 2015. In December 2014, Uber was banned in Spain and in two cities in India. Uber continues to be involved in disputes with several governmental bodies, including local governments in the U.S. and Australia.
>Governments have been largely unable to stop Uber's operations in their jurisdictions because its operations are conducted primarily over the Internet. In addition, Uber is said to use extremely aggressive tactics such as bullying and hiring investigators to "dig up dirt" on journalists who criticize them.[5] Portland, Oregon's transportation commissioner called Uber management "a bunch of thugs".[6] A commissioner in Virginia who opposed Uber was flooded with emails and calls after Uber distributed his contact information to all of its users in the state.[7]
Thread replies: 255
Thread images: 35

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.