[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: 41
File: dpt.png (389 KB, 934x1000) Image search: [Google]
dpt.png
389 KB, 934x1000
What are you working on, /g/?
>>
>>52553087
first for hitler used java
>>
>>52553087
Trying to stop being a disorganized fuck and writing proper tests.
>>
>>52553087
hitler was right
>>
>>52553087
Put a damn link to the old thread in the OPs: >>52549242
At least you didn't post degenerate shit and waited till after the bump limit.
>>
What's the best data library in python? Pandas?
>>
File: Screenshot.png (3 MB, 3280x1920) Image search: [Google]
Screenshot.png
3 MB, 3280x1920
Just installed Linux.
>>
first for fourth
>>
>>52553203
>data library
Is there any possible way you could make your post more vague?
>>
File: stallman1.jpg (124 KB, 480x320) Image search: [Google]
stallman1.jpg
124 KB, 480x320
>>52553230
>nooboontoo
Install trisquel GNU plus linux-libre
>>
>>52553230
You're supposed to installed one of the autistic distros, e.g., Arch, Gentoo, etc.
>>
>>52553279
>>52553289
b-but it has m8 in the name.
>>
>https://github.com/arnetheduck/nlvm
neat
maybe Araq will finally move to LLVM IR instead of just "transpile it to C lol :^)"
>>
>>52553249
> what's the best library for the language I use
>>
>>52553203
Yes. Or just use hdf5 for everything and use pytables.
>>
I thought the "vb is the worst language ever" meme was a meme
It was not.
I wasn't expecting it to be good, but jesus
>>
>>52553502
try Objective-C
I literally wrote 200 lines of code to make a calculator using best practice
meme language
>>
>>52553502

The nice thing is that you can easily convert between C# and VB .NET. So if you need something ""written"" in VB, just write it in C#.
>>
>spend the last 10 years of my life programming
>sorry anon but your skills as a C Programmer are outdated
>you're not a javascript ninja
>we don't need low level stuff anymore
>we only need frontend programmers

Theres no money to be made programming desktop applications, its all about apps and web programming which isn't programming its just spamming worthless meaningless shit for pennies

Remember kids if you're going to make programming into a career always keep in mind what you learnt will be comepletely useless in 5 years.
>>
I'm thinking of giving Clang a shot, but I'm not sure if I should. I've read that it works better than gcc. I've always used gcc, so should I give it a shot??

What are /g/'s thoughts??
>>
>>52553550
C programming has been deprecated for quite some time

move on to C++ or someshit
>>
>>52553550
>your skills as a C Programmer are outdated

Tbh, they might be. Do you even use C11?
>>
>>52553564
it's gcc but faster but I doubt you'll notice if you're making small ass programs.
>>
import java.util.ArrayList; 
import java.util.List;

public class Lel {

public static Lel topLel = new Lel();
public static Lel lel = topLel.topLel;
public static Lel bottomLel = topLel.lel;

public static void main(String[] args) {
List lels = new ArrayList();

while (true) {
lels.add(new Lel());
}
}

}
>>
>>52553543
Ya I'm a c# guy. Had to use vb for a bullshit "we had nothing better to give you this term" class.
>>
>>52553609

Thanks!
>>
>>52553502
What dont you like about VB?
>>
>>52553670
The syntax is just incredibly unintuitive and it uses the whole "english keywords" thing in the worst way I've ever seen.
if/elseif/endif, who does that
>>
File: gopher.gif (148 KB, 400x470) Image search: [Google]
gopher.gif
148 KB, 400x470
Why is Go a meme?
>>
>>52553699
all the worst features of C, none of erlang's features beside channels.
>>
>>52553699
Why wouldn't it?
>>
>>52553699
>the people who design it have a bizarre ideological opposition to generics
>D already exists
>>
File: intense sexual preparation.png (294 KB, 444x434) Image search: [Google]
intense sexual preparation.png
294 KB, 444x434
>>52553697
>endif
>>
>>52553564
gcc is better
>>
Why is my timestep being ran about half as frequently as I want it to?

>My timestep is 16ms, so 1,000ms/16ms = ~60 timesteps per second.
>10,000ms/16ms = 625 timesteps in 10 seconds

>In reality if I let it run for 10s, I get 312~ elapsed timesteps
>>
>>52553699
>even the mascot straight up shills ethnical diversity and multiculturalism
>>
File: dgre.png (35 KB, 563x426) Image search: [Google]
dgre.png
35 KB, 563x426
>>52553790
>>
>>52553790
post code you dickbutt

are you getting vsync'd to 60 fps?
>>
>>52553795
what
>>
>>52553832
>gopher.gif
>the color of its skin/fur
>>
File: l.png (60 KB, 1200x1892) Image search: [Google]
l.png
60 KB, 1200x1892
What websites should I block senpai?
>>
>>52553850
4chan
>>
>>52553842
fucking animals with their brown fur
animal holocaust when
>>
>>52553850
http://someonewhocares.org/hosts/
>>
>>52553850
it's the only rational answer >>52553872
>>
>get web dev job editing and maintaining shitty old ASP.NET

did i make it?
>>
>>52553842
>4chan hate me because my skin is brown
just fuck you m8.

It's not my fucking fault.

fuck you
>>
File: selfie.jpg (93 KB, 640x640) Image search: [Google]
selfie.jpg
93 KB, 640x640
Is this a good way to do property binding in C#?
public class ConfigContainer_Bool
{
public delegate void EventHandler_Void();
public event EventHandler_Void onValueChanged;


public string Name { get; private set; }
bool _Value; public bool Value
{
get { return _Value; }
set { if (_Value != value) { _Value = value; if (onValueChanged != null) { onValueChanged.Invoke(); } } }
}


public ConfigContainer_Bool(string name, bool value)
{
this.Name = name;
this._Value = value;
}
}

I don't really like it because I have to write "showTabBar.Value" rather than just "showTabBar" that way
But I don't know how to do this any better
>>
>>52553939

hnnnnng this code is hot
>>
>>52553923
>4chan hates drawings of animals with brown fur
how does it even cross your mind to care what they think about you
>>
>>52553947
Hey, my code is down there!
>>
>>52553939
>prefix underscores instead of postfix
degenerate
>>
>>52553939
>deleting your post
>twice
>>
>>52553923
calm down m8 i don't hate you specifically it's just the SJW agenda that the jews are pushing

>inb4 you're a jew
>>
>>52553939
N O G F
O
G
F
>>
>>52553947
99% boiler plate

na mane
>>
>>52553939
>that classname
other than that yeah
>>
>>52553988
I think that's a resharper convention
>>
>>52554157
Yes, I'll probably rename it soon

>>52554169
>>52553988
I'm prefixing so it doesn't show up in the auto-completion window when typing the first letter from within the class
>>
hey senpai
Does nim have anything like python's range?
>https://docs.python.org/3/library/functions.html#func-range
>range(start, stop[, step])
I'm interested in the [, step] part.
Can you do every nth step in nim?
>>> for i in range(0, 23, 5):
... print i
...
0
5
10
15
20

I don't see any way to do it in nim.
I know I could use 1..23 but I'm not sure how step could be used with it
>>
>>52554052
You can have a girlfriend in VR in a few years
>>
I just bought Prata's C++ Primer Plus to start learning programming.

I was afraid to open it for a while but now I've read the first chapter.

I only cried a little bit, am I a programmer now?
>>
>>52554265
it'll be many years before VR is good and you still won't be able to touch her irl
>>
>>52554249
for x in countdown(10,0,3): echo(x)


output
10
7
4
1
>>
>>52554443
Why would it be many years?
The upcoming consumer VR headsets have pretty decent resolution
Touch is possible right now by full-body tracking a silicone doll

All that's missing are good waifu sims and silicone dolls that can actually move
This will likely happen in the next 5 years
>>
File: LLVM-3-0-Officially-Released.png (184 KB, 728x399) Image search: [Google]
LLVM-3-0-Officially-Released.png
184 KB, 728x399
What's so revolutionary about LLVM?
>>
>>52554536
thanks senpai, sorry I missed that
>>
>>52554544
Nothing, really.
>>
>>52554539
* actually move by themselves I mean
>>
>>52554544
There wasn't any good cross-platform low-level VM before. For example, jvm is slow, very restrictive, large, and GC-enabled, and MSIL is additionally locked. Inherently, though, it's not very good.
>>
File: optimized.png (47 KB, 728x399) Image search: [Google]
optimized.png
47 KB, 728x399
>>52554544
your PNG is now optimized.
>>
>>52554539
have you even touched a real woman, silicone doesn't feel as good as a healthy woman's soft, smooth and supple skin
>>
File: gay (1).png (41 KB, 728x399) Image search: [Google]
gay (1).png
41 KB, 728x399
>>52554580

your optimized PNG is now compressed.
>>
>>52554544
It's a cool logo
>>
>>52554621
lo/g/os
>>
>>52553550
Stop applying for hipster startup companies then you faggot.
Jesus I've not even finished my CSE course and I'm already walking into a software job (working with bespoke hardware).

You know what I had to do to get it? Not be a sperg, and not be afraid of low level languages like C. I don't even have to know it that well, but just be willing to fucking LEARN.
Any and every fucking graduate can work with python and java, nobody gives a fuck about that, might as well put on your CV that you have two arms and know how to flip burgers.

There is money to be made in desktop applications, you just have to be actually good at your job, rather than cog #232/1000 in the meme development machine.
Nobody cares what you already know, they care about what are are willing to find out.
>>
>>52554599

Nothing compares to the touch of a real woman.

>>52554633

What kind of experience did that job you landed require? Just curious.
>>
>>52554633
>C
>desktop applications
Is this 1973 again?
>>
>>52554599
True, but with clothes on it should feel pretty much the same way
And it's not like you want a girlfriend to touch her super-realistic skin
>>
>>52554536
I don't understand this.
import sequtils
let x = toSeq(1..50)
proc chunks(l, n): auto =
for i in countup(0, len(l), 0):
yield l[i..i+n]
echo chunks(x, 5)

>c:\users\faggot\nim\l.nim(6, 5) Error: 'yield' only allowed in an iterator
Isn't it in an iterator, for?
Why isn't it allowed?
>>
>>52554544
Clang
>>
>>52554674
>(0, len(l), 0)
that might be it
I should re-read my shit before posting
sorry
>>
>>52554633

>didnt go to uni
>learned javascript and made tons and tons of shit with it at home
>called company and told them i live and breath code
>yes i actually said that

got job. Feels goodman.
>>
>>52554702
things_that_never_happened.jpg
>>
>>52554665
>What kind of experience did that job you landed require? Just curious.
None, really. I worked for them last summer (full pay, none of that $2/hour intern shit) as a sort of trial period, they're happy with my workstyle and I get on with the rest of the software department (literally 3 other guys).

>>52554670
Not every company has the time and resources to redo over 20 years worth of code in the meme language of day. You know COBOL is still going right? It might not be much fun to work with, but anyone who can gets paid better than any javamonkey could dream of.
>>
>tfw you spend 3 hours debugging your program because of inexplicable behavior

>there's a semicolon on one of your nested loops
FUCK
>>
>>52554742

of course i had to pass the interview but its actually true

stay jelly
>>
>>52554702
>javascript
prove it pajeet
>>
>>52554775
use braces you dip
>>
>>52554832
i did
it looked like
for (j = 0; j < y; j++);
{
>>
>>52554665
>Nothing compares to the touch of a real woman.

I don't know about that, Ruby. The feel of finely stained wood and cold steel on a new gun is pretty good.
>>
>>52554775
what horrible language are you working in
>>
>>52554827

i made a little paint program, a mouse click 2d shooter, and just basic bootstrapped web site layouts. That's literally it. During the interview they had me fizz buzz and program tic tac toe with html/css/javascript.
>>
>>52554845
wtf

also, that is why this format
 for(int i=0; i<69; ++i){
cunt();
}


is superior
>>
>>52554773
>maintaining 30 years old shitware
>desktop applications
Choose one.
>>
How can I view all my GET requests, /dpt/?
>>
>>52554889
this is a horribly general question and should probably go in /wdg/
>>
>>52554906
/dpt/ is like a chatroom, you can ask whatever you want here.

stop promoting other generals, anon.
>>
>>52554889
http://requestb.in/
https://github.com/Runscope/requestbin
>>
>>52554879
But that's exactly what I'm going to be doing. Just because niche products are small business, doesn't mean they don't exist.
>>
>>52554970
My fucking sides! Is that how people who end up in dead-end job like codemonkeying or burger flipping always end up like?
>>
>>52554985
Low quality shitpost, please modify before reposting.
>>
>>52554970

can you tip your fedora any harder? its 2016. Javascript is taking over and web applications are running the world now.
>>
>>52554970
maintenance can be fun if the original software was written really well. if not, probably sucks hard to maintain that crap
>>
>>52555071
Eitherway, using a dead language is really shit.
>>
>>52555065
>It runs in The Cloud™ :^)

High level meme languages come and go every 5 years, but low level shit is here to stay.
Even if one of the many maymays actually lasts, how much are you willing you gamble that it'll be the one you're using?

I'll take solid employment over starbucks enterprises, thanks.

>>52555071
The people who wrote the original software are still there.
It's being improved upon all the time, but they don't currently have enough manpower to maintain the existing codebase and add all the new features that they would like.
I'm going to be doing more of the latter, but some maintenance too if the others are held up and some serious bug appears or whatever.
>>
>>52555065
that's just a stupid meme. web apps have severe drawbacks. just try running any webgl app for instance. unless you lucked out with your graphics drivers or something you will not have a great experience with it.
>>
>>52555221
Unlike C am i rite?
>>
>Javafags will never know the fun of pointers
>>
>>52555274
But all nonprimitives in Java is are pointers, anon.
>>
>>52555274
>ctards will never know the fun of no buffer overruns, no use after free, no double free.
>>
>>52555287
Those are the result of bad programming though
>>
>>52555310
>literally everything is bad programming except using a high-level language
Thanks.
>>
File: fuck.png (24 KB, 825x1013) Image search: [Google]
fuck.png
24 KB, 825x1013
so I got it to work, but I feel like there has to be a better way to do this
import sequtils

let x = toSeq(0..53)

iterator chunks(s, n): auto =
for i in countup(1, len(s), n):
yield s[i..i+n-1]

for i in chunks(x, 5):
echo i

this, when run, gives
Traceback (most recent call last)
l.nim(7) l
system.nim(3202) []
system.nim(2527) sysFatal
Error: unhandled exception: index out of bounds [IndexError]

which can be fixed by changing it to
iterator chunks(s, n): auto =
for i in countup(1, len(s), n):
if i+n < len(s):
yield s[i..i+n-1]
else:
yield s[i..len(s)-1]

this looks ugly to me though, is there a better way?
>>
>>52555357
>he fell for the self-perpetrated nimeme
>>
>>52555328
Not my fault if you can't check your inputs
>>
>>52555380
>I'm the only person in the world who can check my inputs!
>therefore C is a good language!1
>>
>>52555391
>I'm the only person in the world who can check my inputs!
When did I say that
>>
File: 12.png (16 KB, 314x138) Image search: [Google]
12.png
16 KB, 314x138
>>52555391
d
e
l
u
s
i
o
n
>>
>>52553087
I'm programming a robotic snowplow in a last ditch effort to get it working for the ION competition in 5 days.

Also VHDL... lots of VHDL
>>
>>52555405
Are you backpedaling now? Are you admitting that you aren't better than the sum of all the best C developers to ever grace this Earth?
>>
File: gay_3.png (14 KB, 728x399) Image search: [Google]
gay_3.png
14 KB, 728x399
>>52554610
fuck you
>>
>>52555430
>Are you admitting that you aren't better than the sum of all the best C developers to ever grace this Earth?
When did I ever insinuate that I was? Are you okay anon?
>>
>>52555447
Backpedaling at the speed of light I see.
Typical ctards.
>>
>>52555454
Whatever you say anon
If you don't check your inputs, then it's your own fault if your program suffers any kind of overflow
>>
I just came to say that after learning basic html and css I'm having so much fucking unbelieable fun.

I don't get why you guys hate webdev.

It's so fun and easy.

:)
>>
File: no thanks.png (186 KB, 1271x975) Image search: [Google]
no thanks.png
186 KB, 1271x975
No thanks, /g/.
Figured out transforms and projections on my own.
Wasn't even that difficult. Jesus.
>>
>>52555494
>C is the best language
>it lets hacker get all my user's credentials
>it lets my kernel be vulnerable to remote execution
>it kills every application that relies on time information in 2000
>I love C
>>
>>52555531
nice 1998 meme
>>
>>52555511
Fuck off back to your containment thread pajeet.
>>
>>52555511
what language did you learn first and if it's a low level one then I agree because web dev languages are easy as fuck.
>>
>>52555540
who?

I don't browse the web development general.
I just started to learn html and css.

>>52555573
[spoiler]C# then Java[/spoiler]
the most low level shit was making breakout in SDL.
>>
Firefox or Chrome?
>>
>>52555601
whichever one you prefer better, anon
>>
>>52555531
http://securityaffairs.co/wordpress/32743/security/java-poses-security-risks-us.html
Stay delusional
>>
>>52555531
>Complains that C is insecure
>Still uses operating system with the vast majority of components written in C

Just because you're unable to program secure code, doesn't mean others can't manage just fine :^)

Stick to meme languages, we don't want you causing any real harm.
>>
>>52555618
>software written in C is the largest security risk
Thanks for proving my point.
>>
>>52555625
>points out the OS is written in C
>implies that this means some C programs aren't chockfull of bugs
>when the OS is known to have pages upon pages' worth of security vuln which were all due exclusively to the use of C rather than a sane language
Cmen logic.
>>
File: shitposting.gif (31 KB, 250x250) Image search: [Google]
shitposting.gif
31 KB, 250x250
>>52555658
Nobody ever claimed C code is bug-free.
You just seem to be under the impression that nobody is capable of writing secure software in C.
If you truly believe this to be the case, then you wouldn't willing run any program written in C, or that uses components written in C.

But you do, because you're a hypocritical shitposting faggot.
>>
File: BUNBUUU.jpg (107 KB, 932x651) Image search: [Google]
BUNBUUU.jpg
107 KB, 932x651
Some challenge website asked me to simulate falling tetris blocks after a 4-line tetris and I solved it by sorting the game grid vertically with qsort...

Am I doing it right?
>>
What's the Notepad++ of Linux, /dpt/?
>>
>>52555859
gedit
>>
>>52555859
Kate
>>
>>52555781
Strictly speaking the solution is correct, you only had to simulate the results. But if you weren't a faggot you'd just count the number of blocks in each row and spit it out in sorted order, since all blocks are equal.
>>
>>52555902
*although it's only correct in the case the game has just started.
Correct solution is to parse all four columns for the first instance of a block it finds.
It chooses the maximum (or minimum depending on how it's set up) and then teleports it above that row.

In the case of a vertical 4-line tetris block then all you have to do is drop it above the first block, or at the bottom if there is none.
>>
>>52555859
atom
>>
File: 1.8468080.jpg (354 KB, 2400x1649) Image search: [Google]
1.8468080.jpg
354 KB, 2400x1649
>mfw I realize negation is just xoring with all 1s
>>
>>52555993
I guess you could do that.
Intellectually it's a far more intensive task than two's complement.
>>
>>52555993
>using one's-complement
>>
>>52555993
No it's not you fuck.
It's NOT X + 1
>>
Which is easier to make a compiler for? RISC or CISC?
>>
I'm working on a new block cipher algorithm. I have the proof of concept code done for the alphabet(lower and upper case) and a few symbols. Now I'm working on having it handle all ASCII and Unicode characters.
>>
hard ass niggas write oop
>>
>>52556201
It depends on the actual CPU architecture.
>>
>>52556295
Okay, may i ask another question?
Which is more efficient for a VM architecture? RISC or CISC?
Is that even applicable to bytecode? how different is bytecode to actual machine code anyway?
>>
C program to get the determinant of any matrix. Having some infinite loop issues.
>>
>>52556385
It's very concise though
>>
>>52556445
post code
>>
>>52556509
>>
>>52556523
>tfw no code
>>
>>52554569
>Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them. The name "LLVM" itself is not an acronym; it is the full name of the project.
>>
>>52555859
Am I autistic if I just like to use nano?
>>
>>52553564
Why not? I usually switch around, they work exactly the same. Clang gives really nice colored error messages so if I'm struggling through template errors or some C++ bullshit I might use clang. I think clang compiles faster, but I haven't made anything substantial enough for any "performance" differences to matter. I have however had problems with code only compiling on clang and not on gcc, but it was something kind of un-standard so I just rewrote it to be compatible.
>>
File: GentooEmacs.png (5 KB, 720x400) Image search: [Google]
GentooEmacs.png
5 KB, 720x400
>installing unnecessary bloat like a WM in order to program
>he can't do it all from the command line
Shiggy
>>
$ ed -p'> '
> a
Hello world
Why can't we all get along?
No one needs to die!
vim, emacs, nano, we can all live in unison.
.
> 1,2d
> 1,s/.\{7\}n/n/
> 1,s/ds/d/
> 2,s/o,.*/o /g
> 1m2
> 1,2j
> ,p
>>
>>52556593
Maybe.
>>
>>52556633
How did you screenshot?
>>
>>52556593
>>52556593
nano is good for reading large files but not for writing them. Use sublime text for a semifledged but very competent text editor. It won't look as 1337 as a terminal though.
>>
File: bear.webm (3 MB, 852x356) Image search: [Google]
bear.webm
3 MB, 852x356
Ask your much beloved programming literate anything.

>>52555859
kate
gedit
lime text (http://limetext.org/)
neovim
brackets (http://brackets.io/)
zed (http://zedapp.org/)
light table
atom
liclipse (http://www.liclipse.com/)
emacs/aquamacs/spacemacs (https://github.com/syl20bnr/spacemacs)

>>52556670
not him but i wrote a script to take screenshot of the linux frame buffer

http://neetco.de/CodeArtisan/FBSnap
>>
Ask your beloved programming illiterate anything
>>
>>52556695
Why not? It feels pretty comfy.

The only thing I hate is that CTRL+X isn't cut, but I suppose that is easy fix.
>>
>>52556695
I'm either in IDEA or vi, mostly vi. I stopped using sublime once they went proprietary.
>>
>>52556670
I have it running in a VM, but I don't actually use it for programming.
>>52556695
I like using nano for quick edits like config files and whatnot. Anything more involved I usually go to Emacs
>>
File: GentooSF.png (9 KB, 720x400) Image search: [Google]
GentooSF.png
9 KB, 720x400
>>52556754
Forgot pic
>>
>>52556723
I don't think bears do that
>>
I have a class that's partially in C this semester, so I wrote an emulator for the educational processor architecture we're going to write ASM for in order to refresh my memory of the language.

https://github.com/AnthonySuper/lc3-simulator
>>
>>52556844
>539 contributions in one year

fuck that's pretty good m8. What year are you in university?
>>
File: 4966441.jpg (11 KB, 312x312) Image search: [Google]
4966441.jpg
11 KB, 312x312
>>52556844
Looks cool Anthony
>>
>>52556844
>including c files

y u do dis
>>
>tfw no qt haskell gf
>>
>>52556723
Good film tbqh.
>>
>>52556989
They are too pure for this world.
>>
File: Practical_Language_Comparison.jpg (2 MB, 2100x1400) Image search: [Google]
Practical_Language_Comparison.jpg
2 MB, 2100x1400
>>
>>52556885
Freshman. I'm in first-semester sophomore level CS classes, though.

A lot of the stuff I've done in class has, so far, been pretty easy, which is a bit disappointing. Guess that's what I get for doing a shitload of programming work on my own before college. Hopefully things get older soon.


By the way, that number doesn't include all the work I've done on my website, since that's in a private repo. Here's the real number.
>>52556902
The code or the profile picture?

Because, in all honesty, that's probably the funniest picture of me ever taken.

>>52556940
Honestly? Laziness. I didn't want to write Make rules for tests.

I don't think I get much out of incremental builds of tests anyway.
>>
File: uvnPZhm.png (266 KB, 1116x751) Image search: [Google]
uvnPZhm.png
266 KB, 1116x751
can /dpt/ program "Does it have legs?"
>>
Editors? Spacemacs is the future everyone
>>
File: image.png (832 KB, 1280x720) Image search: [Google]
image.png
832 KB, 1280x720
Are lines of code usually directly proportional to the resulting instruction count?
>>
>>52557076
same here except a level up. The class is ridiculously easy and all I have to do is go to the tests. One less 4 credit class I have to worry about I guess.
>>
>>52557167
I'm still going to the classes, mostly to try and get to know the instructor/people in the class a bit better.

Both of my instructors in CS this semester seem super cool.
>>
>>52557085
Probably. I was trying to write a learning Tic-Tac-Toe game a few years ago, but I got bored.
>>
What gui framework in c++ feels the most familiar coming from a Swing background?
>>
>>52557189
>printf("the only winning move is not to play\n");

good choice
>>
>>52557240
http://www.cplusplus.com/forum/lounge/140601/

Also, swing is a horrible GUI framework.
>>
>>52557240
None of them. Swing is garbage.
Swing looks nothing like contemporary GUI frameworks, and message passing between the GUI and the underlying data is completely different.
>>
File: anime thumbs up.jpg (24 KB, 301x267) Image search: [Google]
anime thumbs up.jpg
24 KB, 301x267
>>52556844
Pretty nice. Your code looks good. Pretty far ahead of where I was freshman year.
>>
>>52557189

I actually had to do a learning tic tac toe game in one of my undergraduate classes. The tic tac toe was played by a robot controlled by an NXT brick. It moved a marker around and scanned a physical board on paper with a light sensor. It had to play randomly for the first 9 rounds, and then start playing all further games only with the training data. Given that mine went for the center as the first move on its 10th game, followed by going for corners, I'd say it did a good job.
>>
>>52556633
since you decided it was necessary to reveal your gender, I'm a girl and can program exclusively from the command line
>>
Question: If I wanted to do audio FFT analysis with a raspberry pi, would all I need is an ADC to convert the analog signal into a digital one then let the GPIO pins do the rest of the work?
>>
File: 1389974919976.png (5 KB, 160x166) Image search: [Google]
1389974919976.png
5 KB, 160x166
>>52553939
    public class Config
{
public event Action ValueChanged;

bool value;
public bool Value
{
get { return value; }
set
{
if (_.Update(ref this.value, value))
ValueChanged?.Invoke();
}
}
}

public static class _
{
public static bool Update<T>(ref T value, T newValue)
{
if (value.Equals(newValue)) return false;
value = newValue;
return true;
}
}
>>
>>52557591
There is probably an ADC on the board, but it's been a while since I've looked into it. What do you mean by 'let the GPIO pins do the rest"?
>>
>>52553803
>C++
>not using sfml
>>
>>52557629
I'm thinking of doing realtime fft analysis so it'd go

audio interface line out->ADC->GPIO->program

The audio has to be coming from an external source, hence the need for an external adc. I'm just making sure I don't need anything else in between.
>>
I want to learn python (please no h8) and I have a VERY VERY BASIC programming foundation. What would be a decent free IDE? Free as in free beer, I don't mind free as in freedom either though. Should I ever bother with an IDE? What's a good text editor if not?
>>
>>52557683
Note that I'm using xubuntu. So I'd need it to be compatible with debian/ubuntu based linux distros.
>>
>>52557683
with python a software ide will really only slow you down. I recommend trying this out as it has code completion and the works without the bloatiness of desktop ides. http://pythonfiddle.com/
>>
>>52557696
I'm really not a fan of cloud services. Anything that I can download and use without an internet connection?
>>
>>52553939
>>52557604
Oh sorry, didn't see your real question.
    public class Config
{
public event Action ValueChanged;

bool value;
public bool Value
{
get { return value; }
set
{
if (_.Update(ref this.value, value))
ValueChanged?.Invoke();
}
}

public static implicit operator bool(Config con)
=> con.Value;
}

public static class Foo
{
static Foo()
{
var con = new Config();
if (con) // do something
}
}

public static class _
{
public static bool Update<T>(ref T value, T newValue)
{
if (value.Equals(newValue)) return false;
value = newValue;
return true;
}
}
>>
>>52557701
Also I've heard good things about Sublime Text 2. Anyone have some experience with it? Would it work fine for learning python and still be useful in the future? (IE more complex stuff)
>>
>>52557729
it's good for just text highlighting but not code completion if that's what you're looking for. For beginners I would recommend this feature. Try this http://komodoide.com/komodo-edit/
>>
>>52557745
Shouldn't it be the opposite? Having the program complete the code for you wouldn't it make your learning slower? Once you have it ingrained then you can let it take care of it for you?
>>
>>52557750
So by that logic, as a beginner it's faster to go look up every detail about the language every time you want to write something?
>>
>>52557750
I would consider myself an intermediate programmer and I switch between so many languages at work, things like function names never truly get ingrained. It's easier to have the IDE tell me if it's insert, append, push, +, etc. since each language does it differently.
>>
>>52557750
I wouldn't say so. Code completion is not very intrusive, making you hit tab to complete a word and it doesn't just template out lines of code for you, you have to give it input for it to respond. It can allow you to explore the language more in depth while giving you a good sense of how the language should be structured.
>>
>>52557677
How are you going to interface the adc -> gpio? Depending on the chip it might be non-trivial to bit bash it through.. That's why I suggested looking into a peripheral ADC built into the SoC, but I'm not sure it actually exists.
>>
>>52557770
That's what I would tend to believe. Yes. Sorry if I'm being retarded here. Bear with me.
>>52557774
>>52557789
Alright then so the conclusion is that I should look for a text editor with code completion for python?
Would this be my best bet? http://komodoide.com/komodo-edit/
>>
>>52557683
What kind of functionality would you expect from an IDE? Python is dynamically-typed and late-bound, so most of the code-browsing features you'd get in C/C++ aren't an option.

The standard Python distribution includes Idle, which includes a text editor and interactive debugger, but it's fairly primitive.
>>
>>52557128
Depends on your definition of "line of code".
Depends on your definition of "instruction".
>>
>>52557836
>What kind of functionality would you expect from an IDE?
I have no clue.
>>
>>52557796
Try it and see if you like it. That's the best way you can tell.
>>
>>52557876
Alright, I'll do that. Thanks for the responses everyone.
>>
>>52557790
Ha, one look at the raspberry pi site and it gives me that exact answer. Not often that happens.

"The Pi does not include a hardware analog-to-digital converter, but an external ADC (such as the MCP3008) can be used, along with some bit banged SPI code in Python to read external analog devices."
>>
File: kid-flying-robots.png (153 KB, 475x474) Image search: [Google]
kid-flying-robots.png
153 KB, 475x474
>>52557914
There you go :) In my experience the spi device is easy to use. it just shows up as a file in /dev/spi. Have fun, sounds like a good project.
>>
>>52557914
The rev.2 boards have I2S, which might be more appropriate (SPI is probably easier to find information for, though).
>>
>>52557944
Thank you! I'll make sure to post it here once I'm done.
>>
>>52555531
>>52555658

Anon, you claim than the existence of bugs in operating systems is due to the choice of C. Name one language suitable for operating system development which would not have the same faults as C. Remember: Because one of the major roles of an operating system is to manage memory for all applications, no language which uses any form of garbage collection, or makes any assumption about how memory is laid out can be usable. It is also mandatory that any language used in kernel development be able to convert an integer into a raw pointer and deference it for DMA I/O operations.

Let's see what our viable non-C languages are:

C++ : So we're basically just using C with some extra abstraction. Bugs due to, say, buffer overflows are still going to occur.

Rust : Literally every function is going to be "unsafe". We might as well be writing C with different syntax.

Ada : Possibly viable. It's still possible to get the same bugs as in C if you're stupid, however.

D : See C++... except you're going to want to kill yourself because this language was designed to be used with a garbage collector.

Forth : If you want to gouge your eyeballs out.
>>
Why haven't you got a job, /dpt/?
>>
>>52558037
because welfare pays enough for me to live comfortably
>>
does anyone have a book or something for transitioning from outdated c++ to c++14?
>>
>>52558066
Why haven't you made a website or program that generates you millions a year?
>>
>>52557971
>Ada: Possibly viable
It's absolutely viable and commonly used in RTOS development.

http://www.ghs.com/AerospaceDefense.html
>>
>>52558081
I don't know how ;_;
>>
>>52558076
No.
Watch CppCon keynote videos. Years 2014 and 2015 are what you want.
>>
>>52557971
ada is shit, definitely the most annoying programming language.
>>
What resources do you guys use to make sure you're keeping up to date with progress in your fields? I'm in my final year of Uni right now and I'm worried about stagnating once I hit the workforce.

Is it mainly just about working on side projects?
>>
>>52557971
Your comments about the "OS" only apply to the kernel, and that doesn't actually have to include things such as the network stack, or any device drivers beyond those for the CPU/MMU/DMA (although obviously you need to avoid things like swapping out the SATA driver for the device hosting the swap file ...).
>>
>>52557971
>Rust : Literally every function is going to be "unsafe". We might as well be writing C with different syntax.
unsafe or not you still have abstraction techniques that are not possible with c.
>>
> that glorious feeling when you write a script that saves you at least a week of manual work for the first time

How did I ever live without doing this shit
>>
>>52558145
reddit
>>
>>52558369
>2008
>Why haven't you learnt Groovy? It's the next big thing
>2009
>Why haven't you learnt Haskell? It's the next big thing
>2010
>Why haven't you learnt Scala? It's the next big thing
>2011
>Why haven't you learnt Clojure? It's the next big thing
>2012
>Why haven't you learnt Scala? It's the next big thing
>Reddit

Repeat infinitum
>>
>>52557971
>Rust : Literally every function is going to be "unsafe". We might as well be writing C with different syntax.
I think you should look up Redox. It only has 108 unsafe blocks (which are mostly small) in 46KLOC of rust code.
>>
Has anyone here worked with Retrofit?
How do you guys pass an API Key to every request? Do you use interceptors?
>>
Would anyone care to try out my project? It's the first one I've done for fun on my own, and my first real attempt at using C++, and Qt.
https://github.com/rzumer/Webbum/

It's an interface to encode video to WebM with ffmpeg (VP8 or VP9). The default settings are pretty slow so make sure that you only encode a few seconds to a few minutes at a time if you do try it (trim function).

I have had issues trying to run it on one computer due to dynamic linking, and I haven't thoroughly tested all the options in the program, so just knowing what issues there are would help a lot. I've been using it myself for 4chins, but mostly with default settings.
>>
>>52559454
>no screenshot

nah
>>
A website to index ipfs hashes from a webpage, hopefully it will lead search engines crawlers to index more ipfs content.

http://ipfscraper.heliohost.org/
>>
Is there a point in using mono anymore?
>>
>>52557128
Depends how consistent you are.
If you keep switching between very long one liners, and then more verbose broken-out blocks then it's hard to find a constant.
But if it's relatively consistent, number of instructions ∝ LOC
>>
char* variable
or
char *variable

The first one can read as;
variable is of type 'char pointer'
The second one can read as;
variable is a pointer that points to type 'char'

In a type based language like C, wouldn't the first one make more sense?
>>
>>52559599
Always the second one.

char* foo, bar;


What are the types of foo and bar?
>>
>>52559622
well it would be of type char*, no?
>>
>>52559637
In that example foo is a char pointer and bar is a char.

char *foo, *bar;


If they were both pointers it would look like this.
>>
>>52559645
huh, they are different types.

char* foo, bar;
printf("%d\n%d\n", sizeof(foo), sizeof(bar));

this spits out different sizes
today i've learned, thanks
>>
>>52559552
Windows XP support.
>>
>>52559599
Well I'd read the first as: variable is a char pointer
And I'd read the second one as: dereferenced(*) variable is a char.

Using the first makes you think in terms of the pointers, whereas the second makes you think in terms of the actual data.

There is no specific "char pointer" really. Also, consider the implications of reading it as "declaring a pointer".
If you are only declaring a pointer for a string, what about memory allocation for the string itself?
>>
>tfw favorite language has the status of a meme in the local programming community
I really enjoy using it, but if I told an employer it's my main language, he'd probably roll his eyes because said language was chosen for high school computer class and shitty university programs.

I'll probably have to fill my portfolio with stuff written in another language just for the sake of employability.
>>
File: youcantstopliteracy.webm (3 MB, 640x360) Image search: [Google]
youcantstopliteracy.webm
3 MB, 640x360
>>52559599
char* as a whole is not a type but a type and a declarator.

char * foo
does mean that foo is declared as a pointer (*foo) and its type is char (so it's a pointer to char), not that the type of foo is char*

for example, with the const qualifier

char const * foo; // pointer to constant char
char * const foo; // constant pointer to char


which can be viewed as
[char const] [*] [foo]
[char] [* const] [foo]


* is not part of the type.

another reason to favor
char *foo
is that the type of the expression *foo is char: it's a common case in C where the declaration always (excepting a few cases) mimic how the variable might appears in an expression (that's the reason for the awkward syntax for a function returning an array pointer)
>>
File: xdress.png (1 MB, 1702x2471) Image search: [Google]
xdress.png
1 MB, 1702x2471
>>52553087
I implemented neural network backpropagation yesterday. RPROP really is way faster than using the gradients directly.

Going to start using autodiff for more complicated networks. I'm thinking of going with Theano.
Thread replies: 255
Thread images: 41

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.