[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: 317
Thread images: 29

File: challenges.png (2MB, 3840x2160px) Image search: [Google]
challenges.png
2MB, 3840x2160px
What are you working on, /g/?

Previous thread: >>61875133
>>
>>61882452
Roll
>>
Learning x86_64 asm.
>>
>>61882521
Take your rolling to >>>/trash/.
>>
Rolling... So bored.
>>
File: password1-618x336.jpg (41KB, 618x336px) Image search: [Google]
password1-618x336.jpg
41KB, 618x336px
How do I properly send/receive and store passwords in my program? All the salts and nonces confuse me (even though I clearly understand wht they all do), I can't put them all together in a coherent secure flow.

My connection is encrypted, but I still don't ever want to touch plain-text passwords on the server side.
>>
>>61883015
Store the password by using scrpyt or pkbdf2 to get a secure hash (with a unique salt/and or appropriate number of rounds). Get the attempted password from the user and hash it. If the hash matches the hash in the db, it's a valid password.
>>
>>61883063
Yeah, that's the easy part.
But I don't even want to receive the plain-text password.

The only idea I have is to have the user generate salt and hash the password during registration, and then give them that salt before they log in. Seems pretty secure.
>>
>>61883120
That's one way, each user/griuo gets a unique salt tied to their account.but why give the salt away?

You're gonna need to process the plaintext at one time or another anyway.
>>
Making dat gw2 tradingpost item trend tracker in rust baebeee
>>
>>61883139
>but why give the salt away?
Because I'm trying to avoid the "need to process the plaintext at one time or another", which I'm pretty sure is possible.
If they have the salt, then the user hashes their password themselves before sending it to me.
>>
>>61883120
You mentioned not touching the plaintext server side... You think a client side evaluator would.be safer?
>>
>>61883187
Yeah but giving public salt is pretty insecure, maybe. Well, it's one information that's exposed that can be used to brute the algo you used to hash. But it's probably ok.

You can probably do a client side validator using JavaScript.
>>
>>61882452
>>61882452
roll? anyone have something with golang?
>>
>>61883214
>Yeah but giving public salt is pretty insecure, maybe.
>it's one information that's exposed that can be used to brute the algo you used to hash

The point of salt is to force the attacker to brute force, instead of just using a rainbow table.
If the attacker has the hash of the password, then they have the salt anyway, so I'm not sure making the salt public actually changes anything.
>>
>>61883276
Ever since quantum computers made headlines, brute force methods cannot be discounted.

That said, what do you end up doing? Client side validator?
>>
I want to have a github project that I can work on from both visual studio and plain vim, compilation through gnu make and clang. How would I achieve this with cmake? if cmake even is the right tool..
>>
>>61883331
>That said, what do you end up doing?

During registration, user generates salt and hashes their password with it. Sends the hash and the salt to the server, where it is hashed again.
During login, I send the salt of the specified user to them, they hash the input with that salt, send that hash to the server, where it's hashed again and checked against the stored hash.
>>
Thank you for this
>>
>>61883574
Have CMake export either to an executable or a vsproj by using the -G switch. I think the CMake-generated GCC and CLANG makefiles are the same.
>>
Is Visual Basic useful? Does anyone use it on the market?
>>
I have ended up in python with a string of a python bytes object. "b''\x00\x00" (example)
now I want this to be a bytes object again, not a string. what do
>>
>>61882452
Roll

>>61883675
I don't think there's any point in using it when you can use C# instead
>>
>>61883675
No. Why do you want to learn it?
>>
>>61883742
It was my first ever programming experience.
I remember doing a mini text game in it like 7 years ago. I was just wondering for nostalgia sake
>>
File: kaiji moe.gif (206KB, 500x281px) Image search: [Google]
kaiji moe.gif
206KB, 500x281px
What are the best paying languages?
>>
Taking a deep dive into TypeScript with strict config - it's been somewhat of pain in the ass but I'm starting to get the hang of it and it's definitely making me write more robust code than what I've written with ES2015+ alone, which I'm certainly liking.
>>
>>61883831
Luxembourgish
French
German
>>
>>61883831
Whatever your master tells you to write.
>>
New to coding, any programs you'd recommend?
>>
>>61883804
My most sincere condolences.
Thankfully, we've got good programming languages these days.
>>
>>61883804
It's not really used other than embedding malware in to word files. C# is Microsoft's new bad language, but that's used in industry a lot. Python is usually the recommended beginner's scripting language now.

I do relate though, I started programming in 2008 and the world is totally different now. A lot of the tools I used to use became pretty irrelevant.
>>
>>61883886
alcoholics anonymous
>>
>>61883886
multithreaded web browser
>>
>>61883901
>Python is usually the recommended beginner's scripting language now.
Dijkstra's famous quote about BASIC could easily apply to Python too
>>
>>61883921
I think so too. That said, I can recommend C++/OpenGL to anyone who wants to make games (that's how I learned), but they'll probably just get overwhelmed and quit.
>>
>>61883921
Eh, with all due respect to the man, that quote is pretty garbage. Do you think it's not possible to learn low level stuff after you've started on the high level? Because it's not feasible these days to have all people start programming in C and then go up from there.
>>
>>61883981
>it's not feasible these days to have all people start programming in C and then go up from there
That's actually the only correct way.
>>
>>61883975
Pretty much anyone who wants to make 2D/3D games starting from zero programming language and dives straight into it without bothering to learn the basics is doomed to fail regardless of which language they use.
>>
>>61883975
>I can recommend C++/OpenGL to anyone who wants to make games
God no

There's no point in reinventing the wheel when you can just use a game engine. That is unless you make *very* simple games like Snake.
>>
>>61883981
I think it's very possible to learn low level stuff after starting with a principled, rigorous high-level language, i.e. one completely unlike Python.
>>
>>61883997
Yeah, I actually wanted to include the write that if you're convinced bottom-up learning is the only way, then we have a basic disagreement and any further discussion is pointless.

>>61884037
You must have it confused with Javascript.
Also, if you could provide some examples of such languages, that would be great.
>>
>>61884033
This is /dpt/, not /agdg/

Go back to your soporific, stultifying "discussion" of the relative merits of Unity vs Unreal, and which one allows you to make a game with the least amount of knowledge required
>>
>>61884067
>Also, if you could provide some examples of such languages, that would be great.
Scheme
ML
Idris
>>
>>61883015
>My connection is encrypted, but I still don't ever want to touch plain-text passwords on the server side.

if you encrypt a password clientside then the hash becomes the password. it makes no difference to the serverside security (unless you intentionally make your serverside logic less secure based on incorrect assumptions of your clientside encryption)
>>
>>61884069
Ah yes I forgot I was on /g/, where all the cool kids use C and have fun implementing the most basic boilerplate code over and over again. Fuck off.
>>
>>61884091
>it makes no difference to the serverside security
Yes, but it makes a hell of a lot of difference for the serverside peace of mind. If my server gets hacked, then the attacker won't be able to intercept user's passwords whenever they log in.
>>
>>61883255
make a to-spec IRC server
>>
File: dij.jpg (15KB, 535x75px) Image search: [Google]
dij.jpg
15KB, 535x75px
deep
>>
Rolling desu
>>
>>61884094
Is that really the bullshit they feed you over there? To keep you hooked and paying your Unity subscription?

Nobody in this thread thinks using C is a good idea apart from some very specialized situations e.g. very tiny embedded stuff and Linux kernel development.
>>
>>61883184
What separates it from other tradingpost item trend trackers
>>
File: 1502047944249.gif (240KB, 320x320px) Image search: [Google]
1502047944249.gif
240KB, 320x320px
What's your favorite IDE?
>>
>>61884149
>Is that really the bullshit they feed you over there?
I don't even browse /agdg/, idiot.
Reinventing the wheel is just very unproductive and won't get you anything done.
>>
>>61884172
fuck off
>>
>>61884129
The rest of the quote is something like "Science is not about tools, but how we use them and what we learn when we do."
>>
>>61884188
Most languages have this weird thing called a standard library, anon.
>>
i need to manipulate the hdmi i2c bus on linux. does anyone know if it's even possible to directly manipulate low level serial busses on linux through a high level language like python? i'm not willing to undergo the bloodletting and arcane rituals required to get C to work on anything more than 16 bits. i know about ddccontrol but it doesn't detect the bus despite me having interacted with it on windows.
>>
>>61884203
>making games
>standard library
Yeah no
>>
>>61884189
are you going to contribute to the thread or just let everyone know you got triggered?
>>
why do programmers and code artisans like twitter so much?
>>
>>61884172
rubymine, preferably while spinning my fidget spinner and wearing my XL fox tail buttplug
>>
>>61884217
You may be able to use perl
>>
>>61883699
Try
bytes(yourstringbytes)
or
byte(strbyte)
>>
>>61883010
Another Todo List? Web this time, using vue.js. in Golang. Self hosted Todo List here we go.
>>
>>61884203
Stop posting.
>>
>>61884172
qtcreator for Qt or general C++ stuff. It's real good.
>>
>>61882452


asdfafsd
>>
>>61882452
rolling. give me something good.
>>
File: 1499164781005.png (428KB, 1008x872px) Image search: [Google]
1499164781005.png
428KB, 1008x872px
>>61883831
emojis
>>
File: crying2.png (311KB, 800x432px) Image search: [Google]
crying2.png
311KB, 800x432px
C was a mistake
ML was robbed
Java and C++ are unstoppable now
It didn't have to be like this
>>
what is a /dpt/ approved GUI framework?
>>
>>61884451
Swing
>>
>>61882452

roll
>>
>>61884451
Obviously Electron
>>
>>61884508
>>>/g/wdg
Sorry you haven't got the wherewithal or ability to learn anything more than JS
>>
>>61884508
everything js based is just hipster shit

next
>>
>>61884536
>JS
>1995
>C
>1972
Just a reminder that clions are actual hipsters here meine familia.
>>
File: DBRNfIaXcAEZpFq.jpg large.jpg (72KB, 1440x1440px) Image search: [Google]
DBRNfIaXcAEZpFq.jpg large.jpg
72KB, 1440x1440px
what is the best book/resource for learning C++ d If you already know C?
hmmm?
>>
So, what's gonna be the next big thing every adult male should get guud early on?
>>
will /dpt/ ever graduate from 'recommended/preferred tools' discussion?
tune in next thread to find out
>>
>>61884574
Repairing sexbots.
>>
>>61884573
fuck off
>>
>>61884574
R++
>>
>>61884172
ed(1) is the standard
>>
>>61884573
your pic pissed me off more than what it should
>>
Which one?
 double rate, time;  

 double rate,
time;
>>
>>61884700
double
rate,
time;

obvs
>>
>>61884700
double rate;
double time;
.
>>
>>61884700
double  rate,
dick;

>>
>>61884574
Rust/Nim
>>
>>61884700
double rate; double time;
>>
>>61884285
hmm, that seems to simply encode that string into bytes, which is pretty pointless
I need the contents to string representation of the byte object to become the byte object. not the string itself
>>
>>61884574
Electronics. Hobby electronics are really easy now. So easy normal males might actually get it.
Complementing it with things like 3D printing and easy languages like python only helps. But electronics is the core.
A wifi module is down to a buck, it's crazy.
>>
building gnome 2 now
probably going to build a distro with it soon
>>
>>61883699
>>61884833
If you're using python you should learn to Google a little.
https://stackoverflow.com/questions/35310695/convert-byte-string-to-bytes-or-bytearray
>>
>>61884888
yeah ok, it was pretty hard to google
turns out the real answer is to use eval()
>inb4 eval is dangerous
>>
>>61884700
>>61884710
>>61884715
>>61884735
>>61884812
What is the point if int if double exists?
>>
>>61884609
I wonder if there's any open source sexbot AI:s.
>>
>>61884935
What? I was just posting because I like posting. Stop ascribing meaning to my posts.
>>
>>61884935
Are you asking what's the point of double data length floating point numbers if integers exist?
>>
Fucking pointers man...

I'm a bit confused on implementation stuff.
Let's say I have a structure, Node, and I've defined the type "Polynomial" to be a Node*

I have two methods:
/* removes first element from the polynomial */
void Pop(Polynomial P)
{
struct Node* First;
First = P->Next;
P->Next = P->Next->Next;
free(First);
}

/* Initializes the header node to point to null */
void Initialize(Polynomial* P)
{
*p = (struct Node*) malloc( sizeof(struct Node));
(*p)->Next = NULL;
}


and I call both of them as follows:
int main()
{
Polynomial P;
Initialize(&P); /*If I don't pass in the address
of P, I get segmentation fault because P isn't initialized */
/* Push stuff onto P */
Pop(P); /* Why don't I need to pass in P as a pointer/address */
}


My question is: If I'm changing the linked list in both cases, why do I need to pass in a pointer to a Node* in initialize while I can just pass in a Node* in Pop?
When does pass by value lead to a copy of what I'm passing in, and how do I make sure the side effects I want take effect?
>>
>>61884935
So you can do stuff like
int*double YUGEdouble;

double*double would be ill-defined.
>>
>>61884977
set P to NULL before using it
>>
I want to make an app to keep track of attendance and events for a student organization I'm in. What're the best resources for learning swift?
>>
File: 1468882928057.png (199KB, 439x392px) Image search: [Google]
1468882928057.png
199KB, 439x392px
Employed Haskell programmer reporting in
>>
File: sdasd.png (82KB, 439x392px) Image search: [Google]
sdasd.png
82KB, 439x392px
>>61885165
optimized your image for the next post baits
>>
>>61885165
fuck off pedophile
>>
>52. Given an Array of Stock's values over time, find the period of time where the stocks could have made the most money

fn main() {
let stocks = get_input();
let best = best_purchase(&stocks);
println!("{:?}", best);
}

fn get_input() -> Vec<u32> {
let mut buf = String::new();
std::io::stdin().read_line(&mut buf).unwrap();
buf.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn best_purchase(stocks: &[u32]) -> Option<(usize, usize)> {
let mut biggest_gain = 0;
let mut best_purchase = None;

for (i, start) in stocks.iter().enumerate() {
for (j, end) in stocks.iter().enumerate().skip(i) {
match end.checked_sub(*start) {
None => continue,
Some(gain) => if gain > biggest_gain {
biggest_gain = gain;
best_purchase = Some((i, j));
}
}
}
}

best_purchase
}
>>
>>61885192
you took the soul out
>>
>>61882452
roll
>>
File: 1499158142957.png (572KB, 563x706px) Image search: [Google]
1499158142957.png
572KB, 563x706px
>>61885213
>>
>>61885217
>all this code just to find the min and max of an array
>>
>>61885257
>find the min and max of an array

2-digit IQ detected
>>
>>61885257
Pretty neat that you know how to travel backwards in time with your stock purchases.
>>
>>61885257
that doesn't work if the min occurs after the max
>>
>>61885217
>Not doing it in O(N) time

int getMax(int stockArr[], int SIZE)
{
int currSum, maxSum, iter;
currSum = maxSum = 0;

for(iter = 0; iter < SIZE; iter++)
{
CurrSum += stockArr[iter];

if(CurrSum > MaxSum) MaxSum = CurrSum;
else if(CurrSum < 0) CurrSum = 0;
}

return maxSum;
}
>>
>>61885373
>iter++
>>
>>61882452
There is no better fizzbuzz.
for(var i:int = 1; i <= n; i++) (i % 15==0) ? trace("fizzbuzz") : ((i % 3==0) ? trace("fizz") : ((i % 5 == 0) ? trace("buzz") : trace(i)));
>>
>>61885373
>Given an Array of Stock's values over time, find the period of time where the stocks could have made the most money

How does that tell me when to buy?
>>
>>61885192
what did you do?
>>
>looking trough jobs
>C++, C# etc
>good knowledge of Photoshop
What, they expect me to be an artist too?
>>
>>61885421
>implying
print("\n".join(["FizzBuzz" if i % 15 == 0 else "Fizz" if i % 3 == 0 else "Buzz" if i % 5 == 0 else str(i) for i in range(1, 20)]))
>>
>>61885373
not quite, you need to transform the array of stock PRICES into an array of price CHANGES for this to work
>>61885423
that'd be an easy modification of updating boundaries when the optimum changes
>>
>>61885423
You could have a set of variables that tell you which range is the one that gives you the most money.

(i hope i got it right... didn't test this just guessing at this point)
int getMax(int stockArr[], int SIZE)
{
int currSum, maxSum, iter;
currSum = maxSum = 0;

int max_begin, max_end;
max_begin = max_end = 0;

int temp_max_ind = 0;

for(iter = 0; iter < SIZE; iter++, temp_max_ind++)
{
CurrSum += stockArr[iter];

if(CurrSum > MaxSum) MaxSum = CurrSum, max_end = iter;
else if(CurrSum < 0) CurrSum = 0, max_begin = temp_max_ind;
}

return maxSum;
}


>>61885497
>price CHANGES
Fuck I can't believe I'm illiterate
>>
>>61885421
>>61885484
Enumerable.Range(1, 20)
.Select(x =>
x % 15 == 0 ? "FizzBuzz" :
x % 3 == 0 ? "Fizz" :
x % 5 == 0 ? "Buzz" :
x.ToString())
.ToList()
.ForEach(Console.WriteLine);
>>
>>61884124
You're not getting it, in the system you describe the hash the client provides IS the password.
>>
>>61885584
>3 heap allocations in a single expression
>>
>>61885633
It works :^)
>>
>he uses an IDE
>>
>>61885605
I understand that perfectly, but if that system wasn't in place then user's actual sacred passwords would be sent to me and potential attackers. I don't want to have that kind of responsibility.
>>
my teacher gave us an assignment to make a calculator and I asked him a small question but he got carried away because he likes me for being the only one giving a shit about learning and progress so he made basically the whole thing for me to explain everything and I tried to remake the program as different as possible but I can't without making it retarded, oh and there's sexual tension and days ago other teachers were mocking him because I look like him so he said I'm his son but he's like 6 years older than me
what do?
>>
>>61885584
[...Array(20).keys()].map(x =>
x % 15 === 0 ? "fizzbuzz" :
x % 5 === 0 ? "buzz" :
x % 3 === 0 ? "fizz" :
x
).forEach(x => console.log(x));
>>
>>61885765
Stop blogging for one
>>
I haven't programmed in 4 years and even then I was bad at it. I'm trying to make a small script that splits up a giant text file. I'm making good progress and can split up the text but it's ugly as fuck. Oh well.
>>
>>61885773
because fuck readability
>>
>>61885823
delegate int F(int i);
delegate void M(string[] args);
static void Main(string[] args)
{
args = args.Length == 0 ? new string[] { "1", "Fizz", "Buzz" } : args;
int n, mask = ((F)(x => x % 3 == 0 && x % 5 == 0 ? 3 : x % 5 == 0 ? 2 : x % 3 == 0 ? 1 : 0))(n = int.Parse(args[0]));
Console.WriteLine(mask == 0 ? args[0] : "" + ((mask & 1) != 0 ? args[1] : "") + ((mask & 2) != 0 ? args[2] : ""));
((M)(n < 100 ? (M)Main : delegate(string[] a){}))(new string[] { (1 + n).ToString(), args[1], args[2] });
}
>>
>>61885765
start using periods.
>>
File: DF_ohviXkAQ75N3.jpg (121KB, 1079x1053px) Image search: [Google]
DF_ohviXkAQ75N3.jpg
121KB, 1079x1053px
print("\n".join(["fizzbuzz" if not x % 15 else "fizz" if not x % 5 else "buzz" if not x % 3 else "" for x in range(100)]))

Python prettiest, am I right?
>>
>2017
>code blocks on 4chan are still hideous
nipmoot pls do something
>>
>>61885421
for n in {1..100}; do
fb=
(( n % 3 )) || fb=fizz
(( n % 5 )) || fb=${fb}buzz
echo ${fb:-$n}
done
>>
File: 1483889196784.jpg (117KB, 915x720px) Image search: [Google]
1483889196784.jpg
117KB, 915x720px
>make a part of the code multithreaded
>performance goes down by 200%
>>
>>61885895
list(set- whatever) comprehensions are unreadable garbage and were a mistake

the rest of python is pretty ok
>>
>>61885895
always
def SieveOfEratosthenes(size):
array = [True] * size
for each in xrange(3,int(sqrt(size))+1,2):
if array[each]:
array[each*each::2*each]=[False]*((size-each*each-1)/(2*each)+1)
return [2] + [each for each in xrange(3,size,2) if array[each]]


Just look at that last line
return [2] + [each for each in xrange(3,size,2) if array[each]]

I mean its beautiful.
just beautiful
>>
File: 000024-Twitch.png (104KB, 167x300px) Image search: [Google]
000024-Twitch.png
104KB, 167x300px
>>61885920
LOL
>>
>>61885920
https://www.youtube.com/watch?v=WDIkqP4JbkE
>>
File: 1501696301116.jpg (95KB, 781x779px) Image search: [Google]
1501696301116.jpg
95KB, 781x779px
>write code
>it's shit
>>
>>61886003
it's always a WIP, no need to fret
>>
File: ran_situp.webm (938KB, 640x480px) Image search: [Google]
ran_situp.webm
938KB, 640x480px
>>61885920
>multithreading
>ever
>>
File: hackerman.png (88KB, 362x619px) Image search: [Google]
hackerman.png
88KB, 362x619px
>>61886003
>>
>>61886003
Its fine Anon, no-one here has ever written good code
>>
>>61885765
Smash it?
>>
>>61885895
Wow congratulations you copied my code and made it worse
>>
>>61885956
That was actually useful. Thanks.
>>
>>61885429
filesize idiot
>>
>>61886003
>write programs
>like them and even make a nice webpage for them all
>can't release proprietary software
>can't release free software because i'm nervous some leet freetard will shit on my code
>website just sits unused forever
>>
>>61882452
alrite
>>
>>61886445
>can't release proprietary software
>can't release free software because i'm nervous some leet freetard will shit on my code
your shit "code" isn't worth anything
>>
>>61882452
>tfw you unequivocally realize that C++ is either fast coding or fast code

why is this garbage still exist?
>>
>>61884700
present day; present time;
haHAA
>>
>>61886386
Wow you're such a hacker. Nobody else could have possibly come up with that on their own.

[(not x % 3 and print("fizz", end="") is not None or not x % 5 and print("buzz")) is False and print("\n",x) for x in range(100)]
>>
File: fidgetchan.jpg (63KB, 640x640px) Image search: [Google]
fidgetchan.jpg
63KB, 640x640px
>>61882452
roll
>>
>>61886445
>can't release proprietary software
wat
>can't release free software because i'm nervous
get over it
if it's good, it'll be taken and shoved into a popular chink product
if it's bad, it'll be just like things are now - unused
>>
>>61882452
r8 this masterpiece:
package main

import "fmt"

func main() {
n := 0
for _, err := fmt.Scanf("%d", &n); err == nil && n != 0; _, err = fmt.Scanf("%d", &n) {
fmt.Println("Not zero!")
}
fmt.Println("Zero! Bye!")
}
>>
>>61882452
roll
>>
>>61886511
are you even trying?
for i in range(1,101):print('FizzBuzz'[i*i%3*4:8--i**4%5] or i)
>>
>>61886788
Thanks for reminding me to avoid Go at all costs
>>
>>61886788
that code will print
Not zero!
Zero! Bye!


? it will execute the statement after the for or no?
>>
>>61886910
start here:
https://tour.golang.org
https://www.golang-book.com

you are welcome ;^)

>>61886931
try it
>>
Should I use GPL or AGPL for libraries?
>>
>>61886943
>try it
don't have g o installed
>>
summer is coming to an end

get your shit together
>>
>>61886943
go is such a bad language it isn't even funny
>>
>>61886788
not aesthetic/10
>>
>>61886957
LGPL, though using any kind of variation of GPL might make people avoid your library.
>>
>>61887031
it's a library that has other libraries
>>
>>61886788
>functions start with capital letter
>:=
>no statement terminating character
It's shit.
>>
>>61886957
>GPL
cuck license
>>
>>61887042
DYNAMIC LINKING
>>
Go is shit because of error handling, not because of any particular syntactic problem
>>
>>61887055
>>61887020
>>61887001
but i see dozens of projects on github written in Go with thousands of stars.

something isn't right here
>>
>>61882737
what is your purpose for learning x86_64 ASM
>>
>>61886957
https://choosealicense.com/
>>
>>61882452
Doing a /wdg/ backend project. God I hate that pajeets flooded the markets in software development. Can't seem to find a job there. I've been searching for 6 months and nobody other than /wdg/ backend positions got back to me
>>
>>61887077
>hipsters writing shit with the newest hip language
>post it on hackernews
>hipsters circlejerk eachothers in hopes that having lot of stars might fool somebody actually competent to start using *CURRENT_LANGUAGE*
smt desu senpai
>>
>>61887085
Understanding low level.
>>
>>61887085
if you need to write compiler
>>
>>61887077
>but i see dozens of projects on github written in Go with thousands of stars.
honestly i cant even laugh at this way too many startup fags are making decisions based on github stars
>>
>>61884275
i unironically use rubymine at my job. jetbrains products are actually pretty good
>>
>>61886961
it'll print "Not zero!" while you give it a number that's not zero, though it's buggy as hell, and also ugly

>>61887055
>>functions start with capital letter
public (exported) methods, for convenience

>>:=
it works and makes my code shorter, so what's the problem? also, if you don't like it, there are alternatives

>>no statement terminating character
builds just fine if you add ';' at the end of the line

>>61887112
>muh hipster language!
- compiles to many CPU architectures, and many OSes
- almost as fast as C
- GC'd, no need to manage memory
- CSP / concurrency
...
>>
Shut up you idiot, Java has more respect for the programmer than any shi.t of C++ or C# that college teaches to you. Once I visited Sun Microsystems and I've never been treated so well in my life and I could see the love that is deposited in this language, so inform yourself better before go out and saying shi.t around, you piece of shi.t
>>
>>61887217
not sure if srs
>>
ive been watching a few cppcon videos recently,
i saw a python con video recommended so i though i might as well watch it
jesus.
it was simple and i wasnt expecting much anyway, but those questions at the end
>what are societal causes on why someone writes code like this blah blah blah
>other incredibly dumb questions
>>
File: file.png (160KB, 442x344px) Image search: [Google]
file.png
160KB, 442x344px
>>
>>61887319
kek
>>
>>61887319
if anyone is interested
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
>>
>>61887319
who's that hank
>>
If I want to make program that is written using many different languages, can it even be native? I fear that having initialize the runtime for many different runtimes would either not work or not work correctly because of how the GC's might fuck the heap up.
Should I just use JVM as target platform?
>>
>>61887750
>>>/b/
>>
>>61885717
you don't get what he's saying man
they client could circumvent actually finding something that hashes to that value
they just need to send the value itself
if they know what value they need, they're in
the has -is- the password

hashing on the server side is more secure
if you're really worried. have a small server who's job is to act as a middleman, taking in plain-text from the client and sending over the hash for verification to the real server
>>
>>61882452
Roll
>>
>>61887843
Reroll
>>
>>61887294
cons are all useless

>>61887703
If it looks like a duck and talks like a duck, consumers will fuck the duck.
>>
>>61882452
I just started to program. I guess, if you could even call it that. I've been messing with Scratch a bit -- I had only used HTML/CSS before this.
I suppose I'm going to try to learn Python next.
>>
>>61887910
>If it looks like a duck and talks like a duck, consumers will fuck the duck.
Nobody wants to install jvm.
>>
>>61887937
Not with that attitude.
>>
>>61882452
roll
>>
>>61887935
I think you should try javascript instead. It'd go nicely with whatever you've made with html. Unless you plan on using python with something like django on the serverside. Python is a very good and easy language, though, so it's a good choice anyways.
>>
>>61884172
QTcreator for C and C++
emacs for Lisp and scheme
jupyter for python
>>
File: whynotboth.jpg (53KB, 618x465px) Image search: [Google]
whynotboth.jpg
53KB, 618x465px
>>61887978
>>
>>61887830
>you don't get what he's saying man
I do, I really do! It just bears no relevancy to me.

>they client could circumvent actually finding something that hashes to that value, they just need to send the value itself

"The client can just _guess_ the 512 bit number!"
Oh, now you've got me worried!

I think some people in this conversation wrongfully assumed I will be sending users the actual hash during login attempts. The only thing I'm making public is the salt to the hash, the actual hash that gets generated during registration is never leaving the server.

I just don't want users being angry at me for leaking their Gmail password when I get inevitably hacked.
>>
>>61888004
If someone is already in your server listening for incoming passwords, how much harder would it be for them to just modify your client code before it goes out so it just sends the password anyway?
>>
>>61888004
>"The client can just _guess_ the 512 bit number!"
>Oh, now you've got me worried!

not what I'm saying
you don't understand at all
if you are hacked, they won't need to guess, now will they?
and sure, you won't have the plaintext passwords, so they won't get those
but they will be able to login anyway with the hashes they just stole. because the hasing is done client side you have no idea if they actually hashed anything or just sent you the stolen hash

you're doing a lot of work to circumvent a problem, and yet you're finding yourself at a "solution" that solves nothing
>>
>>61887147
even people who write fuckin compilers don't use asm for much. you can bootstrap a compiler in C and then write the rest of it in the language you're compiling.
>>
>Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.

I don't fucking understand the solutions people write. They always use this
 5*rand5() + rand5() -5 
bullshit; how do you get here? I can see why it works--yeah, it generates integers between 1 and 25 uniformly and then it just ignores numbers bigger than 21. But why not generate between 1 and 14? How would you do that? why do we have to generate up until 25?


http://www.geeksforgeeks.org/generate-integer-from-1-to-7-with-equal-probability/
>>
>>61888004
>I just don't want users being angry at me for leaking their Gmail password when I get inevitably hacked.
You won't be leaking them if you store them as a salted hash. You're looking for a solution for a problem that doesn't exist, there's a reason literally nobody else uses this system you're proposing.
>>
>>61888106
it does protect accounts on other websites/services though if his users reuse their passwords everywhere and an attacker manages to get into his server and stay there long enough to get incoming passwords, which is what he wanted to solve if I understand correctly
I'm not sure how great this danger actually is tho
>>
>>61888102
>modify your client code
It's not a web thing, client code is completely separate.

>>61888106
>but they will be able to login anyway with the hashes they just stole
>You won't be leaking them if you store them as a salted hash

That's exactly why I'm hashing whatever users send me on the server as well, just like I said 5 hours ago >>61883582

Since I hash on both sides, then literally nothing gets leaked if the database leaks.
>>
>>61888129
rand5*5 equally generates
0 5 10 15 20
that means there's a gap of 5 between each number, one that can be filled with another rand5
adding rand 5 gets you an equal chance of
0 1 2 3 4 5 6 7 8.... 24
getting an fully counted set of numbers for 14 would be much more of a pain in the ass

not -quite- sure what the -5 at the end is doing.
>>
>>61882452
rollerino
>>
>>61888220
>That's exactly why I'm hashing whatever users send me on the server as well, just like I said 5 hours ago
ah, I see
>>
>>61888257
the -5 just assures it's between 1 and 25 and not between 5 and 30
>>
>>61888286
oh, I was assuming rand5 made 0-4, not 1-5.
>>
>>61888220
If someone has compromised your webserver to such a degree, they can easily modify what is served to clients to get them to just provide their plaintext password. Again, there is a reason noone uses this sytem. You're not some genius who's figured out the solution to web security where thousands of security researches have failed to do so.
>>
>>61888220
If your database only contains salted hashes then nothing gets leaked anyway, one password hashed on different sites using different salts will generate two completely different hashes. You are not leaking anything of value, not even an indicator that someone has used the same password on multiple sites.
>>
In C++, is it possible to pass an int pointer to a char pointer without fucking up the data?
For example,

void test_function(char* buf, int size){

for(int i=0; i<size; i++){
char a = buf[i];
cout << a;
}
}

int main() {

int32_t* nums = nullptr;
nums = new int32_t[5];

for(int i=70; i<75; i++){
nums[i] = i;
}

void* tmp = (void*)nums;
test_function((char*)tmp, 5 * sizeof(int32_t));
}



I had expected the test_function to print out characters that correspond to individual numbers with some null spaces in between, but it prints out gibberish symbols. Is it not possible to retain the data format when casting pointers like this? Any implicit conversions I should know about? Thought that as long as the bytes match (e.g. int value contained within one byte should output as 1 byte char) it should be fine.
>>
>>61888220
>if the database leaks
the thing your client sends you for authentication, be it a plaintext password or a hashed one, doesn't need to be stored in the database anyway, so hashing client side won't help here
>>
How do you make it so that rate and dick is right under each other?
>>
File: tom-57b9f3c047169.jpg (18KB, 640x640px) Image search: [Google]
tom-57b9f3c047169.jpg
18KB, 640x640px
>>61888311
>your webserver
i already said it's not a web thing, my dude. you're not making it easy.

You're free to point out real flaws in this Anon's Double Hashing Method (patent pending, trademark, copyright, OC do not steal), because I do not see any yet.
I know sharing salt with the world is a bit iffy, but I don't think it's a problem of any real significance.

>>61888347
>If your database only contains salted hashes then nothing gets leaked anyway
But stuff does get leaked if users are sending plain-text passwords, and I don't want to see their passwords for my own sanity.
It's a magical solution that gets two birds stoned at once.

>>61888359
>doesn't need to be stored in the database anyway
I guess I'll just write it down on a piece of paper then.
>>
>>61888405
>>61884735
>>
>>61888358
>i = 70; i < 75
>nums[i]
>>
>>61888405
spaces
>>
>>61888416
>I guess I'll just write it down on a piece of paper then
just make sure you salt and hash it first
>>
>>61888416
>But stuff does get leaked if users are sending plain-text passwords
No it doesn't, you're not storing those in a database.

>I guess I'll just write it down on a piece of paper then.
Do you think you store the plaintext passwords in a database? You receive their password, hash it on the server, and compare it against the hash in the database. The plaintext password only exists in memory and only for as long as it takes to hash the password.
>>
>>61888358
You're storing your characters at indexes of 70, 71, 72 etc.
>>
>>61882452

you cancerous nanobrain
>>
rolo
>>
>>61882452


def fine(rangeLen):
dic = {}
primes = []
i = 2

for k in range(2, rangeLen):
if k > 3 and not k % 2 or not k % 3:
i += 1
continue
try:
if dic[k]:
for j in range(i, rangeLen, i):
dic[j] = ''
except:
primes.append(k)

for j in range(k, rangeLen, k):
dic[j] = ''
i += 1
return primes

fine(25000000)

python py.py 15.75s user 1.02s system 99% cpu 16.796 total


16 seconds is way too slow, any way to make it faster?
>>
>>61882452
Rolling
>>
>>61882452
roll
>>
Is dear imgui just for game ui? or is it viable gui solution
>>
>>61888480
>you're not storing those in a database.
Yes, but I would be receiving them. If the database leaked, then the whole server is compromised, which means whatever I'm receiving also leaks.
>>
>>61888512
are you using this dictionary as an array of booleans?
>>
>>61888358
You are not initializing the last element in the array.
>>
>>61888535
If this was a problem then other people would be using a similar feature. They don't, because it's not. Not even governments and financial institutions.

>If the database leaked, then the whole server is compromised
No.
>>
>>61888600
I applaud your efforts in educating others. Security is such a tricky subject rife with misinformation.
>>
>>61888535
If that was true then when giants like Yahoo and Adobe have database leaks then a lot more stuff than just the database would be leaked, there's far more valuable information on the server itself. A compromised database very rarely means a compromised server. It just means your database was compromised. They are not one and the same.
>>
File: LASTPASS.png (38KB, 893x240px) Image search: [Google]
LASTPASS.png
38KB, 893x240px
>>61888600
>>61888655

>If this was a problem then other people would be using a similar feature.
oh hey, look at picrelated.
it's literally the same as my idea, but without sharing salt, since your username is the salt.

>>If the database leaked, then the whole server is compromised
>No.
this is just bait, because you can't be serious with this.
>>
What the fuck is this?

https://www.quora.com/How-can-I-save-myself-from-GPL
>>
>>61886788
>:=
>>
>>61888436
>>61888482
Christ, I'm retarded. Initial example went from 0 to 4, but it output card suits I wanted to try different input and completely forgot about indexing.
>>
>>61888683
Devs saving themselves from an abysmal license.
>>
>>61888540
sort of
only store numbers I know I can skip
>>
>>61888600
You can do it if you want, but it really is wholly unnecessary and if you do implement such a system be sure to have it independently audited.

>>61888676
This isn't done for the reasons you want to implement it, it's to give users peace of mind that their password isnt being stolen by the service operators, because it's a service for managing all of your passwords and people using it will probably be paranoid. It offers no additional security in the event that their service is compromised.
>>
>>61888358

Whatever you are trying to do shouldn't be so difficult.

Quit trying to convert 32 bit integers to 8 bit chars.

for(int i = 0; i <= n; i++){
std::cout << i << std::endl;
}


std::cout will handle converting integer/float values to ascii for you
>>
>>61888676
He gave you a pretty incomplete answer, but generally speaking it is true that database leaks are rarely related to the server itself being compromised. Exploiting your buggy database software or exploiting the fact that you don't sanitize inputs is not the same as gaining root access to your server.
>>
File: dave.png (670KB, 1036x1160px) Image search: [Google]
dave.png
670KB, 1036x1160px
>>61888683

> indian institute of technology
>>
>>61888683
>Indian Institutes of Technology
>>
>>61888752
Meant for
>>61888535
>>
>>61888752
>it's to give users peace of mind

It gives me a peace of mind.
It gives my users a peace of mind.
And it's not hard at all to implement, while not lowering security in any way.

Win-win-win if I've ever seen one.

>>61888791
Yes, all true, but my database will probably only be listening on the localhost anyway. So if they get into it, then they're in all* the way.
>>
File: india.jpg (51KB, 525x497px) Image search: [Google]
india.jpg
51KB, 525x497px
How would you use programming to solve the poo in the loo problem?
>>
>>61888512
This might be a bit faster
def fine(rangeLen):
dic = {}
primes = [1, 2]
i = 2

for k in range(3, rangeLen, 2):
try:
if dic[k]:
for j in range(i, rangeLen, i):
dic[j] = ''
except:
primes.append(k)

for j in range(k, rangeLen, k):
dic[j] = ''
i += 1
return primes
>>
>>61888876
>It gives me a peace of mind.
How? It's a placebo for the users at best and doesn't offer you any additional security benefits,

>And it's not hard at all to implement, while not lowering security in any way.
It's very possible that you will introduce security holes if you roll your own system like this. Like I said, make sure any security solutions are audited.

>>61888876
>my database will probably only be listening on the localhost anyway. So if they get into it, then they're in all* the way.
Most databases only listen on localhost, it doesn't protect against common attack methods.
>>
>>61888958
>It's a placebo for the users at best
Yeah, receiving user's password in plain-text is about the same as receiving it's unbreakable hash. Placebo at best, definitely.

>doesn't offer you any additional security benefits,
I never said it would, or that it was my goal. Read my very first post, I said just never want to touch plain-text passwords.
>>
>>61888876
If you use secure up-to-date database software and do all the basic stuff like sanitize inputs your database will be safe, and unless you are exceedingly retarded/careless there is no way anyone is getting root access to your box
>>
>>61889064
>Yeah, receiving user's password in plain-text is about the same as receiving it's unbreakable hash. Placebo at best, definitely.
As the service operator (or an attacker that has compromised your sevice) you can easily just instruct the client to provide you with the password in plaintext instead, such a change would likely go unnoticed at least for a while.

>I never said it would, or that it was my goal.
Are you joking? You won't stop claiming that such a system makes you more secure because it stops password leaks or whatever.
>>
>writing more on /dpt/ than you have in your editor of choice
ummmmmmmm
>>
File: 1491238423993.jpg (17KB, 522x499px) Image search: [Google]
1491238423993.jpg
17KB, 522x499px
>>61889125
>you can easily just instruct the client to provide you with the password in plaintext instead
CHRIST

FOR A THIRD TIME:
IT'S NOT A WEB APP
OR A WEBSITE

CLIENT CODE IS SEPARATE

>You won't stop claiming that such a system makes you more secure because it stops password leaks or whatever.
More secure as in "if the server gets compromised, then users won't be sending their plain-texts to the attackers". No more, no less.

>Are you joking?
it's actually 4:20AM here, cut me some slack.
>>
>>61887165
>>61888700
no arguments against my reasoning, so I guess I'm right once again
>>
>>61888944
from 16 to 14 nice
i guess evaluating on every iteration is too costly
>>
>>61889203
If the service gets compromised to the point where they can modify server code they can push a malicious version of the software to users that does not perform the client-side hashing, and then read the plaintext passwords as they come in.

Just use proper security on your server and it isn't getting compromised anyway. And make sure you don't use any exploit-ridden shitware on your server.
>>
>>61889304
>they can push a malicious version of the software to users
You're making a lot of assumptions about how my deployment is done.
No, deployment is not done from the server. The server is just a server, it has absolutely no idea about the client code.

I'm going to bed. Nice talkin' to ya.
>>
>>61889354
Okay, good luck with whatever you're working on.
>>
File: prog.jpg (24KB, 579x125px) Image search: [Google]
prog.jpg
24KB, 579x125px
How the hell am I supposed to know if I did everything right on my own? Book doesn't have solutions
 #define PI 3.141559

int
main(void)
{
double radius,
area,
circumf;

int num_circ;

char circ_name;
}
>>
>>61889496
That is correct.
>>
>Currently finishing my humanities degree and will take a remote part time ror job after I graduate

Feels bad?
>>
>>61889510
Thanks. I don't want to or plan to post every exercise here. It's just ridiculous how there is no examples or solutions for these exercises.
>>
should I major in computer science or computer engineering
>>
>>61889496
get a book that solutions
>>
>>61889496
>implying
This is the only way to calculate pi
constexpr double calc_pi()
{
double runningSum = 0;
int sign=1;
for(double i =1;I<1000000;i +=2, sign*=-1)
runningSum += sign * (double) 4/i;
return runningSum;
}

double pi = calc_pi();
>>
>>61889925
>not 2*acos(0)
>>
>>61882452
Gimme a fun one
>>
>>61889925
>implying

const int pi = 3;
>>
>>61888914

if (loo)
poo;
else
find_loo;
>>
File: icecream.jpg (85KB, 640x480px) Image search: [Google]
icecream.jpg
85KB, 640x480px
>>61885917
>>
>>61882452
roll
>>
>>61882452
Most of this stuff is just repeating what's already been done. What a waste of effort.
>>
File: 1427092787389.jpg (68KB, 636x781px) Image search: [Google]
1427092787389.jpg
68KB, 636x781px
>unhappy with firefox and chrome
>decide to write my own browser
>start reading html5 and dom specs
>can't fathom how events and rendering and compositing and javascript updates are done, can't even begin to comprehend how to structure such a project, let alone debug and test it

wtf guys, i thought i was smart

i can't even begin to express my disappointment in myself
>>
>>61890079
reroll that's way out of my league/interests
>>
>>61890005
>not Σ (n=1, ∞) 4/(-1+2n)
>>
>>61890136
>not (ln 1)/sqrt(-1)
>>
>>61884451
GLUT :^)
>tfw most of /g/ probably doesn't even know what I'm talking about
>>
>>61890106
>he can't even into chromium
http://ampbrowser.com/
wdf
>>
>>61886003
Learn Ocaml. I know it's hard to believe, but Ocaml allows you to actually write not-shit code once you learn it.
>>
>>61890178
>based on chromium
what am i supposed to do with this?
>>
Lads, what's a project bound to get me stars on GitHub?
>>
>>61885765
Have sex with him. ;^)

You should simply take his code, which is already something he thinks is good, and improve it in any small ways you can. Make sure to show those improvements to him when you turn the assignment in.

Just try writing the algorithm in a few different ways then benchmarking it until you get something that does the same thing but is faster.

Alternatively, you could expand on the features of the calculator program he gave you. Maybe give it the ability to define functions or something. Make it a fully featured GUI programming language. Change things until it's cool.

These are all things you could do which would make him happy with your work.
>>
do people actually program in a windows environment? I can't imagine it
>>
what are the most mind-expanding languages other than scheme? haskell? erlang?
>>
>>61890279
loli organizer

>>61890255
w/e you feel like
>>
>>61885956
I absolutely love the way he speaks.

Easy to understand on the first listen, very clear enunciation.

I wish all speakers presented like this
>>
>>61885895
for x in range(1,101):print(x%3==0)*"Fizz"+(x%5==0)*"Buzz"or x

https://gist.githubusercontent.com/LandonPowell/db5ec4590dd0d962212d/raw/62644a6a54a17405b9d36aba0737b33e2b04e1c1/CodeGolfFizzbuzz.py

I'm better than you, suck my dick.
>>
>>61890288
i do ama
but then again it's not all that impressive you can program in any environment granted you aren't using the os as a crutch
>>61890292
esperanto
>>
>>61890292
Ocaml. Ever since I've learned it, I fee like I'm thinking on a whole new level of thought.
>>
>>61884172
Emacs
>>
>>61890292
interlingua
>>
>>61890292
Prolog, ML family.
>>
>>61890377
what's a good project for ocaml? Might learn it
>>
>>61890292
https://www.youtube.com/watch?v=a9xAKttWgP4
>>
NEW THREAD!!

>>61890565
>>61890565
>>
>>61884272
a lot of programmers are nu-males and nu-males and females are the main demographic of twitter
>>
>>61884377
we're in the worst timeline
we could have instead been in a functional heaven, instead we're stuck with all this POO bullshit
>>
Why do I still need to force myself to code after a year? Is it just not for me or should I find some interesting stuff to make?
>>
>>61889142
I write on /dpt/ using my editor of choice.
>>
>>61882452
Rolling
>>
>Markov chain sentence generator
Is it a legit Markov chain if it's literally just a multimap with the current word mapped to the next word, and the actual generator is just picking the next word from the pool of words the current word is mapped to?
>>
>>61892126

The transitions should be weighted, but either way, it's a single-place (or one-place) lookahead markov chain.
Thread posts: 317
Thread images: 29


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