[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: 404
Thread images: 30

File: DPT.png (389KB, 934x1000px) Image search: [Google]
DPT.png
389KB, 934x1000px
Old thread: >>56604862

What are you working on /g/?
>>
File: Desktop.png (212KB, 1920x1080px) Image search: [Google]
Desktop.png
212KB, 1920x1080px
OpenGL and chill.
>>
2nd for sepples
>>
>>56610291
KHR_debug is your friend.
>>
I want to rename a bunch of files in a directory they all have the correct name and file ending except they have a "k" before the ending.

So for example kak.gif, I want that to turn into ka.gif and then so on. I know I can do this somehow via linux terminal but I don't know what to search to try and solve this...

I remember doing a codecademy course where they seperated lakes and mountains depending on if they had mountain in the name
>>
So I'm learning VB.net in my 300 level IS class.

Can anyone explain when to use double vs single vs long vs short? Like when I should use a different one?

Cause like I can use double for everything that would be covered by single, but would it ever be better to run it as single?

We haven't covered the long or short data types, can I replace double with long or short and it would work better? I figure no since it hasn't come up in the book or in lecture, but I'm just wondering.
>>
File: 2016-09-15-044839_579x924_scrot.png (85KB, 579x924px) Image search: [Google]
2016-09-15-044839_579x924_scrot.png
85KB, 579x924px
>>56610266
pls halp
I get segfault
>>
>>56610319
>VB.net
That must be a shitty uni.
>>
>>56610344
Fuck, get better colors. My eyes bleed looking at that shit.
>>
>>56610352
mine dont..
>>
>>56610344
calloc returns void* casted implicitly to int**
learn how to 2d array
>>
>>56610344
Ow my eyes.
Also your issue is with calloc and trying to be a double star programmer before being a one star programmer.
>>
>>56610376
prolly cause I use redshift and I don't see too bright
sorry, senpai
>>
>>56610374
>>56610376
ok, even if I make it
(int (*)[nx]) calloc(..
still segfaults
>>
>>56610274
what the fuck is this image?
>>
>>56610318
#!/bin/bash

for f in *; do
new=$(sed -r 's/k(\..*)$/\1/' <<< "$f")
if [ "$new" != "$f" ]; then
mv "$f" "$new"
fi
done
>>
>>56610409
http://www.geeksforgeeks.org/dynamically-allocate-2d-array-c/
There are 3 different ways to do what you want to do.
The first one is the nicest imo.
>>
>>56610348
Thanks for the help.
>>
>>56610409
Think about how much memory your allocating there.
It isn't correct.
Allocating ny blocks of size sizeof(int) * nx isn't what you want.

Look at >>56610450
>>
>>56610450
Isn't there a risk using the first method where you may have a 2D array too big to fit in memory? The OS could block you allocating a big block of memory while using an array of pointers would not suffer this issue.
>>
>>56610484
The array of pointers takes more memory so this would almost never be the case.
>>
>>56610467
but thats what I want
I want a yx*nx array
and I want st to point to it

pls halp, I started a week ago
>>
>>56610438
Worked like a fucking charm, thank you so much Anon-san
>>
>>56610488
No, I mean, would the OS have trouble allocating a huge contiguous block of memory compare to smaller separate blocks?
>>
>>56610450
Not gonna read that but using 2dimensional arrays is much more of a pain than using a single array and just calculating the index from the row and column.
>>
>>56610484
modern OS's can allocate almost any amount, it's not limited by the physical memory
>>
>>56610545
>would the OS have trouble allocating a huge contiguous block of memory compare to smaller separate blocks?
No.
>>
>>56610545
Nope.
>>
>>56610450
Not gonna read that but using 2dimensional arrays is much more of a pain than using a single array and just calculating the index from the row and column.

>>56610545
No, memory is virtual anyway.
A lot of modern games just allocate like a gigabyte of memory on startup and implement their own allocators to avoid going through the os on every malloc call.
>>
>>56610484
no, at least not in practice and even less for >>56610344's purpose.

>>56610504
A 2d array of size X by Y is not really needed as it is the same as a 1d array of size X*Y
/* allocate */
int *ptr = calloc(nx*ny, sizeof(int));

/* it doesn't really matter if you do x*nx+y or y*ny+x here
* just be consistent throughout your program */
int value_at_x_y = ptr[x*nx+y];


>>56610557
>>56610557
>Not gonna read that
>I don't want to put any effort into something but still nag on others the post
That's the first method shown in the link you imbecile
>>
fuc, ill come back tomorrow
i have to sleep
>>
Public Class Q44
Private Sub btnCompute_Click(sender As Object, e As EventArgs) Handles btnCompute.Click
Dim team As String
Dim gamesWon, gamesLost, percentage As Double
team = txtBoxTeam.Text
'Change txtBox text from String to Double
gamesWon = CDbl(txtBoxWins.Text)
gamesLost = CDbl(txtBoxLosses.Text)
'Calculate
percentage = (gamesWon / (gamesWon + gamesLost)) * 100
percentage = CStr(Math.Round(percentage))
txtBoxResult.Text = "The " & team & " have won " & percentage & "% of their games this year!"
End Sub


Oh boy
>>
File: 1473865766821.png (2MB, 3840x2160px) Image search: [Google]
1473865766821.png
2MB, 3840x2160px
>mfw even a lot of the easy ones seem out of my league
>>
File: 1468269825441.jpg (314KB, 1261x1000px) Image search: [Google]
1468269825441.jpg
314KB, 1261x1000px
>>56610920
try this one, homosexual
>>
With a DataTable in C#, how do I set a row name?

Like, for a column you can do:
myTable.Columns.Add("Monday", typeof(string));
myTable.Columns.Add("Tuesday", typeof(string));
myTable.Columns.Add("Wednesday", typeof(string));
myTable.Columns.Add("Thursday", typeof(string));
myTable.Columns.Add("Friday", typeof(string));
myTable.Columns.Add("Saturday", typeof(string));
myTable.Columns.Add("Sunday", typeof(string));
[/code]

But then I want to add rows like this:
for (int i = 0; i < 8; i++)
{
myTable.Rows.Add(consol_times[0, i].colour, consol_times[1, i].colour, consol_times[2, i].colour, consol_times[3, i].colour, consol_times[4, i].colour, consol_times[5, i].colour, consol_times[6, i].colour);
}


Is it possible for me to place a name for the row, like you can in the column?
>>
>>56610954
Whoops, forgot my opening code tag. First example is supposed to be:
myTable.Columns.Add("Monday", typeof(string));
myTable.Columns.Add("Tuesday", typeof(string));
myTable.Columns.Add("Wednesday", typeof(string));
myTable.Columns.Add("Thursday", typeof(string));
myTable.Columns.Add("Friday", typeof(string));
myTable.Columns.Add("Saturday", typeof(string));
myTable.Columns.Add("Sunday", typeof(string));
>>
>>56610920
Surely you can at least do rock, paper, scissors
>>
>>56611014
But that's kind of too easy. I don't think I'd learn that much. I dunno, I'll have a go at some at least
>>
>>56610920
Don't fall for this meme challenge board. It's has impossible shitty items that are software projects instead of exercises that you can do in one day...
>>
>>56610920
>22 Sound Synthesis (sine, square, sawtooth, etc.)
>Difficult
That's an overstatement. It's actually pretty fucking easy.
>>
what are some good books to read about virus writing for most general programming languages? (Aside from the giant black book of viruses)

how could one even write a virus is prolog, ruby, haskell or any of the "meme" viruses?

need it for libertarian purposes
>>
File: 1461055886604.jpg (738KB, 1000x800px) Image search: [Google]
1461055886604.jpg
738KB, 1000x800px
Just got an old DEC Fortran version of Zork (text adventure game) working in Linux with gcc fortran. Now I'm playing with a fortran MVC framework and tweaking the Zork source code to work more as a library.

My endgame is an app that uses a text messaging API to send Zork through SMS text messages.
>>
>>56611021
>too easy
Just try it. Worst case scenario it takes you 10 minutes and you get more practice.
>>
How do I judge my code quality? Is there somewhere I can have it exposed to a merciless team of uberbeards who'll tell me exactly why it's shit and worthless?

I can never really tell if I'm solving a problem well or if I'm doing it horribly wrong
>>
>>56611147
this. and even if the problem seems easy you'll get practice with building the program and you'll have to think about how to optimize/simplify/design the logic because you're not supposed to just hardcode it with a shit ton of if/else statements because even with a simple game like rock paper scissors the code will look like shit and with a more complex game it would be retardedly bad to do it that way
>>
Okay. Serious question.
I just can't seem to translate my thoughts into code.
How do I specifically train that, without feeling hopeless and give up because I feel like I am playing a new game +9 naked and without skills?
>>
>>56611234
by not being a faggot i guess. What do you want to program for?
>>
>>56611131
wait....

you can send games through text messages?
what
>>
>>56611131
why text messages? just have a text interface in the app
>>
>>56611222
>stack overflow
>hackforums
>right here

thats it
>>
>>56611332
>>stack overflow
>>hackforums
>>right here
>uberbeards
>>
hey /g/
see this >>56611337
>>
>>56611354
are they not?
they have channeled the first sigil of wrath that make s one a uberbeard
>>
>>56611253
For starters, something "simple", like a a 2d platformer and learn some reasonable structure designing with that, optimizing the code for fun.
Else, my little brother starts college and he needs to start with Haskell.
I heard it is functional programming, aka, filtering out people.
I want to help him by coding side by side and teach myself the language, too as I suffer with him..
It is just, I hate monkey see monkey do.
Monkeys also need to learn, or them seeing and doing has no merit.
>>
So i got job to create android app for one company, app that will help them working with their items.
Login, save some data, send reports via mail and shit like that

>I created responsive website with all that
>restricted it that phones can connect only
>created webview
>send that to them, to test it
>they go crazy, they say they like it very much
>They payed everything, i set them server and give them app
>Till this day, they think they are using android app and not website
Am i cheater anons?
App is doing what they wanted, working good, just it is not in java.

I made it in 2 weeks, got 3000 euros.

Was this a good deal, what do you think?
>>
>>56611437
just don't be retarded. start with how to draw a box. then make the box move etc
>>
Making Deep Reinforcement Learning bot that will tweet and improve itself

(the "reward" will be either a retweet or a like)

after x amount of time I'll have the most followed, popular twitter account and I'll be able to sell ads on it
>>
>>56611506
Nope not a cheat, that's what a lot of "apps" are.
Got paid decently desu.
>>
File: taytweets21.jpg (497KB, 1255x1614px) Image search: [Google]
taytweets21.jpg
497KB, 1255x1614px
>>56611551
lol howd that work out last time
>>
>>56611321
Spot the underage.
>>
File: anal beads.png (2KB, 55x385px) Image search: [Google]
anal beads.png
2KB, 55x385px
Call the cops, I don't give a fuck.
>>
>>56611663
node?
>>
>>56611663
you disgust me

>>56611672
maybe C#
>>
>>56611672
C#
>>
>>56611663
"var" is the only sane choice.
>>
>>56611506
good job anon
kind of a jew move because you diden't atleast mention it, but most people wouldn't even understand if you told them because of tech literacy
>>
>>56611699
i think it's ok as long as they didn't specifically ask for a certain type of implementation and he didn't say he would make a native app
>>
>>56611663
Good job anon.
Who C++ 'auto' abuse here?
>>
>>56611740
>>56611699
Well, they didn't asked anything about how the app was build.
On the start they mentioned that they want android app, later they were interested only in what app can do.
They tested it with their workers, and non tech people found it extremely easy to use.
They are using that app for 9 months now, they didn't have one problem.
>>
>>56611765
Nothing wrong with that.

They're not paying you for a piece of software.

They're paying you to solve a problem.
>>
File: 1473307267189.png (54KB, 486x542px) Image search: [Google]
1473307267189.png
54KB, 486x542px
Ok so
git rebase commit
changes the current branches base to point to the new commit (say, the head of another branch), but then I see shit like
git rebase -i HEAD~N
which appears to be changing the base commit to point to one of it's children?
This makes no fucking sense, what's going on here?
>>
File: bestwaifu.jpg (56KB, 357x500px) Image search: [Google]
bestwaifu.jpg
56KB, 357x500px
A shader to cut holes in object based on a "negative flashlight"
CGPROGRAM
//if you're not planning on using shadows, remove "addshadow" for better performance
#pragma surface surf Lambert addshadow
struct Input {
float2 uv_MainTex;
float2 uv_SliceGuide;
float _SliceAmount;
};
sampler2D _MainTex;
sampler2D _SliceGuide;
float _SliceAmount;
void surf(Input IN, inout SurfaceOutput o) {
clip(tex2D(_SliceGuide, IN.uv_SliceGuide).rgb - _SliceAmount);
o.Albedo = tex2D(_MainTex, IN.uv_MainTex).rgb;
}
ENDCG
>>
>>56611758

auto erotic_asphyxiation = true;
>>
File: 1467386629306.jpg (29KB, 412x430px) Image search: [Google]
1467386629306.jpg
29KB, 412x430px
>>56611663
>var
DELET THIS
>>
>>56612069
auto ism = true;
>>
>>56612069
>Implicit int
>>
File: 1465131689237.jpg (37KB, 526x473px) Image search: [Google]
1465131689237.jpg
37KB, 526x473px
>>56612069
>>
>>56610423
How new are you?
>>
>>56611358
Assuming that "bar" translates to byte array then probably yes because according to the doc the String class has the following constructor:
String(byte[] bytes)
Constructs a new String by decoding the specified array of bytes using the platform's default charset.


I don't know Java though and the chances are that it doesn't work like that because why logic.

>>56611506
Meh, if they cannot tell the difference and it\s not obnoxiously slow then I wouldn't consider that cheating. The only concern I have is that if you pay for the server out of your own pocket then you didn't make 3k EUR, you're effectively making less than that with the reward getting down proportionally the longer you have to keep the server up. I know, it probably costs pennies to host such a thing but that still holds true.

>>56612026
What makes no sense? git rebase <name> is not for a commit, it's for rebasing against another branch for when people work on different features in different branches and then you put them all back into master.
>>
>>56612404
>git rebase <name> is not for a commit
uh yes it is.
A branch is nothing more than just a named commit.
>>
>>56612432
>A branch is nothing more than just a named commit.
???
>>
File: 1463107119873.jpg (41KB, 500x621px) Image search: [Google]
1463107119873.jpg
41KB, 500x621px
going through a python course on udemy called Pyhton Bible, some fucking british poo starts every video by calling me beautiful
>>
>>56612444
http://ftp.newartisans.com/pub/git.from.bottom.up.pdf
Go learn how git works, it's only 31 pages.
>>
>>56612463
no thanks
>>
>>56612135

>implicit int
Implicit int conversion. If you did something like
int foo = true;

Then foo would be equal to 1. If you were to use the bool keyword, or auto (which uses type deduction), then foo would be a boolean, and NOT an int.
>>
>>56612541
auto variable;

declares a variable of int type.
>>
>>56612444
I only ever read https://rogerdudler.github.io/git-guide/index.html
But even I know that you're horribly wrong.
>>
>>56612461
>random-ass udemy Python course
>$195 for beginner lessons
Go to (community) college if you're going to spend that much money on learning.

https://automatetheboringstuff.com/
>>
>>56612575
looks pretty clear that a branch is something entirely different than a commit, conceptually at least
>>
Does anyone have torrents for Python books? I'm a poor fucker with basic experience in C looking to advance into Python.
>>
>>56612575
fuck, linked the wrong post. wanted to reply to >>56612432

>>56612608
Yes it is, sorry for messing up my post.
>>
File: 1459933865468.jpg (65KB, 637x661px) Image search: [Google]
1459933865468.jpg
65KB, 637x661px
>>56612603
oh I didn't pay, when they make a udemy course they set it to free for promotion on the first day or whatever. Someone posted a link so I enrolled then and got it for free. I got the Automate The Boring Stuff With Python udemy course the same way, That one is 25$ I think.

I thought that it's gonna be a free course and then I saw the price of 200 $ and thought wtf happened. It's a nice course but nothing worth 200 $
>>
>>56612621
>Python
lol
>>
>>56612575
>>56612608
Nope, wrong.
Maybe I used the wrong wording by saying that a branch is a named commit.
It's more like a branch is a reference to a commit, so anywhere you can use a commit, you can use a branch, and vice versa.
Of course you can use commits in rebase, that's how people edit their commit history.
>>
>>56612621
why books go with courses?

Automate The Boring Stuff With Python:

>https://torrentproject.se/472ee340bae6f6bf2b5d63bf5a0f692f0c4d22c4/Automate-the-Boring-Stuff-with-Python-Programming-torrent.html

search for it here:

>https://torrentproject.se/
>https://torrentz2.eu/

Also MIT edX course started few weeks ago too
>>
>>56612564

In C...
>>
>>56612676
Right
>>
>>56612564
Not in C++.
>>
>>56612682

We're talking about C++. The auto keyword in C++ behaves much like var in C#.
>>
Dbus is the worst fucking cancer to plague Linux, aside from the pig disgusting interface,
>Have daemon running under users X session
>Use libnotify to send notifications
>They work
>Restart X session but not the daemon
>Notifications no longer work
>Not even reinitialization libnotify works.
Seriously what the fuck? why? this is fucking retarded and there's absolutely no reason why that should happen, and apparently google knows nothing about this problem, so it's impossible for me to fix.
The only solution is the restart the fucking daemon when the X session restarts, but that's a fucking retarded "solution".
>>
>>56612690
>>56612726
People actually use C++?
Jesus christ, how horrible.
>>
>>56612755
nice meme
>>
>>56612755

wow C++ users blown the fuck out! what did he mean by this? I am really thinking, now!
>>
>>56612670
thanks bro i will have a look now
>>
>>56612755
Name a great game that wasn't written in C++

Not some shitty phone game or web browser game

A real game with demanding 3D graphics and world physics etc

>inb4 "muh vidya"

regardless what you think of games they're the most demanding piece of software when it comes to the need for perfect performance nad hardware requirements
>>
Beginner here

>A year is a leap year if it is divisible by 4. But if the year is divisible by 100, it is a leap year only when it is also divisible by 400.

Why isn't this right then:

        if ((year % 4 == 0) || ((year % 100 == 0) && (year % 400 == 0))) {


If I input 1700 it says it's a leap year.
>>
>>56612839
>muh gaymes
>>>/v/
>>
>>56612850
Fuck off cunt.


>huuhuehue jokes on him I was only trolling
>he butthurt now
>I win
>>
>>56612755
Mars rover curiosity is programmed in C++
>>
>>56612845
if ((year % 4 == 0) && (year % 100 != 0) || ((year % 100 == 0) && (year % 400 == 0))) {
>>
>>56612845
You need to check year % 4, and then check the other part. Because you've got an OR there, if it's divisible by 4 it's going to be true and not check the rest.
>>
>>56612897
if (((year % 4 == 0) && (year % 100 != 0)) || ((year % 400 == 0))) {
>>
>>56612897
>>56612905
Right. I'm stupid... Thanks.
>>
>>56612755

The web browser you used to make that post was written in C++, Anon.
>>
>>56612911
not stupid, just learning
>>
>>56612913
Almost all of Windows (including apps that predominantly do string and tree manipulation) is written in C++. Almost all of Linux userspace is written in C. These are still terrible, insecure, fragile languages which cause frustration and loss to programmers and users every day.
>>
>>56610291
Good music senpai
>>
File: too busy crushing it.jpg (133KB, 1022x1054px) Image search: [Google]
too busy crushing it.jpg
133KB, 1022x1054px
>>56612953
Shouldn't you be getting back to Hacker News and posting another mastubatory Rust article?
>>
>>56612953
They use it because it's fast, we've had this conversation before
>>
>>56612953
Until Rust can produce binaries close to C's performance then it will stay that way.
>>
>>56613017
C/C++ is a very poor match to today's CPUs. It's super slow compared to what the hardware is capable of. Compare for instance with Intel ispc (https://ispc.github.io/). It gives you an idea how much performance we're currently missing, anon.

Let me put it this way. When C was still young, memory latency was typically 1 or 2 clock cycles. There was no pipelining, at most a simple state machine that would finish in a few clock cycles. A branch didn't cost much. A few cycles at most. Neither did a pointer reference. Random access was almost as fast as sequential access.

You following?

Today's CPUs have memory latency of 150-300 clock cycles. A modern CPU core can typically retire 1-4 instructions per clock cycle. A single instruction takes typically about 16 clock cycles from decoding until retire. So CPUs have to often execute blind and just guess where the execution flow will go. Branches modify this flow. CPUs simply guess the flow, branch predict. When they're wrong, they just have to invalidate currently executing instructions and start again. Branches are something to avoid. Especially unpredictable ones. Function pointers are branches. Even though they can be predicted, they often just fall out of the branch predictor cache.

We need something that can minimize the costs modern CPUs are bad at. C/C++ is very branchy and uses slow function pointers often (vtable, switch jump tables, etc).

THE PROBLEM IS: there's more variation among CPUs than ever before, even within same instruction set architecture. For x86, not only the costs for instructions are wildly different, but the instruction set support is fragmented.

C/C++ is NOT the last word. Unsafe and way TOO SLOW compared to what current hardware is capable of. The problem is, the language that is safer and a good match just does not exist yet.

(Full disclosure: C/C++ is what I do at my day job.)
>>
>>56610344
Switch to a better language and stop wasting time debugging memory errors.
>>
>>56613042

It will soon! EVERYTHING IS COST FREE! EVERYTHIGN!
>>
>>56613070
>it's not fast enough
Faster than other practical languages
>>
>>56610291
>C instead of C++
>>
>>56613091
We've been over this many times anon, C++ is horrible.
Why the hell have there been so many Sepplesfags on here lately?
>>
>>56610344
Stop using meme languages?
Use a practical language like Java.
>>
>>56613042
>Rust
>Going anywhere outside of a niche
Just admit it. Doing casual Rust is far more soul sucking than writting assembly code.

>>56613070
So which paradigm do you propose that doesn't have branches?
>>
>>56612839
>Name a great game that wasn't written in C++
RTCW
Wolf:ET
Quake until id4
Doom until id4
>>
>>56613104
>C++ is horrible.

t. Lisp user
>>
>>56613104
It's better than C, just with RAII alone. But keep debugging these memory leaks and keeping track of your pointers 1970-style m8
>>
>>56613118
Is that supposed to be an insult, you filthy race mixer?
>>
>>56612992
>>56613042
Rust does not solve the problems that he expressed.

>>56613083
Not Fortran
>>
>>56613091
>C++
>Ever
>>
>>56613108
>Casual Rust
Well that's not it's use case. It's a good language if you are writing applications and care about security, safety, as well as performance (of course the performance isn't all there yet, but that's another story).

>>56613136
He expressed an issue about C and C++ being unsafe, Rust solves that mostly.
>>
>>56613128
Lisp is shit
>>
>>56613139
C++ is too hard for your little pretty head.
>>
Why is C so satisfying?
>>
>>56613136
>Not Fortran
C has restrict pointers now.
https://benchmarksgame.alioth.debian.org/u64q/fortran.html
>>
>>56613152
>Rust solves that mostly.
Rust solves only very few problems concerning safety. We talked about it before in here.
>>
/g/ has too long been infested with Linux ricer kiddies. It's time to purge them once and for all.

Any of the following regularly occurring threads on /g/ is either directly or indirectly about Linux ricing or autism:

* Intel vs. AMD threads
* GPU threads
* Various types of rig/battlestation/guts/Speccy threads ("What parts should I buy, /g?" "Is this part good, /g/?" "Check out my specs, /g/.")
* All Linux discussion and support threads (obviously)(which distro to use, how to rice, which anime child porn to use)

These threads only serve to discuss products for doing pointless stuff. They have nothing to do with programming, networking, security, privacy, freedom, design, usability, or anything else /g/ related.

These threads and the people who post within them belong in either >>>/mlp/ or >>>/trash/, as they are the appropriate boards in which to discuss their hobby, along with "distro war" and "gentoo vs. arch" threads. This should be Rule #4 for /g/ and it should be aggressively enforced until the manchildren finally get it and move on.

This is the thread to petition Hiroshimoot to cure the /mlp/ cancer in /g/. If you really care about technology and not just vapid consumerism, help by adding your voice to this discussion.

We can do it, /g/.


----


lincucks don't care about technology in general.

All they care about is the rice, not the method. Pony pictures is >>>/mlp/ and the method is >>>/g/.

Products are GPU shitstorms, speccy threads, guts threads, casing threads etc.

A typical lincuck's perception of judging a GPU is nothing because lincuck has no games or programs.

None of the ricer lincuckolds are interested in the method or process of making games. Game is not technology, programming games is.

Ricing is not technology and neither is discussing which build will look the best with anime theme.

Lincuckolds do not care about privacy and cryptology. They are more invested in anime child porn. gb
>>
>>56613108
>So which paradigm do you propose that doesn't have branches?
Forth.
>>
>>56613162
Are you claiming that you understand the entirety of C++?

>>56613173
Nobody cares, you stupid faggot.
>>
>>56613167
That almost nobody uses except the standard functions, where in Fortran it is like this by default.
>>
>>56613184
>almost nobody uses
Anyone who actually gave a shit about performance would indeed use it.
>>
>>56613156
It's actually the most superior family of languages.
>>
>>56613183
>Are you claiming that you understand the entirety of C++?
Of course, lol.
>>
>>56613128

No, but it's supposed to highlight the (dramatic) irony.
>>
>>56612753
Couldn't you just setup the libnotify service to start when the X session starts rather than on boot? Or does that work this way already? I've no systemd-based system at hand at the moment so I cannot verify. On the other hand if it worked that way then the service should be able to re-establish the connection with X.
>>
>>56613197
It's actually not
>>
>>56613169
Darnit, email me the minutes next time.
>>
>>56613220
libnotify isn't a daemon, it's a library.
>>
File: echo.jpg (81KB, 600x375px) Image search: [Google]
echo.jpg
81KB, 600x375px
/dpt/, I'm a relatively experienced college student being asked to develop an Alexa Voice Services skill.

What hourly rate would you request in my position?

>>56613070
Super slow compared to what? For general purpose compilation, GCC/Clang are typically compared to as state-of-the-art for performance.

>put forward a specific domain a specific language does well in
How many practical purposes allow you to use SIMD at a large scale beyond things like using its large registers to do the equivalent of memcpy? GCC/Clang will vectorize these simple cases without human intervention already.

>Today's CPUs have memory latency of 150-300 clock cycles. A modern CPU core can typically retire 1-4 instructions per clock cycle.
Are you arguing against your own proposal of how important SSE is?

>C/C++ is very branchy and uses slow function pointers often (vtable, switch jump tables, etc).
Compared to what?

>C++ is NOT the last word. Unsafe and [...]
>C++ is what I do at my day job.
Hopefully you don't write C++ that way at your job unless you're asked to.
>>
>>56613244
Err yes, I meant the service that handles the notification daemon.
>>
>>56613070
branching is necessary, the most you can do is to do some tricks to emulate "true" branching, you can't really "fix" this on the software/language side, you just have to deal with it or change the hardware cpu architecture
>>
>>56613253
Nah doesn't do anything.
It's not a problem with the notification daemon, it's a problem with dbus.
>>
>>56613291
You are probably right but have you tried with a different daemon just to make sure?

Also, Notify OSD for instance, should be able to get back a connection to DBUS after it's been lost but there are also a few log messages in the connection function (https://bazaar.launchpad.net/~indicator-applet-developers/notify-osd/trunk/view/head:/src/dbus.c), perhaps your daemon leaves some logs as well?

Did you check the journal?
>>
>>56613353
Just tried a different daemon, didn't fix anything.
It's something to do with the connection that the application sending notifications has to the dbus daemon.
If I restart X and use notify-send it works, but my daemon which survived the X restart can no longer send notifications until it is restarted.
Why would restarting X do anything to the dbus connection?
>>
>>56612953
There's almost nothing wrong with C/C++ that wouldn't be fixed by standards instead of throwing the baby out with the bath water and going full NIH syndrome.

>>56613070
Saying ispc is blowing a lumbering beast like gcc out of the water is extremely misleading. ispc is optimised for ''Intel''. The whole point of C is that it's about as close to universal portability as you can get without sacrificing speed. What else could you possibly do to optimise C without restricting yourself to certain hardware? Assume byte type? Stop checking for signatures?

>>56613152
Rust solves it at the expense of speed, which was the whole issue the poster was talking about in the first place.
>>
>>56613249
>What hourly rate would you request in my position?
Punch high and assume your own value, anon.
>>
>>56613353
Also nothing appears in the journal when the daemon tries to send a notification.
>>
File: newlogo-repro.png (8KB, 360x361px) Image search: [Google]
newlogo-repro.png
8KB, 360x361px
password generator with use of real words

i was expecting that I will be able to use PyEnchant to generate random words
but seems that even though it has access to all the words in the chosen language, you can only spell check

So how should I go about this?
>>
>>56613555

load dictionary, pick random words, done.
>>
>>56613572
yes, thats the idea
but how?
>>
Or, if you want to be cheeky:

1. Generate random string of random len
2. PyEnchant.suggest(random_string)
3. Select random suggestion from list of PyEnchant suggestions

:^)
>>
>>56613598
yeah, I had the same idea actually when I was checking enchant methods and saw suggest...
but I am like fuck that, this si fundamental
>>
>>56613555
import random_word_password_generator
>>
>>56613555
>password generator using dictionary
>never heard of a dictionary attack
Really smart anon.
>>
File: password_strength.png (91KB, 740x601px) Image search: [Google]
password_strength.png
91KB, 740x601px
>>56613669
comes down to pros and cons of course
but if you think someone will remember randomly generated 0fb2n!A4BHR0WHa@yJtC#8ydZPi you are mistaken
also I read that combination of few words is the best way
>>
>>56613555
So something like this?

from random import choice

words = None
with open('/usr/share/dict/american-english') as f:
words = f.read().split('\n')

print(''.join(choice(words) for _ in range(5)))


Just install the dictionary package on your system (pacman -S words in case of Arch).
>>
>>56613496
I'll try, I suppose- it most likely can't hurt.
>>
>>56613718
put a small number at the end just to make it a bit less shitty
>>
>>56613249
why not ask them what the pay is, and then ask for a bit more than what they say
>>
>>56613724
yeah, except I need slovak and czech dictionary
I also somewhat hoped that there was way from enchant that I was missing
but I guess I gonna have to go on libreoffice dictionaries or some shit
>>
>>56613756
this.
It's not hard. Add part of a phone number you've memorized in between two words or something.
>>
>>56613784
>yeah, except I need slovak and czech dictionary

So use Google, download dictionaries, and do exactly the same thing.
>>
>>56613718
Holy shit you are taking that comic seriously? You need to add additional information so a straightforward dictionary doesn't break it in a couple hours. Put numbers between the words, or interleave words, cut half of the word off, or put numbers at the end on it.
>>
>>56613784
ftp://ftp.gnu.org/gnu/aspell/dict/0index.html

Also improved:
from random import choice, randint

count_words = 3
count_numbers = 3
count_special = 3

special = ['!', '@', '#', '$', '%', '^', '&', '*', '(', ')']

with open('/usr/share/dict/american-english') as f:
words = f.read().split('\n')

print('{}{}'.format(
''.join(choice(words).replace("'", '') for _ in range(count_words)),
''.join(str(randint(1, 9)) for _ in range(count_numbers)),
''.join(choice(special) for _ in range(count_special))
))
>>
>>56613830

The fixed placement of numbers & specials probably isn't the best choice.

You ought to have it so that the next piece of the password is randomly selected to be a word, number, or special.
>>
>>56613803
thats what I wrote with the libreoffice being mentioned

>>56613805
shhh, quiet, no service should allow to do dictionary attack for hours
you could have then password like 0fb2n!A4BHR0WHa@yJtC#8ydZPi and it would be broken up eventually annyway

and the password generator is for morons, normal users where priority is that with rolling of few tries that random moron will get some word combo that he is able to retain in his retarded little brain
>>
File: 1457041617816.jpg (115KB, 768x1024px) Image search: [Google]
1457041617816.jpg
115KB, 768x1024px
>>56610274

Has this Q in the last thread, no one answered (which is terrifying, because maybe it doesn't exist):

Are there any books, videos, or sites (even blogs) out there that look into good code and break down - line by line or portion by portion - what is being done and why it's being done the way it is?

I'm looking for great examples of code that also teach you the why behind it. Language doesn't matter.
>>
>>56613783
That's a good point. I've never had the opportunity to negotiate before, but they say the person who gives a number first loses, right?
>>
File: mfw.jpg (25KB, 323x454px) Image search: [Google]
mfw.jpg
25KB, 323x454px
>mfw mmap takes bytes, not pages as length parameter
>>
File: angry frog pepe.jpg (13KB, 184x184px) Image search: [Google]
angry frog pepe.jpg
13KB, 184x184px
>what I mastered yesterday becomes deprecated tomorrow
Yes, fundamental knowledge never goes away, but you can't stick to outdated tools if you want to be productive. How the fuck I can learn everything?
>>
experienced programmer here who has never really done webdev, whats /g/s opinion on web frameworks? goal is to get get a website off the ground asap, would mostly be static pages but lots of transactions. well versed in c/java/python and have done some functional programming before (lisp, scala). im looking at flask or django right now
>>
>>56613889
>stupid frogposter
>learns to use "tools" rather than to program
>>
>>56613830
>ftp://ftp.gnu.org/gnu/aspell/dict/0index.html
yes, thats what I would use in enchant
but its not plain text word file... will need to look for some wrapper
>>
>>56613877
There's no such thing as good code. Once you start programming something that you plan on being used in the real world, you're committing to writing a shitty code base.
>>
File: dynamo.png (5KB, 403x145px) Image search: [Google]
dynamo.png
5KB, 403x145px
>>56611663
Are you even on my level?
>>
>>56611663
>there are "programmers" in /dpt/ who equate type inference with dynamic typing
>>
>>56613901
What means to program? It means to use tools to solve problems.
>>
>>56613858
>no service should allow to do dictionary attack for hours
Offline attacks.
>you could have then password like 0fb2n!A4BHR0WHa@yJtC#8ydZPi and it would be broken up eventually anyway
Not in this existence.
>>
>>56613919
>dynamic

Now I am angry.
>>
>>56613927
>there are "programmers" in /dpt/ who think porgrammers on /dpt/ equate type inference with dynamic typing
>>
>>56613927
There are?

I haven't seen a single post suggesting that.
>>
>>56613947
>>56613953
Why else would they be reacting so poorly?
>>
>thinking var in c# isn't great
If the right side makes the type clear, or the type is an interface/abstract implementation var makes perfect sense.
>>
>>56613903
You can convert an aspell dictionary to a wordlist using the aspell itself, no biggie.
>>
>>56613884
Page size is different between architectures and systems. Some systems even have more than one page size (huge pages are 2MB, Intel and AMD chips have dedicated TLB cache space for storing 2MB page translations).
>>
>>56613919
DELETE THIS
>>
>>56613968
Sorry the class doesnt implement IDisposable
>>
>>56613919
-3 points for not utilizing
using static System.Console;
>>
>>56613960
for some reason heavy use of var/auto is considered bad practice among many neckbearded C++/C# programmers.
>>
File: photo.jpg (7KB, 100x100px) Image search: [Google]
photo.jpg
7KB, 100x100px
>>56613919
>dynamic y = "hello"
fuckin kek
>>
>>56613988
Probably because they don't understand the difference between it and dynamic typing.
>>
File: waterloo.png (13KB, 300x195px) Image search: [Google]
waterloo.png
13KB, 300x195px
What schools do you boys go to for CS?
>>
>>56613960
explicit > implicit

being too lazy to type (pun not intended) the type name is not a good excuse to use type inference
>>
>>56613998
They do, it just just trigger their autism.
>>
>>56613982
Xamarin Studio 5 doesn't support it
>>
>>56614005
people will defend this mickey mouse bullshit
>>
>>56612839
>using games as examples of good software
you fucked up
>>
>>56614000

Go back to the UW sub you cretin
>>
>>56614002
Loving brevity however is a good reason.
List<String> muhList = new List<String>();

is indefencible.
>>
>>56614002
But not having to write the type name is exactly what inference is for. It's about not repeating yourself, mostly, and if that's laziness then you should want to be lazy.
>>
>>56614022
epic meme fag
>>
>>56614022
>implying Doom 1 through 2016 aren't the mona lisa of programming for each of their eras
>>
>>56614034
pathetic code monkey

also
List<String> muhList = new ArrayList<>();
>>
>>56614057
>pathetic code monkey
I'm correct.

You code example demonstrates nothing. If you have a good reason to define the exact type of a variable, that's fine. Otherwise it's retarded bloat.
>>
>>56614057
So much better than
var muhList = new ArrayList<String>();

right? Java doesn't implement some feature, so it must be useless.
>>
>>56614034
It's a much nicer shorthand than javas
List<String> muhList = new List<>();

What's even the point
>>56614057
>arraylist in c#
>>56614002
C# is always explicit unless you use
dynamic
. The right side of the assignment should clearly explain what var is. If it doesn't, you shouldnt use var.
>>
>>56614057
>mfw this is valid Java
That shit wouldn't compile in C# because C# has non-broken generics
>>
>>56614072
>>56614074
>>56614077
>>56614085
(You)
>>
>>56614091
>>btfo (you)
>>
>>56614074
>Java doesn't implement some feature, so it must be useless.
This is the mentality of every Java dev. Until Java finally adds said feature. Then it becomes
>Java finally has [feature x]! No longer any reason not to use Java!
>>
>>56613993
Ordinary magician?
>>
>>56614115
nah you're truly pathetic but i'll let you believe i got btfo i'm not gonna waste time on another fruitless argument with you retarded fucking C# normies
>>
>>56614118
>linq is useless, why would I want functional programming in my objects
>omg streams so beautiful linq btfo
>>
>>56614036
>muh gaymes are not buggy crappy software
have you ever seen a game dev care about security (that is, the security of the users) and stability?

>>56614054
true, there are some exceptions. that doesn't mean shit
>>
>>56614131
>nah you're truly pathetic
I can't even imagine being so much of a fanboy for a language that everyone who would dare disagree is pathetic.
>>
>>56614151
Don't reply to the carposter.
>>
>>56614028
P R A I S E F E R I D U N
>>
>>56614151
who even uses lists lmfao? codemonkeys do. and there is no such thing as instantiating a List in java, it's just an interface. and it's obviously useful to specify if a variable is a parent type or a subtype. and i'm not wasting my time on you.

>>56614159
kill yourself you insufferable queer
>>
>>56610274
Is there any particular sophisticated way to run a python python program within a C# programm?
IronPython doesent work in my case and currently i only have the option to use a subprocess.
>>
>>56614151
It's almost always Java developers who are like this. Like, 90% of the time. It's because they learned Java in college and lack the motivation to learn anything else, so they shit on every non Java language out of insecurity.

Ask what other langugaes they know. It's usually only PHP and JS. Maybe they tried C# for a week and gave up because they didn't like it right away.
>>
File: 1455396581034.jpg (174KB, 1280x720px) Image search: [Google]
1455396581034.jpg
174KB, 1280x720px
>>56614174
>codemonkeys do
Considering how much you like Java, you are a codemonkey as well.
>>
>>56614174
>who even uses lists

The Java Dev(tm) everyone
>>
>we know go is shit, but we still use it

http://bravenewgeek.com/go-is-unapologetically-flawed-heres-why-we-use-it/

The future is dead. Nothing will ever improve because too many humans are simply retards.
>>
>>56614174
>and there is no such thing as instantiating a List in java, it's just an interface
Literally no one said anything other than this. In fact no one even said this. And it's exactly the same as c#. What the fuck are you talking about.

>who even uses lists lmfao
>lists are obviously useful
You're a special kind of shill
>>
>>56614211
learn to read, idiot
>>
>>56614209
Alt + 0 1 5 3
>>
>>56614174
>it's obviously useful to specify if a variable is a parent type or a subtype
Not really, no.
>>
>>56614174
I use lists when I need O(1) push and pop.
>>
>>56614228
Keep digging that hole Ranjeet
>>
>>56614233
That would be a stack/queue/deque, depending on what ends. All of those can be implemented contiguously, too.
>>
>>56614247
stay delusional, smug Cshart in mart
>>
Rob Pike on go:

>The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.
>>
i'm closing this tab i'm done wasting my time on you fucking morons for today at least

also trump is winning
>>
>Just discovered extension methods in C#
I want microsoft to hire me as a shill
>>
>>56614230
What is this?
>>
>>56614248
And they don't always have the required performance characteristics when implemented contiguously.
>>
>>56614288
Stay safe Prajeet
>>
>>56614261
Java fags argue like they code.
>>
>>56614300
There's more to life than worst-case algorithmic complexity.
>>
>>56614290
They're pretty fucking magical.
>>
>>56614290
Extension methods are poor man's typeclasses.

It feels like every mainstream language is becoming a hodge-podge of crappy first-order approximations of features from functional languages.
>>
>>56614299
A hacker technique to blow up your computer. Don't press it
>>
>>56613894
They're gonna give you cancer. The more front-end you do, the more you will want to just drive your car off a bridge.
>>
>>56614276
>They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language
That school must have been quite terrible, lmao. Especially when they learn 4 languages of the same category.
>>
>>56614300
According to Bjarne StewSoup the object overhead of lists almost instantly outweighs the O(1) performance
>>
>>56614314
There's also more to life than amortized algorithmic complexity.
>>
This thread has become so toxic.
That's sad.
>>
>>56614317
>It feels like every mainstream language is becoming a hodge-podge of crappy first-order approximations of features from functional languages.
Sounds about right.

It does not matter...


The functional revolution is coming...
>>
>>56614319
I asked because it did absolutely nothing after I pressed it.
>>
>>56614335
In a lot of cases, sure, it would be better to use a different data structure, but sometimes a linked list is exactly what you need.
>>
>>56614344
;_;
L-Let's talk together then anon, what are you working on? :3
>>
>>56614346
it should make the â„¢ symbol.
>>
>>56614336
Yes, which is why contiguous nearly always beats linked. Cache, cost of allocation/deallocation, etc.
>>
>>56614345
The gradually optionally typed JS revolution is coming, more likely. Fucking kill me.
>>
>>56614365
How so? Who told you that it "should"?
>>
>>56614358
Well, the original statement was:
>I use lists when I need O(1) push and pop.
Which is just wrong, no matter if it's implemented contiguous or linked.
>>
>>56614324
I don't know about america, but here we learn c for OS, java for general programming, which was replaced by python but also still run side by side with python module during the transition, vb.net for a shitty filler credit and haskell as an optional credit. I would assume most colleges are similar with the possible exception of the java/python mess
>>
>>56614367
You're so unimaginative. There are scenarios in which allocation/deallocation is O(1), and you don't have a cache.
>>
>>56614358
The only situation I've heard of is game engines, and according to one angry anon I argued with here, they apparently use a hybrid approach of some kind
>>
>>56614383
>The gradually optionally typed JS revolution is coming
When? I don't see any big move on that. TypeScript hasn't got much adoption yet. I'd fucking love if it did though.
>>
>>56614404
>everything O(1) is fast
There's more to life than worst-case algorithmic complexity.

If it takes several thousand cycles every time, that's O(1). Is it fast?
>>
>>56614386
Google
>>
>>56614393
At my school, ML and Java were mandatory, C/C++ and Prolog were optional. There were no credits available for Python or VB.NET or any other language.
>>
>>56614361
You don't want to know it, my friend.
I'm working on... *cough* JSF project *cough*.
It feels like my soul leaves me.
>>
>>56614417
Are Angular 2, Aurelia, etc. not considered "big moves" to you?
>>
>>56614393
On mine we have 1-3 modules about FP each year and work with functional languages all the time. We also use C on OS stuff and there is an optional module about C++.
There are some modules about enterprise bullshit where they use Java but these are optional.
>>
>>56614432
Well, "Google" is wrong then.
>>
>>56614467
>Aurelia
literally who

Angular yeah, but I've yet to see web devs warm to type safety. Hopefully they do though.
>>
>>56614421
Yes. But worst-case algorithmic complexity matters too. Just because sometimes O(1) means thousands of cycles doesn't mean it necessarily does in every single scenario under the sun.
>>
>>56614467
They're still JS under the hood. It's like rearranging deckchairs on the Titanic.
>>
>>56614276
what's the problem with that? why would you want to mentally masturbate with your language, instead of being productive, and writing safe and stable software?
also, lots, LOTS of experienced devs use Go. the fact that it's easy doesn't mean experienced devs shouldn't use it or something.
>>
>>56614451
Last time I worked on a Java project, I was so annoyed by the lack of multiple inheritance and how I needed to duplicate tons of code so I used the C preprocessor to solve my problem.
It still hurts when thinking about it.
>>
>>56614527
I can get things done faster in Haskell because I don't have to write the same code over and over again because Haskell allows you to write abstract, generic, reusable code.
>>
>>56614489
If you're on a special snowflake OS, maybe.

Otherwise, it's impressive that you're ignorant to inputting alt codes.
>>
>>56614526
no one's claiming otherwise.
>>
Im gonna learn laravel, give me some tips before i start anons
>>
>>56614550
>If you're on a special snowflake OS
Define "special snowflake OS" please.

>alt codes
Ah, it seems like some windows-only useless "feature".
You can't expect everyone to be a retard like you and use windows.
>>
>>56614528
Lack of language feature is not really a problem. It may not be pleasant, but at least you can try different approach. Sometimes abominations like "YourGenericTypeFactoryFactory" are not as bad as it sounds.
The real hell is when you make something that "sort of works", but only partially, and doesn't provide any error message. Documentation doesn't explain anything. Examples don't work. Debugging is impossible. Welcome to the JSF!
>>
>>56614537
yeah, hello world and fizzbuzz are easy
>>
>>56614585
Your projection is showing.
>>
>>56614527
To use an example from a blog pos
func isInt64InSlice(i int64, slice []int64) bool {
for _, j := range slice {
if j == i {
return true
}
}
return false
}

In go you need to rewrite that for int32[], uintXX etc. Any competent language supports the above behavior in the Standard library, go not only doesnt but if my memory serves you cant overload the method.
>>
File: 1411521941397-1.png (402KB, 794x1038px) Image search: [Google]
1411521941397-1.png
402KB, 794x1038px
>third year at uni starting soon
>increasingly find myself hating being a student
>only having to be in for 2 hours a day means i struggle to give a fuck about anything
>if it wasnt for a couple of good modules coming up and about 10k potential difference in my wages, id be seriously considering dropping out
anyone else know these feels? i just want to be employed, so i can have a sensible fucking routine and live on a reasonable amount of money
>>
>>56614528
Why not just use composition instead then?
>>
>>56614562
never heard of it, don't bother?
>>
File: 1452263120865.gif (362KB, 616x800px) Image search: [Google]
1452263120865.gif
362KB, 616x800px
>>56614596
Are you in the UK as well?
>>
>>56614393
>vb.net
wtf
also, when did you graduate?
>>
Need to learn Docker. What the fuck is Docker?
>>
>>56614575
Lack of language features is a big fucking problem. You end up either having to keep more stuff in your head than you should have to (because the compiler should be doing it, not you), or you have to repeat yourself in code unnecessarily.

>>56614585
Just because you don't know any Haskell beyond hello world and fizzbuzz doesn't mean nobody else does.
>>
>>56614596
I have dropped out, got a job, and I'll probably move to a much better job soon.
Experience > Education.
But don't leave uni if you still learn something. I dropped out because I felt I don't learn new things.
>>
>>56614636
The biggest garbage hipster nu-male programmer meme in the last 5 years, avoid it like the plague.
>>
>>56614596
>i just want to be employed, so i can have a sensible fucking routine and live on a reasonable amount of money
It's a nice feeling.

University can fucking suck, but as soon as you land that comfy office job with few hours and enough of a wage that you don't have to worry about necessities ever again, you'll be glad you did it.

That's not to say that uni is required, but it certainly helps to check boxes that HR departments are looking for when wages are discussed.
>>
>>56614589
show to us some valuable software written in haskell

>>56614591
as the authors of Go have said, patches are welcome
or you could use interface{}
or, hell, I could "rewrite" that with regexp easily
>>
>>56614626
Last year. The VB.net thing was literally to waste time at the end of the year while people trickled into their internship positions. It wasn't taken seriously or anything. I believe students focusing on web had php and javascript as optional modules also.
>>
>>56610319
A double is a floating point number ( a decimal number) like 5.5 or 3.14

There is no such thing as a single, if there is something called a single in vb.net that is kekworthy.

A long is just an int but holds more data (number can be bigger without overflowing) And a short is just an int with less data (has a smaller max number, takes less data to store)
>>
>>56614661
>as the authors of Go have said, patches are welcome
>or you could use interface{}
>or, hell, I could "rewrite" that with regexp easily

I mean, you're saying those things like they should convince anyone on the fence that go is good. Even the concept of abusing interfaces in place of generics is mind boggling. They are and always have been solutions for difference problems
>>
>>56614661
Patching go is like building a house on a foundation of sand or putting lipstick on a pig.
>>
>>56614661
You won't see any desktop software written in Haskell, but many big companies use it. Just google it.
(But the real world Haskell is not as clean and pretty as it could be. Do you like these bangs everywhere? I don't, that's why I prefer ocaml)
>>
>>56614660
>be 20
>staying in college so I can remain unemployed
>using college/my scholarship specifically to be eligible for summer work to pay for my living expenses
There aren't many easy ways to get seasonal work easily in CS.
>>
>>56614661
>or you could use interface{}
What's the point of go having a static type system when you have to subvert it in order to get anything done?
>>
>>56614585
While this post is condescending, I've literally never seen a useful piece of software written in Haskell.
>>
>>56611021
If you separate all practice programs into things that are too easy to bother with, or too hard to start, you'll never program anything.

Program something you think you can, along the way you'll see better ways of doing what you already wrote, re write it again and again, research new parts of your lang and move on to bigger projects.
>>
>>56614623
yep
i miss being at college, BTECs were actually fucking engaging, even if the subject material was shit

>>56614646
ive got compilers and data mining coming up, theyre the only modules that are actually even remotely interesting to me.

>>56614660
i fucking hate how the only course worth a damn to employers is a degree, degrees are fucking shit for developing programming skills and experience, and they spread out work that could be done in days over the course of months. im on a full time degree, and their excuse for leaving me with most of the day free is "youre expected to put in X amount of hours studying on your own". no, fuck you, im paying 9k a fucking year for this, the least you could do is give us some god damned lab time and some non-trivial work to do in it.
>>
>>56614716
It's used a lot in finance. You haven't seen it because they don't make the code public.
>>
>>56614730
The other kids are paying 9k for it too. You're all customers, and the customers have demanded a course that is easy enough for them all to pass.
>>
File: MaccyG.jpg (122KB, 1200x799px) Image search: [Google]
MaccyG.jpg
122KB, 1200x799px
skippedList = stream(vipNames).substream(3).collect(toList());


>mfw this is valid java
>>
Since Angular 2 has finally left beta stage I have a hard time deciding whether I should use it in next project. I believe that React+Redux+Rx is superior, but opinionated framework should induce less decision fatigue and be easier to support in the long run.
Can anyone provide a compelling argument why should I switch to Angular 2/stay with React?
>>
>>56614694
>>56614714
As an enterprise Java dev Go's interface{} just reminds me too much of the bad old days of passing Object everywhere when you needed a "generic" method.

This is going to haunt them, a lot of existing libraries will be screwed.
But it's Google, so they can afford to rewrite everything, even if your business can't.
>>
>>56614806
You should use something not shit.
>>
>>56614730
What uni? I'm entering York in a few days for elec & comp engineering because I fell one grade short to do CS.
>>
>>56614817
>This is going to haunt them, a lot of existing libraries will be screwed.
Isn't that the story of angular?
>>
File: renge pensive hmmm.jpg (188KB, 567x720px) Image search: [Google]
renge pensive hmmm.jpg
188KB, 567x720px
>>56614821
React is definitely not a shitty library. I can't tell the same about ng2 because I haven't used it yet, but I don't expect it to be shitty either.
>>
>>56614842
Java before 1.5 and Javascript in general I think.

>New build system every 6 months
JUST
>>
>>56614806
>>>/wdg/
>>
Guys I'm coming out with a new JS framework called Redact. It's basically React except you never delete code, you only append instructions to redact it
>>
>>56614872
Angular is made by/in tandem with (I forget exactly) google which is why I mentioned it. They have a history. Not to mention android
>>
>>56614763
its not even that hard, the single hardest thing ive ever done here could have been produced to full spec within a week, and yet they spread it out across 3 fucking months at a time. i just cant muster the mental strength to give a fuck about so little work when ive got so long to do it.

>>56614833
University of Hull
its a good uni, but its still a uni nontheless. i did a year at essex before i went to hull, and while hull has a far better curriculum its still a uni.

i hear york is a fucking good uni, i also hear its brimming with socjus bullshit and the comp sci course is very maths heavy.
>>
>>56614882
>wdg
Wow, never heard about it before. Thanks.
>>
>>56614902
>University of Hull
I didn't want to guess, but the way you were describing things made me immediately think of Hull. A friend who went there sent me one semester's assignment, meant to take several weeks. I finished it in an afternoon.
>>
>>56614902
Not that anon but what do you think about the University of Birmingham?
>>
Why do people defend weakly typed dynamic languages. Sure they're quick to start with, but they create a maintenance hell in any mid to large project.
>>
>>56614933
if youre doing electrical engineering expect a heavier workload, but i honestly doubt CS at anywhere but maybe the top 10 unis is much better than here. that said, i know a guy who does EE at hull, and good fucking god is their workload harsh, the man barely ever had any spare time, and they werent shy about busting your balls with pages and pages of circuit problems, math problems, and physics shit.

>>56614979
i got rejected from there because apparently they turn their nose up at anyone who opts for BTECs over A levels. i got an A*A*A and apparently that still wasnt good enough for them.
>>
>>56614986
Because they don't want to put in the effort to use strong, static languages. Or they're afraid that they aren't good enough to understand them. So they try to drag us all down to their level and make us wallow with them in their effluent.
>>
>>56614986
Define "weakly typed" and "dynamic languages" please.
>>
>>56615016

You can't be serious
>>
>>56614986
>Why do people defend weakly typed dynamic languages.
I'm being dead serious. But it's because they are retarded. There's no benefit to weak dynamic typing. It just saves work for the people who make the language. Reflect on it all you want, but there's no better answer.
>>
>>56614986
Weak typing sucks. But dynamic typing is better than bad type system. OCaml > JS > Java.
>>
>>56610920
pls gib nice thing
>>
>>56615036
I can. Neither of these is well defined.
>>
>>56615059
>JS > Java
JS's type system is most certainly not better than Java's. Java is just shit for being insanely verbose. What advantage does JS have over Java besides that?
>>
>>56615072
Monads.
>>
>>56615071
You could MAYBE make the argument for strong/weak but static/dynamic is very well defined.
>>
>>56615071
Weak typing means types are not enforced very much at runtime, and can be converted from one to another implicitly easily

Dynamic Typing means types are not enforced at compile time.

>>56615083
true
>>
>>56614817
how come the "computer" "scientists" can't solve the problem java/go have had with generics in a good manner?
hell, google itself does a lot of research and has lots of resources...
>>
>>56613127
>RAII
RAII solves issues C++ introduced and hides issues that you _need_ to fix.
It's horrible but bad programmers just don't realise it because of its hiding characteristic.

And there's plenty of reasons not to use C++ that doesn't even concern the language use alone. C++ compilers are slow and it can greatly reduce your iteration time. You're at risk of exposing yourself to bad sepples (redundant I know) programmers. You almost certainly get people critiquing your code in meaningless ways that simply clutters your issue tracking.

If you consider C++ viable in any situation aside from namespaces (which doesn't impact the code in any significant way, doesn't impact the generated code and overall doesn't confuse anyone with proper use). I'd say you should just say fuck it and move on to some language where you don't care about your software at all. Like Java, JS, python. You get the picture. Your development process will be faster simply because you don't have to deal with C++. And you weren't really using the positive sides to the language (the C parts, basically) well anyway. Its obvious because the language does its best to eliminate the potential the language has.

Oh and as an aside, OOP programmers, use a proper OOP language, not the bullshit in C++.
>>
>>56615102
They can. Pike just happens to be a tard.
>>
>>56615009
>i got rejected from there because apparently they turn their nose up at anyone who opts for BTECs over A levels. i got an A*A*A and apparently that still wasnt good enough for them.
Would you however consider it as a good university if we ignore their acceptance system? Is it SJ maybe? I am asking because my closest friend got accepted there.
>>
>>56615102
They have solved the problem. Java had generics before it was solved and its implementation had to be backward compatible, so it gets a pass. Go has neither of those excuses available.
>>
>>56615072
JS is flexible, that is an undeniable advantage. What advantage does Java have? Primitive type-checking? But disciplined coding + linting helps no less than that. Functional nature of JS also helps to write better code.
>>
>>56615072
Javascript doesnt get much leeway on the verbosity scale. Imagine my shock the first time I saw functions that are 10 or 15 lines long written directly into the argument list of a function call. Fuckin hell JS fags write your callbacks seperately and pass the var
>>
>>56615095
Wrong

>Weak typing means types are not enforced very much at runtime, and can be converted from one to another implicitly easily
For stuff like +, -, etc? These can as well be functions that accept arguments of multiple types.

>Dynamic Typing means types are not enforced at compile time.
This seems more like a implementation detail than a language one.
>>
>>56615102
I believe their answer was effectively that it would make the language too powerful.
>>
>>56614986
Because they don't understand what statically typed languages are and they don't understand what statically typed languages do which isn't strictly a statically typed language requirement.

For instance declaring what type an identifier is associated to is not required. So if you can't get your head around that, well, your option shouldn't matter.
>>
>>56615135
Second part was meant for >>56615100
>>
>>56615126
>JS is flexible
How is more flexible than JS? Without mentioning verbosity.

>Primitive type-checking?
All types are checked at compile time and runtime.
>>
new
>>56615154
>>
>>56615126
The advantage of java is that it taught c# exactly what not to do when building an OOP-first language

>>56615135
>These can as well be functions that accept arguments of multiple types.

That's method/operator overloading and by definition must be type aware. It has nothing to do with the underlying type system. You have no idea what you're talking about
>>
>>56615135
>seems more like a
Well no. That's the 'dynamic' in the dynamic typing. If its enforced at compile time it's a statically typed language.
>>
>>56615134
That wasn't a verbosity problem, the problem was in author's being a retard.
Also, nowadays we use promises instead of callback hell. And soon we will finally move to a cleaner and prettier async/await.
>>
>>56615142
That's a load of horse hockey, though.

First-order generics allow only very basic abstraction. They give barely a smidgen of power.
>>
>>56615144
Considering this idiot
>>56615135
They literally do not understand typing in languages. I guess he answered my question perfectly
>>
>>56615135
>These can as well be functions that accept arguments of multiple types.
That's exactly what they are. And accepting lots of different types make them less type safe.

>This seems more like a implementation detail than a language one.
That's because you are stupid. These "details" are part of the language spec.
>>
>>56615182
>considering this idiot
Well I shouldn't care about your opinion but I suggest reading Wikipedia to get you an introduction to the concept of typing in languages.
>>
>>56615162
>That's method/operator overloading
I have heard of nobody that calls pattern patching in Haskell as "method/operator overloading".

>It has nothing to do with the underlying type system
This is the point.

>>56615165
>That's the 'dynamic' in the dynamic typing. If its enforced at compile time it's a statically typed language.
Which does not make any kind of sense as it is an 100% implementation detail.
>>
>>56615186
A function of type
forall a. a -> a
accepts every type, and yet is very type safe.
>>
>>56615117
i dont know what the curriculum is like, so i cant say a great deal about the place. i do recall that birmingham uni clamped down hard on a protest over tuition fees and staff pay a while back, and that birmingham has a very large muslim population though.
>>
>>56615102
It's been solved many times over. In fact, it was solved as early as the mid-70s with the development of the polymorphic lambda calculus.
>>
>>56615208
>Well I shouldn't care about your opinion but I suggest reading Wikipedia to get you an introduction to the concept of typing in languages.
Says the guy who things static/dynamic typing is ill defined.
>>
>>56615182
Please learn more about type systems instead of spouting words that you heard.
>>
>>56615212
You can't pattern match on types in Haskell.
>>
>>56615236
>>56615208
(you)
>>
>>56615186
>That's exactly what they are. And accepting lots of different types make them less type safe.
Spotted the retard.

>These "details" are part of the language spec.
And how so? This does not make any sense.

>>56615234
He is not me.
>>
>>56615242
I guess its type system is pretty shit then.
>>
>>56615244
Yes, (me).
Are you planing to keep shitposting or use actual arguments?
>>
>>56615236
https://en.wikipedia.org/wiki/Type_system#Static_type_checking
Tell me if that Wikipedia article is wrong or not.
>>
>>56615275
Moron, you've already had these terms explained to you and you just respond with "no" "go read about types" "stop shitposting". You don't get to accuse others of shitposting.
>>
>>56615175
Honestly I think that they fell for Rob Pike's "PLAN 9 IS BEST" meme and the attitude that comes with that.
I mean Go took C's syntax, compiles it down to an IR which is "Not AT&T x64" assembly before emitting machine code.
>>
>>56615288
Replied to you in the new thread.
>>
>>56614002
>> Not using auto.
>> Enjoy having uninitialized but declared variables, generating generic input with wasteful unique_ptr types which are noticeably less efficient than an inferred type, and generally having to deal with horrible template cancer in your lambdas when you don't want to.
>>
>>56615299
>and you just respond with "no" "go read about types" "stop shitposting".
This is false. I made my arguments clear before.
>>
>>56615333
Except you didn't. You made some nonsensical statement about overloads then thought pattern matching and overloads do the same thing.
>>
>>56615349
Please read my posts better next time, thanks.
>>
>>56615305
>compiles it down to an IR which is "Not AT&T x64" assembly before emitting machine code.
Just like most modern compilers for most languages.
>>
>>56615214
no it doesn't. "a" must always be the same type. That makes it strongly typed.

forall a. b -> c

would be weak
>>
>>56615254
>And how so?
Because the language spec specified that the types must be consistent for the code to be legal.
>>
>>56615617
Can happen with dynamic typing.
>>
>>56615742
The entire point of dynamic typing is types do not have to be consistent at compile time.

var x = 10
x = "Cuntly"

is going to be valid in any given dynamic language. It's the entire point.
>>
>>56615766
x can be a sum type of int and a list of chars.
>>
>>56615789
not in a dynamic language. Dynamic langugaes do not put type constraints on variables by their very definition.
>>
>>56615836
The point is that this can be valid code in a statically typed language.
>>
>>56615854
Are you saying that the language spec would treat all strings as a 64-bit integer or something?

I'm not the anon you're talking with, but it seems like this ass-end of the conversation is getting silly.
>>
>>56615854
what? The point was this >>56615742
Which is literally untrue. That's what i was replying to.

Of course this can be valid code in statically typed language. Statically typed languages can be dynamic when they want, but dynamic langugaes can't be static.

dynamic x = 10
x = "Cuntly"

is valid C#

Object x = 10
x = "Cuntly"

is valid Java
>>
>>56615891
>I'm not the anon you're talking with
I would recognise that even if you didn't say it. The difference in knowledge and iq is galactic.

>Are you saying that the language spec would treat all strings as a 64-bit integer or something?
No.
>>
>>56615931
>Of course this can be valid code in statically typed language. Statically typed languages can be dynamic when they want, but dynamic langugaes can't be static.
If you already knew that, then what was the point of >>56615766?
>>
>>56615979
to contradict the guy i was replying to?
>>
>>56616082
You are not making any sense.
>>
>>56616090
The guy claimed the compiler can verify that types are consistent for code to be legal in dynamic langugaes, which is false. Dynamic langugaes do not verify these things by definition.
>>
>>56616156
>Dynamic langugaes do not verify these things by definition.
Their implementations can.

You are replying to an unrelated post however, my post at >>56616090 said that you are not making any sense at >>56616082 specifically.
>>
>>56616206
What is your distinction between the language and the language's implementation?
>>
>>56616206
>Their implementations can.
No they can't. not without failing to compile legal code. And not without making the language statically typed. This is effectively what happens when you put JS through the TypeScript compiler.

>said that you are not making any sense at >>56616082 (You) specifically.
I know. Read more carefully.
>>
File: 1473901825868.jpg (43KB, 480x451px) Image search: [Google]
1473901825868.jpg
43KB, 480x451px
How do you have time for everything you wanna do and learn /g/? Im studying cellular biology in a uni and programming in my freetime. And there is so much shit to do. I have NAS i need to set up, i have a Pi i want to develop a homeautomation system for, i need to learn C properly, rice my desktop, try out javaFX, check out googles word2vec, keep working on my neural net, upgrade my pc, learn golang, etc. etc.
Im sure some of you have the same problem. How do you deal with it?
Thread posts: 404
Thread images: 30


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