[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: 40
File: 1442354021459.jpg (96 KB, 554x807) Image search: [Google]
1442354021459.jpg
96 KB, 554x807
Previous thread: >>53926984

What are you working on, /g/?
>>
First for C#
>>
>>53932281
centenbak
>>
>>53932232
>>53932246
>>53932256
>>53932272
>>53932317
truly cancerous

this is the real thread
>>
delete this and kill yourself
>>
>>53932446
>Underscored_nigger !!GoPSNpCAIcB
literally who
>>
hey /dpt/ is http://www.learncpp.com/ the best place to learn c++ for a beginner?
>>
Index numbering in programming should start at the number one
>>
>>53932471
yes no, maybe, i don't know, can you repeat the question

YOU'RE NOT THE BOSS OF ME NOW

YOU'RE NOT THE BOSS OF ME NOW AND YOU'RE NOT SO BIG
>>
>>53932487
Your worse than a tripfag
>>
>>53932487
rancid beet
>>
>>53932487

Use Ada, then.
>>
>>53932496
>>53932501
Samefag
>>
>>53932489
nice meme kid
>>
>>53932511
He osgtp wanna be my friend?
>>
>>53932513
THERE'S SWEAT ON MY SWEATER

YOUR MOM'S SWEATY
>>
File: 2d_Nazi_001.png (518 KB, 600x700) Image search: [Google]
2d_Nazi_001.png
518 KB, 600x700
>>53932471
Seems alright, I'd 100% recommend you supplement everything though.

One of the most difficult parts for me when I'm learning Java is having a lack implementation of the concepts I learn.

I recommend you use websites like hackerrank or codeeval that give you challenges to practice with. There are many more of these types of websites by the way. Before you do those websites though make sure you understand at least the basics.
>>
File: msf.gif (123 KB, 500x658) Image search: [Google]
msf.gif
123 KB, 500x658
Eclipse or Netbeans for java programming?
>>
>>53932532
Ok, thanks
>>
>>53932545
Netbeans
>>
>>53932545
eclipse
>>
>>53932545
Program C# instead.
>>
>>53932568
>>53932579
Samefag
>>
>>53932582
troll harder
>>
>>53932582
this
>>
>>53932582
>>53932600
samefag
>>
File: comfyaf.jpg (753 KB, 3000x2000) Image search: [Google]
comfyaf.jpg
753 KB, 3000x2000
>>53932582
I wish mate, I wish, but in actual circumstances I do not have choice
>>
>>53932614
He fell for the Java meme
>>
>>53932526

Not really
>>
>>53932639
:^(
>>
>>53932639
B T F O
T
F
O
>>
>>53932545
idea
>>
>>53932545
intellij
>>
>>53932675
Sublime
>>
>>53932669
>>53932675
shill harder
>>
People at my Software developing firm are all now arguing over which should be taught first Objects or functional programming first
>>
>>53932710

Both at the same time.
>>
>>53932545
Netbenas

Eclipse doesn't even have decent Maven support
>>
>>53932689
(You)
>>
>>53932710
your firm is a joke if people don't already know those things or can't learn them on their own
>>
>>53932726
SUPERIOR NETBEANS IDE
>>
>>53932710
Truth: Imperative
JMP Truth
>>
File: german tanks.jpg (75 KB, 736x490) Image search: [Google]
german tanks.jpg
75 KB, 736x490
I have an impression that people in these threads make advices to reduce concurrency among their specialization. Like, if they are C#/python developers, they say that the X language is shit and everybody using it are losers and offer to learn something irrelevant like Haskell or Basic.
>>
>>53933068
I like c++
Every other language is a meme (unneccessary layer of abstraction)
>>
File: 1459431620766.png (865 KB, 1093x603) Image search: [Google]
1459431620766.png
865 KB, 1093x603
Have you ever felt dumber than me right now, when I had been staring at the looping constructs page of my favourite language, looking for a plain while loop with just a condition, as I realised that this was a /fpg/ language where conditional tail recursion was what I was looking for? protip: no, you haven't
>>
>>53932281
Working on my first dx12 project, I'm following a book so it's not to exciting
>>
File: feet.webm (3 MB, 800x450) Image search: [Google]
feet.webm
3 MB, 800x450
Ask your much beloved programming literate anything (IAMA)

>>53932710
Functional programming.

>>53932545
eclim
>>
>>53932545
Eclipse

It just werks
>>
>>53933108

>use c

problem solved!!
>>
Quick! I need you to do insertion sort in whatever your favourite language is, I want to check something.
>>
>>53933187
It's true that C technically does have call/cc...
>>
>>53933169
kys
>>
>>53933169
Teach me to program
>>
Too many new tripfags here recently
They're all fuckin dumb
>>
I just learn Haskell and now I feel indestructible.
>>
>>53933093
You just don't know how to program then.
>>
>>53933270
Agreed. OSGTP and Ruby were already too many.
>>
File: sad.jpg (411 KB, 3264x1952) Image search: [Google]
sad.jpg
411 KB, 3264x1952
>>53933248
:: Structure and Interpretation of Computer Programs
http://sarabander.github.io/sicp/
http://paste.lisp.org/display/151208/raw

:: How to Design Programs
http://htdp.org/
https://www.edx.org/xseries/systematic-program-design-0

:: Concepts, Techniques, and Models of Computer Programming
not free

:: Composing Programs
http://composingprograms.com/

:: CS for All
http://www.cs.hmc.edu/csforall/
https://www.edx.org/course/cs-all-introduction-computer-science-harveymuddx-cs005x

:: Program Arcade Games With Python And Pygame
http://programarcadegames.com/

>>53933221
please don't bully
>>
>>53933314
This
Also the new ones are stupid as fuck
>>
>>53933093
>unneccessary layer of abstraction
You better go and program in asm then.

Unless you think your compiler creates better code than you could, which it certainly would.
>>
>>53932545
Eclipse.
>>
>>53933068
we say e.g. python is shit because we genuinely think they're shit
>>
>>53933463
Not true a lot of people here know Java is good
>>
>>53933524
true. the people who say java is bad are just memeing
>>
>>53933562
Everytime I post Java stuff I get memed into orbit
>>
>>53933607
POO
IN
LOO
>>
>>53933463
>>53933524
>>53933562
Languages are not shit, people who say they are shit are accustomed to other languages and other paradigms than used in that specific language.

For example, I would say that I PERSONALLY DISLIKE java, python, whatever, because I am accustomed to using C# and especially Visual Studio as IDE at work and in private.
I like the broad array of features that Visual Studio offers and I am so used to it that I don't really want to use any other IDE.
I have tried others and in MY OPINION they don't live up to what I am used to with Visual Studio (and also language features in C#)

Usually lurking here, but get your shit straight /dpt/, I'm getting sick of it.
>>
I lack motivation to do anything.
>>
File: le hands.png (24 KB, 386x306) Image search: [Google]
le hands.png
24 KB, 386x306
>>53933654
Here put on this dress it will help
>>
>>53933093
Use Rust in that case.
> abstracted
> not unneccessary
>>
I'm developing a web application in Haskell with yesod.
>>
>>53933750
It's like I'm on HackerNews
>>
File: 1453397193660.jpg (23 KB, 337x372) Image search: [Google]
1453397193660.jpg
23 KB, 337x372
in Java 8 how do i login in to a web page to extract info while logged in? i already have all the Post parameters i did it on c++ with curl but now i want to do it on java please SEND HELP

>inb4 he fell for the c++ and did it on curl the absolute madman XD
>>
>>53933770
Do they talk a lot about yesod there?
>>
>>53933778
Read up on Sessions in Java and how they work
>>
>>53933786
It's a young web framework with a Jewish name used by 10 people for a fp language.
It's a pretty safe guess that they do.
>>
>>53933811
I don't go to hackernews so I don't really know what they talk about.
Yesod just seemed like it would work well for what I'm working with.
It was either that or JavaScript.
>>
>>53932281
whats a good textbook for javascript for an someone who knows another language. Preferably has some web dev stuff in it.
>>
File: illuminated stallman.jpg (46 KB, 620x413) Image search: [Google]
illuminated stallman.jpg
46 KB, 620x413
R8 My racket gnome sort!
(define (gnome-sort! v [less-than? <])
(define len (vector-length v))
(unless (zero? len)
(let step-forward ([i 0])
(define j (add1 i))
(unless (= len j)
(define x (vector-ref v i))
(define y (vector-ref v j))
(cond
[(less-than? y x)
(vector-set*! v j x i y)
(let step-backward ([i i])
((let/ec tailpos
(unless (zero? i)
(define j (sub1 i))
(define x (vector-ref v i))
(define y (vector-ref v j))
(when (less-than? x y)
(vector-set*! v j x i y)
(tailpos (thunk (step-backward j)))))
(thunk (step-forward i)))))]
[else (step-forward j)])))))


Non non-nested loop, just plain, elegant, divine tail recursion
>>
>>53933750
How's that going? I've been meming to check Yesod out, but haven't gotten around to it.
>>
Writing to text files in python 3
How come this will print out the updated code


def display():
file = open(r"test_two.txt","r")
print(file.read())

display()

file = open(r"test_two.txt","a")
user_in = input("Enter the words: ")
user_in_fin = user_in + "\n"
file.write(user_in_fin)

file = open(r"test_two.txt","r")
print(file.read())

file.close()


But this won't?


def display():
file = open(r"test_two.txt","r")
print(file.read())

display()

file = open(r"test_two.txt","a")
user_in = input("Enter the words: ")
user_in_fin = user_in + "\n"
file.write(user_in_fin)

display()
file.close()
>>
>>53933093
so C and ASM are unnecessary abstraction?
>>
>>53933524
>>53933562
>>53933607
java can't even produce executables for your processor
get that trash out of here
>>
>>53933980
It has a lot of nice tools and it's really easy to write controllers.
Although I feel it might be too big of a framework but it's definitely really mature.
>>
>>53934142
>Excelsior JET
>ART
>RoboVM
>>
http://pastebin.com/rTAeGwx6

rate my linked list
>>
I did it again. I traveled outside of /dpt/. This is the first thing I saw. Pls kill me.

Another guy said assembly was the ugliest programming language. :'(
>>
>>53933992
I'm guessing it's because of function scope? You need to close the file inside the function. Move that last file.close() to the line below file.write(user_in_fin) in your second code and it should be good.

You could always use a with block, since it'll close the file for you.
>>
Does anyone knows how to use the webcam capture in opencv?The documentation on official site seems to be outdated.
>>
>>53934271
get with the times grandpa/sperg
>>
>>53934311
This is not a programming subreddit,faggot.This is a reddit c vs java circle jerk
>>
>>53934254
Good job Patel
>>
how to do arithmetic on numbers consist of 50 digit in C ?
>>
>>53934668
POO IN LOO
O
O

I
N

L
O
O
>>
>>53933646
So you disagree with the notion that one programming language is better than another? That doesn't make sense.
>>
>>53932545
kekekekekekekekek this guy must be trollin
>>
>>53934668
http://lmgtfy.com/?q=stackoverflow+c+bigint+arithmetic
>>
>>53932633
He has a job
>>
is it bad practice to have half your C code as macro functions?

its not golf-tier though
>>
>>53934708
I'm looking for something quick and dirty
>>
Are stupid programming questions here or in /sqt/?
My problem is say I'm building an image database and the images can have an arbitrary number of tags.
The pattern I usually see for this is to have a table with all the image-related sutff, one table with the tag-related stuff and a third table with image_id and tag_id columns, require each (image_id, tag_id) pair to be unique and throw a new row there each time an image gets a new tag.
That doesn't look right to me. If I were doing work as usual in a (OO) imperative language I'd just put a tags array(or whatever other container) in my class and put the relevant tag_ids there instead of using more space to store (image_id, tag_id) pairs. Is there no way to do it this way in a relational database? If yes, then why does the first method seem to be so more prevalent?
And yes, I'm a complete dummy on databases, only know what I picked up when I was toying with kusaba.
>>
File: no_shadows.jpg (14 KB, 640x531) Image search: [Google]
no_shadows.jpg
14 KB, 640x531
I'm working on some shadow mapping code for my webgl project. As you can see, it isn't working yet.
>>
>>53934752
save all tags used in a string, separated by commas and have some image ID in there too and just grep for the tags, and display corresponding image ID's :^)
>>
>>53934311
I've seen this rrt guy for some time.What does rrt means?
>>
>>53934750
require('GMP')
>>
>>53934831
Its my full name Rameshwaran Rajapati Tuqlaq
>>
>>53934739
Generally, it is bad practice because it makes debugging hard from the lack of readability. Also, they're not practical to write at all when you write huge chunks of code with macros.

However, it is mainly the only way to do generic programming on C. For example, Qemu is written in C and is full of macros so as to make the porting of new architectures to Qemu less of a hassle.
>>
>>53934826
>>53934842
>>53934859
>>
I'm trying to write an install script for my dotfiles repo.
I've never really done much shell scripting before :^(
How do I cp dir_where_script_is/.Xresources ~/.Xresources in shell script?
Every time it just says cannot stat.
>>
File: cs.jpg (28 KB, 276x183) Image search: [Google]
cs.jpg
28 KB, 276x183
Hi /dpt/.
I know a little bit of programming, but I know jack shit about how a computer actually works. I wanna broaden >muh knowledges.

Please suggest me a good introductory CS book.

Thanks friends.
>>
>>53934932
gzip/tar it
>>
>>53933189
(define (insertion-sort! v [less-than? <])
(define len (vector-length v))
(for ([i (in-range 1 len)])
(define x (vector-ref v i))
(define j
(let search ([lo 0] [hi i])
(cond
[(= hi lo) lo]
[else
(define mid (quotient (+ lo hi) 2))
(define piv (vector-ref v mid))
(if (less-than? x piv)
(search lo mid)
(search (add1 mid) hi))])))
(vector-copy! v (add1 j) v j i)
(vector-set! v j x)))
>>
>>53935012
>he bisected
Good anon, good.
>>
File: lad.png (744 KB, 3360x2100) Image search: [Google]
lad.png
744 KB, 3360x2100
Post functions you're proud of /g/.
>>
File: nw.png (13 KB, 896x175) Image search: [Google]
nw.png
13 KB, 896x175
Any Java proggers here who have an idea what network/sec tools i could add to my pic related program??

I need a 15/20 to pass on this shit subject. So far everything is working but I ran out of inspiration....


thx
>>
>>53935195
kanker generator
>>
>>53935202
ff serieus g ik moet slagen voor dit kkproject
>>
>>53935216
mocro ai

wollah!
>>
>>53935233
Koerd g geen mocro

niet wollah maar:

>Vallah!
>>
>>53934218
Havent set up all segments and not canonicalized cs:ip
>>
>>53935244
alle koerden terug naar de woestijjn
>>
>>53935275
Er is geen woestijngebied waar Koerden zitten g.

en geef me wat inspiratie voor dit project g.

>of ben je jaloers dat deze Koerd binnen 5 maanden afgestudeerd is, al in bezit is van een CCNP-cert en ook al een stage binnen heeft gehaald bij een zeer hoog geprezen network-consultancy bedrijf?
>>
>>53935195
SYN flood
>>
>>53935309
Thx for the tip man but my retard tier teaches says I can not use any programs that will cause harm to servers/Webpages/... . Not even if it's for educational purposes :(
>>
>>53935363
bruteforce ssh/telnet/whatever?
>>
File: UB4w6Z2.jpg (791 KB, 2160x3840) Image search: [Google]
UB4w6Z2.jpg
791 KB, 2160x3840
Donating this image for future /dpt/'s
>>
>>53935408
>ssh/telnet


Interesting! I didn't think about this. Would you think it's complex in Java to connect to a Cisco router for example via SSH and configure the device in a Java prompt window?

Thanks for the tip!
>>
>>53934946
What don't you understand?
>>
>>53935435
https://github.com/hierynomus/sshj
>>
>>53934668
gnu mp
>>
>>53935466
tyvm brother I will study this and implement it in my project
>>
>>53935451
I literally don't know what I don't know. I supposed I'd like a bottom-floor intro to how a computer works (i.e., CPU, RAM, motherboard). A book they'd use in any CS intro class for undergrads would be perfect.
>>
>>53935542
Try Art of Assembly. It's old and well used and available for free on the web. Downside is that some concepts have become obsolete since then and new ones have emerged.
>>
File: 1458679968630.jpg (293 KB, 389x326) Image search: [Google]
1458679968630.jpg
293 KB, 389x326
>>53935142
Wrote this when I was 14
>mfw looking at it now

void printHelp(void)
{
printf("Usage:\tredchan [options]\n\n"
"Options:\n"
"%-28s%s\n%-28s%s\n%-28s%s\n%-28s%s\n", //What the fuck?
"-h or --host=<host>",
"specify host",
"-p or --port=<port>",
"specify port (6667 is default)",
"-c or --channel=<channel>",
"channel to join after connecting",
"--help",
"display this help");
return;
}
>>
>>53935305
heb je een eigen land?
>>
>>53935628
Geboren en getogen in België & spreek het Vlaams + Frans beter dan de gemiddelde white boy.

Dus ja.

Oh ja! Je bent ook 'gecuckt'!

Ik neuk enkel wit vlees & mijn vriendin heet 'Anne'. Niet boos worden he!
>>
>>53935142
More of a class since it uses two other methods I created but here it is

public LinkedList<Integer> palindromeGenerator(int largestPalindrome){

LinkedList<Integer> listOfPalindromes = new LinkedList<>();

int currentPalindrome = 10;
int limit = 1;
int currentStartingPosition1 = 1;

while(currentPalindrome < largestPalindrome){

limit *= 10;

for(int i = currentStartingPosition1; i < limit && i > 1; i++){
listOfPalindromes.add(mirrorThroughCenter(i));

if(listOfPalindromes.getLast() > largestPalindrome){
listOfPalindromes.removeLast();
return listOfPalindromes;
}
}

for(int i = currentStartingPosition1; i < limit; i++){
listOfPalindromes.add(mirrorThroughMiddle(i));

if(listOfPalindromes.getLast() > largestPalindrome){
listOfPalindromes.removeLast();
return listOfPalindromes;
}
}

currentStartingPosition1 *= 10;
}

return listOfPalindromes;
}


Creates all palindromes up to whatever was input as a parameter.
>>
File: howto.jpg (2 MB, 1000x1330) Image search: [Google]
howto.jpg
2 MB, 1000x1330
>>53935412
that's pleb shit
>>
Xcode > microshill visual shitio >> Emacs >>>>>>>> codeblacks >>>>>>>>>>>>> Vim
>>
File: animu_grill.jpg (141 KB, 1366x2048) Image search: [Google]
animu_grill.jpg
141 KB, 1366x2048
>>53935623
wat u even doin nigga
> tfw you're 15 now
>>
>>53935791
>bites nails

eww
>>
So, as I understand it, you init git in some directory on your PC, you add some stuff to it and what not. and then you clone it somewhere else on your PC and make that somewhere else the new working directory. You change stuff, add it and commit it. And here's what I don't understand. When I want to push the changes back to the original folder, it prints out a big ass error, something how I can't push to a non bare repository. I thought that the first one acted like a database, or an archive of sorts, and the second one like a working directory that preiodically updates the original one.

Now I don't know crap about git, and it's always either babby's first programming lesson, or some 900 page manual for it, nothing in between, or worse yet, some manual that assumes I worked with other VCS systems. I tried following this thing, but it already doesn't work at step 5 where I need to push the changes back to the original git folder.
>>
>>53935930
you need to set up the central git repository (the one you are cloning) as a bare repository.
>>
>>53935930
>>53935958
so you'd really have three repo's the original repository, the bare repository, and the cloned repository
>>
>>53935958
You mean just init a folder and then clone it, without adding anything inside? What about future pushes?
>>
>>53935930
>it's always either babby's first programming lesson, or some 900 page manual for it, nothing in between
https://git-scm.com/book/en/v2
>>
>>53934271
Well they are right.
>>
>>53935994
Oh crap. I thought that thing was only for sale. I'll get it right now. sorry to be a bother.
>>
>>53935930
>make that somewhere else the new working directory.
Incorrect. What happens is that the somewhere else becomes an complete new entire repository, which for all we know might be over the network. It's not just a new working directory which is linked to the same repository.

This error protected you from changing the first repository's contents while there were changes in its working directory, otherwise this would have been a mess.

>>53935974
A bare repository is a repository with content, but without any working directory. Its purpose is to serve as an exchange point between non bare repositories on which people work and commit. Generally, like the other anon mentionned, you should only push to bare repositories.
>>
>>53934752
>Is there no way to do it this way in a relational database?
Not that I know of. The way it is usually done is like you said. RDBs don't really have an array type, and while you can have comma separated tags in a large string, that isn't that great either.

I am actually struggling with the same problem - working on a media organizer that allows tags and such. I think I may have made my job harder by making tags first-class objects, but it seems like it'd be more useful that way. I don't want to end up rolling my own DB, though - I am using SQLite because I'd rather have the database easily manipulated outside of the program.

In my case, an array type would sort of work, but what I was envisioning was a series of different containers and structures filled with references to the media, the tags, and other structures to allow one to quickly and easily jump from one piece of data to another without a bunch of searching, even if the user has thousands of files.

If my understanding is correct, it is that RDBs do not have a simple way of mapping many-to-many other than the way you specified. This is made even worse if there are more than one many-to-many mappings or sets of data - while working on this, I've found that the amount of mapping can exceed the amount of actual information, which says to me my solution isn't a good one.
>>
File: FuPanda.png (18 KB, 134x134) Image search: [Google]
FuPanda.png
18 KB, 134x134
>>53932281
OP did you even change the text accordingly?
>LEKKER
>WERK
>OP
>>
>>53935974
no use the --bare flag
see http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/
>>
>>53935721
I can't read moon runes that a book on assembly for the Z80?

That computer looks like it does not want to get pegged.

Post moar
>>
>>53935997
Assembly is beautiful

You can't even compare C and Java as languages
>>
>>53935195
Speedtest
>>
>>53936345
Yes you can compare them, for instance C is useless where as Java is useful.
>>
>>53936373
>what are embedded systems
>>
>>53936196
Yes, literally "How to Mashingo"

But can't find a scan of it unfortunately
>>
>>53935765
VS is way better than Xcode. Kill yourself.
>>
>>53936383
https://docs.oracle.com/javase/8/embedded/develop-apps-platforms/overview.htm
>>
>>53936418
>Bloatware studio
Lel
>>
>>53936421
Yeah and all the embedded java systems are really shit anon
>>
Is there a way to create or edit android apps from a smartphone?

ive got a moto x and my laptop fried. I figured it would just be convenient to just use the smartphone. I might upgrade to a bigger screen soon.
>>
>>53936448
So are C embedded systems, so I'm not sure what's your point.
>>
Is "The C Programming Language (2nd edition)" still to go to C book?
Does much change in C99 and C11 that make it annoying to transfer to them?
>>
>>53936594
c primer plus
>>
>>53936045
Have you considered a document store DBMS? I remember there being a few disk-only ones too, like SQLite.
>>
>>53936594
C89 and C11 are extremely similar and style of coding is the same.
>>
>>53936458
MOOOOOODS!
MODS MODS MODS
>>
>>53936673
that's sfw
>>
>>53936673
hotpockets
>>
>>53934946
But How Do It Know?: The Basic Principles of Computers for Everyone
Book by J. Clark Scott
>>
>>53935623
>void
>return;
What the fuck are you doing?
>>
File: smug_sad_pepe.png (75 KB, 499x499) Image search: [Google]
smug_sad_pepe.png
75 KB, 499x499
Ok, so I've been playing around with linked lists, and I followed Alex Allain's tutorials one what are technically "singly linked lists."

I played around with it and I think what I have made here is a doubly linked list. Can anyone confirm?

I personally kind of like it because it's the first time I've made a thing that can dynamically allocate and free memory depending on the user needs.

However, I could probably use some style critique, and I also fear the possibility that his program is secretly leaking memory everywhere.

http://pastebin.com/cNysd2qc
>>
>>53936673
thats sfw.

still doesnt answer my question.
>>
>>53936757
yes you made a double linked list
>>
>>53936757
Check it with valgrind for leaks
>>
>>53936797
neat

could i make a triply linked list?
>>
for a potato like me golang is pretty weird to use.
like function in a function stuff, and last night i figured out that the structs could have their own methods, like "woooot the shits, now i gotta rewrite my crap".
>>
>>53936916
yes just make each node store the root tree pointer aside from the previous and next nodes
>>
>>53936916
Where would the third node link?
>>
>>53936421

Doesn't run on an Arduino Uno. C and C++ are both perfectly usable when restricted to only 2 KB of RAM and 32 KB of storage.
>>
File: 10000_hrs_in_ms_paint.png (5 KB, 300x300) Image search: [Google]
10000_hrs_in_ms_paint.png
5 KB, 300x300
>>53936946
>>53936942
i was thinking something like this
>>
>>53936979
There is actually a JVM that runs on an ATMega
>>
>>53932321
kanker veel muntjes
>>
>>53937007
If you dangle that down from N1 you might have a trinary tree.
>>
Learning Java (meme, etc.) as my first language and I'm using Think Java by Downey. I'm up to ch7 which is about loops. My question is, what can I start doing at this point to make my own tiny programs? Nothing special or even original, just things I can do to go through the motions to solidify what I've learned.

I will say that I've had trouble understanding some of Downey's explanations and the reasoning behind some of the exercises, so add that as a considering factor.
>>
>>53937106
http://www2.sunysuffolk.edu/tangy/cst112%5CText_book%2810th_ed%29.pdf

scrap that and read this

have fun
>>
>>53937106
start parsing anime torrent rss feeds and store them in a sqlite database.
>>
>>53937133
I saw you (or someone else) post this for another anon yesterday and grabbed it after looking through the first few pages, I might just ditch Downey's book after all. Thanks.

>>53937141
y-you too
>>
how math competent do you believe yourself to be, /dpt/?

do you know what the sum of:
1+2+3+4+5+......
is equal to?
>>
Is Scala a meme language?

Trying to decide whether to take a C# job or a Scala job.
>>
>>53936916
>>53937007
I think the correct term is a connected graph, and yes, you can make them. Just be aware that the behavior is a little more complicated when it comes to search/traverse/insertion/deletion.

https://en.wikipedia.org/wiki/Connectivity_%28graph_theory%29

As you can imagine, these sorts of things have quite a few applications. Creating maps and relations between data, route determination and other such to study/represent network topology, etc.

>I personally kind of like it because it's the first time I've made a thing that can dynamically allocate and free memory depending on the user needs.
Challenge: Make any given node able to link to any number of other nodes.
>>

// ==UserScript==
// @name 4chan post sort
// @namespace 4chanpostsort
// @description Sorts 4chan posts in a thread by number of replies to a post
// @include http://boards.4chan.org/*/*
// @include https://boards.4chan.org/*/*
// @version 0.0.1.20150629054247
// ==/UserScript==


if (!GM_registerMenuCommand)
alert('Please upgrade to the latest version of Greasemonkey.');
else
{
function toArray(obj) {
var array = [];
// iterate backwards ensuring that length is an UInt32
for (var i = obj.length >>> 0; i--;) {
array[i] = obj[i];
}
return array;
};

function compareChildrenCount (a,b) {
if (a.children.length < b.children.length) { return -1; }
if (a.children.length > b.children.length) { return 1; }
return 0;
};

function PS_sort()
{
var reps = document.getElementsByClassName("backlink");
reps = toArray(reps);
reps.sort(compareChildrenCount);
t=reps[0].parentNode.parentNode.parentNode.parentNode;
for(i=0,x=reps.length;i<x;i++) {
var e = reps[i].parentNode.parentNode.parentNode;
e = t.removeChild(e);
t.insertBefore(e, t.childNodes[0]);
};
};

GM_registerMenuCommand('4chan Sort Posts by Reply Count', PS_sort);
};




this stopped working on my tampermonkey script, idk why. happened only after the 4.0 tampermonkey update. someone help me out please, this script really helps me curate high posting volume boards.
>>
>>53937236
It's unbounded
>>
>>53937236
depends on if and how the sum ends
>>
Hey guys I'm looking into programming as a hobby but am having trouble finding good reasons to pick it up. What exactly can I do with programming, besides making bots?
>>
>>53937262
Check the logs for errors?
>>
>>53937312
Make and sell apps and games
>>
>>53937264
it's a divergent series, but has a convergent sum.

>>53937305
you just keep adding the integers all the way to infinity, as written.
>>
>>53937350
>>53937236

n(n+1)/2

Step it up, you have no business being a programmer if you don't know that
>>
>>53937333
I thought that was a meme though? I'm not an ideas person so I wouldn't know what to do if that were true
>>
>>53935142
>60-70 line function
>proud of it
>>
>>53936643
I think you might have pointed me in a good direction. I started reading it and came across graph databases, which are closer to what I was thinking of. The way I was looking at things roots from the idea of key => value, with the option to treat keys as values or values as keys in an efficient way.
>>
>>53937236
-(1/12)
>>
>>53935142
>not using english variable names
>>
>>53937400
Don't expect to make anything more than pocket money from selling apps. The market is very over-saturated.
>>
>>53937437
>not using esperanto variable names
>>
File: euler.jpg (54 KB, 460x597) Image search: [Google]
euler.jpg
54 KB, 460x597
>>53937432
this anon wins.

1+2+3+4+5+6+..... = -1/12

>>53937367
you, anon, need to step it up. euler proved this close to 300 years ago. why aren't you aware of 300 year old simple mathematical proofs?
>>
>>53937027

Yes, but it does not play well with small resources. As stated, it does not run on the Uno.

>>53937251

Take the Scala job so that some Scala hipster doesn't get a job.
>>
Why do people still use oop? It's trash, I don't get it
>>
>>53937350
>it's a divergent series, but has a convergent sum.
I don't get what you mean.
The sum 1+2+3... is already the Gauß series which diverges.
>>
>>53937568

Easy to maintain, extend, etc...
>>
>>53937594

>using the meme b
>>
File: 1390523997261.gif (484 KB, 500x270) Image search: [Google]
1390523997261.gif
484 KB, 500x270
I asked if I could learn programming if I knew jack shit about computers in yesterday's thread and got linked to book on Java. If you're still here, thanks anon, I'm studying as we speak.
Anyway. I hope it's okay for me to ask retarded questions every now and then. Here's the first one:
>The CPU usually has two components: a control unit and an
arithmetic/logic unit.
>In order to increase CPU processing
power, chip manufacturers are now producing CPUs that contain multiple cores
Does that mean every single core of a multicore CPU has its own control unit and logic unit?

I feel dumb but eh, at least I'm studying.
>>
>>53937621
It's an ss
>>
>>53937549
>As stated, it does not run on the Uno.
What?
The Uno uses an ATMEGA328P which has more than enough Flash and RAM to run NanoVM.
>>
File: 1457685582324.jpg (200 KB, 480x1080) Image search: [Google]
1457685582324.jpg
200 KB, 480x1080
>>53937653

heil hitler!
>>
File: 120312412.jpg (211 KB, 1920x1200) Image search: [Google]
120312412.jpg
211 KB, 1920x1200
here's another simple one /dpt/. this one's only 100 years old.

what is
sqrt( 1 + 2*sqrt(1 + 3* sqrt(1 +4*sqrt(1 + ....

equal to?

(give /g/ latex hiro moot; be better than whom you succeeded)
>>
>>53937632
>Does that mean every single core of a multicore CPU has its own control unit and logic unit?
Yeah, each core is a complete processor, just on the same chip
>>
>>53937738
7
>>
>>53937738
/g/ doesn't need latex, if anything /sci/ needs code tags
>>
Anyone ever have gvim complain about unmatched brackets when the brackets are, in fact, matched?
>>
>>53937796
the answer to these sorts of questions is rarely 7.

>>53937738
can you guys figure it out if I give you this:

sqrt(a*x + (n + a)^2 +
x*sqrt( a(x+n) + (n+a)^2 + (x+n)*sqrt(...
>>
>>53937662

The Uno has 2K of working RAM. 2048 bytes. That's it. No reasonable VM will run on that.
>>
>>53937909
Except NanoVM.
Look it up.
>>
what experience/knowledge should i have to read sicp?
>>
>>53937479
It was Ramanujan who proved this using what came to be known as, guess what, Ramanujan summation.

>>53937594
You don't get what he means because he's being lousy as fuck. The limit of the sequence of partial sums diverges(what we usually mean by the value of a infinite series), but there are other summation methods that can assign a finite number to that series, but they are in no way just:
>keep adding the integers all the way to infinity
>>
>>53937888
Is it 7, though?
>>
>>53937922

>Uses 8k code memory and 256 bytes of RAM
Wikipedia must be fucking with me.
>>
File: ramanujan.jpg (20 KB, 300x400) Image search: [Google]
ramanujan.jpg
20 KB, 300x400
>>53937992
no it's 3.

it's another Ramanujan equation. he was a poo in loo that made thousands of mathematical contributions while receiving no formal education and dying at 32.

just a couple reminders that none of us are genius's or chosen ones and only work will set our souls free.
>>
>>53938040
Fuck. I should have guessed 3, then you'd think I was smart (or managed to find the result with google).
>>
>>53932496
kek
>>
I want to learn a script language, what should i learn
>>
>>53938271
haskell
>>
>>53938271
R
>>
>>53938271
lua
>>
>>53938271
post again. 0-3 is ruby 4,5 and 7 are lua. 8 is perl, 9 is php.

6's or dubs and you're a snek.
>>
>>53937851
turns out i'm a fucking idiot. it was highlighting the braces but it was doing so because of an unmatched parenthesis in the intervening block
>>
>>53938317
What is a snek?
>>
>>53938338
Python
>>
>>53938271
Perl
>>
>>53938271
Rexx
>>
>>53938317
R
>>
>>53938483
I don't really consider R a scripting language. it's more of a terminal based statistical toolkit.
>>
>>53938284
>>53938311
>>53938312
>>53938317
>>53938364
>>53938467
Looks like nobody agrees on any of these honestly i don't really know much about scripting languages but which one is more relevant than the others? I want to learn something that will be a really useful skill
>>
>>53938710
python then
>>
>>53938710
Rexx is the way to go then.
ARexx is extra relevant
>>
>>53938710
>looking for consensus on a highly subjective matter
you rolled a 0, queue up the Ruby faggot.
>>
File: five_stars.png (5 KB, 435x391) Image search: [Google]
five_stars.png
5 KB, 435x391
hello /g/, as it turns out im kind of a fucking idiot. I'm taking my first programming class for the computer networking degree i'm enrolled in. It's a beginning Python class. this should give you some background into how little experience I have.

I was wondering if I could get some help with my homework. I have to make create the image I've attached using code from a previous example:
import turtle 

def drawStar(t):
for i in range(5):
t.forward(100)
t.left(216)

wn = turtle.Screen()
wn.bgcolor('lightgreen')

corrie = turtle.Turtle()
corrie.color('hotpink')
corrie.speed(6)

for i in range(5):
drawStar(corrie)
corrie.penup()
corrie.forward(350)
corrie.right(144)
corrie.pendown()

I'm just having issues making it all fit on the screen. The instructions say that you will need to move to the left before drawing your first star in order to fit everything in the window, this is the part that is giving me the most problems.
>>
>vim has noticeable slowdown on an i5 3570 when syntax highlighting perl6
Even vim can't deal with this shitty syntax.
>>
>>53938877
top kek

fucking meme languages, even your meme "non-bloated" "text editors" can't handle them
>>
>>53938832
just add
corrie.write("".join(chr(x) for x in (0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66)))

right after drawStar(corrie)
>>
what should I do with an arduino an some c++ programming /g/?
>>
>>53939044
>corrie.write("".join(chr(x) for x in (0x6b, 0x69, 0x6c, 0x6c, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66)))

but... :(
>>
Alright i'll give it a shot to snek what should i use to write my scripts/programs? Notepad? i'm on windows if it matters

>inb4 le windows maymay XDD
Thread replies: 255
Thread images: 40

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.