[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: 34
File: daily programming thread2.webm (2 MB, 600x338) Image search: [Google]
daily programming thread2.webm
2 MB, 600x338
old thread: >>54484471

What are you working on, /g/?
>>
>>54497019
First for D
>>
File: 1451754656609.png (14 KB, 418x359) Image search: [Google]
1451754656609.png
14 KB, 418x359
>>54497019
Website in Python/Django

A tourist hub for 3rd world countries
>>
>>54497028

I've had DMD installed for forever. I should probably start Ding it up.
>>
>>54497028
How non free is the backend for DMD?
>>
>>54497074
Writing literally the same function twice doesn't seem very dry to me, but maybe I'm just too used to dynamically typed languages.
>>
>>54497019
Should I receive like this?
    for (int i = 0; len != 0; ++i)
{
if (i == 511)
buf = malloc(sizeof(buf) + 512);

len = recv(sfd, buf + i, 1, 0);
printf("%c", buf[i - len - 1]);
}


Or should I receive in larger chunks?
What is the standard receive loop dogma?
It's for an irc bot.
>>
>>54497019
a music tracker for avr microconrollers
and NO im not using arduino
>>
>>54497083
Don't forget your dubs
http://code.dlang.org/
>>54497096
I have no idea desu
>>
>>54497131
All recv variants have a peek mode which returns the exact buffer size that would be needed to store the next packet.
>>
Low-level network programming is best programming
>>
If I wanted to make graphical applications for both pc and mobile with my favorite obscure language than compiles C how should I do it?
https://github.com/bkaradzic/bgfx
My idea is to use bgfx which is cross platform renderer that has C api and I would init the application with bgfx and implement the rest with the other language.
Use build tools provided by bgfx to compile to every platform.

got any better idea?
>>
>>54497217
sdl
>>
>>54497217
SDL. It compiles to pretty much anything. Seriously, its headers are branches of macros asking about your instruction set, OS, etc
>>
>>54497217
Your favorite obscure language that compiles to C generates totally portable code? Then it will work. There's a chance your favorite obscure language is platform specific though. I know mine uses some platform specific machine code and libraries. What language?
>>
File: 20150730185217_big.png (559 KB, 1000x892) Image search: [Google]
20150730185217_big.png
559 KB, 1000x892
Yay, I finally ordered my file server (pic related).
In order to access my files remotely, I want to build a web based file manager. Kinda like ownCloud, but without the bloat. No JS and ideally no CSS. It should be doable in a short period of time, but I'm lazy as fuck.
>>
>>54497131
You keep receiving until you have found \r\n, if you received a bit more, you chop it off and leave the extra stuff in a leftover buffer for the next packet.
>>
>>54497217
>https://github.com/bkaradzic/bgfx
Looks like a ghetto SDL. Use SDL. It's most likely better supported than some god-forsaken github page. Also obviously you'd write your code in OpenGL.
>>
What's the best c++ compiler, guys?
>>
>>54497385
msvc
>>
>>54497385
clang for error messages
gcc for optimization
>>
>>54497407
>being too much of a bitch to read gcc error messages
>violating your freedom
>allowing apple to do its eee shit
>>
>>54497385
Clang has a better performance, a world-class optimizer, the best error messages, and a very active community involving developpers and researchers.
GCC has old unix neckbeards that will yell at you if you report a bug.
>>
>>54497297
that's pretty cool, senpai. good luck
>>
>>54497385
its a not-so-secret industry secret that the intel compiler is one of the fastest in the world right. A lot of games and performance-critical software uses it.

You can see it in action here
https://gcc.godbolt.org/
>>
File: haskell-fb-industry.png (1 MB, 1128x1080) Image search: [Google]
haskell-fb-industry.png
1 MB, 1128x1080
>>54496785

/fpg/: functional programming general
>>
>>54497488
>https://gcc.godbolt.org/
Thanks! I plan on learning Assembly and this is gonna be useful as fuck
>>
File: books.jpg (1 MB, 2560x1536) Image search: [Google]
books.jpg
1 MB, 2560x1536
What /g/ books are you reading?
>>
File: 0673999866.jpg (162 KB, 500x648) Image search: [Google]
0673999866.jpg
162 KB, 500x648
>>54497545
>>
which one should i use to print strings with a \n

code A:
printf("this is just a test!\n");


code B:
puts("this is just a test!");


Also, which one is faster?
>>
>>54497297
>No CSS
That's just going to be gross if you do that. You can have CSS without the bloat. Just don't use a framework.
>>
>>54497488
It's good for intel CPUs because it probably has optimized codepaths for intel-specific machine code.
>>
>>54497297
You can use C as a backend if you're really into speed and minimalism
>>
>>54497593
They're both as fast, the difference is negligible.
You should use printf just for consistency. puts is fine too, but it will give people a pause for a second.
>>
>>54497297
directory listing + upload links. Wew lad.
>>
File: 1461024237041.png (170 KB, 930x436) Image search: [Google]
1461024237041.png
170 KB, 930x436
>>54497622
>>
>>54497655
gtfo pajeet, no one likes your kind
>>
File: f.png (6 KB, 277x123) Image search: [Google]
f.png
6 KB, 277x123
a few years ago i built a primitive python bot that uses the shodan api to find ip cams with default/weak passwords. recently revisited the project and managed to collect thousands of unprotected camera ips and credentials. today i was going through some of them and found this. someone added their credentials to some (a hundred at least) ip cameras.
for those who don't know, "fsociety" is an Anonymous like hacker group in the tv show Mr. Robot.
nothing to share about the code itself, it's pretty straightforward honestly. but i found this mildly cringy and thought i would share.
>>
>>54497475
Thanks senpai. I'll post a vid once I get the basics working.
>>54497599
I initially wanted to use bootstrap because muh ease of use, until I followed the tutorial. Yeah, I should at least make up the HTML table.
>>54497622
Go is fast enough and has HTTP2 support.
>>54497635
Kinda like that. My goal is to implement the following:
- Listing
- Uploading by URL
- Uploading as multipart
- Removing
- Moving
- Managing torrent feeds
>>
>>54497715
Go is a meme language though
>>
>>54497693
Calm down, /pol/, you're getting all euphoric again.
>>
>>54497717
Go is far from perfect, but it's the language I'm most comfortable in a project like this.
>>
What is the purpose of using a sentinal node with doubly linked lists? versus having front and tail?
>>
>>54497693
I haven't seen even one, but tell me more how people who pray to toilets have tech jobs in your country. have many designated streets have you crossed today?
>>
>>54497746
*how
>>
>>54497746
I live in rural UK. The devs here are 99% white
>>
>>54497737
are front and tail enums? strings? objects??
>>
>>54497818
front and tail nodes (recursive data with nodes: previous, next)
>>
>>54497814
>rural UK.

You have a shotgun certificate, m8?
>>
As a meta question, what's up with /g/ and cross dressing? Why there are so many traps on this board especially?
>>
>>54494231

Anyone help?
>>
>>54497863
>shotgun certificate
>UK
he probably needs a spoon permit
>>
>>54497863
I don't even have a tv license m8, I'm an outcast here
>>
>>54497867
/g/ is full of literal faggots and pedos.
>>
>>54497867

All you are doing is asking them to post the its fun to program cross dressing shit.

Its a forced meme.
>>
>>54497893

You better get a few shotguns. After all, the muzzies are coming to wreck your country.
>>
>>54497894
Humanity has always been pedophile. Too bad Christianity banned it and took all the pretty boys away.
>>
>>54497931
took all the pretty boys for themselves*
>>
>>54497931
Gonna need to put some better bait on that Super Rod.
>>
>>54497946
yeah I bet you like bringing up my Super Rod
>>
File: sad alien.png (13 KB, 350x350) Image search: [Google]
sad alien.png
13 KB, 350x350
reposting because no replies

i want to learn common lisp, but the tool the book im following recommends, lisp in a box, is apparently a dead project. is there anything else like it still being maintained?

pls respond
>>
>>54497972
http://www.jonathanfischer.net/modern-common-lisp-on-linux/
lrn2ggl fgt
>>
>>54497203
But do you use formal methods?
>>
>>54497385
LLVM.
>>
>>54497297
You understand that you can use themes for onwcloud, don't you?
>>
File: 250px-098Krabby.png (47 KB, 250x250) Image search: [Google]
250px-098Krabby.png
47 KB, 250x250
>>54497964
Too bad the only thing you're catching with it is crabs.
>>
>>54497972
https://mitpress.mit.edu/sicp/
>>
>>54497385
GPCYP
>>
>>54498024
I do, but it's not only about the looks. It's riddled with functionality I'll never use, so I'd rather tailor make something for my need. [spoiler]It's just a project to kill time.[/spoiler]
>>
>>54498089
Yeah, I get it. Whatever makes you happy.

I wish I had the time to do stuff. Godspeed, anon.
>>
File: cl.jpg (12 KB, 195x245) Image search: [Google]
cl.jpg
12 KB, 195x245
I just got this in the mail today and have started going through it. It's actually pretty nice.
>>
Where can I find a good selection of programming e-books that isn't the virus infested gentoomen torrent? Decided to finally get myself a kobo and whack a load of them on it.
>>
>>54497426
they're shit as shit you have to google them just to find out what they could possibly mean

>>54497385
gcc

>>54497488
maybe for intel cpus but can it even compile arm at all
>>
File: 1462551396438.png (158 KB, 342x366) Image search: [Google]
1462551396438.png
158 KB, 342x366
Why do people claim that Go has all the drawbacks of C with none of the benefits?
>>
I'm currently studying Oracle PL/SQL but honestly it doesn't make that musch sense yet. Has anyone here ever worked with it and do you have advice on getting in to it?
>>
>>54497709
Hey mind sharing for the bot?
I want to learn python and that seem a nice "read".
>>
>>54498431
go has all the drawbacks of autism with none of the benefits
>>
>>54498431
Because they need OOP to hold their hands.
>>
>>54498009
but is there nothing along the lines of lisp in a box? this still looks like it requires configuring and im very much a beginner when it comes to lisp and emacs

>>54498035
>scheme
pls no

>>54498330
whats it like senpai? ive got an ass old book at uni im gonna borrow at some point but if i can get something more modern that would be great
>>
>>54498507
It's a howto, just follow the directions, line-by-line.
>>
File: 1455864189054.jpg (50 KB, 512x397) Image search: [Google]
1455864189054.jpg
50 KB, 512x397
So my spouse was working on a paper about Australia's Labour party and we were looking at their website.

They really want to encourage more women into programming and coding because muh "not enough women in STEM."

What is the end game of shoving a bunch of clueless women who don't WANT to be in STEM? What benefit does "balancing the gender" in these fields gives us?

I don't really see this even possible. Can't force people to be actually interested in a subject, let alone women with programming and coding.
>>
File: 1453308876622.jpg (152 KB, 1033x798) Image search: [Google]
1453308876622.jpg
152 KB, 1033x798
Okay so
    int len = recv(sfd, buf, 1, 0);

for (int i = len + 1; len != 0; ++i)
{
if (buf[i - len - 1] == '\r' && buf[i - len] == '\n')
{
buf[i - len + 1] = '\0';

printf("\nNEWLINE\n");
printf("Buffer contents: %s\n", buf);
}

recv(sfd, buf + i, 1, 0);
printf("%c", buf[i - len - 1]);
}


This detects newlines correctly, since it does print "NEWLINE" every time one is encountered, however, the "buffer contents" at that point are just a single colon character, when it should be the entire previous line up to the null-terminator.
What is going on?
This is so frustrating.
>>
>>54498507
It's really slow going and easy to take in. It's got a novice programmer in mind and you only need basic arithmetic skills.
Lisp is high level and is a good starting point. I'm a novice and I decided on it at the recommendation of a few Lain anons.
>>
>>54498571
I agree with what you're saying, How ever I am in college studying Software Engineering, Less than 10% maybe even 5% is female in my year... feels bad man...
>>
>>54498571
The thing is, there are some sperglords who discriminate against women and there are some oily greasy marketing subhumans harassing the secretery because they're just that clueless, and the reverse doesn't happen quite as much.

Now the problem is it's blown way out of proportion and hundreds of proffesional victims have jumped in to cash in on that STEM money. So now everything is awful.
>>
>>54498571
It means I can stare at breasts at work more often, and that's good enough for me
>>
I am making a GUI in Python

Is Tkinter good enough or should I use wx?
>>
>>54498571
>The Australian Labor Party is a democratic socialist party

That's why. It's the party of mental illness.
>>
>>54498571
>What is the end game of shoving a bunch of clueless women who don't WANT to be in STEM?
a small number of reasonably good female programmers who might not have bothered pursuing it otherwise, and an ocean of shit ones. 98% of whom will probably do nothing with the degree when they realise they both hate the work and suck at it, and 2% who will be industry deadweight.
>>
yo I'm trying to setup an ocaml environment so I created
~/.ocamlinit
and stuck these lines in it :
#use "topfind"
#thread
#require "ppx_jane,core.top"
#require "async"
#require "core_extended"
open Core.Std

but when I start utop it keeps telling me that core is an unbound module, any idea what I should do ?
>>
>>54498507
>lisp in a box
What about LispBox? Looks like there's a github project for that.
>>
>>54498635
Qt5
>>
>>54498518
ill try

>>54498662
thats it i think, but the projects completely dead, last commit was almost 6 years ago

>>54498605
im looking to learn lisp out of frustration with python, and i hear lisp is pretty much the perfect language if you use it right and dont fall into bad design and programming habits
>>
>>54498674
Seconding this.
>>
>>54498682
Yes. I'd start with it.
>>
>>54498571

There are people who only have a job to do by finding a problem anon.

Also saturation of labor in the field keeps pay lower.
>>
>>54497019
How is this anime called?
>>
>>54498718
It's called "Google Reverse Image Search", you might have heard of it.
>>
>>54498682
>last commit was almost 6 years ago
Ah, I see. If you're not that into Emacs, there's lisp stuff you can get for Vim that I hear is really good. There's tutorials for installing the swank server and all that jazz so I don't think it'd be *too* hard to do it yourself if you can't find an immediate replacement for lisp in a box.
>>
>>54498716
There's no saturating the programing labour market. There's always high demand for *good* programmers, and companies have always complained that they can't find enough of them as long as the industry existed. Maybe it can be saturated for enterprise tier projects, but if you're otherwise half decent you'll find work pretty easy.
>>
>>54498782
>companies have always complained that they can't find enough of them

This is a blatant lie.
They're out there and jobless, the industry doesn't want to pay them a livable salary anymore, so they turn to imported pajeets and "women in STEM" to flood the market and drive down wages to minimum wage.
>>
>>54498689
>>54498674

Looks like some web 2.0 shit.

I just want a functional native-look GUI.
>>
>>54498635
Kivy
>>
>>54498825
>They're out there and jobless
LOL. Because they are shit. This is the only reason.

Women programmers are not viable replacements for good programmers.
>>
>.cpp or .cc
>.h or .hpp
>>
>>54498881
>.cpp
>.h
>>
>>54498832
How the fuck do you equate Qt — a respected 20 year old C++ library with bindings in every language — with webdev crap?
It is native looking by default, but actually you can choose what style you want programatically, there are several.
>>
>>54498674
has it changed a lot since Qt 4? I'm reading "Introduction to Design Patterns in C++ with Qt" which uses Qt 4 and I'm wondering if it isn't obsolete. I have no idea why this book was even written, but it's surprisingly good
>>
>>54498933
It has modernized, but not radically changed. Generally porting Qt4 code to Qt5 is pretty much automatic, but there are better way to do things now.
>>
File: eva.jpg (39 KB, 570x415) Image search: [Google]
eva.jpg
39 KB, 570x415
I think it's better to ask this here.

What is used to write console applications apart from ncurses? I can write simple stuff that writes lines into the output, but I can't figure out how to write applications that can refresh lines without creating a new ncurses-like window. I mean things like wget/curl progress bars.
>>
I'm using matlab for some image processing (school stuff).

I think it's pretty neat how easy it is to work with matrices and how fast it computes operations on huge matrices.

However I have a problem. It may be real easy but I'm a beginner so please bear with me. Working with the values in a matrix is easy and fast, but how about working with the indices of the matrix? Let's say I want to apply a function to the position of each pixel of an image that maps it to a new position based on its current position? How do I do this without resorting to loops? I'm looking for the most intuitive way. Thanks!
>>
>>54499558
VT100, google it.
Basically you send special characters to the console, and it interprets it as commands to move the cursor or change the color.

Of course it doesn't work on hardware older than a VT100 or software that doesn't support it, which is practically nothing.
>>
>>54499558
'\r' to carriage return and overwrite the current line

There, that's all the interactivity you need to draw a progress bar.
>>
What's wrong with this code?
(I'm learning)
#!/usr/bin/python

#Pick a rule
rulepick = input("Pick a rule from 1, 2, or 3. \n 1. y = 5x+2 \n 2. y = x+3/2 \n 3. y = 10x+1/9 \n")

#---------------Applying and Displaying Coordinates----------------
if rulepick in ["1"]:
x = input("choose a number for x 1-100 \n")
y = x*5+2
print ("("x","y")")
exit()

if rulepick in ["2"]:
x = input("choose a number for x 1-100 \n")
y = x+3/2
print ("("x","y")")
exit()

if rulepick in ["3"]:
x = input("choose a number for x 1-100 \n")
y = x*10+1/9
print ("("x","y")")
exit()
#-------------------------------------------------------------------

#Informing user of recognized command and aborting.
if else:
print("Unrecognized command. Enter 1, 2, or 3 when choosing a rule. Exiting.")
exit()
>>
>>54499718
It's python
>>
>>54498571
just the usual those types do.
fuck people over by convincing them its whats best.
>>
>>54498507
>scheme
>pls no
Shit taste detected. CL is far more icky and hacky than Scheme and even CL fans acknowledge that.

>>54498781
SLIMV is prone to crashing and murders vim performance which is almost impressive because it's a fucking text editor. Real solution is to use screen with one window being the source and the other the repl.

Screen is also easier to use than slimv.
>>
>>54500074
dont care, i want a flexible language, not a pure one
>>
>>54498881
.c & .h
.cpp & .hpp
>>
>>54499558
If you want to have the functionality to refresh lines etc, you might as well make a gui app.
>>
>>54498881
>>54500341
What are the best C++ file extensions?

http://www.strawpoll.me/10188261/
http://www.strawpoll.me/10188261/
http://www.strawpoll.me/10188261/
>>
File: wonderful_impurity.png (12 KB, 419x200) Image search: [Google]
wonderful_impurity.png
12 KB, 419x200
>>54500330
>implying scheme is pure
How did you get that conception? Pic unrelated to purity.

Fuck man one of the hallmark features of Scheme, call/cc, essentially demands impurity to fully use.
>>
>>54500384
Which ones does Bjorne Strousup use?
>>
>>54497019
Stop this programming fag meme.
>>
>>54500384
hpp seems redundant, unless you have c AND cpp files with the same name for some fucked up reason.
>>
File: image.gif (3 MB, 500x333) Image search: [Google]
image.gif
3 MB, 500x333
>>54497019
http://c-faq.com/decl/spiral.anderson.html

It finally makes sense.
>>
>>54500431

Stroustrup uses python.
>>
File: huehue.gif (1 MB, 480x270) Image search: [Google]
huehue.gif
1 MB, 480x270
>>54500562
>>
>>54500479
>http://c-faq.com/decl/spiral.anderson.html
it's a joke right

it seems to work but you can easily read it without going in a spiral
>>
>>54500422
>How did you get that conception?
the first page of a common lisp tutorial i read
>>
>>54497385
GCC
LLVM
>>
>>54498635
tkinter is good enough
>>
These three SQL queries are driving me insane for 3 days now, I would really appreciate if a SQL wizard could help me out

Pastebin (too long):
http://pastebin.com/yWLePqsG


I'm making them to use with https://gephi.org, basically I think the problem is in the first one.

Basically the idea is to "loop" through the posts and check which ones have "[quote=username]", then get the username inside that and check if I already have the data for the user, if I don't then I generate a random one.

Problem is that I'm getting all kinds of fucked up results in gephi like "label" from gephi_nodes being a negative number and not the username, duplicates etc.

Structure should be pretty easy to understand,
p for post
u for user
q for quote
t for thread and so on.
>>
>>54498917
>Qt
>bindings in every language
ask me how I know you're a webshit
>>
>>54500847
>in gephi like "label" from gephi_nodes being a negative number and not the username
and not the username inside [quote] tag

>if I already have the data for the user, if I don't then I generate a random one.
if I already have the data for the user, if I don't then I generate a random id because well.... the username I already have


small fixes
>>
>>54499608

>Which is practically nothing
Win32 doesn't do ANSI escape codes. It has its own special functions for colors, clearing screens, etc... which presumably are called by the Win32 port of ncurses.

Although that said, I have noticed that the escape codes do work on Windows if you use Ruby. I'm guessing the runtime is doing some translation behind the scenes, because you can't get the same effect out of a C program.
>>
>>54500850
Kek, I know the /dpt/ has never been the place for quality content, but you're really putting the bar low.

Sweetie, I know Qt because I'm a Sepples dev. If I did webdev I wouldn't be shitting on it.
Let's keep going, because you're actually pretty entertaining.
>>
>>54500874
>Win32
So, in the market for terminal applications, practically nothing ;^)
>>
File: French-Pistol-Ruby-M1915-right.jpg (1 MB, 1560x1320) Image search: [Google]
French-Pistol-Ruby-M1915-right.jpg
1 MB, 1560x1320
Also, not programming, but Ruby, did you know that you share your name with a pistol? French designed and Spanish built.
>>
>>54497385
>What's the best c++ compiler, guys?
Personally, I vote for LLVM/Clang. However, good code should compile regardless of the compiler. Using both will help you debug it more easily.
>>
>>54500847
when sql was invented i dont think this is what they had in mind
>>
>>54500887
go ahead, just ask
>>
>>54500954

fuck off back to hell tripnigger
>>
>>54500985
I just need to now, why are you even that mad at the webdevs anyways?
Sure, they're often incompetent JS-flinging hipsters straight out of bootcamp, but the level of upset here is just comical.

Feeling threatened by the left-pad crowd?
>>
Hey guys, how would you go about approaching a professor with an idea as a lowly undergrad? I'd like to discuss the merits of a thought I came up with (similar to already-existing ideas, but not exactly the same and those ideas aren't even popular anyway) and if it'd be worthwhile to pursue it, but I don't want to seem dumb.
>>
>>54500974
:^)
>>
How do I make emacs usable? Is it even worth it in 2016?
>>
>>54501043
Vi has an emacs plugin.
>>
>>54501007

No thanks.
>>
>>54501015
you can ask already
>>
>>54501015
>Sure, they're often incompetent
Such as yourself.
>>
>>54500954
the light of God is ruby and emerald.
>>
>>54501025
1) Walk towards said person
2) Say hi, do you have a couple minutes?
3) Try to hold on that overflowing pasta for a moment
4) Realize your professor probably has no clue and is – in fact – not the unfailing source of all knowledge.
5) Deal with the fact that if you can't even determine whether the idea could possibly be good, you won't be able to execute it right.
6) Give up
>>
>>54501091
>Such as yourself.
Oh yes, talk dirty to me! I'm almost offended :):):)
>>
>>54501137
>proudly oblivious of his own stupidity
Ok.
>>
>>54501125
>4) Realize your professor probably has no clue and is – in fact – not the unfailing source of all knowledge.
I know that, but they're still much more educated than me. Anything I say will sound fucking dumb no matter the way I put it.

>5) Deal with the fact that if you can't even determine whether the idea could possibly be good, you won't be able to execute it right.
Well, the idea seems good to me, but as an undergrad I don't really have enough experience to be able to say "Yes, this is a valuable novel idea which may hold interesting possibilities if explored" over "This is just an interesting idea but it's been done before/has serious shortcomings/has no use" or "This is an awful idea and completely misguided effort"
>>
>>54501179
What is your idea?

Inb4
>Muh ideaz, donut steel©©™©
>>
File: adminLogout.gif (268 KB, 300x230) Image search: [Google]
adminLogout.gif
268 KB, 300x230
>>54501176
Damn your really showed me there.
You must be such a smart person to judge random anons throught the Internet!
Tell me more ^__^ !
>>
>>54501225
A sort of extension/alternate version of predicate classes (if you don't know what they are, imagine an object being able to change its type at runtime based on fulfilling a condition).
>>
>>54501278
That's already something that exists, look up duck typing.
>>
>>54501519
It's not the same thing.
>>
>>54501278
Example? Is this like how numbers work in python?
>>
>>54501547
You might wanna explain yourself more then. As far as I understand you, totally is. In Scheme if I do:
(set! obj (list obj)

The type of obj gains another layer of the list type.
>>
>At CIA information session
>A few jobs actually interest me
>Find out I'm going to have to apply a year in advance
>They point out that if we're engaged in certain crimes right now like drugs (emphasize marijuana since this IS Washington), we need to stop doing so before applying.
>Figure this'll be easy since I've never smoked a joint in my life
>Also have to stop pirating

...

WELL GOOD THING I WAS PLANNING ON SWITCHING BACK TO LINUX THIS SUMMER ANYWAYS!
>>
>>54501862
>>Also have to stop pirating

There is absolutely no way they'll know you've engaged in piracy.

Good work on avoiding the degeneracy that is Marijuana, though.
>>
File: exploits_of_a_mom.jpg (59 KB, 600x185) Image search: [Google]
exploits_of_a_mom.jpg
59 KB, 600x185
for the lels
>>
>>54501862
It also means no more anime or pony porn because most of that shit is already of questionable legality in the US.
>>
>>54501877
>there is absolutely no way they'll know you've engaged in piracy
Bullshit for $400 please. If tripfag gets a security clearance they'll know. They probably won't give a fuck.
>>
>>54501924
>If tripfag gets a security clearance they'll know.

It depends what level of SC he gets.
>>
>>54501916
Wait, art is illegal in burgerland?
What the fuck is wrong with you people?
>>
>>54501862
the government takes money from hardworking americans to support spying and interventionist policies that do more harm than good. you really shouldn't work for them if you don't have to, what they're doing is neither right nor good.

the drug testing is just another red flag, napoleon laid out that only merit should go into hiring for government jobs, and only performance should be cause in losing the job.
>>
>>54501967
he's trolling, it's legal at the federal level
though it's explicitly illegal in places like the UK
>>
>>54501967
>art is illegal in burgerland?
>What the fuck is wrong with you people?

Are you shitting me? People in the UK have actually been convicted over illegal images of cartoon children. Even degenerate lolicon and shotacon are still 100% legal in the United States.
>>
>>54501916

Anime porn isn't illegal in any way, although most use might qualify as piracy. Pony porn is arguably fair use, since it's all fan art. Though some art in these areas may feature underage charterers, this isn't illegal federally because of Ashcroft v. Free Speech Corporation.

>>54501877

Yeah, but they will do polygraph tests, which is kinda weird (I asked why, since they're almost useless. They basically told me that the idea was "we don't rely on it, but it's one way of establishing trust.")
>>
>>54502062
>Yeah, but they will do polygraph tests, which is kinda weird

You'd better hope they don't ask if you'd like to fuck all the characters on MLP.
>>
>>54502062
>pony porn
I was thinking more along the lines of bestiality and not copyright violations which is more of a civil matter than anything else.

Bestiality is explicitly illegal in many parts of the US along.
>>
>>54502100
Well, not ALL of them...

>>54502111
Fucking horses: illegal in most states, not illegal federally.

Horse porn: not illegal. Not even with real horses.
>>
>>54500847
>tfw no replies
>>
>>54502154
You should become the next Mr Hands.
>>
>>54500847
why don't you simplify your queries and use a scripting language to do the result processing like you're supposed to do. what you have is completely incomprehensible to anyone but yourself.
>>
>>54499723
thank you
>>
>>54502478
>3 and a half hours to reply
God damn, python is slow.
>>
>>54497019
Hey guys!
I'm new to doing API and website shit. Is there a way I can get the most recent post data from a board?

I want to basically make a script that when run, takes the following info from the given board:
>Post body
>Post date
>Post number
And then saves it into a text file.

The saving into a text file is easy shit, but I don't know how to approach the actual "gather information" part.

Any tips?
>>
>>54497972
clojure
>>
>>54502634
Are you talking about 4chan's API?
https://github.com/4chan/4chan-API
>>
>>54502675
oh shit, we have an API?
well time to go fuck around and read the documentation I guess.
>>
>>54502687
faggot
>>
>>54497019
What's this from again? Can't find anything on Google.
>>
So /dpt/,

When you start a new project, how much time do you spend prototyping things and identifying data relationships on paper before actually coding the stuff?

Or do you code into your text editor immediately like what most Open Source losers do?
>>
>>54502806
About zero on paper, a little in my head. Since I don't do pure oop or abusively strict haskell, it's easy to modify data structures and relationships as things come up.
>>
 
void x (double **A, int N) {
int i, j, k;
for (k = 0; k < N; k++) {
for (j = k + 1; j < N; j++) {
A[k][j] = A[k][j] / A[k][k];
}
A[k][k] = 1.0;
for (i = k + 1; i < N; i++) {
for (j = k + 1; j < N; j++) {
A[i][j] = A[i][j] -
A[i][k] * A[k][j];
}
A[i][k] = 0.0;
}
}
}
>>
>>54497019
So whats the best way of making a gui. QT is shit but the only one Ive used before. Is there a better alternative. Im trying to make a game of solitaire here.
>>
>>54503170
>code indented at the same level as the function name
>>
>>54503323
for what OS?

if windows, probably WPF/winforms
if apple, you only have one choice
if linux, QT.
>>
>>54503323
Win32 is so much better than Qt
>>
>>54502806
all jobs are now about agile/scrum m8
>>
>>54503323
If you're making solitaire then you don't need buttons or anything outside of the topright exit button, so just use SDL.
>>
>>54503323
wtf just use a game engine or opengl wrapper
>>
>>54503531
>opengl
>solitaire
Nigga sdl blits are sufficient
>>
Has anyone ever tried generating music in C?
#include <stdio.h>
int main(void)
{
int i;
for (i = 0; ; i++)
{
putchar(
( (i * 9 & i >> 4) |
(i * 5 & i >> 7) |
(i * 3 & i / 0x400) ) - 1
);
}
}
>>
>>54503603

No, how does it sounds?
>>
>>54503636
Compile it and play the output.
like
./whatever | aplay

Or save the output to a file and play it as a WAV.
>>
>>54503336
void x (double **A, int N) { 
int i, j, k;
for (k = 0; k < N; k++) {
for (j = k + 1; j < N; j++) {
A[k][j] = A[k][j] / A[k][k];
}
A[k][k] = 1.0;
for (i = k + 1; i < N; i++) {
for (j = k + 1; j < N; j++) {
A[i][j] = A[i][j] -
A[i][k] * A[k][j];
}
A[i][k] = 0.0;
}
}
}

What does it do though?
>>
>>54503704
it looks like vector transformation
>>
>>54503663

Nice pattern

Care to explain?
>>
>>54503722
*2x2 matrix
>>
>>54503733
you're printing the first 7 bits of integer i to stdout through putchar().
at 8000hz, you can create sounds by fucking with the integer and doing bitwise ops on it.
I really don't understand it very well either.
>>
Trying out Cython
>>
Should I write my SQL queries in all caps?
I know they're not case sensitive, just as a convention thing.
>>
File: 1429573917586.jpg (68 KB, 700x700) Image search: [Google]
1429573917586.jpg
68 KB, 700x700
>tfw fell for the webdev

I'm earning bucks but not as happy
Trying to get back to my C SDL game engine

What do i do /dpt/ to get back on the game (kek)?

> K&R again?
> C++ (and OOP)?

Help plz
>>
>>54503784
yeah you gotta scream at that motherfucker to get it to work
>>
>>54503793
Make an OS
>>
>>54503793
Why do you not like webdev? Don't fall for the LMAO WEBDEV SHITTERS DRIVERZZ ALL DAY meme. The web is the future. Denying this is pointless.
>>
>>54500422
>>54500674
(define foo 1)
foo
;=> 1

(set! foo 2)
foo
;=> 2


Purely functional.
>>
>>54503822

I like it, but it's not as satisfying.
>>
>>54498431
Because of its broken type system

But Go does concurrency better than C, at least
>>
>>54502062
>since they're almost useless
Completely, 100% useless.
>>
>>54497019
What is the from fuuuuuuuuuuuuuuuuuug
>>
>>54503793
You get back to your C SDL game engine of course.

I'm working on my own C SDL (openGL Scheme) game engine too.

>>54503855
No shit. I posted impure code. I wonder whether (rotate) (draw_diorama), and (update_screen) are impure?
>>
>>54503770
first 8 bits*
>>
>>54503807

> my own temple OS

Ok i will give it a try
What books do i start reading?
>>
>>54502675
>>54502687
There's Racket bindings for it called yotsubAPI.
>>
>>54503953
>So I told him to make his own OS and he actually did it, the absolute madman!
http://wiki.osdev.org/Main_Page*

*Some assembly required
>>
>>54503942
Chill, dude. I was making a point to agree with you.
>>
>>54503942

But i feel that i've forgotten everything.

Thats why i thought that taking a smaller
project will refresh my memory.
>>
>>54503993
Fair enough. I was confused by ya quoting me.

>>54503996
Just do it piecemeal. Spend some time initially studying what you previously did.

Out of curiosity is it 2D or 3D? How much did you do?
>>
yea Qt is actually using mingw 4.9, im going visual studio 2015 version

is Qt in linux actually still on gcc 4.9?
>>
How do you compile a .cpp file using gcc?
>>
>>54504106

g++ *.cpp
>>
>>54504106
g++
>>
>>54503985

Thanks, do you have a more 'portable' resource?
>>
>>54504114
>>54504117
Yes sorry I meant g++

I'm austim
>>
>>54498718
>>54502780
>>54503939
Himegoto I think
>>
>>54504143
man g++
>>
is it possible to get someone's IP address from a 4chan post?
>>
>>54504164
I was running

gcc test.cpp -o test 


oops
>>
>>54504197
No, all traffic is routed through 4chan's servers so you would only see 4chan's IP.
>>
File: Cute!.webm (2 MB, 924x520) Image search: [Google]
Cute!.webm
2 MB, 924x520
>>54504130
Unfortunately no, I haven't actually done any OS development myself desu
>>
File: pairprogramming.png (198 KB, 640x480) Image search: [Google]
pairprogramming.png
198 KB, 640x480
>>54503704
Christ, they're still fucked up. Here.
void x (double **A, int N) { 
int i, j, k;
for (k = 0; k < N; k++) {
for (j = k + 1; j < N; j++) {
A[k][j] = A[k][j] / A[k][k];
}
A[k][k] = 1.0;
for (i = k + 1; i < N; i++) {
for (j = k + 1; j < N; j++) {
A[i][j] -= A[i][k] * A[k][j];
}
A[i][k] = 0.0;
}
}
}


Anyway, it performs row operations to make the matrix triangular.

See me being productive now? I literally got banned for shitposting the day before.
>>
>>54504106
gcc --language=c++ file.cpp
>>
>>54504052

Actually i've spend about an hour playing with it,
and was good progress but i want to redo some modules.

Anyway, i'll do that, but can you recommend something else, 'cause that feeling isn't going anywhere, kek.

And to answer your questions

> 2D
Haven't bothered with opengl

> Primitive modules (including audio)
> Sprite handler and toolset
> Level and character instance generator
> Testing modules
> Shitty procedural algorithm
> Other stuff
Have a solid base for an copycat RPG
>>
>>54504221

Ok, thanks anyway
>>
>>54504052

Also is /agdg/ good these days?
>>
r8 h8

fn cycle_colors_left(player: &mut RectangleShape) {
let current_color: Color = player.get_fill_color();
let new_color =
match (current_color.0.red, current_color.0.green, current_color.0.blue) {
(255, 0, 0) => (0, 0, 255),
(0, 255, 0) => (255, 0, 0),
(0, 0, 255) => (0, 255, 0),
(_, _, _) => (0, 0, 0)
};
player.set_fill_color(&Color::new_rgb(new_color.0, new_color.1, new_color.2));
}

>>
>>54504381

Rust?
>>
>>54504443
More like Bust amirite
>>
File: 750x-1.jpg (38 KB, 750x422) Image search: [Google]
750x-1.jpg
38 KB, 750x422
Is your code tasty?
>>
So I have a recursive function here that basically prints the post order numbering (in reverse, for now) of a depth first search. Currently it's void so it just prints out the values.

How would I go about adding the ordering to an array or something? I can't quite figure it out.

void df_sort(Graph g, int vert, bool* vis)
{
vis[vert] = true;
EdgeList current = g.edges[vert];
if (current == NULL)
{
printf("%s%d%s\n", "Vertex ", vert, " is done now");
}
else
{
while (current != NULL)
{
if (vis[current->edge.toVertex] != true)
{
df_sort(g, current->edge.toVertex, vis);
}
current = current->next;
}
printf("%s%d%s\n", "Vertex ", vert, " is done now");
}
}
>>
File: 15-slide-puzzle.jpg (19 KB, 305x326) Image search: [Google]
15-slide-puzzle.jpg
19 KB, 305x326
>>54504285
You could make easier games than a copycat RPG. Maybe a sliding block puzzle game.

Actually I might want to do that myself...

>>54504317
/vg/ is one of my least favorite boards. I prefer chilling in /dpt/ as one of the resident smug lisp weenies/smug c weenies.
>>
Tear me to shreds

#include <iostream>
using namespace std;

int main()
{
double price, tax, rTax, total, subtotal ;


cout << "Enter the price of the item: ";
cin >> price;
cout << "Enter the sales tax: ";
cin >> tax;

rTax = tax * 0.01;
total = rTax * price;
subtotal = total + price;

cout << "The total value is: ";
cout << subtotal;

return 0;
}
>>
>>54504565
With recursive algorithms it is easier to construct a linked list.
Linked lists in C are structures of the form
typedef struct node {
void * value;
node * next;
} node;

The nodes are daisy chained into a list, and the final node points to NULL. In order to append to a linked list, you set the final node's next to a new node.

If you really want to do arrays what you do is you start off with mallocing an array of a certain size small, and when you fill it up, you realloc to twice that size.
>http://linux.die.net/man/3/realloc
>>
>>54504645
why this is a standard program structure for this, there's no issues.

honestly the only other thing I would note is that you can just cout the calculations themselves and just skip holding it in variables, but that's not an issue from such a small program. Even if it was 10,000 times as large it wouldn't necesarily be an issue really
>>
>>54504682
Yeah, I have a linked list implemented as a queue in the same project for another part that I could use for now.

Just can't figure out what to do exactly. Would I create a linked list outside of this function and then put it as a parameter, and then every time it says in my code 'vertex is done now', add it to the LL?
>>
>>54500422
>un-ironically using scheme
>not racket

Shame
>>
>>54504758
Actually, yeah. I just did this and it totally worked. Guess I knew what to do after all.
>>
>>54504747
I see what you mean. I didn't think of cout << 5 * 3;
Thread replies: 255
Thread images: 34

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.