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



Thread archived.
You cannot reply anymore.



File: T2zRdnR.png (389 KB, 934x1000)
389 KB
389 KB PNG
What are you working on, /g/?

Previous thread: >>64278238
>>
>>64283128
ohaio gozaimas~
>>
learning SDL to make a Doom clone, why the hell SDL defines its own fixed-width integers???
>>
>>64283128
This thread is already shit.
>>
File: QyoaOkc.png (205 KB, 409x404)
205 KB
205 KB PNG
>release first project
>100 stars on github in the first day

i've made it mom,
living the dream

quick question: how do i convert github stars into hard cash?
and where do i get my rockstar programmer club membership card?
>>
>>64283149
For the same reason Qt has qint's -- for better cross-platform compatibility. You're free to ignore them.
>>
>>64283158
Post it so I can bully you
>>
File: 3497490-super+friends.jpg (88 KB, 580x290)
88 KB
88 KB JPG
C++ friends unite!
>>
File: 1515782927115s.jpg (4 KB, 250x172)
4 KB
4 KB JPG
>>64283158
what project?

now I'm interested

i wanna put a star too
>>
>>64283141
おはよう ごさいます Anon君
>>
>>64283141
konbanwa
>>
Starting to contribute to this opensource cryptoexchange project:
https://github.com/rubykube/peatio/
>>
>>64283158
Share it with us
>>
>>64281534
Reposting.
>>
>>64282747
Duh
>>
>>64282247
>>64282290
I don't quite follow.
I said that he should use char *p instead of int *p.
I understand that his code isn't bulletproof, especially when using a fixed character array to place input into.
>>
>>64283273
so, from >>64283273
>friendly feedback
1.
void Tournament :: genMatches()
{
vector<Player> ::iterator itB;
vector<Player> ::iterator itE;

for (int i = 0; i < players.size() - 1; i++)
{

tf is going on with the indentation of everything after itE?

2.
Matches.push_back(currentMatch);

what is Matches, where is it defined
does this code even compile?
I mean it doesn't even include a main method, do anything with the result (assert, print), or do debug prints as you're building the rounds up
ffs post a *self-contained* example
do you know what it means?
hint: I should be able to copy-paste it into a file, compile and run it, and see the issue during runtime (be it printing, assert failures or other errors)

>on-topic feedback
$ cat shite.scala
def genRounds(playerCnt: Int) = {
require(playerCnt % 2 == 0)
var ps = (1 to playerCnt).toVector

for (round <- 1 until playerCnt)
yield {
val (psa, psb) = ps.splitAt(ps.size/2)
ps = Vector(ps.head, ps.last) ++ ps.tail.init
psa.zip(psb.reverse)
}
}

@ genRounds(8) 
res1: [...] = Vector(
Vector((1, 8), (2, 7), (3, 6), (4, 5)),
Vector((1, 7), (8, 6), (2, 5), (3, 4)),
Vector((1, 6), (7, 5), (8, 4), (2, 3)),
Vector((1, 5), (6, 4), (7, 3), (8, 2)),
Vector((1, 4), (5, 3), (6, 2), (7, 8)),
Vector((1, 3), (4, 2), (5, 8), (6, 7)),
Vector((1, 2), (3, 8), (4, 7), (5, 6))
)

tbf it is semi-on-topic

no sense in wasting my time getting your code to compile, frankly
people are less likely to want to help you, the more of an unnecessary hassle you make it for them to help you
consider that the
>constructive feedback
>>
>>64283449
>so, from >>64283273
>so, from >>64282690
ftfm

also wrt
>self-contained
http://sscce.org/
>The SSCCE
>Short, Self Contained, Correct (Compilable), Example
>If you are having a problem with some code and seeking help, preparing a Short, Self Contained, Correct Example (SSCCE) is very useful. But what is an SSCCE?
>It is all in the name, really. Take a look at each part. The version prepared for others to see should be:
>- Short (Small) - Minimise bandwidth for the example, do not bore the audience.
>- Self Contained - Ensure everything is included, ready to go.
>- Correct - Copy, paste, (compile,) see is the aim.
>- Example - Displays the problem we are trying to solve.
>>
Learning unix sockets to make a program in Haskell (for parsing) and C (openGL).
>>
>>64283509
why not use python?
>>
Anyone here knows OpenCL? I have a C++ program that I want to run in my CPU and GPU at the same time, can I just use OpenCL to concurrently execute the for loop that is in use 99% of the time? It's just number crunching with some random number generation, so it's just pretty much C code anyway, I can just use it as the OpenCL kernel right?
>>
>>64283449
>no sense in wasting my time getting your code to compile, frankly
>people are less likely to want to help you, the more of an unnecessary hassle you make it for them to help you
not to mention that the issue may be highlighted (and much easier to spot) in the code that you chose not to post
so, again, you're making things more difficult than they need to be
>>
>>64283585
Use cuda
>>
>>64283621
NOT PORTABLE YOU FUCKING TOOL
>>
>>64283585
Idk but maybe give this video a watch: https://www.youtube.com/watch?v=kIA_UtdVabQ
He makes an overview of CPU+GPU computing. You may find interest in openACC.
>>
>>64283582
Why use python?
I'm pretty comfortable with Haskell, parsec and C, but not python and its parsing libraries.
>>
>>64283695
>I'm pretty comfortable with Haskell, parsec and C, but not python and its parsing libraries.
excellent reason NOT to use python imo
he prolly thought you're using haskal due to memes
>>
SDL threads or POSIX threads?
POSIX threads should work on windows right?
>>
>>64283585
https://stackoverflow.com/questions/23986825/opencl-for-loop-execution-model
>>
>>64283828
>POSIX threads should work on windows right?
wont compile, you'll need to do a few #ifdef's
>>
>>64283828
they work on windows if you link to winpthread from mingw64
>>
>>64283828
std::thread
>>
>>64283854
Fuck off Bjarne.
>>
>>64283852
>windows
>mingw
if yer a masochist
>>
>>64283866
More portable c:
>>
>>64283866
>Bjarne
>Implying
https://doc.rust-lang.org/std/thread/
>>
File: steve.jpg (19 KB, 300x300)
19 KB
19 KB JPG
>>64283888
Fuck off Steve, you are even worse than Bjarne.
>>
>>64283879
>C
>portable
thanks to dynamic linking it's not even portable across lincucks distros
>>
>>64283873
yes but it has the better compilers
>>64283918
dynamic linking respects the user's freedoms
>>
File: 1515781486932.png (53 KB, 403x448)
53 KB
53 KB PNG
>>64283946
>dynamic linking respects the user's freedoms
>>
>>64284006
This is some next level rust shitposting? Dynamic linking is the only acceptable form of linking.
>>
>>64284027
but LD_PRELOAD is broken
>>
>>64284044
>terrorist might blow up plane so you should never fly anywhere
>>
>>64284027
>dynamic linking is the only acceptable form of linking
from 2 options you chose the wrong one
>>
In Rust, suppose I have a crate with two binaries in it and some code I'd like to use in both, so it looks like
src/foo/main.rs
src/bar/main.rs
src/stuff.rs

and in Cago.toml I have
[[bin]]
name = "foo"
path = "src/foo/main.rs"

[[bin]
name = "bar"
path = "src/bar/main.rs"

How do include `stuff` in both `main.rs`s? As far as I understand, mod works only from the current dir inward, and there's no way to 'mod' a file from the parent directory. Then how am I supposed to reuse code in a single crate?
>>
>>64283128

Playing with 4chan's json api in node.js.

I just finish the making of an html page containing all images in /g.

https://github.com/dailyprog/dailyprog.github.io/blob/master/test-image.html

It doesn't work yet - 4chan's cdn seems to dislike we link to images from elsewhere (or I'm asking for too much images).
>>
>>64283128
Is there any good guides for making GUI for your java program?

I made program where you input speed and gravity. Then it prints out second/height/speed and stops when the object is down again. After that it prints highest point where that object was.
>>
>>64284113
sounds like a shite building system
guess you could kludge it up with symlinks?
so much for "modern language"
>>
>>64284113
Protip: Unlearn rust
>>
>>64284113
Learn a language that works
>>
File: 1493271707216.jpg (1.44 MB, 1152x1559)
1.44 MB
1.44 MB JPG
im trying to make a parser that parses a custom language based on this pic into lua and then runs it.
>>64284203
>>
File: 1484820870222.png (145 KB, 392x470)
145 KB
145 KB PNG
>>64284113
When I have a directory structure like
src/foo/main.rs
src/bar/main.rs
src/lib.rs

then
extern crate <crate-name>

in both main.rs is enough to work.

>>64284165
>>64284171
>>64284203
Rude
>>
File: 1495491076554.png (112 KB, 1920x1053)
112 KB
112 KB PNG
>>64284235
>>64284218
>>64284113
Pic related
>>
>>64284113
>Two main functions
lol, wut?
>>
>>64284309
Invoking cargo build creates two binaries
>>
>>64284264
please don't import me unless you are in japan
>>
>>64284320
>>
>>64284235
>>64284264
It actually worked, thanks.
>>64284309
Two executables - two main functions.
>>
File: 1503317928850.gif (72 KB, 287x344)
72 KB
72 KB GIF
>>64284349
Good to know
>>
>>64284113
>>64284264
A Rust crate with binaries may still have a library component (i.e. lib.rs and submodules). Then in the binaries you just `extern crate dpt`.
>>
People got so used to free shit they just take it for granted now ungrateful cunts.
I have a cool little app on the app store and 100 people installed it (and kept it), and not even one single of them bothered to rate it
This sucks dick.
I will have to create fake accounts and rate it myself
>>
>tfw reading the whole thread
>>
>>64284495
You have no face?
>>
>>64284504
>feel
>>
File: 1490128072819.png (16 KB, 174x231)
16 KB
16 KB PNG
>>64284524
Whoops, am dum
>>
>>64284569
I'll forgive you if you post feet
>>
File: 1511152897641.jpg (15 KB, 323x480)
15 KB
15 KB JPG
>>64284663
>>
File: 1510035642050.jpg (610 KB, 2335x3502)
610 KB
610 KB JPG
>>64284663
>>
How would I go about visualizing algorithms? I want to learn sorting algorithms and visualize them.

Just learn how to do 2D graphics first and then make array length amount of different height vertical lines and apply the sort to them?
>>
>>64284830
haven't used it but there's this
https://visualgo.net/en
>>
>>64284844
>this tool looks better on larger screen :)
>>
>>64284830
>I want to learn sorting algorithms and visualize them.
the wikipedia page on almost all them has a gif showing the sort.
>>
>>64284853
>>64284844
Yes, I am aware that the internet is full of gifs and videos and fancy html5 sites which show all the possible sorting algorithms.

But the idea was to read about the algorithm, then try to implement it myself. And also learn the visualization part on the side.
>>
>>64284874
I think you could also do that by reading the wikipedia page for the algorithm or just read an algorithms book.
>>
>>64284874
i don't see how the answer to your last question could be anything other than "yes"
pick your favorite language. there is some way to draw shapes in a window with it
>>
>>64284874
find the pdf or something
https://www.amazon.com/Grokking-Algorithms-illustrated-programmers-curious/dp/1617292230
>>
Question:

How do I add/remove objects of a JPanel that's on BorderLayout.CENTER from a JPanel that's on BorderLayout.START_PAGE ?

I made a function inside the JPanel that's on the center with
public void resetGameSize(){
this.remove(mtrx);
mtrx.newSize(2, 2);
this.add(mtrx);
}


and now on the JPanel that's on the start_page part I made a combobox where I want one of the options of the combobox to do
Main.resetGameSize();

but it turns out the resetGameSize() should be static for me to do that, but I can't make it static because remove(mtrx) and add(mtrx) wouldn't work then.

I'm a shitty coder I know. Any ideas for a workaround?
>>
>>64285384
Oh I forgot to mention, the two different panels are on two separate classes.
>>
File: Thinking4.png (9 KB, 122x119)
9 KB
9 KB PNG
What can affine types do for MY projects?
>>
How the fuck am I supposed to free resources on exception in memory managed language?
This is fucking bullshit.
>>
>>64285409
Affine types are deprecated, use linear types
>>64285416
What language
>>
>>64285423
>What language
C
>>
>>64285409
nothing, because they're wasteful.
>>
>>64285429
C doesn't have exceptions tho
>>
>>64285429
Just log an error and exit gracefully
>>
File: mfw.png (341 KB, 350x900)
341 KB
341 KB PNG
>read up on RAII, smart pointers, etc
>confident and pumped to code
>mfw i actually try to create something
>clusterfuck of leaks and cyclic shared_ptrs
>>
>>64285416
>>64285423
>>64285429
Like the Idea is that I give allocator to plugin and if there's exception on plugin function I unplug it and free everything in allocator but what to do if the plugin has shit running in different thread?

>>64285439
>what is longjmp
>>
>>64285462
Bullshit you shouldn't be using.

But if you do wanna steam ahead with this - you need to put a setjmp everywhere you would put a "try" block otherwise in a language with built in exception handling.
>>
>>64285480
>constant time method to jump arbitrarily far up the stack
>bullshit you shouldn't be using
>>
>>64285459
Don't allocate anything manually, ever
If you want to create something, push it onto a vector or add it to a map
Then you never even have to think about memory management
>>
File: 1515773536006.png (74 KB, 788x403)
74 KB
74 KB PNG
What is the best area of computer science and why is it math?
>>
>>64285491
It's only constant time if you don't need to call any cleanup routines along the way.
>>
File: 1513699587588.png (75 KB, 592x379)
75 KB
75 KB PNG
>>64285512
>>
>>64285512
math isn't CS, math can just be applied to many areas in CS.
>>
>>64285506
>Then you never even have to think about memory management
brainlets
>>
>>64283128
How can I average two numbers in C?
Wtf, I thought C was just as powerful as any other language
>>
>>64285512
>math
>area of computer science
>>
>>64285551
C doesn't even have strings. Why would you think it's powerful?
>>
File: 1500341610811.jpg (43 KB, 600x600)
43 KB
43 KB JPG
>>64285459
>Read up on Ada and secondary stack
>Confident and pumped to code
>Mfw I actually try to create something
>Clean strongly typed code and living on the stack
>>
>>64285551
Shit, I meant ints
>>
>>64285506
I've been avoiding new/delete and raw pointers, but I realize my design is shit, and nothing's gonna fix it but ripping out the junk and replacing it with actually well-reasoned structures.
>>
>>64285551
Well, the power in C doesn't come from its abstractions. The power of C comes from the fact it is very low level to you have a lot of control over how the computer handles memory, while at the same time is able to be portable. It is quite unique in this regard.
>>
>>64285384
>dat formatting clusterfuck
public void resetGameSize(){
this.remove(mtrx);
mtrx.newSize(2, 2);
this.add(mtrx);
}

>I'm a shitty coder I know
srsly m8, show a bit of thought for the poor fucks that are reading this, and format it properly
lack of care for formatting activates the pajeetdar like no other
>>
dafuq is with unnamed namespaces
>>
>self taught freelance codemonkey
>aspiring to use programming as a crutch to learn math
>

will I make it?
>>
>>64285512
>not using sheaves to define a manifold
lol get out brainlet
>>
>>64285551
int avg(int a, int b){
return (a>>1) + (b>>1) + (a&b&1);
}

Am I doing it right?
>>
>>64285881
>code tags don't stop post quotes
nice one hiroshimoot
>>
>>64285933 is a big homo
>>
>>64285771
No. Programming math beyond high school algebra can lead to some pretty wacky shit totally different from what you would get calculating manually or with a math-specific program.
>>
>>64285881
What's the average of 3 and 4, anon?
>>
>>64286018
3, just as god intended.
>>
>>64283128
How do you clear the scanner buffer in java? I tried writing the following method but it doesn't work
public static void dump(Scanner input)
{
while(input.hasNext())
input.nextLine();
}
>>
File: Bald emotional man.png (564 KB, 680x634)
564 KB
564 KB PNG
>>64285530

>tfw you will never understand what this post means
>>
>>64286018
Undefined behavior.
>>
>>64285771
You should just learn math because it is interesting and because you never know when any particular mathematics may be interesting. I worked with a bunch of engineers and computer programmers that didn't really understand modular arithmetic. It was all just remainders of division of integers to them - they never learned to think of them as residue class rings. I guess the moral of the story is knowing the internal structure of what you're working with can allow you to recognize patterns, broaden your ability to find solutions and in general to work more swiftly whatever you're doing. Remember in the land of the blind cyclops is king.
>>
>>64286120
>you never know when any particular mathematics may be interesting
should say 'useful'
>>
>>64285538
>Assembly is dead, here's comes C and malloc!
>No, malloc is terrible, use new!
>new is horrible, use RAII
>RAII is terrible, use this methods
>Actually, that's all bad, it's time for us to ascend to memory safe languages and leave all this behind
>Plebs, all of you, if only you knew the power of mathematically proven code
>>
>>64286263
new and RAII are horrible, malloc is all you need
>>
>>64286018
Ceiling instead of floor:
int avg(int a, int b){
return (a>>1) + (b>>1) + (a&1|b&1);
}
>>
>>64286270
Programming in modern C++ you should be avoiding new and delete in favor of smart pointers.
>>
>>64286292
Modern C++ is a sham. Give it three years and Neomodern C++ will be unrecognizable.
>>
>>64286270
why is RAII horrible?
>>
>>64286270
(you)
>>
Why isn't Haskell useful?
>>
>>64286305
Cuz memes
>>
>>64286305
Because RAII means constructors, constructors means exceptions, and exceptions are horrible.
RAII without exceptions (see, Rust) can make for pretty comfortable programming though it's suboptimal in terms of efficiency. But without exceptions, the onus for RAII is largely gone.
>>
>>64286301
>C++ 31
auto #include <all>
auto main (auto args)
{
auto::cout << "hello wordl";
return auto;
}
>>
>>64286381
>constructors means exceptions
no they don't.
>>
>>64286382
>C++34
fn main() {
println!("Hello, World!");
}
>>
>>64286381
unique_ptr constructors are marked noexcept you butt
>>
File: SeeYouInMyDreams.png (220 KB, 416x406)
220 KB
220 KB PNG
>>64286399
>
fn main() {
println!("Hello, World!");
}

That almost looks like rust
>>
>>64286398
It's that, or you create a zombie object.

That's even worse. It makes a constructor pointless.
>>
>>64286381
>exceptions are horrible
no
>>
>>64286432
>meeeeeemz
>>
>>64283128
Why do I see this animu girl so much in /dpt/?
>>
File: 5MXN7SX.jpg (11 KB, 281x283)
11 KB
11 KB JPG
>>64285515
>writing programs that rely in RAII-like cancer to release resources
>>
>>64286473
Haven't you been following the conversation? I'm saying that using sjlj for ghetto exceptions is a bad thing.
>>
>>64286382
kek
>>
>>64286411
make_unique is not. make_unique is what the cult of RAII promotes, and calling unique_ptr's constructor with the result of a new expression is shamed by the cult of RAII.
>>
>>64286484
>I'm saying that using sjlj for ghetto exceptions is a bad thing.
It's only bad if you write programs that rely on RAII-like resource management (protip: manual ghetto RAII is still RAII).
>>
File: 1488331434745.jpg (55 KB, 640x640)
55 KB
55 KB JPG
>>64283128
I'm working on nothing because I'm wasting my time on 4chan
>>
>>64286382
I honestly think setting the return type of functions to auto will be legal very soon
The compiler will just figure it out by looking at what you return
and if you have 2 return paths with different types it can just be an error like it is already
>>
>>64286530
Well, yeah. That's what anon was bitching about here >>64285416. It's stupid and he shouldn't be doing it.
>>
>>64286547
Has been that way since C++14, anon.

And multiple return paths is legal if you use constexpr if (C++17).
>>
>>64286570
Holy fuck what
I'm living in the future
>>
>>64286583
auto result = doc.load_file(CONFIG_FILE.c_str());
if (result) {
auto gfx = doc.child("gfx");
auto window = gfx.child("window");
// etc

the dream
>>
>>64286461
Not an argument.

>>64286455
Yes. Using exceptions for general purpose error handling is a mistake.
>>
>>64286381
>RAII means constructors, constructors means exceptions
>RAII without exceptions
???
>>
>>64286660
>expecting minimal internal consistency from a /dpt/ poster
You must be new here.
>>
>>64286642
yes exceptions are cool
>>
>>64286660
In C++, RAII means initializing objects and their resources using constructors (implicitly using exceptions to signal failure) and releasing those resources using destructors.
Rust uses the term RAII differently since it has no concept of constructors or exceptions.
How is this hard to understand?
>>
>>64286698
>In C++
First time that assumption has been brought up, and it's a little weird to implicitly assume things for one part of a post and not for another.
>>
>>64286719
>malloc, new, raii are terrible >>64286263
>when did anyone talk about C++?
>>
i was programming an autocode bot, that would produce code based off of English sentences in c#.

then, not realizing there wasnt a bootable disk maker for linux, i switched my os to linux, and started learning c.

i didnt know c doesnt have a string type variable, so my c# autocode bot is irrelevant, since it reads string input... also just having a string variable is fun, because you can make a big chatbot with just if statements. and then play with them.

now idk if i should go back to windows, or keep working in linux, hoping i break through a c learning curve....

i plan on moving to c++ soon, but by the time i learn both languages i could have made something valuable in c#, and im poor. :(
>>
I hate programming.
>>
anyone here live/work in a so-called incubator?
just watching 1st season of silicon valley.
is the incubator shit real?
how to find one?
how to find a GOOD one?
>>
>>64286736
"new and RAII are horrible" is ambiguous. Does it mean the combination of new and RAII in C++? Does it mean C++ new and RAII are horrible separately? Someone asked for clarification on why "RAII is horrible", which drops the C++ assumption, and you carried on talking about RAII in C++ but then dropped the assumption yourself halfway through your post. Learn to communicate.
>>
>>64286094
Algebraic topology is easy. Just read Hatcher's book.
>>
Is Powershell useful on linux?
>>
>>64286807
literally just move to san francisco and be halfway competent
>>
>>64286807
Yes business incubators are real. It's pretty standard actually.
>>
All programming languages are shit. No language has a powerful enough type system and is fast enough.
>>
>>64286849
No, unless you're administrating remote windows systems from linux.
>>
>>64286807
yes I have worked in a incubator company
I quitted because I was not gay enough
>>
c++ is the greatest language of all time
>>
Long time C and C# developer here, I've taken a new look at C++ and honestly I don't hate it that bad, should I learn it? It frequently pops up in projects I like.
>>
>>64286868
What the fuck is an incubator company?
>>
>>64286877
It's okay I guess.
>>
>>64286863
Or maybe your aspergers is just making you very bitter.
>>
>>64286869
yea
>>
Which newer meme language do you think has the best chance of being used heavily in the future? Rust? Swift? Something else?
>>
>>64286893
Whichever one is shittiest.

>>64286889
>waaaah my favorite language that I invest all of my self worth in got called shit
>>
>>64286893
Javascript will replace all languages including English.
>>
>>64286884
Other people pay for your shit basically until your company becomes successful enough.
>>
>>64286869
Languagewise C++ is pretty nice, it has some stupid pitfalls but its mostly due to C++'s source level compatibility with C.

Anything around C++ is completely dogshit. No build management, no dependency handling no nothing. CMake is pure steaming pile of shit, even make is more sensible.
>>
>>64286902
Just think about it, you might be happier if everything didn't look like shit in your mind.
>>
>>64286923
One important thing to remember when writing C++ is that you save yourself a lot of time if you simply put everything into header files.
>>
>>64286953
You don't save in build times.
>>
>>64286953
>Redundant compilation on top of horrible compilation times
>>
>>64286959
>>64286962
That's what the threadripper farm is for.
>>
>>64286953
Do you mean unity builds?
>>
>>64286969
That's not a solution. D's standard library builds in 1.5 seconds in my ryzen system.
>>
>>64286998
Is D the ultimate meme language?
>>
>>64287015
No, I think meme status belongs to languages like cock, idris, adga, lips etc etc
>>
>>64287022
I know you're smart because you didn't call Pony a meme.
>>
>>64287022
wow i passionately agree with your opinion

please be my girlfriend
>>
>>64286893
Swift has a guaranteed future until Apple replaces it.
Rust will have artificial adoption, but has no real future outside of Mozilla.
Haskell already established itself as "the" FP, and already has traction in the legal and financial sectors.
>>
>>64287038
I want to try out Pony some times in future actually
>>64287047
No one will use swift, just like no one used objective-c
>>
Found out an R package I want to use for my phd research isn't being actively developed anymore after a few years of being half-assed by someone, so I'm gonna fork it and try to update it on my own for the first time. Looks like it's gonna be a long weekend.
>>
File: tee-hee.gif (964 KB, 400x293)
964 KB
964 KB GIF
>>64287022
>cock
>lips
Tee hee hee.
>>
>>64287068
swift is a ok language
objectivec is bad. implementation is because is started preprocessor for c. the 2.0 never bothered to change shit implementation despite the break of abi
>>
>>64283128
How to find energy to program after day of work and school?
>>
>>64287155
Cocaine
>>
>>64287155
work at night and sleep at school
it worked for me
>>
>>64283158
>>how do i convert github stars into hard cash?

>port it to mobile devices and charge money/run ads on it
>add the project to your resume and freelance for people who can be confident that you know your shit
>add the project to your resume and get a real job
>write a book about making the project and get published by somebody and/or shill the book on Reddit until enough gullible retards buy it

Unethical mode
>Discretely collect data on your project's users and sell their information on the dark net to the highest bidder
>>
>>64286944
I'm not going to pretend your favorite language isn't shit.
>>
>>64287276
What is a good language to you anon?
And if one doesn't exist, what would you like it to be/have?
>>
>>64287287
A good language has a better type system than Agda and Coq.
>>
>>64287301
What are those two lacking, feature wise?
>>
>>64287323
Ease of use.
>>
>>64287336
That sounds a lot like brainlet talk to me.
>>
>>64287336
this man has for sure a very tiny brain
>>
>>64286642
Error handling is a mistake. You should unit test everything you make until error conditions don't occur. And in the rare event they do, just terminate the program.
>>
>>64287369
>And in the rare event they do, just terminate the program.
Don't do that unless it's actually fatal enough to not warrant continuing.
>>
>>64287387
only if its a video game
bugs of video game make oc gif material
>>
>>64287418
Depends on the situation, but no this covers all areas. But really you should just make invalid states impossible so you don't have the problem in the first place.
>>
>>64286547
You can use auto as the return type, but it is for specifying the arguments after the fact so that you can base the return type on the arguments.
template<class T, class U>
auto product(const vector<T>& x, const vector<U>& y) -> decltype(x * y);
>>
i'm working on a discord chatbot with a markov chain based on the complete chat log of the server it's present in (only used for fun in a friend's discord server). i filter the messages to not get moonrunes, links and other junk mixed in with the normal words to make the generated sentences flow better.

tried using four different markov chain libraries but all the libraries i tried took forever to create a chain whenever there was around 1500-2000 messages (each message is between 1 and 30 words, i haven't calculated the average) used per chain (dividing the 35k messages (when stripped for links, moonrunes, etc) in our chat history into 30-40 different chains).

i ended up just creating a simple markov chain myself and it parses all 35k messages in about 2 seconds on startup. i don't get how the other libraries are able to spend so long parsing this corpus into a chain, but it was really nice to get it working properly and even better than when i was relying on other peoples code.
>>
>>64287529
what you say makes sense
>>
>>64287529
Which language are you using?
>>
File: peatio.png (14 KB, 1065x113)
14 KB
14 KB PNG
>>64283204
>Designed as high performance crypto currency exchange
>Built-in high performance matching-engine
>high performance
>50+% ruby
>>
>>64287639
all roby program that is fast actually is fortran behind the curtain also pascal and c
>>
>>64287658
thanks for the fun-fact, pajeet.
>>
>>64287821
i am pleasured to provide you with information of significance
>>
Because I'm a nooblord, I only work on a small part at time, just finished a function to prepare my data to be anaylzed.


def exchangedataprep(coin):
work= np.loadtxt(coin+".txt")#names = [["Bid", "Ask", "Volume", "OpenBuyOrders", "OpenSellOrders", "Time"]*running_time]
persets = [.0557, .0901, .1459, .2361, .382, .5, .6181, 1]
low = np.array([0]*5, dtype=float)
high = np.array([0]*5, dtype=float)
dick = {}
for each in persets:
for x in range(5):
low[x] = np.amin(work[x][int(len(work[x][:])*each*-1):])
high[x] = np.amax(work[x][int(len(work[x][:])*each*-1):])
fin = np.column_stack((low,high))
ttt = np.column_stack((fin, np.corrcoef(work)[5][:-1]))
dick[each] = ttt

return dick
>>
Opinions on Arangodb, /dpt/? Tried asking /wdg/ but some times I think they're a few bits short of byte.

https://arangodb.com/

Looking for a data store for my web application. I intend on using graph data in the future, and I'd end up tweaking a postgres relational database into storing nodes and edges, or rely on a different database.

It's not a relational database though, what do I lose out on here? Right now I'm considering using boltDB, which I can use as a library within my project - it feels really nice to have an application with no database or binary dependencies.

>inb4 that one go hater
shut up it's not illegal to try different languages
>>
I'm trying to compile a CodeBlocks project, and I've set this as a search directory:
C:\Program Files (x86)\mingw-w64\i686-7.2.0-posix-dwarf-rt_v5-rev1\mingw32\i686-w64-mingw32\lib

But when I try to compile, I get the complaint "No such file or directory" about this file path:
\Program Files\mingw64\x86_64-w64-mingw32\lib\libmingw32.a

Why is it checking the wrong path?
>>
>>64288074
just install the toolchain where the software desires to be honest my little c++ friend brother
>>
>>64288074
strip out everything but
libmingw32

code blocks doesn't care about extensions or paths.
>>
>>64288172
I can't even find what requires libming, I tried searching it with the most loose search possible and couldn't find it.
All I know is that it was stated as a requirement for compiling.

Some retarded programmer must have hardcoded in that path in a library, given that the error only occurs after the project is done building.
>>
>>64288051
Reddit
>>
>>64288226
I meant in the library paths
go to
\Program Files\mingw64\x86_64-w64-mingw32\lib\libmingw32.a


And change it to
libmingw32
>>
>>64288262
That directory doesn't even exist though.
The problem is that whatever is looking for libmingw32 is looking for it in that specific (nonexistent) directory, even though it's meant to check directories I've said to search.
>>
>>64288303
this path is normally in the ordinary searched path of gcc
it was a mistake of the original creator to write it
>>
I C U guys like see, do U thing see is a good think?
>>
>>64288440
Lisp
>>
>>64288440
i think the world requires many necessery evils and see is one necessary evils
>>
>>64288368
The only reason I'm trying to compile something in C++ is to fix someone's retarded hardcoding in a game, and now I'm being held up by someone's retarded hardcoding.
I used to think that one day I'd be using exclusively C-family languages, but I'm starting to feel that C-family languages encourage convoluted code and moronic practices.

I put that file in that hardcoded path, and now that works, but now it's complaining:
\dev64\lib\libsdl2main.a No such file or directory
That's not a very helpful error message, it doesn't tell me what's missing or where it's looking.
I'm guessing it's checking C: for dev64, how do I get it to check where dev64 actually is?
>>
How is this possible? My switch statement gets one of the cases as input, but goes to the default case anyway?
>>
>>64288480
\ is root for the current drive (C: probably)
dev64 is where the dev put his compiled libraries
you need to make a build a sdl2
>>
>>64288512
Well, I have no idea what you're talking about.
All I know is that SDL2 is something that some of the code includes.
>>
>>64288544
install sdl version 2. there is two paths to this.
build from source or take binaries.
binaries if you are lazy. for what i know msys2 has a mingw-w64 with libraries (like linux).
>>
>>64288482
you need a break; after every switch case
>>
>>64288590
Did you miss the 'return' keyword in all of them? It was repeated 9 times, a cat would be dead by now.
>>
>>64288590
no they don't, a return itself should be sufficient in this case
>>
>>64288590
It returns so I don't need a break. That's not the problem though, I put a breakpoint on the "ak_copy:" line, it's completely skipped.
>>
>>64288482
>He doesn't know to use the 'case' keyword
>>
I love C++, but the fact that things such as template <class T> and template <typename T> are literally the exact same thing drives me up the fucking wall. Having access to different ways of doing the same thing is not something I dislike, but having different syntaxes for the same thing is ridiculous
>>
>>64288639
That's a laugh. Even if I missed that on a glance. Although, between all the different switch statement syntaxes of languages, I'm not too surprised.
>>
>>64288639
fuck hahaha
Cut me break, my boss wrote this code and he has a PhD.
>>
>>64288639
How does the compiler not warn about this without -Wall?

>warning: label defined but not used

I can only imagine the glorious code that would result in jumping into the middle of a switch/case.
>>
>>64288663
But, as always with C++, there are hidden corner cases where they are not. These sorts of things are my main gripes.

https://stackoverflow.com/questions/2023977/difference-of-keywords-typename-and-class-in-templates
>>
>>64288663
you surely mean grammar not syntax
>>
>>64288663
C++ is a ridiculous language
try Haskell
>>
Dependent types are the future of programming
>>
>>64288711
dependent linear types
>>
>>64288711
not that interesting honestly, i'd rather have system f+misc (e.g. typeclasses, gadts) in a good language than dependent types in a bad one
>>
>>64288711
metaclasses
>>
>>64288700
No I’m pretty sure how you write things and what the keywords are is called syntax
>>
File: maxresdefault.jpg (214 KB, 1280x720)
214 KB
214 KB JPG
>>64288704
c++ is good enough
>>
>>64288727
No, try again
>>64288728
Dependent types are a straight upgrade in a good language
>>64288733
Object oriented programming is trash. Try Idris
>>
>>64288750
>try again
tell me why i should consider there's nothing better right now.
>>
>>64288696
A good language would probably not have labels and case statements look exactly like
>>
C++11 and onward can be quite nice if you know what you're doing.

rust and modern C++ are both solid systems langs. imo the only way to compete would be C with rust-like macros or code generation.
>>
>>64288750
Idris is trash. Try Lisp
>>
>>64288750
>Dependent types are a straight upgrade in a good language
assuming there isn't some particular set of properties you would like for that language and that dependent types even make sense in it, also
>in a good language
>>
>>64288711
The future of programming involves euthanizing typefags.
>>
>>64288757
There is.
>>64288765
Lisp is too advanced for mere mortals. Dependent types let you incrementally design your software leading to fewer bugs
>>64288775
False. Go away
>>
>>64288784
>There is.
Like what?
Linear types will unironically revolutionize systems programming. Combine them with the power of dep types and you have an SSS+ language.
>>
>>64288762
It's not exactly alike, one of them has the case keyword.

I don't care about the syntax, just when would you ever need to jump into the middle of a jump table?
>>
>>64288762
case statements are just labels
>>
>>64288764
Can you bit pack an indefinitely sized array of 3-bit types?
>>
>>64288796

I'm not convinced 2bh. Got a link?
>>
>>64288799
It's close enough for gone faggot to waist time with it.

The same reason you'd jump anywhere else.
>>
Can anyone think of a way to copy n bits of an array of 8 bit values into a 64 bit integer?

e.g. the array:
32, 6, 128

And I want to copy the first 15 bits
(00100000 0000011) into a 64 bit integer
>>
Python sucks
>>
>>64288858
that goes without saying
>>
>>64288818
Here's a starting point.
http://wiki.c2.com/?LinearTypes
But the short elevator pitch is
>no GC
>but also no MMM
>BUT also no RC

Haskell is experimenting with weighted variants which are also interesting.
>>
>>64283158
>>release first project
>0 stars on github after 2 years
how'd you do it?
>>
>>64288855
& ?
>>
>>64288855
you make a loop that shifts result 8 bits and OR with an array value
>>
File: hmmmm.png (309 KB, 665x857)
309 KB
309 KB PNG
>>64288807
I have just the fire starter for this situation
>>
Is gradual/optional typing a meme?
>>
>>64288858
yes python is like a bomb. you must disarm the bomb and you must check the wiring to cut the good wires. except there are exponential wires
>>
>>64288855
copy n / 8 bytes, then 1 byte you & (1<<n)-1.
>>
>>64288913
They're hacks and 99% of the time end up creating more problems. Type systems can't just be hacked on, which is why Liquid haskell is a mess.
>>
>>64288855
In C you can just typecast the starting element as 'short' and then assign it to the number
>>
>>64288945
I thought Liquid Haskell was being shilled as quite good?
>>
>>64288937
* n%8
>>
>>64288577
And how would installing yet another random thing make my code work?
>>
>>64287323
Extensional equality
>>
>>64288951
It's terrible.
Terrible to read.
Terrible to write.
Terrible to maintain.
The type annotations might as well not even be there because they give 0 valuable information. Inference does not belong in FP, do NOT fall for the haskell shilling.
>>
File: 1513347227844.jpg (84 KB, 791x800)
84 KB
84 KB JPG
>Liquid haskell is a mess.
>The type annotations might as well not even be there because they give 0 valuable information. Inference does not belong in FP, do NOT fall for the haskell shilling.
>>
>>64288951
It is
>>
>>64288982
What would you suggest instead?
>>
>>64288991
This is the same guy that literally didn't realise when he does
[3, 4, 5]
That the compiler has to infer the type argument to (:), and in Idris it needs to infer an overload too. He's a daftie.
>>
>>64288807
w-why d-do you ask?
>>
There is absolutely no downside to having the computer automate satisfiability of decidable formulae. With a clever presentation of bidirectional typing that includes existential quantification, you can write undecidable propositions that require programmer supplied proofs (through a system like GADTs but with arbitrary index sets instead of just polymorphism), so you lose zero expressivity but gain cheap and predictable automation.
>>
>>64289014
Idris or any other FPL of the sort.
>>64289018
Oh it's you again, they are two different things.
And your argument is flawed.
>>
>>64289018
The type of [3, 4, 5] is [3, 4, 5].
>>
>>64289050
In addition this subsumes (or at least interacts very nicely with) unification based type inference which is, again, very predictable and cheap with bidirectional typing compared to e.g. complete inference in Haskell or semidecidable inference in Idris.
>>
>>64289052
>Idris or any other FPL of the sort.
I'm guessing Agda is also acceptable?
>>
>>64289096
Agda needs a little more time, as of right now i see no reason to use it over Idris, but sure.
There's also F* if you want a completely different world, and more type theory porn.
>>
>>64289108
Cool. I have the Idris book but I don't want to get stuck only being able to use a single language
>>
>>64289108
>Inference does not belong in FP
>recommends F*
We got a pseud here lads.
>>
>>64289119
The only pseuds here are the ones gluing glitter on the decomposing corpse of Haskell.
>>
>>64289119
F* is a different paradigm and is much more advanced than haskell.
>>
>>64288965
sdl is the graphics library for games.
i quickly searched the binaries of mingw, you can have the link.
https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/mingw-w64-x86_64-SDL2-2.0.7-1-any.pkg.tar.xz
>>
>>64289136
Liquid Haskell is actually very well integrated aside from the {-@ @-} stuff. It makes the language total, for instance. If it wasn't good, it wouldn't be getting as much use in academia as it is. Currently LH is the prime environment for researching automated theorem proving.

>>64289142
Doesn't matter.
>>
What would you do if you had to make a 64k demo to impress normies?
>>
>>64289154
And I have SDL.
As I said, it's one of the things the code includes.
I would know if SDL was the problem, it would complain about it being absent.
>>
>>64289175
>normies
>impressed by something being 64k
>>
>>64289165
>If it wasn't good, it wouldn't be getting as much use in academia as it is.
There is very little use of it in academia or elsewhere.
>>
>>64289180
>\dev64\lib\libsdl2main.a No such file or directory
does this exists inside the project ? it has to be a path error. or architectures not matching (32-64 bit)
>>
>>64289204
I didn't say there was, but it's a significant amount in a very particular field.
>>
>>64289182
Ok, what about 64M.
>>
>>64289234
You need to install something called GNU/Linux.
>>
>>64289234
It's because dev64 isnt actually in C:, but no matter where I tell the compiler to search it will check C:
>>
>>64289263
This problem literally does not occur if you use GNU/Linux.
>>
>>64289204
>>64289241
I should say automated theorem proving in the context of programming, i.e. automatic software verification.
>>
>>64289245
i run gnu linux but i offer charitable guidance to the windows programmer who is in trouble
maybe god will reward me for good actions
>>
>>64289277
You're an enabler.
>>
>>64289263
you must go to the low level.
there must be a compile log. can you obtain the command line which ends in failure?
>>
>>64289304
Please stop enabling the addict.
>>
>>64288947
I don't want to overwrite what is already in the 64 bit int.
>>
>>64288807
template <int WIDTH>
struct NWideVector {
std::vector<bool> bits {0};

NWideVector() {
static_assert(WIDTH <= 64, "Unsupported vector width :(");
};

unsigned long operator[](size_t index) const
{
size_t off = index * WIDTH;
int ret = 0;
for (int i=0; i<WIDTH; ++i) {
ret |= this->bits[off + i] << i;
}
return ret;
}

void set(size_t index, unsigned long entry)
{
size_t off = index * WIDTH;
size_t off_end = off + WIDTH;
if (off_end > this->bits.size()) {
this->bits.resize(off_end, false);
}
for(int i=0; i<WIDTH; ++i) {
bool entry_bit = 1 & (entry >> i);
this->bits[off + i] = entry_bit;
}
}
};
>>
How to flip a single bit in a char without messing out the other bit?
I know i can set to high or low with this method:
void set_low(char * data, int loc){
if(loc > 7 || loc < 0) {
return;
}
*data &= (~(1 << loc));
}

void set_high(char * data, int loc){
if(loc > 7 || loc < 0) {
return;
}
*data |= (1 << loc));
}

But how to flip the bit from high to low and low to high??
I know I can just check whether the bit is high or low and call the appropriate function, but it seems extremely inefficient
>>
>>64289628
Your compiler will optimize out that branch, so don't even worry about it.
>>
>>64289628
the same as your set_high but with an xor instead of an or
>>
New thread:
>>64289685
>>64289685
>>64289685
>>
>>64289687
Take your sonic mexican autism somewhere else.
>>
>>64289611
>Unsupported vector width
powerful
>>
>>64289716
hurr durr I need to pack my vectors to 65 BITS to save memory.
>>
>>64289745
>Making excuses
>>
>>64289751
he asked for a 3-bit vector, I wrote a 1-64 bit vector, and you're complaining.
>>
>>64289762
I'm just a bit disappointed that you gave up halfway through
>>
>>64289780
I didn't give up. I tried writing it using any-size types, but C++'s limitation that prevents you from making in-place pointers made it incredibly ugly to get and set values.
>>
>>64289611
> std::vector<bool>

Repent, heretic.




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

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.