[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: 320
Thread images: 42

File: 128326706456.jpg (263KB, 1118x1600px) Image search: [Google]
128326706456.jpg
263KB, 1118x1600px
What are you working on, /g/?

Old thread: >>60527117
>>
nth for the pathetic existence of Go
>>
>>60531022
first for having sex with my lisp book
how did you get a picture of me by the way
>>
File: 1492350470182.png (753KB, 603x594px) Image search: [Google]
1492350470182.png
753KB, 603x594px
>>60531022
Rewriting Rust in System T.
>>
File: intel-server-uptime.jpg (138KB, 1229x692px) Image search: [Google]
intel-server-uptime.jpg
138KB, 1229x692px
I', working on adding a number to another number in javascript but instead i just get them together. 2 + 2 is twenty two

I thought jquery was great and did all things but this just ;eaves me stumped
>>
>>60531022
"The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't know what it means for a programming language to be powerful and elegant. Once you learn Lisp, you will see what is lacking in most other languages." -Richard Stallman
>>
>>60531085
FooNaN desu
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
>>
>>60531104
>Richard Stallman
Stopped reading right there.
>>
>using emacs
>not using ewindowses
fucking neck yourselves macfags
>>
>>60531022
We need more lewd loli mangos adapted to /dpt/.
>>
if /g/ is so smart why dont they just make their own internet
>>
JUST
(deffunction main-func()
(printout t "Enter a number: ")
(bind ?chosenNumber (read))
(loop-for-count (?i 0 ?chosenNumber) do
(if (=(mod ?i 15) 0)
then (printout t "FizzBuzz")
else (if (=(mod ?i 3) 0)
then (printout t "Fizz")
else(if (=(mod ?i 5) 0)
then (printout t "Buzz")
else (printout t ?i)
)
)
)
(printout t crlf)
)
)
(defrule sys-init
=> (main-func)
)
>>
>>60531484
we already have like three de-central networks going.
>>
>>60531484
But I already did. You used it just now to post this message.
>>
>>60531127
that was the end though, so I also stopped after that..
>>
>>60531515
o

can u put it on a floppy for me?
>>
File: e0a.jpg (52KB, 1080x1080px) Image search: [Google]
e0a.jpg
52KB, 1080x1080px
would some kind soul be willing to take a peek at my shoddy neural net and tell me why it cant predict shit?
>>
>>60531077
>System T
Say your experiences with it.
>>
>>60531022
Sauce?
>>
How did you guys learn your current programming language of choice?
>>
>>60531513
Not a lisp

>>60531524
*raises hand*
>>
>>60531541
reading its unofficial, official book and citing its site.
>>
File: 1441329850103.png (1MB, 1920x1080px) Image search: [Google]
1441329850103.png
1MB, 1920x1080px
>>60531522
I got you, senpai
>>
>>60531541
Easily
>>
>>60531513
>more than 4 indent levels

ugh I don't even

>>60531541
BASIC language book borrowed from the library
>>
File: over_1.4_mb_of_porn.jpg (58KB, 640x480px) Image search: [Google]
over_1.4_mb_of_porn.jpg
58KB, 640x480px
>>60531522

Not sure there's enough room left famalamadingdong
>>
>>60531553
>128 ExaBytes SD card
I'm sure we'll see this one day
>>
File: Figure_combined.png (34KB, 640x960px) Image search: [Google]
Figure_combined.png
34KB, 640x960px
>>60531544
so what ive got is a single neuron with a sigmoid activation function, i train it with a function that returns a set of weights for a given input count and learning rate, and a function that attempts to continue from where the training data left off. when continueing i either get a constant flatline or a wall of peaks and dips that do not at all fit the pattern, depending on the learning rate and input count supplied. would you be able to tell me why this is or give me some hints at what might be wrong?

pic related, top is the learning results, bottom is the prediction results, red is neuron output, blue is training data.
>>
>>60531513
>parens on their own lines
Absolutely disgusting.
>>
>>60531589
Pretending you could store 1 bit per atom and the other components of the card took up negligible space, how much data could something the mass of an SD card even hold?
>>
>>60531627
One gram on DNA could potentially store 400+ exabyte, now imagine if a special card was designed anon per atom just to store info.
This will happen and sooner than we think
>>
>>60531649
[citation needed]
>>
I'm making a winforms app in 2017, should I feel bad? (It's for work though)
>>
>>60531676
What else would you use? WPF? Nobody really understands WPF. Not even Microsoft.
>>
>>60531663
>being a googlet nigger
http://bitesizebio.com/8378/how-much-information-is-stored-in-the-human-genome/
it's just simple maths, no proof needed
>>
>>60531691
Is WPF even "alive"? I've seen articles declaring it's dead back in 2012.
>>
>>60530817
Literal brainlet
>>
>>60531541
A shill shilled it to me and I liked what he shilled.
>>
>>60531702
The word "gram" isn't even mentioned in there, and there's so much bad math it might as well be labeled fake science.
>>
>>60531541
AI class taught me prolog, and god damn is that shit powerful
>>
>>60531747
sorry you're just too stupid
>>
>>60531762
Classical logic is trash though.
>>
>>60531544
It's better, it's cLIPS.
>>
>>60531795
doesnt matter, its exceedingly fucking powerful compared to imperative languages
>>
>>60531747
Since you're a dumb nigger I'll just link you this
https://en.wikipedia.org/wiki/Orders_of_magnitude_(data)
scroll down to zettabyte and look for the graphite thing and think for a second
>>
Got a Java question.
I have a method like this: public void Maze(java.io.Reader fileInput), it's suppose to take a texfile and turn it into a 2d array maze.
What input is it suppose to take? In my main I try to send a BufferedReader, args[0], a FileReader, but whatever I do I always get "Maze() in ClassName cannot be applied to" error.
>>
>>60531842
>doesnt matter
It matters when the core of the language is trash.
>its exceedingly fucking powerful compared to imperative languages
Sure, but that isn't really saying much.
>>
>>60531868
C++ doesn't have this problem
>>
>>60531868
post full code
>>
>>60531878
im sure lisp is far more powerful and versatile, but i dont know lisp, so for now that remains the most powerful language i have at my disposal
>>
>>60531922
I'm pretty sure most lisps have call/cc, making them classical trash as well.
>>
redpill me on setjmp/longjmp
>>
>>60531977
For exceptions, so isn't required for performance, so useless, so C89 is still the King.
>>
>>60531961
so what do you recommend?
>>
>>60531868
Switch to Kotlin.
>>
>>60531996
it's a c89 thing
>>
>>60532013
Really? That's not what I 'member. But in any case it's useless.
>>
>>60531022
So have you all started using smart pointers or cannot afford to refactor or learn a new concept?
Foo* func(T arg){
return new Foo(arg);
}


>VS
shared_ptr<Foo>& func(T arg){
return make_shared<Foo> (arg);
}
>>
I want to git gud
>>
>>60532057
How old are u?Got a job?
>>
>>60532006
Prolog with everything classical removed should be fine.
>>
>>60532047
>C++
>>
>>60532057
SICP
>>
>>60532047
>started
theyre like 5 years old at this point.
>>
>>60531795
How so? What do you suggest instead?
>>
>>60532047
>returning a reference to a local variable
You should stop using C++ and switch back to PHP.
>>
>>60532088
Have you used it ever in your project if exists?
>>
>>60532047
I only use unique ptrs with constant accessors tbqh
>>
>>60532125
i did when i still used sepples
>>
>>60532094
You are what is known as retarded person.
Read the context properly and reply.
>>
>>60531893
 public void Maze(java.io.Reader fileInput) throws IOException
{
int lineBuffer;
BufferedReader reader = new BufferedReader(fileInput);
String line;

while ((line = reader.readLine()) != null)
{
// process the line
rows++;
cols = line.length(); // always the size of the last line in the file
}
reader.close();
while((lineBuffer=reader.read())!= -1)
{
for(int i = 0; i<rows; i++)
{
for(int j = 0; j<cols; j++)
{
mazeData[i][j] = (char)lineBuffer;
mazeTable.put(new Position(i,j), Integer.toString(lineBuffer));
}
}
}
}
>>
>>60532047
>using namespace std;
please do not embarrass yourself any further
>>
>>60532149
and where you call the function
>>
>>60532146
I've read it, the second function isn't equivalent to the first, the temporary object created by make_shared is destroyed at the return and the reference the function returns refers to nowhere after the call. The function should return shared_ptr by value.
>>
>>60531541
I needed to get things done, and it turns out that pretty much anything you'd want to do is already baked into the language/framework/toolset.
>>
>>60532197
make_shared makes a shared pointer which is returned by value.

here learn how shared_ptr works
http://en.cppreference.com/w/cpp/memory/shared_ptr
>>
>>60532006
Common Lisp
>>
>>60532174
public class mazeMain
{
public static void main(String[] args) throws IOException
{
Maze mazeTest = new Maze(args [0]);
mazeTest.printMaze();
}
}

public void printMaze()
{
System.out.println(Arrays.deepToString(mazeData));
}
>>
>>60532389
Fuck, you're dense.
I know how shared_ptr works, m8, the problem is you returning it by reference and not by value, it won't even fucking compile https://godbolt.org/g/nRUOtF .
>>
>>60531127
I appreciate what you're doing here
>>
What procedural/imperative languages don't have objects?
>>
>>60532510
assembly
>>
>>60532510
C
>>
File: sicploli.png (631KB, 1111x1600px) Image search: [Google]
sicploli.png
631KB, 1111x1600px
>>60531139
http://lambda.bugyo.tk/cdr/mwl/
>>
>>60532475
args[0] is a String.
You need to pass in something that extends Reader. See "Direct Known Subclasses" here.

https://docs.oracle.com/javase/7/docs/api/java/io/Reader.html

Some Readers read from files, others read from strings. You may want a StringReader. Try this.

    
public static void main(String[] args) throws IOException
{
Reader r = new StringReader(args[0]);
Maze mazeTest = new Maze(r);
mazeTest.printMaze();
}
>>
>>60532526
>>60532535
Any modern languages that don't take weeks to do something trivial?
>>
>>60532686
What do you need to accomplish, the requires the absence of objects?
>>
>>60532697
/dpt/ says they pollute everything. I don't know, I'm just trying to get a good utility language to do things in, but all the cool ones have objects of some sort or another. New to programming, but I get the basics.
>>
>>60532510
Lua
>>
>>60532715
>he listens to /dpt/
>>
>>60532510
Bourne shell.
>>
>>60532715
If you want a language without objects, you should stick to functional programming.
>>
>>60532715
>but all the cool ones have objects of some sort or another
>thinking languages with objects are cool
get out
>>
FUKIN HELL

i made a python script that works, but as soon as i start it, audio on my win10 starts stuttering... dropping the multiprocessing from 16 procs to 1 improves it a lot but it's still present, and it doesn't really makes sense since almost all threads are always waiting for a lock anyway...

i'm going crazy, pls help
>>
>>60532715
>listening /dpt/
>listening to anything on 4chan
there's no hope for you left
>>
>>60532736
install gentoo
>>
>>60532736
>falling for both the python and w10 meme
wew lad
>>
>>60532668
Ok thanks.
>>
>>60532736
>pls help
>doesn't post any kind of information on what he's doing or the script itself
It's probably because you wrote it like a retard and python is a fucking trash language
>>
>>60532715
Just learn Python.

If you worry about objects "polluting everything", but cannot articulate an argument other than "people in these threads says so", then you're an idiot.
>>
>>60532767
refer to
>>60532734

Why are you contradicting each other?
>>
>The reshape function returns its argument with a modified shape, whereas the ndarray.resize method modifies the array itself:
hmm so python differentiates between methods and functions, but without any syntactic differentiation between the two. neurons in overdrive
>>
re:60532783
a better questions why are you still here and shitposting?
>>
>>60532765
>It's probably because you wrote it like a retard and python is a fucking trash language
you dickface, how is a single thread just doing a bunch of IO operations supposed to completely destroy the reliability of audio callbacks?
>>
>job I want uses Go

I can't tell is Go going to fuck me over in the knowledge department? is it a dead language?
>>
>>60532736
>waiting for a lock
If your locks are a shitty kind of locks, they might require the waiting threads to do busy waiting, i.e.
while lock.islocked (): pass 
which eats up all the available processing power basically. Then there would not be enough of it left for the audio system, maybe. Look at your CPU's workload stats.

That's why clunky chinese laptops are fun: their fans get loud when they are working hard and that's unintentional feedback for the programmer.
>>
>>60532783
I'm not >>60532734, who, by the way, is simply spewing more of the bullshit that makes >>60532715 ask retarded questions.
>>
>>60532715
why woudl you listen to /dpt/, most of the people here can't even invert a binary tree.

Use what makes you happy, unless Java makes you happy. never use java unless you're being paid to.
>>
>>60532821
Not anymore than.
It lacks libraries though
>>
im getting this error on my exchange server for emails with an attachment over 5mb. Can anyone help? I'm stumped

05/21/17 10:53:23 newstate - before 0 3 21
05/21/17 10:53:23 newstate - after 3 3 3
05/21/17 10:53:23 End read state 9
05/21/17 11:04:21 Number of lines: 2
str:451 Timeout waiting for client input
>>
>>60532822
I'm using Multiprocessing's locks: https://docs.python.org/3/library/multiprocessing.html#synchronization-primitives

I doubt those are the shitty kind of lock
>>
>>60532853
No no no no no no, absolutely not. Fuck off. This isn't indian tech support you dumb faggot.
>>
>>60532821
i think we can now say that go is among the popular programming languages, both in the amateur and professional scenes.
>>
>>60532853
$10 says packets being dropped due to shoddy connection.

>>>/g/sqt
>>
File: 1495226595861s.jpg (6KB, 200x200px) Image search: [Google]
1495226595861s.jpg
6KB, 200x200px
What happened to that torrent of books on installgentoo? Did the site go legit?

I need a C# book for my ENTERPRISE job. Preferably with an animal on the cover.
>>
>>60532868
Probably not but you never know. Python's libs can be weird. Try writing and running a program that has one process sleep while the other waits endlessly on a lock they share and see if it is really a problem with the locks themselves or with something else in your original program.
>>
>>60532510
>>60532686
Rust doesn't have objects
>>
>>60532813
Because windows is written like garbage

>>60532821
Go is super easy to learn and use. /g/ just shits on it because WAAAH ITS NOT C!!!!
>>
>>60532785
presumably methods live on an object like this
[2,3,4].len()
and functions live elsewhere like this
len([1,2,3])
>>
>>60532955
>Go
lolnogenerics
>>
>>60532952
https://doc.rust-lang.org/book/trait-objects.html
>>
>>60532973
>how you call methods is different from how you call functions
Disgusting.
>>
>>60532952
Define objects: simply data that sits on the heap, or overconceptualized "advanced design patterns" abominations ?
>>
>>60532990
The latter since Rust has the former
>>
>>60532986
Define methods: functions that are resolved at runtime based on the type of an object, or clumsy bunch of syntax bloat with constraining scope privileges ?
>>
>>60532986
is this your first time programing outside of lisp
>>
>>60532986
Not necessarily.

E.g.,
len([1,2,3])


Is the same as
__builtins__.len([1,2,3])


In any event, everything is objects in Python, so if you're that opposed to them, why are you writing python code?
>>
>>60533008
>ifaces
>>
>>60533013
>writing trash
I am not.
>>
>>60533013
And is also the same as
[1,2,3].__len__()


(magic methods are cool imo).
>>60533022
Ok. Though you where >>60532785. My mistake.
>>
File: 1485869048220.png (40KB, 228x165px) Image search: [Google]
1485869048220.png
40KB, 228x165px
Serious question, what is python good for? I'm a first year compsci loser and wanna learn another language besides c++. Python is apparently widely used in academia and a lot of businesses love it. But there's (seemingly) no memory management or anything, it like your programs could just become these horrible monsters without it. I know Deluge and Kodi are made with it, and they're efficient programs in my experience.
Should I stick with learning Python or go with my other idea and learn Lua? I'm really torn here.
>>
>>60532946
Site's gone but the torrent is still up. The library has a separate page with all of the titles so just look through there and you'll find what you want.
>>
>>60533067
Python is slow as fuck
>>
>>60533067
it has a lot of machine learning and other academic libraries written it it but its dynamically typed so into the garbage it goes
>>
>>60533067
The amount of packages, and its syntax, is what makes Python really fun to use for me, personally.

>>60533103
Then don't use Python for programs where speed is essential? Wow, that was hard.
>>
>>60533067
good for prototyping shit
>>
>>60533150
>not hand optimizing your fizzbuzz on assembly level
>>
>>60533067
>Serious question, what is python good for?
Quick prototyping, for instance. As you yourself pointed out, there's no manual memory management, there's no cumbersome "everything must be inside a class" shit that infects C# and Java, nothing like that. It's all made simple, so you can just throw together some code when it's more important to have something that works than something that works perfectly. Memory is plentiful and clockcycles are cheap, so even though it's not the fastest language, it's often good enough even for finished products.
>>
>>60533067
Well written Python is potentially very fast and very lean
But that's insanely rare to find. It's mostly used by researchers because...well, it just is. Some of the smarter ones wrote libraries to handle common data crunching tasks and now everybody is forced to use that heaping pile of garbage.
>>
>>60533150
I think /g/entooboys think you're only allowed to use one language
>>
>>60533067
it's not used for commercially distributed apps or anything, it's like the general purpose glue with an easier-than-bash syntax for getting a lot of things done, and depending on how far depraved you are you can do a lot of other things youre not supposed to with it (small webservers, ok, game development, well hold on, mobile applications, ...)
>>
>>60533165
lol.

>not using Python to write a quick-n-dirty ML algorithm that uses the millions of fizzbuzz implementations floating around the various /g/-archives to engineer the ultimate fizzbuzz implementation.
>>
>>60533200
>quick-n-dirty
>he doesn't program on a wall of DIP switches
>>
File: reading_sicp.webm (1MB, 1280x720px) Image search: [Google]
reading_sicp.webm
1MB, 1280x720px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

>>60532955
WINNT is one of the most well written codes i have ever seen.

>>60532952
Rust is not object oriented but does have objects.

>>60532047
I dropped C++ soon after they have gone mainstream.

>>60531977
Useful to implement coroutines.

>>60531541
Official docs, Learn X in Y minutes,rosetta code, and IRC

>>60531118
>(eventually)

>>60531022
Thank you for using an anime image.
>>
>>60533067
>But there's (seemingly) no memory management or anything, it like your programs could just become these horrible monsters without it.
Where did you get that idea? Micromanaging isn't necessarily crucial.

Python is simple to read and write if you understand it, that's its niche. You can concentrate on the high level logic without needing to go into uninteresting details, and the Python runtime will do something passable with it, that's the deal. I'm an anon, so I'm not gonna change your perspective with posts and images, so lookup some Pycon talks by intelligent people and you'll see them drive a CS point home while showing understandable and repeatable code.

Serious research doesn't need to be done in assembly you know? Also numpy is a helpful wrapper around hardcore numeric algorithms, and it works because you spend way less time in the high-level code than in the high-level one. Being able to declare your computation in an abstracted language is necessary so you can actually understand it, that's literate programming. No need to overthink performance, we're not pajeets.
>>
>>60533067
sheer convenience, if you want to knock something up fast theres libraries for fucking everything and the way the language is designed means you can cut the bullshit that comes with verbose languages like java. its basically like perl on easy mode.
>>
>>60533246
>Rust is not object-oriented
Rust is shit, OO is shit, therefore Rust can't not be OO.
>>
>>60531977
Look at lua's C programming interface and you'll see.
>>
File: shilling as.png (91KB, 381x473px) Image search: [Google]
shilling as.png
91KB, 381x473px
>>60532088
they are decades old in c++
they just weren't part of the standard before 11

>>60532047
no
just because people keep parroting that something is so amazing and that everybody should use it, it doesn't mean you should
think for yourself anon
see design patterns
>>
>>60533246
>WINNT is one of the most well written codes i have ever seen.
Where did you get to read the NT source code?
Unless you mean the 2004 source code, back when Microsoft still tried to do anything well
>>
>>60533263
Sorry, but logic doesn't work that way bud.
>>
>want to make a c++ program
>literally no gui lib options that compare to java swing
>only thing decent in QT which requires you to make your shit open source
Why did I even learn c++. Shit language.
>>
>>60533311
> requires you to make your shit open source

How is this bad?
>>
>>60533103
>>60533134
>>60533150
>>60533158
>>60533167
>>60533170
>>60533187
>>60533250
Thanks for the responses. I think the reason I have this autism about memory is because it's sort've drilled into you when going through C++ classes that memory management is just crucial to everything you do. I did watch some conferences about building up a portfolio by building small python apps, allowing you to just have millions of projects that look good on a resume. I think I'll stick with python for now just so I can make some shit fast.
>>
>>60533311
>caring about licensing
just sell that shit, closed source, you dumbfuck
nobody will care
nobody will knock on your door because you made $50 and a pack of gum
>>
>>60533311
It's on LGPL3 now you know?
>>
>>60533328
python is no faster to build in that other high level languages, that's a literal meme
its actually slower due to dynamic typing
>>
>>60533344
Wait I retract, it needs a whole fucking page to be explained, so I dunno

https://www.qt.io/licensing/
>>
>>60533328
>memory management is just crucial to everything you do

It is when your language doesn't manage it for you.

>>60533354
Spotted the retard.
>>
>>60532979
Nobody gives a shit.
>>
>>60533369
>spotted the retard
yourself?
>>
>>60532047
Isn't your func() pointless though? std::make_shared / make_unique does perfect forwarding already.
>>
>>60533419
No this guy
>>60533354
Thought it was obvious since i quoted him.
>>
>>60531022
I am in the process of learning c++.
For that purpose i am writing a program to catalogue books that can run on linux and windows.
Using QTCreator i am in the process of making a UI for it which works reasonably well except for the progressbars
In linux they look as they are supposed to
but in windows they are wrong.

is this a general windows problem?
or did i fuck up somewhere?
>>
File: 1464927580449.png (9KB, 2554x159px) Image search: [Google]
1464927580449.png
9KB, 2554x159px
>>60533443
i´m sorry i forgot to add the image
>>
>>60533443
these crossplatform frameworks or whatever are marketed as "write once" so it's probably QT's fault
>>
>>60533443
You fuck up.
>>
>>60533437
no, its you
>>
>>60532599
I fucking love you, anon. My moon isn't good enough yet though. But it's more motivation, and that's always a good thing.
>>
File: 1473204461771.png (9KB, 884x340px) Image search: [Google]
1473204461771.png
9KB, 884x340px
>>60533478
But how and where?
The problem persists even in completely new projects created on windows.
>>
>>60533561
The art of GUI is a complex art.
>>
i have this string:

char *test = "main(String[])(String[])(String[])";


i want to write a method that modifies the string in place
and returns "main(String[])"

here's what i have, but it's not working:
void test(char *str)
{
int i;
int count = 0;
for (i = 0; str[i]; ++i)
{
if (str[i] == '(') {
count++;
}
if (count == 2) {
str[i] = '\0';
}
}
}
>>
>>60533640
test is a string literal, i.e. of type
const char *
.
You cannot modify a string literal.
>>
>>60533640
You skip the \0 you've just placed by using str[i] as the stop condition. Just break after you've written the null.
>>
>>60533673
No, wait. I'm an idiot.
>>
>>60533679
told ya
>>
>>60533561
You are writing it in a way that it isn't portable.

Write better code.
>>
>>60533640
change from
char *test
to
char test[]
, char * is immutable, char[] is not.
>>
>>60533740
thanks! it works now
>>
Working on some data analysis with matplotlib.

How do I do a poisson distribution fit of the data in pic related?

Here's the code I have:
plt.hist(Cesium_Data)
plt.title("Cesium Check Source Histogram")
plt.xlabel("Time")
plt.ylabel("Radioactive Counts")
>>
>>60533925
-> https://duckduckgo.com
>>
How do search engines work? Like if you have billions of sentences how do you quickly find which sentences contain a specific word?
>>
>>60534010
index stuff: prepare your data by extracting the "key" words and making them faster to access when needed.

Parallelize: have tons of computers that all hold a tiny amount of data, send the query to all of them and collect the results.

Caching: if 2000 users are making the same query in the same 10 seconds or so interval, send the same results to all of them.

Surely lots of other stuff.

related: https://www.joelonsoftware.com/2006/08/01/can-your-programming-language-do-this/
>>
I have an NxN array of ones and zeros
[0 1 0 0 0
0 0 0 1 1
1 0 1 0 1
1 1 0 1 0
0 0 1 0 1]

How do I put another 1 into the array on a random position but only if it's not already occupied by a 1?
>>
>>60534107
>How do I put another 1 into the array on a random position but only if it's not already occupied by a 1?
roll a fucking dice, check if it lands on a 1, if so repeat. Ah you want a program that does it? Then write a program that does basically that. In short: do your homework yourself like a big boy.
>>
>>60534107

That's really fucking easy
>>
File: ss-2017-05-22-21-28-50.png (20KB, 492x179px) Image search: [Google]
ss-2017-05-22-21-28-50.png
20KB, 492x179px
>>60534010
picrel

>>60534107
is this a trick question?
>>
File: 1476220448644.png (421KB, 3840x2160px) Image search: [Google]
1476220448644.png
421KB, 3840x2160px
>>60534010
eigenvalues and shit
>>
File: 1448929197840.jpg (303KB, 2048x1536px) Image search: [Google]
1448929197840.jpg
303KB, 2048x1536px
>>60534079
>https://www.joelonsoftware.com/2006/08/01/can-your-programming-language-do-this/
This is why I want lambdas in the next C standard.
>>
>>60534154
rollan
>>
>>60534146

Ah I get it now
>>
>>60534193
Use Lua. seriously C+Lua is nice.
>>
File: aya_hatate_face1.png (83KB, 317x217px) Image search: [Google]
aya_hatate_face1.png
83KB, 317x217px
>>60534107
>>
File: 1492239354520.jpg (125KB, 417x557px) Image search: [Google]
1492239354520.jpg
125KB, 417x557px
>>60533187
Please don't use "commercial" as a synonym for "nonfree." That confuses two entirely different issues.

A program is commercial if it is made as a business activity. A commercial program can be free or nonfree, depending on its manner of distribution. Likewise, a program made by a school or an individual can be free or nonfree, depending on its manner of distribution. The two questions--what sort of entity made the program and what freedom its holders have--are independent.

In the first decade of the free software movement, free software packages were almost always noncommercial; the components of the true/Linux OS were made by individuals or by nonprofit organizations such as the FSF and universities. Later, in the 1990s, free commercial software started to appear.

Free commercial software is a contribution to our community, so we should encourage it. But people who think that "commercial" means "nonfree" will tend to think that the "free commercial" combination is self-contradictory, and dismiss the possibility. Let's be careful not to use the word "commercial" in that way.
>>
>>60534193
>FP C
>>
>>60534136
Thanks for your infinite loops, you're very generous.

Nevermind, I found a solution myself.
>>
>>60534079
>Java required you to create a whole object with a single method called a functor if you wanted to treat a function like a first class object. Combine that with the fact that many OO languages want you to create a whole file for each class
Good fucking lord.

>>60534228
You are 100% correct. I need to get the ball rolling.
>>
>>60534303
OH YOU'RE MY GOD!!!!! You seriously solved that problem by yourself? Like completely alone without looking or anything? What a forgotten genius you are, I so wish I could be a tenth as supremely intelligent as you, you master of us all
>>
>>60534344
Thenks
>>
File: nvim.png (6KB, 104x128px) Image search: [Google]
nvim.png
6KB, 104x128px
>>60534329
>https://github.com/libmpack/libmpack-lua
aint half-bad for serializing lua objects. Not 100% bug-free yet I think, but this is the guy behind NeoVIM
>>
>>60534379
Nice. Thanks for sharing, anon
>>
>>60532510
Go.
>>
>>60532716
cat = { bark = function() print("Mooo!") end }
print(cat.bark())
>>
>>60534523
absolutely disgusting
>>
>>60531022

I'm doing https://paiza.jp/logic_summoner/challenges/logics_skill_4005
>>
>>60534523
>OOPfag discovers first-class functions
>>
>>60534548
that's Lua
>>
>bought cheap chink phone so I could try android development
Which GUI library that is based on SDL should I use?
>>
>>60534581
LSD
>>
>>60534581
>SDL
absolutely disgusting
>>
>>60534595
WHy?
>>
>>60534595
What would you suggests then?
allegro5, sfml, ...?
>>
>>60534602
Anon wants to reuse what he has learned. It's a little bit sensible actually, but not much.
>>
>>60534602
>be me
>try SDL based GUI lib
>it disables desktop compositing
>find out it's hard coded in SDL
intothetrashitgoes.gif

>>60534604
literally anything that doesn't forcibly fuck with things for no reason
>>
>>60534638
SDL give you a rectangle. It's fucking compatible with everything.
>>
Correct and most up to date way of writing a c++ 11 template that accepts a function?

<template class, typename, anything else?
>>
>>60534581
>SDL
shall be avoided at any cost
>>
>>60531022
What book is that?
>>
>>60534653
std::function if you do anything with it but call it, maybe the following (which is basically reinventing std::function) if you know what you are doing.

template<typename> struct thing; // undefined general declaration
template<typename Ret, typename... Args> struct thing<Ret(Args...)> {
... // something useful
}
>>
Anyone tried codenameone my lads?
>>
>>60534757
Or if by function you mean anything callable, simply the following, which will kill itself if F isn't callable. That's how std::transform does it. (And what the fuck is even an ExecutionPolicy good lord)
template<F> void dothing(F f) {
...
}
>>
File: truth.png (28KB, 616x179px) Image search: [Google]
truth.png
28KB, 616x179px
What's the best way to make a jump table for dispatching instructions in an interpreter?
>>
>>60534581
>which GUI library based on SDL
>want to try Android development
why not standard ui toolkit in that case
>>
>>60534813
good ol' hash o' functions. Switch statements often do more harm than good.
>>
File: umarusee.jpg (113KB, 1280x720px) Image search: [Google]
umarusee.jpg
113KB, 1280x720px
>>60534813
pre-decoding > jump table
>>
>>60534805
>>60534757
i believe i need something far more simple, i have a class in which i want to template a passed function to allow the user to be able to use it's own hashing function inside the class, as of now i am at

template<typename Hash>
class
{
void meme(){.... Hash(input)}
..
};
>>
>>60534841
pre-decoding?
>>
File: umarusfs.jpg (115KB, 1280x720px) Image search: [Google]
umarusfs.jpg
115KB, 1280x720px
>>60534860
d-do you know what instruction decoding is?
>>
>>60534833
>using platform specific shit API instead of cross platform library
Go be dumb cunt somewhere else Pajeet.
>>
>>60534881
I'm sorry, I really only have a high-level knowledge of this stuff. This is my second attempt at an interpreter.
>>
File: umaruwp.jpg (112KB, 1920x1080px) Image search: [Google]
umaruwp.jpg
112KB, 1920x1080px
>>60534900
are you programming literate? what programming language are you using?
>>
>>60534856
Hash is a type, you can't invoke it in an expression. Maybe
template<int (&MyHashFunction)(...)>
works ? template parameters can be compile time values, but i don't know if it goes this far. And std::function is out in that case because it's less likely to be accepted as a template parameter. Otherwise:
Hash::hash(...)
and consider that Hash should be a type with a static member function. Or just use a function pointer and don't bother, it will unbloat your executable.
>>
>>60534900
Stop addressing anime posters
>>
>>60534917
https://stackoverflow.com/questions/1174169/function-passed-as-template-argument

i am reading from there and the accepted answer actually just uses typename and then the function is passed, going to try tomorrow and report back in case anyone is interested
>>
File: yup.png (69KB, 781x538px) Image search: [Google]
yup.png
69KB, 781x538px
>>60534917
seems like they can
>>
>>60534915
C++, in mostly name only.
>>
File: pure-bliss.png (374KB, 641x720px) Image search: [Google]
pure-bliss.png
374KB, 641x720px
>>60534937
This is our website, bully!
>>
>>60534886
but he want to learn Android development, not crossplatform development you doofus
>>
File: umaru happy ending - no sound.webm (511KB, 1280x720px) Image search: [Google]
umaru happy ending - no sound.webm
511KB, 1280x720px
>>60535044
>umaru posters
>belonging anywhere except hell
>>
>>60535033
what's your github?
>>
>using github
>>
I'm new on Python. Should I install jetbrains IDE?
>>
>>60535057
No I want to test developing for android. I'm not going to program in fucking java.
>>
>>60535071
da
>>
>>60535062
I'd rather not, considering that the names on some of my git commits are my full name.
>>
File: umaruus.jpg (471KB, 1280x720px) Image search: [Google]
umaruus.jpg
471KB, 1280x720px
>>60535086
lel, who care? seriously
>>
>>60535058
I'm not disagreeing about ratposters. Though I kind of miss the
>rat.jpg
>whatthefuckisthat.jpg
posting.
>>
>>60535106
I imagine someone here would.
>>
>>60535119
I care

about you
>>
>>60535122
That's nice.
>>
>>60535071
no, get vscode
>>
>>60535130
you're nice
>>
already asked and waiting for /sqt/, but anyone know even after changing my locale and everything back to English and restarting, why my w32 program is still TextOut'ing in moon runes?
>>
>>60535192
You make me feel warm inside, thank you.
>>
>>60535122
then create a git repository with a nickname to let the great community that /dpt/ is help you
>>
File: 1478379996725.gif (176KB, 312x322px) Image search: [Google]
1478379996725.gif
176KB, 312x322px
>>60535199
why don't you make me feel warm inside
>>
>>60535226
That sounds quite lewd.
>>
>>60531022
can someone spoonfeed me know to implement k-means clustering in JS, so as to color segment an image?
>>
does /dpt/ like nim-lang?
i think i like nim-lang

pls respond
>>
>>60534154
what's the "latest" meme list?
>>
>>60534653
template<typename Func, typename ...Args>
void Callable(Func f, Args... args )
{
// do other stuff
f(args...);
}


And use it like:

int c = 3;
Callable([=](int a, int b) { std::cout << c* a + b ;}, 2, 2);
>>
>>60534154
fucking rollin mate
>>
>>60535338
its okay
but i see no reason to use it
>>
File: solitaire.png (116KB, 802x624px) Image search: [Google]
solitaire.png
116KB, 802x624px
>>60535389
someone's pulling my leg already did it
reroll
>>
>>60535360
>not using std::forward
>>
>>60535338
name three good things about nim
>>
>>60535338
D fag here, love nim --it just hit v0.17
However there are things that bother me and I do hope they fix it by v1.0
>>
>>60535432
https://nim-lang.org/features.html
>>
>>60535431
You're right, I suck.

template<typename Func, typename ...Args>
void Callable(Func f, Args... args )
{
// do other stuff
f(std::forward<Args>(args)...);
}
>>
>>60535409
Rust it is then! :^D

>>60535432
1. discard statement, no accidentally ignoring return values
2. named+optional parameters
3. whitespace sensitive
4. break statement with symbols (n-deep)
5. inline assembly
6. c/++ interopability
7. it's basically a better python that compiles to c/++ or js
8. fucking modules
9. just RTFM https://nim-lang.org/docs/manual.html
>>
>>60535520
>3
thats a negative
>>
>>60535520
>c/++ interopability
C*

Don't forget nimble, not as advanced as cargo but does the job
>>
>>60535514
>on the func
>>
>>60531602
A single neuron can only split the data in 2 groups
>>
>>60535537
>C*
See "Easy C, C++ and Objective C wrapping" at https://nim-lang.org/features.html where it wraps a C++ library (SFML)
>>
>>60535590
It compiles to C/C++/JS. However it can't call C++ functions natively
>>
File: solitaire.png (124KB, 1010x778px) Image search: [Google]
solitaire.png
124KB, 1010x778px
>>60535428
in master lang C
>>
>>60535520
I said three, not nine
>>
>>60535622
you've just made me want to play solitaire
>>
>>60534154
ROll
>>
>>60535622
mine was in C too chum
>>
>>60535579
im not trying to catergorise it with one neuron though, im trying to model the pattern
>>
Hold on a sec, do people use neural networks these days unironically? Was in a coma

I member reading a few year ago in norvig or minsky book probably, that they are a cute meme or something
>>
>>60534154
roll
>>
File: UWotMate.gif (364KB, 331x331px) Image search: [Google]
UWotMate.gif
364KB, 331x331px
>>60534193
>pic
That can't be real.
>>
>>60535711
/jp/ is 4chan in its purest form.
>>
>>60535681
u wot m8?
>>
File: 1495478402041.jpg (15KB, 250x250px) Image search: [Google]
1495478402041.jpg
15KB, 250x250px
>>60535723
!!!
>>
File: yucurry.png (34KB, 878x667px) Image search: [Google]
yucurry.png
34KB, 878x667px
>>60535723
Back in 2010 maybe.
>>
i dont get it how is "daily progaming thread" technology? and wheres that progaming? all you guys talk about is some math gibberish
>>
>>60535768
still is desu
/a/ is a little normie but the closest second.
>>
>>60535768
>>60535789
Every board is fucked except for the small hobby ones.
>using normie
Please leave.
>>
>>60534154
Fuck it, I'm bored.
>>
File: basketball.gif (550KB, 412x717px) Image search: [Google]
basketball.gif
550KB, 412x717px
>>60532599
>>60531022
i wanna fucking die
>>
Which is more comfy? Glade/Gtk or QTCreator/Qt
>>
>>60535847
Qt.
>>
learning haskell,

im lost as fuck right now.
syntax is confusing af
>>
File: 1495482129970.png (226KB, 480x680px) Image search: [Google]
1495482129970.png
226KB, 480x680px
Why can't we have a truly anonymous distributed imageboard yet?
>>
>>60535971
Please take shitkell discussion to a daily scripting thread where you discuss scripting and scripting languages like shitkell or crapdris
>>
>>60535982
You can
http://nntpchan.info/
>>
>>60535956
No, you are qt.
>>
File: 2017-05-22-221743_810x629_scrot.png (16KB, 810x629px) Image search: [Google]
2017-05-22-221743_810x629_scrot.png
16KB, 810x629px
I've posted this a few times so this will be the last, but, I've been making a logic circuit simulator and it's shaping up pretty well
>>
>>60535971
what part confuses you?


{-# LANGUAGE NoImplicitPrelude #-}
import Prelude hiding ((*), (&&))
a * 0 = 0
a * b = a + a * (b - 1)

True && True = True
True && False = False
False && x = False


>this is valid Haskell code
>>
>>60536013
This seems pretty good. God source?
>>
>>60535990
im gonna implement my own SRNDv2 plus NNTPChan!
>>
>>60536034
Seems pretty good.
>>
>>60536042
I want to make my own NNTP client as well :3
Since it is extremely similar to SMTP most mail clients also implement NNTP so I might as well implement SMTP with it, could even use it as a IMAP replacement.
>>
>>60534698
It's SICP.
You should be able to recognise those pages: they're from the first chapter.
>>
Any D fag here, need help

>Reading from piped input in the shell/environment

For example,

$echo abc def | wc -c

Will print 8. $wc was able to read piped input. However If I try doing the same in the following way, it doesn't work
import std.stdio;

void main(string[] args)
{
uint total_chars = 1;
foreach (index, arg; args[1..$])
{
total_chars += arg.length + index;
}
(total_chars).writeln;
}


Compiles to
[user0@primary test-d]$ ./main abc def
8

But
[user0@primary test-d]$ echo abc def | ./main
1

Also, how would you write getopt so that it can (i) read multiple arguments for one flag and (ii) get true if a certain flag is passed

$ some_prog -p /tmp/abc/def.ijk /home/user/Documents/my_doc.txt -c -wi


Should assign a string[], [ "/tmp/abc/def.ijk", "/home/user/Documents/my_doc.txt"] to p and bool true to c, w and i. How would you achieve this?

string[] paths
getopt(args, "p", &paths)


Only assigns the first string (/tmp/abc/def.ijk) to p.

Thank you.
>>
I took a few weeks off /dpt/ since it started becoming too retarded even for someone like myself. Are the Rust shills/programming with no IO/gatekeeper-kun/etc still around?
>>
>>60536399
Gate keeper is in the peak shitposting spree currently
>>
>>60536408
New thread.
>>
>>60534523
Those aren't objects though, those are just functions stored in a table.
>>
>>60536393
Piped input does not pass as argument. It gets in stdin.
>>
>>60536393
The piped text is sent to stdin, not passed as arguments
>>
>>60534154
Roll
>>
File: dlang_chan_says_thanks!.jpg (69KB, 370x436px) Image search: [Google]
dlang_chan_says_thanks!.jpg
69KB, 370x436px
>>60536393
This is not a D problem, but thanks for learning her though, anon-kun~!
>>
Hi guys, I have been working on my first reasonable size CRUD application and it's fun.

Today, however I have an exam in database management. Could anyone give me a quick example of how joins work in SQL? The resources I've found online aren't really helping too much.

Assuming two relations customers and orders

SELECT order_date, order_id FROM
customers
JOIN orders
on customers.customer_id = orders.customer_id
WHERE customer_id = 3


Will return the three specified attributes, will this work if you select from the second table and join on the first?
>>
>>60538143
https://www.youtube.com/watch?v=oXd4mTA86MI

>Will return the three specified attributes, will this work if you select from the second table and join on the first?
yes, inner join is symmetric
Thread posts: 320
Thread images: 42


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