Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

/vt/ is now archived.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 87 KB, 960x762, m18U31V7G3KRGT4jjOpvjD1vwdnNzq5pB5XmjnI5gWQ.jpg [View same] [iqdb] [saucenao] [google] [report]
67089208 No.67089208 [Reply] [Original] [archived.moe] [rbt]

What are you working on?
Previous: >>67081854

>> No.67089239

>>67089208
>error handling
Pass it to the logger service and show it to the user in a messagebox.

>> No.67089245

>>67089208
i'm working on a crypto trading bot that uses machine learning (in node.js)

btw anime and monads are trash

>> No.67089249

JavaScript
> ["10", "10", "10"].map(parseInt)
Array(3) [ 10, NaN, 2 ]

>> No.67089254

A language designed around the methodology of writing functional specifications and refining them to imperative programs.

>> No.67089257

>>67089254
rust

>> No.67089278

>>67089254
ADA

>> No.67089280

>>67089257
Not with panic

>> No.67089292

>>67089257
>>67089278
"No!"

>> No.67089293

>>67089249
not even gonna try to figure that one out but here's the correct way to do it

["10", "10", "10"].map(x => parseInt(x))

>> No.67089300

>>67089254
F*

>> No.67089307

friendly reminder map is not traverse

>> No.67089321

>>67089254
Idris

>> No.67089322

>>67089293
>no eta-conversion in JavaScript
Quelle surprise.

>> No.67089323

>>67089249
Why

>> No.67089324

>>67089307
(but traverse can be map)

>> No.67089333

>>67089307
it's just a map that takes an applicative function and range.
wow how revolutionary.

>> No.67089340

>>67089307
>>67089324
I don't understand why OOPsies get so upset by traverse and desperately claim it's just map. Actually maybe it's because their favorite languages can sort of implement the latter but not the former.

>> No.67089343

>>67089322
>>67089323
The actual issue is that ParseInt takes two arguments.

>> No.67089345
File: 72 KB, 1241x1010, DdM5PONWAAAEc7W.jpg [View same] [iqdb] [saucenao] [google] [report]
67089345

>>67089340
They don't understand. Look at this brainlet >>67089333
>s-surely I can't be wrong again?

>> No.67089351

whats the difference between using CMake and a random C++ IDE (like CLion)?

>> No.67089360

>>67089333
That's incorrect, though.

>> No.67089365

>>67089345
then prove me wrong.
hint: posting a brainlet image with my post number is not.
>>67089360
why?

>> No.67089369

>>67089254
https://en.wikipedia.org/wiki/TLA%2B

>> No.67089375

>>67089345
How are we ever going to get them up to speed on something like lenses if they're still struggling with traverse, of all things?

>> No.67089388
File: 14 KB, 211x119, test.jpg [View same] [iqdb] [saucenao] [google] [report]
67089388

>> No.67089393

>>67089365
Your characterization of it does not match its type.

>> No.67089408

>>67089393
give me an example of traverse that does not match: mapping an applicative to a range and getting the new range.

>> No.67089419

>>67089388
>js

here is your problem

>> No.67089421

Frankly I think you're all gay

>> No.67089423

>>67089388
~~”0”
And just works

>> No.67089449
File: 8 KB, 320x156, Capture.png [View same] [iqdb] [saucenao] [google] [report]
67089449

>>67089388

>> No.67089498

Anyone here familiar with GCC internals?
How the FUCK do I force the linker to align sections to a 4096 byte boundary without using a custom linker script or defining it in the source of the program being compiled?

>> No.67089534
File: 50 KB, 287x285, dicks.png [View same] [iqdb] [saucenao] [google] [report]
67089534

>update pull request
>CI jobs screwing up at apt-get steps randomly
>hideous gay nigger in your face to mock you

>> No.67089535

>>67089408
traverse Const (3, "foo")

>> No.67089539

>>67089419
It's the same in C, !"0" == false.

>> No.67089546

>>67089535
why would you ever do that

>> No.67089558

>>67089539
js> 0 == "0"
true
js>

>> No.67089569

>>67089539
>he didn't it

>> No.67089571

>>67089546
using traverse as fold

>> No.67089576

Why does Haskell generate such huge binaries?
"Hello world" becomes a whopping 1.2 MB.

>> No.67089580

>>67089571
or you know just use fold.

>> No.67089581

>>67089580
use the lens library

>> No.67089582

>>67089249
read the spec
Array(3).fill("10").map(Number)

>> No.67089588

>>67089576
Statically linking the entire standard library. If there wasn't already libc in the OS, C programs would be huge as well.

>> No.67089596

Managed to get the feature I've been working all this week to work correctly. Did the commit&deploy&run. Still got shitloads of unit and integration tests to write.

>> No.67089612

>>67089588
Ah, static linking by default, I see. Why doesn't ghc use dynamic linking by default like gcc and clang do?

>> No.67089618

Daily reminder to read an follow https://wiki.sei.cmu.edu/confluence/display/c/SEI+CERT+C+Coding+Standard .

>> No.67089619

>>67089581
These people don't even understand traverse, they'd have no chance with lens

>> No.67089622

>>67089612
Because dynamic linking sucks.

>> No.67089626

>>67089612
Because that would make deplyment too complicated, for some reason most OSes don't include Haskell's standard library in the base system.

>> No.67089627

>>67089588
are unused symbols still in the binary if you link statically?

>> No.67089632

>>67089618
Daily reminder that most programmers use languages that, while shit, aren't so disastrous that they blow up like C does if you look at it wrong

>> No.67089636

I love weakest preconditions!

>> No.67089637
File: 2.17 MB, 1000x1678, sicp_nazrin_small.png [View same] [iqdb] [saucenao] [google] [report]
67089637

>>67089208
Have you ever used Godot Engine? Would you say it's worth learning?

>> No.67089640

>>67089627
Yes, the linking works on library basis, not per function. There is an option to compile each function into a separate object file so it would link only required function, I don't remember the name of the option, and it make compiling too slow.

>> No.67089647

Oh no, nononono.
I know what's happening. This happened with a lot of boards before. First, people with transphobia come. They acknowledge the existance of trans people and tell them to fuck off. Then the trans people come and start shitposting their trannyshit all over this board. The transphobian people shortly fuck off, saying "oh this board went to shit", without realizing that they started this shit. Slowly /g/ won't be about technology anymore and the board dies out.

Please. stop. this.
Ignore trannies, don't acknowledge their existance. They are NOT here.
Most of them are larpers. You don't give them a (You), you just let their threads die.
/g/, please.

>> No.67089664

currently working on a GUI interface using Visual Basic to see if i can track an IP adress.

>inb4 comments saying this doesnt make sense
>fuggin sherlock

>> No.67089665

>>67089632
The benefits of the way C is designed will always outweigh the costs, as long as we don't write bad code.

>> No.67089674

>>67089647
Go back to your "safe space", bigot

>> No.67089675
File: 324 KB, 466x510, 1530068994244.png [View same] [iqdb] [saucenao] [google] [report]
67089675

@67089664

>> No.67089680

>>67089675

>be me
>be new to 4chan
>see any post i dont understand
>think im funny
>tag someone with an @
>hit post

>at this point honestly just kys

>> No.67089688

Even parrots and dolphins can understand traverse, what's your excuse?

>> No.67089693

>>67089245
Why in the world would you implement Machine Learning in NodeJS?

>> No.67089696

Is Discord botnet?
>>>/qa/2238569

>> No.67089703

>>67089693
Webdevs refuse to learn any other language

>> No.67089708

>>67089703
I'm a webdev by trade and I'm learning C right now. We're not all faggots.

>> No.67089710

>>67089696
>proprietary software
What do you think?

>> No.67089711
File: 117 KB, 1058x705, 1386460907430.jpg [View same] [iqdb] [saucenao] [google] [report]
67089711

This actually works!


let kek;
export default {
query: (text, params) => pool.query(text, params),

queryFirst: async (text, params) => (([kek = null] = (await pool.query(text,params)).rows), kek),


>mfw webstorm actually warns me that my code is "overly clever"

>> No.67089732

>>67089696
Naturally, it's written in Rust
https://twitter.com/ManishEarth/status/1027676698068713473

>> No.67089752

>>67089732
discord != new and shiny game store that will inevitably fail along with the whole company when the investors pull out

>> No.67089753

>>67089647
Literally MtF outside prostitution get jobs as programmers.

/g/ will had more MtF that women.

>> No.67089763

>>67089753
I'm a professional linguist and polyglot but I'm still too hung over to figure out what fucking language you're speaking

>> No.67089767 [DELETED] 

>>67089763
A bunch of people are upset that programming isn't a safe space for bigots. That anon is kinda telling them to deal with it.

>> No.67089793

>>67089752
dont need investors when you can sell so much info from dumbfucks like >>67089696

>> No.67089816

Is techno the GOAT music genre for programming?

https://www.youtube.com/watch?v=t62Rty9yCoY

>> No.67089828 [DELETED] 

>>67089763
In contex of trans people it might mean Male to Female I suppose.

>> No.67089835

>>67089816
i like minimal/deep house myself.
or the occasional S Y N T H W A V E bullshit.

>> No.67089839

>>67089763
>>67089828
so it basically means faggots?

>> No.67089874

>>67089816
https://www.youtube.com/watch?v=xDwGAJ4FnA8

>> No.67089879

>>67089249
>>67089293
ParseInt takes two arguments, the second being a radix.
Map provides three arguments, the element, the index, and the collection.
The index feeds into the radix producing this behavior.

>>67089388
Non-zero numbers are truthy
Non-empty strings are truthy

>>67089423
Bitwise not does a type coercion to number, then another bitwise not inverts the bits again. Doing +"0" or Number("0") is cleaner.

>>67089449
Multiplication does a type coercion to number. Number * 0 = 0

>>67089539
"0" is a const char pointer to a non null location. !"0" is null, which is 0, and false is 0
If you instead did !'\0', that would be a char of value 0, not would make it 1, and it is true since true is 1

>>67089558
"0" is type coerced to 0, 0 == 0 is true

>>67089680
>Doesn't know @num is a meme to backlink without giving them a (You)
>Calls someone else a newfag
Here's a (You) for making me respond

>> No.67089888
File: 64 KB, 732x742, 1531001866647.jpg [View same] [iqdb] [saucenao] [google] [report]
67089888

Why would you do computation on a GPU? Isn't that what CPUs are for?

>> No.67089895

>>67089888
CPU - several, complex cores
GPU - orders of magnitude more, simpler cores

>> No.67089908

>>67089888
Would you like to have 2000 cores instead of 4? You can, just not for every kind of tasks.

>> No.67089913

>>67089888
cpus and gpus are good at different kinds of processing
any kind of algorithm that's gonna involve a lot of branching, you're going to want to run on a CPU

>> No.67089915

>>67089816
You misspoke dark ambient.

>> No.67089918

>>67089879
>Non-zero numbers are truthy
>Non-empty strings are truthy

var zero_int = 0;
var zero_str = "0"

zero_int == false
zero_str == true
zero_int == zero_str


true == false?

>> No.67089922 [DELETED] 
File: 265 KB, 450x450, 1531436291783.png [View same] [iqdb] [saucenao] [google] [report]
67089922

>>67089816
>Not anime music
Pic related, me when listening to anime music, wearing my programming kneesocks and stimulating my boipussy while programming.

>> No.67089925

>>67089908
TIL GPUs are good for doing many web requests

>> No.67089929

>>67089925
>just not for every kind of tasks.

>> No.67089938

>>67089929
>not wanting 2000 cores, one for each request

>> No.67089949

>>67089938
That's just pointless because web requests spend most of their time idle anyways.

>> No.67090016

wow... no one told me programming was 90% writing makefiles and trying to install libraries

>> No.67090060

>>67090016
In Rust it's just
[dependencies]
library = "1.0"

>> No.67090077
File: 563 KB, 819x716, 1530663049712.png [View same] [iqdb] [saucenao] [google] [report]
67090077

>>67090060
ahaha.... you think i'm some kind of rust noob? i'm a 1337 c++ programmer...

(just fucking kill me)

>> No.67090087

>>67090016
use a language with a package manager that most likely can also function as its builder
c/++ & make are absolute trash.

>> No.67090092

>>67090016
this is exactly what I'm doing right now

>> No.67090104

>>67089388
are you retarded?
this is like the same in almost every language

0 == false
"asdad" == true

>> No.67090112

>>67089918
0 == false -> false == false -> true
"0" == true -> true == true -> true
0 == "0" -> 0 == 0 -> true
If you can't understand type coercion, then use the triple equals. It's not really that hard. C++'s type coercion is many times more complex.

>> No.67090117
File: 418 KB, 768x768, 1496146372667.jpg [View same] [iqdb] [saucenao] [google] [report]
67090117

>>67089208
>What are you working on?
I'm new to programming and I'm currently learning Python, just finished the chapter on dictionaries.

I'm planning on going to Uni next year to do compsci because I'm really enjoying this, but I'm feeling overwhelmed, there's so much shit to learn and I'm late to it at 25.

>> No.67090131

>>67089703
I went to the web dev thread to ask about C++ for back end development and what I can use for front end to be displayed to the user and general concepts for handling it, and I was told to fuck off and learn webGL/JavaScript. Not all are gigantic faggots, but I'm inclined to believe most are.

>> No.67090142

>>67090131
You are forgetting something very important (the website you're on)

>> No.67090175

>>67090131
why the holy fuck would you attempt to use C++ as a backend for a webserver? Are you retarded or have shit tons of time on your hands

>> No.67090255

>>67089693
library availability

>> No.67090296

>get multiple software dev offers
>grilled by multiple senior devs at one
>they offer me the 6 hours later
>take one offer because it dealt with an interest of mine
>drive 10 hours to live there
>turns out its an IT job

>> No.67090303

>>67090112
Thats just not how math works. When X and Y are equal to each other, and Y is equal to Z, you expect X to also be equal to Z.

Also, JS is cancer in general
js> x=[0]

js> x==x
true

js> x==!x
true

>> No.67090314

>>67090296
what was the interest?
Also you didn't ask what the job would entail?
that's the first thing you ask when they ask if you have any questions.

>> No.67090333

Imagine if web browsers ran Scheme or ML instead of JavaScript

>> No.67090336

>js

js> Array(5)==",,,,"
true


js> NaN==NaN
false


js> typeof null
"object"
js> null instanceof Object
false


js> 0.1+0.2==0.3
false
js> 0.1+0.2
0.30000000000000004


js> Math.max()>Math.min()
false
js> Math.max()<Math.min()
true

>> No.67090346

Reminder that only anime /dpt/ are canon.

>> No.67090348

>>67090333
imagine if web browsers ran Idris instead of shitlangs that can't enforce totality.

>> No.67090349

>>67090333
Then those languages would become riddled with shit features due to the kind of tards who do web dev. Sounds great...

>> No.67090363

>>67090348
Idris didn't exist back in the browser wars

>> No.67090374

>>67090348
Write a web browser in Idris, then we'll talk

>> No.67090381

>>67090363
nothings stopping someone from writing one now. Especially considering Idris can compile to JS.
>>67090374
if only i cared enough to waste my life with webshit, i would.

>> No.67090396

>>67090381
>Especially considering Idris can compile to JS.
Nonono, we want the target language to not be JS

>> No.67090401

>>67090396
well i meant it has easy interop with existing projects. Then again, there's also WASM.

>> No.67090408

>>67090336
But strong types are impractical, amirite?

>> No.67090422

>>67090296
What was the job?

The same thing happened to me with a bait and switch. The offer was for a software developer position but ended up being technical support. I'd take it if it were actually in my city since any job experience is good experience + money. There's like 50 other technical support positions open in my city that wouldn't require me to move though.

>> No.67090434

#include <memory>
#include <iostream>
#include <utility>

using UptrInt = std::unique_ptr<int>;

class Foo{
public:
Foo(UptrInt& i) : foo_value(std::move(i)){ std::cout << "lvalue\n"; }
Foo(UptrInt&& i) : Foo(i){ std::cout << "rvalue\n"; }

int value() const { if(foo_value)return *foo_value; }
private:
UptrInt foo_value;
};

UptrInt get_int_ptr(int x)
{
return std::make_unique<int>(x);
}

int main()
{
auto x = std::make_unique<int>(7);
Foo f(x);
Foo f1(std::move(x));
Foo f2(get_int_ptr(8));
std::cout << f2.value() << std::endl;
}


Is this use of ctor delegation legal and correct?

>> No.67090473

If Idris is so great, why are there no operating systems written in Idris? Why are there no games written in Idris? Checkmate, Idrists (like "autists")

>> No.67090477

fmap has nothing to do with collections

>> No.67090487

>>67090473
There are games written in Idris, though.

>> No.67090512

>>67090487
I literally can't find a single example

>> No.67090529

>>67090434
looks correct to me

>> No.67090536

>>67090336
>life without types

>> No.67090552

>>67090512
Check out Edwin Brady's talk at Scala World, he shows hangman and invaders

>> No.67090557

>>67090512
>>67090552
https://github.com/idris-hackers/idris-demos

>> No.67090576

>>67090557
I take it all back, Idris is the future.

>> No.67090586

>>67090576
shitposting or not compile time type checked state machines is fucking huge for games. After my main project i hope to write a game in idris.

>> No.67090591
File: 1.38 MB, 2687x2319, 1530801626003.jpg [View same] [iqdb] [saucenao] [google] [report]
67090591

>>67090552
>>67090557
>hangman and invaders
Alright granddads, I meant something with more than 15 minutes of gameplay

>> No.67090607

>>67090591
You asked for games, you got games. So ungrateful.

>> No.67090610

>>67090314
deals with manufacturing military hardware. I had another offer from this company where I got a hotel and a rental car for the interview. The next day I phone interviewed with the IT place, I thought it was the same type of software dev I just interviewed for. I asked about programming, just not enough, silly mistake.

>>67090422
the job now is overseeing some middleware bullshit where all I do is debug errors. The other offers were systems integration and a real-time systems developer role. I'm so happy the city im in is growing in the tech space, and I know a few people from big companies in the area.

>> No.67090612

>>67090591
>no i meant a polished game
>no i meant a REAL game
>no i meant a game that's on steam
>no i meant a game by a AAA company that's sold X units
"no"

>> No.67090622

>>67090607
>Back in my day, we took what we were given and were grateful for it
https://github.com/eckart/gl-idris
Code me up something epic or I'll tell mom you're cheating on her

>> No.67090631

>>67089351
Ones an IDE and ones a build tool? They are entirely different things.

>> No.67090646

>>67089208
I am going to make it.
I am going to make everything right.
I am going to complete my game.
I am going to get six packs.
I am going to invest in long term goals.
/vg, /fit, /g, /biz ftw

>> No.67090648

Survey time:
>Most used langs (3 max but you can post fewer if you want)
>OS (and distro, if applicable)
>Text editor or IDE

>> No.67090656

>>67090646
>/vg, /fit/, /g/, /biz
I fucking hate Redditors

>> No.67090657

>>67090648
C#
Windows 10
Visual studio, VS code

>> No.67090667

>>67090648
C++, Rust
Arch
Spacemacs

>> No.67090669

>>67090648
shell, C, XSLT
Debian
vim

>> No.67090681

>>67090648
>Common Lisp, GNU Guile, Emacs Lisp
>GuixSD
>GNU Emacs

>> No.67090706

>>67090648
C, C# and ruby
Win10 and Debian stretch
VS, VSCode and vim

>> No.67090725

>>67090648
>Haskell
>MacOS
>Vim

Seeing it like this: I'm the real hipster :^)

>> No.67090727

>>67090681
Hi, rms.

>> No.67090738

>>67090725
>I'm the real hipster :^)
that's literally the "look how hipster i am" starterpack m8

>> No.67090750

>>67090648
>Python, C++, Rust
>Linux Mint
> VS Code

>> No.67090753
File: 595 KB, 734x708, 1484676488604.png [View same] [iqdb] [saucenao] [google] [report]
67090753

>>67090648
Haskell, Rust, (atm using Agda, learning)
ArchLabs and Win10 (on separate machines)
Emacs and VSC

>> No.67090755

>>67090648
Haskell
OSX

>> No.67090760

>>67090753
k Welp

>> No.67090763

>>67090648
racket, c
windows 7, debian linux
vim

>> No.67090773

>>67090760
*sweats*

>> No.67090776

>>67090725
swastika via gloss?

>> No.67090780

>>67090648
C, C++, Common Lisp
Gentoo
Emacs

>> No.67090815

>>67090648
racket and some C#
mint
vs code

>> No.67090867

First year CS students can understand traverse. What's your excuse?

>> No.67090878

>>67090776
>question mark
>implying haskeleltards are hard to spot

>> No.67090886

I applied to iOS position and i dont even have a mac. Guy replied to me saying he saw my github, and he asked about my knowledge on A&DS, cryptography, unix skills, design patterns because i need strong foundation in this for job. He also said it would be nice to see my grades (!). I am freshmen with 3 exams to pass yet in september, and Cs from rest of subjects. What the fuck am i supposed to do? Am i that much of a brainlet that entry-level jobs are not for me. I failed quite rigourus prove-driven calculus course - i cant be fucking programmer?

>> No.67090887

>>67090867
>traverse
That's quite general. Did you just get out of a first year CS class and decide to shitpost on /g/ with some of the random words you heard?

>> No.67090898

>>67090887
traverse a tree my dude

>> No.67090905

>>67090887
Found a traverselet.

>> No.67090941

>>67090898
Is that considered difficult? I thought you were saying something like "there are some CS freshmen who have written compilers", i.e. it's hard but a very small number of young programmers have managed it. I thought tree traversal was covered by ALL freshmen.

>> No.67090960

Hi /dpt/ let's see you exhibit some minor features of your favorite language with fibs. Here's higher-order functions and built-in tests with racket:
#lang racket/base
(define (transpose m)
(apply map list m))

(module+ test
(require rackunit)
(define standard-message
"This is trivial how did you fuck it up?!!?")
(let ((m '((1 2 3) (4 5 6)))
(M '((1 4) (2 5) (3 6))))
(check-equal? (transpose m) M
standard-message)))

(define (identity length)
(define (make-row index)
(for/list ((i (in-range length)))
(if (= i index) 1 0)))
(for/list ((i (in-range length)))
(make-row i)))

(module+ test
(check-equal? (identity 3)
'((1 0 0) (0 1 0) (0 0 1))
standard-message))

(define (matrix* left right)
(define (sum list)
(apply + list))
(map (λ(l)
(map (λ(r)
(sum (map * l r)))
(transpose right)))
left))

(module+ test
(let ((left '((1 2) (3 4)))
(right '((2 3) (5 5)))
(expected '((12 13) (26 29))))
(check-equal? (matrix* left right)
expected
standard-message)))

(define (matrix^ m e)
(cond ((zero? e) (identity (length m)))
((= 1 e) m)
((even? e)
(matrix^ (matrix* m m) (/ e 2)))
(else (matrix* m
(matrix^ (matrix* m m)
(/ (- e 1) 2))))))

(module+ test
(let ((m '((1 2) (3 4)))
(e 5))
(check-equal? (matrix^ m e)
(for/fold ((acc (identity (length m))))
((i (in-range e)))
(matrix* m acc))
standard-message)))

(define (fib* base)
(define (result m)
(caadr m))
(lambda (n)
(cond ((zero? n) 0)
((= 1 n) 1)
(else (result (matrix^ base n))))))

(define fibs (fib* '((1 1) (1 0))))

>> No.67090968

reminder that traverse is literally just an fmap
traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
{-# INLINE traverse #-} -- See Note [Inline default methods]
traverse f = sequenceA . fmap f

>> No.67091004

>>67090336

What's the point of doing this stuff to point out JS is shit? There are many legit reasons why JS is shit but it's not doing non nonsensical operations like comparing function call, smells like a meme.

The 0.1+0.2 one is because of IEEE as well.

>> No.67091017

>>67091004
small problems are usually evident of a much larger one.

>> No.67091037

>>67090968
"literally just an fmap"
Only if you ignore sequenceA (which is equivalent to traverse id) in that snippet, dumbshit.

>> No.67091045

>a fuckton of garbage language extensions are actually a feature
ghc: the bloat

>> No.67091063

What is the minimum I need to learn or do to get a cosy job at FANG or Microsoft? I have a degree but not a CS one.

>> No.67091076

>>67090336
>oxymoron

>> No.67091092

>>67091063

Grind leetcode faggot

>> No.67091187

>>67089708
kudos

>> No.67091219

>>67091063
>cozy
>have to move to commiefornia

>> No.67091224

>>67089626
>for some reason most OSes don't include Haskell's standard library
because it's a memelang

>> No.67091256

>>67090648
C++, Rust
Win10/Fedora
Emacs

>> No.67091270

>>67090648
>Java, Assembler, C
> macOS and z/OS
>eclipse or sublime

i have a real job

>> No.67091280

>>67090648
C++, Python, Haxe
Ubuntu 18.04
Visual Studio Code and Atom

>> No.67091366

>>67090303
If you want strict equality, use the strict equality operator. If you want loose equality, use the loose equality operator. If you understand those two things and you still run into issues, your problem is a lot deeper than the language.

>> No.67091388

>>67091366
loose equality is almost never something you want. The fact that it exists, as the default, is bad design.

>> No.67091412

>>67090336
>>67090408
>>67090536
Intentionally picking cases that either never happen in practice, or are willfully ignorant of how aspects of the language work doesn't make you look like some amazingly woke programmer.

>> No.67091575

>>67091388
Nearly every language has warts but there are situations, albeit limited ones, where you use loose equality. If that is the argument for calling JS bad, it is a pretty weak premise.

>> No.67091653

>>67091575
JS has many such warts and this is just one example. It's death by a thousand cuts, rather like sepples.

>> No.67091686

>>67089208
Yup, algebric data types, applicatives, monads and that stuff does make error handling simpler

>> No.67091718
File: 1.30 MB, 2570x2102, 4L.png [View same] [iqdb] [saucenao] [google] [report]
67091718

Progress continues on my macOS / iOS 4chan client. I am not sure if anyone will use it besides me.

>> No.67091744

>>67091686
how?

>> No.67091752

>>67091718
>nearly half the window taken up by navigation
jesus l2design

>> No.67091758

>>67091718
>mac

>> No.67091895
File: 28 KB, 480x480, Ich.jpg [View same] [iqdb] [saucenao] [google] [report]
67091895

>>67089208
Traceroute Util for golang

>> No.67091948
File: 240 KB, 1800x1200, 1533924846112.jpg [View same] [iqdb] [saucenao] [google] [report]
67091948

I'm working out an idea I have for a weekend project. It'll be a feed to email program. I'm not sure how I should handle configuration though. I can either accept a configuration file or simply read CLI arguments. I'm slightly leaning towards the latter because of the simplicity for me and the end user (also me). I want to start off my program as simple as possible, but with room for additional features.
CLI arguments or configuration file?

>> No.67091971

Programming challenge: implement typesafe traverse in Go

>> No.67091984

>>67091948
CLI arguments that are saved to a config file, it's more streamlined than config files, and you wouldn't need to input everything multiple times, you'd only load your config file you could've gotten from anywhere

>> No.67091987

>>67090077
dumb frogposter

>> No.67091998

>>67090648
rust, c#, python
windows 10
vs/vsc

>> No.67092015

>>67090648
C#, C
Windows 10
Visual Studio

>> No.67092019

>all these windows babies

>> No.67092033

>>67092019
linux sucks dick for desktop

>> No.67092040

>>67092033
not really. It has plenty of just werks DEs

>> No.67092046

>>67092033
you suck dick for free

>> No.67092055

>>67092046
how did you know, anon?

>> No.67092069
File: 43 KB, 514x536, The Ausmos - An Internet Odyssey.jpg [View same] [iqdb] [saucenao] [google] [report]
67092069

>>67089249
>can't into basic lambdas
>blames javascript

>> No.67092102

>>67092069
It's javascript's fault that map passes in three parameters, and extra parameters are implicitly ignored. That's just bad API design.

>> No.67092110

>>67091971
>implement typesafe Foo in nogenerics
lol

>> No.67092119

>>67092110
I'm hoping it will open gophers' eyes

>> No.67092128

>>67091948
read from config file and accept cli args, cli settings overrides file settings if they specify something different. simplest to implement would probably be to have your core program just take cli args and write a little wrapper program/script that reads the config file/cli args and calls the core program. If you make your config file syntax similar to the way cli args are specified and use the same option names, that wrapper is trivial to write

>> No.67092144
File: 2.19 MB, 388x218, 1533778883777.gif [View same] [iqdb] [saucenao] [google] [report]
67092144

>>67092069
>defends javascript even against a shitty argument

>> No.67092152

memes aside is it worth learning rust

>> No.67092161

how can I inline bytecode in C?

>> No.67092193

>>67089208
Does PyGame simplify anything or should I jump straight into "real" graphics libraries? If yes, then which one(s)?

>> No.67092205

>>67092152
Yes, it's a good alternative to C and C++ nowadays.

>> No.67092207

>>67092193
learn SDL and OpenGL asap if you plan on regularly working with graphics

>> No.67092212

>>67092152
memes aside is it worth buying a cuckshed

>> No.67092219

>>67092152
Yeah desu

>> No.67092270

>>67092207
Are they complex? SDL or OpenGL first? Is PyGame really that bad?

I'm not really into making games, just yet.

>> No.67092297

>>67092270
>Are they complex
depends how much you wanna do
you don't need to learn every feature all at once
>SDL or OpenGL first
SDL
>Is PyGame really that bad
never used it, but python is simply not built for heavy lifting and I doubt a library for baby's first gaem is going to give you all the tools you'll ever need

>> No.67092305

>>67092212
t. unemployed c-nile

>> No.67092312
File: 91 KB, 750x938, 1533925993060.jpg [View same] [iqdb] [saucenao] [google] [report]
67092312

>>67091984
>>67092128
Thanks anons.

>> No.67092444

>>67092297
OK, I did check SDL and it has rather poor support in Python, judging by google results. Or is it just my impression?

I'm not a programmer, but learning for CAD and UI/UX stuff. I'm branching out, as I want to move out of the 3rd world country my parents imported me into.

>> No.67092456 [DELETED] 

>>67092444
There are no spoilers on /g/ you fucking mongrel

>> No.67092463

>>67092444
python is not made for games anon. use C++. Python is only good for scripting

>> No.67092471

>>67092444
anon, you'll never make anything of consequence if you plan on only programming in python

>> No.67092486

>>67092161
you can do inline assembly if that's what you mean, syntax depends on compiler I think

>> No.67092499

The emoji skintone selectors being a more common thing in UI development feels like the biggest trap to deal with at every level. As if text processing isn't complicated enough.

>> No.67092571

>>67092102
>and extra parameters are implicitly ignored
That's not how map works, that's how all functions in JS works.
Any function will accept insufficient or extra arguments.
You don't want to fuck up everything on your website just because you're lacking an argument, cause data is dynamic, and you can't really control it.
So you prefer having explicit rest and default arguments for every function you will write. Good luck with that.

Ye, that's definitely better than just read docs and knowing that map passing 3 arguments. Who are reading docs anyway. Shitty language.

>> No.67092576

>>67092463
>>67092471
But I'm not a programmer, I just want to be able to make mock-ups of stuff that programmers should make based on design of mine or others.

I have hard time writing a least common multiple program, not to even think about stuff the fedora wearing programmers make.

>> No.67092597

>>67092576
>, I just want to be able to make mock-ups of stuff that programmers should make based on design of mine or others
you don't need to program to do this
why learn pygame?
what's wrong with explaining with writing or doodles

>> No.67092613

>>67092576
if you're not a programmer then go use some engine like Game Maker Studio

>> No.67092671

>>67090648
JS, Rust, Lua
Arch
JetBrains's IDEs

>> No.67092690

>>67090657
my man, although im also using intellij rider

>> No.67092698

>>67090333

Brendan Eich wanted to use Scheme, but his boss wouldn't have it. They wanted a cheap cash in on being like Java instead.

>> No.67092712

>anon asks about pygame
>just learn opengl, c++ and write your own engine
Why don't you just start from writing your own graphical API? I mean, after you write your own OS, after you write file system, ofc.

>> No.67092718
File: 31 KB, 1313x175, 1507147474941.png [View same] [iqdb] [saucenao] [google] [report]
67092718

Ever write code your proud of not because of retarded shit like elegance, but because you cant balieve it works? pic related is my latest one. I can go home today knowing I did a good job writing

Func<object, bool> predicateCombined = t => t is T && t != null && (!Filters.Any() || Filters.Select(x => x((T)t)).All(x => x)) && (!SearchColumns.Any() || SearchColumns.Select(x => Regex.IsMatch((x((T)t)?.ToString() ?? string.Empty).ToLower(), (FilterText ?? string.Empty).ToLower())).Any(x => x)) && ColumnCollection.Values.Select(x => Regex.IsMatch((x.CellValue(t)?.ToString() ?? string.Empty).ToLower(), (x.Filter ?? string.Empty).ToLower())).All(x => x);

>> No.67092726

>>67092690
I've heard that rider needs a beast machine to work properly, is it true?

>> No.67092731

Tic tac toe with an implementation of the Minimax algorithm for my C++ class. I’m struggling cus I’m actually a brainlet.

>> No.67092744

>>67092712
>learning C++ and openGL is basically the same as writing your whole OS from scratch
>brainlets actually believe this

also that anon asked if pygame is a good substitute for real graphics libraries, which it isn't

>> No.67092789

>>67092718
But why?

>> No.67092800

>>67092499
>he doesn't know how to do an if else statement
lol

>> No.67092815

>>67092789
To filter rows based on the values in columns.

>>67092499
At least its not the Mongolian Vowel Separator

>> No.67092834

i know c, c++, c#, python (django, flask), some js, java, php
what else should i learn to get a job

>> No.67092842

>>67092834
You don't learn a language in order to get a job, you get a job then get paid to learn a new language, but if you really want to , SQL.

>> No.67092844

>>67092834
>i know
ye don't. Just apply for a job you retard

>> No.67092879
File: 127 KB, 1397x666, big pancake just.png [View same] [iqdb] [saucenao] [google] [report]
67092879

>>67092800
You're doomed either way
>use the yellow skintone
>are you a racist?
>use your own skintone
>are you a racist?
>use a different skintone
>are you a racist
return "JUST"

>> No.67092900

>>67092879
Who the fuck are you associating with that this is an issue?

>> No.67092926

>>67092900
Californians

>> No.67092952

>>67092926
xou have my condolences.

>> No.67092953
File: 349 KB, 2240x2028, file.png [View same] [iqdb] [saucenao] [google] [report]
67092953

leveling up my hacker rank

>> No.67092981
File: 478 KB, 634x533, file.png [View same] [iqdb] [saucenao] [google] [report]
67092981

>>67092953
Good job Stefan!

>> No.67092997

Why do people jerk off to lambdas?
Arent they just trading readability for a small decrease in lines?
Also is fucktional programming just a neme?
inb4: t. newfag
Yes.

>> No.67093033

>>67092997
they're a powerful and simple abstraction
no
no

>> No.67093041

>>67092997
>Arent they just trading readability for a small decrease in lines?
How do you figure?
A decrease in lines increases readability once you know how to read in that way.

>> No.67093042

>>67092997
Arent they just trading readability for a small decrease in lines?
no, lambdas are in a lot of situations more readable than full methods. they also allow you to capture variables and do delayed execution of code that would be a lot more contrived using methods.

>> No.67093050

>>67092997
lambdas are easy to read after you learn them

>> No.67093058

>>67092152
Even if you don't use it professionally, it helps you write better c and c++

>> No.67093065

>>67092744
>brainlet doesn't understand hyperbole
I mean, I'm not surprised, what else can one expect from 16yo c++ hackers itt. I hope you've already written your own pygame?

>> No.67093077

>>67092718
why not using sqlite or a database at this point

>> No.67093079

>>67089208
Bomb mechanism with pic10f200.

>> No.67093090

>>67092997
You gain readability and decrease lines, and plus closures can capture variables unlike functions (language specific).
FP isn't a meme, it has it's strengths, weaknesses and use cases.

>> No.67093097

>>67093033
How exactly are they abstracting anytbing away? They're just a shorter syntax to do thensame exact thing.

>> No.67093106

>>67092997
People here are jerking off to anything functional.
Amirite guys? Too smart to find a job btw. Haskell btw. Scheme btw.

>> No.67093115

>>67093097
the exact same thing as what? defining a function out of line?

>> No.67093130

what can rtti actually be used for anyways

>> No.67093139

>>67093077
I am using a sqlite database in the back though, this is in the view where the user can filter the info on screen, im not coupling the database to the view just to filter a table.

>>67093097
its not the exact same, some languages allow you to use methods/functions in the same way as lambdas to let you capture variables in the scope for example, but a lot dont. you need to define the language we are working in to be able to say if its the same or not.

>> No.67093143

>>67093042
std::tuple<int,int> mytuple= std::make_tuple(1, -1);
std::get<0>(mytuple);

why are tuples so fucking awful in c++>?

>> No.67093159
File: 310 KB, 1920x1080, 1517905419828.jpg [View same] [iqdb] [saucenao] [google] [report]
67093159

>>67093143
in rust, this just
let mytuple = (1, -1);
mytuple.0;

>> No.67093191

>>67093139
I've only seen them in JS and they were completely unreadable. Maybe it's just programmer's fault and not lambdas but i really don't see how cramming a function in a single line makes anything better.

>> No.67093193

>>67093143
>why is THING so fucking awful in C++
because C++ is awful, stop using it.

>> No.67093239

>>67093143
in C# its just
var mytuple = (a:1, b:-1);
mytuple.a;

>> No.67093240
File: 179 KB, 1024x1017, 1533300000984.jpg [View same] [iqdb] [saucenao] [google] [report]
67093240

>>67093143
Just use structs LOOOOOOOOOOOOL

>> No.67093300

>>67093143
because C++ is an abomination of bolted on features, and the same sort of thing happens with std::visit and all over the standard library

>> No.67093327

>>67090117
Don't give up anon, it's never to late to pick up a new skill. If you're feeling overwhelmed, try taking things one at a time and just search "what is <concept>" to try and learn whatever you don't understand. Also most first year university CS courses assume you know jack shit about programming and start with the basics (usually with Python or Java, but I've seen Racket too). I would suggest brushing up on your math skills instead, since those were the courses that I found harder. Good luck!

>> No.67093335
File: 199 KB, 630x630, file.png [View same] [iqdb] [saucenao] [google] [report]
67093335

>>67093240

>> No.67093347
File: 184 KB, 1914x566, lambdas.png [View same] [iqdb] [saucenao] [google] [report]
67093347

>>67092997
>lambdas less readable

which of these two do you think is more readable?

>> No.67093373
File: 28 KB, 564x259, 63fad8cca1.png [View same] [iqdb] [saucenao] [google] [report]
67093373

>>67093191
Well, even in JS it can really make your code cleaner.
One of nice things that you can do with lambdas is currying. It can come be really useful in some contexts(Redux) and is only readable with lambdas.

>> No.67093377
File: 509 KB, 600x800, Whisper.jpg [View same] [iqdb] [saucenao] [google] [report]
67093377

>>67090117
>頑張って

>> No.67093402

>>67093347
holy shit why does it have to be so fucking verbose?

>> No.67093403

>>67093347
Both are unreadable to me.
>>67093373
Ok, this does look kinda neat.

>> No.67093407

>No exception handling
Are you serious right now? This is why C has become irrelevant

>> No.67093411

>>67093191
wtf do you use instead then??? the full boilerplate laden function notation?

>> No.67093422

nth for OO can and SHOULD be used to write more orthogonal code

>> No.67093425

>>67093407
Quite the opposite. C is widely used because it is the way it is.

>> No.67093427

>>67093407
>try isnt error handling

>> No.67093430

On Fridays, we code!

>> No.67093432

>>67093403
wow, guess you're just heckin' dumb then lol

>> No.67093434

>>67093407
>writing code intended to fail
??????

>> No.67093435

>>67093347
>look ma, no semicolons!
both will be fun to debug in two months

>> No.67093454

>>67093425
You're right, it's widely used by retards because it has no features

>> No.67093467

>>67093347
>-> not being used to access members in a dinamically-allocated struct
shiggy diggy

>> No.67093480

>>67093139
>im not coupling the database to the view just to filter a table
I dunno how you've got it set up but to me a new request (different filter) means a different query.

>> No.67093483
File: 1.15 MB, 900x506, 1502622873397.webm [View same] [iqdb] [saucenao] [google] [report]
67093483

>>67093407
>exceptions

>> No.67093484

>>67093407
>No monadic error handling
Are you serious right now? This is why C++/Java/C#/Python/Whatever will become irrelevant.

>> No.67093489

>>67093159
you forgot .take().crate().request().mut()

>> No.67093494
File: 10 KB, 640x107, 8097666bfc.png [View same] [iqdb] [saucenao] [google] [report]
67093494

>>67093432
>>67093347
m8 this shit is unreadable. You shouldn't expand lambdas like this when they are part of arguments. Also you are inconsistent with line breaks in general.

You should do something like this.

>> No.67093496

>>67093435
:thinking:

but I still get the right line number in my error logs?

>> No.67093507

>>67093494
ok, but what if
ok(data.data.foo(...

goes on too long? how do i break that line up?

>> No.67093510
File: 117 KB, 630x480, 1521319334924.jpg [View same] [iqdb] [saucenao] [google] [report]
67093510

>>67093489
>.take()
tuples are not Option<T>, you dummy

>> No.67093512

just follow the one function a line rule you heathens.

>> No.67093515

>>67093484
this but unironically

>> No.67093523

>>67093484
>will
Why are you so insecure about your favorite shitlang anon?

>> No.67093542

>>67093489
you forgot to unwrap()

>> No.67093548

A bad software design decision now can cause problems for decades. Remember that before you decide to quickly hack something together

>> No.67093552

>>67093507
If it's function chain bar.foo().foo().foo() then put then break them into new lines. If there was more functions applied after ok(...), I would break them down, aligning them. Same for arguments.

If you have very long access chain like data.data.data.data.data.data then what the fuck are you doing.

>> No.67093560
File: 15 KB, 696x178, 1516488205054.png [View same] [iqdb] [saucenao] [google] [report]
67093560

>>67093480
>>67092718
Im not making a new request every time the filter changes, its supposed to be real time as the user enters a string the table shows the results.

I refactored it a bit, its a little more clear now, but I feel the method lost its magic now.

>> No.67093568

>>67093548
That sounds like guaranteed job security to me. Thank you for pointing it out!

>> No.67093569

>>67093347
I'm not keen with inline lambda expressions, because there's a tendency for developers to go absolutely fucking wild with them until the entire routine becomes an unreadable and comprehendible mess. If you have more than 1 "->" in your chain statement (as you do), it's a fucking mess.

Instead, you can complement lambdas by referencing nicely named functions. That way, I haven't gotta spend 20 minutes trying to figure out what
return sessionMergers.mergeSessionTickFieldsOnly(maxMergeTimeMillis, rootFolder, folder + pattern).thenApply(this::nicelyNamedFunction1);

private Result nicelyNamedFunction1(SessionMergeResult<SessionDataAndMeta> mergeResult) {
return buildHttpResultFromMergeResult(mergeResult, this::nicelyNamedFunction2);
}

private Result nicelyNamedFunction2(SessionDataAndMeta dataAndMeta) {
return ok(dataAndMeta.data).withHeader("x-in-session-meta", Json.stringify(dataAndMeta.meta));
}

Clean code is happy maintainable code. Messy code is why you're still employed.

>> No.67093570
File: 1.03 MB, 1200x1198, urhkmezc0vnz.png [View same] [iqdb] [saucenao] [google] [report]
67093570

>> No.67093589

>>67093568
Nah, it doesn't protect people from being fired, it just causes misery for the people who replace them and have to take over the code

>> No.67093608

>>67093570
No such thing as zero-cost abstraction.

>> No.67093618

>>67093569
that's even worse than anonymous functions! now I have to go to a different fucking place to see what the code does. if the lambda body is simple, I don't see why you'd ever do this. if you're confused by what the lambda's type signature is, you can expand the arguments... if you're confused by what the lambda's body does, why would it being somewhere else help?

>>67093552
what if I named my variable something really long

>> No.67093631

>>67093608
compile-time only baka

>> No.67093641

>>67093570
>>67093589
>His language doesn't have zero-cost abstractions
Lmaoing::at(&your.life)

>> No.67093648

>>67093618
>now I have to go to a different fucking place to see what the code does
Like any built-in function?

>> No.67093649

>>67093618
>what if I named my variable something really long
Stop being Java programmer.

>> No.67093656

>>67093641
Think you replied to the wrong anon

>> No.67093664

>>67093618
For the same reason why, your entire program isn't executed in a single block of code.
Breaking out chunks of code into separate routines makes them easier to comprehend, maintain and test. Having a huge fuck-off lambda expression linked with a bunch of fuck-off other lambda expression makes debugging a nightmare, scalability an impossibility and goats are slaughtered because developers will take it on faith that it works, just because.

>> No.67093666
File: 24 KB, 511x288, brainlets.jpg [View same] [iqdb] [saucenao] [google] [report]
67093666

Everytime i compile this there is "Segmentation Fault". Its one of the challanges on leetcode, pass 2 strings A and B and return true if A==B after replacing only 1 letter in A


#include <string.h>
#include <stdlib.h>
#include <stdio.h>

char BuddyStrings(char *A, char *B) {
for (int i=0;i<strlen(A);i++) {
for (int j=0;j<strlen(A);j++) {
if (i!=j) {
char temp = A[i];
A[i]=A[j];
A[j]=temp;
if (strcmp(A,B) == 1) {
free(A);
free(B);
return 1;
}
else {
char temp = A[i];
A[i] = A[j];
A[j] = temp;
}
}

}
}
free(A);
free(B);
return 0;

}

int main(int argc, char *argv[]) {
char A[20] = "ab";
char B[20] = "ba";
//BuddyStrings("ab", "ba");
BuddyStrings(A, B);

}

>> No.67093670
File: 13 KB, 256x256, 1513232096718.jpg [View same] [iqdb] [saucenao] [google] [report]
67093670

>>67093656
Oh yeah

>> No.67093675

>>67093670
Don't worry it's cool anon, no biggie

>> No.67093682

>>67093631
No such thing, if something takes longer to compile it means its writing more code to the executable, which will lower performance when running it.

>> No.67093694
File: 45 KB, 600x677, shinji.jpg [View same] [iqdb] [saucenao] [google] [report]
67093694

>>67093666
Just count the differences.

>> No.67093701

OCaml come back guys
https://dev.realworldocaml.org/index.html

>> No.67093703

>>67093682
Somebody please post a brainlet wojak quoting this post, i don't have one

>> No.67093705
File: 38 KB, 667x558, 1516619698043.jpg [View same] [iqdb] [saucenao] [google] [report]
67093705

>>67093682
>if something takes longer to compile it means its writing more code to the executable, which will lower performance when running it

>> No.67093719

>>67093648
right, where the advantage is that the logic in isolation is easier to reason about, and you can call it from multiple places. in this case the logic only makes sense in the context of the call site, so number 1 is out, and number 2 was out anyway (if it wasn't, then it should 100% be an external function)

we had a guy who did this, he'd write tons of stupid functions where the signature matches what the lambda was getting passed in, even if it didn't use all of those args. so there'd just be these dumb functions that don't make sense on their own because why do I need the map key passed in when I'm not going to use it because I guess he thought the :: notation looked sexy or some dumb shit. anyway he's long since fired now and I have his job, so there you go

>>67093649
wow rude

>> No.67093722

>>67093701
>FUNCTIONAL PROGRAMMING FOR THE MASSES
literally FP for brainlets

>> No.67093728

>>67093666
Why arenyou freeing thongs that you didn't mallocate?

>> No.67093734
File: 25 KB, 349x149, file.png [View same] [iqdb] [saucenao] [google] [report]
67093734

>>67093703
i think it's a bait anon

>> No.67093735
File: 94 KB, 600x450, 1506543493086.jpg [View same] [iqdb] [saucenao] [google] [report]
67093735

>>67093728
Because she's a Cnile

>> No.67093744

>>67093407
Exceptions are bad.
If you really want them, make your own with SJLJ.

>> No.67093777

>>67093734
Wasn't bait, but Im too tired and my thoughts didn't translate well to text, what I mean is that longer compile times mean the compiled is doing more shit creating a more complicated executable (not neciceraly a larger file-size executable as the code can be more 'dense'), those complicated things will then take longer to execute than a simple executable.

>> No.67093789

>>67093777
Stop, it already! You're only making it worse!

>> No.67093799

>>67093777
an extremely solid, mt. stupid post anon.
gz

>> No.67093802

>>67093777
Those 'complicated' things get compiled away, they don't exist at runtime, hence "Zero-cost abstractions"

>> No.67093810

What's worse
>writing your mobile app in react native so you only have to deal one code base for android/iOS
or
>writing your mobile app twice in Swift and Java

>> No.67093813

>>67093300
>std::visit
I've just read about it. Holly fuck, fortunately Rust has pattern matching.

>> No.67093819

>>67093810
>deving for android
>deving for mobile shit at all

>> No.67093822

>>67093719
Would you change >>67093347? If so, how? Because there's always going to be a fight between readability and practicality.

>> No.67093832

>>67093777
That's literally the opposite of what happens.
Learn what optimizing compiler is.

>> No.67093839

>>67093813
It really is abysmal. You can make better ghetto pattern matching if you do it yourself - it's just the standard being terrible.

>> No.67093840

>>67093822
I'd change it how that other anon told me too, so that the line breaks are consistent

thanks other anon!

>> No.67093855

>>67093694
>>67093728
thanks now it works when i deleted free, is there a way to print booleans, or is there only 1/0 instead?


#include <string.h>
#include <stdio.h>


char BuddyStrings(char *A, char *B) {
for (int i=0;i<strlen(A);i++) {
for (int j=0;j<strlen(A);j++) {
if (i!=j) {
char temp = A[i];
A[i]=A[j];
A[j]=temp;
if (strcmp(A,B) != 1) {
return 1;

}
else {
temp = A[i];
A[i] = A[j];
A[j] = temp;
}
}

}
}
return 0;

}

int main(int argc, char *argv[]) {
char A[20] = "ab";
char B[20] = "ba";
//BuddyStrings("ab", "ba");
char Result = BuddyStrings(A, B);
printf("%d\n", Result);
}

>> No.67093862

>>67093819
>>deving for mobile shit at all

Some of us are actually making useful things, neckbeard

>> No.67093865

>>67093862
ah yes another calendar app.
how productive.

>> No.67093885

>>67093862
>"Some of us are actually making useful things, neckbeard"
>Resumes coding his 2D game

>> No.67093891

>>67093810
I've used Ionic for apps until now and it was quite nice. I'd like to try react native though.
I'd never use Swift or Java unless I had too.

>>67093855
Man, you don't need two loops. Just count the differences and check if it's only 2 and the chars are swapped.

>> No.67093892

>>67093865
>>67093885

Shitty and wrong assumptions, really shows off your insecurities.

>> No.67093897

So there's this function isTabular() in a spreadsheet detection program and it does this magic to determine whether or not something is tabular.

private static final float MAGIC_HEURISTIC_NUMBER = 0.65f;
...

public boolean isTabular(Page page) {

...
float ratio = (((float) colsDefinedByLines / colsDefinedWithoutLines) + ((float) rowsDefinedByLines / rowsDefinedWithoutLines)) / 2.0f;

return ratio > MAGIC_HEURISTIC_NUMBER && ratio < (1/MAGIC_HEURISTIC_NUMBER);
}


What the fuck is this doing? How does the ratio of defined lines and undefined lines being between .65 and its inverse determine whether or not something is tabular?

>> No.67093907
File: 96 KB, 620x620, thumb.jpg [View same] [iqdb] [saucenao] [google] [report]
67093907

>>67093892
>Assumed that the other Anon was making a mobile game
Love watching a hypocrite raging... you pathetic spastic

>> No.67093915

>>67093855
Booleans are 1bit binary values and you can only print ascii characters.

>> No.67093931

>>67093915
>Booleans are 1bit binary values
Wrong

>> No.67093932

>>67093931
implementation dependent

>> No.67093945

>>67093907
What the hell are you talking about I assumed that guy wasn't making anything and I was right since he started projecting.

>> No.67093953

how do i add files to repl.it? i just want to test something with jquery.

>> No.67093955

>>67093932
In C there is no boolean type so everything (not restricted to 1 bit) is true while 0 is false.

>> No.67093958

>>67093955
what is _Bool?

>> No.67093975

>>67093931
I know that they are actually 8 bit but that's irrelevant since 7 of them are always zero.

>> No.67093978

>>67093955
there's stdbool

>> No.67093990

a=0
while isinstance(a, int):
print(a)
input(a)

Why does it crash?
It doesn't create the a, takes no input, and what's worse doesn't break the loop if I enter a str value, which should break the loop especially that every input() is str by default.

>> No.67094027

>>67093990
input(a) prints a and gets the user input, you probably want a = input()

>> No.67094042

>>67093990
We're supposed to guess what language it is?

>> No.67094047

>>67093990
Ok I realized the mistake in this version.
a=input()


anyways, I was trying to solve the problem of inputs being always str with try, expect, blocks but it didn't work. What's the proper way to check if user inputs a number or a str or any other value like float or char.

>> No.67094059

>>67094042
See the indenting and colon you idiot. It is pythong

>> No.67094062 [DELETED] 

If languages were cute anime girls, which would be a big-dicked trap?

>> No.67094064

>>67094047
a=0
while isinstance(a, int)==True:
print('ok')
a=input()
try:
a=int(a)
except:
break

This is sort of working code, but sometimes it breaks.

>> No.67094077

>>67094062
Erlang.

>> No.67094083

>>67094062
forth
it isn't what you expect and it's wildly different from the other options

>> No.67094139

Whats the safest language? meaning lots of compiletime checks, people cant do shit you dont want them to do, easy to tell the compiler your intent, and so on? python is probably the most unsafe language I know, anyone can change any private variable, almost no compile time checks so you get tons of run time errors,... C# has a lot of good shit to make it safe but also some weird ass shit like read only fields that can be mutable.

>> No.67094156

>>67094139
some flavour of strongly typed FP

>> No.67094162

>>67094139
Idris

>> No.67094164

>>67094139
idris of F*
Elm if front-end webshit.

>> No.67094179

Is 'Thinking Forth' worth the read? Forth is a deadlang.

>> No.67094185

>>67094162
>>67094164
Can you even do anything useful with Idris?

>> No.67094197

>>67094185
yes Idris can interface with C even.

>> No.67094199

>>67094139
Prolog

>> No.67094201

>>67094139
>python is probably the most unsafe language I know
Wish more people understood this desu (especially data """scientists""").

I'd go with Java as a good candidate. I guess FP langs are technically more safe because there is no concept of mutability, but I'm not sure if that's what you're looking for.

>> No.67094204

>>67094185
Yes, you can make hangman or invaders
>>67090552
>>67090557

>> No.67094209

if (cond) return foor

or
if (cond)
return foo


also
if (cond1) return foo
if (cond2 && cond3) return foo
if (cond4 || cond5 || cond6 || cond7) return foo

or
if (cond1 ||
(cond2 && cond3) ||
(cond4 || cond6 || cond7))
return foo

>> No.67094210

>>67089637
All engines suck so it's a matter of picking whichever one is the least suck to you. I've played with it but never done anything serious with it. Seems capable enough. Gamedev is fucking hard wherever you try to do it.

>> No.67094225

>>67094209
(cond)
? action
: other action;

>> No.67094235

What do I need to learn to enter a FANG company? I have an inside man who can get me an interview but I'm not ready. I've been a java and android monkey for years and my grasp of essentials has gone to shit

>> No.67094243

>>67094201
>Wish more people understood this desu
We're all consenting adults here anon, you are safe :^)

>> No.67094262

>>67094235
you need to be a SJW. Sorry, anon

>> No.67094278

>>67093897
Have your tried looking at a call site of that function, might shed some light if the name isn't 100% accurate?

>> No.67094289

>>67094235
Who's the N? Nintendo?

>> No.67094297

>>67094289
Netflix

>> No.67094347

>>67094201
>FP langs are technically more safe because there is no concept of mutability
FP doesn't always mean immutability.

>> No.67094349

>>67094235
d&a

>> No.67094361

>>67094201
>Java as a good candidate
Not with the amount of shit in its standard library that should be immutable but for some reason isn't and can get changed inside methods you cant even think off.

>> No.67094386

>>67094349
Dicks and ass?

>> No.67094459

>>67094278
It's not very helpful looking at its use case:

SpreadsheetExtractionAlgorithm se = new SpreadsheetExtractionAlgorithm();
boolean isTabular = se.isTabular(page);
assertTrue(isTabular);
List<? extends Table> tables = se.extract(page);
StringBuilder sb = new StringBuilder();
(new CSVWriter()).write(sb, tables.get(0));


As far as I can tell, that magic number is simply a value picked after trial and error. It just werks at determining at whether the data in an extracted area is tabular. I still wonder why it matters if the ratio is in the bounds of magic number and its inverse though.

>> No.67094460

>>67094179
>Is 'Thinking Forth' worth the read?
sure
>Forth is a deadlang.
Forth is a funlang

>> No.67094617

>>67094347
>FP doesn't always mean immutability.
i mean it's a pretty central pillar of it, but if you want to be pedantic.

>> No.67094637

>>67094386
that's right
only faggots work for bigN

>> No.67094733

New thread: >>67094731

>> No.67094735

how the FRICK am I supposed to navigate the sdl2 docs?
https://packages.ubuntu.com/xenial/all/libsdl2-doc/filelist
it just seems like a bunch of html files with no real order
it's just a mess

>> No.67094924

>>67090016
Autotools

>> No.67094973

>>67093694
>>67093891
I fucking give up, there is no way i will write program that will check every opportunity. I am terrible programmer
char* swap (char* A, int i, int j) {
char temp = A[i];
A[i] = A[j];
A[j] = temp;
return A;
}


bool buddyStrings(char *A, char *B) {
int h=0;
int w[2];
if (strlen(A) == 0 || strlen(B) == 0) {
return false;
}
for (int i=0;i<strlen(A);i++) {

if (A[i] != B[i]) {
w[h] = i;
h++;

}

if (h>=2) {
if (strcmp(swap(A, w[0],w[1]), B) == 0) {
return true;
}
return false;
}
}
if (strcmp(swap(A, 0,1), B) == 1 && strlen(A) <= 2) {
return false;
}

return true;

}

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action