[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/ - Designated Pajeet 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: 329
Thread images: 44

File: bakabaka.png (510KB, 782x1238px) Image search: [Google]
bakabaka.png
510KB, 782x1238px
What are you working on, Ra/g/eesh?
>>
Haskell!
>>
>>60999254
idris is the new haskell
>>
Haskell is programing! Haskell is pure! I love Haskell!
>>
File: anime.png (786KB, 1000x1300px) Image search: [Google]
anime.png
786KB, 1000x1300px
>>60999313
Idris is dead and slower than Haskell
>>60999254
>>60999322
good posts
>>
>>60999329
>Commits today
>dead
no

>slower
Haskell took a while to get where it is now, years. Idris has a better start due to being able to fix mistakes made with haskell and build on a better type system.
>>
>>60999378
Toy languages with a userbase of 1 have had commits today.
>>
>>60999445
dude pls no hating on the best we have got in 2017 becus you will ragret later
>>
Why are there so many pajeets in the IT sector?
muh jobs
>>
>>60999659
If pajeets are taking your jobs it means you are so shit that the employers would rather have a less expensive pajeet to write shitty codes that matches your caliber
>>
>>60999940
It's the same pay and onshore. Is the average americans really that fucking dumb
>>
File: 1478677367459.png (1MB, 1276x1344px) Image search: [Google]
1478677367459.png
1MB, 1276x1344px
>>60999940
tfw cant break into IT to get experience to git gud because pajeets
>>
>>60999940
t. pajeet
>>
>>60999940
This guys not wrong, A good programmer isn't replaceable.
>>61000388
This guy is also not wrong. Pajeet fucks over the college kid trying to get started. But anyone thats been in the industry complaining about them is someone who probably shouldn't bother competing.
>>
>>61001070
Pajeet fucks over everyone. You can have negative contributions to a project
>>
>>60999215
What's an ADT?
>>
File: marissa-meyer.jpg (23KB, 448x350px) Image search: [Google]
marissa-meyer.jpg
23KB, 448x350px
>>60999940
Exactly this. Why should they pay you American wages when they can get Rajesh to code the same spaghetti that you code and pay him 1/5th of your salary?
>>
Java is a pajeet language
>>
>>61002224
It's the same wage try again
>>
>>61002179
https://fsharpforfunandprofit.com/series/understanding-fsharp-types.html
>>
>>61002561
I meant Rajesh in India.
>>
File: old_hag_langs.png (173KB, 600x355px) Image search: [Google]
old_hag_langs.png
173KB, 600x355px
24th for Fortran.
>>
>>60999215
// count to 10
std:cout("1,2,3,4,5,6,7,8,9,10");

am i doing this right?
>>
>>61003704
No, definitely not.

std::cout << "1,2,3,4,...";
or
std::cout << 1 << 2 << 3 << 4;
or
std::cout << "1" << "2" << "3";
or whatever
>>
>>61003642
Blondes are usually high maintenance.
>>
>>60999215
Java and Haskell are both shit tho
>>
>>61003739
Waste of time to do that for individual lines like that that I just want to fucking type and post
>>
>>61003759

blondes are pure
>>
>>61003642
the C stands for cute
>>
fixed my foldable instance
instance Foldable Tree where
foldMap f (Tree y []) = f y
foldMap f (Tree y [l]) = f y `mappend` foldMap f l
foldMap f (Tree y (l:leafs)) = foldMap f l `mappend` foldMap f (Tree y leafs)
>>
>>61003798
>>61003808
These.
>>
>>61003870
Good job, pajeet
>>
>>60999940
even if pajeet doesn't take your job, he is still saturating the job market and lowering your wage
>>
>>61002224
why do we pay politicians when we can just get a pajeet to do it for 1/50th the price?
why dont we just replace everyone?
>>
>>61003994
robots are the machine pajeet
>>
>>61004015
hopefully they dont get pajeets to fix the robot pajeets
>>
>>61004028
the robot pajeets will repair themselves
>>
>worked with a team of pajeets
>full "please do the needful" tier pajeet
>only way to communicate was though email and you'd have to wait for the next day for a reply due to time zone
>they all wrote awful code in perl and PHP
>VP told me stories about how they sleep or play games on the job
>constantly misinterpreting or not replying to emails due to language barrier
>eventually we sack them all and hire onshore
>>
does _SOMETHING_RE have a special meaning in python?

is the some kind of regex attribute?
>>
>mfw writing python with no obvious type information and no documentation
>>
File: ran_disgust.png (53KB, 204x288px) Image search: [Google]
ran_disgust.png
53KB, 204x288px
>>61004294
>writing python
Stopped reading right there.
>>
>>61004294
dynamic languages are evil
>>
File: file.png (141KB, 780x734px) Image search: [Google]
file.png
141KB, 780x734px
>>61004294
>>
>>61004172
Not on the syntax level. Sounds like the name compiled regex objects would be assigned to. Look at the re documentation on the web and check out raw string literals.
>>
>>61004294
Is there nothing like describe or inspect in Lisp?
>>
What's the best way to program GUI's?
I'm only really familiar with Swing, is that a good way to do it?
>>
>>61004413
help(), but it doesn't help if there's no information to begin with
>>
>>61002578
>f#
>>
File: 1497814976363.jpg (111KB, 1280x720px) Image search: [Google]
1497814976363.jpg
111KB, 1280x720px
>>60999215
C influenced languages get an automatic F in my book.
>>
>>60999215
Lisp is the most powerful programming language.
>>
File: yuck.jpg (33KB, 358x316px) Image search: [Google]
yuck.jpg
33KB, 358x316px
>>60999254
>>60999313
>>60999322
>>60999329
>>60999378
>Shitkell
>>
File: file.png (77KB, 480x360px) Image search: [Google]
file.png
77KB, 480x360px
>>61004502
>when the hacker known as /dpt/ insults my favorite language
>>
>>61004518
haskell is the worst programming language. even java shits on it
>>
File: file.png (115KB, 361x297px) Image search: [Google]
file.png
115KB, 361x297px
>>61004538
>>
File: 1484460882002.jpg (122KB, 1280x720px) Image search: [Google]
1484460882002.jpg
122KB, 1280x720px
>>61004518
The problem with Haskell (or Shitkell as I like to call it) is that it's complete garbage with a broken and trivial type system.
>>61004538
>even java shits on it
This hardly matters since they can be shown to be the same language.
>>
>>60999215
Tfw when /dpt/ is my favourite thread on /g/, Ranesh.
>>
File: file.png (310KB, 512x512px) Image search: [Google]
file.png
310KB, 512x512px
>>61004569
>>
Anyone into reactive extensions who can tell me how to do this in a more "rx" way?

source.concatMap(x => Rx.Observable.defer(async () => {
await actionA(x)
await actionB(x)
await actionC(x)
}))
.subscribe(console.log)


What I want is for the actions to be run synchronously like a queue on each event, so that it doesn't matter if actionA is faster than actionB, we still must wait for all actions to finish before the next cycle
>>
>>61004554
>>61004554
>>
@61004659
>wdg
I don't want reddit stink nearby. Fuck off.
>>
>>61004674
>reddit stink
added to wordfilter list
>>
>>61004698
Why the fuck are you even here? If you're going to act like a fucking redditor, go to fucking reddit.
>>
>>61004707
>reddit
added to wordfilter list
>>
>>60999215
>needing to define arithmetic operators
Why are functional programmers so autistic?
>>
>>61004391
>>61004518
>>61004547
>>61004589

straight out of 9fag in 2017
>>
>>61004758
>9fag
added to wordfilter list
>>
Doing some computer graphics. For Z-buffering with polygons, you need to store the coefficients of the plane's equation per polygon, right? I don't see how to calculate the z-depth, otherwise.
>>
I made a C program that prints Pascal's Triangle (albeit a right-angled triangle) on the train ride in to work. Recursion is pretty neat.
>>
>>61004875
Congratulations, you've learned to use recursion. Now please learn to not use recursion.
>>
>going to be programming for the rest of my education and the whole of my career
Is it worth learning to type on Dvorak layout? Or is there a better alternative?
>>
>>61004897
vi keybindings
>>
>>61004718
>>61004778
What a typical person from those sites would do.
Pottery.
>>
>>61004891
Don't worry mate, I understand how aggravating it is to see unnecessary recursion that makes the code impossible to decipher, but I couldn't think of another sane way to do Pascal's Triangle (since it's recursively defined).
>>
>>61004921
>he doesn't wordfilter "wordfilter"
summerfag
>>
>>61004921
>redditors are people
What a typical * from those sites would do.
>>
File: file.png (55KB, 235x250px) Image search: [Google]
file.png
55KB, 235x250px
rip /dpt/
>>
File: 1213.png (16KB, 811x275px) Image search: [Google]
1213.png
16KB, 811x275px
>>61004596
Dunno about rxJS, but in rxJava you can do it like this.
>>
>>61003704
>Pajeet detected
>>
File: ehhhmee.png (218KB, 626x560px) Image search: [Google]
ehhhmee.png
218KB, 626x560px
so I wanted to run a few tests on a commit 3 commits ago, so I did git --reset soft and ran it

then I decided to git stash to stash my changes
apparently I stashed the wrong kind of changes since reset staged all the changes the last 3 commits

I suppose I fucked up beyond repair?
(assuming I did not have files with the most recent version open, which I did)
>>
>>61005021
>Robots are stealing Pajeet's job
Top kek
>>
>>61005169
>soft reset
Found your problem: you got the state of tge code at commit N on top of commit N-3. Your stash is probably a mix of all your experimental changes with diff N N-3. It would have been repairable since said changes weren't erased, but would have required thought and uncommonly used commands.
>>
>>61005033
noice, thx
>>
>>61005021
>Ai using code to enhance themselves
This is so fucking stupid. AIs should directly generate opcodes, there's absolutely no reason to go through intermediate levels.
>>
>>61005408
why not use a seemingly atomic high level action if the high level action is what it desires to do, like sort a list?
>>
>>61005447
Why would they need to write array.sort() and then have a compiler/interpreter translate it to opcodes instead of directly generating the opcodes for the sort?
>>
File: IMG_9015.png (70KB, 275x224px) Image search: [Google]
IMG_9015.png
70KB, 275x224px
>finally figure out how to reverse a string
>used a while loop
>felt nice for a moment
>online course shows how to do it in 2 lines

IM NOT GONNA MAKE IT
>>
>>61005452
the same reason you do not plan your shopping trip to the store footstep by footstep but rather in larger units?
>>
>>61005453
What you did is probably what happens behind the scenes when the course's two lines are use. You probably have a deeper understanding of programming now. Be happy.

>>61005467
Your analogy is kinda shit, even though I understand what you mean and I think you are wrong. It's inefficient as fuck for me to plan each footstep, it's efficient as fuck to generate opcodes directly.
>>
>>61005453
>2 lines
Bloated
let s: String = string.chars().rev().collect();
>>
>>60999313
does idris sitll use [Char] for the base String type?
>>
threadly reminder that faggots will go to hell
>>
>>61005510
I mean it is efficient to pick the steps directly too if you know what steps to take.

Even if you have good heuristics, you end up with just too many opcodes, no?
>>
>>61005596
Being buttfucked for eternity by demons isn't really a punishment and demons being degenerate fucks might even enjoy the horde of faggots joining.
>>
File: what.jpg (107KB, 613x533px) Image search: [Google]
what.jpg
107KB, 613x533px
>go through some old code
>position multiplied by a color
>it's not even used for anything
>>
>>61005749
>Not creating documentation
Kys dipshit
>>
File: neand.jpg (34KB, 500x543px) Image search: [Google]
neand.jpg
34KB, 500x543px
I just made my very first pull request

it's a single line

I dont know if I can cope with it getting denied
>>
>>61005453

string[::-1]
>>
>>61005876
I know how you feel anon. I die inside everytime I get the slightest of negative feedbacks and can't think about anything else for days afterwards.
>>
File: shr.jpg (58KB, 640x1136px) Image search: [Google]
shr.jpg
58KB, 640x1136px
>byte is not the same as Byte
>some methods take in a byte[], some take in a Byte[]
>a language that is being worked on since the 90s can't even implicitly cast between the two
holy shit java is absolute trash
>>
>>61006014
oh look it's summer all over again
>>
>>61005510

>it's efficient as fuck to generate opcodes directly
Maybe, but it's not efficient to try and maintain a massive code generator inside of an AI. People who are good at AI shit are not necessarily people who are good at compilers and vice versa. It's easier to operate on a higher level data structure, even just an AST, and then offload the work for turning that into code to some other program.
>>
>>61005510
>it's efficient as fuck to generate opcodes directly.
what the fuck, no it's not, so you program in machine code/assembly then?
>>
>>61005876
>mfw my 700+ lines PR has just been merged after 5 days and 60 comments
>>
an AI programmer would need to "understand" high level concepts like sorting an array, you can't just deal directly with opcodes
>>
Working on a Chip8 emulator. The op codes have all been implemented and I wrote tests for them, but there's still some weird bug that causes some games not to work and I have no idea what it could be.
>>
>>61006065

Anon likely figures that just because a program can be better than a human at generating machine code, that it is necessarily practical to do so.

The reality is that machine learning and compiler optimization are two completely different specializations within computer science, and finding programmers who can fuse the two easily within a computer program is difficult. By comparison, we already have some very efficient compilers that can just be executed by the AI as need be.

Unless you need your own in-house code generator for a particular task, or are implementing your own code generator as a learning exercise, just let LLVM do all of the heavy lifting. That's what it's there for.

>>61006099

You can... you just shouldn't.

>>61006142

GDB is your friend.
>>
https://www.youtube.com/watch?v=Lxbdvo2vFwc

leave it to the priviliged bay area types to virtue signal about things which negatively affect others but not themselves
>>
>>61006529
Wrong thread, wrong board.
>>>/pol/ go back.
>>
>>61006569
t. bay area faggot
>>
>>61006529
Reported.
>>
>>61003870
case 2 is a bit redundant
>>
>>61006599
reported
>>
Any other well recommended book/guide for python like automatetheboringstuff? I'm not aiming to do heavy stuff, just a bit of help/automation at work.
>>
>>61006569
>>61006599
>literal google shills in damage control mode
>>
Anyone else using sqlite for their projects? Mind sharing some beginner books/guides/tutorials?
>>
So I want to figure how a certain program does a certain thing on windows. Source is not available.
How should I proceed and with what tools?
On linux I'd use strace to get a general feel of what's happening and then jump in by disassembling the binary but I'm completely lost when it comes to windows.
>>
>>61007197
I just it a lot, the official doc is pretty good
>>
>>61001671
Exactly, these curry fuckers and their disgusting accent do nothing for anyone.
>>
>>61004934
Only retards have a hard time understanding recursion. The real problem is that C does not perform tail call optimization. Recursion is really wasteful for memory
>>
>>61004891
this
>>
>>61007312
Doesn't gcc have a flag for tail call optimization?
>>
>>61004897
Colemak is supposedly better.
>>
>>61007312
>The real problem is that C does not perform tail call optimization
C does not guarantee TCO, but it is something that an optimising C compiler would do.

>>61007500
I know it happens at -O2, but I'm not sure about -O1. I can't be bothered testing it.
>>
>>61007500
GCC does sometimes, I've found it to be unpredictable
>>
>>61007542
at -O2, -O3 and -Os
>>
>>61007549
In the simple case, I don't see why it wouldn't do it as long as you've made the tail call properly.
I'm not sure about corecursion and whatnot.
>>
class Mixin < Module
def instance(&block)
old = method(:extended)
define_singleton_method(:extended) do |o|
old.call(o)
o.instance_eval(&block)
end
end
end
HasA = Mixin.new do
attr_reader :a
instance {@a = 1}
end
HasB = Mixin.new do
attr_reader :b
instance {@b = 2}
end
HasC = Mixin.new do
def c
return @a + @b if @a && @b
end
end

hurr a durr look u guise i can done a roo bee i'm am so trendy like tendies
>>
>>61007697
>end
They were so close to a comfy language and then they do this shit
>>
>>61004897
>>61007519
nicely meme'd

https://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/

learn proper qwerty, it's good enough, and get a US ANSI layout keyboard mechanical keyboard if you don't have one already

http://keybr.com/

https://www.aliexpress.com/store/product/Tada68-Mechanical-keyboard-gateron-swtich-65-layout-Dye-sub-keycaps-cherry-profils-enjoypbt-keycap-cherry-profile/2230037_32807055607.html
>>
>>61007710
well i mean you can also just
Mixin = Class.new(Module) {
define_method(:instance) {|&block|
old = method(:extended)
define_singleton_method(:extended) {|o|
old.call(o)
o.instance_eval(&block)
}
}
}
HasA = Mixin.new {
attr_reader :a
instance {@a = 1}
}
HasB = Mixin.new {
attr_reader :b
instance {@b = 2}
}
HasC = Mixin.new {
define_method(:c) {
return @a + @b if @a && @b
}
}
>>
>>61005453
Know your libraries
>>
>>61003980
Honestly if you graduated from a top tier ivy in a non-meme major you have nothing to worry about. It's the numale """code artisans""" that will get weeded out anyway.
>>
>>61005876
reminder that it's possible that neanderthals were less socially intelligent than us but still more analytically intelligent and the reason they went extinct and we survived is because we got tired of their shit and killed them for being nerds
>>
>>61007781
not him but two questions
1. is computer science with a field emphasis on game development a meme major?
2. is UCSC top tier enough
>>
>>61007722
>Colemak is bad because there are a few words that feel awkward to type
>so better use QWERTY where every word feels awkward!
Also, images on that site don't load so I don't know what he proposes as the better layout. Colemak is pretty much as good as it can get without messing up crucial shortcuts. There is also QGMLWY, that is slightly better and also doesn't move most important keys, but I noticed it only now. I settled for Colemak as 'good enough' because I have an idea how to pronounce it unlike some other layouts.

http://mkweb.bcgsc.ca/carpalx/?typing_effort

Also, I agree about the keyboard, mechanical one feels much comfier.
>>
>>61007878
1. Yes.
2. No.
You are an unemployable numale code artisan. But given the specific nature of your code artistry, there may still be a chance for you.
You obviously don't know much. But you know how to make games, right? So do it.
If you get really, really lucky, you can make a living selling them independently.
>>
File: 250px-322Numel.png (55KB, 250x250px) Image search: [Google]
250px-322Numel.png
55KB, 250x250px
>>61007781
>numale
>>61007907
>numale

pic related
>>
>>61007894
>phalanges are clearly made to move up and down
>let's design a keyboard layout around reducing up and down movement
>>
>>61006014
>some methods take in a byte[], some take in a Byte[]
Autoboxing, you faggot.
>>
C is poo.
>>
>>61007878
Dude stay away from Game Dev. It's over saturated and it's a fucking miserable field to work in. It can be fun to do independently, and I encourage you to have fun with it, but the classes you'll take in a Game Dev major are fucking fucked. You're better off going heavily into Computer Science with a minor in Mathematics or going into Computer Science with a minor in graphic design or art or something.
>>
File: no.jpg (8KB, 205x246px) Image search: [Google]
no.jpg
8KB, 205x246px
Learning vim
>>
>>61007996
Come on, it's not that bad.
>>
>>61007996
Use emacs
>>
>>61007942
>outlets are clearly made to provide electricity
>let's design a machine around reducing electricity use
>you think this is a bad thing
>>
>>61007996
use nano
>>
>>61008007
>linux freetard neckbeard shit
yes, it's that bad
>>
>>61007996
Don't, once you get used to it you'll never be able to use anything else and life will be terrible.
>>
>>61007969
thanks but it's too late, i'm going into my fourth year
i'd go back and do things differently but i can't afford to, i already live off financial aid as it is and there's no way they'd fund that
>>
>>61008035
>implying linux freetard neckbeards write bad software
lol friend
>>
>>61007942
If horizontal movement is your concern, why would you suggest a layout that was made to be as awkward as possible? Also, phalanges are not the only bones of your hands. And even if you insist on using only them and keeping your wrists perfectly still, the distance between keys is pretty small and I actually prefer to move index fingers horizontally rather than vertically.
>>
File: UtPHDXO.jpg (219KB, 800x727px) Image search: [Google]
UtPHDXO.jpg
219KB, 800x727px
>>61008015
>electricity use is the only thing that matters
>>
>>61008054
your wrists are practically still when touch typing properly dumbshit
>>
>>61008024
This.
>>
>>61008090
I make minimal movements for reaching further keys and horizontal movement.
>>
>>61008052
>what is gimp
>what is blender
>>
File: gameboy3.jpg (30KB, 640x480px) Image search: [Google]
gameboy3.jpg
30KB, 640x480px
>>61008068
>how does i'm install gentoo on original nintendo gameboy
>>
File: 1492980432827.jpg (30KB, 546x640px) Image search: [Google]
1492980432827.jpg
30KB, 546x640px
>>61007996
>tfw used vim for a long time
>never really bothered to learn it properly

Here's what I mostly use:

v - select
V - select line
:s/foo/bar/ - replace line regex
:%s/foo/bar/g - replace in whole document
= - format selected code
% - if you selected a opening / closing element it jumps to the other one
> - intend selected crap
< - do the opposite
gg - top of document
G - bottom of document
$ - end of line
0 - beginning of line
y - copy selected text
p - paste selected text
o - write new line
dd - delete line
d - delete selected crap
u - undo
. - repeat last change
/foo - search for foo
>>
>>61008119
>what is gimp
good software i use often
>what is blender
good software i don't use often
>>
>>61008011
How do I properly emacs? I've been using it for past few months, but still didn't really go deep into it, I only look up stuff I need to do.
>>
>>60999215
my current project
>>
>>61008154
they have horrid user interfaces and they lack functionality compared to the leading commercial software products they compete with. the only redeeming quality is that they're free, but you wouldn't take a cumshot to the face for free unless you're a faggot.
>>
What's a simple graphics/media library for C, I can't get SDL to compile without using c++ and I don't want to deal with some cryptic linking errors
>>
>>61008042
At the very least work on some side projects. Have a portfolio, and for gods sake, when you apply for real jobs, minimize your game dev experience.
>>
>>61008154
Gimp does not werk.
>>
>>61008188
>horrid user interfaces
kek
>lack functionality
kek

>t. brainlet
>>
>>61008218
there is also sfml
opengl is less simple but you'll find more advice on getting it to work if you have any trouble
then there's gtk+ and qt
>>
>>61008155
>use-package + package.el for package management
>learn emacs lisp
>org-mode
>evil-mode if modal editing is your thing
>if you find yourself doing repetitive tasks a lot consider ways to automate
>consult the wiki
That's some general advice. What sort of text editing are you using emacs for?
>>
>>61005537
bloated
string.reverse
>>
File: 397.jpg (63KB, 447x400px) Image search: [Google]
397.jpg
63KB, 447x400px
>>61008228
>Gimp does not werk.
>HE CANNOT EVEN USE THE GIMP
>>
>>61007928
kek
>>
learning WebGL and linear algebra to create my 3d loli eroge
>>
>>61008218
>I can't get SDL to compile without using c++
???
>>
>>61008277
>>
>>61008250
>sfml
totally forgot about this, thanks, way better than the sdl clusterfuck
>>
>>61008260
>only 2 words
>but he uses those 2 words to call a method in a dynamic shitlang
bloated
void reverse(char *string) {
if (!*string) return;
char side, *left = string, *right = string;
while (right[1]) right++;
while (right > left) {
side = *left;
*left = *right;
*right = side;
left++, right--;
}
}
>>
>>61007960
>Autoboxing, you faggot.
we are not denying a justification exists
we are only denying it is good
>>
>>61008346
>Making your own strlen instead of using string.h
Shit code desu fampai.
>>
>>61008313
Stop making excuses and step your shit up.
>>
>>61008218
You fucked up somewhere dude. How are you trying to compile SDL? What OS are you on?
>>
>>61008382
>strlen
there is literally no strlen involved
>>
>>61008404
that's exactly the problem
>>
>>61008346
>side = *left;
>*left = *right;
>*right = side;
Hideous. You should know how to swap two char pointers more efficiently than this. (hint use assembly)
>>
>>61008292
>>61008388
>>61008403
On windows, using codeblocks I link and include everything correctly, compiling with C gives a million cryptic errors, compiling with C++ just works, don't want to deal with that shit
>>
>>61008436
>that's exactly the problem
No it isn't, there's no conceivable use for strlen in this function.
>>
>>61008451
What compiler are you using?
>>
>>61008451
>Using codeblocks
There is your fucking problem, codeblocks is shit.
>>
>>61008451
>don't want to deal with that shit
You don't have a choice.
>>
>>61008404
>>61008459
>while (right[1]) right++;
>Not strlen
You just copy-pasted the code from the internet, didn't you?
>>
>>61008473
what's better?

>>61008469
gcc
>>
>>61008449
>asm
Why not just xorswap?
Pretty sure the compiler would fix this for you anyway.
>>
>>61008495
On Windows your pickings are pretty slim. If a Linux dual boot is out of the question, and your computer is not Windows 10 (WSL isn't too bad), then you'll probably want to stick with Visual Studio. It's pretty shit but it's semi reliable.
>>
>>61008480
No, I wrote it and I still don't see how using strlen would improve the code.
Why would you use strlen to jump to the last non-null character of a string? It puts you just past the last non-null character, you'd have to subtract 1 to get the actual last non-null character.
As it stands, the algorithm to get there is;
>start at the first character
>stop when the next character is null
What you suggest would be:
>copy the pointer
>start at the first character
>stop when the current character is null
>return the distance (copy of pointer goes out of scope)
>subtract 1 from that distance
>advance the original pointer by the result
wow thanks so much more efficient gee
>>
>>61008260
You have to implement it. moron.
reverse = foldl (flip (:)) []
>>
>>61008346
Doesn't work on utf-8 encoded strings.
0/10
>>
>>61008524
>xorswap
holy shit i had no idea this existed
i love it
>>
>>61008538
>don't see how using strlen would improve the code
One word: readability.

Also strlen is often pretty well optimized and faster than your naive implementation, but that's beside the point.
>>
>>61008571
It's not considered good now because reasons. It'd only be good if your one concern was swapping the variables and then be done with it. But that's rarely the case.
As I said a compiler would know better. The temp value makes the intent perfectly clear. (you only have to watch out for non-trivial ctors and dtors the compiler might not understand well enough to get rid of)
>>
>>61008581
>Also strlen is often pretty well optimized and faster than your naive implementation,
how the fuck do you get faster than iterating over the string and stopping when you reach null
there's no bookkeeping data in the string to assist in anything faster, it's literally just an unsorted array and the fastest way to find an element in an unsorted array is linear search
>>
>>61005453
Number of lines is not important
>>
>>61008581
(cont from >>61008632)
never mind i just checked and i get that it's easier on the cpu because it iterates over the string as an array of words
>>
>>61004421
Use the WindowBuilder plugin, if you are using Eclipse. Or a equivalent plugin in NetBeans/IntelliJ;
>>
>>61008581
>strlen
>optimized
How so? The null byte situation seems entirely intractable to avoid going bit by bit if you're to avoid undefined behavior.

I can see you vectroizing it if that's no concern (since accepting the case where your program fails if your string is in the last 4 bytes of memory isn't hard) but I doubt the standard actually allows that.

How do you optimize strlen sempai?
>>
>>61008254
Almost everything I do concerning text editing, I do with Emacs. I only open some trivial config files in Kate. Recently I set it as the default file manager because somehow I thought that was a good idea. I use it for very various languages as I'm in colleague and every semester I learn new languages so I happened to learn how to use package.el (at least to the degree where I can install new modes). For a long time I didn't care enough to check how to indent a region so I manually mashed tab+arrow down until somebody asked me if Emacs couldn't do it. I feel pretty overwhelmed by Emacs config whenever I try to change something to my liking (for example keybinds). I've seen the basics of Racket and Lisp overall, have you got some source of exercises to play around with Emacs lisp? Thanks for the advice.
>>
>>61008703
>accepting the case where your program fails if your string is in the last 4 bytes of memory
Unnecessary, strlen processes by individual chars until the head pointer is word-aligned. If your string is in the last 4 bytes of memory, the string will be over before then.
>>
>>61008703
See >>61008632 . Here's an optimized strlen: http://www.stdlib.net/~colmmacc/strlen.c.html
>>
>>61004421
Are we to assume that you're set on using Java or what?
>>
>>61008703

Check first chunk upto first vectorizeable group of bytes. Check through end, aligning vectorized checks so they never cross memory page.

Optimize it to do so without regard to standard, using compiler hacks / asm directly.

So long as strlen works as intended, the compiler is free to implement it using knowledge that lies outside the standard.

If you want to implement in straight C according to standard you're proper fucked, likely.
>>
>>61008743
see: >>61008664
thanks anyway though
>>
File: AEecM5W.png (4KB, 768x768px) Image search: [Google]
AEecM5W.png
4KB, 768x768px
I have a sacred mission to fulfill.
I must pure-function-ify the whole world.
>>
>>61008706
As far as learning elisp, I found https://learnxinyminutes.com/docs/elisp/ to be a good starting point. From there, I recommend looking at other peoples projects and packages, especially packages you use. The best way to learn code is to read code.
I found that my init.el got a lot simpler once I started using use-package, so I highly recommend installing that. It'll be in the standard emacs distribution soon I believe. I can post my init.el if you'd like to take a look at it, although it is a bit of a mess
One more thing, if you're writing Common Lisp without SLIME or Scheme without Geiser, you're cheating yourself.
>>
File: 1497921949901.png (5KB, 640x300px) Image search: [Google]
1497921949901.png
5KB, 640x300px
>>61008802
mfw all of life is a side effect
>>
>>61008743
Yeah sure. It essentially does the vectroizing (except it relies on the compiler to actually vectorize which I deem a bad idea). But
>>61008733
Accessing outside an array is undefined behavior. Sure most platforms will not have any issues with this. But I find it weird to have a standard library that'd not cover all cases. And I don't see how they would here. They could easily access off heap allocated memory and get a SIGSEGV as I see it.
>until the head pointer is word aligned.
I don't see why at all. Why would it stop there? In particular the implementation above.
>>
File: icon_of_java.gif (168KB, 849x458px) Image search: [Google]
icon_of_java.gif
168KB, 849x458px
>>61008147
>>61008007
How do you have yours set up?
And what do you use it for?

Currently I'm just using it very basic with no plugins which is pretty annoying to write Python code in. Don't know if I shall just get a load of them right away or work my way up from the "bare" version, extending and modifying gradually.

Also about to start on k&r, and I think I need to set it up differently for .py and .c files. Don't know how yet.
>>
>>61008829

nah, it's a pure function over various energy manifolds with a limit determined by the rate of manifold energy level normalization, aka entropy
>>
File: 1496537976970.jpg (88KB, 576x783px) Image search: [Google]
1496537976970.jpg
88KB, 576x783px
>>60999215
>finish assignment perfectly fine
>spend the next 30-50 minutes having to rearrange the strings so that they have the EXACT same spacing/case/words
Automated tests are so fucking annoying, they should really just test that the data is manipulated right, not the fucking strings are exactly identical, FUCK
>>
>>61008869
To be clear I see they align themselves correctly but they rely on memory pages being aligned like that. I haven't heard about any of that.
>>
>>61008958
>To be clear I see they align themselves correctly but they rely on memory pages being aligned like that.
It are not weer
>>
>>61008943
>they should really just test that the data is manipulated right
how the fuck do you propose they do that exactly
>>
>>61008977
idk man, fuck just check the state of variables or something, ignore strings entirely? do i s
>>
>>61008992
TIL strings are not data
>>
>>61008943
>>61008992
Hard to tell what you're actually talking about here.

I would bet money that you're doing something stupid if it took you that long to modify formatting for an automated test designed to verify the integrity of the data.
>>
reminder that lispchan is fat and should stop eating
>>
>>61008992
It's a lot of work to deal with that generally anon. It's not as trivial as 'checking the data'. They don't know what you mean each piece of data is supposed to be. The strings are your way of declaring that. Just format your strings anon.
>>
>>61009022
reminder that schemechan is lispchans cuter younger sister
>>
>>61008992
How would that help? The variables themselves wouldn't change what the outcome is supposed to be.
>>
>>61008821
Thank you sir.
>>
>>61009094
>sir
pajeet detected
>>
>>61008364
>can't even implicitly cast between the two
>we are not denying a justification exists
Yes you are.
>>
>>61009055
>>61009034
>>61009017
Yeah yeah yeah whatever you're right. It shouldn't have taken that long but it's 1am and I'm tired.

Kumpula ski jumping week

Write the names of the participants one at a time; an empty string brings you to the jumping phase.
Participant name: Mikael
Participant name: Mika
Participant name:

The tournament begins!

Write "jump" to jump; otherwise you quit: jump

Round 1

Jumping order:
1. Mikael (0 points)
2. Mika (0 points)

Results of round 1
Mikael
length: 95
judge votes: [15, 11, 10, 14, 14]
Mika
length: 112
judge votes: [14, 12, 18, 18, 17]

Write "jump" to jump; otherwise you quit: jump

Round 2

Jumping order:
1. Mikael (134 points)
2. Mika (161 points)

Results of round 2
Mikael
length: 96
judge votes: [20, 19, 15, 13, 18]
Mika
length: 61
judge votes: [12, 11, 15, 17, 11]

Write "jump" to jump; otherwise you quit: jump

Round 3

Jumping order:
1. Mika (260 points)
2. Mikael (282 points)

Results of round 3
Mika
length: 88
judge votes: [11, 19, 13, 10, 15]
Mikael
length: 63
judge votes: [12, 19, 19, 12, 12]

Write "jump" to jump; otherwise you quit: quit

Thanks!

Tournament results:
Position Name
1 Mikael (388 points)
jump lengths: 95 m, 96 m, 63 m
2 Mika (387 points)
jump lengths: 112 m, 61 m, 88 m[\code]
>>
>>61009287
Looks very annoying to format that yeah.
>>
File: 1494040860199.png (203KB, 386x494px) Image search: [Google]
1494040860199.png
203KB, 386x494px
>recieve simple competency test
>expecting some prebuilt code in which i have to impliment some functionality
>its just a text file with "make [thing]" inside of it
>>
>>61000388
Currently working on a full stack project because the pajeets did it wrong. Pay is comfy too.
>>
>>61009492
Welcome to the real world
>>
File: dpt-41.png (2MB, 3840x2160px) Image search: [Google]
dpt-41.png
2MB, 3840x2160px
ROLLIN.
need to practice c++
>>
I need a program that just puts moveable text on my screen that count up..
like
This much money has been earned -----
and the amount to go up by 50 for as long as i run it
>>
>>61009612
fuck it I got nothing better to do
>>
>>61009668
That sounds boring Imma do Tron instead
>>
>>61009571
ive done one of these types of tests before, but i was essentially given a stub program and told to fill in the blanks and add some features, which made sense to me as a test. make [thing] on the other hand is a real fucking pain in the arse of a test description, because the only other constraint i have is that it has to be in ES 2015 JS and be modular. im not a web developer, so i have very little clue where to even fucking start on this desu.
>>
>>61009694
>not a webdev
>being tested on JS
???
>>
>>61003704
for(int i = 0; i < 11; i++){ std::cout << i << std::endl;  }
>>
>>61009717
i got handed some job spec for a back end dev job by an agency and figured "fuck it, itll be general dev shit and not anything to do with CSS and JS". guess i was wrong.
>>
File: anal beads.webm (61KB, 600x144px) Image search: [Google]
anal beads.webm
61KB, 600x144px
>>61009632
Seriously?

var muhMoney = 0m;
while (true)
{
Write($"\rThis much money has been earned: {muhMoney.ToString("C").PadLeft(6)}");
System.Threading.Thread.Sleep(500);
muhMoney += 50;
}
>>
>>61009747
You know how /g/ shits on anyone who tries to learn about webdev? This is the result. CSS and JS and HTML are big fucking messes but they're really important. They're not pleasant and they're not pretty but they're very necessary. Hopefully some CS student will see thing and will pull her head out of her ass and take an afternoon and familiarize herself with the fundamentals of web development
>>
File: poointheloo2.jpg (47KB, 475x767px) Image search: [Google]
poointheloo2.jpg
47KB, 475x767px
Why is this a thing?
>>
File: 1483778792411.jpg (15KB, 480x431px) Image search: [Google]
1483778792411.jpg
15KB, 480x431px
>>61009796
my nigga
/spoiler/what do I use to run it...?/spoiler/
>>
>>61009804
Indians? Or people who submit stupid fucking PR's on shithub?
>>
>>61009804
>having a type named long long
wtf, c is the trash of all trashes.
>>
>>61009804
>>61008876
>>
>>61009816
That is C#
>>
>>60999329
I want to make a window manager with Haskell-chan.
>>
>>61009816
Holy shit, you have to go back to wherever you came from.

Stupid image, failed spoiler tags even if they did work on /g/, and lastly can't program the most basic shit.

Read a book on literally any programming language and lurk more before you post.

I used C#, but any language would do this easily.
>>
>>61009797
thing is web dev is a discipline unto itself, just like game dev, AI, or application dev, and to me AI was just far more interesting than any of the others, and application dev seemed to be more practical than web dev.

>>61009804
what the fuck are you doing making commits to linux if you dont know basic fucking types?
>>
I can't get into programming because I can't choose what language I should stick with so I will use C++ until I can create whatever the fuck I want with it.
>>
File: 1493768512517.gif (2MB, 360x360px) Image search: [Google]
1493768512517.gif
2MB, 360x360px
>>61009833
Thanks senpai
>>61009859
>implying I didn't know that already
>implying I just wanted something real quick and don't have time to make it myself
[spoiler]don't be mean senpai[/spoiler]
>>
>>61009878
>starting with c++
Don't do this, you'd be better off starting with just C if you really want to go that route, c++ has a shit ton going on that will confuse you. C is at least very basic.
>>
>>61009861
>thing is web dev is a discipline unto itself, just like game dev, AI, or application dev, and to me AI was just far more interesting than any of the others, and application dev seemed to be more practical than web dev.
I definitely get you there, I feel the same way. However, way too many people overspecialize, and are then completely unemployable. Everyone thinks they should learn one language and stick with it.

>>61009878
The correct language is always the one that fits the problem domain. You should try and learn at minimum
>C (it's used in everything)
>Shell (PS on windows, bash on Unix)
>A scripting language like perl, ruby, python, for easy automation/embedding
>A functional language like Haskell, Idris, Kotlin or F# (passing familiarity is needed)
>A Lisp-like language (Common Lisp, Scheme, Clojure)
>An OOP mainstream language (Java, Idiomatic C++, C#)
>>
>>61009878
yes stick with C++. don't pussy out by switching to an easier but shittier language. to learn everything properly while wasting as little time as possible i suggest following a proper book and not just online examples/tutorials.

https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
>>
>>61009954
ive dipped my toes in a bunch of shit, but not web dev.

i can peice together sort of a basic structure of how i would solve the problem, but i dont even know how the fuck im going to write or run this thing. on python or something it would be no problem, but im just not familliar with this kind of thing.

do you know of any good resources for a person who can already write OOP software easily enough to get up to speed with EC6 and moduar JS?
>>
>>61009940
I'm not actually starting. I'm continuing there where I left. I already know concepts like OOP etc.
>>
>>61010026
My experience with JS has been mostly cobbled together from a lot of different sources. I've made a few sites for work and they're kinda "frankensites".
Could you be a bit more explicit about what the program has to do?
>>
>>61009940

This. The only good thing I can say about C is that it's a very pure language.
>>
>>61009612
roll
>>
>>61010084
it's fucking disgusting mate
>>
>>61010126
I never said it was pretty.
>>
https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html
>D Language accepted for inclusion in GCC
I'm confused, does this mean D isn't dead?
>Currently the main GCC distribution contains front ends for C (gcc), C++ (g++), Objective C, Fortran, Ada (GNAT), and Go.
>Objective C, Fortran, Ada
Oh, nevermind.
>>
>>61010197
There's a renewed push to shill D right now in the hopes that it can strangle Rust in the crib
>>
>>61010232

Not happening until noGC is practical.
>>
>>61010244
It already is. Look up "Better C mode."
>>
>>61010232
I've noticed that too, looks like (((they))) are really afraid of Rust.
>>
>>61010265
>looks like (((they))) are really afraid of Rust
You're a little confused. The Islamic Deep State is in favor of Rust because it helps in their plan to colonize the dark side of Earth with a drone army.
>>
>>60999215
taking >your job(s) !
>>
>>61010071
its a simple little game. i just need a good source to learn about EC6 JS and the process of writing modular JS that isnt written for a total novice.
>>
>>61010265
lol at best Dtards are afraid of rust, you're deluded if you think C++gods see rust as a threat, rust is just incredibly shit on so many levels, just because you try to market it as a C++ replacement or as a "safer" C++ doesn't make it true
>>
File: andrei.jpg (41KB, 512x512px) Image search: [Google]
andrei.jpg
41KB, 512x512px
>>61010352
Then who's running the cover op to shill for D and spread FUD about Rust?
Is that our Romanian overlords?
>>
>>61005876
i did a one character pull request today :D
merged ofc
>>
>>61009901
>don't have time to make it myself
Who are you trying to fool?
>>
>>61009816
>>61009901
/v/ tourists need to leave this board alone
>>
>>61010433
>rust is just incredibly shit on so many levels
What's shit about it?
>>
>>61010712
fn main() {
main()
}

thread 'main' has overflowed its stack
fatal runtime error: stack overflow


WTF, i hate Rust now
>>
>>61010712
many things

the gay iterator crap and unwrap and shit

good luck replacing C++ when you don't even have a traditional style for loop
>>
>>61010756

a traditional for loop is nothing more than a while loop with some minor scoping differences
>>
and basic things like the syntax

i don't want to read "fn" (eff enn), if you want something more minimalist than void how about \ or someshit

>>61010771
using a while loop in place of a for loop is some python-level disgusting shit
>>
>>61010756
Why have c-style for loops when you have macros: http://huonw.github.io/cfor/cfor/
>>
>>61010756
> the gay iterator crap
What do you have against Rust's iterators? They're pleasant to use and produce tight and fast code.
>>
>>61010803
>They're pleasant to use and produce tight and fast code.
do you even believe this yourself

do you believe other people believe it
>>
>>61010735
>Endless recursion causes stack overflows
Whew, what a surprise. And no, I don't see the lack of TCO as something that makes Rust shit, I thought we were talking about language design, not language implementation.

>>61010756
I'll admit unwrapping everything is kinda irritating, but I'm not bothered by the lack of traditional for loops. I don't know enough about Rust to tell whether you're right about the rest.
>>
>>61010831
Yes? I've been using Rust for my personal projects for many months now and I like writing long iterator chains knowing they'll result in a tight loop. They're way more handy than anything C++ I use at work has to offer.
>>
File: 061.jpg (38KB, 600x600px) Image search: [Google]
061.jpg
38KB, 600x600px
>>61010912
>>
File: IMG_2050.png (794KB, 640x1136px) Image search: [Google]
IMG_2050.png
794KB, 640x1136px
>jeets can't even simple webdev
>ec6
>my fucking sides
>>
>Search for a mistake for an hour
>Forgot that 0x11 != 00000011 Binary
Fugg debugging without printf is hell
>>
Trying to re install netbeans on a new computer (windows)
I forgot the compiler I used, but it wasn't cygwin I believe
Think it had a 2 in it.
You guys told me to get it last time. Plz help
>>
>>61011301
Also its C++
>>
>>61011157
>Debugging without printf
Man. You people still don't use debuggers? Are Linux debugging that horrible that people prefer printf? Why don't someone get on improving that?
>>
>>61010842
>stack overflow
Why should it? There's no reason to. Especially not in this case.
>>
>use a language
>do an infinite recursion that doesn't dynamically allocate anything
>"out of heap space"
>what the fuck
>>
>>61011338
I debug using leds
Truly the patrician way
>>
>>61011415
show details
>>
>>61011301
>>61011322
use eclipse
>>
>train your NN that does word prediction on your 4chan posts
>"Is a good example of how to use the smart pointers in C though to make sure you are not the only one who can make it inline massive amounts of arguing."
It's retarded. I'll have to kill it now.
>>
>>61011301
Found it, it was mysys2, all g boys
>>
File: magic.jpg (82KB, 720x479px) Image search: [Google]
magic.jpg
82KB, 720x479px
>>61008147
You will probably will like to learn, that dd actually cuts a line, which you can later paste with p. Same with normal d.
Another nice mode is block selection mode, ^v (Ctrl-V). From there you can use commands like:
I - insert in front of selected block, on each line
A - append after selected block, on each line
$A - select to the last column and append at the end of each line
You will start to like vim much more, once you learn more movement commands, and learn how to combine them with action commands. E.g.
d$ - delete (cut) from this place to the end of line
dw - delete to the beginning of next word
de - delete to the end of current word
2dw (or d2w) - delete two words
== - format line
=G - format to the end of file
gg=G - format whole file
va{ va} - select whole {} block
vi{ vi} - select whole {} block content
v2a{ - select whole block and its parent block
Something more advanced:
1. va{d - cut the {} block
2. mx - create a mark x for current cursor position
3. Move around the file to another block
4. va{p - select and replace the {} block
5. `x - jump to the exact position of our mark
6. P - paste in place of cursor
7. ???
8. You just swapped two {} blocks of code. In two lines:
va{dmx
va{p`xP
This is the true power of vim.
>>
>>61011025
web dev aint my thing man, i dont know shit about it beyond knocking up basic pages
>>
type* name
type *name

Which one?
>>
>>61012091
type name
>>
>>61012106
> hiding pointers in a typedef

You fucking disgusting piece of shit.
>>
>>61012091
The first because you dont have to backtrack to read
>type pointer named X
vs
>type X pointer

Especially if you move on to D where pointer semantics are different.
>>
>>61012091
enlightened centrist reporting in
type * name
>>
>>61012131
>typedef
>>
>>61012091

type *name
better reflects how the syntax of C and C++ but is illogical, especially when you initialize at the same time.
>>
>>61012163
kek
>>
>>61012163
type

*
name
>>
>>61012314
type    *
name;

>>
>>61012091
type* name if single variable declaration
>>
typedef int *int_ptr;
const int_ptr p = &42;
>>
>>61012167
>macro
Even worse.
>>
>>61012350
#define TYPE type
#define STAR *
#define NAME name
#define DECL TYPE STAR NAME

DECL
>>
>>61012391
missing ;
>>
>>61012399
see >>61012314
>>61012213
>>61012163
>>61012106
>>61012091
>>
>>61012391
>not even DECL(NAME)
>>
>>61011338
Usually less of a hassle to use printf debugging tbqh fampai
>>
New thread? I am too lazy.
>>
new thread when? :3
>>
>watching parts of handmade hero
>that microsoft C dialect
what the fuck
>>
New thread!

>>61012570
>>61012570
>>61012570
>>61012570
>>61012570
>>
>>61012578
Yeah Microsoft is pretty awful. Makes more sense to use GLFW than make your own platform layer.
>>
>>61011506
That's pretty much /g/ in a nutshell
>>
python is great
>>
and it gets things done
Thread posts: 329
Thread images: 44


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