[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, Pajeet's linked lists Edition
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: 21
File: 20160424_234425.png (703 KB, 1079x1594) Image search: [Google]
20160424_234425.png
703 KB, 1079x1594
Evil old thread: >>54231666

What are you working on, /g/? Have you implemented Enormous Memory Savings?
>>
First for C++ is superior to C.
>>
Actual thread >>54236901
>>
Anyone have experience with GPU programming on EC2 instances? I installed tensorflow onto one but the second I try to utilize the GPU it freezes and the process needs to be killed.

Is there just a super long wait time for the GPUs or what?
>>
>>54236955
>implying
>>
>>54237032
I don't think they have a GPU, unless you order the workstation instances, that do.
>>
File: 2016-04-26-151441_907x683_scrot.png (105 KB, 907x683) Image search: [Google]
2016-04-26-151441_907x683_scrot.png
105 KB, 907x683
https://news.ycombinator.com/item?id=11569726

This literally angers me to read
>>
>>54237641
the "privilege" shit is retarded

so what if there are differences between whites and shitskins, so fucking what, doesn't mean you owe anything to shitskins just because you're white

but anyway
>eastern europe
>white
>>
>>54236916
xor adresses. Nice idea.
>>
>>54239583
Pajeet's not the first one to have it tho.
>>
>>54237641
white males and their privilege disgust me too.
>>
>>54237868
>but anyway
>>eastern europe
>>white

>Poland
>Belarus
>Ukraine
>Czech Republic

>Not white
>>
>>54236916
>A linked list is a complex data structure
stopped reading right there
>>
>>54241009
they're a mix of slavs and turkmen
>>
>>54236916
Reposting code from last time, hoping for some feedback
#imports the modules we'll be using, both turtles and the random number generator
import turtle
import random

#setup the display, configures background color and exit on click
wn = turtle.Screen()
wn.bgcolor("black")

#creates all the turtles and crams them into a list
a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 = [turtle.Turtle() for x in range(10)]
artists = [a0, a1, a2, a3, a4, a5, a6, a7, a8, a9]

#generates rotational angles and movements
m0, m1, m2, m3, m4, m5, m6, m7, m8, m9 = [random.randrange(40,60) for x in range(10)]
move = [m0, m1, m2, m3, m4, m5, m6, m7, m8, m9]
r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 = [random.randrange(0,360) for x in range(10)]
rotate = [r0, r1, r2, r3, r4, r5, r6, r7, r8, r9]

#Configures turtle color, I'll randomize this at some point
a0.color("Red")
a1.color("Blue")
a2.color("Purple")
a3.color("Brown")
a4.color("Gold")
a5.color("DarkKhaki")
a6.color("OrangeRed")
a7.color("DarkSlateGray")
a8.color("MediumSpringGreen")
a9.color("ForestGreen")

#set up the turtles to draw the shapes
for a in artists:
a.speed(0)
a.ht()
a.penup()
a.right(random.randrange(0,360))
a.forward(125)
a.pendown()

#does the actual drawing, fascinating bit of code here, it loops this sequence one-hundred and twenty times
#It calls the artists list above and pulls index 'x' from 0 to 9
#Index 'x' corresponds to a0, a1, a2 and so fourth, the turtles, but it also corresponds to the rotation and move lists
#Issues a command to a turtle, so a3.left(rotate[x])
#rotate[x] uses the same index as before, only this time it's calling the rotate list
#since the indexes correspond I can have the turtle move by a corresponding value generated for it on lines 39 and 41
for i in range(120):
for x in range(0,9):
artists[x].left(rotate[x])
artists[x].forward(move[x])


wn.exitonclick()
>>
>>54241405
too many comments/10

I'll let it slide because you're obviously learning and writing notes to yourself.
>>
>>54241422
I was told to comment my code as much as possible, I'll cut down on it once shit becomes self explanatory. Thanks Anon!
>>
File: CAN'T WAKE UP.jpg (3 KB, 125x125) Image search: [Google]
CAN'T WAKE UP.jpg
3 KB, 125x125
>>54241405

>a0,a1,a2,a3,a4,a5,a6,a7,a8,a9
>a0,a1,a2,a3,a4,a5,a6,a7,a8,a9
>m0,m1,m2,m3,m4,m5,m6,m7,m8,m9
>m0,m1,m2,m3,m4,m5,m6,m7,m8,m9
>r0,r1,r2,r3,r4,r5,r6,r7,r8,r9
>r0,r1,r2,r3,r4,r5,r6,r7,r8,r9
>a0.color, a1.color, a2.color, a3.color, a4.color, a5.color, a6.color, a7.color, a8.color, a9.color
>>
Need a template for an apk that can install assets into a specific path on internal memory.

I want to sell my expansion packs for games

Please and thank you.
>>
>>54241435
>I was told to comment my code as much as possible
Only when you're learning.

Comments should preferably explain magic numbers and code that isn't immediately clear.

For example, everyone and their tit sucking babe can tell you're importing random. Things like that are straight up insulting.
>>
File: A63KnsG.gif (934 KB, 370x208) Image search: [Google]
A63KnsG.gif
934 KB, 370x208
>>54241405
>python
>variable jizz
>more init than function
>>
File: t3NU9QG.png (4 KB, 130x283) Image search: [Google]
t3NU9QG.png
4 KB, 130x283
SEND HELP
>>
File: man-balding-scratching-head.jpg (700 KB, 2360x1568) Image search: [Google]
man-balding-scratching-head.jpg
700 KB, 2360x1568
What does this mean?

I'm trying to use a Ruby gem to download images.
/usr/lib/ruby/2.3.0/open-uri.rb:37:in `initialize': No such file or directory @ rb_sysopen - /lenORGG/favicon-32x32.png (Errno::ENOENT) from /usr/lib/ruby/2.3.0/open-uri.rb:37:in `open' from /usr/lib/ruby/2.3.0/open-uri.rb:37:in `open' from /home/camel/.gem/ruby/2.3.0/gems/image_downloader-0.2.4/lib/image_downloader/images.rb:43:in `download_by_segment' from /home/camel/.gem/ruby/2.3.0/gems/image_downloader-0.2.4/lib/image_downloader/images.rb:35:in `block in download' from /usr/lib/ruby/2.3.0/net/http.rb:853:in `start' from /usr/lib/ruby/2.3.0/net/http.rb:584:in `start' from /home/camel/.gem/ruby/2.3.0/gems/image_downloader-0.2.4/lib/image_downloader/images.rb:28:in `download' from /home/camel/.gem/ruby/2.3.0/gems/image_downloader-0.2.4/lib/image_downloader/download.rb:9:in `block (2 levels) in parallel'


Does it mean my ruby version is not compatible?
>>
>>54241484
favicon doesnt exist mby
>>
File: Screenshot.png (129 KB, 1600x900) Image search: [Google]
Screenshot.png
129 KB, 1600x900
>>54241405
Screenshot of what this does off of my memeOS

>>54241444
I know, I'm posting because I want to know how to cut down on that
>>
Should I be using angle brackets #include <me/myheader.h> on my own headers?
>>
>>54241444
There's nothing wrong with this it's good programming practice for when he learns arrays and loops YOU SHITLORD
>>
>>54241465
So any actual suggestions anon?
I'm trying to improve, I must have rewritten this thing ten times

If you think THIS is bad you should have seen it yesterday, no multiple assignments, every variable assigned manually, no loops, I must have had 150 lines just repeating the same bullshit
>>
>>54241535
It's the opposite of good programming practice kek
>>
>>54241405
>>54241444
>>54241500
>>54241535
>python shitter
>struggles to learn arrays and loops
what a surprise
>>
>>54241484

It means that the file /lenORGG/favicon-32x32.png doesn't exist.
>>
>>54241535
>SHITLORD
Please don't royalty shame.

I identify as a 10th century feudal dignitary.
>>
>>54241535
I've been doing this for about three days, I just started programming on a whim, it's fun, but I know my code's a mess
>>
>>54241571
I hope to god you're European you appropriating colon-ist
>>
>>54241595
Learn about arrays and loops

>>54241571
10/10
>>
How do people produce very small binaries that also can be distributed and work fine?

Like I was playing a 2D online game the other day that wasn't that trivial and the .exe was only 1.3 MB and there was only other file (archive with graphics and stuff), and no DLLs or anything. How do you release a complete game with the resulkting binary file being so small, with no dynamic dependencies and no packer involved?
>>
>>54241598
I bi-identify as a 21st century young urban professional from Texas.

You don' tell me hwat.

I tell YOU hwat.
>>
What's the difference in performance between chaining and probing for a hash table implementation? Aren't they the same?
>>
File: crying-man-11.jpg (50 KB, 400x598) Image search: [Google]
crying-man-11.jpg
50 KB, 400x598
>>54241566
But it doesn't download anything.

What heck does it mean?

I'm trying to use the "image_downloader" ruby gem.

Can you explain how to use it then? Doesn't seem to work for anything.

I'm guessing it's not compatible with current ruby because he stopped developing it in 2011 but idk
>>
>>54241444
>>54241465
>>54241555
>>54241552
Any one of you could offer an actual suggestion

>>54241605
I was under the impression that a loop was just a repeated operation, which I have implemented up there, and aren't array's just sets of mathematical coordinates? I don't see how that would help my cause here
>>
>>54241473
Brian?
>>
>>54241595
it might already be too late but switch to a different language as soon as possible

it should be obvious even to a beginner that python is very shitty
>>
>>54241631
An array is used to store a collection of data, but often we find it more useful to think of an
array as a collection of variables of the same type. Instead of declaring individual variables,
such as
number0
,
number1
, . . . , and
number99
, you declare one array variable such as
numbers
and use
numbers[0]
,
numbers[1]
, . . . , and
numbers[99]
to represent indi-
vidual variables.
>>
>>54241631
it would be much easier with the normal for loop which python doesn't have

for(int i = start; i < end; ++i)


i is an index into the array
>>
>>54241670
>An array is used to store a collection of data, but often we find it more useful to think of an
>array as a collection of variables of the same type

>all those fucking turtles in my code

I see what you're driving at here
Thank you
>>
>>54241677
>++i

TRIGGERED
>>
    while ((option = getopt(argc,argv, ":l:m:")) != -1 ) {

FILE *pointerFile = filereader(optarg);

switch(option) {
case 'l' :
optionchosen = 0;
counter(optionchosen,pointerFile,argv);
break;

case 'm' :
optionchosen = 1;
counter(optionchosen,pointerFile,argv);
break;

case ':' :
counter(optionchosen,pointerFile,argv);
break;

}


I want my program to accept two different flags(or no flag) together with a non-option argument or no non-option argument. How do I implement the no-flag in a good way? Everything I try gets all potatoed up.

This is the last working version, where everything but no-flag has been implemented
>>
>>54241709
define flag. What do you mean by flag?
>>
>>54237032
I'm working on a cuda assignment with aws right now. I'm using an nvidia ami with a g2 instance.

You sure you got the right ec2 instance type? The free-tier won't do much for you if you want to do GPU programming
>>
>>54241405
import turtle
from random import randrange

wn = turtle.Screen()
wn.bgcolor('black')

artists = [turtle.Turtle() for _ in range(10)]
move = [randrange(40, 60) for _ in range(10)]
rotate = [randrange(40, 60) for _ in range]
colors = [
'Red', 'Blue', 'Purple',
'Brown', 'Gold', 'DarkKhaki',
'OrangeRed', 'DarkSlateGray',
'MediumSprintGreen', 'ForestGreen'
]

for index, clr in enumerate(colors):
artists[index].color(clr)

def setup(artist):
artist.speed(0)
artist.ht()
artist.penup()
artist.right(randrange(0, 360))
artist.forward(125)
artist.pendown()

map(setup, artists)

for _ in range(120):
for index, artist in enumerate(artists):
artist.left(rotate[index])
artist.forward(move[index])

wn.exitonclick()
>>
>>54241722
dunno what the proper name is, option perhaps

like -l or -m in this case

so I want to be able to write for example program.exe -l [file] or program.exe -l or program.exe [file] ya dig?
>>
>>54241648
Glad you're enjoying JavaScript faggot
>>
>>54241759
post your assignment
>>
>>54241767
>the only reasonable alternative to python is javascript
kill yourself and fuck off to >>>/g/wdg fag
>>
>>54241757
Actually setting colors can also be stuffed into setup.

import turtle
from random import randrange

wn = turtle.Screen()
wn.bgcolor('black')

artists = [turtle.Turtle() for _ in range(10)]
move = [randrange(40, 60) for _ in range(10)]
rotate = [randrange(40, 60) for _ in range(10)]
colors = [
'Red', 'Blue', 'Purple',
'Brown', 'Gold', 'DarkKhaki',
'OrangeRed', 'DarkSlateGray',
'MediumSprintGreen', 'ForestGreen'
]

def setup(index, artist):
artist.speed(0)
artist.ht()
artist.penup()
artist.right(randrange(0, 360))
artist.forward(125)
artist.pendown()
artist.color(colors[index])

map(setup, enumerate(artists))

for _ in range(120):
for index, artist in enumerate(artists):
artist.left(rotate[index])
artist.forward(move[index])

wn.exitonclick()
>>
>>54241641
No, not Brian.
>>
>>54241677
That's the LISP/C loop. The "normal" for loop counts over a range like
for i = m to n
.
>>
>>54241794
its in french

All I want to do is for this program to work with or without options(or flags or whatever) with or without a non-option argument(aka a filename). I need a case in my switch for the no-option, and I dont know how to.
>>
>>54241484
Please help someone.
>>
>>54241757
That's impressive anon, mind sharing where you learned all that, for instance I had no idea you could use an underscore in a for loop
rotate = [randrange(40, 60) for _ in range]

should be
rotate = [randrange(40, 60) for _ in range(10)]

though
>>
>>54241836
kys
>>
>>54241821
What does the map function do there?
>>
>>54241860
>That's impressive anon, mind sharing where you learned all that, for instance I had no idea you could use an underscore in a for loop
Documentation and practice.

>should be though
Yep accidentally fucked that up.

>>54241880
It applies a function to every element of iterable container, so it basically calls setup(index, artist) on each element in the result of enumerate(artists).
>>
>>54241863
I'll let you kys me on the cheek :)
>>
>>54241908
I'll have to read up on how to properly use enumerate()
I've seen it everywhere but I didn't pay much attention, figured it was esoteric, but I guess it's time

>Doccumentation and practice
I'll just have to keep at it then
>>
>>54241625

>What heck does it mean?
It would help to see what code you have that's causing the error. What it means is that somewhere, something called open() on a file that doesn't exist.

>Can you explain how to use it then? Doesn't seem to work for anything.
What is documentation?

Also, why are you using a gem when Ruby already has builtin methods for grabbing crap from HTTP or FTP?
>>
>>54241700
>not optimizing
>>
>You really shouldn't use javascript for connecting to a database if you want this app to be anyones but yours (then it's your own fault if everything messes up) Client javascript should be used only for the interfaces. It has security issues and all sorts, it's just bad practice.
cordova and shitlang fags BTFO fuck off shitter fags
>>
>>54242009
>what's server-side JS

I don't even usually advocate the webdev shit but at least to be more subtle with your bait.
>>
>>54241838
That's why I said I need to see the entire assignment to to make sure what is meant by options and flags because that doesn't sound right
>>
>>54242002
I don't know it seemed easier

I'm literally just using the code from his documentation example

I also tried the binary included but it gave me same error when trying to use it on something.

Sorry just kind of new to Ruby and messing with some gems and trying to work them.
>>
>>54242058
cordova is for client side apps fag
>>
File: 1459702589670.jpg (31 KB, 600x337) Image search: [Google]
1459702589670.jpg
31 KB, 600x337
I want to rewrite an old (closed source) game that was released in 2004 as an open source project.
For that I want reuse the assets.
a) can I deploy the project with the prepared assets?
b) can I write a tool that prepares the assets as long the person owns a "legal" copy of the game?
c) I get in all kinds of legal shit if I even try version b and should try to stay anonymously
how does it work? is this covered under fair use?
>>
File: yyyyy.webm (3 MB, 640x360) Image search: [Google]
yyyyy.webm
3 MB, 640x360
any tips for slimming down code
>using java if that matters
any useful tidbits, practices, tricks would be appreciated.
>pic related?
>>
>>54242086
>cordova AND shitlang
>AND SHITLANG
so you were not talking exclusively about cordova
>>
>>54242116
What is wrong with Cordova?
>>
>>54242093
>a) can I deploy the project with the prepared assets?
No.

>b) can I write a tool that prepares the assets as long the person owns a "legal" copy of the game?
Grey area, mostly yes.

Look up legality behind emulators like Dolphin. I'm sure the laws would apply to your situation very similarly.
>>
>>54242093
>a) can I deploy the project with the prepared assets?
Are they downloadable from the original release? If so just direct your users to download it from there and put in the game folder. Also worth looking into the license.

>b) can I write a tool that prepares the assets as long the person owns a "legal" copy of the game?
Yes.
>>
>>54242093
a) possibly
b) possibly
c) if you aren't selling it, but are just showcasing your creativity, that's fair use.
>>
>>54242116
i'm talking about using shitlangs for end-user applications (mainly mobile apps) in general, i don't really give a shit about the server side shit
>>
>>54237641
Indians and Chinese are not white and they have no problem finding jobs in industry.
>>
for CRUD shit do you have a muh_api.php file on your website and you just connect to the website and the website acts as an interface for users to access the database in the ways i allow them to?

is that the rough outline of how it works or what
>>
>>54242133
Mariana Cordoba?
>>
>>54242099
SORCERY!!!
deceptive magicks
>>
>>54242217
She's pretty hot t b h

would hang out with her / 10
>>
File: 1431737144056.png (17 KB, 228x225) Image search: [Google]
1431737144056.png
17 KB, 228x225
What's for dinner?
>>
>>54242237
"netflix & chill", i'm sure
>>
>>54242217
knew it was a tranny fag
>>
>>54242060
The assignment is to make a program that counts words/lines/symbols in a text file or a stdinput (when no text file is given).

-l is to count lines, -m is to count symbols. no option given = count words

for example
'program.exe -m [file]' counts symbols from a file
'program.exe [file]' counts words from a file
'program.exe -m' counts symbols in stdinput
>>
>>54241405

I know shit about python but here's how I would write it looking at the documentation for a second
import turtle
import random

#setup the display
wn = turtle.Screen()
wn.bgcolor("black")

#creates all the turtles and crams them into a list
artists = [turtle.Turtle() for x in range(10)]

#generates rotational angles and movements
move = [random.randrange(40,60) for x in range(10)]
rotate = [random.randrange(0,360) for x in range(10)]

#Configures turtle color
colors = ["Red", "Blue", "Purple", "Brown", "Gold", "DarkKhaki", "OrangeRed", "DarkSlateGray", "MediumSpringGreen", "ForestGreen"]
for c in xrange(10):
artists[c].color(colors[c])

#set up the turtles to draw the shapes
for a in artists:
a.speed(0)
a.ht()
a.penup()
a.right(random.randrange(0,360))
a.forward(125)
a.pendown()

#drawing
for i in range(120):
for x in range(0,9):
artists[x].left(rotate[x])
artists[x].forward(move[x])


wn.exitonclick()
>>
>>54242252
cheese pizza
>>
>>54242270
doesnt compile
>>
>>54242294
What's the error. It compiles on my machine
>>
>>54242315
python's an interpreted language
>>
>>54242270
someone beat you there >>54241821
>>
>>54242139
>>54242135
>>54242168
>a) possibly
and getting dmac'd every week? I dont want to sell or make a profit in any way so I will go with option b
>>
Hey, just played around with Java and was wondering if I could specify where exactly I wanted to double buffer. At the moment it is buffering 700 by 700 from 0 x,y. Is it possible to position it?

bufferI = createImage(700, 700);

Thanks in advance,
>>
>>54242323
So should you say it gets interpreted on my machine? lol

It runs on my machine, whatever.
>>
>>54242327
You could do that but there's no reason to do that, just double buffer everything.
>>
>>54242355
>when you get a >(You) but what you really wanted as a >kek
>>
>>54242267
http://stackoverflow.com/questions/18109458/read-from-a-text-file-and-parse-lines-into-words-in-c
>>
Hi everione! Can someone explain to me how in the h works a voxel engine?? I'm a razonable programmer, but if you could explain in details wold be great. Thank you!
>>
>>54242359
When I double buffer everything, it flickers the components like JLabel and JSlider.

I know I'm probably doing something else wrong but it would be neat if I could double buffer a specified area instead of the whole frame/panel.
>>
>>54242377
But that has absolutely nothing to do with my problem....

My problem is how to include the argument of "no option" in my program
>>
>>54242211
come on you fags talk about webshit and crudshit all the time help a nigga out
>>
>>54242405

strFName = "my_file.txt"
FILE* my_file;
my_file = fopen(strFName, "r"); // "r" - read option. Returns NULL if file doesn't exist
/** operations on file go here **/
fclose(my_file); // must be called when you're done with the file

>>
>>54242424
>>
>>54242438
I dont mean to be rude but...did you read the comment you replied to?
>>
>>54242324
The second one has less lines minus comments, and more readable
>>
I need a library that'll extract scalar features from audio files e.g. sampling rate/max amplitude/tempo/whatever.

Help me /g/, you're my only hope.
>>
>>54242267
argc should have the number of arguments. I think argc==1 means the program was run with no arguments, so just handle that case and you should be fine.
>>
>>54242327
Anyone?
>>
>>54242544
That case would also activate for program.exe -m then for example, which would be wrong
>>
In file included from src/hpsh.c:7:0:
include/function.h:8:13: error: unknown type name ‘stack_t’
void op_add(stack_t *stack);


It's panicing about not finding stack.h despite being included above function.h and inside the function.h header itself.
>>
File: ft.jpg (63 KB, 400x361) Image search: [Google]
ft.jpg
63 KB, 400x361
shitfuckdamnniggerbitchcunt

350 lines of java code on notepad
didn't capitalize a single character
>>
File: loading.gif (2 KB, 193x192) Image search: [Google]
loading.gif
2 KB, 193x192
Had to write a paper for class. I'm not very smart. Can someone smarter than me review?

https://www.scribd.com/doc/310529883/N-Gram-Markov-Chain-epistemological-text-generation-with-weighted-outputs
>>
>>54242267
>>54242582
Someone help this guy
>>
>>54242611
Why the fuck did you use notepad. You couldn't use Sublime text or some shit?
>>
>>54242625
>putting your whole name and school out there

I agree you aren't very smart
>>
>>54242625
dude i wanna see this cat in minecraft!
piston the legs for up/down animation
>>
>>54242611
use eclipse not notepad and just refactor the names with ctrl+shift+r
>>
>>54242629
>>54242654
notepad is the best ide
>>
>>54242625
looks ok at a glance but just so you know i didn't actually read it
>>
>>54242629
>Sublime text
i'm a newb, didn't know this existed - what's some others?
was on old clunky laptop that struggles under big IDEs
>>
>>54242625
The pizza guy is asking me if you want pineapple on your 500 XL family pizzas
>>
>>54242681
Atom also, which is probably better but it might be more intensive. Sublime text is really all you should need.
>>
>>54242684
No! Please don't
>>
>>54242701
Good call, already had anchovis and extra cheese on all of them, pineapple would be awful
>>
are any of you intellectuals interested in collaborating on a game dev project
>>
>>54242582
Oh yeah, so something like this maybe:

bool countSymbols=false;

char *filename=NULL;

for(int i=1; i<argc; i++) {
if(argv[i][0]=='-') {
switch(argv[i][1]) {
case 'm':
countSymbols=true;
break;

default:
cout<<"Bad flag: "<<argv[i]<<"\n";
return 1;
break;
}
} else {
if(filename) {
cout<<"Superfluous filename provided.\n";
return 1;
} else filename=argv[i];
}
}


if(filename) {
// Load from file
} else {
// Prompt user for stdin text
}


>>
If I have interpreter.c and i want to include like 100 function pointers from functions.c, is there a way to do it without forward declaring every single one in the functions.h file?

Because it's getting tedious.
>>
>>54242718
no pls

>>/vg/agdg
>>
>>54242681
>notepad++
>>
>>54242701
Hi this guy is not me
>>
>>54242718
/agdg/ pls go
>>
https://spin.atomicobject.com/2016/04/26/swift-long-compile-time/

Thanks Apple.
>>
>>54242718
What software will we be using and what is the game idea.

Also I know you are from /agdg/
>>
>>54242734
>>54242751
cmon guys it'll be fun
>>
>>54242742
notepad++ is shit in comparison nowadays
>>
>>54242770
I'm not interested unless you use SDL
>>
>>54242065
>>54241484
>>54241625
Anyone?
>>
>>54242764
whatever language you prefer. personally i know java

how do you know i'm from /agdg/
>>
>>54241457

This is the straight up shittiest programming advice I've ever read on here, and that is itself quite an accomplishment.
>>
Where can I find ideas for programming?
>inb4 from your heart
fuck you
>>
>>54242792
you called /dpt/ intellectuals
>>
>>54242812
>>/vg/agdg/
>>
>>54242794
hah it's the only way pajeet keeps a job is by shitty documentation
>>
>>54242681

I never cared for Sublime.

I used Notepad++ for Windows work, and now have standardized on Atom because I can run the same IDE on Windows, Linux, and Chrome OS and have it automatically sync the packages and configuration.

When Atom can't handle it, I reach for Eclipse.
>>
>>54242794
He's right though. Generally speaking you should strive to make your code readable enough to not need comments, and only comment stuff that really needs it.
>>
>>54242717
in the days before cellphones, was broke and hungry once. i called and ordered myself a huge pizza and drinks and desserts and sides (about $60)
>write note and tape to door:
"sorry, had an emergency. had to go pick up family member. called store and paid via credit card, including $5 tip. please leave food on porch. thanks!"
turn off all lights and be quiet as fuck
>knock knock
>shuffle shuffle
>car starts and drives off
yum!!!
>>
>>54242812
make a game, pick a genre, dream up some shit or just experiment and then expand on it as you go along
>>
>>54242833
Pajeet is a better programmer than most of the people here
>>
>>54242845
this tbqh, i mostly only comment things like glsl shader code which is obfuscated for performance and size reasons
>>
>>54242850
Why didn't you just use your food stamps, Tyrone?
>>
Any tips on recursively traversing a general tree that uses vectors to hold node pointers?
>>
>>54242845
What kind of productivity applications do you make?
>>
>>54242880
tree.traverse();
>>
>>54242880
the normal method would be either breadth first or depth first, both functions flatten a tree into a sequence
>>
>>54242850
For that much they would probably have the brains to call the store and check

I'm not saying it's a bullshit story... but....
>>
how do you reverse a binary tree
>>
>>54242879
i'm white
i was a teen
dad drank welfare/stamps
>fuck yoose
>>
>>54242921
swap left and right nodes
>>
>>54242921
Reverse or inverse?
>>
>>54242936
yeah but how
>>
>>54242915
>b4 cell phones were in every pocket
>>
>>54242949
swap(node1,node2);
>>
>>54242882
mobile, desktop and web applications.
>>
>>54242947
inverse
>>
>>54242949
Probably by swapping the left and right nodes
>>
>>54242967
No, I meant are they productivity like for learning stuff or time management?
>>
C/C++ HOMEWORK ASSIGNMENT

Consider a node with pointers to two "subnodes":

struct node {
node *a, *b;
}

Write a function that swaps the subnodes of a node passed to it, without calling any functions.


97% will fail this
>>
something to think about:
>not asking if it would be a good idea or not.
but would it be possible make a small pc (like pi-ish) that ran java natively?
write java code> run directly on the hardware. no vm. and would java translate to the binary or is bytecode the most primitive it could get?
>>
>>54243083
Anon, writing and calling a function are not the same thing
>>
only pajeets comment everything
>>
>>54243042
I worked on a mobile app for project management. I have a desktop app for for productivity, but it's hard to describe without out in a way that wouldn't make it easy to figure out what it is exactly.
>>
>>54243083
void swap(node *n)
{
n->a = n->a ^ n->b;
n->b = n->b ^ n->a;
n->a = n->a ^ n->b;
}
>>
find a flaw in my code brah


if (cnt >= clkspeed) begin
cnt = 0;
out0 <= out0 + 4'h1;

// LED0 > 9 -> LED1 += 1
if (out0 == 4'h9) begin
out0 <= 4'h0;
out1 <= out1 + 4'h1;

// LED1 > 5 -> LED2 += 1
if (out1 == 4'h5) begin
out1 <= 4'h0;
out2 <= out2 + 4'h1;

// LED2 > 9 -> LED3 += 1
if (out2 == 4'h9) begin
out2 <= 4'h0;
out3 <= out3 + 4'h1;

// LED3 > 5 -> LED3 = 0
if (out3 == 4'h5) begin
out3 <= 4'h0;
end
end
end
end
end



pro-tip: you can't
>>
File: autistic blue gril.jpg (55 KB, 602x614) Image search: [Google]
autistic blue gril.jpg
55 KB, 602x614
Rate my RPN calculator!
now with error messages!
> 3.22
1: 3.22
> 1.86
2: 3.22
1: 1.86
> 7.22 -
2: 3.22
1: -5.36
> *
1: -17.2592
> /
[!] DIVIDE requires 2 operands.
1: -17.2592
>
>>
>>54243131
Sounds interesting, what were they about?
>>
>>54243098
A java compiler. You're talking about a java compiler.
>>
guys could someone please help me?

>>54241709
>>54242267
>>
>>54243185
ok sure, a physical java compiler
>>
>>54243098
Already a horrific thing
http://www.oracle.com/technetwork/java/embedded/overview/index.html
>>
>>54243240
>physical java compiler

What?

Do you understand how native code works on a computer?
>>
>>54243098
aren't you thinking of a pc that runs (er, um... ran) Sun OS? aka SunBox
>>
>>54243279
Native code doesn't exist on the magical Java Virtual Machine

>tfw you will never be compiled to bytecode and ran by the best JIT compiler around
>>
>>54243171
What were which about? The mobile app was for a company i worked for. They have a project management web app thing they sell and I worked on the mobile app for it.
>>
>>54243333
What does the project management app do? What does the desktop productivity application do?
>>
>>54241620
Almost all games have dependencies.
>>
>>54243103
Okay, I just meant that the function you write must not contain any function calls. So you have to swap the nodes by hand.
>>
File: bakaviewer.png (337 KB, 1825x990) Image search: [Google]
bakaviewer.png
337 KB, 1825x990
An imageviewer that supports all image formats (including webm) commonly found on imageboards and allows the same comfiness that I was used to when using HoneyView.

Python + PySide (Qt4) currently. Might switch to PySide2 once it's released, although that doesn't matter much -- maybe for the nicer Phonon backend.

Picture related. I did something similar before, so I can reuse quite a few parts of the code, but I want to do it properly this time around.

Suggestions for a better name are always welcome.
>>
>>54243317

>Native code doesn't exist on the magical Java Virtual Machine

You realized that JIT is literally translating bytecode into native code, right?
>>
>>54243370
That doesn't answer my question at all.
>>
>>54242845

No he isn't, and he'd get shit canned from any development shop with competent management.


Poor commenting is literally the easiest way to get fired from a development position, outside of rampant absenteeism or outright theft of company property.

NEET advice is not good advice.
>>
>>54243384

JIT a shit. AOT or bust.
>>
>>54243348
the project management app was like basecamp pretty much. Not gonna say what the desktop one is because there's too few of them out there. It would give away what it is.
>>
>>54243438
But he's recommending good commenting, not poor commenting.
>>
>>54243317
Right... When you say "physical compiler", what the fuck are you talking about? Do you mean a native compiler like in C?
>>
>>54243279
A better idea would be a metaphysical java compiler. The resulting program wouldn't even require hardware to run.
>>
>>54243159
Looking good as always
>>
Hello friends.

Just started to learn python, my first programming language.

I'm stumped on project Euler problem 3 as per the image attached.

I don't want a direct answer, but perhaps one of you could point me in the right direction with how to get started.

Thanks.

The name of a topic/technique will do. I want to figure it out but I need a little push.
>>
What are libraries?
>>
What's the opposite instruction of JE?
>>
>>54243710
It's like a building with books and shit inside.
>>
>>54243679
Get an algorithm that checks for primes, and evaluate a modulo that equates to 0, print when both conditions are true. Start from half+1 of the big number and count down. What ever prints first is the answer.
>>
>>54243710
>>54243733
It's like a folder with headers and shit inside.
>>
>>54243735
Thanks senpai.

I was thinking along the same lines actually. I just have no idea how to check for primes in an efficient manner that doesn't involve churning shit loads of numbers.

I'll figure something out for that part.
>>
>>54243764
No one does, that why primes are a cornerstone of encryption. AKS and Miller Rabin are good though.
>>
Does anyone know the colour code for the JFrame?
>>
I usually organize my projects by which language they're written in, e.g. cpp/profiler is the folder which holds the profiler program source written in C++. But often, some projects rely on multiple languages, and I sometime want to see projects by their name rather than language. Yet, the programming language used matters because of the corresponding toolsets and to know what toolchain needs to be installed when moving.

Why are non-retarded tagging filesystems not a thing yet?
That's a good idea for a project I guess.
>>
>>54243793
Wow. OK no wonder I'm stumped then.

Cool, thanks, I guess I'll write something that just churns numbers or copy something you've mentioned.
>>
>>54243468
I see about the project management one. It is a shame you don't want to say the desktop one you have nothing to worry about from the people here on ./dpt/ they can't even do FizzBuzz properly
>>
>>54243848
I don't want the name of the product showing up on a 4chan archive when google searched.
>>
Is it true that most people who program (probably excluding most people here) can't FizzBuzz?
>>
>>54243710
Institutions which freely loan books for short periods of time.
>>
>>54243873
I wouldn't say so. But sure as fuck a lot of CS graduates can't.
>>
>>54243873
Nobody who advocates for C in these threads knows how to fizzbuzz.
>>
>>54243863
Throwaway contact info? I enjoy seeing Anon's applications
>>
>>54243873
Apparently, but I have trouble believing it.
>>
>>54243898
Sorry son. Can't talk about shit like that. I made it with WPF and F# tho
>>
>>54243892
Why?
>>
>>54243083
void swap(node *n) {
node *tmp = n->a;
n->a = n->b;
n->b = tmp;
}


that will be 25 rupees dear kind sir
>>
>>54243910
Teach me your productivity application making ways
>>
>>54243816
I don't see any reason to group projects by language. I have a separate file which lists all software dependencies/tools/libraries etc. that I've installed on my machine.
>>
>>54243892
I wouldn't advocate C unless you're working on embedded systems
>>
>>54243939
Then maybe you can fizzbuzz.
>>
>>54243873
Half the people in my CS250 class said they copied stack overflow answers the whole time. I can believe it.
>>
Some guy literally named Cashman is trying to hire me, what do?
>>
>>54243917
How does it feel being in the 3%?
>>
>>54243986
All the people in my CS350 Java Enterprise program all had other people write and help them with their projects
>>
are any of you intellectuals interested in collaborating on a game development project
>>
>>54243986
>>54244050
What Universities do you attend??
>>
Java question.

I have a list of <AbstractProduct> which contains objects of 5 different subclasses of AbstractProduct.

Now I need to access methods of these subclasses on the objects, which means casting.
I'm kind of hesistant to casting because this typically reeks of bad design.

What does /g/ think? Is casting always bad? Is there a way around?
>>
>>54244066
A good one, which is weird.
>>
>>54244059
Maybe. Sell us on the game idea.
>>
>>54243735
>Start from half+1
Ho ho ho.
Can you explain why floor(sqrt(value)) is a better choice?
>>
>>54244071
Generally there's a better way of structuring the code to avoid casting.

What is "AbstractProduct" exactly, and why do you need to access certain methods on the subclasses?
>>
>>54244071
Why don't you define abstract methods in AbstractProduct and use polymorphism?
>>
>>54244080
the theme is horror and we're planning to release within 6 months or so. we're in the brainstorming phase and we're just coming up with ideas on what to include so we could use any sort of inputs on it especially from a programming standpoint
>>
>>54244082
Why is it?
>>
what book should i take to learn haskel?
i have previous experience with functional programming.
>>
>>54244059
Games are for children.
>>
>>54237641
He's not right for the US, Germans were detested in the US for an extremely long time
>>
>>54244118
We'd have to see some of the code to get a perspective on it
>>
>>54244131
good goy
>>
>>54243733
>>54243882

Really? So mature.
>>
>>54244066
it's called "i'm only here because i wanna make video games"
>>
>>54244118
Saying that the "theme is horror" isn't going to sell anyone. There are plenty of horror games. What ideas make your game unique and fresh?
>>
>>54244118
>especially from a programming standpoint
as if you're not just making a cookie cutter jewnity engine shitter game with storebought assets and no real programming
>>
>>54244163
True the only reason I got into programming was I wanted to make a video game but once I realized it's way too hard and only really intelligent people who have been programming for 10+ years can do it I lost all interest in programming
>>
>>54244134
no they're not

>>54244141
there's no code yet. we're building this from the ground up. essentially we're looking for people that want to be part of every stage of the project
>>
>>54244178
>no they're not
You don't think children should play games? You are a monster.
>>
>>54244198
No one should play games they are a waste of time
>>
>>54244177
Not true now. There's UE4 and shit. Unfortunately to do that you have to be good at photoshop and whatever autodesk is shilling nowadays.
>>
File: 1433857314618.jpg (35 KB, 480x360) Image search: [Google]
1433857314618.jpg
35 KB, 480x360
>>54244178
>inexperienced shitters that think fags from 4chins won't just waste their time if they even decide to "help" at all
>there's no code yet.
>we're building this from the ground up
>6 months
>>
>>54244212
UE4 is not easy to learn it requires a ton of work and so many hours learning and then many more hours learning to do art properly
Thread replies: 255
Thread images: 21

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.