[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: 327
Thread images: 35

File: tmp_6318-14844505069361092119173.png (102KB, 1000x1071px) Image search: [Google]
tmp_6318-14844505069361092119173.png
102KB, 1000x1071px
What are you working on, /g/?

Old thread: >>58756258
>>
Does this make sense??
http://pastebin.com/HCh3sShD
>>
(vi) Carmack intentionally destroyed data on his computer after he got notice of this litigation and right after he researched on Google how to wipe a hard drive—and data on other Oculus computers and USB storage devices were similarly deleted (as determined by a court-appointed, independent expert in computer forensics);

(vii) when he quit id Software, Carmack admitted he secretly downloaded and stole over 10,000 documents from ZeniMax on a USB storage device, as well as the entire source code to RAGE and the id tech® 5 engine —which Carmack uploaded to his Oculus computer;


Do you back up the code you write at work to a personal location so you can reference it later?

Is this unethical?
>>
File: C3kCSjUUEAAN2D_.jpg (93KB, 1200x857px) Image search: [Google]
C3kCSjUUEAAN2D_.jpg
93KB, 1200x857px
The best coders in the world today learned Python as their first language
>>
Now I can use monads properly in Haskell. This is, as monoids in the category of endofunctors of Hask

type Monad cat = Monoid (EndFunCat cat) (EndFunComp cat)

data HaskEndoFunc :: (Type -> Type) -> (Type ~> Type)

instance Prelude.Functor f => Functor (HaskEndoFunc f) where
type Dom (HaskEndoFunc f) = Hask
type Cod (HaskEndoFunc f) = Hask
type Map (HaskEndoFunc f) a = f a

wellDefinedFunctor _ _ = Sub Dict
fmap _ = Prelude.fmap

instance Prelude.Monad m => Monoid (EndFunCat Hask) (EndFunComp Hask) (HaskEndoFunc m) where
mempty _ = Nat (\_ -> Control.Monad.return)
mappend _ = Nat (\_-> Control.Monad.join)

-- proof that IO is a monad
io_monad :: Dict (Monad Hask (HaskEndoFunc IO))
io_monad = Dict -- YES!
>>
>>58764884
That's literally impossible since the best """coders"""" in the world today programmed long before Python was ever conceived.
>>
>>58764884
>Python
>best coders
choose one
>>
>>58764855
implement java.util.Queue<E> interface, and pass queue to something that expects a queue and see if it works.
>>
>>58764903
If Turing knew Python he would have ended the war in a week and not gone to prison
>>
>>58764820
>Go is a like Plan 9 (the movie, not the OS). So hilariously bad it's good.
What the fuck, I just watched The Chinese Restaurant last night.
>>
>>58764921
if turing knew python he wouldn't have an interpreter to run it
>>
>>58764921
turing was puting python into his ass because he was a faggot
>>
lets say we write a program that can improve itself by 0.0001% each time.

wouldnt this program take over the world in a week thanks to exponential growth?
>>
>>58764921
Considering the speed of computers of that time, Hitler would bomb the world twice while the code was running
>>
>>58764936
Define improve.
>>
>>58764936
Depends how long "each time" takes.

Also >>58764961
>>
>>58764954
Nico is such a brat
>>
why is this desirable

} catch (FileNotFoundException e) {
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

}

}
>>
>>58764991
Smells like curry
>>
>>58764914
When I dequeue something, I just doesn't work.

        
Queue branchQ = new Queue();

for(int i=0; i<3; i++)
{
System.out.println("ENTER things: ");
String name = input.nextLine();
if(i>=1)
{
name = input.nextLine();
}
System.out.println("ENTER another things: ");
int dept = input.nextInt();
System.out.println("ENTER LOCATION: ");
String loc = input.nextLine();


OppoBranches oppo = new OppoBranches (name,dept,loc);//already defined
branchQ.enqueue(oppo);// the queue things


}

OppoBranches oppo1 = null;
while(!branchQ.isEmpty())
{
oppo1 = (OppoBranches) branchQ.dequeue();
System.out.println(oppo1.toString());
}
>>
>>58764991
catch (FileNotFoundException e) // handle case where file doesn't exist
{
e.printStackTrace();
}
finally // dispose of resources whether code runs as expected or not to avoid orphaned resources
{
if (br != null) // if 'br' (some sort of reader?) still exists...
{
try
{
br.close(); // close the reader handle
}
catch (IOException e)
{
e.printStackTrace();
}
}
}


Not so sure about the additional try/catch within the finally, but why did you post it in a mangled format? Doesn't even fit K&R, if that's what you were going for.
>>
>>58764884
best_coders = "alive today"

(best_coders == "alive today" and print("python =",True) )
[/code}
>>
>>58764997
can I have some lamb with my curry?
>>
>>58765077
That would be 550 yen sir.
>>
I wrote a short script that adds "expand" button to 4chan catalog so you can expand the post.
The syntax at the beggining is for tampermonkey. You would probably have to adjust it for greasemonkey.
http://pastebin.com/J4RkmKVV
>>
>>58765054
>best coders
>fuck up markup

Yeah, memes on memes meme memes out.
>>
Learning assembly at uni. Don't think it's too bad right off the bat. Does it get easier or harder?
>>
Does a 1 page CV look lazy? I'm a recent CS grad so I don't have a huge amount of relevant shit to put on it, but I really like how concise and neat it looks.
>>
Any cool name for a 4-person C project team? I can't come up with anything better than "Shadilay MAGA" (and MAGA is taken by another team).
>>
>>58765104
>memes on memes meme memes out.
underrated statement
>>
>>58765144
The C-ucks
>>
>>58765144
The C-Section
>>
Top 5 Meme Languages for meme programmers:
1. Python
2. Haskell
3. Rust
4. Go
5. Swift
>>
>>58765137
A 1-page CV is a résumé, and no, it doesn't look lazy, it looks like you've summarised your most relevant experience.

>>58765132
Easier the more you do it, but you forget it very quick if you don't keep doing it.
>>
>>58765169
change swift with lisp and you have a perfect list
>>
>>58765169
>tfw you thought you were studying CS at MIT but you were actually just learning memes at MIT
>>
>>58765132
That depends on how far you are. If you get all t he concepts like how instructions can affect flags and how you need to know to push some things on the caller end of functions and others on the calling end, then it doesn't really get harder, just more tedious. If you're not at that point, then it'll get a little harder. Assembly is mostly just tedious, knowing stupid tricks, and testing a lot of things to see what is fastest or how small you can get something (also tedious)
>>
>>58765169

at least Python is fun
>>
>>58765194
yeah ive figured out the tedious part for myself already. honestly i dont really mind it, it is something i can get used to, i already spent most of this morning trying to get an assignment as perfect as I could get it so i hope it gets easier from here on out. thanks for your input
>>
>>58765213
and useful
and actually allows you to get a job
>>
>>58765190
>Meme Institute of Technology
>>
>>58765144
If I ever get a boat, was thinking of calling

The sea dagger dagger
>>
Can you guys help me with an assignment? You're given an user entered string, and when entered, you're supposed to change A and a to 01, B and b to 02, the rest can either be one or two chars (C and c can be either 3 or 03), and then write it out to the user.
This is the easy part, but how would you decode it?
>>
>>58765759
Also, you're not supposed to use arrays.
>>
>>58764858
This is in most cases illegal, depending on what your employer had you sign when you started working. Unethical? Nah. Could get you in a lot of trouble though
>>
>>58765759
what language?
also decoding is pretty easy, just think about why a and b need the zero
>>
File: 1483757897046.jpg (180KB, 517x768px) Image search: [Google]
1483757897046.jpg
180KB, 517x768px
>>58764884
>calling programmers coders
>implying fortran and C didn't produce the best programmers
>>
>>58765802
x86 ASM
yes, i know it's because of the number of letters in the alphabet
>>
>>58765802
C#.
I know the logic behind it, but it's a new language so I'm writting pajeet code. So far I have 26 instances of the stringName.Replace and I don't know how exactly to use it in a for sentence correctly. I'm thinking to make the counter go from a to z, increment by one, but I don't know if the syntax will be correct.

someString = someString.Replace("A", "01");
.
.
.
someString = someString.Replace("Z", "26");


This would be the current code.
>>
>>58765832
Are you allowed to use either the C library or syscalls?
>>
is this how you use code? sorry new here
.
>>
>>58765832
well I'm not familiar with ASM. by no arrays do they mean just go through your input one char at a time?
>>
Should I use Atom
>>
I'm doing exercise 6 of Learn Python the Hard Way. Something I don't understand
x = "There are %d types of people." % 10
binary = "binary"
do_not = "don't"
y = "Those who know %s and those who %s." % (binary, do_not)

print x
print y

print "I said: %r." % x
print "I also said: '%s'." % y

hilarious = False
joke_evaluation = "Isn't that joke so funny?! %r"

print joke_evaluation % hilarious

w = "This is the left side of..."
e = "a string with a right side."

print w + e

How is the %r variable linked to hilarious = False?

I can understand how %r is linked to "I said: %r." because x is assigned as a variable to that string. But I don't understand the %r variable linking to the hilarious variable being False.
>>
File: 1481883613210.jpg (32KB, 640x640px) Image search: [Google]
1481883613210.jpg
32KB, 640x640px
how do you get better at design/architecture for anything but small projects
most of the time my projects tend to drown in refactoring work because the original design didn't cover some unforeseen use case
>>
File: 1314513034590.png (15KB, 202x243px) Image search: [Google]
1314513034590.png
15KB, 202x243px
So I just started learning programming 3 weeks ago and I'm using C programming for the Absolute begginer by Michael Vine
Can this thread help me with the books challenges? If not where should I go?
>>
>>58765832
Literally not me.

>>58765849
No.
>>
>>58765840
I'd suggest going through the (toLower'd) string char by char, C# probably has for-each loops, and then you could probably just do print(toString(c-'a')), just take special care for a and b
>>
>>58765924
or (c-'a')+1, c being the current character
>>
>>58765888
What problems are you having specifically, cuteposter?
>>
>>58765861
No use sublime instead since you can build directly in sublime
>>
>>58765924
Current loop looks like this:

for(char numb = 'a'; numb<'z';stev++)
{
i++;
someString = someString.ToLower().Replace(Convert.ToString(numb), (0+Convert.ToString(i)));
Console.WriteLine(someString);
}


Now the problem I'm having is, that it prints the 0 all the time instead of just 1-9, so I get encoding like 010, 011, 013,...
What should my if sentence look like? I want to trim the zeroes, but only on those specific numbers.
>>
>>58765759

#include <stdio.h>

void encode(const char* input)
{
while (*input != '\0')
{
int c = *input - 'A' + 1;
if (c < 3)
{
printf("0");
}
printf("%d ", c);
}
printf("\n");
}

int main()
{
encode("POO IN LOO");
}
>>
File: 1404443625493.gif (3MB, 252x320px) Image search: [Google]
1404443625493.gif
3MB, 252x320px
>>58765940
The challenge is to write a program that displays this mathematical problem: a=5, b=1, x=10, y=5. f =(a-b)(x-y) using a single printf()
The compiler I'm using says I can't use mixed declarations and code and i think its because i have several lines that start with int

Take a look
#include <stdio.h>

main(){
int a, b, x, y;
a=5;
b=1;
x=10;
y=5;

int fOperation;
fOperation = a - b;

int jOperation;
jOperation = x - y;

int Result;
Result = fOperation + jOperation;

printf("\nThe vale of a minus b is d%", &fOperation "the value of x minus y is d%", &jOperation "Together they make d%", &Result);
}
>>
>>58765879
first, learn python3
second, %r is not a variable, it's a printf format thingie or something, it only tell the print statement that whatever follows the string after the % sign should be turned into a string (via repr()) and inserted there. so first you tell it to print "I said (whatever x is)" (%r got replaced by repr(x)) and after you print "isnt this funny? False", because %r in this string got replaced by repr(hilarious)
>>
>>58766027
>fOperation + jOperation


int f(int a, int b, int x, int y)
{
return (a - b) * (x - y);
}

int main()
{
int a = 5, b = 1, x = 10, y = 5;
printf("%d\n", f(a, b, x, y));
return 0;
}
>>
>>58765995
replace 0 with
(numb<='b'?"0":"")
>>
>>58765887
I use to have this problem in a major way. What I do now may or may not be the "right" way to do it, but it works for me.

First, I plan out what features I know it must have. Say for example I know my package manager must install, remove, update, and track packages. Install and removing packages are higher priority, so I start with them.

I hack away at a project first. Just to outline the basic functionality. It's often monolithic in nature, and may not be optimized or memory efficient. So in the context of my package manager, it now can install and remove software.

Then, I completely rewrite it with the goal being to modularize. Now that I have a fairly solid idea on how I need to implement certain baseline functionality, I begin to think of expansion, and program with possible future functionality in mind. Once I have the original monolithic hacked program broken down and neatly optimized, I begin to implement the next level of functionality.

So in the context of our example, instead of a program that only installs and removes software, it now is a program that accepts a command; though the only commands it has right now are install and remove. I then begin to implement the next level of functionality, IE add an update command and package tracking.

After the second level of functionality has been implemented, if a rewrite needs to occur (due to any unforeseen use case) it happens now. And the development cycle continues.
>>
File: C3prg21UMAAxZLT.jpg (275KB, 800x1130px) Image search: [Google]
C3prg21UMAAxZLT.jpg
275KB, 800x1130px
>>58765979
Okay thanks
>>
File: 1485921353875.gif (2MB, 400x900px) Image search: [Google]
1485921353875.gif
2MB, 400x900px
>>58766063
I see my mistake now, I will try fitting all the integers into a single line next time.
>>
>>58766027
you got the format specifier the wrong way round, it's %d not d%, also &fOperation is the address of fOperation, but you need the value here, so just fOperation is enough
also printf wants one string and the rest is stuff to be put in the string, so your printf should be something like
printf("this=%d, that=&d, all=%d",fOp,jOp,R);
>>
>>58766027
Your program would've worked had you fully understood the printf function.

Though it would have worked, it is a poor solution. Not a bad attempt since you're just starting out. The biggest part of learning to program is learning to think in ways you may not normally think.

>>58766063
Something like this is really how it should be done.
>>
>>58766040
Thanks. The book I'm using teaches python2. I figure I can learn python3 quickly after I learn python 2.
>>
>>58766069
Same output.
>>
>>58766148
No. Just learn python3. Then be aware of the python2 differences so if you absolutely have to use 2.7 for some strange legacy package then you can do it.
>>
>>58764991
Complain about java....still use code style like in java 6.....read some new shit men use try properly
        String sourceFile = "files/myFile.txt";
try (
FileReader fileReader = new FileReader(sourceFile);
BufferedReader bufferedReader = new BufferedReader(fileReader);
) {
// Your shit here
} catch (Exception e) {
e.printStackTrace();
}
>>
>>58766165
what's stev? (in your for statement)
>>
Give me an app idea I can program in android. I'm bored. No anime.
>>
>>58766214
Oh, yeah, that's numb, I just changed names.
>>
tfw too dumb for machine learning
>>
>>58766117
>>58766122
So the issue isn't the way I typed the integers but the printf() function misreading the rest of the program?
>>
https://css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/

here's something worth a read, /dpt/


>I mean – I would be suspicious of someone who could solve fizzbuzz off the >cuff. They are likely to:
>1. have too much time on their hands
>2. had too many interviews asking that question
>3. be unsufferably arrogant
>4. or all of the above.
>>
>>58766183
What do you recommend for learning python3?
>>
>>58766246
This is old AF anon. But he is correct though, I do have too much time on my hands. Rate my fizzbuzz.

## Functions ###
range = $(if $(filter $1,$(lastword $3)),$3,$(call range,$1,$2,$3 $(words $3)))
make_range = $(foreach i,$(call range,$1),$(call range,$2))
equal = $(if $(filter-out $1,$2),,$1)


### Variables ###
limit := 101
numbers := $(wordlist 2,$(limit),$(call range,$(limit)))

threes := $(wordlist 2,$(limit),$(call make_range,$(limit),2))
fives := $(wordlist 2,$(limit),$(call make_range,$(limit),4))

fizzbuzz := $(foreach v,$(numbers),\
$(if $(and $(call equal,0,$(word $(v),$(threes))),$(call equal,0,$(word $(v),$(fives)))),FizzBuzz,\
$(if $(call equal,0,$(word $(v),$(threes))),Fizz,\
$(if $(call equal,0,$(word $(v),$(fives))),Buzz,$(v)))))


### Target ###
.PHONY: all
all: ; $(info $(fizzbuzz))
>>
>>58766250
You can learn python3 from your book in python2. The biggest difference that will impact your learning is the print statement syntax is different and uses parenthesis instead of a space.

Basically in your book if you get errors in python 3 interpreter then you know there is a change and just look it up and start doing it that way. Your book explains programming concepts, it doesn't require python2
>>
File: dsadwq2.png (20KB, 417x297px) Image search: [Google]
dsadwq2.png
20KB, 417x297px
Okay, with this code, I get pic related output. How do I edit it, so that it doesn't change 01 to 1 and 02 to 2.
The rest seem to be working fine.

 i = 0;
for(char numb = 'A'; numb<='Z';numb++)
{
i++;
someString= someString.ToUpper().Replace(Convert.ToString(numb), (0+Convert.ToString(i)));
if (i >= 10)
someString= someString.Replace(Convert.ToString(0)+i, Convert.ToString(i));
Console.WriteLine(someString);
}
>>
>>58765799
>illegal
Regardless of what you signed, it wouldn't be "illegal".
>>
>>58766250
forgot code


print "python2 is old"

print("use python3 instead, it's 2017")

>>
>>58766309
Oh. I see. Thanks for telling me that. I didn't think of it. I have both python2 and python3.
>>
>>58766315
it's looking for 010, and that's right at the start there, so I think
i = 0;
for(char numb = 'A'; numb<='Z';numb++)
{
i++;
if(i>=10)
someString= someString.ToUpper().Replace(Convert.ToString(numb), (Convert.ToString(i)));
else
someString= someString.ToUpper().Replace(Convert.ToString(numb), (0+Convert.ToString(i)));


}

should work better
>>
File: anal beads.png (6KB, 903x83px) Image search: [Google]
anal beads.png
6KB, 903x83px
>>58766231
>>58765759
Anon...

var input = "the quick brown fox jumps over the lazy dog";

var output = string.Join("", input.Select(x => x == ' ' ? " " : (x - 96).ToString().PadLeft(2, '0')));
>>
Took an internship and have to learn PHP and MySQL.

Made my own login system with cookies and a simple message board.

Trying to figure out everything as the boss gives me tasks to do while doing tutorials and reading up on official documentation.


What can I do to make him more likely to hire me at the end of the internship?
>>
>>58766414
stop browsing here and stop looking at anime while at work anon

good luck
>>
>>58766414
suck his cock every day
>>
>>58766423
its 7 pm I'm at home already
>>
>>58766440
then why arent you sucking his cock after work hours
>>
>>58766440
More study less talk
>>
File: anal beads.png (3KB, 633x45px) Image search: [Google]
anal beads.png
3KB, 633x45px
>>58766403
Just to verify, pic related.

200805 1721090311 0218152314 061524 1021131619 15220518 200805 12012625 041507
t h e q u i c k b r o w n f o x j u m p s o v e r t h e l a z y d o g
>>
>>58766457
Was reading this meanwhile https://code.tutsplus.com/tutorials/scheduling-tasks-with-cron-jobs--net-8800

you got any good php go-to sites that are not php.net or stackoverflow?
>>
>>58766403
I don't know all the syntax yet, C# is new to me.

How do I decode it though? This is the one that's giving me trouble. If I just invert the if clause, it doesn't give me the correct output.
>>
>>58766491
just go through the input char by char, if it's a zero, one or two, multiply by ten and add the next one, and convert to the appropriate letter, if it's >2 just convert it right away.
>>
>>58766491
var input = "the quick brown fox jumps over the lazy dog";

var decodedCharacterList = input
.Select(x => // for each character in input, return a string...
x == ' ' ? // if the character is a space, return a space
" " :
(x - 96).ToString().PadLeft(2, '0')); // otherwise, subtract 96 from its ASCII code and return a string with
// at least two characters, padded with '0'

var output = string.Join("", decodedCharacterList); // join all of these strings together as one string

// or basically

string output2 = "";

foreach(char c in input)
{
string characterToDecodedString = "";
if (c == ' ') // if it's a space, put a space in
{
characterToDecodedString += " ";
}
else
{
characterToDecodedString = (c - 96).ToString().PadLeft(2, '0');
}

output2 += characterToDecodedString;
}
>>
>>58766572
pretty sure by decoding he means going from numbers to letters
>>
>>58766627
Yes.
>>
>103 posts in
>nothing interesting
halp
>>
>>58766784
go do something interesting then
>>
File: dasd23.png (1KB, 346x33px) Image search: [Google]
dasd23.png
1KB, 346x33px
>>58766556
Multiply 0 by 10? Anyway, I fucked around a bit and there some letters it's still not decoding, especially if there's one of the first 10 in combination with others. Pic related.
>>
Is ocaml really the best?
>>
File: Untitled.jpg (34KB, 624x487px) Image search: [Google]
Untitled.jpg
34KB, 624x487px
Trying to make PHP cronjob to work on my server. It should output the date on a .txt file

<?php

$file = dirname(__FILE__) . '/output.txt';

$data = "hello, it's " . date('d/m/Y H:i:s') . "\r\n";

file_put_contents($file, $data, FILE_APPEND);

?>


It works on my Xampp server on localhost if I open the index.php with chrome. It works if I make it a scheduled task (I'm on windows) running on php.exe. If I upload to my server on the web and open the index.php it doesn't create a new file on the server. How do I do this? I am using WinSCP to connect and upload files. I have SSH access but I don't know how to use the shell yet.
>>
Anyone have experience with JSON validation in go?
>>
>>58764858
>Do you back up the code you write at work to a personal location so you can reference it later?
Depending on where you live/work it's not unethical, but illegal.
>>
I want to write budgeting software with a companion Android app. The software is the primary part, Android app is mainly an afterthought. It's for personal use.

My issue is, I would like to develop the software portion to be cross-platform between Windows and Linux. What's the best language/toolkit to approach this with? I really dislike Java and using software written in Java (hate the UI toolkit) so that's pretty much out. With that gone, I'm not sure where to go really. I could do Python with Qt or something, but I don't know how well Python runs for a fully fledged GUI-based software project. I could do C# with Mono, but that doesn't even use up to date C# stuff (WPF etc) and I don't know how long Mono will be a viable option for Linux. I could do C++ with, again, Qt or something but I'm unsure would it be overkill development-wise for the project I want to undertake.

Any ideas?
>>
>>58767141
Write a web application.
>>
>>58766906
Linux uses forward slashes. Just do output.txt and it will do current dir. Also it wont just execute by opening in a browser/ftp. Either use a webserver's cgi directory or run directly from command line/crontab and run php index.php
>>
Okay, so this is what I have so far. Encoding works fine, decoding has some issues, where the program will write nonsense if it encounters a 10 or 20, for example, "to" would be 2015, but it decodes it to 2A5.
How do I fix this?

 i = 0;
for(char numb = 'A'; numb<='Z';numb++)
{
i++;
if (i >= 10)
someString = someString.ToUpper().Replace(Convert.ToString(numb), Convert.ToString(i));
else
someString = someString.ToUpper().Replace(Convert.ToString(numb), (0 + Convert.ToString(i)));
}
Console.WriteLine("Encoded string: " + someString);

i = 0;
for (char numb = 'A'; numb <= 'Z'; numb++)
{
i++;
if (i >= 10)
someString = someString.ToUpper().Replace(Convert.ToString(i), Convert.ToString(numb));
else
someString = someString.ToUpper().Replace((0 + Convert.ToString(i)), Convert.ToString(numb));

Console.WriteLine(someString);

}
>>
>>58766906
>>58767199
Also line endings are only newlines vs newline carriage return on Win.
>>
>>58767178
That's not a bad idea actually, using something like Electron? I'll look into it, thanks!
>>
>>58767212
I already told you
>>58766556
when decoding you can't just use simple string replacements, since for example the 01 in 2015 then gets treated as an A, instead of belonging to two different characters
>>
>>58767276
Just write a page to run in browser.
>>
Just applied at a Polytech to a program focusing on Software development...I've just started picking up programming and am terrible so far...Hopefully this wasn't a mistake. Trying to escape my wage slave lifestyle. Wish me luck.
>>
>>58767351
Good luck anon
>>
>>58767307
How would I do database etc in that case? I don't want to actually host it on a server, I want it to run locally.
>>
>>58767351
Good luck buddy, I'm applying to jobs rn too.
>>
I want to make a simple online fighting game in Javascript. Should I use something like a game engine or am I retarded? Is there a way to make vectored animations or I have to use bitmaps?
>>
Sorry if this question gets posted a billion times:

What are some of the better sources to learn Java?

As an aside, I did a minor in CS in university, but I didn't really retain much of what I did. So maybe something that isn't geared to someone completely new to coding or java.
>>
File: gt77tiyk.png (519KB, 1366x768px) Image search: [Google]
gt77tiyk.png
519KB, 1366x768px
is 18 too old to learn programming?

whats the best way to learn? community college classes? internet? i know absolutely nothing
>>
>>58767281
I don't understand what you're trying to say.
> if it's a zero, one or two, multiply by ten and add the next one
So if for example I get 2015, I'd get 200105, or what?
>>
>>58767399
>>>/g/dpt/
>>
>>58767399
21 here, I just started learning C#, been following along with Bob Tabor so far..its fun. Pick it up and try it out. I'm terrible tho.
>>
>>58767399
Get a PDF of K&R 2nd Edition
Read through all of it, do every single exercise
It should take you about 2 weeks to do and you'll immediately be a better programmer than almost any given 2nd year university student.
>>
int main() {
return 0;
}

or
int main()
{
return 0;
}
>>
>>58767399
Most people start uni at that age, so I don't know why you think you'd be too old to learn something.
I don't think you have a chance, though. You sound defeatist.
>>
>>58767487
Kernel devs wants use to use n°2, but I use n°1 for consistency sake.
>>
>>58767487
int main()
{
if (cia) {
printf("nigger");
} else {
printf("based terry");
}
return SPACE_ALIENS;
}
>>
>>58767512
Why on earth would you want consistency between conditional/switch blocks and functions?
They are completely different things, that just so happen to both be enclosed by curly braces.
>>
>>58767281
>>58767418
>>58767212
pls respond
>>
Just started to learn programming. Is codeacademy really as bad as people say it is? I just finished the CSS portion. Should I leave now and find a better online course? Any suggestions?
>>
>>58767449
>2 weeks
or 2 months, there's no point in rushing especially if you've no previous experience in programming
>>
>>58767563
>Why on earth would you want consistency between conditional/switch blocks and functions?
Why wouldn't I? Get on my level.
>>
>>58767637
Well sure, but a lot of people avoid textbooks because they think it's gunna be a semesters worth of drugdery. K&R specifically is very short for how much it offers
>>
>>58767418
no, I mean:
see a 2 -> ok , do 2x10 = 20 and add the next character, here 0 -> we get 20+0 = 20 and know it's a 't'
skip the 0, because we added it before
see a 1 -> ok, make 10 and add the next one, here 5 -> we get 10+5=15 and know it's an 'o'
>>
How can I write a script that will start a java server on a remote machine
>>
>>58767628
>programming
>CSS
Just start with C and move onto a higher-level language later
>>58767662
psexec
>>
>>58767662
ssh user@host "java MyServer"
>>
>>58767524
Those 1 line if else statements should not be contained in braces
>>
>>58767680
Thank you, how could I do that but have it running on the physical remote machine? If i close the terminal on my local machine then the server is no longer running.
>>
>>58767487
int main()
{
return 0;
}
>>
>>58767680
>>58767728
Never mind, it is still live. Thank you
>>
>>58767487
        int main () 
{
return 0;
}
>>
>>58767638
>Get on my level
I can't, time only goes forwards in this universe.

>>58767699
That saves you a whopping 4 characters, but no fewer lines used.
If you don't leave empty lines after single-line conditionals there is a special place in hell for you.
>>
>>58767737
There must be at least one hipster out there who uses that indentation style
>>
>>58767768
that is actually how arabs write code.
>>
File: anal beads.png (54KB, 1379x857px) Image search: [Google]
anal beads.png
54KB, 1379x857px
>>58766572
>>58766627
>>58766713
Here's a 2-minute ugly solution. I'll see if I can't clean it up a bit.

Needs a
.ToLower()
sprinkled in, methinks.

Pic related.

static string EncodeString(string input)
{
return string.Join("", input.Select(x => x == ' ' ? " " : (x - 96).ToString().PadLeft(2, '0')));
}

static string DecodeString(string input)
{
var output = "";

var tempCount = 0;
var temp = "";

foreach(var x in input)
{
if (x == ' ')
{
output += " ";
}
else
{
if (tempCount == 1)
{
temp += x;
output += (char)(int.Parse(temp) + 96);
temp = "";
tempCount = 0;
}
else
{
temp += x;
tempCount++;
}
}
}
return output;
}
>>
>>58767768
You realize that the GNU C style is a joke, right?
As in literally, you were supposed to format it to whatever style you liked, and then reformat it to GNU before submitting patches.

It was done that way because AT&T or some dumbshit company thought that following a styleguide made you closer to copyright infringement.

Don't actually use it.
>>
>>58767797
thanks, pretty much what I meant to describe here >>58767659
>>
>>58767797
I'm having trouble reading it because I'm only learning C#. The encode line confuses me. Could you edit my code so that I can learn from it?
>>
Do any of you guys have experience with Android development?

Do I just need the latest version of the SDK downloaded, or do I need multiple versions to be compatible with older versions of Android?
>>
>>58767820
it is the ugliest coding style I have ever seen.
>>
>>58767913
You need whatever version of the SDK you are targeting.
Android does their best to make things backwards compatible, so generally you should be targeting the newest SDK.

However, if they make large changes, you might want to hold back until you've actually taken them into consideration.
For example, when Android moved to "ask as they're needed" permissions, if you just bumped an app built with the older SDK to the new one, it wouldn't work properly.

If you want to work on particularly old android versions, just download the oldest ROM you want to support and test that your stuff still works on that.
>>
>>58767907
You should be able to read the encode I wrote here: >>58766572

in the second half of the post, that uses
foreach()
>>
How do I use a proxy with the SOCKET library in python?
I had it working a long time ago but I forgot how. I don't really want to use other libraries.
>>
>>58767487
>>58767487
int
main(void)
{
return 0;
}


Do you even BSD ?
>>
>>58768042
>a whole line, 95% of the time dedicated to "int" or "void"

For what purpose?
>>
Can anyone summarize what Pascal is about in one or two sentences?
>>
>>58767972
I have no problems with encoding though, decoding is a problem. I'd use foreach if I had an array, that would be easier, but we were told not to use it, and now I have 01 and 02 that I have problem decoding/converting to A and B.
How would I do it with just a for loop?
>>
>>58768096
Easy to read. Easy to write.
>>
>>58768118
Sounds neat. What's the drawback?
>>
>code is literally not doing what I tell it to
The Singularity is here lads.
>>
File: 14751106354.jpg (360KB, 1920x1080px) Image search: [Google]
14751106354.jpg
360KB, 1920x1080px
How's your /g/ame going ?
>>
>>58768060

For when the typename is longer
For when the typename is accompanied by static, inline, or other keywords
For when the parameter list is longer, perhaps containing longer names
>>
>>58767966
Ok, thanks, that makes sense.
>>
>>58768060
>>58768060
to allow for easier greps. ex: ^name\(

vs something like ^\w+\s*name\(
(what if its extern, what if its static, etc)
>>
>>58768109
You can easily change a foreach into a for, anon.

foreach (var x in input)
{
Console.WriteLine(x);
}
//becomes
for (int i = 0; i > input.Length; i++)
{
Console.WriteLine(input[i]);
}
>>
>>58768211
>easily
>gets the conditions of the for loop wrong
:^)
>>
>>58768131
Virtually deprecated, in favor of c-like syntax, other than Ada.
>>
>>58768219
FUCK MAN, IT'S LIKE 3PM I AIN'T PAYING ATTENTION AT THIS POINT YOU KNOW WHAT I MEAN
>>
>>58768131
Literally who last 20 years.
It's still taught in post-Soviet countries, though.
>>
>>58768211
for (int i = 0; i < input.Length; i++)
*
>>
>>58768150
I have no artistic talent except maybe I could make some sound effects or short loops
>>
>>58768199
>using raw grep
>not using superior ack or ag, that come with -w option to only search whole words

>>58768197
So use it WHEN the typename is longer, not as the default style.

What else are you going to do, wrap every line, even the short ones, so they're consistent with the long wrapped lines?

Jesus christ.
>>
>>58768237
>>58768211
Yes, but how do I make the program check for 01 and 02, but not x01 or x02? 2015 should be "to", not 2A5.
>>
File: anal beads.png (2KB, 323x45px) Image search: [Google]
anal beads.png
2KB, 323x45px
>>58768319
>2015 should be "to", not 2A5.
It works...
>>
>>58768284
so, with ag how do you search for a function while ignoring the return type (because you don't know if its typedef'd, uses a macro, etc), ignoring uses, and not knowing the argument types?
>>
File: twerfwe43.png (18KB, 784x454px) Image search: [Google]
twerfwe43.png
18KB, 784x454px
>>58768351
It doesn't for me. Is it because I used my code to encode the string? That's why I wanted to edit my code to decode it, otherwise I could just copy paste yours and learn nothing.
>>
>>58768319
we can't do much more than tell you, just read what you've been told to do and ask specific questions if you don't understand something
>>
Which of these looks nicer?
ld byte r0,r1
ld r0,r1,1

ld word r0,r1
ld r0,r1,2

ld special r0,r1
ld r0,r1,3

ld dword r0,r1
ld r0,r1,4
>>
>>58768487
what was the input to be decoded here?
>>
>>58768401
ag -w function_name_goes_here


If for some reason the name is common elsewhere, look for a opening paren:
ag -w "function_name_goes_here\s*\("


Wow, so hard.
>>
>>58765213
Please die
>>
File: ads32423.png (12KB, 526x302px) Image search: [Google]
ads32423.png
12KB, 526x302px
>>58768512
I forgot.
But if I put "this is some string that i want to decode", I get this.

>>58768488
I appreciate it. How would you edit the decode for loops though to make it work correctly?
>>
File: 43.jpg (29KB, 640x519px) Image search: [Google]
43.jpg
29KB, 640x519px
Why do people care so much about which programming language they use?

Don't you think being good at maths is more important and that's where the focus should be?

Instead of getting tribal over programming languages, making fun of people who are shit at maths would surely be more beneficial.
>>
>>58768514
>>58768401
>ignoring uses
m8 just use ctags
>>
>>58768514
and how is that different than this? (first question was also rhetorical)
>^name\(
other than putting the return type on prior lines.. especially when the codebase has been using this style for 30 years?
>>
>>58768284

That's what I typically do. Some people prefer to have it on another line to be more consistent.

>What else are you going to do, wrap every line, even the short ones, so they're consistent with the long wrapped lines?

You should take a look at some Microsoft driver code. And then proceed to dip your head in pot of boiling peanut oil to relieve yourself of the pain.
>>
>>58768532
what's the encoded version of "this is some string that i want to decode"?
>>
>>58764884
kys animefag
>>
>>58768537
Dumb frogposter, dumb opinion.
>>
How do I become filthy rich with programming?
I'll do any language, would even force myself to use Microsoft Windows if it must be.
>>
>>58768537
You don't have to be good at math for programming though, you just have to understand the logic behind it.
>>
File: thinking_hotaru.png (372KB, 954x768px) Image search: [Google]
thinking_hotaru.png
372KB, 954x768px
>>58768537
The problem is that being good at math doesn't pay. Knowing how to prove that a square-free omega-word exists over an alphabet of at least 3 elements matters less than actually being able to construct it in the real world.
>>
>>58768537
I think we should just drop irrational numbers and just use rational numbers.

You don't need to use irrational quantities because they don't exist.

A circle on your screen will always have a rational number of pixels. Why use irrational numbers to solve rational problems?
>>
File: dasdq23252.png (12KB, 308x315px) Image search: [Google]
dasdq23252.png
12KB, 308x315px
>>58768568
Fucking 4chan
>>
>>58768647
how would you do a 3d transform/translate on a 2d screen then?
>>
>>58768505
anyone?
>>
>>58768663
You use rational approximations, anon.
>>
>>58768654
yeah the decoding in >>58768487 doesn't consider that for example 'c' can also be encoded as 3, not just 03

changing (tempCount==1) to (tempCount==1 || int.Parse(x)>2) should fix it i think
>>
>>58768647
What's the square root of two then senpai?
>>
>>58768647

-t. NJWildeberger
>>
>>58768741

he's saying because computers have finite memory they don't exist in computers

>>58768663
>>58768696

> he hasn't heard of bradians

in old games they did angles with 256 degrees in 1 circle

works out well because a power of 2 is divisible by 2 the max amount of times
>>
File: 1478885117144.jpg (17KB, 225x225px) Image search: [Google]
1478885117144.jpg
17KB, 225x225px
I'm making a game!
>>
>>58768741
Doesn't exist, you can't slice anything into the square root of 2 pieces.
>>
>>58768545
Because it doesn't rely on the return type being on a separate line, it'll work with both.

You'd have to take some pretty bad pills to come up with a code style purely for the benefit of finding function definitions a bit quicker.
>>
>>58768741
~1.41
>>
>>58764858

free my nigga Carmack
>>
I'm making an n64 emulator.
>>
>>58768861
Make sure it isn't poorly coded....

BAZINGA!
>>
>>58766315
If you really want to do it like you did right here
for (char ch = 'A'; ch <= 'Z'; ch++)
{
input = input.ToUpper().Replace(ch.ToString(), (ch - 'A' + 1).ToString("D2"));
Console.WriteLine(input);
}

Try to use XYZ.ToString() instead of Convert.ToString(XYZ)
Also, you can pass a format string to ToString(), "D2" in this instance means a decimal with 2 places (basically pads to the left until the number is reached)
Check here for number format strings
https://msdn.microsoft.com/en-us/library/dwhawy9k%28v=vs.110%29.aspx
>>
>>58768761
>he hasn't heard of bradians
How does it comply with the fact that you use a finite number of values?
>>
>>58768726
Thanks, I'll try it out later when I get back to the computer.
If you can be bothered, would it be possible to write decoding with 1 or 2 for loops, and could you do it? I honestly have no idea how to decode correctly with my method, and I want to stick to it.
>>
Best website to learn programming assuming no prior knowledge?
>>
>>58767699
As he said and did, they can be contained in braces, as long as you don't write it like
if (cia) 
{
//
}
else
{
//
}

Stop trying to apply pro tips you read somewhere to everyones code without knowing what you are talking about, please.
>>
>>58768932
4chan.org
>>
>>58768237
>I want people to take me seriously
>Someone points out the flaws in your post
>HURR DURR ITS SO LATE ALREADY
Why do programmers always do this?
If you're so tired, maybe you should go to bed?
No one is asking you to stay awake to answer peoples questions here.
>>
>>58768904
but the function in >>58768487 already has a for loop? if don't want a for-each, just replace foreach(...) with for(int i=0;i<kodString.length;i++) (or something) and any appearance of x with kodString[i]
>>
>>58768970
>Why do programmers always do this?
Dunning-Kruger
>>
>>58768972
I meant if it's possible to do decode with similar lines that you encoded, with two or three if statements, one line each.

>>58768882
I'll try this as well, thanks.
>>
>>58768993
Probably. Thanks for reminding me about the name of this.
>>
File: assembling assemblers.png (342KB, 1920x1080px) Image search: [Google]
assembling assemblers.png
342KB, 1920x1080px
do i have to put a fucking image to get a reply
which?
ld byte r0,r1
ld r0,r1,1

ld word r0,r1
ld r0,r1,2

ld special r0,r1
ld r0,r1,3

ld dword r0,r1
ld r0,r1,4
>>
>>58768892

the smallest possible angle is 1/256 of a circle

In old games this was more than good enough

another reason why they are so nice is that they automatically roll over
>>
File: anal_beads.png (3KB, 404x115px) Image search: [Google]
anal_beads.png
3KB, 404x115px
First of all, I'd like to apologize for the decode function that somebody posted earlier. It was terrible.

It can be done, quite easily, with pure LINQ
>>
Does anyone have a list of free online courses I can take that would give me the knowledge equivalent of a CS degree?
>>
>>58769158
I came here to study programming and this image made me end up masturbating to various applications of method-syntax LINQ queries instead.
>>
>>58769015
just applying string.replace() over and over won't help, because a '01' somewhere in the string doesn't necessarily mean 'a', like in "jk"=1011
>>
>>58769158
does that deal with strings like "9999"?
>>
>>58769283

That wasn't part of the spec.
>>
In Haskell, I have a function that does a procedure using in a passed in function (here we just apply 2 to the function but it could be arbitrarily complex)
app :: (Int -> Int) -> Int 
app f = f 2

My friend thinks my function is really cool, but he writes a function that has to do some IO: (Int -> IO Int) How can he use app with his function?
appIO :: (Int -> IO Int) -> IO Int
appIO f = ???
>>
>>58769308
Are you saying it gives bad data as if it was good? Into the trash, tbqh?
>>
>>58769312
appIO f = f 2
>>
>>58769324

Actually, it crashes with a System.FormatException.
>>
>>58769324
>>58769334
He's trying to tell you, that you didn't say it need to handle invalid input.
>>
>>58769327
appIO = ($ 2)
>>
>>58769327
>>58769327
sorry, that's not what I mean. I mean he wants to use app in his function. He doesn't know the definition of app.
app ((+) 2) // 4, works because ((+) 2) does no IO

ioSuff a = do
print "Hello!"
return (2 + a)

app ioStuff // doesnt compile

Can my friend use app with ioStuff?
>>
>>58769334
That's fine then, my dude
>>58769355
No function should give bad output without informing the caller in some way
>>
>>58769374
It should work. Does your code actually misspell the name like your post?
>>
>>58769408
Couldn't match type ‘IO Int’ with ‘Int’
Expected type: Int -> Int
Actual type: Int -> IO Int
In the first argument of ‘app’, namely ‘ioStuff’
In the expression: app ioStuff
>>
>>58769374
You can't have values at the top level anyway, they have to be bound

x = app ((+) 2) -- works
y = app ioStuff -- works
>>
>>58764819
I'm researching the Epiphany coprocessor for Parallella and trying to get some useful computing power from it (i'm thinking a massively parallel compression system). I'm working on BasicTV, so the only two things that strain the system are decompression and decrypting. Any ideas?
>>
>>58769426
You want to generalise the type of app

app :: (Int -> a) -> a
>>
>>58769426
Oh, sorry, I was thinking of appIO still. No, you can't do that.
>>
File: 1479163129931.jpg (298KB, 1200x1188px) Image search: [Google]
1479163129931.jpg
298KB, 1200x1188px
What anime program should I make for learning Haskell?
>>
$ cat encode.c decode.c
#include <stdio.h>

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

char *c = NULL;

if (argc < 2) {
char cc;
while ((cc = getc(stdin)) > 0 && cc != '\n')
printf ("%.2d ", (cc - 'a')+1);
} else {
char *c = argv[1];
while(*c && c) {
printf ("%.2d ", (*c - 'a')+1);
c++;
}
}
putchar ('\n');
return 0;
}
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

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

const char *s = " ";
char *t = NULL;
char b[8192];
char *v = NULL;
int flag = 0;

if (argc < 2) {
if (fgets(b, 8191, stdin) <= 0) {
// commit_sudoku ();
}

unsigned u = strlen (b);
b[u-2] = 0;

v = b;
flag = 1;

} else v = argv[1];

t = strtok(v, s);
while(t) {
int i = atoi(t);
if (i == -64) goto MEME;
if (i <= 0) goto NEWTOKENPLS;
else goto GENTOO;
MEME:
putchar (' ');
goto NEWTOKENPLS;
GENTOO:
printf ("%c", ('a' + i)-1);

NEWTOKENPLS:
t = strtok(NULL, s);
}

if (flag) putchar ('\n');

return 0;
}


t. autist
>>
# Find dependencies
# Set the library and include directories

# Enable C++11 support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no \
C++11 support. Please use a different C++ compiler.")
endif()

if(CMAKE_USE_LCOV)
message(STATUS "Adding support for lcov")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O0 -g -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g -fprofile-arcs -ftest-coverage")
else()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -msse4")
endif()

# -DARMA_NO_DEBUG -DNDEBUG -DHAVE_INLINE -DGSL_RANGE_CHECK_OFF

# Build tests
add_executable (main "main.cpp")
target_link_libraries(main ${libs})


I have this cmake file I got with some fancy library i'm using and everything works fine. Problem is, that I want to compile with flag -O3, but when I open the makefile, there is no obvious place to put it, -std=c++11 and -std=c++0x is not even mention in the makefile at all and the makefile i've got is totally different from everything i've seen before and i don't understand anything of it

cara always related
>>
In c++, how would I take an inputted string and immediately place it in an object via a setter function in one line?

specifically I don't want to use a variable in my driver function
>>
>>58769488
>ribbit tier homework
>>>/r/abbit
>>
>>58769517
rude
>>
>>58769452
Make a program that applies waifu2x to every frame of an episode pls
>>
>>58769531
yes. your point?
>>
decode = unwords . map (\xs -> map (\i -> toEnum . (+96) . read . take 2 $ drop (i * 2) xs) [0 .. length xs `div` 2 - 1]) . words
>>
>>58769477
In release mode, it already applies -Ofast which includes -O3.
>>
>>58769539
just wondering if I can cut down:
string blah
cin >> string
object.set(string)

to a single line, it's not even homework related
>>
>>58769581
first post an anime image as a response to this post
>>
>>58768882
This doesn't seem to work, I just get the encoded string printed n times.
>>
File: turd.jpg (116KB, 1252x1252px) Image search: [Google]
turd.jpg
116KB, 1252x1252px
>>58769584
>>
File: 1485472918403.png (99KB, 288x390px) Image search: [Google]
1485472918403.png
99KB, 288x390px
>>58769584
>>
>>58769627
>anime
>>
>>58769613
thats some pretty shitty anime. do they like that on your home site (plebbit)?
>>58769627
that's a good image but it's not from anime
>>
File: 1485900094520.jpg (26KB, 274x321px) Image search: [Google]
1485900094520.jpg
26KB, 274x321px
>>58769629
>>58769643
>>
>>58769643
all anime is inherently trash
>>
lmao

Haskell:
http://rextester.com/RSMP99973
http://rextester.com/MQEIT9246

Python:
def stein(n,d):
s=0
i=0
while n>0:
r=n%d
n=n//d
s+=r*(d+1)**stein(i,d)
i+=1
return s

def gs(n,d):
return stein(n,d)-1

t=int("value?")
print(t)
for i in range(2,10):
t=gs(t,i)
print(t)


source: https://www.youtube.com/watch?v=oBOZ2WroiVY
>>
>>58769556
thanks mate
>>
>>58769657
this is blatantly impossible.
go back to your subreddit though, we don't need your plebbit kind nearby.
>>
File: 1486018021366.png (410KB, 720x932px) Image search: [Google]
1486018021366.png
410KB, 720x932px
>>58769657
>>
>>58769699
>>58769710
shibboleth'd NEETs
>>
>>58764819
Trying to figure out how to work with metadata in FLIF images. The function that retrieves the metadata doesn't give any obvious information as to whether the image I fed it actually has any metadata to retrieve. The length parameter that the function mutates doesn't give 0, but what appears to be the maximum size_t will allow. It's rather frustrating.
>>
>>58767399
There's no such thing as too old to learn.
>>
>>58769438
>>58769440
Let me add some context. I'm simulating Monty Hall and I want people to be able to use their own door-picking functions. I dont particulary care about HOW they pick a door (they could do some IO, call out to an external service, always choose the first door or even do crazy monad shit I havent heard of). In OOP, I'd do something like
public Prize runMontyHall(DoorPicker a)

But Haskell seems to care if the DoorPicker does IO or not. I've tried the following things:
runMontyHall :: (GameState -> Door) -> Prize // doesnt work if they want to do IO 
runMontyHall :: (GameState -> IO Door) -> IO Prize // seems unreasonable but whatever
runMontyHall :: (GameState -> m Door) -> m Door // forces me to muck around with the Free monad
runMontyHall :: (GameState -> a) -> a // doesnt make sense in the context

Do I have to use the (GameState -> IO Door) -> IO Prize definition? Or is there another thing that would work/
>>
>>58769920
>forces me to muck around with the Free monad
What? All you have to do is constrain m to be a Monad and use the generic operations.
>>
Is it weird that I'm sexually attracted to the Java programming language? I used to hate it but now it makes me cum whevener I see all that verbosity.
>>
>>58769920
(MonadReader GameState m) => m Door
>>
https://www.udemy.com/the-web-developer-bootcamp/

Is this a good course for someone who has zero programming experience, but would like to start? I'm kind of confused on where to start this journey. Any help would be appreciated.
>>
I just read a job prospect where they say they're looking for software engineers who have experience with "Java, JSP and postpressSQL".
>>
lads I can't get winsock to work. Even the MSDN example just doesn't work.

Do I just install gentoo?
>>
>>58770009
Installing Gentoo is always the correct thing to do, but it really won't help you with getting winsock to work.
>>
What is the most boring part of java and why is it servlets?
>>
>>58768254
It's ok anon, making a game require no artistic talent.
>>
>>58768150
Good, I have a Vulkan instance, a Win32 window, and a Vulkan surface for the window.
>>
>>58769973
>>58769937
Thanks, ended up using
runMontyHall :: Monad m (GameState -> m Door) -> m Prize
>>
is the texinfo version of SICP worth using?
>>
>>58770000
If you wanna do web development stuff, /wdg/ would be a better place to check.

If you wanna do Real™ Programming, pick a general-purpose language (C++, Python, Java, anything but Haskell) and get a compiler/interpreter/IDE running and find a beginner's book in your language of choice.
>>
>>58770373
>C++, Python, Java,
These are all the worst and memeiest languages you could have recommended.
>>
>>58770393
What's the language they should learn then?
>>
>>58770416
>they
>>>/r/ibbit
>>
>>58770416
Haskell, Lisp, x86 asm
>>
>>58770393
You're right, I should've put Rust, Go, and Javascript
>>
>>58770416
C or Scheme
>>
>>58770416
C
you might as well just go to plebbit if that wasn't your first language.
then this >>58770437
>>
>>58770393
>C++ a meme language
kill yourself
>>
>>58770447
this. preferably both
>>
>>58770416
>>58770447
Racket
>>
>>58770285
>gnu trash
Probably not.
>>
>>58770457
How on earth is C++ not a meme language?
It's poorly designed, and all of the users are cargo-cultists who get extremely defensive whenever it's criticised.
It's just like python, but even more of a clusterfuck.
>>
>>58770521
there is no way something can be a "meme" language.
that being said it's trash and should never be used.
>>
>>58770546
meme has become synonymous with trash on here.
>>
>>58770437
asm is great, it's also good idea to start with binary and go to hexadecimal after that and then the memory.
>>
>>58770554
which doesn't justify the perversion of it's original meaning. that would make the redditors feel more comfortable.
>>
TFW Java is literally Pajeet tier language and no non code monkey company uses it currently. If you even bother suggesting Java to a beginner you should literally quit your job and start selling pizzas or something. You are the a language that should have died 10 years ago exists today.

On the topic a strictly type oriented language such as C# would be best for a beginner.
The reason being is that you won't learn any bad habbits and actually understand how the logic works. Another reason why I am vouching for C# is how widely used and evcing is it ATM and can be used as a better alternative to other popular languages such as PHP, Java and in some cases C++.

Also if someone tells you C++ is a meme language you should probably never listen to him again. Proper development in C++ is very hard and requires years of actual programming experience, thus is not recommended for beginners at all.
>>
>>58770559
>binary and go to hexadecimal
Those are number bases, not programming languages, you fucking idiot.
It's completely obvious that anybody who says this is a complete retard.
What you're actually talking about is machine code, and there is absolutely no reason to know it unless you're writing an assembler.
>>
>>58770511
but don't most lispers/schemers use emacs
>>
File: 1362748152458.jpg (30KB, 500x376px) Image search: [Google]
1362748152458.jpg
30KB, 500x376px
>>58770559
>it's also good idea to start with binary and go to hexadecimal after that and then the memory
What are you even trying to say?
>>
>>58770601
so? how does it make the general gnu product any less trash?
emacs is a rare exception, just like gcc.
>>
New thread:

>>58770625
>>58770625
>>58770625
>>
>>58770598
>C# is different from java you guyss

Every single /dpt/ thread ever
>>
>>58770648
Did you poo in the loo today Pajeet?
>>
>>58769668
???
I have no idea what this even does but here's my haskell transcription of the code

import Control.Monad(foldM_)

-- Gives a list of all digits of 'n' in base 'd'
-- e.g. digs 1234 10 = [4,3,2,1]
digs :: Integer -> Integer -> [Integer]
digs 0 d = []
digs n d = r:digs q d
where
(q,r) = n `divMod` d

stein n d = sum (f <$> zip [0..] (digs n d))
where
f (i,r) = r * (d+1) ^ stein i d

gs :: Integer -> Integer -> Integer
gs n d = stein n d - 1

main :: IO ()
main = do
putStr "Enter value: "
t <- readLn
foldM_ (\t i -> do
print t
return (gs t i))
t
[2..10]
>>
>>58770668
They both suck and aren't good choices.
C++ is an even worse choice for a beginner but C++ can be a worthwhile tool in the right hands for the right reasons.
>>
How do you guys keep your motivation to keep learning code?

I was working on a simple C# project in unity, but I stopped 3 months ago and haven't touched it since.

How do I get that motivation back?
>>
>>58771834
>motivation
useless plebbit tier shit
>>
>>58771872
shutup nerd
>>
>>58771898
you are a literal plebbitor though if you think "motivation" can be generated at will.
why do you even want to do programming? you clearly aren't interested in it.
>>
>>58771922
wait wait wait, who are you again?
>>
>>58771922
faggot
>>
>>58771938
your father
>>58771954
really now?
>>
>>58771988
*tips fedora*
*pushes up glasses*
"I ARE GAY"
>>
>>58772007
wanna fuck?
>>
>>58771988
your point nigger?
>>
>>58772028
only if you have a nice little boypucci, I'm not into overweight hippos'
>>
Can anyone help me decipher this error?
its in C++

"required from 'void do_tests(std::string) [with SET = array_intset; std::string = std::basic_string<char>]"
Thread posts: 327
Thread images: 35


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