[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: 328
Thread images: 37

File: indians5.png (44KB, 753x772px) Image search: [Google]
indians5.png
44KB, 753x772px
Previous thread: >>55924562

Whatcha workin' on, /g/?

>putting /dpt/ in the subject edition
>>
First for: what language is best for serious AI development? I want to make my robot qt and name her Eva.
>>
>>55931637
Doing some actual fun CRUD with some live databases and APIs.

Fuck the haters, I love working with data.
>>
First for C++ is shit
>>
First for guile
>>
>>55931654
>haters
Are you a 12 year old that frequents youtube comments or something?
>>
>>55931668
Haters gonna hate hate hate
>>
>>55931637
thank you for not posting a fag thread
>>
>>55931673
I'm just gonna shake, shake, shake, shake, shake
>>
>>55931653
Python seems to be the most commonly used library for machine learning, most of the Python ML libraries are written in C++.
>>
>>55931688
And fakers gonna fake fake fake
>>
god that text rendering is awful
>>
>>55931675
Jeg ville poste en norsk tråd.
>>
>>55931692
Wait how does
>Python seems to be the most commonly used library for machine learning
relate to
>most of the Python ML libraries are written in C++.

To me that seems more of a "learn C++" than learn python.
>>
File: HDDraft, 4.0.png (2MB, 3840x2160px) Image search: [Google]
HDDraft, 4.0.png
2MB, 3840x2160px
First for rectangle with words on it
>>
>>55931653
Probably D, Go or Rust.
_good_ AI is performance intensive. And those are modern speed languages.

Could of course go C++ but then you have a bunch of morons making pull requests if you're ever open sourcing it.
>>
File: 1449656929666.gif (289KB, 447x415px) Image search: [Google]
1449656929666.gif
289KB, 447x415px
Why are there zero debug utilities for determining where wpf controls's data sources are grounded?
>>
>>55931726
It's because ML people can't program and need a babby language
>>
>>55931727
I can't wait for 30 posts saying 'roll' and literally no one actually posting their results.
>>
>>55931722
>Jeg
I
>ville
will
>poste
post
>en
a
>norsk
Norse/norwegian
> tråd.
thread

Thansk vikings for continuously raping my ancestors. Now I too can understand the language of the norsemen.
>>
tfw you search tutorials on youtube and the only videos are made by indians
>>
>>55931728
>Could of course go C++ but then you have a bunch of morons making pull requests if you're ever open sourcing it.
>open sourcing my waifu
>shiggy diggy

I'm not investing potentially thousands of hours just to make her available to the entire world. My waifu isn't a slut thank you very much.
>>
>>55931771
Stop programming in C, then.
>>
>>55931726
it's not that python is good, it's just that python is all that these "academics" and hobbyists know
>>
File: asdf.png (60KB, 1426x808px) Image search: [Google]
asdf.png
60KB, 1426x808px
Is it just me, or is the section for "I" missing a particular entry?
>>
>>55931797
>it's not that python is good
True. I learned that recently when I listened to podcast on supposedly how Eve online was written in python only for the dev to be like "oh most of it was written in C++ or like Java.
>>
>>55931814
yeah, iceland
>>
>>55931727
roll
>>
File: zzz.png (6KB, 94x542px) Image search: [Google]
zzz.png
6KB, 94x542px
>tfw there's literally no better way to do what you're doing and the best way is tedious
>>
>>55931814
You mean Iraq?
>>
>>55931814
it only includes programmers who are noteworthy
>>
>>55931863
Clearly he meant Iroquese.
>>
>>55931858
What language and problem?
>>
>>55931881
There is a suspicious lack of Indonesians on that list.
>>
>>55931758
That's not correct, I'm afraid.

http://www.verbix.com/webverbix/go.php?T1=ville&Submit=Go&D1=25&H1=125
>>
>>55931858
looks like shit, you're probably doing it wrong
>>
Rust is based, prove me wrong.
>>
>>55931814
Don't be such an antisemite
>>
>>55931858
>>55931900
It looks like JavaScript?
>>
Real talk, Java is a great language and anyone who disagrees is an edgy kid who just started learning to program
>>
>>55931758
it's more like "i was going to post a norwegian thread"
>>
File: ice cream i love ice cream.png (278KB, 1004x768px) Image search: [Google]
ice cream i love ice cream.png
278KB, 1004x768px
What's the best resource for stuff that K&R doesn't cover, like threading and sockets?
>>
>>55931925
this, java and C++ are literally the best programming languages
>>
>>55931925
Still butthurt that you don't understand Haskell, huh?
>>
>>55931924
> capitalized method names
> Visual Studio colors
It's C# you dunce.
>>
>>55931943
haskell isn't hard to understand, it's just fucking shit, get your head out of your ass smug tard
>>
>>55931924
.Map is capital, so not likely. C#?
>>
>>55931900
>>55931906
Moving data from a view from one database, to a table in another database.

The destination table is not exactly the same as the source, and so the data needs to be individually mapped to new column names, and functions need to be performed on some of the data to obfuscate it for public viewing.

It's basically a custom ETL package, and I would bet my penis(female) that there's not much of a better way.
>>
>>55931925
It's only good for raking in money doing codemonkey work.
>>
>>55931653
Tie between python and java. See tensorflow and deeplearning4j
>>
>>55931990
>dynamic typing
>>
>>55931961
I bet you couldn't even grok applicatives, I'll be enjoying my delicious fast development and type safety
>>
Programming babby here; let's say that I have nested dictionaries in C#; three of them, to be exact. Looping through one is easy enough, but how do I access the other two underlying dictionaries and print their contents based on input from the user? This was easy enough to understand in Python but I've run into some limitations with the end goal of my project by using Python.
>>
>>55932020
Using LINQ with lambda expressions.

I'll write up an example in a sec.
>>
>>55932020
You shouldn't have learned Python, you have broken your brain and now can't think outside Python. The only solution is a cerebral enema.
>>
>>55931925
I half-agree with you.

Modern Java is great (Java 8 and on) because you have typed generics and you have default methods on interfaces and all sorts of good stuff like that, plus the JVM is actually fast.

Legacy Java (Java 5 or 6, or, god forbid, earlier) is fucking shit, because your generics aren't typed so it'll be buggy, and you don't have enough sugar to work around the class system, so you have to write Design Pattern Soup.
>>
>>55932020
>>55932031
Actually, could you give me your dictionary declarations so I can show you based off of what you're doing?
>>
>>55931999
>grok
kill yourself
>fast development
stay delusional
>>
>>55932044
Dictionary<string, Dictionary<string, Dictionary<string, string>>> ppcDatabase = new Dictionary<string, Dictionary<string, Dictionary<string, string>>>
{
{
"AL",
new Dictionary<string, Dictionary<string,string>>
{
{ "Autauga",
new Dictionary<string, string>
{
{"Autaugaville", "6"},
{"Billingsley", "9" },

}
}
}
}
};


>>55932038
Don't talk to me or my wife's programming language ever again.
>>
>>55932050
Not to mention the benefits of pure functions when it comes to testing.

Face it, you couldn't code your way out of a paper bag if your dildo collection depended on it.
>>
>>55931996
>being retarded
>hurr, let me write my own distributed, GPU-enabled machine learning library
Also java is static, you autist.
>>
>>55932090
I was talking about Python being shit, faggot.
>>
>>55931858
Just make a mapForMe function. Pass in the thing you're mapping to and an array of what you're mapping. Have it map every element in array. Learn how to automate your life code monkey
>>
>>55932039
No, it's still shit. Lambdas and streams and exceptions interact horribly and the workaround is a complete mess. Generics are still the most basic kind (pun intended, I'm not talking about C# being better here).
>>
>>55932075
pretty sure you have extranous brackets there.
Also there's a possibility that nesting dictionaries is not optimal data structure to whatever you are doing.

pccdata["AL"]["Autauga"]["Autaugaville"]
>>
Making a basic Pong game in Rust + SDL2
>>
>>55932077
have you even made a single program worth mentioning in haskell lmfao

>Face it, you couldn't code your way out of a paper bag if your dildo collection depended on it.
nice projection
>>
>>55932134
I wrote a Python compiler in it.
>>
>>55931773
I still say D or Go though.
>>
>>55932148
I'm not him but why does literally everybody who uses Haskell use it for writing compilers or interpreters or other programming language theory shit?

It's some powerful trend.
>>
>>55932148
give me a proof
>>
>>55932220
I can't, my employer owns the code.
>>
>>55932218
haskell is useless for writing real software
>>
>subset of C/C++ has no restrict keyword or designated initializers for structs/unions or flexible array member

Why did C++11 even bother to update their standard library C reference to C99 if they aren't willing to put in the most useful things in it? They're planning to do it again in C++17 to go with C11 but not putting in effort to make atomics and threading compatible with one another makes it pointless yet again.

They should seriously just drop C compatibility if they are just keeping it in what is basically name only.
>>
>>55932124
I've been given conflicting advice between using nested dicts or hashtable. I don't have a whole lot of knowledge or understanding outside of how to use them in their simplest forms for simple textbook practice applications; this project was partly so that I wouldn't be operating in my comfort zone but I think I might be too far away from it. I'm not sure which would provide the best results.
>>
>>55932218
Good question.

I think it's a combination of immutability, concise code, and good quality libraries available.
>>
>>55932225
>my employer
nice lying on the internet lmfao, as if your employer uses haskell and needed you to write a python compiler
>>
Proof that Haskell is a meme: You increment things by typing succ (Num)

it give u the succ
>>
>>55932218
actually Ocaml is better for compilers due to Polymorphic variants (which can't be done cleanly in haskell)
>>
>>55931771
So you're probably looking up stuff people pay to know.
>>
>>55931771
>video tutorials
RTFM
>>
>>55932240
>they should drop C compatibility
Yeah. Or you should move to a language not made by a retarded Norwegian.
>>
>>55932287
succ is short for successor
i.e. the successor of a value
5 -> 6
'a' -> 'b'
>>
>yfw Rust has a calculus of constructions
>>
>>55932240
>what are compiler extensions
>>
>>55932328
class  Enum a   where
...
succ = toEnum . (+ 1) . fromEnum
pred = toEnum . (subtract 1) . fromEnum
...
>>
>>55931999
>grok
wew lad
>>
>>55932336

>not being pendactic and sticking to the standard unless doing platform-specific work
>>
>youtube has/had buffering issues since switching to ssl
>switch to deezer
>rediscovered some good tracks
>but the loud filtered shit on deezer is fatiguing to listen to
KILL ME
>>
>>55932481
>>youtube has/had buffering issues since switching to ssl

you kidding?
>>
>>55932491
in the last couple of weeks, since switching to encrypted HSTS shit, some videos would take a long time to load, and it's not just me, there are plenty of similar complaints online from the last the couple of weeks
>>
>>55931906
Idiot.
>>
>>55931925
Idiot.
>>
>>55932506
Yeah it's happening for me too in all browsers except Internet Explorer. Bravo Google.
>>
I'm having trouble implementing a deciphering tool.
Basically, the decryption formula is d(x) = a^-1 (x-b) mod m (It's the Affine Cipher:http://rumkin.com/tools/cipher/affine.php)
And the first couple of letters work okay, but I can't get the correct answer after that (pic related). Here's my code:
int main(int argc, const char * argv[]) {
std::cout << AffineCipher("Hello", 3, 0) << std::endl;
std::cout << AffineDecipher("VMHHQ", 3, 0) << std::endl;

return 0;
}
std::string AffineDecipher(std::string input, int multiplier, int shift)
{ //Decryption is a slightly different formula, d(x) = a-1(x - b) mod m.
std::string output = "";
for(int i = 0; i < input.length(); i++)
{
char currChar = input[i]-'A';
char outputChar = (currChar-shift)*(1./multiplier);
output += outputChar%26 +'A'; //Mod is on another line because you can't mod a double
}
return output;
}
>>
>>55932579
Vmhhq and VMHHQ are very different things
>>
>>55932595
I know, but I'm trying to do it with capital letters first to sort of understand the process. Don't want to add unnecessary errors.
>>
>>55932579

>1./multiplier

Why the dot? You are limiting yourself to 7 significant digits.
>>
>>55932672
1. is a double literal
>>
File: growls at snakes.jpg (36KB, 377x256px) Image search: [Google]
growls at snakes.jpg
36KB, 377x256px
>>55931928
Hello?
>>
>>55932614
just try putting Vmhhq instead of VMHHQ and run it
>>
File: anal beads.png (71KB, 861x1489px) Image search: [Google]
anal beads.png
71KB, 861x1489px
>>55932075
>>55932245
That's not how you store data like that in C#.

Here's a better option: create objects for what you're trying to represent, and then create distinct relational objects with keys as references between them. Think about basic relational database design.

In this example, we could use three lists representing tables in a database. If you'd like, you can store these in a single object and call it your database.

It looks like a lot of setup, but the idea is that you set it up once and then your life is easier later. All of the data is type-safe, and you can make constraints on what goes in and out, as well as naming things in a way that's easy to retrieve with IntelliSense.

Big bonus on the fact that you can directly access the list of Cities, rather than trickling down through a hierarchical object.

See pastebin for code:
http://pastebin.com/ifYjHfHf
>>
>>55932774

int main(int argc, const char * argv[]) {
std::cout << AffineCipher("Hello", 3, 0) << std::endl;
std::cout << AffineDecipher("Vmhhq", 3, 0) << std::endl;

return 0;
}
std::string AffineDecipher(std::string input, int multiplier, int shift)
{ //Decryption is a slightly different formula, d(x) = a-1(x - b) mod m.
std::string output = "";
for(int i = 0; i < input.length(); i++)
{
char currChar = input[i]-'A';
char outputChar = (currChar-shift)*(1./multiplier);
if(isupper(input[i]))
output += outputChar%26 +'A'; //Mod is on another line because you can't mod a double
else{
output += outputChar%26 +'a'; //Mod is on another line because you can't mod a double
}
}
return output;
}


It's a bit funky
>>
>>55932810
>input[i]-'A';
No.

Also that's not how you compute the inverse in a modulo set
>>
Idk what to do can someone post that img with the list of things to make.

Its going to rain all weekend where im at and i want to shut myself in.
>>
>>55932860
Read the fucking thread, idiot.

God fucking damn it, I hate people like you.
>>
>>55932787
definitely follow this
>>
>>55932871
dang all the flavors and pick to be salt.
>>
File: codingchallenges.png (25KB, 634x221px) Image search: [Google]
codingchallenges.png
25KB, 634x221px
Last digit of your post id decides about your programming challenge for the weekend
>>
>>55932810
if the formula is correct i don't know what the fuck
>>
>>55932909
Godfuckindammit I actually believed for a second that this would be a nonshit post
>>
>>55932787
>>55932875
Understood, thank you very much. I'm definitely going to have to take this slowly but the paste was eye-opening as hell.
>>
>>55932939
I'll be here for the next 4 hours. Feel free to ask anything else.

t. non-Indian C# developer with a job
>>
>>55932350

Haha, I like how I can do this in Ruby, too:

p  1 . succ . pred   # prints "1"
>>
>>55932949
i have a question that's been bugging me for a while now, if you don't mind. what exactly does that "t." stand for?
>>
>>55932837
How would you do it, then?
The formula for decryption is:
d(x) = a^-1 * (x - b) mod m

The only thing you need is the multiplicative inverse of the multiplier.

I'm doing
input[i] -'A'

simply because that's how I guarantee that the indexes start at zero for the alphabet.

That or I'm just completely misunderstanding you.

>>55932928
That makes two of us
>>
>>55932928
It's not it's just not: no way one-third is one of the first 26 natural numbers. See?
>>
File: t.png (26KB, 687x268px) Image search: [Google]
t.png
26KB, 687x268px
>>55932973
>>
>>55932973
>>55933004
It's worth noting that the use of "t." as "regards" is Finnish in origin.
>>
>>55932976
>I'm doing input[i] -'A'
>simply because that's how I guarantee that the indexes start at zero for the alphabet.
And what if input [2] is lowercase you dummy? This explains why you got a different wrong answer with your second attempt than your first. As for the multiplicative inverse: 3 * 9 mod 26 = 1, so 9 is an inverse of 3 in a modulo set with n=26. 1/3 is not because it's not one of the 26 integers in that set. Think about it.
>>
File: 1086321.png (29KB, 400x400px) Image search: [Google]
1086321.png
29KB, 400x400px
git
local repo with remote being github
created gitlab account
can I use that same local git rep folder to push stuff to gitlab?
like changing some remote address or something?

also I am doing this in hope that they let me upload there 800MB of exe/msi files, installation files, and some powershell scripts that install them
does gitlab allow hosting shit like that? For github I had gitignore filter that shit out
>>
>>55932976
>>55932979
i might have found the error

a^-1 is not 1/a, it's the modular multiplicative inverse

https://en.wikipedia.org/wiki/Modular_multiplicative_inverse
>>
>>55932113
It's not just array of column names to array of different column names.

Some columns need to have an Action performed on them as the ETL process is happening. For example, the previous DBA was retarded and had the values "Closed" and "Not Closed" under the column "IsClosed", so the map for that field is like this:
.Map("IsClosed", "IsClosed", x => x.Equals("Closed") ? 1 : 0)


This is because the destination table utilizes a bit-type column to save space and increase performance, rather than two states of text.

Multiple issues like this by 30+ columns and it has to be written out manually at least once.

Obviously, I'll abstract this under a method that's easily called in one line, once I get everything polished.
>>
File: aXbVN9g_700b.jpg (77KB, 587x551px) Image search: [Google]
aXbVN9g_700b.jpg
77KB, 587x551px
>>55933105
Yes that's it! Congrats NerdAnon
>>
>>55932909

I'll give it a try:

class Hello_world
def method_missing(m) puts "Hello World" end
end

h = Hello_world.new
h.send :hello_world_with_metaprogramming
>>
>>55933105
Thanks, anon!

Gonna try to implement this. Be right back
>>
>>55933077
yes you can have multiple remotes or you can change existing ones

git remote help
>>
>>55932909
5) What's the point of a string array if "Hello World" is just one entry?
>>
>>55933162

And one more for the showcase:

require "continuation"

a = [ "World", "Hello"]
callcc{|cc| $cc = cc}
puts a.pop
$cc.call unless a.empty?
>>
>>55932050
>>55932457
What's with this Heinlein hate?
>>
>>55933020
Actually, it's Hungarian.
>>
>>55933386

It's definitely Finnish, as well.
>>
>>55933271
Strings are char arrays.
>>
>>55933271

That's not the point, anon..

a = "Hello World" . split //
>>
>>55933364
i have nothing against him it's the use of the word by faggy shitlang devs
>>
>>55931653
none
>serious AI development
is not a thing. the entire AI/ML field is a bunch of dumbasses feeding data from someone else into code from someone else and calling that "research" despite not using any innovative methods or making any technological developments. AI weenies just sit there and make new demos all day that don't even work in the real world. 90% of the papers of AI claim findings by repeating the same process on huge data sets only to find one or two test cases where their model actually works at all.
>>55931747
literally this. they don't write any of the code themselves, and if they tried to it would be 100x slower and get worse results. Python is the perfect fit because it's all about importing the entire solution and writing nothing on your own.
>>
>>55933425

Or:
a = "Hello World" . each_char . to_a
>>
>>55933202
thnx
it was fairly easy, now waiting for few hours while my 125 kB/s writes it all up
>>
File: prolapsed rectum.png (3KB, 481x33px) Image search: [Google]
prolapsed rectum.png
3KB, 481x33px
>>55933425
lame
>>
>>55933525
Lame.

"Hello world.".array.each!write;
>>
File: em.png (3KB, 351x63px) Image search: [Google]
em.png
3KB, 351x63px
>>55933558
fuck you want with me man

are we golfing?
>>
>>55933525

Is that C# ?

I didn't know that you can also add methods to anonymous string there.. pretty impressive.

But how about that one..

"Hello World"
. reverse
. reverse
. match(/^(.*) (.*)$/)


puts $1 << " " << $2
>>
>>55933701
The ones in >>55933525 are built-in.

In >>55933694, I'm showing how you can define your own extension methods for object types (and generics):

public static List<TSource> l<TSource>(this IEnumerable<TSource> src)
{
return new List<TSource>(src);
}

public static void we<T>(this IEnumerable<T> source)
{
foreach (T element in source) Write(element);
}
>>
>>55931653

Python and C++.
>>
File: suk d.png (2KB, 454x32px) Image search: [Google]
suk d.png
2KB, 454x32px
>>55933719
>>
>>55933701
>Is that C# ?
yes
>>
>>55931637
No, the image should be a thread that gets locked because a duplicate exists that either is barely relevant, didn't actually get answered, or is a valid answer 5 years ago and the latest version of the language (that most tutorials/sources haven't updated too either) has a vastly superior and easier solution than the supplied answer.
>>
>>55933755
>Closed: Use the search function next time
>>
>>55933694
>are we golfing?

Now, that was just D equivalent of your code.
>>
Finally started working on a system to emulate legend of mana tempering in Rust. Figured I should probably get the base system hashed before I go crazy trying to generate recipes.

This should be enough to get what I care about for now (Baseline stats). Armor is essentially the same as Weapon.

Pretty sure I'm going to handle cards via a trait that just defines Apply / Remove functions for weapons and armor. Each item will have a 4 slot stack of Cards, when it gets pushed to the stack the Add function for the armor or weapon is called and when it pops off the stack the Remove function is called.

#[derive(PartialEq, Copy, Clone)]
enum Element {
Salamander = 0 ,
Undine ,
Gnome ,
Jinn ,
Dryad ,
Luna ,
Wisp ,
Shade = 7 ,
}

#[derive(PartialEq, Copy, Clone)]
enum Attack {
Sharp = 0 ,
Heavy ,
Force ,
Tech = 3 ,
}

#[derive(PartialEq, Copy, Clone)]
enum WeaponType {
Knife = 0 ,
Sword ,
Axe ,
TwoSword ,
TwoAxe ,
Hammer ,
Spear ,
Staff ,
Glove ,
Flail ,
Bow = 10 ,
}

struct Weapon {
base_atk : [u8 ; 4] ,
mod_atk : [u8 ; 4] ,
atk_mult : [f32 ; 4] ,
elements : [u8 ; 8] ,
ele_resist : [u8 ; 8],
}
>>
>>55931982
What do i need to get Java dev jobs? As in a certificate or just a general portfolio or even accounts on programming challenges, etc?
>>
>>55933719
>>55933745

I like that..

I mean the Ruby syntax is a tad shorter - personally I don't like this() brackets() everywhere().

But considering that C# plays in the Java league and Ruby is sloow (but wait utill Ruby 3 comes in 2019!)..
and yeah, it has this funky LINQ thingy, right? I might give C# a try.
>>
>>55932481
trying spotify (free) now, it sure has fucking garbage sound quality, maybe not too bad on desktop but it has ads and i'm not sure you can block them properly, can't turn off the normalization filtering shit on web player
>>
best book/site to learn ASP.NET CORE?
>>
int get(int n)
{
switch (n) {
case 1:
return 1;
case 2:
return 2;
case 3:
return 3;
case 4:
return 4;
case 5:
return 5;
case 6:
return 6;
case 7:
return 7;
case 8:
return 8;
case 9:
return 9;
default:
return 0;
}
}
>>
>>55933886
nvm spotify is completely FUCKED on desktop too, sounds muffled, bass is just muddled, fuck this shit
>>
>>55933907

I know this is bait, but..
>statical typing

n = "ruby"

puts case n
when 0..9; n
else; 0
end
>>
>>55933991
case n do
n when n in 0..9
_ -> 0
end


;-)
>>
>>55932765
>flies in simulator

ayyyy
Nice War Thunder memes.
>>
File: mfw.gif (19KB, 400x300px) Image search: [Google]
mfw.gif
19KB, 400x300px
>>55934069

I-is this Elixir, senpai?
>>
>>55934130
yes
>>
>>55934130
k-k-k--y-y-y-s-s--s
>>
>>55933851
The parentheses() help you know that it's a method being called on the object.

Without that, it would be impossible to tell at-a-glance if it's a property or method of an object.

Yes, the funky LINQ thingy is like programming crack.
>>
>>55933991
>dynamic typing by default
>acceptable
>>
>>55931727
roll at work
>>
File: puke.jpg (62KB, 571x800px) Image search: [Google]
puke.jpg
62KB, 571x800px
>>55934134

Yay!

Oh shit, next year I'm gonna learn Erlang and Elixir, I swear..

But right now I'm so fucking busy with C, Java and Ruby.. ;__;


It's hard to keep all this stuff in your head, really..
>>
>>55931727

ayy lmao
>>
>>55934154

>Yes, the funky LINQ thingy is like programming crack.

A friend of mine is a C# dude and he showed me some LINQ stuff, damn, it's nice..


I'm halfway decent in VBA and Java, how much effort would if be to pick up C# for me?
>>
File: everything can suck my dick.png (8KB, 769x91px) Image search: [Google]
everything can suck my dick.png
8KB, 769x91px
Global extension methods extending "object" are not advisable.
>>
>>55934287

Is that C# or D?

I'm confused..
>>
>>55934274
>I'm halfway decent in VBA and Java, how much effort would if be to pick up C# for me?
The learning curve for you will be extremely low, because C# obviously has a massive amount of influence from Java.

It will mostly be a matter of learning the language features and using them wherever you see fit.

LINQ, much like any other language's lambda implementation, just means you're thinking in sets, rather than iteratively.

>>55934327
It's C#
>>
>>55934192

Yeah, after the fifth or sixth language it gets fun. Similar syntax with slight nuances can create a bunch of unintended compiler errors.
>>
>>55933907
>>55933991
(defmacro get (n)
`(case n
(,(loop for i from 1 to 9 collect i) n)
(T 0)))
>>
File: texteditor.png (70KB, 1089x913px) Image search: [Google]
texteditor.png
70KB, 1089x913px
>>55931752
500 Lines into text editor.
>>
>>55934387

Well just one question are you from Colombia?
>>
>>55934387
>having spellcheck on

Do your friends call you Dan?
>>
File: UnAssigned_004.gif (2MB, 598x600px) Image search: [Google]
UnAssigned_004.gif
2MB, 598x600px
>>55934408
>>55934416
>>
File: Nothing Can be Removed.png (204KB, 1920x1080px) Image search: [Google]
Nothing Can be Removed.png
204KB, 1920x1080px
>>55934387

>>55934416

Assuming that is actually his name in the top I'd say it is a high possibility.

Here is the image that was deleted just in case anyone doesn't know what we're talking about.
>>
>>55934437
There's literal hundreds of people with your name.

Just put a smiley face with the caret nose and move on.

No one's going to be able to dox you.
>>
>>55934465

What you should say is /DPT doesn't have anyone who can be assed or reason to dox him.
>>
>>55934192
I'd say learn it only if you have a specific use case for it.

>>55934327
That's C#, in D that would be:
import std.stdio;
import std.typecons;
import std.algorithm;
import std.range;

void ActuallyJustWriteSuckMyDick(T)(T v)
{
"Suck my dick.".writeln;
}

class Thing
{
}

void main(string[] args)
{
tuple("Hello world", new Thing(), 1, iota(0, 10))
.each!ActuallyJustWriteSuckMyDick;
}
>>
>>55934348

I prefer scheme over CL..
:P

>>55934347

Yeah, that's why you have to stay in one "ecosystem"..

Java + C --> get C# with minmal effort
Java + Scheme --> get Clojure with minmal effort
Java + Haskell --> get Scala with minimal effort
Ruby + Java --> get Groovy with minmal effort
Ruby + Erlang --> get Elixir with minmal effort


I know this is not 100% accurate, but my point is I think if you just stay in one "area" of langauges you can keep the overlap in your head..

Oh shit, life's too short for getting a decent programmer, bro.
>>
>>55934465
yeah, why would anyone do such a bad thing?
>>
>>55931727
I'm gonna roll but not actually do it.
>>
>>55934563
How is a random name picker considered medium difficulty?
>>
>>55931858
foreach?
>>
>>55934505

>I'd say learn it only if you have a specific use case for it.

Yes I have..

While I love Ruby (and think Rails is still pretty decent), matter of fact Rails is just too slow sometimes.

Elixir is just - I really hate to say this -a better langauge, because it has so many stuff ruby doesn't: guards, immutable values, decent concurrency..
And I really think Erlang has a fantastic language design, the way they handle errors is just damn powerfull.

Also even if I'll never abandon Ruby (since it's amazing for scripting and small tasks) I do think I need to learn a "purely functional" language like Erlang to get my programming skills on the next level.

Concurrency is the future.
>>
>>55934586
read
>>55933108
>>
>>55934617
>Rails is just too slow sometimes.
what on earth are you even doing?
>>
>>55933907
x = {1:1, 2:2, 3:3, 4:4}
try:
return x[input]
except KeyError:
return 0
>>
>>55934516

C, C++, Java, C#, Python, Rust, Lua, Scheme, and Basic are all languages I've chosen to use to a non trivial extent at one point or another.

The overlap is a bitch sometimes.
>>
>>55934543
>>>/b/
>>
>>55934655

You mean I don't need to rebuild WhatsApp?

True, for 90% of all websites Rails is "good enough" or you can switch to a smaller framework like a simple Rack app..

But still, benchmarks say phoenix is just 10 fucking times faster than rails.

Also Ecto is better designed than ActiveRecord and much more..


I Rails is great for being productive and it's used in industry. But everything I hear about Elixir/Phoenix seem just.. right.
>>
>>55934617
>purely functional langs solve concurrency
nice meme
>>
>>55933174
>>55933105

Okay, so I made a modular inverse function, but I'm having issues with the decryption.

Code for the modular inverse function:

int findModInverse(int a, int mod)
{ //Given an integer a, finds i such that a*i%mod == 1;
int result = 0;
for(int i = 1; i < 5*mod; i++)
{
if((i*a)%mod == 1)
{ result = i;
break;}

}
return result;
}


Code for the decryption function:
std::string AffineDecipher(std::string input, int multiplier, int shift)
{ //Decryption is a slightly different formula, d(x) = a^(-1)(x - b) mod m. (Note, a^-1 isn't the multiplicative inverse (1/a), it's the modular inverse)
// x = 3^-1 % 11
// (3*x)%11 = 1, x = 4

std::string output = "";
for(int i = 0; i < input.length(); i++)
{
std::cout << "Original Character = " << input[i] << "\t" << std::endl;
char currChar = findModInverse((input[i]-'A' - shift), 26);
std::cout << "\tNew Character: " << char(currChar + 'A') << std::endl;
}
return output;
}


What's happening is that every other letter becomes an "A", and part of the problem (I think) is that the modular function can't use "0" because then the formula doesn't really work, but your guess is as good (if not better) than mine)
>>
>>55934712

For me it's VBA, C, Java, Scheme (muh SICP!!), Ruby..

..and hopefully Erlang and Elixir in the future.

I'd love to learn Rust or Elm, but it's out of scope for the next years.


And yeah, I get what you mean, it can be confusing if languages are too close together.
But I think that C, C++, Java, C# probably go together very well (even though I don't know C++ or C#), because they are similar in the way they approach problems.
>>
>>55931653

Prolog
>>
>>55934772

No, it's not like that.

But the functional paradigm makes concurrency much easier. Mutable values, Shared state.. it's makes concurrency more difficult.

I'm not saying you can't be great at concurrency with somethign like C. But you have to adress more problems.
>>
>>55933907
That's the best implementation I can think of. Anything else is bloat.
>>
File: ff48.png (10KB, 770x52px) Image search: [Google]
ff48.png
10KB, 770x52px
God damn firefox i just spent an hour trying to fix an old greasemonkey script.
someone please explain why
includes
is better than
contains
?
to be fair it's a 3 yearold script and i haven't exactly been checking for warnings..
>>
Where can I learn how to write my own graphics library using opengl? I just don't know how I want to wrap things and I don't feel confident enough to invent stuff.
>>
>>55934785
don't plug everything into findModInverse(), for the case of multiplier=3 it should just be 9, see http://planetcalc.com/3311/

so you have (9 * (input[i]-'A' - shift) % 26) + 'A', i think
>>
I'm writing genetic algorithms in VBA.

No, really.
>>
>>55934785
//Given an integer a, finds i such that a*i%mod == 1;
int findModInverse(int a, int mod)
{
for(int i = 1; i < 5*mod; i++) {
if((i*a)%mod == 1) {
return i;
}
}
return -1
}
>>
>>55934869

> Sacrificing control and tune up abilities
> Abstracting time and space in your code
> IT'S BETTER BECAUSE MY CORES ARE HITTING 100% xDDDDDDDD

Please...
End yourself
>>
>>55934946
which ones?
>>
>>55934990
Not an argument.
>>
>>55934763
i mean that on my hands-on experience, if you use the right algorithms, scripting languages work fast enough and reach velocity standards without trouble, i only see them flake in long running stuff where those little differences in velocity accumulate over long spans of time

i mean, 0.01 secs vs 1 sec is mostly the same, before you can focus your eyes on the output that 1 sec has already passed, the problem is when that accumulates and suddenly is 1hs vs 10hs, but most shit people need don't run for so long
>>
File: kids_these_days.jpg (48KB, 564x564px) Image search: [Google]
kids_these_days.jpg
48KB, 564x564px
I have git on gitlab/github/gitwhatever...

I put there 500MB of various exe files of installations, think libreoffice, 7zip, vlc, firefox,...
I push it up
repo is now 500MB in size
I will update the repo over the course of the year with recent versions of the installations

will the size be ever growing up? will it always keep the very first versions of the files, only adding next version and next version?
Growing to very large rapidly?

Or is there some deduplication process?
Or can I issue some command to forget older versions of large files?
>>
>>55935057
>will the size be ever growing up?
of course. newer versions, have more functionalities , bug fixes. thus the binaries will have a bigger size


just use dropbox nigga
>>
>>55935057
git isn't exactly designed to maintain binary files.
it might work but you should fine something else..
>>
>>55934990
Wow, ain't you a dumb shit?
>>
>>55934828

C# is parallel to Java but not close at all to C / C++ in style.

Idiomatic C# does things too differently and it has a syntax that lends itself to accidentally reverting to C++ and fucking yourself with the differences.

Oh, and it's interesting how you can tell what type of programmers people make by their languages. "Systems" programmers or library developers almost always list C, C++ first and then go into the standard industry languages or common scripting languages to embed. Web devs typically list languages like C#, JavaScript, Java, Python, Ruby, Perl. As for the standard wage monkies / pajeets it's almost always Java, C#, and SQL,
>>
>>55935113
>>55935120
>just use dropbox nigga
theres quite a few powershell scripts that install those installations
and some bath files
and there are occasionally some mst files that change msi installers
and some config files

its all about automatic unattended installation
for thoes powershell scrips the git approach works very well and what I am used to from python
>>
>>55935057
Mite wanna take a look at https://github.com/github/git-lfs
>>
>>55935155

what type programs people make *

Damn auto correct.
>>
>>55935177

I keep getting dubs and fucking up at hard at my native non-programming language.

10 / 10 would post again for the humor . Time for coffee!
>>
File: x.jpg (15KB, 450x332px) Image search: [Google]
x.jpg
15KB, 450x332px
>>55935222
>>
>>55934935
Holy shit that worked! Thank you very much!

I guess I just wasn't understanding that
(a^-1 (x-b) mod m)
was actually
a^-1 (mod m) * (x-b)

>>55934958
That's at least five times better than my method... Thanks!
>>
>>55931727
How would you do number 52? I would think a standard linear regression but you don't know the time frame to calculate it on so that'd be inefficient

I guess just get the high and low and do it that way or something
>>
Hello programming friends.

I just solved my first differential equation (pendulum equation) in Haskell ever.

Are you peepz interested in the code?
>>
So I have a program which works but it times out on some of the inputs for hackerrank. I've optimised it some already but can't think how to make it faster, though I'm not sure if the searching of the tuple list will be cached or not which I think should speed it up

import Control.Monad
import Data.List
import Control.Applicative

main :: IO ()
main = do
getLine
list <- map read <$> words <$> getLine
getLine
nums <- map read <$> lines <$> getContents
let a = tuplesum $ scanl1 (+) $ reverse $ sort list
mins = map (subset list a) nums
putStrLn $ concat (map (\x -> (show x) ++ "\n") mins)

subset :: [Integer] -> [(Integer,Integer)] -> Integer -> Integer
subset xs ys n
| sum xs < n = -1
| otherwise = searchtuple ys n

searchtuple :: (Num a, Ord a) => [(a,a)] -> a -> a
searchtuple [] n = 0
searchtuple ((a,b):xs) n
| n <= b = a
| otherwise = searchtuple xs n

tuplesum :: [Integer] -> [(Integer,Integer)]
tuplesum = zip [1..]


The problem: https://www.hackerrank.com/challenges/subset-sum
>>
>>55935486
loop through it once while remember the lowest price you could have bought at and the highest profit you could have made (the highest difference of the current price vs the current lowest price)
>>
>>55935564
i don't know haskell but sure. func my shit up
>>
>>55935567
Haskell is slow and their website has very strict time constraints.
>>
File: coca_cola.jpg (68KB, 800x800px) Image search: [Google]
coca_cola.jpg
68KB, 800x800px
both of my two tech internships have been at companies started by women, with a black man as my project manager.

none of you will understand these vibes
>>
>>55935582
It's under the functional programming banner and haskell is pretty fast for a functional language I thought. Then again the success rate is rather low for something which is pretty easy to actually program
>>
>>55935596
what language you use
>>
>>55935312

Lmfao how rare dubs, dubs, trips. Same mistake in all three posts.

Wonder I Do how such a thing happens. Yoda speak ftw.
>>
>>55935579
Alright so I've only been working in Haskell for two weeks, so it might not be the most efficient code, but I found it a decent start:


module ODEsolver where

-- List operations
import Data.List

-- JuicyPixels
import Codec.Picture

-- SVGFonts
import qualified Graphics.SVGFonts.ReadFont as F

-- Diagrams
import Diagrams.Prelude
import Diagrams.Backend.Rasterific

-- Chart
import Graphics.Rendering.Chart.Easy
import Graphics.Rendering.Chart.Backend.Diagrams
import Graphics.Rendering.Chart.Backend.Types

solveDE1 :: Double -> (Double,Double) -> Int -> [(Double,Double)]
solveDE1 omega (un,yn) n | n <= 0 = []
| otherwise = (u',y') : (solveDE1 omega (u',y') (n-1))
where
u' = un + yn*(1e-3)
y' = yn - (omega**2)*un*(1e-3)

stripFst :: [(Double,Double)] -> [(Double,Double)]
stripFst xs = zipWith (\x y -> (x,fst y)) (reverse [0,(1e-3)..1]) xs

stripSnd :: [(Double,Double)] -> [(Double,Double)]
stripSnd xs = zipWith (\x y -> (x,snd y)) (reverse [0,(1e-3)..1]) xs

plotDE1 = do
layout_title .= "Pendulum DE Plot"
plot(line "u(x)" [us])
plot(line "y(x)" [xs])
where
xs = stripSnd $ solveDE1 (50*pi) (0,1) 1000
us = stripFst $ solveDE1 (50*pi) (0,1) 1000

>>
File: node_js.png (10KB, 492x365px) Image search: [Google]
node_js.png
10KB, 492x365px
>>55935607
>>
>>55935607
ironpython
>>
OK someone please tell me how this guy does it: https://github.com/GrahamCampbell

I checked his history he committed yesterday at 11PM and then today again at 7AM, and he's been doing shit up until now

How can one CS fresher have this much steam? You told me CS undergrads are useless, but this guy maintains more than 30 projects all with tests, continuous integration, documentation, coding styles, versioning system, etc
>>
>>55935656
is he asian?
>>
>>55935656

A number of his large 'projects' are forked from others.
>>
>>55935671
he's british
>>
>>55934990

> Sacrificing control and tune up abilities

Exactly, that's the reason..

Immutable values guarantee that each time I use a certain function with a certain input the results are the same. If I have mutable values/objects I have to make sure I understand the state of each object, I need a control system for that which adds complexity and is more prone to errors.

> Abstracting time and space in your code

But again it's exactly the otehr way arround:
if you use procedural or OOP programming it's not easy to calulate space/time complexity..

Just consider a factory that produces objects depending on some input or think about complex nested loops where the indices move a lot..

With immutable values I can make better predictions, because the "for each" has always a time complexity of O(n) - you visit every object exactly one time.
Yes, you can also use the "visitor patter" in java, but in the end you do this only in small scale, not in large scale.


Why do you think Google uses "MapReduce" for example? Because it's much easier to deal with Big Data in a functional way.
>>
>>55935676
Well no shit he didn't make Laravel himself -- it's the most popular web framework for PHP and it was created when he was probably in primary school. But h'e the 2nd most active contributor
>>
At my work I am literally the only guy who works there, other than one of the RNs. The Office manager, intake coordinator, volunteer coordinator, Resident nurse, Admissions specialist, and almost all of the nurses, physicians, social workers, and HHAs are all women
>>
>>55935701
What's that got to do with anything?
>>
>>55934154
> Yes, the funky LINQ thingy is like programming crack.

wait til you get to lisp macros
>>
>>55935711
i think it's a call for help. he must be quite scared
>>
File: 1406151243602.jpg (29KB, 345x345px) Image search: [Google]
1406151243602.jpg
29KB, 345x345px
>>55935701
You know what to do
>>
File: choice_codefu_material.png (25KB, 478x270px) Image search: [Google]
choice_codefu_material.png
25KB, 478x270px
>>55935656
inspiring fellow for sure
>>
>>55934580
You can make anything more difficult by changing the way you do things.

In the case of a random name picker, instead of randomly choosing a name from a given database of names, how about creating new names randomly?

With the requirement that the random names adhere to certain patterns and is actually pronouncable etc.
>>
Anyone want to make something like waifu2x using generative adversarial neural networks? Waifu4x perhaps?
>>
File: xNNPN0d.jpg (131KB, 680x693px) Image search: [Google]
xNNPN0d.jpg
131KB, 680x693px
First time perusing the front page of plebbit actually made me laugh.
>>
>>55935567
the problem is naive implementations of that problem have really bad complexity.

i wrote a solution for it on hackerrank as well and it times out on the last couple test cases if i remember
>>
>>55935753
What's wrong?
>>
>>55935057

Git is intended for txt files.

Use git-annex if you want to store big files.

Git by definition keeps all history unless you purge it yourself.
>>
>>55935789
I've written a seq2seq implementation in Theano and some computer vision stuff as well. I'm also looking for someone to team up with for ML projects.

Are you using tensorflow?
>>
>>55935599
>haskell is pretty fast for a functional language I thought
people say that, but it's really not. SML, F#, Scala, and OCaml are all generally faster (although Haskell can be optimized to about the same speed if you write weird code). also, Scheme is probably around the same speed if not faster when you compile it with Stalin. Haskell's not slow, but it's hard to predict good runtime performance with it due to its design and the type of code people tend to write with Haskell is very slow when compared to more imperative code you can still write in other functional languages. if you compare Haskell only to purely functional languages, it blazing fast
>>
>>55933907
>>55933907
>>55933991
>>55934069

fn get(n: isize) -> isize {
match n {
0...9 => n,
_ => 0,
}
}
>>
>>55935793
die
>>
>>55933907
>>55933991
>>55934069
>>55935975
index [0..]
>>
Coded up a Twitch channel notifier, checks every 30s if any channels in a list went online or offline

from twitch.api import v3 as twi
from time import sleep

# Delay between online check intervals
delay = 30
# Array of channel URLs (minus the twitch.tv part) to check for online status
streams = [ 'deliberatemurder', quakecon', 'quakecon2']


chans = ','.join(streams)
stream_online = {}
for stream in streams:
stream_online[stream] = False

while True:
data = twi.streams.all(channel=chans)
online_streams = []

for info in data['streams']:
name = info['channel']['name']
chan_info = twi.streams.by_channel(name)
if chan_info['stream']:
online_streams.append(name)
else:
if stream_online[name]:
print(name, "went offline and is fake online :(")
stream_online[name] = False

for stream in streams:
if stream in online_streams:
if not stream_online[stream]:
print(stream, "went online!")
stream_online[stream] = True
sleep(delay)
>>
>>55935692

Well then, he's got nothing better to do. He's also smarter than you.

Is that what you wanted to hear?
>>
I need to do an assignment in which I talk about a programming language (History, usage etc), but I can't choose the most popular ones.
Any recommendation? Hopefully a more or less obscure but useful language
>>
File: koMX1LT.png (324KB, 579x458px) Image search: [Google]
koMX1LT.png
324KB, 579x458px
what build tool do you guys use?
>>
>>55935893
Not using anything yet. Just reading about adversarial neural networks, in particular applied to colorization and upscaling of faces. Seems like a good candidate for general-purpose upscaling, or upscaling of animation in particular.
>>
>>55933907
get = lambda x: x if x in range(10) else 0
>>
>>55936074

Write about R.

It's niche but fascinating.
>>
>>55935893
>>55936088
post githubs?
>>
>>55936082

Makefiles for simple shit like C.

Grunt+WebPack for JavaScript.

Gradle for weird shit like Ruby.

I'm kinda liking Gradle.
>>
>>55935975
What are we doing?
>>
>>55936113
How is it fascinating?
>>
>>55936074
Erlang is pretty cool
>>
>>55936074
nim (i think), elixir crystal sound like possibly candidates ?
>>
I'm slowly working on a Web interface with 3-step authentication for password-store.
>>
>>55936135
It's very complicated, you wouldn't understand, don't worry about it
>>
>>55936082
>using build tools
>>
>>55936142

It's a language that was created purely for the purpose of manipulating and analyzing data.

It takes a bit to get used to but once you know it well cleaning up data and pumping out some tasy graphs for a report is a breeze.

It's kinda like LaTeX for statisticians now that I think about it.

I used to use it when writing performance/stress-testing reports for software to analyze data from logs.
>>
>>55936178
Yeah but you can just Python for all these. Pandas instead of dplyr, matplotlib/seaborn instead of ggplot
>>
>>55936200

Yeah, if that's what you feel comfortable with, sure, why not. But it does require a lot of biolerplate to do various transformations on matrixes and such, where the R's syntax is perfect for it.

But sure, if it's more comfy for you to use python for it then do so.

I just took my performance reports as an opportunity to learn a cool language.
>>
>>55936159
why would you not use them?
>>
>>55936226
Yeah I just don't see what's so fascinating about it. Just because it was made for manipulating data? Is awk fascinating too? I'm actually using R these few days at work
>>
>>55936074

https://en.wikipedia.org/wiki/MUSIC-N
>>
>>55931925
Java would be good, if it had RAII instead of gc and type inference.
>>
>>55931925
It works but it's ugly and no fun to program in
>>
>>55936249

>Is awk fascinating too?

YEAH! I fucking love AWK.

Some years ago I was on a project for a bank data migration and they had thousands of those XBOX HUGE csv files(3-10 GB) that would have to be parsed to find things. People were using perl and python for that shit and I just scripted in AWK and was miles faster.

AWK is and adorable little language.

The right tool for the job is half the battle.
>>
>>55936129
https://github.com/adamchanson/seq2seq

>>55936088
Adversarial nets are cool. I've done more NLP stuff than computer vision but I'd still be very interested. Here's a tox id if anyone wants to team up:
1AECFC369CCE760C8CC49D653B38A2B7F550B7226ED613FF13FAA690B135AB1CE4BD767886EB
>>
>>55936113
>>55936143
>>55936150
>>55936252
>>55936252
Thanks for the suggestions, will look into these
>>
>>55936305
Awk is slow though? You'd probably be able to do it faster using other linux text processing tools pipelined together
>>
Are people teaming up for Kaggle around here?
>>
>>55936452

Actually exactly the opposite is true.

One of the weirdest things I've found out during that time is that the AIX implementation of AWK(AIX is everywhere in banking) that I was using at that time was about 3 times faster at simply grepping a big file(multiple GB) than just grep(from AIX too).

I wonder if that's true with GNU implementations. I'll have to test that.
>>
File: Screenshot_2016-08-05_23-19-05.png (104KB, 748x747px) Image search: [Google]
Screenshot_2016-08-05_23-19-05.png
104KB, 748x747px
Starting on a realtime client->server->clients text synchronisation system. The message passing framework is done. Currently writing the backend endpoints for submitting text.

>>55936082
go build/gulp
>>
>>55936499
>>I wonder if that's true with GNU implementations. I'll have to test that.
Definitely not lol. awk is interpreted, grep is compiled c
>>
>>55936522

Yeah, that's why I thought it was so weird.

I guess AIX implementations were just royally fucked up.

Or the AIX AWK had some kind of shortcut that did something different when you gave it a basic

`awk /search_pattern/ file.csv`

I don't have any text files that big to do a proper test. Would have to generate one.

What would you people use to generate semi-random data that conforms to a specific format like csv?
>>
Does anyone else have a problem with ideas?
I want to get more in to web development but I've literally no ideas ever. It really limits me.
>>
>>55936090
>>55934678
>>55934348
>>55933991
Literal bloat.

>>55935975
4 Line solution, and bad at this.

Actual enterprise quality solution:
int get(int n)
{
if(n < 1 || n > 9)
return 0;
return n;
}
>>
>>55936642
Make a 4chan clone.
Make a twitter clone.
Make a Reddit clone.

There, should get you occupied for a while if you're new to webdev.
>>
>>55936642
I have ideas but I run into barriers with my ability.

All my web framework ideas require that I know how OAuth works but every time I try to get into it my head starts to melt.

Spent a little while learning a web framework for C# but I fucking despise front end dev so I never have any use for it.
>>
>>55936642

It's hard to have ideas in a vaccum.

Ideas, or rather - solutions - since this is engineering, come from two things:

1. A problem
2. Knowledge and experience

It's hard to think of a solution when you have no particular problem in mind. And it's hard to think of a solution when you have little knowlege or experience.

Start with defining a problem you want to solve, and then pursue knowledge by reading books/watching lectures/testing technologies with that problem in mind.
>>
>>55936642
Nope. Too many ideas, too little time.
>>
>>55936702
>too little time
>posts on 4chan/g

Okaayyyyyy....
>>
>>55936685
>require that I know how OAuth works

What are you using it for? Just making accounts for users? There should be plenty of libraries that abstract away all the complicated parts. I've used it in projects without understanding OAuth at all.
>>
>>55936728
Following 2 threads on all of 4chan is not a lot of time invested.
>>
>>55936752
Essentially yeah, I run into front end issues with it 99% of the time because I really would rather cut my own toes off than work with front end stuff.
>>
>>55936642
Nigger, just do. Only those that are good at what they do come up with "genuine ideas," for now just copy, copy, copy and copy. Eventually you'll be able to add your own twists, and further down the line you'll make unique things.
>>
Only sorta related to programming.
I have a git repo with a master branch that has some changes made to it, I also have an old stash with some data. How do I create a new branch, that discards the current unstaged changes in the master (but only discards them for the new branch, keeps the changes in master intact) and then pop the stash into that new branch?

I'm thinking:
git checkout -b something
git checkout -- .
git stash pop -p stash@{index}


But I don't want to fuck something up, can I get a confirmation that's correct?
>>
>>55931964
>penis(female)
_N_________N_________N_
___O_______O_______O___
_____D_____D_____D_____
_______N___N___N_______
_________O_O_O_________
_N_O_D_N_O_L_O_N_D_O_N_
_________O_O_O_________
_______N___N___N_______
_____D_____D_____D_____
___O_______O_______O___
_N_________N_________N_
>>
>>55936563
Like two lines in C#.
>>
>>55936699
Truth.

Even an entry-level code monkey position will expand what you can actually do with programming.

Sometimes the best way to learn to swim is to get thrown in the deep end.
>>
>>55931653
Scratch
>>
>>55936837
>Needs two lines to generate a semi-random set of csv data

File.WriteAllText("c:\\temp\\test.csv", string.Join(",", Enumerable.Range(1, new Random().Next(300))));


Step it up.
>>
>>55933907
int get(int n)
{
return (n < 1 || n > 9)? 0: n;
}
>>
>>55935607
Nigganese
>>
>>55933127
>using a recursive function to calculate mass

Now that's just plain bad design.
>>
>>55937103
How would that even work
>>
Algebraic effects are great.
>>
>>55937220
what about algebraic coeffects
>>
>>55934505
>"Suck my dick".writeln
the fuck is wrong with you? why just not write writeln("Suck my dick"); like a normal person?
>>
>>55937319
Cogreat.
>>
>>55937366
why did this make me laugh hold me /g/ i think im finally starting to lose it
>>
Now for something completel different that has nothing to do with printing ASCII dicks.

I was thinking of learning a forth-style stack based language. Is postscript close enough to Forth? It would be nice to learn something new and also gain a minor printer superpower at the same time.
>>
>>55937417

Gforth is still actively maintained and updated if you really want to use forth.

https://savannah.gnu.org/projects/gforth/
>>
if t is a custom class, and days is a vector, what is this line doing (c++)

std::set<decltype(t)::key_type> sortedDays(begin(days), end(days));
>>
>>55937530
Causing an error because classes have no type.
>>
The NYTimes site pissed me off so I made this:
// ==UserScript==
// @name NYTimes deshittifier
// @description makes nytimes.com less shitty
// @author You
// @match http://www.nytimes.com/*/*/*/*/*
// @grant none
// ==/UserScript==

(function() {
'use strict';
// grab the shit we want
var title = document.getElementById('headline').innerText;
var contents = document.querySelectorAll('.story-body-text, .photo .image img');
var content = "";
// sick twisted shit
var bodies = [];
var i;
var toPush;
for (i=0;i<contents.length;i++){
if (contents[i].tagName === "IMG"){
// allow back to back images without a p element in-between
if (content.length !== 0) {
toPush = document.createElement('p');
toPush.innerText = content;
content = "";
bodies.push(toPush);
}
bodies.push(contents[i]); // add the image now
}
content += contents[i].innerText + "\n\n";
}
// if we still have text left over add it
if (content.length !==0)
{
toPush = document.createElement('p');
toPush.innerText = content;
bodies.push(toPush);
}
// create elements
var page = document.getElementsByTagName('html')[0];
var pageBodyNode = document.createElement("body");
var container = document.createElement("div");
var titleNode = document.createElement("p");
// remove old shit
page.removeChild(document.getElementsByTagName('body')[0]);
// add content
titleNode.innerText = title;
// style
titleNode.style.fontWeight = 800;
container.style.width = "50%";
container.style.margin = "0 auto";
// add to page
container.appendChild(titleNode);
for (i=0;i<bodies.length;i++)
container.appendChild(bodies[i]);
page.appendChild(container);
})();
>>
>>55937103
    unsigned long long sum(unsigned long long n)
{
if (n == 1) {
return 1;
}

return n + sum(n - 1);
}
>>
>>55937530
t is an object or a value, not a type
if the type of t is T then

T has a type definition key_type
e.g.

struct T {
using key_type = std::string;
}

T t;
decltype gets the type of a value, i.e.
decltype(t) = T

std::set<decltype(t)::key_type> sortedDays;
->
std::set<T::key_type> sortedDays;
->
std::set<std::string> sortedDays; // (in this example)

sortedDays (begin(days), end(days))
this is calling a constructor that takes two iterators
it gets the iterators from days
>>
>>55937669
should point to
>>55937185
>>
>>55936522
grep is compiled c that interprets regular expressions, rather than awk code
>>
>>55931637
I just had a guy on StackOverflow who has "worked for 20 years in industry as an embedded systems engineer" and has a very high reputation tell me you can't define functions in header files in C and voted my question down.
>>
New thread: >>55938046
>>
Alright friends I'm confused

I'm trying to create a script in Python that sorts through a file system and organizes MP3s based off of information in their ID3 tags

does anyone here have experience with such a thing? It seems like all the libraries out there that have been developed for interacting with ID3 tags are terribly documented (eyed3) or needlessly complex and bloated (mutagen) or just not updated in like 5+ years (everything else I can find).
>>
>>55938061
I've tried to do that before. Yes, all the id3 libraries are fucking awful. I gave up on it, but I would go with the one thing that works and is documented. gl, it's not going to be fun.
>>
Damn, the linux subsystem on windows shell is convenient. Installing gforth was a complicated process on windows, but then I realised I didn't have to go through that as I could simply write apt-get install gforth. It allows direct access to the windows filesystem too, so I can edit code in windows and run the code on linux without changing machines.
Thread posts: 328
Thread images: 37


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