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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 323
Thread images: 29

File: 1467570941060.jpg (517KB, 1521x1076px) Image search: [Google]
1467570941060.jpg
517KB, 1521x1076px
Previous Thread: >>55660372

What are you working on, /g/?
>>
FIRST for GO has SEGMENTED stacks!! ~
>>
Reposting.
>>55665935
>>
while(1) {
printf("Please don't use an anime image next time!\nThanks!");
}
>>
Should I learn C or C# for coding shitty games?
>inb4 C++
>>
>>55666642
Yeah! Let's go back to 16 bit x86!
>>
Please use a trap image next time
>>
>>55666673
C++.
>>
>>55666651
if your program can't recover from a failure in that function, then just throw instead of returning a nonzero value
>>
>>55666673
C
>>
>>55666673
Probably neither, depends on what kind of shitty games you want to make
>>
>>55666674
you can have segmented paging
>>
>>55666673
game maker studio for 2d games

Unity or Unreal engine for 3d games
>>
>>55666727
r-really?
>>
>>55666734
>>>/v/

also
>non-free software
>>
>>55666738
yes, but it's a mess and I don't think it's really used much
>>
>>55666673
C# + Unity will get you going quicker whether 2D or 3D.
>>
Reposting my question, is there any ready solution for storing tags akin to leveldb?
>>
>>55666752
>>55666774
You are not going to finish and program an entire game without using a engine
>>
>>55666794
Bullshit
>>
>>55666794
I know, that's why I recommended Unity + C#.

Fuckton of tutorials, lots of free assets, easy to get in to.
>>
>>55666805
Truth
>>
>>55666794
3d maybe, but 2d is pretty much doable all by yourself.
>>
>>55666815
No, unless if you are useless as a programmer.
I am seriously unsure what you are doing here.
>>
>>55666819
>>55666832
Do you know how very long it would take you to build an engine to manage all the assets in your game? Many years compared to using an already made engine which is where you both are wrong
>>
>>55666843
Define "manage all the assets in your game". For my pokemon clone it took a few minutes.
>>
>>55666819
>2d is pretty much doable all by yourself
Maybe for the most basic of 2D games, which is frankly boring and no one will want to play it.

Most "2D" games coming out these days are 2.5D done with something like Unity, even the pixel art games.
>>
>>55666819
>>55666843
It's doable but still a bad idea. You're going to waste a lot of time making an engine of some sort, probably by the time you'll finish it you'll lose all motivation for making an actual game.

Also, I don't know about C#, but C++ doesn't even have any proper frameworks for game development. Most of them are either bare bone or just pretty shit quality.
>>
>>55666843
Ridiculous. You can make a 2D engine in a week or two easily.
>>
>>55666734
>>55666774
Why the hell would you suggest non-free tools?
>>
>>55666879
>but C++ doesn't even have any proper frameworks for game development
You're kidding right?
>>
>Search and replace NULL with nullptr
>program starts crashing
>reset to previous commit
>program still crashes after make clean && make

I swear to god I'm going to kill myself
>>
>>55666883
You forgot to count in project management, testing, art creation, project design, ui design, marketing, engine creation, content creation, engine optimization, engine testing, engine porting to consoles and many more things.
>>
>>55666879
>C++ doesn't even have any proper frameworks for game development.
anon
>>
>>55666924
$ cat ~/bin/c
#!/bin/sh
gcc -fdiagnostics-color=always -g -gdwarf-4 -Og -Wall --std=c11 \
-Wpedantic -fno-diagnostics-show-caret -fsanitize=undefined \
-fsanitize=address -fno-omit-frame-pointer -fcilkplus -pthread \
-lm -D_FORTIFY_SOURCE=1 -D_XOPEN_SOURCE=700 -I ~/include/ \
-L ~/lib/ "$@" -Wno-maybe-uninitialized


It may help you! (mainly the sanitisers)
>>
>>55666892
Stop being an open-source autist.

Unity is one of the best (if not THE best) platforms for newbies.

There isn't a better open-source alternative that is superior on merits other than simply being open-source.
>>
>>55666928
You mean all those things you have to do with a third party engine anyway?
>>
>>55666896
>>55666929
Just name a few frameworks that have same features as Game Maker (e.g. rendering, physics, asset management) and that are actually battle-tested
>>
>>55666883
You are not going to make a 2d engine as good as game maker studio in a week or two easily
>>
>>55666949
Xenko is better.
>>
>>55666950
A 2D engine you do in a week will objectively be not as quality as Unity's, but it may serve the purpose just right for your game.
>>
>>55666924
Learn how to use gdb, it's basically 2-3 core commands
>>
>>55666961
>game maker studio
>good

wew

>>55666969
Your engine will be made for your game instead of being a general purpose thing which includes a million things your project has no use for that are just there to obfuscate the tools you actually want to use and bloat the executable.
>>
>>55666879
Pajeet/10

>>55666949
newbies should learn programming and CS instead of working with shitty dragndrop programs.

>There isn't a better open-source alternative that is superior on merits other than simply being open-source.
Have you tried many?

Also, I am not an open-source autist, I do not support open source. I support free software.
>>
>>55666928
>project management
oh boy i sure needed lots of project management to manage me and my nonexistant coworkers
seriously for a one man hobby project you need nothing but a todo list
>testing
included in the two weeks
>art creation
not part of engine dev but of game dev
>project design
software architecture is easily included in those two weeks
>ui design
not part of engine dev
>content creation
not part of engine dev
>engine optimization
part of the two weeks
>engine testing
duplicate
>engine porting
most required provided portability is already provided by the tools used to write the engine
>>
Finding my next position.
>>
>>55666974
The program never worked in GDB because for some reason vkGetDeviceSurfaceCapabilitiesKHR returns VK_ERROR_SURFACE_LOST when the program isn't run from explorer.

Tbh I'm starting to think Nvidia's Windows drivers just don't like Vulkan. DOOM has been crashing a lot too.
>>
>>55666892
Unreal Engine 4's source code is fully available, but it isn't "free".

I have no dislike for the free software movement, but put bluntly if free tools were viable people would be suggesting them instead. If you're developing a game of any complexity, you don't have years to blow on recreating tools that already exist. It's not simply easier to modify an existing engine, it's your only real option. Especially if you're working alone.
>>
>>55666977
It is one of the best 2d game engines out there

>>55666982
You are not going to make a good 2d engine in a week stop lying to yourself you don't realize how much work goes into a real good 2d engine like game maker studio
>>
>>55666983
Holy shit, that's a lot of money.
>>
>>55666998
>if free tools were viable
The majority of them are.

>people would be suggesting them instead
And they do.

>If you're developing a game of any complexity
You should be able to make its engine in a short amount of time if you are not a pajeet.
>>
>>55667000
you're aware that the actual engine is a lot smaller than all the stuff game maker provides, right?
especially for a small 2d hobby project (while being a competent developer), you don't need all that stuff
>>
>>55666996
FUCK I figured it out

I was replacing an old variable with a new struct type and somehow ended up with the old variable being used in half the places and the new one in the other half
>>
File: 1467530633947.jpg (325KB, 1521x1076px) Image search: [Google]
1467530633947.jpg
325KB, 1521x1076px
>>55666624
>fix'd
BENIS
E
N
I
S
EBIN
>>
File: 1468718719827.jpg (115KB, 1044x1300px)
1468718719827.jpg
115KB, 1044x1300px
>game maker
>>
>>55667034
Hotline Miami was originally made in Game Maker
>>
>>55666965
Could you list some advantages?

All I can see is that people feel like it's Unity 1.0 (i.e. not very good).
>>
>>55667000
>>>/v/
People on /dpt/ actually know about programming and can easily recognise bullshit.
If you really need a premade shitty engine to make a 2d game, then you really should find a hobby other than programming.
>>
>>55667049
thank you for proving my point
>>
>>55667000
>game maker studio
mark overmars pls go
>>
>>55667059
how's your 12432th variant of fizbuzz doing? or another interer averaging program?
>>
>>55666624
How to develop a progam that clicks on a certain spot instantly when a keybind is pressed?
>>
>>55667059
post your free 2d game engine you made that is much better than game maker studio

Ohh wait you don't have one because it's a difficult project to do on your own you liar!
>>
>>55666998
For 2D dev you don't need fucking UE or Unity, they just contain a ton of shit you're not going to use. You're not going to be recreating those, you're going to create an engine adapted to what you need. You don't need a 3M LOC+ engine for a 2D game, games like Braid and Super Meat Boy are made by one programmer each and are both <100k LOC. Even for 3D dev making your own engine can be viable, as seen in The Witness, Amnesia and SOMA.
>>
>>55667059
>>55667029
You cannot program a reasonably good 2D game in less than a month from scratch.
>>
The only 2d game engine you will ever need is SDL/SFML.
>>
>>55667068
>int averaging
not this meme again
>>
>>55667071
Would be pretty easy in C#.

Make it a service.

Listen for keypress, click at specified coordinates.
>>
>>55667074
You can't do it with Unity either.
>>
>>55667068
our /dpt/ bantz are coming along well, thanks
>>
>>55667072
Did I ever claim that I made a generic 2d game engine?

>>55667074
Yes, you can easily if you don't totally suck. Have you tried it?
>>
>>55667068
What do memes have to do with the topic?
>>
>>55667112
you are making ridiculous claims of being able to make a 2d gaming engine in one week. Thanks for proving you don't have one and it's not going be possible to make a good one
>>
>>55666959
Still waiting for an answer

>>55667078
SDL is not even a game engine. SDL is an abstraction layer over input/output devices. It can provide you interface to poll inputs, create windows and blit images. And if you want to use OpenGL, SDL can't even blit images.
>>
>>55667090
Yes, you absolutely can.

You can have the basic structure of a working platformer with assets set up in a day or two.
>>
File: my_body_is_ready-1.jpg (79KB, 463x462px) Image search: [Google]
my_body_is_ready-1.jpg
79KB, 463x462px
I spent almost 8 months making it work. That was phase 1.

Now I'm going to start phase 2: making it *right*.

>"you're wasting your time"
It's open source, this code will have my name publicly attached to it and it will be used to judge my skills.

>"there's no perfect code"
No, but there's better code than the mess it currently is.
>>
>>55667139
>you are making ridiculous claims of being able to make a 2d gaming engine in one week
Not ridiculous at all, it's very easy.

>Thanks for proving you don't have one and it's not going be possible to make a good one
...what?
When did I prove that? I really can't find such a proof in any of my posts.
>>
File: plshelp.jpg (40KB, 549x328px) Image search: [Google]
plshelp.jpg
40KB, 549x328px
who /cs50/ here? I'm trying the mario exercise, where you have to print out a half-pyramid of pound symbols aligned to the right. I managed to get it working somehow, but now I have a problem: when I give it certain values for height, like 8 or 23, it prints out pic related.

So my questions is, why is there a bunch of @ in between the #? If I had to guess I'd say that it's because i'm increasing the array index j past the maximum size of s, but as far as I can tell that's not the case. Or am I wrong?

My code (height is an int between 1 and 23 i get from elsewhere):
void MakePyramid(int height)
{
// For each line
for (int i = 0; i < height; i++)
{
// initialize an array of characters that will contain the spaces and the pounds
char s[height+1];

// replace each character with a space or a # depending on its position
for (int j = 0; j <= height; j++)
{
if (j < height-(i+1))
{
s[j] = ' ';
}
else
{
s[j] = '#';
}
}
// print the array
printf("%s\n", s);
}
}
>>
>>55667172
Look, I know you're trolling, but /dpt/ has been really shitty since this thread started.

Can you go for a walk or something? Preferably in heavy traffic.
>>
>>55667074
nigga u dumb
have you ever heard of ludum dare? people make an entire game (including the engine) in 48 hours.
>>
>>55667193
Kill yourself pajeet and fuck off back to >>>/v/.

>but /dpt/ has been really shitty since this thread started.
Because of your kind.
>>
>>55667187
>using arrays for this shit
why
>>
>>55667073
I'm talking about 3D.

>Amnesia and SOMA.
Made by a team that developed their engine over a number of years and various projects. eg SOMA's engine was not made from scratch, it was an evolution of Amnesia's. Which was probably an evolution of Penumbra's.

I'm the rigidly self reliant type as well, and I like tightly crafting a program for exactly what I want it to do, how I want it to do it. I don't like working with other people's code, and I don't typically like adding on to an existing project. But there are hard limits to bear in mind, and you have to be realistic. Do I really have the time to research and replicate a highly developed lighting system? Do I have time to sort out all the possible issues with z-fighting, that have largely been solved? Etc.

You have to be realistic. I'm idealistic and stubborn, but I'm also broke and starving and have lived that way for years, and I'm only one person. The days of being able to consistently stay up for days straight are over, which is what I'd have to do to have the remotest chance of producing a working engine from scratch that does what I want and is capable of approximating photorealism.
>>
>>55667193
>>55667217
Pressed submit too fast, oops.
Still waiting a reply to my question, when did I proved anything like that?
>>
>>55667213
>make an engine instead of just making a game
wew
>>
>>55667213
>ludum dare
That's a competition between the most autistic of autists.

It's hardly comparable to a recommendation for the average person actually trying to create something.
>>
>>55667187

Behold: the future of "coders"
>>
>>55667187
works on my machine
just go step by step in debugger and see what happens
>>
Does anyone have that image with the hundred or so project ideas on it? I haven't seen it on here in a while.
>>
>>55666667
so close
>>
>>55667073
>Amnesia and SOMA
Nigga, they've been working on that engine for over a decade.

I remember when they were working on the engine for Penumbra. They actually posted on /v/ way back then in like 2006 with screenshots of lighting and physics progress.
>>
>>55666677
Hey l/g/bt, where can i buy cheap hormones that make me a better programmer? I wish to be the little girl です.
>>
>>55667187
void MakePyramid(size_t height) {
for (int i = 0; i < height; ++i) {
for (int j = 0; j < height - i; ++j) {
putchar(' ');
}
for (int k = height - i; k < height; ++k) {
putchar('#');
}
putchar('\n');
}
}
>>
>>55667187
for(int i = 0;i<height;i++){
for(int j = height-1;j>i;j--){
printf(" ");
}

for(int k = i+1;k>=0;k--){
printf("#");
}
printf("\n");
}
>>
File: surprised.gif (874KB, 220x220px)
surprised.gif
874KB, 220x220px
I might have a little Anon soon, any suggestions for names?
>>
>>55667407
foo
>>
>>55667407
bar
>>
>>55667407
9001 xddddd SO LE RANDOM XDDDD LE MONKEY FACE =3333 *poops self*
>>
>>55667407
x
>>
>>55667422
>>55667432
I guess I'd have to have 2 kids then
>>
File: 8ball.png (26KB, 1006x156px) Image search: [Google]
8ball.png
26KB, 1006x156px
Next up, Right-Angle Triangle Checker
>>55665526
Fuck this 8-Ball, god damn rand() was always giving me the same number for some reason so I had to throw in some kind of code I know nothing about, some kind of 'seeding' going on with time or other. How'd I do with this one?
Gather round and get your fortune
>>
>>55667187
This is how I solved it:
#include <stdio.h>

void DrawPyramid(int height)
{
for (int x = 0; x < height; x++) {
for (int i = 0; i < height-x; i++) {
putchar(' ');
}
for (int j = 0; j < x+2; j++) {
putchar('#');
}
putchar('\n');
}
}

int main(void)
{
DrawPyramid(14);
return 0;
}
>>
>>55667407
; DROP TABLE FROM sqlite_master;
>>
How can I start writing baremetal C programs? How can I make bootable pendrive with program that I've written?
>>
File: S3TSBrK.png (10KB, 828x208px) Image search: [Google]
S3TSBrK.png
10KB, 828x208px
>>55667377
>>55667392
Range(1, size).ToList().ForEach(x => WriteLine((Concat(Repeat("#", x))).PadLeft(size)));
>>
>>55667497
rick-roll
>>
>>55667497
Just post the website:
http://better-dpt-roll.github.io/
>>
>>55667507
Well shit, I did not know this.

Thanks.
>>
File: WHY IS THIS HAPPENING.png (9KB, 561x251px) Image search: [Google]
WHY IS THIS HAPPENING.png
9KB, 561x251px
Someone please explain. I don't throw or catch the exception and get

unreported exception AWTException must be caught or declared

Then when I try to catch it It says symbol not found? What the hell?
>>
>>55667495
wont work in C
>>
>>55667523
You're a really smart guy.
>>
>>55667528
then stop boasting your epic 10 command program that you just jammed into one line
>>
>>55667514
import java.awt.AWTException;
>>
>>55667528
For you.
>>
>>55667514
what kind of a shit IDE is that
>>
>>55667554
It's Netbeans with dark theming.
>>55667541
Wow didn't know you had to import the exception..
>>
>>55667539
>boasting
I literally just posted a solution to the problem in another language.

I always find it interesting to see alternate ways to do things, and the different approaches that different languages take.

In fact, I literally didn't even post any words with my code. The fact that you just using the term 'boasting' shows an inherent feeling of inferiority, much like a predominantly black school making fun of the smarter kids for 'acting white'.
>>
File: 1469032198.png (70KB, 1089x635px) Image search: [Google]
1469032198.png
70KB, 1089x635px
I am a techy in mom&pop type PC repair shop

I often do system reinstalls
but not enough same PCs that i would just image everything

I install basic software
can I automate this process?

I know python
but if theres better tool for this I am all ears

for example, first task, install irfanview by script
unchecking some settings, navigating to next screen, finishing the installation
then maybe set associations
>>
>>55667568
just use intellij, it does all this shit for you
>>
>>55667574
Look up silent installations for the software you need to install. Most .EXE installers have a /s or /q or /quiet command line switch.

Consider utilizing Ninite.

You're going to want PowerShell for this.

t. Sysadmin for a large MSP
>>
>>55667574
https://ninite.com/
>>
>>55667591
Intellij was a bit confusing for me, especially once I installed it I could not run any programs, the run button was greyed out and that sort of stuff.
>>
>>55667574
if the installers don't offer a command line the solution will be a hacky one, but you could do it in python
>>
>>55667591
NetBeans does too
>>
>>55667595
What do Systemadmins do all day?

sudo apt-get install ${packagename}
>>
>>55667187
void MakePyramid(int height)
{
for (int i = 0; i < height; i++)
{
for (int j = 0; j <= height; j++)
{
(j < height-(i+1)) ? printf(" ") : printf("#");
}
printf("\n");
}
}
>>
>>55667603
i started with eclipse and trust me, intellij is top shit
looks like you didnt have a run config for some reason (if you create a project using one of the templates it sets it up for you), you can google that and it just werks every other time

>>55667625
if you jump through loops like a monkey
>>
>>55667634
lots of log reading
lots of
>this thing has started throwing errors and we don't know why
lots of modifying config files
>>
>>55667634
I'm not a sysadmin in the traditional sense.

I work for an MSP, so I have over 40 clients.

Lots and lots and lots of scripting/silent apps in PowerShell, Python, C#, etc.

I don't do any of the troubleshooting, the tier-1 helpdesk guys do that. I write all of the scripts and reports and dashboards that they use.

Half of the job is duct-taping technologies together.
>>
>>55667644
Ahh so going into the config files and modifying all the files with different linux commands

I am also assuming you look at stack exchange for all different errors that come up

Sounds pretty comfy is there lots of free time in between breaks during work?
>>
>>55667670
>Ahh so going into the config files and modifying all the files with different linux commands
Most of all enterprise infrastructures are on Windows-based machines, and there's not much to be done with Linux machines that the application vendors don't take care of.

>I am also assuming you look at stack exchange for all different errors that come up
General googling for obscure errors and to see if anyone else in the world has had to do what you're about to have to do.

>Sounds pretty comfy is there lots of free time in between breaks during work?
I'm sitting here shitposting in /dpt/ while getting a bit drunk. At the office.
>>
>>55667708
holy shit they let you get drink at work? wtf lol where is this magical unicorn place
>>
>>55667738
America, my friend.

They pay for the booze, too.
>>
>>55667748
the fuck

here in Canada all we get is diversity training and no snacks
>>
What's a good antonym for "setup"? I've settled on "teardown" for now.

It doesn't matter much, but I'd like for it to be intuitive that
server_teardown(void)
shuts down the server setup by
server_setupid(params)
>>
>>55667738
When I worked at Edmodo we had beer on tap.
>>
>>55667787
seppuku desu
>>
>>55667770
>here in Canada all we get is diversity training
audible kek

Don't they at least provide a daily stipend of maple syrup and poutine?
>>
>>55667787
shutdown
>>
>>55667643
>if you jump through loops like a monkey
No, it's really simple.
>>
>>55667792
I never knew IT and alcohol mixed so well

>>55667804
Daily poutine would be great but sadly no poutine
>>
>>55667770
lots of tech places in america have stuff like beer and free food
and free gym memberships, and allotted nap sessions during work hours
and all kinds of other shit to try and get you to work for their tech company instead of another one
>>
>>55667643
Well I guess I could try it again. Interestingly enough, when I try to run a Java program through the command line, it opens it in intellij instead of running it via command line. Kind of pisses me off. Anyway to fix that?
>>
>>55667886
what do you type in command line to run it?
>>
>>55667901
Actually I just fixed that too.. well I guess I'll use intelliJ now.
>>
How the hell do I setup a Rust project in IDEA? It sees the toolchain but "Make project" does absolutely nothing.
>>
>>55667252
you're on /g/, everyone here's autistic. stop moving the goalposts
>>
>>55668025
I'm not autistic
>>
>>55668025
I'm not autistic
>>
>>55666624
why yall weebs so fucking corny though?
>>
>>55668041
Or so you think.
>>
>people complain about anime OPs for DPT
>forgetting the humble origins of the DPT when the only OP images we had were the asuka and rei images and sometimes people used the SICP cover
>>
>>55667973
nvm I think I got it
>>
>>55668068
wasn't it mostly that robot bitch from haruhi
>>
File: export.png (197KB, 1024x1024px) Image search: [Google]
export.png
197KB, 1024x1024px
>>55666624
I was going to make a CAPTCHA type thing, but ended up just generating this pretty image.
>>
Apologize if this is not the correct thread to ask this.

I know almost no coding or programing (Had a class on Pascal but that's useless) and I want to learn C++ by myself

Should watching youtube videos be enough for the beginning or do I need books or other tools?
>>
>>55667787
Cleanup
>>
File: ?.png (7KB, 120x120px)
?.png
7KB, 120x120px
I have a program made in python, that does some image processing.

Now, i would like to put it on the web.

how do i do that? any advice?

thanks
>>
>>55668215
Just use whatever resource you can
>>
>>55668215
Reading a tutorial is usually a lot better than watching videos.
>>
>>55668226
What do you mean 'put it on the web'?
Upload it? Put it in an app store? Have some kind of webside front end?
>>
>>55668226
Do you want to make it a web page?
Use Django.
Do you just want people to be able to download it?
Put it on GitHub.
>>
>>55668235
This. Videos are incredibly inefficient.
They're effectively the same as a well written tutorial and lack the active interaction of someone directly helping you.
>>
>>55668242
>Have some kind of webside front end?
yes i want people to submit their images and then my python script will process them.
>>
>>55668256
>>55668235
Then can you recommend a good C++ tutorial?
>>
File: good job.jpg (18KB, 300x265px) Image search: [Google]
good job.jpg
18KB, 300x265px
>>55668205
this is indeed pretty.
>>
>>55668285
This is what I've used.
http://www.cprogramming.com/tutorial/c++-tutorial.html
>>
In Java, how do I make something happened when a certain key combination is pressed?
>>
>>55668285
"C++ Primer" or "Programming Principles and Practice Using C++" followed by "Discovering Modern C++", followed by "Effective Modern C++".
>>
>>55668331
>>55668345

thanks
>>
>>55668341
1.read input
2.if input equals X:
do something
>>
>>55668341
You can't really do that if you are running in the console/terminal.
>>
>>55668341
https://docs.oracle.com/javase/tutorial/uiswing/events/
>>
>>55668367
So I have to make it a GUI application then? Okay.
>>55668365
Useless answer.
>>55668375
Good answer, let's see if I can do this properly. I don't like Jswing though, I use SceneBuilder and JavaFx.
>>
>>55668424
key combinations with a modifier key and one normal key are possible in the console
>>
>>55668424
what are you trying to do?
>>
>>55668480
I'm playing a shitty game called Space Station 13. I want to (to prove that it can be done and teach myself something) write a program that, when a certain key is pressed, get an item from the backpack, and shoot at the screen (at a particular pixel color). Basically it would be a "cheating" device.

So this involves:

>Running in the background while the game is playing.
>Listening for a certain key combination to be pressed.
>Once the combination is pressed in game, the program will continue
>Move the mouse to a specific location
>Left click
>Search the screen for the appropriate location to click (a certain pixel color)
>Left click

All of this should be done quickly.
>>
>>55668542
kek
>>
>>55668542
you want to listen into global keyboard inputs?
you probably have to do some winapi shit
>>
>>55668542
http://docs.oracle.com/javafx/2/events/jfxpub-events.htm
>>
>>55668585
Yes, maybe it would be easier to write in a different language. But I.. only know Java.
>>
How long did it take you all to go through SICP?
How do i get good at assembly?
>>
>>55668618
I think there are some Java wrappers for the Windows API.
And there's stuff like JNA
>>
>>55668542
autohotkey script
>>
>>55666983
>Write Your Own Adventure
What did he mean by this
>>
>>55668655
you have to be BORN good at assembly
>>
>>55668744
*assembled
>>
>>55666983
What site is that paterfamilias
>>
>>55668738
Multiple positions open

>>55668779
Hired.com
>>
How do I get app ideas? need something to my portfolio to show off to potential employers
>>
>>55668542
>SS13
If the player is any good they can dodge around your shots anyway. And the lag will mean this is only useful against stationary targets anyway
>>
>>55667848
they give you that kind of shit because the job is hell and you'd never stay otherwise
>>
>>55668834
Where are these positions?
>>
generics vs templates?
>>

package testing;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

// author kenneth

class Testing
{

public static void main(String[] args)
{
String[][] users = new String[2][2];

users[0][0] = "John Doe";
users[0][1] = "Doe Industries";

users[1][0] = "John Doe";
users[1][1] = "Doe Limited";

String[][] moo = new String[2][2];

if(users[0][0].equals(users[1][0]) && !users[0][1].equals(users[1][1]) )
{
moo[0][0]= users[0][0];
moo[0][1]= users[0][1];

moo[1][0]= users[1][0];
moo[1][1]= users[1][1];



}
System.out.println(moo[0][0]);
System.out.println(moo[0][1]);
System.out.println(moo[1][0]);
System.out.println(moo[1][1]);


}
}


>>
>>55668952
Doesn't one imply the other?
>>
File: vid_1469038305.webm (476KB, 1267x966px) Image search: [Google]
vid_1469038305.webm
476KB, 1267x966px
>>55667574
>>55667595
>>55667602
>>55667606
God I love python.
what do you think?
seems pretty damn nifty yet simple as fuck

http://pastebin.com/KW6Vc4r1
>>
File: colors2.png (92KB, 512x512px) Image search: [Google]
colors2.png
92KB, 512x512px
>>55668205
Now with colors!
>>
>>55668952
HKTs
>>
>>55668987
Not a silent installation, 2/10 would not let admin my systems.

http://www.irfanview.com/faq.htm#Q72

RTFM and get an RMM tool
>>
>>55669012
That's quite pretty.

Render something slightly darker in desktop resolution.
>>
>>55669079
this was just a test case, I will use silent installation where available but thats trivial

but the ones that dont offer silent install are that will need some automation love
>>
>>55669038
?
>>
>>55669079
read your comment to the end..

>RMM tool
for when someone brings notebook for hdd change and system reinstall?
>>
>>55669126
Oh, it's all you sitting in front of each machine in-person?

Never mind then, carry on.

Sounds inefficient as hell though.
>>
>>55669147
would be worth an effort if customers would be flooding us
we get on average 2 people a day
>>
>>55669164
How do you keep the lights on? What other services do you provide?
>>
Question about style in python.

Learned a little about functional programming recently, so wrote some scripts for work that are structured like:
>bunch of functions, each do one thing and return one value
>at the bottom, have a few lines where the functions are called
>some functions take other functions as arguments

Is having a load of functions calling each other bad stylistically? It looks neat as fuck, but I just wonder from a best practice point of view if its a good idea
>>
>>55669177
post code
>>
>>55669169
The boss is the sysadmin for like ~12 business around the city.
Thats from where the money actually come.

But shop for the normal customers is just extra and to keep contact with the public I guess... and theres loads of customers just buying shit, I meant ~2 come with shit in need of fixing by techie - me
>>
>>55669177
It will get to the point where making 15 functions do a tiny little task each will become more cumbersome than creating 2-3 commonly-used functions to perform the majority of the business logic.

Hard to say without seeing how crazy you're getting with the 'purity'.
>>
File: wallpaper.png (823KB, 1920x1080px) Image search: [Google]
wallpaper.png
823KB, 1920x1080px
>>55669102
Like this?
>>
>>55669246
purity isn't the problem, the problem is python is not built for functional programming
>>
>>55669295
Yes.

However, it looks like a bunch of colorful butts.
>>
>>55669191
Can't, unfortunately- work for a tech startup with crazy NDAs, any shitty scripts I write are theirs (i.e. OC donut steel) so can't spread it, no matter how shitty they are

>>55669246
I thought functional programming relied on each function doing one thing, no? How do those guys manage if it becomes that unwieldy?
>>
File: comfy.png (82KB, 1183x628px) Image search: [Google]
comfy.png
82KB, 1183x628px
>>55669329
>>
File: g v3.png (1MB, 3840x2160px) Image search: [Google]
g v3.png
1MB, 3840x2160px
>>55666624

After being forcibly stuck in the NEET life for months, I'm finally taking initiative and remembering how to code so I can get a job one day. Currently throwing together a shitty personal organizer as a warm-up, and then I'm gonna load it with everything on pic related and work through it.
>>
File: wallpaper2.png (541KB, 1920x1200px) Image search: [Google]
wallpaper2.png
541KB, 1920x1200px
>>55669324
Now it looks more like a cloud.
>>
>>55669429
hotboxing in a church /10
>>
>>55669369
Why the fuck you keep posting this shit?
>>
printf magic version

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv)
{
int i, n;
char s[128];

n = atoi(argv[1]);
if (n < 1 || n > 23) {
puts("Bad input");
return 0;
}

printf("Height: %d\n", n);

strcpy(s, "%");
itoa(n + 1, s + 1, 10);
strcat(s, ".*s\n");

for (i = 2; i < n + 2; i++)
printf(s, i, "########################");

return 0;
}
>>
>>55669394
>everything
Sure thing, buddy.

Make sure to post your MMORPG, RTS game, and Twitter/Facebook/Pinterest clones here when you're done with it.
>>
>>55669369
That looks absolutely useless.
>>
>>55669473
pajeet tier
>>
>>55669474

That's why the "everything" was partnered with the "load it" and not with the "work through." I have no expectation of doing most of the latter half, which is pretty obviously stuff someone slapped onto the earlier versions for the sake of CONTRIBUTING :^)
>>
>>55669468
it's an example of some functional code

>>55669482
It would be useful for
>testing framework
>inspecting types
>seeing relationships (e.g. Bool & Either () ())
>meta functions
>>
i know what a binary tree is

what is a red black tree
>>
>>55669495
Fair enough. My reading comprehension sucks.
>>
>>55669489
nobody asked about your latest project
>>
>>55669496
Do you have a practical example of when you've used this dumb bullshit for those things?
>>
>>55669473
this is really really bad
>>
>>55669514
then you'd ask for a practical example of when that itself was used

do you know what unit testing is?
>>
>>55669509
regards, printf god
>>
File: 1456720630370.png (917KB, 568x825px) Image search: [Google]
1456720630370.png
917KB, 568x825px
>>55669496
>>
Just finished programming a Command-Line Hangman game in under 100 lines... Feels good, man
>>
>>55666642
is that a good thing?
>>
>>55669546
NEET?
>>
>>55669562
Currently preparing to attend uni, so no
>>
>>55669552
No, the Go devs are actually trying to move to a different method.
>>
>>55669522
No, I have never done unit testing, nor have I heard the phrase unit testing. I am completely oblivious to basic software development practices, and have no place questioning your dumb bullshit.
>>
>>55669546
Bet I can do it in like 24 lines.
>>
>>55669598
Do it
>>
>>55669570
Why do you bother with console based apps? No one cares about it.

If you showed that in uni you will be a joke.

t. first-year cs peasant
>>
>>55669620
Fucking auto "correct"
>>
Go to an interview and they give me their manual to read through their in house library and the technical test is to debug their code and write a few functions for them

Am I being memed?
>>
Where does the "Java is insecure" meme come from? Are normies still thinking "web applets" when they hear Java?
>>
>>55669638

That is beyond memeing. Expect to see that position open for the rest of time.
>>
>>55669579
ok well if you had heard of unit testing
the code in the picture gives you a list of all the values of that type
(except values containing 'undefined')

so if you wanted to test an (a -> b) function called F, you know you could do something like

F <$> (values :: [a])

this is all of the outputs of the function

you could get a random one

let inputs = values :: [a]
let outputs = F <$> (values :: [a])
r <- randomRIO (0, length inputs)
-- length should probably be added to the typeclass
-- this would be a problem for large types
(inputs !! r) -- a random output
>>
>>55669620
It's mostly for practice so that I'm not as incompetent at programming by the time I start my major
>>
I have a MySQL insert statement that always times out if I run it in Python using the MySQLdb connector while it finishes nearly instantly if I directly interface with the MySQL server using either the command line or MySQL workbench.

Could it have to do with the fact that the MySQL server is on a separate machine from the machine running the python script? That doesn't really make much sense to me since MySQL workbench and the command line tool (through SSH) are run from my computer which is separate from the MySQL server too.
>>
>>55669662
*outputs = F <$> inputs
>>
>>55669655
Why do companies do this?
>>
With a creative commons share alike license, does the entire program have to be under the same license or just the portions licensed under share alike?
>>
>>55669705
If you own the CC-SA'd thing, you don't have to do shit.

If you are using someone else's in your own code, you need to make the whole thing the same license. If it's just assets though, you don't have to license the code that way.
>>
>>55669689

There's two reasons.

If they're malicious and stupid, they're doing this to prey on jobless saps to get some free work, ignoring how shoddily that will make the results.

If they're just stupid, they're thinking "giving away company library access to every applicant can't possibly backfire," and they might otherwise be reasonable.

If you're desperate, hey, whatever, go for it. Just don't get your hopes up about it being a good and/or real job. I've never heard of any company forcing you to read up on their specifics before a coding challenge. Any assessment of your skills could be done just as easily on a self-contained hundred-line piece of code.
>>
>>55669725
Okay, I'm thinking about getting into drawing and I can't decide which license to use. I've been told that cc0 or one of the creative commons licenses was better suited for art and documentation rather than GPL. Are there any advantages to using cc0?
>>
Could someone else look on this elisp code snippet for me? I've written it around 3 am and read that docstring too often to be able to tell if it makes sense and describes the function sufficiently well.
(defun ltools-init-hook (hook local &rest body)
"Initialize HOOK, wrap and add all expressions in BODY.

Overall this function is a rather thin wrapper for `add-hook'.
HOOK will be (re)set to nil, all expressions in BODY will be
wrapped into a lambda expression and then added to the value of
HOOK. The first expression in BODY will be the first in HOOK,
and so on. If an expression in BODY is redundant, it will only be
added once, the first time it appears.

The second argument, LOCAL, if non-nil, says to modify
the hook's buffer-local value rather than its global value.
This makes the hook buffer-local, and it makes it a member of the
buffer-local value. That acts as a flag to run the hook
functions of the global value as well as in the local value.

HOOK should be a symbol, and BODY should consist of quoted valid
Elisp expressions. HOOK is always first set to nil.
The return value of ltools-init-hook is the value of HOOK."

(set hook nil)
(dolist (expr body (eval hook))
(add-hook hook `(lambda () ,expr) t local)
)
)
>>
>>55669670
You won't be doing console programs. Trust me.

Console programs are only a high school thing.

The education will be around OOP, so start learning patterns and other design related things.


If your are from the other side of the Atlantic then it may be not true to you.
>>
>>55669791
cc0 is just public domain - everyone can do whatever with it

if you don't care if someone's making money of it (NC), doesn't give you credit (BY), or release some changes to your drawing under a different license (SA)
then go for it or use any combination of the above restrictions you want
>>
>>55669798
This is so fucking bad. It teaches "coding" but they use very long comments to do that. What if the actual student starts doing that too?
>>
how prevalent is the bullshit android variable naming convention? i really dislike it but it looks as if i have no choice
>>
>>55669670

You're being memed on. Courses that don't have a direct UI component won't care in the slightest what format you're using, as long as all requested functionality is present.
>>
>>55669903
I wrote that, actually. Well, I copypasted the original add-hook docstring and rewrote it appropriately, or so I tried.
>>
>>55668048
Yeah neither am I lol
>>
>>55669874
Thank you. I think I'll go with CC BY 4.0 because it's more compatible with GPL than SA is.
>>
>>55668041
I am acoustic actually.
>>
if(list.size>0){
for(Object o: list){
fooList.add(o);
}
return fooList;
}else{
throw new SomeEmptyListException();
}



is using exceptions this way pajeet tier? i never really used exceptions before
>>
>>55670157
>pajeet tier

Seriously, when will this fucking stop?
"Pajeet" exclusively refers to Java programmers
>>
>>55670157
if (!list.size) {
throw new SomeEmptyListException();
}

at the top is better style imo.
>>
whats teh worst programing language ever and why is it csharp
>>
>>55670197
malbolge?
>>
>>55670197
Because its users willfully ignore that nowadays it's pretty much just Java + .NET.
>>
>>55670157
Exit asap. Should be if list is empty throw error, else ...
>>
>>55670197
C++
>>
>>55670157
Yes absolutely.
>>
>>55670226
>>55670189
okay so the usecase is correct it's just the order that is incorrect?
>>
>>55670186
are pajeets the same set as java programmers or just a subset of java programmers?
>>
File: Java.png (17KB, 484x402px)
Java.png
17KB, 484x402px
>>55670270
that's the question, isnt it
>>
Bare metal C# CLR when? Managed OS dev is the future.
>>
>>55670305
We will just end up running everything on jvm probably.
>>
>>55670305
That's absolutely stupid.
>>
>at work
>stackoverflow goes down for like 20 minutes

made me realise how much i relied on it haha
>>
>>55670508
Not him, but managed OS research has been pretty active in academia for the past several years. There are benefits to it.
>>
>>55670550
A lot of apps can be run in vm, but the OS no, never.
>>
>tfw /dpt/ is closest thing to friends as you got
>>
>>55669903
>What if the actual student starts doing that too?
so what if they do?
>>
>>55670292
That's extremely weird but you should be using primitive int.
>>
http://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016
>>
>>55670576
>never

Why would you say that? It's already a thing. Not in any mainstream OS, but like I said, in academia. Normally the OS runs on top of the hardware and the runtime runs on top of the OS, but in this case that relationship is simply flipped. The research is mostly based on developing ultra secure OSs, but performance has been pretty similar to a "normal" OS as well.
>>
>>55667539
>guys why are your programming languages better it cannot be true please do not post that
>>
File: qqqqq.jpg (127KB, 500x500px) Image search: [Google]
qqqqq.jpg
127KB, 500x500px
Should I make a 4chan+(8)chan+(420)chan app or a voat.co app?
>>
>>55670783

do something slightly original maybe?

this is why webdevs are fags
>>
>>55670783
Voat doesn't have an app that is of comparable quality to the ones that reddit has. Overchan is ugly as sin, and while Clover is amazing it's only for 4chan.
>>
>>55670836
>implying you need an app for 4chan
>>
>>55670407
Comedy gems like this are why I come to this freakshow and wade through umpteen gorillion gpu threads to find the real shitposting gold.
>>
>>55670760
>http://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016
https://swtch.com/~rsc/regexp/regexp1.html
im just saying. the go devs have been preaching this for a while. a bunch of decades, at least.
>>
>>55670847
~1,000,000 people on the play store would disagree with you.
>>
File: reeee.jpg (261KB, 900x900px) Image search: [Google]
reeee.jpg
261KB, 900x900px
Why is it so impossible to find answers to the simplest questions when it comes to programming?

FFS, how the fuck do you just generate a random list of 1024 integers in python?

Not a sample of y numbers from a list in range x, not a randomly selected integer in range x, just a random fucking list of 1024 integers to be fucked with at a later point

fuck
>>
>>55670882
I don't care about morons advice.
>>
>>55670956
You're not asking questions the right way.
>>55670972
I wasn't giving advice.
>>
>>55670956
possibly because what you're trying to do is so trivially composable of other sets of knowledge that no one was retarded enough to ask that specific question yet, and the python community is retarded enough to ask A LOT of specific questions.
>>
>>55670956
list(randint(-2**16, 2**16) for x in range(0,1024))
>>
File: yuk-sicp.jpg (189KB, 1260x720px)
yuk-sicp.jpg
189KB, 1260x720px
>tfw if you had the motivation you would have completed your project a month ago
>>
>>55671021
[randint(-2**16, 2**16) for x in range(0,1024)]
>>
>>55671021
>>55671040

>-2**16, 2**16

for what purpose
>>
File: 1451586760468.jpg (495KB, 640x1920px) Image search: [Google]
1451586760468.jpg
495KB, 640x1920px
Rate my OC
>>
File: fhIX5io.jpg (310KB, 1242x1227px) Image search: [Google]
fhIX5io.jpg
310KB, 1242x1227px
>>55670956
if you need to ask that, you shouldn't be trying to program...
>>
>>55670956

How you could find your answer if you weren't incompetent:

Dear google, how can I
>generate a random integer
>store multiple things together in some sort of collection
>make a for loop

And then combine them.
>>
>>55671063
>you shouldn't learn something you don't know
>>
>>55667407
Pajeet Jr.
>>
[{u'message': u"Some error message here", u'code': 5}]

I'm trying to learn about APIs/json
what does the u signify here? I see this a lot in the data the API sends me. What's the right way to handle this programmatically? What kind of data structure is this?
>>
>>55666843

are you including if they use a library like SDL or no?

i made a pretty shitty rpg game using sdl. only put like 30 hours in, but it came out alright for a first timer.
>>
>>55671057
Just some random range, wanted to pick a 32bit signed integer but I fucked up, should be -2**31,2**31
>>
>>55671068
lol, there must be a better way of generating a random list than making a for loop, that seems highly inefficient
>>
>>55671083
It's a unicode string
>>
>>55671083
it's a unicode string, handle it like any other string

data structure, is a dictionary in a list
>>
>>55671076
that's not something you learn you idiot, that's something you deduce, here you're asking people to do that work for you. while what programming is, IS doing that work. So if you can't do it buddy boy, go home and play your vidya.
>>
File: 521396216612397.gif (1MB, 181x148px) Image search: [Google]
521396216612397.gif
1MB, 181x148px
>>55670292
Integer a = 127;
Integer b = 127;
System.out.println(a == b); //true
a++; b++;
System.out.println(a == b); //false
a--; b--;
System.out.println(a == b); //true
>>
>>55671095

We're dealing with someone that resorted to frogposting after they couldn't google something properly. It isn't a good idea to stress him too much more.
>>
>>55671098
>>55671096
thanks guys
>>
>>55671121
>>55671121
>>55671121
NEW
>>
>>55670869
>that speed comparison
jesus FUCK how come we don't use that?
>>
>>55670956
>not a randomly selected integer in range x, just a random fucking list of 1024 integers to be fucked with at a later point
because
>randomly selected integer
has bounds of (-Inf,+Inf). the set of numbers your computer can actually even store in memory is infinitesimally smaller than the set of all numbers it could possibly generate if all you ask is
>random list of 1024 integers
that's why you have to specify a range
Thread posts: 323
Thread images: 29


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.