[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: 316
Thread images: 51

File: 1448976712622.png (346KB, 640x1136px) Image search: [Google]
1448976712622.png
346KB, 640x1136px
What are you working on, /dpt/?

Old: >>52361920
>>
File: 1414613401164.jpg (41KB, 400x343px) Image search: [Google]
1414613401164.jpg
41KB, 400x343px
writing SPARQL queries for a linked data course
>>
>>52366419
Dumb frogposter.
>>
>>52366410
Dumb anime poster.
>>
File: 1423051864866.jpg (328KB, 2000x1000px) Image search: [Google]
1423051864866.jpg
328KB, 2000x1000px
Nth for web development is real programming
>>
>>52366419
dumb frogposter
>>
>>52366410
Dumb pedophile.
>>
>>52366419
Dumb frogposter
>>
>>52366477
Only a paedophile would think an innocent image of a little girl is sexual.
>>
File: Langtons ant.webm (1MB, 154x240px) Image search: [Google]
Langtons ant.webm
1MB, 154x240px
So how are you supposed to make an OK ascii display on windows (or anywhere really) without that annoying clear blinking. Like how does nethack games do it?

Where can I read about it?
>>
>>52366410
>vagina clearly visible
why do they do this?
>>
>>52366498
make a UML diagram
>>
>>52366505
Try libcaca.
>>
>>52366506
because you're austistic
>>
>>52366497
>innocent
>chest exposed so you can see her side boobs
>in panties
>is blushing

take a picture of a child in that same pose and post it on facebook. I can bet you 99% would call you a pedo
>>
>>52366506
Why not
>>
making a VPN kill switch... cuz the ones that available doesn't work. I just got mine working and just need to clean up the codez.
>>
>>52366542
>Americans
>>
Alright so I have a function in C wherein I use a computed value numerous times. However, I do not want to define a variable to hold it and I don't want to compute it numerous times. What I want to do is use ebx/eax via inline assembly. How do I do it? I remember using this method in a driver I made a long ass time ago and it was something like __inline__asm ( "%eax": a) if I wanted to transfer eax to a. Anywho... help?
>>
>hurr durr what is the bump limit
>>
Well, at least we know it's not a trap image.
>>
why is nobody doing anything interesting

all just babby shit in c/c++
>>
File: 1436722233500.png (4KB, 386x20px) Image search: [Google]
1436722233500.png
4KB, 386x20px
Holy shit, what are the chances of this?
>>
>>52366611
>he doesnt know
>>
>>52366577
>However, I do not want to define a variable to hold it
>What I want to do is use ebx/eax via inline assembly.
Why the fuck would you want this?
>>
>>52366595
I just finished a self-expiring localStorage Set writer/reader with inter-tab synchronization.
>>
>>52366577
Just use a variable you non-portable nigger.
Your compiler will optimize it into a register anyway.
Or if you using a shitty compiler, you could use the register keyword explicitly.
>>
>>52366595
I'm writing a VM, a linker and an assembler for it.
I recently implemented virtual memory and interrupts in the VM.
All in C.
>>
File: 1442484648671.png (152KB, 448x789px) Image search: [Google]
1442484648671.png
152KB, 448x789px
>>52366633
How does that inter-tab sync works?
>>
should i make a stackoverflow account
do you have one
>>
>>52366633
Neat. Does it rely on randomness for correctness, or is it always correct? Do you need unique IDs?
>>
>>52366687
No, they are incompetent. 4chan is the best place for coding. Here the code monkeys can not bad the true coders. Clique of bad coders can not exist on 4chan. They can not rule like everywhere else.
>>
>>52366687
It wouldn't hurt to have one?
I mean i doubt it'd help much on a resume.

it's better to have a github, professionally speaking. that way you can easily link to projects you've done and it also shows anything you've contributed to.
>>
>>52366611
> Holy shit, what are the chances of this?
The odds of a file getting that CRC by coincidence are 1 in 4,294,967,296.

But the odds of the file's creator forcing that particular CRC (which isn't exactly hard) are somewhat higher.
>>
File: 1451500303327.png (443KB, 600x800px) Image search: [Google]
1451500303327.png
443KB, 600x800px
How do I stop writing spaghetti?
>>
>>52366779
Why did you post an empty picture?
>>
>>52366632
Just as a refresher really. It's kinda neat too and makes you think since the eax value changes every time and you have to consider that every time as well. Makes you think. It's a side-project too so I want to have some fun with it.

>>52366655
no. Sadly I can't be arsed to debug and see if the compiler optimizes it as such and it doesn't recognize the register.
>>
>>52366680
Found out this exists today https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent
>>52366701
I write and read to the same key, so I assume it to be always consistent, unless some wonky browser behaviour.
Source, if anyone cares http://pastebin.com/Nnrh5790
>>
>>52366505
double buffer? idk
>>
R8 my Fizzbuzz /dpt/:

fn main() {
let f = (1..).map(|i| match (i%3, i%5) {
(0,0) => println!("FizzBuzz"),
(0,_) => println!("Fizz"),
(_,0) => println!("Buzz"),
_ => println!("{}", i),
});

f.take(100).last();
}
>>
>>52366813
>It's a side-project too so I want to have some fun with it.
Even under "because I can", this is a retarded thing to do.

>It's kinda neat too and makes you think since the eax value changes every time and you have to consider that every time as well.
If that's what you want, go write assembly. Don't try second-guessing your C compiler.

>Sadly I can't be arsed to debug and see if the compiler optimizes it as such and it doesn't recognize the register.
It optimizes it as such unless it recognizes that doing so is more expensive than the alternative. You know, exactly what you want.
>>
File: 1429705842499.jpg (454KB, 1280x720px) Image search: [Google]
1429705842499.jpg
454KB, 1280x720px
Do you do a bit of CG and HTML, and a bit of Flash, /dpt/?

>>52366813
>no. Sadly I can't be arsed to debug
Well fuck you then.
If you don't care to look at your programs instructions then why the fuck do you even care about performance that much?
Anyway, if you're using either GCC or Clang, I can guarantee you that it will optimize it into a register, and if it doesn't, there's probably a good reason for that.
>>
File: 1451877402987.gif (407KB, 500x500px) Image search: [Google]
1451877402987.gif
407KB, 500x500px
>>52366851
What meme language is that? Ruby?
>>
>>52366873
I love this cat.
>>
>>52366838
Oh, I misunderstood what your thing is supposed to do.

>I write and read to the same key, so I assume it to be always consistent, unless some wonky browser behaviour.
It's not always consistent. This implementation is vulnerable to race conditions.
>>
>>52366873
Rust
>>
>>52366903
>race conditions
Oh, you are right. How would you go about avoiding those?
>>
Animfags need to get out

>>>/r/reddit
>>
File: 1437724379921.gif (173KB, 510x282px) Image search: [Google]
1437724379921.gif
173KB, 510x282px
>>52366878
The best part is if that program is written like shit. They did this to us to teach us how to do OOP on some piece of shit "game" framework that had buggy movement. You could jump when touching a wall and there was nothing you could do. The final step was to make a playable game. Good luck.
>>
>>52366799
There's clearly a very angry packet of crisps. Hella weird how they're floating though.
>>
Who else doing CHIP-8 interpreter?

thinking of doing it in python lel
>>
>>52366851
>"FizzBuzz"
0/10
>>
>>52366994
OCaml is better for those kind of tasks.
>>
File: 1452460437689.png (1MB, 1600x2743px) Image search: [Google]
1452460437689.png
1MB, 1600x2743px
>>52366942
2D women are far superior to 3D women, anon.
>>
>>52366939
In realistic browsers, it's gonna be damn hard to avoid this. There are some mutex implementations on the internet, but all the ones I have seen are only mostly correct and not fully correct; I tried implemented my own, but it was fiendishly tricky to get fully correct and I aborted the attempt when I realized I didn't need it for my project anyway.

According to the localstorage specification, the browser takes care of race conditions on its own and you don't ever have to worry about this. But most browser implementations don't actually do this for performance reasons, and sucks to be you if you want your localstorage usage to not break.
>>
>>52367012
Probably, but this is a hobbyist project to be quite fair. I'll do it in python to get a hang of a more complex interpreter (35 opcodes) than the 21 opcode synacor challenge one, then I'll move onto the GameBoy interpreter which has like 76 opcodes IIRC and so many more intricacies
>>
>>52367021
Tell that to my dick.
>>
>>52367010
Nitpicking:
fn main() {
(1..).map(|i| match (i%3, i%5) {
(0,0) => println!("Fizzbuzz"),
(0,_) => println!("Fizz"),
(_,0) => println!("Buzz"),
_ => println!("{}", i),
}).take(100).last();
}
>>
>>52367037
Use OCaml, it will be easier and more robust.
>>
>>52367045
>"Fizzbuzz"
>doesn't match reference output
-1/10
>>
File: bleh.png (1MB, 1440x810px) Image search: [Google]
bleh.png
1MB, 1440x810px
>>52366838
>no semicolons
>>
>>52366860
Alright then, fair enough. I'll need it some day though and I'll be angrily shaking my fists at the thought of you.
>>
>>52367063
forgot to mention that I'll be doing CHIP-8 in C++ after python, then do GB in C++, just to remember C++ a bit

I'm not going to use OCaml lmao, I just got through Racket, I could do with less languages. I'll give it a glance though
>>
my AI has hit 800 lines and is still pretty shitty, but the groundwork is there.

What's the chat with learning techniques for optimising hieristic weights? I have up to 8 different values for determining the value of a game position but I need a way of weighting them.
>>
File: 1424804813046.png (118KB, 424x335px) Image search: [Google]
1424804813046.png
118KB, 424x335px
>>52367044
hoi penis~
>>
File: 1452426290185.png (355KB, 612x407px) Image search: [Google]
1452426290185.png
355KB, 612x407px
Remember, readability > memeability, there's nothing wrong with throwing in a couple of if else statements.
>>
Question about compiled languages:
How do you test small changes if the application is medium/large and compilation takes a good couple of minutes?
>>
>>52366994
>>52367037
>>52367091
The Chip 8 instruction set doesn't use GC, so you shouldn't be using a language that has it.
>>
>>52367084
>too retarded to understand all 3 of ASL rules
You don't need that semicolon 99.99% of the time. And, when you really do, you can add it. Better readability as well.
>>
>>52367114
>though
There's almost always a more elegant way than a bunch of ugly if statements..
>>
>>52367088
If you can think of a scenario in which you would need this, I'll be much impressed. (Protip: you can't, because the whole concept makes no sense at all.)
>>
>>52367030
Mixing in an async mutex is probably not worth the effort. Considering my usage case, I can likely let it slide. If it works fine in Chrome and FF, the rest doesn't matter.
>>
>>52367143
I can code that in lad
>>
hey /g/

why is clojure the best programming language?
>>
>>52367114
Agreed completely. Ternary operators are a mess to read.
>>
>>52367127
Modularise into small libraries or use a language designed with fast compilation in mind.
>>
File: tard brackets.png (3KB, 412x111px) Image search: [Google]
tard brackets.png
3KB, 412x111px
>>52367145
it just looks incomplete and makes it harder to tell where a statement ends
everyone relying on automatic semicolon insertion should be killed and the feature should be removed from the language desu
"asi was a mistake" -me
>>
>>52367278
C/C++ and Java fags probably all think this way, but is seems very natural to people coming from many other languages. Semicolons are boilerplate by definition.
>>
posting in cute anime thread
>>
>>52367252
Fuck you, man. Ternary operators are my BFFs.
>>
>>52367365
Stop writing spaghetti, anon.
>>
>>52367325
The ; removes whitespace-sensitivity. It also makes the syntax less fragile.
>>
>>52367182
i prefer readability
>>
>>52367252
only if you use them too much.

They seriously help me tons.
>>
>>52367406
It's boilerplate almost always. You only need indentation to readably close expressions.
>>
File: 1450855203121758055.jpg (115KB, 1080x1080px) Image search: [Google]
1450855203121758055.jpg
115KB, 1080x1080px
Trying to work around guessing correct resource lookup magic,
https://msdn.microsoft.com/en-GB/Library/windows/apps/hh965324.aspx

However the only way MS exposes it is through ResourceManager class which can not be manually instantiated.
So i figured i can obtain "current" class instance:

namespace wrl = ::Microsoft::WRL;
namespace foundation = ::ABI::Windows::Foundation;
namespace resources_core = ::ABI::Windows::ApplicationModel::Resources::Core;
wrl::ComPtr<resources_core::IResourceManagerStatics> p_statics;
{
wrl::Wrappers::HStringReference const class_id(RuntimeClass_Windows_ApplicationModel_Resources_Core_ResourceManager);
auto const hr(foundation::GetActivationFactory(class_id.Get(), &p_statics));
if(FAILED(hr))
{
return;
}
}
wrl::ComPtr<resources_core::IResourceManager> p_resource_manager;
{
auto const hr(p_statics->get_Current(&p_resource_manager));
if(FAILED(hr))
{
return;
}
}

But it crashes at get_Current since it is not a metro app and app-context stuff is never initialized.
Life is tough...
>>
What's the best board to get SFW lewd anime pics, /dpt/?
>>
>>52367648
/a/
>>
>>52367635
>What are code tags?
>>
>>52367635
>What are code tags?

If you're going to paste a chunk of code and ask a question please use code tags or pastebin you fuck.
>>
Semicolons at the end of statements are boilerplate. Separating same-line statements are ok, but having same-line statements anyway is anti-pattern.

Python pretty much does it best, as scope through indentation is a practice we all do even in languages with boilerplate { } ;

Languages should incorporate it for clearer code, the only use for the alternative is in autistic code golfing.
>>
>>52367648
>SFW
>lewd anime
you can only choose one
>>
>>52366410
Messing with CustomStringConvertable and StringLiteralConvertable in Swift

struct Thing : StringLiteralConvertible, CustomStringConvertible {
let a: String

var description: String {
return a
}

init(string: String) {
a = "My name is \(string)"
}

init(stringLiteral value: String) {
self.init(string: value)
}

init(extendedGraphemeClusterLiteral value: String) {
self.init(string: value)
}

init(unicodeScalarLiteral value: String) {
self.init(string: value)
}
}

print("tom" as Thing)
>>
what's the most efficient way of deep copying an object in python?

copy.deepcopy, cPickle or implementing a copy method manually?
>>
>>52367667
>>52367675
adding them won't make shit better anyway

>>52367675
I didn't ask anything.
>>
File: 1435908290120.jpg (191KB, 700x600px) Image search: [Google]
1435908290120.jpg
191KB, 700x600px
>>52367648
/e/ is good, you have to be careful though, some are obviously not SFW.
>>
>>52367770
Yes it will, I thought you were asking a question because your entire post was one big unreadable block that made me just assume you were a moron asking a dumb question.

Use code tags for stop posting.

You cunt.
>>
File: 1435908341195.jpg (445KB, 900x636px) Image search: [Google]
1435908341195.jpg
445KB, 900x636px
Is this a good way to check if I'm in a 4chan thread?

if(document.URL.split("/")[4] === "thread"){
//do stuff that only applies to threads
}
>>
>>52367863
lol
>>
>>52367863
no
>>
>>52367863
>>52367774
>>52367112
>>52367021
>>52366960
>>52366410
Please do not post lewds. You are ruining my nofap 2016.
>>
>>52367863
Use indexOf. If 4cuck changes the URL you're fucked.
>>
>>52367863
use the 4chan API
>>
File: 116891276451e055716fca4.jpg (8KB, 100x111px) Image search: [Google]
116891276451e055716fca4.jpg
8KB, 100x111px
>>52367889
OK
>>
>>52367710
>differentiating between strings and MULTIPLE TYPES of string literals
Well, scratch Swift from the "sane language" list.
>>
>tfw software developer
>haven't written code for job in a week
>bored

If I were normal, I'd be raising a family and doing all of that shit.

So give me a programming goal /dpt/
>>
>>52367938
Be a Go master at the end of the month.
>>
>>52366994
I'm doing that right now, actually. Using Python because Pygame is the only thing resembling graphics library I know how to use. On that note, what graphics library should I learn? SDL?

>>52367143
Why does it matter? Can't everything in the machine be represented by fixed-size arrays anyway?
>>
>>52366505

What are you currently using for terminal output? You're not just writing to standard out without putting it into raw mode, are you?
>>
>>52367963
>SDL?
SFML lad, if only because pySFML is 100x faster than pygame in various areas
>>
File: SpJ79mB.png (386KB, 2144x1800px) Image search: [Google]
SpJ79mB.png
386KB, 2144x1800px
>>52367937
What do you mean? There's only one String. StringLiteralConvertable just means you can toss a String to something that otherwise would take another type and the compiler will call the init(stringLiteral value: String) constructor automatically.
>>
File: 1451751832808.png (17KB, 418x359px) Image search: [Google]
1451751832808.png
17KB, 418x359px
>mfw putting every class in its own file
>mfw putting everything in classes
I'm not even into pooinloo, but the modularity and portability lads. Can I get an amen?
>>
File: 51437306_p0.jpg (332KB, 1300x1676px) Image search: [Google]
51437306_p0.jpg
332KB, 1300x1676px
Reminder that the file is a really poor abstraction
>>
>>52368027
>using a language with classes
>using classes
Alright Gurpreet.
>>
>>52368027
>Can I get an amen?
not if you're going to use the pooinloo meme as if you're above everyone else
>>
std::random_shuffle ( myvector.begin(), myvector.end() );


Why does this function exist?
>>
>>52367112
Can't find sauce for shit.
H-help?
>>
>>52368080
To randomly shuffle something.
>>
File: 1435956404567.jpg (516KB, 850x533px) Image search: [Google]
1435956404567.jpg
516KB, 850x533px
>>52367895
Maybe, but that would be true for:

https://Boards.4chan.org/qa/#thread

>>52367915
Why send another request when I can find out if I'm in a thread from the already loaded page?

Besides, the API has rules and a ToS. That's no fun.
>>
>>52368027
>put everything into one file
>avoid classes
https://raw.githubusercontent.com/dtschump/CImg/master/CImg.h
>>
>>52366410
>What are you working on, /dpt/?

Kind of mixing /dpt/ and /ohm/ atm.
I'm making an Atari 2600 emulator on fpga that I plan on turning into a hand held device that can play the old cartridges.
>>
File: turtle3.webm (2MB, 640x360px) Image search: [Google]
turtle3.webm
2MB, 640x360px
>>52368092
So, why is my something predictably shuffled each time?
>>
>>52368099
>tfw wanting a anime homescreen without being made fun of by my coworkers
>>
>>52368139
You're stuck in a quantum vacuum.

Probably.
>>
>>52368139
Because if you don't supply an RNG, it uses std::rand, which by default has the same seed every run.
>>
File: csgrad.jpg (250KB, 1137x679px) Image search: [Google]
csgrad.jpg
250KB, 1137x679px
>>52368110
I think this has passed the point of autism
>>
tfw you have :Sex with vim
>>
File: 1383195552_image.jpg (108KB, 600x480px) Image search: [Google]
1383195552_image.jpg
108KB, 600x480px
>>52368164
show em your special skill
>>
>>52366410
Anal edition?
>>
>>52367127

Many source files, don't delete the .o files. Re-compiling one source file doesn't take minutes.

Also, try not to do that thing where you make a couple of changes and then compile several times until you get it right. If something's fucked in a large application, try actually using a debugger.

>>52368060

I'd like to hear your reasoning.

>>52368139

Was not aware snapping turtles like to eat mice.
>>
>>52368193
Header was probably generated using bin2c and is used like:
const char[] data = {
#include "data.h"
};
>>
>>52368080
Because while C++ is, the STL isn't bloated enough for the committee's tastes yet.
>>
>>52368220
Don't be sick, anon. That's a little girl.
>>
>>52367127
Use C#. Realize not having edit/continue and an IDE is hell.
>>
File: 1446290901343.jpg (533KB, 1920x1080px) Image search: [Google]
1446290901343.jpg
533KB, 1920x1080px
>>52368230
The file when talking about software has a number of issues.

Now there is the grouping by file type, that sense of course, you don't want your PNGs in your favourite language's source code

And directories are fine too, assuming your language makes use of directories for seperating units of code.

But just having one unit, translation unit or whatever it is called consist of multiple files for the sake of it shows a poor quality of tooling.

Really all you made with those files is a set of # tags like on a website for where to start reading the piece of code.

Having it all in seperate files leads to a lot of bookkeeping

I have a 12000 line file now and it is going to become bigger
>>
>Was not aware snapping turtles like to eat mice.
Was not aware your mum likes to eat my d :DDDDDDDDDDDDDD
>>
File: 1363774280996.png (70KB, 455x339px) Image search: [Google]
1363774280996.png
70KB, 455x339px
>>52368220
>>
File: pl_higurashi_355.png (3MB, 1920x1200px) Image search: [Google]
pl_higurashi_355.png
3MB, 1920x1200px
>>52368164
Then hide your power level, faggot.
>>
File: IC814519.png (20KB, 680x403px) Image search: [Google]
IC814519.png
20KB, 680x403px
>>52367127

>>52368296
This, pic related new in VS2015.
>>
>>52368342
I was looking for F/SN wallpaper, but they're all too obvious mang.
>>
File: 4459353701_826a3c120d.jpg (126KB, 489x400px) Image search: [Google]
4459353701_826a3c120d.jpg
126KB, 489x400px
>>
File: 788.png (304KB, 1178x377px) Image search: [Google]
788.png
304KB, 1178x377px
autism
>>
Small python script with PyQt for file archiving, I'm a beginner but I really enjoy programming stuff when I feel like I need something, learn new stuff as I add more functions to my programs/script.
>>
>>52367127
Go compiles with decent performance!
Now I have some packages which have a ton of C underneath and those are now,
I don't test small changes in those unless I have some downtime anyway.
>>
>>52368306

So how would you design a build system that can efficiently work with a single file, rather than multiple, separate files?

>>52368164

Anon, I gave a presentation in class on i2p with a pony as my wallpaper. Nobody laughed, or even commented on it.
>>
>>52368080
while it's not being deprecated officially, you should just std::shuffle instead anon.

http://en.cppreference.com/w/cpp/algorithm/random_shuffle
>>
>>52368080

To... shuffle your container? Why not have it?
>>
File: pl_fate_651.png (3MB, 1920x1200px) Image search: [Google]
pl_fate_651.png
3MB, 1920x1200px
>>52368370
Very.
>>>/w/powerlevel
>>
>>52368396
>>52368164
I'd make fun of you both, non-stop, until HR fired me for making fun of retarded people.
>>
>>52368410
Thank you anon. Didn't know a powerlevel thread existed.
>>
Weebs are literally incapable of programming beyond the fizzbuzz level. This has been proven with statistics.
>>
File: 1446216035386.jpg (33KB, 848x480px) Image search: [Google]
1446216035386.jpg
33KB, 848x480px
>>52368396
Those are a whole different beast

But I always wind up with the same set of problems with multiple files that I do with a single file.

With multiple files the knobs you want to turn with the build system rarely actually match that set of files

You still have markup inside of the files to assist you

So I prefer to rig something super tiny on the spot, after all things change.

I guess this would be more of an issue with multiple authors but even then I don't see how you couldn't properly merge what is after all text
>>
>>52367863
it doesn't ignore consecutive slashes unlike most web servers
https://boards.4chan.org//g//thread//52366410

const pathArray = location.pathname.split("/").filter(s => s !== "");

if (pathArray[1] === "thread") {
// do stuff that only applies to threads
}
>>
>>52368441
Nah, man. I can program.
>>
>>52368504
but not beyond the fizzbuzz level.
>>
>>52368515
goto reddit; 
>>
>>52368441
I'm a weeb and I disagree.
>>
>>52368515
Please tell us what are all of these programming levels are
>>
File: Screenshot - 110116 - 21:57:26.png (146KB, 1356x688px) Image search: [Google]
Screenshot - 110116 - 21:57:26.png
146KB, 1356x688px
>>52368515
String parser seems complicated enough.
>>
>>52368548
>what are all of these programming levels are
>what are these are

obvious weeb can't even english
>>
I'm trying to overcome a long range communication issue. I have 30 ATTiny85 chips that I need to slave to a base unit. I wanted to just hook them up via RS485 or UART -> MAX485 but 85's don't have serial capabilities.

Trying to figure out if this is a software issue I can overcome or a hardware issue and I have to make some design changes.
I'm pretty new to this so I'm probably just looking past something simple
>>
File: post-110069-1273164125.png (16KB, 634x571px) Image search: [Google]
post-110069-1273164125.png
16KB, 634x571px
>>52368565
Holy shit, I think I've had a stroke while writing that post
>>
>>52366477
>3016-1000
>Not being a pedo
ISHYGDDT
>>
>Weebs are either normies or geeks m8s
>>
>>52368562
use the apis fagit
>>
>>52368607
>he thinks it's 4chan
>>
Fuck Java desu
>>
>tfw I can average 2 ints in brainfuck
Who else knows this feel?
>>
>>52368625
>not smart enough to use Java

top kek anon
>>
File: 1399353105982.png (458KB, 493x424px) Image search: [Google]
1399353105982.png
458KB, 493x424px
>>52366477
implying you aren't one
>>
>>52368637
>not dumb enough to use Java
ftfy
>>
>unironically being a weeb
like what the fuck lmao
>>
>>52368626
,>,
++++++[-<--------<-------->>]<<
[->+<]>>++<
[
[->+>+<<]
[-<<-
[>]>>>[<[>>>-<<<[-]]>>]<<]
+
<<[-<<+>>]
<<<]
[-]>>>>[-<<<<<+>>>>>]
<<<<++++++[-<++++++++>]<.
>>
>>52368649
nice dunning kruger
>>
>>52368480
Thanks, anon. It works.

And it looks like 4chan's native extension has problems with consecutive slashes.
>>
>>52368657
shit negro, in just the 2nd line you go less than cell index 0
>>
>>52368651
Stop pretending you don't like it fag
>>
Working on my YouTube subscription manager.
The idea is to run the application every few hours. It'll check if the channel has uploaded one or more videos relative to the last run. If so, the user can send the result by mail or invoke a script. You can always invoke the script manually and it'll print the result to stdout.
I already can parse the config and open close the database connection.
I'm thinking about a name for my class that'll receive the result from the parsers and sends it to the user. I was thinking about 'Execer', short for executer. Any more suggestions?
>>
>>52368660
Nice Psych term you learned on Wikipedia and throw around to look smart
>>
>>52368698
my phone tells me when subscriptions upload videos.
>>
>>52368705
nice delusion that you're so "smart" that you see no use for java
>>
>>52368480
didnt know javascript had the keyword const

nice
>>
>>52368719
I see a use for Java, however I see other languages that can do what Java does and more
>>
>>52368698
>I was thinking about 'Execer', short for executer.

Don't do this or I'll slap you. Call it Executer.

I can't count the number of times people have dropped one or two letters from a word with columns and class names.

Unless you are dealing with AbstractFactoryAbstractFuckBeansController class names, you don't need to abbreviate words.
>>
 int num = 0;
for(num=1; num <= 100; num++){
if(num % 3 == 0) // check if multiple of 3
printf("Fizz (%d)\n", num);
else if(num % 5 == 0) // check if multiple of 5
printf("Buzz (%d)\n", num);
else if(num % 3 == 0 && num % 5 == 0) // check if multiple of 3 AND 5
printf("FizzBuzz(%d)\n", num);
else
printf("%d \n", num);


alright fizzbuzz attempt? I would like to find a way not having to test for fizz & buzz twice but , I'm not sure how to do it the most economic way. Shouldn't a fizzbuzz program only have to do two checks per run through the loop? And use something like a goto to a specific print?
>>
File: 1451754656606.png (17KB, 418x359px) Image search: [Google]
1451754656606.png
17KB, 418x359px
>OOP
name bigger memes
>>
>>52368719
Really though, the only reason you can possibly have to use Java is if you're unaware of its alternatives.
>>
>>52368736
doesn't mean you have to say "fuck java desu". and actually it just validates java because you feel that it's worth directing your energy toward it whether it be positive or negative energy
>inb4 ">4chan is one person"
>>
>>52368757
oop is good when done right
>>
>>52368757
OOP is not a meme

scalability is
>>
>>52368757
Generics.
>>
File: 1451779320598.png (20KB, 418x359px) Image search: [Google]
1451779320598.png
20KB, 418x359px
>>52368772
>oop is good when done right
good choice lad, can we meme bigger than this?
>>
>>52368757
Significant whitespace
>>
>>52368767
>my retarded opinion is the objective truth
how insightful, anon
>>
>>52368779
>lad

can girls be lads
>>
File: quite a ruff victory.jpg (46KB, 653x510px) Image search: [Google]
quite a ruff victory.jpg
46KB, 653x510px
>>52368757
these threads.
cats.
>>
>>52368757
Material design.
>>
>>52368757
The use of this particular frog image in /dpt/.
>>
>>52368771
wut
>>
>>52368795
too big, lad
>>
>>52368779
kill yourself

>>52368757
programming applications in C
>>
>>52368786
this

together with lazy evaluation the only bad parts of haskell
>>
>>52368808
>kill yourself
old meme lad
>>
Does anyone have that image with the most enjoyed programming languages?
>>
>>52368828
kill yourself
>>
>>52368805
>lad
:s
>>
>>52368832
I have that image of a frog looking condescendingly forwards
>>
>>52368832
it's bullshit

fuck off to sjwhub and curryniggerflow normie
>>
>>52368755
kill yourself
>>
>>52368850
Nice, it's the same, I'll go for it
>>
>>52368755
prime grade bait
>>
>>52368824
That's like saying curly braces and OOP are the only bad parts of Java.
>>
>>52368744
You're right. Execer is a bit too much anti ExecuterServiceImpl.
I was also thinking about simply calling it 'Runner'.
>>
>>52368824
the entirety of haskell is extremely shit
>>
File: Te28SOS.png (184KB, 751x1823px) Image search: [Google]
Te28SOS.png
184KB, 751x1823px
>>52368757
'code', at least in this thread.

>shit is always in top 5
>java winning the popularity contest over Python this thread

Still working on filtering out non-significant words.
>>
>>52368883
That's kinda true though.
In fact, Go is Java with those features removed.
>>
>>52368909
post source code?!
>>
>>52368921
Go is hot garbage, 9001x worse than java
>>
>>52368731
Below IE 11 doesn't support it, you should probably avoid using it unless you're making a Chrome/Firefox extension.
>>
>>52368921
Then it's like saying := and channels are the bad parts of Go.
>>
>>52368938
I will when I get it more fleshed out.

Working on phrase combination stats and optimizing the API calls.

I'll sell it to NSA/Facebook when I'm done.
>>
>>52368969
You're better off selling the data to mook.
>>
Wait Go has no OOP and it has pointers?
Maybe Rob Pike isn't such fucking big faggot holy fucking shit.
But he is still faggot tough.
>>
>>52368989
He probably has all sorts of analytics stuff going ham on the entirety of 4chan already.
>>
>>52368757
Code reuse
Versioning
Portable
>>
>>52368995
Go has the concept of interfaces if you call that OOP.
>>
>>52368698

>I'm thinking about a name for my class that'll receive the result from the parsers and sends it to the user. I was thinking about 'Execer', short for executer.

DON'T BE AFRAID OF LONG NAMES

EXECER IS NOT MEANINGFUL

I WOULD READ IT AS "EXESSER", AND IT WOULD MAKE NO SENSE AT ALL
>>
>>52368995
>has pointer
no pointer arithmetic though
>>
fuck CHIP-8, give me something harder
>>
>>52369092
gameboy.
>>
>>52369092
NES
>>
>>52369092
x86
>>
File: ya_boi_bowie.jpg (29KB, 500x412px) Image search: [Google]
ya_boi_bowie.jpg
29KB, 500x412px
Trying to learn C without getting frustrated and giving up.
>>
>>52369097
>>52369104
>>52369126
lmao I'll just do CHIP-8, cbf tbf
>>
>>52368698
If you can call a class an "Executor" it shouldn't be a class.
>>
>>52369158
Why?
>>
>>52368995
>OOP
Mind, it has struct composition OOP, not classes.
>>
>>52369180
Because it could likely just be a function or even just a code snippet that has been factored out and abstracted for no reason.
>>
Is OOP the most overused and meaningless programming term?
>>
>>52369191
Can't be done in Java :^)
>>
>>52369191
And if Executor is a very complex class?
>>
If I do
a = 0?1:;
b = 1?4:;
c = 1?:3;
d = 0?:4;


in C, what will be the values of a, b, c, and d?
I know that, for example,
e = 1?:2;
sets `e` to `1` but everything else is obscure to me.
>>
File: 1448024204125.jpg (111KB, 540x720px) Image search: [Google]
1448024204125.jpg
111KB, 540x720px
>>52369139
Hang in there senpai

It's okay to take a break
>>
>>52369214
I'm having a hard time thinking of anything that complex that can be boiled down to "executes something".
>>
>>52369207
There are so many different kinds of OOP, so yeah, pretty much.
>>
>>52369207
No it's design pattern.
>>
>>52369216
a 0
b 4
c 1
d 4
Just a ques
>>
>>52369207
Quite the contrary; it has become so ubiquitous that it's hard it's hard to imagine programming without it, making the term sound meaningless on first glance.
>>
>>52369216
a = 0
b = 4
c = 1
d = 4
>>
>>52369253
>it's hard to imagine programming without it
what a pleb
>>
>>52369139
I believe in you yo. What are you trying to learn atm?
>>
>>52369214
not him, but he's right executor is really rubbish name.

Find something more descriptive (sounds like it might be better to refactor into a controller)
>>
>>52369233
A cpu is a executor of a code segment. Do you think that a CPU is simple or complex?
>>
>>52368878
I honestly wasn't baiting I'm just trying to learn fucking c.
>>
>>52369216
since when does C have some sort of elvis operator?
>>
>>52369289
check if multiple of 3 AND 5 first so you get the correct output

and you should almost never use goto
>>
File: nes chip.jpg (38KB, 737x151px) Image search: [Google]
nes chip.jpg
38KB, 737x151px
>nes emulator programming
>151 opcodes
Is it worth it lads?
>>
>>52369315
can't really say that I changed it after posting it here without sounding like a turd now but that's what I did. Is four if statements really the most economical solution?
>>
>>52369216
This is not valid syntax.
>>
>>52369331
NES has fewer than the full set I believe
>>
File: Input-Type.png (24KB, 609x304px) Image search: [Google]
Input-Type.png
24KB, 609x304px
>>52366410

Any JavaScript fag who can edit a google chrome extension so it stores e-mail and password inputs to a remotely accessible database instead of chrome's standard one ?

you can also upload it to the web store and profit

extension : https://chrome.google.com/webstore/detail/gumshoe/mekpfngodchodemgmkhinohkfjefjeea
>>
>>52369351
it's pretty much the only sensible solution. one of the main points of fizzbuzz as a job interview question is that a newbie like you will try to figure out some "clever" solution while an experienced programmer will just write the straightforward solution straight away.
>>
What are the languages everyone should learn, /dpt/?

C++, Java, PHP, and JavaScript?
>>
>>52369373
Oh that's a relief. I can't find a decent tech reference anywhere.
>>
>>52369392
replace the last 3 with python, c, haskell and ocaml
>>
>>52369392
replace PHP with Python and yes
>>
>>52369392
Java, C++
>>
>>52369387
hey I did write the sensible solution (albeit I of course did the statements in the wrong order)
>>
>https://code.google.com/p/google-security-research/issues/detail?id=693

Reminder that if you use node.js you are a degenerate incapable of programming safely
>>
>>52369392
Everyone should learn a relatively "pure" functional language (Haskell, ML, not Lisp)
>>
>>52369444
there's a special place in hell for webdevfags
>>
>>52369392
>one purely imperative language like C or Pascal
>one purely OOP language like C# or Java
>one ourely functional language like Lisp or Haskell.
>>
>>52369216
Empty ternary operators are not a part of C. They are a GNU extension.
If I recall correctly, they will have the value of the conditional expression, so a == 0, b == 1, c == 1, d == 0.
>>
>>52368755
>alright fizzbuzz attempt?
The 15 case doesn't work. Do you see why?

>I would like to find a way not having to test for fizz & buzz twice but , I'm not sure how to do it the most economic way. Shouldn't a fizzbuzz program only have to do two checks per run through the loop?
This is a good goal, but here there is no way to do that. There are genuinely four cases here, and the 15-case is *almost but not quite* equivalent to a 3-case followed by a 5-case.
>>
>>52369477
>a == 0, b == 1, c == 1, d == 0
Whoops, that's completely wrong.
a == 0, b == 4, c == 1, d == 4
>>
>>52369455
no they shouldn't
>>
File: 1451622595898.jpg (237KB, 800x1000px) Image search: [Google]
1451622595898.jpg
237KB, 800x1000px
>>52369471
N-not all webdevs use node.js, anon.
>>
>>52369275
Yeah, it's too vague. My idea of naming it 'Runner' is also shitty. I guess I'll sleep over it.
It's a thing that receives the result from different scrapers, aggregates it and sends it to the user.
Fuck, I hate naming shit.
>>
>>52369520
SendingService, EmailService?

this should be configured not to send this specific data in this specific, but any data to any receiver. then you can reuse the code in another project.
>>
>>52369504
Why not?
>>
what are the top meme languages of the month ?
>>
>>52369444
This is hilarious.
>>
>>52369587
I'll call that fucker Sender and call it a day. It'll hold an array of Result and sends it by email or invokes a command.
The thing isn't really useful for other projects, so I'm not worried about naming clashes outside of the current project.
>>
>>52369604
F# for sure
>>
>>52369520
>It's a thing that receives the result from different scrapers, aggregates it and sends it to the user.

That's just a data access layer. You can really just call it your data source. If "sends it to the user" includes organizing it / making it pretty, you've merged View and Controller responsibilities from MVC.
>>
>>52369591
FP is a meme
>>
Learn Nim or C for first language
>>
@52369677
You're a meme, anon! :)
>>
>>52369392
s/PHP/python and I think you're right
>>
>>52369683
Learn C

Nim is lmao who tier
>>
>>52369683
java

>>52369706
nim is a little bit like python but actually good
>>
File: 1450111022044.jpg (22KB, 359x489px) Image search: [Google]
1450111022044.jpg
22KB, 359x489px
>>52369512
I bet none of you ever used Ada Web Server.
>>
>>52369290
The ternary? Dates back to CPL, but I think C was the first language to give it the ?: syntax.
>>
>>52366687
>make shitoverflow account
>some faggot le downvote faces my correct answer because he doesn't know what a fucking comma is
>top answer for some questions are stupid joke answers because le funny face xd
There's a reason why true democracy is a dumb fuck idea.
>>
>>52366410
i was in a job interview today, and they asked me to do fizzbuzz, so i got up, brushed off my trench coat, got my butterfly keyboard thinkpad out of my cargo pants pocket, sat down, straightened my fedora and wrote this
main(i){printf((char[4][9]){"%d\n","Fizz\n","Buzz\n","FizzBuzz\n"}[!(i%3)|!(i%5)*2],i);return i<100?main(++i):0;}

any idea why i didn't get the job?
>>
>>52369738
python's good you cretentious melt
>>
>>52369787
you typed Fizz and Buzz twice in your code
>>
>>52369648
I was thinking about implementing it MVCish.
Package parse contains the scrapers. (controller)
Package send contains the different ways to notify the user (view)
Package result contains the result for the scrapers to be sent to the send package (model)
>>
A CMS using DJANGO, hopefully i'll get out of this fucking job before going any further with this impossible to complete piece of shit project.
>>
File: frg.png (13KB, 463x228px) Image search: [Google]
frg.png
13KB, 463x228px
>>52369690
You can't deprive people of their (You)s anymore, anon!
>>
>>52369787
He was disgusted by how verbose you are. Next time, give him this:
i;main(){for(;i++<=99;printf("%s%s%.d\n",i%3?"":"Fizz",i%5?"":"Buzz",(i%3&&i%5)*i));}
>>
File: 1394392660463.jpg (59KB, 613x744px) Image search: [Google]
1394392660463.jpg
59KB, 613x744px
>>52369331
>illegal opcodes
>>
>>52369493
Yeah the 15 case is supposed to be at the top.
>>
NEW

>>52369894
>>52369894
>>52369894
>>52369894
>>
>>52369889
Fuck Hell Knights
>>
>>52369818
>having trouble with django
>>
>>52369902
too early fgt
>>
>>52369772
i mean when you omit one operand like >>52369477
>>
>>52369902
>>52369902
>>52369902
I assume you were sitting there all day rubbing your sweaty fat fingers together waiting for the chance to post your disgusting weebshit picture, weren't you...
>>
>>52369902
fuck off you piece of shit
>>
File: kuroneko.jpg (244KB, 1278x1256px) Image search: [Google]
kuroneko.jpg
244KB, 1278x1256px
>>52367021
We outfit swapping now
>>52369331
I decided to write a DCPU-16 emulator
>>52369382
If you're willing to pay, I'd think about it. Otherwise requests generally aren't a thing in /dpt/ besides learning-related ones.
>>
R8 me. Dont know shit about programming

f = float(3)
b = float(5)
ii = float(0)
B = 1
F = 1

for x in range(0, 100):
iib = ii / b
iif = ii / f
iiF = iif % 1
iiB = iib % 1

if iiB > 0:
B = 0
if iiF > 0:
F = 0

FB = "Fizz"*F+"Buzz"*B
print(str(int(ii)) + ":" + FB)

B = 1
F = 1
ii = ii + 1
>>
>>52369929
I have trouble with anything related to migrations and stuff that does shit for me, i am used to code everything by myself.

And it's impossible to develop a CMS all by myself anyways.
>>
>>52369808
is this better?
main(i){printf((char[3][9]){"%d\n","Fizz%s","%s"}[!(i%3)?1:!(i%5)*2],!(i%5)?"Buzz\n":!(i%3)?"\n":i);return i<100?main(++i):0;}
>>
>>52370089
Post in the new thread >>52369894 otherwise they won't see it

By the way, not that anon but the way you used printf in that is really creative
>>
In my js book it says that all user defined objects and built in objects are descendants of an object called Object.

Can somebody please explain to me more information about this statement?
Thread posts: 316
Thread images: 51


[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.