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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 326
Thread images: 32

File: 1488604517373.png (909KB, 1280x720px) Image search: [Google]
1488604517373.png
909KB, 1280x720px
Old thread: >>59260749

What are you working on /g/?
>>
learning gpu programming

any tips?
>>
>>59266231
Thank you for using an anime image!
>>
>>59266231
"While I love the power of Lisp, I am not a devotee of functional programming. I see nothing bad about side effects and I do not make efforts to avoid them unless there is a practical reason. There is code that is natural to write in a functional way, and code that are more natural with side effects, and I do not crusade about the question." -Richard Stallman
>>
I have a question regarding console applications. I want to make a program, which upon first login asks to create an admin account. Then, that admin account can create new accounts and save data in a txt file. All encrypted of course.
Now, I have a problem; how do I change between accounts without using some sort of database? All account information will be in a single txt file, each in it's separate line. How do I switch between them? All of them will have ID's, with the admins being 0.
>>
first to show off my pro code Ive been a python major for 7 years now
I made a cool ass digital clock
import time,datetime

a0 = ["00000"," 11 "," 222 "," 333 ","4 4","55555"," 666","77777"," 888 "," 999 "]
a1 = ["0 0","1 1 ","2 2","3 3","4 4","5 "," 6 ","7 7","8 8","9 9"]
a2 = ["0 0"," 1 "," 2"," 3 ","44444","55555","6666 "," 7 "," 888 "," 9999"]
a3 = ["0 0"," 1 "," 2 ","3 3"," 4"," 5","6 6"," 7 ","8 8"," 9 "]
a4 = ["00000","11111","22222"," 333 "," 4","55555"," 666 "," 7 "," 888 ","999 "]

def numap(w,x,y,z,f):
print(a0[w] + " " + a0[x] + f + a0[y] + " " + a0[z])
print(a1[w] + " " + a1[x] + f + a1[y] + " " + a1[z])
print(a2[w] + " " + a2[x] + " " + a2[y] + " " + a2[z])
print(a3[w] + " " + a3[x] + f + a3[y] + " " + a3[z])
print(a4[w] + " " + a4[x] + f + a4[y] + " " + a4[z])

while True:
print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n")
t1 = datetime.datetime.now()
da = int(str(t1.hour).zfill(2)[0])
db = int(str(t1.hour).zfill(2)[1])
dc = int(str(t1.minute).zfill(2)[0])
dd = int(str(t1.minute).zfill(2)[1])
if(t1.second%2==0):
ddd=" *** "
else:
ddd=" "
numap(da,db,dc,dd,ddd)
time.sleep(1)
>>
>>59266262
Why are you using a text file?
>>
>>59266262
Why are you reinventing the accounts/permissions system already on your computer?
>>
I am about to shoot myself in the head due to lack of python documentation for QGIS. Someone save me.
>>
>>59266253
Abandon ship. Unless you don't do it solo. You will never have the time to make a complete application on that low level solo.
>>
>>59266269
Why not just use one multidimensional array?
>>
>>59266269
why didn't you just use a dict to store all the letters?

>hitlerwasright[7]
>>
File: tmp_8515-1459420805558719379485.gif (284KB, 400x225px) Image search: [Google]
tmp_8515-1459420805558719379485.gif
284KB, 400x225px
>>>59266196
BTW you can repurpose your solver as a random state scrambler. Most fags scramble with random moves but random moves does not guarantee a random scramble. Random moves make easier scramble show up more often. It's not as a big deal when working with 8 puzzles but when doing 15 puzzles it's noticeable and pain obvious on higher order ones.
For scrambling:
>generate random state
>check parity to see if it's possible to solve
>if impossible go to step 1
>else solve it
>print out the inverse of the solution as the scramble
>>
>>59266283
>>59266284
Because it is for a school project obviously, it has it's limitations on what you're supposed to use.
>>
>>59266304
I just want to apply for roles in machine learning that require GPU programming
>>
>>59266307
was my first plan I didnt feel like doing it

>>59266308
? because appending a row would require thinking wich I cant do but as excuse I'll say that I didnt feel like thinking today
>>
>>59266315
Machine learning GPU programming is very easy. It's all just parallelizing matrix math.
>>
>>59266346
That's relieving to hear. Is the hard part in GPU programming game development stuff?
>>
>>59266231
>>What are you working on /g/?


saving enough money to give a proper thanks to this fella
>>59266311
>>59266282
>>59266117
>>
>>59266353
Graphics are harder then just math.
>>
File: tmp_1142-1488762536964-204106086.gif (1024KB, 500x354px) Image search: [Google]
tmp_1142-1488762536964-204106086.gif
1024KB, 500x354px
Can I escape Python?
Where to run?
>>
>>59266371
*than
>>
>>59266346
Can I use languages besides p*thon?
>>
>>59266375
sure, C -> Haskell -> Lisp
in this order.
>>
>>59266379
C or C++
>>
>>59266375
Just jump straight to Lisp.
>>
>>59266399
only if you want brain cancer.
>>
>>59266375
To lisp
come to lisp :) ()())))))))))))((((((())))))
>>
>>59266370
btw I wasn't the same guy who gave the implementation advice. I just gave the info about random state scrambling since speed solving 15 puzzles is one of my hobbies.
>>
>>59266396
>>59266375
I have three years coursework of Java with a sprinkling of perl and scheme; will an AI course taught in Python and a computer vision course taught primarily in C be survivable?
>>
>>59266415
Yes, unless you're a brainlet
>>
>>59266396
what should I use with C?
>>
>>59266423
CUDA
>>
>>59266415
You'll survive but they may do some autistic stuff with python you won't understand immediately.
>>
File: 2017-03-06-121027_563x126_scrot.png (24KB, 563x126px) Image search: [Google]
2017-03-06-121027_563x126_scrot.png
24KB, 563x126px
Hey guys I'm just learning C now and what's everyone's obsession with pointers? I understand what they do, but why do people use them all the time? Why use pointers for adding 2 numbers?
>>
>>59266402
What would give a person brain cancer if he went from python to lisp?
I did it and I feel fine
>>
>>59266444
>but why do people use them all the time?
Pointers are absolutely vital in C. It would be very difficult to write a non-trivial program without using them.
>Why use pointers for adding 2 numbers?
That is a typical situation where you would use a pointer.
>>
>>59266466
>That is a typical situation where you would use a pointer.
Fuck, I missed a vital word.
You WOULDN'T use a pointer for that.
>>
>>59266262
>>59266312
please respond
>>
I want to get into gamedev but I don't want to learn a meme language
Wat do?

>unity :D
>>I don't want to learn a meme language
>>
>>59266444
>he doesn't have pointers to pointers of arrays of pointers pointing to pointers of pointers
>>
>>59266450
>What would give a person brain cancer if he went from python to lisp?
the retarded thing they both have in common. he needs a cleansing which will be accomplished by C and subsequently haskell. then he should learn lisp for the macros.
>>
>>59266489
/dpt/ answer: Roll your own engine. Actually, fuck the game: the engine is enough.
/agdg/ answer: Use Unity and slap some bought assets into your shitty "game".
>>
>>59266489
lurk in /vg/agdg/ and try to understand basics before calling something a "meme"
>>
>>59266489
Use existing engine (irrilich, ogre3d, openscenegraph, urho3d, gameplay3d) and program with c++.
Or use you choice of language, pretty much all of them have wrapper for sdl and opengl.
>>
>>59266530
C# is a meme language no matter how you put it though
>>
>>59266530
>>>/vg/agdg/ *

>>59266546
thats true, I didnt know unity uses C# as I dont develop games personally my bad
>>
hello python noob back again
>>> for i in listb:
... lista.remove(i)


What can I do to stop it erroring out if listb contains something not in lista? Like a catch or an if contains or something like that

ex lista=[1,2,3] listb=[5,6,7] would make the above code crash and I just want it to do nothing and be like okay we tried to remove it and it wasn't there and that's okay
>>
Is SICP still relevant?
>>
>>59266570
>>> for i in listb:
try:
lista.remove(i)
except ValueError :
print(i)
>>
File: autismmsitua.gif (3MB, 320x180px) Image search: [Google]
autismmsitua.gif
3MB, 320x180px
>>59266546
>>
>>59266615
are you seriously implying that c# is not a meme language
>>
How does /g/ average two numbers?
#include <string.h>
int main(int argc, char* argv[]) {
return ((atoi(argv[1]) >> 1) + (atoi(argv[2]) >> 1) + (atoi(argv[1])&atoi(argv[2])&1));
}
>>
>>59266642
i am not makiing that argument, though i could.
i am pointing out that you are autism cuz you say it is a maymay language
>>
>>59266657
>telling the truth is autism
nigger detected
>>
>>59266662
>nigger detected
in yo mama's ass
>>
>>59266489
>meme language
>>>/r/eddit
>>
>>59266642
>a meme language
>>>/r/ibbit
>>59266657
>"""""maymay""""" (?) language
>>>/r/abbit
>>
>>59266498
Understandable, not everyone can handle the freedom of dynamic typing, and need to have the compiler hold their hands. That's why in Lisp, you can have this (quoting an example from the Hyperspec):
 (defun equidimensional (a)
(or (< (array-rank a) 2)
(apply #'= (array-dimensions a))))

(deftype square-matrix (&optional type size)
`(and (array ,type (,size ,size))
(satisfies equidimensional)))

You can then use FTYPE and TYPE to declare your types in a DECLARE form. Need monads? There are macros for that. Currying isn't given by default, but that is a pretty simple function. Purity isn't too much of an issue, and the Hyperspec documents cases where side-effects occur anyway.
>>
>>59266676
>C# isnt a meme language
>>>/reddit/r/programming
>>
I'm so glad Lisp """programmers""" exist. I'm a pretty average programmer, but I look like a genius next to one of them.
>>
>>59266694
>there exists an x such that it is a meme language
>>>/r/abbit
>>
>>59266644
 avg =: +/ % # 
>>
>>59266706
>disagreeing with the best
>>>/9/g/a/g/p/r/o/g/r/a/m/m/i/n/g/
>>
>>59266714
Is that Chinese?
>>
>>59266689
>that ugly garbage just to get a barely """typed""" program
no, thanks.
>Currying isn't given by default
of course, since lisp is trash. it can't even have auto-currying for every single function. is it even Turing complete?
>>
>>59266719
I'm sorry, but you must be confused, redditor.
Never ever recommend usage of objects or OOP here.
>>
Can I get some resources for C++ please.

I need to know when to use .h and when not to.
>>
>>59266750
see >>59266740
>>
>>59266730
Of course it is, anon. Not to mention, static type checking can be given by Lisp. But that's not really meaningful, as the compiler is available at any time.
>>
Basically if you're not writing self-modifying Assembly, you should flip burgers instead.
>>
File: hqdefault (1).jpg (35KB, 480x360px) Image search: [Google]
hqdefault (1).jpg
35KB, 480x360px
>>59266689
what are those (((((( ))))) ?
>>
>>59266777
prove it. also make it curry every single function by default.
Perhaps then I can agree that it isn't absolute garbage.
>>
>>59266750
write everything in single header file
>>
Quick question about linq. Can you use it to read specific text from a file? For example, in a file somewhere is written "cuck: value". I want to search for "cuck" and compare the value to user input.
Is it possible in C#?
>>
>>59266887
>reading from a file
id regex that file personally
>>
>>59266269
wow I got less negativity over me than I expected and probably deserved
>>
>>59266813
Example of a TM: http://weitz.de/turing/
Currying by default I assume would involve extending the evaluator through a combination of *evalhook* and *applyhook*. I've never tried this before, but I'm interested now.
>>
File: screenshot-06032017%.png (241KB, 1920x1080px) Image search: [Google]
screenshot-06032017%.png
241KB, 1920x1080px
>>59266231
Proccesing Mess DATA to TIDY format for OLAP Cubes
>>
>looked up for yandex jobs
>either junior python programmer with requiered 2 year experience or senior python programmer with 3-4 year experience
And /dpt/ told me python is useless shit
>inb4 what is yandex
>>
>>59266910
I don't understand that, can you show me an example please?
>>
>>59266887
Does the file have any specific format that it follows? Do you want to search for just cuck or all "keys" that go key: value?
>>
>>59266995
Let's say it's a .txt file, but in reality it shouldn't matter. I want to search for all keys that have key: value, but for specific ones.
>>
>>59266740
I was going to make a joke about OOP being the object of your anger but I couldn't think of how to make it sound good. Such is life as an OOPfag.
>>
>What are you working on /g/?

Still working on my userspace sysfs NVMe driver. Made a couple of functions for submitting NVM commands and polling for their completion (but more logic is needed for phase bit etc). I'm also extracting some data about the controller from the identify controller structure.

The next step is to identify namespaces. After that I will try to create (and delete) IO queues and host them on GPU memory.

https://github.com/enfiskutensykkel/ssd-gpu-dma
>>
>try to learn C

char (*(*f())[])();

char (*(*X[3])())[5];

void (*f)(int,void (*)());

char far *far *ptr;

typedef void (*pfun)(int,float);

int **(*f)(int**,int**(*)(int **,int **));


>give up learning C
>>
>>59267066
>he can't read syntax
>>
>>59267066
wtf I hate C now
>>
>>59266984
>/dpt/ told me python is useless shit
/dpt/ also earns 300k starting working on top secret military projects in Haskell and Assembly
/dpt/ alternatively is too intelligent to be employed
>>
>>59267120
>supporting capitalism
>>
>>59267066
>char (*(*f())[])();
declare f as function returning pointer to array of pointer to function returning char

>char (*(*X[3])())[5];
declare X as array 3 of pointer to function returning pointer to array 5 of char

>void (*f)(int,void (*)());
declare f as pointer to function (int, pointer to function returning void) returning void

>char far *far *ptr;
syntax error

>typedef void (*pfun)(int,float);
syntax error

>int **(*f)(int**,int**(*)(int **,int **));
declare f as pointer to function (pointer to pointer to int, pointer to function (pointer to pointer to int, pointer to pointer to int) returning pointer to pointer to int) returning pointer to pointer to int
>>
>not earning 7 figs working your highly classified algol variant
stay jelly nerds
>>
>>59267139
>i'm gonna impress my n00b friends with my secret tool cdecl
>>
Hello I am making a though tracker to track how mind state shifts. Here's my model, what do you think?

Thought
- id
- name
- time
- mood/feel

Mood
- name

Moods: hungry, sad, bad, good, satisfied, calm, angry

[1, "Craving junk food", timestamp, "hungry"]
[2, "Bad memory", timestamp, "bad"]
[3, "wanting to ejaculate", timestamp, "horny"]


So I spend about an hour a day just tracking my thoughts and will see over the week the patterns and how one thing leads to another.
>>
File: heh pepe.jpg (15KB, 306x306px) Image search: [Google]
heh pepe.jpg
15KB, 306x306px
>>59267066
>muh scary symbols
>muh scary pointers
>muh brain can't handle all of this complexity
fuck off poo
go back to java
>>
>>59267139
typedef void (*pfun)(int, float);


Is completely valid syntax though. It defines a type pfun which is a pointer to a void function with an int and float argument.
>>
@59267131
>>>/t/umblr
>>
>>59267152
Who are you quoting?
>>
>>59267148
where is anime?
>>
>>59266910
>>59266995
please respond
>>
>>59267151
is right. That's something you see a lot in the Linux kernel code.
>>
>>59267139
cdecl to the rescue
>>
>>59267157
A retard from either tumblr or plebbit. If I had to bet I'd say it's tumblr.
>>
>all these retards talking about cdecl like if it was the only way to read those
Seriously it's not like it's even that hard to parse C with your eyes. We're far from C++ templates insanity.
>>
>>59267158
I don't really watch anime so I guess a NEET would put

[3, "wanting to see my waifu", timestamp, "bored"]
[4, "wanting to ejaculate to my waifu", timestamp, "horny"]
>>
>>59267177
>We're far from C++ templates insanity.
keep telling yourself that
>>
>>59267180
>I don't really watch anime
You do know this isn't the right website for you, correct?
>[3, "wanting to see my waifu", timestamp, "bored"]
>[4, "wanting to ejaculate to my waifu", timestamp, "horny"]
that looks about right.
>>
File: 1481580659074.webm (1MB, 640x640px) Image search: [Google]
1481580659074.webm
1MB, 640x640px
I want to write a bash script to make some folders, files and run some commands.
(virtual host for apache setup)
Where can I get the info to lean how?
>>
>>59267184
Oh, you think C is your ally. But you merely adopted the pointer; I was born in it, moulded by it. I didn't see the OOP until I was already a man, by then it was nothing to me but BLINDING.
>>
>>59267209
https://www.gnu.org/software/bash/manual/bashref.html
>>
>>59267209
I recommend the website you came from.
>>
>>59267209
that webm was cringy
>>
>>59267233
btw I'm 12 haHAA
>>
>>59267194
If it's an anime website why would there be a separate anime section from the other interest boards?
>>
>>59267243
>tfw double that age actually
>>
File: 1.png (73KB, 1563x1169px) Image search: [Google]
1.png
73KB, 1563x1169px
Wow, I love rxJava.
>>
>>59267297
why would there not be an anime board on an anime website? you're not making any sense.
>>
>>59267327
Anime/wallpapers
General/wallpapers

It's almost as if they are trying to separate anime wallpapers from general wallpapers

Anime is just a board on 4chan >>>/a/

All of the evidence points to this website not being completely anime website.
>>
>>59266253
use the thrust library desu
much easier than raw CUDA
>>
>>59266269
>python major
i don't think that's a thing
>>
would a class using inheritance with overwritten parent methods run any better than a class inheriting pure virtual functions?
>>
>>59266269
there are hardly and acceptable lines of code in that script
>>
>>59267177
>C++ templates insanity.
Care to provide some examples?
>>
>>59267357
wrong. there is anime on the main page of the site. also you should learn some history, which it's clear you are ignorant of.
>>
>>59267400
There are also more.non anime related boards on this website.

It may have been started by a weab with the majority being anime.boards but that is not the case anymore.

Kinda like.how North America was owned by Indians but that is not the case any more
>>
File: tmp_21295-1488750249770263558396.jpg (259KB, 1280x1810px) Image search: [Google]
tmp_21295-1488750249770263558396.jpg
259KB, 1280x1810px
>>59266385
>>59266399
>>59266405
I highly appreciate your help, but I need a scripting language, e.g., for web parsers

>>59266415
Isn't Perl dead?
>>
>>59267425
Perl is super dead
Kind of a shame because it's a blast to use, it spoils you
>>
>>59267424
>getting trolled by the oldest troll argument on this website
he's right that you should learn some history
>>
>>59266304
Really? This is ridiculous. 3d graphics is super easy now that you have so many resources to throw around. You can actually just draw stuff with your shaders and it happens in reasonable time on user machines.

And most libraries that people use for graphics only do basic stuff like set up VBOs, load textures and meshes.

All depends on what the goal is of course.
>>
>>59267425
Then use Lisp.
http://quickdocs.org/search?q=web
>>
>>59267478
Doesn't GPU programming refer to lower level stuff in general? e.g. C + CUDA
>>
>>59267456

Please enumerate the number of anime boards against non anime boards?


>>59267467

Been here since 2006 so don't question me
>>
>>59267494
>arguing over the same thing for more than 10 years

How do people develop this kind of autism
>>
File: output-1.png (177KB, 1315x674px) Image search: [Google]
output-1.png
177KB, 1315x674px
Have you guys ever used the tool gprof2dot? I'd be interested to see some plots from your own projects.

https://github.com/jrfonseca/gprof2dot
>>
>>59267514
nobody that's been here that long would care
t. 2009(?)
>>
>Good knowledge of algorithm design.

What does this mean in a job requirement? Shit like the stuff from "Cracking the coding interview" or something else?
>>
So if I wanted to make a Quake-like game engine what should I read on? Any good resources?
>>
>>59267483
Wouldn't suggest using non-Turing complete shit.
>>
>>59267514
By going on 4chan for 10 years
>>
>>59267530
Linear Algebra
vaguely knowing it is not enough. You need to be able to construct and apply transformation matrices in your sleep.

Binary Space Partitioning or Octrees
to efficiently render large scenes
>>
>>59267483
Can i have some more widespread language?
>>
>>59267530
http://fabiensanglard.net/quakeSource/index.php
https://www.bluesnews.com/abrash/
https://github.com/id-Software/Quake
>>
>>59267562
JS/Node is the web language
Python is the data science/ML language
>>
>>59267492
Don't see how that's particularly relevant to my post but yeah to some extent. I wouldn't consider it gpu programming if you use some high level graphics library to draw a few meshes on screen. The abstraction usually tries to do away with the base graphics api entirely.

Words like low level and high level are problematic to use because people don't agree on what they mean enough to make them useful. When you say C is low level it's only really low level in terms of programming languages in general. But it's not all that low level when you consider the extra concerns you've added.

I'd say cuda is very high level though. But I haven't used it extensively, just a little bit.
>>
>>59267557
Thanks.

>>59267566
I don't want to plow through Quake's source but rather learn about things that have been used to make it possible (like the other post mentioned) and apply those myself.
>>
>>59267538
Better than using your useless Turing tarpit, anon. :^)
>>
>>59267569
And there are no languages on the second place?
>>
I want to know if there is even the slightest difference between two images.

Is calculating a MD5 hash for each a good way to go?

Is there a better method that could tell me where in the picture the differences are? For example, splitting the images into halves and calculating a hash for each half, repeating recursively.
>>
>>59267569
JS is slow
Python is slow
>>
>>59267596
well good thing the other two links I posted talk about that then you ungrateful piece of trash
>>
>>59267604
For DS/ML there's Lua, MATLAB
For web I guess Python and the dying ruby
>>
>>59267607
Last modified date is pretty good. If you're comparing images without such information and you only need to know if they're different you should realise that there's no way of telling without comparing the entire image. You can easily early out but if you're to determine if they're exact copies you have to compare every pixel. A hashing function by its nature won't help you because it's a lossy translation of data. Multiple combinations of pixels correspond to single hashes.
>>
>>59267607
Here's a paper on the subject: http://www.robots.ox.ac.uk/~vgg/publications/papers/chum08a.pdf
>>
>>59267621
So?
>>
>>59267599
>:^)
Is this some new rebbit meme?
>>
>>59267646
So they're trash.
>>
>>59267651
I dunno, you tell me, redditor. :^)
>>
>>59267655
>i'm a /dpt/ meme
>>
>>59267684
Not an argument.
>>
File: big errors.png (989KB, 1140x969px) Image search: [Google]
big errors.png
989KB, 1140x969px
How can I improve on this, /g/?
>>
>>59267699
>arguing with a memeboy
>>
>>59267712
You're in the wrong thread. /sqt/ is what you want.
>>
>>59267393
Template errors are notoriously verbose and hard to understand. Here are some handcrafted examples but I've seen some similar things in real life (when developing components for the Sofa Framework for example).
http://codegolf.stackexchange.com/questions/1956/generate-the-longest-error-message-in-c
And some of these still make sense. Wait till you start adding some other kind of meta-programming to it.
>>
File: 1481661539472.png (315KB, 1069x804px) Image search: [Google]
1481661539472.png
315KB, 1069x804px
Can someone post that /g/ Programming Challenges pic, like the most up to date one?
>>
Help me with this, it's python. NOT for a grade.
Just a practice problem for an upcoming lab.


Complete the load function that takes a list of strings as an argument, and creates a dictionary of strings. The argument of strings contains data that represents Experiences. The keys in the dictionary will be the year of the experience, while the values will be the companies, stored as a list. You may assume that all experiences passed in as arguments never have two experiences with the same company and year. Items will be added to the lists-as-values in the order they are processed in the incoming list argument. The function should return the dictionary. For example, if you had the following function call:
load(["software engineer,IBM,1996", "cashier,Safeway,1983", "architect,Microsoft,1996", "advisor,GMU,1996"])
It would return a dictionary, when printed out, that would look like:
{"1996":["IBM", "Microsoft", "GMU"], "1983":["Safeway"]}
>>
>>59267771
no
>>
>>59267730
See >>59267699
>>
>>59267638
>>59267641
Thanks, much appreciated
>>
>>59267787
See >>59267730
>>
>>59267655
They are trash because they have overgrown their original uses. Their speed was considered fast enough when they didn't make Neutron or whatever library.
And then there are users of the language. Users can heavily influence on the language fame.
>>
>>59266258
Lisp isn't functional
>>
>>59267771
>>59261745
>>
>>59267775
Parse strings, if commas are delimiters, then parse by commas.
>>
>>59267840
It's not functional either.
>>
http://pastebin.com/raw/KTCNrNvM
http://pastebin.com/raw/Kg8XUUMp
rate my code
>>
>>59267952
this
>>
>>59267850
I apparently did 7 already, without even seeing this, yay!
>>
>>59267959
>inline
Is that C++?
>>
>>59268003
no
it's c99
>>
>>59267959
disgusting
>>
>>59268042
it just works
>>
>>59268077
i don't doubt it but next time use a language with proper generics instead of disgusting hacky macros
>>
>>59268123
>disgusting hacky macros
lmao spotted the java codemonkey
>>
>>59268156
what? are you implying that the shitty implementation of macros that C has are any good?
>>
File: 1474761436242.png (197KB, 322x361px) Image search: [Google]
1474761436242.png
197KB, 322x361px
>>59267850
>version 2.0
>>
>>59268179
Macros in C are imperfect. Imperfect macros are better than no macros at all.
>>
File: Screenshot_2017-03-06_17-29-53.png (1MB, 1366x768px) Image search: [Google]
Screenshot_2017-03-06_17-29-53.png
1MB, 1366x768px
Added tag completion hints. Now working on hamburger menu.
>>
>Boss downsizing the company
>My job going away (Supply Chain Manager)
>Offers me a job as a programmer, and if I do well he will keep me on
>Say sure, because I need a job and I learned a bit of Python/C++/VB in college
>Get my task, realize I signed a deal with the devil

So I need to go through this set of about 20 programs and convert them to SQL.

The problem is they were all hastily written in Microsoft FoxPro and FoxPro is the retarded bastard child of SQL

I know neither language, where exactly should I start? I have awhile to do this (He wants good progress in 3 months).

I think it would be best to learn SQL first since Fox is just slightly different SQL. I already did some research on good books, but is there any websites that will give me easy tasks to do until I learn?

Essentially I learn best in a classroom setting. I am already looking into edX
>>
{code] Write a program that calculates the sum (with precision of 0.001) of the following sequence: 1 + 1/2 - 1/3 + 1/4 - 1/5 + … [/code]

Self-learner here, how would one approach this? I am not sure how to switch those + and -. My first thought was to assign a + to one bool value and just switch it on and off as program goes, for every true write + and for every false write -, am i correct?
>>
>>59268429
(-1) ^ n

0 -> 1
1 -> -1
2 -> 1
3 -> -1
...

and + a 1 for the first bit

but what you said works too
>>
>>59268429
You use the fact that 1 + 2 + 3 + 4 + ... = -1/12.
>>
>>59268414
Looks like you'll have to learn the most important skill for a programmer first of all: managing expectations
>>
>>59268323
post (4, 7)
>>
>>59268323
Are you the same guy that's making the server thing in Go?
>>
>>59266231
Thanks for using anime image
>>
>>59268462
Haha, he said that as long as I am making progress on learning it he will be happy. They couldn't find anyone to do this (and no one that interviews stays interested)

Pretty much they didn't want to get rid of me but his boss is a dumb fuck

Pretty much at worst I will learn some SQL and get paid. I am already on the job hunt elsewhere
>>
>>59268451
You don't use that faggot. It's a harmonic series that converges to 2 - ln(2)
>>
>>59268590
Is it true that 0.9999... = 1?
>>
>>59268619
Yes, there is no distance between those two numbers, just like how there is no distance between 2 and 2.
>>
>>59266375
Perl, so I won't be so lonely in these threads
>>
File: 0.9999999999999.png (905B, 203x60px) Image search: [Google]
0.9999999999999.png
905B, 203x60px
>>59268619
haskell says yes
>>
>>59268465
Here.
>>59268488
Yes. The server is mostly complete, including the API and docs. Some anon here said QML was easy, so I decided to try it.
>>
>>59268687
Did you push it to your github? I didn't see it?
>>
>>59268687
now post (2,3)
>>
>>59268619
Nope.
>>
I'm trying to understand how to write scripts in Autohotkey, where should I look?

I have next to zero programming experience.
>>
>>59268619
Yes.
>>
Hey guys, I've been doing basic RPG making in qb64 and its still pretty work in progress but some people look over it and give me places to change and just generally make better. All of the main stuff is in the RPG program.bas but its also mostly uncommented.

https://github.com/RichardStallmanNo1/QB64-RPG

Posting from mobile right now if you have a question how something works I'll answer in a bit, I'm mostly just looking to make it run a little better resource wise.
>>
>>59268709
>>59268702
Yes, https://github.com/bakape/hydron and https://github.com/bakape/hydron-qt
>>
File: typeclasses.png (4KB, 367x115px) Image search: [Google]
typeclasses.png
4KB, 367x115px
>>59268684
muh type classes
muh defaulting
>>
File: 1486087811340.jpg (31KB, 438x428px) Image search: [Google]
1486087811340.jpg
31KB, 438x428px
Can I turn a read-eval-print-loop into an eval-loop to remove all IO from it? Should be pretty easy to remove two functions, right?
>>
in data structures for Java and increasingly falling behind due to shitty wagecuck job

any tips?
>>
>>59268776
what purpose would it serve
>>
>>59268789
Why would you want to know that?
>>
>>59268776
isn't that an interpreter that doesn't accept user input nor prints
>>
>>59268845
Yes, printing and reading would require IO which I plan to do away with.
>>
>>59268786
>due to shitty wagecuck job
Yeah, sure. You have time to fucking post here and you still have the nerve to lie like that.
>>
>>59268765
That's nice. Looking through you're code I assume you haven't implemented the "clicking opens the image" yet? Or maybe you're planning to do something different?
QML looks easy, I should learn it one day.
>>
>>59268854
yes, so go make an interpreter
>>
>>59268802
Let me guess, you're that troll from yesterday right?
>>
>>59268854
How would you eval something if you never read something to eval in the first place?
You'll need to read from a file so that's IO.
>>
Is it true that you can write a program that doesn't have I/O?
>>
File: 2017-03-06-161434_1002x543_scrot.png (151KB, 1002x543px) Image search: [Google]
2017-03-06-161434_1002x543_scrot.png
151KB, 1002x543px
>>59268765
What does high performance mean? Parallelised?
>>
File: 1488412193698.png (271KB, 600x481px) Image search: [Google]
1488412193698.png
271KB, 600x481px
>>59268889
>tfw off by 1
>>
>>59268902
means it performs high
>>
>>59268898
stored programs are a meme
>>
>>59268913
Fag
>>
>>59268866
ngl you got me there but I close at a restaurant so from the afternoon to late night is gone so time is somewhat limited.

any tips?
>>
>>59268899
We'll never know because the answer will never be printed
>>
What I/O is here
 $ python -c "import random; random.random()"
>>
>>59268429
>>59268447
>>59268590

I asked this question, how come i get ~1.66 ?

            Console.WriteLine("Calculates the sum (with precision of 0.001) of the following sequence: 1 + 1/2 - 1/3 + 1/4 - 1/5 + … ");

Console.WriteLine("Insert n");
int n = int.Parse(Console.ReadLine());
double result = 1;
double sum = 0;


for (int i = 0; i < n; i++)
{
if (!(result - sum < 0.001))
{
sum = Math.Pow(-1, i) / (i + 1);
result += sum;
}

}

Console.WriteLine("The result is: {0}", result);
Console.ReadLine();


I tried it as a test for 100 number, didn't want to bother to make recursive method
>>
Is it possible to average 2 ints in C?
>>
>>59268970
 int x=1, y=2; float average = (x + y)/2


(I don't actually know C but why wouldnt this work)
>>
>>59268902
In this case, it means it is much faster and uses much less memory than any alternative. Imageboards are all written in slow languages like PHP and Python. The native Go thumbnailing is nowhere near a solution in C with Go bindings.

And in case of hydron, it is an (eventual) Hydrus replacement. Hydrus is written in Python and can occasionally take a good 10 minutes from boot to operational state, imports are slow as fuck and it can't scrape tags from boorus in batch.
>>
>>59268872
Yes, simply not implemented yet.
>>
>>59268889
I don't think I know you.
>>59268898
It will be present at compile time.
>>
>>59268992
1. Integer overflow with INT_MAX
2. inaccurate with large numbers, for instance
x = 406877954
y = 68277988
>>
>>59268970
x/2 + y/2 + (x%2) * (y%2)
>>
>>59268970
What's the problem with averaging of two integers in C?
>>
>>59269055
Why does 2. happen?
>>
>>59269043
Noice. I just looked at your github and dude you commit all the fucking time, keep up the good work m8
>>
>>59268968
First two iterations do 1 - 1/2 instead of 1 + 1/2. Ignore the 1 at the beginning and add it back at the end. It's not part of the harmonic sequence.
>>
>>59269072
The internal representation of 32-bit float reserves 23 bits for the significand:
https://en.wikipedia.org/wiki/Floating-point_arithmetic#Internal_representation

This means the largest integer a 32-bit float can represent accurately is about 2^23 or around 7 digits.

Your idea would work with double precision.
>>
File: averaging 2 ints i nC.png (36KB, 684x982px) Image search: [Google]
averaging 2 ints i nC.png
36KB, 684x982px
>>59269063
>>
>>59269161
shit, fucked up formatting
>>
What is the best language for writing fizzbuzz?
>>
>>59269176
fizzbuzz
>>
>>59269063
It's a /g/ meme. The thing is you have to take care of plenty of issues that arise when you deal with a finite amount of digits to get proper results.
>>
File: 1483523070094.png (289KB, 700x740px) Image search: [Google]
1483523070094.png
289KB, 700x740px
>>59269183
That's not a language
>>
>>59268429
Remind me how do you calculate this inf series?

1 + 1/2 - 1/3 + 1/4 - 1/5 + … 
>>
>>59269213
Make it one then.
>>
>>59268619
Yes.
1/3 = 0.3333...
3 * 1/3 = 3*0.3333...
1 = 0.9999...
>>
>>59269213
in fizzbuzz this is just

fizzBuzz
>>
>>59268776
(loop (eval nil))

Here's your worthless eval-loop.
>>
>>59269226
What should it do and what should the syntax be like?
>>59269244
>impure fizzbuzz
Disgusting.
>>
>>59269255
But I need it to actually evaluate expressions.
>>
>>59269256
>What should it do
Generate FizzBuzzs.
>what should the syntax be like
Your call mate.
>>
>>59268776
No. If there's no read, then eval is worthless unto itself.
>>
>>59269134
23 bits for the significand means 8 bits for the exponent, so 2^(2^8) is the largest integer it can represent. No?
>>
>>59269221
>1 + the sum of (-1)^n*1/n from n=2 to infinity
>>
>>59269279
Why?
>>
>>59269286
It can represent numbers that large, but not accurately to the decimal digit.
>>
>>59269221
Don't you remember integral calculus, anon?
>>
File: 1488789899833.jpg (298KB, 4096x2304px) Image search: [Google]
1488789899833.jpg
298KB, 4096x2304px
I gotta binge C++ in a month.

What is the best way to learn it as fast without seeming like a retard when I gotta go to this competition.

Thanks in advance.
>>
>>59269301
You can't evaluate something that does not exist.
>>
>>59269307
I honestly forgot, it was long time ago while i was studying economics. After that i switched my life 180 degress
>>
>>59269320
It will be baked into the binary though.
>>
>>59269343
Then what the fuck is your problem you dumb shit? Just write the code as-is without using any I/O facilities.
>>
>>59269375
>you dumb shit
LOL HOW WILL HE EVER RECOVER
>>
>>59269317
Effective c++
>>
best opengl >= 3 tutorial for C language, not fucking sepples shit.
>>
>>59269399
Lisp.
>>
>>59269399
Haskell & Assembly
>>
>>59269317
>>
>>59269399
Official spec
>>
>>59267058
That's pretty cool.
>>
>>59269375
You don't understand. I don't want to use IO even when evaluating.
>>
>>59269408
>>59269420
you might want to read the post before you reply.
>>
>>59269399
C++
>>
>>59269452
you might want to chill yourself before you GIL yourself
>>
>>59269443
And? Parsing a string provided to the eval function isn't I/O. You're either stupid or trolling but in either case you should just fuck off.
>>
>>59269486
How the fuck is taking input from the user not IO?
>>
>>59269443
why evaluate something if you don't do anything with it? might as well not do anything
>>
>>59269490
>from the user

He said that's not the case because the input will be embedded into the executably (so a byte array or whatever), in which case that's not I/O.
>>
>>59269495
Why do you think that's any of your business?
>>59269503
Yes, but I still need to remove the call to read and just substitute everything in place of it.
>>
>>59269510
>Yes, but I still need to remove the call to read and just substitute everything in place of it.
Do exactly that then?
>>
>>59269528
>>59269503
>>59269486
You're wasting your time. The same fucking retard has been spamming in /dpt/ with his retarded logic and constant lack of brain yesterday.
>>
>>59269528
Okay. Thanks, man.
>>59269550
Can you repeat the question?
>>
>>59266480
I almost got triggered.
>>
>>59269439
No it's not, he's just showing off his downie face.
>>
>>59266231
That was a great anime.
>>
>>59269619
Has anyone used visual studio code? It's surprisingly good.
>>
Name any other language that is as robust or scalable as Java.

>Protip: You can't
>>
>>59269176
D.
>>
>>59269643
>It's surprisingly good.
Can we stop saying VS Code is "actually" "surprisingly" "unexpectedly" "really quite" "..even though it's Microsoft it's" good?

We get it. If you touch anything with Microsoft you have to clarify that it's unexpected or forced upon you in some way.

They put out great products, particularly on the dev/BI sides of things.
>>
>>59269176
GNU Make
>>
>>59269176
LaTeX
>>
>>59269643
Yeah it's decent.
>>
>>59269656
Go is superior in both accounts.
>>
>>59269643
Been using it for almost a year now.
>>
>>59269221
That's ln(2) = 0.69 (approximately)
>>
>>59269656
Brainfuck
>>
GCC is a bloated mess, is there a better C and C++ compiler to use that's minimalist?
>>
>>59269746
Clang
>>
>>59269656
>>59269671
>>
>>59269221
>>59269738
That's wrong. That series doesn't converge.
>>
>>59269317
Effective C++ by Scott Meyers.
>>
Just represent the program directly as the AST, then eval that.
There, now you have no read
>>
>>59269777
Um...it does.
>>
>>59269738
Not correct

It's around 1.3
>>
>>59266231
Messenger chatbots HN says it would be future and i bought hard that meme with 5 bots.
4 in fb sdk in node js
>>
File: harmful.png (46KB, 1215x487px) Image search: [Google]
harmful.png
46KB, 1215x487px
>>59269746
>>
>>59269777
http://www.wolframalpha.com/input/?i=sum+%28-1%29^%28n%2B1%29%2Fn,+n%3D1+to+infinity
>>
New thread:

>>59269815
>>59269815
>>59269815
>>
>>59269759
Suckless hates clang

>>59269806
Cool, will look into. Uriel died too early.
>>
>>59269806
What's the deal with harmful software?
>>
>>59269827
Why do you give in to the suckless autists?
>>
>>59269800
I thought it was
 1 - 1/2 + 1/3 - 1/4 +... 


So, you're right. The exact answer is 2 - ln(2) which is approximately 1.3
>>
>>59269819
Second number is +, not - like in your case
>>
>>59269836
They're usually right
>>
File: NEAT_Questions.png (37KB, 1204x1068px) Image search: [Google]
NEAT_Questions.png
37KB, 1204x1068px
Hey /g/
I'm trying to write a NEAT implementation from scratch. Up to now I've read the main paper from Kenneth O. Stanley but I'm left with some questions.

1)The paper doesn't mention it but, by the logic with which crossovers happen, it makes sense for neurons to have an innovation number.
So do neurons have an innovation number? And if they do is the innovation number shared with the connections or specific of the neurons?

2)When the net structure changes how do connection "feed" the network, or, to better explain myself, by what order is the infromation fed forward? (pic related)
>>
>>59270589
Thread is dead post in the new one.
>>
>>59268970
No
>>
File: bresenham.png (13KB, 656x439px) Image search: [Google]
bresenham.png
13KB, 656x439px
Can anyone help me see why, in my implementation of Bresenham's algorithm, the bottom line is one pixel short?

http://pastebin.com/MGxYkpVG
>>
two threads really trigger my autism
>>
>>59271346
One sec, I'll delete this one.
Thread posts: 326
Thread images: 32


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.