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

If you can see this message, the SSL certificate expiration has been fixed.
Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 288 KB, 1024x491, 1540569773155.png [View same] [iqdb] [saucenao] [google] [report]
68495555 No.68495555 [Reply] [Original] [archived.moe] [rbt]

Old thread: >>68486937
What are you working on, /g/?

>> No.68495585

>>68495555
and?

>> No.68495606

>>68495555
Lisp is the most powerful programming language.

>> No.68495613
File: 369 KB, 1000x494, js-rocks.png [View same] [iqdb] [saucenao] [google] [report]
68495613

JavaScript rocks!

>> No.68495627
File: 64 KB, 804x637, 1536729500614.png [View same] [iqdb] [saucenao] [google] [report]
68495627

Unfortunately, the only real C++'s competitor at this point is Rust. Why we need a C++'s successor is that it cannot scale to the demands of modern day programming needs. It's not 1970 anymore, people are not looking for primitive standard libraries.
They want good string processing libraries, networking APIs, a standard build and package management system. C++ has none of them.

>> No.68495647

>>68495627
All of those things exist, they're just not standardized. If standardization mattered to you, you wouldn't even consider Rust.

>> No.68495650

>>68495627
>C++ has none of them.
on the contrary it has all of them

>> No.68495671

>>68495650
>on the contrary it has all of them
So what's C++'s standard package manager?
>>68495647
>If standardization mattered to you, you wouldn't even consider Rust.
It does, which is why I don't consider C++ anymore.

>> No.68495681
File: 65 KB, 920x1379, peak-tism.png [View same] [iqdb] [saucenao] [google] [report]
68495681

I'm not working, but procrastinating like a motherfucker trying to draft a flowchart with all the recommended milestones when learning a new language. Can I have your suggestions? Here's an example to showcase what I have in mind.

e.g.
Rewriting old scripts and programs, reading the most recommended bibliography from cover to cover, reading and understanding other people's source code, programming challenges of a certain difficulty, writing something "original" yourself, etc.

>> No.68495696

>>68495671
I see you don't know C++ but just want to hate it

>> No.68495701

>>68495627
If you are missing anything from the STL then Boost most likely has it. But since Boost is not technically standard I guess the same applies again >>68495647

>> No.68495705

>>68495671
Can you name even one language with a standard package manager?
protip: a convention that everyone follows isn't actually a standard.

>> No.68495731

>>68495696
I know C++ quite well.
>>68495701
So what's C++'s standard build system and package manger?
>>68495705
>a convention that everyone follows isn't actually a standard.
Prove it.

>> No.68495752

>>68495731
>I know C++ quite well.
sure thing, I can tell from your posts how much you know it

>> No.68495758

Anon here. Im a Java noob. I have this HashMap with values also being a HashMap. I need to make a copy of this. I had problems getting a copy which was not modified when I modified the original hashmap. Something about call by value, call by reference I guess, I find it difiicult. I came up with code that works, but I have to initialize the inner hashmap with "dummy" values, which is so ugly. Whats a better way to do this?

<code>
HashMap<String, HashMap<String, String>> HashMap1 = new HashMap<String, HashMap<String, String>>();
HashMap<String, HashMap<String, String>> HashMap1_Backup = new HashMap<String, HashMap<String, String>>();

//Some code here to fill HashMap_AllInfo
Set<String> keys = HashMap1.keySet();
for (String key : keys) {
//put a dummy hashmap here to initialize...
HashMap1_Backup.put(key, new HashMap<String, String>() {{put("dummy", "dummy");}});
Set<String> keysInner = HashMap1.get(key).keySet();
for (String keyInner : keysInner) {
String valueInner = HashMap1.get(key).get(keyInner);
//...so that I can use .get(key) here without getting null-pointer error
HashMap1_Backup.get(key).put(keyInner, valueInner);
}
}
</code>

>> No.68495763

>>68495752
>I can tell from your posts how much you know it
Feeling's mutual.

>> No.68495770
File: 25 KB, 761x216, hashmap.png [View same] [iqdb] [saucenao] [google] [report]
68495770

>>68495758
Fuck, how does the code tag work? Sorry.

>> No.68495793

>>68495763
thanks for confirmation

>> No.68495799

Is Golang worth learning for a funnies web app project or should I just stick with C#?
The Google cloud/web app ecosystem looks pretty clean and easy to jump into, so I figured I might wanna try Golang, as well.

>> No.68495805

>>68495731
>I know C++ quite well.
#include <iostream>
using namespace std;

struct Test {
int num;
void func() {}
};

int Test::*ptr_num = &Test::num;
void (Test::*ptr_func)() = &Test::func;

int main() {
Test t;
Test *pt = new Test;

(t.*ptr_func)();
(pt->*ptr_func)();

t.*ptr_num = 1;
pt->*ptr_num = 2;

delete pt;
return 0;
}

>> No.68495811

>>68495793
Always happy to help out a noobie :)

>> No.68495818
File: 37 KB, 1261x767, 23532.png [View same] [iqdb] [saucenao] [google] [report]
68495818

Dark theme.

>> No.68495828

>>68495799
I thought Golang was dying? It seems like Google has been caring more about Dart, lately.

Google really should bring Dart support to their GAE and GCP shit. Dart looks fun.

>> No.68495831
File: 18 KB, 573x261, Java primitive and reference.png [View same] [iqdb] [saucenao] [google] [report]
68495831

>>68495758
>>68495770
You should learn about reference semantics.

The only way to make a copy of an object in Java is the only way to make any object in Java - using the new operator to call a constructor. Assignment with = or by calling a method merely copies the reference to the object.
HashMap has a copy constructor which takes a Map as an argument and copies all the elements from it. Like this.
HashMap<String, HashMap<String, String>> copy = new HashMap<>(oldmap);

>> No.68495834

>>68495811
feeling is mutual

>> No.68495835

>>68495805
>look mom I just learned about function pointers!
adorable

>> No.68495840

I have a m by n sized array of integers each holding a number to be used to represent pixel color, from 0-255. this is supposed to represent a picture.

How do I scale down this array into a x by y sized array? I see suggestions saying to use scaling algorithms like bicubic or bilinear but all the examples I see are for scaling up, I don't get how exactly you determine which columns/rows to keep and remove for scaling down

>> No.68495847

>>68495805
it still bugs me that we can't convert pointers to data members to offsets
I hate offsetof

>> No.68495860

>>68495805
>using namespace std;
kek enjoy your conflicting symbols

>> No.68495878

>>68495847
> pointers -> data members -> offsets
for reasons

>> No.68495887

>>68495835
that's baby's first C++

now explain this
struct A final: Foo {
A() = default;
[[noreturn]] virtual void foo() override;
}

template <typename T> concept bool Equal = requires(T a, T b) {
{ a == b } -> bool;
}

>> No.68495893

>>68495860
it is for cruise control

>> No.68495903

Is there some sort of convention for separating multiple files being piped on stdin? I'm doing a graph thingy and I want to use tgf because it's the only sane format that doesn't have oodles of cruft and can be parsed by hand with zero effort, but I want to be able to pipe in several graphs. I could extend tgf with something to delimit individual graphs, but I'm wondering if there's an existing convention for that kind of stuff. Like, I dunno, 0x04 perhaps.

>> No.68495907

>>68495887
>mom I just learned about this C++17 [[noreturn]] and C++2a concepts, isn't it cool?
how cute

>> No.68495912

>>68495887
Is this supposed to be difficult?

>> No.68495913

>>68495887
is this c++17?

>> No.68495923

>>68495887
I bet you feel very proud of that virtual method too.
lmao. Is /g/ full of high schoolers?

>> No.68495925

Graduating in 1 1/2 years. Can some one tell me how do I not end up as a code monkey? What types of places should I look for work?

>> No.68495926
File: 300 KB, 2121x1833, [email protected] [View same] [iqdb] [saucenao] [google] [report]
68495926

>>68495818
you should learn some UI design

>> No.68495929

>>68495912
no but it shows how much shit c++ became with the latest additions

>> No.68495931

I want to get into programming and I want a job with it in the future.
What languages do you recommend I learn ?
I wanted to get more into web dev so I was considering PHP and Javascript (I still need to find a proper course for learning php7 since all of them are still giving php 5.6 that is EOL).
However I was also feeling interested to learn C# (because I wanted to take Unity up as a hobby).
Are there certain languages that would are in demand right now and would be good for a beginner to learn ?
Thanks for reading all of this.

>> No.68495935

>>68495929
All of that is pretty straightforward though. The only objectionable thing really is concepts.

>> No.68495940

>>68495925
MS PhD

>> No.68495942

>2018
>can't split a string
"oh but have you heard about the upcoming non-portable 2D graphics library in the standard yet?"
The actual state of C++ hahaha

>> No.68495948

Any good tutorials/books on ASP.NET, MVC5 and Entity Framework?

>> No.68495960

>>68495555
Nothing since my network got highjacked and I can't fix it.

>> No.68495961

>>68495948
here you go, pajeet
https://www.bccfalna.com/core-asp-net-webforms/

>> No.68495965

>>68495942
even C can split strings

>> No.68495973

>>68495926
Well, I'm not a UI designer and I know that I suck at that shit. Your pic actually looks kinda cool. I think I'm going to use it as a reference.

>> No.68495980

>>68495942
cpp cucks BTFO again

>> No.68495981
File: 523 KB, 640x854, returning.png [View same] [iqdb] [saucenao] [google] [report]
68495981

>> No.68495986

>>68495907
>>68495913
>>68495923
>>68495912
constexpr auto pi = 314LLu;
thread_local decltype(pi) rage = 0b10;

[[deprecated("fuck you")]] char16_t *f() noexcept {
return nullptr;
}

>> No.68495994

>>68495981
Jesus, zero pussy the thread.

>> No.68495997
File: 1.24 MB, 2880x1704, JUST.png [View same] [iqdb] [saucenao] [google] [report]
68495997

>>68495981
AAAAAAAAAAAA

>> No.68496012

>>68495997
>#include "../gl/texture.hh"
Learn to use CMake you literal retard

>> No.68496026
File: 147 KB, 3328x740, Screenshot_2018-09-26 g - dpt - Daily Programming Thread - Technology - 4chan.png [View same] [iqdb] [saucenao] [google] [report]
68496026

>>68495627

>> No.68496030

>>68496012
>he didn't saw the CMakeLists tab
sweetie

>> No.68496041

>>68496030
>having a CMakeLists means I know CMake
RTFM you fucking mongrel

>> No.68496047

>>68496041
>he likes to make assumptions based on a image
sugar..

>> No.68496051
File: 34 KB, 1225x197, Screenshot_2018-11-14_11-20-16.png [View same] [iqdb] [saucenao] [google] [report]
68496051

>the absolute state of webdevs

>> No.68496055
File: 395 KB, 711x590, 1540916378574.png [View same] [iqdb] [saucenao] [google] [report]
68496055

>>68495997
>he copy/pastes SDL headers
THE UTTER STATE

>> No.68496059

>>68496012
but if you (plan to) have different build systems, there is no need to shape your source structure around a single build system

>> No.68496066

>>68495681
Help.

>> No.68496075

>>68496047
I know enough to infer your sheer incompetence when I see a hardcoded "../" into your include directive

>> No.68496084

>>68496075
>NEETs on /dpt/ telling me how to program
honey..

>> No.68496089

>>68496055
>headers
Pretty sure he's copy/pasting the entire fucking SDL codebase
What a fucking retard kek

>> No.68496100

>>68496055
>>68496089
>they didn't the SDL folder in the project structure
babies..

>> No.68496101

>>68496084
How does it feel to learn that a NEET on /dpt/ knows basic CMake but you don't?

>> No.68496108

Is udemy a good place to learn programming from ?
Absolute beginner here

>> No.68496113

>>68496100
>can't even form a sentence
Are you experiencing an autistic meltdown?

>> No.68496121

>sugar
>honey
>babies
Nice defense you got there

>> No.68496124

>>68496108
ask at >>>/wsr/
/g/ is absolutely the worst place to ask about tech related things

>> No.68496127

>>68496101
>knowing a huge bloated C++ build system
>compilation takes longer than compiling GCC
>requires learning a new custom scripting language

yep, sounds something a NEET would spend his time on

>> No.68496137

>>68496075
>hardcoded "../"
What's wrong with this if using C?

>> No.68496142

>>68496121
sweet pie pls

>> No.68496155

>>68496137
there is nothing wrong with it but it can be avoided easily

>> No.68496162

>>68496127
>properly specifying include paths will make my compilation slower
>call others NEET at the even of getting called out for stupidity as if finding a job was a special achievement for him
Peak insecurity
>>68496137
Using C.

>> No.68496163

>>68496155
so you're just complaining for nothing?
classic

>> No.68496167
File: 65 KB, 1920x928, 1520466750303.png [View same] [iqdb] [saucenao] [google] [report]
68496167

Neat

>> No.68496177

>>68496162
what
are you experiencing an autistic meltdown?
>>68496167
neet

>> No.68496193

>>68496137
>What's wrong with this if using C?
Another brainlet. Why do you think using C makes it any different?

>> No.68496204

>>68496193
Because I just looked at a couple mature, quality C projects and they use it.

>> No.68496207

>>68495948>>68495961
ky

>> No.68496209

>>68496127
>Not knowing basic CMake
>Call others NEET

>> No.68496213

>>68496167
>CSV
>comma separated values
>separated by semicolons

>> No.68496214

>>68496124
Guess I'll try there, thanks bruh

>> No.68496223

>>68496209
>knowing basic CMake

>> No.68496226

>>68496204
It's okay, learning something in and out would overflow an average C tard's low capacity brain

>> No.68496236

>>68495831
Then how come they always say everything in Java is passed by value?

>> No.68496241
File: 1 KB, 125x60, 1542223903333s.jpg [View same] [iqdb] [saucenao] [google] [report]
68496241

>Oracle 12.0 is 20 million lines of C code

>> No.68496252

>>68496241
>1542223903333s.jpg
>s
It's $current_year and people still save thumbnails. Jesus Christ.

>> No.68496254

>>68495997
>pragma once
>hardcoding include paths
>litrally pasting 3rd party libs into your project
>pointless C style casting and not checking error
>Not using STL
3/10 see me after class

>> No.68496256

>>68496252
it's just to grab attention, newfag fuck

>> No.68496260

>>68496256
>It's another I was pretending to be retarded episode

>> No.68496262

>>68496254
>see me after class
are you going to suck me off?

>> No.68496263
File: 1 KB, 209x48, 2018-11-14 21_37_09-Python 3.7 (64-bit).png [View same] [iqdb] [saucenao] [google] [report]
68496263

>> No.68496268

>>68495681
I'm also interested, but am also lazy as shit and have no ideas.

>> No.68496270

>>68496226
What are you spewing on about?

>> No.68496271

>>68496256
>newfag fuck
It's "you newfag fuck." Learn grammar.

>> No.68496274

>>68496262
Yes. I like feminine penis.

>> No.68496287

>>68496226
audible kek

>> No.68496293

>>68496270
is this new /g/ meme the?

>> No.68496298

Anyone here graduated CS? Do you show your grades to interviews, do the employers ask for grades?

>> No.68496302

>>68496260
>he STILL doesn't know what image boards are for, instead of text based boards

why do you think a thread with a nude girl attracts more attention than a random picture?

kys

>> No.68496310

>>68496236
Because the values are object references. Pass by reference is not the same as arguments being reference types.

>> No.68496313

>>68496302
>why do you think a thread with a nude girl attracts more attention than a random picture?
Yes, sex sells
wtf is wrong with you?

>> No.68496315

>>68496271
hurr durr

>> No.68496317

>>68496236
Because they are. You're either passing references by values or passing the values of primitive data types.

If you do method1( xyz) then the value of xyz won't change. The stuff inside the object that xyz is referencing might change, but that's entirely different.

>> No.68496321

>>68496293
meant to quote
>>68496271

>> No.68496336

>68496315
>>>/global/rules/3
>>>/global/rules/6

>> No.68496347

>>68496298
Some ask for grades (usually gov contracts). If you have interesting projects they tend to ask about those instead since they are more representative of work.

>> No.68496358

https://leetcode.com/problems/trapping-rain-water/description/

any reason not to sort the enumerated array copy to solve mathematically?

>> No.68496384

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

>> No.68496387

>>68496298
I remember reading on some guy's blog like 5 years ago that he applied to google and they asked him for his college transcripts even though he graduated almost 20 years prior to that. I don't think they do it anymore though or at least I haven't had anyone mention it to me.

>> No.68496395
File: 3 KB, 300x168, feelguy.png [View same] [iqdb] [saucenao] [google] [report]
68496395

>>68495555
im an "student" of programming, that have procastrination(or just pure lazyness).
Being a depressed NEET being bullied by their fathers HURR DURR GET A JOOOOOB does not help at all...
how do you guys make efforts to concentrate and learn programming?
and how to git very gud?
maybe not being english native-speaker only worsen more...
>inb4 asking advice on mongolian throat singing forum
anything is better than nothing

>> No.68496412

>>68496358
Sort? Sort what? Sorting the heightmap would result in a map that couldn't hold any water.

>> No.68496417
File: 89 KB, 766x1000, __ibuki_suika_touhou_drawn_by_batta_ijigen_debris__5ee55547876ec50e04e6a03027018f92.jpg [View same] [iqdb] [saucenao] [google] [report]
68496417

Anyone here that knows JavaFX well?

I'm trying to design a UI for an application that reads and displays data from a database, I like the look of JavaFX and it looks nice to work with, but I'm not sure if I'm misunderstanding something.

I see a lot of tutorials with people directly writing the UI in FXML then binding items via ID's in the FXML to variables and functions in the java, I want to write my UI in fxml and then pass in a list of objects of unknown length and have the fxml deal with that and display it correctly in a table, exactly like you do with web frameworks where you simply pass in a list of objects and it can deal with all the objects by using a foreach construct

i.e. something like below

<for each object in List>
<tr> <td>object.title</td><td>object.content<td></tr>
</for each>

Does fxml support any of this functionality or is it literally just for writing static UI's like a calculator where all the inputs are of a know length in advance?

>> No.68496425

>>68496268
Oh, ok. I'll come back and post it then when I finish it. filename will have "autismo" on it.

>> No.68496439

>>68495613
JavasCript is way better desu

>> No.68496447

>>68496395
How does your father bully you exactly, how old are you and what is your native language?

>> No.68496448

>>68495799
im learning golang now and building an api - its awesome. very lightweight, dont have to use a shit ton of libs - just gorilla/mux for routing. if you like C youll love golang

>> No.68496485

>>68496358
since it is a heightmap isn't it just counting whites between blacks on each level?

>> No.68496488

>>68496448
>if you like C youll love golang
not even remotely similar

>> No.68496493

>>68496417
Sure, you can create nodes from FXML (either from a resource file or directly from a string/input stream) and then insert them into the hierarchy wherever you want. I wouldn't trust JavaFX's layout formatting to be as good or as clever as a web browsers, but you can certainly dynamically construct UIs from a series of objects that are stored in FXML.

>> No.68496535

>>68496485
Basically, but actually building out the 2D black and white map would be excessive and unnecessary, so you're looking for numbers in between two bigger numbers.

>> No.68496604

>>68496448
>if you like C youll love golang
I hope you meant C# because C is awful to program in and doesn't seem similar to Golang.

>> No.68496625
File: 49 KB, 540x540, 1540253299454.jpg [View same] [iqdb] [saucenao] [google] [report]
68496625

>>68496604
>C is awful to program

>> No.68496637

>>68496535
count values < N between first and last N
3: [0,1,0,2,1,0,1,3,2,1,2,1] -> 0
2: [0,1,0,2,1,0,1,3,2,1,2,1] -> 4
1: [0,1,0,2,1,0,1,3,2,1,2,1] -> 2

>> No.68496648

>>68496625
>C is awprogtoramful

>> No.68496658

>>68495973
just go to behance/dribble and copy what You like. No reason to design Yourself if You don't want.

>> No.68496659

do not mind me just running some experiment with text injection
@datadata

>> No.68496669

>>68496659
Did it work?

>> No.68496683

In java getCost()[0] will get me first index of cost array but how do I set the cost of first element in array by using setCost()? do I just need to pass the whole array in parameter?

>> No.68496720

>>68496683
Just pass the position you want to modify and the value to set it to, like setCost(0, 25)

>> No.68496722

>>68496683
getCost(index)
setCost(index, value)

>> No.68496744

>>68496412
tarray = sorted([(k,i) for i,k in enumerate(height)])
not very useful, because tuples in python, but having it sorted by height and retaining the index lets you enter the array from the start, grab the highest two and set them to the lowest of the two, then iterate each time to seek the first and last by index with such height, count the occurrences and thus have the number of rain retained within the range (included) in the row and subtract to it the number of items with the same height you're iterating through, until you reach 1 for all items in the array

The same can be done in reverse, but I'm more interested in actually writing something that will solve now
>>68496485
yes, but only at first and last delimiters in the array at a certain height
It can be done iterating through the entire array each time but it seems wasteful

>> No.68496776

>>68496659
<@144962991106949120> beans beans beans <@144962991106949120>

>> No.68496792

>>68496637
Cut but runs in NxM. If you had a height of 100,000 you'd be doing it 100,000 times.

I'd approach it something like:
-Iterate from left to right
-Keep track of highest left as you go.
-Have an array of pop-counts for heights that are less than the highest right. Basically a mutable collection of (height, number of times height has been encountered) that is binary searchable on height.
-Any time an entry is less than the highest left, increment its height to the pop count. (Also probably keep track of "lowest currently in the pop count" so you only have to do the binary search when needed)
-Each time you encounter a node that's higher than the lowest in the pop count, go through each pop count and (a) add # in popcount * (height of current - height of popcount) to your count (b) increment the popcount of the height of current stack.
-Each time you set a new highest left, flush the popcount.
By the time you reach the right you will have calculated the value.

Should be O(N*ln(N)). Memory has the potential to grow to be N-large, but that's only duplicating memory size of the input.

>> No.68496806
File: 107 KB, 631x1204, anal beads.png [View same] [iqdb] [saucenao] [google] [report]
68496806

>>68496659
>>68496669
>>68496776
Context in pic related.

programing chat is here: https://discord.gg/4TuhPhr

>> No.68496809

>>68496669
>>68496659
yup it works

qqqniggna
<@299540437276950528>

>> No.68496891

Anyone here who works as a programmer do you ever write any "reports" on the programs you wrote or work with?

>> No.68496913

>>68496891
You typically want to use existing software like Power BI or Tableau. See if your company has any business intelligence tools.

>> No.68496934

>>68496792
I guess if you want a very simple efficient solution: you can trim the array as you go [0,1,0,2,1,0,1,3,2,1,2,1]

1: [1,0,2,1,0,1,3,2,1,2,1,] -> 2
2: [2,1,0,1,3,2,1,2,] -> 4
3: [3,]

>> No.68496940

>>68496891
what kinds of reports

>> No.68496953
File: 16 KB, 300x227, Bill-Lumbergh-Office-Space-300x227.jpg [View same] [iqdb] [saucenao] [google] [report]
68496953

>>68496891
>>68496940

>> No.68497032

>>68496940
What program does, how it does it, how you build it and what techniques you used etc

>> No.68497033

>>68496744
I get the idea, but I'm not quite following the precise implementation. In particular this part
"and subtract to it the number of items with the same height you're iterating through, until you reach 1 for all items in the array".

Are you sure you're handling the the multiple containers case? Where it's say [0,3,1,3,0,2,1,2,0.]

>>68496934
If you're going to do that then at least keep track of the next height to check each time you itterate through (the lowest number higher than the current iteration). That way it's
1: [100,0,200,100,0,100,300,200,100,200,100,] -> 2*1
100: [100,0,200,100,0,100,300,200,100,200,100,] -> 2*(100-1)
200: [200,100,0,100,300,200,100,200,] -> 4*(200-100)
300: [300,]
That's at least be O(N*min(N,M)). Throwing scaled-up height maps at your algorithm to see how it performs seems like something that would realistically be done if you're entering this into one of those automated testers.

>> No.68497035

>>68496447
>How does your father bully you exactly?
HURR DURR GO GET WORK , YOU DO NOTHING, NOTHING AT ALL DURRR
(an economic crisis is at the corner, but still)
> how old are you?
27
>what is your native language?
Spanish

i learned Python faster than Java. how bad is python?

>> No.68497051

>>68497032
lol no
we just shove shit in subversion and hope it works

>> No.68497090

>>68497033
>Are you sure you're handling the the multiple containers case?
there is only one big container per row, limited by the leftmost and rightmost two values at least at X height for row X in the map
anything within those delimiters will contain either water or another value, it doesn't matter WHERE it is, as long as you know that the value is at least X

>> No.68497124

>>68496891
Comments on the pushes, comments on completed Tasks/Stories, plenty of diagramming. But the closest thing I'd call "reports" that I do are postmortem write-ups when something went very wrong.

>> No.68497152

>>68497090
Wait you're iterating per row? Then why even bother to sort? Just so you know which height to look for in the next iteration? Seems like you could just do that while iterating.

>> No.68497213

>>68496720
>>68496722
so I want two parameters in my setter?
also no need for getCost(index) since getCost()[index] works fine

>> No.68497299

>>68497213
You're exposing the entire internal array to the outside world? Kind of defeats the purpose of getters and setters.

>> No.68497326

>>68497213
Depending on the language, getCost()[index] might be more expensive, if you're copying and returning the whole array despite only wanting part of it.

In Java, I believe the array is not copied, so you are returning a reference to the same array. That means you could also do getCost()[index] = value instead of a setter. But, getCost(index) and setCost(index, value) is more consistent with how other getters/setters are supposed to work, and how they work in most other Java classes.

>> No.68497381

>>68496417
Drop that shit and switch to Tornadofx (and Kotlin). Then you can build all your views either by hand or by Kotiln's DSLs.

>> No.68497533

>>68497152
if not height or len(height) < 3: return 0
result = 0
currh = None
tarray = sorted([(k, i) for i, k in enumerate(height)])
tarray.reverse()
currh = min(tarray[0][0], tarray[1][0])
smallest = tarray[len(tarray)-1][0]
while currh is not smallest:
count, RLim = 0, 0
LLim = len(tarray)-1
for k, i in tarray:
if k < currh: break
count += 1
LLim = LLim if i > LLim else i
RLim = RLim if i < RLim else i
result += (RLim - LLim - count + 1)
currh -= 1
print (result)

of course it'll time out on larger ones because it's not great, iterating and all.
It should just get the ranges between the largest values and just evaluate all within that range and then condense it by splicing it out of the array and leaving just the lowest value in place

>> No.68497648

>>68495705
Go

>> No.68497681

>>68495828
What? Source?

>> No.68497716

How do I get Into programming?

Are udacity courses worth it? I'm 30 years old and fairly bored in my job. Got enough money to take a break bit ideally looking for something to do in my spare time/in my current job.

>> No.68497721

>>68496448
>gorilla/mux
Slow as fuck. Use https://github.com/julienschmidt/httprouter or https://github.com/dimfeld/httptreemux

>> No.68497745

>>68497716
Learn Lisp.

>> No.68497776

>>68497716
What kind of development are you interested in? (web, mobile, IoT,...)
And as for courses there are plenty of good free things out there like https://ocw.mit.edu/courses/find-by-topic/#cat=engineering&subcat=computerscience

>> No.68497848

>>68497716
courses are a meme
just pick a language and learn it lol
the internet is full of resources

>> No.68497878

>>68495931
Python to start.
For frontend stuff js, backend java.

>> No.68497891

>>68495555
Where is Holy C?

>> No.68497903

>>68497716
Just learn the basics for any C language on any of the free sites and then just advance from there, the internet is full of information.

>> No.68497953

Is MVC redpilled?

>> No.68498021

>>68497878
Cool Stuff
Thanks for taking the time to reply.
I was looking at Udemy since they have a lot of courses that would interest me in terms of programming (at least the higher rated ones).
Is Udemy a good place to learn from or is there a better place for a complete beginner to learn a lot of different languages from (since lynda.com was bought up by linkedin)?
The only thing I have experience is a general IT diploma from a school, some networking (Comptia A+ and Network+ which was handeld very well by a different company) and HTML5/CSS3 (where I wasn't completely satisfied with how it was put together).

>> No.68498022

>>68497953
If you're making a REST API or something then sure. Not so much if actual users are going to be using it.

>> No.68498058

>>68495555
where's assembly?

>> No.68498078

>>68498021
Udemy courses are pretty good, but you'll have to supplement what you learn there with your own projects as well to practice the concepts. You can find torrents for most of the popular courses.

>> No.68498143

>>68498078
>Udemy courses are pretty good, but you'll have to supplement what you learn there with your own projects as well to practice the concepts. You can find torrents for most of the popular courses.

That's great to hear, I already have a domain where I plan to put a lot of different projects for potential employers to browse through so they can see what I'm capable of.

I'm not opposed to paying for the courses (most of them are only 10 bucks for 40+ hours of video ) if they can at least get me up to speed on how I can program and make functional projects.

To put into perspective I was forced to pay for the HTML5/CSS3 course which was around 400 euro for 4 months of coursework (granted this gave you a book worth 50 bucks as well and did extensive projects at each main breakpoint of learning it), 10 bucks to learn at least the basics of a programming language feels like a steal honestly.

Thanks for your advice, I really appreciate it.

>> No.68498197
File: 114 KB, 301x389, 1439311300924.png [View same] [iqdb] [saucenao] [google] [report]
68498197

>>68496806
>programing chat is here: https://discord

>> No.68498264
File: 23 KB, 1511x91, file.png [View same] [iqdb] [saucenao] [google] [report]
68498264

I know you'll flame me but why I cant get into C.Man i dont know what is going on, The easiest stuff I knew how to make it.But once we got to more complex (with loops,cycles) i became brainlet in it. I know it becomes even harder with arrays, matrix, strings etc. Why I cant get into it. I dont understand the exercises cause they give us some mathematic releated things that need at least hour+ for thinking if you are newbie in C. I see naturals think 5-10 mins and GG. How do I develop my thinking and logic. I really wanna learn C.

>> No.68498272

>>68498264
ask questions about the parts that you don't understand

>> No.68498326

>>68495671
>So what's C++'s standard package manager?
Not even a C++ shill but curl and your distro's package manager unironically. It's great because you don't have to install extra shit, but it sucks because there's no standard way that projects are structured and it's often difficult to install packages that aren't extremely well known. Regardless, there seems to be 4 main approaches
>manual installation through lang-specific tool
Python, Haskell
>manual installation through non lang-specific tool
C, C++
>automatic installation through lang-specific tool
Rust, Java/Kotlin (gradle)
>automatic installation through hooks embedded in the language syntax
Nim
Those are the only ones I know off the top of my head. An extensive poll of language package management would be very interesting. Would be interesting to also see how that kind of thing correlates with a language's popularity, age, etc.

>> No.68498333

An unknown number of hexadecimal digits is read from the standard input until a point (.) Is inserted. Your task is to calculate the decimal count of the entered hexadecimal digits. If the resulting decimal count is divisible by 16, Print Score is printed. If the same set, apart from being divisible by 16 plus, ends at 16 (the last digits are 1 and 6), a Full Score is printed, otherwise the sum itself is printed.

Example

input: A 7 F 2 0 c A 5

output: 61

(61 = 10 + 7 + 15 + 2 + 0 + 12 + 10 + 5, the number isnt divisible with 16, neither its last digits are 1,6. ***

I dont know if you can understand but I have this exercise as example, called hexadecimal digits. People are telling me that I can solve these kinds of things in smaller codes but I dont know that too.

Mainly I dont understand For/While/Nesting For's, If's and the %. Another example is if Im needed to make 123 into reverse number. I know the algorithm now but I got it with help. Without help I wouldnt think of it.

>> No.68498337

>>68498264
>file.png
>Good fucking luck tho, because Mathematicians are all complete autists
The pot is calling the kettle black lol.

>> No.68498350

any sepples wizards around?

>> No.68498360

I put that png by mistake I was sending it to my friend and I pasted it here. Didnt know how to remove it XD since im new to 4chan

>> No.68498368

>>68498350
i can be ur wizard 2nite :)))

>> No.68498392

>>68497533
if not height or len(height) < 3: return 0
result = 0
smallest, currh = min(height), max(height)
while currh is not smallest and len(height) > 2:
total, sumiter = 0, 0
tarray = sorted([(k, i) for i, k in enumerate(height)])
tarray.reverse()
Max_H, Max_I, SMax_H, SMax_I = tarray[0][0], tarray[0][1], tarray[1][0], tarray[1][1]
currh = SMax_H
Lindex, Rindex = min(Max_I, SMax_I), max(Max_I, SMax_I)
j = Lindex + 1
while j < Rindex:
sumiter += SMax_H - height[j]
j += 1
result += sumiter
del height[Lindex:Rindex]

>Your runtime beats 23.90 % of python3 submissions.
I'm too lazy to do a proper "find the second highest value in array" case and I don't know if there's a built-in for python
anything else that can be improved upon?

>> No.68498404
File: 46 KB, 1334x499, ot5ky6woj8h01.jpg [View same] [iqdb] [saucenao] [google] [report]
68498404

>>68498368

>> No.68498442

>>68498333
What is a "Full Score?"

>> No.68498449

What do I do after learning the basics of python

>> No.68498457

>>68498404
no -Wextra?

>> No.68498460

What do I do after learning the basics of learning how to drive

>> No.68498462

you're using vscode? disgusting. why aren't you using vim?

>> No.68498474

>>68498457
I'll give you the extra later.

>> No.68498495
File: 606 KB, 1879x2118, 1537806176108.jpg [View same] [iqdb] [saucenao] [google] [report]
68498495

anyone know of a comfy Java library for regex, that actually supports multiple matches by group?
couldn't find one yet. I mean, .NET supports this for sure but the basic java regex library doesn't seem to..

>> No.68498536

>>68498392
you might try moving all variables outside the loops, but python probably handles that

>> No.68498540

What are some comfy books on Assembly?

>> No.68498608

>>68498495
>java.util.regex.Matcher

>> No.68498630

>>68498404
For what purpose?

>> No.68498644

>>68498540
which one?

>> No.68498651

>>68498644
He probably means x86 since that's the only arch that exists :^)

>> No.68498686

>>68495997
put a space between keywords and control flow constructs pls

>> No.68498691

>>68498651
there is this
https://software.intel.com/en-us/articles/introduction-to-x64-assembly

>> No.68498726

>>68498462
Why not vscode with vim mode?
Or literally any editor except vim, but with vim mode?

>> No.68498756

>>68498608
It doesn't support it though. What I'm wishing to do is define a regex group in the string and then getting only one output, not needing to iterate again and again through the text.. regex.matcher only returns one match at a time.
My dream is to do something like "?(<firstGroup>..declaration..)(?<secondGroup>..declaration.." and actually receiving all elements from first group and all from second at once.. C# supports this as I already said

>> No.68498787

>>68498756
write a function that put all in an array?

>> No.68498822

>>68498787
that's what I was trying to avoid

>> No.68498837

>>68498756
>My dream is
You have some rather petty dreams, anon.

>> No.68498884

>>68498726
patrician taste

>> No.68498907

>>68498630
partial class definitions :^)

>> No.68498935
File: 190 KB, 358x358, ada.png [View same] [iqdb] [saucenao] [google] [report]
68498935

>>68495627
>not picking the ISO standard

>> No.68498943

Is there a repository of examples of how to implement different constructs in the various standards of C++ up to C++20?

>> No.68498965

>>68498644
>>68498651
you learn one assembly you've learned them all.
at that point all you have to do is read the developer documentation for the exact flavor of ASM you're working with

>> No.68498988

>>68495926
I can't into UI design either, any useful tips?

>> No.68498992
File: 1.82 MB, 1200x661, capri.png [View same] [iqdb] [saucenao] [google] [report]
68498992

>>68498837
that's just to divert attention from my real dream (pic related)

>> No.68499149
File: 182 KB, 2560x1440, Screenshot_20181114-184512.png [View same] [iqdb] [saucenao] [google] [report]
68499149

>not programming on your phone
Ishygddt

>> No.68499213

>>68499149
thats retarded

>> No.68499281
File: 62 KB, 720x960, 1539000328420.jpg [View same] [iqdb] [saucenao] [google] [report]
68499281

for i in range(1, 101):
i = "fizz-buzz" if divmod(i, 4)[1] is 0 and divmod(i, 5)[1] is 0 \
else "buzz" if divmod(i, 5)[1] is 0 \
else "fizz" if divmod(i, 3)[1] is 0 else i
print(f"{i}")

>> No.68499312

>>68499281
from typing import List
def fizzbuzz(nums: List[int]):
for i in nums:
f = 'fizz' if i % 3 == 0 else None
b = 'buzz' if i % 5 == 0 else None
yield (f,b) if any((f, b)) else i

list((fizzbuzz(range(1,16))))

>> No.68499325

Recommend way of learning Android dev?

Want to build myself a little app, but not sure where to start

>> No.68499354
File: 186 KB, 457x303, 1495658423376.png [View same] [iqdb] [saucenao] [google] [report]
68499354

>>68499312

>> No.68499429

>>68499149
>n^2 unique value detection
ISHYGDDT
Fastest way in python is to convert the values to a set, and assert length is the same. You could do it in 1 line
You can also add it 1 by 1, which will have fast code for when there's repeats (since you can exit early), but realistically slower performance for when it has to go through each item

>> No.68499441

>>68499312
import itertools

def FizzBuzz(tl):
fb = itertools.cycle([None, None, 'Fizz', None, 'Buzz', 'Fizz', None, None, 'Fizz', 'Buzz', None, 'Fizz', None, None, 'FizzBuzz'])
tlc = 1
for fbstr in fb:
if tlc > tl: break
if fbstr: print(fbstr)
else: print(str(tlc))
tlc += 1


FizzBuzz(1000000)

>> No.68499446

Why people like to shit on Python?

>> No.68499462

>>68499446
It's pajeet tier. It's a nice scripting language.

>> No.68499502
File: 45 KB, 720x720, 1495007876339.jpg [View same] [iqdb] [saucenao] [google] [report]
68499502

>>68499441
I love it

>> No.68499512

>>68499446
GLOBAL INTERPRETER LOCK

>> No.68499547

I'm playing around with some Qt code and I want to know if there's a tool that will measure how long each function takes to execute. Or will I have to do an elapsed timer for each function?

>> No.68499574

>>68499547
You can run a profiler instead.

>> No.68499620

>>68499574
Thanks, I didn't know what the term was.

>> No.68499687

So how do you guys feel about SQL? Any recommends on picking that up?

>> No.68499718

>>68499687
You save all your data in json files and load them as needed.

>> No.68499723

>>68499687
Databases are useful, but it's not hard language to learn. It's pretty boring imho.

>> No.68499738

>>68499441
>printing inside of your function
How inefficient.
Write more pure functions.
from itertools import cycle, islice
def FizzBuzz():
fb = cycle([None, None, 'Fizz', None, 'Buzz', 'Fizz', None, None, 'Fizz', 'Buzz', None, 'Fizz', None, None, 'FizzBuzz'])
for tlc, fbstr in enumerate(fb, 1):
yield fbstr if fbstr else tlc

print(list(islice(FizzBuzz(), 1000000)))

>> No.68499739

>>68499723
>>68499718
Better than I was expecting to hear. Thanks.

>> No.68499769

>>68499718
How would you handle race conditions?

>> No.68499827

>>68499769
A different JSON file per row and a different folder per table
Dunno why you guys need to make this complicated

>> No.68499859

>>68499149
>regex to detect if something is an alphabetical character

>> No.68499867

>>68495887
This is trivial shit m8.
What point are you trying to prove exactly?

>> No.68499875

>>68499827
>Dunno why you guys need to make this complicated
Computer programming is a practical skill with practical uses. You should always think about how it would work or fail in a production environment.

>> No.68499876

>>68499859
but it is encoding independent

>> No.68499917

>>68499827
lol this will scale nicely, please get me some timings on searching through a table with 60mil entries

>> No.68499939

>>68499917
No problem. I'll get it to you within an hour

>>68499875
This is the best way and you can't prove me wrong

>> No.68499949

>>68499446
Same reason people like to shit in toilets.

>> No.68499962

>>68499876
Let me give you a hint. e is some sort of list or dict of coded values. You must already know what characters are valid indices for e, since you filled it at some point.
If your encoding scheme doesn't really depend on special properties of alphabetic characters then why are you not encoding anything else?

>> No.68499995

Anyone got a simple HTML+JavaScript thing that lets me use JavaScript to draw pixels?
I want to test an algorithm which the output of can be represented as an image, but I don't have anything readily available for creating and displaying images.

>> No.68500000

>>68499995
look into canvas

>> No.68500001
File: 490 KB, 1460x1519, EBCDIC.svg.png [View same] [iqdb] [saucenao] [google] [report]
68500001

>>68499962
dunno, I just want to talk about this abomination

>> No.68500015

>>68500000
What a waste of a GET.

>> No.68500016

>>68500000
shiiiiiiiiiiiiiiiiiiiiiiiiiiiieeet

>> No.68500099

>>68500001
>All of those gaps
>a-z and A-Z aren't consecutive
Seriously, what were they thinking?

>> No.68500164 [DELETED] 

>>68500099
A lowercase letter is 32 off from an uppercase letter. So literally just flip bit 5 to convert between upper and lower case. It made more sense this way than consecutive. Unicode just inherits ASCII codepoints.

>> No.68500201

>>68499687
SQL queries are basically just verbose set comprehensions. Pretty easy to understand.

>> No.68500210

>>68500099
A lowercase letter is 32 off from an uppercase letter. So literally just flip bit 5 to convert between upper and lower case. It made more sense this way than consecutive. Unicode just inherits ASCII codepoints.
Sorry for the double post. Doubted myself and deleted but checked and I was correct. Bit 5 is of course the sixth bit since we index from 0.

>> No.68500214

>>68500201
join the key-value hype anyway

>> No.68500230

>>68500210
Ascii has the same property, but keeps all of the letters next to each other.
It seriously fucks with the way you compute letters to indexes.
c - 'a' doesn't work.

>> No.68500242

>>68495997
That's it, I am sorry to say this /g/, but you need a stupid programming thread general.

>> No.68500254

>>68500214
I was pretty impressed by the SQLite vs LMDB perf comparison mozilla published recently, but sqlite is fast enough for everything I need and pretty comfy.

>> No.68500258

>>68500214
They're basically glorified dictionaries. I'm a bit suspect of no-sql databases. Also, sql is much more intuitive.

>> No.68500279

>>68500230
Ah, eww I think I was reading that table wrong. I don't understand why anyone wouldn't just use utf-8.

>> No.68500348

does anyone contribute to open source? I'm trying to get more involved in it but I'm finding it kinda hard to find a project with issues I can contribute to
does anyone else do this? how do you find projects?

>> No.68500381

>>68500348
>Find tool/library/service you use
>Go to git* profile
>Implement missing thing or do bug fix
It's that simple. If they don't like your contribution just maintain your own fork.

>> No.68500386

>>68500348
they are filled with elitists scumbags and bullies, not worth wasting time

>> No.68500431

>>68499687
If it helps, SQL was first introduced as a low tier programming language for managers and non programming stuff to handle data. There is nothing magic about it, if you want you can go first the theory route by studying on relational algebra, and a couple courses on how that translates over to SQL. That is it for querying data if you want to design databases, there is any number of methodologies, since you're not taking a class, and hence have no requirements, go over to wikipedia and choose the one that fits best your mental model of dealing with data, but whichever route you go you'll end up sanitizing data so you need to be able to break it down to its atomic parts in the design process and then normalize it. There is one very good book about databases in general, it covers everything from a to z, I don't remember the title now, maybe another anon can help here.
Finally in the good old tradition of 4chin's blog posters, I'll answer your initial question, yes picking up SQL is worth it if only to be able to analyze your History/places.sqlite files with your browsing habits in them.

>> No.68500438
File: 21 KB, 405x289, 1535303222575.jpg [View same] [iqdb] [saucenao] [google] [report]
68500438

I should learn trees and doubly and circular linked list in C for tomorrow
wish me luck, /g/!

>> No.68500450

i spent the entire summer help and open source hentai app
wtf do i do can i show this in my resume???

>> No.68500484

>>68500450
yes; comic reader or japanese themed game

>> No.68500486

In Javascript, how do I achieve the same effect as :WaitForChild(name) in Roblox?
I'm writing some drawing code for testing texturing code, and I need that drawing code to wait for the canvas to load even if the texturing code instantly started calling drawing functions in the base code.

>> No.68500547

>>68500279
7-bit ascii is retarded. Fucking niggerlicious shit.

>> No.68500552

>>68500348
>does anyone contribute to open source?
Yes. I'm a core developer of a project with quite a few users, but I've submitted patches to several other places.
>I'm trying to get more involved in it but I'm finding it kinda hard to find a project with issues I can contribute to
does anyone else do this? how do you find projects?
Most of my contributions to other projects are usually because something in another project I was using was annoying me, so I go and fix it.
Although if you're going around looking for something for the sake of contributing, it would be best to look in an area that you're interested in, and possibly something you already use.

>> No.68500558

>>68500438
Do you have an exam?

>> No.68500562
File: 108 KB, 853x480, mpv-002.jpg [View same] [iqdb] [saucenao] [google] [report]
68500562

>>68500552

>> No.68500569
File: 300 KB, 485x354, 1420229460495.png [View same] [iqdb] [saucenao] [google] [report]
68500569

>>68500438
Trees are great. Tries are my favourite data structure.

>> No.68500584

>>68500569
>Tries are my favourite data structure.
They're certainly an interesting choice, but I have to go with red and black trees.

>> No.68500588

>>68500569
>all these cache misses
miss me with that shit nigga

>> No.68500594

>>68500569
>Tries
https://www.youtube.com/watch?v=AXjmTQ8LEoI

>> No.68500601

>>68500588
But they have so many nice properties and are easy to implement.

>> No.68500626

>>68500558
yeah!
recursion! I hate recursion!

>> No.68500628
File: 196 KB, 1250x1200, njez27doav711.jpg [View same] [iqdb] [saucenao] [google] [report]
68500628

>>68500601
>when you see a good data structure

>> No.68500636

>>68500584
Not him, but RBT are hard to implement off of the top of my head, I need the Big White Book handy to be sure I did not miss anything. Is there another simpler DS that exhibits similar behaviour for search and insert times?

>> No.68500645
File: 48 KB, 553x153, screen.png [View same] [iqdb] [saucenao] [google] [report]
68500645

Redpill me on fibonacci heaps, bros.

What is this black magic?

>> No.68500654

>>68500626
base case branch case, how is this difficult to understand?

>> No.68500659

>>68500626
You won't be having a very good time in your career if you do.

>> No.68500671

>>68500645
That table is misleading. Fibonacci heaps are O(1) in insert, union, and find-min using amortized analysis. If you did your regular babby sophomore Big O analysis you'd think they were O( log(n)) or worse.

>> No.68500702

>>68500659
i hated discrete math at the begining, and now is my favourite math
I should understand the real use of it, I think

>> No.68500756

>>68500702
math is the worst rapist, you start to like it after a while

>> No.68500777

>>68500756
le upboat xDDDDDD

>> No.68500806

>>68500671
using amortized then binomial insert is also Theta(1)

>> No.68500814

>>68500702
Work through SICP, and soon enough most processes virtual or irl will appear to you as a base case bean sprouting and germinating towards the clouds.
I did a high-school specialty focused on math, unsurprisingly called mathematical sciences, and I wasn't seeing the point at all, as a teen I missed a lot on pussy. Came college and in my first two years of cs, all of the things I hated so much in high school gave me wings and I leaped beyond my peers. I realized that I was like one of them red necks stocking on arms and in my life time came a zombie apocalypse, feelsgood.jpg.

>> No.68500815

>>68500671
>O(1) in insert, union, and find-min using amortized analysis
how is this accomplished? seems like black magic to me how any data structure can accomplish those numbers

>> No.68500831

>>68500815
fibonacci is a data structure?

>> No.68500839

>>68500831
im pretty sure a fibonacci heap is a data structure, yes

>> No.68500846

>>68500562
I'm not 100% sure what this reaction image is trying to convey.

>> No.68500870

>>68500815
it's sort of like a circular buffer of circular buffers etc

>> No.68500879

>>68500839
>fibonacci heap
https://en.wikipedia.org/wiki/Fibonacci_heap#Implementation_of_operations

>> No.68500885

>>68500815
amortized proofs are complicated. They were invented by Tarjan (famously wrote something like half of the papers referenced by Introduction to Algorithms by CLRS, also famously a bad teacher).
You can read his paper and hope to comprehend the logic.
https://www2.cs.duke.edu/courses/fall11/cps234/reading/Tarjan85_AmortizedComplexity.pdf

>> No.68500893

>>68500831
>Cormen, et. al. Algorithms. Fibonacci Heaps. p. 505.

>> No.68500960

>Recent experimental results suggest that Fibonacci heaps are more efficient in practice than most of its later derivatives, including quake heaps, violation heaps, strict Fibonacci heaps, rank pairing heaps, but less efficient than either pairing heaps or array-based heaps
https://epubs.siam.org/doi/pdf/10.1137/1.9781611973198.7
Thanks for getting me to pull up algorithm papers are 3 AM, /g/

>> No.68500967

var waitForCanvas = timeoutms => new Promise((r, j)=>{
var check = () => {
canvas = document.getElementById(name);
if(canvas) //Canvas exists
r()
else if(timeoutms <= 0) //Timeout if timer reaches 0
j('timed out!')
else { //Canvas doesn't exist, wait some more
timeoutms -= 100;
setTimeout(check, 100)
}
}
setTimeout(check, 100)
})

(async ()=>{
waitForCanvas(2000)
})()


What's a non-stupid way of starting waitForCanvas?
This doesn't work because waitForCanvas never actually runs, this whole thing is just skipped over.
If I start it without that weird stuff around waitForCanvas, it runs too late.

>> No.68500982

I think I proved P = NP

>> No.68500993

>>68500960
It's pointless though because Fibonacci heaps aren't used anywhere meaningful (such as your operating system scheduler) because they're too difficult to implement properly, in comparison to other heaps.

>> No.68501023

>>68500993
>too difficult to implement properly
i dont understand this argument. surely it would only have to be implemented once and tested thoroughly, right?

>> No.68501034

>>68500982
what is this? P is not P?

>> No.68501049

>>68500982
congrats on your 1 million dollar millenium prize, anon

>> No.68501070

>pascal
>at the top of any of those lists
Obviously prepared by somebody raised in the 60s. Pascal is shit.

>> No.68501079

>>68500967
>>>/g/wdg
Javascript bullshit is not welcome here. Take you abomination of 4-way-mixed asynchronous promises and leave.

>> No.68501082

>>68500982
brainlet here, what is NP and P anyways do they stand for something, I just know it's some unsolved algorithm type thingy

>> No.68501119

>>68501082
go to wikipedia
but P = NP is unlikely

>> No.68501125

>>68499738
>>68499312
>>68499281
perl -e 'say "Fizz"x!($_%3)."Buzz"x!($_%5)||$_ for 1..100'

>> No.68501128

>>68501082
penis and no penis

>> No.68501131

Anyone have a good template for a personal image host like an Imgur clone?

>> No.68501150

>>68501131
Why? File upload sites are trivial to make.

>> No.68501162

>>68500982
In the very off chance that you did, please do deliver your speech like a true /g/ent. Do it for the lulz, you will be immortalized for it more than for the proof itself.

>> No.68501174

>>68501023
I think that windows and Linux devs have enough problems without worrying about the correctness of complex algorithms causing undefined or unexpected behavior in their kernel.
If a kernel was developed using a language where it's piss easy to prove the correctness of an algorithm, as in declarative or functional languages like Erlang, then it may stand a chance.

>> No.68501191

>>68501174
Kernel in Idris 2 S O O N

>> No.68501194

>>68501174
Maybe i'm just dumb, but it seems to me that linux's RCU mechanism is 100x more complicated than implementing a fibonacci heap would be

>> No.68501244

>>68501194
They're much slower and more memory-intensive than binary heaps in practice (except for merges, which are not common heap operations and for which there are simpler ways to improve the performance). They're mostly of theoretical interest since they improve the asymptotic performance of algorithms that depend on priority queues for their implementation.

>> No.68501248
File: 97 KB, 853x480, mpv-001.jpg [View same] [iqdb] [saucenao] [google] [report]
68501248

>>68500846

>> No.68501276

New thread:
>>68501267
>>68501267
>>68501267

>> No.68501278

>>68501150
I don't want to.

>> No.68501483

>>68495627
>cannot scale to modern programming needs

That's a funny way of spelling "hiring fresh out of college c's get degrees masters students on visa who cant into linked list to rewrite your once stable embedded tcp/ip stack in a hipster language because the cto saw some youtube videos about how cool rust is"

>> No.68501683

>>68501483
That's actually bleak, so bleak in fact it can delay ushering the matrix era a couple of centuries.

>> No.68501713

>>68501125
>He doesn't know there's a lot more code his interpreter is doing behind the scenes

>> No.68501996

>>68495555
http://greenlab.di.uminho.pt/wp-content/uploads/2017/10/sleFinal.pdf
Was a good read.

>> No.68502417

>>68500588
That's an implementation detail. Just like graphs, you could store your tree in an array if it's small, doesn't need to be expanded, and can fit in cache.

>> No.68502447

>>68500815
You have to optimize your structure when you find the root node. Basically when you find a node's root by following a path, you may as well make the node point straight to the root. This optimization takes the average runtime down to O(1).

>> No.68502471

>>68500982
Please provide a SAT oracle.

>> No.68503086

>>68499738
pleb idiot

from itertools import cycle, count, islice
fizz_s = cycle([""] * 2 + ["Fizz"])
buzz_s = cycle([""] * 4 + ["Buzz"])
fizzbuzz_s= (fizz + buzz for fizz, buzz in zip(fizz_s, buzz_s))
fizzbuzz = (word or n for word, n in zip(fizzbuzz_s, count(1)))
for z in islice(fizzbuzz, 100):
print z

>> No.68503086,1 [INTERNAL] 

Use the <a href=""https://www.functioninc.in/>function in programming</a> to resolve the problems so learn about all the programming function's like <a href="https://www.functioninc.in/">c function</a>

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