[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
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: 24
File: tornado.png (692 KB, 560x700) Image search: [Google]
tornado.png
692 KB, 560x700
Tornado edition.

What are you working on?

Previous thread: >>47013506
>>
Working on the unit testing for my project.I was using google test, but I want to move into something original
>>
>>47023099
>https://gist.github.com/DEElekgolo/cf0ac817b6659f413e6b

holy hell how do you even come up with this kind of algorithm
>>
File: ahhHHHHHHHH.gif (1010 KB, 450x402) Image search: [Google]
ahhHHHHHHHH.gif
1010 KB, 450x402
>>47023162
>Grid[x += dx[dir]][y += dy[dir]] = j + 1 == js ? "\xC0\xDA\xBF\xd9"[dir] : "\xC4\xB3"[dir & 1];
>>
I'm trying to figure out something to do. I don't think I've ever written more than ~100-200 lines of code, and I've never written anything particularly useful on my own. I'm thinking of making a web browser in Python, but that's going to take a lot of research.

Also, code looks awesome in the Tomorrow theme.

def faggot():
op_is_fag = True
if op_is_fag:
print("OP is a fag.")
else:
print("OP is still a fag.")
>>
>>47023148
Finished up a script for my police scanner app
It displays the current channel and radio transmitting on a 2x20 LCD mounted to a 5.25" drive bay on my 4U rackmount server that runs the scanner software.
>>
>>47023191
>python

gross
>>
>>47023199
...you're calling that an 'app'?
what has the world come to.
>>
>>47023191
Python

you tried
>>
As someone was saying in a previous thread, I can join a server and now my bot will stay in the server until a 30 second ping timeout. How do I keep sending pings back every 29 seconds? (C++, Irc.)

#include <iostream>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <cstdlib>
#include <cstdio>

using namespace std;

bool sendRawPacket(char *msg, int sockfd){
int len = strlen(msg);
int sentbytes = send(sockfd,msg,len,0);
if(sentbytes == 0){
return false;
}else{
return true;
}
}


int main(int argc, const char* argv[]) {
struct sockaddr_in sock;
char buffer[256];
int sockfd = socket(PF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
perror("socket");
return 1;
}

sock.sin_family = AF_INET;
sock.sin_port = htons(6667);
sock.sin_addr.s_addr = inet_addr("54.164.27.70");

int k = connect(sockfd, (struct sockaddr*)&sock, sizeof sock);
if (k < 0) {
perror("connect");
return 1;
}
sendRawPacket("USER gay gay.balls lol :gay\r\n", sockfd);
sendRawPacket("NICK rarbot\r\n", sockfd);
sendRawPacket("JOIN #channelname\r\n", sockfd);
// close(sockfd);

//we need a loop here to look for pings and process messages/commands

while(recv(sockfd, buffer, 255, 0) > 0) {
// ??????? lets try it
}


cout << "Program terminated. Goodbye!\n";
return 0;
}
//make ur screen bigger, that way i can have more space to edit in
//expand putty pls
//wtf, for some reason its still too small lol
>>
>>47023254
reading comprehension

It's not an app
It's (a module) for an app.
>>
>>47023264
As I said, you need to find the PING's and respond with a PONG. It'll have a string which comes with it, which you need to send back. Use a regular expression.
>>
>>47023213
>>47023255
>Bashing Python
>2015
>>
>>47023148
>Making a file transfer protocol akin to ftp

just the difference being i will only use it for transfering games from my home server to my phone, all are actually emulator roms.

The application will have a nice graphical frontend on my phone so that i can browse games in comfort (and brag about it to colleagues hehe). It will also support cover image for every games so that i dont have to read the filename to identify the games...

>A visual novel game
I am fluent in C, what should i use to make my game, if i want it to be cross platform? Anyone?
>>
>>47023279
>use a regular expression
You should be parsing all IRC commands into arguments. You don't use regex for that.
>>47023264
>The PING command is used to test the presence of an active client or server at the other end of the connection.
>When a PING message is received, the appropriate PONG message MUST be sent
i.e., you cannot rely on a server sending you a PING, so not only must you listen for one, you should be sending one yourself.
if you can make your main loop not block (recv), and check the time every so often, you can make sure to send a heartbeat at predefined intervals.
>>
>>47023336
Regex was a suggestion, makes dealing with IRC easy as fuck. You can't just "send one yourself". Not all servers accept a plain ping. Some send a string which you need to send back.
>>
>>47023372
>Not all servers accept a plain ping.
uh, what?
>When a PING message is received, the appropriate PONG message MUST be sent
what don't you understand about MUST?
>>
>>47023388
That's what I'm saying, it (the accompanied string) MUST be sent back.
Just sending "PING" wont work.
Apparently I misunderstood you. When you said
>i.e., you cannot rely on a server sending you a PING, so not only must you listen for one, you should be sending one yourself.
I thought you meant just sending "PING" and nothing more.
>>
File: dran0026.jpg (484 KB, 1664x1280) Image search: [Google]
dran0026.jpg
484 KB, 1664x1280
>>47023148
Reverse enginnering files from a game, Pool of Radiance. Putting together a Python script to extract the maps.

The game was kind of shit but it did have some nice art. Pic related.
>>
>>47023420
ah, ok
'a PING command' might've been better wording
>>
>>47023431
I wrote a huge IRC MUD a couple years back in perl. It was massive. I lost interest since it got so messy. It was my tutorial to perl, so everything I learned I would add in. As you can imagine, older code was very poor. I've been thinking about redoing it in C just for the practice, as I've switched to C.

Shit had everything though.
PVP, random encounters, raids, global weather, spells which affected monsters and players, quests, my god everything I could think of. Worked on it for a good two years.
>>
Big time pleb here

I just want to make a small question about UML diagrams, I'm supposed to design a class and this popped up in the diagram
>+ char getSize( ) const

Is the "const" part supposed to be going along with the return type of the function?
Like const char getSize()?
>>
>>47023426
Before reading your message, I thought this was some sort of Icewind Dale II high-res graphics.
>>
>>47023457
>huge IRC MUD
>perl

May god have mercy on your soul.
>>
>>47023597
Why? Perl is fantastic for working with IRC. I had a blast making it.
>>
a website

its mainly going to be used for porn
>>
>>47023611
that reminds me, I was starting to mirror exhentai to git repositories using github
>>
>>47023191
>Le meme
>>
>>47023611

That reminds me, I need to get back to working on my wobsite.
>>
The IRC fag here. i want to only read upto \0 (end of file), so basically just that packet and cout ONLY that packet (until a new packet comes, of course) but its putting shit at the end from the last packets.

#include <iostream>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <cstdlib>
#include <cstdio>

using namespace std;

bool sendRawPacket(char *msg, int sockfd){
int len = strlen(msg);
int sentbytes = send(sockfd,msg,len,0);
if(sentbytes == 0){
return false;
}else{
return true;
}
}


int main(int argc, const char* argv[]) {
struct sockaddr_in sock;
int sockfd = socket(PF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
perror("socket");
return 1;
}

sock.sin_family = AF_INET;
sock.sin_port = htons(6667);
sock.sin_addr.s_addr = inet_addr("54.164.27.70");

int k = connect(sockfd, (struct sockaddr*)&sock, sizeof sock);
if (k < 0) {
perror("connect");
return 1;
}
sendRawPacket("USER gay gay.balls lol :gay\r\n", sockfd);
sendRawPacket("NICK rarbot\r\n", sockfd);
sendRawPacket("JOIN #niggersack\r\n", sockfd);
sendRawPacket("PRIVMSG #niggersack :sup niggers?\r\n", sockfd);

int rc;
int MAXSIZE = 1024;
char buf[MAXSIZE];
while(1){
rc = recv(sockfd, buf, sizeof(buf), 0);
if(rc > 0) {

}
}

cout << "sHIT FUCK DICK BALLS!\n"; //hope we never see this message lol
return 0;
}


help
>>
>>47023582
Close. The game rules the D&D ruleset like Icewind Dales does.
>>
>try to finish project
>oh fuck, this shit is so hard
>tab to /g/
>end up having nothing of value for github
>never get job
>starve
>>
>>47023802
are you saying projects on github equate to job opportunities?
>>
I'm putting together registration / login scripts for a web service.

If I want a per user unique salt is it enough to use some application constant random number concatenated with the username and maybe the domain name? or is the username not really helpful?
>>
>>47023817
drop what you're doing, and use bcrypt.
here's some from my user file.
var Promise = require('bluebird')
, bcrypt = Promise.promisifyAll(require('bcrypt'))
, SALT_WORK_FACTOR = 10

//plaintext -> hash, using bcrypt
function hashPassword(password, _, next) {
return bcrypt.genSaltAsync(SALT_WORK_FACTOR).then(function(salt) {
// hash the password along with our new salt
return bcrypt.hashAsync(password, salt);
});
}
>>
>>47023808
no but I hear it helps
>>
>>47023264
Your send function should loop until the entire packet has been sent. TCP is a streaming protocol.
>>
>>47023846
there's no need for the '_' and 'next' parameters here, I just copied my code wrong

>>47023852
>until the entire packet has been sent
until a CRLF pair has been sent*
>>
>>47023858
Well yeah, in case of IRC the packet should end with \r\n but the statement is valid nonetheless.
>>
>>47023870
valid? how
TCP is a streaming protocol, as you say
you cannot be certain whether you are reading two packets, one packet, a half a packet, etc
I assume most TCP servers will buffer things up too, so you're going to get more than one line per packet, too.
>>
>>47023881
Sending a "packet".
bool sendRawPacket(const char *msg, size_t size, int fd)
{
int sent = 0;
while(sent < size)
{
int current = send(fd, msg, size - sent, 0);
if(current == 0)
return false;

sent += current;
}

return true;
}
>>
>>47023886

bool sendRawPacket(char *msg, int sockfd){
int len = strlen(msg);
int sentbytes = send(sockfd,msg,len,0);

if(sentbytes == 0){
return false;
}else{
return true;
}
}
>>
>>47023892

Also, receive

void Receive(char* buffer, int sockfd){
int n = 0;
while((n = ::recv(sockfd, buffer, strlen(buffer), 0)) 0){
buffer[n] = 0;
}
}


kek

 int rc;
int MAXSIZE = 1024;
char buf[MAXSIZE];
string strmsg = "";
while(1){
Receive(buf, sockfd);
cout << buf << endl;

}
>>
>>47023886
oh, sending
sorry my bad, thought you were talking about receiving.
>>
>>47023148
couple of us over at #/g/technology are working on a chat bot in C++. the goal is to keep it protocol agnostic (we've only implemented IRC, though)

https://github.com/GreenBagels/greenbot
>>
>>47023846
I have the scrypt module installed, it works similarly.
generating a random salt is the default behavior if one isnt provided, but that wouldnt give me predictable behavior for verification....

or is there something I'm missing.

I do need to store the random salt somewhere If I do create one dont I?
>>
>>47023808
Literally don't fucking listen to anyone.

Having projects to put on your resume, even if they suck shit, can help. Most of the time they won't even look at your shit, but they will see that you can actually do something.

I've only done one interview where the guy was actually sitting there looking at my repos while talking to me. It's a scary yet great feeling.
>>
>>47023923
nah, bcrypt hashes actually _contain_ the salt (so you save the entire thing into db and you're good to go)
So my script generates the salt, then creates the hash using it.
to validate it, I have a simple function:
comparePassword: function(candidatePassword) {
return bcrypt.compareAsync(candidatePassword, this.getDataValue('password'));
}
>>
>>47023963
Okay, I guess I missed
>bytes 16-47: 32 [bytes] of random salt

but what is the point the salt being stored in plaintext along with the hmac?

isnt the whole point to disrupt offline password cracking of compromised databases?
>>
>>47024010
nvm, I guess if there is a unique salt, even if its stored in plaintext with the hmac, each password would need to be cracked independently...
>>
>>47024010
The whole point of the salt is to stop creating rainbow tables, and then using that to crack offline.
Having a per-user salt (like you were going to do) means that offline cracking is still possible, but there are no similarities between other users, making it even more of a useless task
>>47024031
ninja'd
>>
>>47023148
>no catalog-friendly /dpt/
>made me make a new one because I didnt find
>>
>>47024038
it's the tornado meme my friend, you must accept it
>>
>>47024054
although yes, I could've included '/dpt/' in the subject. Please forgive.
>>
File: 1426387961893.jpg (32 KB, 373x346) Image search: [Google]
1426387961893.jpg
32 KB, 373x346
Alright, /dtp/. I am so fucking pissed with this shit. I just really need some help.

#include <iostream>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <cstdlib>
#include <cstdio>

using namespace std;

bool sendRawPacket(char *msg, int sockfd){
int len = strlen(msg);
int sentbytes = send(sockfd,msg,len,0);
if(sentbytes == 0){
return false;
}else{
return true;
}
}


int main(int argc, const char* argv[]) {
struct sockaddr_in sock;
int sockfd = socket(PF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
perror("socket");
return 1;
}

sock.sin_family = AF_INET;
sock.sin_port = htons(6667);
sock.sin_addr.s_addr = inet_addr("54.164.27.70");

int k = connect(sockfd, (struct sockaddr*)&sock, sizeof sock);
if (k < 0) {
perror("connect");
return 1;
}
sendRawPacket("USER gay gay.balls lol :gay\r\n", sockfd);
sendRawPacket("NICK rarbot\r\n", sockfd);
sendRawPacket("JOIN #niggersack\r\n", sockfd);
sendRawPacket("PRIVMSG #niggersack :sup niggers?\r\n", sockfd);

int rc;
int MAXSIZE = 65535;
char buf[MAXSIZE];

while(1){
rc = recv(sockfd, buf, sizeof(buf), 0);
if(rc > 0){
char *array;
array = new char[rc]; // doubt it. try it anyway mah nigga
array = buf;
cout << array << endl;
cout << flush;
// delete [] buf;
}
}

cout << "sHIT FUCK DICK BALLS!\n"; //hope we never see this message lol
return 0;
}


Literally, ALL I want returned is the packet and nothing else. WHAT THE FUCK AM ID OING GOD DAMN WRONG AND HOW DO IF IX IT
>>
>>47024116
>using namespace std;
kill you\'re self
>>
>>47024116
i think you're just plain retarded, give it up
>>
>>47024151

guess how many shits i give?
>>
>>47024116
You should send USER and NICK, then wait for PING, send PONG, wait for MOTD, then SEND JOIN and PRIVMSG. Also use >>47023886. Also fix your receive loop. Also https://tools.ietf.org/html/rfc2812.
>>
>>47024116
check out how it is done in >>47023915
>>
>>47024223
>You should send USER and NICK, then wait for PING
no, that's not what you should do
USER, NICK, then wait for RPL_WELCOME/001 (which implicitly comes after the MOTD)
>>
>>47024151
I implicitly define all of my js variables in the global namespace
>>
Babby level here. What do I need to be studying/learning to make graphical programs. I need dat gooey.
>>
>>47024401
search: "<your language>" "gui framework"
>>
Would it be possible to make a graphics library similar to that used in phones but for computer programs? I wouldn't mind making more GUI styled programs but the libraries available kinda suck.
>>
>>47024486
What language? [spoiler]Maybe its YOU who sucks[/spoiler]
>>
>>47024486
i'm sure it already exists.

it may not be explicit, do.this.like.android.does.this();

but I can imagine how I would build a swipe / click app in a couple languages.
>>
>>47024510
>>47024526
pure C, only one I know is GTK+ which looks kinda boring and generic
>>
>>47024528

see

>>47024441

select first 4 from wikipedia when lang == C
>agar
>xaw / athena
>clutter
>elementary

if you cant bother to read, you're already fucked

you can go back to /v/ now
>>
>>47024555
He was specifically asking for an android like framework.
>>
>>47024570
no, what he's asking for is an IDE to make the design easier, he just doesnt know it yet because he doesnt know how to use the google
>>
>>47024555
I sure do like my program looking like its from windows xp!

>>47024595
No, I want a more custom interface when making GUIs. With something like android or IOS you can use the default IDE or can customize it programmatically.

I want a library that can be used to make shitty XP clones or material-esque programs.
>>
>>47024441
>not searching "<your language> qt"
>>
File: 1286150929023.png (146 KB, 521x818) Image search: [Google]
1286150929023.png
146 KB, 521x818
>>47007906
>>47008246
on snapdragon 800:
>branching, worst time (ns): 15740989
>polymorphism, worst time (ns): 4344479
i only measured the most significant "one-off" event, which is likely to be incorrectly branch predicted. the perceived improvement was obviously not placebo and these measurements (in addition to my hands-on experience) shows that simply having two extraneous branches can introduce game-ruining stuttering. the one with branching often took much more time than the worst time with polymorphism. brb taking 16 ms for one little thing in a 60-120 fps game. these findings definitely motivates me to further remove branching. the critical method i measured should be able to be improved significantly with polymorphism and i'm looking forward to implementing it. btw this method only takes up to tens of microseconds on a 3 GHz core 2 duo so it taking up to several milliseconds on an ARM processor doesn't necessarily mean it's terribly unoptimized.
>>
>>47024672
>60-120 fps game
with v-sync btw. aiming for a rock-solid vsynced frame rate, haven't even checked the non-vsynced frame rate.
>>
typedef std::string string;

or
using std::string;
?
>>
>>47023578
It means that the function doesn't change the state of the object.
>>
>>47023171
I was writing this kinda shit in my first year of C. Ain't hard niqqa.
>>
>>47024854
What did you use to learn C?
>>
>>47024801
nothing of them, just use std::string all time in your code
>>
>>47024994
>just use std::string all time in your code
Gross.
>>
>>47025015
Don't pollute.
>>
>>47025027
What? I've got all my data type changes secluded to a single file so none of the code is really "polluted".
>>
>>47024672
well i found the main cause of the performance disparity between ARM/android and wintel. apparently it takes multiple milliseconds to start playing one tiny sound. i presumed only low-end devices would be helped by turning the sound off. crikey m8

#thanksbasedgoogle
>>
>>47023578
>>47024807
>specifying that accessors don't change state
aaaaand this is why people don't like UML
>>
File: screen.jpg (180 KB, 2805x759) Image search: [Google]
screen.jpg
180 KB, 2805x759
Sort of a stupid question. How do I make the buttons go beneath each other?
>Pic related is my CSS or is this HTML based?
>>
>>47023168
Looks like I have inspired a fellow autist :^)
>>
File: 1376505409276.jpg (48 KB, 524x480) Image search: [Google]
1376505409276.jpg
48 KB, 524x480
>Programming assignment
>Write a server and client for a subset of TFTP
>Connections use UDP
>Get the client sending packets to the server
>Finish for the day, save my work and close everything
>Continue the next day
>Can't seem to get the client and server to communicate; the server never unblocks from recvfrom()
>I have no fucking idea if it's the client or the server that is broken
FUCKING UDP
>>
>>47025140
udp is fine fuck off.
>>47025128
inspired with what, tornado or the C# thread stuff
>>
>>47025161
UDP is not fine, it's unreliable. Only good for VoIP
>>
>>47025190

>only good for VOIP
>not good for all the video games that use it

get better internet
>>
>>47025161
New thread shit
>>
>>47025190
'unreliable'
technically yes, it's unreliable.
in practical use, packet loss doesn't happen, unless you actually have a bad connection

>>47025205
;_;
I was the first to come up with the 'tornado' word, and I wrote the code to create the OP image
oh well
I do like to thread stuff, I wonder if it can be adapted to other languages
>>
File: rekt.jpg (77 KB, 687x361) Image search: [Google]
rekt.jpg
77 KB, 687x361
>>47025196
rekt
>>
>>47025211
Yeah I guess that's true
>>
>>47025211
>in practical use, packet loss doesn't happen
>Being this naive
>>
File: nav8u.png (218 KB, 719x395) Image search: [Google]
nav8u.png
218 KB, 719x395
>>47025211
I do like the thread stuff*, I mean.

>>47025213
what the FUCK. 87MB/s down? 93MB/s up?
...how? NBN or some shit?
>>
>>47025140
Because you're too dumb to fire up wireshark. Blame an established protocol instead of yourself. Also your teacher told you to use UDP because you're obviously too dumb for TCP handshakes and he wanted to make it easy for you
>>
>>47025227
Well we've recently had fiber installed (not NBN I don't think), That and we live close to the exchange. Best thing ever.
>>
>>47025255
fuckin A man. lucky as fuck.
>>
>>47025190
>UDP is not fine, it's unreliable.
UDP is fine, it has a lot of advantages.

if you want to use UDP and maintain file integrity you would still probably be better off doing tcp over udp, or building in some sort of checksum integrity check like bittorrent (also uses udp).

another example would be sftp, which uses ftp(tcp) over ssh(which is udp).

tl;dr - the problem is you
>>
>>47025253
>Blame an established protocol instead of yourself
I was more blaming the nature of unreliable transfer.
I've figured out that is has something to do with getaddrinfo() acting weird when giving it "localhost", but it works when "127.0.0.1" is provided.
>you're obviously too dumb for TCP handshakes and he wanted to make it easy for you
>Implying that TCP handshakes aren't done by the OS.
>>
>>47025277
>over ssh(which is udp).
?
SSH is port 22 TCP
>>
>>47025269
Yeah it's pretty sweet, the place I live in has a file server running FreeNAS and they have currently put it in my room. I'm the techy guy and just incase they audit the place they can't search students rooms.
So I've got this baby connected to a switch and I've got my desktop connected to the switch and I'm pulling movies off at 11mbs while everyone else is about 1 - 2 mbps
>>
>>47025277
>UDP is fine, it has a lot of advantages.
Yes. Speed and simpler implementation.

>tcp over udp
So all of the disadvantages of tcp AND udp.
Idiot.

>building in some sort of checksum integrity check like bittorrent
I have to follow the spec. You send an ACK packet for every file chunk they send.

>sftp, which uses ftp(tcp) over ssh
Fucking wrong. SFTP has nothing to do with FTP. It is its own protocol.
You're probably thinking of FTPS (FTP over SSL).

>over ssh(which is udp).
SSH is TCP.

I don't think you could have been any more wrong in your post.
>>
>>47025213

if UDP is proving unreliable for you, i suggest your connection is still a pile of shit
>>
File: rust.png (44 KB, 1000x1000) Image search: [Google]
rust.png
44 KB, 1000x1000
>no GC
>no memory management
>no buffer overflows
>no dangling pointers
>no null pointer
>option type
>immutable by default
>blocks are expressions and have return values
>all the advantages of functional programming without the clunky autism
Why aren't you using this perfect language?
>>
>>47025310
I have no problem with UDP, just how it's implemented I don't like it.
>>
>>47025211
>I do like to thread stuff, I wonder if it can be adapted to other languages
Undoubtedly you can come up with something for any language
>>
>>47023148
Have you done your daily tornado, /dpt/?
let tornado input =
let len = Seq.length input

let rec tailTornado shift list =
match shift with
| x when x = len -> list |> List.rev
| x -> let next = [ x .. x + len - 1 ]
|> Seq.map (fun i -> Seq.nth (i % len) input)
|> Seq.toArray
|> fun chars -> new string(chars)
tailTornado (shift + 1) (next::list)

tailTornado 0 []
>>
>>47025313
I've learned Rust and I have a personal program that I've been working on written in it.
It's a bit of a weird language though, at least coming from C.
>>
>>47025313
I'm waiting for it to stabilize. Right now it's in "we'll-change-things-every-day" phase. I don't have time to relearn the same language ten times in a year.
>>
>>47025126
bump
>>
>>47025313
because it has autism syntax
>>
>>47025126
display: inline or inline-block or inline-flex or inline-table
>>
>>47023148
>tornado.png
top fucking kek
>>
>>47025313
>no null pointer
I'm confused, why are you listing this like it's a good thing?
>>
>>47025430
https://www.linkedin.com/pulse/20141126171912-7082046-tony-hoare-invention-of-the-null-reference-a-billion-dollar-mistake
>>
>>47025430
As a true systems language, Rust actually does have null pointers, but only in unsafe blocks.
>>
File: uxwzo.png (45 KB, 763x537) Image search: [Google]
uxwzo.png
45 KB, 763x537
>>47025427
i made this
>>
>>47025434
This is why you should use C++11 and the glorious nullptr.
>>
>>47025467
what programming language is this?
>>
>>47025430
imo, null /pointers/ are bad (i.e. integer w/ value of 0)
a defined null /type/ on the other hand, is OK
>>
>>47025478
just c#
>>
>>47025487
Looks beatiful, what a shame it's useless on GNU/Linux
>>
>>47025498
someone said ages ago that c# has compilers for other OSs now
>>
>>47025467
>2 space indents
>cursive
>the declaration of Main is in 5 colors, yet Console.WriteLine in 1
:/
>>
>>47025507
They talked about that, but there is still no native C# compiler available at the moment - or at least I'm too stupid to find it.
>>
File: tornado.png (82 KB, 800x800) Image search: [Google]
tornado.png
82 KB, 800x800
>>47025498

>>47025509
ok, so
I use Visual Studio to write all my code
I use 1 tab for indenting (Visual Studio uses smart tabs though, so they're actually 4 spaces)
but since the fucking IDE is so bloated...I chose to take the preview image in sublime, and converted the indentation to 2.
Why I did this I do not know.
>>
>>47025498
>>47025507
>>47025527
nubs, mono has been out for ages for linux and mac, and now since microsoft is releasing (nearly) the whole of .NET/C# as open-source, they'll be even stronger
>>
i have a java question

say i have an array of jlabels each with mouse listeners, i know i can do e.getSource to get the clicked jlabel but is there any way to get the jlabel's index in the array?

i know i can loop through the array and compare the objects but that feels like a really tacky way of doing it
>>
>>47025538
>but since the fucking IDE is so bloated
That's the price for such comfiness. I don't mind it one bit, tbh.
>>
File: bloat.png (53 KB, 1069x683) Image search: [Google]
bloat.png
53 KB, 1069x683
>>47025509
see, here
you happy?
(Visual Studio is so fucking nice though)
>>
What are the c++ conventions for project structure?
(Inc)
\-String.h
\-...
(Src)
\-String.cpp
\-...

I was thinking about this but it seems like it would be kind of unmanageable if I have 50+ source files in the same directory.

(Src)
\-(String)
\-String.h
\-String.cpp

Maybe this?
Anything I should look out for when deciding on the project structure?
>>
>>47025551
doesn't mono compile to an .exe which requires wine to execute?
>>
>>47025588
mono (or more precisely, mcs, the compiler) compiles to a .NET exe, which mono itself runs.
You can compile .NET exes on windows too, and they'll work on mono.
I'm not 100% sure, but I think wine interfaces with mono to provide .NET support too (but using mono directly is better.)
>>
>>47025602
so there is no way to compile your code into one binary containing the complete dependencies/.NET or whatever it needs so you can just ./program without needing mono?
>>
>>47025570
>That's the price for such comfiness.
Exactly. I tried to go back to other languages and IDEs, and man, it is impossible.
No intellisense? no productivity. Visual Studio reigns over all.
>>
>>47025573
Shit, mate, you even added newlines at almost all the right places. I'd put one below segments and remove the one between source and dest Rects.

>>47025618
Don't forget Resharper.
>>
>>47025616
actually, mono has a utility called 'mkbundle' which does just that
it bundles everything, including mono, into a native executable.
>>
>>47025625
>put one below segments
true
>remove the one between source and dest Rects
noooo
they're separate for a reason
>>
>>47025577
Look at big projects on GitHub for style inspiration. They usually look like the bottom one.
>>
>>47025430
Because they are one of the biggest causes of memory errors and crashes. Using the Option type like Rust does is a far better way to handle the concept of null values that doesn't encourage unsafe code.
>>
>>47025632
thank you very much for the information anon.
>>
>>47025641
That makes sense, thanks for the tip anon.
>>
>>47025640
Well, guess you're right. C# format gestapo approves. On a related note, the trailing newline at the end of files makes me twitch. The first thing I do when creating a new file is deleting that pesky newline :D. Am I autistic?
>>
>>47025313
Because functional programming is highly overrated. Default immutable data structures are extremely, and I mean extremely fucking insanely overrated.
>>
>>47025421
Tried that, didn't move
>>
>>47025691
all I know is that github shows an ugly icon if you don't put the bloody newline, so I put it there :/
>>
>>47025707
whats your html?
if they're divs, they should flow on a new line
>>
>>47025707
If something doesn't flow correctly if it should then it's generally the style of the parent element denying it.
>>
File: question cat 1.jpg (48 KB, 365x444) Image search: [Google]
question cat 1.jpg
48 KB, 365x444
/dpt/ what do I need to know in order to create a project that can be worked on by a team of people (myself included)? I figure UML may be a requirement but I'm completely in the dark, me and the rest of the people already know source control and the programming language were working with but not how to map a project out.

I figure that I'll need to read some book on proper design so that I can devise some kind of roadmap and project skeleton but I've never done this before, I've only ever written my own software and it's usually done without structure ahead of time (implement first, refactor later).

Any suggestions or advice for this?
>>
>>47025702
Rust isn't Haskell. It has functional programming features but never at the cost of practicality. Typing "mut" when you need it is very easy, and it both catches errors and makes things easier for the optimizer.
>>
hmmm
by my count, e621.net has approximately 665GB of images.
I wonder how hard it would be to download them all
>>
What's everyone's favourite Java/C++ IDE?
>>
>>47025928
I use Code::Blocks. I might switch to Lime Text or Qt Creator though because they both look pretty cool.
>>
>>47025928
IDEA
eclipse has its perks (it can do literally everything with a gui), but its ridiculous how complex it gets. and forget upgrading / migrating, you might as well ship your entire eclipse install as a dependency.
>>
>>47025805
this cat has some highlevel quest for me, I'm 27, anyone knows when I can turn it in?
>>
File: gentoo-tornado.png (181 KB, 1146x1200) Image search: [Google]
gentoo-tornado.png
181 KB, 1146x1200
>>47025498
Here's your native multiplatform attempt, pic related is output of
./tornadoimage gentoo.png gentoo-tornado.png
:
program TornadoImage;

{$mode objfpc}{$H+}

uses
Classes, SysUtils,
fpImage, fpReadJPEG, fpWriteJPEG, fpReadPNG, fpWritePNG;

const
DefaultDivisions = 20;

var
SrcImage, OutImage: TFPMemoryImage;
i, DivHeight, DivWidth, x, y, x2, Divisions: Integer;
begin
if ParamCount < 2 then
begin
Writeln('USAGE: tornadoimage src out [divisions]');
Writeln(' src Source image file (jpeg, png)');
Writeln(' out Output image file (jpeg, png)');
Writeln(' divisions Number of vertical divisions to make');
Halt(1)
end;

SrcImage := TFPMemoryImage.Create(1, 1);
SrcImage.LoadFromFile(ParamStr(1));

OutImage := TFPMemoryImage.Create(SrcImage.Width, SrcImage.Height);

if ParamCount < 3 then
Divisions := DefaultDivisions
else
Divisions := StrToInt(ParamStr(3));

DivWidth := SrcImage.Width div Divisions;
DivHeight := SrcImage.Height div Divisions;

for i := 0 to Divisions - 1 do
begin
x2 := 0;

for x := DivWidth * i to SrcImage.Width - 1 do
begin
for y := i * DivHeight to (i + 1) * DivHeight - 1 do
OutImage[x2, y] := SrcImage[x, y];
Inc(x2)
end;
for x := 0 to DivWidth * i - 1 do
begin
for y := i * DivHeight to (i + 1) * DivHeight - 1 do
OutImage[x2, y] := SrcImage[x, y];
Inc(x2)
end
end;

OutImage.SaveToFile(ParamStr(2));

SrcImage.Free;
OutImage.Free
end.
>>
>>47025805
Yeah document the functions and structure out on a whiteboard before you start, add more later. Every project ever at work turns to a clusterfuck because no one knows how the other parts work.
>>
>>47026200
disgusting
>>
>>47026200
what language is this?
>>
>>47026250
Free Pascal
>>
even: math
odd: python notebooks for scikit-learn
>>
>>47025313
Those are the reasons why i DON'T use Rust, except for the first one.
>>
I'm working on some integer arithmetics in java. I have to multiply an integer by an another digit. But the integer is not an integer, it's an array where the position [0] stores the units, [1] the tens, [2] the hundreds, etc.
For example, 533 would be number[0]=3 number[1]=3 number[2]=5.

I cant seem to find why my code isn't working, tho. I get an ArrayIndexOutOfBoundsException error.

public int[] multByDigit(int[] number, int digit) {
if (number.length==1 && number[0]==0 || digit == 0 ){
int[]result = new int [0];
result [0] = 0;
return result;
}
else{
int[]result = new int [number.length +1];
int carry = 0;
for (int i = 0; i< result.length; i++){
int multi = number[i]*digit;

if (multi>9 && i<number.length){
String temp = Integer.toString(multi);
int[]tempmulti = new int [2];
tempmulti = fromString(temp);
result[i] = tempmulti[0] + carry;
carry = tempmulti[1];
}
else if (multi>9 && i==number.length) {
String temp = Integer.toString(multi);
int[]tempmulti = new int [2];
tempmulti = fromString(temp);

for(int j=0; j<tempmulti.length; j++){
result[i]= tempmulti[j];
i++;
}
}
else if (multi<10){
result[i] = multi;
}
}
return result;
}

}
>>
>>47023148
Trying to implement a binary tree in Go.

func (n *Node) insert(value int) {
if n == nil {
n = &Node{value, nil, nil}
...


Why is the node data lost after the program returns from the insert function even though the parent node holds the pointer to it?
>>
I understand the difference between an interpreted language and a compiled language, but what are the different use-cases for each? As in, why would you use a compiled language over an interpreted one for a certain program, or vice versa?
>>
>>47026397
Compiled: Performance
Interpreted: Neat tricks
>>
>>47026397
Compiled languages are usually faster.
>>
>>47026377
>integer multiplication
>code sprinkled with integer to string conversions and string splitting

This isn't how you multiply arbitrarily long numbers.

Also, learn to use debuggers. I'm 100% sure a good debugger will reveal the source of your problem in less than five minutes.
>>
>>47026377
didn't go step throught your algorithm completely, but the i++; inside the second
else if
looks like the most likely culprit. After that loop i = i + tempmulti.length, even if that's bigger than number.length.
>>
>>47026412
>>47026422
I guessed as much, is that pretty much the only reason?
>>
>>47026377
Change

int[] result = new int[0]

to

int[] result = new int[1]
>>
>>47026454
With a compiled language, some programming errors can be caught during compile time rather than only at runtime.
>>
>>47026454
today there's not much difference
you could say javascript is an interpreted language, but it really is just compiled on the fly (known as JIT compilation)
in general, compiled languages should be faster, as the compiler can analyse the entire program, as opposed to the limited view an interpreter gets.
>>
>>47026454
There are lots of little reasons, but performance is the biggest reason to use a compiled language.
E.g:
Less memory consumption (especially without GC)
Has an actual ABI that other languages are able to use

but there isn't actually a huge amount that is inherently different between compiled and interpreted.
>>
Thank you for using an anime image.
>>
>>47026439
Yeah i think i'm doing it wrong. Care to elaborate a little how i should properly do it?

>>47026458
Oh yes, i didn't see that one. But the program doesn't crash there, it says it crashes in
int multi = number[i]*digit;
>>
>>47026385
Are you sure n is nil in your test? Can you post the full program?
>>
>>47026544
(albeit bastardised)
>>
/dpt/ please, I'm a total noob. When I load a program in Win32dasm I can search for and find a certain string used by the program. But when I load the program in IDA pro and search for the string in the subview I get no results. What could be the cause?
>>
>>47026568
Yes. Root is nil and a new node is created, but after the function returns root is nil again.

package tree

type node struct {
Value int
Left *node
Right *node
}

type Tree struct {
Root *node
}

func NewTree() *Tree {
return &Tree{}
}

func (t *Tree) Insert(value int) {
t.Root.insert(value)
}

func (n *node) insert(value int) {
if n == nil {
n = &node{value, nil, nil}
} else {
if value == n.Value {
return
}
if value < n.Value {
n.Left.insert(value)
} else {
n.Right.insert(value)
}
}
}
>>
>>47026544
why would you thank someone for that?
>>
>>47026716
He's trying to get a reaction out of someone, a person typically says "thanks for using the X image" or "thanks for not using the X image" in these threads because there are a few images that are standard and a lot of people like or dislike at least 1 of them, by making these comments they're almost guaranteed to annoy someone.

/autism
>>
>>47026375
You just like making your own life difficult?
>>
File: here.jpg (59 KB, 526x433) Image search: [Google]
here.jpg
59 KB, 526x433
>>47025740
Here is my HTML
>>
>>47026831
No, i like manual memory management.
Fuck your babby shit. go back to Python.
>>
>>47026637
You surprised me with the fact that you can actually call methods on nil as long as the type is right and the method does not use any type.
I think I found your problem:
http://play.golang.org/p/Ed2leUZnXJ
>>
>>47026926
*Does not use any values of the type
>>
>>47026903
Rust has manual memory management if you wish to use it you moron. You don't even know about the language you're attacking
>>
>>47025336
Doing it one line with python.
string = input('Word?\n')
for subMatrix in [[string[i+j-len(string)].upper() for j in range(len(string))] for i in range(len(string))] : print('{0}'.format(''.join(subMatrix)))


INSTALL GENTOO
NSTALL GENTOOI
STALL GENTOOIN
TALL GENTOOINS
ALL GENTOOINST
LL GENTOOINSTA
L GENTOOINSTAL
GENTOOINSTALL
GENTOOINSTALL
ENTOOINSTALL G
NTOOINSTALL GE
TOOINSTALL GEN
OOINSTALL GENT
OINSTALL GENTO
>>
>>47026637
I might be wrong here but your Tree is pointing to a nil pointer, when you add an actual node in it's place the Tree does not update this.

That is the best I can guess from playing around with it a bit. Can you try changing it in to a
type Tree struct {
Root node
}


Kind of structure?
>>
>>47025702
You know what's even more overrated? Default mutable data structures.
>>
Is tornado text the mostest epickest newest memest on /dpt/?
>>
>>47027031
>one line
>is actually two lines
Step up nigga.
(defn tornado [s] (clojure.string/join "\n" (for [i (range (inc (count s)))] (->> s cycle (drop i) (take (count s)) (apply str)))))
>>
>>47026926
You're right. I guess the node is destroyed at the end of the function. Fortunately one can return a newly allocated struct:

return &node{value, int, int}


I have to change my function so it returns a node pointer and assign it somewhere else. Thanks for the help.
>>
>>47027183
*that should be nil not int
>>
>>47027155
Don't forget images, have a web:
http://massive.faggotry.org/tornado/
>>
>>47023310
>Not bashing Python
>2015
>>
I've opened in window using Xlib, now i need efficient read/write access to the window's framebuffer.
How do i do that?
>>
Using C#/xna, trying to get a simple save/load system. Seems I can use some built in stuff with xna, but it uses

using Microsoft.Xna.Framework.Storage;


When I try it, nothing found. I've made sure I'm using xna 4.0, my .csproj file contains 4.0 rather than prior version references, and if I type in

using Microsoft.Xna.Framework.


I get the auto complete options for audio, content, design, gamerservices, graphics, input and media. But no storage.
>>
>>47023310
Python is a terrible joke, it's more complex than C while being orders of magnitude slower.
>>
>>47027564
Storage for what?
>>
>>47024151
I'm new to C++, what's wrong with that?
Why use
using std::cout;
instead of
using namespace std;
?
>>
>>47026903
hahahaha. you clearly have no idea what rust does or how it gets rid of those issues. you spend just as much time thinking about memory, since you seem to be a masochist; the only difference is that rust implements certain compile-time checks to make sure you're not using memory in a way that could potentially be unsafe. go back to your babby c shit, enjoy your built-in security issues causing 99% of huge security meltdowns
>>
>>47027619
Personal preference on coding styles, it shows intent better if you include namespaces.
>>
>>47027611
I can't find it in the using statement.
>>
File: Untitled.png (124 KB, 1542x840) Image search: [Google]
Untitled.png
124 KB, 1542x840
>>47026631
Anyone got any suggestions with this?
This is what both windows show.
I can't find the string in Ollydbg either. I don't get why other decompilers can't decode these strings.
>>
>>47024801
Use "using" instead of a typedef.
>>
I have a noob question about SQL databases. I wanna build a flash card app. My model is simply that there are chapters which have a list of questions. A question also can be learned(boolean value) and has other values(not relevant for the question)
In my SQLite database, I've created two tables: one for the chapters and and one for the questions. In the question table, every question has a reference to the id/ primary key of it's chapter.
My question: I wanna know if a chapter has still unlearned questions left (boolean value, would be false if question in the sqlite database with the id of the chapter is learned)
What is the most efficient way to do that? My first guess and the most straight forward way was to do a query on the questions table asking for questions with a certain chapter id and unleared =0, and check if the returned cursor has at least one row. But a whole query for a single boolean value might seem a bit overkill. Would it be better to store the boolean value (wether there are still unlearned questions left) in the chapters table and update it whenever questions get learned/ unlearned?
Thanks for the help
>>
>>47027174
I can't do it one line. I tried to add the input into the for loop, but it doesn't work.
But again, I wonder how much lines the apply function have :3

Your language is neat. Is that LISP?
>>
>>47025573
>using var in a language with static typing
Disgusting.
>>
>tfw no one forks your repo
it hurts
>>
File: BeWfQJF.png (158 KB, 1178x1062) Image search: [Google]
BeWfQJF.png
158 KB, 1178x1062
Just having fun with the latest thing

Also fuck you >>47027746
>>
>>47027746
I'll bite. So you'd rather type:
Bitmap image = new Bitmap(..)
Dictionary<string, Rectangle> dict = new Dictionary<string, Rectangle>()

than
var image = new Bitmap(...)
var dict = new Dictionary<string, Rectangle>()
>>
>>47027805
I love type inference.

typealias InnerFunction = ([Int]) -> Int
let doSomething3 = {n in {$0.reduce(n) {$0 + $1}} as InnerFunction}

let cur = doSomething3(10)
cur([1, 3, 4]) // 18
>>
>>47027805
Yes, because those dynamic variables can cause unexpected behavior.

I'm not against duck typing, but I don't think it should be used that extensively in C#. Only for creating very simple data structures like:

var student = {name: 'studentName', age: 24} ;
>>
>>47027786
Is this some kinda disgusting swift shit?
>>
>>47027936
Yes.
>>47027872
Is also Swift.
>>
>>47027872
>as InnerFunction
:^)

Yes, it's great. >>47025336 is only a tiny method, but you can also write much larger piece of code in F# without every specifying a single type. And when you need to do so, it can enough to use type annotation on a variable in one location only and it will automatically propagate. Magic.

>>47027905
>what is type inference
There's nothing dynamic about using var... Even in your case (creating an anonymous class), the compiler takes care of everything. No runtime penalty at all.
>>
>>47027715

IDA Pro's auto analysis probably didn't find it, maybe due to lack of it being referenced in a context where IDA could tell it's a string.

If you know what address it should load at (through another tool, manually, or searching for it in IDA as a series of bytes), then you can go to that address and mark it as a string yourself.
>>
>>47027745
It's Clojure. 99% Lisp.
>>
Are lambda expressions in java just a fancy name for a local method within a method?
>>
>>47027957
If you want to really want to test Swift type inference you can do.

let doSomething3 = {n in {($0 as [Int]).reduce(n) {$0 + $1}}}
let cur2 = doSomething3(10)
cur2([1, 3, 4])


From [Int] it can infer the types of everything else.
>>
>>47027905
The var keyword doesn't mean the variable is dynamic. With the var keyword the compiler figures out the type for you. The variable behaves the same as if you specified the type explicitly. So this won't work:
var a = 3;
a = "hello";


If you want real dynamic types you must use the dynamic keyword:
dynamic a = 3;
a = "hello";
>>
>>47028039
What does the code do?
>>
>>47028073
Adds 10 + 1 + 3 + 4
>>
>>47023148
Okay /dpt/, let's see if I understand iteration and recursion.

class Factorial {
public int iterFact(int num) {
int fact = 1;
for(int i = 1; i <= num; i++) {
fact *= i;
}

return fact;
}

public int recurFact(int num) {
if(num == 1) {
return 1;
}
int fact = num * recurFact(num - 1);

return fact;
}
}

In the iterative function, the value is computed by simply increasing i by 1 until 1 > 5.

In the recursive function, the value is computed by the function calling itself with an argument 1 less of what it was called with last time until it is passed an argument of 1, at which point the return chain begins.

Say I passed a value of 5 into the recursive function. It goes like this:
fact = 5 * f(4)
fact = 4 * f(3)
fact = 3 * f(2)
fact = 2 * f(1)
The recursion now stops as the function has been passed a value of 1. The caller is returned 1 and the chain can now resolve:
fact = 2 * 1 (2)
fact = 3 * 2 (6)
fact = 4 * 6 (24)
fact = 5 * 24 (120)
120 is returned at the highest level.

Am I understanding this correctly?
>>
>>47027973

Also I just realized that your other tool is talking about resource IDs, those strings may be defined in a resource, which IDA doesn't load by default, and may not automatically resolve and determine to be a string even when it does.
>>
>>47027973
Thanks.
Kind of disappointed that neither IDA nor olly show the string, whereas a much older program like win32dasm does. Guess I'll keep using w32dasm along with IDA and olly to determine the string locations.
>>
>>47028116
yeah m8
>>
>>47028123
>those strings may be defined in a resource, which IDA doesn't load by default, and may not automatically resolve
Interesting. Is there a way to load them in IDA?
>>
>>47028080
>>47028039
let doSomething3 x list =
list
|> Seq.reduce (+)
|> (+) x

let cur2 = doSomething3 10

cur2 [1; 3; 4]

One less type annotation than your code :P
>>
>>47028116
basically, but understand you are recursing with the stack, if you recurse too deep (try recursive bucket fill e.g.) the computer will get upset
>>
>>47028148

Chances are, it's not a particularly important string to the code you're reversing, if IDA isn't finding it in auto analysis. Once you find it as a series of hex bytes, cross reference and/ot set a breakpoint on access and debug to see if it's ever used.

Your example string looks like a library error message that might not even be relevant in this program.
>>
>>47028164

Yeah, when you load up a file in IDA, there is a check box for loading resources.
>>
>>47025805
You can't possibly come up with good design upfront if you have never tackled anything like the problem before. You should have a lead programmer do what you did alone. After a good structure suggests itself from the prototype code you can start bringing over other programmers.
>>
>>47023310
Idunno anon i like python.
>>
Hi /dpt/ what is your opinion on sites like elance/topcoder. Have you made money on them?

Is it even worth your time, I'm a CS student who wants to gain some experience while making some money on the side doing programming related stuff.

I'm inexperienced and generally apprehensive about anything related to "making money online". Thanks in advance.
>>
>>47028199
>>47028213
Brilliant. Thanks anon.
>>
public static String tornado(String s) {
if (s == null) {
return null;
}
return Stream.iterate(s, cs -> cs.substring(1) + String.valueOf(cs.charAt(0)))
.limit(s.length())
.reduce((o, n) -> o + "\n" + n)
.orElse("");
}
>>
>>47028191
>basically, but understand you are recursing with the stack, if you recurse too deep (try recursive bucket fill e.g.) the computer will get upset
Is that because each time the function is called, memory is allocated for a new set of variables on the stack and only deallocated once the recursion stops?
>>
>>47023148
A* pathfinder that runs on a mesh of convex shapes, pretty ez
>>
>>47027732
>Would it be better to store the boolean value (wether there are still unlearned questions left) in the chapters table and update it whenever questions get learned/ unlearned?
No. It's a relational database; store the base information where it belongs and try to only store it there. In this case, whether there are questions left is a derived fact; with appropriate indices, it's computable cheaply from the things that you already have. Keeping derived information around just makes for trouble ensuring that the derived information is correct (a suitable trigger on the question table could do it, but it's unlikely to be a problem unless you've got a much larger DB than your example would justify).

And don't think in terms of having a query that returns a boolean, but rather a query that returns a collection of things which the boolean can be derived from. For example, you could return the list of chapters that still have unanswered questions, or return a list of chapters with the count of answered questions and the total number of questions for each chapter in the row data. All sorts of possibilities.
>>
>>47028329
Oh, and it's in Lua
>>
File: 1424479231624.jpg (24 KB, 396x353) Image search: [Google]
1424479231624.jpg
24 KB, 396x353
All i want to do is open a window and write to it's framebuffer.
Why is Xlib making that so fucking hard for me?
I must be doing something terribly wrong here, how do i get efficient direct access to the window framebuffer?
>>
>>47028363
use sdl nerd
>>
>>47028289

I was just happy to run across someone on here doing some reverse engineering. Definitely pick up and read Practical Malware Analysis and The IDA Pro Book if you haven't already.
>>
>>47028373
>INSTALL ALL THIS FUCKING BLOATED SHIT TO MANIPULATE A FUCKING FRAMEBUFFER HURRRRRRR.
Why don't you fuck off, there's a reason I'm doing this with pure X, efficiency is most important here.
>>
Will there ever be a programming language where you don't have to fight against it to do anything beyond the basics?
>>
>>47028419
No.
>>
>>47028419
That would be too easy.
>>
>>47027786
This one is nice. The tornado text have a space at the end of the original string, so it's more aesthetic and the bottom line even have the full sentence.
FIZZ BUZZ
IZZ BUZZ F
ZZ BUZZ FI
Z BUZZ FIZ
BUZZ FIZZ
BUZZ FIZZ
UZZ FIZZ B
ZZ FIZZ BU
Z FIZZ BUZ
FIZZ BUZZ
>>
>>47028419
There is no programming language in which you're not a lazy dumbfuck faggot.
>>
>>47028395
>pure X
>efficiency
choose one.

If you want efficiency you should use drm and bypass X entirely.
Thread replies: 255
Thread images: 24

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.