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

File: 1485438720022.png (423KB, 720x720px) Image search: [Google]
1485438720022.png
423KB, 720x720px
Old thread: >>60556768

What are you working on, /g/?
>>
The image you've used, let me express my gratitude to you for using it.
>>
Language translation tool.
>>
File: cute_anime_nerd_girl.jpg (124KB, 680x962px) Image search: [Google]
cute_anime_nerd_girl.jpg
124KB, 680x962px
Any cute girls in this thread? What is your favorite programming language and why?
>>
File: CoffinARCHANT_468x310.jpg (31KB, 468x310px) Image search: [Google]
CoffinARCHANT_468x310.jpg
31KB, 468x310px
>Come up with a pretty decent set of ideas of addressing concurrent programming
>Syntax is nice enough
>Minimal core
>Performs quite good, considering a GC'd languege


>LITERALLY NAME IT CHAPEL
>>
>>60561529
Well it's still better name than C or D.
>>
>>60561523
I'm a cute boy(male) and I can't decide what I like more, Rust or Idris.
>>
>>60561523
I am a "cute girl".

My favorite language is C#, because it's easy to get things done, and LINQ makes me moist.
>>
>>60561573
>I'm a cute boy(male)
what did xemean by this?
>>
}~/prog/c{cat tmp.c
int add2 (int x, int y) {
return x + y;
}

}~/prog/c{gcc -c -O3 tmp.c
}~/prog/c{objdump -M intel -d tmp.o
tmp.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <add2>:
0: 48 81 ec 38 10 00 00 sub rsp,0x1038
7: 48 83 0c 24 00 or QWORD PTR [rsp],0x0
c: 48 81 c4 20 10 00 00 add rsp,0x1020
13: 64 48 8b 04 25 28 00 mov rax,QWORD PTR fs:0x28
1a: 00 00
1c: 48 89 44 24 08 mov QWORD PTR [rsp+0x8],rax
21: 31 c0 xor eax,eax
23: 8d 04 37 lea eax,[rdi+rsi*1]
26: 48 8b 54 24 08 mov rdx,QWORD PTR [rsp+0x8]
2b: 64 48 33 14 25 28 00 xor rdx,QWORD PTR fs:0x28
32: 00 00
34: 75 05 jne 3b <add2+0x3b>
36: 48 83 c4 18 add rsp,0x18
3a: c3 ret
3b: e8 00 00 00 00 call 40 <add2+0x40>

>There are people pretending that C has no overehead
>There are people pretending that compilers are smarter than humans
>>
>>60561695
>There are people pretending that C has no overehead
There are?

I think it's generally accepted that C has very little overhead in most cases compared to other higher-level languages.
>>
File: killself.webm (2MB, 1280x720px) Image search: [Google]
killself.webm
2MB, 1280x720px
/dpt/-chan, daisuki~~

Ask your much beloved programming literate anything (IAMA)

>tfw no question

>>60561695
https://godbolt.org/g/j6Z8xL

>>60561491
Thank you for using an anime image.
>>
>>60561718
>There are?
>I think it's generally accepted that C has very little overhead
>>
>>60561695
C has zero overhead
>>
>>60561695
You're doing something wrong, m8.

$ cat test.c
int add2 (int x, int y) {
return x + y;
}

$ gcc -c -O3 test.c
$ objdump.exe -M intel -d test.o
test.o:     file format pe-x86-64


Disassembly of section .text:

0000000000000000 <add2>:
0: 8d 04 11 lea eax,[rcx+rdx*1]
3: c3 ret
4: 90 nop
5: 90 nop
6: 90 nop
7: 90 nop
8: 90 nop
9: 90 nop
a: 90 nop
b: 90 nop
c: 90 nop
d: 90 nop
e: 90 nop
f: 90 nop
>>
>>60561801
-Ofast
>>
File: Screenshot_2017-05-24_15-40-47.png (36KB, 804x460px) Image search: [Google]
Screenshot_2017-05-24_15-40-47.png
36KB, 804x460px
>>60561695
stop being a nigger
>>
>>60561808
It's the same, the only way to fuck it up is by using -O0:
0000000000000000 <add2>:
0: 55 push rbp
1: 48 89 e5 mov rbp,rsp
4: 89 4d 10 mov DWORD PTR [rbp+0x10],ecx
7: 89 55 18 mov DWORD PTR [rbp+0x18],edx
a: 8b 55 10 mov edx,DWORD PTR [rbp+0x10]
d: 8b 45 18 mov eax,DWORD PTR [rbp+0x18]
10: 01 d0 add eax,edx
12: 5d pop rbp
>>
>>60561817
compiled with gcc -O3 -c btw
>>
Can someone tell me if this guy's being an idiot or if I am being one?
http://yager.io/programming/go.html

On the part about interface{} he complains about not being able to tell what's really going to be the underlying type. Isn't this a problem with literally every generic data structure? Isn't that why you never use the top type of a language to define a data structure's fields? I thought I understood generic data structures but now I'm having a personal crisis over realizing that they're basically never useful.
>>
>>60561764
Please do what this dude is doing in your webm
>>
>>60561764
>>60561801
>>60561817
>>60561831
>Not using a hardened gcc
>>
File: 1495569399515.jpg (53KB, 330x552px) Image search: [Google]
1495569399515.jpg
53KB, 330x552px
What are the best alternatives to Lua (for allowing user-scripting of native binary applications) right now?

Is it a good / bad / terrible idea to try to embed Python in a C++ program?
>>
>>60561769
"very little" is not the same as "none"
>>
>>60561864
just use Lua it's the perfect language for this kind of things
>>
File: 1495314358756.png (25KB, 300x441px) Image search: [Google]
1495314358756.png
25KB, 300x441px
>>60561843
>go
>>
Can anyone give me a decent article on Rust for Java programmers? I'm still thinking in terms of classes and objects and one class per file, I need to know the rusty way of doing things.
>>
>>60561864
LuaJIT, Squirrel, ECMAScript, AngelScript, GameMonkey Script
>>
>>60561885
I have to write an essay evaluating how good or bad of a language it is. I realize how shit it is but I still have to word that properly you see.
>>
>>60561877
b-but

Global by default, and undefined variables evaluating to nil.

These things are so fucking bad.

I could always use Moonscript and translate it to Lua I suppose.

>>60561898
>Squirrel ... AngelScript
These pique my interest. Are either Squirrel or AngelScript fast?
>>
>>60561843
>Why Go Is Not Good
He's being right.
>Isn't this a problem with literally every generic data structure?
No, in a langue with generics you always know that an element of List<int> is an int, you don't need run-time casting and compiler won't let you insert a string in it. In Go you 1) have to cast elements back and forth in run-time 2) don't have compile-time type checks. It's really shit and you should drop it, I'm not even meming right now.
>>
File: shot0033.jpg (310KB, 1920x1080px) Image search: [Google]
shot0033.jpg
310KB, 1920x1080px
>>60561864
http://gravity-lang.org
>>
>>60561843
Absolutely BTFO
>>
>>60561895
If you already know the language, just read the source code of the standard library, it's easy and documented enough to be a good introduction material.
>>
>Comparing Go to Rust
Why
You wouldn't compare parrots to ravens
>>
>>60561930
People should be publicly flogged for creating yet another programming language.
>>
>>60561864
>c++
http://chaiscript.com/
>>
>>60561959
>Go-tards are that desperate
There's no task out there for which Go would be a better choice than Rust.
>>
>>60561959
This
Interested to know, if Rust is a Raven what are C and C++?
>>
>>60561913
What makes it good is the way basic features of the language lets you do basic reflection stuff (iterating the members of a table and printing its keys+values for instance). It's perfect for the small tools users might need.

And depending on the application (games for instance) Lua has a sandboxed environment that has a good reputation. Python simply isn't meant for that.
>>
I've no project idea
Give me something anon, I want to write something useful in C that I can put on my public github
so not a 4chan thread analyzer or shit like that
shoot your ideas
>>
>>60562009
Eagle and Falcons
>>
>>60562009
Vultures
>>
Everytime I hear complaints about Go it's either smug FP faggot or weakly typed code artisan. Maybe I should try Go
>>
>>60561917
Thank you, after writing about Go for six hours I forgot that real languages just assign a type (that isn't just the top type) to the data structure after its creation. However couldn't you just create a real interface that makes sure your types are nicely bounded within what you can work with?

My brain is honestly fried at this point

also read
>>60561909
>>
>>60562017
Make something you would find useful yourself
>>
>>60562017
a CLI version of this https://getcaption.co/
>>
>>60562033
It started well, but C still does everything better.
>>
Making a "secure" backup system, Id happily take suggestions on how to improve.

import os
import binascii
import time
import zipfile
import subprocess

static = time.strftime('%d-%m-%Y--%H-00-00')
file = ' '
importer = ('backup', static, '.txt')
gen = (binascii.hexlify(os.urandom(256))).decode('utf8')
encrypt = 'gpg --batch --passphrase ' + gen + ' --output ' + static + \
'.backup --symmetric --cipher-algo AES256 --digest-algo SHA256 ' + static + '.zip'

with open(file.join(importer), 'w') as f:
f.write(gen)
f.close

zf = zipfile.ZipFile(static + '.zip', 'w')
for dirname, subdirs, files in os.walk('C:\\test\\'):
zf.write(dirname)
for filename in files:
zf.write(os.path.join(dirname, filename))
zf.close()

print 'Starting encryption AES256 hash SHA256'

subprocess.Popen(encrypt, stdout=subprocess.PIPE, shell=True).communicate()

print 'encryption complete'

os.remove(static + '.zip')

# Decrypt gpg --batch --passphrase INSERT --output backup.zip --decrypt
# FILENAME.BACKUP
>>
>>60562033
maybe you should first learn what weak typing is truly about.
>>
>>60562033
>t. FP code ninja
>>
>>60562077
Fact: there is no formal distinction between weak typing or strong typing.
>>
>>60562017
>implement regex in c
>use it to write html parser
>>
>>60562068
I thought that Go is "C for webshit"
>>
>>60562017
Gentoo installer
>>
>>60562093
aren't regex really hard to write tho? for it to be efficient at least
>>
File: anime_pointing_dance.gif (483KB, 243x270px) Image search: [Google]
anime_pointing_dance.gif
483KB, 243x270px
>>60561913
You just don't understand the Lua way. Lua's features make it a nuisance for designing large programs, but very good for writing small ones. You probably don't understand the Luaisms and why it does particular things. For instance, undefined variables as default as useful because you can do things like
word_count = {}
for word in pairs(list) do
word_count[word] = (word_count[word] or 0) + 1
end

Hopefully when you learn more about Lua you can understand why it does certain things
>>
>>60562091
yes there is
>>
>>60562058
>couldn't you just create a real interface that makes sure your types are nicely bounded within what you can work with?
And how would such an interface look like for List<>? You have no bounds on it, except being a type.

Also here's some additional info for you http://nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/ .
>>
>>60562017
write image editor in C for webassembly
>>
In Rust is it bad to have only one struct in a module?
>>
>>60562068
False, Go has a better concurrency model than POSIX threads.
>>
Did the gatekepper get lobotomized?
>>
>>60562121
t. doesn't understand what formal means
>>
>>60562140
Please don't summon him
>>
>>60562150
Why did you write this post so stupidly?

>You don't understand what "formal" means.
is much more effective and direct.
>>
>>60562132
No, why should it be?
>>
>>60562132
>Rust is [...] bad

As for your question, no it's not.
>>
>>60562110
A simple regex system (which just does matching) that can do the basics (concatenation, *, +, ?, (), etc.) isn't actually that hard, you just need to know the theory behind it.
Once you start adding all of the extra shit that people expect from regex systems, that's when things start getting a shitload more complicated.
>>
>>60562140
I've met his type before, it's some form of recreational activity I guess, basically
>consume a lot of drugs
>post furiously on various internet forums
>sleep for 24h+
so he's probably sleeping or hungover
>>
>>60562124
What I mean is you'd write the interface according to the methods you want to use on that list later.

And don't worry, there's no shortage of resources on why Go sucks. What I really need is more time to read them all
see https://github.com/ksimka/go-is-not-good
>>
>>60562182
Ok I might do something like that then. Any link on how to get started with this?
>>
>>60562110
It was a joke altogether and I'm kind of disappointed no one caught it: you can't actually write an HTML parser with regex. It's impossible
>>
>>60562202
Finite automata
>>
>>60562192
But since Go has no generics you'd have to implement a different List for each such an interface you have in mind. The only way to implement universal list is via interface{}.
>>
>>60562163
t. upset
>>
>>60562202
https://swtch.com/~rsc/regexp/regexp1.html
It starts off as a gripe about how most regex implementations suck, but then goes onto talking about the theory behind regex and actually provides an implementation.
There are multiple articles in this series.
>>
>>60562234
>Regards, upset
wtf
>>
le who are thou quoting argument
>>
>>60562268
regarts, dolan
>>
Do all C functions have to finish with a RET instruction? Are there times where the compiler might choose to optimize them away?
>>
>>60562233
I think you're right, and now Go is even worse than I thought. Thanks for the help.
>>
>>60561491
Hi All, Good morning.
I have one windows 10 key. Said it is single lincense. Can I have multiple hard drives on my pc and install multiple windows 10 ?
>>
>>60562313
That's an architectural thing but yeah overall when you do a function call it has to know when the function is done and it must jump back to the instruction after the one that called.
>>
What are some use cases for generic traits?

Generic classes make sense

Generic functions make sense

What the fuck would generic traits be for?
>>
>>60562313
If an execution path in a function ends with a call to another function compiler will generate an unconditional jump instead of a call.
>>
learning generics in C#
i luv this language
>>
>>60562355 (You)
> instead of a call
And a ret, ofc.
>>
>>60562355
Thanks.
>>
>>60562385
HRRESULT for you
>>
->60562330
>>>/v/
>>
File: 1445705986467.jpg (31KB, 853x480px) Image search: [Google]
1445705986467.jpg
31KB, 853x480px
Why are humans such bad computers? Secondary memory is in the head yet system dumps come out the ass??
>>
>>60562450
Humans are built to last decades and withstand decades of abuse. I bet your shitty thinkpad couldn't even last half a century without replacing all of its organs.
>>
>>60562489
>thinkpad
and that is another thing, somehow the human brand of computer cannot think without pads????
so much for machine learning
>>
How do I write a program in lisp to compute the outcomes of fights to the death?

I wish to know who would won in the fight:
>12 video tapes containing footage of Justin Bieber repeatedly saying "baby"
VERSUS!!!!!!!!
>a squirrel
>>
>>60562177
Dunno, it just seems weird having to type
>Foo::Foo
>>
>>60562626
Just pub use it in the parent.
>>
>>60562203
>you can't actually write an HTML parser with regex. It's impossible
I'm pretty sure it is very much possible.
>>
>>60562647
mod Foo;
use Foo::Foo;

Think of it like using namespace Foo in C++
>>
>>60562589
statistics
>>
pretty new to python and I just wanna know how to delete values in a list if it has a repeated character, e.g
my_list = ["cat", "dog", "moose", "fox"]
I want to check if there's a value with a repeated character and than delete it from the list so it looks like this:
my_list = ["cat", "dog", "fox"]
>>
>>60561913
The best languages you can embed into programs to extend them are Lua and Javascript. What makes them great host extension languages are their malleable objects. Lua's tables and Javascript's prototypes.

Pick either Lua or JS. Anything else is wrong.
>>
>>60562762

Create a function that checks a string if a character is repeated, then map that function across the entire list, removing the word if it's true, doing nothing otherwise
>>
>>60562819
JS is just the worst.
>>
I'm planning on writing an HTML5 parser in C, as a good one doesn't exist and it's 2017. I have very little experience in C as far as larger projects go, the extent of my actual project experience is a 4chan image downloader using regcomp, and curl. Is this an achievable long term goal? Any anons out there with experience willing to collab or give pointers?
>>
>>60562762
I'm not familiar with python's functional extensions, but I could show you how to do this in another language if it helps.

You basically want to filter the list by treating each word as a list and grouping by letter and checking to see if any has a count > 1.
>>
>>60562254
That guy is completely right though.

The problem with regexp engines is they try to cram everything under the sun. Meanwhile actual context-free parsers have approximately zero library support.

What we need is a simple regular language parser implementation and a simple context free language parser implementation in the standard library. Regular parsing can follow the algorithms in that guy's article. Context free parsing can use a simple online algorithm like Earley's, it allows you to plug in the grammar at runtime and is ideal for a library, and it's fast enough. Now we just need someone who can decipher the academese of the papers that describe the algorithm
>>
anybody have suggestions on learning embedded C?
>>
File: anal beads.png (7KB, 745x101px) Image search: [Google]
anal beads.png
7KB, 745x101px
>>60562762
Just do this with whatever Python uses:
muhList.Where(x => x.GroupBy(grp => grp).All(grp => grp.Count() == 1));
>>
>>60562762
def has_repeated_characters(word):
return len(set(word)) != len(list(word))

my_list = ["cat", "dog", "moose", "fox"]
my_list_filtered = [word for word in my_list if not has_repeated_characters(word)]

print(" ".join(my_list_filtered)) # cat dog fox
>>
>>60562762
my_list = ["cat", "dog", "moose", "fox"]

def has_repeating_characters(s):
"""Returns whether a string contains two or more characters that occur directly after each other"""
if len(s) < 2:
return False

last_char = s[0]
# We iterate over the characters and test whether they're the same as the last character
for current_char in s[1:]:
if current_char == last_char:
return True
last_char = current_char
# Nothing has matched so we return False
return False

assert list(filter(has_repeating_characters, my_list)) == ["moose"] # >True
>>
>>60561523
cute girl here
i program in holyc :-3
>>
>>60562925
>>> has_repeated_characters("aba")
True


Not sure whether this is what he wants
>>
>>60563003
I'm not sure either. His example was ambiguous
>>
>>60562925
Oh, I see what you did there. Makes more sense than my approach. I can duplicate your take like:
bool HasNoRepeatedCharacters(string x) => x.GroupBy(grp => grp).Count() == x.Length;

var muhList = new List<string> { "cat", "dog", "moose", "fox", "boobies" };

muhList = muhList.Where(HasNoRepeatedCharacters).ToList();

WriteLine(string.Join(" ", muhList));


>>60563003
He never said anything about the letters being consecutive.
>>
>>60562925
len(list(word)) -> len(word)*
>>
>>60563027
I thought he kind of implied that with the `moose` example. Anyways, the asker can choose whatever version he wants.
>>
>>60562879
>>60562841
I got it, cheers guys!
>>
>>60562879
You could also shift string a to the right by 1 byte into b, then pop the first byte off string a and pop the last byte off string b. Then you test whether a xor b == 0. This will only work with ASCII though.
>>
>>60563113
*any of the bytes of a xor b == 0
>>
File: 1468268393127.png (183KB, 623x528px) Image search: [Google]
1468268393127.png
183KB, 623x528px
import std.stdio;

void main(string[] args)
{
string[] result;
foreach (arg; args[1 .. $])
{
bool duplicated = false;
foreach (index, _; arg[0 .. $ - 1])
{
if (arg[index] == arg[index + 1])
{
duplicated = true;
}
}
if (!(duplicated))
{
result ~= arg;
}
}
writeln(result);
}


I love cute problems :)

[user0@primary test-d]$ ./test abc def ghiij klm
["abc", "def", "klm"]
[user0@primary test-d]$ ./test duplicaated not-duplicated
["not-duplicated"]
[user0@primary test-d]$
>>
File: safe_code.jpg (127KB, 1188x515px) Image search: [Google]
safe_code.jpg
127KB, 1188x515px
Safe code is slow
execution time registered to be: 2763ms
>>
>>60563155
80 characters per line or you are doing something wrong.
>>
>>60563205
>80 characters per line
"no"
>>
>>60562682
you can't parse HTML with only strict regex because HTML is not a regular language. it's possible if you can match back-references but that technically wouldn't qualify as a regular expression anymore
>>
>>60563136
I've seen you a lot here and I wonder, have you ever wrote a D program longer than 50 lines?
>>
>>60563235
>you can't parse HTML with only strict regex
Correct in a classical sense of regex, but you can do it with PCRE and alike.
>>
>>60562925
This helped a lot, thanks anon.
>>
>>60563205
Yea, cause:
#test_gfx_memdriver $ putcolor_at(h,
PIXL_POS_X,
PIXL_POS_Y
) -> catch
(e:Error)$set_error(e:Error);

Is soooo much better
>>
>>60563257
Are you sure you haven't mistaken me for anyone else?
>>
>>60563266
right. it's a matter of definition vs. implementation
>>
>>60563301
Are you implying there is more than 1 (one) D programmer who posts small trivial code snippets here?
>>
File: 1490395475313.png (522KB, 519x697px) Image search: [Google]
1490395475313.png
522KB, 519x697px
>>60563327
I can definitely claim that there are 2 other D friends ITT, anon
>>
>>60563350
Wew, it's like half of the entire D userbase.
>>
File: 1468031539090.gif (415KB, 500x500px) Image search: [Google]
1468031539090.gif
415KB, 500x500px
>>60563394
That's alright. Not all language is for everyone. :)
>>
>People using dark themes
>While working in well illuminated rooms
>While they constantly switch to normal webpages which most of the time use light themes
So they want to go blind by 40 just because memes?
>>
>>60563394
>Wew,
But the real question is how many lads do you intend to inject into the wew.
>>
>>60563423
>>People using dark themes
>>While working in well illuminated rooms
Restricts attention to the screen
>While they constantly switch to normal webpages which most of the time use light themes
Webpages like stackoverflow and reddit?
>>
>>60563423
>he doesn't know how to make every webpage always use dark themes
* {
background color: black !important;
color: lightgray !important;
}

>inb4 >>>/g/wdg/
>>
>>60563450
>>inb4 >>>/g/wdg/
Gate keeper took the meds, he's out cold today
>>
>>60563450
oops background-color not background color
>>
File: care-terminal.png (792KB, 2868x1710px) Image search: [Google]
care-terminal.png
792KB, 2868x1710px
>>
Is there a way to inject bindings into a closure?

Example:
(defun make-lexically-incomplete-binary-adder (a)
#'(lambda () (+ a b)))
;; How would I complete this adder after making it?
>>
>>60563609
That font rendering is nice. What went so right?
>>
>>60563620
Assuming you're using CL, you don't need #' when using a lambda. Are you talking about b in particular?
>>
>>60562313
no
>>
C++ is what you use when you try to use C but get really insecure about newer languages' built-in features while suffering from inferiority complex.
>>
>>60563661
Oh. Oops, didn't know that. Yes I'm talking about how would you inject a binding for b to create a function that doesn't throw when you call it
>>
>>60563653
>What went so right?
Girls in tech
>>
>>60562762
>>60562923
>>60562925
>>60562972
>>60563003
>>60563027

Here's my high performance version in C. Pretty sure it doesn't get any faster than this.
#include <stdio.h>
#include <string.h>

int has_repeated_characters(char *a) {
const char *b = a + 1;
const int len = strlen(b);
for (int i = 0; i < len; i++) {
if (a[i] == b[i]) {
return 1;
}
}
return 0;
}

int main() {
char a[] = "moose";
printf("%d\n", has_repeated_characters(a));
}
>>
>>60563609
lol nice try
BEHOLD: The fastest terminal emulator
https://github.com/jwilm/alacritty
>>
>>60563675
No problem. You were almost 100% on the mark. Just put b in the argument list of the lambda.
(defun make-lexically-incomplete-binary-adder (a)
(lambda (b) (+ a b)))

Then you can do this:
> (funcall (make-lexically-incomplete-binary-adder 2) 3)
5
>>
>>60563720
>GPU-accelerated terminal emulator
anything using cairo/qt is gpu accelerated
>>
File: true or what.png (8KB, 475x327px) Image search: [Google]
true or what.png
8KB, 475x327px
int a = 10;
int b = 0;
System.out.println("int a = 10 and int b = 0");

System.out.println("7 < a || a == b && b > 9 - a / b");
System.out.println(7 < a || a == b && b > 9 - a / b);

/* output
* int a = 10 and int b = 0
7 < a || a == b && b > 9 - a / b
true
*/


why or how does this evaluate to true? when you cant divide by zero
evaluating b > 9 - a / b on it's on gives an error
>>
>>60563720
>gpu accelerated terminal emulator written in Rust
oh man
how can anyone outmeme this
>>
>>60563720
I'm a big fan of Rust, but a significant part of the speed comes from the lack of scrolling. And when you use tmux it's actually slower than some competitors that do offer scrolling
>>
>>60563711
please make asm version with loop unrolling and other shit
>>
>>60563725
Thanks. I know this part, but I was wondering if there's a way to inject bindings into a closure OTHER than by passing arguments. Like if you just have some function already, and it uses a binding it captured from the context of its definition, and you'd like a copy that uses a different binding instead. I realize the better solution would be to just make that binding a parameter, but I'm just curious.
>>
>>60563754
https://hyper.is/
>>
File: 1479694998212.gif (2MB, 250x250px) Image search: [Google]
1479694998212.gif
2MB, 250x250px
>>60563822
>Terminal emulator
>Written in fucking Javascript

What the fuck were they thinking?
>>
>>60563855
You can browse web too
>>
>>60563775
Ack, I'm sorry. I haven't done that so it wasn't totally clear to me. Interesting thought though. Maybe you could achieve this through dynamically scoped variables? I'm just kind of shooting in the dark though.
>>
>>60563822
>>60563861
That's cute but if it can't set it up as PID 1 on linux kernel then it's worthless.
>>
>>60563711
Don't ever fucking quote me again with code from that disgusting, outdated language.
>>
>>60563822
Oh god, I can only imagine the CPU and RAM usage.
>>
>>60563917
>outdated
As long as Rust can't beat my code in terms of performance, I'll just keep using it when I need it.
>>
>>60563855
>the javascript already has a desktop gui frontend
>write html frontend too
>upload to a server
>make it start on an ssh session to the server it was downloaded from
>advertise your service as the ssh server account you can use on any device
>>
>>60563738
Scrubbed distracting stuff:
false || 1/0 == 0 
crashes with ZeroDivisionError or whatever it's called;
true || 1/0 == 0 
doesn't and it turns out it's true. This is a feature of most modern languages called short-circuiting: if the first value in a || evaluates to true, the computer can deduces that the whole expression will be true regardless of whether the second value is true or false, so it simply skips it. Same goes with
false && stuff 
this allows the programmer to voluntarily put the less expensive checks first and know the computer will make use of that information.
>>
>>60563977
5/10.
Would be better if you scrapped the SSH idea, took out the terminal emulator element altogether, and just wrote a JavaScript application that uses AJAX to handle IO to and from a PHP application that acts as a pipeline to and from a TTY process on the server. Remote access over HTTP, no SSH necessary.
>>
so /g/ i learned java programming in high school for UIL and I got the basics down and was wondering if you guys knew of a good book to learn and practice intermediate level java
>>
>>60564266
Some kind of security would be good though, so at least HTTPS.
>>
File: cscheme.jpg (73KB, 937x522px) Image search: [Google]
cscheme.jpg
73KB, 937x522px
R8 my colorscheme
>>
>>60564310
4/10, -1 for the font, 3/10 is the best I can do.

Too jarring.
>>
How alive language standard ML is?
>>
>>60564310
where Option<T>: From<T>

Why?
>>
>>60563738
are you baiting?
7 < a is true so it will not check further into the conditions
>>
>>60564310
awful font, awful colors, awful background color
>>
>>60564352
Why not?
>>
>>60564310
sleep is ugly color
numbers are ugly
rest is actually pretty nice
>>
>>60563738
>>60564366
also
>BlueJ
>>
>>60564339
So whats the best terminal font in your opinion anon?
>>
>>60564366
>>60564389
it's for an exam using school resources lol not bait
>>
>>60564266
This is the worst possible idea. Have fun getting encrypted.
>>
>>60564406
Consolas :^)
>>
>>60564385
It serves no purpose.
Option::from(t)
isn't used anywhere inside the function.
>>
>>60564422
B-but my memes...
>>
File: Encoding.png (18KB, 631x232px) Image search: [Google]
Encoding.png
18KB, 631x232px
Quick question
I've got a program that writes out data into another file, and embeds some configuration into it

There are 2 separate sets of data that are encoded
1 32-character alphabet string that seems to stay the same no matter what configuration the file has
and 1 9956-character alphanumeric string that changes based on the configuration

It follows a pattern of [EncodedBullShit]AAA...AAA[MoreEncodedBullShit], and I identified a few spots where I've determined what configuration value drives them.
So I can come up with inputs and outputs, given that and the fact that it's probably not encoded for security purposes, is there a feasible way to determine its encoding process(Namely if it's a commonly used one)?
Pic related is the first part of the stupid huge string
>>
>>60563711

#include <cstddef>

constexpr auto cstrlen(const char* s)
{
std::size_t l = 0;
while (*s++) ++l;
return l;
}

constexpr auto has_repeated_characters(const char* s)
{
auto o = s + 1;
auto l = cstrlen(o);
for (std::size_t i = 0; i < l; ++i)
if (s[i] == o[i])
return true;
return false;
}

int main()
{
return has_repeated_characters("moose");
}


main:
mov eax, 1
ret
>>
>>60563711
>high performance
all the posted versions can be high performance depending on the way the code is run

>pretty sure it doesn't get any faster than this.
actually it does >>60563768
>>
>>60564410
well anon you should take a look at how conditions work.
if a condition is met, the function will not check further into a row of conditions. it checks from left to right.
>>
first for Consolas da best font for programmers
>>
>>60564606
Only on NT.
>>
File: Apress-Beginning Ruby.jpg (146KB, 700x925px) Image search: [Google]
Apress-Beginning Ruby.jpg
146KB, 700x925px
Howdy, all.

40+ year old programmer here. Haven't done programming in a work setting in several years, and when I did it was in PL/SQL and Perl. Trying to get back into programming now, and trying to learn something new. Picked up a Ruby book and am going through it -- Ruby seems fun and cute, and I'm learning the object-oriented way of doing things for the first time.

But I don't get the feeling that Ruby is such a "hot" technology anymore, like it supposedly was about, oh, maybe a decade ago. Should I be studying something else? If I want to be able to earn an income through writing lines of code again, that is. I don't know what's the new hotness and what's old and busted in the industry these days.
>>
>>60564659
Yeah, you should go with Rust, it's gonna be hot by the time you're comfortable with it.
>>
>>60564659
Kotlin is the new hotness since google has chose it to replace java.

https://kotlinlang.org/
>>
>>60563609
>>60563694
all anti-female memeing aside it's things like this that make me sad i'm not a girl

girls:
>use words like "tiny" and "care" because they can actually appreciate cute things without wanting to self harm
>can admit to pouring love into something and not feel like losers
>"please remember to breathe deeply"
>oh my god look at its little face

me:
>HRRRGH NEED TO BE MORE EMOTIONALLY CLOSED OFF
>HRRRRGH NEED TO ACCOMPLISH MORE THINGS TO CONSIDER SELF REAL MAN
>HRRRRRRRRRRGH NO APPRECIATION OF OWN HARD WORK ALLOWED
>HRRRRRRRRRRRRRRRGH NO CARING ABOUT ANYTHING
>>
when are we gonna get a compiler that automatically creates and handles threads
>>
>>60564659
There's a lot of "hot stuff" now. It's difficult to tell, go ask in other places than 4chan, there's a rather conservative attitude here. Which is well motivated in my experience, but your potential employers don't know that.

Find out where the cool kids go. Also try and match it with previous experience obviously.
>>
>"hey g I want a job"
>"hey man, try learning obscure languages!"
nice one

>>60564659
Try looking for jobs in your area or where you want to have a job. Demanded skills vary greatly across countries or regions. Webdev might be the "easiest" way in and some regions want Node, some are about C# and ms stack, some are dominated by PHP and, yes, Ruby is still out there. Javascript in some form seems to be common everywhere though. You find out what's hot in your area, you learn it, you get the job.
>>
File: decoding.png (59KB, 985x913px) Image search: [Google]
decoding.png
59KB, 985x913px
>>60564451
Through more digging, I ended up running the string through a Base64 decoder
The fields I had identified pretty much decoded as the original string entered into them, rest is bullshit
I just hit a wall, didn't I?
>>
>>60564659
For jobs,
Java > C# > C++/C/Python > everything else

I am excluding Javascript and SQL for obvious reasons, but both of these are basically ubiquitous.
>>
>>60564743
>HRRRRRRRRRRGH NO APPRECIATION OF OWN HARD WORK ALLOWED
It's pretty bizarre. Even people who are quite objectively accomplished often view their projects as steaming piles of shit. It may be this patriarchal oppression that causes this.
>>
>>60564743
huh. when i see shit like that i just think "that's pretty gay"
>>
>>60564659
One language everyone's using professionally all over the place these days is Python. God knows why; it's slow, pointlessly enforces a distinction between statements and expressions, encourages writing single-line nested loops so complicated you can't read them, and actually cares how many tabs and/or spaces you have in your code. Nevertheless, if you want to get back into programming professionally, it might be worth checking out for that reason alone.
>>
>>60564827
>Java > C# > C++/C/Python > everything else

php and objective-c > C# > C++/C/Python > everything else
>>
>>60564839
>HRRRRRRRRRRRRRRRRGH HULK NO COMPLAIN ABOUT ENFORCED MASCULINITY, COMPLAIN ABOUT ENFORCED MASCULINITY IS GAY
Hrrrgh my point exactly.
>>
>>60564856
because python puts/brings joy back into programming.
>>
>>60564789
>implying some 60 year old isn't already retired
>>
>>60564743
I feel you man, my group was so emotionally and socially inept it's unbelievable. When a girl, who was a really decent programmer overall, joined us and commented on someone's project "Nicely done!" it was a shattering event lol.
>Wha... we can be nice to each other? We can appreciate?..

Exactly, ye. Of course good female programmers bring a lot to the table. I feel like sausage parties are never a good thing, in any field
>>
>>60564858
> C# > C++/C/
And no Java. WTF.
>>
>>60564780
Chapel supports that.
// 10 iterations that might be executed in parallel
forall x in 1..10 {
writeln(x);
}

// block where each statement might run in parallel
begin {
foo();
bar();
}
>>
>>60564874
>python puts/brings joy back into programming.
The only thing I can see to this end is a confusion about static vs dynamic typing. That's the fault of static languages though.
>>
>>60564873
you're projecting. people have different balances. you just have more girl-brain than me. nothing wrong with that but don't assume that's how it is for everybody
>>
>>60564714
>>60564720
>>60564784
>>60564789
>>60564827
>>60564856

All points taken. Thanks, anons.

Shame that C# is a thing, though. Ain't touchin' that. (yeah, I'm prejudiced)
>>
File: wub.png (228KB, 978x576px) Image search: [Google]
wub.png
228KB, 978x576px
Chinese cartoons were a mistake
>>
>>60565068
nomies were a mistake
>>
>>60565018
I just misunderstood is all. I read back over what you said and I realized when you said
>huh. when i see shit like that i just think "that's pretty gay"
you were probably talking about the terminal emulator. At first I thought you were talking about my response to it.
>>
Hey /dpt/, after multiple failed attempts in the past I want to try my hand at learning programming again. Is there any language you guys would recommend to a complete beginner? Any good resources for learning that language and advice that helped you starting out would also be appreciated.
>>
>>60565141
>failing
What does this imply? Does it mean you feel you can't get better at writing code and have to look up syntax all the time or does it mean that you can't figure out how to solve the problems you set out to solve?
>>
Why are Makefiles so painful?
>>
>>60565169
They're there to solve a problem you don't feel you care about.
>>
File: friendlyhuggingfriend.jpg (83KB, 221x466px) Image search: [Google]
friendlyhuggingfriend.jpg
83KB, 221x466px
>>60565169
Don't fight it anon, just relax and let it happen.
>>
>>60565169
because youre still using a shitty language
>>
Anyone studying computational geometry? Good intro books you'd recommend? Missed that shit back in the days
>>
>>60565169
Cause gprbuild exists
>>
Speaking about make, I unironically like using scons. Am I a faggot?
>>
>>60565219
I just compiled with bash scripts and then eventually switched to scons because it's actual tool for building.
Fuck make.
>>
>>60565035
C# is really comfy to use these days, and it's FOSS now. Most of the tools are FOSS, too.

You can hate Microsoft all you want, but their dev division has their shit together. Xamarin is coming to Linux/macOS desktop soon.
>>
Is github not loading properly for anyone right now?
>>
>>60565255
>their dev division has their shit together
No. Don't ever say this. You haven't experienced enough of MS if you think that do.
>>
>>60565206
Genuinely pretty based
>>
>>60565111
oh. no yeah i meant the screenshot. i didn't mean for it to have a dickish tone i just meant "interesting, but i don't really get that response myself". and i don't mean "gay" in a derogatory way i just use it when i mean "obviously feminine". like steven universe. gay. you can basically tell from just the color palette a randomly selected screenshot that it was made by a woman, or maybe a gay man (i know it was made by a woman but you get what i mean)
>>
File: 5tBjbam.jpg (44KB, 465x580px) Image search: [Google]
5tBjbam.jpg
44KB, 465x580px
struct S {
char* name;
union {
int kg;
float lb;
};
};

int main() {

S *s = new S;
std::cout << sizeof(S) << sizeof(s) << sizeof(*s) << std::endl;

}


Why 8 4 8?
>>
>>60565165
A little of column A and B, I've noticed I have a real difficulty retaining what I learn to the point that I cant imagine ever being able to code without constantly having to look up how to do certain things. I also struggle trying to solve even the most basic of problems that most beginner lessons give you. Maybe this is just shit that everyone goes through when they start out that fades over time, but as is it feels like programming is something beyond my grasp.
>>
>>60561764
Need sauce please.
>>
Any website with projects idea not for beginners? I'm fucking tired of fucking meme websites and le epic 1000 ideas reddit threads.
Am I also supposed to be an idea guy? Fuck this shit
>>
>>60565350
because sizeof(ptr) in x86 is 4 bytes dingus
>>
>>60565390
what field
>>
File: bait-and-switch-button.png (44KB, 1176x338px) Image search: [Google]
bait-and-switch-button.png
44KB, 1176x338px
>>60565255
>C# is FOSS now
Well shit. Didn't think I could actually learn the language without forking over an assload of cash.

Microsoft are still dicks, though -- see pic-and-filename related.
>>
>>60565390
>Am I also supposed to be an idea guy? Fuck this shit
top kek

Yes, you are also supposed to be the "idea guy".

The definition of a code monkey is a programmer who only programs, and doesn't create novel solutions to existing problems with their own creativity.
>>
>>60565404
Any really, I just want stuff to work on. Not network stuff if possible
>>
>>60565390
>>
File: essays.png (101KB, 776x455px) Image search: [Google]
essays.png
101KB, 776x455px
A pretty neat project for aspiring nlp fags I'd say
>>
>>60565410
Visual Studio Community is free and has every bit of functionality as the enterprise editions, minus the enterprise functionality. Which you arent going to be using, if you aren't in an enterprise environment. So basically it doesnt matter.
>>
>>60565349
Haha, oops. Well that absolutely makes sense then.
>>
>>60565390
Help open source projects?
>>
>>60565410
Visual Studio Community has existed in a free (not OSS) form for many years now. Why do you think VS Community is a "bait and switch"? It's only lacking some of the enterprise features meant for huge dev teams.

If you don't want to use VS, you can always use VS Code, which is a FOSS text editor with many IDE features:
https://code.visualstudio.com/
>>
>>60565423
>Make me software that does my job for me, and also has a yet-unaccomplished ability to read, analyze, understand, and critique written language.
>I will pay you $100.
Professors who don't interact with the industry for too long are fucking retards
>>
>>60565423
up to $100? Software that can evaluate writing would be worth much more than that. turn the software on its head and generate writing.
>>
>>60565358
I was going to recommend BASIC for beginner programmers; it's how I got started when I was a kid. But I dunno...I've poked around on my favorite search engine for current info on BASIC, and it doesn't seem quite so beginner-friendly anymore. Your mileage may vary, though.
>>
>>60565423
You could get by using a few existing cognitive APIs.
>>
>>60565462
>>60565469
Well ok, I thought Community was just a "free trial", versus Express which was supposed to be actually free.
>>
So i installed the android emulator from the android SDK and holy shit that thing is unusuable, it takes 10 minutes to boot and then every click takes like 2 minutes to register
how the fuck am i supposed to use that piece of crap
>>
>>60565580
Are you using the one that's hardware accelerated? There are also other options:
>plug your own phone into USB and debug directly on that (I do this, stupidly easy)
>use a 3rd-party emulator
>>
>>60565398
I guess, why 4? In x64 it returns 16 8 16 and I don't understand, why 8? Because I have union here?
>>
>>60565358
What languages have you tried learning? I suggest you open up a log and write down what you're beginning to understand and how you envision things working. Because usually you can't productively read an entire programming book that teaches you a language and then simply write the programs you want. If you write down your thoughts you can strike things out and make what's essentially your own guide to programming.
You can also share it with people and they can correct you better. If you write down how you think C pointers work and post it here people can say if it's accurate or not. If you post a problem you're having and they correct you might not still get it.

As for what language to use I think a lot of languages are rather light on syntax confusion but Lua is my favorite. There's not that much to understand overall, so it's quick to learn. Which might help you focus on your problems better and learn the more interesting side to programming. It won't land you a job but it can be a good starting point to learn other languages I feel. I haven't gone that route obviously, I started with C and moved on to other things after being experienced but I'm not sure that was the easiest route.
>>60565462
>Visual Studio Community is free and has every bit of functionality as the enterprise editions, minus the enterprise functionality.
Are you selling this software to him or recommending it? This sounds like something a salesman would say. "Our free product has all the features of the free product and not of the paid product". It's a nonsense statement which implies nothing about how good the software actually is, its just an attempt at inflating perceived value.
>>
>>60565602
>Are you using the one that's hardware accelerated? There are also other options:
Yeah but i'm not sure if its using HW emulation since the sdk says that haxm is not windows compatible which is of course bullshit, so i installed it manually
I do have an old phone, can i really debug on that? But i want it to be comfy, like i press a button in visual studio and my app loads into the phone and launches, you know so i don't have to uinstall and reinstall it million times like a retard

3rd party emulator such as what? i looked at genny motion but can't find anywhere to pirate it
>>
>>60565613
It was a direct response to someone assuming it was a "trial", and not free (as in beer) software.

It wasn't a recommendation to use VS; rather, a simple correction as to the pricing model. Stop being paranoid, faggot.
>>
>>60565613
He's implying that there being a link to Community from Express is somehow a shady sales tactic.
Express is an oudated even-more-limited version. They're both free and they're both perfectly fine, just don't expect to use Team Foundation Server with them
>>
>>60565645
>someone assuming it was a "trial"
Where? The assumption was that it's not fully featured clearly. And it's not.
>stop being paranoid
I'm watching you, shill.
>>
>>60565664
>just don't expect to use Team Foundation Server with them
TFS works just fine with Community, unless you're talking about something specific I'm unaware of.
>>
>>60565606
>why 8?
Because in x64 your pointers need to be able to address 64bit addresses. 64/8=8, 8 bytes for a 64bit pointer can address 1.8446744e+19 addresses. If you were to use 32bit pointers you would only be able to address 4294967296 addresses (each one being a byte). That's 4294megabytes 4gigs. Maybe you've heard about that? 32bit applications being limited in ram use. 64bit avoids that and this is how. We're not gonna reach that limit for a long time now.

I guess the more concise answer to "why" is that x64 operate on 8 byte pointers, x86 operates on 4 byte pointers. That's why the sizes vary based on what platform you've compiled for.
>>
>>60565606
in x64 a pointer is 8 bytes. either way in your code that pointer should be smaller than when you dereference.
>>
>>60564743

Allow me to give you the real red pill: being a man is fundamentally about being an individual, and not about lacking emotions. If you give too much thought about what society feels is acceptable for a man to do and not do, or to like and not like, you aren't really a man; you're a sheep.
>>
>>60565751
we've reached pretentious levels that shouldnt even be possible
>>
>>60564513
>ctfe

#define has_repeated_chars 1

int main(void)
{
return has_repeated_chars;
}


really makes ya think
>>
How the fuck do I apply OOP thinking to WinForms or anything with a gui? I can't imagine doing it when every element is basically a method. Are there any good books on OOP?
>>
>>60565350
>>60565606

sizeof(S) and sizeof(*s) should be the same size regardless of platform, because s is a pointer to S, and thus *s refers to a struct of type S.

sizeof(s) should be the size of a pointer.

sizeof(S) should be the size of two pointers. You might wonder why this is, when the second element is 4 bytes regardless of platform. The answer is alignment. On a 64-bit platform, you want your 8 byte pointers to be allocated on an 8-byte aligned boundary. Were S a packed struct, it would take up 12 bytes (8 bytes for the pointer, 4 bytes for the union), but the default is not to be packed, since we don't want to allocate an 8 byte value on a 4 byte boundary.

Let's look at how this looks in memory. We'll let P designate a byte for the pointer, U a byte for the union, and A a byte that is unused, due to its need for alignement.

On a 32-bit system, a struct of type S looks like this:
PPPPUUUU

On a 64-bit system, a struct of type S looks like this:
PPPPPPPPUUUUAAAA
>>
>>60565751
being a person is fundamentally about being an individual. being a man is *technically* about exhibiting traits statistically found in men to some degree, otherwise to be a man and to be a woman would mean the exact same thing. but given that the underlying factors vary and may not necessarily motivate a man to behave like a man or a woman like a woman, being an individual ought to take a way higher priority
>>
Doing a project in c# and visual studio is kinda laggy(usually gets stuck for a less than a sec when changing windows form properties) could it be cause im using enterprise edition or is it laggy in general? Using a good pc btw.
>>
>>60565981
>sizeof(S) should be the size of two pointers.
Why?
Isn't it int size + pointer size?
>>
>>60565933
Represent your data with objects.

The UI reflects specific visualizations of the data, and specific methods of creating, reading, updating, and deleting that data.

Any good beginning book will show you the very basics of objects. This one is good for those new to C#, and doesn't shove ENTERPRISE OOP DESIGN PATTERNS down your throat:
http://www.robmiles.com/c-yellow-book/
>>
>>60564513
>int main()
>{
> return
>}


Does this even work in C?
>>
>>60565990

Traits previously attributed mostly to men are often these days more expected of everyone, regardless of gender. Despite this, I still see individualism and a strong sense of self more present in men than women.
>>
>>60566023
That's not normal. I've got 2017 enterprise on a pretty substandard computer, and it runs smoothly in most cases.
>>
>>60566026

Literally the next sentence is "you might wonder why this is," followed by an explanation of the fact.
>>
>>60565613
I've tried learning HTML & CSS (which I actually had a pretty easy time learning for the most part), Javascript (which is the language I planned to start out with this time around), Python and Ruby.
So basically the ones everyone recommends as really easy for a beginner to learn, though I haven't tried Lua and should probably give it a go. As for the idea of writing my own sort of coding journal, I had actually tried doing something kind of like that at one point but stopped, and looking back im not sure why. I'll try doing it again this time around, I feel like it might really help.
>>
>>60565908
that's not the same thing you cheeky fuck. obviously the point is that you don't have to manually precompute values. this works in any case where the input is a constant expression (and otherwise does what the code i replied to does), which can apply in a lot of cases given that you can easily use constexpr to implement robust type-safe compile-time string manipulation with no macros
>>
>>60566072
>I've tried learning
Ok, let me interject for a moment. Define "tried". I hope it's not "I spent a week reading the first chapter, still not able to write kernel. Sad, I am a failure."
>>
File: 1495078049387.jpg (654KB, 1920x1080px) Image search: [Google]
1495078049387.jpg
654KB, 1920x1080px
>>60566047
nigga, I...
>>
>>60566023
it's written in c++ so it can't be laggy
>>
>>60565751
I agree, but also I submit to you that it's systemically kept impossible not to be a sheep.
>>
>>60566047
much of that code doesn't work in C because it's C++
>>
>>60566039
I get the basics and how to implement them in console applications, but when I start a new gui program, I ignore everything object oriented. For example, I made a program to read data from a database into a datagridview, filter through it with filter fields, and print selected data, by adding it into a listview w/ checkboxes which represent an image.
It was a small program so i just wrote most of my code into the printing process and used only one of my own function for the filter fields.
I have read the book, but he barely touches the gui aspect, and I can't wrap my head around that. How should I have done it, or what should I put in my own class?
Are my programs too small?
>>
>>60566216
Are you still using WinForms in the year of our Lord, 2017?

At the very least, you should be using something XAML-based with MVVM, like WPF.

The GUI side of things will make much more sense if you understand that line of design.
>>
>>60563662
You forgot about tail calls.
>>
>>60566050
more present, sure. but so much so that you'd say that being an individual is not also a primary part of being a woman?
>>
File: 1485931664111.png (67KB, 578x547px) Image search: [Google]
1485931664111.png
67KB, 578x547px
>>60561491
How do I create directories in C without making a syscall? If not in the application then during the install at least, using autotools.
I want to create a config file for my application in $home/.appname/config but fopen can only create files, not directories.
Wut do.
>>
>>60566339
http://www.gnu.org/software/libc/manual/html_node/Creating-Directories.html
>>
>>60566339
Pretty sure it's mkdir(). And fopen invokes syscalls under the hood you know? Why are syscalls that scary? If you're afraid of syscalls you can >>>/cm/ just like Ruby and that guy who was discussing what it means to be a "man".
>>
>>60566106
Well, I didn't give up quite that fast, but if were being honest I have a bad habit of being more self critical than one reasonably should be. Its a problem that affects more than just my ability to learn programming. I know I should work on it, but god damn its not an easy personal flaw to fix. Im sure ive probably given up way faster than I should have, and that this time I need to lighten up if I want to get anywhere, but im know thats easier said than done.
>>
>>60566397
But there's no cross-platform mkdir in ANSI C. that's pretty lacking agreeably.
>>
>>60566442
Nothing for it, other than switching to Ada
>>
>>60566311

Not as much as it is for men. I'd say women are more community-oriented... at least on average.
>>
>>60566555
shitpost kiddie gotta tryhard. trips, but trash nonetheless.
>>
>>60566244
Yes because the tools I am writting usually run on PCs with limited resources and do not need to look pretty. The above program has 3 filter fields, a listview, a datagridview and 3 buttons along with some text and a logo from the company, that's it. But I honestly can't wrap my head around OOP. Any other good reads?
>>
>>60566577
Lurk more
>>
I want to learn android development and I know java already. Should I use java or kotlin?
>>
tmp or temp?
>>
>>60566754
timp
>>
>>60566754

The former for temporary variables
The latter for temperature.
>>
>>60566657
Are you fucking serious you little shit? You're trying to put me down like a rookie like that's even remotely possible? I'm a confirmed professional shitpooster. I make six figures never leaving my home, I have a hot wife and way more bandwidth than hundreds of the likes of you! There are a hundred ways I could thumb down you to eternal obscurity, and that's just with my bare hands. I know where you live, I know who you are and in fact I am right behind you, ready to strike if you ever dare turn around. Whoever lives by the keyboard dies by the keyboard, and that's exactly what I will lethally smash your stupid face again soon, so rest in peace son.
>>
what's a good UI prototype program/service/whatever
>>
>>60566810
paint
>>
>>60566850
yeah im using photoshop but i'd imagine theres specific software that's good at the process
>>
File: dlang_chan.jpg (139KB, 470x545px) Image search: [Google]
dlang_chan.jpg
139KB, 470x545px
Threadly reminder that dlang-chan is not dead; she's going to have her GC tumor removed (eventually); and she's super duper cute and easy to prototype in! Say something nice about her, /dpt/!
Though I do wish her subroutines could return multiple values.

>>60561491
Some entry-level algorithms
>>
>>60566949
>Though I do wish her subroutines could return multiple values.
She can't have Twins?
>>
>>60566810
draw.io
>>
>>60566810
nanovg or (the api it's based on) HTML5 canvas.
With UI there's more than just the visual that needs to be accounted for.
>>
>>60566906
Nah paint that was a joke. I can see why you'd want to sketch out the flows and the screens of your gui, but you and I know that photoshop is a poor fit for that. I don't know what (((professional artisans))) use, but me I would probably just sketch out using the actual GUI library, creating quick mockups with buttons that do nothing, and scrapping it if it doesn't feel right. It's more common in dynamic languages obviously, if you're programming in Joova it quickly becomes painful, even by java pain scales. Just my 2 cents though.

>inb4 >>>/wdg/ those are perfectly defensible techniques also on the desktop.
>>
>>60567042
New thread.
>>
>>60566949
tuples? am i missing something?
>>
>>60567056
Tuples are a substitute for multiple return values, they aren't really that. Tuples and other data structures can contain tuples, whereas multiple return values do not nest and have to be destructured right away. See Lua for an example.

It's a bit assymetric how parameters can be many, but return values have to be worked around with tuples. Haskell and F# have functions that actually only take one parameter and in which you have to simulate multiple parameters though.
>>
>>60563711
You should just store the previous character in a register and compare with that, instead of performing two dereferences per loop body (i.e., "a[i]" AND "b[i]").

And start on the second element.
>>
>>60565751
>being a man is about individuality, not being a sheep
>if you don't adhere to my definition of masculinity you are not a man
Hmm.
>>
File: vibpillow.jpg (293KB, 1015x1500px) Image search: [Google]
vibpillow.jpg
293KB, 1015x1500px
>>60566949
this is crazy I thought for sure you were a bot. I really have to admire your persistence.
>>
>>60567183
nice fallacy
>>
>>60567336
He did produce a nice fallacy, didn't he? :)
>>
>>60567132
Consider the following pseudocode, because GCC vomits all over itself when presented with it. That said, it does seem to get as far as conditional moves, but those may not be appropriate considering how well your processor predicts branches in your average case.

I can't be bothered to write it in assembly by hand.

// give ourselves an opportunity to use a pre-calculated length
int has_repeated_characters(char * s, const long unsigned int len) {
char * end = s + len;
char prev = *s++;
while (s < end) { // fix OBOEs plox
if (*s == prev)
return 1;
prev = *s++; // compiler should optimise away second deref
}
return 0;
}
>>
>>60561491
Figure I'll ask here, If someone is getting a Bioinformatics MS with more of a focus on programming, would it be more possible to transfer into a dev or a software engineering side?
>>
>>60567132
>And start on the second element.
Doesn't he do that? This would catch "ooze" without incrementing i.
Thread posts: 322
Thread images: 35


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.