[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: 32

File: 1480286057046.png (503KB, 940x822px) Image search: [Google]
1480286057046.png
503KB, 940x822px
Old thread: >>57791122

What are you working on /g/?
>>
File: 1459870315301.png (328KB, 451x451px) Image search: [Google]
1459870315301.png
328KB, 451x451px
>python
>>
File: 8923415.png (154KB, 400x347px) Image search: [Google]
8923415.png
154KB, 400x347px
>>57799306
good op
>>57799328
good first post
>>
File: c8dis.png (19KB, 910x573px) Image search: [Google]
c8dis.png
19KB, 910x573px
Chip8 disassembler. Might add superchip and other extensions.
>>
>>57799352
i hope it isnt written in c#
>>
>>57799306
Java master race
>>
File: img_10262.jpg (477KB, 1280x884px) Image search: [Google]
img_10262.jpg
477KB, 1280x884px
reading the book on the right

just taking a 10 min break atm
>>
>>57799445
I still don't understand the animal memes on programming books.
>>
>>57799448
just go with it, bro
>>
>>57799445
why are you reading a book at the atm?
someone could steal your money
>>
I have a phone interview for my first it job in 40 minutes

Heeelp ;____;
>>
>>57799601
Hopefully you don't sound like a boring asshole like I do.
>>
>>57799405

I don't get it.
>>
>two variables on the same address
>change one value
>check address, still same
>only one of the values have changed
I give up time to sleep
>>
>>57798991
>When someone gives you general advantages, "too general"
I was never given general advantages.
I was asked about language and then I was told:

>C with built in algebraic data types would be much better, e.g. tagged unions and pattern matching.

Why the hell it must have something with C?
I bet if I told x86 assembly, I would be told something other similar.

The question is:
Why OOP is hated, and if it's hated, why FP is seen to be better over OOP? What good features does FP have over OOP?
>>
>>57799448
Orly started this. Essentially, you are guaranteed to never run out of these. Never needing to use the same animal for two separate topics, etc. This evolved to the point where other publishers started using animals as well, for eg. Eloquent javascript.
>>
File: 43.jpg (54KB, 620x348px) Image search: [Google]
43.jpg
54KB, 620x348px
What's your favourite design pattern, lads?
>>
>>57799940
builder pattern is goat
>>
>>57799940
If you're talking about """design patterns""", then they are all complete garbage.
>>
File: Compiler.png (177KB, 1692x913px) Image search: [Google]
Compiler.png
177KB, 1692x913px
pretty hyped
>>
>>57800066
Is that Pascal?
>>
Alright guys, some I'm trying to optimize some parameters in matlab with Newton's method. I know how it works in practice but why doesn't my code work? Do I need to make Sm a function?

syms a0 a1 a2 Sm
Sm = a0*exp(a1*(Eavg(i)^2)+a2*Eavg(i))*(2*a1*Eavg(i)+a2*I);
da0 = diff(Sm,'a0');
da1 = diff(Sm,'a1');
da2 = diff(Sm,'a2');
for i=1:l
Jy(i,1:3)= [da0,da1,da2];
end
>>
I got a job in SQL-based Reporting.

Anyone got a clue what that is, lel?
These HR cunts are unable to explain this stuff properly.
>>
>>57800315
As a follow up, yeah I can code the easy shit for the next iteration. I just need the matrix of derivatives of the equation being fit with respect to each constant to fill.
>>
>>57799644
Cache?
UB?
>>
>>57800318
translate data from a database into pretty charts and graphs
check out crystal reports as well
>>
any YACC/BISON fags here?
how do you parse negative numbers without relying on a flex regular expression for it?
>>
any YACC/BISON fags here?
how do you parse negative numbers without relying on a flex regular expression for it?
>>
>>57800458
thanks senpai
>>
>>57800488
your welcome
>>
>>57800296
Mostly
>>
What language can easily be used to create console programs that run on OSX, Linux, and Windows with little to no platform specific alterations?
>>
>>57800458
Your struct should have a sign value that is set when you parse the urnary '-'
>>
File: It was a usual Python error.png (1KB, 780x15px) Image search: [Google]
It was a usual Python error.png
1KB, 780x15px
HOLY FUG, WHY PYTHON IS SUCH A PIECE OF CRAP

>>57800575
Python
>>
>>57800446

Why do you want to not rely on Flex again?
>>
is abs() literally just (n < 0) ? -n : n
>>
>>57800681
Pretty much., although the compiler/CPU/whatever might have a slightly more efficient way to implement it.
>>
>>57800680
because i strip whitespace before anything, so in the lex i cant tell the difference between 1-2 and -2
>>
File: 1457192378786.jpg (13KB, 324x390px) Image search: [Google]
1457192378786.jpg
13KB, 324x390px
>>57800681
I don't know, why don't you google it.
>>
>>57800722
That's not how that works, dude
>>
>>57800747
it is though, if i have regular expressions to catch minus symbols preceding numbers i cant tell the difference between expressions and negative numbers, but i can in the grammar
>>
File: hmmm.jpg (21KB, 393x360px) Image search: [Google]
hmmm.jpg
21KB, 393x360px
Sup'
I have my end-of-study work coming later this year (don't know if you call it that way in english but that's the thing you have to do to prove you can program shit to get your diploma)
Anyway, any idea of the subject (the app) I can make ?
I'm currently searching for something easy enough to not have major troubles doing it. But elaborate enough so the teachers will accept my subject.
I wanted to make a lifting related app but other students told me that going for the generic management of something app is the best thing to do.
I'll do it in Java.
>>
>>57800790
It won't match '1' and '-2' unless you have expression : number number as a grammar. It'll match expression : number op number.
>>
>>57800840
i suggest using phonegap if its an android app
d/l a bunch of plugins and done.
>>
>>57800315
anyone?
>>
>>57800878
Yeah forgot to clarify something. We have to use what we learned during our studies there.
Wich is, Java, Javascript, Php, HTML and the shit related to it and use an SQL database to manage your datas.
>>
>>57800843
either way, this is an issue of grammar, and not lexicon, isnt it?
>>
>>57800906
Treat it as a grammar, it'll make things simpler for variables and expressions
>>
>>57800900
>Wich is, Java, Javascript, Php, HTML and the shit related to it and use an SQL database to manage your datas.

Ah same as me, the best thing can do then is a simple CRM-ERP solution which will use all of those above. Only bad thing its gonna take time to build and i even didnt manage to complete it fully.
>>
Must read beginner compsci books ?
>>
>>57800927
so i should still solve it by the rule
integer : integer
{//int_token}
| MINUS integer
{negint_token}
?
>>
>>57800988
You'd want to make 'integer' more generic, to account for MINUS variable, or MINUS statement, etc. But basically, yes.
>>
>>57799445
>>57799448

>Haskell has a dung beetle
>>
>>57800957
What did you do and how long did you work on it ?
>>
>>57800671
It was designed by idiots
>>
>>57800318

We have an SQL reporting guy here.

He uses some shit named LBGen to generate queries and claims he's never actually seen SQL.

From what I can gather it basically does a SELECT * FROM EVERTHING and puts the query together in the client because we have a 40GB database and it generates a 40GB tempfile on his desktop every time it runs.
>>
>>57801042
Why the hell it got popular then?
>>
>>57801082
It's easy to learn.

That's literally it.
>>
>>57801082
It's easy for beginners to get decent at it before they run into all the annoying shit.
>>
>>57801091
>>57801092
I thought Basic existed for such purposes.
>>
>>57801104
you can do more with python than basic. Python is the new basic in a way.
>>
>>57801104
Python is new-basic
>>
>>57801037
CRM-ERP web-app , It main idea is to help web designer/developers write down their customers needs/wants. archive and maintain a customer log, print out fast prototypes of website template and documents for signing by the customer (yes i had to add that formality in the app since there are many cases, idiots dont pay for the job or dont like the site THEY ASKED FOR ) . So yeah its like sugarCRM only more target for web developers/designers
>>
>>57800066
what does it compile?
>>
>>57800719

I think the negation is as fast as it gets. Two's complement isn't computationally difficult
>>
>>57801018
MINUS statement isnt allowed for in the BNF
>>
>>57801137
forgot , it also took me 8 months but i kinda stuble to ALOT of bugs, which kinda fucked me at the end and had only 1/4 of the app finished. Looking back now i believe i could have done it in 3 months with my current knowledge.
>>
In Java, how would I carry out an action exactly n steps times.
Where n is decided by the user?
>>
>>57801235
read in an int and use it in a for loop
>>
>>57801137
Yeah that's a nice idea but I'm searching for something more generic. For example the last years subject were mostly if not all "Management of somethiung" like a clothing store, or a nursery or shit like that.
>>
>>57801235
For loop.
>>
>>57801235
i don't even know java, but it's obvious you would use a for loop
>>
File: blythe_,masters.jpg (85KB, 959x639px) Image search: [Google]
blythe_,masters.jpg
85KB, 959x639px
I love Python but I'm not sure I want to become a developer. I have a business degree rather than a quant degree, so the chances of moving into Data Science are pretty small too.

What other jobs is python useful for?
>>
>>57801351
Python is pretty good for non programmers. A lot of scientists use it.

Do you want to be a developer, or specifically a python developer?
>>
>>57799306
so is miskasasuk just palming that book like a basketball
>>
>>57801196
>>57801196
8 fucking months. Nah it's too much for me. I'll have to do it in a few months.
I was thinking of doing a fitness app where you can make your own routine. With every exercices stocked in the database (with tables and relation telling you wich muscles it works and some other informations, I don't know yet what to put in the database).

Thins is I'm have no idea of the amount of work it is and I'm scared I'll end up with something too ambitious. Obviously building the routine isn't the only feature, I'll have to find some others.
>>
I asked this yesterday, anyways, do you think I could symlink to the torch7 libraries and load like clnn in Love2D or does the th command do something in the background, soree, I'm le noob
>>
>>57800575
Go
>>
>>57801548

Alright, the helpful torch-knowledgeable guy must be American then
>>
>>57801351
You can be a Business Analyst if you like.
Those cucks that goes to clients to negotiate some technical requirements and ask programmers to develop that for you.
>>
>>57801235
for (int i = 0; i < n; n++) { 
//do stuff here
}
>>
>>57800575
Depends what you want to do. But Java is pretty good at that. Java is a shitty langugae however.
>>
>>57801548
>soree, I'm le noob
Jesus christ, fuck off.
>>
>>57799940
I like me a good singleton from time to time.

>>57800318
You're probably going to be working in something like SSRS.

I'm so, so sorry for you.

Try to get your company on Power BI for dashboarding and see if you can get your SQL Server upgraded to 2016, because the new SSRS is pretty hot and actually mobile-friendly.

Brush up on your SQL, be prepared to familiarize yourself with your databases, and you'll be fine.

Consider learning some basic API integrations in any language so you can add more value to the data you're using. For example, using external IPs that you know about to geolocate everything through an API and then mapping that on world map to see where your users or employees are.

t. BI guy
>>
>>57801855

I like how in the 2 years I haven't visited here people are still so easily triggered lmao
>>
I just started doing this bullshit
there's some shit about binary trees and recursion and my head hurts
>>
>>57801685
I'm already one of those, it's shit


>>57801403
I don't want to be a web dev, but software dev would be nice.

A job in a quant hedge fund would be cool, but I'm some way off that by the look of it
>>
>>57800318
BI guy here

Git gud with SQL and excel. They'll probably have a load of bloated enterprise MS shit to use, but basically that job just involves fucking around with data and explaining it to retards, you'll be fine
>>
File: 1480422855328.jpg (836KB, 1920x1080px) Image search: [Google]
1480422855328.jpg
836KB, 1920x1080px
I've watched, listened to and read RICH HICKEY'S SIMPLE MADE EASY innumerable times.

Is there other any talk, any paper or article that can provide the same sublime enlightenment that this talk gives?


!!!!!!!?
>>
File: thats pretty gay.jpg (26KB, 327x316px) Image search: [Google]
thats pretty gay.jpg
26KB, 327x316px
>>57801943
>bi
>>
>>57801934
functional langugaes can be good for financial sector jobs. Look at Scala and F#.
>>
>>57800575
Python or Java
>>
>>57800734
kek'd

>>57799306

Is there any point at all using recursive functions in C? It seems to me there's lots of wankery around recursion but they're almost always inferior performance wise to iteration in C/C++, and recursive tree traversal 100% of the time is slower than an explicit stack and loop implementation.
>>
>>57800970
https://dl.dropboxusercontent.com/u/1680449/books.html
>>
>>57802006
>Getting worked up over function call overhead
There is absolutely no reason to worry about that shit. The cache misses you're going to get from following the pointers would be far worse.
>>
>>57799628
I think he's making a music joke
>>
>>57802006
>Is there any point at all using recursive functions in C?
Why would you need them?
>>
>>57801930
You don't need either of those things ever.
>>
>>57801951
Bump
>>
>>57802109

Normally it's to elucidate a computing concept, like tree traversals, and you usually see recursion in classroom settings.

I agree though, using recursion with C is such a waste, but sometimes, it's hard to formulate an easier solution using non-recursive functions.
>>
>>57801701
thats an infinite loop>>57801704
>>
File: 1466777223034.png (56KB, 219x406px) Image search: [Google]
1466777223034.png
56KB, 219x406px
Any idea on how much time to recreate this application, but like a less complete and uglier version ?
https://play.google.com/store/apps/details?id=softin.my.fast.fitness&hl=fr
I'm the student looking for a subject of end of studies work. And was going to settle on something like this. I'll have less than less than 6 months to do that. Is it too ambitious ?
I'm doing it alone.
>>
>>57802253
Stop putting whitespace before your question marks, fucking frenchy.

Anyway, that shouldn't be too hard once you create all of the art assets.

You could get it done pretty quickly with Xamarin, especially if you're familiar with C#.
>>
>>57802253
2-3 weeks tops
>>
>>57802286
I'm forced to do it in Java with an SQL database tough. Not only that but I'm forced to use that
Kek, I'm probably the same guy you told that a few weeks ago and asked me whu I put space before question marks.

>>57802295
Yeah 2-3 weeks of constant work without any bug or problems encountered. But I meant in a realistically way, with the student's level I have in coding.
>>
>>57801951
Up for programming talks
>>
>>57801951
https://www.youtube.com/watch?v=csyL9EC0S0c
>>
>>57800318
below pajeet tier
>>
>>57801080
that's fucking scary m80
>>
>>57801080
The fuck. SQL was designed to be easy as shit. My girlfriend's sister does it at her company and she's not even a programmer. They were gonna develop some frontend to fit all their use cases, but they realized "SQL is stupidly easy. The S stands for Simple".
>>
>>57802753
>The S stands for Simple
Do they actually think this, or is it like a joke or something?
>>
>>57802253
depends if your gay
if you are then a 4-6 weeks, would be faster if you're not stopping to jack off to your pictures in between
if you're not, then you're in denial why the fuck would you want a fitness app
>>
how can I convince my fellow developers to unionize with me?

I tried talking with them about Marx but most of them are class-cucked Asians who don't care about politics
>>
>>57799445
haskell is a waste of your time

puzzle-oriented programming isn't even impressive to fellow /g/ autists anymore

if you want to do FP, just do Scheme like a normal person
>>
File: can_you_fill_it.png (1KB, 200x200px) Image search: [Google]
can_you_fill_it.png
1KB, 200x200px
If I open up pic related in any image editor, and use the filling tool to make the question mark red, what kind of algorithm is used to do the job?

I imagine it involves finding the neighbors of the pixel I click, determine whether they're the same nuance of black, if so color it red, then move on to the next. Surely there are efficient ways to do this, but I can't see what to type into the search engine to find them.

Any hint?
>>
>>57803311
https://en.wikipedia.org/wiki/Flood_fill
>>
>>57803392
That's perfect, thanks!
>>
I'm having problems comparing two void pointers to each other. Basically I have made a program that is supposed to test a constructed queue datatype, the queue datatype is built upon a list.
typedef void* data;
/*queue_empty() will create an empty queue.
queue_front(queue) will return the first value in a queue, takes a queue as argument.
queue_enqueue(queue, data) will put a value at the last place in a given queue, takes queue and a void pointer as argument.*/
This is one of the functions.
bool test_queueEnqueue(void)
{
queue *test = queue_empty();
data *number;
int x=2;
int y=5;
number = (void *)&x;

queue_enqueue(test, number);

if(queue_isEmpty(test)==true)
{
printf("queue_enqueue failed!\nQueue was empty after enqueue was called.");
queue_free(test);
return false;
}
data *testValue=queue_front(test);

if(*testValue != *number)//Here is the problem
{
printf("queue_enqueue failed!\nWrong value was inserted to queue.");
queue_free(test);
return false;
}
The problem is that the program will crash when it attempts the comparison, I think I made some problem somewhere but I don't really know how these void pointers work.
>>
>>57803460
Probably null pointer dereference, use a debugger to confirm. Also switch to a better language that has generics.
>>
File: 565.jpg (16KB, 565x318px) Image search: [Google]
565.jpg
16KB, 565x318px
What are we gonna do when AI automation takes our jobs, /dpt/? I'm worried that my favorite pastime and the one thing I'm legitimately good at will be taken away by AI.

Who would want human code when robots can write it better?
>>
In python, how can I do
def function():
main()

without actually calling the main function?
>>
>>57803771
So you want to call a function without calling a function?
>>
>>57803771
???
>>
>>57803806
>>57803819
I'm wanting to return to the main function after another function completes. Think of it like having a menu to choose an option, and then once that option is done it returns to the menu. Sorry for asking in a shitty way, still trying to learn.
>>
>>57803827
function = main
>>
>>57803827
def function():
pass

def main():
# something
function()
# it returned to main now
>>
>>57803850
>>57803844
Ok cool thanks my dudes.
>>
What is the best online computer science course?
>>
>>57803897
>>>/g/dpt
>>
>>57803751
>implying that's not already happening.
To give you some perspective.
You're writing code that goes through a robot that can do incredible code transformations, that then goes to a CPU that does its own optimizations on that code.

If you're in a language that's more high level than C already is you likely already have more steps in that process.
>>
>>57803751
http://www.teamhuman.fm/
>>
>>57803981
I think this might be what kills humanity.
Just the other day I heard social studies people on the radio talk about how robots could replace humans in work.
And basically their answer to fixing this was to find new work for humans.
That's retarded. I thought for sure they'd suggest communism because I'm in Sweden but social studies people must be designed to fail or something.
>>
I'm starting to learn C and I want to use Visual Studio to do the exercises. Should I make a solution and a whole project for each exercise? Seems a bit overkill but I don't know how to make a C file for each and compile them all to different EXEs.
>>
What kind of CS faggot at google thought that these eye grating youtube search results looked good in any way?
>>
>>57804218
do you not have at least a linux laptop?
>>
>>57804307
Nope, I've been thinking on installing Linux on my desktop though.
>>
>>57804218
Just make an "Exercises" solution and add a project to it for each exercise.

You can build them all or just the one you're coding.
>>
>>57803961
Of course I write code in C you mong.
Compilers / interpreters aren't the same thing at all anyway. I'm talking about code generation not translation.
>>
>>57804165
>Who would want human code when robots can write it better?
I'd take lean, man-made HTML over computer-generated pagebloat any day. And that's not even programming.

Otherwise automation/computerization is fine, as long as our politicians stop pretending the job market will stay the same while jobless people are just lazybones. When we get bored of unemployment and "bullshit jobs" (Graeber's words) and start to bash our leaders' heads in, maybe they'll start to consider other options. We'll have to embrace things such as unconditional basic income, and programming won't have to stop being a hobby.

As long as you don't let them decide alone.
>>
What old-school console is the easiest to write a game in assembly in? I want to start simple so I don't get too overwhelmed.
>>
Is this how I would go about choosing a random element from an Array & indexing it in Java?

int n = random.nextInt(collection.length);
return collection[n];

Also would I use a for loop to set the size of a HashSet who's size is determined by an int parameter within a constructor in Java also?
>>
What's a good python book/learning method?
>>
>>57800575
Java, Rust probably, python if you want to kill yourself
>>
>>57804622
http://diveintopython3.net/

Sometimes the website appears offline. I found that if you google it and click the link, it should show up
>>
>>57804622
>good
>python
lel
>>
>>57804622
see >>57799328
>>
>>57804622
Automate the Boring Stuff with Python
Actual CS Textbook (John Zelle, John Guttag)
Python 101/201 by Michael Driscoll
>>
>>57804622
this is all you need
>>
>>57804773
Why is python a mouse and C a cow? How does this even make any sense?
>>
>>57804786
IIRC the choice of creature is usually explained in the forewords, or on a notice of sorts.
>>
>>57804786
Mice are quick. Cows are slow.
Corelates to the fact that you use Python for quick hacky jobs, and C for reinventing the wheel.
>>
>>57804649
It was this or Java that my uni offered

You guys told me Python

Pls no bully
>>
>>57804817
That's a retarded explanation
C is a lot smaller and faster so surely it's more qualified to be a mouse. Reinventing the wheel has literally nothing to do with it
>>
>>57804817
>reinventing the wheel.
There's almost no good generalized systems available.
Possibly graphisc drivers/graphics api but even that's shaky.
>>
>>57801032
It's a Hercules beetle.

Has anyone else noticed that Groovy is just Python/Ruby/etc done badly and marketed at Javafags?
>>
>>57804856
I know, ideally that would make sense to have them swapped, but it also makes sense this way because you usually spend less time working on something in Python than you do in C.

Either way I'm convinced they pick the animals arbitrarily.
>>
>>57804218
Visual Studio supports makefile based projects, and they you can easily just output as many executables as you want.
>>
>>57804817
>you use Python for quick hacky jobs
>hacky
:^)
>>
>>57804843
Python is for having fun and developing amazing applications
Java is for actually having a high paying job
>>
>>57805005
i don't think he meant that anon
hacky as in "hacked together"
since that's the only thing python is capable of
>>
>>57804949
How?
>>
File: tumblr_inline_ndnd3iyNCk1rliztq.png (80KB, 272x199px) Image search: [Google]
tumblr_inline_ndnd3iyNCk1rliztq.png
80KB, 272x199px
>dad's old friend is shittiest code monkey I've met
>can't keep own laptop in order. shitware, browser toolbars, etc
>complains about H-1Bs
>web search his name
>first results are arrest record and emailed essay from him whining about insurance companies having to pay for contraception
lol
>>
>>57805057
New Project - Visual C++ - General - Makefile Project
>>
>>57804614
I can't remember, does the random return only values less than length? If so that's okay

You don't need to set any size for a HashSet, just keep filling it up. I'm personally not a fan of it, if you need to get a value for a specific index use an ArrayList
>>
I have no programming talent and no math skills.
Why do I continue writing daily?
Should I just kms?

t. personified cognitive dissonance
>>
>>57805141
As long as you can communicate in English abstract shit, you're more useful than most Indians.
>>
>>57805141
join web developers
or make up your mind and learn C now.
I can even give you a link for free classes.
>>
>>57805158
I mean, if you can do it better than Indians. If you're severely autistic, you may not be able to.
>>
>>57799448
They're public domain 19th centruy wood engravings:

http://archive.oreilly.com/pub/a/oreilly/news/ediemals_0400.html
>>
>>57805141
Play more watchdogs 2 senpai
>>
>cannot capture an anonymous struct in C++ lambda unless I use a named capture

really makes those neurons fire
>>
>>57805162
>web developers
What is it?
>>
>>57805215
>>>/g/wdg
>>
>>57805215
Usually spiders.
>>
>>57805181
Is that a language thing, or a non-compliant compiler thing?
>>
>>57805141
You don't need math.

You need logical reasoning.

Notice how programming only implements shit like arithmetic but unless you drawing karnaugh maps by hand to design CPUs, you don't give a shit about the actual math. Even with shit like graphics engines, you don't actually need to know the math, just how to reason about implementing the equations.
>>
>>57805235
Standard C++14.

What I mean is:
struct A
{
struct {
int v = 0;
} something;

void f()
{
// error
auto l1 = [&something]() {}

// ok
auto l2 = [&something = something]() {}
}
};

int main(int, const char **)
{
A a{};
return 0;
}
>>
>>57805162
>I can even give you a link for free classes.
Yes please
>>
Is a raspberry pi worth getting? I thought of getting a small tv and mounting in next to my bed, putting it on a timer, and turning the Pi on to some news or radio show at a certain time every morning (a webpage I've developed which has a news stream and some other info like weather).
>>
I need a project.

I really like web scraping and making unnoficial API's using web scraping.

Or just API's generally.

Any suggestions? I'm going crazy with the lack of things to do.
>>
File: codeclown.png (19KB, 659x456px) Image search: [Google]
codeclown.png
19KB, 659x456px
java idiot here I'm fucking terrible help

Whats going wrong here? I've asked for all of the inputs and want to add them all together into a new transaction object
>>
>>57805275
It's like $20. Why not if you feel like dicking around with one?
>>
>>57805289
in new Transaction, you don't need to include the type: double, String, Date
>>
>>57805289
When you call the constructor you're not supposed to name the types.
So remove the "double" "String" and "Date" on line 7 from the bottom.
Also enable line numbers.
>>
>>57805289
You're declaring new objects of the same name inside your object constructor.

At least I think you are, I don't really know Java.

Just omit the type and it should work just fine.
>>
>>57805289
Can you tell us the problem?
>>
>>57805296
Not that guy, but I already have one. What could I do with it?
>>
>>57805289
transact10 = new Transaction(double amount, String type, String reference, Date date);


You don't need the types. The type checker can figure it out by itself. By including the types, what you're doing is effectively declaring new variables inside the function call which is probably what javac is bitching at you about.
>>
>>57805311
>>57805316
>>57805317
ahh thank you

I'm terrible at programming but It's a necessary module for this year
>>
>>57799306
thinking of a project with a raspi you sit it on your desk leave it running then if you plug a usb into it it encrypts the usb using a random 64 char password then wipes it - would it be worth documenting and open sourcing something like this?
>>
>>57805376
You could call it a One-Time Pi.
Because it's like a one time pad. Except nobody else knows the key, not even the recipient.
>>
>>57805337
This isn't something that lets you know if you're terrible at programming or not really.
Just so you know.
>>
>>57805376
>would it be worth documenting and open sourcing something like this?
Yes. For job opportunities.
>>
>>57802006

>they're almost always inferior performance wise to iteration
With any decent compiler (GCC and Clang will both do this), tail recursion gets optimized to a goto, just like a loop. The only performance overhead is in non-tail recursion, and that's not a significant overhead.
>>
How do I impress my cute programming teacher?
>>
doing the advent of code thing
struggling on understanding exercise since i am not english native (not india)
>>
>>57805477
I also want to know this.
>>
>>57805477
>>57805492
Act like you have social skills and can operate as a normal human being.
>>
>>57805498
How?
>>
>>57805433
its all struggling to go in, I get my terminology mixed up a lot and still can't wrap my head around how for loops and arrays work or how to use the debugger

only 2 more weeks left though
>>
>>57805477
64k demo on how petite women are the best
>>
>>57805477
Make really cutesy comments and us =3 a lot, he's bound to notice.
>>
>>57805490

I'd consider doing it, but they once again have this problem where they need to identify you with an external account. I'd like to have access to the dataset without having to have some sort of social identity tied to it, and I don't feel like making a throwaway.
>>
>>57805477
Don't be gay
>>
>>57805498
>operate as a normal human being.
Any books on this?
>>57805570
Is this too dorky or would it be OK?
>>
>>57805430
oh I really like that name, I was thinking usb blackhole or something
>>57805455
I wouldn't have thought something like this would help
>>
http://www.strawpoll.me/11776572

Posting the strawpoll from yesterday.

I know, I forgot C#, Lua and others. It's not perfect.
>>
>>57805597
>I wouldn't have thought something like this would help
Well I don't know what your resume looks like but in general just filling it up more is good because it shows it's something you care about.
>>
>>57805603
>I forgot C#

Shameful
>>
>>57805603
If you're gonna do something like this in the future use poal.me so people can add their own options.
>>
>>57805614
fair point, guess I'll spend the next few days documenting and open sourcing my projects
>>
File: 124r.png (9KB, 470x259px) Image search: [Google]
124r.png
9KB, 470x259px
Java bitch here,
Why am I getting the error when trying to print out the description of the object?
Do I have to create a new object first?
>>
>>57805477
Make an obfuscated function in one of your assignments that can't be reached in the code normally, but when run generates your phone number.
>>
>>57805651
its a void function so it does not return anything.
>>
>>57801466
It sounds fine as an app,
1st thing to take out of the way CREATE A SERVER and keep it alive until you present it (i suggest aws if u cant afford it, a home server with this http://localtunnel.me/)
2nd. I suggest drawing out all of the pages ui/interactions try to make only one of them and time how fast you can finish it. based on it schedule !
3rd document everything from bugs to design choices throughout the building of the app.

Thats it good luck
>>
>>57805651
Please copy your code and put it in code blocks like [ code]ActualCode[/code]
You probably want to move the parenthesis right after class to the end of the line (just before the semicolon).
And I don't think description is a method. Just guessing there.
>>
>>57805490
I've done both. What are you struggling with?
>>
>>57805651
System.out.println() returns void. There is no .description() method to a void type.
>>
>>57805573
>>57805591
it's a she, I'm not that much of a faggot.
>>
>>57805865
Oh, well then why should we care?
>>
>>57805661
I'd intuitively say this is a good way to go.
Is my intuition right?
>>
>>57805921
some of you hotboys must be good at picking up bitches
>>
SOMEONE PLEASE MAKE A NEW THREAD.

why can google not let us have one of their ocr robots to break their capcha so a bot can automatically make a thread everytime this one is circa 200 replies?
>>
>>57805456
>The only performance overhead is in non-tail recursion, and that's not a significant overhead.
It's significant if the recursion is greater than 16 deep because then you spill out of the return stack buffer and pay miss-prediction cost on every return back up from depth 16 to root.
>>
>>57805581
Day 1
- Problem: https://paste.installgentoo.com/view/raw/71e7b065
- Input: https://paste.installgentoo.com/view/raw/bdce9efb

Day 2
- Problem: https://paste.installgentoo.com/view/raw/f54f27c8
- Input: https://paste.installgentoo.com/view/raw/0d9d1ac4

Answers:
https://paste.installgentoo.com/view/raw/38a6a908
>>
>>57805965
>circa 200 replies?
Why 200? Bump limit is 310
>>
>>57805965
Fucking newfag
>>
>>57805983
because it bothers me when a thread is this large.

>>57805985
anagram this word: fuckoff
cffkfou
cofffku
ffkoufc
kfcoffu
ofuffck
cuffokf
ffkcfuo
kffucfo
cffkfou
ffcfkou
>>
>>57805969
No, because a tail call is not a function call at all.
>>
>>57805936
I dunno, bro. I'd just ask her out if I were you.
>>
>>57806001
This thread isn't about you, fuck off you self obsessed cunt
>>
>>57806005
Read the post again.
>>
>>57806010
I bet programming/CS/IT girls get that a lot though.
Don't you have to stick out in some way?
>>
>>57806028
O-oh.
>>
>>57805965
The samples they ask you to solve are NOT solvable by their current generation of OCR. They're using your response to train the software to the point where it CAN, which is why there is a new 'generation' of CAPTCHA every so often.
>>
>>57806029
>I bet
Yes.
>Don't you
No. You just have to be more appealing than the rest of the idiots.
>>
Anyone doing adventofcode?
>>
>>57806069
>You just have to be more appealing than the rest of the idiots.
Ok so there's no chance then. Great. Saved me a lot of time anon.
>>
How the fuck can I take information from a list in one function, and then use that same list in another function?
I'm trying to make a payroll program in python as homework and I'm stumped. Can't use pickles or anything because my professor skipped that chapter.
>>
>>57806086
What do you even mean?
>>
>>57806086
def __init__(self, word):
self.word = word


use a class silly.
>>
>>57806086
Return and pass?
>>
>>57806086

Make the list global or pass it as a parameter

I think anyway
>>
>>57806086
References in python confuses me too so I've written entire applications in OOP (with some minor janky non-oop parts) despite being very unfond of it.

You're not supposed to have to spend time learning a scripting language.
>>
>>57806082
No worries, bra. I find getting a medical degree helps, if you have time for that.
>>
File: 1437538680514.gif (621KB, 440x247px) Image search: [Google]
1437538680514.gif
621KB, 440x247px
>>57799306
>What are you working on /g/?

i'm working on building up my annoyance/anger that i plan to channel into good android apps that would replace (for me) the annoying ones (i.e., Join/Pushbullet, any tetris game cuz they all suck ass, my banking app that has the whole Kaspersky AV inside of it).
i will pop soon, you just wait
>>
>>57806086
Just return the list from one function and use it as the input into the other?
>>
>>57806129
>I find getting a medical degree helps
I don't want to do medicine ;_;
>>
>>57806086
def f1(l):
pass

def f2(l):
pass

def main():
l = [1, 2, 3, 4]
f1(l)
f2(l)

if __name__ == '__main__':
main()
>>
So if training a NN isn't reducing the error by any measure, does that mean I've done something wrong or could the data actually be somehow completely incompatible(as in not related) with the output or have I just set it up wrong?
>>
File: helpaaaaa.png (35KB, 529x888px) Image search: [Google]
helpaaaaa.png
35KB, 529x888px
>>57805289
this guy here to niggle for the last time

What is going wrong is this highlighted area? I'm very lost
>>
>>57806102
>>57806103
>>57806144
>>57806146
It has to be a 2D list that includes employee name, hours worked, and pay rate. The information also has to be saved to a file, as well as calculate gross pay for each employee entered then display all the information if the user wants to.
>>57806100
>>57806116
I might dick around with OOP and see what works, I'm just unsure if the professor wants OOP or not.
>>
>>57806077
#include <stdio.h>

int main(void)
{
int i = 5;
int c;

while ((c = getchar()) != EOF) {
switch (c) {
case 'U': if (i > 3) i -= 3; break;
case 'D': if (i < 7) i += 3; break;
case 'L': if (i % 3 != 1) --i; break;
case 'R': if (i % 3 != 0) ++i; break;
case '\n': printf("%d", i); break;
}
}

putchar('\n');
}
>>
>>57806145
It's great. You get to run around in your pyjamas pretending you know what you're doing.

Programming as a career seems soul-crushing.
>>
>>57806188
>>57806188
>It has to be a 2D list that includes employee name, hours worked, and pay rate. The information also has to be saved to a file, as well as calculate gross pay for each employee entered then display all the information if the user wants to.

What does it matter? The same principle applies.
>>
>>57806188
>It has to be a 2D list that includes employee name, hours worked, and pay rate
class payroll:
def __init__(self,name,rate,hours):
self.name=name
self.rate=rate
self.hours=hours

done
>>
>>57806077
Yeah, 4 stars in Python so far, planning to get em all just like last year.
After I'm done with my solutions in Python I also attempt (and fail) to reimplement them in Elixir as a learning exercise.
>>
>>57806077
Yes, done both.
package main

import (
"fmt"
"strings"
)

var (
keypad1 = [][]rune{
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
}
keypad2 = [][]rune{
{'0', '0', '1', '0', '0'},
{'0', '2', '3', '4', '0'},
{'5', '6', '7', '8', '9'},
{'0', 'A', 'B', 'C', '0'},
{'0', '0', 'D', '0', '0'},
}
)

type coords struct {
x, y int
}

func main() {
fmt.Printf("part1: %v\n", traverse(keypad1, coords{1, 1}))
fmt.Printf("part2: %v\n", traverse(keypad2, coords{0, 2}))
}

func traverse(keypad [][]rune, pos coords) string {
var pressed []rune

for _, line := range strings.Split(input, "\n") {
for _, d := range line {
var x, y int

switch d {
case 'L':
x--
case 'R':
x++
case 'U':
y--
case 'D':
y++
}

// Check bounds
new := pos
new.x += x
new.y += y
noButton := new.x < 0 ||
new.y < 0 ||
new.x == len(keypad[0]) ||
new.y == len(keypad) ||
keypad[new.y][new.x] == '0'
if !noButton {
pos = new
}
}

pressed = append(pressed, keypad[pos.y][pos.x])
}

return string(pressed)
}

>>
>>57806188
i think you should use oop. if he doesn't like oop he's probably a cuck tell him closed code open implemntatin.
>>
>>57805936
>>57805661

I went ahead and did it for you, bro. Go get her.
#include <stdio.h>
#define _(__) __-4
main(){char a[25] = "Gepp$qi$?-$)h";a[13]=14;14[a]=0;
char* e = &a[0];while(*e!=0){*e = _(*e);e++;}printf(a, 1234567);}
>>
>>57806203
Hmm.
Is medicine difficult in the sense that you need to learn stuff that's difficult to comprehend?
Or is it more about learning and remembering large amounts of stuff?

Ignoring the math.
>>
>>57806267
Both.
>>
>>57806267
3 of my closest (and only) friends are in medicine and I'd say (from what I heard from them) that it's a combination of both but more skewed into the latter
>>
>>57806185

You probably have set it up wrong. Use multiple hidden layers with back propagation.
>>
>>57806187

is Account.addTransaction() public?
>>
>>57806267
>>57806274
>>57806285
It's not abstract, it's just volume.

You'll also find that most people don't apply enough (any) rigour to their reasoning, so you'll go far if you do.
>>
>>57806303
The error I'm getting is

method addTransaction in class Account cannot be applied to given types;
required:Transaction;
found: no arguments;
reason: actual and formal argument lists differ in length

whatever the hell that means
>>
>>57806254
Thanks anon but it has to be more personal. Is probably wiser to just store a huffman table disguised as random ascii and decode something.
>>57806274
>>57806285
>>57806313
Good to know.
>>
>>57806328
Error says it all. addTransaction requires a parameter of type Transaction, but you have to no parameters.

Looking at >>57806187 I think you want
addTransaction(new Transaction(amount, type, reference, date));


Otherwise you were apparently just throwing away that new Transaction object.
>>
>>57806337
Sign up then, bra. Maybe one day you can be my underling.

Plus you'll bag that teacher.
>>
>>57806362
Maybe I should just ask her out first and see if I don't have to wait 5 years to do it.
>>
>>57806376
That's what I said in the first place.

Failing that, sign up for the pyjama party.
>>
>>57806287

God the documentation on Torch7 is truly abhorrent, it should just work with

nn.Sequential()

and then adding some layers right?

But then what transfer functions do I want, what nodes and what criterion should I use? I'm currently using Tanh as the transfer, linear as the nodes and MSE as the criterion.
>>
File: herewego.png (30KB, 660x608px) Image search: [Google]
herewego.png
30KB, 660x608px
>>57806355
amazing anon, thank you.

I'm so close I can taste it, I think this is the final error.
>>
>>57806392
Scrubs do look very comfortable I have to admit.
>>
>>57806202
purty syntax
>>
>>57806411
They're fucking glorious. Plus if you get covered in something it's an easy fix.

I wear them round the house when the weather allows.
>>
>>57806410
That means there is no method displayBalance visible
>>
>>57806396

I have no idea how your specific neural network libraries work. I just have a basic idea of how neural networks in general work.
>>
>>57800315
ooh boy, I know those feels exactly from writing an interior point method algorithm for linear programs. Sorry I'm too lazy to break out my old notes.
>>
File: Vim.png (45KB, 544x545px) Image search: [Google]
Vim.png
45KB, 544x545px
What's the modern equivalent of Vim? Or alternatively what's a great (windows) text editor that has full Vim support?

I'm on Windows at work and gimped by it, Vim is not really modern or polished and expects a Linux style terminal for full functionality.

There's neovim, spacemacs, a host of others that, again, are mainly designed for Linux and might not work on Windows fluently or be any good.

If there's a modern text editor with a Windows friendly UI and modern features like multiple cursor, opening folders, (good) git integration that can emulate or match vim that would be great.

There are also vim plugins for sublime, atom, VS code, everything else, but who knows which are decent. The sublime one couldn't even use ex mode.
>>
>>57806470

Ah, I think I got it, I somehow messed up my data normalization, where I was converting it to a value between 0 and 1, I was expecting numbers about 200x bigger than the network can make as an output, ha
>>
>>57806624
>what's a great (windows) text editor that has full Vim support
VS Code has Vim support, IIRC
>>
AGDG is so shit at programming.
>>
>>57806643

I installed the Visual Studio vim plugin today and it's surprisingly good. Only omissions I've noticed so far are the expression register, and making a recursive macro crashed VS.
>>
>>57806730
dpt is no better
>>
File: monad-id-law.png (20KB, 358x260px) Image search: [Google]
monad-id-law.png
20KB, 358x260px
>>57806730
link us so we can teach them the ways

>inb4 >linking /v/
>inb4 >/v/
>>
>>57806749
One of my co-workers uses the Visual Studio Vim plugin, because our workflows are all with VS integrated with VSTS.

I suppose it's good enough for him in daily use.
>>
File: 1480694502816.png (39KB, 898x751px) Image search: [Google]
1480694502816.png
39KB, 898x751px
>>57806772
At least /dpt/ has the sense to realize something like pic related is beyond retarded.

>>57806786
You can find it yourself, I'm not getting done in for inciting raiding.
>>
>>57806786
>Have you ever made a burrito?
>>
>>57806806
>going to a software development thread to aid them with software development is now raiding
>>
Are there any IDEs for C++ that will prompt you to insert try-catch error handling for code which could throw exceptions?
>>
>>57806877
All code can throw exceptions.
>>
File: 1457328701367.jpg (399KB, 1280x720px) Image search: [Google]
1457328701367.jpg
399KB, 1280x720px
>don't touch code for months
>open vs and go straight back to where I left off
>>
>>57806901
noexcept
>>
>>57806913
For me, this isn't so much "I don't know what I'm doing", but more of
>What in the holy hell was I thinking when I wrote this?
>>
>>57806913
dumb hair girl
>>
Weird, does ipairs( ) have some sort of limit on # of iterations or what?
>>
File: 1479883677181.jpg (143KB, 833x696px) Image search: [Google]
1479883677181.jpg
143KB, 833x696px
>>57806951
>>
>>57806901
So?
>>
>>57805251
>>>/g/dpt
>>
File: eG4whxp.jpg (41KB, 422x317px) Image search: [Google]
eG4whxp.jpg
41KB, 422x317px
>>57806967
dumb snek girl
>>
>>57806969
So then why not modify the compiler to have an unmutable always-on warning that says
>Hey, you might be a fuckup and your users think their birth date is "cat" sometimes, so put everything in a try/catch block!
>>
>>57806969
>>57806992
He's wrong, not all code can throw exceptions.
Noexcept functions can't throw exceptions.
>>
>>57806913
Dumb anime poster.
>>
File: 1470671602288.gif (607KB, 250x249px) Image search: [Google]
1470671602288.gif
607KB, 250x249px
>>57806951
>>57806985
>>57807009
why is /g/ so mean today
>>
What if there was only 1 language. And it was golang?
>>
>>57807017
dumb professor
>>
File: FeministPepe.jpg (45KB, 680x689px) Image search: [Google]
FeministPepe.jpg
45KB, 680x689px
>>57807000
>He's wrong
Did you just assume my gender?
>>
>>57807000
>He
>>
New thread:

>>57807030
>>57807030
>>57807030
>>
>>57807022
I would stop programming.
>>
What is the most optimal way to decode a complex instruction set in a CPU? The easiest and quickest would be a full size ROM, but that would require 2**n*m space where n is the instruction size, and m is the number of control lines to set. And there would be a lot of unused holes.

Ideally the instruction format will allow using the opcode to set lines, but it can't do that for all. Has anyone seen a real decoder implementation?
>>
>>57806453
>That means there is no method displayBalance visible
what do you mean? It's letting me do account.displayTransactions but not Balance, I don't get it.
>>
>>57805275
Get one, I manage mine thru a terminal on my desktop and laptop at home. It's footprint is small and having a Linux server around keys you fuck with any project idea you come up with.
>>
File: 1478609742190.jpg (80KB, 478x644px) Image search: [Google]
1478609742190.jpg
80KB, 478x644px
>applied to dev at a cool open source project
>get ignored
its like searching for a job all over again
Thread posts: 316
Thread images: 32


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