[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: 310
Thread images: 47

File: dpt.jpg (177KB, 496x1122px) Image search: [Google]
dpt.jpg
177KB, 496x1122px
What are you working on, /g/?

Old thread: >>60847211
>>
>>60853430
Nice op image.
We need more like this.
>>
I fucking hate anime as op image
>>
>>60853443
Thanks, friend, I stole it from http://reddit.com/r/ProgrammerHumor , you should really check it out, it's hilarious, that volume control running joke is killing me! :^)
>>
File: 1494396236166.png (93KB, 942x739px) Image search: [Google]
1494396236166.png
93KB, 942x739px
>What are you working on
Nothing :(
>>
File: 1484491237782.jpg (4KB, 208x206px) Image search: [Google]
1484491237782.jpg
4KB, 208x206px
stop watching anime
>>
>>60853304
What do you make of this, anons?
>>
File: try harder.jpg (1MB, 2272x1704px) Image search: [Google]
try harder.jpg
1MB, 2272x1704px
>tfw finished the fun part of the project too quickly
>tfw procrastinating from writing the scary part

how do i into GUI?
Qt is intimidating.
>>
>>60853464
What do they call that kind of style?
>>
>>60853467
>paying money for books
Why would anyone do that?
>>
>>60853467
The only worthwhile thing there looks like the Scala bundle.
Golang is retardedly easy to pick up, and if you want to understand exactly whats going on inside a package its very very easy to read and figure out. You have to intentionally try and be obtuse to produce hard-to-read code in it.
Everything else looks like worthless "web developer bootcamp" material.
>>
File: a25380f.gif (19KB, 490x106px) Image search: [Google]
a25380f.gif
19KB, 490x106px
>>60853462
>he knows reddit memes
Thought for sure this was 4chan oc but I guess not.
>>
>>60853431
std::string* decToBinary(std::string text, int txtlen) {
std::cout << text.size() << std::endl << text << std::endl;
std::string* binaryTxt = new std::string[txtlen + 1];
for (int i = 0; i < txtlen; i++) {
int* remStore = new int[txtlen + 1]; //Stores the remainder of the division
std::cout << text.at(i);
int x = text.at(i);
std::cout << x;
while (x > 0) {
remStore[i] = x % 2;
std::cout << std::endl << x;
x = x / 2;
std::cout << std::endl << x;
binaryTxt[i].append(std::to_string(remStore[i]));
//std::cout << std::endl << binaryTxt << std::endl;
}
while (binaryTxt[i].length() < 8) {
binaryTxt[i].append("0");
}
std::reverse(binaryTxt[i].begin(), binaryTxt[i].end());
std::cout << binaryTxt[i] << std::endl;
delete[] remStore;
}

delete[] binaryTxt;
return binaryTxt;


}
int main(){

std::cout << "Welcome to my text to binary/hexademical converter" << std::endl;
bool cond;
while (cond = true) {
std::string text = getText();
std::string* binary = decToBinary(text, text.size());
std::cout << *binary;
cond = false;
}
std::cin.get();
std::cin.get();
return 0;
}

>>60853435
hmm, can I do that with a dynamic array?

also plz don't bully me over the code, i'm learning.
>>
>>60853477
Start with basic example and hack until you understand it.

Then start over. Repeat if you have to.
>>
>>60853464
Do you have any of these for python?
>>
>>60853516
Just look at any python code.
>>
>>60853504
I haven't read all of it but you free (delete) your string before you return it. That's probably what's wrong here. You just need to not do that. Let it be the callers responsibility to delete the allocated string.
So remove the line: delete[] binaryTxt;
>>
File: 1489069335242.jpg (10KB, 347x145px) Image search: [Google]
1489069335242.jpg
10KB, 347x145px
>>60853516
No, only the result of teaching people python.
>>
>>60853526
okay thanks, so does that mean that when that after the function returns a value, the memory used in that function automatically frees itself?

I'm kinda new to pointers and stuff.
>>
>>60853411
Usually you allocate the array (even if its on the stack) before calling the function. For example:

void
fill_array(int *array, int size)
{
for (int i = 0; i < size; ++i)
array[i] = i;
}

...

int array[5];
fill_array(array, 5);



That's static allocation. Usually you don't want to do this, but for example you could also do the following:

void
fill_array
{
int *array = (int*)malloc(5 * sizeof(int));
/* Fill the array somehow */
return array;
}


Obviously in the latter case, you also have to free the allocated array later.
>>
>>60853582
The latter function should've returned an int pointer. Anyway, you get the point.
>>
>>60853582
>>60853595
wait, so you allocate the memory in the scope containing the function and then pass it as an argument into the function? Then after the function has returned a value, you free the memory in the same scope you allocated it?
>>
>>60853554
No it means it doesn't. You need the string outside the function right? In that case you want the string to remain, it shouldn't be deleted.
A pointer just points to something. In this case a std::string. With the 'new' operator you asked the computer to allocate some memory for your pointer to point to so you can store the string. It will remain until you deallocate it (delete it). So it will remain even outside the function. But you don't know where it is unless you return a pointer to it. Which you are doing.

Also you have a problem with your while loop.
You wrote while(cond=True) this assigns cond the value of True and the checks if cond==True
You almost certainly meant while(cond==True), checking if cond is equal to True. Or even shorter: while(cond)
>>
>>60853430
>if I see another keyboard I swear I'm gonna fuckin SHIT
w-what?
>>
>>60853617
Yes, you can do that. Of course if the array is on the stack, you don't need to explicitly free it (as in the first example).
>>
>>60853630
>I'm gonna fuckin-
>SHIT
>>
http://science.raphael.poss.name/rust-for-functional-programmers.html
>>
File: 1462691045594.png (13KB, 822x389px) Image search: [Google]
1462691045594.png
13KB, 822x389px
And for my fellow D fags, must read
https://garden.dlang.io/
>>
>>60853740
Rust for Karl Marx.
>>
>>60853816
?
>>
>>60853740
Rust introduces a new “box” type with dedicated syntax for heap allocated objects, which are called managed objects.

Rust supports multiple management strategies for boxes, associated to different typing rules.

The default management strategy for boxes ensures that boxes are uniquely owned, so that the compiler knows precisely when the lifetime of a box ends and where it can be safely deallocated without the need for extra machinery like reference counting or garbage collection.

Another strategy is GC, that uses deferred garbage collection: the storage for GC boxes is reclaimed and made available for reuse at some point when the Rust run-time system can determine that they are not needed any more. (This may delay reclamation for an unpredictable amount of time.) References to GC boxes need not be unique, so GC boxes are an appropriate type to build complex data structures with common nodes, like arbitrary graphs.

Unlike C, Rust forbids sharing of managed objects across threads: like in Erlang, objects have a single owner for allocation, and most objects are entirely private to each thread. This eliminates most data races. Also the single thread ownership implies that garbage collection for GC objects does not require inter-thread synchronization, so it is easier to implement and can run faster.
>>
>>60853740
>July 2014
It was a year before 1.0.
>>
>iterate over all pairs of the string and increment a key in our dictionary
import std.array: array;
import std.algorithm: each, map;
import std.range: dropOne, only, save, zip;
import std.conv: to;

int[string] d;
auto arr = "AGAGA".array;
arr.zip(arr.save.dropOne)
.map!"a.expand.only"
.map!(to!string)
.each!(a => d[a]++);
assert(d == ["AG": 2, "GA": 2]);
>>
>>60853842
Good thing they've got rid of it, the language would be such a mess with an optional GC.
>>
>>60853830
The goyim know.
>>
>>60853906
Yes that's what I was thinking about. I have nothing against the optional GC really though
>>
>>60853918
Yea, GC can be occasionally useful, I think Sutter's idea of manually-controlled kinda-GC as a library for C++14 is interesting: https://github.com/hsutter/gcpp , https://www.youtube.com/watch?v=JfmTagWcqoE .
>>
File: 14 - UVca6dW.jpg (65KB, 810x780px) Image search: [Google]
14 - UVca6dW.jpg
65KB, 810x780px
>finish something
>it's an ugly unsafe piece of shit
>would need to rewrite everything to make it better
>>
>>60853504
Any reason why you're using a pointer here? Just use a stack variable and return it, it'll be fine due to copy elision.
>>
File: 1492556374301.png (129KB, 248x248px) Image search: [Google]
1492556374301.png
129KB, 248x248px
>>60853430
I wonder what people think when they stumble upon one of my codes.
>>
I was writing a program that reads and prints the first nth lines to the stdout:
>>
>> import std.stdio;
>>
>> void main(string[] args)
>> {
>> import std.algorithm, std.range;
>> import std.conv;
>> stdin.byLine.take(args[1].to!ulong).each!writeln;
>> }
>>
>> As far as I understand the stdin.byLine.take(args[1].to!ulong) part reads all the lines written in stdin.
>> What if I want to make byLine read only and only first nth line?


I was actually just looking for ways to read the first n line and then print it ($man head). My current program
1. reads all the lines provided by the stdin (bottleneck)
2. takes the first n lines (bottleneck)
3. prints each line


I want to
1. read all the lines
2. when line number n is reached, stop reading the rest of the input
3. print each line


Sorry, I am new to functional paradigm
>>
File: 1309544442003.png (89KB, 400x400px) Image search: [Google]
1309544442003.png
89KB, 400x400px
>>60854098
Post it
>>
File: 1495796633622.png (188KB, 500x276px) Image search: [Google]
1495796633622.png
188KB, 500x276px
>>60853430
C supports lambdas, they just have to be strongly typed and declared at top level with a name.
>>
File: relevant_anime_girl.png (12KB, 861x185px) Image search: [Google]
relevant_anime_girl.png
12KB, 861x185px
>>60854241
Yeah.
C also supports dynamic typing.
It just has to be statically typed.
>>
what to read to learn c++11, that isn't a 1300 pages long?
>>
>>60854337
What exactly do you need from 11 that isn't available from any general C++ tutorial?
>>
>>60854337
http://www.aristeia.com/books.html
http://en.cppreference.com/w/cpp
>>
>>60854344
I learned c++98 bc the lecturer is a lazy fuck, and I don't want to read stuff I already know
>>
>>60854355
There aren't that many features that you would need after 98, unless you want to use the standard library. But then, if you think you need a structure or functionality from the standard library, just search for it on the internet. Templates and the like to my knowledge also exist in 98 anyway, so there's really not much for you to learn there.
>>
>>60854347
>>60854337
cant go wrong with scott meyers
>>
>>60854178
You just have to use a better language.
use std::io::{stdin, BufRead};
use std::env::args;

fn main() {
let n = args().nth(1).unwrap().parse().unwrap();
let stdin = stdin();
let _ = stdin.lock().lines().take(n).map(|l| println!("{}", l.unwrap())).count();
}
>>
>>60854464
>let n = args().nth(1).unwrap().parse().unwrap();
kek
>>
>>60854467
I knew some autists will be triggered by this.
See, you have two potential points of failure here: there could be no argument, and it could be not integer, so you have to explicitly say you don't care two times.
>>
>>60854464
>use std::io::{stdin, BufRead}
nice
>.unwrap().parse().unwrap();
the fuck
>stdin.lock().lines().take(n).map(|l| println!("{}", l.unwrap())).count();
not any better
>>
>>60854464
>let stdin = stdin();
Has science gone too far?
>>
>>60854481
What's the point of that if the program is going to crash either way?
>>
>>60854464
Is this rust? Why oh why would they take the horrible namespace syntax from C++ (::)?
>>
File: plsrape.png (29KB, 633x758px) Image search: [Google]
plsrape.png
29KB, 633x758px
How many of you friends/employee do you know that read multiple technical books page to page?
I haven't seen anyone trying to improve. Their knowledge is confined to stackoverflow, occasional tutorials, youtube videos.
The state of learning process is worst and people don't seem to care as long as they go home stick their dick in their wife's holes.
>>
>>60854464
>
let stdin = stdin();

W E W
E
W
>>
>>60854482
>the fuck
See >>60854481
>not any better
Not better than what? It's better than the D version because lines() doesn't read anything, it returns a lazy iterator, then take() and map() modify this iterator and it's only via count() the IO actually gets executed. Oh, and the result code is a tight loop without any calls, possible even unrolled.
>>60854512
You have to handle all the possible errors in the code itself, for example with .unwrap_or_default(), or .unwrap_or_else(), or by matching the result manually. Equivalent D/Java/C# code would compile without error handling but then produce exceptions during the runtime, which is not very safe. In rust you can ignore error by unwrap(), but you don't get any surprise crashes, because you wrote than unwrap yourself.
>>
>>60854564
>You have to handle all the possible errors in the code itself, for example with .unwrap_or_default(), or .unwrap_or_else(), or by matching the result manually. Equivalent D/Java/C# code would compile without error handling but then produce exceptions during the runtime, which is not very safe. In rust you can ignore error by unwrap(), but you don't get any surprise crashes, because you wrote than unwrap yourself.
It doesn't change the fact that the syntax is ugly as fuck.
>>
>>60854554
I don't have any friends
>>
>>60854488
>>60854559
Freedom (from memory unsafety) ain't free.
>>60854569
Oh well.
>>
>>60854554
>they go home stick their dick in their wife's holes.
what more could you ask for in life?
>>
>>60854018
correct me if I'm wrong, but you can't return static arrays in C/C++.

also gave me an error where I tried to use static arrays for variables, said that the array size needed to be constant(I still wanted to change the size of the array to match the length of the input), which makes sense

>>60853627
>>60853631
thanks guys, i appreciate it. I'm gonna finish the project and then read up on pointers some more.
>>
>>60854564
I didn't even use map
>>
>>60854554
A coworker of mine is writing his own neural network. I don't know of anyone else hobby programming though.
>>
>>60854464
There are much better ways you can write that.
use std::io::{stdin, BufRead};
use std::env::args;

fn main() {
let n = args().nth(1).unwrap_or_default()
.parse().unwrap_or(0);
let stdin = stdin();
let lines = stdin.lock()
.lines().take(n)
.filter_map(|l| l.ok());

for l in lines {
println!("{}", l);
}
}
>>
>>60854554
Everything in your post reeks of reddit.
Seriously: piss off. Your kind is not welcome here.
>>
>>60854640
>forcing FP into a C like language
cancer incarnate
>>
>>60854713
What is a ``FP" though?
>>
>>60854712
treffer is a list. you have to get the first instance or iterate through them.

to reiterate: its a list of objects, you can't access the properties of those objects through the list interface.
>>
>>60854722
are you retarded
>>
File: 71645629.gif (254KB, 384x288px) Image search: [Google]
71645629.gif
254KB, 384x288px
>Wrote my first useful program

>foobar2k saves .m3u playlists with absolute file paths in them
>mp3 player needs relative paths

Programs goes through every line of every .m3u file in a folder and cuts the first 17 characters off to make it relative.

import os

temp = []

for i in os.listdir(os.getcwd()):
if i.endswith('.m3u'):
test = open(i, 'r')
for x in test:
temp.append(x[17:])
test.close()

test2 = open(i,'w')
for y in temp:
test2.write(y)
temp = []
test2.close()
>>
File: 1488068523582.png (48KB, 336x280px) Image search: [Google]
1488068523582.png
48KB, 336x280px
>>60854747
>Wrote my first useful program
>foobar2k saves .m3u playlists with absolute file paths in them
>mp3 player needs relative paths

Why did you mark these as quotes?
>>
>>60854747
If it works, great! I always get tingles when I use my own program.
I'm no Python expert, but try this:
import os

temp = []

for i in os.listdir(os.getcwd()):
if i.endswith('.m3u'):
#test = open(i, 'r')
#for x in test:
# temp.append(x[17:])
#test.close()

with open(i, 'r') as test:
for x in test:
temp.append(x[17:])

#test2 = open(i,'w')
#for y in temp:
# test2.write(y)
#temp = []
#test2.close()

with open(i, 'w') as test:
for y in temp:
test2.write(y)
temp = []
test2.close()
>>
>>60854774
To make you reply.
>>
>>60854789
I fucked up the last block, but I hope you get the idea.
>>
>>60854817
>I fucked up the last block
You fucked up the whole program. It's in Python.
>>
>>60854817
>>60854789
I do. Thank you.
>>
>>60854617
You want to return std::string from the stack, no one said anything about static arrays.
>>
File: 1462302664163.jpg (29KB, 412x430px) Image search: [Google]
1462302664163.jpg
29KB, 412x430px
QUICK
what is your fav IDE
>>
>>60854918
qtcreator
>>
>>60854918
IntelliJ
>>
>constant pain in lower arm when using mouse of typing
rip programming career
>>
>>60854918
i dunno
VS is alright but it's a bit thicc
>>
>>60854918
Visual Studio 2017
>>
>>60854918
Notepad++
>>
>>60854938
>not having someone else typing out the code
>>
>>60854918
vim
>>
>>60854918
Vim any day.
>>
>>60854918
ed
>>
>>60853639
But why is she gonna take a shit if she sees another keyboard?
>>
Is it possible to do something like this in Ruby?

if mutex.try_lock
do_something() ensure mutex.unlock
end
>>
>>60855217
https://stackoverflow.com/questions/2191632/begin-rescue-and-ensure-in-ruby
>holy shit google is so fucking hard
>>
>>60854904
i want to return an array, read the binaryToDec function.
>>
Hello anons, Python noob here, I'm learning the selenium module at the moment and this error appears every time

selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH


I have done some research on the error and understand it, and I have tried putting the driver in every possible folder and it still doesn't recognize it as in PATH.

My question is, what's PATH path suppose to be by default? Google gives nothing and I have also tried putting the driver on /usr/local/bin but it didn't changed anything, any ideas would be really appreciate it.
>>
There are no male programmers.
>>
>>60855247
Did you even read my question?
I've been reading a book on Ruby and it have something similar to this in one of the examples and I'm trying to figure out if you can do inline ensure statements like you can do for rescues. I've search everywhere and I have found nothing yet.
>>
>>60854918
CLion
>>
Hi guys. Snack and Drink on me. Woke up early today and I can't stop thinking about my sick kitty. Gonna be working on a game and changing a Unity and Javascript tutorial into a game with the changes made in the C# code or something.
>>
>tfw front-end pajet
How do I not kill myself?
>>
>>60855359
what about girl (male)
>>
>>60855440
Well the tutorial is more like a book but yeah...The book is something hollistic game development with Unity an all in one guide to game mechanics, etc, etc.
>>
>>60855359
>no male programmers
>no females who are competent at anything including programming
>therefore no competent programmers
this explains a lot actually
>>
Avid C/C++ dude here

Looking to make some python stuff for my git "portfolio"
>>
Guys who are following a programming study, what laptop do you use?
>>
>>60855508
Just make some shit that doesn't work, classic Python programming
>>
>>60855513
lenovo g580
I'm poor as fuck doe
>>
>>60855513
I still miss her ;_;
>>
>>60855513
Thinkpad e531 with some custom picked parts.
If I could do it over I would go with something with a better screen, lighter and less powerful.
>>
Day 4 of trying to get autocomplete to work in vim.
Installing omnisharp for any editor developed in the current century works in a single click. However for vim you gotta build everything yourself. I now have to install 1.4GB of Windows WPF bullshit to compile a little binary that does some autocompletion. At least vim isn't bloated.
>>
Type var {value}

Why would someone ever use this syntax?
>>
>>60855676

because
Type var(Type2())
is interpreted as a function prototype.
>>
>>60855513
https://www.walmart.com/ip/HP-15-ay039wm-15.6-Laptop-Windows-10-Intel-Core-i3-6100U-Dual-Core-Processor-8GB-Memory-1TB-Hard-Drive/51397788

this one and it's pretty much all I need. I even get to play league and eve on it so my tower is looking kind of unnecessary.
>>
File: meme.webm (938KB, 800x480px) Image search: [Google]
meme.webm
938KB, 800x480px
this meme
>>
File: meme2.webm (1MB, 800x480px) Image search: [Google]
meme2.webm
1MB, 800x480px
>>60856200
when red and green are 100x more massive
>>
in haskell where you guys declare a Data Type that will be used among several packages? Do you create a module/package just for that datatype?
>>
>>60856282
It depends, but normally.
If it's one of many usually used together you could package those.
You could try looking at common packages and see how they do it.
>>
>>60855630
>windows
>vim
ayy lmao
>>
>>60856282
>>60856331
In fact now we have backpack so you might even be able to make it generic over the implementation, e.g. you give a module sig


-- this is pseudocode
module Tree
data Tree : * -> *
empty :: forall a. Tree a
leaf :: forall a. a -> Tree a
node :: forall a. Tree a -> Tree a -> Tree a


then you can import that "module" (it's really just a specification/an interface)
then you can specialise that to a choice of module
>>
>>60854178
>>60854464
>>60854640
You all need a better language
f = Enumerator.new {|e| loop { e.yield STDIN.gets.chomp} }
puts f.take(ARGV[0].to_i)
>>
>>60854178
import System.Environment (getArgs)
main = do
n <- read . head <$> getArgs
interact (unlines . take n . lines)
>>
File: 1495294439095.png (787KB, 4250x2391px) Image search: [Google]
1495294439095.png
787KB, 4250x2391px
>>60856384
>I/O
>>
>>60856200
what programming language have you used for programming that? How do you render the font? Have you read the book of shaders? are you developing a video game or just playing around? why are you not using vulkan (or at least opengl)?
>>
>>60856472
If you consider arguments to be pure input (even though the implementation is not) and similarly for stdin<->stdout, then it sort of is pure
>>
>>60856331
>>60856355
looking darcs code, they put some datatypes under Darcs.Util. It kinda feels natural for me so Im just gonna do that.
>>
I know this isn't /sqt/ but what's the best editor for Winblows when it comes to working on remote servers? Right now I'm using Atom + Remote FTP but it's clunky and prone to failure.
>>
>>60856476
C#
MonoGame converts fonts into sprites
nope
just playıng around
because MonoGame uses DX
>>
>>60856222
>red
>green
you mean pink any cyan right?
>>
>>60856577
Not programming related.
Try >>>/g/sqt/
>>
Just put my name down to volunteer with girls who code. Even if you don't agree with the same cause as me, is anyone here doing any volunteering to use their CS knowledge to improve their community
>>
>>60856587
monogame has mutiple backends. you better should drop windows for linux. (you should also drop c#, actually)

have you seen https://fna-xna.github.io/
>>
>>60856694
Do uni programming clubs count?
>>
wtf there is some wild cat that just entered my house and is fighting my cats. what do?
>>
File: tumblr_mvzeb12qo31sjzzz3o1_400.gif (557KB, 300x131px) Image search: [Google]
tumblr_mvzeb12qo31sjzzz3o1_400.gif
557KB, 300x131px
>>60856726
Sure, if you're helping others. Do you do any tutoring or all-around helping other people learn? I want to teach kids to program through game development
>>
>>60856687
Its (you) again
Try >>>/t/rash
>>
>>60856741
>wtf there is some wild cat that just entered my house and is fighting my cats. what do?
Not programming related.
Use >>>/ohjesuschristtheresafuckingwildcatinmyhouseiamsofuckedholyshit/
>>
>>60853516
all python code looks pretty much the same as a result of whitespace being syntax
>>
>>60856749
I'm gonna do one next year. The clubs are for first years to learn from the older students, so yeah. I'm sure teaching kids would be interesting, too.
>>
/dpt/ is there ever a valid excuse for being a tranny? no meme answers pls
>>
>>60853516
[
print (
word
)
for
word
in
(
"Hello World,"
+
"John 3:16"
)
.split(
','
)
]
>>
>>60857113
Its (you) again
Try >>>/t/rash
>>
File: 1368061716906.png (10KB, 268x268px) Image search: [Google]
1368061716906.png
10KB, 268x268px
how the fuck do you retrieve all values associated to a key in a hashmap that allows multiple values per key?
>>
File: Sophie_Wilson.jpg (291KB, 640x426px) Image search: [Google]
Sophie_Wilson.jpg
291KB, 640x426px
>>60857052
You don't need excuses to be someone.
>>
Halp
mov QWORD[rax], 0x123456789ABCDEFF
gives me
warning: signed dword immediate exceeds bounds
. I'm tempted to ignore it since it's only a warning but since I'm only beginning with asm I'd like to know whether I'm doing something wrong.
>>
File: hzAOi9g.jpg (25KB, 720x480px) Image search: [Google]
hzAOi9g.jpg
25KB, 720x480px
>>60857113
>>
Is there a valid excuse for not being able to add strings and integers?
>>
>>60857148

In what language?
>>
>>60857148
Use any non-meme language
>>
>>60857162
>hzAOi9g.jpg
Use >>>/b/

>>60857185
>meme
Try using >>>/v/
>>
>>60857156
I don't know which assemler you're using, but you need to specify the literal is unsigned. In C you would do it by adding `ull` suffix (i.e. unsigned long logn), so try 0x123456789ABCDEFFull.
>>
>>60857169
What should
3 + "2"
do?
>>
>>60857169
the entirety of abstract algebra
>>
>>60857184
>>60857185
c++. Im simply pondering the existence of a multimap in unreal engine 4.
>>
>>60857169
yes, they are not the same type
>>
>>60857205
Depends on the definition of '3', '+', and "2"
>>60857209
Excuse me?
>>60857216
I don't recall mentioning any specific language.
>>
>>60857227
That's what I'm asking. If it's possible to "add" strings to integers, then you should be able to come up with a reasonable result for that operation.
>>
File: 6aclmM6.png (32KB, 576x402px) Image search: [Google]
6aclmM6.png
32KB, 576x402px
>>60857227
dynamic typing is cancer, you shouldn't be using it anyways
>>
>>60857148
compute the hash of the key
allocate a buffer the size of the number of elements in the resulting bucket (or use amortized spatial growth if the table is open addressed)
iterate over all such elements
for each one whose key is equal to the key you're trying to look up, add it to the buffer
return the buffer (must be freed by caller)
>>
>>60857244
Neither of those things is defined, how can I come up with a result?
>>60857254
I can't use something which doesn't exist though.
>>
>>60857254

dynamic typing isn't too bad, it's weak typing that's evil
>>
>>60854519
ye, thats rust.
whats that bad about "::"?
>>
>>60857265
>dynamic typing isn't too bad
Indeed. Something nonexistent can't really be bad.
>>
>>60857293
You're saying dynamic typing is nonexistant?
>>
File: 1484024585718.png (18KB, 744x247px) Image search: [Google]
1484024585718.png
18KB, 744x247px
>>60853466
>>
>>60857293
>>60857262
what do you mean nonexistent?
dynamic typing is a thing
https://en.wikipedia.org/wiki/Type_system#Dynamic_type_checking_and_runtime_type_information
>>
>>60857152
>You don't need excuses to be someone.
google and/or rust and/or debian and/or canonical and/or mozilla, pls go
>>
File: screenshot_2017-06-11-19:34:56.png (80KB, 1072x633px) Image search: [Google]
screenshot_2017-06-11-19:34:56.png
80KB, 1072x633px
>>60857200
That's what I thought but I can't find the right syntax ;_;
>>
>>60857308
Yeah.

>>60857335
>dynamic typing is a thing
Are you claiming that something which can't exist actually exists?
>wikipedia
Post discarded.
>>
>>60857335
>Dynamic_type_checking
Nobody was talking about this.
>>
>ask inane question
>deflect all responses
>claim dynamic typing doesnt exist
Effective Trolling in Java
>>
File: wyNGEbm.png (344KB, 764x476px) Image search: [Google]
wyNGEbm.png
344KB, 764x476px
>>60857052
The only valid excuse, and also an extremely valid and important one: only a girl (male) can program good.
>>
>>60857380
Who are you quoting?
>>
>>60857393
Hitler
>>
>>60857380
this guy
>>60857355
>>60857293
>>60857262
>>
>>60857349
>google and/or rust and/or debian and/or canonical and/or mozilla
I'm pretty sure just "or" works fine here.
>>
File: g2tSfA.gif (172KB, 650x650px) Image search: [Google]
g2tSfA.gif
172KB, 650x650px
>>60857393
>o wow it are le stanky whomst arst thee quothing meme
>>
>>60857408
I'm pretty sure "trolling" and "Java" didn't exist when Hitler was still alive.
>>60857410
That poster didn't say this.
>>60857422
I don't see the text you quoted in my post.
>>
>>60857196
Its (you) again
Try >>>/t/rash
>>
File: ezgif-2-b809cfb7da.gif (172KB, 650x650px) Image search: [Google]
ezgif-2-b809cfb7da.gif
172KB, 650x650px
>>60857441
>o wow le meme it are so stanky
>>
>>60857441
>I'm pretty sure "trolling" and "Java" didn't exist when Hitler was still alive.
Trolls are part of old mythology and Java is an island that existed when Hitler was alive
>>
>o wow it are le stanky whomst arst thee quothing meme
>o wow le meme it are so stanky
>g2tSfA.gif
>ezgif-2-b809cfb7da.gif
The redditors seem to be out in force at the moment.
You need to go back.
>>
>>60857497
>hurp durp ima shitpost
this is a direct quote from your face
>>
>hurp durp ima shitpost
That's a pretty stupid thing to say. Are we being raided by redditors like you today?
>>
File: 1460154349403.png (164KB, 319x354px) Image search: [Google]
1460154349403.png
164KB, 319x354px
>>60857422
>>60857461
>>
File: 4goon3ny103z.jpg (633KB, 1432x1209px) Image search: [Google]
4goon3ny103z.jpg
633KB, 1432x1209px
>>60857349
It would much easier if you went, preferably back.
>>
>4goon3ny103z.jpg
>tw*tter
I want to see the reasoning why you're not from reddit, which you obviously are.
>>
>>60857616
Use:
>>>/r/ibbit/
>>>/leftypol/
>>>/lgbt/
>>>/t/umblr/
>>
File: 571.png (64KB, 658x901px) Image search: [Google]
571.png
64KB, 658x901px
>not smart enough for any of the project ideas i have
>>
>>60857668
Good post!
Join us on >>>/v/
>>
>>60857666
Its (you) again
Try >>>/t/rash
>>
>>60857616
>twitter
If you're going to act like a fucking redditor, go to fucking reddit.
>>
>>6085770
>everyone I don't like uses reddit
>>
>>60857707
Only a redditor would post a screenshot from twitter here. Your kind isn't welcome.
>>
File: 1497180646277.jpg (43KB, 654x527px) Image search: [Google]
1497180646277.jpg
43KB, 654x527px
>>60857668
just make a todo app
>>
>>60857722
> le redditor ruining my /dpt/ REEEEEEEEEE
>>
>>60857731
>ribbit spacing
>le
>REEEEEEEEEE
So basically you're admitting that you're a redditor then.
Reddit is fucking shit. The users are fucking shit. Keep your filth away from here.
>>
>People can't use both reddit and 4chan
JFYI I literally stole the OP image from reddit.
t. OP
>>
File: 20170611_190052-1.jpg (313KB, 1176x1024px) Image search: [Google]
20170611_190052-1.jpg
313KB, 1176x1024px
>>60856913
no bullshit, i even took a picture. it had one of its ears chopped off. that was really scary and life endangering (>.< ") my dog managed to fight him off my house but the cat was not afraid at all.
>>
>>60857762
I don't want reddit stink nearby. Fuck off.
>>
>>60857668
what project ideas anon
>>
>>60857762
Seriously: piss off. Your kind is not welcome here.
>>
>>60857747
> pedantic comment that has nothing to do with reddit
> mocks irony
> quotes my REEE

Hows the tendies anon?
>>
>>60857766
Now this is some creepy picture.
>>
what is the functionality implemented by this function?
int foo(int x, int p, int n)
{
int s = 0;
int i = n;
while (i > 0) {
i = i-1;
s = p[i]+s*x;
}
return s;
}
>>
>ribbit spacing
>REEE
>"reddit"
>""tendies""

>>>/b/
>>>/r/abbit/
>>
>>60857787
Your kind is not welcome in /dpt/. Seriously: piss off.
>>
>>60857793
>>60857811
Why the fuck are you even here? If you're going to act like a fucking redditor, go to fucking reddit.
Do you go into a chess club then start shitting on all of the chess boards while screaming at the top of your lungs, then get offended when people tell you to fuck off?
>>
>>60857807
read this sentence.
>>
>>60857801
>int p
>int i
>p[i]
It stops compilation with an error?
>>
>>60857801
>int i = n;
>n is never used after this point
>>
>>60857825
>He gets unironically triggered on /g/

>>>/t/rash
>>
>>60857801
to produce a compiler error
>>
>>60857845
>unironically
>triggered
Of course a redditard would deny being in reddit.
I don't want reddit stink nearby. Fuck off.
>>
>>60857852
>of
>deny
>I

Back to Facebook you go
>>
>>60857850
you're assuming that's C.

it is not.

pleb
>>
>>60857867
>Facebook
Why the fuck are you even here? If you're going to act like a fucking redditor, go to fucking reddit.
>>
does dpt have mods or ...
>>
I like how 4chan is obsessed with reddit and reddit doesn't care about 4chan at all outside /r/4chan.
I also like how people who are against "identity politics" focus so much on completely artificial identities like `redditor`.
>>
>>60857885
>He assumes I have Facebook because I use the word Facebook
>>
>>60857892
>reddit doesn't care about 4chan at all
Why would a non-redditor know about it?
>/r/4chan
What is that?
>>
>>60857892
/g/ is a laughing stock on /r/linux

btw I use arch
>>
>>60857892
So basically you're admitting that you're a redditor then.
Your kind isn't welcome here.
>>
>>60857927
>>>/t/rash
>>
File: meme3.webm (2MB, 800x480px) Image search: [Google]
meme3.webm
2MB, 800x480px
>>60856590
there are 2 initial particles that start the chain reaction, those are red and green

>>60856720
looks p neat anon but isn't monogame more mature?
>>
>>60857945
>looks p neat anon but isn't monogame more mature?
i don't know, i don't program in c#.
>>
>>60857892
>reddit
I didn't even bother to read your post, because I already know it's fucking stupid. Piss off.
>>
>>60857963
>>>/t/rash
>>
>>60857909
>>60857927
I have no idea why you've assumed I'm going to deny I'm using both reddit and 4chan regularly. I also get my tech news on HN btw, I find it in accordance with my interests. You have to be really confused to limit yourself to one tech site and even be proud of it.
>>
>>60857973
>You must be really dumb to limit yourself to not eating shit and be proud of it
You really won me over with your argument.
Reddit is fucking shit. The users are fucking shit. Keep your filth away from here.
>>
>>60854918
copy con
>>
>>60857973
>I'm using reddit
I don't want reddit stink nearby. Fuck off.
>>
File: 1492458100009.jpg (134KB, 960x960px) Image search: [Google]
1492458100009.jpg
134KB, 960x960px
>>60858013
Make me.
>>
>>60858013
>>>/t/rash
>>
>>60858049
>>>/t/rash
>>
File: 1387477772083.jpg (27KB, 251x226px) Image search: [Google]
1387477772083.jpg
27KB, 251x226px
im tired of this thread always degenerating to ribbit rabbit reddit trash talk...
>>
Haskell is the most efficient programming language.
>>
>>60858099
If efficiency is measured in garbage generation speed.
>>
>>60858099
assuming you don't mean efficiency in terms of processing power, time taken, memory used, system resources used, ...
>>
>>60857351
>>60857200
>>60857156
Apparently mov cannot take a 64bits immediate as operand. Fuck this shit.
>>
>>60858099
correct.
>>
>>60854713
t. Pajeet
>>
>>60858234
I'm too stupid for a real FP langauge: the post.
>>
>>60858166
Was going to post this but it's because of how opcodes are encoded. You are supposed to move the immediate into a register and then move the register.
>>
>>60858085
Some days mods and janitors are going to stop plugging dragon dildos into their asses and enforce GR3 and 6.
In the meantime, enjoy your daily dose of gate keeper.
>>
>>60858270
Yeah I realized that. It annoys me because it doubles the amount of work I have to do since I want to manually write opcodes in memory to exec them. Not fun.
>>
>>60858269
What is a ``FP" though??
>>
>>60858328
Welcome to /dpt/ !
>>
File: 1496611698909.jpg (2MB, 1700x2470px) Image search: [Google]
1496611698909.jpg
2MB, 1700x2470px
>>60858328
Pretty much.
>>
>>60858328
The first good post itt.
>>
>>60858328 faggot
>>
>>60858099
I wasn't aware they renamed OCaml.
>>
>>60858328
Is it an off-day at Anitfa HQ?
>>
>>60858388
It's Sunday, Adolf.
>>
>>60858328
good post
>>
File: ebolachan-checked.png (39KB, 1000x1000px) Image search: [Google]
ebolachan-checked.png
39KB, 1000x1000px
>>60858377
>>60858388
>>60858400
>>
File: file.png (474KB, 1113x468px) Image search: [Google]
file.png
474KB, 1113x468px
>>60858352
Post more.
>>
>>60858328
thanks for reminding me from the catalog why I never fucking enter /dpt/ and why generals are cancer
>>
>filter all shitposts, gb2r, wruq, gatekeeper posts
>thread size down by 50%
good thread, well done everybody
>>
>>60858400
I'm sorry, but I don't associate myself with Adolf Hitler. I'm more of a Heinrich Himmler person.
>>
>>60858328
This is exactly why this song plays in my head whenever I read these threads
https://www.youtube.com/watch?v=wZKn73JZWaM
>>
>>60858400
Atheists aren't allowed to observe the Sabbath.
Get back to work.
>>
>>60858511
>Atheists aren't allowed to observe the Sabbath.
Says whom?
>>
>>60858584
God.
>>
>>60858591
Atheists tend not to concern themselves with the will of God.
>>
What are some simple optimization tricks everyone should know?
>>
>>60858599
Could've fooled me given how much they talk about Him
>>
66 4
1 2
1 3
2 4
3 5
9 9
1 2
87 0
87 0
87 523
45 523
55 523
66 5
#expect: 1 1 1 87 87 87 66 66


how do I print out the rows in which there are duplicate elements in the first field?
I know how to cut out the first column and run uniq on that, but I struggle to keep the second column intact

I started off with sort -k1,1 to sort by first column, though uniq -D -fN is giving me shit by only allowing me to skip the first N fields, not having an option I can find for using the first N fields

this is all to guide me in finding duplicate files by comparing md5sums (and comparing the md5 sum to the filenames, to see if the alleged md5sum in the filename matches the actual md5sum)
>>
>>60858328
All me.
>>
Does clang generally have faster compile times than GCC?
>>
>>60858741
Occasionally: http://www.phoronix.com/scan.php?page=article&item=gcc7-clang4-jan&num=4
>>
>>60858634
profile and don't waste time
Big-O complexity matters
>>60858652
grep -P (\d+) \d+(\n\1 \d+)+ sort of does what you want, you might want to pipe that through sort | uniq afterwards
>>
>>60859009
>Big-O complexity matters
Why?
>>
>>60857052
You don't need an excuse for being mentally ill.
>>
>>60858652
>#expect: 1 1 1 87 87 87 66 66
>>
>>60859009
most of the stuff I found has been awk and grep stuff unfortunately, which I suppose might work but then again should it really be necessary when there might be some utility that does it cleanly

the closest thing I have found thus far is reversing so that I can count fields from the end, but unfortunately the later columns contain spaces so unless I manage to replace them somehow, or insert a different field separator, reverse + uniq + unreverse would not work either

and reversing is an incredibly hacky solution desu
>>
>>60859076
Speed and space.
>>
>>60859142
Maybe in the 90s.
>>
>>60859076
Because making a certain function twice as fast is all nice and dandy, but if you have to call a function 10 times instead of 100 times for an input size of 10 that's far better.
>>60859129
uniq has -w which only compares the first n chars, can you add leading zeros to the first number to pad it to a constant size?
>>
>>60859225
This attitude is why programs today run slow as fuck on new hardware.
>>
>>60859225
You are pretty ignorant. Most of the programs don't run natively, they run on software platform like browser or vm. This creates overhead. Most upcoming programs are also interpreted which adds it's own overhead. Now your basic operations are slow. CPU's aren't getting faster like they used to. Complexity matters as much as in the 90s.
>>
>>60859122
yeah it is sloppy shorthand for
1 2
1 2
1 3
66 4
66 5
87 0
87 0
87 523


in some arbitrary order
>>
>>60853430
What should I research so I can track an anime 3d model into an inflatable sex doll ? Imagine this with hololens or some mixed reality goggles
>>
>>60859266
I suppose it would work since the first column will be md5sums which all have the same length
>>
File: autcsgrad.png (71KB, 369x406px) Image search: [Google]
autcsgrad.png
71KB, 369x406px
>he need static typing
>>
>>60859406

>Error checking by hand when the compiler can do it for you
>>
>>60859388
>>60859266
find . -type f -execdir md5sum {} \; | sort -k1,1 | uniq -D -w32

Seems to work. Thanks.

Wish there was an inverse of -fN though
>>
File: 2ee.gif (141KB, 287x344px) Image search: [Google]
2ee.gif
141KB, 287x344px
>>60859432
>relying on types for error checking
>>
File: 1488292070326.jpg (27KB, 407x617px) Image search: [Google]
1488292070326.jpg
27KB, 407x617px
>>60859406
>>60859432
>>60859468
Who said this?
>>
Friendly reminder that if you can't trivially implement a kernel in your preferred language, your language is complete and utter TRASH.
>>
>>60859508
>kernel
What is an ``kernel"?
>>
>>60859508
but can your design a digitial logic circuit in your preferred language?
>>
>>60859519
Don't worry, it's something you and your language will never be able to implement, so no need to concern yourself with it.
>>
>>60859463
why -execdir rather than -exec?
>>
>>60859536
My preferred language is solder.
>>
>>60859545
So you can't implement it in C? Must be useless.
>>
>>60853430
Does anyone know of a library like Luigi (python) that is made for smaller, shorter, (in-memory) tasks?

>Luigi is a Python (2.7, 3.3, 3.4, 3.5) package that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualization, handling failures, command line integration, and much more.
Really just need to describe the data pipeline and feed data into it, the data analysis isn't enormous and doesn't need to be flushed to disk. It also doesn't need visualization, workflow management, and "much more".

Does such a thing exist?
>>
>>60859574
>He writes in C and doesn't know what a kernel is
Just checking out C for the day? Just go back to Python, little boy. This area is for grownups, go play with your toys in the toy room.
>>
File: group_action_alice.jpg (71KB, 853x480px) Image search: [Google]
group_action_alice.jpg
71KB, 853x480px
>>60859519
The kernel of a homomorphism is the set of objects in the domain that are mapped to 0 or the identity.
>>
>>60853430
I created
thisisfun.xyz
An ad free e-hentai archive with usability, free downloads, and almost 18,000 mangas and doujinshi already queued.

Im working on a way to earn more gp on e-hentai so that the archiver can function. Does anyone know an automated way of doing so?
>>
>>60853430
planning for next weeks work, should I report this to CEO of the company as a contractor?

i was brought in to rescue an API which was written with zero tests in place. the language they chose to build it is not something i would have chosen -- for web development, there are far better choices for reaching business goals. unfortunately the technical lead of the company and the guy who worked before me on the APIs neither understand this, and have chosen the current stack purely according to flavor of the month on HN without evaluating what it brings to the table. they have put their own kubernetes system in place, without gathering statistics on what parts of their microservice architecture (code copy-pasting architecture) gather the most hits. they dont know how often their APIs are queried, thus they cant possibly know whether k8 solves anything for them.

AWS spendings are just over 1K a month, but i think they would be better off with a single ass dedicated server rather than paying whatever AWS hosted k8 is charging them for automatically scaling pods.

i wish i had the luxury of not working for clients whose founders do not have technical background. this tech stacks by HN shilling is an utter non-sense.

should i report to the CEO or just do in 100 hours and ask for a raise?
>>
>>60859700
Yes.
>>
>>60859700
No.
>>
>>60859700
Maybe.
>>
New thread:

>>60847211
>>60847211
>>60847211
>>
New thread:
>>60859857
>>60859857
>>60859857
>>
>>60859855
kek
>>
>>60859549
I replaced it with exec a bit later, the manpage said execdir was safer, though maybe that is for cases where you are executing the actual results you find furthermore
>>
File: image-05-03-16-02-58-6.jpg (103KB, 640x496px) Image search: [Google]
image-05-03-16-02-58-6.jpg
103KB, 640x496px
How would you go about helping someone with structured text when your only experience with it was extrusion?
Thread posts: 310
Thread images: 47


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