/dpt/ - Daily Programming Thread

What are you working on, Jow Forums?
Last thread:

Attached: Y U N O.png (800x600, 472K)

Other urls found in this thread:

pastebin.com/jU7DEXK8
nim-lang.org/docs/tut2.html#object-oriented-programming
tools.ietf.org/html/rfc8017
blog.salaryproject.com/netflix-software-engineers-earn-a-salary-of-more-than-300000/
gitlab.com/your_username/your_repo_name.git
twitter.com/NSFWRedditImage

learning java

nth for Nim!

Have you fellas got any recommendations for projects to be working on with JavaScript? I'm applying for front-end developer jobs and want to sharpen my skills a little, maybe buffing out my portfolio a little in the process.

Has anyone got any recommendations?

So I decided to quit evil-mode for a while and force myself to learn emacs properly
It's fucking hell. Like it's not just the keybindings, but nothing behaves like I want it to.
I don't think I'll last another day.

Attached: 1517326802938.png (500x282, 105K)

just install nvim
emacs is for dweebs

I recommend /wdg/

i have one, potentially two questions.

First of all, where the hell can i find a forum/community that is good for just general programming questions?

all the ones i've found so far are so straightforward. As a beginner, i need somewhere i can ask general questions about code instead of questions specifically realted to a language.

second question:
does anyone know where i can find open source samsung watch apps? i want to reverse engineer ANY watch app in tizen studio but as far as i can tell there are literally none.

emacs is overrated. its neat that you can bind and program with it but aint no one got time for that shit

learning multithreading in Rust, this was my first try on getting
>one thread for updating time
>one thread for updating weather
>one thread for putting these together into a string and print it
pastebin.com/jU7DEXK8

then I realized I can just use Arc directly to share data between fucntions/threads and skip using channels kek, well at least I know how to make a pseudo scheduler now.

final
use std::sync::{Mutex, Arc};
use std::{thread, time};

fn main() {
let time = Arc::new(Mutex::new(String::new()));
let timecpy = time.clone();

let child = thread::spawn(move || {
get_time(timecpy);
});

child.join().expect("");

println!("{:?}", time);
}

fn get_time(t: Arc) {
let mut t = t.lock().unwrap();
t.clear();
t.push_str("11:11");
thread::sleep(time::Duration::from_secs(1));
}

shove it witch

I've been using emacs for more than a year.
I don't like nvim. You won't change my mind about emacs...

at the place I work one guy uses vim, everyone else uses emacs

>general community for programming
I think you'll find this difficult because of paradigm divides. Try your languages IRC channel. They tend to answer most questions

If you inherit someones computer that contains unlicensed source code, is it still copyrighted?

>another user
>nim-lang.org/docs/tut2.html#object-oriented-programming
>Nim avoids these problems by not assigning methods to a class. All methods in Nim are multi-methods.

You lost me there...

I still like how set is manipulated in nim.

Took up a challenge from Tim Corey (palindrome checker). Implemented overloaded methods for both string and integer but the bonus challenge is a bit of a headscratcher.

Stackoverflow?

Thats a forum that specifically rejected my question about watch apps

>First of all, where the hell can i find a forum/community that is good for just general programming questions?
>posted in /dpt/

yes
emacs is a bloated operating system masquerading as a text editor, don't use that shit.

yes obviously i considered this but i find there's a bit too many snarky cunts here for it to be worth the effort

use ed
kill all bloat

Attached: 1526186054686.png (1024x768, 406K)

JavaScript rocks!

Attached: javascript rocks.png (1000x494, 134K)

JavaScript rocks!

Attached: js_rocks.png (1433x779, 473K)

kill this bloat

Attached: bloat.png (292x760, 124K)

wierd, maybe they thought you had malice intent. Try qoura. ( i think they will answer both question for you)

thank youuuu

Is there a tool to trim js source code and remove functions and all the stuff which was not called during the callback?

Attached: 1542751504891.gif (333x396, 205K)

Can you stop spamming this?
Atleast other one had loli

term you're looking for is "dead-code".

Not exactly.

what would it be then?

kys pedophile

I think I am going to be laid off soon. Wish me luck.

Im not pedo or into loli, i just don't like ugly pic

Good luck

>the callback
Any specific callback? Because it sounds like a pretty easy problem to solve but it also sounds like something you'd never wanna do.
Just do a program trace out of your callback and then have a tool that deletes all functions which weren't collected from your trace.

this is std::iota
say something nice about it

Attached: function.jpg (479x130, 9K)

more like no cents lmao

I learned about RSA in my math degree and I would like to implement it in scheme. Which standard should I implement?
Is this good tools.ietf.org/html/rfc8017 ?
I want to learn to read formal documents.

>Im not pedo or into loli
kys code monkey pajeet

Trying one more time.

Anyone has experience with self-hosting version management and ancillary stuff? There's rather few user reports on this kind of thing.

I'm looking into self-hosting a Mercurial server in Wangblows, plus the basics like a bug tracker, forum, automated builds etc for if/when I start a team or make it public.

JetBrains seems to have a trio of softwares which integrate with each other,which are free to small teams, and which seem to cover almost everything, except an actual Mercurial server. I'm particularly interested in its code-aware navigation.

Attached: DtDW9I3X4AEHh_j.jpg orig.jpg (960x776, 55K)

I've gotten some savings. I hate IT and mathematics with passion and should have gone for the brainlet positions instead.

void fill_arr(int *start, int *end, int sval) {
for (int i = 0; start+i != end; ++i)
start[i] = sval+i;
}


imagine importing an entire header to avoid writing these 4 lines

>C++ has a standard utility function
C++ is bad because you can write it yourself
>C++ does not have a standard utility function
C++ is bad because you have to write boilerplate

>C++ doesn't provide the right abstractions
-

I have two interviews coming up. One for a Junior Software Dev position (Java) and another for a tester position.

Where can I go and what should I use to help prepare myself for the interviews. I was already thinking of using codingbat to brush up on java syntax and then watching some videos on SDL and testing lifecycle on youtube.

Any reccomondations?

Attached: 1503200562241.gif (500x333, 900K)

man, you reallly showed this guy

Attached: strawman.jpg (300x300, 34K)

The responses you're getting show me that you hit a sore spot. People really will complain about C++ no matter what...

you understand the concept of generic my negro

template
inline _LIBCPP_INLINE_VISIBILITY
void
iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)
{
for (; __first != __last; ++__first, (void) ++__value_)
*__first = __value_;
}

>spend 4 days setting different options for a VISA TCP/IP connected instrument
>fucking around with register flags
>fucking around with stop bytes
>fucking around with every other autist VISA option
>"set_termination=None"
I was literally defeated simply by endline characters /dpg/, I am literally the most subhuman programmer in existence.

It's ok tbqh. Various endline shits are like a kryptonite

>codebyter, codewar

Just try to chill. Begin level headed is important

Being*

Unironically build a robust todo list. Start simple. I want it to be able to add, edit, mark as complete (strikethrough) and delete todos. Also, I want each todo to have a description field. You have a week.

Is there a way I can get my threads to pull urls in order in the list? List is, by default, sorted. Not sure if the answer is imap, intellisense doesn't seem to suggest so.

Language is Python 3.

...
session = requests.Session()
login(session)
print('Login Successful.')
print('Input the URL of list of files to download from archive.org.')
listURL = input('archive.org URL: ')
print('Parsing download links...')
downloadLinks = parseDownloadLinks(listURL, session)
print('Parsing complete')
print('Input the directory where the downloaded files will be stored.')
directory = input('ROM directory: ')
entries = []

for dLink in downloadLinks:
entries.append([session, directory, len(downloadLinks), dLink, downloadLinks.index(dLink)])

ThreadPool(8).map(downloadFile, entries)
print('Finished downloading.')

#include
#include

typedef struct list { struct list* next; int value; } list_t;

short unsigned traverse(list_t* list) {
list_t* pointer = list;
for (; pointer; pointer = pointer->next)
printf("%d\n", pointer->value);
return EXIT_SUCCESS;
}

int main() {
list_t l;
l.value = 1;
l.next->value = 2;
l.next->next->value = 4;
l.next->next->next->value = 6;
traverse(&l);
return 0;
}


Why SIGSEGV, anons?

You're dereferencing garbage pointers, dummy.

Thanks user.

l.next->value =2; //you never added to the list, so this pointer is uninitialized
//you need functions to add to the list or remove from the list, right now its an incomplete list class
int* append(list* l){ //exercise for the reader }

>post strawman
>people point it out
>pretend like people are completely stunned by your post
Silly.

blog.salaryproject.com/netflix-software-engineers-earn-a-salary-of-more-than-300000/

fucking jesus

new rule: you can't call yourself an engineer if you make less than 300k/y

300k is reserved for math phds dummy

>implying phds who spent their prime time in academia are anywhere near dudes who were actually working at the time

Such numbers are irrelevant if you don't put them into context (e.g. how much is the cost of living?).

its a /sci/ meme gramps
dont get bent over it

now subtract the commiefornia CoL tax.

It's a shitton of money in any case desu.
Rent in SF is like 4-5k? So hwat

My eyes, my fucking eyes

a easy rule of thumb is subtracting $40k from any SF salary. unless you already live in NY or some shit

>NEEDING to work to have money

Lower class scum, please.

>tfw no sugarmommy to feed and fuck you while you work on your chip-8 emulator in lisp dialect

the c++ standard library just needs to be better organized
instead of #include to get a whole bunch of shit you dont need
it would be better as #include to get exactly what you want,
and if you really want everything then just #include

do you want them to finish in order?

Modules will fix this.

Yeah! So, if I have 8 threads there, like so, then it would pull 1...8, and the next thread would finish 9, then 10, and so on.

If it's inefficient, in that I'd need to lock something or somewhat, I'm fine with leaving it as is.

Do we know if the committee will adopt modules in the standard library?
Will that not break existing code?
Or will there be module versions for everything.

Can you declare a subset of the exported symbols in a module to import?

Fuck man this is really dumb. I need to read two inputs, 11001101 and 01010111, and then do a XOR between them. But how do I actually get them into a byte form from the string. Using Convert.ToByte naturally just converts each number and then the value is something totally different. I feel like I'm overlooking something very simple

Attached: blaze.jpg (600x539, 46K)

Maybe you are supposed to perform the XOR yourself, without converting and using the built in.

No idea. But a sane compiler will define a binary interface unit format that means the compiler won't have to parse what it doesn't need so I expect that even dumping all of ::std in a single module will perform better than the current system.

When you are using Convert.ToByte, it is reading the string value and trying to turn that into a byte, rather than the representation.

Parse the string yourself.

WAIT!

string s1 = "11001010";
string s2 = "10010110";

byte b1 = Convert.ToByte(s1, 2);
byte b2 = Convert.ToByte(s2, 2);

Console.WriteLine((b1 ^ b2));


Probably forgot the base encoding.

What in your opinion should be in the portfolio of a person who wants to get an internship or a junior Java developer job for them to have a reasonable chance at getting it?

Projects. Fuck GPAs, if the write good code, and they are determined, they'll learn.

Naturally. Thanks

Attached: 1546903415367.png (720x720, 802K)

This And are you sure that last pointer will point to Null?
Sometimes it may point to random address

Dumb retarded niggermonkey. Do you even understand why it has to be that ugly?

Modules can't come soon enough.

It looks current to me based on the hash functions (SHA2, ie not yet successfully exploited) and date. (Nov 2016) My stack of choice is OpenPGP however (RFC4880) which might interest you as well because it has data compression and a hip historical significance. Pick either as you wish.

the answer to questions like this is usually "this behavior may be undefined in the standard and could vary by compiler so just do it the right way and don't worry about what would happen"
and iirc my function should return list* instead of int*

It will not break if you do little change

If you want all:
[code ] #include [/code]

If you want specific :
#include

Python is good example on changes that broke a language.

Crash course for using git as a tool for syncing projects between machines:
1: go to the directory where your code is
2: user@dpt ~/your/project $ git init
3: user@dpt ~/your/project $ git add -v your.c files/here.c wildcards/work/too/*.h
4: go to gitlab or github. Register an account.
5: make a new project. You'll give it a name that's all lowercase letters. Remember it- you'll need it for the next step.
6: user@dpt ~/your/project $ git remote add origin gitlab.com/your_username/your_repo_name.git
7: user@dpt ~/your/project $ git commit -m "hello world!"
8: user@dpt ~/your/project $ git push origin master

To get your code onto another computer:
1: go to the directory you want to put your project in.
2: user@dpt ~/your/project $ git init
3: user@dpt ~/your/project $ git remote add origin gitlab.com/your_username/your_repo_name.git
4: user@dpt ~/your/project $ git pull origin master

From then on out, use 'git add' to add new files to the project. 'git add -uv' will add all changed files to your next commit. Pull and push to update the local and remote repositories.

If you want to keep the order without adding waits, just modify the thread code so it receives the index and returns it along with the download result. Fairly dull way to go but it's the smartest imho.

I would actually like that. Rich older woman femdomming the shit out of me.

It will not break if you do little change

If you want all:
#include

If you want specific :
#include

Python is good example on changes that broke a language.

What would be the point tho? Is there anything wrong with importing names and not using most of them?

I was thinking in the context of modules.
Not includes.
I don't think they will break it up like this.

Pollutes your symbol table but whatever you still have namespaces.