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

Previous thread: >>55946704 What are you working on, /g/?

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

File: read_sicp.png (518KB, 846x475px) Image search: [Google]
read_sicp.png
518KB, 846x475px
Previous thread: >>55946704

What are you working on, /g/?
>>
>>55951615
I'm working on an ODE solver in Haskell.
>>
O SHIT WADDUP
>>
>>55951615
>forgetting to post a link in the old bread
I covered your ass this time, OP
>>
Zero configuration chat client

>>55951799
>bread
you have to go >>>/b/ack
>>
Why is nobody posting
>>
>>55951937
posting what?
>>
>>55951937
because >>55951799
>>
>>55951747
hey anon what term is that ?
>>
>>55952104
row polymorphism
>>
xth for VC++ being shit
>>
>>55952104
as in terminal? zsh with the agnoster theme for oh-my-zsh
>>
>>55951664
Cool
What is the most difficult part of it?
>>
What can I do now that Windows can use gcc?
>>
>>55951615
>title in name (unsearchable in catalog)
>didn't link to here from the old thread
sure is summer
>>
>>55952344
rm -rf %WINDIR% --no-preserve-botnet
>>
>>55951615
I'm building an imageboard in C#/asp.net webforms.
>>
>>55952351
Implying there isn't eternal summer now
>>
Repostan

typedef struct _Data {
uint16_t a;
uint8_t b;
} Data;

std::vector<Data> src;
std::vector<char> dst;


How would I go about copying the contents of src to dst with std::copy and iterators?
>>
Fuck, it's supposed to be an uint8_t vector instead of char
>>
>>55952397
First of all, in C++ you don't need to typedef structs like that, this is fine:
struct Data {
uint16_t a;
uint8_t b;
};


Second, what exactly do you want to get into dst? Data.a? Data.b? Is the char type a typo?
>>
>>55952397
You would have to create your own iterator types.
>>
>>55952448
I see, thanks. I just want the memory representation of the struct array as bytes in the dst vector.

memcpy(src.data(), dst.data(), src.size() * sizeof(Data));


Works fine, but I wanted to do it with std::copy. Not sure how.
>>
File: Selection_003.png (99KB, 1242x1188px) Image search: [Google]
Selection_003.png
99KB, 1242x1188px
My first language that I finished a tutorial series on

Now I'm learning python (will learn NumPy and Pandas later), and after that I'll learn R
>>
>>55952513
Or you could stick with C++ as if you have a pair
>>
>>55952513
>after that I'll learn R.

I wouldn't bother. You can do most of your statistical work with Python. It would be more beneficial for you to dedicate your time to learning skills rather than languages.
>>
>>55952503
And now I switched the source and destination. Well, I guess it's understandable anyway.
>>
>wanna learn C
>can't decide what editor/IDE to use
>>
>>55952503
So something like this?
std::vector<Data> src{};
std::vector<Data> dst{};

dst.reserve(src.size() * 3); // Pre-allocate memory
std::transform(src.begin(), src.end(), src.begin(), [&dst][const Data &data] {
dst.push_back(data.a);
dst.push_back(data.b & 0xFF);
dst.push_back(data.b << 8);
});


I don't think you can do it with just copy since it works based on iterators and IIRC both src & dst must have the same template type.
>>
>>55952513
>learn R
That will be an interesting afternoon, why talk about it?
Rscript script.R
>>
>>55952566
That seems really convoluted, maybe I'll just stick to memcpy with POD structs.
>>
>>55952562
Notepad. Don't be a faggot.
>>
File: mg_statistics_big.png (268KB, 474x626px) Image search: [Google]
mg_statistics_big.png
268KB, 474x626px
>>55952542
Very true, as for skills I'm learning statistics now

>tfw Casella & Berger Statistical Inference gives me no intuition

Now I'm reading pic related, I know it's a meme book but it's good at explaining stuff

>>55952522
It would be really stupid for me to disregard python and R. Note that I'm not a code purist, I'm just a kid who wants to make money

>>55952600
See above, I don't know nearly enough statistics to make use of R really, if you have resources to recommend I'll be extremely happy
>>
>>55952603
The simplest thing is just to use a for loop:

dst.reserve(src.size());
for (auto data : Data) {
dst.push_back(data.b);
}
>>
>>55952640
..should be
for (auto data : src)
>>
>>55952665
>not auto&
>>
>>55952640
>>55952665
Thanks but I'll just use memcpy, I'd rather not iterate over tens of thousands of entries.
>>
>>55952699
>not const auto&
>>
>>55952699
Data is 24 bits, while a pointer is 64 bits. Won't make a difference either way.
>>
>>55952724
>const

pussy
>>
>>55951615
I love these edits.
>>
>>55952733
>letting anyone modify your state
slut
>>
>>55952712
They should be the same performance-wise, or at least the difference will be negligible. memcpy isn't magic.
>>
>>55952633
the beauty of R is that you don't really have to know a lot about statistics to use it as a statistics tool.
Eg, if you want to test if the variance is equal between two populations, you could use var.test
You can see that it is a F-test, and if you knew about statistics, you would know if this is the right test based on your data, but you can't really blame R for not teaching you statistics.

As for reading material, you could pick a book on R, learn how to use the 4 data structures, but you might as well pick up a book that teaches you statistics as well.
For the packages, use:
?package

or
[code
??search_term
>>
File: C programming language.png (387KB, 424x600px) Image search: [Google]
C programming language.png
387KB, 424x600px
>>55952562
Vim + gcc faggot
>>
File: flygande häxan 2.png (528KB, 1280x720px) Image search: [Google]
flygande häxan 2.png
528KB, 1280x720px
>>55952724
>>55952758
>thinks declaring things const means that they cannot be changed

wew lad
>>
>>55952788
I suppose. Seems like this works, though.
std::copy(src.begin(), src.end(), reinterpret_cast<Data>(dst.data()));
>>
Guys, help me shitpost. I'm all out of inspiration.
>>
File: t3_4u5xwj.jpg (182KB, 914x1200px) Image search: [Google]
t3_4u5xwj.jpg
182KB, 914x1200px
>>55952875
>tfw non-american keyboard layout, making vim shortcuts really inconvenient
>>
File: galko sur.jpg (250KB, 784x441px) Image search: [Google]
galko sur.jpg
250KB, 784x441px
>>55952962
I knöw thät feel
>>
>>55952809
I'm not blaming R, I'm saying that Im not ready for R yet.

As for f test, student's t test etc. etc. I had that in my orientation econometrics class, and I went through the motions (in STATA, not R) but I don't know what any of those mean. at all.

I just picked up the manga book, and that explains stuff really well. I now understand what a z score is.

>but you might as well pick up a book that teaches you statistics as well.

Such a book would be ideal, preferably one that goes in depth like Casella & Berger (the GOAT book, but too incomprehensible for me now)
>>
>>55952897
protection is only 99% effective :^)
>>
>>55952962
So get an American keyboard. You should be programming in US English.
>>
>>55952513
you should try doing that fizzbuzz again jesus...that's bad
>>
>>55952982
I already have the language packs installed, just takes a while getting used to.
>>
>>55951615
Ko-chan~!
>>
wg := new(sync.WaitGroup)
wg.Add(1)
go func(){go func(){go func(){defer wg.Done()}()}()}()
>>
>>55953052
func (c *Client) callback(w http.ResponseWriter, r *http.Request) {
q := r.URL.Query()
topic := q.Get("hub.topic")

switch q.Get("hub.mode") {
case "subscribe":
c.l.RLock()
s, exists := c.topics[topic]
c.l.RUnlock()

if !exists {
http.Error(w, "Unexpected subscription", http.StatusBadRequest)
return
}

now := time.Now()
lease, err := strconv.Atoi(q.Get("hub.lease_seconds"))

s.l.Lock()
s.verifiedAt = now
if err == nil {
s.lease = time.Second * time.Duration(lease)
}
verify := c.verifycb
s.l.Unlock()

if verify != nil {
go verify(topic, time.Second*time.Duration(lease))
}

w.Write([]byte(q.Get("hub.challenge")))
case "unsubscribe":
c.l.RLock()
_, exists := c.topics[topic]
c.l.RUnlock()

if !exists {
w.Write([]byte(q.Get("hub.challenge")))
} else {
http.Error(w, "Unexpected unsubscribe", http.StatusBadRequest)
}
default:
c.l.RLock()
s, exists := c.ids[q.Get("c")]
c.l.RUnlock()

if !exists {
http.Error(w, "Unknown subscription", http.StatusBadRequest)
return
}

h := sha1.New()
body := new(bytes.Buffer)

_, err := io.Copy(io.MultiWriter(h, body), r.Body)

if err != nil {
return
}

hash := hex.EncodeToString(h.Sum(nil))

s.l.Lock()
_, seen := s.history[hash]
s.history[hash] = struct{}{}
handle := s.handler
s.l.Unlock()

if seen {
return
}

r.Body.Close()
r.Body = ioutil.NopCloser(body)
handle(r)
}
}
>>
>>55953052
unsigned int
CapabilityIndex::put(std::string cap, void *ownerdata)
{
std::shared_ptr<CapabilityEntry> entry;

if (highest_bit == 0)
return 0xFFFFFFFF;

if ((entry = find(cap)) != NULL)
{
entry->orphan = false;
return (1 << entry->value);
}

entry = cap_dict[cap] = std::make_shared<CapabilityEntry>(cap, highest_bit, ownerdata);

highest_bit++;
if (highest_bit % (sizeof(unsigned int) * 8) == 0)
highest_bit = 0;

return (1 << entry->value);
}
>>
>>55952513

Just some advice you should probably use a lower tab width. C++ with microsoft style 8 space tabs is a bitch to work with.
>>
>>55953825
yeah, probably... I use atom-beautifier (uncrustify) to get it

Once I figure out how to lower it I'll make it 4
>>
Slightly off topic, but has anyone taken LSD (or similar) while programming? Did it help?
>>
>>55954147
>Did it help?

I almost guarantee that it would not.
>>
>>55954147
I wrote some of the most incomprehensible code I've ever written after taking shrooms. It worked, but I still have no idea how.
>>
Which functional languages are faster than Haskell?
>>
>>55954395
OCaml
>>
>>55954240
>>55954147

LSD and hallucinogens make your brain fire rapidly. Whatever you write under the influence is a result of your subconscious knowledge showing itself .
>>
>>55952522
C++ is a mental black hole by itself

it's almost impossible to learn to read, hard to learn to write in passable quality

only people in their 50s who've had no lives *kinda* know C++
>>
>>55954147
I did a bunch of project euler problems while on LSD because I thought I forgot how to program
>>
antichess AI
>>
>>55954487
and they just keep adding to the language more and more complexity because they are 60 now and bored
>>
>>55954395
Lisp, if you count it as functional.
>>
working on an app to listen to r/a/dio so I can listen to anime music while i read manga without getting my laptop
>>
>>55954545
what's it called (is it on the app store yet?)
>>
Writing a game in Unity and I'm getting 30ms GC stalls every minute or so on mobile. How do I debug memory leaks with C#?
>>
>>55954575
It's called radio, not on the store yet. Give it a week or two. Will release android too shortly after. Opinions and requests welcome.
>>
>>55952897
UB doesn't count
>>
I'm going to learn C today.

>>55954613
did you send it to whoever owns r-a-d.io ?
>>
>>55954597
>memory leaks
But that's the point. C# doesn't memory leak because you GC.

What you're asking is 'how can I not be terrible at using memory'.
>>
File: trivox.png (56KB, 884x812px) Image search: [Google]
trivox.png
56KB, 884x812px
Written a triangle voxelizer. It was simpler than i originally thought it would be.
>>
>>55954487
This.

But should I learn D instead? I've heard it's better but I'm afraid that the community has ideas of 'useful abstractions' rather than being smart and letting you write code efficiently. Nobody can write generalised useful abstractions aside from very simple things like datastructures and associated algorithms.
>>
>>55952981
>>55954615
#include <stdio.h>

void my_fn(const int *a, int *b)
{
printf("%d\n", *a);
++*b;
printf("%d\n", *a);
}

int main()
{
int a = 10;
my_fn(&a, &a);
}
>>
>>55955280
Yes, pretty much. At least in C I can run valgrind and see what's going on (or just ignore it because leaking a few megs of memory an hour doesn't cause the fucking program to msis its frame timing window)
>>
>>55955341
>or just ignore it because leaking a few megs of memory an hour
Absolutely disgusting.
Manage your shit properly.
>>
>>55955341
I'm sure there's memory profiling tools that you can use that point you to where the to-be-freed memory is allocated. Somewhere.
>>
>>55954615
Is pointer aliasing UB?
>>
>>55955390
No. Unless they are restrict pointers, which C++ doesn't even have.
>>
>>55955318
>D
unfortunately D hasn't become popular in any field and that sort of thing can take many years

a language needs to have useful libraries and a huge community of users and devs, otherwise it's a waste of time
>>
>>55955323
if you write code like that you suck ass
>>
File: 1470237686241.webm (330KB, 1280x720px) Image search: [Google]
1470237686241.webm
330KB, 1280x720px
>>55951615

Should I save this pic in my g folder or my newgame folder?
>>
>>55955424
ordered my new toothpaste

its grape flavored and has xylitol in it
>>
>>55955614
nice
>>
>>55955614

Enjoy your possible gas, liver issues, and a host of other risks (Cancer, Diabetes, Deperession, etc).
>>
>>55955464
Why do people care for this? Manga was pretty bad and it has practically nothing to do with software development and frankly it's not gamedev either. Its a person doing 3D models.
>>
how is "learn python the hard way"?
>>
>>55955341
Using a minimum assumption that "few megs" is >= 2, I calculated that leaking >= 2 MBs an hour would come out to:
2^20 * 2 B/h = 2,097,152 B/h
= 34,952 B/m
= 582 B/s
Every second you leak >= 582 bytes of memory. On 99% of implementations (1% to account for meme architectures/compilers) that's losing a pointer to 582 chars every second. How did you manage to be the worst programmer and/or be so pajeet that you don't care about such a significant loss.
>>
>>55955687

From a relatively small amount of toothpaste?
>>
>>55954395
none
>>
what's wrong with using php for views vs some shitty javascript mess
>>
>>55955795
Haven't used it myself, but I have yet to see a single good thing said about it.
>>
>>55952962
i'm using vim, but not really the shortcuts
>>
Windows has C#

OSX/IOS has Objective C or Swift

Android has Java

What does Linux have?
>>
>>55955826

Hard to say it has been shown that xylitol builds up in the liver over time.

Honestly, it's the fluoride that you should be worrying about. It literally strips off the natural enamel and replaces it, while at the same time building crystalline deposits in your brain. There is honestly no reason for fluoride consumption in human beings. Salt or baking soda can clean and take care of teeth just as well.
>>
>>55955910
C
>>
>>55955910
everything.
>>
>>55955914
all of them have it. I'm asking in terms of high-level, high-productivity, flagship language
>>
>>55955910
Android has the Linux kernel, retard
>>
>>55955799
>significant loss
>0.0122% of my RAM per hour

>implying you aren't the Pajeet running Windows XP on 256MB of RAM

If most of the consumer software I used only leaked 2MB an hour, I'd be much happier. But this isn't even consumer software I'm writing, it's a fucking game that you MIGHT play for 8 hours straight if you're autistic.
>>
>>55955913

Fluoride in water is literally part of the NWO bullshit.
>>
>>55955953
Linux can support all of those languages too, I said C only because that's the language that I would associate with it. There's nothing that would really fit your other criteria, except maybe C++
>>
>>55955961
You didn't understand my question, retard.

>>55955986
What about Erlang?
>>
>>55955965
>justifying being shit at memory management
>>
>>55955967

So is the war on drugs :p .

Anyway, I'm still too lazy to write a few quick scripts to just grab all my data from websites so I'm just browsing them daily and checking it manually.
>>
>>55956017
>So is the war on drugs :p .

Probably.
>>
>>55954958
Nope. Why would I?
>>
>>55956022

I am sure it is. It's sad that I'm not pursuing a career in writing banking database / transaction software.
>>
>>55956069

Are you socialist psyop agent who's trying to crash the economy?
>>
>>55956108

Nah I'm a "Crazed conspiracy theorist" who would like to sneak in some tracking software to publicly release some interesting accounts tracing laundered money back to our bankers.
>>
hol up so newbie and I have this
kek :: String -> String
kek x = x !! 7


how would it be done without the parameter typed?
kek :: String -> String
kek = (!!) 7


how to write it for the proper argument order?
>>
I need a webscale database backend for my boss's pet project. Any suggestions? Something that can interface with C# easily would be good.
>>
File: Sif.gif (35KB, 230x200px) Image search: [Google]
Sif.gif
35KB, 230x200px
How's Idris?
>>
>>55956338

Meme.
>>
>>55956203
I'm not that experienced with haskell, but I think it's
kek = flip (!!) 7
>>
>>55956039
just wondering, idk.
>>
ReturnState::Codes ProcessMonitor::CreateProcessSnapshot(HANDLE &hProcessSnap, PROCESSENTRY32 &pe32) {
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

if (hProcessSnap == INVALID_HANDLE_VALUE) {
return ReturnState::PM_Fail_CreateToolhelp32Snapshot;
}

pe32.dwSize = sizeof(PROCESSENTRY32);

if (!Process32First(hProcessSnap, &pe32)) {
CloseHandle(hProcessSnap);
return ReturnState::PM_Fail_Process32First;
}

return ReturnState::PM_Success;
}

ReturnState::Codes ProcessMonitor::GetProcessPid(std::wstring szProcessName, DWORD &dwPid) {
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;

ReturnState::Codes status = CreateProcessSnapshot(hProcessSnap, pe32);

if (status != ReturnState::PM_Success) {
return status;
}

status = ReturnState::PM_Not_Found;

while (status == ReturnState::PM_Not_Found && Process32Next(hProcessSnap, &pe32)) {
if (szProcessName == pe32.szExeFile) {
status = ReturnState::PM_Found;
dwPid = pe32.th32ProcessID;
}
}

CloseHandle(hProcessSnap);
return status;
}


I'm getting the PID of any Windows process given its name. Thoughts?
>>
File: vomit.jpg (90KB, 650x650px) Image search: [Google]
vomit.jpg
90KB, 650x650px
>>55956500
Jesus christ.
>>
>>55956419
yea I tried that before, but now it wants a list of strings (where it should just be string/[char])
Expected type: String -> String
Actual type: [String] -> String


works fine in ghci
Prelude> flip (!!) 4 "Heylmao"
'm'
Prelude> :t "Heylmao"
"Heylmao" :: [Char]
>>
>>55956411
Perfect
>>
>>55956520
What's wrong with it :(
>>
>>55956559
wait hol
should just be String -> Char
works now
>>
>>55956500
Why must windows api be so ugly
>>
>>55956203
>>55956419
>>55956559
kek = (!! 7)
>>
>>55956682
Who doesn't love WPARAM and LPARAM.
>>
>>55956682
When you're as successful as Microsoft, you can't afford to change what everyone's used to.
>>
File: 1470088317345.jpg (876KB, 1258x1240px) Image search: [Google]
1470088317345.jpg
876KB, 1258x1240px
>>55955772
It's about cute lesbians making video games of course it's popular
>>
Is Rust going anywhere?
>>
>>55956972
The trash
>>
I need a LINQ master to help me figure out how to not be retarded with this bit of code.

I have a list of agents. Agents can be one of a dozen colors or so. I need to figure out if there are 3 agents that are red, or 3 that are blue, or 3 that are white, etc. But not 2 that are red and 1 that's white.

Here's the code I have right now:
List<Agent> list = agents;
if(list.FindAll(x => x.type == AgentType.red).Count >= 3
|| list.FindAll(y => y.type == AgentType.white).Count >= 3
|| list.FindAll(z => z.type == AgentType.blue).Count >= 3
|| list.FindAll(u => u.type == AgentType.special).Count >= 3
|| list.FindAll(v => v.type == this_agent_type).Count >= 3)
return true;
else return false;


There has to be a better way.
>>
>>55956972
very slowly
>>
>>55957002
Is it worth learning?
>>
>>55956972
checked C++17 will be better
>>
>>55957026
C++ is a meme
>>
>>55957019
I guess dude
just learn it so you could do something with it
>>
>>55956995
OK I got it. I turned it into this:
if(list.Where(x => x.isRelevantColor).GroupBy(y => y.type).Where(g => g.Count() >= 3).Count() >= 1)
return true;
else return false;
>>
>>55956735
of course, partially apply that first
>>
File: 1468540941275.jpg (122KB, 845x740px) Image search: [Google]
1468540941275.jpg
122KB, 845x740px
>>55956995
>>55957105
if (...)
return true;
else
return false;
>>
>>55957247
I didn't write the code style guidelines unfortunately.
>>
>>55957260
>>55957260
What the hell kind of guideline would set that?
return conditional;
>>
Practicing Haskell while listening to this
https://www.youtube.com/watch?v=AbiCIwAAIP4

Interesting experience
>>
File: output.webm (918KB, 790x662px) Image search: [Google]
output.webm
918KB, 790x662px
I wrote some DLL injection cancer
>>
File: Play V3 2.png (16KB, 649x254px) Image search: [Google]
Play V3 2.png
16KB, 649x254px
Decided to rewrite my music player, but it turned into the same hacky garbage that the old one was.

I'm not particularly good at architecture or design.

At least it uses ID3 tags now. :^)
>>
>>55952712
you think memcpy doesnt? lmfao neo-/g/ is such trash
>>
>>55955910
Go
>>
File: myDeathIsMoney.png (257KB, 720x404px) Image search: [Google]
myDeathIsMoney.png
257KB, 720x404px
>working through homework
>spend literally 4 hours trying the same shit over and over again wondering why my program wasn't working
>tfw I thought sizeof returned the size in bits
What the fuck familias, you think that the instructor would mention this being that there's no man page for operators.
>>
File: 1470348868789.jpg (322KB, 800x800px) Image search: [Google]
1470348868789.jpg
322KB, 800x800px
>>55958191
>I thought sizeof returned the size in bits
>>
>>55958191
>there's no man page for operators.

It's not like it's exactly a secret, anyway. You could have used [spoiler]the internet[/spoiler] to verify your suspicions about what an operator does.
>>
>>55958191

print sizeof(operator)

If it is a number under 4 then you can be sure the size is not in bits. Generally on most platforms sizeof returns the size in bytes.
>>
>>55956972
It's a total meme and will be forgotten in a month or so
>>
>>55958267

How many years have we beenn saying that about multiple languages that are still around and growing?

Oh, and btw University of Pennsylvania is teaching a rust class now
>>
>>55951615

What is it with that book and why is it always posted? Is it good? Please explain the meme
>>
>>55958332

Structure and Interpretation of programs is a book used for a introductory level computer science class at mit from the 1980s up into the early 2000s.
>>
>>55958332
It's just a meme.
>>
>>55958360

So its good then?
>>
>>55958376

A more modern offshoot would be
http://www.sicpdistilled.com/

That page also has links explaining a bit about sicp and why it is good. Needless to say there was a reason the book lasted for so long.
>>
>>55958332
it's the original introduction to programming that teaches programming and not a language as the purpose (it uses scheme)

it's outdated now tbqh, MIT uses python (and probably changed the core structure)


Nowadays it's better to learn Haskell to reach Satori
>>
>>55958376
Yes but not very beginner friendly (for an introductory book (in my opinion))
>>
>>55958332
It actually a pretty decent book.
>>
>>55958387
>This is a very different world, and we decided that we should adjust our curriculum to account for that. So, a committee (here, Prof. Sussman peaked his hands over his head, which I interpreted to indicated pointy-headedness) got together and decided that python was the most appropriate choice for future undergraduate education. Why did they choose python? Who knows, it’s probably because python has a good standard library for interacting with the robot.
>>
>>55958402

It was mit acknowledging that the majority of programmers are getting stuck in web dev / grunt work positions that are mainly stitching together libraries and filtering data :p
>>
>>55958426
yes
the industry forced even MIT to change their ways
>>
File: carlos.png (272KB, 560x560px) Image search: [Google]
carlos.png
272KB, 560x560px
>>55958402
looks like they really MIT their match
>>
>>55958431

Industry doesn't really need good programmers. It's like all businesses cheap and good enough to get the job done and easy to fire and replace workers are inn demand.

I mean you gotta milk our system of slavery living under the guise of being a necessary system for "society" to function. *Hint* the monetary system is unnecessary and just makes the establishment of rulers and slaves easier and more hidden / palatable.
>>
File: 1446088517600.png (84KB, 436x425px) Image search: [Google]
1446088517600.png
84KB, 436x425px
>>55958438
>>
File: 2016-08-07-013449_500x321_scrot.png (13KB, 500x321px) Image search: [Google]
2016-08-07-013449_500x321_scrot.png
13KB, 500x321px
I want users to be able to create something and then share it with other uses via use of a code. I figured the most user-friendly code could be 0-9 A-Z a-z, and maybe 8 characters, eg 3f75Ur9a. This is essentially just base 62, so I figured each character can represent 6 bits (0-63, leaving out 62 and 63).

Is this an okay idea? see pic for details
>>
>>55956338
I don't feel like copy pasting what I wrote here last time someone asked, but there's 2 parts to it:

1. It's got some great ideas that have a lot of merit and could be used to develop a great language
2. The maintainers have more interest in writing academic papers using the compiler and implementing new pointless features than they do actually refining the core language and making the compiler stable (right now it's got 500+ open issues on github iirc)
>>
>fall for the C meme
>fall for the Rust meme
which?
>>
>>55958479
>>>each character represents 6 bytes.
s/bytes/bits
>>
Learn D. (y/n) (comment)
>>
>>55951664
Teach me senpai
>>
>>55958486
Haskell
>>55958491
y
then learn Haskell
>>55958494
Haskell?
ok
>>
>>55958491
useless might as well learn rust
>>
>>55958486
C, definitely.

>>55958491
For the same reason, n.
>>
>>55958486
C, if only for the fact that Rust lacks any kind of useful debugger at this point.
>>
Why do some languages do pass by reference implicitly. It makes no sense to me why that'd be a thing. Seems terrible.
>>
>>55958503
welcome to the wonderful world of eternal mutable state
>>
>>55958486
Both.
>>
>>55958479

Just use a standard hashing / encryption algorithm. Odds are unless you have a strong backing in math and cryptography anything you make will be easier to break and more prone to collisions
>>
>>55958502

Gdb isn't a usable debugger anon?
>>
when will you memesters stop learning useless languages and just do Python? I mean, do you even want to make money?

>inb4 t.poo
>>
>>55958479
if size doesn't matter, having something like 3 unique words is a lot more use friendly. if you have a dictionary of I think there used to be a gif website that did that but i don't remember the name. you can't store quite as much information, but a dictionary of 10k words with 3 words is pretty big. it might also be worth using fake words (but things that sound like words). that's what Urbit does for routing
>>
>>55958530
>when will you memesters stop being moral and just sell drugs to children? I mean do you even want to make money?
>>
>>55958530

Anon you're assuming the working members of /dpt don't already have a working level of knowledge in Python / C# / Java and are venting their frustrations from their daily torture.
>>
>>55958530
I mean following that argument, wouldn't it be a better idea to learn Java/C#? Or js?
>>
>>55957026
C++ will remain 20th century garbage unless they rethink the entire syntax and fill the standard library with useful stuff to write things other than mindfuck libraries to help write mindfuck libraries

this has been posted by one of the top C++ gurus

>As long as C++ gurus live in the clouds of the Olympus, they won't see the need for this kind of evolution. That's why C++ becomes more and more elitist. In the future, people who do NYT crossword puzzles and the ones who program in C++ will be in the same category.

>Very smart people keep writing books with titles that read like "Esoteric Nooks and Crannies of C++", or "More Bizarre Pitfalls of C++". Or puzzles that start with "What's wrong with this code fragment that to all normal people looks perfectly OK?". You don't see such publications in the Java or C# community. C++ is becoming a freak language that's parading its disfigurements in front of mildly disgusted but curiously fascinated audience.

>"So you have to put a space between angle brackets? How bizarre!"

>"Are you telling me that you can't pass an instance of a locally defined class to an STL algorithm? How curious!"

>"Talk to me dirty! Tell me more about name resolution!"

>"Pardon my French, Is this specialization or overloading?"
>>
>>55958532
There still is a gif website that does that; it's really popular as you'll see a lot of images on this site use gifs from that site; I forget the name though.
That's pretty dumb though.

>>55958518
I'm trying to actually transmit the data in the code though. As an example, if the program were for creating characters, bits 4-6 would be skin color, 7-10 for hats, 11-25 for shirt/top, etc.
>>
>>55958530
>python
I mean yeah I've done python. Its nice for small things but no static typing make it hell for anything slightly big.

Also I don't see where the money is in python?
>>55958551
C# is better.
>>
>>55958565
>implying we don't love it because of that
>>
>>55958565
>C++ is becoming a freak language that's parading its disfigurements in front of mildly disgusted but curiously fascinated audience

that's all C++17 is
>>
>>55958526
gdb is a fine debugger for C/C++, why are you bringing it up to talk about Rust?
>>
>>55958530
>implying we don't already know python
The language doesn't even have to be learned because it's so simple. No doubt everyone here actually does do python and like >>55958550 said whoever here holds a job probably grudgingly does it. I know I do, at work I jump between Python, Java, and JS. At home I comfort myself with C.
>>
>>55958590
https://gcc.gnu.org/ml/gcc/2016-06/msg00030.html
>GDB now supports debugging programs written in the Rust programming language.
pretty recent, I think
>>
>>55958585
>love it because of that
No fuck off you're being retarded. The only reason anyone here uses C++ is because there's no better options for performance. Other than C and C is still lacking.
>>
>>55958605
>not wanting an esoteric high performance lovecraftian horror of a language
>>
>>55951615
learning to use the GNU Scientific Library because C is the master language.
>>
>>55958591
>at work, things are pretty quick and easy to write. At home, I make it harder for myself for no reason
neat!
>>
>>55958605
I actually quite like writing C style C++, simple C with objects thrown in. But C++ style C++ is a nightmare.
>>
>>55958603

Rust-gdb has been around for about a year I believe.
>>55958590
See the post above.
>>
File: 1469946712082.jpg (61KB, 832x690px) Image search: [Google]
1469946712082.jpg
61KB, 832x690px
>>55958591
>being a code monkey

why do people do this to themselves??
>>
>>55958637
dumb frogposter
>>
>>55958530
>slow
>dynamic typing
Nah
>>
>>55958607
Not esoteric, waste of time. So many good people's time ...

Linux Trovalds was right, it can't be used in collaboration because reading others' contributions and finding lurking vulnerabilities just isn't worth it. One could rewrite that fucking shit himself in half the time.
>>
>>55958637
Actually I'm working in a research lab at a uni, it's pretty comfy. D3.js is a must for the lab, I'm using python for opencv, and the java was to contribute to a project done by a past student. I don't hate the languages, I'm actually pretty ok with them, but they aren't the ones I want to use in my free time.

>>55958613
Do you ever consider that the languages have different use cases? I don't use C for statistics or modifying HTML so I don't see how python and javascript make it obsolete.
>>
>>55958664
Languages certainly do have different use cases, but C has perhaps two. If you're not doing embedded or OS dev, you shouldn't be using C.
>>
>>55958693
What are you talking about? C is the fastest language. It's a perfectly good choice to write anything, especially if there are ready libraries making that easier.
>>
>>55958693
Who are you to say what language I should and shouldn't use? You're also missing writing libraries that a lot of other languages have bindings for - Python is an example of a language with a lot of FFIs written in C.
>>
>>55958693

You forgot a third use case which is when you actual care about the performance losses from Python, Javascript, and Java.

Everyone seems to think cpu and memory usage is a non issue. Faster results and lower impact on the system is always wonderful.
>>
File: son.png (182KB, 204x529px) Image search: [Google]
son.png
182KB, 204x529px
>>55958710
but can you run c in a web browser? exactly...
>>
>>55958710
Anything beyond fizzbuzz, not really. Could you give me some good examples, though?

>>55958726
>Who are you to say what language I should and shouldn't use?
(You)

>>55958730
That's not a use case.
Time spent developing is pretty important too.
>>
>>55958693
Why? Because"muh strings"?
>>
>>55958739
Yes you can.
>>
>>55958748
No, that's a retarded argument. C just takes far longer to write in than other languages,
>>
File: exactly.png (110KB, 167x411px) Image search: [Google]
exactly.png
110KB, 167x411px
>>55958749
but can you make web apps in c? exactly
>>
>>55958741

Time spent developing is meaningless outside of a corporate environment.

>>55958739
The Internet in everything movement is a disgusting abomination against basic human rights that really needs to be curtailed now.
>>
>>55953005
not him but
>hey aspiring programmer, that's bad
>i won't tell you why, or give you any tips though :^)
>>
File: 640.jpg (14KB, 640x320px) Image search: [Google]
640.jpg
14KB, 640x320px
>>55958768
>:^)

>>:^)
>>
>>55958756
>>55958741
>Time spent developing is pretty important too.
Are you like slow or something, this argument can't keep being made because most large software projects take time to develop, no matter the language.
>>
>>55958741
>Could you give me some good examples, though?
Easier to say what not to write in C. Short little text processing scripts or web dev stuff. Slow as shit prototyping in some specialized language [which usually uses C behind the scenes and in its libraries]

Anything with math, algorithms, efficiency, libraries for other languages, interfacing with the hardware C can be a good choice for.
>>
>>55958710
C is _only_ good for writing fast or portable code

>>55958788
>attacking the only emoji allowed on 4chan
>avatar fagging
>avatar fagging with a lame fucking image
Get out newfag, /dpt/ is not accepting new applications
>>
File: 64d0.jpg (14KB, 640x320px) Image search: [Google]
64d0.jpg
14KB, 640x320px
>>55958808
>>
>>55953675
God damn go is hideous.

just straight up ugly.
>>
>>55953675
what the fuck is that
>>55958833
this

>>55958788
>>55958817
:^)
>>
>>55958191
That's why you write unit tests and verify each part of your code functions as it should. Plus you get smaller functions!
>>
>>55958839

That is web dev. Something that doesn't belong in /dpt . However, it does belong here
>>55918345
>>
>>55952562
vim... or if you REALLY want an IDE qtcreator or CLion
>>
>>55958859
>Some people unironically defending PHP
>>
>>55955323
well memed
>>
Just got my shit cucked up lads
>>
>>55952562
you don't even need an IDE for C

it's not like Java, C# or that monstrosity C++
>>
>>55958924
you don't need an IDE for C++, far less so than Java
>>
>>55958924
>>55958931
you should still have one, or at least a """"""""text editor""""""""
>>
>>55958931
> you don't need an IDE for C++

without an IDE you work ten times slower

you work slow in C++ anyway why complicate it?
>>
>>55958954

Can one really say that a well setup vim, emacs, or atom editor isn't really a IDE?
>>
>>55958730
>You forgot a third use case which is when you actual care about the performance losses from Python, Javascript, and Java.
In that case you have other options that aren't C.
>>
>>55958921
you used Ruby?
>>
>>55958966

Java is actually quite fast (Usually only 2x - 4x slower than c). The only options it leaves for performance increases are C, C++, Rust, and straight up hand optimized assembly.
>>
>>55958975
what's wrong with ruby ?

I wish I had learned it when it was popular. goddamn laziness.
>>
>>55958739
>>55958764
source of pic??
>>
>>55959043

got it on /pol/ bunch of slavs that look like the guys in those two pics, next to beautiful slavic women. it's funny because they look like neanderthals while women look great, don't have the full pic
>>
someone made a new thread since this one isn't searchable:

>>55951615
>>55951615
>>55951615
>>
>>55959063
shit

>>55957258
>>55957258
>>55957258
>>
File: Nikolai.jpg (26KB, 410x230px) Image search: [Google]
Nikolai.jpg
26KB, 410x230px
>>55959055
> it's funny because they look like neanderthals
would you tell that to their face? exactly...
>>
>>55958764
If you can run it in a browser, you can clearly use it to make web applications.

>>55958963
I don't use IDEs for C++ for the same reason I don't use them for C. They make the entire task more complicated than it needs to be.

>>55959015
It was popular because of Rails. Rails is a bloated piece of shit. Ruby without Rails is pleasant to work in. It's not as popular as Python, but it's nicer to work in than Python.
>>
>>55959348
and unlike Python, it actually has some good features other than "no semicolons"
>>
>>55954545
r/a/dio a shit.
Get your own high quality anime music library.
>>
>>55955910
All of those those + C & C++ and literally every other language.
>>
>>55958764
Yes, you can.
I've done that before.
>>
>>55955364
Or you could just put everything on the stack and stop fucking leaking everywhere automatically,
>>
>>55958438
Thank you
>>
>>55959987
>put everything on the stack
That's not always viable.
>>
>>55958450
Incorrect. Industry desperately needs good programmers.

However, industry is not run by programmers, it's run by business, which goes out and hires....

well... one time in band camp, they tried to replace me with TWO people (as if that would have been enough).

One got hired behind my back and the other was hired explicitly against my recommendation to burn his application. Welp, he did have a good haircut and a sturdy handshake. Business person heard the phrase "program in HTML" and thought they could save a few bucks.

The fucking cunt didn't even know how variables worked. Literally a script kiddie.

I left shortly after, having done what I could to convert business to almost anything else other than business.
>>
>>55960013
Says the non-functional programmer.

Learn a functional language, then go hit C up again, and you'll get it.

Of course, if you use libraries, then....
>>
>>55960057
Functional programming has nothing to do with things being stack allocated.
Anyway, I was referring to the fact that stack space is limited, so you have to use the heap for large amounts of data.
>>
>>55960074
I have never exceeded stack space in C, only other languages.

Can you show me how to do it ?
>>
>>55955286
How did you do this? Sorry for the possibly dumb question but I'm new to this
>>
>>55960001
You're a welcome
>>
>>55960092
#include <stdio.h>

int main()
{
long long array[100000000];
puts("test");
}

There you go.
>>
>>55960119
Segmentation Fault.

OK.

You're right.

Welp, back to hurtling towards a painful organic death.
>>
>>55960119
Just going to say that if the compiler knows in advance about this....

>>55960248
Then the result is retarded.

This is down to some sort of evil pact with the operation system, is it not ?
>>
>>55955910
Linux have Java too.Not long before C# gets full support.
>>
You guys know you can request more stack space, right?

That said, doing so is retarded. If you need a fuckload of memory, chances are you want it for something reasonably longterm, and therefore stack memory makes 0 sense. Also, any sort of linked data structure like a tree or a graph pretty much requires heap memory, so you clearly shouldn't be allocating EVERYTHING on the stack. You should, however, try to keep memory contiguous as much as possible.
>>
>>55955910

C# through CoreCLR and Mono
Java through Oracle JVM and OpenJDK
Objective-C through GNU Step if you really, REALLY want it.

Most tools for Linux are open source, so it doesn't really have any exclusives. It's just that it's not a fucking pain in the ass to develop for compared to most other operating systems.
>>
Innocent question: which pair of languages should I go for first as a push to make myself more employable? C# and F# or C and C++ ?

The programming languages I have the most recent experience with are Haskell and Clojure (well, and Mathematica if you count that, it was my gateway drug into declarative programming). I'm a Physics major about to enter the jobs market (Eng. Phys bachelors + Physics & Astronomy Masters).

Other languages that I have worked with extensively but haven't used much in the past year: MATLAB, LABVIEW, Java, Python, and (in high school) whatever the language that ran on the TI-84 calculator was called. I've dabbled a bit in Forth, C, and Smalltalk at various points.
>>
>>55961728
Why would you learn C++ AND C?
>>
>>55961781
Lots of job postings I see mention them together. Should I ignore that and concentrate on one or the other? I was thinking learning one would put me in a good position to learn the other.
>>
>>55961728
JavaScript

It's really big and you can get a job with it easily

Learn it with nodejs and some frontend (angular, ember, etc)
>>
>>55961938
if you learn C++ you'll learn C in the process

just avoid all the OOP nonsense
>>
>>55961987
>you'll learn C in the process
No you won't.
Knowing C++ doesn't mean that you "know" C. You will superficially know the basic syntax (but even C99 adds new syntax), but you won't know how to write good C programs.
>>
>>55962052
If you can't write good C programs then you can't write good C++ programs
>>
>>55962416
But learning how to write good C++ programs won't teach you how to write good C programs.
>>
Did everyone really migrate over to the other thread?
>>
Does anyone know the differences between the first edition of "Introduction to Algorithms"(CLRS) and the third edition? The first edition is like £30 cheaper.
>>
>>55964190
>paying for books
>>
>>55962931
you can't write good C++ programs.
the whole language is broken to the core
>>
>>55957879
sell it to microsoft
>>
File: 514_400x400_NoPeel.png (179KB, 400x400px) Image search: [Google]
514_400x400_NoPeel.png
179KB, 400x400px
>>55957879

Code?
>>
>>55951615
if i'm learning C should i switch to ganoo+loonix+freedums for programming?

it's my first programming langauge by the way.
>>
I cant choose what programming language should I learn. I think I would go with java but I'm also intrested in C. Maybe I will go with web development. I dont fucking know.
>>
>>55967771
java and then C++ and then C
or C and then C++ and then java
>>
Working on a custom framework app for chat rooms. Let me know what you think http://clicky.buzz/index_t.htm
>>
File: 1441847263690.png (82KB, 400x363px) Image search: [Google]
1441847263690.png
82KB, 400x363px
>>55951615
>root finding code in C++ not giving me what I want
>find out the problem is low step sizer resolution
>tweak the code a bit to give more precise output
>it now takes 2 days to run
JUST
>>
a bootstrap website that i cant even get halfway done because my lack of knowledge
>>
>>55961961
>>55964801
...I'll just focus on Javascript for now then (which I could combine with some playing around with Clojurescript).
>>
>>55968069
wtf
>>
>>55951615
Awful rest API with flask + admin site with ASP.NET MVC + Android app consuming the rest API.

At the same time thinking if I should study Law or engineering, med school inscription was supposed to open this month but still no news.

I'm a fucking mess.
>>
>tfw you want to develop something but don't have a development computer
I have a beefy Macbook Pro from work, which is great for portability and development but I can't use it for personal projects.
The rest of my computers are windows, which are awful for casual development. I guess I could find some .NET project to do or w/e.
I need to get a new laptop or something.
>>
>>55968889
JS is even worse bloated trash. Use RoR.
Thread posts: 296
Thread images: 31


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

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


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