[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: 43
File: hime k&r.jpg (828 KB, 1536x2048) Image search: [Google]
hime k&r.jpg
828 KB, 1536x2048
old thread: >>54030402

What are you working on, /g/?
>>
>>54037315
Subtle trap shit.

I like it.
>>
File: rat.webm (2 MB, 504x500) Image search: [Google]
rat.webm
2 MB, 504x500
Ask your much beloved programming literate anything (IAMA)

>>54037315
>K&R
>1980+36
>>
nothing, as (You) (All)

>ITT I'LL MAKE THE LOGO
>>
>K&R
>1980+36
Is it really so bad? I learned C with it five years ago and I believe it was a fine introduction.
>>
>>54037368
Which licenses are considered free as in freedom?
>>
File: 1408751367381.jpg (2 MB, 3504x2336) Image search: [Google]
1408751367381.jpg
2 MB, 3504x2336
>>54037388
GPLv3
>>
>>54037315
real thread here >>54037326
>>
>>54037407
That's the only one?
>>
>>54037388
BSD (all variants)
MIT
GPL
LGPL
AGPL
CC-BY-SA
Public Domain
WTFPL
>>
File: project.png (167 KB, 1920x1080) Image search: [Google]
project.png
167 KB, 1920x1080
>>54037315
Playing around with graphing stuff
>>
>>54037388
The BSD and MIT licenses because they do not violate elementary property rights to the sole benefit of a small subset of programmers

>all your source are belong to us

But if you meant free as in marxist bullshit about being free from ever having to rely on others and even exchange capital for goods and services, the GPL because it robs developers of their private data so you can keep a small portion of your self determination.

BSD = free software
GPL = communal/communist software or "software of the people"
>>
Well shit.

I guess .NET, Xamarin, Mono, etc are all Freedom software now.

Dat MIT license.
>>
>>54037438
Source:
https://blogs.msdn.microsoft.com/dotnet/2016/04/01/net-at-build-2016-open-cross-platform-and-free/
>>
>>54037437
>BSD/MIT
>hey thanks for letting us take all of your software for use in our paid proprietary program without contributing anything back to open source you're awesome, we'll leave your name buried in a footnote of our company's products right under the 300 pages of mandatory GPL license displaimers

>GPL
>we don't want to use your software because then we'd have to GPL our product, we're not interested in contributing to open source, we'll just use this BSD cuck's code instead


If you're an individual and you're using the MIT/BSD license for applications and not library code, you're a cuck.
>>
>>54037437
>elementary property rights => no copyleft
No need for a spoon to dissolve such a vapid and feeble reasonning.
>>
Quick question.
If I want to relicense my code to another license and I've accepted a few pull requests on github, would I legally have to rewrite their contributions in order to say the software is completely mine to relicense again?
>>
>>54037475
>He cares about money so much he'd rather make his code unusable in production than let anybody make a profit from his work
How is it even freedom? It's a soviet-style communism - "I'm poor and so you should be too, we all should be equally poor^W free.".
>>
>>54037542
>needing necklaced users in order to make a profit
>blames it on CopyLeft
Educate you're self please thanks
>>
File: sudoers.png (17 KB, 731x467) Image search: [Google]
sudoers.png
17 KB, 731x467
Right back to this problem,

>>54036760
This is what my suoders file looks like now (After 30 minutes trying to fix the damn thing). Currently >>54036734 is still not running the script when I press the button, any ideas?
>>
>>54037542
I write software to contribute to free software.
The GPL license says only 1 thing: You're free to reuse my code so long as you give other users the same liberties I gave you.

I gave them the right to look and freely adapt my source code, they should be obligated to do the same.
If you are not willing to abide by the terms of my license, you're free to use someone else's code.
>>
>>54037475
>TAKE all your software

You shared a copy of the source. They didn't take anything.

>GPL = free lemonade except you have to share a sip with me if i ask for it, also you can't share the lemonade without crediting me and telling the person they also have to share a sip. forced sharing is freedom.

>>54037494
Copyright or copyleft = no elementary property rights

IP law leveraged for communist purposes still strips people of the right to their own data, which is not data they made, but data they possess on their own storage medium
>>
>>54037657
>GPL
>Free lemonade!
>Also here's some sugar, lemons and wood planks so you can go make your own lemonade stand! However, you can't charge money or pretend this was your idea.
>>
My compiler is screaming at me to fix the below code, but I'm not sure what's wrong with it. For the record I'm sure it isn't the logic in the function body, I'm doing something wrong in the declaration but I don't know what:


template<class T, int, bool>
bool validate(const T obja, const T objb, const T[], int num, bool v = true) {

bool result = true;

for (int i = 0; i < num; i++) {
if (arr[i] <= obja || arr[i] >= objb) {
v[i] = 0;
result = 0;
}
}

return result;

}

>>
>>54037750
>bool v
>v[i]
>>
>>54037750
I'm not 100% on how C++ templates work, but do you have to name your 'const T[]'?
>>
>>54037763

It's a boolean array. Forgot to add the [].
>>
>>54037750
>'arr': undeclared identifier
>subscript requires array or pointer type
> I'm not sure what's wrong with it
Are you compiling in your head or something?
>>
>>54037800

It's an array of type T. Dunno why but it only works that way, it won't accept an identifier.
>>
File: 1423681299680 (1).jpg (593 KB, 2121x1939) Image search: [Google]
1423681299680 (1).jpg
593 KB, 2121x1939
>>54037657
>IP law leveraged for communist purposes still strips people of the right to their own data, which is not data they made, but data they possess on their own storage medium
If your ideal world is one without copyright constrains, then a GPL'd communal domain is what's closer to it IRL. Copyleft is using copyright law in order to forbid you from using it against others, whereas MIT licensed software can be twisted in order to create a situation where someone possesses data but doesn't own it. It's obviously limitedly effective but it's the best we've got. Also: do you consider compiled software an acceptable form of owned data? I think the requirement to distribute source code along with software is right, don't you? why?
>>
>>54037832

Made recent changes and forgot to change the variable names inside. Still p. sure that itsn't the problem, just wanted feedback on the actual declaration
>>
Should I learn C++ or java? I know little of python but I want to learn C++ or java. Wich one is "better" programming language for me?
>>
>>54038005
"C++"
>>
>>54038005
Java
>>
>>54037315
is this book good for beginners?
>>
>>54037891
>I think the requirement to distribute source code along with software is right, don't you?
I think it's the right thing to do, but shouldn't be compulsory.

"I don't agree with what you're doing, but I respect your freedom to do so. I will allow the free market to determine whether it is acceptable by choosing whether or not to reward you with currency."
>>
File: hime c.png (1 MB, 1280x720) Image search: [Google]
hime c.png
1 MB, 1280x720
You have been visited by the 3 star programmer of Shimoshina Academy!

Good performance, triple indirection, and tail call optimization will come to you, but only if you post "Keep overflowing the stack, Hime!".
>>
>>54037750
You want to name the second template parameter and the third template parameter. I am not sure if const T[] will ever work. Usually you pass a pointer to T and arraySize.. You also want to pass references instead of making copies for performance reasons in this case (other case is when you want to locally modify the passed parameter but you don't do that here..).

I suggest:
template<class T, int NAME_OF_INT, bool NAME_OF_BOOL>
bool validate(const T& obja, const T& objb, const T* arrayPtr, int arraySize, int num, bool v = true) {
//I don't care about the code only the declaration :)
}
>>
>>54038144
I'd overflow that stack.

If you know what I mean.
>>
>>54038005
C++. Java will teach you bad practices and enforce bad practices while C++ lets you do either bad practies or good practies.

You will learn more and be surrounded by more competent programmers if you go with C++ (I believe).
>>
>>54038120
if you ever have plans of taking classes look at the college you would take them at and learn their book
>>
>>54038005
Java: You don't have to worry about memory management; Programs can run on multiple platforms; Easier to debug.
>>
>>54038198
Yes.

Although I don't know if this is just confirmation bias on my part. My experience with Java programmers are they just recite shit from memory without actually thinking about the code they write. Probably because Java is fucked syntactically.
>>
>>54037368
that's cute, are there any disadvantages to having a pet rat?
>>
When I load this page it instantly sends the "exec("sudo python /home/pi/PythonScripts/test.py");" without waiting for me to press a button, how do I prevent this?
<html>
<meta charset="UTF-8" />
<!--
<style>
.button {
background-color: #707070;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.center {
margin: auto;
width: 60%;
border: 3px solid #D0D0D0;
padding: 10px;
}
</style>

$db = new SQLite3('mysqlitedb.db');

$results = $db->query('SELECT bar FROM foo');
while ($row = $results->fetchArray()) {
var_dump($row);
}
-->


<head>
<title></title>
<h1 class="center">Raspberry Pi Home Automation Control Hub</h1>
</head>
<body>
<?php
if (isset($_POST['LaunchProgram']))
{
exec("sudo python /home/pi/PythonScripts/double.py");
}
if (isset($_POST['CurtainToggle']))
{
exec("sudo python /home/pi/dummy.py");
}
if (isset($_POST['LockToggle']))
{
exec("3");
}
if (isset($_POST['LightToggle']))
{
exec("sudo python /home/pi/dummy.py");
}
if (isset($_POST['KettleOn']))
{
exec("sudo python /home/pi/PythonScripts/test.py");
}
?>
<div class="center">
<form method="post">
<button name="LockToggle">Open/Close Lock</button>
<button class="button" onclick="alert('Program Launched')" name="LaunchProgram">Launch Program</button>
<button class="button" onclick="alert('Curtains opened/closed')" name="CurtainToggle">Open/Close Curtains</button>
<button class="button" onclick="alert('Lights turned on/off')" name="LightToggle">Turn Lights On/Off</button>
<button class="button" onclick="alert('Kettle turned on')" name="KettleOn">Turn Kettle On</button>
</form>
</div>
</body>
</html>
>>
>>54038138
Well-reasoned position. No, really I mean it. It's defensible. I'm an unmoderated do-gooder tho, so brb securing my software against unethical exploitation by my sworn enemies because I can.
>>
>>54037437
>The BSD and MIT licenses because they do not violate elementary property rights to the sole benefit of a small subset of programmers
>leaving out Apache
REEEEEEEEEEEEE
>>
>>54038248
>PHP
why lad?
>>
>>54038198
it's the other way around. messed up OOP stuff in C++ will teach him bad practices. Java only removed memory management boilerplate
>>
>>54038295
I've spent ~48 hours looking for a way to control my program from mobile and this is the solution that finally worked. I've never even touched php before I don't even know what I'm doing with it.
>>
Daily reminder you are all shit at programming because you don't program in Java
>>
File: 42265436_p0.jpg (3 MB, 2462x1740) Image search: [Google]
42265436_p0.jpg
3 MB, 2462x1740
>>54037315
How do I scale textures in OpenGL 3.3+ preserving aspect ratio?
I would like to also do interpolation in the shader.
Do I scale in the shader as well or no?
>>
>>54038355
>Java
lmao
>>
I am writing a kernel module for my raspberry pi to use a board my professor made. In the end, it will hopefully write an afsk modulated signal to the DAC on the board.
>>
>>54038385
This better be in Java or you are wasting your time
>>
>>54038399
>Java
seriously hope
>>
File: index.png (3 KB, 300x168) Image search: [Google]
index.png
3 KB, 300x168
Is it possible to crack a password-protected 7zip file?

I encrypted a file with a random 100 digit password (using Upper letters, Lower letters, White Spaces, Minus, Underline, Numbers and Special caracthers).

i ask this because there are tools like John the ripper and fcrackzip which they claim it can crack any zip file, and i want to put an encrypted file in dropbox, so i want to be safe.
>>
>>54038427
>Is it possible to crack a password-protected 7zip file?
Yes, no matter the length, depending on 7zip's encryption algorithm
>>
File: le hands.png (24 KB, 386x306) Image search: [Google]
le hands.png
24 KB, 386x306
>>54038427
>>54038443
botnet please go what are you trying to hide
>>
>>54038362
Not really sure what you're asking. In OpenGL when you upload a texture you usually apply it onto geometry. You do this in the shader with a sampler object.

You can play with the texture coordinate values to manipulate the aspect ratio.

Interpolation happens automatically by OpenGL. You can set the texture property to either Linear or Nearest (might have additional modes in GL3.3 idunno) for different kinds of interpolation
>>
File: gr1.png (11 KB, 1084x156) Image search: [Google]
gr1.png
11 KB, 1084x156
Well the starting on reload problem is gone, when I press the button to launch my program I know it's running, but then when I try to interact with it by pressing the curtain or lock buttons it isn't interacting with the code anymore which should be waiting as pictured, any idea how I can make sequential lines of exec talk to the same place?

<html>
<meta charset="UTF-8" />
<head>
<title></title>
<h1 class="center">Raspberry Pi Home Automation Control Hub</h1>
</head>
<body>
<?php
if (isset($_POST['LaunchProgram']))
{
exec("sudo python /home/pi/PythonScripts/double.py");
}
if (isset($_POST['CurtainToggle']))
{
exec("1");
}
if (isset($_POST['LockToggle']))
{
exec("3");
}
?>
<div class="center">
<form method="post">
<button name="LockToggle">Open/Close Lock</button>
<button class="button" onclick="alert('Program Launched')" name="LaunchProgram">Launch Program</button>
<button class="button" onclick="alert('Curtains opened/closed')" name="CurtainToggle">Open/Close Curtains</button>
</form>
</div>
</body>
</html>
>>
>>54038568
> calling sudo in a web app..
>>
>>54038568
ABSOLUTE MADMAN
>>
>>54038582
Is there a particular reason to avoid this? It appears to run fine with it.
>>
File: banana.jpg (65 KB, 1280x720) Image search: [Google]
banana.jpg
65 KB, 1280x720
>>54038606
Nevermind him.
you keep doing what you're doing, anon~
>>
>>54038606
If you don't see what is wrong, please STOP working on what you are doing and get a job mopping floors.
>>
>>54038606
sudo
A Linux/UNIX command (short for SuperUser DO) allowing a user to execute a command that normally only the superuser (root) can perform.
>>
>>54038651
everyone already knows what it is
>>
>>54038651
Yeah, I'm using the php to tell the os to run the script as root, it's functioning exactly as it should be.
>>
File: Sudachi.png (226 KB, 966x592) Image search: [Google]
Sudachi.png
226 KB, 966x592
Working on managing music files with my MPD front end
>>
>want to try asm.js
>install emscripten sdk
>linux version: YOU GOTTA COMPILE THE WHOLE THING SENPAI
>run their dumbass scripts
>GIT CLONE
>COMPILE
>GIT CLONE
>COMPILE
>GIT CLONE
>COMPILE
>their fucking compilers take hours to compile
>all done
>try to compile a trivial screen print program
>doesn't even work

fuck webdevs, seriously
>>
>>54038674
ok, so let me explain why you should never do that and how to do it.

1) YOU ARE GIVING A WEBSERVER ROOT ACCESS.. Rule 1 is NEVER EVER EVER trust users..

2) If somehow it gets exploited you just gave them root on your box and pretty much ever other PC which that box can access.

The proper way is to use something like redis or etcd and store work items in there then have a daemon processing the items. Have the daemon on a white list system so it will not run unknown commands.
>>
>>54038658
Are you fucking sure? I am sure that everyone doesn't have the knowledge of what sudo is.
>>
>>54038702
i almost forgot
>git repo for emscripten alone is 500 mb
what the fuck dude
>>
>>54038746
please

quit your job
go mop floors
>>
File: 144243232324.jpg (22 KB, 400x388) Image search: [Google]
144243232324.jpg
22 KB, 400x388
>try your lazy best and learn
>feel like there's no hope and I'm never gonna be a true wagecuck
>motivation is fading and discipline is getting weaker
>you decide to write a CV with some shitty github project
>send it to a bunch of companies on indeed
>yfw you get a response asking when you are available to start and salary expectations
haven't felt this great in a long time, thanks /dpt/ I don't even care if I get the job it's just a great boost
>>
>>54038777
Nice trips anon, I'm glad you're feeling well too.
What's the project btw?
>>
>>54038777
trips confirmed, anon on a roll,
we're proud of you
>>
major study area no work
how do learn code 4 job pls
>>
>>54038813
https://www.codingame.com/start
>>
Hey /g/, I've been fucking around in programming as a hobby for a while (5 years) and I'm starting to want to do professional work.
...and by professional I mean total shit contract jobs on the internet that'll pay me chump change in bitcoin.

Memes aside, I know python and javascript. What fields are hiring freelance programmers and where do I get hired?
Specifically: what books do I read and what website should I sign up for / goto (i've seen fiverr etc)
>>
I am a developing and app that will, for now, show a listing of upcoming movies and it's details.
Yes, it's simple, but I am developing it to study. But I am having a problem: How should I name this project? Could you guys give me a suggestion?
>>
>>54038674
Please die
>>
>>54038852
>python and javascript
>freelance
Just get a real backend webdev job. I only picked up Python on October with no real knowledge on other webdev languages/frameworks and no degree, and landed a python/django job easily
>>
>>54038724
I can appreciate the serious security flaw here but I'm running this as a offline local system so I'm not too worried about that.
>>54038797
Yeah I think this is what was happening, explains why it was doing that and why it's just stopped.
>>54038863
I'm alright
>>
>>54038853
30 Minutes of Previews
>>
>>54038777
what are some non time consuming projects that look good on a CV?
>>
>>54038873
Sorry anon, but I didn't get it.
Do you care to explain?
>>
File: screenshot_00049120160414154619.png (119 KB, 1920x1080) Image search: [Google]
screenshot_00049120160414154619.png
119 KB, 1920x1080
What have you done today, /dpt/?
>>
>>54038885
In many movie theaters, there are an exorbitant amount of previews for other movies before the film actually begins.
>>
>>54038920
>developing for windows
why tho?
>>
>>54038852
>memes aside
>python and javascript
>>
>>54038935
I'm switching to Debian, but I need to get my wifi dongle first. Will this not compile on GNU/Linux?
>>
>>54038920
>using cuckpad++

Ugh.
>>
>>54038920
Tried to restore 4ch.be on a local MariaDB.

Restore failed.

Found out I needed a plugin only available on RedHat/Fedora

Loaded up a VM with Fedora

Spent 3 hours configuring it

Can't figure out how to move an 8GB file easily from my machine to the VM.

VMWare Tools is being a bitch (why do you need old kernel headers?).

Fuck it.
>>
>>54038955
What's bad about it?

>>54038956
Iktf, anon.
>>
>>54038922
Oh okay, you meant trailers. I get it now.
>>
>>54038724
Tbh lad it's just a amature work it doesn't need to be super secure using redis would be an overengineering overkill.
>>
>>54038961
>>
>>54038998
Why does this make the software itself bad?
>>
>>54038961
>What's bad about it?
Not enough features.
>>
>>54039016
It just werksâ„¢ for me.
What does it lack, in your opinion?
>>
>>54039027
Comprehensive IntelliSense and Go To Definition.
Performance benchmarking.
Debug breakpoints with customizable watch lists.
GUI preview
Automatic service reference generation for compatible APIs using a wsdl
reference counts on methods
time in ms between steps while debugging with break points
NuGet solution package management
Comprehensive database modelling

And more.
>>
>>54039093
>programming in C
>2016
kys
>>
>>54038998
What's FN?
>>
I need to know how linux treats the .txt file.
Especially what forms the file, if there are headers and such, because for fucking REASONS i have to move through a txt file using lseek and due to some ebin tricks i know the number of chars to move based on what i want to find, but the .txt size isn't exactly the number of chars, so there must be something else.

tldr i need infos about .txt file format, because 5 chars in .txt get to 6 bytes
>>
>>54039110
>implying you would use much of that list with C
>>
>>54038568
Read some stuff on computer science in general because you've no idea what you're trying to do.
>>
>>54038870
If you're trying to automate something, just create a python or ruby script.
>>
Today I shall be working in Java.

Not entirely my choice, but I guess that's what my algorithms professor prefers.
>>
>>54039241
System.out.println("ur faget");
>>
>most jobs reject me because I lack experience
>a few jobs send me tests I can't do
>the one job that interviews me calls when I'm half asleep.they ask if its a good time and I woozily say "can you call back in half an hour or an hour?"
>>
>>54039118
front national
french conservative nationalist party
>>
>>54039260
If you were really valuable to them, they would gladly wait.

Glad to know you're just a stupid neet tho.
>>
>>54039260
I am in the same place as you.
Even though I have a past job experience, since I "changed my career" from mobile developer to android developer, nobody wants to hire me.
What I suggest you is to try and keep active, try to find an online course, watch some youtube videos and try to develop a project and upload it on GitHub and use it to display your skills to interviewers.
>>
>>54039260
they're not gonna call back
>>
who wants to collab on a game
>>
>>54039261
So the devs take a political stance against assholes. I can get behind that.
>>
>>54039223
The automation isn't always on though. I'll probably just make it so it is though and only applies if the database tells it to, then I can just run a script to modify the database with php to effectively turn it on or off, should do the trick.
>>54039173
Anything you would recommend? I'm a computer engineering major so while I've got some programming experience it's mostly C and Python instead of fancy CS languages like Java or PHP.
>>
Trying to figure out simple graph algorithms.

#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <stack>

class graph
{
private:
struct vertex
{
bool visited;
vertex() : visited{false} {}
};

std::map<std::string, std::list<std::string>> adj_list;
std::map<std::string, vertex> nodes;

public:
graph(decltype(adj_list) adj_list) : adj_list{adj_list}
{
std::for_each(adj_list.begin(), adj_list.end(), [this](auto it)
{
nodes[it.first] = {};
});
}

void breadth_first()
{
std::queue<std::string> q;
q.push(adj_list.begin()->first);
nodes[q.front()].visited = true;

while(!q.empty())
{
for(auto& it : adj_list[q.front()])
if(!nodes[it].visited)
q.push(it), nodes[it].visited = true;
std::cout << " " << q.front();
q.pop();
}
}

void depth_first()
{
std::stack<std::string> q;
q.push(adj_list.begin()->first);
nodes[q.top()].visited = true;

while(!q.empty())
{
for(auto& it : adj_list[q.top()])
if(!nodes[it].visited)
q.push(it);
std::cout << " " << q.top();
nodes[q.top()].visited = true;
q.pop();
}
}
};

auto main() -> int
{
std::map<std::string, std::list<std::string>> adj_list =
{
{"0", {"1", "2", "3"}},
{"1", {"0", "4", "2"}},
{"2", {"0", "4"}},
{"3", {"0", "4"}},
{"4", {"1", "3"}}
};

graph{adj_list}.breadth_first(); std::cout << std::endl;
graph{adj_list}.depth_first();
}
>>
who wants to collab on a game
>>
>>54039363
>>54039432

depends on said game and other collaborators
>>
>>54039432
What language?
>>
>>54039490
it will be an isometric game for added challenge. basically just need another programmer
>>
>>54039528
And I bet the art is pixel shit ? No thanks.
>>
>>54039523
preferably java/libgdx. if you want to use a different language then you'll have to be the sole programmer
>>
Anybody know how to write a recursive piece of code that searches a 512x512 grid for a specific point? The base case is correct, since the scan method returns width if it's in the area, so to pinpoint it, it'd need to be 1. But i don't know how to search each part of the grid (by quarters) and then pinpoint the area coordinates.
>>
>>54039546
doesn't have to be but why not. do you really want to have to deal with quaternions and shit
>>
>>54039549
Java is my sole language.
>>
>>54039561
are you actually interested in developing a game though? also how fluent are you in java
>>
>>54039556
Nice documentation.
>>
>>54039579
I'm a freshman in college but I've learned most of what I know through self teaching. I'd look at the github repo and try to learn anything if I'm completely ignorant, but if it's way out of my skill I'll just fuck off.
>>
File: tips.jpg (38 KB, 1280x720) Image search: [Google]
tips.jpg
38 KB, 1280x720
>>54039602
>>
>>54039556
>if(...)// the animal is in the area...
>else // the animal is in the area...
>>
>>54038777
It's me again, apparently the guy who replied back to me is the CEO(never mentioned it in the mail) or someone writing in his name, I assume it's a good thing?
>>
>>54039628
Yeah had to redo the sources documentation. Originally was only checking a portion of the grid and had //it isn't in the grid
Just changed it quickly whilst writing the base case.
>>
File: Yoda.png (1 MB, 1253x1007) Image search: [Google]
Yoda.png
1 MB, 1253x1007
>>54039623
Why use an if statement if the animal is always in the area?
>>
>>54039648
Assume it's the final stage of the job interviewing process.
In the end, it doesn't matter if you're skilled or not, it's all about how "social acceptable" you're.
>>
>>54039659
>>54039650

Like I said, just quickly got rid of the original person's documentation, but updated for you. Thanks for looking out for me.
>>
File: eyes_twitter_com_draw4401.png (415 KB, 579x502) Image search: [Google]
eyes_twitter_com_draw4401.png
415 KB, 579x502
>>54039260
>a few jobs send me tests I can't do

This is my biggest problem with trying to get a job. I just don't have the ability to do the kinds of problems they ask in interviews and on interview sites like codility or hackerrank.

I've written tons of things in C, C++, JS, both small tools and full applications. I've done graphics programming with OpenGL, audio programming with GStreamer, interfaced with embedded, serial port programming etc and no one gives a shit at all because I just fucking suck at the programming puzzles

Its really frustrating and depressing. I've read cracking the coding interview, I try to do 'puzzle problems' every so often but I just don't have that kind of thinking ability.

It feels so unfair man. Like no matter how hard I work or how many practical things I can do I'm just fucked because my brain can't think in that way. I wish they would have screened for this sort of shit during my degree and failed me so I could have just moved on to some other field.
>>
>>54038485
But texcoord space is different from pixel space isn't it?
And I'd like to do bicubic interpolation for better quality which GL doesn't seem to have built in.
>>
>>54039690
What if the animal isn't in the area?
You should add an else if statement just to make sure.
>>
>>54039694
>i want a job!
>i literally do not have the skills they're asking for but i want money anyway

fucking entitled millennial shit
nobody owes you a job
>>
The more time I spend coding in C/C++, the more I'm convinced that there's really no better language.
If only they fixed
typename
shit in front of templated data types and the issue about not being able to split a template file in header and code files...

>>54039556
function search(p: Point, ...)
if it's in the area of size "width"
you know its first three numbers!
else if quarter area is > 1 square
split the map in 4 areas(NW, NE, SW, SE)
call function _search_ for each quarter

To split the map, create new search spaces by taking the median points of each side of your area.
For more infos, search for Quadtrees.
>>
>>54039694
What are some tests they've sent you?
>>
>>54039556
I didn't look through your core but generally you
want to recurse on the quadrant of the image that the point is in to narrow it down.
>>
making a 4chan archiver in go because fuck fuuka or whatever that java trash is
>>
>>54039718
We were supposed to assume there always is, but I have just added one to be safe. Thanks.
>>
>>54038341
just make an app in java lol
>>
>Wants to code
>Can't decide the name of the App
Help.
>>
>>54039773
quirky name or boring descriptive name
>>
>>54039771
Probably a bit late to turn around and learn a new language for this when I've got ~7 days left to get it all together.
>>
>>54039694
I'm the exact opposite. I'm great at interview problems but everything I write that's longer than a few functions is a shitty unmaintainable spaghetti code full of bugs
>>
File: ball_python_2.jpg (25 KB, 480x321) Image search: [Google]
ball_python_2.jpg
25 KB, 480x321
I'm going to start programming in python, which I have no experience in (nor do I have any experience in any programming language). So where do I start?
>>
>>54039755
Is this a complete 4chan archiver system complete with front-end or does it just scrape posts?
>>
>>54039800
im building the archiver, then the rest api, then the frontend in that order.
>>
>>54039784
Any suggestion for a quirk name involving movies?
I thought about "What to Watch" but it's too tongue-twister.
>>
>>54039728
>fucking entitled millennial shit
>nobody owes you a job
I never implied anyone owes me a job. All I said was that I wish I had a better idea that you had to be good at this sort of thing to get a job in the industry, and specifically that my university made it clear.

Usually you go to school to get the skills and knowledge you need to succeed in a career. But it feels like my degree is useless because I can't solve the kinds of problems that most interviewers look for.

No idea why you're so angry

>>54039741
I don't really have anything off the top of my head. Usually it starts out okay, they give you a problem and its straightforward for me to solve it in a naive way. Then pretty much all of the problems have a 'trick' where you have to go through like an 'aha!' moment to figure out a performant non-naive solution that has better complexity.
>>
>>54039755
why are you writing so much boilerplate just so you can use snake case for your json files
just use the go names, damn it
there isn't even a consistent json naming guideline, annotation exist to interface with existing names, but not to create more boilerplate for new shit
>>
I downloaded an embedded sdk and compiler for arm, and it doesn't run on my 64-bit linux, and i cant compile it because i don't know where they got their libraries from

would it make sense to install a 32-bit linux vm and run it in headless just to write and compile software through ssh?
>>
>>54039795
https://www.udacity.com/course/programming-foundations-with-python--ud036
>>
>>54039829
>Usually you go to school to get the skills and knowledge you need to succeed in a career.
college is not job training

also, the fact that you cant name even a single example means you're probably mentally retarded
>>
>>54039836
i generated it from the json response itself. i dont pick the "snake case" 4chan does, and snake case in go is frowned upon.
>>
>>54039714
Have you tried playing around with texture at all yet? If you want bicubic interpolation I think you can just set texture filtering to GL_NEAREST.

Then you can manually sample the texture in the fragment shader and apply whatever filtering you want (I don't know how bicubic works, but basically once you're in the fragment shader you can use texcoords to look up whatever pixel you want in the texture and interpolate them however you see fit)
>>
>>54039846
Ok I will try it, thanks.
>>
>>54039379
*tips hat*
>>
>>54039694
Yeah, the tricky algorithmic puzzles are more of a proxy measure of IQ than a test of actual programming knowledge.
It's reasonable, though, because IQ is really valuable for a coder.
>>
>>54039846
stop shilling udacity

>>54039910
If you've programmed for a good amount already, try Dive Into Python. It's available online.
If you haven't programmed before, Think Python is recommended.
>>
holy shit /dpt/ I forgot what rules for a language in a compiler are called that are written like this
<var> := <a-z*;A-Z*>;
or whatever, not regex
but the other variant
holy shit I'm so dumb
it's been so long I don't even know anymore what it was called

help me
>>
>>54039932
>stop shilling udacity
Why?
>>
you guys will never make money from programming give it up
>>
>>54039956
Do you mean BNF?
>>
>>54039956
syntax
>>
>>54038935
Even google and apple developers use windows to develop their shits.
>>
>>54040025
YES
god...
Thanks
>>
>want to learn Spring more in depth
>apparently all up to date Spring books are either shit or long winded as fuck
>tutorials are baby's first examples
what do? I already use it occasionally in my current job and check documentation when I don't know something, but my knowledge is really spotty that way and I have a job interview later this moth
>inb4 Java
>inb4 Enterprise
>>
Stacks in C are so elegant.
int *stack = calloc(sizeof(int), 512);
int size = -1;
stack[++size] = push;
pop = stack[size--];
>>
>>54039829
I feel for you. As an outsider to the field who got incredibly lucky to get a job, I feel for you. I suppose there are two things you can do, they are not exclusive:
1. Put something good on github and point to it. They might make you take the test anyway, so lower their expectations.
2. Yes, often there is the aha-moment. You may run into some problem you have never seen before. But there are like <20 concepts that come up consistently. Memorize them and check if one of them applies. If the test is in person, explain the naive algorithm - that will buy you time and demonstrate understanding.
>>
>used default java queue instead of implementing my own for java final project
>directions apparently implied you had to make your own
sweating-man.jpg
>>
do c functions like strrchr and index return a pointer to the specific character?

like could I call that function and use the pointer is returns as a new string?
>>
I want to write something like image converter. It opens a 256 color dos palette image and outputs info about each pixel that can be used in dos mode.
So later on I could simply open that output file, write it into dos video memory and have that image on screen.
In what data structure would I store that color info? In some kind of map? ARGB value of pixel would be the key, and dos byte value would be the value.
>>
What are some good free and opensource polymorphic engines?
>>
>>54040105
Even better in C++

std::stack<T> stack;
stack.push(123);
stack.pop();
>>
Trying to figure out what's wrong with this subquery right here

    ifnull(
(
SELECT
UName
FROM
`forum_users` `u`
WHERE
(`p`.`PDate`) = (max(`p`.`PDate`)) AND p.PAuthorId = u.UId
),
'UNknown'
)AS `LastPostIndexedAuthor`


p = posts
t = threads
u = users


When the thread has 1 post it returns the author name, when it has more it returns unknown
>>
>>54040368
>using a library when you could just use base language features
>>
>>54040398
std:: is part of the base language retard
>>
Post your void.h /g/

#ifndef VOID_H
#define VOID_H

#define true 1
#define false 0

typedef void v0 ;//void
typedef char c1;//text char %c
typedef long unsigned int uc4;
typedef long int c4;

//arithmethic signed types
typedef int8_t s1 ;
typedef int16_t s2;
typedef int32_t s4 ;
typedef int64_t s8 ;
//natural unsigned types
typedef uint8_t u1;
typedef uint16_t u2 ;
typedef uint32_t u4 ;
typedef uint64_t u8 ;
//Floating point
typedef float_t f4;
typedef double_t f8;
typedef long double f10;
//pointers to types
typedef v0* vp;//cast to raw pointer
typedef c1* c1p;//character string
typedef c4* c4p;//long int
typedef uc4* uc4p;
typedef s1* s1p ;
typedef s2* s2p;
typedef s4* s4p ;
typedef s8* s8p ;
typedef u1* u1p;
typedef u2* u2p ;
typedef u4* u4p ;
typedef u8* u8p ;
typedef f4* f4p;
typedef f8* f8p;
typedef f10* f10p;

#endif
>>
>>54040432
lol this is like ricing C

Good job confusing the shit out of everyone who will read your code
>>
>>54040432
fuck you this is triggering me


>>54040404
>>
>>54040432
>void.h
What? I just call mine types.h. You are just specifying types...
It's pretty much that with a few more union types for destructuring a byte into bits and multibyte integer types into byte arrays. Fuck dumb bitmasking shit.
>>
>>54040458
>>54040494
>>54040507

https://gist.github.com/FrozenVoid/87e6ad6212ac9ce496e0

you guys are weak
>>
>>54040105
I prefer linked list stacks.
No need to resize.
>>
>>54040584
I bet you also like shit performance
>>
File: 50314_288865372137_2985807_n.jpg (12 KB, 200x219) Image search: [Google]
50314_288865372137_2985807_n.jpg
12 KB, 200x219
>>54040584
>linked list stacks

stacks are LIFO for a reason. If it's not, then it's not a stack.
>>
>>54040584
>he likes linear time over constant time

disgust of the most absolute kind
>>
>>54040627
If you limit yourself to just accessing the ->head node, you have nothing to worry about.
>>
>>54040654
but... for what purpose... it's slower and less convenient...
>>
>>54040341
Anyone?
>>
>>54040677
No need to resize your arrays, anon.
>>
>>54040398
wanna know how I know you never had a programming job?
>>
>>54040723
>implying I don't use the company/group/project's preferred software stack when I'm working

not everything has to be practical, some things are personal
>>
>>54040518
That's the most retarded thing I've ever seen.
>>
>>54040723
Wanna know how I know you've never had a c++ job?
>>
File: TheProdigy.jpg (236 KB, 1737x662) Image search: [Google]
TheProdigy.jpg
236 KB, 1737x662
What's your opinion on the prodigy?
>>
>>54040736
you didn't say for fun and I took you for one of those retards who reinvent well tested and optimized libraries in their code for no reason and think that makes them good programmers
>>
>>54040368
Actually, that's disgusting in comparison. Knowing exactly how your stack operates is better, when possible.
>>
>>54040368
Why would you use std::stack over std::vector?
>>
>>54038244
yea they smell
>>
>>54040903
No it isnt.
push() = [++size]
pop() = [--size]

std::stack is an array like the calloc definition except it's dynamic
>>
File: 1457159864816.png (12 KB, 256x202) Image search: [Google]
1457159864816.png
12 KB, 256x202
Well I finally fucking figured out why int13h;ah=48h wasn't working, I didn't set the buffer size, I assumed it was filled in by the BIOS, not the programmer.
That also explains why removing the drive_no byte caused the function to work.
>>
>>54040961
They are similar, except std::stack limits functionality like insert etc. so it can be made sure the container acts like a stack and guarantees it
>>
>>54040751
Overrated. They really haven't done much noteworthy stuff.
Sure. Advancing so quickly is an achievement but it doesn't exactly constitute world news.
Especially his "operating system" that was on github was a clear indication he didn't get it back then. I'm sure he has learned a lot.

I really wish I was clever enough to actually make an effort and start university studies earlier. There's so much garbage you have to waste time on in public school.
>>
File: styrofoam cup.jpg (2 KB, 225x225) Image search: [Google]
styrofoam cup.jpg
2 KB, 225x225
>>54037315

I've decided to be honest with myself:

I really can't cope with anything but TI basic or embedded C

how do I into real programming
>>
>>54041110
embedded C is as real as programming can get.
>>
>>54040751
look at these babby programs jesus

https://github.com/sgonzalez?tab=repositories
>>
>>54041110
>how do I into real programming
Learn OOP. It's not hard.
>>
I'm just getting back into programming after a few years absence

Is there a list of common programming projects to help ease me back in? I remember doing little things like writing a function to calculate factorial and what not
>>
>>54041110
Just do embedded. With the whole "Internet of Things" hype, there's going to be a LOT of opportunities to sell really shitty poorly coded embedded crap to a bunch of morons
>>
>>54040751
don't know their music very much but I liked their smack my bitch up video
>>
>>54041137
Write a langtons ant and find a library/use OS API to render it in a window.
>>
File: 1449012854445.gif (811 KB, 480x320) Image search: [Google]
1449012854445.gif
811 KB, 480x320
>>54040372
pls
>>
File: 1411794385255.png (90 KB, 500x500) Image search: [Google]
1411794385255.png
90 KB, 500x500
how do pointers work?
explain it like I'm a small child.
>>
in c++ what does the ** operator mean?

for example in a tree class

Node **C;


I know that
int *a;

is an array, but what does the ** mean?
>>
>>54038244
>>54040988
They're kinda smelly, but rats are great anyway.
>>
>>54041196
a finger pointing to a chunk of memory where data is stored. putting a star next to the finger is like "opening the box" at the location and the value comes out
>>
>>54041139
i just looked that term up. people are so retarded
>>54041196
>>
>>54041232
its not an array, arrays are implemented with pointers. pointers are not arrays. ** is just a pointer to a pointer
>>
>>54041196
You're in a room, and you want your mate to pick up an object for you, your mate doesn't know where the object is, so you point to the object using your finger to show him where it is, he then picks it up for you and gives it to you.
But of course, you could just not be a lazy fuck and go get the object yourself, but other lazy fucks would call you out on "reinventing the wheel" if you did that.
>>
>>54041239
yeah I got that, but why do you need them?
>>
>>54041232
It's a pointer to a pointer. A location in memory which holds a location in memory which holds your 'Node'.
>>
>>54041139
This. The CS department wants me (ECE undergrad) to help a student with a capstone project related to IoT because no one in the department knows shit about embedded programming. I told him IoT was a fucking unstoppable shitty meme. And if the student or any faculty wanted to improve the technology they should make the project related to hardware security on IoT connected devices. We even have an expert in the ECE department on hardware security.

They didn't seem to like the idea, "Too difficult for an undergrad".
>>
What is /g/ experience working in Agile, Scrum or similar?

I'm looking for programming work, and I'm not sure how well I would function in such an environment. I have a huge complex regarding making mistakes, so my natural inclination is to work slower and get it right the first time, and not "fail fast". Also "dynamic team player with strong written and verbal communication skills" and Assburgers.
>>
>>54041196
int a=0,c=0,d=0;
int* b;

b=&a; //b now contains the address of a, b "point to" a
*b=5; //this (*b) is a dereference. It means "we're now referring to what ever b points to". So it's like writing a=5; in effect.
b=20; //sets b to the address "5". Which is in all likelyhood a bad idea since you don't own that piece of memory.
*b=10; //tries to write 10 to that piece of memory.
//999999/100000 this fails and the program crashes you don't set pointers to point at static memory locations ever.
foo(a,&c);


void foo(int passByValue, int* incomingPointer){ //Here I'm going to show the difference
passByValue=32; //this won't be reflected outside the function. passByValue is its own variable, it's not a.
*incomingPointer=32; //incomingPointerhad the address of c. So when we dereference it we're using it as if it were c.
return;
}
>>
>>54041277
to refer to places where data is without having to know the address. or send all the data to every function you call.
>>
>>54041332
a large child wouldn't understand this, let alone a small one
>>
>>54041290
>capstone project
What the fuck is a capstone project

>I told him IoT was a fucking unstoppable shitty meme
Eh, its going to be the next hot thing. I don't care about how terrible it will be, its already what the Silicon Valley vulture angels are pushing for. Getting experience with IoT adds 10 sexy points to your resume, especially for the stupid HR bitches and recruiters that will be looking at it
>>
>>54041332
Should probably make it clear that after foo was called c has the value 32. a still has the value 5.
>>
>>54041361
Fair enough.. But i think it's what anon really wanted.
>>
>>54041384
i think the dragon dildo analogy's better but w/e. he's honestly better off not understanding pointers
>>
File: sdfsdfsdf.png (19 KB, 910x195) Image search: [Google]
sdfsdfsdf.png
19 KB, 910x195
Dear DPT, please help me.

I have the following bit of code in C

 #include "keymap_common.h"

const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty */
KEYMAP(FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, ENT, \
LCAP, A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS, \
LSFT, NUBS,Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, \
LCTL, LALT, LGUI, SPC, RGUI,LEFT, RGHT, DOWN),


/* 1: FN 1 */
KEYMAP(TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, \
PWR , TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, MPRV, MNXT, MUTE, VOLD, VOLU, TRNS, TRNS, PGUP,\
TRNS, TRNS, TRNS, MPLY, TRNS, HOME, END, PGDN),
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_ESC),
};


I get an error message like this when I try to compile it

 
keymap_poker.c:5:5: warning: implicit declaration of function 'KEYMAP' [-Wimplicit-function-declaration]
KEYMAP(FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, \
^
etc.
..... make: *** [obj_gh60_lufa/keymap_poker.o] Error 1


I have no idea what I'm doing, can anyone tell me what I have to change to make this compile?
>>
>>54041430
>i think the dragon dildo analogy's
the what now?
>>
>>54041430
Wow.

What's that from? Specifically.
>>
>>54041449
Rest of the error message in pic related in original and this post, fucking character limit.

Trying to compile some keyboard firmware.
>>
>>54041449
no return value. Make it void?
>>
>>54041363
>capstone project
senior design? senior project?

Basically a group of students pick a project to work on during their last semester (or last two if you're engineering at my school), then they design, implement, and write a paper on the project. Training for a thesis or dissertation I guess. At my school they tend to be more adventurous and lengthy than the grad school projects, but slightly less technical, because there are multiple people working on them. Most schools I've seen have them in STEM majors.

I'm working on autonomous navigation systems this year and helped with a project last year on the controls and data logging systems of an experiment that was put up in space by NASA.
>>
File: rest in rip.jpg (134 KB, 1366x768) Image search: [Google]
rest in rip.jpg
134 KB, 1366x768
>He calls himself DevOps
>>
>>54041449
Are you certain KEYMAP() is declared in keymap_common.h?
>>
File: SpringWind-Mint-1600x1200.jpg (322 KB, 1600x1200) Image search: [Google]
SpringWind-Mint-1600x1200.jpg
322 KB, 1600x1200
I've learned python and sql through work (came into as clueless grad, learned everything on the job and through self-study), and I fucking loved it, really wish I'd learned to code as a kid. Also learned some lua for fun, via /agdg/.

What should I learn next? I'm torn
>Ruby, to see if I can work with some of the guys at work on some projects
>Javascript, to get a better understanding of how to develop for the web
>C or C++, as it seems to be universally in demand, and seems like a good education in how a computer actually works


Not sure where to go on this, any advice?
>>
File: 1264494855480.png (3 KB, 184x172) Image search: [Google]
1264494855480.png
3 KB, 184x172
What's a good resource for learning COBOL?
>>
>>54041302
I worked in an agile/scrum environment. I've done both daily and weekly scrums and at least where I've been the take away from both was that it's super easy to work at your own pace as long as you're meeting deadlines. In my case I was also the one making the estimates for those deadlines. I was able to set myself 'standard' deadlines and generally finish the work far far faster after which I could slack off at work and say I'm done whenever, if it got too boring all you need to do is move onto your next task. Other people I worked with had that real perfectionist mentality as well, so long as you're still getting your shit done it shouldn't be a problem. All of that dynamic team bullshit is just buzzwords, if you get along with your colleagues you have nothing to worry about.

All of this is subjective to the 1 month internship and 1 year contract I've worked so your experience may be different but there's really not much you need to worry about. You can probably score some easy points at an interview if you read up about scrums and scrum masters and can spout off some of the buzzwords in good context.
>>
>>54037425
Mah nigga
>>
>>54041512
I'm familiar with senior/finalyear projects. I've just never heard them called capstone project

You sound like you have a ton of pretty sweet experience
>>
How would one make a tripcode generator? Bored and looking for stuff to do/learn.
>>
>>54041139

I don't plan to fall for that meme. Also I've never made a single penny programming.

>>54041136

I want to make a little graphical program for a small geometry related project

basically my malfunction is I can't figure out how to draw shit on the screen, I guess

this sort of stuff isn't obvious to me
>>
>>54041593
Javascript will give you the most employability points. Its not going anywhere any time soon and its in demand everywhere.

C and C++ won't necessarily give you much insight into how a computer actually works, though you'll learn a tiny bit about memory management

I'd say you learn JavaScript first and then when you get sick of it (and you will), check out C and C++ so you appreciate what strongly typed languages are all about.
>>
>>54041615
generate passwords, extract characters to use as a salt, run them through crypt, print results
Thread replies: 255
Thread images: 43

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.