[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: 316
Thread images: 31

File: hidamari_dpt_waifu2x_traps.png (2MB, 1618x1308px) Image search: [Google]
hidamari_dpt_waifu2x_traps.png
2MB, 1618x1308px
Old thread: >>55145572

What are you working on /g/?
>>
>>55154853
rewriting c in b
>>
I'm making a script that installs gentoo
>>
>>55154888
gentoo is deprecated
>>
Implementing the linux kernel in untyped lambda calculus
>>
File: uztsbvtzaxn4a2j3bnuw[1].png (1MB, 1280x720px) Image search: [Google]
uztsbvtzaxn4a2j3bnuw[1].png
1MB, 1280x720px
I'm demotivated /g/, what should I build?
>>
Reminder that BASIC prevents many of the bugs that cause security vulnerabilities in C programs on a daily basis.
>>
>>55154873

I've been rewriting C in PL/I, the best language that everyone forgot about.
>>
>>55154940
build a robot that motivates you
>>
>>55154853
I'm working on Ivy. Trying to make the search results preview non-fucky. I figured out that placing the preview bitmaps in a single line in a text% object makes it reflow when resizing the window, which is neat.
>>
Why do people think Visual Studio is better than Code::Blocks?

CodeBlocks:
>supports C projects
>no bloat
>produces less platform specific code
>>
>>55155211
>less platform specific code
Worse.
>>
>>55155211

vs2015

>looks nice

>has everything inc. the kitchen sink
>>
Starting work on an image manager because there are none that do what I want
>>
File: screenshot.png (74KB, 851x525px) Image search: [Google]
screenshot.png
74KB, 851x525px
Does Fortran have any place in modern computing? What are its applications?
>>
>>55155384
Number crunching. So... sciences and economics?
>>
>>55155384
Fortran is an amazing language for numerical processing.

People who don't use it think Fortran still means Fortran 77, but it has changed a lot since then.
>>
>>55155384
no.
>>
File: Firefox_wallpaper.png (946KB, 1920x1200px) Image search: [Google]
Firefox_wallpaper.png
946KB, 1920x1200px
Best C++/C IDE on Debian?
>>
>>55155543
VIM

or if you want a proper IDE CodeBlocks
>>
>>55155543
gcc + your favourite text editor
>>
>>55155543
Qt creator is the actual answer
>>
>>55155543
clion
>>
>>55155543
vim with plugins
>>
>>55155543
vs on wine
>>
github.com/deeepaaa/hachidori
>>
Reposting since I didn't see the new thread

I have an string in C of unknown length. What's the best way to access the last character? I was gonna do a strlen and use that info, but it occurred to me that there might be a better way to access an end of a string than to use strlen.
>>
>>55156166
No better way afaik
>>
>>55156166
>better way to access an end of a string than to use strlen
of course, if you know where it is
>>
>>55156166
if you know a minimum length of the string you can skip the search to the string end to there.
>>
how come Zlib only decompresses small files for me?

Im extracting my raw data from a PNG file with the same program and I know every file I'm trying isn't corrupt.

zlib.error: Error -3 while decompressing data: incorrect data check
>>
>>55156166
If you know the address of something after the string, you can use that.
>>
File: smug_sakura.jpg (29KB, 337x404px) Image search: [Google]
smug_sakura.jpg
29KB, 337x404px
>2016

>Writing software by hand instead of evolving it

>Writing software that doesn't learn from experience

Pathetic.
>>
>>55155384
It's faster than C for what it does
>>
>>55156313
>faster than C
Name a single fortran compiler that is able to use SSE4 vectorisation on x86?
>>
>>55156300
>Writing software that doesn't learn from experience
I'm actually very interested in learning how to do stuff that does. Any book/article recomendations?
>>
>>55156357

1) Read /r/MachineLearning everyday, also read older posts there is a lot of great stuff

2) Try to implement simple stuff, a linear classifier, naive bayes, multilayer perceptron.

Read wikipedia and tutorials, some decent ones are http://karpathy.github.io/neuralnets/ http://scikit-learn.org/stable/tutorial/basic/tutorial.html https://www.toptal.com/machine-learning/machine-learning-theory-an-introductory-primer

You shouldn't have problems with ordinary programming, shouldn't fear highschool math. ML builds on these skills. Also note that using ML is way simpler than coming up with semi-original or even full custom algorithms (an example of semi-custom one: http://benanne.github.io/2014/04/05/galaxy-zoo.html )

keywords: machine learning, supervised learning, logistic regression, k-means, multilayer perceptron, convnet
>>
>>55156331
GCC and Intel
>>
>>55156436
Okay, but I still highly doubt that Fortran compilers make faster programs than C compilers.
>>
>>55156451
it's ok, we expected you to be an idiot
>>
File: 1466286141225.png (523KB, 764x735px) Image search: [Google]
1466286141225.png
523KB, 764x735px
>>55156300
>2017 - 1
>writing software that makes mistakes
>>
>>55156475
Name calling instead of backing up your claim. Classy.
>>
>>55156504
I highly doubt you'd be able to comprehend
>>
>>55156451
In general, no.

But for what Fortran does -- number crunching -- it has basically the same features as C but without pointer arithmetic and aliasing, so you can do the same optimizations and then a bunch more. Fortran compiles to SSE4 easier than C.
>>
>>55156526
>I can't back my claims up
>>
method(self, *args)
library_method(["arg1", "arg2", *args])


how do I add the *args to the new args I'm creating? that doesn't work since it doesn't ~flatten~ the args param.
>>
>>55156572
It can also do a lot more optimizations with arrays and arrays in Fortran are more powerful and nicer to use in general.
>>
>>55155995
fucking spammer
>>
File: smile_with_a_carat_nose.gif (2MB, 500x500px) Image search: [Google]
smile_with_a_carat_nose.gif
2MB, 500x500px
>>55156493

>Writing software that doesn't make mistakes because the problems it solves are trivial

Or rather

>Writing dumb software that doesn't learn AND crashes randomly even on the problems it was designed to solve
>>
>>55156583
>I'm too retarded
>>
Which languages are worse than JavaScript?
>>
File: junko 6.png (891KB, 1265x669px) Image search: [Google]
junko 6.png
891KB, 1265x669px
>>55156918
>being incapable of solving non-trivial problems
>being unable to right functioning programs
>>
>>55155543
I've tried just about all of them and I just keep coming back to vim/text editor of choice

IDEs feel like they get in my way too much, makes it hard for me to really pay attention to what I'm working on, vim has no distractions
>>
>>55156944
Your favorite
>>
>>55156955
You're not writing Java, are you?
>>
>>55156944
Something stupid like brainfuck?
>>
I finally reached feature parity with the old version of my Slack bot after 3ish days of lots of work. When I designed that version, I was expecting maybe a few thousand records to work with and I ended up storing it as random dicts and lists written to files, but once it got to 20k I ended up moving to a proper database. It's actually a lot faster, although I'm not sure why exactly.
>>
http://www.strawpoll.me/10508463/r
Okay /g/, this poll has almost 200 votes. This should give a good idea of what /g/ uses. I'll post it one last time for anyone who still wants to vote.

http://www.strawpoll.me/10508463/
>>
>>55156398
Looks like I've got my work cut out for me. Thx man.
>>
>people still use google's captcha in AD2016CE
>>
>>55156747
nvm I fixed it
["arg1", "arg2"] + list(*args)
>>
>>55157067
>sublime
>atom
Fucking plebs
>>
>>55156747
Are you using Python?

>>> a = [1, 2, 3]
>>>
>>> def method(*args):
... new_args = [-1, 0]
... new_args.extend(*args)
... return new_args
...
>>>
>>> method(a)
[-1, 0, 1, 2, 3]
>>>

>>
>>55157125
*tips fedora*
>>
File: IMG_20160619_120910.jpg (44KB, 523x535px) Image search: [Google]
IMG_20160619_120910.jpg
44KB, 523x535px
>>55156300
>>55156493
>>55156953
Thanks guys
>>
File: junko 1.gif (948KB, 500x240px) Image search: [Google]
junko 1.gif
948KB, 500x240px
>>55157168
>288
fucking pleb
>>
>>55157175
I only started saving from /dpt/ a few weeks ago
>>
>>55156944
>>55157033
JSFuck is valid JavaScript. Even the creators of Brainfuck and Malbolge couldn't come close to that abomination.
>>
>>55157234
>what is JSFuck
>Googles it
Oh god... I now agree with you that javascript is the worst thing out there. That's terrible
>>
>>55154997
PL/I is literally BASED.
http://www.kednos.com/pli/docs/reference_manual/6291pro_014.html
>>
is the JS shill that claims 'rapid prototyping' still around? he can go fuck himself

// Returns 1 if the lines intersect, otherwise 0. In addition, if the lines 
// intersect the intersection point may be stored in the floats i_x and i_y.
char get_line_intersection(float p0_x, float p0_y, float p1_x, float p1_y,
float p2_x, float p2_y, float p3_x, float p3_y, float *i_x, float *i_y)
{
float s1_x, s1_y, s2_x, s2_y;
s1_x = p1_x - p0_x; s1_y = p1_y - p0_y;
s2_x = p3_x - p2_x; s2_y = p3_y - p2_y;

float s, t;
s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) / (-s2_x * s1_y + s1_x * s2_y);
t = ( s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) / (-s2_x * s1_y + s1_x * s2_y);

if (s >= 0 && s <= 1 && t >= 0 && t <= 1)
{
// Collision detected
if (i_x != NULL)
*i_x = p0_x + (t * s1_x);
if (i_y != NULL)
*i_y = p0_y + (t * s1_y);
return 1;
}

return 0; // No collision
}


then some fag commented:

>I just spent like 15 minutes porting it to JavaScript
>>
>>55157125
What's wrong with sublime and atom, clearly a lot of anons love using it.
>>
>>55157541
I bet that took longer to debug than it did to write.
If you were using a scripting language you would have finished an hour ago.
>>
>>55157553
I'm with ya. I like Vim, and I like Atom. Both are two tools to acomplish the same goals. Atom can be a bit "broken" at times (paticularly themes), but the functionality has always been solid - especially with inline linters for JS etc.

For server admin, sure, vim'll do. But I prefer Atom for most of my day-to-day stuff.
>>
>>55157630
kys fag
>>
>>55156572
>but without pointer arithmetic
But wikipedia says Fortran 90 has POINTER attribute, pointer assignment, and NULLIFY statement to facilitate the creation and manipulation of dynamic data structures
>>
>The filmmakers also discovered that three-dimensional computer animation is naturally good at generating the sculpted faces of the people of the South Pacific.
3d is much easier to work with than 2d, it's just math, once you have the math in place everything looks good almost automatically
>>
>>55156451
for number crunching they do
>>
So algebraic data types form a semiring, with + being sum types, * being product types, 0 being the uninhabited type, and 1 being Unit.

Can they be extended to a ring?
>>
>>55157931

2D is also just math
>>
Does anyone watch ppl program on some streaming site? The one on twitch isnt even organized properly and falls under 'creative'.
>>
>>55158093
typical 2d games require "hand-drawn" sprites and animations
>>
>>55158096
Wouldn't that be much slower than reading a book?
>>
>>55158088
"Algebraic data types" are a lot more general than the gimped ML/Haskell version. They can be any algebraic structure.
>>
Guys, how difficult would it be to make a livestreamer plugin?
>>
>>55158088
You would need an inverse function for addition (i.e. a negation, you would need negative types)

There's a paper somewhere, google "negative and fractional types"

But generally, you can do whatever you want. Just define negation however you want that happens to satisfy the right properties.

The problem lies in + being the disjoint union
>>
>>55158109
i dunno. I'd rather watch some1 code than watch some1 play vidya desu.

I think its a good learning resource if the streamer explains his reasoning with what he's doing.
>>
I made a small game in C# when I first started out programming. Now, I would like to port this to Linux with Mono.

However, the game was in windows' command prompt, and used those char blocks for graphics. How would I best port this?
>>
File: mfrn.jpg (47KB, 500x441px) Image search: [Google]
mfrn.jpg
47KB, 500x441px
>>55158179
interesting... bumping that subtopic, I'm curious if someone's gonna link to a programmer-streamer so I can try whatching them... I'm bored af anyway.
>>
>>55158246
I dunno what those char blocks are desu. I know we have ANSI escape sequences working most of the time here in GNUland, and I know for a fact they are capable of doing what you are describing. If it is what you were using on doze, it should fly without any friction whatsoever. Not sure tho. Check https://en.wikipedia.org/wiki/ANSI_escape_code#Platform_support
>>
>>55157710
>But wikipedia says Fortran 90 has POINTER attribute
Doesn't matter pointer arithmetic and aliasing is part of x86. Not letting the user use it doesn't improve things.
>>
>>55154853
I'm working on simple gui application in Qt using Qt creator.
How do I compile it and build release version so I can run it on other windows machine without having Qt libs there?

is it even possibru??
>>
>>55158312
I think that comes close, but my brain is uncooperating at the moment.
However, it seems that ncurses might be more efficient, since these are purely escape characters.
Should've thought of ncurses beforehand though
>>
>>55158338
Statically link everything
>>
>>55158333
>Not letting the user use it doesn't improve things.
Aliasing can require the compiler to generate extra loads and stores. When arrays can't alias, you don't have to worry about overlap so you can process them in any order and you know that you won't clobber input before you use it.

Pointer arithmetic requires an array or other data structure to be stored in memory. A compiler can optimize away intermediate data structures.
>>
>>55158338

There's two ways to do it, both of which are cancer:

#1: Ship the necessary DLLs with your program
#2: Statically link it all
>>
>>55158511
>>55158457
Thanks.
I get the idea this sollution suck, but I'm doing simple program for my brother and I want to avoid driving there and install necessary libs.
I just want to send an exe.
>>
>>55158511
>>55158539
and ofc you don't have a package manager because otherwise you would be in civilised territory... I'd say checkout an open source Qt program for windows and check how they package it. Maybe VirtualBox? (perhaps a shit suggestion, dunno) Pro is that you get the recipe on how to do it for free.
>>
>>55155995
Hi Alessandro De Pasquale, how many dicks did you ate today?
>>
>>55158539

There's nothing to be done for it. Windows is a shitty platform with no real library search path (except for basic shit located in system32 etc. of course) and no package manager.

Every single piece of software ever have a ton of DLL files in their working directory exactly because of this, unless they're statically linked.
>>
>>55157710
And if you make constant use of it even where it doesn't make any sense, the program will probably run slower because of inhibited optimization.

Similarly, C99 now has the "restrict" keyword to allow doing some of the same Fortran optimizations in C, just in a less safe and convenient way.
>>
who /paranoid/ here?

what flags do you use to compile your programs?

I do:
 g++ b.cpp -Wall -ansi -pedantic -Wextra -Wshadow


is there a new one i should know, that will show me hidden errors?
>>
>>55157630
>scripting language
They don't exist.
>>
File: 1465209191709.jpg (72KB, 882x800px) Image search: [Google]
1465209191709.jpg
72KB, 882x800px
>>55158696
alias c="gcc -fdiagnostics-color=always -g -gdwarf-4 -Og -Wall --std=c11 \
-Wpedantic -fno-diagnostics-show-caret -fsanitize=undefined \
-fsanitize=address -fno-omit-frame-pointer -fcilkplus -pthread\
-D_FORTIFY_SOURCE=1 -D_XOPEN_SOURCE=700 -I ~/include/ -L ~/lib/"
>>
>>55158704
- AppleScript
- ColdFusion
- DCL
- Embeddable Common Lisp
- ecl
- Erlang
- JCL
- CoffeeScript
- JScript and JavaScript
- Lua
- m4
- Perl
- PHP
- Pure
- Python
- Rebol
- Rexx
- Ruby
- Scheme
- Tcl
- Unix Shell scripts (ksh, csh, bash, sh and others)
- VBScript
- Work Flow Language
- Windows PowerShell
- XSLT
>>
>>55157012
compiling java from the terminal is actually pretty comfy
>>
>>55158747
"Scripting Languages" as a term means absolutely nothing. Not to mention that many of the languages you mentioned weren't classically classified as scripting.
>>
File: output.webm (1MB, 1280x720px) Image search: [Google]
output.webm
1MB, 1280x720px
blinking leds
>>
File: topgun_1280.gif (383KB, 1280x720px) Image search: [Google]
topgun_1280.gif
383KB, 1280x720px
>>55158762
>>
>>55158762
Which microcontroller?
Did you write the code in Assembly or C?
>>
>>55158762
Can it talk?
>>
>>55158762
why is everyone using jumpers that long for 2cm bus distance connections? it fucking infuriates me just looking at the clutter
>>
>>55158880
looks like a nano
>>
>>55158880
atmega8a and SNx4HC595 shift register
C
>>55158892
yes. its siri
>>55158938
because I have no shorter jumpers and too lazy to cut some myself
>>
File: 1466236131822.png (211KB, 371x377px) Image search: [Google]
1466236131822.png
211KB, 371x377px
>>55158742
>-gdwarf-4
>>
File: 1454785324260.jpg (58KB, 570x487px) Image search: [Google]
1454785324260.jpg
58KB, 570x487px
>>55158742
>>55159016
>>>/a/
>>
File: get out of g.png (94KB, 400x400px) Image search: [Google]
get out of g.png
94KB, 400x400px
>>55159037
>>
>>55158747
>- Embeddable Common Lisp
>- Scheme
Please do not sully the LISP family's name, thanks.
>>
>>55158762
now build a pinball machine
>>
File: nwo.png (837KB, 2504x2725px) Image search: [Google]
nwo.png
837KB, 2504x2725px
>>55159037
>>
File: 1444169183438.jpg (64KB, 774x600px) Image search: [Google]
1444169183438.jpg
64KB, 774x600px
>>55159037
>>55159050
>>
Is there any way to concatenate integers to strings using the preprocessor? Something like

#define AMOUNT 5

char *mystring = "Size must be under "##AMOUNT##" and over 0";
>>
File: kitten.jpg (411KB, 1600x1200px) Image search: [Google]
kitten.jpg
411KB, 1600x1200px
Have you seen a lot of vacancies for
0. D developers
1. CoffeeScript developers
2. TypeScript developers
3. Go developers
4. Rust developers
5. Swift developers
6. <Any functional language>
?
>>
File: D.jpg (42KB, 512x512px) Image search: [Google]
D.jpg
42KB, 512x512px
>>55159297
>D
>Functional
>>
File: 1456279739277.jpg (30KB, 500x272px) Image search: [Google]
1456279739277.jpg
30KB, 500x272px
>>55159324
>CoffeeScript
>TypeScript
>Go
>Rust
>functional
>>
>>55159297
I'm not even sure there even are any postions for these that could be vacant. other than teacher maybe.
>>
>>55159324
>>55159337
Did I say they are functional?
>>
>>55159286
#define AMOUNT 5
#define S(x) #x
#define SAMOUNT S(AMOUNT)

char *mystring = "Size must be under " SAMOUNT " and over 0";

This should work?
>>
>>55159352
yes
>>
Question about C++

I usually write my main function like this:
int main(int argc, char* argv[]){}


but I recently saw it written like this:
int main(int argc, char** argv){}


Is there an actual difference in how argv is handled with the second syntax, or is it just another way of writing the same thing?
>>
>>55159352
yes
>>
>>55159375
** is the same as * []
>>
>>55159375
IS THE SAME FUCKING THING YOU FUCKING FAGGOT
>>
>>55159375
Please prefer using
int main(int argc, char *argv[]){}

Insted, notice the position of *.
>>
>>55159375
Just use Rust.
use std::env;

fn main() {
for a in env::args() {
println!("{}", a);
}
}

>>
I've just been fired from the clock making factory.

after all those extra hours I put in.
>>
>>55159412
I didn’t know, thank you!

>>55159449
Ok, is there any particular reason why? I guess this is more conventional?

>>55159417
this is certainly no thanks to you that people are interested in programming if you talk like this to everyone.

>>55159460
thanks, but I’m not interested as for now~
>>
File: 1466355216727.gif (1MB, 480x270px) Image search: [Google]
1466355216727.gif
1MB, 480x270px
>>55159460
Disgusting.

>>55159463
I approve of this post.
>>
>>55159473
>Ok, is there any particular reason why? I guess this is more conventional?
Because it fits more the syntax of C and C++, example:
int* a, b;

Unlike what one would think, b is actually an integer, not a pointer, instead of one writes
int *a, b;

It will be more clear for the majority of people.
>>
>>55159369
Nope, it becomes

Size must be under AMOUNT and over 0


The AMOUNT token is evaluated as a string in S(AMOUNT)

Nice try though anon

>>55159473
>Ok, is there any particular reason why? I guess this is more conventional?
Yeah. It works the same, but it's good practice since it won't lead to you mistakenly doing something like

char* pt, c; //c is not a *


instead of

char *pt, *c; //now both are pointers
>>
>>55159507
>>55159526

int*
a,*
b,*
c;
>>
>>55159507
>>55159526
I see, thank you for your help anons!
>>
>>55159526
#define AMOUNT 5
#define S(x) #x
#define XS(x) S(x)
#define SAMOUNT XS(AMOUNT)

char *mystring = "Size must be under " SAMOUNT " and over 0";

This?
>>
>>55159546
sigkill yourself
>>
>>55159589
error: process not found
>>
>>55159589
int* *al,* *a,* *b;
>>
>>55159616
>Not being able to find yourself
deep

>>55159657
sigkill yourself immediately

>>55159586
You're a wizard anon
>>
>>55159657
int* *al,* *la,* *h;
>>
>>55159722
derka derka
>>
Daily reminder you can use the keywords "and" and "or" in C++
#include <iostream>

int main(void)
{
int a = 10;
int b = 59;
int c = 23;

if (a == 10 and b == 59 or c == 23)
printf("YES\n");

return 0;
}

>>
>>55159751
Daily reminder that you can do it in C as well
#include <iso646.h>
#include <stdio.h>

int main(void)
{
int a = 10;
int b = 59;
int c = 23;

if (a == 10 and b == 59 or c == 23)
printf("YES\n");

return 0;
}
>>
Let's get some demographics going /dpt/

http://www.strawpoll.me/10528345
http://www.strawpoll.me/10528348
http://www.strawpoll.me/10528364
>>
>>55159795
Anything for you NSA-sama
>>
>>55159795
Antartica
>>
>>55159795
Stop spamming
>>
>>55159804
NSwho? I know nothing of this agency you speak of.
>>
>>55159822
It's literally the first time in my life that I've posted a strawpoll on 4chan
>>
>>55159850
Stop, people keep fucking posting them.
Nobody gives a shit. Worse than a derail.
>>
File: last.png (934KB, 1920x1080px) Image search: [Google]
last.png
934KB, 1920x1080px
I'm working on a replacement for xscreensaver because I wanted to make a custom screensaver and the way xscreensaver does it is retarded in my opinion.

Seriously, having an external window passed to an external executable seems like a pretty good idea to allow custom screen savers or "hacks" in xscreensaver parlance to be written in any language, but then you make two different APIs (both awful) and there's a bunch of additional code that has to be compiled in or rewritten from scratch.

Also xscreensaver has in its codebase a bunch of old shit for X11 that hasn't existed in a thousand years, and I just wanted to make a screen saver.

So here I am making one from scratch, at least the blurring effect is cute.
>>
>>55159880
It's not any worse than half the shit that's said here. If you don't want to participate you can just hide it and move on with your life. I'm actually curious about the people I spend a better part of my time on 4chan talking to.
>>
>>55159881
the i3 lock does the same think


https://github.com/meskarune/i3lock-fancy
>>
>>55157394

Very BASED, anon. It's almost like PL/I set a reasonable standard for dealing with pointers and then Ritchie went "muh mnemonic!" and ruined everything forever.
>>
>>55159795
The most useless polls for this thread. :(
>>
>>55159939
How come anon?
>>
>>55159926
That's good to know, but I wouldn't have used it, I wanted to make something where you can make screensavers in Rust with glium and then just have them work as savers/lockers with the rest of the shit.
>>
>>55159980
The anon who has been posting the editor poll actually has a purpose and relevancy, this one is just a waste of time.
>>
>>55160051
You don't find it interesting to know where people are from?

I was surprised to see 2 asian anons and 2 women, as well as someone over 45.
>>
>>55160051
No he doesn't, he's just gathering marketing data
>>
>>55160098
I put myself as a woman because we are all little girls here.
I also put that I am less than 18 because I have the heart of a loli.
>>
>>55160137
Law of large numbers, anon

I'm glad to have had the chance to brighten your day by letting you lie on a meaningless internet poll
>>
ruby fucks up regex, has no list comp, and cant take comma-seperated array/string indexes or backwards ranges
>perl has no list comp, backwards ranges, or string indexes and doesn't auto-convert ranges to arrays
>coffeescript has no backtick-enclosed shell commands (or shell commands at all), string-reversing, comma-separated array/string indexes, or threading, and is so fucking ambiguous
>python fucks up regex even worse than ruby, has no anon functions, no comma-separated array indexes or tilde-enclosed shell commands

Is there any perfect scripting language?
>>
>>55160163
It's not a lie though, I am talking deeply and purely from my heart.
>>
>>55160168
F
#
>>
>>55160168
>Is there any perfect scripting language?
No because scripting languages do not exist.
>>
>>55160190
meaning what exactly?
>>
>>55160190
>No because scripting languages do not exist.
what?
>>
>>55160188
after looking at that syntax, the only thing I can say is jesus christ that looks horrible. Their regex system is worse than python
>>
>>55160265
regex isn't a language feature you mong
>>
>>55160231
That scripting languages do not exist.

>>55160261
See above.
>>
>>55160274
nor should it be
>>
>>55160274
yeah, it is

>>55160286
you literally have no idea what the hell you're talking about

>>55160295
god, why is this thread so much stupider that usual
>>
>>55160329
It isn't in F# you dolt and if you think regex should be built into a language and not just a library feature then you're in the wrong thread >>>/wdg/
>>
>>55160329
>yeah, it is
No, it is not

>>55160295
This

>>55160329
>you literally have no idea what the hell you're talking about
I do

Looks like you are the retard here.
>>
>>55159928
PL/I has no reserved words either, which is a really underrated idea.

Adding more features should never break existing programs that compile on the same compiler.
>>
>>55160098
I haven't found a variant "Siberia", so I have chosen "Asia"
>>
>>55159375

char * = char[]
both can be used to store arrays of chars.

(char*)* = (char*)[]
array of pointers, where each pointer is an array of characters, effectively a list of words.
>>
>>55160347
fine then explain it to me. if scripting languages don't exist, then what are python, ruby, js, coffeescript, perl, bash, C#, F# and so on?
>>
>>55160399
Programming languages, just like every programming language in the world. Duh

>C#, F#
These two were never called as scripting languages, not even by ignorant fucks like you.
>>
>>55160399
>what are python, ruby, js, coffeescript, perl, bash, C#, F# and so on?
complete shit
>>
>>55160168
> and can't take comma-seperated array/string indexes

You mean like a Perl hash slice?

my %hash = (key1 => 1, key2 => 2, key3 => 3);
print join ', ', @{hash}{qw[key1 key2]}; # 1, 2

before I get yelled at, I find @{hash}{keys} more clear than @hash{keys} for slices since they are pretty different from normal array access.

Perl has map and grep which are pretty close to list comprehension, but aren't lazy like Python iterators.

I would argue coffeescript's inadequacy as a scripting language is even worse than you said. You have to use a C extension just to be able to exec(2). Also coffeescript and node.js generally lack consistent synchronous equivalents for their async functions. Also some stuff like iterating over a file a line at a time is unnecessarily difficult.
>>
>>55160367
Well, Siberia is in Asia anon. Maybe I should've split Norhtern Asia from Southeast from Southwest.

What's it like in Siberia? Most internet-using russians I know are from Moscow or St. Petersburg
>>
>>55160190
>>55160418
a scripting language is a language used for scripting, and is not necessarily turing complete
>>
>>55160439
>a scripting language is a language used for scripting
That would include every programming language ever created.
>>
>>55160457
enjoy your black and white thinking, sperg
>>
>>55160471
You know that I am right.
>>
>>55160481
stay delusional, idiot
>>
>>55160471
...carposter
>>
>>55160343
why shouldn't a useful feature be built into a programming language?

>>55160418
they're specifically a subset of programming languages that are interpreted rather than compiled (except for coffeescript but it can be interpreted too)

>>55160419
tell me more about how great haskell is mongoloid

>>55160421
yeah, that's what I mean. I don't understand why perl is the only language out there that can give you something like

@a = (1, 3, 5, 2, 4, 1, 6, 8)
@b = @a[2, 0, 1, 3] # (5, 1, 3, 2)
>>
>>55160508
kill yourself fagposter
>>
>>55160519
haskell is also fucking shit, kill yourself retard

fuck this shit i'm not wasting more time on this, i'm leaving again, enjoy your garbage "discussions"
>>
>>55160519
>why shouldn't a useful feature be built into a programming language?
Because it's fucking bloat when it can be into a library, holy shit faggot stop posting.

>that are interpreted rather than compiled
Every language can be both interpreted AND compiled.
Not to mention that typically interpreted != scripting.

>>55160544
Says the Java user, lol
>>
>>55160423
Continental climate, lack of sea/ocean. I want to live near a sea :(
It is -40 *C (-40 *F) at winter, +30 (104) at summer.
First part of spring it is dirt + snow, the second part we have dusty "winds".
It can suddenly start snowing in May-June.
We rarely have mosquitos in summer in the city cause it is mostly hot, but in autumn we have mosquitos hell.
>>
>>55156953
>right
*write

ftfy
>>
god, why is /g/ so fucking shitty. We should have gotten rid of /pol/ before it fucking metastasized and spread here

>>55160544
what language do you use then?

>>55160560
Not every language has to be about being fast to run. Convenience is usfull, but I guess you're an elitist manbaby goes REEEEEE whenever you hear that some random group you hate irrationally is learning how to program

fuck off back to your basement haskell cave with the nazi flag tapestry
>>
for the nth time, stop bickering autistically and make this place somewhat sufferable you cunts.
>>
>>55160098
I'm the asian woman over 45
I'm not actually an old asian woman tho ;)

>answering truthfully in NSA polls
>>
>>55160623
>Not every language has to be about being fast to run
Where did I say that, faglord?

>Convenience is usfull
Sure, what does this has to do with anything?

>but I guess you're an elitist manbaby goes REEEEEE whenever you hear that some random group you hate irrationally is learning how to program
...what are you rumbling about?
I do hate you because you are a retard that loves to spread his ignorant opinion, but I am not elitist as I tried to help you learn.

Now, please go back to the topic.

>nazi flag tapestry
>/pol/
What? Who said anything about /pol/?
Kill yourself

>what language do you use then?
He is the carposter, he uses Java
>>
>>55160581
>correcting a 4 hour old post
You have autism
>>
I'm gonna try out Cython by making a Brainfuck interpreter, wish me luck losers
>>
>>55160519

Perl has a metric ton of magical stuff for the built-in aggregates, auto-vivification, the $SUBSEP awkism (e.g. `$hash{qw[a b c]} = "value"`). Assigning to $#array lengthens or contracts the array.

I think the later languages were reacting to this and designed simpler dictionaries and arrays with less dedicated support from the language.
>>
>>55160719
>Cython
Isn't that just python?
>>
>>55160719
        loop_ptrs = {}
loop_stack = []
for ptr, opcode in enumerate(source):
if opcode == '[': loop_stack.append(ptr)
if opcode == ']':
if not loop_stack:
source = source[:ptr]
break
sptr = loop_stack.pop()
loop_ptrs[ptr], loop_ptrs[sptr] = sptr, ptr
if loop_stack:
raise SyntaxError ("unclosed loops at {}".format(loop_stack))
tape = collections.defaultdict(int)
cell = 0
ptr = 0
while ptr < len(source):
opcode = source[ptr]
if opcode == ">": cell += 1
elif opcode == '<': cell -= 1
elif opcode == '+': tape[cell] += 1
elif opcode == '-': tape[cell] -= 1
elif opcode == ',':
tape[cell] = ord(name[inputptr])
inputptr = inputptr + 1
elif opcode == '.': key.append(chr(tape[cell]))
elif (opcode == '[' and not tape[cell]) or (opcode == ']' and tape[cell]): ptr = loop_ptrs[ptr]
ptr += 1
return key
>>
>>55160787
Not CPython, Cython
http://cython.org/
>>55160789
Stooooooop, I want to figure it out myself
>>
>>55160353

It's a shame it never really took off. Well, it did in Russia, but that's about it. I wonder if they're still over there CYKA BLYATing it up.
>>
>>55160812
Yes, it's just yet another python implementation.
What's so difficult?
>>
>>55160830
>it's just yet another python implementation
Not quite, read more thoroughly
>>
What you thinks is real good develop language? All say they use Perl and many others but i need only C and Java.. What the f*** am i loser.. :D
>>
>>55160842
Python with a few extensions, like C with gcc extensions.
So what?
>>
>>55160812
>Stooooooop, I want to figure it out myself
sorry
>>
>>55160853
Yes, you are a looser you fucking faggot. Kill yourself and go back to the shithole you came from.
>>
>>55160862
It allows you to compile much more efficient code than if you just used straight Python, among other benefits listed.
>>
>>55160898
I think you are confusing languages and implementations anon.
>>
>>55160763
my only beef with perl is you cant just do
$str = "abcdefg";
$char = $str[0]; #"a"


its suck a basic thing I don't get why it's not in there
>>
Any books you guys can recommend on helping me learn about cyber security?
What language would help to teach me about cyber security if i decided to learn it?
>>
>>55160954
>cyber security
meme

>What language
none
>>
>>55160910
I understand the difference, you were just pushing it off as "just another Python implementation" when it's a lot more than that.
>>
>>55161072
Your post at >>55160898 clearly shows that you do not.
>>
>>55161093
Actually I do, and Cython is a separate language from Python. Now tell me how I'm wrong even though everywhere else lists it as a language and you just learned about it a few minutes ago.
>>
>>55161156
For a last time, read what you wrote at >>55160898
>>
how are you guys preparing for the upcoming VR hype? (i wish i joined earlier to get $$$ from the app bubble)
>>
>>55161171
Okay, and how am I wrong?
>>
>>55161185
>It allows you to compile much more efficient code than if you just used straight Python
>>
>>55161204
Yes
Feel free to explain what I said was wrong instead of quoting that post over and over again.
>>
>>55160954
every book.
every language.
>>
>>55161212
It shows your confusion between implementations and languages.
>>
>>55161219
It doesn't actually, and since you are incapable of explaining how, you are wrong.
Don't reply to me until you can
>>
can a program be slowed down by writing to standard output too often? Or does it just create a que and keep going on to other functions?
>>
>>55161177
No vr standards means it will either fail or become like the video game consoles (certain titles are exclusive to certain vr headsets).

This means vr is trash and not worth wasting time or money on for the time being.
>>
>>55161265
stdout is line buffered in libc. So for example you calling putchar(), it will only print when it has a full line to print.

And yes, your program can be slowed because terminals are slow as fuck.
>>
>>55161236
shut the fuck up, tard
>>
>>55161236
>he is incapable of reading understanding his own post
>>
>>55161359
Well, I'm gonna go work on what I said I was gonna work on. I'll come back later to see if you are actually capable of explaining yourself instead of being retarded
>>
File: creative accounting.jpg (54KB, 492x501px) Image search: [Google]
creative accounting.jpg
54KB, 492x501px
I'm a CPA, tired of accounting. I plan to become a programmer or possible use my CPA in conjunction with a programming background to get my a System Analyst, Business Analyst, or Database Admin (maybe a different title) job. Either something where I can use the CPA a little or not at all and just do programming/web design, etc.

Anyway, /g/ is harping about algorithms & math for programming. If I read this book and do the exercises, etc., am I all set as far as algorithms & math? I've done a couple websites (HTML), know some SQL, SAS, VBA, & Python. I plan to rev it up with those and add a few others - Java, maybe C, C++, C#, and/or R.
>>
>>55161472
>this book
?
>>
File: Untitled.png (244KB, 603x683px) Image search: [Google]
Untitled.png
244KB, 603x683px
>>55161472
>>55161676
Wrong pic. Either this or the Sedgewick one.
>>
File: 129341271047.gif (338KB, 120x120px) Image search: [Google]
129341271047.gif
338KB, 120x120px
>>55159297
I hope you're not suggesting that lack of job openings means that learning those languages is pointless. Hobbies are a thing too.

>>55159324
>>55159371
>>55159401
Adding "any functional language" to a list of languages does not necessarily imply that the rest of the list is made of functional languages. Try a reading comprehension next time.
>>
So, anyone with databases could help me with picture related?
I am trying to develop and app, mostly for study purposes, that takes care of a shop inventory and purchases. The relationship between Inventory and Item is 1:N and I decided to create a intermediate connection table to have a M:N relationship between Item and Purchase.
Is this schema right or at least decent?
>>
>>55161716
You're not all set, but you're a lot of the way there.
>>
>>55162084
Do you need separate ID columns for Inventory and ItemPurchase?
>>
>>55162104
What else then?
>>
>>55162132
Sorry but why do I ask?
>>
>>55162084
>>55162132
In fact, why not this?

Purchase
* PurchaseId

Item
* ItemId
* Name
* Category
* Description
* Price
* Quantity

ItemPurchase
* PurchaseId
* ItemId
* Quantity
>>
>>55162193
Well I actually thought about it when I first modeled this, but I thought having a inventory table would be good for the future (something like multiple shops with multiple inventories) but I guess this way makes it easier.
>>
>>55162156
From what I remember, the Cormen book is mostly concerned with implementing things in an imperative way. Learning about purely functional data structures and algorithms would help you become more rounded. Larry Paulson's notes here might be a good place to start: http://www.cl.cam.ac.uk/teaching/1516/FoundsCS/materials.html
>>
Is it bad practice to use this in C++?
>>
>>55162244
Yes, you're right that if you want multiple inventories, you'll need something more complex. Maybe Inventory and InventoryItem tables.

Separately, I try to avoid having ID columns if a table's foreign keys can be used as a primary key instead.
>>
>>55162292
Thank you. I would like to learn shit that is practical rather than academic.
>>
>>55162322
How else will you refer to an object's fields if their names collide with those of local variables?
>>
>>55161472
look into design patterns/software modelling as well to make sure your code is organized in a good manner (assuming youre going OOP).

Maybe some formal training in set theory & logic for databases wouldnt hurt?

Also C# has some functional aspects to it and LINQ is a godsend for working with datasets + the language is perfect for beginners. (dont knowm much about the other languages though_)
>>
>>55162350
Purely functional stuff is seeing more use these days, because immutable data makes concurrent code so much easier to get right.

Today's theoretical fluff is tomorrow's practical stuff.
>>
https://www.youtube.com/watch?v=I25UeVXrEHQ
https://www.youtube.com/watch?v=vYso-ZUwEZ0
>>
>>55162350
Trigger warning: Personal opinion.

>practical rather than academic.
I would avoid functional programming and its zealots like the plague then.
It's not that knowing functional programming principles isn't very helpful, but for the most part you can get away with only knowing imperative principles. Most professional programmers go years without writing a recursive function, and even when they do it's for working with a data structure that is naturally recursive (file systems for example).
You'll see a lot of people circlejerk about how great functional programming is on the internet in general, and while it has its merits they're not important for a beginner.

tl;dr ignore >>55162292 until you're at least an intermediate programmer.
>>
>>55162339
This change also eases the item's quantity control since, whenever the user registers a new sale, I just have to subtract the quantity of that item.
Thanks a lot anon.
>>
>>55162350
functional programming is bullshit but you need top-tier math and programming skills to be a great programmer, otherwise you can still be a codemonkey or a decent tier programmer but you won't be doing anything groundbreaking
>>
>>55162474
Yeah, I guess that's fair. I was taught a functional language first, before any imperative languages, so I think of the basics in terms of FP, but I realize that's not the norm.
>>
Can you guys try this? Create a Makefile with this content: (tab in front of mkdir)
all:
mkdir -p {folder, folder{1,2}, folder3}

after executing make it should create 4 folders.
Well, it doesn't. In fact it works if I manually type "mkdir -p {folder, folder{1,2}, folder3}" in the terminal but it doesn't work called from a Makefile. What do?
>>
>>55162479
No problem anon, good luck with your app.
>>
>>55162359
Well I actually use it all the time, even when I dont need to. It saves me confusion since I automatically know that the variable belongs to the class.
>>
>>55162568
you should be doing this with skeleton.

ls -alt /etc/skel
>>
>>55162619
2spoopy
>>
>>55162568
make is shit. Don't use it for things that should be done with a simple sh script.
>>
>>55162568
Maybe you need to escape the brackets somehow?
>>
In the private IP range, why is it that corporations have the Class A, and home networks have class C?
Also what are classes regarding private IP addresses?
>>
>>55162521
>>55162474
>>55162379
So what do you recommend to get good at math & algorithms? Books, tutorials, stuff to practice, etc. Do you guys like anything from Udemy, Lynda, etc.?
>>
>>55162715
i use it to launch an emulator after compilation since im learning 6502 asm

why is it bad?
>>
>>55162733
Classes don't matter for private IPs. Home routers are set up for C class masks because homes are unlikely to have 255+ devices. Corporations might, so sysadmins set it up that way just in case.
>>
>>55162769
Make a sh script that runs make && launches your emulator instead. Let make do compilation things only. That's a better separation of concerns.
>>
>>55162568
remove the outer brackets.
    mkdir -p folder folder{1,2} folder3

or better
mkdir -p folder{,1,2,3}
>>
>>55162769
it's great for compilation.
It's shit for simple commands like mkdir
>>
I'm combining a bunch of .o files into a .so file with g++. However, all the symbols from one of the .o files aren't appearing in the .so file. I checked the .o file with nm and they're there, but not in the .so file.
>>
fucking hell facebook is spooky

will someone explain to me HOW the following happened

i had a facebook, had like 4 friends, so i closed/deleted it

made a new gmail, a new acc which i used for misc purposes, only logged in when i had to use uni net, or using tor

now it's suggesting me people i know irl, and a guy who was friend in previous acc

this is absolutely crazy
>>
>>55162817
the first one creates a "folder{1,2}" folder
>>
>>55162772
Ok, so a subnet mask just divides the IP address into 2 parts, the subnet and the host.
Is the subnet like the intranet of the company?
>>
>>55162359
By not shadowing class variables and prefixing them with "m_" and enabling -Wshadow.
However you do need this when you for example want to call a function using a reference of yourself or have a lambda call functions on this.
>>
>>55161472
desu after you read based CLRS get into some machine learning, your accounting background would make you a pretty good fit for Business Intelligence.
>>
>>55162848
folder{1,2} expands to folder1 folder2
>>
>>55162868
not if called from a Makefile. As I said all these commands work on the terminal.
>>
>>55162831
cookies and/or browser fingerprinting
>>
>>55162826
Why might this be happening?
>>
>>55162880
maybe the shell make is using doesnt support that kind of expansion.
% cat makefile; make; ls
all:
mkdir f{,1,2,3}
mkdir f{,1,2,3}
f f1 f2 f3 makefile
>>
>>55162892
make sure you didnt use --strip option
>>
Ok, so a subnet mask divides the IP address into 2 parts, the subnet and the host. The subnet also allows us to tell which host can directly access which computer without going through the default gateway.

So basically what I am understanding is that the subnet is like the intranet of the company/home network. Where is the subnet physically?
>>
>>55162965this is my output
bash: fg: %: no such job
mkdir -p {folder,folder{1,2},folder3}
{folder,folder{1,2},folder3} Makefile
>>
>>55162762
try this:

https://www.youtube.com/watch?v=HtSuA80QTyo&list=PLxZdKEtmy3GRhETjatYq9v3O8VVt3YrNb

make sure you understand asymptotic complexity (difference between n^2, nlgn, n!, etc) and what they mean. Also make sureyou can at least implement algorithms (in your language of choice, although imperative languages are easier imo)

math : (simple) induction proofs, working with summations, master theorem (recursion), fibonacci sequence, logarithm basics, etc.
sorting algo's: quicksort, linear sort, merge sort, seleection sort, bucket sort, radix sort,
search algo's: binary search, shortest path/dijkstra's algo, breadth first search, depth first search. (last 2 can be done after learning queue)
datastructures: array, list, linkedlist, dictionary, heap, binary search tree, hashtables, stack , queue

and many more. Basically what that book provides for you should give you a good primer. However reading that shit is dry as hell (imo) watch it with some vids, implement them, etc.

Also note that the book is kinda old, so some programming memes like ref are not included so they desbribed harder than they should be. But thats just a detail in the binary search tree (maybe others as well)
>>
>>55162968
>>55162892
>>55162826

It's OK, I wasn't passing -c to g++. Silly me.
>>
File: nepy_pervy.jpg (212KB, 953x988px) Image search: [Google]
nepy_pervy.jpg
212KB, 953x988px
>2016

>Not writing UNSTOPPABLE applications in Solidity

Learn Solidity, pleb

https://en.wikipedia.org/wiki/Solidity
>>
>>55161716
That books alright, I read a couple years ago to study for the AP Computer Science test. You'll learn an okay amount from it.

I passed it btw
>>
>>55162965
I'm using bash on Linux Mint. Which one would work?
>>
>>55162717
>>55162965
ok thanks for the hint. I finally fixed it. This works

SHELL=/bin/bash

all:
mkdir -p {folder, folder{1,2}, folder3}
>>
>>55163103
>>>/a/
>>
>>55162981
Ok. So I found that the subnet physically can just be a switch.
Furthermore, subnettting further divides the host part of an IP address into a subnet and host address, and a subnet.

But physically, what is the Subnet Mask? When i type in ipconfig, i get 255.255.255.0. What is this?? Why is this 255.255.255.0, and not 255.255.0.0?
>>
>>55162474
I thought I understood what the difference between functional and imperative, but I don't. What are some languages that are functional?
>>
>>55163103
>JavaScript-like
kys
>>
>>55162865
Thank you. I'll get that CLRS book.
>>
new thread when?
>>
>>55163808
When you stop being a homosexual
>>
>>55163808
After the bump limit, you stupid fuck.
I guess you're just going to shitpost these last 4 posts away.
>>
>>55163925
Thanks for helping.
>>
>>55163260
Please help b4 thread ends.
>>
Dere bor bruke Haskell, Elm og Idris. Alle andre programmeringsspråk er for gamle.
>>
NEW THREAD!!

>>55163989
>>
File: confusing.png (94KB, 960x788px) Image search: [Google]
confusing.png
94KB, 960x788px
Object based stuff is confusing but I'm determined to figure this stuff out.
>>
>>55164524
it would help if you used something other than filthy fucking retarded shit python
>>
File: 1441357852866.webm (2MB, 1280x720px) Image search: [Google]
1441357852866.webm
2MB, 1280x720px
>>55157175
>fucking pleb
>posting tumblr gifs
fucking pleb
>>
>>55165510
It's Swift.
>>
>>55166034
ok but that's not much better, apple is even worse at programming than microsoft, and C# is shit too
Thread posts: 316
Thread images: 31


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