[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Search] [Home]
Board
Settings Home
/g/ - Technology


Thread archived.
You cannot reply anymore.



File: 1552578634292.jpg (602 KB, 1280x720)
602 KB
602 KB JPG
What are you working on, /g/?

Last thread: >>70963358
>>
First for Java
>>
File: nail.jpg (459 KB, 1080x1105)
459 KB
459 KB JPG
>>70969601
Get out
>>
Second for fuck anime
>>
Been writing JavaScript all day and I am loving it!
>>
>>70969634
Show us the fruits of your work
>>
>>70969659
alert("result: " + document.getElementById('test'));
>>
>>70969678
>not using jquery
this fucking code sucks
>>
>>70969678
>not using jquery
I want to fuck you now, anon
>>
Can I have a function return different class objects with polymorphism in c++?
Something like

objectOne testFunc (bool con) {
objectTwo o2;
objectThree o3;

if (con)
return o2;
else
return o3;
}

int main() {
objectOne o1;

o1 = testFunc(true);

return 0;
}


Objects 2 and 3 are derived from object one here. Is there a way to make this work? I've tried several different things but I'm too dumb to make it work.
>>
God, I want to lick Chio's fingers
>>
>>70969791
Meant to make it
 objectOne *o1; 
>>
>>70969791
You have to use pointers.
>>
How do you call attention to your open source projects or contributions in a CV?
Should you just link your github? The quality of projects I've been associated with varies a lot (not least because I've learned since) and I would prefer they look at a few specific ones.
Is there's some common pattern people employ?
>>
>>70969791
https://www.tutorialspoint.com/cplusplus/cpp_polymorphism.htm
>>
>>70970004
Link your github/gitlab or whatever, but also specifically mention the contributions to what projects you've made as well. A recruiter isn't going to spend any amount of time actually digging through your profile to see what you've done, and a lot of people have some pretty throwaway crap in many forgotten repositories. Direct them to what you actually want to show off.
>>
I hate this hobby!
>>
I'm collecting browser information and putting it into a database. I'm kind of confused on if I should take the extra time to optimize it.

Here's what I mean. I get a user agent string, I put it into a library that will parse it for me, and I get an object with something like
{ browser: { name: 'Chrome', version: 'REDACTED' },
os: { name: 'Linux' },
platform: { type: 'desktop' },


When I go to put it into a table, should I take the extra time to make a key value pair? What I mean is, if I have 10.000 visitors and I collect their info, should I create another table like

1: Linux
2: WIndows
3: Mac OS

and then record using the primary keys?

DATE --- OS
Today 1
Yesterday 2
Today 2
Tommorow 3

Certainly this would be more efficient. Am I prematurely optimizing this? Should I just store the information as varchars?

DATE --- OS
Today "Linux"
Yesterday "Windows"
Today "Windows"
Tomorrow "Mac OS"
>>
>>70970124
If I were to store that in a database, it would be a single table. A user agent is a single thing, instead of splitting into 3 categories.

browser, browser_version, os, platform
>>
>>70969634
Come over here and sit on my lap, so we can do something you'll love even more~
>>
Trying to switch to Premiere, i always used Camtasia Studio 8. Tried Sony Vegas 10 and it doesn't convince me at all, Premiere seems pretty neat btw.
Any recomendations /g/ ?
>>
>>70970260
none of that is programming
>Any recomendations /g/ ?
ask another thread or board.
>>
>>70969705
>>not using jquery
based
>>
File: moin.png (193 KB, 1296x994)
193 KB
193 KB PNG
>>70969573
>What are you working on, /g/?
I am working on converting h264 avc to h264 annex b. I finally have some video output. I am getting closer!
>>
>>70970260
Just use the industry standard. So yes, use premiere.
>>
>>70970349
>I finally have some video output.
good work anon
Are you literally writing a "parser" for the h264 format in kotlin?
Sorry, probably not the right word, but don't now what else to use, not familiar with video formats/encoding beyond usage of ffmpeg
>>
if( argc <= 1 || argv[1] != '-' )
{

this is 100% safe, correct?
>>
>>70970434
b8
>>
>>70970434
No, if argc is 1 then argv[1] is out of bounds.
>>
>>70970451
>>70970452
but if argc is JLE, it will trip the condition and the second conditional won't execute, right?

also, forgot argv[1] should be *argv[1]
>>
>>70970452
>>70970451
>||
Oh I see, I fell for it.
>>
>>70970472
Is that part of the C++ standard? I know it's the case in Java, but not sure if in C++ it's compiler specific.
>>
File: moin2.png (207 KB, 1108x856)
207 KB
207 KB PNG
>>70970398
Yes, it parses h264 network abstraction layer units. Then it turns the byte stream from avcc format to annex b format
>>
>>70970530
alright, that's actually really fucking cool, and it's far better than anything I could do
How are you going about doing this? Just looking at the h264 format/spec and trying to comply with it?
>>
File: 1476152471818.jpg (32 KB, 599x440)
32 KB
32 KB JPG
https://github.com/boyEstrogen/Anime-Girls-Holding-Programming-Books

Which one of you is this?
>>
>>70970516
Short-circuit is in the standard.
>>
>>70970552
I don't think it's anybody from here, if he is he's missing a lot of images.
>>
>>70970549
>How are you going about doing this?
Googling any time I want clarification. h264 is really well documented. AVCC vs Annex-B is not that big of a difference. https://stackoverflow.com/questions/23404403/need-to-convert-h264-stream-from-annex-b-format-to-avcc-format
>>
File: cover.jpg (589 KB, 600x765)
589 KB
589 KB JPG
>>70970552
>llvm.moe
Nice
>>
>tfw it is too nice outside to program
>>
>>70970552
>https://github.com/boyEstrogen/Anime-Girls-Holding-Programming-Books
Discord tranny by the username.
>>
File: 1535872384040.jpg (37 KB, 417x500)
37 KB
37 KB JPG
>>70970673
take your laptop to your weird outdoor activities, or just close the blinds.
>>
>>70970602
Cute
>>
>>70970695
But I want to enjoy nature and bask in the beauty.
>>
>>70970673
I suspect this is why Seattle software companies kick the shit out of California ones.
>dude, let's just ship it in JavaScript amd go surfing, brah
vs.
>oh Christ, another three weeks of rain, might as well finish optimizing this inner loop in assembly
>>
Practicing monads. Is there any way I can write this in a nicer way?

verify :: Digit -> String -> Maybe String

verifyNumber :: String -> Maybe String
verifyNumber xs = do
x1 <- verify N xs
x2 <- verify X x1
x3 <- verify X x2
x4 <- verify N x3
x5 <- verify X x4
x6 <- verify X x5
x7 <- verify X x6
x8 <- verify X x7
_ <- verify X x8
return xs
>>
File: 1527441284353.jpg (1.38 MB, 2272x1704)
1.38 MB
1.38 MB JPG
>>70970738
you can do both, rms is a good example of maximum NEET.
>>
>>70970770
Is that Stallman's home?
>>
What are some interesting beginner projects to do on Java
>>
>>70970845
yep
>>
>>70970854
if you want a challenge you can try uninstalling java
>>
>>70970855
That man is a legend.
>>
>>70970873
i lied tho
>>
File: 1534753753605.jpg (3.59 MB, 3720x2800)
3.59 MB
3.59 MB JPG
>>70970845
No, he lives the perfect NEET life. Shitpost all day while travaling and get praised by people who like free software.
He has a better life than Bill Gates, it's not money.
>>
>>70970910
at least bill gates isnt a virgin
>>
>>70970896
How could you?
>>
Cancerous marketing material for the gambling industry that makes me want to cry (one-time use landing pages, interactive applications, games etc).

I don't even have the balls to code my own stuff any more. Someone help me.
>>
File: 1532294381227.png (128 KB, 800x1000)
128 KB
128 KB PNG
>>70970922
>I stuck penis in vagina once
good job, but it doesn't compare to the comfort of maximum NEET life.
>>
>>70970961
Bill Gates is technically a NEET too, I doubt he's employed
>>
>>70970872
please I'm trying to get good at this language
>>
>>70970949
Ask for a contract negotiation and then ask for less hours instead of more pay. They will be relieved they don't have to shell out. Tell them software developers are more productive with less hours. It's a tough market for employers so you have leverage.
>>
I was going to try re-implementing (a subset of) https://bans.verniy.xyz
like, I probably don't care about having a fancy website/interface, or SQL dumps
from what I can tell, most of the "heavy lifting"/actually important stuff happens in https://github.com/ECHibiki/Bans.Verniy.xyz-Modern/blob/master/CronJobs/ripper.php and https://github.com/ECHibiki/Bans.Verniy.xyz-Modern/blob/master/Scripts/TableFunctions.js right?
are there any other "important" files to look at?
>>
>>70970966
even google is moving away from it
https://techcrunch.com/2019/05/07/kotlin-is-now-googles-preferred-language-for-android-app-development/
only purpose to learning java is if you want to be an enterprise codemonkey streetshitter
you're better than that, anon
>>
>>70970964
Technically is the word, he doesn't seem to enjoy the NEET life, it's closer to retirement.
His microsoft foundation is closer to NEET life, just a very rich NEET that has nothing to do with his money.
>>
>>70970994
Kotlin is shit, I will have a list of arguments to support this soon.
>>
>>70970982
I recently got a 4k pay rise and it still didn't do the trick.

I get you though, three people have done exactly what you said in the past 3 months so I think I missed the boat.
>>
>>70970994
I didn't ask for your opinion, I asked for programming projects fit for a beginner
>>
>>70971015
Not him but I also have an opinion about this

java sucks
>>
File: 1503204756939.png (378 KB, 1450x1080)
378 KB
378 KB PNG
>>70971015
my opinion is that you should write your project fit for a beginner in a different language
anyway, https://better-dpt-roll.github.io/
pic rel is probably not up to date, I found it on google
if you do use pic rel, do not reply to this post and shit up the thread - there are plenty of ways to get a random number
>>
>>70971028
+1 / Like / Love / Heart / "This helped me"
>>
File: ka4.jpg (70 KB, 1024x576)
70 KB
70 KB JPG
>trying to get asm and then execute it in my own program
>for some reason opcodes i.e. 0x0 / 000000 are somehow used for multiple ops
Just doesn't fucking make sense, why on earth would you give a definition more than once? and how does a system even differentiate them reeeeeeee
>>
File: Challenges.png (1.61 MB, 3840x2160)
1.61 MB
1.61 MB PNG
>>70971033
Here's a more recent version
>>
What are the recommended resources for learning Kotlin?
>>
>>70971114
Acid
>>
>>70971114
public toilets
>>
>>70971114
Learn.kotlin.ru
>>
>>70971120
>>70971144
>>70971152
sasuga /dpt/
>>
>>70971120
Don't do this one, it's retarded and nothing good will come from it.
>>
>>70971261
4chan police
>>
File: kotlin7.png (183 KB, 642x597)
183 KB
183 KB PNG
>>70971120
>>70971144
>>70971152
All decent advice. Android Studio will convert Java to Kotlin for you.
>>
File: 1549041031060.gif (387 KB, 269x270)
387 KB
387 KB GIF
>>70971280
I've done acid at least 20 times, it's garbage. Stop, drugs are bad,
>>
>>70971302
if its garbage why did you do it 20 times
>>
>>70971319
because I'm a retard.
>>
I did the Helsinki MOOC for Java and I started the Princeton Algorithms course on Coursera. What are some personal projects I could be working on at this time? And any recommendations for what to learn after a data structures/algorithms course?
>>
>>70971319
Not him, but I kept doing acid even though it was horrible for me because I kept believing "next time, I'll have a good trip". Bad idea.
>>
>>70971323
not a dick measuring contest because i'd probably lose but

it's not that bad
>>
for the love of god somebody give me a nonsense hobby project. Not "build a raytracer!" or whatever, make me write a statically typed python compiler or something.
I'm so fucking bored doing my thesis I need something that I can always go back to and just fiddle with
>>
>>70971381
so you never had a good trip?
>>
>>70971381
Was the same for me with weed. Now I only drink, I know it's not healthy but at least it actually feels good.
>>
>>70971391
Browser, but written in COBOL
>>
I'm 21, almost 22, and I've never, ever, EVER tried out weed or any kind of drug. And I've never had any problems. You should learn from me.
>>
>>70971391
Implement a borrow checker for C
>>
>>70971432
That defeats the performance of C
>>
good static types > dynamic types > bad static types
>>
>>70971440
what the fuck are "bad static types"
>>
>>70971445
java
>>
>>70969573
>What are you working on, /g/?
Trying to decide how complex to make a self driving car and how to go about implementing it for an embedded systems class.
>>
>>70971445
go
>>
>>70971394
Not really, no. Shrooms were better.

>>70971395
It ruined weed for me, too, and just before it got legalized here unfortunately.
>>
>>70971450
You can follow russia's model and make a line following bot. https://www.youtube.com/watch?v=9RgxPHis74g
>>
>>70971450
while (pedalToTheMetal) {
vroomVroom();
if (brake) {
break;
}
}
>>
>"Scala sucks at FP, so let's use Kotlin instead"
why do people spout this shit? if you think FP in Scala is bad you're really gonna hate Kotlin
>>
>>70971439
BC is a compile time thing
>>
>>70971516
jvmlets are brain dead
>>
>>70971528
we should never have allowed java to worm its way into academia
>>
File: shineeee.png (2.19 MB, 1212x930)
2.19 MB
2.19 MB PNG
Is there any practical downside to use the Boehm GC in my C projects and never worry about explicitly freeing memory again? It's a drop-in replacement to malloc so it's of little effort to integrate
>>
Anyone ever make an arduino a slave to a pi? Writing a tesnorflow program that recognises people and a motor attached to an arduino moves to them.
>>
>>70971586
Not a precise GC. May leak.
>>
>>70971586
Any "real" C program is going to have dependencies, and those dependencies aren't going to be using your stupid GC.
>>
File: untitled9.png (9 KB, 708x680)
9 KB
9 KB PNG
I'm having a little problem computing angles. I want to know if an angle is inside some range. But the problem is, to compute this angle I'm using atan2, and I don't know what the fuck is going on, but there's a value range in which very similar angles come to very different values, at about 180º.

What I want to know is: is the angle -128º between the angle -180º and the angle -117º? Unfortunately, since -180º is completely horizontal, it returns as positive 180º, and this means I'm fucked. I'm doing the following:

if( (max( alfa(L), beta(L)) >= gamma(K)) && (min(alfa(L), beta(L)) <= gamma(K)) )


Where alfa would be -117, beta is 180 and gamma is the one that goes between. Is there any other way to do this that avoids this problem?
>>
>>70971376
Find a project on github. Even if you suck, people will correct you.
>>
Do any metalanguages exist where I could write a library kind of abstractly and then make it available to arbitrary target languages without having to wrap a C API?

Like I want to be able to write an OO library and have it be available in C++, Java, Python, C#, etc.

The only thing that seems kinda close is Haxe, but I've looked at the generated code and it's pretty atrocious. C++/SWIG is another option, but all that's doing is automating the creation of C bindings (OK as a last resort, but still not exactly what I have in mind). Instead I'd rather have it generate more-or-less idiomatic code in the target language. The idea is, the resulting code should be easily consumable by somebody who is familiar with that language, and not make them go "why the fuck is this library so weird?"
>>
>>70971391
you need other people to tell you what to do?
I guess college is the right place for you.
>>
Is it autistic to want to do manual memory management?
>>
>>70971930
unless embedded hardware, or very concerned about performance, extremely
>>
>>70971958
Not him, is it autistic to enjoy embedded and performance-concerned systems programing?
>>
>>70971976
>>70971930
No. C is a very fun language to use.
>>
>>70971930
I'd call it obsessive compulsive, although I guess that is an aspect of autism.
>>
>>70971976
I don't think so, no, but I think actively wanting to manually manage memory for any other reason is just jerking yourself off
>>
>>70971669
Angles wrap around. To define a range you need to have both two numbers and a direction (clockwise or counter-clockwise). Then you need to get how far beta is from alfa in that direction, and how far gamma is from alfa in that direction, and if the first number is smaller then your angle is inside the range
>>
>>70972007
You don't seem to know the joys of seeing
==5711== HEAP SUMMARY:
==5711== in use at exit: 0 bytes in 0 blocks
==5711== total heap usage: 9,988 allocs, 9,988 frees, 1,056,276 bytes allocated
==5711==
==5711== All heap blocks were freed -- no leaks are possible
>>
>>70972022
Fuck, replied to the wrong post. It was intended for >>70972005.
>>
>>70971930
I don't think so but I'm autistic so hey
>>
>>70969573
>Needed to add some small feature to one of our services
>going by boy scouts rule, refactor the two functions I go through
>submit MR, people too afraid to review it
the second function wasn't that complicated, but it was almost impossible to test it properly since it had two calls to exeternal DBs
>mock the calls
>mock the entire system
yeah fuck those niggerlicious solutions, mocking a system in Clojure with Component isn't that hard, but making sure it contains the data you want it starting to be a headache
>back to drawing board
>aha moment: manage to separate function going out to DBs completely from rest of business logic
>refactor logic to pure function
>write proper tests
>redo the changes
>find a few little things I missed without the tests
At least writing tests in Clojure is easy. Annoying that I wasted about two days on something I eventually figured out and wrapped up in 3 hours.
>>
>>70970987
/bans fetching is implemented
now to focus generating a link for the archived post
https://github.com/ECHibiki/Bans.Verniy.xyz-Modern/blob/master/Scripts/TableFunctions.js#L240-L301
this looks ugly to me, but what do I know?
>>
>>70972007
>Then you need to get how far beta is from alfa in that direction, and how far gamma is from alfa in that direction, and if the first number is smaller then your angle is inside the range
Got it. Will try it out.
>>
>>70972093
http://dpaste.com/3HQYV5N
>>
>>70970673
>>70970695
>>70970738
>>70970770
I had a very nice weekend fucking around with a personal project in a cabin. you get quiet atmosphere, beautiful surroundings, give it a shot. You can both relax and get excellent focus on your work.
>>
File: 1557750049575.jpg (99 KB, 487x640)
99 KB
99 KB JPG
I used JavaScript to generate java code today
>>
>>70971391
Write a Chicken Scheme interface to Vulkan.
>>
I just wanted to say I'm really disappointed in everyone releasing projects that are OS dependent in current year. Please work on improving your self and skills.
>>
>>70972278
>make tradeoffs for something to work on Lunatix, Mac HomOSeX and Winblows
<everyone just runs it on the same platform
>>
I just realized knowledge of C pointers is good for anti subversion. Knowing that what a symbol dereferences to can be changed makes a lot of linguistic trickery obvious.
>>
>>70972278
The only OS independent project is another operating system.
>>
>>70972306
That's a self fulfilling prophecy. When you make tools that rely on a specific vendor, of course users will be vendor locked to them. Making portable programs is the only way to alleviate that and give actual choice to the user.

Besides, the only trade off is a minimal amount of time and good engineering practices. It's not like supporting more than 1 platform is going to make the program somehow worse.
>but it's harder to maintain
That's just not true. It means your abstractions are shit.
>>
>>70972306
>Mac HomOSeX
Stealing this
>>
>>70970552
>"cute" boys
who else but the faggot who keeps fucking up the /sqt/ OP? The pedoweebhomo.
>>
>>70970738
this.
Enjoy nature and take inspiration from God's creation.
>>
>>70971048
roll of pluck
>>
File: 1520715994766.jpg (98 KB, 640x706)
98 KB
98 KB JPG
>>70972453
I want to ____ God's 2d creations
>>
>>70972464
Praise the Lord Jesus with?
>>
>>70972435
It's very old, and not even relevant now.
>>
>>70971033
rolling
>>
File: 1557912043464.png (168 KB, 349x427)
168 KB
168 KB PNG
Which Vim plugins don't suck? So many are broken and depreciated I don't know how people can be so adamant about Vim.
It feels like all the good plugins are just hiding from me
>>
File: wutt.png (354 KB, 1282x847)
354 KB
354 KB PNG
>>70972497
yes
>>
>>70972446
Stop baiting me I need to go to sleep like a good wage slave. I don't have time to spam this thread with loli.
>>
*PWEEEEEEE*

Do not sexualize the lord jesus
>>
>>70971033
bored, rrrrrrolling
>>
>>70972587
>It feels like all the good plugins are just hiding from me
Yeah, they're all on the emacs side
Who the fuck can even tolerate writing vimscript long enough to maintain a plugin? Emacs lisp isn't great but still miles better than vimscript and even has a common lisp compatibility layer
>>
>>70972699
oh fuck
>>
>>70972706
good luck fucko
>>
>>70972706
not that hard
https://gist.github.com/JohnnyonFlame/807ed61988d2efe774dd
>>
>>70972106
alright, did a thing
now has archive searching

I think I'm done having fun with this, since all that's really left is to urlencode the string so the comment doesn't fuck up searching on the archive, and writing to a file, neither of which I have much interest in, since it'll basically be
with open('log.txt', 'wb') as f:
f.write(json.dumps()) # a bunch of variables

http://dpaste.com/0V8R305
>>
File: 1557882292941.webm (1.95 MB, 460x612)
1.95 MB
1.95 MB WEBM
C, Sepples, Rust, Python, Haskell
These are all you need.
>>
>>70972879
>Sepples, Rust, Python, Haskell
Yeah, no.
>>
>>70972587
ALE, YCM and NerdTree
>>
>>70972879
*C, Haskell
>>
> the absolute state of react developer
>>
>>70972917
do they speak engrish?
>>
>>70972927
they speak HR buzzwords
>>
>>70972927
they sound Chinese
>>
>>70972971
Indian.
>>
>decide to give Ada a try
>took me 1hr to implement Subset Sum Problem

theres a point where a language is _too_ declarative
>>
>>70973016
try Agda
>>
>>70973016
post code
>>
>>70972660
>i need to go to sleep
make sure to take your nightly dose on cyanide!
>>
>>70973051

with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
-- a set of numbers to find subset sum on
type Set is array(1..5) of Integer;
-- init set
Arr : Set := (2, 8, 4, 9, 1);
-- find if subset sum exists in a set
-- @param Arr - the set to check
-- @param S - the sum to check against Arr
-- @param N - for iteration; equals Arr.length
-- @returns - truth value on whether subset sum exists
function SubsetSum (Arr : Set; S, N : Integer) return Boolean is
begin
-- a sum of zero is always possible
if S = 0 then
return True;
-- if surpassed all elements of Set
elsif N = 1 then
return False;
end if;
-- if it is still possible for a sum to exist
if (Arr(N-1)) > S then
return SubsetSum(Arr, S, N-1);
end if;
return (SubsetSum(Arr, S, N-1) or SubsetSum(Arr, S-Arr(N-1), N-1));
end SubsetSum;
begin
if SubsetSum(Arr, 11, Arr'Length) = False then
Put("There is no subset sum.");
else
Put("There is a subset sum.");
end if;
end Main;
>>
>>70972927
>>70972988
If it wasnt for the sweet ass salary they paid, i would leave so yeah...
>>
>>70973067
Holy shit this looks like sex. Ada where have you been all my life.
>>
>>70973067
Now do it in Spark
https://en.wikipedia.org/wiki/SPARK_(programming_language)
>>
Is Rust just better than Go?
>>
>>70969791
As the other anon said, you have to use pointers because it doesn't know the size of the object at compile time. As a consequence, you would also have to allocate with malloc because the object wouldn't exist after the function ends. So it would be
void *testFunc (bool con) {
if (con)
return malloc(sizeof(objectTwo));
else
return malloc(sizeof(objectThree));
}

int main() {
objectOne *o1;

o1 = testFunc(true);

return 0;
}
>>
>>70973067
it's beautiful
>>
>>70970452
No it's not. The standard says that argv terminates with null.
>>
>>70970758
Yeah, using a better language.
>>
>>70969791
This isn't a good design because C++ lacks the runtime introspection of a language like Java. It's better to use classes like ADTs and avoid the dynamic parts of OO altogether.
>>
>>70969791
This isn't a good design because C++ lacks the runtime introspection of a language like Java. It's better to use classes like ADTs and avoid the dynamic parts of OO altogether.
>>
File: step++.png (376 KB, 1648x594)
376 KB
376 KB PNG
>>70969573
>What are you working on, /g/?
I got my stream to the point where ffmpeg can at least take it as input. It looks like there are some helpful messages to help fix up my annex b formatting.
>>
File: 1532350579527.jpg (192 KB, 853x480)
192 KB
192 KB JPG
>>70973127
>The standard says that argv terminates with null.
Ok, I'll trust you because I'm too lazy to look it up. Does that NULL terminator increment argc though? If it does it would break everything, if it doesn't argv[1] is still out of bounds.
>>
>>70973310
No. argv[argc] will always be NULL.
>>
>>70973310
even if it does you'd still be dereferencing null
>>
>>70969573
Dear /dpt/,

Today I unexpectedly had the opportunity to use a simple graph algorithm and it made me happy.

I was working on a rudimentary decision making engine. Under this engine, a decision agent is a record featuring a resource table, mapping names of accumulable resources to their current numeric values; a capability table, mapping pursuits to capabilities that can work toward those pursuits; and a need set, containing goals. A boundary is defined as a numeric range with only one endpoint. A pursuit is defined as a resource name coupled with only the directional part of a boundary (leaving the actual numerical limit out, and only indicating whether it's an "at least" boundary or an "at most" boundary). A goal is similarly defined as a resource name coupled with a complete boundary. A capability is a record featuring a name and a prerequisite set, where the prerequisites are goals.

Anyway, since the capability table maps pursuits to capabilities, capabilities contain goals as prerequisites, and every goal can be trivially converted into a pursuit, it's easy to see the capability table is actually a graph in disguise. I discovered if I apply a breadth-first traversal of that graph from any given starting point marked by pursuit P, and stop when I find the first capability node for which all prerequisite goals are already satisfied by the current state of the resource table, that algorithm will always give me the capability representing the first step toward pursuit P. If the algorithm doesn't turn up anything, that just means the agent doesn't have the necessary capabilities to engage in the pursuit in question.
>>
>>70973343
argc is the count of argv, the length of the array. Even if you guarantee that argv[argc] is NULL for some dumb reason, it's still stupid to use it.
arr[arr_len] is and should be out of bounds.
>>
>>70973388
very good post
>>
>>70972879
There is no world where you need Haskell, now or future.

I will say Python + C is a pretty good starting point for most stuff. Both run everywhere and Python is good for writing scripts and one time use code.

After that all you need is a "big" language, which really just depends on what libraries and shit you are gonna be using. In a perfect world you can choose, but realistically you're gonna get stuck with C++, Java, Swift, C#, Go, Rust, or whatever.

If you're in a perfect world it's C + Python + Rust tho.
>>
Rust is functional C.
>>
>>70973403
ty fren
>>
>>70973428
C is functional C
>>
>>70973390
The reason it exists is so you can pass your argv array to functions like execv (which are NULL terminated) without having to copy it somewhere else.
It's for programs which execute some other command
sudo foo -a -b -c

execv(argv[1], &argv[1]);
>>
>>70973418
>there is no world where you need Haskell
>btw, about python ...
>>
>>70973440
So is it by the C standard or POSIX? Quote it please, as I said I'm lazy but I am curious what the standard says.
>>
Just started learning JS this week to try and make a cinnamon applet. Does this become fun at any point or is it just not for me?
>>
>>70973478
it becomes fun when you make something useful to solve problems for yourself
>>
>>70973467
http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf
5.1.2.2.1 Program startup
>argv[argc] shall be a null pointer
>>
>>70971391
Do you know Rust?
>>
>>70973478
JS becomes "fun" when you're elbow deep in framework surgery.
>>
>>70973501
Interesting. Using argv[argc] in counting is still retarded though.
>>
>>70973543
Yeah, outside of the execv-like case, there is no reason to ever use it.
>>
>>70973436
Chicken is Scheme that compiles to C.
>>
>>70973104
Different tools for different use cases. Rust is for performance-critical code that has to be as safe as possible, even at the cost of a high learning curve and abstraction. Go is something like a statically typed scripting language - good enough performance and safety in most cases, while still fast to develop in.
>>
File: 1546810684284.jpg (142 KB, 661x502)
142 KB
142 KB JPG
How do you fuckers deal with OS programming. Studying it is killing me let along coding modules for the OS
>>
>>70969573
Trying to relearn anything I did in my classes. I haven't so much as looked at code in like 3 years and I'm gonna graduate in december but I don't remember shit
>>
>>70973621
Install Gentoo.
>>
Java only performs better than any native language implementation, if your machine has infinite memory.
>>
File: 720pp.png (1.36 MB, 1920x1040)
1.36 MB
1.36 MB PNG
Working on taking Android camera preview data and straming it. 720p is working nice after a few modifications to buffer sizes. This is starting to work out fairly well.
>>
>>70973675
Can java pass by reference?
>>
>>70973688
only for classes. for primitives (int etc) you need to box in an object and pass that.
>>
>>70973688
no, its always by value
>>70973703
pointers are passed as values so you cannot change them outside the scope of your function
>>
File: 1509413799890.png (124 KB, 257x278)
124 KB
124 KB PNG
>>70973780
>no, its always by value
>>
>>70973621
Watch the first 7 minutes of this https://youtu.be/r4sTwDpHVDY
>>
>>70973478
>>70973515
This guy is right, but in order to get there you have to do unfun learning on toy code to figure out how the stack works.
>>70973791
This guy learned what a reference is and now he thinks java isn't pass by value
>>
>>70973832
This guy collects praying mantises
>>
>>70973832
>This guy learned what a reference is and now he thinks java isn't pass by value
You don't know Java or what references are.
Class types are passed by reference, and primitive types are passed by value.
>>
>>70973791
>I dont understand the difference between a reference and being passed by reference.
read up on it pajeet
>>
>>70973832
>>70973862
http://lmgtfy.com/?q=is+java+pass+by+reference
>>
>>70973780
he was asking about java. no idea what conversation you were looking at ...
>>
File: 1518833712082.gif (3.09 MB, 343x400)
3.09 MB
3.09 MB GIF
>>70973873
Pay me to, lluedo guey. Reference is the object itself in memory, if you pass by reference then you pass a pointer instead of copying the entire object, which would be pass by value.
>>
File: x86.jpg (206 KB, 778x1000)
206 KB
206 KB JPG
is there any other cpu architecture with a cpu-tan?
>>
>>70973862
This program prints foo, then bar. Hm... which function does java behave like, I wonder?
#include <iostream>
#include <string>

using namespace std;

string value(string a, string b) {
b = "bar";
return a;
}

string reference(string &a, string &b) {
b = "bar";
return a;
}

int main()
{
string s = "foo";
cout << "pass by value: " << value(s, s) << endl;
s = "foo";
cout << "pass by reference: " << reference(s, s) << endl;
}
>>
>>70973890
Should there be? Maybe a 6502-tan
>>
File: 1480106921125.gif (1.78 MB, 240x192)
1.78 MB
1.78 MB GIF
>>70973904
>iostream
praying mantis disgusting
>>
>>70973904
>
using namespace std;

Any opinion or point you may have had has been discarded.
>>
>>70973937
A java programmer will have no idea what's going on without that
>>
File: 1520713275097.jpg (60 KB, 420x515)
60 KB
60 KB JPG
>>70973944
Sets the namespace to std, which could be a bad practice in a larger project. Why are you so edgy tonight? Relax, take a load off, enjoy some progeramming bantz with the frens here.

>>70973944
They think it don't be like it is, but it do.
>>
>>70972917
>his name is "Name"
I guess there is more demand than supply for making fun of react developers
>>
>>70973986
Maybe its `nahmeh` or some fucked up shit
>>
>>70973890
amd has waifu mascots, but unless you count amd64 its own thing rather than x86, I haven't heard of any :(
>>
File: Kang_sober_3.png (535 KB, 700x350)
535 KB
535 KB PNG
>>70974017
>count amd64 its own thing rather than x86, I
amd64 == x64, nt though
>>
>>70973904
Your actually passing by bits in both you mouthbreather. Get your poojit head out of the toiler.
>>
>>70974025
yeah exactly, they're not really different architectures, it's just different cpu-tans
>>
>>70974036
>Your actually passing by bits in both you mouthbreather. Get your poojit head out of the toiler.
OH shit she's retarded. Guys lay off. Hey girl you in London by chance?
>>
>>70974045
no need to reply, these seem the same troll wasting his time hoping the 5th post will get a response from me
>>
>>70974045
>she
>>
>>70974055
fawnself*
>>
>>70974045
cope more
>>
File: 1480200297742.png (587 KB, 550x733)
587 KB
587 KB PNG
>>70974062
Post code or stfu faggot
>>
>>70969573
I made a Game of Life and an image-to-ASCII converter based on Robert Heaton's website, are there any other, similar websites with programming projects broken down into sections like his?

I find that learning with this type of structure helps me learn code better instead of listening to courses.

http://robertheaton.com/
>>
>>70972212
A few weeks back I used JavaScript to generate LaTeX, because luatex shits the bed with full force when it comes to unicode and only pdflatex worked properly.
>>
File: 1557990891860.png (412 KB, 840x854)
412 KB
412 KB PNG
is the internal format of a grayscale 16 bit png GL_R16 in opengl? I mean it only has 1 channel right?
>>
>>70974240
https://stackoverflow.com/questions/26778222/32bit-int-buffer-to-greyscale-colour-mapped-image-in-opengl-single-channel-32

Does this satisfy your requirements ma'am?
>>
File: snipception.png (1.09 MB, 1477x856)
1.09 MB
1.09 MB PNG
Anyone still awake?
>>
>>70974459
>two adblockers
Why
>>
File: wtf_foxfag.png (105 KB, 984x876)
105 KB
105 KB PNG
>>70974464
Have to always be ready
>>
File: ENERGY.png (155 KB, 203x471)
155 KB
155 KB PNG
>>70974468
Piholes can suck a dick, I'd rather just maintain a hosts file..
>>
>>70974459
no
>>
>>70974188
I haven't found a general source for this type of thing (maybe sites like medium) but often blog posts follow this format, e.g. https://gnuu.org/2009/09/18/writing-your-own-toy-compiler/
>>
File: trsm.png (1.23 MB, 1290x718)
1.23 MB
1.23 MB PNG
>>70974500
Offtopic a little bit, but if I was transgender do you think rockstar would hire me?
>>
>>70974483
>no css element hiding, referral specific filters, differentiation between 1st/3rd party sources, dynamic AND static filters
host lists are fine, but you really should have a more powerful ad blocker on your actual browser, too.
>>
>reboot computer
>no projects open
>Apache is running for no reason
>check running processes
>can't figure out what process is running it
Anyone know how to fix this?
>>
>>70974514
hire you for what? nobody who posts on 4chan is payed for it and I don't think I've ever seen a rockstar ad.
maybe if suck enough dick they'll let you stir their corn syrup and chemical toilet mixture.
>>
File: Jenkins_Needs_You-02.png (88 KB, 1701x975)
88 KB
88 KB PNG
does this make you're life easier?
I will implement a driver for a semi-big software and will probably have to recompile the software lots of times. Is it worth setting up a jenkins instance?
>>
File: 1555536191499.jpg (615 KB, 1280x720)
615 KB
615 KB JPG
>>70974565
>will probably have to recompile the software lots of times
Anon, why are you still compiling your software in 2k19?
>>
>>70974584
Because the software i am using is written in C? I haven't found a good C interpreter :(
>>
>>70974584
Why isn't he using an electornic book (e-book (amazon brand))?
>>
File: 1535766756546.png (518 KB, 958x760)
518 KB
518 KB PNG
>>70974601
>he
>>
File: anakin_walgreens_POP.jpg (264 KB, 1920x816)
264 KB
264 KB JPG
use std::iter::FromIterator;

#[allow(dead_code)]
pub fn mergesort(v: &mut Vec<i32>) {
let mid = v.len() / 2;
if v.len() > 1 {
let mut vec_a = Vec::from_iter(v[..mid].iter().cloned());
let mut vec_b = Vec::from_iter(v[mid..].iter().cloned());

mergesort(&mut vec_a);
mergesort(&mut vec_b);

v.clear();

merge(vec_a, vec_b, v);
}
}

fn merge(va: Vec<i32>, vb: Vec<i32>, v: &mut Vec<i32>) {
let mut va_n = 0;
let mut vb_n = 0;

while va.len() > va_n && vb.len() > vb_n {
if va[va_n] > vb[vb_n] {
v.push(vb[vb_n]);
vb_n += 1;
} else {
v.push(va[va_n]);
va_n += 1;
}
}

while va.len() > va_n {
v.push(va[va_n]);
va_n += 1;
}

while vb.len() > vb_n {
v.push(vb[vb_n]);
vb_n += 1;
}
}

Finally manged to create my first mergesort function from some pseudo code!

I think my first version looked prettier but it was way slower.
fn merge(mut va: Vec<i32>, mut vb: Vec<i32>, v: &mut Vec<i32>) {
while !va.is_empty() && !vb.is_empty() {
if va[0] > vb[0] {
v.push(vb.remove(0));
} else {
v.push(va.remove(0));
}
}

while !va.is_empty() {
v.push(va.remove(0));
}

while !vb.is_empty() {
v.push(vb.remove(0));
}
}
>>
>>70974663
now you parallelize it.
>>
>>70974663
Fuckin yikes
>>
File: 1532261100613.png (137 KB, 1631x1571)
137 KB
137 KB PNG
>mfw prefixing all my classes with "The"
>TheList
>TheScreen
>TheMouse
>ThePhysics
>mfw prefixing all instances with "a"
>aList
>aScreen
>aMouse
>>
>>70974782
Fuck off, retarded frogposter. You're not welcome here.
>>
>>70974782
why do that when you could do
>x, y, z
>a, b, c
>j, k, l
>i
smhing my head tbdesu familia
>>
>>70974782
Based
>>70974787
Seething
>>
File: 07.jpg (357 KB, 976x1400)
357 KB
357 KB JPG
What differentiates some newbie that creates classes, uses loops, reads files and uses libraries in a single text file from a professional programmer?
>>
I've been programming for three months and have been working through beginner projects in books and project lists, but I'm not sure how to advance. Looking around online people always say shit like "use programming to fix a problem that you have in your daily life" but I honestly can't think of any problems. How do I proceed?
>>
>>70974930
Why was the bed wet?
>>
File: BRAINLET.jpg (195 KB, 890x670)
195 KB
195 KB JPG
>dude asks question
>answer it, because it's fucking simple
>he literally has no idea what's going on and starts asking stupid fucking unrelated shit
>tell him no, i gave him the answer
>thinks his situation is unique and starts thinking his code will somehow change how the language fucking works
>some other brainlet chimes in giving him shit advice
>he fucking takes it and ignores me for some reason, because the other dude is just as fucking stupid
>his code ends up unironically looking like this

DON'T BE A BRAINLET
>>
>>70974961
It was love
>>
I'm working on a java website. I've never done any web dev in java before, let alone using ADR so I'm having trouble getting my head around it. I discovered today that all the navigation button text comes from a database which is why I've had so much trouble locating functionality.

Are there any good resources that could help me out? I'm going nowhere fast.
>>
>>70974997
>java
>nowhere fast
par for the course
>>
an internet chat program in python. Very insecure.
>>
>>70975051
you or the program?
>>
>>70975081
yes
>>
Why do people call themselves "coder"?
Does "programmer" sound too boomer for them?
"Coding" sounds like something mindless, more akin to manual encryption than to algorithm design.
I really hate the term.
>>
File: 1557806036128.jpg (395 KB, 638x900)
395 KB
395 KB JPG
>>70974930
Bumbin
>>
>>70975221
dumb spiderposter
>>
>>70975200
"Coder" sounds like the low paid job punch card punchers of the 1960s in my ears. Coding isn't creative. Coding is putting into code what's been specified for you.
>>
>>70975200
>>70975239
Because HTML and CSS aren't programming.
>>
any good article or books about recursion ?
>>
>>70975322
by saying article or book you've made it impossible to make a joke reply
>>
>>70975200
>>70975239
Why shouldn't entry-level people be allowed pride? I for one respect the street sweeper who takes his work seriously and with conviction.
>>
>>70975341
my brain is playing 4D chess without my knowledge
>>
>>70975364
>>
>>70975322
Step 1: be lucky
Step 2: >>70975364
>>
File: 1555213970069.png (166 KB, 400x579)
166 KB
166 KB PNG
>>70975359
Unironically read SICP and do the exercises
You will understand recursion
>>
>>70970961
how do people fund their NEET lifes?
>>
>>70975378
will give it a go
>>
>>70975378
>Unironically read
As opposed to "ironically" reading?
>>
>>70975436
>as opposed to "ironically" reading [sicp]?
is this your first time in /dpt/
>>
is java just a crippled scala?
>>
>>70975455
No. Why are you dodging my question? How does one "ironically" read a book?
>>
File: 1557977775907.png (871 KB, 800x1119)
871 KB
871 KB PNG
imagine actually reading the books you bought
>>
>>70975456
Yes, and Scala is just a crippled Clojure.
>>
>>70974930
>>70975221
>>70975233
Tell me already
>>
>>70975466
isn't clojure just a pleb's scheme?
>>
>>70974930
>professional programmer
Just professional or actually good?
>>
>>70975469
I don't give answers to spiders, sorry.
>>
>>70975460
SICP in particular is often recommended as a blanket joke, kind of like replying with "install Gentoo" to arbitrary computer problems.
>>
>>70975464
https://twitter.com/dpttxt/status/1084612257751932934
>>
>>70975221
cute spiderposter
>>
>>70975484
>linking to the botnet

>>70975483
wrong
>>
>>70975476
No, why would you think that? Both are fine languages. Scheme is better for certain things like learning compiler design or compiling it to native code due to its simplicity.
>>
>>70975478
Actually competent
>>
File: 1550205897836.png (6 KB, 373x46)
6 KB
6 KB PNG
>>70975484
I posted that!
>>
Is it possible to split comma seperated string in SQL without regex and other voodoo magic?
>>
>>70975501
well done anon, post some cute code
>>
>>70975483
Why are you dodging my question? How does one "ironically" read a book?
>>
>>70975498
no call/cc. How am I supposed to add control flow to my programs?
>>
>>70975484
all these twitters' posts are mine, creepy
>>
>>70975523
even the shit ones?
>>
>>70975527
all me
>>
>>70975484
A grown ass man posted this idiotic, 7 year old girl tier sentence
Is this the effect of watching too much Chinese cartoons?
>>
>>70975545
yes
>>
>>70975510
No one suggested you could.
>>
>>70975561
see >>70975378
>>
>>70975484
>tfw a lot of these are me
>>
>>70975515
>control flow
You're writing shit programs if you need control flow.
>>
>>70975565
This does not mean what you claim it means. Please learn English.
>>
New thread:
>>70975583
>>70975583
>>70975583
>>
>>70975580
Please see >>70975378. Then explain how one can "ironically read" a book.
>>
>>70975588
The word "unironically" does not refer to reading in that sentence. Please learn how to understand language in context.
>>
>>70975598
Please read "Unironically read SICP" and explain how one could "ironically" (as opposed to unironically) read SICP.
>>
>>70975605
I just told you that "unironically" in that sentence does not refer to "read".
>>
>>70975624
Reread >>70975605 within the proper context and try explaining how you could "ironically" (as opposed to unironically) read SICP and do the exercises to understand recursion.
>>
File: 1555922576644.jpg (359 KB, 1536x2048)
359 KB
359 KB JPG
>>70973890
>>
>>70975637
Why do you want me to explain something the sentence does not say? I've told you several times that it doesn't say what you are suggesting it does.
>>
>>70975655
What does it say according to you then? You're implying that an action "read SICP and do the exercises" can be done "ironically" (as opposed to unironically).
>>
I have a stupid question but hobbyist so bear with me.
So ive read in a book somewhere to determinate if a number is even or odd you just & it with 1.
Now I dont know why is should be true but from observation when I look at hexadecimal numbers from 0 to F in binary form,I can notice that odd number do in fact all end in 1 in their binary form thus performing "&1" tells us if a number is even or odd.
I feel that this is not end of the story and there is mathematically more to it.
Is it just the nature of the binary system that allows for someone to do magic tricks like this?
>>
>>70975684
>Is it just the nature of the binary system that allows for someone to do magic tricks like this?
Pretty much.
>>
>>70975684
>determinate if a number is even or odd
Your book was full of shit. This is undecidable in the general case.
>>
>>70975667
I'm implying no such thing, and nor was the anon that wrote the post in question.
"Unironically" refers to the suggestion to read SICP, not to the reading itself. A more exlicit phrasing would be, "I unironically suggest you read SICP" as opposed to your interpretation of "I suggest you unironically read SICP".
>>
>>70975699
>"Unironically" refers to the suggestion to read SICP
The burden of proof is on your to show that this is true. Rereading >>70975378 should help you in this pursuit.
>>
>>70975574
cope
>>
>>70975684
How many digits do have to you check to see if a decimal number is divisible by 5?
>>
>>70975735
This is in general undecidable.
>>
>>70975721
Your whole fucking issue is that your interpretation doesn't make any sense. The only reason to stick with it is because you're stubborn and retarded.
>>
>>70975770
>Your whole fucking issue is that your interpretation doesn't make any sense.
How so? It makes perfect sense to interpret a post written in a retarded way in a retarded way.
>>
>>70975756
Unless you have a non-turing machine, ie a machine. Then you only have to check all of the available storage to make sure every digit isn't zero.
>>
>>70975816
No, it is obnoxious faggotry.
>>
>>70975838
The burden of proof is on you to show that your interpretation is the only valid one.
>>
>>70975843
>the only valid one.
That's not how natural language works, retard.
>>
>>70975200
I say coding just to piss off spergs
>>
>>70975856
>That's not how natural language works
The burden of proof is on you to prove the validity of this claim.
>>
does anyone on this board listen to music while programming?
>>
>>70975684
Every uneven number ends with 1 in its binary representation, so the book is correct.

Most programming languages have integer division and a remainder operator. Like 5 divided by 3 is 1 remainder 2. For a general check if something is evenly dividable by a number n, calculate the remainder (x % n) and check if that's zero.
>>
>>70976051
Im doing an exercise from CSAPP that forbids the use of the modulo operator so it got me thinking about the alternative ways of finding even and odd number,and i remembered reading about this &1 method somewhere.
Please note that math is not my strong suit both professionally and in everyday living and thats gets us my stupid question.

>>70975693
>>70975696
thanks or your answers.
>>
>>70976101
OK, but it's mathematically very simple. It's in the way the binary number system works.
0 - 0
1 - 1
10 - 2
11 - 3
100 - 4

It's easy to see that whenever you go one number up, the last digit changes. And since there's only two possible digits in binary numbers, the change in the last bit directly corresponds with the number being even, odd, even, odd, even, odd and so on.
>>
>>70970758
if you were able to take out the N/X argument, or find some pattern in there, this is just
head . drop 9 . iterate (>>= verify) . pure
>>
Cuckolds Love A Nigger Guy
CLANG
>>
File: 1553644693107.jpg (33 KB, 400x700)
33 KB
33 KB JPG
>>70969678
wow anon, when did you get so good at programming



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.