[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: 324
Thread images: 43

File: 1489430177869.png (176KB, 441x421px) Image search: [Google]
1489430177869.png
176KB, 441x421px
What are you working on, /g/?

Old thread: >>59438776
>>
Is it possible to program an actual anime?
You know... to do things to her?
>>
let's try one more time.I'm trying to understand the copy function in C (or maybe it's a particular copy function just for bmp images). There's this bit right here, and I understand what it does, but I don't understand how. Basically, how are these nested loops iterating through everything? the i and j are not used after they are declared, I don't get it. Shouldn't there be something like triple[i][j] somewhere in there?

Btw, RGBTRIPLE is just a typedef struct

// iterate over infile's scanlines
for (int i = 0, biHeight = abs(bi.biHeight); i < biHeight; i++)
{
// iterate over pixels in scanline
for (int j = 0; j < bi.biWidth; j++)
{
// temporary storage
RGBTRIPLE triple;

// read RGB triple from infile
fread(&triple, sizeof(RGBTRIPLE), 1, inptr);

// write RGB triple to outfile
fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
}
>>
File: 1487413306014.png (383KB, 611x720px) Image search: [Google]
1487413306014.png
383KB, 611x720px
>>59444191
Thank you for using an anime image.
>>
>>59444225
The variables i and j are just there for the for loops, to keep counter. The comments above the loops explain why there are there.
>>
rewriting rust in haskell
>>
>>59444225
It's reading from one file to another.
i and j are just there to make sure they are looped the correct number of times.
>>
rewriting haskell in rust
>>
How's my fizzbuzz?

class FizzBuzz {
constructor() {
return [...this].map((el, i) => {
let ret = '';
if (i % 3 === 0) ret += 'Fizz';
if (i % 5 === 0) ret += 'Buzz';
if (!ret) ret += i;
return ret;
}).forEach(el => console.log(el));
}

*[Symbol.iterator]() {
for (let i = 1; i <= 100; i++) {
yield i;
}
}
}

void new FizzBuzz();
>>
>>59444191

Computing weighted averages of unit quaternions.
>>
->59444250
delet this
>>
>>59444225
and for the anon saying this isn't C, here you can download the source code. Again, RGBTRIPLE is just a typedef struct.

https://u.nya.is/qhpwie.c

>>59444237
I know i and j are for the loops, but what I'm saying is I just don't see i and j being used, where are they iterating?
>>
File: --314.png (153KB, 324x434px) Image search: [Google]
--314.png
153KB, 324x434px
>>59444229
Who in the world would make a non-anime OP on the anime site?
>>
>>59444256
>>class
already over
>>
>>59444270
>I know i and j are for the loops, but what I'm saying is I just don't see i and j being used, where are they iterating?
Each time you read a RGBTRIPLE from file inptr, its file position indicator advances by sizeof(RGBTRIPLE) bytes. Same with fwrite.
So when j == biWidth, you have read a whole scanline, and when i == biHeight, you have read all the scanlines.
>>
>>59444270
They are being iterated over in the top of the for loops, they aren't used anywhere else. They are just there to check for when to terminate the loops.
It's a very common pattern in C.
>>
>>59444324
>they aren't used anywhere else

Right, ok, now I get it, thanks. So the fread and fwrite functions don't rely on the i and j indices, they just read the next byte and write the next byte. Thanks again.
>>
>>59443947
>Smart people made C.
If you want to appeal to authority, it cuts both ways.

How come extremely smart and well respected developers can't avoid writing unsafe code in C?

Also, your performance argument is nonsense because UB does not exist in any form of asm by definition; everything is reliably defined by specific implementations.

Leaving large swaths of the language as UB is not something inherent or necessary to having code "close to the metal", it's a standardization decision made by C standards committee members with the intent of promulgating a language far and wide, making it portable and available on everything without regards to the ramifications.

With C UB who the fuck knows how your specific version of a specific compiler will treat things.

You say C makes things "extremely convenient for programmers who care about performance." I personally don't think systems programming should be about making things more convenient for developers -- what are you, a fucking web dev? -- it should be about making things more verifiable, resilient and secure.
>>
So I've been reading these threads lately and they are basically just homework help right?
>>
File: triangle.jpg (7KB, 323x305px) Image search: [Google]
triangle.jpg
7KB, 323x305px
The Triforce of OpenGL
>>
>>59444410
Most of the time.
>>
What's the difference between a list and stream in Java ?
>>
>>59444417

▲ ▲
>>
File: GoodNewsEveryone.jpg (52KB, 990x749px) Image search: [Google]
GoodNewsEveryone.jpg
52KB, 990x749px
Good news everyone: https://blog.rust-lang.org/2017/03/16/Rust-1.16.html
>>
>>59444465
>https://blog.rust-lang.org/2017/03/16/Rust-1.16.html


use std::str::FromStr;

pub struct Name<'a> {
name: &'a str,
}

eww
>>
File: 1374796030634.png (117KB, 444x440px) Image search: [Google]
1374796030634.png
117KB, 444x440px
>>59444489
Rust is pretty awful yeah.

I suspect we will still be using C/C++ for systems/embedded programming in 2080, pic related.
>>
>>59444489
>>59444514
>2017
>Can't read Rust
Wew, lads.
>>
File: glenda.jpg (4KB, 200x217px) Image search: [Google]
glenda.jpg
4KB, 200x217px
Red pill me on Plan 9
>>
>>59444540
The thing about Rust is that development is so slow it's painful. It was first available in 2010, but didn't even get to version 1.0 until 2015
>>
File: 1489560306627.jpg (274KB, 1231x930px) Image search: [Google]
1489560306627.jpg
274KB, 1231x930px
>>59444465
I originally like Rust. It was a language with some interesting ideas.
It's cancerous, fanatical community has turned me off though. I wrote a program for myself in Rust a little while ago, and now I'm probably going to rewrite it in C.
>>
maybe you lads can help me. I've got a shader in unity that waves a tree around using a sin wave.

My only problem is, I want to dynamically increase and decrease the speed of the wave. The problem is however, when decreasing the speed it goes "back" in time, due to the fact I'm scaling the speed against the time. This makes the waving looks stupid as shit.

I'm currently just lerping between an averaged value that's dynamically changing and sending that to the shader.

Any ideas?

v.vertex.x += sin((_Time.y * _Speed) + v.vertex.y * _Frequency) * (_Distance * a);


c# if that helps
>>
>>59444545
It's not used much, and 9front is a more modern version.
>>
>>59444569
> The problem is however, when decreasing the speed it goes "back" in time, due to the fact I'm scaling the speed against the time.
wew
what do you get when you multiply negative value by positive value?
>>
>>59444586
What is the hardware support like? Could I install it on a computer from a few years ago and work?
>>
>>59444606
I'm not using negative values. The "speed" value can simply be smaller enough that when multiplied by the new time value the new result is smaller than the previous result.
>>
>>59444552
>Rust is still unstable, it's changing too fast
>Rust is stagnating, it isn't changing fast enough
It's almost like you don't look at the actual changes over the years.
>>
>>59444569
you need to use more decimal points, you can probably get away with 0.99-1.0 and you'll still go back in time provided your shader collected any time before slowing down, in order to do this properly it would have to be rewritten to loop instead of iterate upwards and not iterate downwards without going to zero
>>
>>59444615
> Could I install it on a computer from a few years ago and work?
Try that, I am not sure if it can work outside of VMs
>>
>>59444639
How small does it get?
>>
>>59444669
I'm clamping it between 1 and 3 at the moment.

To give you and idea of the data:
I'm reading from a range of audio spectrum channels, and averaging the numbers. These are usually tiny as shit, so I'm multiplying them by a few hundred to get the peaks in music over a value of 1.

So the difference in the "speed" being sent to the shader is usually between 1 and 1.3. The thing is, when its 1.2 in one frame, changing the speed to 1.1 the next frame causes the wave to reverse, due to the difference in value being more than the time passed.
>>
>>59444649
Did I say that Rust was stagnating? I said that Rust development is slow because it took 5 years to get stable.
>>
>>59444658
I tried installing it on an old thinkpad. It almost worked but I can't remember why it didn't work, I it couldn't boot or something.
>>
>>59444428
bumping my question
>>
Can I somehow upload a compiler to my brain?
>>
>>59444853
While possible, why would you? You're basically a walking JIT scripting language compiler.
>>
So, I just started programming using Codecademy. It seems like a good place to get started. I'm thinking about buying a subscription to Treehouse soon.
>>
File: 1461999665160.gif (747KB, 500x508px) Image search: [Google]
1461999665160.gif
747KB, 500x508px
>>59444865
I just want to compile my programs/proofs on-site so to speak.
>You're basically a walking JIT scripting language compiler.
Can I see the internals of this compiler? In case I need to make some modifications.
>>
why do you come to /dpt/? nobody knows how to program here.
unless you want to shitpost.
>>
>>59444903
In BSD thread, everybody is a sperglord.
>>
>>59444903
I come here to shill for Rust. I don't even use it that much, I just like to shill.
>>
File: botnet.png (18KB, 500x262px) Image search: [Google]
botnet.png
18KB, 500x262px
Let's get clear.
Is .NET ever useful outside of MS Windows?
Do people write desktop programs in Java?
>>
>tfw too dumb for sicp
>>
>>59444916
I fucking hate updating java. meanwhile .net is updated automatically because of steam games.
>>
>>59444916
> Is .NET ever useful outside of MS Windows?
Yes, you can use .net core with ASP.net on Linux.
> Do people write desktop programs in Java?
No.
>>
>>59444936
>ASP
What if I'm a filthy neurotypical?
>>
>>59444916
>>59444936
>Do people write desktop programs in Java?
Your entire processor security process, backdooring, and anti-stealing UEFI backdoor.
>>
>>59444240
Why rewrite one meme with another?
>>
>>59444982
Because then i can program pure meme magic
>>
>>59444465
Nice
>>
>>59444191
is spring really that popular in the java world?
i've tried to learn it before but theres SO much automagic stuff going on it was hard to wrap my head around it
>>
File: 1487921166812.png (339KB, 387x550px) Image search: [Google]
1487921166812.png
339KB, 387x550px
>>59444514
>I suspect we will still be using C/C++ for systems/embedded programming in 2080,
>in C
>C

God save us everyone
Will we burn Inside the fires of a thousand suns?

For the sins of hand?
The sins of our tongue?
The sins of our father?
The sins of our young?
>>
File: 1489287649089.jpg (186KB, 752x1063px) Image search: [Google]
1489287649089.jpg
186KB, 752x1063px
>>59444936
>No.
So, it's only servers now?
>Yes, you can use .net core with ASP.net on Linux.
What are downsides?


>>59444975
What?
>>
>>59445020
>What are downsides?
performance is worse than windows
build tools and tools in general are immature
thats about it though
>>
>>59445020
https://www.google.com/search?q=intel+ME&*
>>
>>59445016
kek. You can avoid C, it's just upto you.
>>
>>59445020
>What are downsides?
Of .NET Core? It's new as hell and as such, needs more time to mature.
>>
Is there any site to look up on how to use JavaEE and stuff like JSF/JPA and the rest of the shit?
>>
>>59444280
People who don't possess pedophilic tendencies?
>>
>>59445046
Just check out this expamle: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition .
>>
File: Image.jpg (92KB, 637x593px) Image search: [Google]
Image.jpg
92KB, 637x593px
What's the top five most difficult things to do related to programming?

I hear that either creating a compiler or game engine is one of the top things.
>>
File: 1480959165393.png (225KB, 500x368px) Image search: [Google]
1480959165393.png
225KB, 500x368px
why are there so many pedo programmers
>>
I have a hatred for java
>>
>>59445073
Java 8 is pretty nice
>>
>>59445061
Thanks, but I need some info since I am gonna have a java ee course in short.
>>
>>59444998
Your goal is a noble one. Good luck to you, young meme wizard
>>
File: 1451036575286.jpg (102KB, 644x583px) Image search: [Google]
1451036575286.jpg
102KB, 644x583px
>>59445048
People who don't possess pedophilic tendencies don't belong on this site in the first place.
>>
So if I'm just doing a quick for loop in modern C should I do the time-honoured for (int i = 0; i < foo; ++i) or is the idiom to use the fancy stdint uints?
>>
>>59445063
Getting grasp on alien code.
>>
>>59445115
>C
Stay busy with trivial shit like these please
>>
>>59445034
OK, I got it.
I talked about common use desktop applications.
>>
>>59445078
I hate it anyhow
>>59445128
what meme code is the top notch garbage that /dpt/ is in love with these days?
>>
>>59445010
Yeah it's pretty popular, usually most Java enterprise web apps are either done via Spring, or JavaEE. If you use Spring with xml config it can be a bit easier to see whats going on behind the scenes, since you're configuring it yourself. Spring Boot is good for convenience, but when you're balls deep in 10 annotations and you're descending into a myriad of classes jus to figure out why your bean didn't autowire, you'll wish you'll have started off with the xml

Also, bear in mind Spring at its core is just an IoC container, start there and take it slow, get a handle on what the core of Spring is,does and how to use it. From there, start looking into other common Spring modules, e.g. Spring Data, MVC, Security, Cloud etc. Build it up peiee by piece
>>
In a C program, how do I pass arguments to main if I'm using Windows?
>>
>>59445115
It depends on how are you using i. If it's an index to an array then you should use size_t, for example.
>>
>>59445137
>what meme code is the top notch garbage that /dpt/ is in love with these days?
C
>>
>>59445134
You use Trustzone or Intel's ME every day though anon. Gorillions of devices
>>
>>59445088
Agreed. but the rest of internet programming forums are too PC for my tastes/
>>
File: rust_programming_instagramm.jpg (137KB, 800x800px) Image search: [Google]
rust_programming_instagramm.jpg
137KB, 800x800px
>>59445137
> what meme code is the top notch garbage that /dpt/ is in love with these days?
>>
I have a text file full of lines and lines of characters.

Every one of the lines at random intervals continas a number.

I need to sort the lines into the order the number in the line says.

Ive been trying to do this entirely with bash, and Im fucking sure it can happen. I dont know a single thing about awk so i dont want to start there.

Do you have any suggestions?
>>
Hey guys how can I average two integers? I'm using C btw
>>
>>59445046
How to use? Well, Adam Beihns tends to have a lot of stuff around JavaEE and the like. Baeldung has the odd JavaEE resource, although its more Spring based. Other than that nothing springs to mind, other than Oracles own tutorials but they're hit and miss. Looks like you'll be spending some time on Google
>>
File: web prog.png (10KB, 935x524px) Image search: [Google]
web prog.png
10KB, 935x524px
Started learning web programming
How do I auto indent on Notepad++?
Pic related
>>
>>59445165
float = int1/int2
>>
>>59444225
where is the rest of the function (like signature)?
>>
>>59445010
>>59445141
In fact Spring is the less automagic of the Spring / Java EE duopoly and by a wide margin.
>>
Is there a bare-bones simply typed lambda calculus compiler? I want to program without all the unnecessary stuff.
>>
>>59445182
plugins

>>59445165
(a/b) *2
>>
File: 1487550646729.jpg (84KB, 648x720px) Image search: [Google]
1487550646729.jpg
84KB, 648x720px
>>59445189
Oh? Is that how C programmers find average of two integers?
>>
What is your mainly used language?

What languages do you hate the most?
>>
File: 1486441865649.png (787KB, 846x909px) Image search: [Google]
1486441865649.png
787KB, 846x909px
>>59445203
>(a/b) *2
Eh? Is that how C programmers find the average of two integers?
>>
>>59445207
oh yeah i forgot to *2
>>
>>59445214
>What is your mainly used language?
English

>What languages do you hate the most?
Perl
>>
>>59445214
D
C
>>
>>59445214
English

French
>>
>>59445194
Yeah I agree, It's easier dealing with just one container rather in the Spring route
>>
>>59445216
ahh fuck me, good catch
>>
>>59445169
I have been looking at google a lot and there is tons of bad stuff, like literally bad stuff.
The course I will be taking has more or less just the core of stuff.
JavaEE,JSF,JSP,JPA and that's about it. Looking up on the net for more concrete information about each stuff and example is very troublesome.
>>
File: 1487974409142.jpg (79KB, 640x640px) Image search: [Google]
1487974409142.jpg
79KB, 640x640px
>>59445230
>good catch
I already know you are a C user
>>
>>59445165
(a+b)/2
>>
>>59445214
C++
PHP
>>
File: anal beads.png (98KB, 1581x853px) Image search: [Google]
anal beads.png
98KB, 1581x853px
>>59445038
More specifically, pic related needs to hurry up and happen.

Supposed .NET Standard 2.0 will make cross-plat libraries much more easy to work with, mostly due to having an expanded set of APIs.
>>
which is the most aesthetic programming language?
>>
>>59445182
use Sublime text
>>
>>59445214
My own language (it's called ShitLANG)

java, sepples
>>
File: 1474191709123.jpg (47KB, 425x438px) Image search: [Google]
1474191709123.jpg
47KB, 425x438px
>>59445164
>Every one of the lines at random intervals continas a number.
Elaborate please, I don't understand this part.
>I dont know a single thing about awk so i dont want to start there.
Pic related, it's a small language and doesn't require much time to learn.
>>
>>59445238
>overflows
>>59445203
>average of 1 and 3 is 0
>>
>>59445088
The problem with drawings is that they're a sign of something worse. Sure, they're harmless, and funny enough, probably a good thing if it keeps your pedophelic tendencies at bay, but they're still a sign that something is wrong with you mentally even though they are harmless drawings.
>>
File: 1472255086900.jpg (29KB, 600x450px) Image search: [Google]
1472255086900.jpg
29KB, 600x450px
>>59445238
Oh okay so (1+2)/2 is giving me 1, I guess average of 1 and 2 is 1 in C
>>
File: 1480712992863.jpg (134KB, 500x880px) Image search: [Google]
1480712992863.jpg
134KB, 500x880px
>>59445141
>>59445194
good stuff, thanks mate
>>
File: 1481165180412.png (97KB, 954x442px) Image search: [Google]
1481165180412.png
97KB, 954x442px
>>59445048
Why are you on 4chan then?
This is an anime website no matter how you look at it.
>>
>>59445233
Javacodegeeks tends to have quite a bit on JPA and JavaEE. As for JSF and JSP those might be a bit trickier to find good resources. You could search Dzone.com ref cards, there'll definately be some stuff on all of those.
>>
>>59445266
you work with integer values, nigger, sure you won't get .5 part
>>
>>59445259
Its an ascii art thats been jumbled up.

To stop you simply sorting using collumns the numbers arent put in a consistent position along the string

so like

aaaaaaaaaaa34eeeeeeeeee
/\/\/\/\/\/\/121\/\/\/\/\/\/\/\/
[.[.[[.[.[.[.[.[.[.[.[.[.[.[.[.[.[.19[,[,[,[,[,
>>
>>59445279
>Javacodegeeks
I see here seems to have a bit more concrete stuff, I will look into this.
>>
File: 1481916546254.jpg (47KB, 645x968px) Image search: [Google]
1481916546254.jpg
47KB, 645x968px
>>59445281
Who said I "work with" integer values my "white" friend? Or is it because you are a C user?
>>
>>59445182
I would guess it is tools->highligting or tools->indentation, but I don't have notepad++ installed and it is not in the repo.
If you are just started and you don't have a bias towards editors yet, why not use something like kate?
It is much better than notepad++
>>
>>59445266
noonga i dont know c i was just remembering how the forumula for shit goes
>>
>>59445276
This is why people make fun of programmers...
>>
>>59445276
it may be an anime site, there are boards for it, but that doesn't mean every single board needs to have an anime theme, or be packed with pictures of schoolchildren. This is a technology themed board on an anime site, that doesnt mean its anime and technology
>>
How do I make my programming enviornment good looking?
Using Netbeans for Java, Visual studio for C# and C++ and Notepad++ sometimes
>>
>>59445294
>i dont know c
No one does
>>
>>59445241
Yeah, I remember reading a blog post about this. I'm interested.
>>
>>59445303
>that doesnt mean its anime and technology
I'm afraid that's literally what it means
>>
>>59445289
If javacodegeeks doesn't pan out, check out Dzone, its aggregates content from other sites plus its own oc across a number of areas in software development. It has a section of "ref cards", basically guides/primers/tutorials on a load of different stuff, there'll be JavaEE ref cards there for sure
>>
File: 131253966779266s.jpg (9KB, 151x200px) Image search: [Google]
131253966779266s.jpg
9KB, 151x200px
>>59445262
Something is wrong with you at this moment because you visit this site.
>4chan was started as a project by Christopher "moot" Poole, a user of a small IRC/DC community known as Raspberry Heaven, which was [then] composed of users from the "Anime Death Tentacle Rape Whorehouse" (ADTRW) sub-forum of The Something Awful Forums.
An honest christian wouldn't visit a brothel, why do you visit this site?
>>
>>59445316
My main interest is how the hell for instance, sessions work, db transactions and etc, would be good to know before starting. Java SE felt a lot more sturdier to work with than this java ee stuff, doesn't feel "professional" at all.
>>
File: smuggo.jpg (138KB, 838x638px) Image search: [Google]
smuggo.jpg
138KB, 838x638px
>>59445214
I write in C++ but pretend it's C
I hate Java and C#

here's a japanese image of a smug girl to piss someone off
>>
>>59445331
am upset
>>
>>59445290
>Who said I "work with" integer value
>>59445165
>Hey guys how can I average two integers?
>>
>>59445214
C#

I don't really hate languages. I know that most of them have a time and a place. I don't really care for languages that force me to manage my own memory. I should be allowed to, but not forced to.
>>
File: 1485764233138.png (372KB, 954x768px) Image search: [Google]
1485764233138.png
372KB, 954x768px
>>59445337
>an average is an integer
This is your brain on C
>>
>>59445303
>This is a technology themed board on an anime site
Yes, that means it's to be expected to see anime even on the technology board, because after all, the posters are weebs.
Why should we cease posting any and all anime just because it's a technology board?
You shouldn't be complaining.

>>59445297
Do they? maybe it's because you're a shitty programmer.
I've never been made fun of for being a programmer.
>>
File: 1488869296301.png (228KB, 3316x1896px) Image search: [Google]
1488869296301.png
228KB, 3316x1896px
>>59445352
>I've never been made fun of for being a programmer.
Is taht because you never programmed anything?
>>
>>59445306
Who gives a shit?

You're programming, not masturbating.
>>
>>59445331
> I write in C++ but pretend it's C
I hate fuckers like you because I have to maintain code like this.
>>
In C will the following map
&tmp.v[0] == &tmp.x
&tmp.v[1] == &tmp.y
&tmp.v[2] == &tmp.z
everytime? Because the compiler is allowed to add padding to struct this shouldn't be used right?
struct {
union {
struct { float x; float y; float z; };
float v[3];
};
} tmp;
>>
File: doggo eyebrows.jpg (71KB, 356x264px) Image search: [Google]
doggo eyebrows.jpg
71KB, 356x264px
I write in C but pretend it's C++.
>>
>>59445360
I mean if Im gonna program all my life better make it look a bit better
>>
>>59445390
C doesn't have templates
>>
>>59445359
I've programmed tons of things.
I'm currently working on an x86 kernel.
>>
File: 1478712527411.png (219KB, 640x480px) Image search: [Google]
1478712527411.png
219KB, 640x480px
C is a meme
prove me wrong
>>
>>59445401
just pretend harder
>>
File: doggo.jpg (34KB, 640x640px) Image search: [Google]
doggo.jpg
34KB, 640x640px
>>59445401
I pretend it does.
>>
>>59445415
>meme
"garbage" would be a better choice of word
>>
>>59445415
Your post itself is a proof. No programming language can be a "meme". C is a programming language.
>>
>>59445427
is this how /g/babs prove?
>>
>>59445388
You can't do this, in C it's UB to read from a member of a union if the previous write to the union wasn't to this member.
I.e. this is legal
tmp t;
t.v[0] = 1.0;
float a = t.v[0];

but its is UB
tmp t;
t.v[0] = 1.0;
float a = t.x;
>>
>>59445325
Yeah the dzone stuff should cover a lot of that. For more in depth stuff on how it all works Oracles own tutorials will give you more, but they can feel a bit dated or jargon packed.
>>
>>59445439
>/g/babs
is this some new ribbit meme? I'm not sure I understand you
>>
>>59445447
>You can't do this
Why? Doesn't UB make your code faster? Even if it isn't portable, who cares?
>>
https://tutorial.ponylang.org/gotchas/divide-by-zero.html

>In Pony, divide by zero results in zero.
>>
>>59445464
go be retarded somewhere else.
>>>/reddit/
>>>/hackernews/
>>
>>59445425
This is the reason C doesn't have a garbage collector. It would just free itself from memory.
>>
>>59445469
How am I being retarded? That's not how you link on this site by the way.
>>
>>59445352
It perpetuates the stereotype of programmers being basement dwelling subhumans who can only get it up over drawings of asian 12 year olds in schoolgirl outfits. How would a non-programmer mock an actual programmer over shitty code? how are they meant to know?

And I don't really care if people post anime on a tech board, its when people make a point of having anime on a tech board because "its an anime site". I'm sure you've been here long enough to see how triggered the autists get if a /dpt/ is created with an image thats not anime related
>>
>>59445447
>>59445464
Disregard this, I'm shitting you: http://stackoverflow.com/questions/11373203/accessing-inactive-union-member-and-undefined-behavior
The described behaviour is from C++, C allows you to access other members of the union.
>>
>>59445372
>implying I'd ever work like that
I only use that kind of style for personal projects.
>>
>>59445468
>
actor Main
new create(env: Env) =>
env.out.print("Hello, world!")

pretty interesting 2bh, is this worth playing around with?
>>
Stop using closures. You're just embarrassing yourself.
>>
File: 1487560730201.png (125KB, 312x312px) Image search: [Google]
1487560730201.png
125KB, 312x312px
I have game design experience from doing heavy modding way back and have the artistic abilities to create assets both in 3d and 2d

How long would it take for me to learn how to code simple mobile phone games? Just want to maek games as a hobby
>>
>people calling C garbage
prove it
tell us something better
>>
>>59445347
Keep smugging, dumb frog poster, the problem that you don't know the difference between integer and float computations doesn't make you more relevant.
>>
>>59445515
>posting plebbit garbage
>>>/r/abbit
>>
>>59445501
What's wrong with closures?Not the guy you replied to, just curious, I often hear closures touted as a great language feature, e.g. on the JVM language list alone Groovy, Clojure, Kotlin, Ceylon et al, various FP languages etc
>>
>>59445521
visual basic
>>
>>59445540
>""""""""""feature""""""""""
they are a basic property of any non-shit language.
>>
>>59445551
I'm neither agreeing or disagreeing, I just want to know why people make a big thing out of them. If they're that worthwhile, then what is >>59445501 getting at?
>>
>>59445521
D
>debloated and improves 99% of c++
>a sane module/package system instead of the godawful .h/.c
>steady releases
>range/slices > vectors
>seamless and hassle-free c/++ calling for whatever

the list goes on
>>
>>59445521
>tell us something better
For what specific task?
>>
>>59445572
shitposting
>>
>>59445570
D is Dead tho.
>>
>>59445577
Not really.
latest release was 8 days ago
>>
>>59445569
>I'm neither agreeing or disagreeing
So? You called them a "feature" when they're as much of a "feature" as being able to perform basic arithmetic.
>I just want to know why people make a big thing out of them
Probably because they're stupid.
>If they're that worthwhile, then what is >>59445501 getting at?
I wouldn't know.
>>
Why is MS-DOS 6.22 on my school's Microsoft Imagine account? Does that os have some significance still?
>>
File: 1489287649049.jpg (131KB, 1200x936px) Image search: [Google]
1489287649049.jpg
131KB, 1200x936px
>it gives 1
fn main() {
let a:i8 = 1;
let b:i8 = 2;
let c:i8 = (a+b)/2;
println!("{}", c);
}

Defend this
>>
>>59445625
>a:i8
what syntax is that
>>
>>59445643
Standard non-pleb syntax for types. There should be spaces though.
>>
>>59445594
so all in all, you replied because I referred to closures as a feature?
>>
>>59444191
def roman(integer):
if type(integer) is not int:
raise TypeError('Must be an integer')
chars = ('IV','XL','CD','M')
# integer operations do not round upwards, which is useful here
thous = integer/1000
out = 'M'*thous
integer -= thous*1000
hunds = integer/100
integer -= hunds*100
tens = integer/10
ones = integer - tens*10
i = 3
for digit in (hunds,tens,ones):
i-=1
if digit==0:
continue
elif digit<4:
out += chars[i][0]*digit
elif digit==4:
out += chars[i]
elif digit==5:
out += chars[i][1]
elif digit<9:
out += chars[i][1] + chars[i][0]*(digit-5)
elif digit==9:
out += chars[i][0] + chars[i+1][0]
return out
>>
>>59445625
Are you not aware of how integer division works?
>>
>>59445143
cmd.exe

>>59445115
Avoid using the uintx_t as they depend on the target. You should use an unsigned type in this case.
>>
>>59445660
I am. He (>>59445266) is not.
>>
>>59445482
I honestly don't care what people think.
>its when
What is when?

Stop complaining or fuck off somewhere else.
>>
>>59445653
Yes, that should've been pretty clear since I quoted only a small part of your post.
>>
>>59445625
Yeah, the average is 3 wtf

>>59445658
>Not using div and arrays
Disgusting
>>
>learn all this shit to make function returns more efficient

>btw, faggot, simple return by value is actually the fastest

Fuck C++!
>>
def collatz(num)
puts num
while num >1
if num.even?
num = num / 2
else
num = (num * 3) + 1
end
puts num
end
end

collatz(12)
>>
>>59445548
>three platform compatibility
>compiler is locked down
>the D stands for DEAD, meaning there's no documentation or help from outside sources

>>59445678
git gud
>>
>>59445625
Are you retarded by any chance?
>>
>>59445685
ur code is bugged it keeps returning 1
>>



>>
>>59445674
So your shitposting under the guise of pretending to have any sort of knowledge on the subject. It's easy to see why /g/ gets so much hate these days. Reddit is now a better forum for tech discussion, mostly because of cunts like you swamping what was once a half decent board with you're undeserved sense of entitlement
>>
>>59445678
>worried about performance using c++
is this a meme?
>>
>>59445673
When all else fails and your shit out of comebacks, go grammar nazi. Well done, you're officially autistic
>>
>>59445592
So what, they still release new Cobol versions. D is dead because it's failed to gain any traction in the 15 years it exists.
>>
When is the destructor called of a singleton in C++? For some reason, my singleton destructor is called twice (once at runtime, once when the program is terminating) during the execution.

I'm not using delete or whatever.
>>
File: 1.png (34KB, 1135x629px) Image search: [Google]
1.png
34KB, 1135x629px
Ok so I'm trying to make a program that can solve hangman problems using a huge dictionary but I'm sort of stuck on the design. Any help? Below is documented code so far with lots of missing functions. It's for personal use and I'm using a 4.5gb dictionary. I'm not going to read the whole file in one go, but instead going to read 200mb at a time. A better approach would be to have a static pointer to the beginning of every letter in the alphabet so it's a bit optimized., but I haven't reached that stage yet. For example, the program is supposed to read the dictionary and parse every word, but there are two problems I'm facing: The first problem is that when I parse the file, and then the word, I need to know if I've reached the end of the 200mb that I have in memory. The way I'm doing this is by subtracting the number of bytes read from the number of bytes in memory, although this is dangerous as hell. Below is the relevant snippet. sz_buffer is the 200mb of dictionary data read. If I'm at the end of the file/data pointer (*sz_buffer), and I do *sz_buffer++, would it just point to some random data inside the memory-space of the program?

And then when I'm calculating how many bytes are left to be read, I do:
 if ( (i_bytes_remaining-=MB2B(SIZE)) >= SIZE) fseek ( file, MB2B(SIZE), SEEK_CUR ); 
Which translates into: if I subtract 200mb from the total file size, and if the result is equal or larger than 200mb, I continue reading the file. The last 200mb (or less) are to be read differently (haven't implemented yet). This all seems less than ideal. I mean, I have 32gb but I just don't want to make a 4.5gb+ process. Any tips design-wise?
>>
>>59445719
what sort of retardation is this? why do you think you're entitled to an answer to your whole post?
>Reddit is now a better forum for tech discussion
I agree, let's go there together? you first though, I'll follow
>>
File: lol.jpg (5KB, 256x197px) Image search: [Google]
lol.jpg
5KB, 256x197px
>>59445703
>>
>>59445720
1) performance is the only reason to use C++

2) squeezing competitive performance out of C++ is not easy
>>
>>59445747
>he fell for C meme
I mean, the code is disgusting even by C standard.
>>
>>59445759
Performance and OOP and a shitload of libraries.
>>
>>59445214
Lisp
Lisp
>>
>>59445775
>OOP
>>>/r/abbit
>>
>>59445775
And templates.
>>
>>59445786
Lisp-1 or Lisp-2?
>>
>>59445751
I don't think I'm entitled to an answer, if no one replies im not going to descend into a spiral of depression and self hate, but why bother to post a reply that answers nothing and makes you look like you dont actually have a good answer in the first place, other than to stroke your ego?
>>
>>59445736
Are you fucking retarded? Please point out in my post where I corrected your grammar.
If for some reason your reading comprehension is so low that you're referring to
>What is when?
Then reread my post carefully.

You said "it is when [..]"
Fucking what is when? You have autistic sperg-outs when [..]?
>>
>>59445747
Why the fuck are you not using a database?
Fuck 200mb and fuck 4.5gb that shit doesn't matter. You're going to have to go through the entire dictionary one way or another, and build a search tree.
>>
>>59445747
how the fuck is a word dictionary that big?
>>
>>59445796
Lisp-2
>>
>>59445286
Those are the first numbers in the line?
>>
>>59445747
split the dictionaries by word length, then only read the dictionary with words you actually care about.
>>
>>59445794
Hatred to OOP is a meme.
>>
Should I get my pair of programming socks? what color?
>>
>>59445839
pink/white stripes
>>
>>59445795
>>59445775

there's a shitton leaner languages with OOP and templates are overrated
>>
>>59445747
Why in the world would you do this in C?
>>
best combo /g/ and /fit/ represent
>>
>>59445799
Why are you getting caught up on that instead of addressing the intent of the post? Are you too attached to pictures of anime children to refute it?
>>
>>59445799
>>59445867
Can both of your fuck off and talk about programming?
>>
>>59445853
> templates are overrated
No.
>>
>>59445839
"I" as in you personally, or your sugar daddy?
>>
>>59445797
>but why bother to post a reply that answers nothing
why do you care? i saw you making a retarded mistake and decided to correct you. consider it to be a 'service' of sorts.
>makes you look like you dont actually have a good answer in the first place
answer to what? And why do you think I am obliged to provide you some sort of answer? I didn't even read your post beyond that retardation. Maybe if you ask nicely I could answer, otherwise you'll just have to suck it up.
>>
>>59445871
Yeah, /g/ is too fucked for you to take a high ground and ask that we talk of programming, ignore the fucking comments if it's too much for your aspergers
>>
>>59445872
In the real world people aren't implementing data structures and generalized shit like that all the time.
>>
>>59445890
wow you really are /g/ in a nutshell
>>
>>59445867
I already addressed the main point.
>I honestly don't care what people think.

>its when people make a point of having anime on a tech board because "its an anime site"
And? "it's an anime website" is a perfectly valid and justified reason to post anime.
>>
>>59445902
I don't see how this relates to my post.
>>
>>59445895
Not all the time, but regularly. Templates helped me to migrate huge codebase from ipv4 only to ipv4+ipv6 with minimal changes and without any performance regressions. In general, templates are superior to inheritance-based polymorphism. And finally without templates in the languages there would be no STL/Boost/whatever library you use.
>>
>>59445876
Personally, I wanna go beyond with my programming skills
>>
>>59445920
well really what I mean by saying that is you're a retard who knows a lot less about software development than you let on and you see being a grammar nazi as providing a service. There is no substance to someone like you, basically.
>>
Assume I have a singleton like this.

class A {   
public:
static A &getInstance() {
static A instance;
return instance;
}

~A();
private:
A();
};


Will C++ treat it as a regular variable and call its destructor when it goes out of scope?
>>
>>59445940
In that case there's only one thing for it: go for broke and get the knee high rainbow ones
>>
>>59445800
>>59445830
>>59445808
Yeah but how? I can read 200mb at a time or read the entire dictionary into memory (4.5gb+). I can statically link the address of where each letter begins and ends so it's better optimized and it'd be way more memory efficient, i.e. just read the section of the dictionary which starts with the first letter of the hangman word. Although it'd be a different issue if the first letter is an unknown. I think that statically linking alphabet entries is the way to go instead of doing this reading stuff, but it won't work on other dictionaries and I might just get a fuckhuge 20gb+ wordlist eventually. I'm just wondering how I should go about it exactly.

>>59445769
wrong
>>59445858
why not
>>
>>59445941
>well really what I mean by saying that is you're a retard who knows a lot less about software development than you let on
can you formally prove this statement to be true? you obviously can't since you're mentally deficient. but please, don't post such bullshit next time if you don't have basic reasoning skills.
>and you see being a grammar nazi as providing a service
there wasn't anything wrong with your grammar. it had more do to with your logic. or rather lack thereof
>There is no substance to someone like you, basically.
what kind of "substance" are you expecting here? am I your friend or something? this isn't your home site.
>>
>>59445959
>class
Stopped reading right there.
>>
>mfw two autismos have been so severely triggered by anime they have spent at least a quarter of the thread screeching "muh animooooooo" at each other
Doubt either of you fags could fizzbuzz your way out of a paper bag.
>>
>>59444191
For me, it's the Linux kernel with Skin Cancer.
>>
>>59445992
>mfw
Are you moronic?
>>
>>59445992
>mfw
fucking retard
>>
>>59445998
>>59446007
muh animoooooo
>>
>>59445959
Yes, ofc.
>>
>>59446011
And yet you're the only one actually screeching that phrase
>>
>>59446011
Return to /v/ where your kind truly belongs.
>>
>>59446011
You again?
>>
interviewing for java because i couldn't get any of the python jobs and... baka

https://www.tutorialspoint.com/java8/java8_overview.htm
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;

public class Java8Tester {
public static void main(String args[]){

List<String> names1 = new ArrayList<String>();
names1.add("Mahesh ");
names1.add("Suresh ");
names1.add("Ramesh ");
names1.add("Naresh ");
names1.add("Kalpesh ");

List<String> names2 = new ArrayList<String>();
names2.add("Mahesh ");
names2.add("Suresh ");
names2.add("Ramesh ");
names2.add("Naresh ");
names2.add("Kalpesh ");

Java8Tester tester = new Java8Tester();
System.out.println("Sort using Java 7 syntax: ");

tester.sortUsingJava7(names1);
System.out.println(names1);
System.out.println("Sort using Java 8 syntax: ");

tester.sortUsingJava8(names2);
System.out.println(names2);
}

//sort using java 7
private void sortUsingJava7(List<String> names){
Collections.sort(names, new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
return s1.compareTo(s2);
}
});
}

//sort using java 8
private void sortUsingJava8(List<String> names){
Collections.sort(names, (s1, s2) -> s1.compareTo(s2));
}
}

>those names
>>
File: 1489628891022.jpg (74KB, 526x567px) Image search: [Google]
1489628891022.jpg
74KB, 526x567px
>>59445969
The most basic concept of fulltext searching is to trade time for space.

foreach int line,str word in file('huge_word_list.txt')
file('length_' + word.length() + '.txt').append(line + '\n')
foreach char c in word.unique()
file('contains_' + c + '.txt').append(line + '\n')
>>
>>59446084
Why are you posting this shit here? Please keep it at plebbit.
>>
>>59445992
>fizzbuzz your way out of a paper bag
how does one fizzbuzz out of a paper bag
do you overload it
>>
>>59444514
C/C++ will never be replaced.
Rust is just another in the long line of languages that are hyped, but the features it has make it inappropriate for the same use cases as C. It will migrate to the ghetto of webdev and there it will die.
>>
>>59445929
Other languages have libraries just as big.
>>
>>59446115
Yeah, I guess. It would probably work if printing was literal printing and each sheet had to go in a paper bag and the number range was large enough so enough pages were produced such that the paper bag would split open.
>>
>>59445164
>>59445286
Nobody likes awk.

Used sed to extract the numbers, then echo them in front of the lines, sort that, then cut out the numbers that were added.

while read line; do
num=$(echo $line | sed 's/[^0-9]//g')
echo "$num $line"
done < art.txt | sort -n | cut -d' ' -f2
>>
>>59446120
Yes, but any STL-like library without some kind of parametric polymorphism is inherently slow.
>>
whats the usual response to recieving malformatted messages over a network protocol, drop the single message or drop the connection?
also im trying to figure out a way to not get stuck if a malicious user sends only the a length prefix of a message and then doesn't send anything else
>>
>>59446185
It's called timeout.
>>
>>59446166
in that case why even fizzbuzz
just shit out empty pages into it
>>
>>59445747
What do you mean by "Solve" hangman problems? Do you just mean getting the next "best" guess from a given hangman game state, or do you mean something else?
>>
>>59446166
Jesus is this actually being discussed?
>>
>>59446185
For malformed messages it's entirely up to you how do you want to handle the message, for instance if it's a video game, it's probably better idea to just log that message and look for patterns because there's likely some bot operating on network level that you could detect and ban later on based on message patterns.
For the second, you just use a read timeout.
>>
>>59446245
I know right! Epic 4chan trolls
>>
>>59446245
>not solving programming related issues on a friday
>>
Any experience to share with internships /dpt/

I'm doing mine right now (end of studies) and damn I feel like an imposter. It's been two week now and I'm just beginning to udnerstand the project I'm working on. Not even completly.

Share your experience and tell me if it's normal.
>>
>>59446273
You're right I shouldn't be wasting my life earning money, I'll get right on the soon to be world famous "Fizzbuzz yourself out of a paper bag" problem

We talkin pages made from pine trees or oak?
>>
>>59446284
It is. You'll always experience this.
>>
>>59446232
But the mode of escape is to use a fizzbuzz, right? The fizzbuzz has to shit out enough pages to break the bag.

>>59446245
Can't be worse than "you're a grammar nazi :(" and "no you're a pedo"
>>
College fag here, had to reimplement int vector.
struct Vektor
{
int *arr;
int logical_length;
int physical_length;

void vector_new(int init)
{
arr = new int [init];
logical_length = 0;
physical_length = init;
}

void vector_push_back(int i)
{
//Povećavanje arra
if(logical_length + 1 > physical_length)
{
int *temp_arr = new int[physical_length*2];
copy(arr, arr+logical_length, temp_arr);
delete[] arr;
arr = temp_arr;
physical_length*=2;
}

arr[logical_length] = i;
logical_length++;
}

void vector_pop_back()
{
logical_length--;
}
int vector_front()
{
return arr[0];
}
int vector_back()
{
return arr[logical_length-1];
}
int vector_size()
{
return logical_length;
}
int vector_at(int index)
{
if(index < logical_length)
return arr[index];
else return 0;
}
bool insert_at(int index, int v)
{
if(index < physical_length)
{

if(logical_length + 1 > physical_length)
{
int *temp_arr = new int[physical_length*2];
copy(arr, arr+logical_length, temp_arr);
delete[] arr;
arr = temp_arr;
physical_length*=2;
}
logical_length++;
int *temp_arr = new int[physical_length];
copy(arr, arr+index, temp_arr);
copy(arr+index-1, &arr[logical_length-1], temp_arr+index);
delete[] arr;
arr = temp_arr;
arr[index] = v;
return true;
}
else
return false;
}

bool contains(int i)
{
for(int z = 0; z < logical_length; z++)
{
if(arr[z] == i)
return true;
}
return false;
}

};
>>
>>59446326
kurva!
>>
File: advice.png (51KB, 595x313px) Image search: [Google]
advice.png
51KB, 595x313px
>>59446284
I've been like a complete retard for half a year or so. My bosses and peers were extremely helpful tho, they assured me that I can literally ask anything. Just keep grinding like a madman, anon, it should get better.
>>
>>59446341
>Andrew Magnesium
>>
>>59446301
>>59446341
That's comforting anons, thanks.
What I find the most difficult is understanding the jargon of the developper world. When I was in school projects with friends, we used to communicate between retards with retarded words and we understood each others.
Now, I hear this constant flow of technical words and it's hard get what these people are talking about.

But I'm getting better at it little by little.
>>
File: 1477941156962.jpg (7KB, 200x179px) Image search: [Google]
1477941156962.jpg
7KB, 200x179px
>tfw got blamed for bottom-posting instead of top-posting
And I thought the person is old enough to remember Usenet
>>
>>59446284
>two weeks
It's not that much
>>
>>59446284
Yeah it's normal. During an internship you're expected to learn. I've had seen that happen at shitty startups and "big 4" companies alike.

The key is to figure out a good balance between independence and mentorship (which also takes a few weeks).
>>
>>59446295
>implying you're going to be making money on your free time on 4chan
fuck off retard
>>
Don't know if this should go in dpt instead.

I'm trying to write a function in Java that converts a int[][] array to a series of strings where each string corresponds to a row in the array. But when I print the resulting string I get nonsense: [[I@6d06d69c

public String toString() {
String lineseparator = System.lineSeparator();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) {
sb.append(map[i])
.append(lineseparator);

}
return sb.toString();
}


I've tried a few different variations, using two for loops for example, but I get the same shit either way. What am I doing wrong?
>>
>>59446455
>implying multitasking isn't a thing
Yeah, and I'm the retard, go back to your safe space
>>
>>59446465
as in you want it to look like, for example, "123456"?
>>
>>59446605
Yea, or
123
456
789
rather
>>
> Python

Is there a basic but fast JSON parser?
>>
OOP is the cancer that is killing programming
>>
File: 1488812326372.jpg (13KB, 233x300px) Image search: [Google]
1488812326372.jpg
13KB, 233x300px
>>59446643
Invent something better, faggot.
>>
>>59446440
Yeah you're right but most of the time I don't know what kind of questions are badly seen.
Like what I was saying about them using their dev slang. Sometimes I'm scared of asking what a word means because it's like that as a dev, I SHOULD know that word.
>>
>>59446643
OOP is how the human mind works. You can't think about something if you don't know what kind of thing it is.
>>
>>59444191
I've tried to write fizzbuzz in haskell, but i'm having trouble with divByFiveAndThree
I'm calling divByThree and divByFive and if they both return string then concat them and return.
module Fizz where
type FizzBuzz = Either Integer String

divBy :: FizzBuzz -> Integer -> String -> FizzBuzz
divBy num by fizzString = case num of
Right str -> Right str
Left a -> if a `rem` by == 0
then Right fizzString
else Left a
divByThree :: FizzBuzz -> FizzBuzz
divByThree num = divBy num 3 "Fizz"

divByFive :: FizzBuzz -> FizzBuzz
divByFive num = divBy num 5 "Buzz"

divByFiveAndThree :: FizzBuzz -> FizzBuzz
divByFiveAndThree num = do
fizz <- divByThree num
buzz <- divByFive num
case (fizz, buzz) of
--(Right a, Right b) -> a ++ b
_ -> num

printFizz :: FizzBuzz -> IO ()
printFizz fizz = case fizz of
Right str -> putStrLn str
Left num -> putStrLn $ show num

main :: IO ()
main = do
mapM_ (\x -> printFizz $ (divByThree . divByFive) (Left x)) [1..100]
>>
>>59446663
>something
Often you just want to do shit and do shit, things are secondary.
>>
>>59446663
Do babies not think?
>>
>>59446655
Haskell already exists
>>
>>59446465
>nonsense
What you're probably getting is the string builder's memory location as a string. I haven't done a whole lot with stringbuilder, let alone use it with a multidimensional array, but the oracle docs looked somewhat clear on its usage?

https://docs.oracle.com/javase/tutorial/java/data/buffers.html
>>
>>59446703
They can't think until they are taught a language.
>>
>>59446663
So because it's easy we should use it, even tough it's a pile of crap
>>
>>59446670
Shouldn't it be
(Right a, Right b) -> Right $ a ++ b
_ -> Left num

?
>>
>>59446587
https://www.youtube.com/watch?v=iM4u-7Z5URk
enjoy your dead braincells lmao
>>
>>59446622
just taking a swing at it but what happens when you try String.valueOf(map[i])?Actually while i was writing that i think i see you're problem. A 2d array is an array of arrays. When you call map[i], you're actually pulling the array at that location, not an int
>>
>>59446725
>So because it's easy we should use it
Well, yes. Something that is easier to understand and reason about is a good thing for non-trivial projects.

>even tough it's a pile of crap
Ha, typo, tough luck pal. But seriously, that's, like, your opinion, man.
>>
>>59446465
so in other words, you're pulling a memory address for one of the arrays contained within map
>>
>>59446763
>>59446743
>>59446711
Oh yea, of course. Thanks.
>>
>>59446827
I'm guessing what you're trying to do is print the "row" number, followed by the values contained in the array at that row?
>>
>>59446896
Just a visual representation of the array
>>
>>59446927
in that case, you could have an outerloop to go through rows, and an inner loop to through each value, append it all that way
>>
New thread:
>>59446947
>>59446947
>>59446947
>>
New thread:

>>59446946
>>59446946
>>59446946
>>
>>59446732
Thanks anon I haven't noticed that. But it's one thing. There is a problem with
(Right a, Right b)
itself:
fizz.hs:21:7: error:
• Couldn't match type ‘Either t0 String’ with ‘[Char]’
Expected type: String
Actual type: Either t0 String
• In the pattern: Right a
In the pattern: ((Right a), (Right b))
In a case alternative: ((Right a), (Right b)) -> Right a
[\code]

I think it have something with multicase syntax since this is valid:
unEither :: Either a a -> a
unEither eitherVal = case eitherVal of
Left v, Right v -> v
>>
>>59446948
>>59446951
Faggots.
>>
>>59446944
I ended up doing that. Arrays.toString(map[i]) worked as well but it uses [[a,b], [c,d]] that format.
>>
>>59446974
Cool. For once /dpt/ actually helped someone
>>
>>59446948
>>59446951
You fucked up, I'm leaving.
>>
>>59446708
OCaml*
>>
>>59444209

The only real limitation is your own mind anon. Get to work.
>>
File: 1351799277262.jpg (24KB, 460x351px) Image search: [Google]
1351799277262.jpg
24KB, 460x351px
>>59444489
>>
>>59444191
Can someone kindly give some pointers how to group every 2 consecutive characters in a long string without whitespace? I have a string of hex and I want to take ever 2 characters and match them against a table. What's the best way for doing this in bash?
>>
>>59448821
0x3A28213A
0x6339392C
>>
>>59449052
echo $(echo 464147474F54210a) | xxd -r -p
Thread posts: 324
Thread images: 43


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