[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: 324
Thread images: 37

File: timetocode.webm (2MB, 1152x648px) Image search: [Google]
timetocode.webm
2MB, 1152x648px
This is /dpt/, the best subreddit of /g/

Umaru-chan edition, the best of all editions.

In this thread:
r/programming
r/compsci
r/ReverseEngineering
r/softwaredevelopment

code of conduct:
no racism
no insult
no sexual harassment
no gender discrimination

wat r u working on, anon-chan ?
>>
File: Screenshot_010616_155736_0.png (205KB, 502x667px) Image search: [Google]
Screenshot_010616_155736_0.png
205KB, 502x667px
Any cheaper alternatives?
>>
>>54857034
https://drive.google.com/file/d/0B2Y-n6IlHYliSXZxMk0xT0NSY1E/preview
>>
>>54857034
https://learnxinyminutes.com/
>>
Pythonfag here, running a silhouette analysis on my k-means clustered data. I have a bunch of vectors and for every one I have to calculate an AI (the average distance between that vector and other vectors within the same cluster) and a BI (the lowest average distance to all vectors from another cluster).

Here's part of the code:
for cluster,clusterNumber in zip(clusterDict.values(),range(len(clusterDict))):
aiList = []
for vector1 in cluster:
listOfDistancesAI = []
for vector2 in cluster:
distanceAI = silhouetteDistance(vector1,vector2)
listOfDistancesAI.append(distanceAI)
averageDistanceAI = sum(listOfDistancesAI)/len(listOfDistancesAI)
aiList.append(averageDistanceAI)

biList = []
for vector, clusterNumber in zip(cluster,range(len(clusterDict))):
clusterDistanceList = []
for otherCluster in clusterDict.values():
listOfDistancesBI = []
for vector2 in otherCluster:
distanceBI = silhouetteDistance(vector,vector2)
listOfDistancesBI.append(distanceBI)
averageDistanceBI = sum(listOfDistancesBI)/len(listOfDistancesBI)
clusterDistanceList.append(averageDistanceBI)
clusterDistanceList[clusterNumber] = 10**100
biList.append(min(clusterDistanceList)


The vectors are fed from a dictionary which has a key for every cluster and then a list of vectors as values. The problem is, the AI values are getting calculated just fine, but its only calculating 9 BI values. The amount of vectors in the cluster should match the number of AI and BI values. The biList.append statement is in the for-loop for the vectors, so it should be appending as many BI values as there are vectors.
As it happens, 9 is the amount of clusters I'm telling my k-means algorithm to make, so stuff might be in the wrong loop?
>>
>>54857047
>C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework.
>>
>>54857016
A NI ME
>>
>>54857109
Sounds about right.
>>
>>54857109

Yes, that is correct
>>
>>54857046
>20 MB
>>
On windows how can i know if something is printing? also how can i get the page count?

On command i need this on command i have yet to find something useful

inb4 not programming i need this to implement a feature
>>
>>54857299
20MB is cheaper than the book, faggot.
>>
>>54857299
>the picture
holy fuck
>>
>>54857016
I never really cared for anime but holy fucking shit that is the cutest thing I have ever fucking seen what the fuck
>>
File: 1464605356930.jpg (217KB, 838x1024px) Image search: [Google]
1464605356930.jpg
217KB, 838x1024px
Does anyone have ideas for simple (or very slightly complicated) multi-threaded programs? Something like the DPT challenges but with multiple threads in mind.
>>
how do i make a pair variable in scheme? i do define but it's making it a procedure and giving me errors when i try to car or cdr
>>
>>54857360
producer consumer
>>
>>54857367
(define pair (cons 1 2))
>>
>>54857016
UMARU
Yaaaaaaasssssss boooy finally umaru-chan dpt is back in town baby
>>
>>54857327
I just always wondered what 1.5k pages of book took up
>>
>>54857367
nm i forgot to do prefix notation in a spot
>>
>>54857034
>>
File: 1455889314087.jpg (125KB, 850x850px) Image search: [Google]
1455889314087.jpg
125KB, 850x850px
>>54857016
Wouldn't having your computer on the floor cause a lot of upper body pain from looking down for hours, Umaru-chan desu wa?
>>
File: For the AUTISM!.jpg (289KB, 1920x1080px) Image search: [Google]
For the AUTISM!.jpg
289KB, 1920x1080px
>>54857046
>https://drive.google.com/file/d/0B2Y-n6IlHYliSXZxMk0xT0NSY1E/preview

How can I download that book?
>>
>>54857522
I mean cheap as in cheap beer, not less work
>>
What is the best way to write a database? MySQL? using it mostly for web, but has to scale up like no other, i mean like facebook size.

Running a test and dump random generated usrs in database with usrname pass folder for pics, post info, etc. Advice /g/ents?
>>
>>54857664
You sound like you have no idea what you're doing, but you expect to scale up to "facebook size"?

Also, I bet you were planning to store passwords in plain text.
>>
>>54857664
>but has to scale up like no other, i mean like facebook size
You have LITERALLY no idea what you mean by this.

Google the term 'big data', and familiarize yourself with node-based DB systems.

Something like Facebook uses a combination of multiple DB styles, some relational, some hierarchical like MongoDB for caching.
>>
>>54857614
want me to upload it to you?

just say the word
>>
File: 1463497539681.jpg (278KB, 1024x768px) Image search: [Google]
1463497539681.jpg
278KB, 1024x768px
>>54857764
The word
>>
>>54857792
here you go

https://my.mixtape.moe/kiuvpf.pdf
>>
>>54857692
>>54857733
Yes, it is true anons, I am a newfriend when it comes to databases, i literally dont know shit. This is why i am asking for a point in the right direction.

Ive just read that mySQL is good, up to a certain point, then it can get slow. That is all really,
>>
>>54857948
Use PostgreSQL.

Don't use MySQL.

http://grimoire.ca/mysql/choose-something-else
>>
What are your thoughts on JetBrains?
>>
>>54858003
really good software company soon to dominate the industry.

you have IDE's for every languag (at least , the important ones)

https://www.jetbrains.com/
>>
>>54857792
just remove the /preview from the url and you'll get the google drive normal interface, with the download button at the top
>>
>>54858003
they're shit, have fun paying for a fucking basic ass IDE, and top kek if you fell for the scala meme, scala is shittier and less relevant than both java and C#
>>
>>54858041
>https://www.jetbrains.com/
i like the part where you felt the need to include a link to their website... shill
>>
>>54857569
i want to fug sirufin
>>
File: 1437562354954.webm (2MB, 852x480px) Image search: [Google]
1437562354954.webm
2MB, 852x480px
>>54857354
>>
>>54858141
>scala
actually their language is fucking kotlin, even more shit and obscure
>>
>>54857016
How does she slide past the green seat cushion?
Why does she have a booby mousepad with no design on it?
Where can I get a DOLL computer?
>>
File: spoiler-v1.png (209B, 100x100px) Image search: [Google]
spoiler-v1.png
209B, 100x100px
>>54858239
It's a cat with cheeks as the rests

fucking perv
>>
File: yeeaaaahhhhhh.jpg (8KB, 480x360px) Image search: [Google]
yeeaaaahhhhhh.jpg
8KB, 480x360px
>>54858283
now

that's what i call

cheeky
>>
>>54857391
That's boring af tho.
>>
Oh senpai, I got the best idea for my web based file manager. Make all functionality a plugin.
>>
>>54858398
then it's not really web based is it
>>
>>54858208
THAT'S EVEN CUTER
>>
>>54858412
What do you mean? It's just a website for file management. I want users to choose only the plugins they want.
>>
can someone write me a one liner of this function?


def test(a):
vp = 0
q = a[-1]

for p in a:
vp += p[0]*q[1] - p[1]*q[0]
q = p

return abs(vp / 2)

>>
>>54858557
why?
>>
>>54858557
test = lambda a: abs(reduce(lambda acc, (p, q): acc + p[0]*q[1] - p[1]*q[0], zip(a, [a[-1]] + a[1:]), 0) / 2)


like this?
>>
>>54858695
first because i want to learn how it's done.

plus its a fun exercice and less code
>>
>>54858730

Why is less code good?

compare

>>54858557
>>54858722

which one can be understood faster when something needs to be changed?
>>
>>54858722
this doesn't seem to work

the a parameter is a list of tuples like this
 [(10,20),(56,21),(12,12),(98,88)] 


you can test your one liner and my function to see if thee results are the same
>>
>>54858762
>Why is less code good?
>compare

i, by no means, want to use one liners in production code, because readability and maintainability are important.

i just wanted to see what it look like and to learn how they do that
>>
>>54858557
from itertools import *

def test1(a):
vp = 0
q = a[-1]
for p in a:
vp += p[0]*q[1] - p[1]*q[0]
q = p
return abs(vp / 2)

def test2(a):
vp = sum(p[0]*q[1] - p[1]*q[0] for p, q in zip(a, islice(cycle(a), 1, None)))
return abs(vp / 2)


print(test1([(10,20),(56,21),(12,12),(98,88)]))
print(test2([(10,20),(56,21),(12,12),(98,88)]))

two lines, but you get the idea. I refuse to write a messy abomination.

>>54858762
>which one can be understood faster when something needs to be changed?
test2 indeed, it's declarative.
>>
>>54858857
>test2 indeed, it's declarative.

could you understand the code of test2 function faster than test1 ?
>>
File: zeitmessung.webm (2MB, 1920x1080px) Image search: [Google]
zeitmessung.webm
2MB, 1920x1080px
look
>>
>>54858722
True, the error is in the 2nd parameter of the zip. Namely the a[1:]. It must be the init of the sequence, i.e. a[:-1].

>>54858857
I like this one better though.
>>
>>54858857
explanations:
itertools is the go to for this kind of thing, although sum and zip are standard functions. I started by sum because the vp is indeed the sum of something, the sum of
p[0]*q[1] - p[1]*q[0]
, where p is drawn from a and q is drawn from a, shifted, and that's the only subtelty in fact. I had to check the docs btw

btw it's the shoelace formula rite?

>>54858894
oh clearly yes! it's direct, it totally reads like English or almost. Maybe I'd do three lines and separate a_shifted in its own variable, but that's the only thing. That for loop clearly takes too long to break down.
>>
I bought The Shellcoder's Handbook and couldn't finish the first chapter because they require you to understand x86 assembly. So where should I go to learn that?
>>
>>54858857
>>54858930
thanks man! appreciate it!

>btw it's the shoelace formula rite?
yes it is!
>>
r8 my reverse string function niggers

std::string reverse(std::string const& str)
{
if(str.empty())
return {};
return str.back() + reverse(str.substr(0, str.length()-1));
}
>>
>>54858924
I know lambda is the way, but naming functions and values out is also an option mate. To me this version, while more true to the original, is no better than a muddy for-loop. After all, isn't the One Question to separate true masterlangs from garbage, can your language abstract away an iteration?
>>
>>54858952
>r8 my reverse string function niggers

first of all, i'm not a nigger nor male.

and your function is not good!
>>
>>54858952
stackoverflow/10
>>
>>54858951
U welcome. Also functional constructs are the way, remember it.
>>
>>54858968
except it's not
this function is so short I'm sure someone else wrote the same
>>
>>54858989
it's alright anon
>>
>>54857065
i did an implementation of Kmeans in C++, shouldn't one of the vector distance values always be 0 because it is the distance from the vector to itself, thus giving you 0 and 9 other values?
>>
>>54858476
i thought you meant like a browser plugin
>>
>>54858987
do you usually write one-liners when writing code?
can other people understand?

do prefer writing it that way or normal pseudo-code?
>>
>>54858999
thanks 3/2 satan
>>
>>54858952
absolutely disgusting
>>
>>54859035
Write something better then
teach me senpai
>>
>>54858964
>nor male
are you a female or some kind of queer

post feet
>>
File: 1320467413867.png (41KB, 322x191px) Image search: [Google]
1320467413867.png
41KB, 322x191px
>>54858964
>nor male
You know the rules, tits and timestamp.
>>
File: rpamphet.png (113KB, 993x723px) Image search: [Google]
rpamphet.png
113KB, 993x723px
>>54859016
>normal pseudo-code
normies can go die really.

>do you usually write one-liners when writing code?
>can other people understand?
I admit I have no experience team-programming in Python 3. Maybe if I take this internship I'm on, they'll respond that itertools is evil if I ask, I don't know.

But regardless of what the populace does, once you swallow the functional red pill, you can't forget the truth, so I hope I'll find myself places filled with like-minded folks.
>>
>>54859077
btw I no Scheme isn't functional, it's just that I don't know how to categorise my preferences. Maybe superior masterrace without any adjective, idk
>>
>>54858963
He asked for a one liner :P
>>
File: code bloat.jpg (99KB, 630x655px) Image search: [Google]
code bloat.jpg
99KB, 630x655px
>>54859095
> :p
>>
What's a good way to get started with android development? I've been skimming through a udacity course but want to start working on my own app soon.
>>
>>54859095
Ja richitig, just rambling about. btw this way of programming is enlightened rather than superior, I don't want to come across like an evil bigoted racist. Because that's what C programmers are.
>>
>>54859077
itertools is usually considered good practice, no worries.

Where do you intern?
>>
>>54859115
Start a project involving android dev.
>>
>>54859155
wow thanks!
>>
I am looking for some papers about writing your own process to get into other process loaded into memory and change value of a specific int variable.

What is this kind of method called?
>>
>>54858919
Noice.
>>
File: odoo.png (5KB, 800x600px) Image search: [Google]
odoo.png
5KB, 800x600px
>>54859134
A local small business centered on Odoo, so it's a company that provides services for companies, I don't know how to call that in English. Maybe I'll touch NoSQL stuff, or maybe get to explore the territory of some new hardware they've recently gotten. I'm competent in system administration because muh hobbies, but I know a number of languages, and I know Python is how Odoo is made, so there's that. I have an appointment soon, we'll see. Also the boss is family, as if by chance.
>>
>>54858919
what is this?
>>
>>54859120
We learned Haskell in the first semester of uni (Germany) actually, wasn't until Scala that I have seen it being used in "real-life projects". And, of course, you can use some of these idioms in Python.

What I found out is that at least some FP is a good filter for workplaces: they're less likely to disappoint.
>>
>>54858919
I guess you built it? Nice way to skill up while being useful, unlike most of us. GG
>>
>>54859220
>tfw no nepotism
>>
>>54858919
That's nice anon
>>
>>54858722
also, fails when a=[] unlike >>54858857.
>>
>>54858919
This is an important development. Some might even call it revolutionary.

Despite its importance, however, the technologies that will underpin this new method of telling lap times are the property of major tech firms who don't necessarily have the public's best interests at heart.

Not anymore.
>>
>>54859048
inline std::string strrev(std::string const& src)
{
return { src.rbegin(), src.rend() };
}


Why do you have to overcomplicate things.
>>
>>54859558
indeed

def strrev(string):
return string[::-1]
>>
>>54859558
>>54859630
which is faster?
>>
>>54859650
Why do you care?
>>
File: 550af6cf8c600.jpg (30KB, 615x410px) Image search: [Google]
550af6cf8c600.jpg
30KB, 615x410px
>>54859650
Lets see how fast it goes around our track
>>
File: proud-developer.jpg (18KB, 324x324px) Image search: [Google]
proud-developer.jpg
18KB, 324x324px
I copy paste from stack overflow and I'm proud of it.
>>
>>54859650
>which is faster
>C++ or Python
Wew lad.
>>
>>54859231
What university? I'd like to take a look at the curriculum.
>>
>>54859729
>inb4 >languages can't be slow only implementations
>>
>>54859727
same
>>
>>54857354
Fuck off, OP
>>
File: Caterina_fake.jpg (1MB, 2848x4144px) Image search: [Google]
Caterina_fake.jpg
1MB, 2848x4144px
>>54859225
it is a lap timing system build with arduinos.
It works "rfid-like", only that the tag is active and not passive to achieve the desired range.
I could have used uhf rfid, but those are too expensive for me
>>
When using pthreads, can I make the threads loop forever instead of joining them?
Also, am i supposed to pass them a function pointer in order to do work?
Are the stack variables in every thread private to every thread?
>>
>>54860289
>When using pthreads, can I make the threads loop forever instead of joining them?
Yes. But it would mean that your program will never terminate, which is ridiculous.
>Also, am i supposed to pass them a function pointer in order to do work?
Dunno.
>Are the stack variables in every thread private to every thread?
Yes and no. You must be more precise.
>>
>>54860324
I want every thread to have it's own stack that's private from all the other threads.
Is it default behavior?
>>
>>54860289
>When using pthreads, can I make the threads loop forever instead of joining them?
Sure. Whatever made you think you can't?
>Also, am i supposed to pass them a function pointer in order to do work?
When you create a thread, it runs the code you tell it to run. How do you do that? By giving it a function pointer. What is this? STUPID QUESTIONS FOR DERPHEADS?!
>Are the stack variables in every thread private to every thread?
Yes, unless you hand out pointers to them. Sometimes that's even a good idea (usual rules on shared resources apply, of course).
>>
>>54860362
I realize that I'm not sure about that. How is it possible?
>>
<?php
$meme = 'meme';
echo strrev($meme);
?>


>>54859048
>>
>>54858964
>your code sucks
>im a girl btw
>>
>>54860365
One more question, how do I pass arguments through the function pointer?

Let's say that i want all the threads to have access to a stdout mutex and their own unique rand_r() seeds.
I have them declared in main() because globals are gross.
>>
(I've been slow at writing)
>>54860289
>When using pthreads, can I make the threads loop forever instead of joining them?
> To allow other threads to continue execution, the main thread should terminate by
> calling pthread_exit() rather than exit(3).
as per pthread_exit(3), so do that. I don't think you need to detach them, as pthread_detach(3) contains
> The detached attribute merely determines the behavior of the system when the thread
> terminates; it does not prevent the thread from being terminated if the process ter‐
> minates using exit(3) (or equivalently, if the main thread returns).

> Are the stack variables in every thread private to every thread?
There are as many distinct stacks as there are threads, but if you pass around pointers, nothing will stop anyone from writing anywhere. Does that answer your Q?
>>
File: image.jpg (30KB, 352x352px) Image search: [Google]
image.jpg
30KB, 352x352px
>Cant find an entry level coding job that doesn't require 3 years of experience in a dozen frameworks ive never used
>I live in NYC
>>
>>54860433
You have to exploit the void pointer you get to pass along with the function pointer to pthread_create. It exists precisely because there is no other way to "customise" if you will, function pointers by attaching a set of runtime values to them. In higher order languages we could create a function with a closure, but in C it doesn't exist.
>>
File: 1464731615076.jpg (46KB, 400x458px) Image search: [Google]
1464731615076.jpg
46KB, 400x458px
I'm a retarded first year student and I got a task for a job interview.
it asks me to implement a framework for building FSMs. also asks to provide as much common functionality as I can.

I'm wondering what "common" functionality is reasonable to expect in such a thing. I can't quite think of any.
furthermore, what is a good way for understanding how to make such a thing? read code of other frameworks? read up on design patterns? etc.
>>
>>54860464

learn web development and make a shopping cart . You can use node.js, jQuery or php to get it done! Install xampp and learn how to do CRUD with mySQL. You can do it anon-kun!
>>
>>54860510
>You have to exploit the void pointer you get to pass along with the function pointer to pthread_create

How do I do that?
>>
>>54857016
Please help me with MVC design pattern, i can't find anything related on google


Map data in form of 0,0,200,200,0,200,0,200,200,0,400,0,200,200,0,0,200..... are read from a file and stored in an array inside the model.

Now I need that array in my View for the g.drawRect methods and for defining Shapes that will be have mouselisteners attached to them in the controller.

The simplest way to do it would be to just type model.array but it's against everything in MVC. How do i transfer map data from my model to the draw methods in view?????
>>
>>54860577
MVC is nonsense
>>
>>54860464
start a project, if you're unemployed you have time for it anyway, and the project will give you experience and maybe make you money so you can start your own software company
>>
>>54860544
Most of the time, programmers create a dedicated structure type with exactly what they need, and pass a pointer to a struct thru the void pointer. You have to be extremely careful about not destroying the struct before the new thread gets to consume it, even more so because it's multithread, so if you don't synchronise it can happen extremely late with regard to the parent thread's instructions. I think the simple and safe approach would be to dynamically allocate in the parent and free in the child, because if it's on the parent's stack it will be risky. Maybe someone has guidance on that?

add: I know of at least one other way, using var_args and synchronising. Here it is on Plan 9, just for the lulz:
typedef struct {
void (*f)(va_list*);
va_list l;
} VaThreadCreate;
void vathreadcreate2(void *aux) {
VaThreadCreate* tc = aux;
tc->f(&tc->l);
}
int vathreadcreate(void (*f)(va_list*), int stacksize, ...) {
VaThreadCreate tc;
int id;
tc.f = f;
va_start(tc.l, stacksize);
id = threadcreate(vathreadcreate2, &tc, stacksize);
yield();
va_end(tc.l);
return id;
}

typedef struct {
VaThreadCreate;
int stacksize;
Channel *done;
} VaProcCreate;
void vaproccreate2(void *aux) {
VaProcCreate *pc = aux;
threadcreate(vathreadcreate2, (VaThreadCreate*)pc, pc->stacksize);
yield();
chanclose(pc->done);
}
void vaproccreate(void (*f)(va_list*), int stacksize, ...) {
VaProcCreate pc;
pc.f = f;
va_start(pc.l, stacksize);
pc.stacksize = stacksize;
pc.done = chancreate(sizeof(void*), 0);
proccreate(vaproccreate2, &pc, mainstacksize);
recvp(pc.done);
chanfree(pc.done);
va_end(pc.l);
}
>>
Is a linked list and a sparse matrix the same thing?
>>
>>54860658
But dynamic allocation is probably more efficient, especially with posix threads. I just did that for the lulz and the flexibility and the elegance.
>>
>>54860538
I already know node and JQuery. I'm looking for both software and web jobs(but not front end)

Maybe I should look into front-end though, since angular is bringing web applications to it
>>
>>54860653
I would but every idea has been done, and by coders of much greaer skill
>>
>>54860682
>I would but every idea has been done, and by coders of much greaer skill

then you're useless
fuck off
>>
>>54860682
even if you make some basic shit that's inferior in every way it'll still help you learn and prepare you to make better shit
>>
File: 1432095026626.jpg (35KB, 440x310px) Image search: [Google]
1432095026626.jpg
35KB, 440x310px
>>54860682
Pathetic
>>
/dpt/ give me your most difficult programming interview questions and I'll try to solve them
>>
i have an array with 9 items in it. What sorting algorithm do i use?
>>
>>54860737
sleep sort ofc
>>
>>54860754
pls no memes.
>>
>>54860775
Meme questions get meme answers.
>>
File: 2016-06-01 16_33_16-Atomica.png (97KB, 552x798px) Image search: [Google]
2016-06-01 16_33_16-Atomica.png
97KB, 552x798px
Just added in skip to previous/next track buttons.

How can I make this UI look better? Any suggestions?
>>
>>54860718
>>54860689

You know what? You're right, I am bitching. I'll just do something that's been done
>>
>>54860737
Isn't quicksort by definition the quickest?
>>
>>54860860
Fuck yeah dude, best of luck!
>>
>>54857034
>>54857046
Thanks guys for the book.

However, is there anywhere I/we could also locate the two other texts that supplement this one? Programming Python and the book Python Pocket Reference are two other texts mentioned by the shill in the preface. If I wanna take the time to learn this shit I'd like access to as much resources as possible m8s.
>>
>>54860737
insert sort
>>
>>54860933
>https://kat.cr/usearch/?q=Python+Pocket+Reference

>https://kat.cr/usearch/?q=Programming+Python+o%27reilly

Literally took me 5 secs.
>>
>>54860820
make the volume slider vertical.
>>
>>54860658
So basically, you have to allocate your own stack variables manually?

That sucks.
I wish C had anonymous function literals so bad.
>>
>>54857360
Tripcode generator
>>
>>54860909
I even have an idea already, im just worried Ill get a cease and desist.

[spoiler]mar.io[/spoiler]
>>
Is there anything that Monads CAN'T solve?


Performance excluded
>>
>>54861028
damn I never thought about this. Interesting suggestion. Almost all music managers
(and video players) have it horizontal though. I think it may come out looking awkward, what do other anons think of vertical volume controls?
>>
>>54861189
website already exists
>>
>>54861190
Simplicity.
>>
>>54861212
Monads do simplify
>>
>>54861228
A tiny island of sanity in a cesspool of madness.
Compared to a design in a non-hippie language, they are anything but.
>>
>>54857360
Do an n-body simulation.
>>
>>54861210
I know, I could just change it to shroom.io or toadstool.io

The idea is to just do to mario bros what slither.io did for snake
>>
>>54861245
They reduce code complexity and quantify abstractions

f(x) + f(x) + f(x); -> 3*f(x);
>>
File: 1463438166601.jpg (75KB, 424x383px) Image search: [Google]
1463438166601.jpg
75KB, 424x383px
>be windows user
>try to open 200MiB text file
>wordpad chokes
>notepad chokes
>atom chokes
>firefox chokes
>download Vim from vim.org
>loads instantly and searching is instantaneous

holy shit
>>
>>54861296
The simple fact that people have trouble grasping them, makes them complicated.
There is no value in simplifying things through an abstration, if the abstraction itself is so complex that few people can use it.
That it is possible to use monads is the best I can say about their simplicity.
>>
>>54861330
>wordpad
>>>reddit
>>
>>54861340
Yet people use lists, async, exceptions & optionals all the time
>>
So I have just started to mess around with php and decided to make a dumb script that just prints a certain character x number of times for y lines. After a while I thought about how complicated I could make it and ended up with this. Are these kind of "optimizations" common or a practice in actual code ?
http://pastebin.com/rkJiSAF7
>>
>>54861366
Which are typically much simpler to use, although they can result in somewhat more complex code.
>>
File: 2016-06-01-150931_1079x699_scrot.png (478KB, 1079x699px) Image search: [Google]
2016-06-01-150931_1079x699_scrot.png
478KB, 1079x699px
Working on my taggable image viewer, Ivy. Rather, just fixed a few bugs and then decided it was time to publish a new version. I'll get binaries set up for all three platforms later today, but if you'd like to view the source (or build it yourself), it's located here: https://github.com/lehitoskin/ivy.git

I added a bunch of command line stuff so that you can manage your images and tags from scripts, which I think is nice if you have a whole lot of images that share tags (like I do).
>>
>>54861377
What optimisation?
Outside of the general brainded code, and the fact that you do i*j instead of 5*i, this is as straightforward as it gets.
>>
>>54861071
You mean allocating your own closure? Yes, that's the thing.

I finished rewriting my stuff for Unix, maybe you'll like it (maybe there's a bug, I'm not sure):
#include <stdio.h>
#include <stdarg.h>
#include <pthread.h>
#include <unistd.h>


typedef struct _aux_t {
void *(*f)(struct _aux_t*);
va_list l;
pthread_spinlock_t s;
// protocol: f shall consume aux->l, then unlock aux->s, then do its thing
} aux_t;

static void* wrap(void* aux_) {
aux_t* aux = aux_;
return aux->f(aux);
}
int va_pthread_create(pthread_t *out, const pthread_attr_t *attr, void *(*f)(aux_t* aux), ...) {
aux_t aux;
aux.f = f;
va_start(aux.l, f);
pthread_spin_init(&aux.s, PTHREAD_PROCESS_PRIVATE);

pthread_spin_lock(&aux.s);
pthread_create(out, attr, wrap, (void*)&aux);
pthread_spin_lock(&aux.s);

pthread_spin_destroy(&aux.s);
va_end(aux.l);
}


// Example:
void* sub(aux_t* aux) {
printf("lel\n");
int i = va_arg(aux->l, int);
pthread_spin_unlock(&aux->s);
printf("Hello from #%d\n", i);
return NULL;
}
int main() {
printf("hello world!\n");
for(int i = 1; i <= 10; i++) {
pthread_t t;
pthread_attr_t a;
pthread_attr_init(&a);
pthread_attr_setdetachstate(&a, PTHREAD_CREATE_DETACHED);
va_pthread_create(&t, &a, &sub, i);
printf("done starting #%d\n", i);
pthread_attr_destroy(&a);
}
return 0;
}



                  ¡ R8 !
¡¡ R8 !!
¡¡¡ R8 !!!
¡¡¡¡ R8 !!!!
¡¡¡¡¡ R8 !!!!!
¡¡¡¡¡¡ R8 !!!!!!
¡¡¡¡¡¡¡ R8 !!!!!!!
¡¡¡¡¡¡¡¡ R8 !!!!!!!!
¡¡¡¡¡¡¡¡¡ R8 !!!!!!!!!
¡¡¡¡¡¡¡¡ R8 !!!!!!!!
¡¡¡¡¡¡¡ R8 !!!!!!!
¡¡¡¡¡¡ R8 !!!!!!
¡¡¡¡¡ R8 !!!!!
¡¡¡¡ R8 !!!!
¡¡¡ R8 !!!
¡¡ R8 !!
¡ R8 !
>>
>>54861377
Nested loops are very common.

You can use this syntax for arrays btw.:
$a = ["Hello", "world"];
>>
>>54861384
>I'll get binaries set up for all three platforms later today
>all three platforms
BSD fags on suicide watch
>>
>>54860537
pls respond.

like, literally anything so I can stop feeling stuck.
>>
>>54861443
WWF would like a word with you
Something about abusing animals of an endangered species
>>
>>54860537
Have you ever built software before?
>>
>>54861443
?

the project is licensed under GPLv3, an open, free software license. Assuming it doesn't have any strange dependencies, BSD fags can simply compile their own binaries.
>>
>>54861443
Obviously I meant GNU/Linux, BSD, and Haiku :^)
>>
>>54861529
It must hurt a little bit when even Linux users don't recognize you as a real platform.
>>
>>54860820
Make some frame for an image. Raw pasted images looks terrible imho without some predefined place for them, that is visible even without said image.
>>
will learning scala help with job opportunities?
>>
>>54861505
yes, biggest thing I did was a (very) simplified compiler.
it's just that this is the first time that I get vague instructions with very little hand holding, and I'm feeling lost and overwhelmed.
>>
>>54861625
sorry, that was supposed to be no, I haven't built software yet. just implemented some easy shit and did coursework.
>>
A friend and myself are building a system around weather data, and we just found out we're looking at about 1,750,000 rows of data a day.

I'm not so much worried about the rows per day as much as the actual size of the data - 200MB/day. Pegs at outgrowing our shitty laptop server in 3-6 months. Is anyone aware of a hosted database solution (we're currently using postgres).

From my currently research it seems best to just get a VM on AWS/Azure/Google and attach a big ass disk to it and run the database that way.
>>
>>54861427
Its my first code, of course its braindead. What I was asking is if things are okay to be overcomplicatedlike this. I could have just echoed some of the values raw without the need for the arrays or variable concatenation
>>
>>54861625
>>54861653
Okay well, imagine you're the user of your program and you want to build FSMs, think of what you could possibly do with a FSM.
Build your library so that most of the hard work of using FSMs is coded in the library.

Stuff like easily adding states and transitions, setting callbacks when something interesting happens (like reaching or leaving a certain state), something to trigger transitions, etc.
>>
>>54861683
It depends solely on what you're trying to make. Usually you'd rather use raw string literals.
>>
>>54861683
It looks a little strange, usually people don't do that unless there's something more complicated they need to do with the variables & arrays.

So here it'll work, but you probably shouldn't to not confuse the reader.
It's like using a shovel to serve food, it might work, but there's a simpler way and people will think you're crazy.
>>
>>54861624
no
http://jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/
>>
is there any reason to use ajax nowadays when you have websockets available?
>>
File: ????.jpg (45KB, 577x622px) Image search: [Google]
????.jpg
45KB, 577x622px
Should I declare all of my functions in the header or just the ones that absolutely need it?
>>
>>54861765
Ajax is much simpler, and websockets have a real cost on the server.
>>
>>54861769
Templates can only be defined in the header

If you use non-templated functions there's probably something wrong with you
>>
>>54861769
If it's a public header, only declare what you're committed to maintain and don't mind other people using.
If it's the private header, same thing, but you're not in trouble if you fuck up.
>>
>>54861769
That's kind of why header files exist, right? Just put them in there.
>>
>>54857046

>Monty python references fucking everywhere

Fucking hell, I hate Python enthusiasts.
>>
File: 1.png (80KB, 599x300px) Image search: [Google]
1.png
80KB, 599x300px
>>54861802
This is C though.
Of course I could always implement templates.
>>
File: 2.png (74KB, 599x300px) Image search: [Google]
2.png
74KB, 599x300px
>>
>>54861868
>>54861885
C-cute
>>
>>54861700
thank you, that helped. I think I was overthinking it.
>>
>>54861868
>I could always implement templates

someMacro(int) does not do the same thing templates do
>>
>>54861384
I think you need some interpolation there my friend.
>>
Looking to get into dependent types. I'm familiar with Scala (used it at my job for 4 years) and have used its dependent typing a bit, but it's very limited. Is Idris a good place for me to start?
>>
>>54861962
I was only jesting.
>>
>>54862004
Yes, or a dynamically typed language
>>
>>54858557
>>54860658
>>54861432
>>54858857
I don't get it, why all the abreviations? Why not just use descriptive variable names so that people can actually read the code?
>>
File: 1423010757075.jpg (14KB, 249x243px)
1423010757075.jpg
14KB, 249x243px
>tfw working on a personal project for months
>had a lower-level bug that plagued my program for months with endless frustration
>finally fixed it today, and for the first time my application runs buttery and consistent.

Who knows how great this feel is?
>>
File: KTLteIM.webm (1MB, 966x646px) Image search: [Google]
KTLteIM.webm
1MB, 966x646px
>>54862040
>inb4 abbreviations*
>>
>>54861751
So that is the hubris of custom operators?

What sort of idiot defines an operator with no meaning? Thats like defining a method as void fhdkvskv(int wknlpfwhns, double *sigphd) {}

Don't blame scala for a developer intentionally making code unreadable
>>
>>54862026
>dynamically typed language
How would that be useful for dependent types?
>>
>>54862087
Dynamic typing is just dependent typing in U∞
>>
>>54862059
I don't know that feel because I don't let major bugs linger for months ;^)
>>
>>54862059
what is the project
>>
>>54861990
How do you mean?
>>
>>54861624
no it's a shitty obscure hipster meme lang
>>
>>54862085
All the articles I've seen of the form
>why I moved from Scala to a language with a less powerful type system
have all been written by people who simply weren't smart enough to take advantage of even a fraction of Scala's expressiveness and flexibility. You can safely ignore such articles because they are not worth reading.
>>
>>54862124
It's used quite a bit in fintech.
>>
>>54862059
>>had a lower-level bug that plagued my program for months with endless frustration
you're doing it wrong
>>
If I have 0 javascript knowledge should I start learning Node.JS?
>>
File: 1424386128204.png (93KB, 645x773px) Image search: [Google]
1424386128204.png
93KB, 645x773px
>>54862098
>>54862094

It was actually a bug from using a python GUI module in conjunction with threading.
Fucking Tkinter. Last time I ever touch it, just too lazy to recode everything to something else like PyQt.
>>
>>54862210
No. In fact, the question can be simplified and the answer is the same:

>Should I start learning Node.JS?
No.
>>
>>54862210
no
>>
>>54862091
But don't you lose the advantage of the compiler calling you out when you get the types wrong?
>>
>>54862210
only if you want lots of money
>>
>>54862231
Why not? Seems like it would be great for sites like "csgo roulette" etc. not that I plan to make one as there's already hundreds of them but I did plan on making something similar for a different game, I don't have time to learn Go.
>>
>>54862272
even for webshit nodejs is deprecated it's all about python with django/flask
>>
>>54862210
I meant where* should I start learning Node.JS
>>
>>54862273
>>54862288
>>>/g/wdg
>>
>>54862257
Not if it's strongly typed
>>
>>54862257
>>54862324
I mean you could still have lemmas and proofs, and compilers for all the stuff you'd have in a regular language, but you'd have the additional benefit of all types & terms being able to coexist
>>
>>54862324
You'll have to help me out a little here and explain what you mean by 'dynamically typed', evidently my understanding (which is admittedly hazy) doesn't seem to align with yours.
>>
>>54862361
The simplest explanation would just be that type is dependent on runtime value, but really it's that types are just another kind of term
>>
>>54862361
A dynamic language can still have strong type constraints, and can still have static type constraints that can be evaluated at compile time, e.g. there's no reason in theory why a function int -> int where int is a primitive determined by the compiler should perform worse in a dynamic language, but the problem is most dynamic languages don't have int -> int they have value -> value and their int -> ints are just
if (isAnInt(someValue)) then Value(...) else throw exception
>>
>>54862433
Forgive my ignorance, but in what sense would that then be a dynamic language? I sense there's something basic I'm missing here.
>>
>>54862458
You would still have dynamic values & runtime type construction
>>
>>54862458
Basically in the same way dynamic languages have primitives they can easily have primitive functions
>>
>>54862488
>>54862479
>>54862393
Thanks yall. I'll try to get my head around it. My basic intuition has thus far been that dynamic languages are things like Python, JS and Ruby.
>>
>>54862116
I can see that there are jaggies in that image.
If they do not appear at native image res then the problem is that your scaling method does not implement pixel-data interpolation, or that it implements a poor one.
I would go bicubic.
>>
File: 2016-06-01 17_59_14-Atomica.png (81KB, 552x798px) Image search: [Google]
2016-06-01 17_59_14-Atomica.png
81KB, 552x798px
>>54861575
I can see this working well. I tried to compensate for said issue by having that consistent white thin border for everything as you can see.
Still trying to keep it minimal.

What do you mean by frame? like a sunken look or some type of simple square image that is under the album art while being a bit bigger (to see the album art "contained" in it)
If the latter, what should it be? maybe just a different shade of grey?
>>
>>54862571
In a dependent language, you have something like

Vect :: Nat -> Type -> Type
(Nat is an arbitrarily big natural number)
The universe of the first type parameter is n, while the universe of the second parameter is n+1

I say Universe ∞ because in dynamic typing -
Vect :: Nat -> Type -> Type
The universe of the first type and second type are the same. ∞ + 1 = ∞
>>
>>54862643
This is just my musings though, dynamic languages without strong static typing & proofs (i.e. all of them) don't have the same safety & aren't guaranteed to be well formed like normal dependent languages, but it's useful for learning
>>
>>54862612
Ah, I think I'll look into that. Thanks anon.
>>
>>54862067
>that webm
they dont work like that
>>
>>54862838
how would you know? are you a windmill engineer?
>>
>>54862040
>python and C shitters
>readable code
good one m8
>>
is pastebin offline for anyone else? it's the only site offline for me and i also tried going to it on a vm
>>
>>54862908
it's up
>>
>>54862927
try going to this http://pastebin.com/sfUW2jT1 and tell me if it's still up
>>
>>54862968
still up
>奴隷との生活 -Teaching Feeling-
>>
>>54862231
>JS is bad
This is 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.
>>
>>54862997
what do you think the issue is? and idk what that is you're talking about i must've mistyped it i'm talking about programming. it works on my iphone but not a different browser on the same computer
>>
>>54863006
i dunno lol maybe try in >>>/g/sqt
>奴隷との生活 -Teaching Feeling-
is what came up at your link
>>
>>54862998
>JS is not bad
this =(==?(===?)) false
>>
>>54860464
>a big programming studio in your area didn't require any formal work experience nor a degree, just knowledge of some networking, c++ and python

cool as shit, got the job as a junior c++ dev even though im a hs dropout
>>
>>54863006
maybe it's a temporary fault with your ISP
>>
>>54863035
that crossed my mind but it works on my phone which only has wifi
>>
File: Untitled045920.png (66KB, 1920x994px)
Untitled045920.png
66KB, 1920x994px
Deciding how to implement records in zones.
I finished the WTForms stuff for DNS, but I still have to replace all other with it too.
>>
>>54861432
God C is truly disgusting.
>>
is there any decimal relation when doing bitwise operations with AND, (X)OR? Like 100 XOR 40? I dont really see it
>>
>>54863059
muh aesthetics!
>>
>>54863059
You're confusing the code and the coder.
>>
>>54863135
Have you tried graphing it?
>>
>>54860537
Video games
I have a state machine for mine that does animation based on the state it is in
>>
>>54860883
On average, depends on the data quality (is it properly random, etc) and size
>>
>>54862127
Did you even see the article? It went full expressive and used scalaz

Tons of other shops don't use scalaz
>>
File: javascript.png (5KB, 270x175px) Image search: [Google]
javascript.png
5KB, 270x175px
>>54862998
>JavaScript
>pretty cool language
>>
>>54863306
These are corner cases. C has its own bool vs 0-1 and 0 vs NULL thing.

These bad design decisions could be removed and it wouldn't change much.
>>
>>54863135
just plotted some xors of 2 and 3 with some numbers. Graph kinda looked the same but nothing groundbreaking desu senpai.

There has to be some math/mechanism behind it but i just cant see it
>>
My symbolic differentiator works correctly on expression such as this one
'x/(77*83/99)/sqrt(x*100/90)/65/(88+85)-63/56-42'
Feels good
>>
>>54863306
> sorting integers
> corner case
> zero equals empty string
> corner case
> it's okay to increment a string
> corner case

Mate, pls.
>>
>>54863487
Meant for
>>54863422
>>
What should I be reading/looking into if I want to learn OOP in c++?
>>
>>54863573
http://learnyouahaskell.com/chapters
>>
>>54863487
> zero equals empty string
Isn't it the same as with C NUL-terminated strings? (^:

>it's okay to increment a string
why not if it works

>sorting integers
that's a fail, though how would a dynamic language know that this is an array of integers which should be sorted by integer order, not string order?

Some of these are stupid, others are less stupid. Many dynamic languages have similar design issues.
>>
>>54863573
class Animal
>>
>>54863599
1. Because zero is a number and an empty string is an empty string.

2. Increment should work only on numbers/integers; incrementing a string makes no logical sense.

3. If presented with integers, it should sort numerically, if chars, lexicographically.

This all boils down to typing, I guess.
>>
>>54863684
>If presented with integers, it should sort numerically, if chars, lexicographically.

How should it sort
var array = [10, "abc"];

then?

Should it perform expensive runtime type checking every time it needs to sort a list?

>incrementing a string makes no logical sense.
Int he browser that worked with forms it often made sense

>This all boils down to typing, I guess.
Yup, dynamic typing makes code and dev time shorter. Weak vs strong typing is debatable, both have some advantages and disadvantages.
>>
>>54863135
don't know what you're talking about but probably not in the way you're thinking
>>
how does my C drive get filled up by 1.2 GB in a matter of hours? i don't fucking get it. soon there will be practically nothing left for me to delete on my C drive
>>
I have a list of 300,000 records to pull down

for id in items:
Iteminfo = sqlQueryResult(id)


is there not a more efficient method?
>>
General-purpose computing is magic.

This magic must be in the hands of all, not just those who can master Unix. The computer is a bicycle for the mind. It's an open vehicle for exploration and discovery.
>>
>>54863844
Wrong thread buddy.
>>
>>54863908
wow you fucking retard

info = sql whatever where id in ({}) format(','.join(items))
>>
>>54863797
> how should it sort a heterogenous array?
It shouldn't; it should throw an error.
>>
>>54863926
in is insanely inefficient for more than 100 records. I already tried it.
>>
>>54863954
This isn't friendly computing. Why not go back to writing C then.
>>
>>54863991
'Friendly' computing causes bugs, which stresses the programmer and lengthens and complicates development. Surely a programmer's 'ease' is secondary to a program's logic?

> go back
I would argue allowing only homogenous arrays is safer (in the sense of typing) than heterogenous.
>>
>>54863797
>>incrementing a string makes no logical sense.
>Int he browser that worked with forms it often made sense
What?
>>
>>54863908
solved. Inserted ids into temp table and then left joined.
>>
>>54863962
try indexing
>>
>>54864042
>I would argue allowing only homogenous arrays is safer (in the sense of typing) than heterogenous.

It destroys a significant part of what makes dynamic languages convenient, makes you go back to 10-long declarations of array types.

Typing can be added at later stages of program development, when the exploratory stage is finished. Strict typing is detrimental to quick development IMHO, writing types to solve a non-trivial problem is a puzzle in itself.
>>
>>54864068
Forms receive strings from user, these strings are often meant to be numbers. If you disallow working with number string as with number you force the programmer to perform a check + parse every times he imports string into his program from the browser environment.
>>
Whats the best language to start programming?
Still C?
Recommend me any book?
Better if physical.
>>
>>54864450
nodejs

google
>>
>>54864273
>you force the programmer to perform a check + parse every times
Like this is some difficult task. Would you rather cross your fingers and hope the user didn't give you garbage? It's better to explicitly convert the input to a number, or use a control that only allows numbers.
The math operators aren't well defined for strings anyway. The original picture implied that "i++" and "i += 1" would have different results.
>>
>>54864450
Haskell is a great language.
You just have to start by reading all of Bourbaki!
>>
>>54864450
Haskell
>>
>>54862067
this is the funniest thing ive seen all week for some reason
>>
>>54864501
>>54864502
Hivemind
>>
>>54864473
>>54864501
>>54864502
ITT: We push some poor guy to suicide
>>
>>54864501
why do I feel I'm getting memed at
>>
>>54864515
he was thinking of learning C
haskell is a lot easier than C
>>
>>54864523
Nah, it's great for beginners, it'll teach you rigor.
There's only 10 volume, and it starts real slow by defining what a number is then rebuilding all of mathematics on top of that.

Then you'll be ready to start a simple hello world, but we won't really do that because side effects are evil.
>>
>>54864529
python is just a wrapper on C, just learn python
>>
>>54864542
monads (like IO) are side effect free
>>
>>54864556
I happen to be an expert on monoids in the category of endofunctors, and I can confirm this.
>>
>>54864542
should I do this before or after I install gentoo?
>>
>>54863025

>HURR I CANT FIGURE OUT OPERATOR RULES SO JAVASCRIPT SUCKS

is the equivalent of

>HURR I CANT FIGURE OUT HOW MONADS WORK SO HASKELL SUCKS

In short: Your idiot.
>>
>>54864450
Learn Urbit
>>
>>54864581
>in short: Your idiot

Javascript ladies and gentlemen
>>
>>54864579
Installing gentoo is for filthy plebs, over here we work with abstract mathematical machines in our head, like real academics.
>>
>>54864590
I still can't figure out whether that whole thing is a joke or not. If it is, then the amount of autism in this world is much greater than I anticipated.

>>54864594
>no counterargument
Mindless JavaScript haters, everyone!
>>
NEW THREAD!!

>>54864614
>>
>>54864600
Sorry but it's called F*, verification only!
>F* (pronounced F star) is an ML-like functional programming language aimed at program verification. Its type system includes polymorphism, dependent types, monadic effects, refinement types, and a weakest precondition calculus. Together, these features allow expressing precise and compact specifications for programs, including functional correctness and security properties. The F* type-checker aims to prove that programs meet their specifications using a combination of SMT solving and manual proofs. Programs written in F* can be translated to OCaml or F# for execution.
>>
>>54864621
dumbass
>>
>>54864609
>I still can't figure out whether that whole thing is a joke or not. If it is, then the amount of autism in this world is much greater than I anticipated.

I think he is doing it for real, but it is also done to prove a philosophical point that you can build everything from pairs of integers.

Mencious Moldbug has f u money, thus he is ok with spending a decade rebuilding computing from the ground up.
>>
>>54864624
This is only acceptable for the noble purpose of publishing more p̶o̶i̶n̶t̶l̶e̶s̶s̶ exotic type theory papers.
>>
Noob here again with more shitty, brainded, PHP scripts.

http://pastebin.com/NvxQ5MMC

I first wrote the else if's branch so that they also execute the function, but it didn't work. for some reason. Was it because of the custom emulation of the readline() function, or another reason?
Did I really need the variable from the function to be global?
>>
Hey fellas, I'm coding a Java bot to trade bitcoin by analysing historical data. I've figured that part out, but I want to pull daily data from coindesk now. I can use their api to get the current price, but I cant get their mining difficulty and transaction data found at these two links:
http://www.coindesk.com/data/bitcoin-mining-difficulty-time/
http://www.coindesk.com/data/bitcoin-daily-transactions/
That's where I got the historical data, by downloading it as a .csv, but I can't get one day's data from the website programmatically. Help?
>>
how long does it take to go fron codemonkey to actually "getting it" phase?
in general
>>
>>54864964
it took me about 7 months
>>
>>54864896
You need to store the result of readline in a variable, then use it in the ifs.
choice = readline();
if (choice == 1) {

} else if (choice == 2) {

}
// ...
>>
>>54865078
Oh, well that makes sense. Dunno why I didnt think about that...
>>
so whats so good about linux and programming?
>>
>>54857016
>subreddit
>shitty anime webm
>no gender discrimination
Why I got all "kodewithkarlie" vibe from this shit
>>
>>54864964
people are going to say however long they've been programming (2 years for me) or underestimate the time it takes because they overestimate their own ability
>>
Say I have a branch in my code, example if my program were to detect the presence of SSE and choose an SSE optimized code path, and that branch is taken 100% of the run time, will branch prediction completely or almost nullify any overhead of a branch? if not, what kind of overhead and is it worth replacing with a pre-compiler branch?
Thread posts: 324
Thread images: 37


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

If you need a post removed click on it's [Report] button and follow the instruction.
If you like this website please support us by donating with Bitcoin at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties. Posts and uploaded images are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that website. If you need information about a Poster - contact 4chan. This project is not affiliated in any way with 4chan.