[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 45
File: hime ACNL.png (778 KB, 400x720) Image search: [Google]
hime ACNL.png
778 KB, 400x720
old thread: >>55525463

Keep overflowing the stack, Hime!
>>
Please post an anime image next time. Thanks.
>>
>i want to work in computers!
>but I don't want to interact with anyone
>or even come into work
>in fact, just gimmie my paycheck and you can call me on skype sometimes :)

How do these people even function?
>>
>>55535106
that's me, it can get pretty rough desu
>>
>>55535106
I already told you, I want to sip lattes while hacking on my macbook at Starbucks. I want to be a code artisan.
>>
hi /dpt/ I want to start learning C
What's the best place to program in?
I'm using unbuntu
I've been writing some simple programs in Python and just calling them in the terminal
Is this a bad approach?
If it's not too bad can I do the same with a compiler?
>>
>>55535018
Well, I would be fine with living in an apartment or home for months or even years. But I would need the freedom to go when I want within reason (leases etc)
Finding a place to live isn't as hard as a career though

>>55535020
They would know I'm working because they would have a product.
>>
>>55535106
>Because I'll have to be in a certain place at a certain time and would like to keep that to a minimum so I can be other places.
>It has nothing to do with interacting with others.
>I actually have friends around the world and would like a career that would allow me the freedom to be where I want when I want if I can still get the work done.

How do you even reply? If I didn't have people to see, I wouldn't be traveling.
>>
>>55535173
You're an entitled piece of shit and you're not going to get anything like the idealistic job scenario you keep describing.

And you're never going to get it if you keep up that entitlement complex.
>>
File: 1460887654220.jpg (106 KB, 1280x843) Image search: [Google]
1460887654220.jpg
106 KB, 1280x843
>>55535204
I think you have some issues you need to work through.
>>
File: download.png (173 KB, 320x462) Image search: [Google]
download.png
173 KB, 320x462
watching changes on a xml file and sending the changed data via websockets

Nodejs, python or C?
>>
>>55535154
Doing shit from the terminal is completely viable, and is the preferred programming environment for a lot of people.
>If it's not too bad can I do the same with a compiler?
The way to compile and use a basic single source file C program is just
gcc myprog.c -o myprog
./myprog

After your code gets to be more non-trivial, you probably want to look into using Makefiles to automate the compilation process.
>>
>>55535221
node if you're hip, C if you just want it to work
>>
File: image.jpg (104 KB, 640x640) Image search: [Google]
image.jpg
104 KB, 640x640
>>55535242
Ah I see
I'll just start playing with it when I start the ansi book tomorrow
Thanks anon
>>
>>55535106

I honestly wouldn't mind programming in a workplace environment... although it would certainly take getting used to, since talking with people fucking ruins my concentration.
>>
File: yui does the cute thing.gif (802 KB, 500x545) Image search: [Google]
yui does the cute thing.gif
802 KB, 500x545
Is there any realistic scenario where one would make use of an array with 3 or more dimensions?
>>
>>55535721
3D space MUD?
Cellular automata in 3D?
>>
>>55535221

Between the three... if performance is critical, use C. Given that the task is rather I/O bound, you should consider carefully how much work your program is going to be handling.

Otherwise Python.
>>
Okay, so... working with a friend on an idea for a roguelike with some similar mechanics to Binding of Isaac. Don't know if this'll actually go anywhere (it'll probably end up abandoned eventually), but I think I'd at least like to screw around with some random dungeon generation shit anyways. Something I'm thinking about is how the hell I should represent this shit in memory. What I'm thinking about is I'll have some container class I'll call Dungeon. This will contain a vector of another object called Room. Each Room has four pointers to possibly adjacent rooms. The pointers can be null to represent that no such room exists. The first element of the vector will be the entrance to the dungeon, and subsequent elements will be added as the dungeon is generated.

I'm not sure if depth first or breadth first is best for dungeon generation, nor do I know if there are any particularly useful algorithms for this kind of stuff. Does anyone by chance know of any literature on the subject?
>>
>>55535841
I don't remember but I saw somewhere a thing describing how you iteratively partition your dungeon floor until you have the rooms you want
>>
i need help with sparkfun ir sensor library. who uses this library? trying to convert the returned value but it fails to convert the data type no matter what. sigh......
>>
>>55535929

Have you read the documentation before coming here with your questions?
>>
>>55535961
yeah i have 10 tabs open trying to fix it. i am not c++ programmer so this is not working out unfortunately
>>
>>55535990
post code
>>
>>55535040
im stumped /g/
how do I print a Key?
I'm pretty new, I don't know about ChTypes
are Keys a subste of ChTypes?
pic realted
>>
>>55535221
Node if you want to do it in a few minutes and forget about it, otherwise whatever you like.
>>
>>55535990

If you have any C++ specific questions, I can answer them. It's not exactly the most user friendly of languages, but with proper understanding of it, it can be a very powerful tool.
>>
>>55536046
If you are just messing with curses that's fine, but brick (https://hackage.haskell.org/package/brick) is a terminal UI library that fits Haskell better, as opposed to just being thin wrappers over curses bindings
>>
File: code.jpg (28 KB, 656x241) Image search: [Google]
code.jpg
28 KB, 656x241
I want to convert the returned float/string to int so i can do temperature monitoring and logging. it is done with arduino. nothing works though. the code in the picture outputs the temps in decimal every 2 seconds. i been trying for few hours now to convert
>>
>>55535204
Why are ypu só mad anon? You seem like a boss that promjses the world butwould ratherinflict misery
>>
>>55535867
>OOP fags
https://en.wikipedia.org/wiki/Binary_space_partitioning
>>
>>55536074
>>55536039

see >>55536182 i forgot to quote your posts
>>
>>55536217
Oops, (hue) meant for
>>55535841
For my retardation, have another link.
http://www.roguebasin.com/index.php?title=Basic_BSP_Dungeon_generation
>>
>>55535221
x64 SSE enabled assembly.
>>
File: 1429036498699.jpg (74 KB, 640x427) Image search: [Google]
1429036498699.jpg
74 KB, 640x427
I'm trying to edit this code and i have some questions.

https://github.com/dnschneid/xfce4-genmon-plugin/blob/master/panel-plugin/main.c

This fairly simple xfce panel plugin which runs a bash command when a preset timer runs out and then displays the string returned by the bash command.

As it is now it only updates, calls the command and prints a new string, one two occations.

It updates when the timer runs out. See function on line 267.

And it updates if any changes has been made to the settings (different timer, location, etc). See fuction on line 630.

The function that makes it update takes a struct as an argument, and is located on line 105.

The program supports a clickable icon which when clicked can run a bash command by itself. The click function is located on line 84.

Thanks for following me so far, now here's my problem. What i'd like to do is call the update function from within the click function so that whenever i click the button, the program updates and generates a new string. However since the update function takes a struct as an argument, and i'm unsure if i can send a struct from within the "ExecOnClickCmd" function, i am unsure how i would go about doing this. And since i'm pretty sure i have to compile this every time i want to see if it works i'm not very drawn to experimenting.

tl;dr How easy would it be to run the DisplayCmdOutput(line 105) fuction from within the ExecOnClickCmd(line 84) function?
>>
>>55536182

>float to int
Use an ordinary cast.

>String to int
If this is an STL string, stoi. Otherwise, atoi/strtol or similar.

>>55536266

Thanks. This looks like an interesting approach to the problem. I'll mull around with it and see if it might be useful.
>>
Hi /g/uys. I was wondering if i could use SSH from ubuntu to access a raspberry pi (or another ubuntu/windows desktop) to get my data even from university. Should i get a static ip?
>>
File: 0sfeWR2.png (59 KB, 990x400) Image search: [Google]
0sfeWR2.png
59 KB, 990x400
>>55536573
Would it be as easy as this?

*edited line 102
>>
File: QCXQ8OY.png (60 KB, 1005x395) Image search: [Google]
QCXQ8OY.png
60 KB, 1005x395
>>55536649
Like this sorry, i thought the p_pvPlygin and poPlugin was the same.
>>
>>55536598

Yes you can ssh from Ubuntu to a raspberry pi, even at a university (unless your CS department is retarded and blocks ssh).

A static IP may not be necessary, unless this is going to become a regular thing.
>>
>>55536715

I see no picture. Also, docs say it should be valid.

https://www.arduino.cc/en/Reference/Cast
>>
File: int_fail.jpg (60 KB, 969x495) Image search: [Google]
int_fail.jpg
60 KB, 969x495
>>55536586
I am going to smash this arduino into million pieces soon. ordinary cast does not work.

picture f--king related
>>
>>55536725
forgot to upload the picture, it is here >>55536728
>>
>>55536728
Arduino is a pretty damn annoying, yes.
>>
What is a simple library for loading .obj 3D models for use in OpenGL?
>>
>>55536728
arduino casts weridly
try int(MotorTemp) instead
>>
>>55535106
I don't even allow skype calls or phone calls
I only communicate with my clients directly via email, and then indirectly with timesheet submissions and updates posted to team sites and source code repos
it's pretty nice, I must say
>>
>>55536881
same error. sigh. how can arduino be so broken.
>>
>>55536728
>invalid cast from string to int
lel
>>
>>55536728
you are retard, did you even read >>55536586
>>
Which programming language would you suggest me for building Web services?

I'm thinking about Java(Spring)
>>
>>55536933
this shit still does not work. i give up
>>
>>55537016
Good, you are a looser and a fag. Programming is not for you.
>>
>>55537010
small number of users/personal project? python
large number of users? c or c++
>>
>>55537019
you sound autistic... go troll some other board
>>
>>55537016
you need to learn how to program before you can program.
this is common sense.
>>
>>55537034
Nah, you're a cunt.

If you can't figure out how to cast on any given programming language in 45 minutes, you might be retarded.
>>
>>55536785
Unity <->
>>
>>55537054
Fucking kill yourself.
>>
>>55537040
lol a cunt?

>>55537036
fuck off or paste the working code then smartass
>>
>>55535721
almost every game engine out there, even shit java ones, even tetris models etc.
>>
>>55536728
What does therm.object() return? Is it a string or integer or float or something completely different?

Why are you even converting anything?
>>
>>55537066
You were given a fine advice that you ignored. We are not planing to do a fag's own work, especially for something that trivial that would be solved if you bothered to actually read about the language you are using.
>>
>>55537016
I don't know of any language that supports implicit or explicit conversion between strings and numeral values. That wouldn't make sense.

No where is it guaranteed that your string won't be something like "ASD2152A---", how could you possibly convert that directly into a number?

Therefore (int) "somestring" isn't valid.
>>
>>55537106
>any language that supports implicit or explicit conversion between strings and numeral values.
python and sql
probably every functional language too, but I don't know any of those
>>
>>55537117
>probably every functional language too, but I don't know any of those
How could you say "probably every functional language" when you do not know any of them?
>>
>>55537117
What python and sql do if the cast fails?
>>
File: fsf.png (417 KB, 500x814) Image search: [Google]
fsf.png
417 KB, 500x814
wtf happened to fsf?
>>
>>55537152
>facebook
Did you really think that the actual FSF would have a facebook?
Also, get out you fucking normie.
>>
My problem is so easy not 1 programmer here can fix it lol okay

I knew what i was expecting and i got it
>>
File: NvOxnPw.png (12 KB, 566x506) Image search: [Google]
NvOxnPw.png
12 KB, 566x506
>>55537142
>sql
The transaction fails. Any changes would rollback automatically, with default settings. You've got to handle it.
>>
>>55537166
it used to be legit a couple of months back though, in line with c+=

>normie
autist
>>
>>55537142
in sql
>1 + "1" = 2
>1 + "abc" = 1
an in some cases, sql will interpret 1 + "abc" to mean something else, like to return 1 as the value and name the column {whatever it was} + "abc"

nevermind about python, it actually throws an error
though I was pretty sure it would cast it
>>
>>55537177
>lol okay no one wants to help my stupid ass so I'll just accuse them of not knowing how to do it to bait them to solve my problems for me
>>
>>55536728
You need to use a method or function to do that, read the docs
>>
File: afpclUR.png (7 KB, 566x498) Image search: [Google]
afpclUR.png
7 KB, 566x498
>>55537216
>1 + "abc" = 1
Which DBMS does this behavior?

MSSQL doesn't.
>>
>>55537199
Oh, I thought you meant the actual FSF, sadly since nobody remembers C+= anymore I didn't know that this is what you meant.
>>
>>55537239
>nobody remembers C+= anymore
It's not that old though. Like 2 years max I think.
>>
i started doing codeforces contests a while ago. Is this a good way to learn something or a waste of time? Also what rating can be considered 'decent' there.
>>
File: mysql1.png (7 KB, 244x164) Image search: [Google]
mysql1.png
7 KB, 244x164
>>55537234
MySQL
>>
>>55537244
to a typical employer, anyone who can do just a few basic problems is employable
>>
>>55537246
MySQL gives me cancer.

I have to manage one MySQL DB at work, and it's the only one that I'm constantly having to fuck with because shit just doesn't werk.

>>55537261
This, pretty much.

These days, programming languages are so abstracted and easy to perform with, that employers are hiring non-programmers as programmers.

For example, a math major buddy got a job as a programmer, with the company basically saying
>"We can teach you C# in a month or two, but we can't teach you differential equations within that time."
>>
I started learning python on codecademy, is that ok or should i stop?
>>
>>55537089
the therm.object returns a float. i read the header file and it states this. i tried to use >>55536586 advice and it did not work then people attack me for it lol when you spend this much time on it you just want it fixed.
>>
>>55537316
don't worry, you're not actually learning anything
>>
>>55537316
good choice
feel free to ask questions here
>>
>>55537316
yeah, learning the syntax of python can be useful
>>
>>55537372
I wish there was shades of color or something to indicate sarcasm.
>>
File: mysql2.png (7 KB, 220x172) Image search: [Google]
mysql2.png
7 KB, 220x172
>>55537293
>and it's the only one that I'm constantly having to fuck with because shit just doesn't werk
it does take some getting used to, that's for sure
>>
>>55537381
laughed heartily, thanks anon
>>
>>55537383
lol
>>
File: audiobutton.webm (203 KB, 812x584) Image search: [Google]
audiobutton.webm
203 KB, 812x584
>>55536669
>>55536573

Got it working
>>
>>55537466
ok whatever man
because we care that much huh
>>
File: rootlogo.png (160 KB, 1024x350) Image search: [Google]
rootlogo.png
160 KB, 1024x350
For anyone trying to learn C++, especially trying to get a better grasp of the standard library, try CERN ROOT.

Yes, it is a data analysis framework, but the catch is, that is comes with a pretty nice C++ interpreter. This means you can prototype and toy with libraries in an interactive fashion. Just like you could do in python or LUA.

https://root.cern.ch/

There is also the root primer that gives a brief introduction by examples:

https://root.cern.ch/root/htmldoc/guides/primer/ROOTPrimer.html
>>
>>55535040

I know I'm late, but

>keeping your server rack next in your muggy basement next to your furnace

wut
>>
>>55535204
>le entitled meme
Man has dreams, automatically makes him better than your sour-ass
>>
>>55537372
>>55537355
Ok, can you suggest me some good book for total python beginner? I never build anything in python, i have experience in c/c++/java/php
>>
>>55537506
if you actually have experience in those languages, then just burn through the codecademy thing, then google "python list comprehension" and you're done
python is way simpler than all 4 of those
>>
>>55537506
Just get into its documentation.
>>
>>55537577
This and then go for documentation for stuff like libraries/modules, functional python and lambdas and OOP.
>>
Is there a great book or tutorial to learn Vulkan, or is it still dark magic understood only by AAA game devs and GPU companies?
>>
>>55537844
There's the official spec. Get on it.
If you want a book, you can start with Luna's D3D12 book and then read the Vulkan spec. D3D12 is to Vulkan what D3D11/10/9 is to Opengl 3+
>>
What's so great about static_cast? Why should I use it over the normal cast?
>>
>>55538132
It's more clear what your intentions are.
>>
>>55538132
c style casts in c++ simply go through the list of c++ casts until one works, so most of the time it is actually just doing a static_cast

there's only a couple of very specific cases where a c style cast wont work, and then you have to use static_cast explicitly
>>
Does anyone know where to get a good Java compiler?
>>
>>55535841
I made a game for Unity and in that game I made a random cave (dungeon) generator using cellular automata.

The thing is, it seems that you want a room based random dungeon generator which links together rooms you've precreated in a random manner. Is that fair to say? In that case it's super simple.

I'm interested in your results, because I want to visit video game development in unity once more as I enjoyed it immensely or well at least the programming part of it was fun.

Here is a blog post on the cavern generator.

https://p219.wordpress.com/2015/11/17/into-the-caverns-we-go/
>>
>>55538376
Write one yourself.
>>
What OS does people use here? I'm interested in switching to Linux but I want an OS that's friendly towards languages like Python.
>>
>>55539118
Windows 10, but it really doesn't matter much what OS you're using.

All of the languages you'd want to use are cross-platform.

I just can't live without Visual Studio.
>>
I just had this one for a coding job interview this morning, and answered it in 2 minutes.

Let's see if any of you plebeians can do it.
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.
>>
What's a good engine for creating performant 2D webgl things?
>>
File: base.png (8 KB, 482x84) Image search: [Google]
base.png
8 KB, 482x84
>>55539187
this

>>55539352
diy faggot
>>
>>55539311
cdef int i = 0, sum = 0
for i in range(i, 1001);
if i % 3 == 0 or i % 5 == 0:
sum += i

print(sum)
>>
>>55539311
auto total = 0;

for (int i = 0; i < 1000; ++i) {
if (i % 3 == 0 || i % 5 == 0)
total += i;
}
std::cout << total;
>>
>>55539381
>>55539391

Good response time, but not using Javascript makes you a beta fag.

Here was mine
let count = 0;
let i;
for (i = 0; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0) {
count += i;
}
}
console.log(count);
>>
>>55534649
Ooh neat! It's a really nice book.

I decided to expand on the text adventure engine with AI, external scripting, and a number of other things for practice.
>>
>>55539311
Isn't this just a slightly modified fizzbuzz?
>>
>>55539423
It pretty much is.
>>
>>55539373
I already made one for another game but I'm looking to try a more known interface this time so it's easier to work with other people.
>>
>>55539405
xdddddddddddddddddddddd
>>
>>55539405
JS has now a `let` keyword?
>>
Are pointers actually used in the real world or is it just an academic thing they have to teach you?
>>
>>55539501
They're everywhere in C/C++.
>>
>>55539311
sum(i for i in range(0, 1001) if any(i % m == 0 for m in {3, 5}))

could maybe think of a smart math solution if i thought a little harder.
>>
>>55539478
>a `let` keyword?
Indeed, along with `const`. For block scoping, vs function scoping, etc.

Also it has classes now. Welcome to the CURRENT YEAR
>>
>>55539545
I'm shocked.
>>
>>55539311
Yay for chaining!
(1...1000).select {|x| (x % 5).zero? or (x % 3).zero?}.inject{|x, y| x + y}


233168
>>
>>55539525 > >>55539591
>>
>>55539591
>ruby
>>
>>55539311
uint16_t sum = 0;

size_t i;
for (i = 3; i <= 999; i += 3) sum += i;
for (i = 5; i <= 1000; i += 5) sum += i;
>>
Have some money that I need to donate for reasons, its not much only $100~

Wanted to give to a foss developer
Any suggestions
>>
>>55539679
me
>>
>>55539591
disgusting
>>
>>55539679
just donate to the FSF
>>
>>55539679
give them to me ;_;
>>
>>55539696
>>55539735
Who are you? What have you developed that benefits me?
>>
File: projecteuler_jobinterviewlel.png (25 KB, 1421x285) Image search: [Google]
projecteuler_jobinterviewlel.png
25 KB, 1421x285
>>55539311
>TIL either job interviewers are looking for plebs or people say lies on the Internet
>>
>>55539742
I will suck your dick if you give them to me.
>>
>>55539714
Nah I don't want to give that scab eating Jew any money, I want him to die in a fire, he doesn't do shit for me. I would rather give some money Canonical even though they are led by a billionaire potato spaceman, because at least their work helps me directly. Or Debian.
>>
>>55539742
I develop high quality anime shitposting images, released into the public domain.
>>
File: ZemlCSC.png (10 KB, 614x198) Image search: [Google]
ZemlCSC.png
10 KB, 614x198
>>55539591
I like the way you think, friend.

static int SumOfAllMultiplesOf3or5Below1000()
{
return Range(1, 999).Where(x => x % 3 == 0 || x % 5 == 0).Sum();
}
>>
>>55539751
Not sure what you're butthurt about, it's a valid interview question. What does finding it elsewhere on the web have to do with it?

Here's another stab at in in ES6. It was the first approach I thought of, but didn't try for it and went for the simpler method, because I was under the clock.
let count = 0;
let i = 0;
Array.from({length: 999})
.map(n => i++ && (i % 3 == 0 || i % 5 == 0) && (count += i));
console.log(count);
>>
>>55539771
You're implying that the money would go directly into RMS' pockets, it won't, it will go to the foundation that does a lot for you. And he's done a great deal for you, he made GCC, which is probably what was used to compile 90% of programs that are on your computer.
>>
>>55539808
Hmm true about GCC I guess. I wish he didn't have such a repulsive personality, I wouldn't mind sending money his way. But he is such an autistic unlikable cunt that I feel physically sick at the idea. I'll think about it I guess.
>>
>>55539836
You could tell me a program, and I'd write it and give you the source.

And then you could donate the money to me.
>>
>>55539672
this is incorrect. 15 is added twice to the sum.
>>
>>55539672
Wrong
That's like saying for sets A,B,C:
|A U B|=|B|+|A| , but the right answer is
|A U B|=|B|+|A|-|A ∩ B|
add
 for (i = 15; i <= 1000; i += 15) sum -= i; 
to your code and it will be fine but slow
>>55539793
I honestly can't believe that was asked in an actual job interview. I am not butthurt. My problem is not that it can be found in project euler, but that it can be found as the very first question in project euler.
It would only filter out very few people if any, even with a short time limit.
>>
>>55539311
Poor man's solution.

std::array<int, 1000> range;
std::iota(std::begin(range), std::end(range), 0);

auto total = std::accumulate(std::begin(range), std::end(range), 0, [] (int s, int i) { return (i % 3 == 0 || i % 5 == 0) ? s + i : s; });

std::cout << total;
>>
>>55539931
sum({i for r in (range(m, 1000, m) for m in {3, 5}) for i in r})
>>
File: 1465670959995.png (235 KB, 289x378) Image search: [Google]
1465670959995.png
235 KB, 289x378
let's say a point O with a direction (probably just a unit vector I guess) as a 4x4 matrix. (3 angles and translation vector).
now I have a second vector v that points from O to a point P.
now I rotate O by some arbitrary direction.
if I now multiply v with the rotation Quaternion of O do I get the rotated vector v~?
>>
>>55535721
Plenty. Recently used a 3d array of ints representing points spent in a: Talent tree- Talent row- Talent
>>
>>55540015
you just have to believe in it
>>
>>55537261
I thought to pass a programming interview you had to solve the traveling salesman problem in O(1) time on a whiteboard in C blindfolded with both hands tied behind your back while singing Libiamo ne' lieti calici backwards in Chinese and it has to compile the first time without warnings.
>>
>>55539311
Why do all "interview challenge" questions involve modulus? Is the mark of a "skilled" programmer an understanding of modulus?
>>
>>55539311
(fold 
(lambda (x y)
(if (or (= (modulo x 3) 0)
(= (modulo x 5) 0))
(+ x y)
(+ 0 y)))
0
(iotz 1000))

Where iotz is a modified iota
(define (iotz x)
(append (cdr (iota x)) (cons x '())))
>>
Where did all the old /dpt/ go?
>>
>>55539870
Its okay I can write my own stuff, there are a lot of good foss projects I depend on to get shit done though. So how about you create something that's indispensable to people, e.g. a database driver or a go module.
>>
File: 1455954831810.jpg (89 KB, 440x404) Image search: [Google]
1455954831810.jpg
89 KB, 440x404
Break the wall is gone from these threads show sorta an unatractive look to get humans to make sure I want to mate with her so damn much <3 She's moe. Some stuff I've been around since I last saw her at ax kek Blond as well, though it was shit
>>
>>55539679

Don't give it to the fucking FSF
>>
>>55539679
Whatever your favourite OSS project is.
Or if you don't have one, Org Mode. It's basically the best thing that has ever happened to literate programming and reproducible research.
>>
>>55540182
Probably gonna give it to either the dude who wrote Termux, or the guy who wrote neovim, Floens or the Desmume project or byuu or maybe nds4droid
Don't know if there's a decent DOSbox project going for android, but I would probably donate to that and/or an Amiga emulator for android
>>
>>55535040
Where are all the old tripfags? Such as opisafag, the haskell dude and nand, marisa, lucy and notgaben?
>>
>>55540698
all those mentally ill faggots offed themselves
>>
>>55540698
Most of us took our trips off.

I'm on the list you just typed.
>>
Anyone else ever want to fuck their code?
>>
>>55540752
Are you the Finnish haskell dude whose name I can never remember?
If this is the case, I am glad that I know that you are alive at least.
>>
File: CfvXKPW.png (8 KB, 866x169) Image search: [Google]
CfvXKPW.png
8 KB, 866x169
>>55540779
Yes, I have a fetish for LINQ.
>>
>>55540860
Funny, reactive extensions is what made me ask the question.
>>
>>55540860
I was gonna say that there's probably one method that does all that, but I'm guessing by the double reverse()'s that that wasn't your intention.
>>
>>55535214
>>55536210
>>55537496
he is entitled tho

put others before yourself, always
>>
File: at5xHhc.png (17 KB, 921x346) Image search: [Google]
at5xHhc.png
17 KB, 921x346
>>55540889
Well yeah, considering I skipped none, took everything, reversed twice, and selected the entire list twice.

Two one-liners in pic.
>>
>>55540860

LINQ is goat.
>>
File: test.jpg (282 KB, 1024x1024) Image search: [Google]
test.jpg
282 KB, 1024x1024
I wanted to write random image generator in python 3.5, but my code wasn't work. I tried a few things and now I've got picture related. What the fuck is this? My code:

import numpy as np
import os
from random import randint
from PIL import Image

height = int(input("Image height: "))
width = int(input("Image width: "))

image = np.zeros(shape=(width, height))

for i in range(0, height):
for j in range(0, width):
#r = randint(0,255)
#g = randint(0,255)
#b = randint(0,255)
#rgb = r * 65536 + g * 256 + b
#image[i][j] = hex(rgb)[2:]
image[i][j] = 255

test = Image.fromarray(image, mode="RGB")
dir = os.getcwd()+"/test.jpg"
test.save(dir)
>>
>>55541097
I'm going to just say that you should read your code again.
>>
File: 1463480338258.png (57 KB, 420x261) Image search: [Google]
1463480338258.png
57 KB, 420x261
What do you think of Visual Basic .NET?
>>
>>55541166
What is wrong there? I commented what wasn't work because
ValueError: could not convert string to float: hex value

Why my image isn't in one color if whole array is going to have 255 value?
>>
>>55540955
What color scheme is that?
>>
>>55541200
it's shit
>>
>>55541200
It seems kind of pointless, C# is better in every way and can do the same things and more.
>>
>>55537491
In my ACNL house I kept the servers in the attic with fans everywhere.
>>
>>55541200
No reason for it to exist alongside the vastly superior C#.

It's going to be around for legacy purposes for a while, though.
>>
>>55541225
Default dark theme in Visual Studio.
>>
How can I learn to make nice well written code? How can I "format" the whole thing?

Is it just practice?
>>
>>55540860
lmao at
>...
>.Skip(0)
>.Take(8)
>...
>>
>>55541336
What language?

Every language has an auto-formatter. Just follow the language's spec while you're writing.

There are also sites like poorsql.com that you can use.
>>
>>55537010
haskell
>>
>>55537010
Why do you hate yourself?
>>
Post your colors schemes and editors.
This is vim on xfce4-terminal with Tango preset and a background color change. I sort of miss atom's color scheme, it was pretty comfy.
>>
>>55541429
Disgusting.
>>
File: text editors.jpg (192 KB, 1224x720) Image search: [Google]
text editors.jpg
192 KB, 1224x720
>>55541429
>>
File: 1467915678760.gif (1 MB, 446x469) Image search: [Google]
1467915678760.gif
1 MB, 446x469
>>55541429
> vim
> atom
not using emacs
>>
>>55541480
I can agree with >atom but the others are good as well. I'm not the one you want for continuous shitposting about which editor you use and like.
>>
>>55541475
Post yours then.
>>
File: 1465528686330.jpg (58 KB, 880x500) Image search: [Google]
1465528686330.jpg
58 KB, 880x500
>>55541525
>>
>>55541237
>>55541293
by that logic, you should be using F#
>>
File: Stab.png (712 KB, 600x600) Image search: [Google]
Stab.png
712 KB, 600x600
Hi, first time lurking this thread
I'd like to start learning how to program some basic stuff. What's the best way to start? What are the best programming languages to use as of today?
I've used Visual Basic a bit in the past and it's pretty easy to code with that and it could get the job done most of the times but I realize it's quite shit to use right now.
>>
>>55541588
There are particular metrics of superiority that F# fails on at the moment, primarily in examples of usage for very specific use-cases. Not many people use it, so there are far less examples on how to accomplish particular tasks.

Also, there are some tools without F# support, one example being the drag-and-drop GUI creator for something like WinForms.
>>
>>55541604
C# or Python are the best hobby languages right now.

They're both piss-easy to learn and let you get shit done.
>>
>>55541588
except nobody knows what that is
>>
>>55541604
the only winning move is not to play. seriously, run away as long as you can.
>>
File: screen2.png (45 KB, 706x296) Image search: [Google]
screen2.png
45 KB, 706x296
>>55541429
> emacs
misterioso theme
>>
File: lost.jpg (23 KB, 480x360) Image search: [Google]
lost.jpg
23 KB, 480x360
>>55541653
> C#
> lets you get shit done
>>
>>55541744
I think you might be confused.

C# is one of the easiest languages to go from nothing to a working automation tool or GUI app in a really short amount of time.

If you'd care to give an example of something you normally do with a programming language, maybe I could see where you're coming from.
>>
>>55541767
>working automation tool
no

>GUI app
yes
>>
>>55541777
>>working automation tool
>no

Wow, those repeating digits sure showed me!
>>
>>55541767
> open bash terminal in linux
>
 cd /usr/bin [/code ]
>
 objdump -d [any binary-file] 

now make me a program converting the output into a more readable form in C#, use this: http://www.mono-project.com/
>>
File: twitter_400x400.jpg (32 KB, 400x400) Image search: [Google]
twitter_400x400.jpg
32 KB, 400x400
>>55541477

impressive, very nice
>>
File: gvim.png (22 KB, 660x785) Image search: [Google]
gvim.png
22 KB, 660x785
>>55541429

Vim + Gruvbox

Same setup / rc pretty much on my windows gaming box and my dev laptop.

Just copied a small amount of useless code I had laying around to show the syntax. Comments are grey.
>>
>>55541846
lol, fucked it up, sorry:
> open bash terminal in linux
> cd /usr/bin
> objdump -d [any binary-file]
now make me a program converting the output into a more readable form in C#, use this: http://www.mono-project.com/
>>
Why is Go the best language?
>>
>>55541846
>>55541869
The fuck are you doing
>>
>>55541917
it isn't, those are the best: C, common lisp, haskell, ada
>>
>>55541927
I tried to use the code markup to mark the bash commands, but it fucked up, dunno why.
>>
File: RotatingPointCloud.webm (3 MB, 466x500) Image search: [Google]
RotatingPointCloud.webm
3 MB, 466x500
I made this rotating sphere of points in raw JS. No libraries, all 3d math computed directly. Output is to 2d canvas.
It's reasonably terse, around 140 loc.
Idk, is there any way I can make this into something cool looking?
https://jsfiddle.net/bm0e6217/
>>
>>55542019
Create the points based on data from external APIs, so that they actually mean something.
>>
>>55541929
>exploit
>meme
>hipstershit
>lame pascal
please
>>
>>55542044
Hello pajeet. Also javascript, Java and C++ are the real hipstershit.
>>
>>55541917

There is no such thing as a best language..

Go is decent because of it's rather simplistic approach to things. It's a slightly slower higher level version of c with nice features like built in concurrency support.

Personally of the newer generation of "low level languages" I'm digging Rust. It feels more flexible and comfortable (I did more c++ work than c).
>>
>>55542071
awwwww, did the little hasklel shit get his feeweeings hurt? poor babby
>>
>>55539311
#!/bin/perl
$sum = 0;
$sum += $_ for (grep { $_ % 3 == 0 || $_ % 5 == 0 } 0..999);
print "$sum\n";
>>
>>55541917
Because Kotlin is better.
>>
>>55542158
Thx for this actually pretty cool / original solution.
Why have I not written perl scripts before, and why is it because Python, Javascript etc are objectively better?
>>
I'm looking to learn to code because I know no one will spood feed me but I don't know which language to learn.

I am planning to make a script or bot that would do most of the repetitive task for me.
I.e. There is a website that have occasional lucky draw and I want to write a script to do it automatically for me. Is there a language that focuses on this aspect?
The website at hand is panda.tv and every so often there will be a banner announcing that the lucky draw is starting. I want to write a script to block that banner (which will open a new tab) > go to said tab > disable / pause the video and the commentary > spam click on the button until count down is finished then close the tab.

I'm not asking for the script cause I know I have to work for it but I want to know which language is the best at doing the things I plan to do?
>>
>>55542238
Stop shitposting and accept it gracefully
>>
>>55542238
stop using gay languages
>>
>>55542244
you can do such things on mac with something like Keyboard Maestro to record macros.
>>
>>55542244
Python
>>
>>55542244

Look into something like selenium.

It'd be better to ask this on the web dev daily thread.
>>
>>55542200
>JVM
>any year
>>
Anyone here do Android development? How do you resist the urge to kill yourself?
>>
>>55542244
>There is a website that have occasional lucky draw and I want to write a script to do it automatically for me.
Look into the selenium framework. It has a pretty robust C#, Ruby, and Python package.
>>
>>55542423
Habit.
>>
File: 1465749652628.png (278 KB, 640x360) Image search: [Google]
1465749652628.png
278 KB, 640x360
>>55542071
>industry standard
>hipster shit
>>
>>55542019
Replicate the point cloud scene from Future Crew - Panic.
>>
File: gskldhgdfhlkgd.png (84 KB, 235x250) Image search: [Google]
gskldhgdfhlkgd.png
84 KB, 235x250
>interview at company
>been studying data structures because that's what everyone said they went for
>interview instead focuses on OOP and testing
>I barely touched it
>out of 10 questions get maybe 5-6 right
>other 4 he'd chime in with a lets move on or explain my answer and add the correct shit
>even the 5-6 I got right he'd add some stuff too
>tfw panic set in
>mfw that interview was a disaster

he later explained that data structures is the third interview in. I ain't getting that far anyway after that interview.
>>
>>55542478
What'd they ask about OOP?
>>
>>55539793
Array.from({length: 1000}).reduce((a,b,c)=>{return (!(c%3)||!(c%5))?(a+c):a},0)
>>
>>55542478
>oop heavy company
Not working there is for the best. Nothing worse than dealing with a bunch of cargo cult fuckmops who worship OOP
>>
File: 1400327159-joe.jpg (12 KB, 340x255) Image search: [Google]
1400327159-joe.jpg
12 KB, 340x255
How do I get into sockets? On ... [spoiler] python[/spoiler]
>>
>>55542331

Does it detect when the banner surfaces and start the script or something tho? That's the most important automated part I need. There will be several banners popping up one after another during 'rush hour' so I need to tweak it to make sure the page is loaded etc etc so I'm assuming it has to interact with the browser in a way but I will take look at macros and see if it's sufficient for my needs.

>>55542348
Leaning towards this as it's arguably the easiest to learn and javascript coming in second. There are some greasemonkey script that does sort of what I want but is incomplete so I might pick that up too.

>>55542368
>>55542445
no idea what selenium is but will look it up. I was going to ask in the stupid question thread but saw the thread on the catalog instead, will do sir will do

cheers /g/uys, appreciate the suggestions.
>>
>>55542504
https://docs.python.org/2/library/socket.html
It's basically C sockets.
>>
>>55542501
>let's have this large team work on procedural/functional code
>what could go wrong
>we don't need modularity
>we don't need encapsulation
>we don't need re-usability of code
>we don't need maintainability
>me and the fizzbuzzing haskell fags on /dpt/ right and everyone else is wrong
>no industry or computer science professor knows better than me
stay NEET dumb ass basement dwelling babby """programmer"""
>>
Why do people ask so many data structure/algo questions in interviews? Is it just following what companies like Google do?

I mean, Google has tough interviews with those kinds of problems but when you look at the software Google writes its fucking garbage. Like take a look at Android's source code or try making sense of the stupid fucking Android SDK design and you realize the people who wrote it are idiots. If thats what hiring based on memorizing CTCI gets you, why do people keep doing it?
>>
>>55542484

>define OOP
>what is the difference between classes and objects?
>define some core attributes of OOP
>define polymorphism and how to use it on shapes
>what are three things in AGILE development?
>how does the Waterfall development work?
>why do we test?
>talk about functional documentation
>what is UML?
>how to do use cases? description of use cases?

I fucked up polymorphism, UML, and AGILE. in most cases I gave low level descriptions when he wanted examples.

I also panicked at the third question because it was at that moment I realized all the shit I had studied on data structures was going to be fucking useless.

how long does it take for a company to call and tell me I won't be getting that job?
>>
>>55542649
Oh, wouldn't have a clue what AGILE and Waterfall development stand for either.
>>
>>55542649
>low level descriptions when he wanted examples.

fuck meant low level descriptions when he wanted high level

most of the time I just gave him examples I thought would work for definitions.

He was a nice interviewer but I got a sense he felt I wasn't worth it.
>>
>>55542587

Clearly hasn't walked into the average java code base..

OOP in general has a bad habit of making programmers do tons of generic elaborate bullshit when all they really need is a small function / struct.

>>55542649

AGILE = Corporate meme language for iterative development practices mixed with user testing. Start with small parts of the program and then work up. Complete every feature you work on before moving to the next one. Oh, and ffs diagram (For the brain dead management / funders) / test everything
>>
>>55542587
Butthurt JavaAbstractBeanFactoryBeanFag detected. OOP is fine when its used to solve certain kinds of problems. Worshipping it and using it everywhere creates more problems than it solves.

>modularity
OOP does not inherently provide modularity. In fact when you do it naively it destroys modularity because of inheritance and bringing in a whole fuck ton of stuff you don't need

>encapsulation
// smart and clean
struct Bang {
int boom;
int dang;
int foo;
}

// stupid overdesigned pos
public class Bang {
public void setBoom(int b);
public int getBoom();
...
};


b-but I can change what the functions do in the future! Yeah encapsulation is great if you're an indecisive fuck who can't plan out a design in advance.
>tfw you see morons write getters and setters for simple properties and then write unit tests for them

>re-usability of code
Functional code is FAR more usable than OOP code dumbass

>maintainability
Functional code is easier to test and far more robust. Its stateless. How fucking stupid are you?

>Haskell
Protip retard, you can write functional code in anything that gives you free functions (does Java have that yet? lel). You can write functional code in C, C++, Python, etc. OOP is fine for certain applications. Its good for certain kinds of application architecture. It is not the end-all be-all of software design and cargo cult morons like you make the industry a fucking hellish landscape filled with 99% useless slow ugly boilerplate
>>
>>55542423
I don't really get the urge to kill myself. Just the feeling of constant panic.

>release app
>fuckers are crashing for obscure reasons
>fuck fuck fuck
>>
>>55542742
lol
>>
File: objdmp.png (30 KB, 686x518) Image search: [Google]
objdmp.png
30 KB, 686x518
>>55541910

What exactly do you mean by "more readable form"?
>>
>>55542821
Using Intel syntax
>>
>>55542782
I didn't think there could be anything worse than writing the application in the first place but then I saw how applications are tested and I wanted to give up software development forever right then and there.

>tfw JUnit, Espresso, Roboletric and the dozen other test suits are such an unbelievably disgusting mess of garbage and take hours to set up and tests take like dozens of minutes to run
>>
>>55542835
>>>intel syntax
>2018
>>
File: Python-logo-notext.svg.png (72 KB, 1024x1024) Image search: [Google]
Python-logo-notext.svg.png
72 KB, 1024x1024
Why is she so beautiful?
Thread replies: 255
Thread images: 45

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

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.