[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: 314
Thread images: 41

File: dpt_flat.png (102KB, 1000x1071px) Image search: [Google]
dpt_flat.png
102KB, 1000x1071px
Old thread: >>59136377

What are you working on /g/?
>>
File: 1486509005680.gif (2MB, 500x342px) Image search: [Google]
1486509005680.gif
2MB, 500x342px
Daily reminder why Rust will never be popular

> Rust is currently unable to call directly into a C++ library
>>
Java is the best programming language!
>>
>>59141180
Not even C++ can do that at times
>>
What is the best anime?????
>>
Polite reminder that the popularity of a language doesn't matter. What matters is YOU! So be the BEST that you can be and use whatever tool you feel best fits the great things you're trying to do!
>>
>>59141199
Master of Martial Hearts, probably.
>>
Im that guy trying to make a non jew spying simple to use password manager.

I've come to the conclusion that the safest way is to export an encrypted text file which holds all the passwords and that if you delete this file everything is gone so its advised to keep a backup somewhere.

Can it get any safer than this? In any chance some bits become corrupt in the exported file I will implement a CRC.

Is this as safe as it gets if you assume theres nothing wrong with the encryption algorithm to produce an encrypted plaintext file?
>>
File: 1sd.jpg (38KB, 362x346px) Image search: [Google]
1sd.jpg
38KB, 362x346px
What do I make?
>>
>>59141243
>his language doesn't have a package manager
>>
>>59141252
I don't even have a language, anon. That's a little advanced for me.
>>
>>59141260
Go into the directory where the Makefile file is and do the make dance:

make clean && make && make install
>>
>>59141243
a Makefile, or makefile (we prefer Makefile though)
>>
>>59141269
>make install
and end up with files cluttered allover the system
>>
>>59141282
>>59141269
ok, here it is anons


all:

>>
>>59141296
Thats actually the activity you're asking for when running make install.
>>
>>59141240
>I've come to the conclusion that the safest way is to export an encrypted text file which holds all the passwords and that if you delete this file everything is gone so its advised to keep a backup somewhere.
literally how else would you make an encrypted password manager

>can it get any safer than this?
Make sure you handle the keys properly
>>
File: 1486875820347.jpg (43KB, 480x451px) Image search: [Google]
1486875820347.jpg
43KB, 480x451px
Aside from the "community" faggotry, can we all agree that Rust is dogshit as a programming language that adds no beauty, terseness or usefulness to the current ones?
>>
>>59141243
just pip it
>>
Learning C++
Tried making a Palindrome Word Checker.
Rate, criticize and help me learn.
http://pastebin.com/u66X1nwp
>>
>>59141324
It's a fine language for its specified problem domain.
>>
>>59141328
>implying pip is safe
>>
>>59141322
Just wanted to make sure
>>
In django, how do I call the filename of a file uploaded through an imagefield?
>>
writing a serial port interface.
should I write it like std::iostream, or just use get()/put() functions?
>>
>>59141347
>make; make all; make sure
>>
>>59141341
What is Rust's specified problem domain?
>>
>>59141341
> problem domain.
cis male patriarchy
>>
>>59141324
Rust is the best language I've ever came across. Just makes sense to me.

Now that I am getting used to Rust, I cringe whenever I try to code in other languages aside from Erlang
>>
>>59141364
Making codes of conduct.
>>
are there any 4chan cli clients? or any dead ones I could play around with?
>>
>>59141370
I bet you also like to program in Go.
>>
File: 1486507049643.jpg (196KB, 1600x1150px) Image search: [Google]
1486507049643.jpg
196KB, 1600x1150px
>>59141372
>>
>>59141386
Go wasn't really that bad. I like goroutines as well. Problem is it's currently focusing on web server application development and I am not interested in that.
>>
post quines faggots
every programmer should have written at least one quine
>>
>>59141401
However I liked D better
>>
>>59141384
Use the API and make one yourself.
>>
>>59141361
Both, define the stream operations in terms of the functions/methods.
>>
>>59141406
Here's mine:
>>
>>59141384
It probably wouldn't be that hard to make yourself, but the only problem is captcha.
You would need to have a 4chan pass, or try and work something else out.
>>
>>59141406
at least one quine
>>
>>59141406
The language is H9+
Hello, World!
>>
>>59141406
GNU bash
echo $BASH_COMMAND
>>
>>59141324
Only brain dead freetards that cling to half a century old technology to look hip and retro like C
>>
>>59141199
Aria.
>>
>>59141199
boku no pico
>>
File: 1457931751320.gif (105KB, 400x400px) Image search: [Google]
1457931751320.gif
105KB, 400x400px
>>59141439
>>
>>59141443
can confirm aria is gud
>>
>>59141443
Can I get her lewds?
>>
>>59141406

>>+++++++>>++>>++++>>+++++++>>+>>++++>>+>>+++>>+>>+++++>>+>>++>>+>>++++++>>++>>++++>>+++++++>>+>>+++++>>++>>+>>+>>++++>>+++++++>>+>>+++++>>+>>+>>+>>++++>>+++++++>>+>>+++++>>++++++++++++++>>+>>+>>++++>>+++++++>>+>>+++++>>++>>+>>+>>++++>>+++++++>>+>>+++++>>+++++++++++++++++++++++++++++>>+>>+>>++++>>+++++++>>+>>+++++>>++>>+>>+>>+++++>>+>>++++++>>+>>++>>+>>++++++>>+>>++>>+>>++++++>>+>>++>>+>>++++++>>+>>++>>+>>++++++>>+>>++>>+>>++++++>>+>>++>>+>>++++++>>++>>++++>>+++++++>>+>>+++++>>+++++++>>+>>+++++>>+>>+>>+>>++++>>+>>++>>+>>++++++>>+>>+++++>>+++++++>>+>>++++>>+>>+>>++>>+++++>>+>>+++>>+>>++++>>+>>++>>+>>++++++>>+>>+++++>>+++++++++++++++++++>>++>>++>>+++>>++>>+>>++>>++++>>+++++++>>++>>+++++>>++++++++++>>+>>++>>++++>>+>>++>>+>>++++++>>++++++>>+>>+>>+++++>>+>>++++++>>++>>+++++>>+++++++>>++>>++++>>+>>++++++[<<]>>[>++++++[-<<++++++++++>>]<<++..------------------->[-<.>>+<]>[-<+>]>]<<[-[-[-[-[-[-[>++>]<+++++++++++++++++++++++++++++>]<++>]<++++++++++++++>]<+>]<++>]<<[->.<]<<]
>>
File: 43827504_p0.jpg (794KB, 1314x1366px) Image search: [Google]
43827504_p0.jpg
794KB, 1314x1366px
>>59141487
They're for my eyes only boy
>>
>>59141480
Every month there is a security exploit out in the open in Linux and almost every fucking time it's a C developer forgetting about safety checks.

Linux is shit because C is shit
>>
File: fastcat.gif (1MB, 498x278px) Image search: [Google]
fastcat.gif
1MB, 498x278px
>watching dmd/ldc compile
How do they do it
>>
File: herpes.jpg (80KB, 1280x720px) Image search: [Google]
herpes.jpg
80KB, 1280x720px
>>59141515
>The product is shit because producer is shit
>>
>>59141439
>C
>implying there aren't superior Java, C# or C++ to choose from
>>
>>59141515
You are aware that that Windows', MacOS's, FreeBSD's, OpenBSD's and basically any OS that people actually use's kernels are written in C as well, right?
>>
>>59141568
linus is actually a retard, but linux is nice
>>
>>59141203
>that the popularity of a language doesn't matter
Totally false, I know it's super important to use the right tool for the job, but a language that is highly adopted means that exists a lot of libraries and frameworks to make development easier.
>>59141252
Install-package japanese
>>
>>59141574
I see you forgot to add in Rust to that list.
>>
>>59141585
>not being capable of writing your own libraries for everything that you want to make
>>
>>59141586
See beginning of thread >>59141324
>>
>>59141598
Implementing things is fun, but sometimes you need to use a library just to get the job done. It's like standing in someone shoulders.
>>
>>59141568
Yes, that's right. If the product cannot be used perfectly by a producer it's trash
>>
if hash tables are so good then why not use them for everything?
>>
>>59141600
>Nonsense rambling of a freetard
You showed him
>>
>>59141635
>hurr durr
>>
>>59141598
Isn't the entire point of libraries to share commonly used routines?

Why would I rewrite things that others have done just fine?
>>
>>59141663
epic
>>
>>59141169
>what are you working on
brainfuck compiler
>>
>>59141515
After languages like Rust will take over the role of C and everything has fewer security holes, will the infosec industry slowly die?
>>
>>59141777
Trips raise good concern
>>
>>59141777
>After languages like Rust will take over the role of C

Never. Too much legacy shit is built in C for C to be ever replaced.
>>
Where will Rust be 25 years from now?
>>
>>59141777
We are all waiting for you to make an OS based on Rust so we can leave C behind.
>>
>>59141823
I don't know, but I'm pretty sure it still won't have HKTs.
>>
>>59141823
Python surprisingly is fucking 26 years old. So unless a major company decides to invest in Rust. I don't see Rust going anywhere.
>>
>>59141827
http://wiki.osdev.org/Rust
>>
>>59141827
In state like sml is now or worse.
People already know some language and there's no point to learn rust.
Schools teach c++/java/python so it's unlikely new people will learn it either.
>>
>>59141823
The standard webengine Servo is using Rust
Firefox is rewritten in Rust and it has less exploits
Rust becomes the main language to write desktop applications on Linux
>>
I fucking hate Debian why did I even agree to install this shit
I need my GHC8
>>
>>59141883
>wishful thinking
>>
>>59141877
>People already know some language and there's no point to learn rust.
top quality argument there, just the kind of mindset that hipster retrofaggot shows to justify to hold on to old garbage
>>
>>59141896
Should have installed Gentoo
>>
>>59141896
Haskell is shit.
>>
>>59141777
If you want security you must use Java.
>>
>>59141883
>Rust becomes the main language to write desktop applications on Linux
Until linus rewrites linux in Rust, Rust will never take over C. Much less on Windows.
>>
>>59141883
Also

C isn't used anymore, Linux is dead and Redox becomes more secure than OpenBSD
>>
>>59141916
What does Linus has to do anything with desktop applications?
>>
>>59141930
I don't think you know what you're talking about.
>>
>>59141941
>>Rust becomes the main language to write desktop applications on Linux
>Until linus rewrites linux in Rust, Rust will never take over C.
Explain what Linus has to do anything with userland software
>>
>>59141945
The kernel is written in C.
>>
>>59141961
Your point?
>>
>>59141907
I have, it's clearly not the solution. I need to switch to Nix on this PC but I haven't had time to migrate everything over
>>59141909
ok
>>
>>59141968
So long as the Kernel is still written in C, Rust will never replace C as the de facto language.
>>
>>59141979
Why don't you go onto the Linux Kernel Mailing List to try and convince him then?
>>
>>59141979
What relation exists between the kernel and the userland?
>>
>>59141985
Rust is a systems programming language, or claims to be. Why use it for userland when there are so many better alternatives? It's intended for stuff like writing kernels.
>>
>>59141985
Well you see anon, the kernel must NEVER BREAK USERSPACE
Fix your approach to kernel programming.
>>
>>59142002
>the kernel must NEVER BREAK USERSPACE
Yes, and how does kernel determine anything in the userspace?

>>59141998
Why are you dodging my question?
>>
>>59142016
I was making a bad reference
https://lkml.org/lkml/2012/12/23/75
>>
>>59142016
>Why are you dodging my question?
If you're going to use Rust in Linux you should use it for thte low level stuff (i.e. the kernel), since that's what Rust is designed for. By the time Rust is useful writing userland in native code will be seen as a thing of the past anyway.
>>
>>59141979
My active desktop applications are:
Polari: mainly Vala
Terminix: D
Firefox: C++
Evince: C

What's the de facto language here?
>>
>>59141979
Why? Making statements does nothing. What does the kernel have to do with the de facto software language for userland?
>>
Wtf am I doing wrong here?
>>
>>59142151
Posting your entire desktop, for starters.
>>
>>59142151
Install gimp, and stop using transparent terminal backgrounds.
>>
>>59142166
UnknownBackend                            Traceback (most recent call last)
<ipython-input-1-f5346494a7bc> in <module>()
14
15 # Config the matplotlib backend as plotting inline in IPython
---> 16 get_ipython().magic(u'matplotlib inline')
17
18 url = 'http://commondatastorage.googleapis.com/books1000/'

/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2156 magic_name, _, magic_arg_s = arg_s.partition(' ')
2157 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2158 return self.run_line_magic(magic_name, magic_arg_s)
2159
2160 #-------------------------------------------------------------------------

/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2077 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2078 with self.builtin_trap:
-> 2079 result = fn(*args,**kwargs)
2080 return result
2081

<decorator-gen-104> in matplotlib(self, line)
#(cont)
>>
>>59142192
Oh boy here we go

>>>/p/astebin
>>
>>59142192
/usr/local/lib/python2.7/dist-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
186 # but it's overkill for just that one bit of state.
187 def magic_deco(arg):
--> 188 call = lambda f, *a, **k: f(*a, **k)
189
190 if callable(arg):

/usr/local/lib/python2.7/dist-packages/IPython/core/magics/pylab.pyc in matplotlib(self, line)
98 print("Available matplotlib backends: %s" % backends_list)
99 else:
--> 100 gui, backend = self.shell.enable_matplotlib(args.gui)
101 self._show_matplotlib_backend(args.gui, backend)
102

/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.pyc in enable_matplotlib(self, gui)
2952 # Now we must activate the gui pylab wants to use, and fix %run to take
2953 # plot updates into account
-> 2954 self.enable_gui(gui)
2955 self.magics_manager.registry['ExecutionMagics'].default_runner = \
2956 pt.mpl_runner(self.safe_execfile)

/usr/local/lib/python2.7/dist-packages/IPython/terminal/interactiveshell.pyc in enable_gui(self, gui)
505 if gui:
506 self.active_eventloop, self._inputhook =\
--> 507 get_inputhook_name_and_func(gui)
508 else:
509 self.active_eventloop = self._inputhook = None

/usr/local/lib/python2.7/dist-packages/IPython/terminal/pt_inputhooks/__init__.pyc in get_inputhook_name_and_func(gui)
36
37 if gui not in backends:
---> 38 raise UnknownBackend(gui)
39
40 if gui in aliases:

UnknownBackend: No event loop integration for u'inline'. Supported event loops are: qt, qt4, qt5, gtk, gtk2, gtk3, tk, wx, pyglet, glut, osx
>>
File: idiot_mio.jpg (110KB, 670x437px) Image search: [Google]
idiot_mio.jpg
110KB, 670x437px
>>59142151
>>59142192
>>
>>59142207
>>59142192
>Using python 2

Found your problem. That will be 15 dollars plus tip.
>>
Hey /dpt/
I am a hardware developer, or precisely used to be one. I used C and ASM because I worked mostly on microcontrollers and did a bit of VHDL and Verilog when it came to FPGAs.
But I want to try to go into the sofware development and shit's like a new world to me. So I don't really know where I need to begin or what languages I mostly need to learn. I know I will have to redo some basic shit in C to learn the differences between hardware and software developping but that's it. So I guess I need to learn the duo C++ and JS and then choose whatever language I want if I like it or whatever, right?
Thanks.
>>
>>59142265
former Node.JS and C# dev here, I ditched both and stuck to C because I am very annoyed by the time wasted on abstractions. With that being said try Node.JS to whet your appetite for OOP
>>
>>59141192
?
>>
>>59142276
Thanks, I will take a look at node.js.
>>
>>59142276
>JS
>advocating trash
>>
File: 1457499974388.jpg (45KB, 480x473px) Image search: [Google]
1457499974388.jpg
45KB, 480x473px
>>59141777
FUCKING THIS

I don't want to lose my job, guys. I enjoy being a security analyst.
Will I starve when computer security isn't a practical concern anymore?
>>
File: thinking-face.png (53KB, 256x256px) Image search: [Google]
thinking-face.png
53KB, 256x256px
>making software that splits a scanned page of handwritten words into individual characters (it's a component for character recognition software to come)
>many functions use a 4500x4500 2D integer vector
>functions that take vector& as parameter instead of instantiating a copy of the vector in memory, just access the address of the original vector = less shit in memory, less shit to do
>takes 144sec for a 4500x4500px scanned page
>instead remove vector& and just pass vector to functions; this theoretically takes longer
>takes 22sec for same image

why

is my understanding of pointers/addresses wrong? This is C++
>>
>>59142448

eg.

vector<vector<int > > someVec;
// init someVec to 4500x4500 size
doShit(someVec);
...
...
void doShita(vector<vector<int> > input&) { ... }
void doShitb(vector<vector<int> > input) { ... }


Which of the two is faster assuming the functions are the same?
>>
>>59142448
>instead of instantiating a copy of the vector in memory
here is problem
there was never copy
>>
>>59142498

Doesn't passing a variable to a function create a copy of that variable specifically for that function?

int a = 5;
doShit(a);
...
void doShit(int input) { // copy of a is given to function
cout << input;
} // at function completion, copy of a is kill

void doShit(int input&) { // address of original a is given to function
cout << input;
} // nothing is kill[/code]

Isn't this how it works?
>>
Which is better, BASIC or Python?
>>
>>59142597
Ruby.
>>
>>59142597
The one MIT uses for CS6.001
>>
Have to write a "memory allocator" in C for a Uni project. Not sure if it really is a memory allocator or a memory allocator in a memory allocator. Either way, its pretty fun.
>>
File: das_it_mane.jpg (149KB, 1920x1080px) Image search: [Google]
das_it_mane.jpg
149KB, 1920x1080px
>>59142597
Fortran
>>
>>59142597
yes
>>
>>59142616
Write your own "malloc" and "free" using sbrk or mmap. I think that's as close to metal as you can get.
>>
>>59142587
You're correct

>>59142485
Your idea sounds correct, and the issue sounds strange to me... but then again a size 4500 vector of size 4500 integer vectors is a little weird in itself.

I bet changing the internal vector to vector pointers would fix the problem. Or using good old arrays if the size is fixed at 4500.
>>
File: yes.png (50KB, 596x670px) Image search: [Google]
yes.png
50KB, 596x670px
>>59141580
yes
>>
>>59142722
>the most-used software has the most vulnerabilities
rly maeks u think
>>
>>59142733
yeah and imagine how many more vulnerabilities are out there that are inherit to the use of C but they're in less popular software so they've not been found yet
>>
>>59142733
Android runs Linux. Android is most-used than Windows.
>>
>>59142761
google is number 6
>>
>>59142761
>Android
It's just Linux
>>
File: deep contemplation.png (392KB, 451x619px) Image search: [Google]
deep contemplation.png
392KB, 451x619px
Anyone know why time.sleep() in python3 is weird?

If I do this

import time
print("Hello /g/")
time.sleep(5)
print("Bye bye /g/")


The sleeping takes place first, where as traditionally I thought python3 was interpreted meaning that "Hello /g/" should be printed first, then it sleeps, then it prints "Bye-bye /g/"
>>
>>59142802
kek
>>
>>59142814
I just copied the code and ran it in my console. Works exactly the way it is supposed to.
>>
>>59142814
>The sleeping takes place first, where as traditionally I thought python3 was interpreted meaning that "Hello /g/" should be printed first, then it sleeps, then it prints "Bye-bye /g/"

It does exactly that.
>>
>>59142814
The issue is that the buffer isn't being flushed to the screen until after the second print. Since the sleep takes place before the buffer is flushed, you can just manually flush the buffer to have the print appear before the sleep.

Try using the standard out functions instead of the basic print
>>
>>59142733
>>
>>59142814
I'm assuming print doesn't flush stdout
>>
That's because python builds your code to an intermediate language. It takes that code and translates it to LLVM and then runs it through a javascript module that's able to interpret it. It doesn't use a standard JS interpreter, it uses one that runs on Python.
That's why your code is not working as expected.
>>
File: strike reset.jpg (12KB, 330x93px) Image search: [Google]
strike reset.jpg
12KB, 330x93px
learning java now... need some help. writing a method where I've declared a variable that increases by one every time it is called. I need the variable to reset to 0 every time it reaches 3
>>
File: akarin angry.png (1MB, 1920x1080px) Image search: [Google]
akarin angry.png
1MB, 1920x1080px
>>59142830
>>59142831
wtf!!

>>59142841
>>59142843
import time
import sys

sys.stdout.write("Hello sirs\n")

time.sleep(3)

print("wtf")


Does not work m'sirs
>>
>>59142858
Solution then??
>>
>>59142870
You still haven't flushed
https://stackoverflow.com/questions/10019456/usage-of-sys-stdout-flush-method
>>
File: maga oh my.png (339KB, 900x900px) Image search: [Google]
maga oh my.png
339KB, 900x900px
>>59142888
>https://stackoverflow.com/questions/10019456/usage-of-sys-stdout-flush-method
Wew....

Today I learned something on /g/
>>
>>59142868
strike = (strike + 1) % 3

If you don't know what modulus does look it up. It will give you the proper logic.

ISSUE: Since you initialize strike in the function it will always be zero and then the second line will make it 1, try moving the declaration to be a class variable
>>
File: eyBossCat.jpg (196KB, 432x444px) Image search: [Google]
eyBossCat.jpg
196KB, 432x444px
>>59142899
Keep on rocking ma dude, coding is a pleasure!
>>
>>59142868
Is this your homework, anon?
>>
>>59142907

How come these guys >>59142831
>>59142835

copied my code and it just werked for them? Or was I getting memed on
>>
>>59142918
Automatic flushing in REPL?
>>
>>59142868
strike = 0;
// ...
if (strike == 0)
strike = 1;
else
if (strike == 1)
strike = 2;
else
if (strike == 2)
strike = 0;
>>
>>59142926
I concur, either that or you were being memed
>>
>>59142912
not really homework... I got a job with accenture pending my completion of this course. It was a career transition deal for vets.
>>
>>59141406
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x)))
>>
>>59142918
Are you on the Winmeme or something?
I know on *nix, stdout/stderr are line buffered if connected to an interactive device (i.e. terminal).
I don't know about other operating systems.
>>
File: scanMe.png (5KB, 305x305px) Image search: [Google]
scanMe.png
5KB, 305x305px
I made this today, if that counts...
dankboi.mooo.com
>>
why the hell does std::streambuf use pointers instead of iterators? it's a mess trying to inherit from it with a std::deque as buffer.
>>
>>59143035
Thank you for remembering me why I prefer C over C++.
>>
>>59143070
try to implement the same thing in C you ridiculous faggot
>>
Alright I need your help. Engineering student here with only experience in C. I been bamboolzed recently and am caught in a bind. Got the shit end of a stick and been dealt a final year project that involves me developing a stand alone application complete with its own GUI. I have till the end of this year for it not inclusive of research and developing the algorithm. What is the best language to use to achieve such a task given that.
>I only have experience in C
>About 3-4 months to do the application and GUI
>Most "portable"
>Open to use all languages given sufficient reason to
>>
>>59143083
Are you implying that you can't implement a fucking buffer in C?
>>
>>59143164
Matlab
you might even like it
>>
>>59143196
I can't use Matlab. I already asked my prof and he said what if the "end user" doesn't have Matlab.
>>
>>59143164
Look for either:
Qt framework (C++). Knowledge of C will help very much with C++, though you will have to learn some fundamental concepts prior to completely understanding or making the most of it. The Qt GUI builder is GUI-based, and extremely easy to use.

JavaFX (Java). Fairly simple language. GUI building is editor-based, but you can use other tools to make that easier. You may be able to learn Java faster than learning C++ from C, but I like the Qt tools better than the FX tools.

Both Qt and JavaFX are extremely powerful and easy to learn.
>>
>>59143215
What about Python? Given time I would of course use C++ or Java but I am afraid of the learning curve while under time constrain and I heard Python is easy to learn
>>
File: akarin dab.png (185KB, 417x600px) Image search: [Google]
akarin dab.png
185KB, 417x600px
Guys can't tell if my brain is suffering a ddos attack but tell me if there's anything logically wrong with this

proposed way to store password:

>Get user to make a password
>Apply SHA-512

>This hash becomes the key for an AES encryption
>Encrypt files containing passwords for youtube, facebook or whatever so it cant be reversed engineered by hex editors and other shit

>Encryption/Decryption becomes possible

>Just werks?

Literally cannot be brute forced or dictionary attacked at any point.

Integrity of files is based on the key which is dependent on the strength of the hashing algorithm SHA-512.

It just werks? Or where have I messed up
>>
>>59143528
>Apply SHA-512
>No salt
It's shit.
>cannot be dictionary attacked
Sure it can.
>>
>>59143528
Salt it you nigger. You want a dictionary attack?
>>
>>59143556
What? Why is SHA-512 without a salt shit? If my secret phrase is "hello" there is no way you can find that out from the digest? Its a one way hash isnt it?
>>
>>59143586
If it's not salted, it's susceptible to a rainbow table attack.
>>
>>59143586
Hello was a shit example, maybe if my phrase was like "31t3h4x0rfr0mGEE"
>>
>>59143594
Replacing alphabets with numbers isn't smart either. There are dictionaries made entirely to attack passwords like that. The key to a good password is length not complexity.

Anyway salt your hashes or you WILL be dict attacked.
>>
>>59143586
Yes it is a one way hash. So I check what hash hello or 31t3h4x0rfr0mGEE generates and compare it to the hash you have. If it is the same well then I have a match. That is why you salt it, so hello becomes hello5785789218 and gives you a unique hash everytime.
>>
Man here I thought C++ was complex. Rust is just batshit insane.
>>
>>59143631
>>59143614
How about do I go storing the salt though? It just comes to the same problem a symmetric key encryption, I've got to store the key somewhere. One way hash functions fulfill this purpose, without needing to store a key.

But if I need a salt, I can't expect the user to memorize the salt, so it means I've got to store the salt somewhere which is then vulnerable
>>
>>59143648
You should've know when you saw a hello world starts with a macro
>>
/g/ help remind me. if I have a bitfield in C++, which one of these is the high nibble and which is the low one?
struct bitfield
{
enum { a,b,c,d } first : 2;
enum { e,f,g,h } second : 2;
}
>>
>>59143661
>I've got to store the salt somewhere which is then vulnerable
It's fine if the salt is vulnerable. In fact, it sort of needs to be, otherwise you couldn't decrypt/hash in normal circumstances.
It just stop attackers from using a bunch of pre-computed shit.
>>
>>59143702
But following the logic of a pre-computed table, won't there be a pre-computer table of commonly used salts? I mean surely they would try this.

Even so, if you have a salt that is known how different does this make it to an extended password? PW+SALT = NEWPW = another entry that can be added to a pre-computed table

Or is it too ridiculous to think that people would pre-compute a table of commonly used salts
>>
>>59143661
Store it locally. Just make sure everyone gets a unique salt. That prevents a recognizable hash from leaking onto the net.
>>
>>59143735
>But following the logic of a pre-computed table, won't there be a pre-computer table of commonly used salts? I mean surely they would try this.

Too much computation to brute force. You need.
1. Salt table
2. Hashes
3. How the salt is applied to the Hashes
4. Apply every permutation of a dict attack with the salt
>>
>>59143735
>commonly used salts
You don't pick a salt like you would a password. Just randomly generate some shit. Even a salt that is a few bytes is going to exponentially increase the amount of shit they would have to store.
These sort of file size increases will quickly make storing the number rainbow tables infeasible.
The tables would be measured in the petabytes, or even beyond.
>>
>>59143735
Because length of a password determines how fast it can be brute forced. Take MD5 for example. MD5 is shit and shouldn't be used btw. A 6 letter password can be brute forced easily but a 18 letter password is still theoretically impossible to brute force even now.
>>
>>59143741
>>59143759
>>59143770
>>59143775
Right this makes sense when were talking about storing a password on a server or something.

However when it comes to having a password manager this is local and bound to your PC, or say a company PC with admin passwords to shit, having a salt is useless if its going to be stored somewhere on your computer is it not? I can definitely accept an answer of a salt for when the PW is stored on a database but not in this case.
>>
>>59143770
>>59143759
>>59143735
Even better run that shit over multiple iterations. Preferably at least 6000 times so that even with the right salt it is near impossible to brute force.
>>
>>59143797
Because there are already pre-existing available rainbow tables on the net that has already tested commonly used passwords. So they use take your hashes and compare them against pre-made hashes. So if you encrypt YourAFaggot and the hash leaked, someone just has to compare that hash against available databases instead of YourAFaggot + whatever salt.
>>
>>59143826
Right. So then if someone has access to your machine and is trying to crack your password isn't it useless having a hash? because he will have access to that too, how do you store a salt safely if you know the cracker physically has your machine (Inb4 write the salt on a piece of paper under your bed), realistically speaking..
>>
>>59143797
>salt is useless if its going to be stored
You don't understand the purpose of a salt.
They exist to combat rainbow tables.
For example, google for "online password cracker" or something, and give it this hash:

e10adc3949ba59abbe56e057f20f883e

They're all going to be able to solve it because it's just md5("123456"), and 123456 is already included in every password database.
The point of a salt is that instead of your hash being md5("123456"), it is now md5("123456MySaltGoesHere"), which none of the password databases will have.
>>
>>59143875
You don't. You need the salt to be available for the password to be decrypted. What makes salting good is not telling the cracker how many times it has been salted and forcing him to use an exponentially larger computation power and storage for it to work.
>>
>>59143912
>Read source code
>Read salt value
>Determine method of salting
>Modify rainbow table
I don't see how salts are at all secure. Unless you ask the user to create a salt once at setup.
>>
>>59143875
He is going to have to come up with his own unique rainbow table specifically to crack your hash. And if you are using a good encryption plus salting over many iterations that is spending millions upon millions of theoretical hours to crack ONE hash.

You better be hiding Atlantis for it to be worth your time.
>>
>>59143932
>Modify rainbow table
I think you mean "recompute entire rainbow table".
Salts don't inherently make your stuff more secure, but it will certainly slow attackers down.
>>
>>59143932
>Read salt value
Salt value is a very simple integr be it 4, 100 or 1000. There is no reason to store how many it has been iterated over unless you are a fucking moron.

>Determine method of salting
Useless without iteration number

>Modify rainbow table
You mean generate your own rainbow table.
>>
How do I get started with writing a text editor?
>>
>>59143958
Determine what language you wanna use
>>
>>59143932
>>Modify rainbow table
This is literally bruteforcing the password. That's the point of the salt. It's to make you have to run

for (password in passwords) {
if (bcrypt(password) == someHash) return password;
}


instead of

for (hash in hashes) {
if (hash == someHash) return passwords[hash];
}


Guess which one is faster? Hint: bcrypt can take seconds or minutes to run depending on hardware and settings.
>>
>>59143967
D
>>
>>59143948
>but it will certainly slow attackers down.
And slowing attackers down doesn't solve anything.
>>
>>59143978
Godspeed
>>
>>59143979
It just stops someone walking in with a unsalted SHA-512 rainbow table and breaking your shit in a matter of seconds.
>>
>>59143950
>Salt value is a very simple integr be it 4, 100 or 1000. There is no reason to store how many it has been iterated over unless you are a fucking moron.
What the fuck are you going on about exactly? Are you responding to the wrong thing?

>Useless without iteration number
Good thing we have the source where we can find that out!

>You mean generate your own rainbow table.
Yes, which wouldn't take too long. You'd just be regenerating the hashes with the salt added on.
>>
>>59143979
Please tell me you are trolling. Or do you not realize our entire world runs on the hope that modern cryptography techniques are not bruteforce-able in a reasonable amount of time?
>>
>>59143979
>And slowing attackers down doesn't solve anything.

Fyi MD5 a solvable and unsalted hash takes improbably long to crack if your password is something like holy_shit_I_am_about_to_make_a_very_long_password.

Guess how long it takes to generate a rainbow table for SHA-512 with salt accounted for?
>>
>>59143958
Anyone?
>>
>>59144000
>Good thing we have the source where we can find that out!

Fucking kill yourself. If I tell my program to iterate 6000 times. It does password + salt, encrypts it adds salt again and then encrypts it. 6000 fucking times before it gives me the hash. Now if I don't store that I iterated 6000 times, how the fuck is your "source" going to find out?
>>
>>59144000
>Yes, which wouldn't take too long
This shows you have zero fucking idea about cryptography. Please stop whatever you are doing because 100% hand to God, you will fuck it up.
>>
>>59144000
>which wouldn't take too long
The whole point is that it takes fucking ages. That's why attackers try to precompute shit.
Don't underestimate exponentials.
>>
File: 1461658267272.jpg (63KB, 715x580px) Image search: [Google]
1461658267272.jpg
63KB, 715x580px
Got an online test for a C++ job coming up, what are some good sites to practice on?
>>
>>59141471
fuck dat shit fagget!
>>
File: angry racoon.png (1MB, 1173x780px) Image search: [Google]
angry racoon.png
1MB, 1173x780px
Ok guys I don't know whats happening, I think I've confused a lot of people and random people have started jacking my comments and roleplaying as me.

Why I started this whole thing about passwords and hashes was because I'm trying to find the safest way to store passwords on a local machine, this in turn means that I need a master password which hashes to give a very unique hash, as some people pointed out it would be good to put a salt, I agree, however I am assume that the evil-doer will have access to my computer so that salt will be visible somewhere and in turn does no damage to slow down his dictionary attack as he will be able to just append the salt to every entry in the dictionary.

So my question for this specific scenario is, is a salt useless and futile in this case alone?
>>
>>59143979
Slowing people down is the point of encryption. If I change my account passwords yearly and keep them in an AES256 encrypted file available publicly then I'm betting my account security on nobody guessing or bruteforce my password in a year.

If I use unsalted hashes then someone with a rainbow table that took a year's worth of computing to generate has a year head start. If someone buys a rainbow table from someone with a botnet with 100k computers and they spent a year on it, then to the attacker they have 100,000 years head start. Salting your hashes is computationally inexpensive for you and many times more computationally expensive for an attacker with a rainbow table. Why not hash your passwords?
>>
>>59144120
Salt is there to prevent pre-computation attacks. Salt is made to force the evil-doer to attack your hash rather than compare it with a pre-commuted rainbow table. If you are using a good encryption method, even with the salt, he is going to require hopefully an infinitely long amount of time to crack. You already slowed him down by forcing him to attack your hashes.
>>
>>59144120
Based on your very specific threat model, an attacker using a dictionary attack, it does nothing against a dictionary attack.

Against a threat model involving a rainbow table, which is pretty common, it forces them to use the less efficient dictionary attack.
>>
>>59144190
>it does nothing against a dictionary attack.
Please don't give him ideas. It forces the attacker to use a dictionary attack and a good encryption method makes dictionary attacks worthless in terms of time spent. Writing it like that make it sounds like a simple dictionary attack will crack his password if the person has access to it for a day.
>>
File: 1487530306084.png (98KB, 612x491px) Image search: [Google]
1487530306084.png
98KB, 612x491px
>tfw want to be good porgrammer not poojeet porgrammer but dumdum

wat do??
>>
>>59144233
Define good programmer
>>
File: 1474843413708.png (37KB, 658x662px) Image search: [Google]
1474843413708.png
37KB, 658x662px
>>59144240
uuhhh... linux
>>
>>59144249
>Uses C
>Vulnerabilities exposed every other day
>"Good"
>>
File: 1486449844595.png (215KB, 960x724px) Image search: [Google]
1486449844595.png
215KB, 960x724px
>>59144256
I dond use C, im bedar ten da linux? haha
>>
>>59144206
>good encryption method makes dictionary attacks worthless in terms of time spent

I guess if you consider enforcing strong passwords part of the encryption method yeah. I consider WPA2 to be solid but if you select an 8 digit password it takes my 6 year old 2 core processor 16 hours to get in to your wifi if you're lucky and your password is the 100,000,000th one I try.

I have my LUKS set up to require 5 seconds of iteration to calculate a key from the password but if I set my password to "cocks" it's all for nothing.
>>
>>59144233
practice, read.... aka put in the time.
>>
>>59144271
If thing I learnt, a good password isn't good for it complexity, p@55w0rd is going to get cracked faster than maryhadalittlelamb
>>
>>59142265
First tip, avoid listening to people here. U should look into what you want to program first, then find a language for it.
>>
How do i make a generic function in c# which accepts enums?

public string Poop<T> (T poop) where T : enum

Just won't work for some reason, I need to retrict the genericscness to only accept enums (any enum)
>>
>>59144324
Would you say you are trying to "Create Generic method constraining T to an Enum"?

http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum
>>
>>59144376
Dayum, that is a pretty ugly solution ;_;
I had hoped that there is native support for that
>>
Where can I learn to write the AES-256 encryption by hand? I don't want to use shitty modules other than the standard lib on Python3, but I can't find a proper in depth guide or even an example code on how AES-256 is done.

Ideas?
>>
>>59144525
Do you understand how aes256 works in the first place as in how the key is generated and what techniques are used?
>>
>>59143735
>commonly used salts
Your salt should be random garbage. I'd pull it from /dev/random. I would only consider you a little paranoid if you got it from hotbits.

If you're using software that requires the user to enter a salt in a config file and that salt is 64 bits then you've made a rainbow table 2^64 times less effective. Yeah you could add shittingdicknipples to a rainbow table to attack this implementation. You're going to have to do 2^64 hashes.
time sha512sum 32bytefile
takes about 7ms on my computer. Multiply that by 2^64 and you get a really long time. This makes using rainbow tables on salted hashes impractical.
>>
>>59144565
No I only have a general idea of how it works, I however cannot find any resources with a proper in depth explanation at every stage (or like how you mentioned how the keys are generated)
>>
>>59144525
https://en.wikipedia.org/wiki/Advanced_Encryption_Standard

First you learn the math. The wiki seems pretty detailed. Then you implement the math in the language of your choice.
>>
>>59144639
>https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
Theres no way you can recreate the algorithm in a language with that high level description, there are words in there that they assume you already know the meaning of.

Conceptually this isn't a hard thing to recreate I just don't know the steps, at the heart of it you just repeat like 3 operations 10 times depending on the key length or something
>>
Be me, know how to program, design patterns seems "obliviously", parallelism is cool AF. Programming is too boring, but we need to face life and make money. Gotta focus on something, can't be "jack of all trades, master of nothing" for the whole life.

Taking suggestion to build a solid knowledge.
>>
>>59144810
>design patterns
stopped reading right there.
>>
>>59144810
>Taking suggestion to build a solid knowledge.
learn to write coherently
>>
i've studied html&css a bit for the last 6 months or so, what language should i learn next?
>>
>>59144843
Html++
>>
>>59144843

JS maybe ?
>>
>>59144525
Bump
>>
>>59144698
For good reason as well. Asking to write your own implementation of aes 256 without external help is like asking how to write a kernel.
>>
File: akarin mattaku.jpg (879KB, 1646x1394px) Image search: [Google]
akarin mattaku.jpg
879KB, 1646x1394px
>>59144884
Right. Which is why I need external help, are there resources out there that are actually detailed?

I mean, this algorithm is very easy to code looking at it from a high level perspective, all you have to do is perform 4 operations 12 times if youre using a key length of 256 bits, simple matrix operations and a couple of XOR's.

I mean I kinda already get the jist of it, I'm just looking for a proper guide with in depth explanation so I can learn and confirm things along the way
>>
>>59144926
http://crypto.stackexchange.com/questions/861/where-can-i-get-information-on-how-to-implement-aes
>>
>>59144926
Are you white? I only help whites.
>>
File: worried pepe.png (551KB, 964x912px) Image search: [Google]
worried pepe.png
551KB, 964x912px
>>59144977
Going to take a proper read tomorrow thx tho

>>59144996
>Pic related
[spoiler]yes[/spoiler]
>>
>>59145038
I hope your math is good
>>
>>59145038
Good. Now formally prove it.
>>
File: pepe university.jpg (8KB, 250x234px) Image search: [Google]
pepe university.jpg
8KB, 250x234px
>>59145056
>I hope your math is good
>>
>>59145056
What sort of math are you talking about?
>>
>>59141180
C can't do that as well m8
>>
>>59145110
>>59145110
Numbers theory for asymmetrical
Probability for symmetrical
>>
>>59141324
Only good things it does is typeclasses and their ownership concept

It's a better C++, but not better than haskell
>>
>>59144698
>there are words in there that they assume you already know the meaning of
Because anyone who implements this algorithm is going to have to know those words. If you're reading a book and you find a word you don't know then you better grab a dictionary.

By the sound of it you're a long way from knowing what you need to know to do this. That means you're going to have to learn a lot.

Step 1
>KeyExpansions—round keys are derived from the cipher key using Rijndael's key schedule. AES requires a separate 128-bit round key block for each round plus one more.

Okay so you need to know what Rijndael's key schedule is and use it to generate one 128bit round key block for each round and then one more. So how many rounds does your algorithm have?
Same article says
>14 cycles of repetition for 256-bit keys.
So now we need to know how to use the key schedule to make these keys from a 256 bit number.
Well there's a link right there in the article. Shit couldn't be simpler.
https://en.wikipedia.org/wiki/Rijndael_key_schedule
It says
>Rijndael's key schedule utilizes a number of operations, which will be described before describing the key schedule.
>Rotate, Rcon, S-box, Key schedule core

You're going to have to learn each of these. It will probably pay off to put these in a function and put what you learn about them in each function. Then test them to make sure they do what they're supposed to.

Okay so Rotate
1D 2C 3A 4F
becomes
2C 3A 4F 1D

Looks easy to me. 32 bit number goes in. Take the first byte and move it to the end. I don't know much about python but I bet there's a way to do that. In C

unsigned int rotate(unsigned int input)
{
unsigned int holder = (input | 16777216) >> 24;
input = input << 8;
return input | holder;
}


I just completed the first step of rewriting sha256. Keep going like this and you'll get it.
>>
Which language do I learn to make crysis and black ops?
>>
>>59145215
C plus plus
>>
>>59144977
Highlighted comment:
>Just a note: For productive use, you often want to use existing implementations instead of creating your own, since they probably are better shielded against side-channel attacks, and might also be more efficient (e.g. might use AES-specific instructions on modern processors). For learning about the internal workings it is a good idea to implement it yourself, though.
>>
>>59145144
u wot m8, you don't need math encryption, encryption is literally just about generating large prime numbers, even a retard can do that
>>
File: webdev.jpg (60KB, 680x680px) Image search: [Google]
webdev.jpg
60KB, 680x680px
>>59145251
> you don't need math
>generating large prime numbers
>>
>>59141180
What languages can, apart from D?
>>
File: me.png (98KB, 1105x1185px) Image search: [Google]
me.png
98KB, 1105x1185px
>>59145290
for(int i=1000, i<1000000, i++) {if (i%2!=0 && i%3!=0 && i%5!=0 && i%7!=0 && i%9!=0) {return i}
}
>>
why the fuck are C# stacktraces so inferior to Java's?

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.

YEAH MATE, BUT FEEL FREE TO TELL ME WHAT THE FUCKING ARGUMENT WAS.

I actually miss Java. You lied to me /g/ and told me C# was comfy. It's not.
>>
>>59145405
>He fell for (((it)))
>>
>>59145405
this is not VS
>>
File: 1480546857743.gif (130KB, 500x375px) Image search: [Google]
1480546857743.gif
130KB, 500x375px
>>59145367
>>
File: Something happened.png (5KB, 714x400px) Image search: [Google]
Something happened.png
5KB, 714x400px
>>59145405
>OOPs
>>
>>59144698
>there are words in there that they assume you already know the meaning of
Look them up.
>>
I hate python so much compared to ruby. What the fuck is this shit:

list_a = ["a","b","c"]
list_b = list_a
list_b[1] = "d"

print(list_a)
print(list_b)

>> ["a","d","c"]
>> ["a","d","c"]


is it impossible to just copy the value of an object rather than referencing to an object?
>>
>>59144525
>>
>>59145411
My employer chose the stack, not me.
I'm open to trying new things because I try to be less of an idiot every day.

But yes, I thought this was supposed to be comfy-mode.exe

It wasn't.

>>59145415
You are correct, it's from SSMS. It's an INDUSTRY STANDARD[tm] for managing Microsoft SQL Server[c].

>>59145419
That image is why I prefer GNU/Linux for enterprise stuff. It doesn't try to be cute, it gives you all the hairy details you could ever want to google, and it tries not to crash.

Not that Windows Server is shit, but I really do prefer the Unix way of doing things.
>>
>>59145682
Because names aren't variables in python. Names are pointers to the value.
So when you write
list_b = list_a


You are saying list_b = list_a address wise.

What you need is
list_b = list(list_a)


https://mathieularose.com/python-variables/
Read this
>>
>>59145966
it's not very pretty though, and it's not intuitive at all. So I can copy a list, by making a list of something that is already a list to begin with.

What if I have my own classes? Do I just have to deepcopy everything then?
>>
>>59142932
This is awful, delete this
>>
What is the best up to date and reference like(no bullshit) c++ book? I'm an experienced programmer and I'm ready to get fucked. I would use online references but I need a guideline of things to check out. Also my internet is slow.
>>
>>59145876
wew lad.

Also I found out AES encryption instruction set is built into intel cpu's lmao

just fuck my shit up, am I wasting my time because the thing I produce will not be the real thing or something?
>>
>>59145901
>GNU garbage
>the Unix way of doing things
Get a load of this stupid faggot.
>>
>>59146020
List_a isn't a list.
You have to specify that you want to copy a the list that is named List_a.
This is what happens when you take OOP to the XXXtreme. Everything in python works like an object.

>What if I have my own classes? Do I just have to deepcopy everything then?
No. You just have to specify what attribute of the class you are copying. It is required because Python works on duck typing and your compiler is going to run into nightmares if you allow duck typing and don't implement clarify when assigning variables.

Blame OOP and Duck typing.
>>
File: 1444464606051.gif (3MB, 640x480px) Image search: [Google]
1444464606051.gif
3MB, 640x480px
>>59145876
I lost him at math.
>>
>>59146029
I'm in your position exactly, and I've been recommended A Tour of C++ by Stroustrup, and C++ Primer 5th Edition. Apparently there's 2 books called C++ Primer 5th Edition, one of which is garbage and the other is good. This is for modern C++, so if you need C-with-classes style C++, ignore this post.
>>
>>59146037
implementing it yourself will be more trouble than using someone else's library
and slower too
>>
>>59146052

> He wants ls without flags
Just KYS. I hope a famalamadingo eats your baby.
>>
>>59142287
Not the guy you replied to, but I think he means that since C++ name mangling is pretty complex and implementation-defined, you can only call C++ libraries from your own C++ source, if they were compiled with the same toolchain. I could be wrong tho.
>>
c++ newfag, how can I include windows.h if I'm on windows, otherwise I'll do some other crap i'll work out later. The example code we're given has some windows.h datatypes, but I'm deving on linux so i'd like to ignore it for now
>>
>>59146136
#if _WIN32
#include <Windows.h>
#endif
>>
>>59146148
Cheers
>>
when designing parsers and lexers, how do you decide how "small" your tokens should be?
for example, i want to lex a language where a string is given byu a length prefix, a seperator and the string itself like so: "5:hello" -> the string hello

would you lex this into:
1: LEN_PREFIX + SEPARATOR + STRING
2: LEN_PREFIX + STRING
3: STRING
>>
>>59146063
OK that makes sense. And it's also a pretty strong criticism of OOP for sure. I felt that with ruby the "lmao objects" part worked quite well and made the code clean and easy to read. In python I haven't had that feeling yet but I'm just starting out.
>>
>>59146161
>LEN_PREFIX + SEPARATOR + STRING
is the only thing that makes sense imo
>>
>>59146161
STRING
Other ways of lexing it would increase complexity both in the lexer (multiple dependent lexemes) and in the parser (detecting structures already analysed by the lexer).
>>
>>59146029
The C++ Programming Language by Stroustrup

Stroustrup describes it as something that can be used as a reference or read sequentially. It is written for people who already know how to program but want to know C++ really well. The only thing more exhaustive in coverage of the language is probably the standard itself.
>>
>>59146205
It's not really. It's just that you have to be aware of what you're asking the system to do. You're pointing to objects, and if you mutate the object pointed to, all pointers will reflect this. It's the same in C. IOW. You just have to be careful.
>>
>>59146232
Or maybe INTEGER COLON STRING if your lexer can already lex integers and strings will generally be found in places different from integers.
What kind of parser did you have in mind?
>>
>>59146205
It is just a by product of making everything an object. So long as you know what you are doing it isn't the slightest problem at all.
>>
>>59146037
It will be the real thing if you do the math right. The AES instructions themselves are just things that speed up implementation. You'd probably want an AES implementation for x86 to have a fall back mode that didn't require those instructions to support CPUs that don't have that instruction. If you're the guy who wanted to weimplement it Python your shit would be unusable levels of slow compared to other stuff. The only reason to reimplement AES is for educational purposes.
>>
>>59146262
recursive descent, its my first one ever so i dont really know the alternatives
>>
>>59146237
>>59146082
thanks, exactly what I was looking for.
>>
>>59146161
Personally, I would lex it into three tokens.
> A token telling the parser that a string would be coming
> The length (in case you want to preallocate space or what have you)
> The string data

I mean, there's nothing preventing your tokeniser to tokenise differently from what the original source looks like, so long as your parser can handle it.
>>
how would you simplify this regex?
({exp}[+-]?{spre}){0,1}


is it the same as
({exp}[+-]?{spre})?


??
>>
>>59146544
I would leave the original that is as easy to read as possible in a comment, and then ask Emacs to create an optimized version.
>>
>>59146586
but are they equal?
>>
I'm messing a little bit with libnotify in Python.

Any idea how can I make the portraits of the girls bigger? I can barely see their faces.
>>
>>59146882
Forgot to mention that I'm using GdkPixbuf for the images.
>>
>>59146882
what is this meme shit
>>
>>59146906
Hyperdimension Neptunia.
>>
>>59146953
why the notifications?
>>
>>59146965
Because I thought it would be fun to get reminded by cute girls.
>>
>>59146996
i could go for that
>>
Writing a chat server in C libwebsockets. Wondering if I should make a thread for each client and create a polling thread for each connection or go for something singlethreaded and reactive.
>>
>>59147014
fork my dude
>>
>>59147026
all those processes tho
socket event waiting threads are CPU cheap but memory consuming though they will lead to less waiting to send, single threaded will be more waiting time but less resource usage, which should I choose?
>>
>>59147068
When I wrote my IRC server, it used a single thread, my server for a custom protocol I made uses python async, and the client has a thread for every connection.

So, either fork a whole bunch or use threads.
>>
>>59147085
Yeah libwebsockets is async (doesnt wait at a client connection before it takes the next), I'll go with threads, thanks
>>
new_thread: >>59147279
Thread posts: 314
Thread images: 41


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