[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 320
Thread images: 19

What have you been working on, /g/?


Previous: >>57866411
>>
Which looks better to you?

Which looks better to you?
int sort_freq(const void *a, const void *b)
{
struct freq *x = (struct freq *)a;
struct freq *y = (struct freq *)b;
return x->count - y->count;
/* ~~~ */
return (*(struct freq *)a).count - (*(struct freq *)b).count;
}
>>
>>57871242
the first one looks better and is easier to debug because you can add or remove code around it.
>>
Trying to improve. Feedback?
local lines = { -- would normally be accepted as arguments
{
{x = 1, y = 1}, -- point 1
{x = 7, y = 3}, -- point 2
},
{
{x = 2, y = 6},
{x = 5, y = 0}
}
}

for i, line in pairs(lines) do
line.m = (line[2].y - line[1].y) / (line[2].x - line[1].x) -- slope (m)
line.b = line[1].y - (line.m * line[1].x) -- y-intercept (b)
end

local intX = (lines[2].b - lines[1].b) / (lines[1].m - lines[2].m) -- intersection point x value
local intY = (lines[1].m * intX) + lines[1].b -- intersection point y value

print("The lines intersect at (" .. intX .. ", " .. intY .. ").")
>>
>>57871321
"--" indicates a comment which 4chan doesn't recognize as a comment, just to clear that up
>>
>>57871328
>Implying /dpt/ is tech illiterate
First time projecting this right
>>
>>57871396
iirc lua is the only language to do this, so it might not be obvious
>>
>>57871407
Haskell uses --, and everyone in /dpt/ knows Haskell.
>>
>>57871396
>projecting
Haha so you're tech illiterate.
Or was this a joke?
>>
>>57871373
To produce the things you want and not the things the 'best' people want.

There's also no clear rules for who's the worst or who's the best.
But you can of course be fairly certain you're not either.
>>
>Github: Major Service Outage
REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
>>
>>57871474
This is why you self host and mirror to bitbucket.
Github.com removed the fun joke /g/ made remember?
>>
>>57871411
>everyone in /dpt/ knows Haskell
wrong
>>
>>57871373
I am the best in my little zone of influence, though.

I'm intimately familiar with my company's network and all of the databases, as well as how to access the various APIs of web services we use. I know our server IP addresses by heart, as well as credentials.

I know our larger code-bases like the back of my hand and am able to fix things quite quickly because I'm familiar with those clusterfucks.

Currently, no one else in the world can serve my purpose quite as well as me, and it would take them some time to learn our business needs, our infrastructure, our data, and how to communicate in our odd culture.
>>
>>57871407
Ada does as well

Also the script behind the code blocks is fully capable of language-specific syntax highlighting, just moot/gookmoot are too lazy to add something like [ code=lua ]
>>
File: 300592-5775be0b5046c.jpg (30KB, 720x720px) Image search: [Google]
300592-5775be0b5046c.jpg
30KB, 720x720px
Aside from a given language and "soft skills" (ie, not being an aspie), what should someone looking to go into software development be proficient in? Git? Agile/TDD/other? Scripting languages? How proficient in a given scripting language?
>>
>>57871452
>To produce the things you want
Then shouldn't programming be seen as art instead of science?

Also, I think if you're not ahead you're an hindrance.
>>
>>57871577
How to use the industry-standard IDE for your language and its metaprogramming features.

Good networking knowledge.

SQL.

Also, there's a metric fuckton of soft skills that are really goddamn important, like how to write an email to a client or coworker with the correct tone and specific information.
>>
>>57871596
>Then shouldn't programming be seen as art instead of science?
it is
>>
File: .gif (228KB, 410x500px) Image search: [Google]
.gif
228KB, 410x500px
Is there any OOP language to program closest to bare metal but not C++?
Rust and Go are not applied.
>>
>>57871596
Yes programming is a craft. Not a science. Doesn't matter what computer scientists think about it because we work with a canvas (hardware) and real world constraints (input latency and all kinds of stuff). We don't use some computation ether to run our theoretical time complexity algorithms.

It's a sick view which luckily not all computer scientists hold but the less experienced ones are prone to.
>>
>>57871647
D
>>
>>57871647
>close to bare metal
>a mental model based on a hypothetical abstracted reality meant to fit the programming ideals of people who didn't give a shit about actual software
Choose one and only one.
OOP is not compatible with low level programming or even well performing programs outside of trivial examples.
Also the guy who made up OOP doesn't think C++ is OOP iirc. So maybe you're not even close there.
>>
>>57871217
Testy fjdhdhdh
>>
>>57871647
Ada has a powerful facilities for embedded systems.
>>
>>57871647
objective pascal
there's might be OOP in the C derivates that aim for parallelism like chapel and such.
>>
>>57871647
C
>>
>>57871321
regarding >>57871574

The highlight script is Google's prettify, so you can just add this module:
https://raw.githubusercontent.com/google/code-prettify/master/src/lang-lua.js

then change the class of the HTML generated from the code tag from "prettyprint" to "prettyprint lang-lua"

and do PR.prettyPrint() to refresh
>>
>>57871691
>OOP is not compatible with low level programming
I meant as close as possible.
Let's say, Java isn't a variant (if it's not some Java CPU, lol) to be closest to the bare metal.
But still, aren't objects just structs packed with functions and unreachable internal variables?
If not, what's a good language to practice actual OOP?
>>
File: 50243983_p0.png (802KB, 1092x944px) Image search: [Google]
50243983_p0.png
802KB, 1092x944px
>>57871628
>>57871649
Is there a way to "fix" this? What about haskell?
I'm guessing the CS field to be too modern/hyped thus not having sufficient time to get the benefits of hindsight. I hope it changes for the better
>>
does haskell even have a weighted graph package? i'm trying to do dijkstra in it and i think i'm going to have to make my own
>>
How can I dynamically determine information about the environment my programs run on?

Things such as processor, supported instruction sets, operating system, system calls, etc
>>
>>57871839
>does haskell even have X
no
>>
>>57871849
Depends on the language, but there's probably a library for it
>>
>>57871876
How are those libraries implemented?
>>
>>57871744
>objective
not a typo?
>>
>>57871791
Low level programming means you care about the operations and data representation of the machine to some extent. It's a fussy line. OOP's goal is entirely counter to that.

The closest to a compromise that seems OK to me is C++ or D. Where D is clearly preferred as a language (but available tools are lacking).
>a good language to practice actual OOP
Now I'll draw a clear distinction. Now we're talking not low level languages. OCaml and scala are the two you'd consider primary contenders.
Some people really like the idea of UML. And I can see how from a pure OOP standpoint they'd be very good at this. The representation and presentation seems superb. It jives very well with the philosophy of OOP people. And is very suitable for OOP programmers.

If I were you, and you're set on OOP, I'd learn UML and make programs using it as much as possible. Usually it doesn't compile straight to binary but you have to specify small portions (the 'implementation') of the program in another language. Pick whatever you find is suitable. Then eventually move on to programming languages designed around OOP thought like the examples given.

I'd imagine if you just want to get hired to an OOP position you'd just learn to use C++ or java though. Probably java. I'm not sure.
>>
>>57871242
Why is C so shit?
>>
>>57872020
You shouldn't have say that. Now I know that you're a code monkey.
>>
>>57871807
Not sure we want them to.
There's value in CS as a theoretical subject. Its like how base research may be difficult to digest into technical products (like theory of relativity for GPS) but it's certainly valuable.

My general disgust is from my experiences. Not the practice of CS.
>>
>>57871937
I know Intel has some instructions for their assembly language that you can use to get information about the processor and what instruction sets it can support, so the language could write wrappers around those (I don't know about other architectures). For querying other things I'm not too sure.
>>
>>57871937
Usually through OS api.
For instance
https://msdn.microsoft.com/en-us/library/windows/desktop/dd319331(v=vs.85).aspx
>>
>>57871807
don't listen to them. they're "code artisans" who program in java and html
>>
>>57871217

Writing a database query, JSON and HTML LRU cache. Trying not to produce mutex soup.
>>
>>57872101
Well java and html obviously aren't platform specific as >>57871649 imply programmers do.
Stop being retarded.
>>
File: spiderGame.png (7KB, 543x355px) Image search: [Google]
spiderGame.png
7KB, 543x355px
making a little game

the spider at th bottom (pic. rel) travels the distance deltaY with an animation

this works fine

but now I want to make it jump vertically in a parabola motion (purple arrow in pic rel)

how would you calculate the formula for that parabola if he is at position x=30 and if y movement is deltaY ?
>>
I don't get how classes work.
how do you make a class for something like this in java? christ self-teaching is shit
public class FractionClient
{
public static void main( String [] args )
{
Fraction r1 = new Fraction( 2, 3 );
Fraction r2 = new Fraction( 5, 7 );

System.out.println( "The numerator of fraction #1 is " + r1.getNumerator( ) );
System.out.println( "The denominator of fraction #1 is " + r1.getDenominator( ) );

System.out.println( "\nFraction #2 is " + r2.toString( ) + "\n" );

if ( r1.equals( r2 ) )
System.out.println( "Original fraction #1 and #2 are identical" );
else
System.out.println( "Original fraction #1 and #2 are different" );

r2.setNumerator( 2 );
System.out.println( "\nSetting denominator of fraction #2 to 0\n" );
r2.setDenominator( 0 );
System.out.println( "\nSetting denominator of fraction #2 to 3\n" );
r2.setDenominator( 3 );

if ( r1.equals( r2 ) )
System.out.println( "Original fraction #1 and modified fraction #2 are identical" );
else
System.out.println( "Original fraction #1 and modified fraction #2 are different" );

}
}
>>
>>57872182
there's no purple on that pic
also can't you just use sine/cosine with variable radius overtime
>>
>>57872182
https://en.wikipedia.org/wiki/Range_of_a_projectile
>>
How would I read the longest and shortest string/word out of a .txt file using java?

I got

import java.util.Scanner;
import java.io.File;
import java.io.IOException;

public class WordData
{
public static void main (String [] args) throws IOException
{
File inputFile = new File ("words.txt");
Scanner scan = new Scanner (inputFile);

while (scan.hasNext())
{
word=scan.nextString();

System.out.println("The longest word is" + )
System.out.println("The shortest word is" + )

>>
File: spiderGame2.png (9KB, 543x355px) Image search: [Google]
spiderGame2.png
9KB, 543x355px
>>57872182
forgot to add the arc span
parabola goes from (30,0) -> (250, deltaY/2) -> (30,deltaY)
pic rel

looking for formula
>>
>>57872182
>>57872224
A parabola rotated 90 degrees is not mathematically a function.
>>
>>57872224
http://formulas.tutorvista.com/physics/projectile-motion-formula.html?view=simple
Just rotate this.
>>
>>57872257
>A parabola rotated 90 degrees is not mathematically a function.
Nice meme:
https://www.wolframalpha.com/input/?i=y%C2%B2+%3D+-x+%2B+20
>>
What are some language features you just recently discovered?

>mfw struct copy in C
>>
Anyone ever make a web scraper? I'm making one now for craigslist using node and cheerio. So far I've got it making objects for every listing on the page, gonna be making a word matching function now to determine if the individual listing matches one of my target items
>>
>>57872220
s => {
const w = s.split(" ").sort((a, b) =>
a.length - b.length)
return [w[0], w[w.length - 1]]
}
>>
>>57872312
That's not a function. A function is in the format of f(x) = x
>>
File: screenshot_00102820160831205155.png (422KB, 408x519px) Image search: [Google]
screenshot_00102820160831205155.png
422KB, 408x519px
>>57872350
>node
>>
>>57872257
It is, if the domain is the y-axis instead of the x-axis.
>>
>>57872366
But the y-axis is the range, not the domain.
>>
File: nice.png (66KB, 1920x1056px) Image search: [Google]
nice.png
66KB, 1920x1056px
>>57871217
>What have you been working on, /g/?
doing homework in python atm.
Seems to work. Now just gotta make it pretty
>>
>>57871217
Please don't use an anime picture next time
>>
>>57872366
https://yourlogicalfallacyis.com/special-pleading
>>
File: IMG_20161206_225052203.jpg (307KB, 2958x663px) Image search: [Google]
IMG_20161206_225052203.jpg
307KB, 2958x663px
>>57872398
task was pic related with euler method
https://en.wikipedia.org/wiki/Euler_method

n should be 10^1, 10^2, 10^3, 10^4, 10^5

I just plotted the graphs for 10^1 and 10^5
>>
/dpt/ am I making a huge mistake by using a template cover letter for every job application and going in bulk, or should I only send out a few applications but personalize each one?

I feel like I do better when I have a chance to show off my wit, but I can't be sure
>>
>>57872412
It's not like anime picture is used for OP.
>>
2017 is almos tupon us, programming anime soon
>>
anyone here tried devving with electron?
i dont really like JS or the webstack in general but i wanna see why a lot of big companies are jumping onto the bandwagon
>>
>>57872524
Electron is terrible, it's stupid slow.
Unless you're already knee-deep in webdev shit, it has no redeeming quality
>>
>>57872524
The whole idea is that you have this entire industry full of millennials who only know ruby and javascript, so they started writing desktop applications wrapped around a web browser (chromium).
This has the added benefit of being highly portable without needing to bog yourself down with a native framework, like Qt, gtk or SDL2.

Javascript has no business being used as anything other than interactivity on websites, I can't even imagine writing a whole application in it.
>>
>>57872576
>Javascript has no business being used as anything other than interactivity on websites
Wrong.
>>
>>57872524
Electron is web designers meming about being programmers. Ignore and avoid.
>why a lot of big companies are jumping onto the bandwagon
Because it's a bandwagon. Managers want to be hip and trendy.
>>
REMINDER that JAVASCRIPT is NOT programming, it is NOT used by programmers to make REAL programs
>>
>>57872617
why?
>>
>>57872576
>I can't even imagine writing a whole application in it
It's Hell.
>>
>>57872626
hi aspie, forgot to make your meds?
>>
File: snap109.png (73KB, 1129x712px) Image search: [Google]
snap109.png
73KB, 1129x712px
>What have you been working on, /g/?
I cracked expensive (5-6 digits) software for personal use.

Took me 1 day to write a crack and 2 extra days to realize the reason it wouldn't work even with the crack is I had installed it incorrectly...

They were using a licensing/DRM scheme called FlexNet which was embedded as a library in ~60 different files, so I wrote a patching tool just to apply the crack.

I hadn't really cracked anything serious before, so I'm pretty proud of myself.
>>
Anyone know how I can debug a None type error for my regex in Python?

I've created a script which parses a html doc with Bs4 (Beautiful Soup), there are 112 items I want my regex to match, it matches all of them and after it prints the last one, it throws me a None error and I don't know why. I've added a counter so that each iteration of my for loop, I can count how many times it iterates through the loop and its 112. How do I find out what's cockblocking it?

I'm not looking for help with my code, just how to debug
>>
>>57872676
>Python
>type error
kek
>>
>>57872668
>FlexNet
Is that Solid Edge?
>>
>>57872668
That CLion?
>>
File: myclamp.png (12KB, 821x253px) Image search: [Google]
myclamp.png
12KB, 821x253px
Is there a more efficient/elegant way to clamp in java?
>>
>>57872704
Using x and y instead of [0] [1] for vectors is a bad idea.
>>
>>57872704
why does a clamp function return a boolean
>>
>>57872704
>boolean clamp
>>
File: figure_1.png (65KB, 2400x1277px) Image search: [Google]
figure_1.png
65KB, 2400x1277px
>>57872433
wew, euler method is pretty accurate
>>
>>57872692
Nah, I'd rather not say the exact name since AFAIK I'm currently the only source for a cracked version, but basically it's a pretty big systems designing software suite.
The thing is ~5GB installed.

>>57872693
Qt Creator w/ Flat Dark theme.
>>
>>57872731
Because i want to know if it's within the range or not

>>57872725
How so? Vector2s are fine to use surely?
>>
>>57872731
>>57872733
>>57872762
Google has reminded me of the definition of a clamp. What would this be called instead? does it have a name?
>>
>>57872668
>tfw accidentally found an entrypoint to a vulnerability that allowed me to bypass the security of an online game trough IDA and Ollie just because I wanted the sound to be in 44KHz
Felt good for a week, no wonder so many people crack software and create cheats for people, both money and the great successful feeling of breaking trough some companies hard work to create a secure enviroment.
>>
if I copy an object in C++, does it re-run the constructor?

myObject obj(69);
myObject obj2;
obj2 = obj;


I'm writing on my phone so I can't test this
>>
>>57872793
Line two runs the constructor, line 3 runs the assignment operator (operator=).

If you did "myObject obj2(obj)", then it would run the copy constructor only.
>>
>>57872793
ideone
>>
>>57872576
Saddest thing about JS is that it has an absolutely terrible threading model. The language itself is fine but the implementation is botched up.

Node's "async I/O" is really cooperative multithreading. If you use any of the libraries written by these hipsters, you're trusting that they don't suck at programming. You're also forced to segment work into bits and pieces and manually schedule them into the ridiculous single-threaded event loop.

Really, the only thing that's asynchronous is the I/O. Code is still very much synchronous. And they still don't have threading support. Even the browser has somewhat fixed this; v8 has already implemented web workers and is working on being able to send arbitrary javascript data between threads. Node is generally just sitting around while people generate hordes of absolutely unmaintainable code thats either callback hell or continuation-passing style code.
>>
>>57872787
inRange?
>>
How do I create a new line in a Javascript alert?

Also, I notice that Firefox claims to be version 50-something, but navigator.appVersion tells me it's 5. Do I divide by 10 to get the real version number?
>>
>>57872828
This is much better than my withinRange, thanks for the brevity anon
>>
>>57872844
>How do I create a new line in a Javascript alert?
You insert an '\n', obviously
Are you a webdev?
>>
>>57872818
I just want to copy the objects state (variables) and not re-run everything
>>
What's the preferred technology for .NET desktop applications these days?
I was leaning towards a self-hosted container and just doing ASP.NET

>>57872844
\n
>>
>>57872869
Yeah, that's what the copy constructor is for.
>>
>>57872668

Hey boss, what's that font?
>>
>>57872844
\\n
>>
>>57872883
Just a simple DejaVu Sans Mono
>>
>>57872869
make a move constructor?
>>
>>57872897
He said copy. Move destroys the original..
>>
File: subdraw.png (6KB, 465x250px) Image search: [Google]
subdraw.png
6KB, 465x250px
>>57872892

Oh, I was going to say, it looks pretty good at that size.

I'm quite fond of 8-12 point fonts.
>>
>>57871217
fag
>>
>>57872936
hn8pbp
>>
>>57871217
>switch uni after 1 year pause
>finally programming again
>forced into java
life is suffering
>>
>>57872412
please don't ever reply to my posts again
>>
When pausing a game, do you simply have an

if(Paused == false) {
}

wrapped around any update methods or things that effect the game?
or is there a more elegant way?
>>
>>57872889
>>57872889
What's the difference?
Also, Javascript doesn't like it if I go "\nSampletext" instead of "\n Sampletext", but that leaves a visible space.
Is there a more elegant solution than "\n"+"Sampletext"?

>>57873050
>>
>>57873050
why would you compare to a boolean?
>>
>>57873050
no, if my game was paused, I replace the main event loop with another one

function pointers are the best way to represent state

event_loop = run_loop;
or
event_loop = paused_loop
>>
>>57873050
a) >>57873098
b) the pause would be in the main
depending on the game you'd update each frame in the main
and if it's paused you go into a wait loop outside your main until the pause is over
>implying your game is nothing overly complex
>>
>>57873107
>Function pointers to represent state.
FUCK, anon. That's pretty brilliant.
>>
I want to learn how to make android apps. I have no previous experience at all, do I go with Java or C++? Books or videos?
>>
File: 1480959260304.png (38KB, 499x338px) Image search: [Google]
1480959260304.png
38KB, 499x338px
>>57873107
oh boy here we go
>>
>>57873098
My code would look like the below
if(PauseButton.playing) { 

}


But I thought what I wrote in previous post was a little easier to read.
>>
>>57873107
Except you actually need state, so you need more than just a function pointer, you need a "fat" function pointer (with e.g. void pointer to closure data).
>>
>>57873156
Java for Android apps.

What sort of apps did you want to make?
>>
>>57873177
what do you want to achieve with this snippet?
It would instantly run over it and you would only pause for like 1 cycle of your machine and then continue
>>57873196
>>57873155
yeah you still need an if paused to switch that pointer and then run the pause loop until the pause is ended, doesn't really change anything from other ways to pause a program
>>
>>57873050
My game is turn based and does not need a pause :^)
>>
>>57873086
Whoops, forgot to write a reply to >>57873050

You should probably have some main function that handles all your physics/AI/whatever stuff that you can just pause, unless it's tied to the rendering.
>>
>>57873209
PauseButton.playing will remain false until I tell it otherwise.

>>57873226
I'm sure your players will enjoy the resources your game is using, even when they are doing other things
>>
How do I make a programming language/virtual machine
>>
>>57873209
Putting logic outside of the states is missing the point. You can simply have the state return the next state to transition to. This is approaching the way coroutines work.
>>
>navigator.appCodeName always returns "Mozilla" no matter what browser
how fucking useless
I need to implement a system to tell Microsoft Edge users that their browser is fucking stupid and not compatible with my program, what do?
>>
>>57873209
>you still need an if paused to switch that pointer

button_handler(button *b) {
switch(*b)
case (START_BUTTON):
if (event_loop != paused_loop)
event_loop = paused_loop;
else
event_loop = run_loop;
//and so on
}

>he thought it was the stack
>>
>>57873264
running linux?
>>
>>57873209
>>57873260
So, if you pause and unpause by pressing P, you have the running state return the paused state if P is pressed, and the paused state return the running state if P is pressed. You can further decouple pausing by passing the current state into the paused state when creating it, and then the paused state just returns the stored state. This is an alternative to a state stack and it's a hell of a lot better.

Though at this point you're better off using objects if your language doesn't support first class functions well.
>>
>>57873276
button_handler(button *b) {
switch(*b)
case (START_BUTTON):
if (event_loop != paused_loop)
event_loop = paused_loop;
else
event_loop = run_loop;
//and so on
}


forgot code tags
>>
>>57873276
It's all relative addressing
>>
>>57873257
design the ast, write an interpreter, parser, then compiler
>>
>>57873283
No, and what does that have to do with anything?
It's an in-browser Javascript program, that's why the browser is the concern.
>>
>>57873226
your gay game is still looping to oblivion while it's waiting for user input you dingus
>>57873250
yeah then write that code out please, just some if doesn't pause anything
>>57873260
>>57873276
>>57873294
that's like exactly what I was saying, sorry sometimes my english isn't the yellow of the egg

and fuck you, Terry
>>
>>57873264
navigator.userAgent.indexOf("Chrome") != -1
>>
Why isn't my python loop working? It's literally just
loop = 'y'
while loop.lower() == 'y':
variable = input("input")
loop = input("Again? (y/n)")

It was working fine then all the sudden it doesn't accept an answer until the second iteration.
>>
>>57873199
>What sort of apps did you want to make?

I have no interest in games on Android. Anything with a lot of graphics and such is a no go. But apps I want to make is more like text based comment apps. Share something with others etc. Like a social media but anonymous.
>>
>>57871647
why would you exclude rust? it's kinda the best contender for the position right now. D, maybe, but it's garbage-collected. It's still reasonably fast, but it's pretty niche. Really, what you need to do is define your criteria and goals a bit more clearly.

>>57871691
OOP is, with basically one or two exceptions^1, a zero-overhead model, so it maps great to the metal and is suitable for well-performing programs. A good chunk of the most performance-critical infrastructure in our world is implemented in C++ (like data analysis frameworks, e.g. the one from CERN, HFT algorithms, browsers, operating systems, ...), so I'm gonna assume you're just memeing.

>>57871791
there actually is a "java CPU" of sorts, look up jazelle.


^1: exception #1 being virtual tables, exception #2 being data ordering (AoS vs. SoA, where OOP rather encourages the former, while hardware prefers the former -- but that's hardly a trade-off you can ascribe to OOP, because even if you're not using OOP, you'd likely be AoS-style unless you're specifically conscious of using SoA instead, and even then SoA feels awkward, no matter what language you do it in
>>
>>57873343
>yeah then write that code out please, just some if doesn't pause anything
I'll include notes in future
>>
>>57873369
Those are enormous "exceptions".

>but that's hardly a trade-off you can ascribe to OOP, because even if you're not using OOP, you'd likely be AoS-style unless you're specifically conscious of using SoA instead, and even then SoA feels awkward, no matter what language you do it in
Nice deflection.
>>
>>57873344
Surely there's a less messy way than by using userAgent?
>>
Visitor makes a hell of a lot more sense when you understand that it's an OO version of pattern matching.
>>
>>57873300
you could also even have function pointers for the button handler

paused_button_handler(button *b)
{
switch(*b)
case (START_BUTTON):
event_loop = run_loop;
button_handler = run_button_handler;
}
run_button_handler(button *b)
{
switch(*b)
case (START_BUTTON):
event_loop = paused_loop;
button_handler = paused_button_handler;
}
button_handler = run_button_handler;


this pretty much removes all if statements
>>
>>57873389
not really, because #1 is very easily avoided, and for #2, well, either you ignore the issue OR you write awkward code, and that applies equally regardless which language you're in (possibly with the exception of jai, which I think lets you parameterize SoA vs. AoS, but that language is still in its infancy.)
>>
>>57873356
https://www.youtube.com/watch?v=QAbQgLGKd3Y&list=PL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl

I'd recommend these tutorials if you want to stay away from graphics.
There's a lot of drag and drop to make things easier, and you can edit the .xml files that are created via drag and drop once you get familiar with the software and languages.

Java is used for the logic, so I'd start learning that.
>>
>>57873431
Avoiding virtual calls (indirect jumps) is synonymous with avoiding OOP. AoS code is not hard to write, especially with languages like C++, which has integer templates which makes it quite easy.
>>
>>57873389
also, in principle a language could be OOP but either "hide" the AoS vs. SoA tradeoff from you, or let you "parameterize" it transparently (choose which one you want at declaration time or whatever) -- this is not possible for C++, as it would violate the spec and is impossible to retrofit, but it would be entirely possible for a language to be OOP (under basically any kind of definition of OOP you prefer) and offer this SoA/AoS perf tradeoff feature.

So again, it's not a property of OOP at all, it's a property of C and C++' (and many other languages) memory model.
>>
>>57873466
I would tend to disagree. I also prefer an "composition over inheritance" approach. In C++ I can generally avoid virtual classes by using templates.
>>
Can your language do this?

> val x = Key("foo"); val y = Key("bar"); val z = Key("baz")
x: Key
y: Key
z: Key

> val result = runQuery(param1, param2, /* ... */, Attributes(x, y))
result: List[Result[...]]

> val byX = result.groupBy(_.attributes(x))
byX: Map[Value, List[Result[...]]

> val byY = result.groupBy(_.attributes(y))
byY: Map[Value, List[Result[...]]

> val byZ = result.groupBy(_.attributes(z))
Error: attributes map does not contain 'z'


Note that the last line results in a *compilation* error. If you're accidentally trying to get a value out of the attributes map using a key that it doesn't contain, the code won't even compile.
>>
>>57873470

That's what Blow-lang does, actually. You can choose which you'd like at declaration time.
>>
>>57873528
Yeah, C++ could do that.
You just have to write the library.
>>
>>57873574

ye, I mentioned it earlier

>>57873576
no need to write any library, C and C++ will by default error on you if you try to access a member of a struct or class (which is of course what's really going on here)
>>
>>57873594
>C and C++ will by default error on you if you try to access a member of a struct or class
What did she mean by this
>>
>>57873660
error at compiletime if you try to access a member of a struct or class that doesn't exist or isn't public
>>
I have the choice of taking java or ios programming .I've already taken 3 semesters worth of C++ stuff
Which one will be most useful/ noteworthy once i graduate
>>
>>57873687
you should probably just kill yourself 2bh
>>
>>57873470
>also, in principle a language could be OOP but either "hide" the AoS vs. SoA tradeoff from you, or let you "parameterize" it transparently (choose which one you want at declaration time or whatever) -- this is not possible for C++, as it would violate the spec and is impossible to retrofit
struct Foo {
int bar;
float baz;

void qux() {
baz += bar;
}
}


template<int N>
struct Foos {
std::array<int, N> bars;
std::array<float, N> bazs;

void qux() {
for(int i = 0; i < N; ++i) {
bazs[i] += bars[i];
}
}
}

You can do pretty well regardless.
>>
>>57873687
either is fine and will make you more attractive on the job market, assuming you're actually interested in doing app development

if the ios one is in objective c, note that objective c is a pretty painful language (but then, I don't consider java a personal favourite either, esp. not on android)

if you're not interested in going into app development, do the java one
>>
>>57873396
No.
>>
>>57873684
>>57873594
Let's change the code ever so slightly:

> val x = Key("foo"); val y = Key("bar"); val z = Key("baz")
x: Key
y: Key
z: Key

> val result = runQuery(param1, param2, /* ... */, Attributes(x, z))
result: List[Result[...]]

> val byX = result.groupBy(_.attributes(x))
byX: Map[Value, List[Result[...]]

> val byY = result.groupBy(_.attributes(y))
Error: attributes map does not contain 'y'

> val byZ = result.groupBy(_.attributes(z))
byZ: Map[Value, List[Result[...]]


In other words, if I use Attributes(x, z) instead of Attributes(x, y), I can then ask for z in the attributes members of each element in result, but not for y.

Can C++ still do this?
>>
>>57873684
>isn't public
Why would you make anything private
>>
File: jess.jpg (192KB, 1080x1080px) Image search: [Google]
jess.jpg
192KB, 1080x1080px
>>57873718
i'm kinda fond of objc but there's little reason to not start with swift now
>>
>>57873732
Because it doesn't have dependent types and variants have to be enforced through encapsulation.
>>
>>57873738
>Muh encapsulation
Fucking OOPfags.
>>
>>57873729
of course? I don't see how this new code is fundamentally any different from your previous one
>>
>>57873737
Smaller = better
>>
>>57873748
That's why I like Rust. You can have a safe, encapsulating interface but still expose the internals in an unsafe interface. Also encapsulation occurs at the module level and not the object level in Rust.
>>
>>57873748
>>57873770
Though dependent types are even better, then you don't need encapsulation for preserving invariants at all.
>>
>>57873763
It's not. I was just demonstrating the behavior of the code in response to a change in input.
>>
>>57873790
the code is not changing in response to any input as such, since the compiler can't know ahead of time what the input is. It is just changing in response to the change in code.
>>
>>57873788

I've used idris a bit, and it seems to me that dependent typing is a lot more painful to use in some regards. Also, compilation seems to sometimes take a very very long time and eat huge amounts of RAM

I don't have that much experience with it tho, so I can't say for sure if that's a fundamental issue with dependent typing...
>>
>>57873729
what language is this, typescript/flow?
>>
>>57873748
this

it's the memeiest of the memes and doesn't need to be a language feature

if you absolutely must use encapsulation, use first class ADTs or simply do:

struct thing {
read();
write();

//internal variables, do not use. thanks
int fd;
void *stuff;
}
>>
>>57873881
Scala.
>>
>>57873822
Yes, but I didn't change any struct or class definitions.

I think I may have misunderstood what you were getting at - I don't know C++ very well.
>>
>>57873528
You could do this in Haskell or Idris, it would take some doing
>>
>>57873898
disgusting
>>
is i worth learning python 3?
i had some idiot at work bitch at me because he could get my 2.7 code working (after i fucking told him to use 2.7)
do people use python 3 yet?
>>
>>57871647
Object Oriented Programming is shit,

>inb4 there's a language/paradigm for every project and OO has it's niche
Wrong. Object Oriented Programming is a fucking embarrassment and nobody here will be able to come up with any legitimate points to refute that claim.
>>
>>57873845
>it seems to me that dependent typing is a lot more painful to use in some regards
My guess is it's the totality restriction? It's not technically necessary in order to use dependent types for programming. In any case, you get used to it.

Instead of having a class with private fields, getters/setters for whatever that might do logic, and methods, with the programmers of the class keeping the invariants in their heads all the time, you simply express the invariants in the type and it all flows nicely from there.

>Also, compilation seems to sometimes take a very very long time and eat huge amounts of RAM
Dependent type inference is hard at best and undecidable at worst, and Idris does a lot of it (unification, tactics, proof search). I believe dependent type checking (or bidirectional checking/inference) is polynomial, but that requires some more work on the programmer's part.
>>
>>57873917
That's because the type is inferred by scala.

C++ can do this as well to some degree, but generally/traditionally you have to explicitly specify both the shape and name of a class (nominative typing.)

But for e.g. tuples, C++ will do the same thing, for instance.
>>
>>57873921
I can believe that, Scala is in some ways a very crippled Idris.
>>
>>57873939
t. guy who who's never worked in a professional setting.
>>
>>57873939
>OO has it's niche
GUI programming

even GTK uses fucking OOP
>>
>>57873950
Scala is a crippled Haskell (that can talk to the JVM despite that) which is a crippled Idris.

>>57873962
The most sane way to do GUI is functional, though.
>>
>>57873933
it has some penetration, but most people are still using 2.x

Basically any system that comes with python comes with both, and many people still assume that python=python2.
>>
>>57873962
How?
Isn't it written on C?
>>
>>57872437
Send out the bulk letter for the jobs you're not all that enthusiastic about and personalize the applications to the jobs you really want to work.

That way you have the shittier jobs to fall back on if you don't make the cut at the cooler jobs.
>>
Does anyone who uses Chrome know what you're supposed to enable in about:flags to enable WebGL2?
The website I found instructions for Chrome on says to enable "WebGL 2.0 Prototype", but it also said to enable "webgl.enable-prototype-webgl2" for Firefox when I actually had to enable "webgl.enable-webgl2", so I'd imagine that with Chrome too there's a non-prototype setting that has to be enabled.

I'm asking rather than testing for myself since I don't have Chrome.
>>
>>57873984
it uses gobject, which is a macro-based graft-on OOP system for C.
>>
>>57874004
>>57873984
this

https://developer.gnome.org/gobject/stable/chapter-intro.html
>>
>>57872668
Do you recommend any good books to learn how to do cool shit like that?
>>
I am trying to retrieve date from my system with

*dateStr = system ("date");


but it returns

Tue Dec 6 15:40:52 PST 2016
(null)

how do I prevent the (null) from being copied onto my string?
>>
>>57874020
drop the last char?
>>
>>57873947
Interesting... so you can create a similar generic map class in C++, that knows what keys it contains, you just have to provide a lot more explicit type information to the compiler?
>>
>>57873975
Haskell isn't a crippled Idris, Idris a souped up Haskell
>>
>>57874020
*dateStr[strlen(*dateStr) - 6] = '\0';
>>
What's the derivative of a singly linked list? You should be able to solve this.
>>
>>57874020
>system ("date");
Please. There is a much better way you can do this.
Use localtime() or gmtime() or whatever.
>(null)
That's probably related to your print statement, not this.
>>
>>57874047
A list zipper?
>>
>>57874039
At least we can agree that Idris > Scala < Haskell.

>>57874055
Hi Chris.
>>
>>57874062
Who's chris?
>>
>>57874069
Chris, did you forget your name again?
>>
>>57874035
sure, but it wouldn't really be a "map" in the traditional sense of the word "map" (e.g. a dynamic hashtable), it just turns into a static type definition or whatever

idk if there would be any point to doing this in C++ though, the whole point of doing this in structurally typed systems is that it just happens by default and gives you a convenient way to deal with things, C++ is all about nominative typing (I think either have their advantages)
>>
Working on my terminal emulator, adding Wayland support, I have to use OpenGL.

It will be at least 800 lines just to draw a fucking window.

Who thought this was a good idea?
>>
Using Java

I'm only using the keyword static, if I want to access a variable or method from another class, and I get a "cannot get non-static reference" error. Otherwise I'm leaving it blank.

Is there any reason to use the keyword static on everything that is static? Or should I only bother when I need to get around that error?
>>
>>57872980
Do you actually have to use Java or does your code just have to run on the JVM? If the latter you should look into Clojure.
>>
>>57874035
also the primitive used to implement something like this in C++ is a varadic template
>>
>>57874101
"draw a window"? you let GLFW/SDL/EGL/whatever open the window for you, you don't need to (or indeed, are allowed to) ever draw a window in opengl. You can merely draw inside it.
>>
>>57874101
What about using FreeType?
>>
>>57874116
He's at uni, he probably has to use Java.

There is no hope for the future of programming unless we ban Java and C# from universities.

Sure, they can be very productive languages, but they should not be taught in academia, they should be learned in on-the-job training. CS should be about underlying theory and principles.
>>
>>57874144
I'll take "how to make people complain even more about how much of a waste of money education is" for a hundred dollar, scotty!
>>
>>57874129
You don't have a clue how Wayland works, do you?

You just get a surface to work on, window decorations are client side you fucktard, you have to draw everything yourself.

>>57874133
What does that have to do with anything?
>>
>>57874162
The idea is that graduates be able to pick up almost any programming language in a month or less.

Well, in theory. Of course the reality is that there is no underlying theory or principles behind Java, C#, or OOP in general, so they would never be taught in such a course.
>>
it's time

https://youtu.be/Uyj3H3n2MsI
>>
>>57874175
>window decorations are client side
Not necessarily. The Wayland protocol doesn't mandate that. It's just what Weston did.
In terms of it not being easy to do, I'm pretty sure they designed it with GUI toolkits in mind.
They expected GTK, Qt and whatnot to do all of the actual heavy lifting, so they didn't have to make it super easy.
>>
>>57873594

Oops, I guess I interjected at the wrong time, then.
>>
>>57874198
OSGTP, is C# still your favorite language?
>>
>>57874197
Yes, and it's pants on head retarded.
>>
Try to get the my actor system to shutdown gracefully.

Tomorrow doing some hacks in some app...
>>
>>57873975
>The most sane way to do GUI is functional, though.
This.
>>
>>57874210

Yes.
>>
>>57874221
Are you using Akka, by any chance?

>>57874233
Seems a solid enough language, certainly better than Java.

Unfortunately my university took the JVM pill and I've been screwed ever since.
>>
>>57874229
GUI need mutation at the very least.
>>
>>57874233
Why use C# or Java when you can use Haskell?
>>
>>57874246
Which you can express using monads.
>>
>>57874246
So?
>>
>>57874246
No they don't
>>
Which is the best (or your favourite) JVM language? My favourite language is Haskell, I've done a fair bit of Scala but it felt like it has too much crap inherited from Java. I'm looking at Clojure which looks really nice but it'd be weird to be back to dynamic typing. Frege and Eta seem too immature at the moment.
>>
Would appreciate if someone here could try and help me, no one on stackoverflow is being really helpful rn.
>>http://stackoverflow.com/questions/41006470/whats-making-these-functions-not-work-after-the-first-entry
>>
>>57874261
mutation isn't very functional

>>57874267
they do
>>
>>57874245

yup, it's nice. But erlang/elixir is much better if you want to go pure actor.

It just takes a bit to get used to the paradigm. learnyousomeerlang.com helps.
>>
>>57874288
>mutation isn't very functional
Wrong.
>>
>>57874301
No, I'm correct about that.
>>
>>57874283

go ask for your homework somewhere else pleb
>>
>>57874280
Scala, for all its warts, is at least quite expressive. People have written some impressive libraries, considering the language's limitations.
>>
>>57874304
It's only "non-functional" when you lose purity, which e.g. with monads you can prevent. Also I don't see why GUI needs mutation in the first place.
>>
>>57874298
I just wondered, with you mentioning trying to make it shutdown gracefully, it's a pain in larger apps.
>>
>>57874248

Haskell doesn't have the libraries I need. :^)
>>
>>57874329
mutation is impure
>>
>>57874358
You can do mutation while maintaining that the same inputs always give the same outputs.
>>
>>57874358
modify $ (+) 1


Look mom I mutated the state and stayed pure.
>>
>>57874368
i know

>>57874377
not pure
>>
>>57874384
>same inputs always give the same outputs
And that's what purity is.
>>
>>57874358
>>57874377

If imperative languages are so good at mutation, why can't they allow you to safetly mutate the type at runtime with compile time safety and optimisation?
>>
class Foo
{
public:
Foo &operator=(const Foo &f)
{
x = f.x;
}

Foo(const Foo &f)
{
*this = f;
}

private:
int x;
};


Is this the preferred way to have the copy constructor and copy assignment have the same behavior? or is there a better way?
>>
File: 1381228285622.jpg (27KB, 260x384px) Image search: [Google]
1381228285622.jpg
27KB, 260x384px
>>57874439
>People actually defend C++, let alone use it
>>
>>57874464

It's actually a very nice language if you can make use of its flexibility and performance.
>>
>>57874439
>>57874464
Makes me appreciate Rust. Implicit moving/copying (only difference is affine vs. normal type) is memcpy while any advanced copying logic has to be done with a method call (clone).
>>
>>57874472
Get help.
>>
>>57874475
>while any advanced copying logic has to be done with a method call (clone).
It's shit.
>>
>>57874475
but no variadic templates, SFINAE or integer templates, which sucks
>>
>>57874496
Why? It prevents this shit >>57874439.

>>57874499
I've personally never found SFINAE useful but I do miss the other two for sure. I think they're both on the roadmap.
>>
>>57874512
>Why? It prevents this shit >>57874439(You).
But that shit is good.
Why should a non trivial copy have to use a separate method when the assignment operator can easily do it?
>>
>>57874512
sfinae allows things like enable_if and other type-traits
>>
>>57874554
>But that shit is good
Are you fucking serious?
You're too far gone. You should probably kill yourself at this point.
>>
>>57874554
Having a copy constructor and an operator that always do the same thing is good? Making it hard to tell if something is being deep copied or moved is good?

>>57874566
Oh, I see. Still, Rust has traits (type classes, i.e. interfaces and C++ concepts rolled into one) so presumably that deals with that.
>>
Making videos of finite quantum walks in MATLAB

https://www.youtube.com/watch?v=-7NAVvBF4DY
https://www.youtube.com/watch?v=NDtoQYvCA-c
https://www.youtube.com/watch?v=K61BE3jJ4zc
>>
>>57874332

The deal is more the way you model your system. But distributed systems are not easy anyways
>>
>>57874574
Give me a good logical reason why a non trivial copy should be done via a clone method and not through assignment operator.
>>
>>57874597
You should prefer immutability, so that it doesn't matter whether something is copied by value or reference.
>>
I need help, I'm working on a batch script and i have multiple if lines that check a variable for a number, and give it a value if it's that number. CMD fucking crashes unless it gets the bottom line value
>>
Trying to turn an lvalue object into an rvalue without using std::move(). Anybody know how I could go about this?
>>
>>57874597
>Making it hard to tell if something is being deep copied or moved is good?
It's not hard if you're not retarded and actually know the language you're using.
>>
Why the fuck does C++ have rvalue, lvalue, xvalue, glvalue and prvalue? Who thought this was a good idea?
>>
>>57874613
That's not always possible or desirable.

>>57874624
>I like wasting cognitive effort
>>
>>57874618
static_cast<typename std::remove_reference<T>::type&&>(t) 

Or just use std::move which is exactly that.
>>
>>57874639
maybe it is a good idea and you just don't understand it
>>
>>57874639
lvalues and rvalues are extremely useful to have, they allow you to implement copy and move semantics.
I don't know about the others.
>>
>>57874650

Damn. Can't use move though, or I don't think I can. It wipes the value of the object being moved from but I need that value to stay. Also I can't use a copy constructor/assignment operator with said object.
>>
>>57874644
>>I like wasting cognitive effort
Well I'm sorry that you're retarded, go back to Rust now little one.
>>
>>57874695
I'd rather put my brain to use on important things rather than suffering the ongoing cost of not having to type a few extra characters in the rare event that you actually want to deep copy something.
>>
>>57874691
So you want to move but you don't want to move and you actually want to copy but you don't want to copy.
I'm sorry, I don't understand your situation.
>>
>>57874708
It takes like .25 seconds to figure out if something is being moved or copied while you're writing the code.
It is worth the consistency you gain by using the assignment operator for what it rightfully should be handling.
>>
File: safe map.png (17KB, 404x338px) Image search: [Google]
safe map.png
17KB, 404x338px
Ungodly inconvenience
>>
>>57874742
and it can't store anything polymorphic (hence the :: Integer)
>>
>>57874738
>assignment operator
>does some arbitrary amount of work and then assigns the result of that work
That's what the RHS is for.
>>
>>57874765
Sure it can, he just needs an existential.
>>
>>57874786
What are you talking about
>>
>>57872357
But isn't this literally just y as a function of x?
>>
>>57874821
>a = work(b)
>NOOOO DOING THE WORK SHOULD BE INCLUDED IN THE ASSIGNMENT OPERATOR
>>
Help please I don't understand this question.
Using a for loop, write code that will compute the result of an int raised to the power of another int. For example, your for loop should use two variables, one for the base and one for the exponent. It should then calculate the base raised to the exponent. 2 raised to the power of 2 should output 4, 2 raised to 8 should output 256, etc.
>>
>>57874870
Like Idk how to use a for loop for this, just normal fucntion.
>>
>>57874882
This sounds like homework.
>>
>>57874835
You know you can easily do things your own way in C++, you can only use the assignment operator to do trivial copies and have a clone method for non trivial copies, C++ doesn't force any specific way on you.

But I guess you're right to some extent in what you're saying, like if your class was encapsulating a system resource or something.
But other than that, there's literally nothing wrong with doing a little bit of work in a copy assignment.
>>
>>57874615

>I'm working on a batch script
Do it in Powershell instead.
>>
>>57874931
it is edx.
>>
>>57874936
>You know you can easily do things your own way in C++
Then you have to manually delete the copy constructors because you can't implement the move constructors without them. And you also have to implement both the move constructor and assignment operator even if they do the same thing.
>>
>>57874946
Anyway I don't know what the question is talking about, I'd do something like this:

int power(int a, int b)
{
int result = 1;
for (int i = 0; i < b; ++i) {
result *= a;
}

return result;
}
>>
>>57874870
You can have multiple loop control variables in a for loop
>>
Which is the best programming language for Norwegians?
>>
>>57874977
thank you. I was just wondering if anyone else understood the question.
>>
>>57875026
It's like those stupid train station word problems.
>>
>>57872375
Not when you're dealing with functions on R^2 :^)
>>
I'm trying to connect Xamarin to a remote Mac so I can use the iPhone environment, but my Mac is a VM running at my school and I can't connect across networks.

Anyone know any other ways around this? I don't care if it's illegal emulation, fuck Apple for being so restrictive.
>>
>>57875011
PHP
>>
>>57875102
Hvorfor?
>>
>>57874977
pshh
int power(int a, int b)
{
int res = 1;
while (b) {
if (b & 1)
res *= a;
a *= a;
b >>= 1;
}
return res;
}
>>
>>57875111
det er lort
>>
>>57872257
>all functions are R->R
Stay in school, kids.
>>
>>57875204
yourGf(x)
I -> I
>>
How can I program a digimon?
>>
What does RESTful mean, exactly?
>>
>>57874833
it is not, because if you solve for y, you will see that you get a square root with a "+/-" in front of it, meaning the function has two possible return values

y = +/- sqrt(20-x)


This is the same reason the circle equation y^2 + x^2 = 1 is not a function, because once you solve for y, you get two answers, not just one. There is a concept that allows this called a multifunction, but it's definitely not a function.

Now if you go to vector functions (parametric functions) or complex numbers OTOH, you can express this easily. For instance a circle would become the function

circle(t) = [cos(t), sin(t)]

where the function circle(t) takes a time-parameter (varying from 0 to 2pi) and returns a vector (x and y coordinates on the plane)

same dealio for complex numbers where you can write e^(i*t) (which is really just cos(t) + i*sin(t), which will describe a circle on the complex plane
>>
>>57875316
And that's why you specify "real-valued function" instead of just saying stupid shit like
>A parabola rotated 90 degrees is not mathematically a function.
>>
>>57875304
It means that you don't feel as tired after sleeping.
>>
What is the hardest to master high level programming language?
Is it Haskell?
>>
>>57875342
No, it isn't Haskell
>>
what language is best for creating a 3d graphing tool?

I only know C, C++, Java, Python, and webdev stuff.

It's kind of like desmos but on desktop because I sometimes dont have internet when I need it
>>
NEW THREAD

>>57875383
>>57875383
>>
>>57875316
>>57875337
E.g. sqrt is not a real-valued function. Absolute sqrt is.
>>
>>57875374
idk shit about desmos, but you can create a 3D graphing tool very easily in all those languages -- C, C++, java, python + opengl or javascript (typescript, flow, ...) + webgl.
>>
>>57875396
"absolute sqrt"? never heard that expression, pretty sure that's not a standard term at least in english. I think you mean the "principal square root"? the principal square root is a function and non-negative for all non-negative values.

For complex or imaginary values, the principal square root is complex in general. There is a possible ambiguity with which root is the principal one though depending on your choice of branch-cut, but typically it's along the positive x.
>>
>>57875374
Haskell
>>
I have taken off the last 9 months from programming and have come back to find a completely different javascript stack from what I was learning. I was making a lobby/match making service in Meteor pre 1.3/ES6/before react hype. I wasnt much of a programmer before and the changes to me are boggling, theyve ripped away the simplicity. I spent the last two days trying to update a simple pre ES6/1.3+ convention map app and I still don't have it working.

That's where I'm coming from, I'm wondering what advice you would give me in terms of what I should do about my project. Should I start fresh and build slowly copying code I already have. Should I try to refactor piece by piece? Perhaps meteor is no longer for me and I should invest in a new framework? I'm leaning towards hiring a code mentor to refactor the whole app with me so I get something that works and an explanation along the way. I have about 500 lines of code across 20 files and the repo is here if anyone wants to take a look.

https://github.com/maco144/hearthdapp
>>
Let's say I'm a software developer. I have a well rounded skill set. Now I want to put what I know towards something useful. How could I find something to make that people need or appreciate? I rarely ever feel the need to make something for my own needs.

I guess I lack creativity.
Thread posts: 320
Thread images: 19


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.