[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 328
Thread images: 42

File: tmp_7896-148448406691658752768.png (389KB, 934x1000px) Image search: [Google]
tmp_7896-148448406691658752768.png
389KB, 934x1000px
What are you working on, /g/?

Old thread: >>59184963
>>
immutable or constant parameters?
>>
File: 1481981519266.jpg (107KB, 1920x1080px) Image search: [Google]
1481981519266.jpg
107KB, 1920x1080px
You really shouldn't use C++. It's complete garbage.
>>
>>59197188
There's a difference?
>>
>Name of your dream language
>it's top 5 features
>>
websocket server in C. Currently implementing roleplaying function for muh erp
>>
>>59197189
That's what happens when your language is without garbage collection.
>>
>>59197199
>dependent types, impredicative polymorphism + all of Haskell's polymorphism, row polymorphism
>first class code, first class modules (which are identical to records)
>pure, not effect based (but could be extended to support it)
>not solely text based
>very fast and efficient
>>
>>59197209
In Go and Java the garbage collector collects the language
>>
>>59197199
>fast to run it
>fast to develop in
>fun
>anime girl as a mascot
>>
>>59197242
>>anime girl as a mascot
shit i forgot
do over
>>
>>59197210
all of this plus the last part of this >>59197242
>>
>>59197198
yup
>>
>>59197314
What is it then?
>>
>>59197199
>WaifuLisp
>essentially Lisp with static typing
>some syntactic contructs for convenience (looking at you, "(setf (aref my-array 0) 25)")
>anime girl as mascot
>releases have cute names
>awesome IDE
>>
>>59197325
const erases the information about whether the original variable was mutable
or immutable . This information is hidden even from the compiler
>>
>>59197358
But constants are immutable by definition
>>
File: 1466901665251.png (35KB, 537x515px) Image search: [Google]
1466901665251.png
35KB, 537x515px
https://youtu.be/dDg5qa-gVxw?t=20m39s
>>
String s;
char c;
do {
s = StdIn.readString();
q.enqueue(s);
c = StdIn.readChar();
} while (!StdIn.isEmpty());

Why doesnt this piece of shit exit the loop? It works fine for a finite loop. Input of the format "A B C D E".
>>
>>59197420
Don't have sound at the moment.
What are they saying that you need to post a facepalm-spurdo?
>>
>>59197421
check if stdin is ever empty
>>
>>59197421
Because you have a \n at the end and it's consumed by readString. Use something like ignore or clear after readString, I don't know your shit language
>>
>>59197448
>How do we deal with dick jokes made about D language?
>>
File: 1486275222031.png (139KB, 228x260px) Image search: [Google]
1486275222031.png
139KB, 228x260px
>>59197420
>>
>perl has regexps done right
>perl is unpopular
>>
File: 1474230127643.jpg (15KB, 306x306px) Image search: [Google]
1474230127643.jpg
15KB, 306x306px
>>59197420
>>
>>59197485
Yes, because it did pretty much everything else wrong.
>>
>>59197203
Do you already have a Web server?
>>
File: 1481403342500.jpg (2MB, 2000x4000px) Image search: [Google]
1481403342500.jpg
2MB, 2000x4000px
>>59197420
comedy gold
>>
File: 1474219799870.jpg (59KB, 896x921px) Image search: [Google]
1474219799870.jpg
59KB, 896x921px
>>59197508
>that blank spot on the right
FIX DIS
>>
File: regex.png (32KB, 780x432px) Image search: [Google]
regex.png
32KB, 780x432px
>>59197485
>>perl has regexps done right
Perl completely fucked up regexes, and most of the other retards followed suit.
>>
>>59197455
No, never.
>>59197459
It's Java but with a custom made IO-library
>http://introcs.cs.princeton.edu/java/stdlib/javadoc/StdIn.html
>>
>>59197421
>>59197572
You have a readAllStrings method, use that
>>
>>59197593
Didn't work either. What the fuck
>>
>>59197627
fucking hell just drop out already
>>
File: shit.png (149KB, 1280x960px) Image search: [Google]
shit.png
149KB, 1280x960px
stupid interrupts.
>>
Is C++ slower than C?
>>
>>59197662
in the brain department? yes.
>>
>>59197662
>Doesn't even have restrict pointers
Yes.
>>
>>59197662
Idiomatic C is much closer to machine instructions which tends to provide the best performances. That being said you can write C++ in a very imperative style that will pretty much be the same. Generally the more you go in abstraction the more overhead there will be/the harder it will be for your compiler to reason on your program and optimize it. So it's more about how you use them. The common implementations are mature enough to produce fast code on good inputs.
>>
>>59197703
>Idiomatic C
what does this mean?
>>
>>59197728
pointer pasta
>>
>>59197684
You can use restrict in both gcc, clang and vc though. Just like you can use stuff like static_assert in C with some compilers.
>>
>>59197728
Writing C using his main paradigm. For exemple not trying to do higher order functions like the retard from the other thread
>>
>>59197728
idiotic c
>>
>>59197769
What I meant by that is there's always some way to do something very slow in any language if you're not paying attention (or being an idiot on purpose). What I like about C is that since its very simple it's usually quite intuitive.
>>
>>59197572
I remember trying to use that library, it absolutely sucked and I never used it over the standard library.
>>
>>59197662
too slow to handle 14 million interrupts per second
++interrupt_count;
current_int.push_back(vec);
byte* esp; asm("mov %0, esp;":"=rm"(esp));
if (static_cast<std::size_t>(esp - stack.data()) <= config::interrupt_minimum_stack_size)
std::cerr << "STACK OVERFLOW IMMINENT! "; // TODO: increase stack size
std::cerr << stack_use_count << ' '; // HACK
auto i = vec_to_irq(vec);
if ((i & 7) && !in_service()[i]) goto spurious;
>>59197660
>>
>>59197826
>tfw based Terry gets 4 million task switches per second
HolyC is the one true language
>>
>>59197856
That's not the language but ring-0 only and no privilege level changes.
>>
>>59197485
Perl is shit.
>>
>>59197420

who is this purple motherfucker
>>
File: 1480145118930.jpg (115KB, 473x537px) Image search: [Google]
1480145118930.jpg
115KB, 473x537px
>mfw antlr
didn't expect it to work this well
>>
Is rust in any way affiliated with OOP?
>>
>>59197991
Absolutely.

Looks like you're going to have to satiate your mental illness with another, less useful language.
>>
>>59197991
Maybe, but it's more affiliated with Poop.
>>
>>59198001
>Absolutely.
Prove it using type theory.
>less useful language
Anything which uses POO is already useless as far as I'm concerned.
>>59198002
>but it's more affiliated with Poop
so with OOP?
>>
>>59198031
Type theory is a meme. Nothing of use has come of it.
>>
>>59198062
>the ribbit version of """"meme""""
What an absolutely abhorrent post. Are you Canadian or something?
>>
>>59198062
That explains why every single language is dynamically typed.
>>
>>59198095
Canada is a meme. Nothing of use has come of it.

>>59198101
Only the good ones.
>>
>>59198112
You're so naive it's adorable.
>>
>>59198127
Au contraire, only those who waste their time with strong static typing are fools beyond all redemption.
>>
>>59198139
Only a gay person could think that.
>>
File: Screenshot_2017-03-02_15-49-59.png (52KB, 1366x172px) Image search: [Google]
Screenshot_2017-03-02_15-49-59.png
52KB, 1366x172px
Working on JSON API for a much faster Hydrus alternative. It's backend only. Anyone interested in slapping a GUI on this one, once I'm done?
>>
>>59198157
Whatever you say, dynamic typing allows me to be as gender fluid as I could ever possibly want!
>>
>>59198164
what's a hydrus?
>>
>>59198176
Image tagging/organizing/distributing engine in Python, much like a personal booru.
>>
>>59198164
GUI code sucks ass. Just use one of those GUI generator programs.
>>
>>59198175
You're going to get your heart broken you sensitive boy.
>>
>>59198196
Noice, you got a git or something so I can look at your code, I might do a Qt GUI if I find some time
>>
>>59198218
I am already dead inside.
>>
>>59198164
how does it work anyway?
you serve files based on the tag being searched or what?
>>
emacs like text edtior in C
>>
>>59198288
>reddit newlines in code
why do people do this?
>>
>>59198288
That's funny, I was thinking of writing an emacs-like editor, with an elisp interpreter, in elisp. Should I do it?
>>
>>59198301
I do this because it's actually easier to read. Believe it or not.
>>
>>59198288
how is this like emacs
where's the lisp
>>
>>59198329
>C-h v line-spacing RET
>>
>>59198329
There is a distinction between the view and the model.

The view is how the code is formatted on the screen, whereas the model is the code itself.

You expressed a desire to modify the view, but you modified the model instead. That is a severe antipattern. Why not increase the interline space in the editor?
>>
>>59198219
https://github.com/bakape/hydron
The server<->client communication will all be done with HTTP/JSON, so the client can be written in any language and be on a different machine from the server. Most of the core functionality is there, but currently only accessible through the CLI.

>>59198213
Fair point. Have any recommendations?

>>59198269
You get JSON that can be easily converted to file paths. These files can be found simply on the file system, or retrieved through HTTP, if the client is on a different machine from the server. That way the client can easily sort, filter or whatever by the information returned.
>>
>>59198329
Lol.
This
>I d o t h i s b e c a u s e i t ' s a c t u a l l y e a s i e r t o r e a d .
is easier to read than this?
>I do this because it's actually easier to read:
>>
>>59198321
>>59198338
my original plan was to embed libguile but I dropped this idea

>>59198338
keybindings

>>59198354
>>59198379
thanks, didn't know about this
>>
>>59198432
I've just used Qt Creator.
>>
>>59198432
Well I'll see about doing a Qt Interface
>>
HEEEELP! /g/ ;_;

I lost all my rectangles when i resize the JFrame. What should i add to my code?

 
package ArrayLists;

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;

public class array extends JPanel implements KeyListener{

ArrayList<Rectangle> rec_list;
Rectangle r;
int rnd_1, rnd_2;
Random rnd = new Random();

public array(){
rec_list = new ArrayList<Rectangle>();
Add_array();
}

public void Add_array(){
rnd_1 = rnd.nextInt(400);
rnd_2 = rnd.nextInt(400);
r = new Rectangle(rnd_1, rnd_2, 25, 25);
rec_list.add(r);
}

public void paintComponent(Graphics g){
super.paintComponents(g);
g.fillRect((int)r.getX(),(int)r.getY(),
(int)r.getWidth(),(int)r.getHeight());
repaint();
}

public void keyPressed(KeyEvent k) {
int key = k.getKeyCode();
if(key == KeyEvent.VK_SPACE){
Add_array();
System.out.println(rec_list.size());
}
}

public void keyReleased(KeyEvent arg0) {
}
public void keyTyped(KeyEvent arg0) {
}

public static void main(String[] args) {
JFrame frame = new JFrame();
array a = new array();
frame.addKeyListener(a);
frame.add(a);
frame.setSize(400,400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}



thank you.
>>
>>59198527
>java
>>>/r/ibbit
>>
>>59198527
Is your call to repaint in the right place?
>>
>>59198587
Maybe also look into
revalidate
while you're at it.
>>
>>59198587
>>59198644

well i write both it in inside of every method and it doesn't seem doing anything. Also i hear revalidate() method first time
>>
>>59196766
>Is there already such a machine available?
I believe thermodynamics ensure such a machine cannot exist. At least not one big enough for you to write software for it.
But I'm no physicist.
>>
I'm not 100% confident that row polymorphism is the correct type of polymorphism for sessions, but I'm probably just gonna go ahead and try it this way anyways
>>
>>59197420
I'm really surprised that Andrei keeps hiring these conference organizers. The guy on the left left me with an incredibly poor impression from last Dconf. Maybe they're cheap and efficient in all other aspects than presentation.
>>
>>59198722
Why would you want any other kind of subtyping?
>>
>>59198329
>I do this because it's actually easier to read.
Do you have any construct to paragraph your code? Double newline?
It's common to group lines of code using newline but to newline between every single line is weird.

Also I suggest that for your potential coworkers sanity you just modify your editor to insert extra newlines where appropriate in rendering.

Can't be that hard right?
>>
>>59198788
I wouldn't, but I'm not sure whether I'll need to extend the row polymorphism algorithm to make it work properly
>>
>>59198723
>The guy on the left left me with an incredibly poor impression from last Dconf
Why does he dress like that?
>>
>>59198671
Try doing repaint()
inside your space keyevent like:
if(key == KeyEvent.VK_SPACE){
Add_array();
System.out.println(rec_list.size());
repaint();
}

See if it works.
>>
>>59198789
It's ok guise
>>
>>59198922
That's good. I applaud your concern for fellow man.
>>
>>59198922
Which colorscheme of vim is that?
>>
>>59198949
https://emacsthemes.com/themes/meaculpa-theme.html
>>
File: 2017-03-02_15:52:06.png (33KB, 1920x270px) Image search: [Google]
2017-03-02_15:52:06.png
33KB, 1920x270px
>>59198922
Nice i3bar, r8 mine
>>
>>59198980
Comfy, thanks
>>
>>59198982
post source
>>
>>59198919
no its not working.
>>
>>59197209
Behold heathen! I bring you Rust! Gaze into its fearless concurrency, safe programming and zero-cost abstractions.
>>
File: 2017-03-02_15:57:18.png (9KB, 679x174px) Image search: [Google]
2017-03-02_15:57:18.png
9KB, 679x174px
>>59199043
m8 i've got 10 files in total, not posting all that shit, what are you interested in
>>
>>59199075
first for music-control
>>
File: 1457639633135.jpg (48KB, 600x390px) Image search: [Google]
1457639633135.jpg
48KB, 600x390px
Is there a language which uses nothing but types?
>>
>>59199101
#!/bin/bash                                                                                                                                                                                                         

print_bar() {

# percent | 100
# x | max_width
percent=$(mpc | awk '/(playing|paused)/ { print $4 }' | sed 's/(//;s/)//;s/%//')
max_width=20
y=100
width=$(($(($max_width * $percent)) / $y))
echo -n "〈"
for (( i=1; i<=$width; i++ ))
do
echo -n "━"
done
echo -n ""
for (( j=i; j<=$max_width; j++ ))
do
echo -n "━"
done
echo -n "〉"

};

current=$(mpc current)

if [ "$current" == "" ]
then
exit
fi

state=$(mpc status | grep -o paused)

[[ "$state" == "paused" ]] && echo -n "⏸ "

echo -n $current
echo -n " "
print_bar
echo " ($(mpc | grep -oP "\d*:\d*\/\d*:\d*"))"


And I have some keybindings for mpc in the config file
# Music control keybindings                                                                                                                                                                                         
mode "music" {
bindsym p exec --no-startup-id mpc toggle
bindsym n exec --no-startup-id mpc next
bindsym b exec --no-startup-id mpc prev
bindsym s exec --no-startup-id mpc stop
bindsym Escape mode "default"
bindsym Return mode "default"
}
bindsym $mod+m mode "music"
>>
>418 I'm a teapot (RFC 2324)
>This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol, and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by teapots requested to brew coffee.[49] This HTTP status is used as an Easter egg in some websites, including Google.com.[50]
>>
>>59199049
Just making sure, you did hit space after resizing the window right?
I'm out of ideas otherwise.
>>
>>59199075
post all of them or something bad will happen.
>>
File: 1481520154924.png (974KB, 900x900px) Image search: [Google]
1481520154924.png
974KB, 900x900px
>>59199165
No
>>
>>59199173
>>59199165
I hope we won't read about you two in the news.
>>
>>59197137
https://www.haskell.org/documentation

are there any good books in particular or are the all the same level of quality?
>>
>>59199149
You should use a tripcode.
>>
>>59199051
Yes, gaze into its Frankenstein syntax that belongs in a David Lynch movie, its disturbing macro system that offers none of the benefits that you'd see with Lisp, the lack of purity that you'd see in Haskell, and the lack of use that you'd see in every worthless toy programming language.
>>
>>59199248
Nope, they're all shit.
>>
File: friendly screenshot.jpg (717KB, 1920x1080px) Image search: [Google]
friendly screenshot.jpg
717KB, 1920x1080px
>>59199265
Hit your nerve, didn't I? Here is a friendly anime screenshot
>>
>>59198903
https://youtu.be/4oDK91E3VKs?t=15
That's how a VP of development in sociomantic labs dresses apparently.
And he seems to be a computer-illiterate. Exceptionally so.
>>
>>59199435
I don't mind the anime at all.

Your type autism is annoying. /dpt/ is full of autism around relatively pointless shit, and no one actually works on non-trivial projects.

That being said, many of us who actually work on large projects can't really share anything because it would be too easy to get doxxed, or it's all internal business code.

I guess I'm just lashing out because I'm tired and haven't had any caffeine today, combined with being sober for about 48 hours now.

What is your favorite programming language? Why are you looking for something that has "nothing but types"? Are you already experienced with other languages that have things other than types?
>>
File: 1478605265072.png (32KB, 164x164px) Image search: [Google]
1478605265072.png
32KB, 164x164px
making my own bittorrent library in python
got the parsing of .torrent files and tracker protocol working, gonna start on the peer protocol now
>>
>>59197137
Types are shit.
>>
>>59199509
not him but you can share some parts of what you're doing without revealing too much, just don't be retarded
>>
>>59199509
>I don't mind the anime at all.
It was intended as a present of sorts, it isn't something you are meant to dislike.
>Your type autism is annoying.
Let's assume you're right. What tipped you off?
>no one actually works on non-trivial projects.
I'm actually working on 2 different compilers right now so you're wrong.
>I guess I'm just lashing out because I'm tired and haven't had any caffeine today, combined with being sober for about 48 hours now.
It's the opposite for me, I've had a little too much of it which is partly why I'm making this post right now.
>What is your favorite programming language?
Favorite as in the language which pisses me off the least? Probably C and/or Haskell.
>Why are you looking for something that has "nothing but types"?
I just think I don't need anything else.
>Are you already experienced with other languages that have things other than types?
Depends on what you mean by experienced.
>>59199606
Please never say that again.
>>
>>59199588
>Python
it's going to be shit
>>
File: 1486253568922.jpg (40KB, 402x558px) Image search: [Google]
1486253568922.jpg
40KB, 402x558px
>>59199623
>>59199509
>these two posting patterns
Disgusting.
>>
>>59199795
who are you quoting?
>>
>>59199675
you're shit
>>
>>59199795
who are you quoting?
>>
>>59199813
>who are you quoting?
>>59199838
>who are you quoting?
My thought on these two posting paterns>>59199623>>59199509
>>
>>59199623
Types are completely useless.
>>
>>59199941
how can you quote your thoughts?
>>
File: C31DDH7UkAEJGjZ.jpg (149KB, 700x698px) Image search: [Google]
C31DDH7UkAEJGjZ.jpg
149KB, 700x698px
How large and complex are CS final projects?

I study Math and want to see the competition.
>>
File: 1480184903617.png (142KB, 686x441px) Image search: [Google]
1480184903617.png
142KB, 686x441px
>>59199968
Wrong!
>>
>>59200170
Not hard if you're not retarded and don't do it at the last minute like most retard in CS
>>
>>59200170
>complex
>CS projects
lmao. you seem to think for some reason that this is a real science like Math.
>>
>>59200211

>Math
>Science

Are you retarded?
>>
>>59197199
>No GC/Compiled
>Go syntax
>Rust borrowing system
>Works well with most OS API's
>Doesn't cater to SJW's
>>
>>59200257
no. but you seem to be judging by your plebbit posting style.
>>
>>59197137
Pure functional programming languages will have no effect on the world.
>>
>>59200165
By using the quoting functions.
>>
>>59200399
how the hell is that a function?
>>
>>59197485
It's because Perl is borderline unreadable to modern day programmers.

open( CONFIG, "$FileConf" );
while (<CONFIG>) {
$config_line = $_;
chomp($config_line);
$config_line = trim($config_line);
if ( ( $config_line !~ /^#/ ) && ( $config_line ne "" ) ) {
( $Name, $Value ) = split( /=/, $config_line );
if ( $Value =~ /,/ && $Name eq "rule_url" ) {
push( @{ $$Config_val{$Name} }, split( /,/, $Value ) );
}
elsif ( $Name eq "rule_url" ) {
push( @{ $$Config_val{$Name} }, split( /,/, $Value ) )
if $Value;
}
else {
$$Config_val{$Name} = $Value;
}
}
>>
>>59200391
true, only pure imperative languages will.
>>
File: 1487786895960.jpg (323KB, 480x953px) Image search: [Google]
1487786895960.jpg
323KB, 480x953px
>>59200451
>newfags these days and their stupid questions
>>
>>59200492
Not that guy, but in Lisp for example, QUOTE is an operator. What makes you think it has to be a function?
>>
>>59200492
again. who the hell are you quoting?
>>
File: secret_message.png (26KB, 1944x1944px) Image search: [Google]
secret_message.png
26KB, 1944x1944px
just wrote a little bash script that generates qr sheets like this one

i made it for storing my gpg keys on paper

the idea is to scan the codes one by one and then run `cat * > secret-key.asc` on them

how do you rate that lads
>>
trying D today, looks fun [spoiler]so far[/spoiler]
>>
>>59200616
D is shit.
>>
>>59200607
What the fuck did you just said about me you little bitch?
>>
File: 1468512465079.jpg (553KB, 1280x720px) Image search: [Google]
1468512465079.jpg
553KB, 1280x720px
>>59200492
>stereotypical old memes
>well known memes from 2011-2012
>Primarily 2016
>indeterminate time
I don't care about newfaggotry anymore but when others do they should at least not rag on people who are just as new as them.
>haha what a loser he's still on 4chan after this many years
>>
>>59200539
Did I say it has to be a function?
Aren't some operators just calls for functions?

>>59200558
My thoughts. Are you braindamaged.
I can draw it for you if you genuinely prove that you do not understand it. Also solve this so I know I am communicating with an intelligent being.

Eleven + 7 equals what?
>>
>>59200616
It's plagued by people who like programming languages.
>>
>>59200670
hehe
>>
>>59200694
>My thoughts.
Your thoughts what?
>Are you braindamaged.
Is that supposed to be a question?
>I can draw it for you if you genuinely prove that you do not understand it.
Please do.

The answer is 18. 11 (eleven) + 7 = 18
>>
>>59200616
is it oop shit?
>>
>>59200694
No.

>>59200726
Wrong. You just added a string to a number.
>>
>>59200678
>who are just as new as them.
I am an eternal newfag, like everyone that had first contact with this place in 2007.
>>59200726
>implying I will spoonfeed you
Lurk more.
>>
>>59200758
>I am an eternal newfag, like everyone that had first contact with this place in 2007.
Exactly anon. I'm glad you get it.
>>
>>59200758
>I can draw it for you if you genuinely prove that you do not understand it.
So you're a liar? You do know that's punishable by death, correct?
>>
>>59200758
>>59200788
thats epic! i'm associated with the Anonymous organization (4chan hackers)
>>
>>59200752
Who says that isn't legal under my type system?
>>
>>59200849
What type system? All I see is trash.
>>
>>59200794
>So you're a liar?
I try hard to follow the ten commandments, but I fail some times.
>You do know that's punishable by death, correct?
Lying is not punishable by death where I live, for truth many have died.
Image is autism incarnated to prove that I can actually draw it for your redditfag ass. I wish I was getting paid for this shit.

59200823
.
>>
>>59201029
Oh, so you're using a reddit """""DE""""". I should have known before responding to you. I'm afraid I might catch whatever it is that has made you like this.
Your so-called proof is invalid by the way. You haven't proven that someone can "quote" thoughts.
>>
>>59200455
this is easy to read for me (except for the weird indentation on the first line)

could be written better, though
>>
How can I use basic data structures in haskell like n-dimensional arrays, stacks, (priority) queues etc. Is there a standard library like in C++?
>>
>>59201029
>ubanto
>>
>>59200953
>All I see is trash.
Yes, it's called ?rash
>>
why is it a good practice to initialize instance variables in a constructor in object-oriented languages such as Java or C#?

I could see if some logic was needed to initialize the variables, but why wouldn't a simple drop-in of { } be best?
>>
so this year I'll be 27 with a mix match credits with no degree from a community college. I have a shit part time job and well, I need to get out of this. Given that I live in nyc, I figure coding can be my last salvation. I got one of the java books from the sticky and was going to go through it in hopes of learning. Will I make it bros?

any advice?
>>
>>59201129
Through the FFI.
>>
>>59201129
Haskell is shit. Also yes.
>>
>>59201157
You'll have to be pretty good to get a good software engineering job with no degree.
>>
>>59201151
>but why wouldn't a simple drop-in of { } be best?
Because you can't do whatever you want there.
>>
File: 1488332515373.jpg (101KB, 400x565px) Image search: [Google]
1488332515373.jpg
101KB, 400x565px
>>59201097
>>59201141
>my thoughts when I will not post anymore
>>
>>59201157
yes. If you work very hard you can learn A LOT in a year
>>
>>59199149
Coq my man
>>
>>59201029
>unity
>vlc
is this "bait" as we say on reddit?
>>
>>59201185
so its just a meme that you can do it with no degree? I thought programming was one of the few avenues where you could climb without college.


I'm playing with the idea of applying to bootcamps around here whenever they open up for registration
>>
>>59201170
Where?
Or should i just use lists for everything
e.g. A 2d array as [(x, y, value)]
>>
>>59201244
>"meme"
>those spaces
how about you fuck off back to your subreddit?
>>
>>59201244
I didn't say impossible, but everyone with a degree will have a leg up on you.
>>
>>59197137
I'm working on a website where you just click on a button and you are taken a random place on the interwebs - dark or light, funny or sad, piracy or legal .

Currently hosted on : http://mysterylinks.herokuapp.com
>>
>>59201254
>Or should i just use lists for everything
install lisp
>>
>>59201232
Can you prove this please?
>>
>>59201293
Nah, I'd like to refrain from using dynamically "typed" garbage.
>>
>>59201227
has anyone here successfully gone from 0 to career in that manner?
>>
>>59201297
Calculus of inductive construction is all about inductive types and a lot of bullshit.
But if you want an actual proof, no. Also it's not truly a programming language.

Rust is shit.
>>
>>59201316
Too bad, you could be studying a useful language. Enjoy implementing your priority queue in ugly typed trash.
>>
>>59201331
Quite sure most people here haven't gone to career at all
>>
>>59201358
>and a lot of bullshit
Does that bullshit also involve types?
>But if you want an actual proof, no.
It doesn't have to be a formal proof.
>Also it's not truly a programming language.
I just want to program with types, with no additional "garbage".

>Rust is shit.
Were we talking about Rust? How is that related to the conversation?
>>
dynamic """""" typing"""""" is disgusting garbage. so many goddamn issues I don't even know where to begin.
>>
>>59201443
I truly believe that it is an insult to life itself.
>>
>>59201437
How do you know if somebody hates Rust?

Don't worry, they'll tell you.
>>
>>59201443
>>59201465
Well I guess that's unfortunate for you, because it's here to stay!
>>
>>59200309
lol, apparently if you put a logically separate two parts of you 4chan post, that is an indicator that you are a "redditor"
>>
>>59197463
Embrace it of course
>>
>>59201519
>lol
now I have the evidence needed to punish you, redditor.
>>
>>59201443
It has its places, but it certainly shouldn't be default behavior.
>>
>>59201574
>It has its places
This doesn't prevent it from being disgusting garbage
>>
>>59201606
Strong static types are tools of the devil, meant to obfuscate what would otherwise be beautiful code. Turn away from such refuse while you still can, friend.
>>
File: 1459019485666.gif (2MB, 540x603px) Image search: [Google]
1459019485666.gif
2MB, 540x603px
>>59201570
WE ARE LEGION. WE DO NOT FORGIVE. WE DO NOT FORGET. EXPECT US.
we truly are the outcasts of society, unlike scum redditors
>>
>>59201644
>Strong static types are tools of the devil
Only someone who is himself a servant of the devil could say this. How fitting for a proponent of utter garbage such as dynamic """""typing""""".
>>
>>59201644
>Strong static types
>meant to obfuscate
you got your reddit "memes" wrong here.
>>
>>59201690
It doesn't matter whether or not I like dynamic typing. All that matters is that it will always be here, and most programming languages adopt it.

>>59201730
Obviously, if you knew I got them wrong, you must be from reddit. You have to go back.
>>
>>59201804
>It doesn't matter whether or not I like dynamic typing
I can see by your intelligence that you like it. There's no need to be shy.
>All that matters is that it will always be here
How is that even slightly relevant? Obviously an idea can't be destroyed.
>and most programming languages adopt it
This is blatantly false. I wouldn't even call them "languages" though, they're just trash.
>Obviously, if you knew I got them wrong, you must be from reddit.
Is this the kind of reasoning skills they teach you with dynamic """"typing""""? It is safe to assume that information about reddit can be obtained from outside given that there exists a place which said redditors tend to visit. We are in that place right now if you couldn't tell by the large amount of your brethren here.
>>
>>59202005
Are you angry those strong static types of yours aren't being used like the discarded pieces of trash they are? Nice wall of text, faggot.
>>
>>59202046
>Are you angry those strong static types of yours aren't being used
They are. Anyone who can admit basic facts about reality can see this. It doesn't matter though.
>like the discarded pieces of trash they are?
We are talking about static types here, not dynamic garbage. Seems like your meds have worn off again.
>Nice wall of text, faggot.
I can see why a dynamic faggot would have problems reading a small amount of text.
>>
File: shellffish.png (113KB, 1920x1040px) Image search: [Google]
shellffish.png
113KB, 1920x1040px
I'm writing a C++ program that can be called from shell scripts to execute C functions imported from programs/shared objects/DLLs. I'm calling it ShellFFIsh (Shell Foreign Function Interface). You specify the library name and the name of the symbol along with any typed arguments and it will call the function. If there's a return value it will also return it. If I can get it working I'll try to add support for demangling so you can call C++ functions too.

Here's my main function using my boost::program_options wrapper to set up command-line parsing.
>>
>>59202108
>I'm writing a C++ program
stopped reading right there.
>atom
back to your hipster website. "tumblr", was it? something like that.
>>
>>59202129
Can you imagine being so butthurt that you would make posts like this?
>>
>>59202129
If you weren't a brainlet C-autist you would realise this isn't possible in C because it can only store arbitrary types using pointers to void. So you would only be able to call functions who accept no arguments or only pointer arguments. Using tuples I can call functions with arguments of any built-in type.
>>
File: karen haskell.png (818KB, 1280x719px) Image search: [Google]
karen haskell.png
818KB, 1280x719px
>>59202220
I see people making that kind of post about Haskell and anime all the time
>>
>>59199164
yes ;_;
>>
>>59202255
>If you weren't a brainlet C-autist
which I'm not. nice attempt though. stopped reading your worthless post.
>>
>>59202289
Have you ever read more than six words of anything? If not then it's no wonder you're so fucking dumb.
>>
Is anyone here experienced with Selenium?
>>
>>59202082
Keep fooling yourself. Just remember, for every line of statically typed code you write, there will be 10 times as much dynamic code written. It will never die out.
>>
>>59202359
>Just remember, for every line of statically typed code you write, there will be 10 times as much dynamic code written
because you need 10x as much to get anything done
>>
>>59202314
>Have you ever read more than six words of anything?
i have.
>If not then it's no wonder you're so fucking dumb
i have 2 PHDs though so i wouldn't really call myself dumb but whatever.
>>
>>59202359
>Keep fooling yourself.
Every single thing in those posts is absolute truth.
>Just remember, for every line of statically typed code you write, there will be 10 times as much dynamic code written.
Yeah, I wonder why. Maybe because it's garbage which simply can't be written in a non-hacky non-ugly way.
>It will never die out.
Where have I ever said that I want this to happen? I couldn't care less, you can use whatever you want. Just know that it's complete garbage.
>>
File: 1472171200876.jpg (90KB, 951x840px) Image search: [Google]
1472171200876.jpg
90KB, 951x840px
I'm trying to get the home directory of a user in C using getenv("HOME");

The first time I call it, it works perfectly. Gives me the full path to the users home.

The second time I call it, it only returns /home

e.g.
first call
/home/ANONYMOUS


second call
/home


Anybody have any insight as to why the fuck its doing that?
>>
>>59202384
>10x as much to get anything done
but with dynamic types you need 10-100x much time to debug later
>>
>>59202384
>>59202442
Incorrect. Try again, I know you're smarter than this! Do you want the actual answer? Hint: it's because no one cares for strong static types.
>>
>>59202387
>2 PHDs
How did you decide it was a good idea to go for another PhD
>>
>>59202499
>I know you're smarter than this!
Of course, I'm not an advocate of garbage type systems.
>Do you want the actual answer?
I do, but sadly you aren't capable of providing one.
>Hint: it's because no one cares for strong static types.
Do you seriously think that the value of something is in any way determined by the amount of people using it? How can a person possibly be this naive?
That being said, the opposite of what you said is true.
>>
>>59202387
>i have 2 PHDs
600k starting anywhere you want?
>>
File: mathphd.jpg (34KB, 640x427px) Image search: [Google]
mathphd.jpg
34KB, 640x427px
>>59202552
He didn't mention those were PhDs in math.
>>
>>59202552
not interested.
>>59202566
yeah, i forgot to. they are.
>>
In a single linked-list search algorithm that has to be implemented recursively, is it generally better to have copy the first node and use the copy as a cursor to traverse the list, or to just keep reassigning the first node? In my code, I commented out the part where I initially used a cursor and added code where I simply reassigned the first node. Which way is better?
int contains(const struct listNode *pNode, const char *addr){
/* Create a traversal/cursor pointer. This way, we have one pointer that
* always points at the beginning of the list, and another pointer that
* we can use to traverse the linked list.
*/
//struct listNode *cursor = pNode;

/* Implement a linear-search process: if the current node contains addr,
* report success. If not, set cursor pointer to next node. Continue
* search until the end of the linked list. If the end of the linked list
* is reached, report failure.
*/

//Firstly, check if we are at the end of the list and if so, terminate.
if(pNode->next == NULL)
{
return 0;
}

//If we are not at the end of the list, check the current node for the target.
if(pNode->addr == addr)
{
return 1;
}
else
{
//If the target is not found, set cursor to the next node and try again.
//cursor = cursor->next;
//contains(cursor, addr);
pNode = pNode->next;
contains(pNode, addr);
}
}
>>
>>59202544
If no one sees the value in something, of course it will be discarded. You know what else is commonly discarded? Trash. Just like strong static types.
>>
>>59202387
>doing two PhDs
>a smart idea
How are you enjoying all that debt?
>>
Daily Daily Reminder

Everything has already been programmed before and you can't program it any better
>>
>most major languages use static typing
>hurrrrrr static typing is dead
>>
>>59202603
your code shouldnt change what pNode points to as a side effect of computing contains()
>>
>>59202632
No one said static typing is dead.
>>
>>59202623
Many countries have free/mostly-free higher education. Not everybody lives in the United States of Jewistan.
>>
>>59202672

>>59202046
>>
>>59202626
I'm writing a better Hydrus, which is not that hard, because Hydrus is shit. Checkmate!
>>
>>59202672
I bet you post frogs
>>
File: 1467104980190.jpg (35KB, 400x391px) Image search: [Google]
1467104980190.jpg
35KB, 400x391px
>>59198301
>>59201029
>>59201097
>>59201265
>>59201570
>>59201804

>This fag again
>>
>>59202611
>If no one sees the value in something, of course it will be discarded.
How brain-dead does one have to be to conclude that this implies that everything popular is good.
Are you European or something? It sure does seem like that's the case.
>You know what else is commonly discarded? Trash.
I'm glad to see they do that in your barbarian country.
>Just like strong static types.
People supposedly "discarding" them would have absolutely no say in determining their value. But as I have said previously, what you posted right now is blatantly false.
>>
Recommend me some resources to learn C++

I know how to program, just not in C++
Something small and concise, rather than a 600 page book

I just need to understand the basics and syntax
>*, &, const, .h, .cpp, ::
>>
I write the call center software that queues up telemarketers with customers phone numbers purchased from websites and then calls them automatically.

On a scale from 1-10 how immoral is my job
>>
>>59202743
>Recommend me some resources to learn C++
just use indian youtube videos.
>>
File: cpp.png (173KB, 906x697px) Image search: [Google]
cpp.png
173KB, 906x697px
>>59202743
>>
>>59202769
I refuse to listen to pajeets
Worst accent on earth
>>
>>59197332
>Wants Lisp
>Wants IDE
Dude, Spacemacs exists.
>>
>>59202743
Read K&R 2nd Edition.
Once you know C learning anything else is trivial.
>>
>>59202783
you are learning their language, might as well get used to it.
>>
>>59202792
Not true what is this once you learn C language you know all languages meme
>>
dynamic typing
>Shit, an assignment. What does that return, again?
>Alright, what does that type do? Alright cool.
>Shit, an assignment. What does that return, again?
>etc...

Static typing
>Alright, what does that type do? Alright cool.

Really pondering, tbqh.
>>
>>59202897
>meme
that's where I stopped reading.
>>
>>59202897
The majority of popular, industry-used languages are C-based or C-oriented.
C does not abstract away most of the bullshit that modern languages do.
It gives you a good, solid understand of what you're actually doing when you write code.
Once you can write in C, migrating to C++, Java, C#, Python, or fucking-pick-a-language becomes trivial.

It doesn't mean you're any good at them, but it does make it significantly easier to learn them.
>>
>>59202907
dynamic typing is so obviously worse I cant even understand it
>>
>>59199675
Deluge a thing?
>>
>>59202931
>C++, Java, C#, Python
is this supposed to be a list of shitlangs in ascending order?
>>
>to this day dynamic typing has literally no benefits
>people still shill it like mad

why?
>>
>>59202971
>Anything that isn't C or Haskell is shit
autism
>>
>>59202932
It's very simple, actually. Dynamically typed languages are easier to write in. Lazy devs like it easy. There are a lot of lazy devs.
>>
>>59200302
>Doesn't cater to SJW's

Oh no, what if people who haven't merged with their computer chairs via a layer of lithified dorito dust can use it. Having trouble competing with SJW's in the real world marketplace?
>>
>>59202980
who are you quoting?
>>
>>59202985
>Dynamically typed languages are easier to write in
how come? do most people find them easier? i sure don't
>>
>>59203018
You.
>>
>>59203044
how can you quote something which hasn't been said?
>>
>>59202769
>>59202782
>>59202792
>>59202835
>>59202897
>>59202910
>>59202931
>>59202971
>>59202980
>>59203018
>>59203044
I just remembered why i left this board

One genuine question >>59202743 spawns 20 shitposts
>>
>>59203078
all me
>>
I'm doing a little project with an ATtiny and I want to do a time out, so that after ~5 mins of no user input the program goes back to a default state. I'm using timer1 to keep the time. I've thought about using setjmp/longjmp to jump out of the interrupt routine when necessary, but it seems to be discouraged, any other ideas?
>>
>>59203011
>pro sjw post
>reddit spacing
yeah, real surprised there.
>>
Anything that isn't C or Haskell is shit
>>
File: 1462716265073.png (64KB, 180x236px) Image search: [Google]
1462716265073.png
64KB, 180x236px
>>59202743
>I know how to program
>I just need to understand *, &, const
>>
>>59203041
Based on how many people shill Python, at least some people like it.
>>
>>59203119
I can write in java >inb4 more shitposting
I understand pointers and const, but that tier of stuff would be useful to have written down concisely.
>>
>>59203100
Proud OCaml coder. You're idiot.
>>
>>59203041
They are easier for things you write once and forget. It enables to quickly churn out code, receive a paycheck and then push all the burdens of dynamic typing on the poor soul, that has to work on the project next. By that time you're nowhere to found and have repeated this process countless times elsewhere. It also works for management, that often simply measure the manhours needed to achieve a short term goal.
>>
>>59203148
is that a downie?
>>
File: fact.png (14KB, 672x579px) Image search: [Google]
fact.png
14KB, 672x579px
>>59203148
>>
>>59203142
>I can write in java
Sure. Wouldn't call it "knowing how to program" though.
>>
File: 1488481308149.png (6KB, 672x579px) Image search: [Google]
1488481308149.png
6KB, 672x579px
>>59203227
>>
>>59203100
Thank you.
>>
>>59203288
You're welcome
>>
>>59203277
+1
>>
>>59203041
>how come? do most people find them easier? i sure don't
They're "easier" because the language tries to make it Just Work™, regardless of the fact that you can easily end up with completely unexpected types and values, causing runtime errors.
>>
File: anal beads.png (19KB, 657x575px) Image search: [Google]
anal beads.png
19KB, 657x575px
>>59203277
>>
File: 1466587386750.png (26KB, 786x590px) Image search: [Google]
1466587386750.png
26KB, 786x590px
>>59203227
>>59203277
>>
>>59203348
>>59203352
EverythingIsShitMind
>>
File: IMG_4532.jpg (89KB, 732x647px) Image search: [Google]
IMG_4532.jpg
89KB, 732x647px
>>59201291
>Click 'Enter' to get to first mystery site
>it's 4chan
>>
>>59202743
.h and .cpp are the commonly used file extensions for C++ headers and source files. For headers you can also use .hpp. The const keywords specifies a variable that will never change. This usually puts it in another part of the binary called .rodata (Read only data). It can also help with compiler optimization. * usually means you are declaring a pointer or referencing one. & means you are getting a pointer to a variable.
>>
File: 1488481892584.png (9KB, 786x590px) Image search: [Google]
1488481892584.png
9KB, 786x590px
>>59203352
>>
>>59201291
>>59203462
>click enter
>about:blank
>close tab and click enter again
>about:blank
>close tab and click enter again again
>links to itself
This is a cool idea but either the RNG is broken or there aren't enough URLs. And take out about:blank and the same website, that's just annoying.
>>
>>59201291
Also add one of those facebook links that redirects to the profile of whoever is signed in (profile.php? and then any number) so that people think their facebook page is there.
>>
Does anyone here know how to delete a files contents with golang?
>>
>>59203616
I don't know Go but if you open a file in writing mode (not append mode) and then flush the stream, the file will still exist but be empty. This is built into the OS API (Windows and POSIX at least) so it should be the same in any language on basically every platform.
>>
> __identifier
> __init()__

Is there anything more disgusting than underscores in the code, this shit should be banished from programming
>>
I want to make a simple textboard and maybe let only the OP post an image. What language should I learn? PHP? JavaScript?
>>
>>59203721
No,but people using it for everything must be banned.
>>
>>59203742
Haskell
>>
>>59203742
node js for backend, javascript for front end. Make sure you are using es7 stuff and not ancient javascript.
>>
>>59203777
Why nodejs over PHP?
>>
>>59203835
lrn2code tags, fucking faget
>>
>>59203791
One is a bigger meme than the other is utter garbage.
>>
File: 003b6507_medium.jpg (24KB, 253x300px) Image search: [Google]
003b6507_medium.jpg
24KB, 253x300px
>>59203791
>>59203742
Learn vibe.d
http://vibed.org/
>>
>>59203742
node js is one script to handle all clients where php runs a script for client / refresh.
Using js for both frontend and backend makes some things easier.
>>
>>59203835
>Brainfuck Thread Share your best Brainfuck creations!

http://pastebin.com/g0PGp8tc
my interpreter, written in 8086
>>
>>59204012
Does this use DOS interrupts or only BIOS ones?
>>
>>59204066
it seems to be only DOS
>>
    new Thread();


>>59204122
>>59204122
>>59204122
>>
New thread:

>>59204124
>>59204124
>>59204124
>>
>>59204066
int 0x21, which is the dos syscall.
might be possible to do this with bios interrupts, but you'd have to implement the whole file system to read any input.
>>
>>59203880
>Asynchronous IO for maximum speed
Aside from thread context switches, what does this actually mean? It's bullshit right?
>>
>>59204314
being able to do something else while waiting for slow IO operations is definitely not bullshit.
>>
>>59204404
Which is why I said thread context switches aside, because threads also enable parallelism, as do processes.

Purely using a sync IO doesn't make your app run faster, it just enables low-memory-overhead concurrency, i.e. no thread or process overhead.
>>
>>59197137
If I have some string str (represented as a char array with a null byte) in c and I call strcpy like so:
strcpy(str, "");

Why doesn't str become empty? How do I get around this?
>>
>>59205156
>2017
>not using std::string
>>
>>59205156
*str = 0;
>>
>>59205229
>2017
>still using inferior C++
>>
>>59205261
>>59205229
>>59205156
Okay I'm testing this small bit of code and the problem is not that str doesn't get "emptied" but when I try to fill str back up again it becomes the original string again.
>>
>>59205308
Because strcpy just copies whatever is in the string 2 over whatever is in string 1. So if string 2 is empty, nothing is copied. You need to NUL-terminate it at the 0th element, a la >>59205261.
>>
>>59205620
This:
printf("%s\n", str);
*str = 0;
printf("%s\n", str);
for(idx = 0; idx < 1; idx++){
str[idx] = 'p';
}
printf("%s\n", str);

Outputs:

hello

pello

Any ideas on what I'm doing wrong? I want the last line to just be "p".
>>
>>59205679
str == ['h', 'e', 'l, 'l', 'o', '\0']
*str = 0
str == ['\0', 'e', 'l, 'l', 'o', '\0']
str[0] = 'p'
str == ['p', 'e', 'l, 'l', 'o', '\0']

You need to null terminate the string AFTER you write the 'p' to it.
Add a str[1] = '\0';
>>
>>59205760
That helped me thanks. If I made everything after str[0] a null byte would that be problematic?
>>
>>59205792
It's fine, assuming you know the buffer size of str.

If you really want to blank out a section of memory, you should probably use memset.
>>
>>59205985
Alright, thanks again.
Thread posts: 328
Thread images: 42


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