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: 715 KB, 1008x709, blaze_it.png [View same] [iqdb] [saucenao] [google] [report]
67494866 No.67494866 [Reply] [Original] [archived.moe] [rbt]

What are you working on /g/?

Previous thread: >>67487809

>> No.67494894

install shen

>> No.67494911

I want to create a location and match based app with no programming skills and experience. Since i have unlimited time, ill try to do it on my own while learning how to program in the meantime.

Where do i start?

>> No.67494967

>>67494911
learn swift if you're on apple
C++ or kotlin if you're on android.

>> No.67494991

>>67494967
or he could make a web app and access it from both iphones and androids without having to bother programming two different apps one for each platform
the important thing in those apps is the backend anyway

>> No.67495006

>>67494991
well android is a shit platform, so really all he needs is swift.

>> No.67495025

>>67494991
Can web app only be accessed from browser?

>> No.67495029

>>67494866
wrote this thing that tells you the possible shortest paths in order to breed a particular move onto a pokemon.

have to port it from python to js and host it

also have to figure some algorithm in order to do shortest path where there are muiltiple things you have to get.

Sort of like a maze solving algorithm like dijkstra's algorithm but there are also 3 keys you have to pick up to open the door.

>> No.67495033

>>67494866
I like the new pic OP. Almost as good as an anime OP.

>> No.67495034
File: 46 KB, 559x663, emc.png [View same] [iqdb] [saucenao] [google] [report]
67495034

>>67495029
forgot pics

>> No.67495049

>>67495025
No. Think of it this way

Backend
-> Web backend
|-> Web browsers (platform agnostic)
-> Android app
-> iOS app


The important matching logic will be in the backend. I don't know enough about web development but maybe you could combine the backend and the web backend like this

Web backend server
-> Web browsers (platform agnostic)
-> Android app
-> iOS app

>> No.67495050
File: 64 KB, 675x1200, DahnC6ZX0AYWy56.jpg [View same] [iqdb] [saucenao] [google] [report]
67495050

>that 69 yo zoomer who thinks java is faster than c++

>> No.67495056

>>67495050
Who cares about speed? If your language doesn't have monads, applicatives and sum types it might as well be pajeet tier

>> No.67495077

>>67495050
In the general case of an application with a larger codebase, this will generally be true

>> No.67495091

>>67495050
>that cnile who think he is a master programmer but his frameworks can't beat java

Remember to never listen to first year cs students who mindlessly spout memes from a decade ago that they picked up from /r/programmerhumor

>> No.67495119

imagine having such an empty life as a java pajeet in a shit code monkey job, you have to come to an image-board and desperately try to shill it to try and rationalize your time not being wasted.

>> No.67495144

>>67495119
I most likely make more money than you as a Java dev. Must suck knowing that a pajeet language has been gobbling up c++ jobs for 20+ years

>> No.67495155

I have a 64 bit int
let's say i wanted to insert a particular pattern of bits in the 8th to 15th position (basically a char) without chaing the bits at the other positions

using bitops

anyone have any ideas?

>> No.67495172

>>67495144
>who cares about my well being when i have my precious shekels
wwwwwwwwww

>> No.67495188

>>67495155
uint64_t foo = bar;
foo &= 0xFFFF00FF;
foo |= 0X0000AA00;

replace AA with the byte of your choice

>> No.67495225

>>67495155

Setting a 64 bit int bit
>number |= 1L << n;
1L is a 64bit constant value of 1
(you may have to use 1ULL instead? i'm not sure, i haven't done this with 64 bit ints)

Clearing a bit
>number &= ~(1L << n);

>> No.67495280

>>67495188
this seems to work
i also found that for example let's say i have
0 1101 1 and i want 0110 to be the middle 4 bits

following works
0 1101 1 xor 0 0110 0 -> 0 1011 0

0 1011 0 xor 0 1101 0 -> 0 11 0

since of course (A xor B) xor A = B

>> No.67495330

>>67495091
cniles != sepplesfags

>> No.67495430

>>67495188
>>67495225
by the way
do you think this will be faster than just storing the chars in an array

using a 64 bit int as an array and using bitops as access?

>> No.67495469

Reminder to prefer use C++ as a declarative template metaprogramming language.

>> No.67495472
File: 54 KB, 625x600, WOdPxmVwH4nhaYR5bDdg-A.png [View same] [iqdb] [saucenao] [google] [report]
67495472

>"hey, you can simplify this code"
>it works differently now
what a piece of shit

>> No.67495491

>>67495469
C++
templates
not even once

>> No.67495499

Hi, i am this guy
>>67494825
I settled on Selenium/Python but i have few problems.
1. Selenium wont load default chrome profile. Every time it goes to website, i am logged off so i need to log in automatically to post anything. How to "export" default chrome profile to code?
2. I cant use Firefox instead of Chrome. I downloaded geckodriver and copied it to /usr/local/bin but to no avail
3. I managed to go to website and click "log in button" with Selenium, but its only start of problem. Fields where i input Username and Password are hidden in myriads of divs and classes and even tho i discovered correct id name for login_field code wont put username there directly.

So what i need to do: login with Selenium to my account (or export default Chrome profile to Selenium). Then input text into text field in shoutbox and just spam those fuckers into oblivion. Here is what i wrote but please help me with login
from selenium import webdriver
#from '/usr/local/bin' import geckodriver

webpage = r"website_url"
searchterm = "comment"

driver = webdriver.Chrome()
driver.get(webpage)

login = driver.find_element_by_id("sign_in")
login.click()

#//*[@id="sign_in_popup_popup"]
loginuser = driver.find_element_by_xpath('//*[@id="ips_username"]').find_element_by_class_name('input_text')
loginuser.send_keys("username")

passwuser = driver.find_element_by_id("ips_password")
passwuser.send_keys("password")

loginbutton = driver.find_element_by_class_name("ipsButton")
loginbutton.click()

sbox = driver.find_element_by_class_name("input_text")
sbox.send_keys(searchterm)
####

submit = driver.find_element_by_class_name("input_submit")
submit.click()

>> No.67495509

>>67495491
But modern c++ is written in templates. They are more verbose than in other languages but that’s what you get when you want speed

>> No.67495531

>>67495491
>>67495509
https://www.youtube.com/watch?v=UyK9geJasjE

>> No.67495549

>>67495509
>muh speed
With each passing year this is becoming more of a non-argument outside of AAA 3d games. But even some AAA companies are trying alternatives.

>> No.67495569
File: 60 KB, 500x495, 1505585825556.jpg [View same] [iqdb] [saucenao] [google] [report]
67495569

>>67495549
>this is becoming more of a non-argument outside of AAA 3d games

>> No.67495572

>>67495569
dumb frogposter

>> No.67495589

>>67495569
GC'd langs are catching up and even beating C++ at times.
Even at Facebook they used a C++ preprocessor written in D. Which highlights the absolute state of sepples.

>> No.67495641

>>67495549
I agree. But if speed is not an issue don’t program in C++. If you’re going to use cpp do it the right way, with templates.

>> No.67495665

>>67495589
GC is orthogonal to the language, the main overhead comes from the memory footprint and not the collection speed. Also you're having trouble with the notion of "using appropriate tools". I'd probably write a preprocessor using Haskell or OCaml rather than C++. Your post only highlights the absolute state of your retardation.

>> No.67495696

>>67495589
Irrelevant to "[muh speed] is becoming more of a non-argument outside of AAA 3d games"

>> No.67495707

>>67495665
So the language not being the appropriate tool to write its own preprocessor is not a problem at all?
alright m8.

>> No.67495708

>>67495589
gcollection needs more memory

>> No.67495727
File: 319 KB, 1096x1349, Grace_Kelly_MGM_photo.jpg [View same] [iqdb] [saucenao] [google] [report]
67495727

>>67495696
aaa games actually use garbage collection a plenty. for example, gears of war code base is 90% made of unreal script.

>> No.67495732

if I want to do something productive with Lisp what should I choose? CommonLisp or Clojure?

>> No.67495733

>>67495665
Memory footprint and collection overhead are interconnected issues. As the memory footprint grows the collection overhead decreases because collection cycles can become less frequent.

>> No.67495754

>>67495732
clojure is not really a lisp but it's definitely ready for production.

>> No.67495760

>>67495754
why isn't it a lisp?

>> No.67495772

>>67495760
>muh brackets
it's a lisp, ignore lisplets.

>> No.67495779
File: 284 KB, 696x542, 1373694480124.png [View same] [iqdb] [saucenao] [google] [report]
67495779

>>67495760
don't want to go into this discussion again. if you are a beginner, maybe you shall actually consider clojure as a lisp.

>> No.67495787

>>67495772
yeah and js is also lisp and XML makes java acceptable lisp.

>> No.67495791

>>67495779
I'm just not familiar with the language, I don't have any particular bias toward Clojure.

>> No.67495800
File: 25 KB, 704x528, 1458780613244.jpg [View same] [iqdb] [saucenao] [google] [report]
67495800

>>67495787
>js is also lisp
are you serious or joking ?

>> No.67495804
File: 35 KB, 357x415, 1505302543958.jpg [View same] [iqdb] [saucenao] [google] [report]
67495804

>>67495779
is kyoko sick??

>> No.67495805

>>67495472
So file a bug.

>> No.67495809

>>67495787
no one argues those things. When the author of the language says it's a dialect of Lisp, it's a dialect of Lisp.

>> No.67495811

>>67495006
brainlet

>> No.67495817

>>67495589
>preprocessor
>implying anyone cares about a few % difference in the preprocessing phase of build

>> No.67495818

>>67495029
simplest way i can think of is creating a graph data structure, i have no idea about pokemon so if somehow edges have weights (some transformation take longer/consume more resources or something) then use dijkstra's algo (considering no negative weight) to pick up three keys, simple modify the algorithm to return a special value to indicate an impossible path unless three keys are picked.

If graphs are unweighted use simpler algorithms like modified BSF
Also, you can export the complete graph DS into a static JSON and use it with whatever language/platform you want.

>> No.67495819

>>67495804
she's just overloaded on presence.
something you don't need to worry about.

>> No.67495838

>>67495754
well, I would love to use Racket but there is not documentation and/or libraries to do anything.

>> No.67495871
File: 70 KB, 374x486, 3A892590BE97412CB41D24532BA2C588.jpg [View same] [iqdb] [saucenao] [google] [report]
67495871

>>67495732
>something productive
>with lisp

>> No.67495888

In java, is there any benefit to using an object for something with only one string in it, such as an object animal that only holds the name of the animal or a genre object that only holds the genre string? Or would it be better off to just use a String. We were required to do this in one of our university assignments, not sure if there's a certain advantage or just to improve our ability to work with and understand objects.

>> No.67495893

>>67495871
implying Lisp is not a productive language
>unlimited brackets and indentation is better

look at this imperative pleb.

>> No.67495900
File: 168 KB, 675x601, 1530330667534.jpg [View same] [iqdb] [saucenao] [google] [report]
67495900

>>67494866
>What are you working on /g/?
Managing my record collection with a COBOL CRUD program.

>> No.67495909
File: 32 KB, 1920x1080, lambdabg.png [View same] [iqdb] [saucenao] [google] [report]
67495909

>>67495871
there are people who have been much more productive with lisp than you will ever be with whatever the language you are using now. never forget that.

>> No.67495915

>>67495893
>waaaaaahhhh lisp is productive
Yet you can't make a text editor http://archive.is/mnbNo

>> No.67495918

>>67495915
what is Emacs? Light Table? DrRacket?

>> No.67495938
File: 318 KB, 1622x804, Capture.png [View same] [iqdb] [saucenao] [google] [report]
67495938

>>67495818
hmm yeah basically each pokemon has a list of "egg moves" that it can pass down and either belongs one or two of around 15 "egg groups". Pokemon can only breed with other pokemon that belong to the same egg group, so I webscraped and generated adj. lists for each move so I could make a digraph

not sure if this was the most efficient method though.

>> No.67495953

>>67495918
Nothing that relies on Lisp itself alone.

>> No.67495960

>>67495918
Emacs is 15.7% C

>> No.67495961

>>67494866
Why does he strike me, on this picture as well, as an empty suit?

>> No.67495982

>>67495953
jscheme is entirely made in scheme, from compiler to ide.

>> No.67496033

>>67495982
>jscheme
>written in pure java 1.1
The state of lispfags.

>> No.67496072

>>67495499
Please help
I loaded profile successfully. And running script opens instance of Chrome on already logged website of my choice. Now i want to post it:
sbox = driver.find_element_by_class_name("input_text")
sbox.send_keys(searchterm)
####

submit = driver.find_element_by_class_name("input_submit")
submit.click()

But it wont work!

>> No.67496095

>>67496033
http://www.jazzscheme.org/

>> No.67496124

>>67496095
>The requested URL /~lasallej/jedi-2.6-linux-intel32.tar.gz was not found on this server.
alright then

>> No.67496153

>>67496095
>points out mentioned project was not what was claimed
>"wait lemme give you another link"

>> No.67496206

>>67496124
the site is no more maintained but the project is (https://github.com/jazzscheme/jazz/commits/master)

>> No.67496225

>>67496206
>scheme 9.9%
????????????

>> No.67496245

>>67496225
because most of code is written in jazz scheme (.jazz files). are you really this retarded?

>> No.67496266

>>67496245
>C 84.9%
???????????
Why is it so difficult for lisplets to showcase a project written in 100% lisp/scheme?

>> No.67496299

How the fuck do you set the mirror list priority of pacman?
My pacman always uses the farthest mirror on earth before failing and connecting to the one in my city.
How to set the mirror priority?

Switching to arch is a mistake

>> No.67496305

>>67496072
post the general structure of the site if you cant post the actual site itself

>> No.67496307

>>67496266

https://github.com/search?utf8=%E2%9C%93&q=repo%3Ajazzscheme%2Fjazz+extension%3A.c&type=Code&ref=advsearch&l=&l=

>> No.67496325

>>67496299
>Switching to arch is a mistake
ah yes, this is definitely a wide-spread issue in arch and definitely not a PEBKAC

>> No.67496411

>>67494911
Ionic Framework
Super easy and cross-platform (write once, deploy thrice). I single-handedly wrote my senior project app in it in a few weeks. I was the only one on my team who knew how to code.
If you know general web development, the transfer of skills is very easy (and if you don't, you can learn HTML/CSS in days with W3Schools). Docs are very good, and there's built-in functionality for using almost everything from android (audio, camera access, mic access, GPS, etc)

I highly recommend it if you have no programming skills. All you really need to learn is Javascript and HTML/CSS. Maybe a bit of typescript if you're using the newer versions.

>> No.67496466

>>67494911
I would say start by not doing your app, it will only lead to frustration. Decide to take a month or two *just* for learning programming, don't even think about the project. Then you can start working on it.

>> No.67496468

>>67496305
Thank you for interest
Here is code for shoutbox
https://pastebin.com/fnQBdfSq
Specifically i think here starts: input-field, and besides: Shouts, Prefs etc buttons

>> No.67496507

Why do people use highly abstracted languages?

>> No.67496514

>>67496468
<td class="altrow" colspan="2" valign="top"><input id="shoutbox-global-shout" size="70" class="input_text" type="text"><input id="shoutbox-submit-button" value="Shout" class="input_submit" type="button"><input id="shoutbox-clear-button" value="Clear" class="input_submit alt" type="button"><input id="shoutbox-refresh-button" value="Refresh" class="input_submit alt" style="" type="button"><input id="shoutbox-smilies-button" value="Smilies" class="input_submit alt" data-clicklaunch="populateSmilies" data-scope="shoutbox" type="button"> <input id="shoutbox-bbcode-button" value="BBCode" class="input_submit alt" type="button"><input id="shoutbox-myprefs-button" value="My Prefs" class="input_submit alt" type="button"></td>

>> No.67496517

>>67496507
why not?

>> No.67496552

>>67495077
How?

>> No.67496573

>>67496517

You lose flexibility? It's slower?

>> No.67496582

>>67496573
I have more control in an FPL than i do i C when it comes to types.

>> No.67496593

(s-expressions (on (shit (people (do why))))) (readable (perfectly (are (they))))

>> No.67496607

>>67496573
>you lose flexibility
no
>it's slower
a bit, and up to a point. hand written assembly can be slower than C code because the compiler can be better at assembly

>> No.67496649
File: 76 KB, 720x720, the wall.jpg [View same] [iqdb] [saucenao] [google] [report]
67496649

>>67494866

I think this might be a very dumb question, but here it goes: I developed a log parser in Java (using IntelliJ as IDE, if that matters), and it runs on the console/terminal as expected, receiving inputs and printing out outputs.


Now here's me question: I've built a .jar file of it, but how do I turn this into an executable that launches a terminal/console windows when run?


pic unrelated

>> No.67496756

>>67496593
s expressions are shit
the only advantage they have over standard fpl syntax is that your expressions can have variable arity. who cares

>> No.67496769

>>67496307
...and?

>> No.67496928

what is a monad:
1) a monad m is a context. it's like a real-world box: you can put things (that is, values) into this context and theoretically take them out.
2) it has a function "return". this is just putting a value into the context.
3) it has a function ">>=" called bind, which takes a monadic (that is, in-context) value and a function that puts an out-of-context value to some new monadic/in-context value. this more-or-less does the following: given a monadic value ("m a") and a function f specified before ("f: a -> m b"), >>= simply removes the context from a and then applies it to f.
4) Another binding is ">>". If you have a monad m and values a and b, then "m a >> m b" (without using Haskell notation) is really just "m a" >>= "f: anything -> m b". That is, as long as a is *something*, >> will bind "m a" to "m b"; f isn't actually specified if you solely use >> and have already made "m b". This *something* depends on what exactly the monad is: with Maybe, it has to be a Just value, not Nothing. Comparatively, with IO, you can abuse what many IO functions return to do sequential actions via >>: many output functions -- after writing to output -- return the IO monadic value (), which isn't Nothing but is really nothing-to-do; when you have nothing-to-do, >> doesn't return nothing-to-do again but rather just does what's on the right side (assuming what's on the right side is also an IO monadic value). So, print("hello") >> print(", world!") does what you'd expect (again, not using Haskell notation/functions).

>> No.67496939

>>67496928
no

>> No.67496995

>>67496928
You're describing the implementation details.
A [monad] is an [monoid] in the [category] of [endofunctor]s. Look up each word on Wikipedia and be enlightened.
Pro tip: even me with my 5 braincells is able to comprehend it.

>> No.67497048

>>67496939
yes
>>67496995
no, because neither category nor endofunctor are applicable in 99% of the contexts in which monads are used in functional programming

>> No.67497072
File: 35 KB, 800x450, DcSZGc_WsAEVyOD.jpg [View same] [iqdb] [saucenao] [google] [report]
67497072

>>67497048

>> No.67497085

>>67497048
Really nigga

>> No.67497095

>>67497048
>no, because neither category nor endofunctor are applicable in 99% of the contexts in which monads are used in functional programming
Wait, what?

>> No.67497176

Why even learn to program when you cannot program a gf

>> No.67497203
File: 193 KB, 1600x900, 1488560520261.jpg [View same] [iqdb] [saucenao] [google] [report]
67497203

>capitalization matters

>> No.67497209

>>67495029
can i get a copy i think my girlfriend would like it

>> No.67497234
File: 36 KB, 550x440, 1494672168960.jpg [View same] [iqdb] [saucenao] [google] [report]
67497234

#include <iostream>
#include <cstdlib>

int main()
{
srand(time(NULL));
int elligent;
elligent = (std::rand() % 200);

std::cout << "You have an IQ of " << elligent << std::endl;
if (elligent >= 150)
std::cout << "Congratulations, you have a very high IQ." << std::endl;

return 0;
}

When do I get a job?

>> No.67497251

>>67497234
dumb frogposter

>> No.67497253

>>67497234
right now as long as you aren't a white heterosexual cis male

>> No.67497262

>>67497176
>he doesn't know the secret

>> No.67497282
File: 44 KB, 657x527, 1502182880641.png [View same] [iqdb] [saucenao] [google] [report]
67497282

>looking in gRPC
seems nice so far

>> No.67497310

>>67497282
stupid frogposter

>> No.67497341

Friday evenings are my dedicated beer+anime evening so nothing.

>> No.67497418
File: 845 KB, 1677x1028, supercollider.jpg [View same] [iqdb] [saucenao] [google] [report]
67497418

I'm not sure if I belong here but whatever. Next monday I start an intro to programming class at community college. I wanna learn to program to get a job but also I'm interested in learning to code electronic music. So anyway right now im going through the examples in a book to learn Supercollider, which I want to use to build a replacement for a modular synth I couldn't afford. Anyone have experience with coding audio shit in general or have any advice? Is there anyone here that does live coding? I'm surprise with all the programmers here I havent seen any live coders but I guess that's just cause live coding got me interested in programming in the first place.

>> No.67497506
File: 449 KB, 600x598, elmo cocaine.png [View same] [iqdb] [saucenao] [google] [report]
67497506

>>67497234
>int elligent

>> No.67497643

>>67495172
Thats a lot of cope

>> No.67497708

Any good tkinter books? I think ive solved my sorting problem from last night (not effeciently but hey it werks). Now id like to package it in a gui. Maybe add more features next week. Thoughts

>> No.67497806

>>67496299
>Do that only once
pacman -S reflector
>Do that once a week
reflector --save cat /etc/pacman.d/mirrorlist --sort rate --latest 21

>> No.67497813

>>67497708
So far ive just been watching new boston tutorials on youtube

>> No.67497826
File: 45 KB, 561x576, WHY IS THIS SHIT SO CONFUSING.png [View same] [iqdb] [saucenao] [google] [report]
67497826

did intel purposely made their fucking registers name so software can run slower? wtf is this fucking naming convention

>> No.67497832

>>67497418

Yeah Ive coded audio stuff. I tried super collider a bit.

I dont have any advice. I ended up just writing all my own audio generation software from scratch. Heres my favorite thing I ever made with my own software: www youtube com/watch?v=zRoQdSoUfHQ

>> No.67497868

>>67497826
the explanation, like usual, is historical

>> No.67497869

>>67497826
it makes a lot of sense when you realise it wasn't all made at once

>> No.67497871

>>67497418
Wtf is live coding? Am i dead coding?

>> No.67497885

>>67497868
>>67497869
if the naming convention allows integer after a character, why not just name them a8, a16, a32, a64????????????????????????????????????

>> No.67497893

>>67497826
Most of that comes from older stuff. It makes sense when you learn it, and it probably made even more sense for people in the field long ago.

>> No.67497906

>>67497871
you stream yourself programming.
It's extremely unproductive.

>> No.67497911

>>67497826
Intel is finished anyway, who cares.

>> No.67497914

>>67497885
imagine there are 16 bits and a few general purpose registers
we'll call the general purpose registers a, b, c, d
and we'll call the higher 8 bits h and the lower 8 bits l
al, ah, bl, bh, ...
now we've got more bits (32), we need to refer to the lower 16 bits, hence the x
again with e and r
you've got other stuff like stack pointer, base pointer, etc

>> No.67497915

>>67497906
Like on YouTube? Thats queer. I guess its a good way to learn tho for those watching

>> No.67497922

>>67497911
>implying Intel and AMD don't pre-plan who controls which years to avoid monopoly talk

>> No.67497923

>>67496466
Ok, that sounds good. Know of an efficient way to going about getting that base knowledge?

>> No.67497931

>>67497922
Redpilled. They share board members. Google it

>> No.67497932

>>67497915
Jonathan Blow is interesting to watch, especially when he works on his Jai compiler.
Haven't found anyone else i like though.
I've come across some guy who's done emulation stuff in haskell though.

>> No.67497942

>>67497923
Books and YouTube help but mostly trail and error

>> No.67497972
File: 126 KB, 604x516, 1535845248881.jpg [View same] [iqdb] [saucenao] [google] [report]
67497972

What's the best programming language?

>> No.67497982

>>67497972
the one that makes your heart doki doki

>> No.67497985

>>67497826
>run slower

But symbols have no impact on performance?

>> No.67497989

>>67497906
>>67497871
people code music in real time for an audience, often with the code projected on a screen.

>> No.67497998

nano-optimizations. this
using char_slice = std::pair<const char*, const char*>;

void put_slice(const char_slice &s)
{
std::for_each(s.first, s.second, putchar);
putchar('\n');
}


is two arm asm instructions less than
using char_slice = std::pair<const char*, const char*>;

void put_slice(const char_slice &s)
{
for (auto first = s.first; first != s.second; ++first)
{
putchar(*first);
}
putchar('\n');
}

>> No.67497999

>>67497972
the one that is most suitable for the task at hand

>> No.67498002

>>67497972
dumb frogposter

>> No.67498022

>>67497832
>I ended up just writing all my own audio generation software from scratch.
that's hella cool man.

>> No.67498044

>>67497832
is that like a tracker you made?

>> No.67498137

>>67497923
If you want to make an android app you should learn java.
Check the english version of mooc.fi to get started.

>> No.67498157

>>67494866
someone help me improve this pls
https://pastebin.com/VyBDFxxY

first one works for the standard catalog but the commented out one is for 4chanx.
It doesn't work because it fires much too early when the catalog isn't built yet - same for the load event.
last one is my shoddy workaround

>> No.67498256

>>67494866
What is /g/'s preferred IDE for C++ on linux? Is QtCreator an acceptable choice?

>> No.67498479

>>67497922
>amd
>controlling a year ever
nice meme

>> No.67498506

>>67498256
Never used that one myself, but Vim serves me fine.

>> No.67498568

thinking about using slices instead of cstrings for a small embedded thing I'm working on:

using char_slice = std::pair<const char*, const char*>;

static void put_slice(const char_slice &s)
{
std::for_each(s.first, s.second, putchar);
putchar('\n');
}

template<size_t N>
size_t split(const char_slice &s1, const char_slice &s2, std::array<char_slice, N>& argv)
{
const char* first = s1.first;
const char* last = s1.second;
const char* match = nullptr;

size_t argc = 0;

for (; (argc < N) && (first != last); ++argc) {
first = detail::search_not(first, last, s2.first, s2.second);
if (first == last) { break; }
argv[argc].first = first;
match = detail::search(first, last, s2.first, s2.second);
if (match == last) { argv[argc].second = last; argc++; break; }
argv[argc].second = match;
first = match + (s2.second - s2.first);
}
return argc;
}

int main()
{
const char *s = "as series of swords";
const char *m = " s";
std::array<char_slice, 16> slices {};
size_t count = split(char_slice{s, s + strlen(s)},
char_slice{m, m + strlen(m)},
slices);
for (size_t i = 0; i < count; ++i) put_slice(slices[i]);
}

>> No.67498601

>>67498256
I've also heard good stories about CLion. Not that I use it myself. I'm too intellectual for C++.

>> No.67498669
File: 82 KB, 790x837, 1536113514029.jpg [View same] [iqdb] [saucenao] [google] [report]
67498669

What are you guys working on?

>> No.67498706

>>67498669
dumb frogposter

>> No.67498723
File: 8 KB, 179x282, 1535750964026.jpg [View same] [iqdb] [saucenao] [google] [report]
67498723

>>67498706

>> No.67498756

so according do cpp daddy an adult programmer should now at least 5 programming languages

pick your poison and get a job

system lang: C/C++/Rust/D
vm lang: Java/Clojure/C#
scripting: Python/Javascript/Lua
sh: bash/poweshell
autism: Haskell/Prolog

>> No.67498780

>>67498756
onions: Rust

>> No.67498781

>>67498723
stupid frogposter

>> No.67498827

>>67498756
Is powershell really a language

>> No.67498875

>>67498827
is poop really food?

>> No.67498892

>>67498875
to rabbits and sloths it is

>> No.67498895
File: 1.15 MB, 900x900, 1533062573819.png [View same] [iqdb] [saucenao] [google] [report]
67498895

>Have idea for compression algorithm
>Implement it, doesn't compress at all
>Actually increases file size
>Has weird edge cases that cause some data to be lost during "compression"
>For example, decoding the encoding of "Hawaii" yields "Hawai"
>Fixing those problems makes it bloat files even more
>Trying to make it actually compress the file leads to ambiguities

So /dpt/, any ideas for the applications of a file bloater?

>> No.67498901
File: 67 KB, 1364x888, DANK MEME 2018-09-07 at 22.06.31.png [View same] [iqdb] [saucenao] [google] [report]
67498901

>>67498044
Yeah. Heres a screen shot of the most recent tracker Im working on.

>>67498022
thanks

>> No.67498904

>learning about monads
>seem to be doing alright
>first exercise: design the easiest monad (identity monad)
>absolutely stumped
I'm not cut for this

>> No.67498907

>>67498904
newtype Identity a = Identity a

>> No.67498921

>>67498904
btw "design a monad" is a pretty retarded exerise
>>67498907 (write the instances)

>> No.67498927

>>67497972
stupid frogposter

>> No.67498930

>>67498875
No

>> No.67498933
File: 150 KB, 662x682, Screen Shot 2018-09-07 at 20.47.33.png [View same] [iqdb] [saucenao] [google] [report]
67498933

>>67497972

>> No.67498935

Best python IDE?
I'm a vim guy, but I'm feeling lazy.

>> No.67498947
File: 8 KB, 270x187, 1535659068478.jpg [View same] [iqdb] [saucenao] [google] [report]
67498947

What is a monad?

>> No.67498954

>>67498568
this is the search_not I use. probably has bugs

// search_not -- return the first item in [first, last)
// for which the search [s_first, s_last) mismatches
template<class ForwardIt1, class ForwardIt2>
ForwardIt1 search_not(ForwardIt1 first, ForwardIt1 last,
ForwardIt2 s_first, ForwardIt2 s_last)
{
ForwardIt1 prev = first;
for (; ; ++first) {
ForwardIt1 it = first;
for (ForwardIt2 s_it = s_first; ; prev = it, ++it, ++s_it) {
if (s_it == s_last) {
first = prev;
break;
}
if (it == last) {
return last;
}
if (!(*it == *s_it)) {
return first;
}
}
}
}

>> No.67498957

>>67497923
depends on how you learn. Just learning a language is boring; and its hard to image how you can apply the learned stuff. I'd try to start as early as possible with the project, else you probably get bored / overwhelmed, without anything to show for it.

When you learn a new language / framework or generally a new skill, you have to try a few times. So be prepared to throw everything down the gutter and start from scratch a few times.

Good luck & have fun. Its a long journey, but very rewards once you are on the right track.

>> No.67498966

>>67498907
Doesn't a monad need a unit function and a bind operator?

>> No.67498967

>>67497972

Its Haskell

>> No.67498989

>>67498947
dumb frogposter
>>67498966
yeah, Identity is the type constructor, write the instances, i.e.
instance Functor Identity where
fmap = _todo1
instance Applicative Identity where
pure = _todo2
(<*>) = _todo3
instance Monad Identity where
return = _todo4
(>>=) = _todo5

>> No.67498992

Monads are elementary individual substance that reflect the order of the world and from which material properties are derived.

>>67498947
dumb frogposter

>> No.67499008

>>67498947
class SpaceSuit s where
shield :: (a -> b) -> s a -> s b

class SpaceSuit b => Burrito b where
wrap :: a -> b a
eat :: b a -> (a -> b c) -> b c

>> No.67499028
File: 8 KB, 228x221, 1535398543950.jpg [View same] [iqdb] [saucenao] [google] [report]
67499028

Is haskell actually used for anything useful? Seems pretty useless to me...

>> No.67499037

>>67498989
the types are as follows:
_todo1 :: (a -> b) -> (Identity a -> Identity b)
_todo2 :: a -> Identity a
_todo3 :: Identity (a -> b) -> Identity a -> Identity b
_todo4 :: a -> Identity a
_todo5 :: Identity a -> (a -> Identity b) -> Identity b

>>67499028
Stupid frogposter

>> No.67499062

It would be neat to have a functional programming language where you have to either guarantee that fusion is possible or otherwise implement a lower level version of the functional specification.

>> No.67499083

>>67499062
You can probably do this in an existing language.
As an example, an applicative (but not monadic) Fold type can guarantee you accumulate everything you want in exactly one fold.

>> No.67499094

>>67499037
so the return and bind functions both return a monad
the bind takes a monad, unwraps the value and passes it to a function that takes that value and returns a monad?
caveman explanation aside, is this kind of how they work?

they look like such a useful concept and seeing how LINQ uses monads in disguise it seems like i should really learn this

>> No.67499099

Whats a proper structure for a mesh triangle datastructure? I tried std::vector<float[3]>
and std::vector<std::vector<float>> but the compiler shits on me.

Guess i could flatten the whole thing but thats less comfy

>> No.67499100

someone please explain how to into surround sound output
ffmpeg’s libraries have horrible horrible documentation
don’t need anything too fancy and i would hope im just being a literal retard who doesn’t understand audio programming at all

>> No.67499117

>>67499099
isn't there a standard way of representing them? sounds like you're trying to reinvent the wheel
disclaimer i know nothing about 3d graphics

>> No.67499118

>>67499099
std::vector<std::array<float, 3>>?

>> No.67499122

>>67499099
Try std::vector<std::array<float, 3>> or use a struct for individual vertices. You definitely don't want to (actually, you just can't) use std::vector<std::vector<float>> as that won't be contiguous.

>> No.67499125

>>67499094
Sort of, it's the types that matter*. For certain monads you're right (like Identity). For other monads there may be zero-or-one values (Either) or multiple values (List, Tree) or something else. It's a good intuition to start with though.


*technically there are laws but worry about them later

>> No.67499132
File: 8 KB, 226x223, pll.jpg [View same] [iqdb] [saucenao] [google] [report]
67499132

Imaging wasting your life jacking off to your high school understanding of category theory and functional programming while doing nothing productive in your mom's basement

>> No.67499145

>>67499094 >>67499125
So for instance, for the Maybe monad, rather than "unwrapping it and passing it to the function", you do a case analysis - there may be Nothing there, in which case you give back Nothing (without using the function) - otherwise you can "unwrap" it and pass it to the function
>>67499132
dumb frogposter

>> No.67499151
File: 7 KB, 225x225, 1514499426373.png [View same] [iqdb] [saucenao] [google] [report]
67499151

Trying to get 2 LEDs to blink left left, right right, increasingly faster when I press a button.
Is there a way to predict how fast it'll blink w/o delays by looking at the microprocessor specs or something? What limits the max speed?

>> No.67499156

>>67499125
yeah figured it was a very rudimentary explanation but as long as it serves as babby's first step that's fine

>> No.67499187

>>67499145
Right, that makes sense. No point in using the function if the type is Nothing.
So when working with monads do you just use the standard ones like Option or List, or do you make your own too?

>> No.67499190

>>67499100
With stereo output you interleave the samples of the left and right streams. With 5.1, you have IIRC FL-FR-BL-BR-C-S interleaving.

>> No.67499221

>>67499187
Both, you'll use those a lot (since you work with options and lists a lot), and sometimes you use your own. In the latter case, it may be a combination of monad "transformers" that let you stack effects together, or it may be a freely generated monad.

>> No.67499327
File: 21 KB, 600x630, 1953429834.jpg [View same] [iqdb] [saucenao] [google] [report]
67499327

Why am I such a fucking brainlet.
Why can I just not understand yield and generators in general.

>> No.67499330
File: 455 KB, 1592x1080, Fate_kaleid_liner_Prisma_Illya_-_86.jpg [View same] [iqdb] [saucenao] [google] [report]
67499330

>>67493263

in c++ this is just
(Range(argv, argv + argc) | Skip(1) | Fold(average) ).eval();

>> No.67499354

>>67499327
dumb frogposter
https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/coroutines-for-streaming/part-1-pause-and-resume

>> No.67499409

>>67499327
they're stupid and gay proper coroutines are better

>> No.67499412

>>67494967
I'd start with java or c#. It's easier than c++ and there is lot of documentation. That or c# if he wants to take the xamarin route

>> No.67499469

>>67498935
People talk about pycharm.
I use vscode with the vim plugin for everything desu

>> No.67499479

>>67498935
I use atom but ive heard good things about pucharm as well

>> No.67499485
File: 107 KB, 750x750, DmhPUS5W4AAbeUp.jpg large.jpg [View same] [iqdb] [saucenao] [google] [report]
67499485

Mac Miller died :(

>> No.67499502

>>67495056
>Who cares about speed?
Customers.

>> No.67499528

>>67498756
Is Rust really a systems language comparable to C/C++/D? I thought memory safety was a VHLL feature

>> No.67499556

>>67499502
Customers generally don't care about speed. Stability is most important.

>> No.67499574

>>67499556
>Customers generally don't care about speed.
You must have very forgiving customers. Nice position for a brainlet to be in; it means you don't have to work hard.

>> No.67499580

>>67499556
Customers think that "less stability" is balanced out by them having "good luck" and that crashes will happen so infrequently it won't bother them.
If you let them choose between speed and stability they'll choose speed every time.

>> No.67499613

>>67499528
It's more of a systems language than D. Memory safety is achieved basically by parameterizing functions on object lifetimes. This works on top of a very C++ like memory management model.

>> No.67499617

>>67499613
What the hell does that even mean?

>> No.67499622

>>67499574
>>67499580
Tell me why customers care about speed so much.

>> No.67499645

>>67499622
Gotta go fast

>> No.67499647

>>67499622
When things go faster it gives them bigger dicks.

>> No.67499654

>>67499528
>it's not systems programming if you don't have constant paranoia about memory errors

>> No.67499668

>>67498256
I think codeblocks and gpp is the best combination there is

>> No.67499686

>>67499617
In C++ you have the problem where you don't know how long objects live so you might get dangling pointers. In Rust references (and compound types or functions that may contain them) are annotated with lifetime variables that describe how long the variable is valid for. That way a reference can't outlive its referent. This is done at compiletime.

>> No.67499694

>>67498901
that's really cool. Did you make that with C or what? Pretty inspiring for me, I use Renoise a lot and would love to have my own tracker

>> No.67499710

>>67499686
No, really, what the fuck are you talking about? Is this buzzword bingo? You might as well be telling me the chemical composition of the atmosphere for all the sense it makes, these are just random words with no actual meaning

>> No.67499729
File: 7 KB, 331x260, 1516384381536.png [View same] [iqdb] [saucenao] [google] [report]
67499729

Guys, I need an opinion. I may have to ask this at /sci/ too later, but I want to know what you think first.

I'm writing a computer algebra system. Is it a good idea to define a Rational type and have a division operation, or I should just have the division operation?

>> No.67499734

>>67499710
Liveness is a pretty basic idea.

>> No.67499735
File: 295 KB, 500x198, 1536342816984.gif [View same] [iqdb] [saucenao] [google] [report]
67499735

>>67499330
So you left parsing to the average function or what?
double res = args.Select(Double.Parse).Average();

>> No.67499754

>>67499729
what do you want the system to do? plus, some languages have rational types (like Haskell)

>> No.67499760

>>67499710
I'm describing how memory safety is achieved in Rust. It's (more or less) as efficient as C++, so the fact that Rust is more memory safe doesn't preclude its use a systems programming language.
also if you don't understand phrases like variable lifetime or dangling pointers then you don't understand memory management in any of these languages

>> No.67499766

>>67499734
Is this magic now? Are we done trying to tell the difference between computer ideas and things that are dead or alive? Are you a necromancer? Is that what Rust shills call themselves instead of "programmer?" You're manipulating lifetimes and bringing variables back from the dead?

>> No.67499783

>>67499766
Stop seething all over your keyboard.

>> No.67499787

>>67499754
I want a generic algebraic solver.

>> No.67499792
File: 136 KB, 1600x900, .jpg [View same] [iqdb] [saucenao] [google] [report]
67499792

>>67499735
you got me
(Range(argv, argv + argc) | Skip(1) | map(atof) | Fold(average) ).eval();

>> No.67499797

>>67497234
>int elligent;
kek

>> No.67499800
File: 59 KB, 640x469, Rust programmer.jpg [View same] [iqdb] [saucenao] [google] [report]
67499800

I alchemized a phylactery and ordered a copy of the necronomicon, am I ready to program in Rust?

>> No.67499803

>>67499787
you'll probably want fractions in some form then
You could always have them with exponents?
x(y^-1)

>> No.67499827

>>67499792
>Fold(average)
What's this like?

>> No.67499861

>>67499803
The negative exponent is not a bad idea. I'll meditate on that.

>> No.67499925
File: 44 KB, 1896x352, rustonomicon.png [View same] [iqdb] [saucenao] [google] [report]
67499925

Wait, this is real?

>> No.67499927

>>67499861
You're going to want to limit it somehow, because these things aren't always solvable (at least, they aren't all easily solvable)

>> No.67499931

>>67499792
Is this a C++ lib you are working on? Looks pretty neat but I would suggest implementing more stuff like Average and Sum for your range type.

>> No.67499969

>>67495056
Who cares about monads, applicatives, and sum types?
If your language doesn't have performance it's just academic masturbation trash with zero practical application to anything.

>> No.67499981

>>67499969
>t. "the next notch"

>> No.67500004
File: 194 KB, 1296x972, high velocity lead treatment medicine.jpg [View same] [iqdb] [saucenao] [google] [report]
67500004

>>67499969
>If your language doesn't have performance it's just academic masturbation trash with zero practical application to anything.

>> No.67500026

>>67495056
>>67499969
>implying these features have anything to do with performance

>> No.67500027

>>67499981
Notch created shit and slow code though.

>> No.67500029

>Trying to wrap my brainlet head around the bitcoin network
>can't figure out how nodes notify each other when a block is found or a transaction occurs
Does it use RPC?
What happens if a transaction is created on one node just before another node mines a new block. Is the transaction discarded?

>> No.67500041

>>67500027
doesn't affect my post, the people crying performance are always obsessed with triple A games

>> No.67500067

>>67500041
Nice assumptions, but I literally don't give a shit about games. and if you think performance only matters for gayms then you're fucking retarded and should stop programming.
If your language isn't fast, there's no point to it and it may as well just stop existing.

>> No.67500085

>>67499927
I was thinking about defining a rational as a struct with two int values, so I can have infinite precision when juggling things around. Let's say I have x(5/3). In the tree it will have this format *(x /(5 3)), and it seems more convenient if I just treated 5/3 as a single entity.

>> No.67500087

>>67500026
All programming languages that have them/make extensive use of them are less performant than programming languages that don't.

>> No.67500089

>>67500067
>I don't give a shit about games
Sure whatever you say anon

>> No.67500109

>>67499694

Thanks.

No its an electron app, which if you dont know is like a web browser built into a desktop application. The "front end" part is written in this obscure programming language (that I love) called Elm, which is like Haskell that compiles to JavaScript. Which then renders html. The "back end" part that actually generates the audio is written in Haskell. But Ive remade this tracker a few times, and in the past the backend was written in Golang and C++.

>> No.67500130

>>67500087
HKTs aren't particularly expensive to support. Not more so than parametric polymorphism in general.

>> No.67500168

Are nested loops ok to use? Or are they pajeet code?

>> No.67500182

>>67500168
using loops at all is pajeet, use higher order functions

>> No.67500202

>>67500087
Sum types are cheaper than the alternative in languages that lack them you pleb.

>> No.67500204

>>67500085
Well, this is a proof of concept anyways, it is not like my parser is a wonder of technology, since I'm using spaces as sensitive connotation to jump some steps and throw everything directly in the symbol table. I think I'll just add this type for now and if needed, I'l remove it when I actually have a pattern-matching analyzer.

>> No.67500212

>>67500182
>using loops at all is pajeet, use higher order functions
Spent few years doing nested loops with ne of the main contributors of caml. Yes we we pajeets.

>> No.67500254

>>67500202
No, the cheapest method is plain unions where the "tag" only exists in the form of control flow instead of wastefully consuming memory

>> No.67500267

>>67495029
>port from python to js and host
github.io
>shortest path multiple [...]
traveling salesman

>> No.67500271

how much liberal bullshit do you have to deal with at your work?

>> No.67500285

>>67500202
Well, they're not going to be any faster than a discriminated union, since that's how you'd implement them.

>>67500254
You wouldn't use a sum type in that case anyway so I'm not sure what you're on about.

>> No.67500289

>>67500271
I work in a state that doesn't have slavery

>> No.67500292

>>67500254
That only works in very localized cases i.e. the cases where control flow and the union's lifetime is narrow enough to actually describe which member is active.

>> No.67500322

>>67500285
>they're not going to be any faster than a discriminated union
Same thing.
>since that's how you'd implement them.
In languages which lack them (mainly POOlangs) you generally have to abuse subtyping to emulate them.

>> No.67500354

>>67500322
I'd consider sum types and discriminated unions to be not one and the same because the latter has no enforced rules about how you can use it.

>> No.67500364

>>67500182
>>67500212
Not using exclusively gotos is pajeet.

>> No.67500386

>>67500182
>>67500212
>>67500364
combine the cont monad with some sort of coroutine transformer

>> No.67500436
File: 5 KB, 338x125, Screenshot_11.png [View same] [iqdb] [saucenao] [google] [report]
67500436

>>67500271

>> No.67500479

>>67500436
traps aren't in LGBT

>> No.67500508

>>67493263
use "\n" before (or after) printing so you get a newline

alert("\n your avg is...");

>> No.67500540

>>67500436
/g/ isn't tech

>> No.67500604

>>67500479
traps are gay

>> No.67500614

>>67500604
>

>> No.67500624

>>67495499
Too lazy to look into this but i worked with a lot of selenium before I got fired.

Your first problem is that finding an element by class name will always return a list of elements, because class name is assumed to always be none, one, or more than one. I don't have code in front of me for testing but if it's working then you can just ignore me.

We automated signing into chrome, but there were a few hiccups with it (chrome giving you that retarded reminder for security) but you can always just force a new url once you get passed signing in. Sadly I don't have any of this code due to contract.

Good luck.

>> No.67500659

>>67495155
reinterpret_cast the int to a char array and access 2nd and 3rd element.

Possibly undefined behaviour, not sure, but it works

>> No.67500684

>>67500624
>before I got fired.
why you got fired?

>> No.67500702

>>67499485
lol

>> No.67500736
File: 18 KB, 609x287, Capture.png [View same] [iqdb] [saucenao] [google] [report]
67500736

>tfw coding in shitlangs

>> No.67500740
File: 17 KB, 1104x354, 2018-09-07--1536358538_1104x354_scrot.png [View same] [iqdb] [saucenao] [google] [report]
67500740

>>67499827
ok here's the REAL implementation
but it could just be an Average() adapter

>> No.67500743

>>67500736
now implement traverse

>> No.67500762
File: 6 KB, 490x178, what is this.png [View same] [iqdb] [saucenao] [google] [report]
67500762

What the fuck is this black thing that showed up in the center left? I think I accidentally hit the wrong keys when commenting this code out.

(It's VS in case you couldn't tell.)

>> No.67500766

>>67500740
As I thought anon.
You silly baka.
Fold forms an applicative functor - rewrite Fold to take multiple
sets arguments and return a tuple, thus doing it in one pass.

>> No.67500778

>>67500740
>>67500766
Length() being Fold(count, 0) where count is sum but treats the element as 1 regardless.

>> No.67500795

>>67500743
It already has an iterator if that's what you're asking.
Either way, I'm not doing anything more in Java than school wants me to. I have more fun and useful things to practice.

>> No.67500801

>>67500762
bookmark

>> No.67500829
File: 56 KB, 305x454, .jpg [View same] [iqdb] [saucenao] [google] [report]
67500829

>>67500766
I was going to fold a lambda taking a tuple but then i'd have to std::get the average and it would look ugly and i thought you'd make fun of me for that instead desu

>> No.67500851
File: 408 KB, 680x560, 1453653416673.png [View same] [iqdb] [saucenao] [google] [report]
67500851

>>67500829
I think you can probably use std::apply or something? I believe you can use operator+ and operator/ as well in haskell's (+) and (/) fashion

>> No.67500864

>>67500851
ty I'll try it out

>> No.67500877

>>67494866
Does try() take care of anything that could possible go wrong inside? Give the idiot version explanation, pls

>> No.67500894

>>67500877
what language

>> No.67500897
File: 531 KB, 1200x488, chadtravesti.png [View same] [iqdb] [saucenao] [google] [report]
67500897

>>67500436
Travestis are not trans, they're something beyond.

>> No.67500910

>>67500829
Here's the example of the Fold applicative. There's a third argument that isn't really used here:
import Control.Foldl (Fold(..), fold)

-- liftA2 (,) tot len
-- would be your Fold(sum, 0, count, 0)
tot = Fold (+) 0 id
len = Fold (const (+1)) 0 id

-- this would be your apply(div, theFoldResult)
avg = (/) <$> tot <*> len
-- iavg = div <$> tot <*> len -- integer version

test = fold avg [1..100]

>> No.67500932

>>67500894
C++

>> No.67500990
File: 17 KB, 250x245, 1523386156678.jpg [View same] [iqdb] [saucenao] [google] [report]
67500990

>>67500897
>mfw xer language can't even implement travesti

>> No.67501022

>>67500990
Beautiful fucking word, americans can't even say "traveco" without having a stroke

>> No.67501069

quick SQL question
say I have the following table:

Project_ID (PK)
--------------------
Customer_ID (ref: Customers.Customer_ID) (FK)
Updated_By (ref: Employees.Employee_ID) (FK)
Project_No
Title
Desc
...


since there's no composite key, is it 2NF/3NF compliant? are all the other columns like title and description allowed to exist on the same table because they depend on what the PK describes? sorry if this is vague

>> No.67501111

>>67500877
yeah, try/catch is used to handle circumstances where something goes wrong. i.e. whenever an exception is raised.
say you have code like this.
try
{
foo();
}
catch (Myexception &e)
{

}

say the foo function fucks up somewhere. There will be a statement inside foo like throw Myexception{"something fucked up"};
Your program will stop whatever it's doing at that point and jump immediately* to the catch block where you can handle the error. If there's no catch block matching the kind of exception you threw, then it'll keep looking for matching catch blocks in earlier functions. If there are none then the program exits.

*it will actually execute all the necessary destructors as it returns from each function

>> No.67501123

>>67501069
If there's no composite key, it's 2NF. 3NF means that all the columns are dependent on the PK and not another column. Meaning that you can't turn two columns into a separate table and a foreign key.

>> No.67501255

>>67501123
alright, thanks

>> No.67501380
File: 75 KB, 440x660, 1497634076027.jpg [View same] [iqdb] [saucenao] [google] [report]
67501380

This honest to good took me 2 hours to do.
#function that takes a list and sorts it tusing the bubble sort method, and returns it.
unsorted = [5, 1, 3, 4, 8, 2, 6, 9, 7]

It feels so shitty but I hope I can make it one day.
def bubble(l):
first = 0
second = 1
temp = 0
loop_value = 0
should_continue = True
while should_continue:

for ind in l:
try:
if l[first] > l[second]:
temp = l[first]
l[first] = l[second]
l[second] = temp
first += 1
second += 1
elif l[first] < l[second]:
first += 1
second += 1
except IndexError:
loop_value += 1
if loop_value > len(l):
should_continue = False
else:
first = 0
second = 1

return l

sorted = bubble(unsorted)
print(sorted)

>> No.67501452

>>67501380
unsorted = [5, 1, 3, 4, 8, 2, 6, 9, 7]

def swap(l, i, j):
tmp = l[i]
l[i] = l[j]
l[j] = tmp

def bubble(l_):
l = l_[:] # makes a copy

for i in range(0, len(l)):
for j in range (0, i):
if l[j] > l[j + 1]:
swap(l, j, j + 1)

return l

print(bubble(unsorted))

>> No.67501453

>>67494866
Looks like Elon has already made it to Mars.

>> No.67501455

>>67501380
be proud that you finished it

>> No.67501490

>>67500740
what font is this?

>> No.67501492

Is FP really the future?

>> No.67501505

>>67495034
this

>> No.67501508

>>67501492
It's more like the past that they don't want you to uncover.

>> No.67501512

>>67501492
The future, past, and present. OOPsies simply haven't realized it.

>> No.67501517

>>67501492
FP = Futuristic Programming

>> No.67501521
File: 148 KB, 222x293, jeez_bubs.png [View same] [iqdb] [saucenao] [google] [report]
67501521

>>67501453

>> No.67501522

>>67501508
>>67501512
>>67501517
Is it just a meme? Cause I'm learning Haskell cause of you guys but I dunno if it's worthwhile or not yet

>> No.67501549

>>67501492
no the future and present are multi-paradigm, the useful parts of fp like reactive streams have mostly already been retrofitted into industry standard languages like java

>> No.67501562
File: 470 KB, 200x200, 1463443034765.gif [View same] [iqdb] [saucenao] [google] [report]
67501562

>>67501455
I'm glad I finished it, but I just wish I could do better.

>> No.67501569
File: 995 KB, 280x201, 1483369485134.gif [View same] [iqdb] [saucenao] [google] [report]
67501569

>>67501549
>multi-paradigm

>> No.67501576

What's the proper way to get a time zone from a zip code or address? Its starting to look like I really should just use an external API for it, and that's what practically every OS does internally, so could this be the best solution?

>> No.67501625

>>67501549
>multi-paradigm
shit

>> No.67501628

>>67494866
I want to learn how to program Android apps.
suggestions?
thoughts?

>> No.67501629

>>67501549

What a bottom tier opinion.

>> No.67501636

>>67501549
>java has lambdas now, so why does haskell still exist?

>> No.67501654

>>67501628
google it and do it, motherfucker
you're probably just asking to subconsciously keep putting it off indefinitely when you could be downloading the sdk and just learning instead

JUST
DO
IT

>> No.67501689

How do I get better at reading code?
I suck at reading and comprehending code when I see it.
Even my own stuff that I've made, that I come back to after a while feels weird to read.

>> No.67501699

New thread:

>>67501697
>>67501697

>> No.67501745

>>67501549
unironically this

pure-anything is wankery
opportunists use everthing thats good and discard the rest

>> No.67501769

>>67501745
>I don't understand it so instead of learning it I wallow in my ignorance

>> No.67501787

>>67498895
Reminds me of an assignment we once gave to a first-year class. They had to implement LZ77. Nobody's implementation actually lowered the filesize.

>> No.67502328

>>67498901
shit's cash

did you use electron because there were APIs missing on browser or something? or just to be a "native" application?

>> No.67502411

>>67500479
Yes they are technically

>> No.67503345

So I have a question for y'all. I looking to get into some kind of low level programing for my next job (like writing firmware for highly specific hardware), primarily in C or Assembly, so my question is, what sort of projects can I work on in my own time that might allow to go into that particular section of the industry. If there is a better section to pose this question, please let me know. Thanks

>> No.67504347

>>67499556
t. kissless fat fuck unemployed neckbeard

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