[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: 358
Thread images: 39

File: 1468877540019.jpg (179KB, 512x512px) Image search: [Google]
1468877540019.jpg
179KB, 512x512px
old thread: >>55796316

What are you working on, /g/?
>>
Trying to get my C# program to automatically log in the user through AD.
>>
WHO HASKELL HERE
>>
I am configuring gnome sarcastically
>>
>>55801583
This is pretty easy. Use impersonation.
>>
http://codeforces.com/problemset/problem/158/B
program keeps either hanging or throwing exceptions
>tfw want to look up the solution but will feel like a failure
>>
File: images.jpg (7KB, 226x223px) Image search: [Google]
images.jpg
7KB, 226x223px
>>55801593
lisp better u trash
>>
File: anon hw 1 2.png (56KB, 688x790px) Image search: [Google]
anon hw 1 2.png
56KB, 688x790px
>>55801593
me
>>
Why do people still buy programming books when every worthwhile library and language is well documented online for free?
>>
>>55801654
How do I git gud like you?
>>
>>55801654
>putStrLn
>not using IO
vomitchan.jpg
>>
>>55801668
i was born gud
>>
>>55801654
are you still doing that shit homework from yesterday?

why??
>>
Are there any distributed systems jobs in Finland?
>>
>>55801672
putStrLn is IO

>>55801677
No, that's the solution I gave him for Haskell
>>
REPOSTING FROM LAST THREAD:

http://sijinjoseph.com/programmer-competency-matrix/

ARE YOU A BAD ENOUGH DUDE?
>>
>>55801693
This just screams "THIS IS THE ONLY THING IM GOOD AT I'M GONNA MAKE COMPUTERS LOOK HARDER TO KEEP AWAY NOOBS".
>>
>>55801658
I think they are trophies more than anything. Like hey I learned X language and I have proof. Plus it displays interest to visitors to talk about.
>>
Anyone has good ideas for mathematical stuff to program?
>>
>>55801767
proof assistant
>>
How do I write a markov text generator?
I don't understand any of the articles on the topic.
>>
>>55801846

I'm think how it works is you store all the possible first words and then for each word you store words that could follow it and each potential option has a probability based on how common it is. So the next word is picked randomly from the choices available and more common words are more likely to be picked so it might make sense.

Once the system works you feed in tons of data so that the probabilities are sort of right and you might get sentences that make some sense.
>>
>rendering a total of 100 particle systems, each 100 textured particles totalling 10000 particles
>80fps on my shitty thinkpad

Graphics processors are just magic.
>>
>>55801846

I wrote a thue interpreter and modified that to also look at transition probability (instead of being completely random).

Then I just fed it a rule set.

Wew.
>>
trying to figure out how the internals of my """smart coffee maker""" so i can wire it up to a pi and make coffee whilst at my PC like the guy in the story did
>>
>>55801890
how big is the minimal data set for sentences that arent retarded do you reckon?
>>
>>55801983

Instead of replacing a billion years of mechanical knowledge with a computer, why not make coffee at your PC with a french press?
>>
>>55801997
I am lazy
I want to setup a job to make me a coffee every morning without having to do anything but refill it and place a new cup afterwards
>>
File: bjarne.jpg (23KB, 300x225px) Image search: [Google]
bjarne.jpg
23KB, 300x225px
Does anyone actually like Bjarne Stroustrup's writing style ?

How does it compare to other C++ books in your opinion ?
>>
>>55801995

No idea, but if you scrape a subreddit or an irc room or something then you'll have plenty of data
>>
>>55802068
reading "The C++ programming language" feels like trying to cram K&R allover again, except 5 times that.

I always preferred going to cplusplus.com and just reading about individual key and sometimes not so key features. After doing that for a long time, I just skimmed through the Stroustrup book and didn't learn anything new.
>>
>>55801574
Should I use github, gitlab or bitbucket? does anyone use github paid I'm not sure whether it's worth it just for private repos considering the other two provide it for free what do you guys think?
>>
>>55802242
Just use bitbucket if you need private repos.
>>
File: zzz.png (22KB, 718x256px) Image search: [Google]
zzz.png
22KB, 718x256px
>>55801846
Here's a really easy-to-follow article with sample code:
http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=745
>>
File: 1467148829726.jpg (41KB, 635x473px) Image search: [Google]
1467148829726.jpg
41KB, 635x473px
>that painful phase of learning a language where you know the common syntax but still have to look up which modules to import/what arguments their methods expect/etc. because you haven't memorized them yet
>autocomplete doesn't help because it's a scripting language with dynamic typing
>could write the shit in 1/4th the time in a language where you know the standard library but that would defeat the purpose
Is there anything worse?
>>
I need to geocode 200K physical addresses into lat/lng coordinates and my budget is 0.00 shekels. Google Maps API has a query limit of 2K requests per IP per day. In the past I was able to get a huge list of free proxy servers from the internet and feed it to my script that would basically rape the fuck out of Google servers with parallel proxified requests. Now, however, it seems like Google blocks 99.99999% of proxies. Wat do?
>>
File: oh wow.png (924B, 172x26px) Image search: [Google]
oh wow.png
924B, 172x26px
>>55802451

Truly markov chains are divine providence.
>>
>>55802485
>Is there anything worse?
Yeah, this one time I got arrested in Beijing when I was so drunk I didn't know what species I was. I got beat up and yelled at in Mandarin for like 9 hours straight as I sobered up very slowly.

That was probably much worse.
>>
>>55801574
>anime poster
>>
File: Screenshot_2016-07-28_23-44-22.png (23KB, 578x222px) Image search: [Google]
Screenshot_2016-07-28_23-44-22.png
23KB, 578x222px
Go is fun.
>>
What's the best book for learning C++?
>>
>>55802883
full code pl0x
>>
>>55802718
>see something he dislikes
>goes into the thread
>types a reply
>solves a captcha
>all because he saw anime
man life must suck being triggered this easily
>>
How do you abbreviate 'number'?

I often have variables that contain "number" but not sure how how to abbreviate. I've seen the following:

num_elements
number_elements
nmb_elements
no_elements
nb_elements


I personally see only the first 2 as valid options, but is there any standard or something? Advice pls
>>
>>55803118
n_elements
>>
File: 1.png (47KB, 220x272px) Image search: [Google]
1.png
47KB, 220x272px
>>55801574
gtfo with your fucking weeaboo shit
why the hell you can't put normal image
>>
>>55803118
>
no_elements


I would take access away from you from the repo and report you to GitHub
>>
>>55803132
Why the hell can't you ask a question?
>>
>>55803130
That... makes sense. Thanks

#mindblown
>>
>>55803132
To keep away newfaggots like you.
>>
>>55803132
reminds me of rotten.com
>>
>>55803118
elem_count
elem_num
>>
>>55803118
n_elements
>>
>>55803113
but he's right, stop posting stupid shit that's completely unrelated to programming or technology

there are other boards for that shit
>>
>>55803160
That also makes sense... Prefixing it with `elem` so I have all variables that pertain to `elem` starting with the same prefix.

Naming is so difficult
>>
>>55802162
>cplusplus.com
>not cppreference.com

nigga please
>>
>>55802151
>subreddit
He asked for non-retarded sentences, anon.
>>
File: UeiouSO.png (496KB, 1916x993px) Image search: [Google]
UeiouSO.png
496KB, 1916x993px
>Power BI

Neat.

Going to look at embedding this into something.
>>
>>55801593
me :3
>>55801693
the scoring is pretty cringey
>>
>>55803239
cppreference.com always felt harder to understand. Except for rare cases like std::function.
>>
>>55803118
I like the 'count' suffix. Fits in neatly with other suffixes:

elem_count
elem_index
elem_byte_size
>>
>>55803273

Interdasting.
>>
>>55803239
cplusplus.com is the one with the tutorial

it's pretty cool an short, it even teaches polymorphism in an accessible way
>>
>>55803118
>Keras library
>
model.fit(X_train, Y_train, nb_epoch=5, batch_size=32)


Why the fuck did they use nb_epoch instead of epoch_num when they use batch_size later sm.h
>>
File: 2016-07-28_16-22-24.webm (2MB, 1452x848px) Image search: [Google]
2016-07-28_16-22-24.webm
2MB, 1452x848px
>>55803360
Indeed.

Obviously my HTML parsing needs some work, but I did this in like 20 minutes.
>>
>>55803088
That actually introduced a race condition, so I scrapped it. The problem I have is bunch of goroutines waiting in something like
select {
case allocate <- img:
// Finish up
case <-time.NewTimer(time.Minute).C:
// Bail and clean up
}

Then I have clients that have to somehow find their goroutine before it times out, receive from it and do so without race conditions. Mulling this over.
>>
>>55802883
>it's
>>
>>55803599
He's right though anon, it is data
>>
What is the algorithm to get a gf? I can't figure it out!
>>
>>55803651
import Control.Monad
liftM2 (+) You GF
>>
>>55803651
It's not computable on a turing machine
>>
>>55803651
okcupid
>>
>>55803833
Well, OkCupid has APIs, so I guess you could write an algorithm to aid in finding a gf.
>>
Scratching my head so hard right now, QEMU emulates a PCI system where a generic VGA card (bochs) is added, OVMF firmware can see it and enable it but when I try to enable the device myself using assembly or enabling from linux it doesn't make itself available in the memory areas for PIO and MMIO, I am starting to think of quitting this and going back to webdev lol
>>
I tried to read K&R. And I got completely lost at only the second example! I've never programmed before. I can only Hello World in C. Is there somewhere else I should learn it? Should I learn another language first instead and go back to K&R once I have experience?
>>
>>55803911
dump that book and look for advanced C tutorials online, I recommend the GNU C reference manual, the people that recommend it want to be like their big bros on /g/
>>
>>55803911
C isn't a bad first language to learn if you are young. I would stick with it, re-read the pages you don't understand until you understand them, then ask questions if you are still stuck.
>>
File: 1468852032551.jpg (94KB, 579x329px) Image search: [Google]
1468852032551.jpg
94KB, 579x329px
>>55803976
>if you are young
Is 20 years old considered young?
>>
#!/bin/bash
# stats.sh
# needs lm_sensors

CPU_TEMP=`sensors | sed -n 's/Physical id 0:.*+\([0-9A-Z\.\°]*\).*(high.*$/\1/p'`
MEM_USED=`free -m | sed -n 's/Mem:[\t ]*\([0-9]*\)[\t ]*\([0-9]*\).*$/\2\/\1/p'`
WEATHER=`curl --silent 'http://wttr.in/London' | head -7`

echo "CPU temp: ""$CPU_TEMP"
echo "MEM: ""$MEM_USED"
echo "$WEATHER"

exit 0


i made a cool little script :)
>>
>>55804013
Sure.

You might want to look into C Programming: A Modern Approach. K&R sorta assumes some familiarity with programming, so it might go too quickly for a complete beginner.
>>
>>55804031
i ain't runnin dat
>>
>>55804050
I'm not >>55803911 but still, thank you.
I remember I struggled a lot with The C Programming Language a couple of months ago, so I'll definitely check that out.
>>
I have been programming for a year and a half when do you get good?
>>
>>55804121
When you get a job or work on a team and actually have to meet deadlines.

Expertise is born from necessity. Someone has to plop something totally weird in front of you and say "Figure it out."

If you've been writing FizzBuzzes and shitty little personal utilities for a year and a half, you might as well have been standing still.
>>
File: BATTERING RAM.jpg (27KB, 399x348px) Image search: [Google]
BATTERING RAM.jpg
27KB, 399x348px
Okay so I'm writing a recursive search function that iterates through a filesystem from a specified beginning path and examines .mp3 file ID3 tags. It then moves those files into specific folders it creates, named for the artist name found in the ID3 tag. I'm doing this in Python.

My original attempt iterated through the filepath using a for loop around os.path.listdir() and then os.path.isfile() and os.path.isdir() as conditional statements inside it, but I've just run across os.walk(). I see that os.walk() is a recursive search function that iterates through the file system and returns a list of all the files in it.

Can someone here with experience in Python please tell me that I didn't just spend a few hours replicating a core feature in the python os library? Because that's what it's looking like. Fuck.
>>
>>55804172
>When you get a job or work on a team and actually have to meet deadlines.
No.
>>
>>55804172
>tfw i have been standing still for 10 years
>>
>>55804172
the most complicated thing I wrote was an entire database application as a grocery store inventory
>>
anyone have ideas for a cool project?
>>
>>55804241
Make it OSS so I can help.
>>
>>55804241
Write a 4chan scraping script and connect it to a rasberri pi hooked up to an anal vibrator. Whenever you get a (you) the vibrator will massage your prostate for 5 seconds.
>>
>>55804194
>for loop
>recursive

No

Write your own function that does this recursively, you might learn something.
Hint: use tail recursion
>>
First day on job, boss just asked me for a CRUD that work with mysql and accesible entirely by web, what to do?
>>
>>55804031
why `commmand` instead of $(command)?
>>
File: 2016-07-28_17-19-59.webm (165KB, 524x270px) Image search: [Google]
2016-07-28_17-19-59.webm
165KB, 524x270px
I just accidentally an entire /g/
>>
>>55804351
Make it.
>>
>>55804351
>CRUD
which language
>>
>>55804351
Write a CRUD that works with mysql and is accessible from the web, then.

Why the fuck are you asking this here?
>>
I have a bunch of programming projects on my netbeans should I make a github and upload them all?
>>
>>55804508
Do it and post link.

We won't bully.
>>
>>55804346
>>55804346
I mean yeah I'm trying to do that right now. I've never written a recursive search function before and this is my first attempt. Can you explain why iterating through with a for loop is wrong? I feel like with nested directories it should be fine to go:

def search():
for x in filepath:
if x is file:
do something
elif x is dir:
search(x)
>>
>>55804351
Is your boss cute?
>>
>>55804525
>We won't bully.

...Yes. We will not bully this person.
>>
>>55804534
so much <3
>>
>>55804375
no particular reason
>>
>>55804533
that's not recursion my friend
that's a for-each loop

if you know math it's the difference between
factorial (n) = (big pi symbol) i for i = 1 to n
and
factorial (n) = n * factorial (n - 1)
factorial (1) = 1
>>
Is pythonic just code for "I have no idea what I'm talking about"
>>
>>55804663
More like "I can't be assed to read a one-liner"
>>
>>55804640
Oh I thought recursion was just when a function called itself? Guess that's not the case. Sorry, I'm a self-taught NEET.
>>
>>55804640
>not recursion

>def search():
>...
> search()
>>
How would I go about learning x64 assembly? Any books, websites or online courses?
>>
how can i read a line of numbers to a list in python?

Input:
1 2 3 4 5


a = input().split("")



doesn't work
>>
File: Screenshot_2016-07-29_02-09-43.png (47KB, 578x580px) Image search: [Google]
Screenshot_2016-07-29_02-09-43.png
47KB, 578x580px
>you can stack arrow operators to synchronise more than one goroutine
Go still fun.
>>
>>55805136
>>> a = input().split("")
1 2 3 4 5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: empty separator
>>> a = input().split(" ")
1 2 3 4 5
>>> a
['1', '2', '3', '4', '5']
>>> a = input().split()
1 2 3 4 5
>>> a
['1', '2', '3', '4', '5']
>>>
>>
>>55805136
nums = [int(x) for x in input().split(" ")]
>>
>>55804741
no, what you posted is recursion. though the search function needs an input var, but I take it you already realize that
>>
can anyone get good at programming?
>>
Could someone review my c# async socket code.

The class is supposed to connect to some hostname:port and then receive messages that are delimited by null characters.

public class TcpSocketConnectAndReceive
{
private readonly string _hostname;
private readonly int _port;
private readonly Socket _socket;
private const int BUFFER_SIZE = 1024;

public readonly Queue<string> Events = new Queue<string>();

public TcpSocketConnectAndReceive (string hostname, int port)
{
_hostname = hostname;
_port = port;

_socket = new Socket(
AddressFamily.InterNetwork,
SocketType.Stream,
ProtocolType.Tcp
);
}

class SocketState
{
public Socket Socket;
public byte[] bytes = new byte[BUFFER_SIZE];
public List<char> cache = new List<char>();
}

public void Connect()
{
_socket.Connect(_hostname, _port);

var state = new SocketState ();
_socket.BeginReceive (
state.bytes,
0,
state.bytes.Length,
SocketFlags.None,
new AsyncCallback (BeginReceive_Callback),
state);
}

public void BeginReceive_Callback(IAsyncResult ar)
{
var state = (SocketState)ar.AsyncState;

var numberOfBytes = state.Socket.EndReceive (ar);
if (numberOfBytes > 0) {
var receivedBytes = state.bytes;
var receivedText = Encoding.UTF8.GetString (receivedBytes);
foreach (var c in receivedText) {
if (c == char.MinValue) {
// messages are terminated by null characters
// concatenate the cache into the expected message
var message = string.Join (string.Empty, state.cache);
// add the message to the queue
Events.Enqueue (message);
// clear the cache
state.cache.Clear ();
} else {
// add the character to the cache
state.cache.Add (c);
}
}
}
// socket is empty, keep reading
state = new SocketState ();
_socket.BeginReceive (
state.bytes,
0,
state.bytes.Length,
SocketFlags.None,
new AsyncCallback (BeginReceive_Callback),
state);
}
}
>>
>>55802023
There's already coffee makers that are programmable. I don't use that function since I don't wanna leave the coffe outside all the night (muh smell.)
>>
>>55805638
Are those functions exception safe? If not, handle them.
>>
File: 5697892431.jpg (14KB, 480x360px) Image search: [Google]
5697892431.jpg
14KB, 480x360px
>25 years old
>work in construction
>been learning programming and reading SICP/algorithm books on the side
>want to get a CS degree
>tell people this and they laugh and think I'm crazy

Is there any hope? If I'm doing this shit when I'm 30 I'll probably die from a steel reserve and fentanyl cocktail
>>
>>55805718
It's more the structure I'm concerned with.

Is calling BeginReceive_Callback within BeginReceive_Callback an acceptable way to receive data forever?
>>
>>55805739
learning programming is easy
>>
>>55805739
Follow you're dreams, anon.
>>
>>55805757
>>55805765

Who is going to hire some 30 year old new grad with blue collar experience when they could hire some autistic genius savant whose been programming since age 8 or singh bindar who works for minimum wage
>>
>>55805739

They just don't want you to get out of construction, because it means they could, too.

They are suffering from an internal crisis.
>>
>>55805739
I learned programming at 21 failed then succeeded at 25 learning it and made money from doing so programming religiously if I can do it a retard you can do it too
>>
>>55805793
Because there are only so many autistic geniuses available and they all want 200k starting, and singh bindar doesn't comment his code and only replies to emails at 2 am. Sometimes people want to hire a reliable employee that lives locally.
>>
>>55805793
Companies don't want to hire autists
>>
tb.h why do we write parsers rather than use editors that always create valid parse trees?

i mean, binary parsing is one thing, but parsing programming languages seems like academic mental masturbation
>>
>>55805954
I don't quite understand what you mean, how would the editor create the parse tree from text without a parser?
>>
File: Flonne.full.1795985.jpg (795KB, 1168x1665px) Image search: [Google]
Flonne.full.1795985.jpg
795KB, 1168x1665px
This fucking MVVM pattern is kinda hard to grasp, since is highly decoupled it's difficult to see the connections and relations between templates/bindings. I'm not giving up to this shitter.
>>
>>55805739
I used to know this really cool guy who worked in construction. He was in his mid 50s and all he did in his free time was programming. He was really into open source software and always contributed as much as he could to the OSS community.

He never actually pursued programming as a career but he was extremely good at it and had like 30 years of experience doing it. He told me he could never actually talk with other people at work about it because no one cared or knew anything about it, but the construction company was his family's and he didn't want to let that go.
>>
>>55805739
I'm 25 years old with a partially completed CS degree. Going back in a month so I can finish it and move on with my life. I think it's a good time to go. When I was in before I knew a lot of people who were older students in their late 20s or early 30s.
>>
>>55806009
i forgot to say i suck cocks
>>
File: contemporary-coffee-makers.jpg (19KB, 326x410px) Image search: [Google]
contemporary-coffee-makers.jpg
19KB, 326x410px
>>55802023
There are programmable electric switches that can be turned on/off with an arduino. You could use one of those, and hook up an electric stove to it (that is turned on, obviously), and put pic related on it (of course it's not safe, but who cares?).
>>
>>55802068

He aims for an "academic style", which is why he uses a Roman font for code samples instead of something like courier.

As a tutor, I've actually found his books rather difficult to use as lesson material - not for lack of actual material, but because students just see a wall of text without any colorful syntax or pictures. For all they care, I might as well have them try reading about abstract algebra...
>>
Hi guys my name Pajeet why u make fun?
>>
>>55806259
I'm Rajesh. how are you?
>>
File: 1377563505468.gif (590KB, 300x254px) Image search: [Google]
1377563505468.gif
590KB, 300x254px
I need to write a recursive decent parser for gcode but I'm a total noob when it comes to parsers. I wrote a shitty white space delimited regex parser but it won't do because I'm trying to add meta programming syntax to the gcode grammar that can define and operate on variables. Where is the best place to learn about recursive decent parsers??
>>
>>55806297
good write Java code and you?
>>
Show me your vim config: https://gist.github.com/anonymous/c1f81b0c258f3ce37bb8ddf34caf065a
>>
>>55806337
implement the parser monad
>>
>>55806337
http://effbot.org/zone/simple-top-down-parsing.htm
>>
>>55805993
I've thought about it for a bit so I'll try to explain it more.

Basically, you can only type according to rules specified by the editor.

You'd hit certain hotkeys to insert different syntax elements (for example, an if-statements, while loops, etc) wherever the cursor is.

Then you can navigate between the various sub-nodes of the inserted node, and either insert raw text (if that node allows it) or further sub-nodes for nested expressions/statements.

The cursor points only at a given ast node (e.g. the cursor could select an entire if-statement, or it could select one of the branches of the if-node, etc.), and only in certain positions could you type in raw text.


To save the file, output some language-specific ast format rather than the raw text

Another possibility would be something like a picked ast object for
python, which encodes literal instructions for the python vm to recreate the object
>>
>>55806259
Hello, my name is Prateek. I like programming in Java. It is very fun and good job in my country. My family sent me to American university when I was younger. This was to my benefit and I now make $5 USD an hour with Java. It is very comfortable life, I suggested it to my friends and family. They plan to do it too!
>>
>>55806358
filetype off
filetype plugin on
filetype plugin indent on

syntax on

set nocompatible
set encoding=utf8
set mouse=a
set nohlsearch
set modeline
set number
set ruler
set cursorline
set showmode
set showcmd
set nobackup
set noswapfile
set backspace=2
set wildmenu
set wildmode=longest,full,list
set laststatus=2
set t_Co=256
set statusline=%<%f\ %h%m%r\ %y%=%{v:register}\ %-14.(%l,%c%V%)\ %P

let loaded_matchparen=1

colorscheme jellybeans
>>
>>55806373
This is great and this is how Capitalism benefits every country
>>
>>55806337
what's gcode?

also just read the wikipedia article on recursive descent, it makes the idea pretty obvious.

tb.h i'd avoid writing a parser by hand because i'm this guy (>>55805954 , >>55806372)
and i don't like writing parsers.
>>
>>55806372
So it's a mix between scratch, intellisense, and Starcraft?
>>
>>55806409
scratch as in the language?

i guess very very roughly

how is it like starcraft?
>>
>>55806385
Pretty minimalist. How do you get by without mapping the window navigation commands? <C-W><C-J> is terrible.
>>
>>55806424
I misread it, I was thinking the mouse cursor and started imagining people trying to improve their KPM and mouse accuracy slamming the hotkeys to place syntax elements at the highest speed.
>>
File: Screenshot - 290716 - 01:41:24.png (27KB, 621x586px) Image search: [Google]
Screenshot - 290716 - 01:41:24.png
27KB, 621x586px
>>55806438
i don't.
I use sublime text mostly and use vim only when i want to edit small config files or write small pieces of code.

pic related is what my vim looks like
>>
>>55806358
ayy
(let ((file-name-handler-alist nil))
(set 'gc-cons-threshold 100000000)
(run-with-idle-timer
5 nil
(lambda ()
(setq gc-cons-threshold 1000000)
(message "gc-cons-threshold restored to %S"
gc-cons-threshold)))
(require 'cl)

;; AUTO-generated CUSTOMIZATIONS go in ".emacs-custom.el"

(setq custom-file (concat user-emacs-directory ".emacs-custom.el"))
(load custom-file 'noerror)


(add-to-list 'load-path (concat user-emacs-directory "emacs lisp/"))

(load "erc-settings.el")
(load "org-settings.el")
(load "adoc-mode.el")
(load "package-settings.el")

(load "lisp-settings.el")
(load "ergoemacs-settings.el")
(load "forth-settings.el")
(load "erlang-settings.el")
(load "persistent-scratch.el")

(require 'helm-config)
(helm-mode 1)


(add-to-list 'custom-theme-load-path (concat user-emacs-directory "themes/"))
(load-theme 'zenburn)


(load "linum+.el")
(autoload 'linum-mode "linum" "toggle line numbers on/off" t)
(global-set-key (kbd "C-<f5>") 'linum-mode)


(global-set-key (kbd "C-c <left>") 'windmove-left)
(global-set-key (kbd "C-c <right>") 'windmove-right)
(global-set-key (kbd "C-c <up>") 'windmove-up)
(global-set-key (kbd "C-c <down>") 'windmove-down)
(global-set-key (kbd "C-f") 'er/expand-region)

(eshell)
(put 'downcase-region 'disabled nil)

(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
(add-to-list 'auto-mode-alist '("\\.erl$" . erlang-mode))

(add-to-list 'auto-mode-alist '("\\.py$" python-mode indicators-mode))


(add-hook 'python-mode-hook (lambda ()
(flymake-mode t)
(indicators-mode t)))


(setq ring-bell-function 'ignore)
(setq indent-tabs-mode nil)
(setq tab-width 4)
(require 'nimrod-mode)
(require 'indicators)

(load-persistent-scratch)
(set-buffer "*scratch*")
(push #'save-persistent-scratch kill-emacs-hook))

>>
Alright who wants to create a better operating system than Linux and make a better organization than Microsoft? Who is with me!
>>
/g/entoomen, I want to make yet another window manager that does exactly what I need and nothing more, help me pick a retarded name for it.

The name retarded is already taken on my github by another retarded project, so pick something else.
>>
>>55806503
I'll make the logo!
>>
>>55806503
I'll do the kernel with C#.
>>
>>55806506
wintard
>>
>>55806503
I'll do the networking in JavaScript.
>>
>>55806503
Ether
>>
>>55806503
I'll do the graphics in Alice
>>
>>55806370
Thanks anon!

>>55806404
Gcode is used to program CNC machine motion, for example:

G00 X100 Z50 Y50 //rapid motion
G01 X00 Z100 Y00 //linear interpolation
G18 G02 X100 Z00 R50 //clockwise arc on XZ plane

There are heaps of gcode parsers already out there but I want to add a syntax that lets me calculate coordinates on the fly so I'm going to have to bite the bullet and git gud.
>>
>>55806498
Ah, that makes more sense. I've been using vim more and more for everything since I started using it for work, and I'm really enjoying it.

I'm sure many of these have equivalent plugins in Sublime (which is my second-most-used editor, hence the molokai vim theme), but you should check out undotree in particular. Combining it with persisent undo history (which achieves a similar goal to hot exit in Sublime), it has really made a positive impact on my productivity, working like a meta-VCS between commits.

Being able jump back to a version of a function from a few minutes ago, copy some text, jump back, then paste it (without worrying about overwriting my history) is great.
>>
File: 1441738337660.jpg (52KB, 689x708px) Image search: [Google]
1441738337660.jpg
52KB, 689x708px
>>55806566
>>55806577
ok you two are in
>>
>>55806595
> There are heaps of gcode parsers already out there but I want to add a syntax that lets me calculate coordinates on the fly so I'm going to have to bite the bullet and git gud.

what do you mean?
do you want to calculate coordinates based on previous parts of the gcode program?

don't write a parser, write a simple code generator.

you can do that in any language.
>>
So I'm learning python and one project is a random name picker now I have this
import random

name = ( "jay" , "luis" , "bob" , "sofi", "susan" )

x = random.sample(name,input( "please enter the number of volunteers needed" ))
print x

But I'm wondering is there anyway to make it so the user enters the names via an input?
>>
>>55806600
My issue with vim , is that , to look nice, you need to install a bunch of plugins and Vundles and whatnot

I like vim , but i prefer sublime
>>
File: 1442980022547.jpg (11KB, 250x241px) Image search: [Google]
1442980022547.jpg
11KB, 250x241px
>>55801654
>let to = (,) in [USD `to` EUR, EUR `to` USD]
holy shit lmao. typical braindead weeb
>>
>>55806651
what's the joke here?
>>
>>55806651
it's called readability senpai
>>
>>55806647
yes there is a way to do that

google it
>>
>>55806503
>>55806524
>>55806538
>>55806551
>>55806566
>>55806577
alright guys I will start it and make the kernel

#include <stddef.h> //we can use it: it doesnt use any platform-related api functions
#include <stdint.h> //include it to get int16_t and some integer types

/* Hardware text mode color constants. */
enum vga_color
{
COLOR_BLACK = 0,
COLOR_BLUE = 1,
COLOR_GREEN = 2,
COLOR_CYAN = 3,
COLOR_RED = 4,
COLOR_MAGENTA = 5,
COLOR_BROWN = 6,
COLOR_LIGHT_GREY = 7,
COLOR_DARK_GREY = 8,
COLOR_LIGHT_BLUE = 9,
COLOR_LIGHT_GREEN = 10,
COLOR_LIGHT_CYAN = 11,
COLOR_LIGHT_RED = 12,
COLOR_LIGHT_MAGENTA = 13,
COLOR_LIGHT_BROWN = 14,
COLOR_WHITE = 15,
};

uint8_t make_color(enum vga_color fg, enum vga_color bg)
{
return fg | bg << 4;
}

uint16_t make_vgaentry(char c, uint8_t color)
{
uint16_t c16 = c;
uint16_t color16 = color;
return c16 | color16 << 8;
}

size_t strlen(const char* str)
{
size_t ret = 0;
while ( str[ret] != 0 )
ret++;
return ret;
}

static const size_t VGA_WIDTH = 80;
static const size_t VGA_HEIGHT = 24;

size_t terminal_row;
size_t terminal_column;
uint8_t terminal_color;
uint16_t* terminal_buffer;

>>
>>55806678
>>55806679
he could have just written
let conversions = [(USD, EUR),
(EUR, USD)]
>>
>>55806685
What would I google? multiple inputs in python? I'm self teaching so I don't really know the language to use
>>
>>55806691
void terminal_initialize()
{
terminal_row = 0;
terminal_column = 0;
terminal_color = make_color(COLOR_LIGHT_GREY, COLOR_BLACK);
terminal_buffer = (uint16_t*) 0xB8000;
for ( size_t y = 0; y < VGA_HEIGHT; y++ )
{
for ( size_t x = 0; x < VGA_WIDTH; x++ )
{
const size_t index = y * VGA_WIDTH + x;
terminal_buffer[index] = make_vgaentry(' ', terminal_color);
}
}
}

void terminal_setcolor(uint8_t color)
{
terminal_color = color;
}

void terminal_putentryat(char c, uint8_t color, size_t x, size_t y)
{
const size_t index = y * VGA_WIDTH + x;
terminal_buffer[index] = make_vgaentry(c, color);
}

void terminal_putchar(char c)
{
terminal_putentryat(c, terminal_color, terminal_column, terminal_row);
if ( ++terminal_column == VGA_WIDTH )
{
terminal_column = 0;
if ( ++terminal_row == VGA_HEIGHT )
{
terminal_row = 0;
}
}
}

void terminal_writestring(const char* data)
{
size_t datalen = strlen(data);
for ( size_t i = 0; i < datalen; i++ )
terminal_putchar(data[i]);
}

void kernel_main()
{
terminal_initialize();
terminal_writestring("wellcome to my first operating system!");
for(;;);
}



okay kernel is done
>>
>>55806691
this
enum vga_color
{
COLOR_BLACK = 0,
COLOR_BLUE = 1,
COLOR_GREEN = 2,
COLOR_CYAN = 3,
COLOR_RED = 4,
COLOR_MAGENTA = 5,
COLOR_BROWN = 6,
COLOR_LIGHT_GREY = 7,
COLOR_DARK_GREY = 8,
COLOR_LIGHT_BLUE = 9,
COLOR_LIGHT_GREEN = 10,
COLOR_LIGHT_CYAN = 11,
COLOR_LIGHT_RED = 12,
COLOR_LIGHT_MAGENTA = 13,
COLOR_LIGHT_BROWN = 14,
COLOR_WHITE = 15,
};


is the same as this
enum vga_color
{
COLOR_BLACK,
COLOR_BLUE,
COLOR_GREEN,
COLOR_CYAN,
COLOR_RED,
COLOR_MAGENTA,
COLOR_BROWN,
COLOR_LIGHT_GREY,
COLOR_DARK_GREY,
COLOR_LIGHT_BLUE,
COLOR_LIGHT_GREEN,
COLOR_LIGHT_CYAN,
COLOR_LIGHT_RED,
COLOR_LIGHT_MAGENTA,
COLOR_LIGHT_BROWN,
COLOR_WHITE,
};
>>
>>55806730
your post and shit are the same too
>>
>>55806714
what do you want really?

asking a bunch of names to the user? is that it?

and after that?
>>
>>55806714
being able to use google to figure shit out is an actual skill and one necessary for programming at that

so you'll suffer on your own now but that way you'll learn something
>>
>>55806625
Yeah I'm also working on a kind of gcode generator that lets me draw a tool path on a 3d model of a material and execute the gcode, but I think using expressions as coordinates in the gcode would come in handy, for example:

(a = 150, b = 20)
G00 X(a / b) Y(a * b) Z(b + a)

So that it evaluates the expressions in parentheses to produce coordinates!
>>
>>55806738
from 1 to butthurt, how ass pained are you?
>>
File: 1457274399165.jpg (44KB, 544x529px) Image search: [Google]
1457274399165.jpg
44KB, 544x529px
>>55806750
>being able to use google is a skill
>>
>>55806744
Asking the user for names then picking one at random
>>
>>55806763
just shitposting at work senpai

>>55806762
that's literally what you want to do man

i'd personally do something like
(let ((a 200) (b 200))
(g00 :x (/ a b) :y (* a b) :z (+ b a))
...)

because i'm a lisp fag but also because processing that kind of syntax is easy as fuck
>>
>>55806781
python 2.7
from random import choice
print "enter your names:" # enter the names in one line separated by a white space
names = raw_input().split()

print choice(names)

>>
Alright... I made a semi-functional version of this... But I'm not really happy with the result. It took a lot more time "drawing" the characters than actually doing the program

std::string rowOneArray[26] =
{// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
"\t", " _" ," _", " _", " _", " _", " __", "", "___", "\t", "\t", "\t", "\t", "\t", " _", " _", " _", " _", " __", "___", "\t", "\t", "\t", "\t", "\t", "__"
};
std::string rowTwoArray[26] =
{// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
" /\\", "|_)", "/", "| \\", "|_","|_ ", "/__", "|_|", " |", " | ", "|//","|" , "|\//|", "|\\ |" ,"/ \\","|_)", "/ \\", "|_)", "(__", " |", "| |", "\\ /","\\ /","\\/", "\\_/", "/"
};
std::string rowThreeArray[26] =
{// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
"/--\\", "|_)", "\\_", "|_/", "|_", "| ", "\\_|", "| |", "_|_","\\_|", "|\\", "|_" , "| |", "| \\|" ,"\\_/","|", "\\_X", "| \\", "__)", " |", "|_|", "\\/"," \\A/","/\\", " |", "/_"};


void printLetter(std::string inputString);

int main(int argc, const char * argv[]) {

printLetter("ENDOFTHEWORLD");
return 0;
}


void printLetter(std::string inputString)
{
for(int i = 0; i < inputString.length(); i++)
{
std::cout << rowOneArray[inputString[i]-'A'] << "\t";
}
std::cout << std::endl;
for(int i = 0; i < inputString.length(); i++)
{
std::cout << rowTwoArray[inputString[i]-'A'] << "\t";
}
std::cout << std::endl;
.
.
.
}
>>
>>55806650
I agree that the vim defaults are terrible, both in terms of usability and style. Neovim is a bit better, but still not great.

That said, you probably have Package Control installed for Sublime, which is about as difficult as installing Plug for vim (ie, a single call to curl).

The difference is that the rest of the configuration is done via text files in a domain-specific language rather than GUI + JSON.
>>
>>55806895
Forgot to say that it's supposed to be a String-To-Ascii Art converter...
>>
>>55806764
this kind of comment would lead me to believe that you don't have any experience in the "real world", where being proficient at using a search engine or the internet in general as a resource to help you solve problems is a thing, and working with people in the general populace would show you how many of them aren't able to do this
>>
>>55801654
what editor is this? It looks absolutely gorgeous
>>
>>55806926
Looks like Atom, but I can't say for sure
>>
>>55806926
Atom
>>
>>55806907
#include <iostream>

std::string rowOneArray[26] = {
"\t", " _" , " _", " _", " _", " _", " __", "", "___", "\t", "\t",
"\t", "\t", "\t", " _", " _", " _", " _", " __", "___", "\t", "\t", "\t",
"\t", "\t", "__"
};
std::string rowTwoArray[26] = {

" /\\", "|_)", "/", "| \\", "|_", "|_ ", "/__", "|_|", " |", " | ",
"|//", "|" , "|\//|", "|\\ |" , "/ \\", "|_)", "/ \\", "|_)", "(__",
" |", "| |", "\\ /", "\\ /", "\\/", "\\_/", "/"
};
std::string rowThreeArray[26] = {
"/--\\", "|_)", "\\_", "|_/", "|_", "| ", "\\_|", "| |", "_|_", "\\_|",
"|\\", "|_" , "| |", "| \\|" , "\\_/", "|", "\\_X", "| \\", "__)", " |",
"|_|", "\\/", " \\A/", "/\\", " |", "/_"
};

void printLetter(std::string inputString)
{
for (int i = 0; i < inputString.length(); i++) {
std::cout << rowOneArray[inputString[i] - 'A'] << "\t";
}
std::cout << std::endl;
for (int i = 0; i < inputString.length(); i++) {
std::cout << rowTwoArray[inputString[i] - 'A'] << "\t";
}
std::cout << std::endl;
}

int main(void)
{
printLetter("ENDOFTHEWORLD");
return 0;
}

>>
>>55806857
any idea how to do it in python 3?
>>
>>55806987
Almost the same. Read the docs.
>>
>>55806987
https://docs.python.org/2/library/2to3.html
>>
>>55806987
in python 3, print is a built-in function
the print function is different, and you don't need raw_input


from random import choice
print ("enter your names:") # enter the names in one line separated by a white space
names = input().split()

print (choice(names))

>>
>>55806967
Oh. that's embarassing... At first, the fill code of "printLetter" didn't fit, so I had to remove some parts of it.. The full "printLetter" is...
void printLetter(std::string inputString)
{
for(int i = 0; i < inputString.length(); i++)
{
std::cout << rowOneArray[inputString[i]-'A'] << "\t";
}
std::cout << std::endl;
for(int i = 0; i < inputString.length(); i++)
{
std::cout << rowTwoArray[inputString[i]-'A'] << "\t";
}
std::cout << std::endl;
for(int i = 0; i < inputString.length(); i++)
{
std::cout << rowThreeArray[inputString[i]-'A'] << "\t";
}
std::cout << std::endl;
}
>>
>>55806999
>>55807000
>>55807017
thanks
>>
>>55807027
void print(std::string inputString, std::string array[26])
{
for (int i = 0; i < inputString.length(); i++) {
std::cout << array[inputString[i] - 'A'] << "\t";
}
std::cout << std::endl;
}
void printLetter(std::string inputString)
{
print(inputString, rowOneArray);
print(inputString, rowTwoArray);
print(inputString, rowThreeArray);
}
>>
File: 5.png (23KB, 1807x1080px) Image search: [Google]
5.png
23KB, 1807x1080px
>>55806812
I think extending gcode with minimalistic syntax is more appropriate than having the end user write lisp code (although now that you mention lisp, I'm thinking prefix notation is the way to go!). I'm going to add it to my CNC controller/viewer project. It's kind of like an extension to gcode that's easy for the user to understand (because a lot of gcode programmers don't know other programming languages, they could benefit from something like this).
>>
>>55807096
well yeah it would depend on users
but aiming for the lowest common denonimator will never get you anywhere anon
>>
>>55807056
I like how you got one answer of each level of helpfulness / spoonfeeding.
>>
>>55807103
lisp users are the lowest common denominator
>>
>>55807096
>>55807103
also, I didn't mean for it to actually be lisp, but s-expr based syntax. Doesn't need lisp semantics at all.
>>
>>55807121

M-expressions were superior.
>>
>>55807213
> were superior
yeah until people realized they didn't fuking exist and just kept writing s-exprs
>>
I'm about to start a small project using SQLite. Is it the best? What about postgresql or mysql?
>>
>>55807089
That's a much more elegant solution to the function than I was thinking!

But would it be possible to make it so I don't have to use three arrays? It seems kind of awkward/clunky to have to sort of draw each letter and space them correctly... I don't know if what I'm saying even makes sense anymore, but again, than, you for your help
>>
>>55807260
sqlite is fine when you need some persistent local storage and don't require fancy things like a separate server managing your database

It's better than dumping shit to a file.
>>
>>55807295
you could have only one array, and each position of the array would represent a letter.
then you only need to call one time the print function
>>
>>55807233

That's (((McCarthy)))'s fault.
>>
>>55807435
Everybody liked s-exprs so nobody ever bothered implementing m-exprs.
>>
>>55807435
Oy vey!
yes yes goy! hehe it's her fault!
>>
>>55807422
I tried thinking of doing that, but the problem would be that, because each ASCII letter occupies several lines, it would print one letter, and then the next below it... Oh well..
>>
>>55801574
So guys I'm going autism hypervision mode on Phoenix/elixir right now. Will there be jobs for it in the future?

For some reason I really like to get involved with the more obscure languages. Like I know I would be better off learning Go or Rails, but something about obscurity gets me rock hard
>>
>>55807455
Pure coincidence
>>
Is there an equivalent of Python's 'continue' in C++?
>>
>>55807544
yes.

continue
>>
>>55807544
>Is there an equivalent of Python's 'continue' in C++?
>an equivalent of Python's continue
>Python's continue
>in C++

You may as well have been asking if there's a Python-continue-like statement in C
>>
I'm writing a program that calculates the first 1,000 digits of pi iteratively.

I know there's a summation formula (pic related) that gives the nth digit of pi in hexadecimal, so all I would have to do is do a for-loop that does this 1,000 times. My main question would be how to do this math in hexadecimal. Would I have to create a 4-bit data type and work from there or could I use bitwise operations?
>>
Is there an equivalent of Python's 'break' in C++?
>>
>>55807593
Just calculate the number of decimal digits you need from the hex digit position and convert it?
>>
>>55807505
Elixir isn't obscure.
Check out lamdaprolog
>>
>>55807629
holy shit! thanks!
>>
>>55807629
Okay, this is definitely a step in teh right direction for me, but I'm still a bit lost:

Let's say a string of digits is 'A35'
If it's after the decimal point, this would be:

(10/16^n) + (3/16^n+1) + (5/16^n+2), and this doesn't necessarily equal the number of digits (I did the above calculation, and it appears each fraction in hex is approx. equal to 3-4 digits in dec)
>>
>>55807736
God that was so disjointed. Basically,
If it were .A35, which equals
.625 (1)
+.01171875 (2)
+00122070312 (3)

So I'm not sure what I can do (it looks like the leading digit is n-1 spaces away from the decimal, but I'm not sure how valid this is as you go on further)
>>
>>55804533
>>55804640
That's a recursive depth-first traversal. You may use loops in going through each neighbor of one node at the same level, but it's still recursive as it proceeds through different levels of the tree.
>>
>>55807736
>>55807773
>Tfw you guys are math gods

no idea what is going on
>>
>>55807606
Yes, continue.
>>
>>55807813
Lol, thanks, but I'm pretty much just as confused as you are. I'm just really bad at understanding hexadecmale
>>
File: 1465779880418.jpg (40KB, 657x527px) Image search: [Google]
1465779880418.jpg
40KB, 657x527px
>>55807736
>>55807773
What the fug
>>
>>55807736
Yeah, I realized that just doing binary or hex arithmetic might be easier right after I posted that suggestion
>>
https://github.com/phase/o/blob/master/o.c

JUST
>>
>>55807963
That is fucking disgusting. Kill yourself.
>>
i need this code to be faster. any ideas?
c = 0
for i in array:
if i in set_a:
c+=1
elif i in set_b:
c-=1
print c


Also, how to do this in less lines?
>>
File: slow and steady snek.png (31KB, 778x219px) Image search: [Google]
slow and steady snek.png
31KB, 778x219px
>>55808071
rewrite it in literally any other language
>>
>>55808122
it has to be in python, because it's a python course
>>
>>55808142
do what all good python users do and use """python""" libraries that are written in C
>>
>>55808166
but it has to be in python, because it's a python course
>>
>>55808177
if you're set on using python then you have no justification to complain about speed
>>
>>55807773
>>55807736
>>55807593
Okay, I have a function that does the summation and so far, it seems to be working. It works until number 255, after which the result is NaN, presumably because it's smaller than the smallest fraction in a double.
>>
>>55808286
Fuck... I'm too tired for this shit. Here's the code
        double sumVal = 0;
for(int j = 0; j < 260; j++)
{
float tempInt = j;
sumVal = (1./pow(16, tempInt)) * ( 4./(8*tempInt + 1) - 2./(8*tempInt +4) - 1./(8*tempInt + 5) - 1./(8*tempInt +6) );
double returnInt = pow(16, j) * sumVal;


std::cout << "AT " << j << " sum equals " << returnInt << std::endl;

}
>>
>>55808071
That's embarrassingly parallel, if the problem is big arrays not being in a hot loop you could parallelize. Note that Python is terrible at concurrency and parallelization.
>>
>>55808071
As for less lines:
c = sum((i in a for i in array)) - sum((i in b for i in array))
>>
>>55808071
that code is logically incorrect if you are trying to count the #elements in a - #elements in b
>>
>>55808297
why did you declair a tempint as a float and make it = to j?
>>
>>55808608
Originally, it was to make sure 1/pow(16, j) would be a float, but after some reading, I realized I'm using an incorrect version of the formula.

The correct version is derived from the one I was using, but whatever... I'll work more on this tomorrow
>>
>>55808664
did you realize you named it temp"INT"?
>>
>>55808710
I have absolutely no idea why I did that... I'm tired
>>
>>55808071
>C++ WINS AGAIN
>MEME LANGUAGES ON SUICIDE WATCH
>C++ WINS AGAIN
>MEME LANGUAGES ON SUICIDE WATCH
>C++ WINS AGAIN
>MEME LANGUAGES ON SUICIDE WATCH
>>
>>55808122
>C++ WINS AGAIN
>MEME LANGUAGES ON SUICIDE WATCH
>>
>>55808846
C++ IS a meme language
>>
>>55808071
a = set(array)
c = len((set_a - set_b) & a)
c -= len((set_b - set_a) & a)
c += len((set_a ^ set_b) & a)
>>
>>55808879

For you.
>>
File: 1368463813434.jpg (13KB, 250x241px) Image search: [Google]
1368463813434.jpg
13KB, 250x241px
>dynamic typing
>>
>>55809309
>typing
>>
>>55809309
...is not bad at all
>>
>>55808071
Use Haskell

wp xs a b = sum $ (++) [1 | x<-xs, elem x a] [-1 | x<-xs, elem x b]
wp [1..10] [1..5] [5..10]
>>
>>55809379
Lol implying that's fast
>>
what would be the best way to implement a GUI in C with just a simple grid and some sprites? on those grids?
>>
>>55808071
import numpy as np
c = np.intersect1d(array, set_a).size - np.intersect1d(array, set_b).size
>>
>>55809555
faster than Python, with or without -o3
>>
>>55809638
to add on to this - say for example I wanted to program a simple checkers game, with a GUI. Not being too fancy, just with a grid and some checkers. Should the checkers be "sprites"?

I don't know a goddamn thing about making GUIs.
>>
>>55801693
> Prolog
for literally what purpose?..

has some decent literature recs tho:
> Mythical Man-Month
> Thinking Forth
>>
>>55809555
time ./test
real 0m0.002s

time python test.py
real 0m0.018s
>>
>>55809689
everything is a sprite if you are using a gui
>>
>>55801693
makes me want to punch the author tbhfam
>>
What are some good options for graphics to learn?

I wanted to do OpenGL but my laptop only s-upports 2.1 down and I don't wanna be programming on my desktop a bunch.
>>
>>55809866
learn SDL.
>>
>>55809866
if you want to know what's actually going on,
write a 3d graphics renderer by hand
>>
>>55809957
Any resources on doing this?
>>
>>55809966
actually yes, hold on
>>
>>55809966
>>55809969
https://github.com/ssloy/tinyrenderer/wiki
>>
>>55809985
>https://github.com/ssloy/tinyrenderer/wiki
Thanks, I'll give it a read
>>
>>55801746
It's good to have a physical copy around, you know, to actually read and use as a quick reference. There are some that I actually keep in my bathroom as poopy time reading material. Most others I keep on my desk.

>>55801738
>>55809814
brainlets detected. lets face it - there's a pretty huge gap between the basic webdev / java CRUD code monkeys and highly skilled and knowledgeable software engineers. There's a need for the latter more than ever.
>>
>>55801574
i wrote a script that logs my master thesis updates, measures file size and puts a nice graph of my progress per day

and since i was busy making script and playing games, my master thesis still looks exactly same as yesterday

i have no idea what kind of technology can help with my escapism
>>
>>55810033
>brainlets detected.

A lot of things in the matrix are the author's opinions.
>>
Fucking hate this modularity meme, especially on Hackage

Need a million fucking packages to do anything
>>
>>55801574
I learned event delegation for dynamically generated UI for my interface to what will soon become the first superintelligence known to humankind
>>
>>55810487
Why didn't you just use arrows for functional reactive programming?
>>
>>55808875
>>55808846
No, Java and C# are the winners.

10% in performance is worth avoiding the brainfuck that is C++. And that overhead usually goes down further as programs get bigger.
>>
>>55810562
>brainfuck that is C++
theres no shame in admitting that you need your hand held

it seems like you "app" programmers all keep trying to say "forget about it!!!!" "who cares!!!" when faced with the unoptimized shit that "modern languages" are
>>
File: 1415508325937.jpg (21KB, 249x265px) Image search: [Google]
1415508325937.jpg
21KB, 249x265px
>>55810562
>brainfuck that is C++
>admitting you're a dumb shit
too comfy with your "garbage collector"?
>>
>>55810608
languages aren't optimized, implementations are
>>
>>55810617
>>55810608
>unoptimized shit that "modern languages" are
>dumb shit

> implying either of you knows how to program in anything
>>
>>55810658
I'm a game engine programmer

you still making a brainfuck interpreter like that dpt image told you to? I wonder how many of your classes has "Manager" in them.
>>
>>55810658
hows your app, kid
>>
>>55810562
They're only winners because the majority of computer science "Graduates" are too stupid to use anything else
>>
>>55810562
>And that overhead usually goes down further as programs get bigger.
wew lad, what is O(n)
>>
>>55810666
> I'm a game engine programmer
what's the deal, are you too stupid to learn the math of special relativity and work at CERN ? fucking dumb shit code monkey.

>>55810674
>>55810679
>>55810704
> I programmer now coz I wrote a college project
come back when you learn to value YOUR time and not just the processor time, unemployable little cunts.
>>
>>55810741
>this is what "modern language" kiddies believe

I guess they gotta defend that tuition they spent on trying to learn java
>>
New Thread:
>>55801574
>>55801574
>>
>>55810741
>unemployable
>is happy writing vastly subpar code

wew lad
>>
File: 1437331533756.jpg (2KB, 125x100px) Image search: [Google]
1437331533756.jpg
2KB, 125x100px
>>55810741
>>
>>55801574
I've been taking code auditing and pen testing classes these days. It's really helping me practice understanding largeish code bases.
>>
>>55810809
nice one, dudebro
there aren't spoilers on /g/ though, try a different board
>>
>>55810806
> never had a meaningful deadline in his entire life
clearly unemployable.
>>
>>55808071
(- (length (intersection array set-a))
(length (intersection array set-b)))
>>
File: speedcmp.png (21KB, 800x600px) Image search: [Google]
speedcmp.png
21KB, 800x600px
> C++ confirmed to be an ineffective and unproductive meme language for college projects

master java and get a good job in pretty much any field with half the effort, while you can learn other things in your free time

java also cures autism
>>
File: magic_hat.jpg (227KB, 3000x3000px) Image search: [Google]
magic_hat.jpg
227KB, 3000x3000px
>tfw you refactor code so many times it's nigh unreadable and beautiful at the same time
>>
>>55801654
post the problem spec and I'll outdo you using Javascript
>>
>>55810926
>College projects
>Shitty programmers no matter what language
>Literally half of the tasks C++ is still faster
>Other half are at worst 1/2 the speed
>At best C++ is 13 times faster

Get a better graph
>>
>>55810958
Javascript is impure though
>>
>>55810969
I'll do it without mutating data
>>
>>55810964
>>At best C++ is 13 times faster
no, that's java (smaller is better)

c++ fried your brain, man
>>
>>55810741
>come back when you learn to value YOUR time and not just the processor time, unemployable little cunts.
Those poor C++ devs, having to use libraries just to get anything done.

Oh wait.
>>
>>55810980
Will you contain IO within a monad?
>>
File: 1407037323477.gif (559KB, 400x276px) Image search: [Google]
1407037323477.gif
559KB, 400x276px
>>55810926
>C++ confirmed to be an ineffective and unproductive meme language for college projects

Look at him! Look at him and laugh!
>>
>>55810996
Some would argue monads aren't pure to begin with, in which case I don't see the big deal.
>>
>>55810991
just to do very basic stuff C++ devs have to use libraries that aren't part of the core language and change their syntax often
>>
>>55811014
Why did you care about mutating if you don't care about containing IO?
>>
>>55810926
this is how mad you made this "modern language" kid dude hes scared for his career
>>
>>55811029
>Boohoo C++ devs don't have a shitload of bloat included by default
>>
>>55810926
Stop now while you're behind.
>>
>>55811054
there is still a shitton of bloat but it's not there to help you get shit done

it's there to help academic cunts with infinite time to write papers
>>
>>55811035
Haskell devs made monads so that they could say IO is functional.
JS doesn't have monads so the best I can do is pass input to functions without storing it as state. No state means no mutating data
>>
>>55811078
Haskell is not pure but could be
Haskell restricts IO to IO computations for good reason
Obviously if you can side effect anywhere you can apparently write nicer code for this one instance
>>
>>55811078
And monads are a pure expression of impurity, which is the point. In Haskell, if an unsafePerformIO function isn't used, you know anything performing side effects has a type IO x
>>
>>55810926
>Look this shit up
http://keithlea.com/javabench/
>g++ 3 compiler for the C++ code

nigga what the fuck that shits from like 2004
>>
>>55810926
>>55811127
>script kiddie is so scared for his java career he digs up a comparison from 7 years ago to try and convince themselves
>>
I'm working on a game engine.

How would I go about mimicking C++ templates with C and Guile Scheme?
>>
>>55811137
>7 years ago
>November 14, 2003
>>
>>55811127
okay, prove your point that C++ is faster on a variety of tasks with a better graph

I'll wait

>>55811137
> script kiddie
says the unemployable high school hobbyist or struggling college freshman
>>
>>55811147
>How would I go about mimicking C++ templates with C?
By using C++
>>
>>55811149
stop it
>>
>>55811149
trying to remember the basics of C++ fried his brain
>>
>>55811153
https://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=java&lang2=gpp

>>55811165
stop admitting that you're too stupid for C++, kid
>>
>>55811147
Macro hell.
>>
>>55811155
http://harmful.cat-v.org/software/c++/linus
>>
>>55811205
Exactly.
Linus hates it, so it can't be that bad.
>>
>>55811212
linus hates everything that he didnt make dude
>>
>>55811217
I thought he liked Linux
>>
>>55810554
Because vanilla javascript and trying to make something hackable by those without autism / a PhD in CompSci.
>>
>>55811153
>>55811184
Hes just gonna say "it doesnt matter" and talk about "productive code" anon
>>
>>55811155
>>55811192
No need. FYI Guile Scheme is embeddable Scheme.
>>
>>55811184
>debian.org autists optimizing code over months if not years
>#include <cstdio>
>#include <cmath>
>#include <cstdlib>
yeah, you can fuck off

> stop admitting that you're too stupid for C++, kid
start admitting that you have no idea what you're talking about, literal memefag kid
>>
>>55811256
>2016
>Still arguing about Java vs. C/C++
>>
>>55811273
Nobody is arguing, we've all known from the start that C and C++ are both better than Java
>>
>>55811256
>debian.org autists optimizing code over months if not years
>lists some standard-library includes

what the fuck. is that really so confusing for you

how do you think people make those java standard libraries

>import java.util.Scanner;
>import java.awt.*;
>import java.util.regex.*;
>import java.io.*;
>import java.awt.event.*;
>baww this is so confusing
>I'll just say "java autist optimizing code for over months if not years"
>I'll just say java is a stupid as shit overcomplicated language
>ill just say anyone that doesnt agree with me doesnt know what they're talking about

this is you
>>
>>55811280
I agree, that is why I am curious as to why there is still an argument.
>>
>>55811256
>java programmer
>sees C++ code
#include <algorithm>
#include <array>
#include <map>
#include <future>


>baww this is so confusing!!!!!
>>
No need to argue guys. Both C++ and Java are Turing Complete. Just pick whichever language you like :)
>>
>>55811313
explain what it does
>>
>>55811292
>>lists some standard-library includes
that's not the point

it's basically C, you retard, C++ programmers should never include some of that shit

this is the level of knowledge of C++ defenders on this board ...
>>
File: 1357316864979.jpg (204KB, 683x797px) Image search: [Google]
1357316864979.jpg
204KB, 683x797px
>>55811318
java "programmers" everyone
>>
>>55811313
this is C++ code to you, little shit?

>>#include <cstdio>
>>
>>55811318
Sorry but I can't understand what you're saying because I haven't imported scanner, created a scanner object, and handled the potential exceptions from interpreting a string as a string
>>
>>55811341
c++ is backwards compatible

#include <cstdio>

is the c version

#include <iostream>

is pretty much the cpp version.

you can use both

C is a subset of C++ and is entirely available to C++ because C exists within it. C++ is multi-paradigm and allowing this to happen is key.

java is OOP, no matter what. everything is an object no matter what.
C/C++ doesn't limit you in that way.
>>
>>55811349
to defend the honor of your """C++""" include more <c***> shit because even incompetent java programmers write faster code

>>55811370
> you can use both
you can even inline assembly and call it C++ when you're losing, right?

because that's what a fair speed comparison is all about, you spend years to """optimize""" your """C++""""
>>
>>55811405
please be quiet if you don't understand what you're talking about, rajesh
>>
>>55811405
the funny thing is i literally can't understand your reply

maybe i need to download the latest jvm?
>>
>>55811414
>ethnic slur is his only argument

I bet you like to drink vodka
>>
>>55811405
>proves C++ is faster
>proves that C++ libraries exist
>proves that C++ is multiparadigm and allows for procedural non-oop programming too
>proves that C++ allows for C to exist within its syntax as it is multi-paradigm
>"yea well, your language is TOO optimized i bet it took you like a million years! You must be autistic!"
>"C++ allows inline assembly in its syntax for the compiler to interpret directly? that's not C++!!! you lose!!!"


have you ever been as scared for your job security as a java programmer is
>>
New thread!
>>55811464
>>
>>55801899
Are you using instancing?
Thread posts: 358
Thread images: 39


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