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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 322
Thread images: 25

File: rms.png (1MB, 1190x1080px) Image search: [Google]
rms.png
1MB, 1190x1080px
What are you working on, /g/?

Previous Thread: >>58928112
>>
File: dijkstra.png (44KB, 643x220px) Image search: [Google]
dijkstra.png
44KB, 643x220px
>>
>>58932641
Does Stallman speak decent German?
>>
File: i'll have two number neps.png (646KB, 1364x768px) Image search: [Google]
i'll have two number neps.png
646KB, 1364x768px
Friendly reminder that your C programs aren't worth shit if you don't use at least 4 levels of indirection.
>>
>>58932645
>2001

Java is still better
>>
>>58932665
16 years and Java hardly seems any different
>>
>>58932663
how many layers of indirection are you on?
>>
>>58932675
Have you actually used it in any way?
>>
File: programming_challenge.png (302KB, 1920x1080px) Image search: [Google]
programming_challenge.png
302KB, 1920x1080px
let's roll
>>
>>58932693
please no hard one
>>
>>58932628
that autistic fat commie hasn't written a lone of code in 3 decades. he doesn't know shit about programming.

fuck you for using his pic for this thread.

https://www.youtube.com/watch?v=I25UeVXrEHQ
>>
hey im just a babby and making my first website (to get started) but I am trying to link my css and jQuery into my html file. what is wrong here?

<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
<script type='text/javascript' src='jquery-3.1.1.slim.js'></script>
<script type='text/javascript' src='script.js'></script>
>>
>>58932693
something that's possible in asm please
>>
>>58932717
Wrong thread?
>>
>>58932713
>doesn't know shit about programming
Even though has built basically the foundation for everything modern? GNU ring any bells?
>>
>>58932713
and yet the autistic fat commie is still more useful than you will ever be
>>
>>58932663
>levels of indirection.
What is a level of indirection
>>
>>58932743
It means how many times you can dereference a pointer before you hit the original stack pointer.

Also, what happens when you try to dereference beyond that?
Is it undefined behavior?
>>
>>58932645
>>58932628
this kind of shit is worthless, toxic garbage and the community should shun it. i have nothing against lisp and i even like haskell, but advocating it on this fuzzy ineffable nonsense — this "oh trust me you'll get it when you learn it" horse shit — is antithetical to what should be in a convincing argument. it persuades people that are already on board and offers absolutely nothing to people that are even on the fence except condescension.

philosophers are able to express the nuances of different relatively abstract ontologies; programming languages are designed by humans and should be much, much easier to describe in relatively concrete terms.

if you can't articulate what other languages are lacking that lisp offers, or why haskell is better than java, then stop trying to push it.
>>
>>58932647
he only said a few German words like "kostenlos" (gratis), other than that I don't think he knows German? I could be mistaken. His talk was in English
>>
who here actually enjoys programming in Java every once and awhile?
>>
>>58932693
roll
>>
my textinput is wrong when using cout to print it to the console but if i save it to a file, it's working properly

should i be worried?
>>
File: Untitled.png (32KB, 500x369px) Image search: [Google]
Untitled.png
32KB, 500x369px
what's your favorite piece of software?

i think the webm project is great, plus its open source
>written in c, C++ and Shell

example
>mp4 file: 9.7 MB
>webm file with same quality: 3.2 MB

should we all convert mp4 to webm to avoid wasting space?
>>
i think it's os x because it's great and it just works
>>
>>58932727
org 0x100
use16

mov ax, 0
call print
inc ax
call print
dec ax
mov bx, 1
mov cx, 100
@@: add ax, bx
call print
xchg ax, bx
loop @b
mov ax, 0x4c00
int 0x21

print:
push ax
push bx
push 0
push ' '
push ','
mov bx, 10
@@: xor dx, dx
div bx
or dl, '0'
push dx
test ax, ax
jnz @b
mov ah, 0x02
@@: pop dx
test dl, dl
jz @f
int 0x21
jmp @b
@@: pop bx
pop ax
ret


well that was easy.
re-rolling.
>>
>>58932729
Yes. >>58868490
But the syntax looks fine. Probably an issue with the file paths.
>>
>>58932940
>image viewer
>in 8086
re-rolling
>>
EVERYONE WRITE PHP CSS COMPILERS NOW DONT LET THE BROWSER TAKE ITS TIME BUILD YOUR OWN COMPILERS LIKE LESS COMPILERS AND STUFF FIND THEM ON GITHUB AND USE HTACCESS REWRITING RULES TO REDIRECT THE CSS FILES TO A COMPILER AND THEN COMPILE THEM
>>
>>58933034
>benford's law
Never heard of this. What's the program supposed to do?
>>
ok assuming I want to make a service where you can request to look at files of other peoples computers.
I've thought of a python script that gets automaticly put in the startup services, depending on the distro.
any better ways to do it?
>>
>>58932940
>tfw 'programming' assembler 8051 in class and teacher is probably not a very good one

For more than a year we program basic stuff like chaser lights, pyramids and bar graphs. I get it, but I'm slow as fuck compared to C# and C (via CVI), which we also learn. E.g. I can complete any assignment, but only if time is unlimited. In case of a test or smth I'm pretty much fucked.

How do I get to do this easier besides writing actual code for the n-th time? What is the particular mindset I need for this to speed my assembler(((skills))) up?
>>
File: 1486942423243.png (176KB, 441x421px) Image search: [Google]
1486942423243.png
176KB, 441x421px
>tfw you missed out on the mobile development gold rush
>even Tom Hanks has a best selling app before you
>>
>>58933174
keep practice writing code it's that simple
I only really understand how to design and structure programs by coding coding research coding coding coding more research etc
>>
>>58933187
you can still make good money making mobile apps but they have to be good I made lots of money making an eccomerce type of web business app
>>
>>58933213

It's just nice to fantasize about making flappy bird or w/e where you're just suddenly a millionaire
>>
>>58933238
you can still make lots of money making those simple addictive fun games look at Undertale or Dwarf Fortress you gotta be creative and unique
>>
>>58932717
>>58932729
>>58933010
My bad guys, thanks for the reference.
>>
>>58933187
>find a top 100 app in appstore
>refactor gui so no plagiarism
>add a new feature which people would actually like
>?????
>prophet
>>
>>58933292
so much this look at all the pros and cons of top applications and you will find something unique to put together to make some coin
>>
For C
cprops: https://linux.die.net/man/3/cprops
or
glib :https://developer.gnome.org/glib
>>
>>58932628
Memery aside, I don't get all these people claiming Lisp will set your mind free. Your language is homoiconic and can do macros, sure, that's cute, but I fail to see what the fuck makes it so mind-blowing.
>>
>>58933174
I'm probably not the best person to ask since I'm slow too. Then again I only recently started learning 8086, all google no teacher.
Just practice more I guess, do these challenges, find multiple ways to tackle the same problem, etc.
>>
>>58933477
C++
>>
>>58933550
Fuck off Bjarne nobody likes you.
>>
What language is best for competitive programming? Should I use a (relatively) low level language like C++ for speed or a high level one like haskell or scheme for less boilerplate and more expressive power?
>>
>>58933628
In programming competitions, you write what you know best, and you better have practiced it 1000 times before.
>>
>>58933628
>competitive programming
As in what?
>>
>>58933479
I think it is because you can write domain specific languages quickly with macros and layered abstraction (separation of concerns). This makes code more robust (errors affect less code) and prototyping becomes much easier.
>>
#include <stdio.h>
int main(void){
printf("Hello World!\n");
return 0;
}


Where do I learn more? This is the only program I can write without looking anything up.
>>
>>58933628
I would choose python even though I know lisp or java better.
Lisp tend to be little verbose and require more thinking, java is just verbose and requires compiling.

With python you get interpreted language with kind of terse syntax which I feel is great for fast prototyping and hacky scripts.
>>
>>58933662
But is it worth it to develop your skills in a high level language? Or are all (mainstream) languages equally good
>>
File: 3dzNwll.png (563KB, 1200x900px) Image search: [Google]
3dzNwll.png
563KB, 1200x900px
I'm good with python and sql but want to move into more serious dev work

We have an account with Treehouse at work, so I have free tutorials for:
>Java + weeb dev
>C#
>Ruby (plus rails)
>Django/Flask
>JS
>HTML/CSS


What do I learn
>>
>>58933871
C#
>>
Is there a way to do this without using a lambda?
rleEncoder x = zip (map length $ group x) (map (take 1) $ group x)
rleDecoder = concat . map (\(x,y) -> replicate x y)
>>
>>58933706
http://bookzz.org/s/?q=c+programming+a+modern+approach&yearFrom=&yearTo=&language=&extension=&t=0
>>
>tfw scheme is literally easier than python
I still consider myself generally unable to program but it was kind of fun living the dream momentarily and writing some small programs (such as getting the sum of two user-inputted numbers)
>>
working with git for the first time, can others see the contents of my local repository?
>>
>>58933871
the image is missing Java
>chubby
>clumsy
>kind of a slut
>>
are there any other sites like codecademy, but that you'd consider better? I think something interactive would work better for me than reading, also I'd like more language choices since codecademy seems to mostly be for webdev memes
>>
>>58933871
those choices aren't very good IMO, but I guess Java
>>
>>58933871
cringed pretty hard from this "post"
>>
>>58933970
don't forget some sort of suit or bubble to represent the JVM
>>
>>58933982
you mean a wheelchair
>>
>>58933939
Please continue learning scheme! It's a wonderful language
>>
>>58934047
this. but then also learn something statically typed so your brain doesn't get crippled by dynamic typing.
>>
File: implying.gif (2MB, 300x168px) Image search: [Google]
implying.gif
2MB, 300x168px
>>58932763
>Also, what happens when you try to dereference beyond that?
Pic related.
>>
>>58933871
c# or java. everything else on your list is basically a meme
>>
File: CBpxF32WEAAFVUm.png (442KB, 600x900px) Image search: [Google]
CBpxF32WEAAFVUm.png
442KB, 600x900px
>>58933970
Theres java in the full image
>>
>>58934110
>using "meme" in this retarded way
fuck off back to your home "website"
>>
>>58933871
tfw no perl bf |female|
tfw no autistic R gf
tfw no bratty scala gf
tfw no resource hog VB gf
>>
File: 1457915873839.jpg (153KB, 700x922px) Image search: [Google]
1457915873839.jpg
153KB, 700x922px
>>58934130
here's your (You)
>>
>>58934168
>9gag.com
so that's where you came from? yeah, fuck off back to that shithole. whatever that is.
>>
>>58934168
>9gag
You are disgusting.
>>
We just started interfaces this week why do sent this fuckin method work it's the last one I need.

public int compareTo( Object obj )
{
Monster rhs = (Monster)obj;
if(myHeight > rhs.myHeight && myWeight > rhs.myWeight && myAge > rhs.myAge)
return 1;
else if(myHeight < rhs.myHeight && myWeight < rhs.myWeight && myAge < rhs.myAge)
return -1;
else
return 0;
}
>>
>>58932412
Roses are red
Violets are blue
Java's for monkeys
Who don't poo in the loo
>>
>>58934297
It's only returning 0 for some reason
>>
>>58934297
>>58934319
>>>/r/abbit
>>
>>58932764
I think 'expressive power' and 'elegance' are fairly well-defined.
>>
>>58934277
>>58934217
this is too easy
>>
>>58932764
>the community
good post. if not for this absolute retardation.

also laughed pretty hard at the part where you called Stall"man" a philosopher
>>
>>58933900
rleDecoder =  concatMap $ uncurry replicate
>>
>>58932687
like,, maybe 5, or 6 right now. my dude
>>
Why program anything unless you get money from it?
>>
>>58934620

you are like a little baby

watch this

STRUCT
>>
>>58932628
in the planning stage of my next project and have a conundrum on how to tackle a problem.

Basically, comparing very similar XML files and displaying the differences. Mainly focusing on console/report but might look into GUI.

I could use a library like XMLunit but not sure on performance. Maybe build tress and compare them against each other. I will care about order of that as the XML files are basically maps of a web app, just need to compare changes between versions
>>
>>58934346
No. They're not. Because expressive power is very different depending on your goals. For some applications C and the likes are very expressive. For others higher level languages are more expressive.

As for elegant i don't even know what that supposed to mean. It sounds like a 'pretty code' thing.
>>
>>58934681
Actually, that's not what 'expressive' power is usually taken to mean in PLT:
https://en.wikipedia.org/wiki/Expressive_power_(computer_science)

As for elegance, it essentially means 'minimal': you can express all of the necessary concepts by combining only a few atomic pieces (e.g., the half-dozen or so axioms of LISP).

Anyway, I can see you have a chip on your shoulder about this, so I'll leave you to it.
>>
>>58934627
agreed lets all make business web apps together who is with me?

I suggest we program virtual reality for women clothes accessories we would make a ton of money
>>
>>58934652
can't you just do this with diff?
>>
>>58932764
how about you try them and then list the reasons they're better? perhaps its userbase is not the best with words
>>
Man I really don't know if this is a stupid question but I need help.

I have XLM data in a clob in a db2 database. I am not trying to query particular parts of it, instead I just want the entire thing. I just need to grab and display the xml in a jsp. Is there any way to do this easily? The formatting of the XML isn't regular so I just want it posted in the same formatting it went in as.
>>
Lisp > Fortran > Cobol
>>
>>58934627
for fun and/or helping out your neighbor or yourself

e.g. adding support for some of your hardware to a free software project
>>
>>58934728
I really like your vision! I also want a VR app that can create a "dream girlfriend" and input personalities of someone we know/knew. It would be fun interacting with her, like incorporating dress-up features from your app. Now, are you comfortable being the programmer and I run the business side?
>>
>>58934728
Cool, I'll make the logo.
>>
>>58934796
>X > Cobol

Really not saying much m8.
>>
>>58934796
why compare these three? are they similar? I know the latter two are extremely old
>>
>>58934796
does this even need to be mentioned?
>>
>>58932874
Are you printing unicode characters? A screenshot would help
>>
>>58934370
i didn't call stallman a philosopher. i pointed to philosophers being able to describe more abstract stuff and said "if those fuckers can do it, then stallman and others should be able to as well".
>>
>>58934841
>"if those fuckers can do it, then stallman and others should be able to as well".
I don't see how someone can say this without elevating stall"man" to a higher level. why would anyone think that he is capable of something like this when he's pretty much a complete retard when it comes to most things?
>>
>>58932693
r-roll
>>
>>58934714
>expressive
With that definition it's entirely useless because almost any modern language has the expressiveness to do whatever. Comparing lisp to others it's difficult to consider it anything but the same as other languages in expressiveness. You can do oop in C for example. It's ugly as all hell but it can be done.

I find my idea of it to be more useful. My idea concerns itself with the practical application of the programming language to problems. When you write in a language you likely chose the language because it fits your problem. The type of expressiveness you find in the language matches your problem. You would probably not try to do low level state mutations in haskell for example. But it's appropriate for other things.

You can't just say 'it's expressive'.

I don't see elegance as a virtue. There can be issues with too many features but compressing your language into few pieces can be just as bad because for a specific common problem you could have another atomic which handles that case well. It's a balance to strike clearly. And yes minimalist sounds exactly like code prettiness to me. It has some virtues like in the case of lua (interpreters are very easy to do), but it's not a universal good.
>>
>>58932693
rolling
>>
>>58934885
Did you read the article? It does go through what 'expressive power' means in the context of PLT.

>I don't see elegance as a virtue.
That's okay, I didn't say you had to :) But some people do, which is why they tout it as a benefit.
>>
Is C++ a good language to learn as a starter and to move on to other things? I was recently gifted a Udemy course that teaches C++ by making games with unreal and the reviews seem like the course is worth it. Is this a waste of time or should I give it a shot?

Link:https://www.udemy.com/unrealcourse/
>>
>>58934931
No I didn't bother to read it all since you said it didn't agree with me.
Now upon further inspection I see that it does. I'm basically just reiterating what it's saying.
Way to confuse me anon.
>some people view it as a virtue
They'd have to motivate it though.
>>
>makes tiny mistakes at new job all day becuase I never learned AGILE
ohfuckohfuckohfuckohfuckohfuckohfuckIMGOINGTOGETFIREDAGAIN
>>
>>58934998
It doesn't tout the same definition as yours, but regardless, my point was that 'expressive power' is well-defined, and I'm glad you agree with that.
>>
>>58932693
Roll cuz I'm a piece of shit
>>
>>58935027
If we accept that definition, yeah. But Stallman statements doesn't fit it particularly well. And that's what bothers me.
>>
>>58934962
>Is C++ a good language to learn as a starter and to move on to other things?
No. C++ is a good language to study for ten years and still not understand it deeply because there will still be parts of it you've never fucking heard about. Experienced C++ programmers are rare experts compared to the industry overall. Most of them are working in game dev.
>>
>>58934127
I want a tsundere rust waifu ;_;
>>
>>58935006
Probably deserve it tbqh.
I don't get how you can screw up these jobs where you're supposed to follow programming memes. It'd be a bit of a struggle to go against common sense all the time but still. It's not like you can't do it if you wanted to.
>>
>>58935051
What Stallman means is essentially 'you can do a lot without typing much'. People tend to like this in languages, not just due to laziness but also because bug counts tend to be related to SLOC.

Languages have tended towards this trait with time, and for good reason.
>>
>>58935064
I dont want to get into game dev so what would be a better alternative?
>>
>>58935071
I screwed up because I legit didn't know, not because I refused to do it. This is the first job where I've had any kind of programming performance meme. I thought if I just did a lot of work and did it well it would look good, but because I did all of it as one big chunk I looked like an idiot
>>
>>58935099
Python is a good language to learn early and then abandon. A couple people are gonna reply to this saying Python is "a meme" but they're scrubs who wouldn't know an interrupt handler from a parallel universe, so ignore them.

Once you've picked up some momentum, C# is a good language to use as your day-to-day tool. If you find it too difficult, give Go a shot, but I personally think Go is dumb and making things in it is counterproductive.
>>
>>58935087
>you can do a lot in brevity
That's nice and all but the SLOC comment isn't really about serious programmers.
Serious programmer have to fight complexity. Very few programming languages help with that so far. Approaches like functional programming help because their constraints lock it down quite a bit but it's not an ultimate solution. There's more to do.
>>
>>58935125
Just calm down and catch up anon. You will do fine.
>>
>>58935099
Different anon here:

Depends on what you want.
For learning: Python, JavaScript, Golang
For getting a job: JavaScript, C#, Java, etc
For performance: C, Rust, C++

I'm biased of course, but Python, Golang and Rust are my personal favorites. It doesn't really matter what language you choose, you just have to stick with it.
>>
>>58935031
good luck anon
>>
>>58935218
>Make a D&D game! With AI!!
>FML
How the fuck am I supposed know how it's supposed work?? Is this like a text based game or what?! Who the fuck thought this would be a good idea?!
>>
>>58934814
You mean the former.
>>
>>58935283
It doesn't say you have to implement an interface, text or graphical. It just mentions the D&D system and AI. I say just make the engine.
>>
>>58935309
No, that's not what I meant. Maybe I'm wrong, but I didn't write what I did on accident.
>>
>>58935283
git clone nethack
>>
>>58935322
The three languages were actually made at around the same time. Fortran was made in 1956, LISP was 1958, and COBOL was 1959.
>>
>>58935158
It's interesting that you raise that, because expressivity, like abstraction, is a great way to stave off complexity; that's why people like it.

Anyway, we're getting off track here: you were saying that the claims mad were vague and hand-wavy, I hope I've convinced you that the terms Stallman used have a lot of meaning behind them.
>>
>>58935355
Ah, cool. Didn't know that. I guess that makes sense considering how old GNU is, and the fact that Emacs uses lisp.
>>
So (in Python) I'm looping through a list of objects and each time doing some operation on them, and checking whether a particular condition has been met which is when I want to delete the object instance, what's the best way to do this?
>>
>>58932693
role
>>
>>58935313
> Just make an engine! Duhogh!
What "engine" is this that you speak of? What does it do? Make pretty boxes? Move points? Display text? Wtf
>>
>>58934813
Cobol's pretty good. Performant and reliable, but on the downside doesn't have the flexibility of C etc.
>>
>>58935368
Sounds like a filter??
>>
>>58932940
s equ 0x1000        ; precision (in 16-bit words)                  
i equ 1000 ; number of iterations

org 0x100
use16
mov di, a
xor ax, ax
mov cx, s*3
cld
rep stosw
mov di, a
call print
mov di, a+s*2
mov word [di], 1
call print
mov si, a
xchg si, di
mov cx, i
.a: push cx
mov cx, s
xor bx, bx
clc
@@: mov ax, [di+bx]
adc ax, [si+bx]
mov [di+bx], ax
inc bx
inc bx
loop @b
pop cx
call print
xchg si, di
loop .a
mov ax, 0x4c00
int 0x21

print:
pusha
mov si, di
mov di, a+s*4
mov cx, s
rep movsw
mov bp, a+s*4
push 0
push ' '
push ','
.a: mov bx, 10
mov di, s*2-2
mov cx, s
xor dx, dx
@@: mov ax, [bp+di]
div bx
mov [bp+di],ax
dec di
dec di
loop @b
or dl, '0'
push dx
xor ax, ax
mov di, bp
mov cx, s
repe scasw
lea si, [bp+s*2]
cmp di, si
jb .a
mov ah, 0x02
@@: pop dx
test dl, dl
jz @f
int 0x21
jmp @b
@@: popa
ret
a rw 0

Improved this so it doesn't overflow after ~25 iterations. Now uses arbitrary precision math (adjustable, default 65536-bit because why not) and prints the first 1000 iterations in the Fibonacci sequence.

please rate
>>
>>58935364
Yes a lot of meaning but not a single meaning. At best we can say lisp is the best language for Stallman and people who share his concerns. Which isn't a particularly impressive conclusion.
>abstraction starves off complexity
I've had this discussion before and no, usually it doesn't. When it does its often a side effect.

Abstractions are too fine grain to reduce complexity in systems. You need more coarse grain to achieve anything meaningful.
>>
File: 1481427489366.jpg (2MB, 1933x1795px) Image search: [Google]
1481427489366.jpg
2MB, 1933x1795px
>>58932693
Roll
>>
>>58934870
I'm s-still learning

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
if (argc == 1) {
printf("usage: %s <number>\n", argv[0]);
return 0;
}

char *ptr;
long ret;
long triangle;

ret = strtol(argv[1], &ptr, 10);
if (!ret) {
printf("Something went wrong\n");
return 1;
}

triangle = (ret * (ret + 1)) / 2;
printf("%d\n", triangle);

return 0;
}
>>
>>58935435
>Yes a lot of meaning but not a single meaning
I think you'll find that 'expressive power' is fairly well-defined, but now we're going around in circles.

Poor abstractions add complexity, opaque abstractions remove it, but that's a conversation for another time.

See you later, bro.
And remember: if you're not sure what they're talking about, just try it for yourself and see.
>>
>>58935324
>Nethack
>D&D
Wat
>>
>>58935474
It's fine, but you're not error checking strtol properly.
>>
>>58935541
What do
>>
>>58935541
If ptr == argv[1], it means that strtol couldn't read a number from the string.
You're just checking if it returns 0, which is actually a valid return value from that function.
>>
File: fibo.png (53KB, 1448x846px) Image search: [Google]
fibo.png
53KB, 1448x846px
>>58935431
proof that it works
actually I'm kinda surprised it does
>>
>>58935537
read the man page, it says it is d&d influenced or something like that
>>
[reposted from /sqt/]
>Facebook have changed their API (it is now v2 only, v1 is not supported any more) so that you can no longer get a list of friends through the API. The only thing you can do is get a list of users that use your app. To test this is working ensure that BOTH users have added the app.
(From http://stackoverflow.com/questions/31790635/python-how-do-i-get-a-facebook-users-friend-list-status-updates-etc-using-dj)

So.... Is there any easy way for me to get a list of all my friends on FB?
>>
>>58935663
That makes sense, thanks

>>58932693
roll again
>>
>>58935809
This seems like a pain in the ass to make, re-rolling
>>
>>58935737
>FB
kek kys
>>
File: 1470750550356.jpg (246KB, 1024x894px) Image search: [Google]
1470750550356.jpg
246KB, 1024x894px
So, what's a good user friendly and [spoiler]comfy[/spoiler] IDE to use for a beginner that's currently studying C that eventually wants to move on to python and maybe C++?
>>
>>58935830
re-re-rolling, something easy this time pls
>>
>>58935869
C is not a language that benefits from an IDE (i.e. it doesn't contain Java-levels of bloat/boilerplate).
>>
>>58935869
>what's a good user friendly and [spoiler]comfy[/spoiler] IDE
any IDE is by definition not compatible with what you've listed here. just use any text editor you like.
>wants to move on to python and maybe C++?
why would you ever want to do this if you aren't brain dead?
>>
>>58935869
DrRacket
>>
>>58935869
Emacs.
>>
>>58935923
Hi Ira.
>>
>>58934127
ActionScript is my waifu
>>
>>58935869
vim
>>
>>58936284
good taste
>>
>>58932693
roll
>>
File: fibo2.png (166KB, 1448x846px) Image search: [Google]
fibo2.png
166KB, 1448x846px
>>58935431
s equ 0x2000        ; max precision (in 16-bit words)                                                  
i equ 10000 ; number of iterations, excluding first two

org 0x100
use16
mov di, a
xor ax, ax
mov cx, s*3
cld
rep stosw
mov di, a
call print
mov di, a+s*2
mov word [di], 1
call print
mov si, a
xchg si, di
mov cx, i
.a: push cx
mov cx, [p]
xor bx, bx
clc
@@: mov ax, [di+bx]
adc ax, [si+bx]
mov [di+bx], ax
inc bx
inc bx
loop @b
jnc @f
inc cx
inc [p]
cmp [p], s
je overflow
jmp @b
@@: call print
pop cx
xchg si, di
loop .a
mov ax, 0x4c00
int 0x21

print:
pusha
mov si, di
mov di, a+s*4
mov cx, [p]
rep movsw
mov bp, a+s*4
push 0
push ' '
push ','
.a: mov bx, 10
mov di, [p]
shl di, 1
sub di, 2
mov cx, [p]
xor dx, dx
@@: mov ax, [bp+di]
div bx
mov [bp+di],ax
dec di
dec di
loop @b
or dl, '0'
push dx
xor ax, ax
mov di, bp
mov cx, [p]
repe scasw
jne .a
mov ah, 0x02
@@: pop dx
test dl, dl
jz @f
int 0x21
jmp @b
@@: popa
ret

overflow:
mov dx, err_msg
mov ah, 0x09
int 0x21
mov ax, 0x4cff
int 0x21

err_msg db "Overflow!$"
p dw 1 ; current precision
a rw 0 ; data area

Final version unless I find any more bugs. Now with true arbitrary precision. This version uses only the precision it actually needs, starting with 16-bit ints and working its way up to a maximum of 131072-bit integers. The performance improvement is quite incredible. Also with overflow protection in case it ever reaches > 2^131072.

please rate
or at least acknowledge my existence
>>
>>58936455
Looks good, bby
>>
> Python is for rapid development
Do people say this just because it's the language they know best?
>>
>>58936165
vim
>>
>>58936598
Pretty much.
>>
>>58936566
Please send help.

Trying to change page background-color using CSS.

This has no effect right now and I don't know why. Everything else works fine.
>>
Are there any programming languages that are similar to Lua (i.e., small, embeddable, scripting, cute), but are NOT fractured across two or more mutually incompatible versions of the language?

Asking for a friend
>>
>>58936598
>that reddit space
>>>/r/ibbit
>>
>>58936932
> Implying is on plebbit
>>>/meds/
>>
>>58936969
I literally couldn't read this post. Try harder next time
>>>/r/abbit
>>
>>58932645

haskell is a language based on vanity and masturbation
>>
>>58936455

its aight

now the fun part is trying to do any mathematics on bignums of variable size
>>
>>58936998
java is a language based on curry and poo
>>
File: 1429667276718.png (162KB, 453x435px) Image search: [Google]
1429667276718.png
162KB, 453x435px
>>58936998
>>58937022
return to your shitty website, plebbitor.
>>
>>58936926
Tcl maybe, but cute it is definitely not
>>
>>58935909

c++ without an IDE is masochism

> let's just learn an entire language just to compile the fucking thing

no thanks
>>
>>58937034
see >>58937029
>>
what has my life come to
>>
>>58937036

>>>/p/oo
>>
>>58937034
>>58937022
>>58936998
>>58936885
Why the hell do you redditors space your posts like that?
You really need to go back.
>>
>>58936976
He's saying you need to go back to your meds, which it's clear you need.
>>
>>58937041
see >>58937036
>>
>>58937049
oh, which meds exactly?
>>
>>58937048
It's how I send emails.
>>
>>58937053

-t. black nigger
>>
>>58932693
roll
>>
>>58937069
The ones for your crippling aspergers
>>
>>58937073
does this look like a fucking "email website" to you? whatever that means
>>58937077 -> >>58937029
>>
>>58933292
This is called "The Pajeet Effect"
>>
>>58937098
i can't take meds i don't have. what do you recommend? perhaps something you've been taking yourself?
>>
>>58937099
I'll browse whatever site I want.
>>
http://kukuruku.co/hub/programming/i-do-not-know-c
>>
>>58937127
I don't think so. You'll be deported pretty soon. The militia will round you and your fellow redditors up so you don't cause any more trouble.
>>
>>58937113
I would suggest asking your mom to take you to the doctor
>>
>>58937149
Lately there is a constant effort by the SJWs to denounce C for being "unsafe" and blaming the language for shitty programmers who write code that contains bugs. It is a trick to replace C with an inferior meme language so programmers can be controlled, instead of the other way around, programmers being IN control. That is the whole point of programming, being in control. A language should give you as much control as possible, to make you the god of your own code. The SJWs want to stop you from being a god.
>>
>>58933628
I'd say Python, C++, or Haskell.
>>
>>58937198
i think I can handle that on my own. i don't need mommy's help on this one.
maybe you could share some information with me? i'd really like to avoid going to the doctor right now. i just need the name of this pills you recommend
>>
>>58937204
>A language should give you as much control as possible, to make you the god of your own code.
You are straight up delusional if you think C somehow offers this.
>>
>>58932693
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
oooooooooooooooooooooooooooo
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
>>
>>58937022
Yeah the division thing was tricky enough and that's just dividing by 10. Although suddenly now the weird div instruction does make sense ((dx:ax)/bx = remainder in dx, carries over to next division). Still I wouldn't know how dividing by a bignum would work.
>>
>>58937222
I suggest a 9mm, and inject it into your forehead
>>
>>58937322
i would have to use a gun for that. and that would most likely kill me so i'll pass.
>>
>>58936885
If it's not inside of the <head> element, I'm stumped.
>>
>>58937387
<head>
<style> <!-- CSS -->
html {
background-color: #008080;
}
#divPhotoOne {
position: relative;
margin-left: auto;
margin-right: auto;
width: 300px;
height: 300px;
}
#myName {
text-align: center;
}
#myNumber {
text-align: center;
}
#divPhotoTwo {
position: relative;
}
</style>
</head>


To be more precise.
>>
>>58937419
I'm using both html and body.
Both work only if they are just above </style> and it forces divPhotoOne to be forced to the left of the page.
>>
>>58937149
1 gave me a think for a half second
2 did as well - but not sure of any system which wouldn't crash on the null pointer dereference anyway so it's a bit of an odd one
3 was obvious, aliasing is always the answer on these "tricky" questions with pointer arguments
4 applies to many other languages too
5 was obvious and quite banal
6 was super obvious and another banal "trick" question we see so often on these "C is bad for you and here's why" quizzes
7 bleedingly obvious UB from the start
8 another common banality of "hiding" the comma operator in what looks like real syntax
9 & 10 amazing, signed overflow isn't defined? this is C 101
11 there's a different range in negative and positive range? waow never would have expected that
12 just a different delivery of point in 11
>>
>>58937704
>>
I just found a job, Python & Go, no Windows, only GNU
>>
>>58937747
It's a matter of style.
I understand why someone wouldn't want to do it, but I'm not vehemently against it.
If the variables are somewhat related
e.g.
int day, month, year;

I'm not against it, but if they're a bunch a different shit, I'm more against it.
When it comes to pointers though, don't mix that shit together with normal variables.
>>
>>58937747

It depends how crowded the line is, and whether or not the vars are related in some way.

for instance:
int width, height;
int bitDepth;
>>
>>58937873
>>58937862
Thanks, that makes sense. She probably didn't want to have to explain that to everyone.
>>
>>58937747
I don't declare variables in chunks. I hate people who puts a block of declarations at the start of the function without any context whatsoever. Just declare each variable right before you start using it (so do declaration + initialization) and you will rarely have that dilemma
>>
>>58937787
Sounds great
>>
>>58937913
>I don't declare variables in chunks. I hate people who puts a block of declarations at the start of the function without any context whatsoever.

That was (at one time) required in C. Old habits die hard.
>>
>>58932693
ok
>>
>>58937941
I know, but there's people teaching freshmen to do that and some even believe it's a good practice.
>>
>>58932628
Why is this retarded kike at the top of these threads.. He's a failure at life who still lives in his mommy's basement. Don't take anything this jackass says seriously.
>>
>>58938156
low quality bait
>>
>>58937936
Yes, I'm happy
The pay is mediocre but I can work remotely from anywhere and schedule my own hours
Perfect so slowly get out of NEET life
>>
>>58932693
rolling
>>
>>58938156
this
>>
>no one posted the Go tour
learn Go: https://tour.golang.org it'll just take a few hours at most

>>58937034
same for java
>>
>>58936926
Chicken Scheme? Guile, perhaps?
>>
>>58938689
Why does a bad language like Go get shilled so hard these days?
>>
>>58938705
Rob Pike wants to be taken seriously, but it's just not working out.
>>
Can someone teach this retard to draft a coherent license agreement? GPL is word vomit nonsense.
>>
>>58934110
all are shit. learn c, python, php, and perl

>inb4 C master race
>>
>>58938746
If this is for open source work, don't draft one yourself because no one will know what it is and so no one will risk going anywhere near your code. If it's not open source, don't draft one yourself, have a lawyer do it.
>>
>>58932693
ROLL
>>
>>58938705
I've spammed the Go for like 2 days m8
Go is cool, just learn it.

>bad language
inb4 HASKAL
>>
Top 5 Meme Languages for meme programmers:
1. Python
2. Haskell
3. Rust
4. Go
5. Swift
>>
>>58938850
Go is fucking shit, fuck off. Your brain must literally be the size of a pea.
>>
>>58938850
m8 it's 2017 and Go still doesn't even have fucking generics.
>>
File: Capture.jpg (31KB, 839x268px) Image search: [Google]
Capture.jpg
31KB, 839x268px
https://forum.dlang.org/thread/[email protected]
no no NO
>>
File: languages3.png (17KB, 522x384px) Image search: [Google]
languages3.png
17KB, 522x384px
Reminder that idiots will dispute this image
>>
File: d.png (21KB, 1076x703px) Image search: [Google]
d.png
21KB, 1076x703px
is D a meme?
>>
>>58938892
>>58938911
D stands for dead language
>>
>>58938911
Yes, but it's a good meme as long as you're fine with the GC
>>
>>58938874
>>58938886
>elite /dpt/ programmers

>>58938899
>Go
>slow
>slow development
top kek, someone missed the news...
>>
>>58938899
>C++
>Good performance

pick one
>>
>>58938938
Oh yes, I'm sure writing the same code over and over again because the language supports almost no sort of abstraction is *really fucking fast to develop in*, you utter cretin.
>>
>>58938957
>writing the same code over and over again
there are many solutions to that problem. you can google that.

>no sort of abstraction
but you are wrong you fucking retard
>>
>>58938938
I'm so glad Go programmers exist. I'm a pretty average programmer, but I look like a genius next to one of them.
>>
>>58939007
>>>writing the same code over and over again
>there are many solutions to that problem. you can google that.
No, there aren't, Go lacks almost all of the features that are necessary for non-trivial code reuse.

Prove me wrong. Show me monad transformers in Go.

>>no sort of abstraction
>but you are wrong you fucking retard
I said almost no sort of abstraction. You can do very crude things, but it's rather like trying to write a letter with a dildo and molten chocolate.
>>
File: Selection_20170214_05:20:10.png (13KB, 478x155px) Image search: [Google]
Selection_20170214_05:20:10.png
13KB, 478x155px
>>58939007
>>58934314
When addressing a person or thing directly, the name used must be offset with a comma (or commas if it's mid-sentence). For example:

Jackie, are you leaving so soon?

I know your sister, Michael.
>>
>>58939035
Remember that Googlers are forced to use this shit. They hire the best and brightest? Bullshit.
>>
top 5 program languages:
1. java
2. javascript
3. c#
4. cobol
5. html

agree?
>>
>>58939140
Not at all

1. Idris
2. Haskell
3. OCaml
4. Scheme
5. Common Lisp
>>
>>58939140
Wrong, it goes like this:

1. C
2. C
3. C
4. C
5. C
>>
>>58937955
It is good practice ya doofus, you do it that way so you don't have to go seaching all over your code for it. It's just a declaration, has nothing to do with flow.
>>
>>58939162
Were those your grades in college?
>>
>>58939039
This.

Anon no one can into grammar on this site

Thanks for helping enlighten the retards Anon
>>
>>58937913
That's because you're a n00b...
>>
>>58939176
No, those went sort of like this:

1. A
2. A
3. B
4. A
5. F--
>>
>>58937027
This. Indians aside, lowered standards for the CS discipline is a big problem. The only thing that's keeps Universities from becoming full blown poo mills is accreditation. You just need a big player to say fuck it and make a "kode in 4 yaers" degree and it will be a solid nail in the coffin of software development. Hopefully CS as a discipline can move on and cut the chaff.
it's not about about your enterprise rakeshsoft. it's about pushing ideas and developing concepts.
>>
>>58939261
This, this, so much this.

A good CS degree will produce graduates who can pick up Java, C#, or whichever language is currently popular in a few weeks or less.
>>
>>58938892
Both look gross
>>
>>58932693
Roll
>>
>>58932693
>>
When you exit a program is the data stored in memory for the variables you used still there? For big important programs do you need to rewrite all the variables you used upon closing?
>>
>>58939307
Programs always start from a clean slate. Nothing is remembered.
If you need something to persist between different times running the program, you would save it to a file, and read it back in next time.
>>
>>58939307
>When you exit a program is the data stored in memory for the variables you used still there?
Yes, for efficiency reasons, operating systems generally do not wipe memory after a process terminates.

Custom, security-focused Linux kernels can do it, though.
https://en.wikipedia.org/wiki/PaX has an option to wipe process memory.
>>
>>58939281
Yeah, I can't think of a clean way to do it though
>>
Fighting with this stupid fucking logging module for Python. My programs functionality is done and I want logs but this is so fucking annoying.

First I was getting log messages from imported modules like requests. Fixed that but now I can't get log messages from my own imported classes. Only some of my logging messages go to my file handler while none of my messages go to my stream handler despite both handlers being set to DEBUG level.

I hate this tedium involved in getting a module ready for packaging.
>>
>>58932693
roll
>>
>>58939140
HTML is not technically a language.
COBOL is still widely used but a dinosaur.
C# is Microshit.. ick! They will abandon you sooner or later, they have a perfect track record for doing that.
>>
>>58932647
Stallman is fluent in French and Spanish, not German, unfortunately.
>>
>>58939511
>HTML is not technically a language.
Wrong, it's a markup language.
>They will abandon you sooner or later
Why would they? The lang has been a massive success, desu I don't doubt it will be replaced with a new, shiny new language, just like it has been always.
>>
>>58932693
roll
>>
>>58939511
>HTML is not technically a language.
HTML with CSS is Turing complete, which makes it a programming language.

And of course it's definitely a markup language.
>>
pleb here

anyone here knowledgeable in bash scripts?

Been trying my first bash script, and I'm trying to move all files with a filename that matches a string of an array and put it in a folder with that name

like, i have an array MONTHS = [jan feb mar may apr... and so on] a bunch of pictures with file name "april2016", another bunch with "may2016", I want to move all the april pics in a april folder and all may pics in a may folder

as of now the way i'm trying to do it is

for file in ~/../public/pictures #folder with all the pictures 
do
variable = 'MONTHS[@]' #save the current month iteration
for file in ~/../public/pictures
ls -l | grep -c -i #and i dont know what to do from here
done
done


I'm trying to find a way to feed ls -l to grep's standard input to read the filename and then move whatever file matches the current array variable being read

Any anons could shed just a little bit of a light my way?
>>
>>58939635
Google how to pipe with xargs to do the moving
>>
File: beachbutts.jpg (120KB, 1024x915px) Image search: [Google]
beachbutts.jpg
120KB, 1024x915px
>>58932628
Anyone use REXX? Highly under rated language. Powerful with beautiful syntax that makes sense without being overly verbose. Developed by IBM.

Other under rated languages to consider

Modula2
Clipper <- love this one!
ADA (used by Nasa and the military)
Pascal
>>
>>58939660
Pascal was the standard language in high school programming classes
Is it not anymore?
>>
>>58932693
Rolling for a wake up
>>
>>58939669
Pascal is a great teaching language. I don't know of any high schools that teach programming of any sort these days.
>>
>>58932693
>>
>>58939660
Ada isn't an acronym
>>
>>58939669
Not for a long time.

>>58939825
It's a great production language too. Before Microsoft consolidated developer tools (and poached talent), the best game in town for Windows was Borland's IDE and products which were polyglot C/C++/Pascal and it worked great. Ah le 90s...
>>
>>58932693
run the jewels
>>
>>58939954
>Not for a long time.
What do they use now?
>>
>>58939970
Usually Python
Some don't even bother with native dev and introduce these poor supple highschool kids directly into Javascript webshit
>>
>>58932628
I want to build my own kernal using c++ when I have the time. Does anybody know where to find good info on doing so?
>>
File: vomit.jpg (90KB, 650x650px) Image search: [Google]
vomit.jpg
90KB, 650x650px
>>58940036
>build my own kernal using c++
Jesus fucking christ.
>>
could anyone recommend me material on asymptotic notation?
>>
>>58940086
I know it will be fucking trash, I know some assembly but not C which is what I would prefer to use.
>>
>>58939151
>Scheme > Common Lisp
Why?
And is Idris just haskell with dependent types?
>>
>>58940086
The graduate-level operating systems class at my University used C++ to build an object-oriented kernel.
>>
>>58940183

Trying to figure out how exactly this implies it being trash??

At the kernel level basically until you implement the libraries to support all the fancy c++ shit, it's pure old school c programming.
>>
>>58940183
Really? Did they use assembly as well?
>>
>>58940206
I would prefer to use C as C++ is just unnecessary, I just don't know it.
>>
>>58940210
>Did they use assembly as well?
Of course. Assembly is undergrad tier anyway.

>>58940206
You still get to use templates, inheritance, operator overloading and lambda functions.
>>
File: 1480812177365.png (207KB, 450x416px) Image search: [Google]
1480812177365.png
207KB, 450x416px
>>58940230
>inheritance
>>
>>58940183
>mfw my os class didn't do shit, no homework or any programming and the teacher was a sub from canada
Easiest fucking class I had, he was just giving away A's. He even gave a lecture near the end of the semester about how if you've made it this far then you should get a free pass, he only goes hard on the beginner courses. I kind of agree with him on it though
>>
>>58932693

rollan
>>
>>58932693
rolling for easy plz
>>
>>58940230

http://wiki.osdev.org/C++

Is a decent summary for the minimal requirements.
>>
>>58932693
Eh. Bored at work
>>
>>58940230
Would you recommend holding off on this project until I am stronger with c? I have been putting it off for too long anyway.
>>
>>58932693
roll.
Gotta go to uni first though
>>
Quick question: I am looking to log to a file with 30 or so lines per second being generated (each line is in the region of 100 characters) in C#. I'm thinking I really shouldn't be attempting file I/O that often so I want to occasionally dump a stored buffer of these logs every now and then (not specific period just "append all the shit stored to the file and start logging fresh"). What's best practice for doing that? I can't have a fixed-length array for the bytes because I have no idea how long it will store for. Currently I'll be adding a line to a list of strings and presumably when I want to dump into the file iterate over the list, combine it into one byte array then write that single array to file.

Maybe a stringbuilder using
<code>
byte[] info = new UTF8Encoding(true).GetBytes(value);
fs.Write(info, 0, info.Length);
</code> ?
>>
>>58932693
Do I get to use any language?

I've been learning the python but I don't really like object-oriented. I feel an affinity towards imperative, almost want to learn fortran; is functional good?
>>
>>58939307
>For big important programs do you need to rewrite all the variables you used upon closing?

Not unless you're worried about someone reading it. By say running another program that is given that memory and reading it without initializing it. Some luks commands make sure keys are no longer in data. For best security you should zero out any sensitive data as soon as you don't need it. Nobody can steal something from you if you don't have it.
>>
>>58940347
Using string in this manner is very inefficient especially if your pulling an item from the front because it has to shift.
>>
File: expert_hacker1.jpg (2MB, 2448x3264px) Image search: [Google]
expert_hacker1.jpg
2MB, 2448x3264px
>>58932764
Lisp is perfect whether you use it or not.
>>
>>58940379
Right so I'm thinking of stringbuilder currently. 30 times a second I'll be appending 100 characters to the stringbuilder and every now and then (region of 10-30secs) convert that stringbuilder to a byte array and write to file.
>>
>>58940347
Use a data structure such as a queue. Do you know how to build a circular array? Does the ordering of the information matter?
>>
>Buy cheap LED display from China for my embedded system project
>So shit you have to code into its memory
>Documentation is in Chinese
This is true suffering
>>
new thread

>>58940420
>>
>>58940402
Yeah I just don't really use C#. All I'm trying to do is avoid hammering file IO cause I'm sure it'll fuck up performance. Don't think memory will be anywhere near an issue with the volume of data I'm collecting between dumps
>>
>>58940435
Just throw them in a linked list then, quick and easy
>>
>>58940455
yeah it's the next part once you have that linked list though. I've got a LL of 3000 lines. I want to write it in one IO operation instead of 3000. So shouldn't I just use a stringbuilder (I think append is O(1)) to generate a 3000 line long string then append that single string to a file?
>>
>>58940293
>Would you recommend holding off on this project until I am stronger with c? I have been putting it off for too long anyway.
Use C because writing _good_ C++ is very difficult and takes at least a decade to master. Not even most C++ experts know everything about the language.

It's easy to write C++ that works, but it's hard to write high quality C++.
>>
>>58932693
rolling for an ASM thing aswell
>>
>>58940529
k

rolling again tho
>>
>>58940547
yeah no
>>
>>58932693
will deliver
>>
>>58940498
yes
>>
>>58940387
Since death is perfection, no wonder Lisp is the Latin of programming languages.
>>
>>58932693
rolling
Thread posts: 322
Thread images: 25


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.