[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: 328
Thread images: 29

File: dpt.webm (1MB, 1280x720px) Image search: [Google]
dpt.webm
1MB, 1280x720px
Old Thread: >>57200190

What are you working on /g/?
>>
Arrows
>>
File: cinnameg-masterrace.png (130KB, 760x1564px) Image search: [Google]
cinnameg-masterrace.png
130KB, 760x1564px
give literally one single solitary reason why you aren't using cinnameg for your personal programming
>>
>>57203477
functions aren't values in python?
>>
>>57203477
no arrows
>>
>>57203484
yes, and python also has list comprehension.
>>
>>57203477
Unless there's an implementation that produces smaller and faster executables than C with clang or gcc I'm not interested.
>>
>>57203501
rustc does
>>
>>57203477
Python has classes? How can it by dynamically typed and have classes?
>>
>>57203508
No.
>>
>>57203509
Do you think Javascript and PHP are statically typed too?
>>
>>57203544
Did i claim python was statically typed?
>>
>>57203553
Did you?
>>
>>57203553
>Did i claim python was statically typed?
>>Python has classes? How can it by dynamically typed and have classes?
>>
>>57203477
>1,000 results on google
Nah.
>>
Could someone with C knowledge check out >>57203421 and maybe provide some feedback?
>>
>>57203559
no
>>
File: pkg.png (5KB, 83x120px) Image search: [Google]
pkg.png
5KB, 83x120px
first for go
>>
File: 1476846473824.jpg (24KB, 600x600px) Image search: [Google]
1476846473824.jpg
24KB, 600x600px
Hey guys i'm new to programming, looking to just start out. I've been looking into different languages and I've narrowed it down to Java and Cinnameg. Java says it's used a lot, but Cinnameg says it's good for beginners. Which should i learn? pic unrelated
>>
>>57203596
f- ... fast
>>
>>57203630
Cinnameg

+ It's not Java
>>
>>57203630
You should kill yourself
>>
>>57203649
sure is /reddit/ here
>>
>>57203657
Downvoted
>>
>>57203630
She should put some clothes on
>>
>>57203630
kek
upvoted :)
>>
File: 2q3zrk9.jpg (27KB, 640x480px) Image search: [Google]
2q3zrk9.jpg
27KB, 640x480px
Is it true that programmers spend most of their time looking for bugs when looking at code?
>>
>>57203679
The bad ones, maybe
>>
>>57203684
I skimming through Programming Principles and Practice by Stroustrup and he says this, "Most of the time, we look at text with errors in it. After all, if we were convinced that some code was correct,
we’d typically be looking at some other code or taking the time off. It came as a major surprise to the early computer pioneers
that they were making mistakes and had to devote a major portion of their time to finding them. It is still a surprise to most
newcomers to programming."
>>
>>57203679
not if you write it in hasklel
>>
>>57203679
that's true for me right now because i have to use fucking cinnameg for assignments which isn't a real language and therefore has no support online, so i have to spend 50x longer debugging it than a real language, and i make 50x more mistakes because i've obviously never used it before. on other assignments like ones in java, even long ones, i more often than not can compile it once at the end of the entire project and run all the test cases and it works. no debugging with a week worth of coding
>>
>>57203679
depends on the langugae. In more functional langugaes I find the time a spend bug fixing is reduced dramatically. Maybe 15% of the time i spend on a project. where C# would be closer to 40%.

At work I worked on a large JS codebase, where is was more like 85% of the time, or more.
>>
File: 1445525433390.gif (719KB, 300x170px) Image search: [Google]
1445525433390.gif
719KB, 300x170px
Bad programmer here, I attempting to work on a remote directory/file manager (essentialy browse directory on my buster android phone from my android tablet) it works the first time I open second activity, and have it populate a listview, but when I his the back button, and re open it, the listview is blank (right now I am just having it send a command to send the current directory each time second activity is open) I mean I know its working, my log is displaying the directory/files getting sent to me, it just not populating in listview.

Am I suppose to handle listview/adapter in some way when I leave/re open the activity?
>>
>>57203703
A lot of people seem to write code without thinking and then rely on the compiler, testing and debugging to catch their mistakes.

If you try to find the holes in what you're writing while you're writing it, it's easy to write bug-free code most of the time.
It just takes a little bit more conscious effort.
>>
>>57203727
There's lots of bug classes that are hard to catch without running the program depending on the langugae.
>>
Considering that /g/ is a conglomeration of young and some of the most very smart minds in technology today, why don't we start a business and get rich af?
>>
>>57203781
I'll make the logo
>>
>>57203726
I know shit about android, but sounds like you might have to redraw the listview or rebind the data when resuming. Look into what happens to listviews when you pause/send to background.

If there is something like "OnResume" event, you might rebind the data there.

This assuming you aren't doing something like making a new listview every time you're resuming the app which would clear it out.
>>
yeah but which language has the best logo
>>
I am making a little game based on console input and output because I do not know what else to make to practice.
>>
>>57203721
That's a fairly significant gain in efficiency. Is there any truth to functional programming not being useful for large projects or is that just snark?
>>
>>57203727
With large software projects, it's very hard to think through every contingency where there would be a bug or error though.
>>
>>57203854
It's snark, in theory.

But in reality you'll simply find a hard time getting a job working in a functional langugae. Simply not enough people know how to write in them.

It's more beneficial for most people to just learn good functional programming principles and use them in C++, Java, C#, JS and other mainstream languages which are slowly soaking up FP programming idioms.
>>
Trying to find a cool and challenging project to work on. Is there a good enough image processing bot that colorizes black & white images? Because I would work on one. Can somebody give me some good ideas?
>>
>>57203854
Also if you want to learn a FP language that you have a chance of finding useful, i'd recommend F# or Swift.
>>
>>57203630

uh, learn perl
>>
>>57203501
Go 1.7+ does
>>
>>57203434

Question:

Let's say you have a million complex Java objects of the same Class with lots of fields containing lots of fields themselves etc..
You're building an application that stores these objects in a database and should be able to quickly filter through all of these objects, finding just the ones that have a certain value for one of these fields within a field within a field.

1) Is a relational database the best option here?
2) Is serializing the objects and handling the filtering in Java a possibility or would that slow down the application too much? Since you have to completely serialize EVERY SINGLE one of the million objects every time you want to use a filter.
3) If you don't use serialization and store the objects completely relational, wouldn't that create a fuckton of consistency problems and almost insurmountable complexity?
>>
>>57203897
>>57203887
I'll keep this in mind, thank you.
>>
>>57203781
Because tech businesses, especially the highly successful ones have a number of key factors.
- incredible timing.
- a market niche.
- solid execution/organization
- enough money to avoid dying in the first year


Even if you start to grow nicely, you can look forward to other companies trying to kill your business and move into your space. Often enormous corporate firms who can afford to invest in a team to copy and outdo you. Or lawsuits, usually both.

Only once you have avoided backstabbing investors, corporate competition, internal executive/manager coups, god awful autistic employees, a constant shortage of money and endless bugs.

Then and only then can you become rich.
>>
>>57203968
Ughh, this is why Im getting into infosec...

fuck the startup world.
>>
>>57203781
I have a product that makes me some money.

Also running a business in general is hard. It's nicer just to work 9-5, get well paid and fuck off home and do whatever i like with my free time on comfy expendable income.
>>
I'm a C++ turned Java turned Python (learning it now) programmer.
And I just came to a realization, that encapsulation or private members of any kind is nothing but a bloat.
In python, from what i have learned, you generally just relay on a client to use your API properly, instead of enforcing it with some language features.
And there are sweet conventions like prefixing something with an underscore to say that it is not a part of the API.
No need for private members, and all the bloat that comes with it (like... hm... entire freaking API for reflection in java, or bazillion lines of boilerplate accessor/mutator code).
I feel like I just woke up from the matrix, and my whole life was a lie.
Prove me wrong.
>inb4 all fuckin OOP is a bloat
>>
>>57204003
all OOP is bloat
>>
>>57203939
I don't have nearly enough information to tell you anything useful, so here's my best guess.

If you want to really optimize for performance, I recommend an in-memory copy of your on-disk regular SQL database, written in a non-GC'd language (otherwise the GC is going to crap itself if it has to check millions of live objects).

I'm not sure exactly why you need to re-serialize everything everytime you use a filter (you probably don't need to do that at all). An in-memory database will allow blazing-fast search compared to reading from disk, the changes will be immediately effective in memory, and you only have to send what changes to the on-disk database, not fully re-serialize everything.

If you don't mind losing the last X seconds in the event of a power failure, you can even make the synchronization with the backing on-disk DB asynchronous.
>>
File: 1476556806916.jpg (172KB, 800x650px) Image search: [Google]
1476556806916.jpg
172KB, 800x650px
>>57204003
OOP? more like POO
>>
>>57204003
Java style OOP is bloat, it is boilerplate hell and everyone knows that.

If you're one of the people who religiously makes empty getter/setters for everything because someone told them to, please understand that this is misguided.

The valid reason for having private members is to hide your implementation details if you can't guarantee that they won't change.
Anything public, you have to guarantee will be stable.
The point of all that is to clearly define and enforce an API.

Now you can simulate this by the convention of having an underscore before private members, but conceptually that changes nothing, except that it's slightly easier for a beginner to make a mistake.
>>
>>57204013
>I'm not sure exactly why you need to re-serialize everything everytime you use a filter (you probably don't need to do that at all). An in-memory database will allow blazing-fast search compared to reading from disk, the changes will be immediately effective in memory, and you only have to send what changes to the on-disk database, not fully re-serialize everything.

I don't understand this. If I want to look into the fields of an object that has been serialized and stored in a database, I have to de-serialize it back to a Java object first right?

(I meant *de-serialize, as in turning it back into a Java object obviously).
>>
>>57204074
Yes, you'd need to de-serialize (not re-serialize), and that would be super fucking slow. By far slower than using an on-disk database.

In order the java serialization/deserialization will be terrifyingly slow, the on-disk database will be reasonnable (on the order of hundreds of ms), and the in-memory database in a non-GC language will be stupidly fast (on the order of several milliseconds).
>>
>>57204074
>I don't understand this. If I want to look into the fields of an object that has been serialized and stored in a database, I have to de-serialize it back to a Java object first right?

I think the idea is that you pay that cost once getting it to the memory database and then only the changes are serialized back into the database rather than serializing an entire object when one field changes or the entire dataset
>>
>>57204049
>If you're one of the people who religiously makes empty getter/setters for everything because someone told them to
But you have to do this with e.g. jpa/hibernate which is an ORM in java.
I guess the problem here is the language philosphy/convention, not the features themselves.
>>
>>57204165
Yeah, it's the accepted style in Java, if you don't write getters/setters in Java, then this will be considered poor style.

I personally strongly disagree with this design, but if I have to write Java I will do it anyway, because consistency and idiomatic code are bigger advantages than making a better design that people will misuse or misunderstand.
>>
>>57204099
So what should I do? Just store everything relationally and deal with the shitstorm?

I had this idea to maybe reduce complexity by doing the following: I would break the object in question down into two parts:

1) it's relational part, that should be able to be accessed quickly for filters and stuff (this will happen often and for many objects at once)
2) a serializable object that is only serialized when you know you need to access this specific object (this will happen rarely and only for one object at a time)

Sounds a bit weird, but it seems like it would solve both my speed problem and it would drastically decrease the ORM complexity in the long run.
>>
>>57203434
SICP with Python.
Finished with chapter one, 4 remain.
>>
>>57203492
"x86" isn't strictly defined, and you'll find lots of literature referring to ia-32 as x86,
>>
>>57204189
The important point if you want performance is to use an in-memory DB, whether it's backed on disk by a relational database or Java serialization doesn't really matter (although serialization is probably slower!).

Do whichever is simpler, if your objects are super hard to store in a relational database, then don't. The bulk of the performance will come from the in-memory cache either way.

Now if you don't use an in-memory DB, using only an on-disk SQL DB will be alright, and using only on-disk Java serialization would be terrible.
>>
File: 1476296430741.jpg (32KB, 620x400px) Image search: [Google]
1476296430741.jpg
32KB, 620x400px
>>57204199
>SICP
>with Python.
>>
File: 1444700676915.jpg (823KB, 1920x1080px) Image search: [Google]
1444700676915.jpg
823KB, 1920x1080px
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA).

>>57204199
>>57204221
http://www.composingprograms.com/

>>57203939
Are you the mmorpg guy?

>>57203892
A gui editor where you can draw sprites using WFC

https://github.com/mxgmn/WaveFunctionCollapse

>>57203850
What pl? post code!

>>57203832
https://en.wikipedia.org/wiki/MIT/GNU_Scheme

>>57203679
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?

>>57203596
if err = gopher()
killself()


>>57203582
The pointer is incremented between the two lines (++b2s;)

>>57203576
Sure. You could reduce the code by using fscanf

eg:
int capacity=0;
fscanf(cf, "%d", &capacity);


in place of

char *capacity_s = NULL;
int capacity=0;
getline(&capacity_s, &(size_t){0}, cf);
capacity = atoi(capacity_s);


That's a 50% reduction of code lines!

>>57203484
Yes, functions are objects like (almost) everything else in python.

>>57203434
Please, use an anime image next time.
>>
>>57204003
>I just came to a realization, that encapsulation or private members of any kind is nothing but a bloat.
slowpoke.jpg
>>
>>57204210
What is an example of an in-memory DB? I'm not sure I follow. I don't think it's possible to use such a thing, as I should be able to store millions of these objects for later use. Obviously I have to load them to the cache to deserialize them, but I have to do that anyway so I don't understand what you're saying desu.

>>57204269
nope
>>
>>57204269
Simply ebin(a)
>>
>>57204003
It's a tradeoff between brevity and encapsulation.

Autists like myself stand behind it, because it's technically the correct thing to do, but for real world purposes you're right that it bloats your code.
>>
>>57204341
>it's technically the correct thing to do
>>
>>57204298
>What is an example of an in-memory DB?
There's many of those, for example SQLite can work with memory only, Redis is pretty well known.

It can be as simple as just you maitaining an array of all your objects, to a full in-memory SQL database.

>I don't think it's possible to use such a thing, as I should be able to store millions of these objects for later use
The point is to have a full copy on disk, and a full copy in memory. You do all your operations on memory, but whenever something changes you write it to disk.

> Obviously I have to load them to the cache to deserialize them, but I have to do that anyway so I don't understand what you're saying desu.
With a traditional on-disk database, the database has to go read from disk everytime you make a query, which is always much slower.
Load everything once, then keep it around in memory, and make your requests in memory, is the gist of it.
>>
>>57203509
by crashing at runtime
>>
>>57204341
>technically the correct
According to what technical spec?
>>
discord invite plz
>>
>>57204354
>With a traditional on-disk database, the database has to go read from disk everytime you make a query, which is always much slower.
>Load everything once, then keep it around in memory, and make your requests in memory, is the gist of it.

Jesus is that really how MySQL works? Wow, you're right, that' would be horrible for my application. Thanks for telling me.
>>
File: crashing_this_plane.jpg (26KB, 1280x720px) Image search: [Google]
crashing_this_plane.jpg
26KB, 1280x720px
>>57204362
And that's the next step of your master plan?
>>
Encapsulation is the only way i know how to togglably writeprotect my variables.
>>
>>57204374
*theoretically
>>
File: Screenshot_2016-10-23_18-52-50.png (120KB, 498x526px) Image search: [Google]
Screenshot_2016-10-23_18-52-50.png
120KB, 498x526px
Added OGG support to my shitty imageboard. Next is MP4.
>>
I am making an app for my local transit. How would I implement an activity that takes the current time and tells you how long you have until the bus arrives at the next stop?
>>
>>57204430
>write your own imageboard
>only get dubs once
>>
>>57204399
Maybe I can combine the two ideas. In the MySQL I can save the fields needed for filters and and id that refers to the in memory database. Then I store my entire serialized object in the in-memory database with the ids.


That way I can do this:
>I need to filter 100 of my million objects:
>I run one query on my mysql and get the id's for my 100 objects.
>Then I deserialize the 100 objects in memory and do stuff with them

The disadvantage is I would have stored the same information (the fields in MySQL) in two places (they are also in the serialized object) and I would have to change them both whenever I change them. But I think that's worth it in the end, because it would make everything else a whole lot easier.
>>
>>57204362
with no survivors?
>>
File: Untitled2.png (27KB, 1888x422px) Image search: [Google]
Untitled2.png
27KB, 1888x422px
>>57203727
>If you try to find the holes in what you're writing while you're writing it, it's easy to write bug-free code most of the time.
>It just takes a little bit more conscious effort.
You're wrong, plenty of areas have tons of checking and there are still bugs. Some industrys spent massive efforts on preventing bugs, and yet there are still plenty of bugs(consider that the discovered bugs are only a subset of the actual bugs in the code)
>>
>>57204379
https://discord.gg/ybQsb
>>
>>57204465
That wasn't even me.
>>
>>57204483
Plus, I should mention. I will almost never change any of the objects in the database. I pretty much only want to save them, filter through them and read them.
>>
>>57204430
What did you write the image board in?
>>
>>57204577
Go, Typescript and C.
>>
>>57204607
pretty based desu.
>>
>>57204607
I can understand Typescript for frontend part, but why have two backend languages? [spoiler]especially these two[/spoiler]
>>
File: 1476882373036.png (586KB, 637x510px) Image search: [Google]
1476882373036.png
586KB, 637x510px
>>57204607
>Go
>C

why?
>>
>>57204642
                                                                                                           >using spoilers on /g/
>>
can someone tell my why my exe cant find the file I specify. Why I run it for my ide its fine. But when I run the exe it doesnt find it.
They are in the same folder so thats not the program. I even had it create the file I want it to find. Ran the exe which created the file in the same directory. Then ran it so it would open that file and it failed.
>>
>>57204742
Maybe because your IDE specified a build path or something that your EXE is unaware of? Just guessing.
>>
>>57204742
>ide
Found your problem.
>>
>>57204742
yes
>>
>>57204642
Go is very good for writing fast concurrent servers. But servers, related infrastructure and CLI tools is pretty much all it's good for.
And I needed ffmpeg bindings, so part of the upload processing code is also in C. Will also later need C for rsvg and <some PDF rasterizer> integration, because Go does not have a native library for those.
>>
I need to learn spanish in the next 24 hours so that I can make a web page for pablo!
>>
>>57204607
Thank you for using TypeScript
>>
>>57204742
>>57204760
>>57204762
Its not the ide. Just did some more testing and the issue is when I pass command line arguments to the exe, The programs path is changed. This doesnt happen if I put the file in a folder.
so something like open("file") doesnt work but open("folder/file") where folder is in the same directory as the exe. I usually put all config files in a separate folder so Ive never noticed this problem before.
>>
>>57204399
look up virtual memory, you can map hundreds of gigabytes of disk space into memory, even if you have only a few gigabytes of memory, the OS will use memory to cache disk accesses in that case.
>>
>>57204830
Not like there are any decent alternative till WASM stabilizes. Dynamically typed languages are trash.
>>
Is there a decent C++ IDE on Windows 7 that isn't Visual Studio?
VS is decent in terms of functionality, I just hate that it takes a fucking century to launch.
I've tried Eclipse with CDT except that it doesn't recognize C++11 by default and enabling it is a pain in the ass that I keep forgetting how to do because I have to do it per-project.
Ideally I'd like something C++14-enabled that will probably support C++17 in due time. Also ideally open-source or at least free as in "for no monetary compensation."
If such a thing does not exist then
>Windows
I should probably learn how to makefile at some point but if there's a dumb, easy solution I'll go with it for the time being.
>>
>>57205166
I recommend Code::Blocks
>>
>>57205166
CLion?
>>
>>57205166
kdevelop5 has windows port, dunno if it's any good. It uses clang as backend but i'm not sure if it has c++14 support.

QtCreator probably also has a windows port
>>
>>57205244
Is it good now? When I tried EPA it was shit: once you #included fstream or boost, its analyzer really took its time to analyze all the templates there.
>>
>>57205164
Tell that to the average web dev weeb
>>
>>57205166
>VS is decent in terms of functionality, I just hate that it takes a fucking century to launch.

Get an SSD mango.

Also stop closing it so often. Close/Open solutions. There's no reason to close VS itself unless it freezes.
>>
>>57205297
The average framework monkey isn't even a programmer. That's just template lego.
>>
>>57205166
why aren't you windows 10
>>
place to get boot leg udemy vids?
>>
Here is a list of the 1000 most used words in /g/:
http://pastebin.com/ZCZDwxkA

(According to the probability it appears at least once in each posts)
>>
>>57205205
>>57205244
>>57205273
Thanks for the recommendations
>QtCreator
I actually have used that before but I've never thought much of it outside of the widget designer.
Is it possible to compile without any of the Qt dependencies?

>>57205331
I turn off my computer every night so my unfortunate choice of a case with bright blue LED fans doesn't keep me awake.
I should probably get an SSD at this point. I've been holding out for too long.

>>57205445
"no"
>>
>>57205492
>the last thing /g/ asks for is advice
>>
>>57205492
https://www.youtube.com/watch?v=fCn8zs912OE
spooky
>>
>>57205166
QtCreator is really good.
>>
>>57205273
>QtCreator probably also has a windows port
It's multiplatform m8, not a port.
>>
Next step, building a shitposting AI. :^)

>>57205513
Windows is more popular than Linux though

>>57205518
Already saw that. Even if he's jew, he's sill awesome!
>>
>>57205492
Also, here is the Python source code (including all /g/ threads as JSON):
https://aww.moe/pf2yla.zip
>>
File: WTFJS01.png (49KB, 1025x493px) Image search: [Google]
WTFJS01.png
49KB, 1025x493px
Ok, /g/uys...
What the fuck is this? Am I just doing something stupid and not seeing it?
Why in the fuck is it saying 9 > 51..?
>>
>>57205618
You're comparing strings.
51 > 9, but "9" > "51".
>>
>>57205618
I wanna make this retarded thing work so I can use it to quickly calculate GCDs using the Euclidean Algorithm for my Discrete Maths class.
>>
>>57205618
JavaScript/10
>>
>>57205629
OHHHHH....

Ok, fuck I'm stupid!
>>
>>57205658
No, the language you're using is stupid.
>>
>>57205658
Nah, Javascript is stupid
>>
>>57205505
Just checked and it is extremely possible

>>57205273
>>57205543
Thanks for reminding me this exists
>>
>>57205639
change
intVal1 = jq("number1").val();
intVal2 = jq("number2").val();

to
var intVal1 = parseInt(jq("number1").val());
var intVal2 = parseInt(jq("number2").val());
>>
>>57205629
>DYNAMIC TYPING
>>
>>57205681
and weak typing

>inb4 some webdev weeb says
>but.. what if I want compare the alphanumeric values of two string : DDDD?
>>
>writing assembly
>realize half-way through that i fucked up by under-utilizing the stack
please... just give me some more registers man...
>>
post the most useful aliases you wrote

alias serve='(port=$(( 8000+( $(od -An -N2 -i /dev/random) )%(1023+1) )); (open http://localhost:${port}; python -m SimpleHTTPServer ${port}))'


serves the local directory on localhost and opens the default browser

alias fwget='wget --mirror --convert-links --adjust-extension --page-requisites --no-parent -e robots=off '


mirrors the entire page

alias iwget='wget -nd -r -A jpeg,jpg,bmp,gif,png --reject txt -e robots=off '


get all images from a page
>>
>>57205663
>>57205664
Well, true... it is.

>>57205629
>>57205676
right. Just fixed that before getting some groceries in.

Works now.
Just gonna make it reverse the calculation in the first is smaller now.

Thanks everyone.
>>
>>57205772
>>>/g/fglt/
>>
>>57205772
Most useful, as in the ones I use most often:

alias §=xdg-open
alias +='apt-get install '
alias ?='aptitude search '
alias upd='apt update'
alias upg='apt upgrade'
>>
>>57203434

To use the glm::lookAt() function in C++ on openGL:

is my understanding that this is meant to be used to generate a view matrix correct? And to change the viewing angle would I need to glm::rotate something or just change what the up axis is?

also is the "position of the camera" vector just the position in world coords?

        glm::mat4 view = glm::lookAt(
glm::vec3(1.2f, 1.2f, 1.2f), // the position of the camera (in world coords I think)
glm::vec3(0.0f, 0.0f, 0.0f), // the point to be centered on-screen
glm::vec3(0.0f, 0.0f, 1.0f) // the up axis. Here up is defined as the Z axis, which implies that the XY plane is the "ground".
);


>>
>>57203434

If someone is willing to help me: i've got this end of semester project in java programming for college and we gotta do a science related and original project.

My idea was to make a chemistry lab in VR, where you can mix stuff and see the reactions and stuff

The only problem is setting up the whole SDK thing

I know what to use, JMonkeyVR by phr00t, but everytime i try to set it up, i get an error here and there or the steps described somewhere are outdated, etc.

I need help setting it up, i can figure out the programming part

please help
>>
why doesn't this work?
double x, y, z;
read_line(&x, &y, &z);
printf("Echo: %lf %lf %lf", x, y, z);


int read_line(double* g_x, double* g_y, double* g_z){
scanf("%lf %lf %lf", &g_x, &g_y, &g_z);
}
>>
Most popular Linux distro in /g/:
http://pastebin.com/LwNug15H

:^)
>>
>>57204430
>>57204607
>>57204769
interesting... I made a Go lib to convert images and videos, but it's only a wrapper for ffmpeg
I did find bindings for ffmpeg, though... but I'm not sure why you'd want to touch that mess...
>>
>>57205871
to change the viewing angle you need to change what you're looking at
>>
what's the right way to write a regexp in ruby that matches . and ..?

i'm using /^\.{1,2}$/ and it seems to work
>>
>>57205937

Could I use it to make a moving camera?

Like does it change objects in world coords or rotate the world around the origin like a camera would?
>>
>>57205996
That's alright, alternatively:
/^\.\.?$/
>>
>>57203477
Terrible name. Drop the G, capitalize the C, and move some letters around.

Cinnumaé. Programming made personal.

You're welcome.
>>
seems like a lot of "cutting edge" academic work is done on high level languages, like python/matlab/R, where things like signal processing/machine learning can be done quickly and easily. whereas C, C++ and other stuff is being left to software devs / the occasional tiny bit of code that needs to be really fast. is this impression wrong?
>>
>>57206016
It gives you a matrix describing translation to the camera location you described and looking at the position you described

To rotate around the origin, just move the camera position around the origin

To rotate around the camera, you have to find a way to move the target around the camera
>>
>>57206043
no. C and C++ are only good if you need very high performance. If you don't need that then there's much better langugaes for just about any job.
>>
File: GCD_Euclid.png (10KB, 948x217px) Image search: [Google]
GCD_Euclid.png
10KB, 948x217px
Neat
>>
>>57206043
no, it's not
people want convenience
you don't need to go low level, writing a lot of verbose code that's prone to errors when you want to write a quick proof/confirmation/algorithm whatever
the underlying implementations could be written in low level languages for performance reasons but there's no reason for the interfaces to not be abstracted in higher level languages
it also provides lower barrier of entry
>>
>>57206043
Most of the time your average academics plays with beginner languages like Python, because the focus in academia is publishing a paper, not releasing usable software.

For any applications where you need performance, for example machine learning, usually everything is implemented in C++, and a layer of Python is added on top so beginners can play with it.

For example take at machine learning libraries, like Google's Tensorflow: https://github.com/tensorflow/tensorflow
>>
Has any one of you ever made a fluid simulation?
>>
>>57203434
Im willing to take out a loan so that I can attend a Programming bootcamp and get some certs and training. I don't care if I get a job that does earn me a 100k, just sick of my current job and desperate need of a career change.

Is this a good idea or bad
>>
C++ initializers question.
Why the fuck do they keep bitching about conversion narrowing?
How come it's not implicit like with regular arguments even with -Werror and -Wall?
Do I really need to explicitly * 1.f whenever I need a float and static_cast whenever I need an int that's rounded?
>>
>>57206101
*doesn't
>>
>>57206101
these certs from bootcamps etc are pretty much worthless unless you can meme yourself into some the next big thing hot startup
>>
>>57206101
Very bad. If you can't afford the bootcamp, don't take a loan.

You'll have trouble finding a job with zero experience fresh out of a bootcamp. The tech bubble isn't bursting yet, but things are slowing down.

What companies are looking for now is mostly talented, experienced people, the market for cheap webdevs is already saturated by foreign workers.
>>
File: Doma.Umaru.full.1901931.jpg (737KB, 852x957px) Image search: [Google]
Doma.Umaru.full.1901931.jpg
737KB, 852x957px
>>57205877
you are passing double pointer to scanf. try
scanf("%lf %lf %lf", g_x, g_y, g_z);
>>
>>57206101
Maybe a good idea. How much is the course?

You can learn to program by yourself. You don't need a course, unless you really want a piece of paper.

What's your current job?
>>
>>57206138
oh shit. thanks
>>
>>57206138
thank you for using an anime image, very cute
>>
>>57206102
>Why the fuck do they keep bitching about conversion narrowing?
Because narrowing conversions cause a lot of bug, and the best practice is to be explicit these days.

>Do I really need to explicitly * 1.f whenever I need a float and static_cast whenever I need an int that's rounded?
You just need to static_cast, or if you're not casting to a pointer/const/volatile you can use a C-style cast without danger.
>>
>>57205618
You are using jQuery. That is pretty stupid.

>>57205936
I don't really remember why we didn't just use the existing 1 to 1 bindings, but a friend and I wrote a light wrapper for directly passing Go "io" interfaces like ReadSeeker to ffmpeg. This minimizes the amount of copying needed and allows ffmpeg to seek Go memory. It currently does not expose much, but I can always expand it. https://github.com/bakape/goffmpeg
>>
>>57206128
>>57206136
>>57206139
I guess i could learn programming on my own, but I thought certs helpd you get jobs.
I know its just a piece of paper, but i thought it was the only thing employers recognized outside of cheap foreign aid or someone that has been programming for a decade.
>>
>>57206166
>You just need to static_cast, or if you're not casting to a pointer/const/volatile you can use a C-style cast without danger.

Damn, I thought so, that kinda adds a lot of verbosity and makes what otherwise would have looked clean with initializers pretty nasty. I was briefly considering -Wno-narrowing but I guess silencing compiler warnings and/or errors is not a good idea.
>>
>>57206054

Yes, this movement around the camera is handled by a view matrix. In my program it is a uniform, so every object will get the same rotation.

I am looking for advice on how to generate a matrix that does 2 things:

1. rotates around the origin where the camera is

2. translates objects to simulate movement of the camera
>>
>>57206180
That's true. the cert is probably a good idea. But i would learn as much as you can before getting the cert. Most programming courses are taught by clinical retards as many regulars here will attest to.
>>
>>57206180
Certs are worthless, because talented people don't bother to get them, and beginners can just buy them.

What employers look for is:
- Are you from a good school?
- Do you have a github/contributions to open-source, meaning are you passionate about programming?
- Can you pass the technical interview?
>>
>>57206251
I guess I should start a github then but who going to hire a nobody newbie programmer for their projects
>>
>>57206269
A nobody startup that can't afford to pay you more
>>
>>57206172
Why is using jQuery stupid?
>>
Restaurant app in Java for Android kindly Sir
>>
>>57206251
Shit loads of employers care about qualifications. If it's a medium to large sized company they will.
>>
>>57206281
This.

But after you have a year or two working for a startup, you can find more work easy enough.
>>
>>57206306
It's 1-100 thousand times slower than native, depending on what you are doing.
>>
>>57206339
Source?
>>
>>57206339
Who gives a fuck so long as it's fast enough?

>""""""native"""""" js
lel
>>
>>57206172
>>57206339
This is the only thing the app does.
And I'm using jQuery so I don't need to fuck around with event listeners.
>>
>>57206339
You probably write every little program in C because you think that the performance will make a difference.

JavaScript without jQuery is unbearable
>>
>>57206307

Please do the needful.
>>
>>57206406
I am requesting the kindly delivery of 30% upfront for the project of android Sir
>>
>>57206395
>an error caused a post from 2007 to be shown in the year 2016

jQuery is totally superfluous unless you live in some Sartre-esque hell that needs to support IE6.
>>
>>57206307
Understood
>>57206431
Understood
>>57206406
I can't actually make this out. What the fuck does this mean??
>>
File: dead-bird.jpg (146KB, 900x615px) Image search: [Google]
dead-bird.jpg
146KB, 900x615px
Currently trying to do an implementation of the Knights Tour using Recursive Backtracking.

My solution gives me an answer fairly quickly for a 7x7 grid, but when I do an 8x8 grid, it takes a lot longer (I haven't ran it for l... Is this expected for an unoptimized version of the algorithm?

Here's the main function:
struct Knight{
int xPos;
int yPos;
int moveNum;

Knight(int x, int y, int n)
{
xPos = x;
yPos = y;
moveNum = n;
}
};
bool knightsTourHelper(Knight& currentKnight, Grid<int>& chessBoard)
{

/********* BASE CASE **********/
if(currentKnight.moveNum >= NUM_OF_SPOTS_IN_GRID -1 ) //If you've moved more times than there
//are spaces on the chessboard, then congrats, you've completed the tour!
{
cout << "SOLUTION FOUND! #: " << currentKnight.moveNum << endl;
printGrid(chessBoard);
return true;
}
/********* RECURSIVE CASE **********/
else
{
Vector<int> validMoves;
returnValidMoves(currentKnight, chessBoard, validMoves);

int changeX, changeY;
for(int direction: validMoves)
{
chooseKnightMove(direction, changeX, changeY);
Grid<int> chessBoard_COPY = chessBoard;
Knight currentKnight_COPY(currentKnight.xPos + changeX, currentKnight.yPos + changeY, currentKnight.moveNum + 1);
placeKnight(currentKnight_COPY, chessBoard_COPY);

if(knightsTourHelper(currentKnight_COPY, chessBoard_COPY))
{
return true;
}
}
}
return false;
}


And here's the github if you want to see the guts of my program: https://github.com/CubicProgramming/ProgrammingChallenges/blob/master/KnightsTour
>>
>>57206356
Any number jQuery vs X benchmarks on jsperf.
>>57206360
Native methods are part of the browser and written in C/C++/whatever.
>>57206395
In IE8, maybe.
>>
>>57206465
I guess OSGTP is a real pooinloo
>>
>>57206475
>Native methods are part of the browser and written in C/C++/whatever.
JQuery uses those behind the scenes too.
>>
File: haskell.png (12KB, 225x321px) Image search: [Google]
haskell.png
12KB, 225x321px
>>57203717
Relevant xkcd
>>
>>57206453
Enjoy writing shitty code
document.getElementByClassName("class").style.backgroundColor = "black";

Whoever thought this was a good idea is a fucking idiot
>>
>>57206528
What is css?

Anyway, everything related to HTTP is bullshit.
>>
>>57206467
>C++
there's your problem
>>
>>57206528
I know this is bait but just for anyone learning javascript don't ever do that, apply a class instead.

also
>using getElementByClassName
>>
>>57206552
>What is css?
What is having to change CSS?
document.getElementByClassName("class").innerHTML = "isuhdf";
isn't much better.

>Anyway, everything related to HTTP is bullshit.
I agree
>>
>>57206584
I was just trying to show how painful not using jQuery can be.
>>
>>57206598

There's never a reason why you would need to write that code in vanilla javascript though. Even if you're using jQuery you shouldn't change css styles directly.

Do you happen to bookmark w3school pages?
>>
>>57206625
>Even if you're using jQuery you shouldn't change css styles directly.
That was just an example. Changing other things with the DOM is just as bad.
>>
>>57206504
Yes, under 200 layers of abstraction written in JS.
>>57206589
Lower level code is usually greater in volume.
>>
I'm trying to figure out how linked lists work.

Can anyone please tell me why my printList function isn't working?

and maybe what's wrong with my newTail function too?

It was working fine up until I started writing those two...

http://pastebin.com/ytRkPbmX
>>
>>57206395
jQuery is obsolete since the introduction of document.querySelectorAll
>>
>>57206676
>http://pastebin.com/ytRkPbmX
You are dereferencing a NULL pointer.
Try 'temp != NULL' in the while loop of your printlist function.
>>
File: Courage Approves.gif (666KB, 400x400px) Image search: [Google]
Courage Approves.gif
666KB, 400x400px
>>57206831
I see. Thanks, man.
>>
>>57206676

printList is pretty easy to do man

void printlist(node *linkedlist){
if(linkedlist == NULL) return;
node *scan;
for (scan = linkedlist; scan != NULL; scan = scan->fwd) printf("%d ", scan->info);
}
>>
>>57203434
Now that I can assume the som is working, I'm off to random forests.
>>
File: 1463266607258.png (125KB, 329x246px) Image search: [Google]
1463266607258.png
125KB, 329x246px
I'll try it one more time

can somebody please link the discord invite?
>>
File: terry a davis.jpg (321KB, 1971x1971px) Image search: [Google]
terry a davis.jpg
321KB, 1971x1971px
Would you "Terry" a Davis?
>>
Finished Finite Automaton Matcher from Cormen's Intro to Algos (34.3 p.969) in C and I'm proud of myself
>>
>>57206904
https://discord.gg/UZaRA
>>
>>57206066
Change the color of the green text for fucks sake.
>>
File: 1461121934956.jpg (50KB, 369x277px) Image search: [Google]
1461121934956.jpg
50KB, 369x277px
>>57206966
thanks
>>
>>57206963
the other three authors really get fucked don't they
>>
>>57206963
Congrats!
>>
File: 1451338360314.png (790KB, 792x792px) Image search: [Google]
1451338360314.png
790KB, 792x792px
The fuck do I put on a resume if I've never had a job?
>>
File: 1361299239246.gif (16KB, 125x125px) Image search: [Google]
1361299239246.gif
16KB, 125x125px
>>57206676
I still can't figure out how to add to the end of the list though

nodePtr newTail(nodePtr head)
{
nodePtr tail;
tail = head;

while(tail != NULL)
tail = tail->next;

tail = malloc(sizeof(node));
tail->data = 1;
tail->next = NULL;


return;
}


plz help...
>>
>>57207102
just the education
in the meantime contribute to some opensource projects and what not so you can update the resume later
>>
>>57207102
your portfolio. education etc.
>>
>>57207102
"pretty please"
>>
hi folks, sorry in advance for my english. Tell me please anyone, how can i run and compile my cpp-file to exe in fucking Windows? Maybe can i do it in command shell like Linux? I do not want work with VS projects, i like small editors and simple source files.
I have VS 2015 and one my cpp-file (without VS-components, just cpp), and i want get one exe-file as result. Can i use VS-compiler for that? And if can, then how?
>>
>>57205492
The to it and you, is that of for in on with have this. Not but are can just what, if be my, or like so your. They get don no as an use all at one from how there about was shit. Me only re more good some because up would why, will has even when out than know any want. Need also, by then, now people them using really still, fuck!
>>
>>57207102
I got hired two weeks as a junior game porting engineer in one of the biggest game porting companies of the world with no previous experience and I didn't even send a CV, I sent a mail explaining why I wanted to work with them and included:
-A portfolio with around 20 small games coded using different languages/engines/frameworks.
-A link to some of the code I used to make those games in my github.

Also, take in consideration common practices for your field (ie: I sent the mail in english even though no-one uses english here, because the industry itself moves in english).
>>
>>57207102
a pic of you in your pantyhose
>>
>>57207245
Time make fucking go should something better. Windows musch which think other too, doesn new ve work here. Their linux does he actually same. Got who way right, we its well into phone. Most could had ll, though https see off never going anything used pretty did being been thing buy, where back over these, those isn look years. Probably bes www ever first, since sure very try install everything without thread.
>>
>>57207260
Old yes computer after http, am things nice. Os already getting anyone take software, find meme, while before around were run post lot, didn code.
Thanks down. Literally nothing made bad say yeah enough.
Doing anon mean free gb. Problem works few laptop system ever.
>>
>>57207274
Maybe always point stuff looks someone might own google. Year screen wrong, two watch give, else reason hard less instead fine long games looking put. Least trying many keep case, having great another again, his open read. Day won, op last money android.
>>
>>57207102

Your favorite anime girls.

>>57207106

node addlast(node *linkedlist, int info){
node *new;
new = (node*)malloc(sizeof(node);

new->info = info;
new->fwd = NULL;

node *scan;
for(scan = linkedlist; scan->fwd != NULL; scan = scan->fwd)
scan->fwd = new;

return linkedlist;
}
>>
How do you scale a backend written in Go horizontally?
>>
>>57207291
Pc different; Ram makes both retarded, desktop battery end.
Either help apple support, life start runing, tell said yourself "price programming working"!
Cheap little learn cpu hardware shitty, play keyboard through oh. Stop card job big, kind full us come high source. Please video, let etc seems ago able idea feel bought. File making language worth internet version.
>>
>>57207106
try this

nodePtr newTail(nodePtr head)
{
nodePtr tail;
nodePtr temp
temp = head;
while temp->next != NULL){
temp=temp->next
temp->next = tail
temp = NULL
//Im not sure why you need to set tail-> next to Null. I think that should be automatically handled in your Node class. along with making data a preset
}

>>
>>57207301
Guess such set dont next, yet program arch unless youtube tried quality. Performance build server, far whatever usb between user, change once until ubuntu.
Stupid based easy html, everyone aren pic, guys. Data uses done small dive check.
>>
>>57207300
Rewrite in C++.
>>
>>57207316
Chan anyway type related. Man, im basically him. Non question care ones wait phones. Org wouldn single web.
>Tfw name possible guy live top pay.
>>
>>57207182
Easy solution, download g++ at nuwen.net

Also if you're using windows10 you can install the bash on windows stuff and apt-get clang and gcc

Also you can use cl.exe and vcvars.bat from visual studio
>>
>>57207323
And how would I scale C++ program horizontally?
I have not chosen the language yet.
>>
>>57207182
Mingw or boot into linux.
>>57207300
Need more info. What does your backend do? What is the database? How much internal state is there?
>>
>>57207333
Part days files, world home thought game, write machine. Gets thinking iphone, lol.
Times faggot ask true, true. Pro love understand buying difference, means talking place.

Decent ssd, debian almost java gentoo matter. Download board experience level left. Found amd gpu. Upgrade site under note, distro comes hate image. Simple whole ass retard may remember. Low users needs away, rather current monitor.
Kek, sound she cool gaming. Microsoft list gonna months kill.
>>
>>57207349
Usually installed, add ok fucked intel haven device. Fast swich issu, gnu design faster music show, saying company dumb botnet. Number exactly fact, each python hours course apps. Chink call win, link tech, example security. Fix wanted. Our general size app line anymore, second plus expensive, completely myself must computers actual today. Problems core sorry, started space. Hell, half website itself drivers boot. Seen black update called wiki. Recommend hope, learning text implying deal.
>>
File: 2016-10-23_15-03-34.png (46KB, 915x732px) Image search: [Google]
2016-10-23_15-03-34.png
46KB, 915x732px
Why does minMiles go retarded? Is it because there's no value in the 2nd row of the array? i.e. milesTracker[1][j] ?
>>
>>57207344
I was just memeing, rewriting in C++ would be vertical scaling technically.

Horizontal scaling means make your shit multithreaded and distribute your tasks between multiple servers using either:
- A message Q like Google Pub/Sub
- Load balancing
>>
>>57207360
Turn seem modern fun, mind. Month mine issues store. Went order project. God believe, except kernel broweser features nobody. Nvidia comfy display came php person. Mac quite takes, goes, says memory. Enjoy worse default sense.
Wasn later programs similar? Samsung sounds basic access threads, easily spend future account headphones. However heard runs hand.
>>
>>57207373
whaat
>>
>>57207373
Her hey useful option cheaper school. Market stock speed normal, technology mouse currently answer. Okay, slow main keyes firefox updates mostly key standard.
Replace friend, test tv, search week, likely close sell piece front poor hdd. Hd higher compared wants net box. Muh budget.
Couple cant cost available dead. Move thank control, thats page extra asking. Needed mobile built tier. Choice side picture aliexpress, mpv huge. Past random light devices, cards supposed settings.
>>
you can stop now
>>
Let's say I have a camera matrix A. How would I get the 3 dimensional vector, that would give me the direction from which I look through the camera? I can't quite wrap my head around it.

I can't imagine what exactly happens for a camera matrix. How does it transform the 3d space to look at it from a different position? If I simply translate the camera, I guess it would move the space into the opposite direction. What happens if I rotate the camera matrix? Does it rotate the space into the different direction? What's the starting vector which tells me which way I look? (0, 0, -1)? Or would it be something else? Using opengl if that matters.
>>
>>57207386
>>57207396
Honestly, sort amazon ebat camera storage media, obviously thinkpad. Depends.
Took systems sometime github. Often amount playng damn pixel, happen load specific. Otherwise network important shouldn tb produce. Taking kinda dev gtx, large become autistic. Audio setup multiple easier, dude. Coming prefer systemd super custom business package leave, desu. Absolutely reddit posting.
>>
>>57207396
cuck detected enjoy your own domain name of the same thing
>>
>>57207408
Installing information worked, value three graphics. Chrome motherboard cause trash reading outside. Online create country class. Unix simply entire sites. Pick perfect paid others gives stable parts, en development. Writing rest porn options remove player. Certain wish send public holy fps. Due wow.
Idiot flash operating finally couldn happens.
>>
>>57207426
ubuntu mate or something like this is the same thing
>>
>>57207410
>>57207426
Happened tracker definitely videos. Office laptops item autism feels. Stay companies cable, arm word stick language forgot. Dual brand servers copy cm nigger fit. Average against window touch, javascript house expect bunch wifi. Smart service release js.
Proper port manager ms inside anime meant. De break consider useless cannot minutes macbook. Longer error driver private. Posted considering original white self specs.
>>
>>57207440
Room tho cs button, wtf? Info processor questions plan older die weeks. Root knows input. Figure correct bump packages waste waiting local talk. Serious drives complete share senpai. Sd form common above numbers, pajeet mb ghz friends. Explain bsd torrent.
>>
>>57207464
News within starting safe, click weird recently. Proprietary features, ui trackers, ios images, gnome chinese, suck solution interesting together process, lmao.
Exsit choose ti terminal series properly. Popular password jobs rom major command, realize per broken mode headphone.
Email, personal vs special, shows distros shill. Pls, dick argument superior state. Latest facebook bigger tools themselves script.
>>
>>57207479
>Posts memes.
Gui given cuck, none via fan personally max bahind. Xiaomi ps mobo tablet fixed, faggots. Bet projects hz nexus, master content delet.
Anywhere hour handle during dell, nsa tool purpose mate. Red closed building book. Besides written, imagine client drop agree. Clean charge psu.
>>
>>57207479
Is this neural network or mathematically computed? :^)
>>
>>57206467
Jesus dude I'm trying to fucking eat. Go learn C++14 right now.
>>
>>57207490
Programmer products paying lost happy doesnt reasons third rx hot, giving fag somewhere previous. Hit typing return monitors whats smartphone lower gave cooler base, several several color application. Secure pass clearly apparently worst usage living. Edge car versions resolution daily air.
>>
>>57207498
>C++14
but its 2016
>>
>>57207490
Party kde jack bottom asked, although vim regular listen lack browsing upload moving human advice.
>>
>>57203630
Don't be like these autists and hipsters: use C#. It is a modern language that that will teach you the basics of C languages and Java languages.
>>
File: yuibg.png (766KB, 1920x1080px) Image search: [Google]
yuibg.png
766KB, 1920x1080px
>>57207295
So if I send my Yui folder I am an automatic hire because Yui is best girl?

>>57207157
I'll add that thanks.
>>
>>57203679
Depends entirely of what you are programming.
>>
>>57207336
>>57207348
Thanks, guys.
>>
I'm thinking of a new concept for a stock trading game. Instead of using RL stock data, I want to generate stock data based on a term and the amount of occurrences of that term in something like the homepage of a website.
>>
>>57207555
kawaii
>>
>>57207569
>inb4 4chan meme trading
I would buy though
>>
Can I post here if I only play araund with unity?
I want to assign a game object to a scripst variable, but the object will be instantiated only after the game starts, so I can't drag it in before.
Is there another way to do this? (as I can't drag a prefab into it either)
>>
>>57207588
There's already the rare pepe market for that.
>>
>>57205618
You can compare strings in jQuery?

To what end?
>>
>>57207593
>>>/vg/agdg/
>>
>>57207588
I have some ideas for stock trading markets (4chan, PornHub, local political stuff).
Imagine a 4chan stock exchange. Stocks are the latest and greatest in memes (happening, kys, etc.) and the value of the stock is based on the amount of occurrences when going through all boards.
>>
>>57207617
Thanks
>>
>>57207619
What I'm doing right now could help.
Popular words used after kys:
[(23.270850518489418, 'yourself'), (20.478885024079045, 'retard'), (11.557543484173294, 'nigger'), (11.455857635262708, 'tbch'), (11.455857635262708, 'nigfag'), (11.455857635262708, 'famalama'), (11.388055262972259, 'desu'), (10.762721041922928, 'uncultured'), (10.762721041922928, 'nodefag'), (10.762721041922928, 'larper')]


I'm trying to compute popular sequences of words but it gets exponentially resources intensive..
>>
>>57207609
Well my mistake was that I forgot to parseInt() on them.
jQuery is just a library for JavaScript, so you can compare normally if you want, like with RegEx and stuff.
http://www.w3schools.com/jsref/jsref_obj_regexp.asp
I normally just use PHP, though, if I'm gonna do a website or something. Just AJAX the file in.

But JS RegEx is about the same power as PHP's RegEx, just not as many options you can throw at it as pre-built patterns.
>>
>>57207680
I only find it unfathomable, I realize, because I come from a C language background.
>>
>>57207673
just have it generate a random large number and modulo against primes maybe?
>>
>>57207673
That's exactly what I'm thinking about. Sauce?
>>
>>57207673
Do you use tfidf for your weights?
>>
>>57207687
Well, if you've ever used Linux or UNIX, then you should be familiar with grep and egrep.

It's... not quite as good as that, but it's similar.
>>
>>57207701
I'm >>57205594
I updated the code but it's still WIP:
https://gist.github.com/anonymous/fd295f906f29535c546c7d33d441dfc3

>>57207705
Just IDF for now. TF is relevant when comparing a document to a corpus.

>>57207697
What do you mean? I don't want it to be random though
>>
>>57207737
>What do you mean? I don't want it to be random though
Wait, what are you trying to do?
I thought you were looking for a macro or something to generate an improved insult whenever you tell faggitz on here to "KYS"

Maybe I misunderstood
>>
>>57207727
>>57207687
You could also compare it to strcmp(), I think
>>
>>57207759
Yes I do but it's statistically generated mostly. Random will be added latter.
>>
>>57207440
>Office laptops item autism feels.
>Dual brand servers copy cm nigger fit
lel
>>
>>57207403
Ok I figured it out and got some good results, does anyone know how to get the distance of the current fragment in the fragment shader from the nearest vertex, or from all the vertices of that triangle? Is that possible?

Please help
>>
>>57207787
>Yes I do but it's statistically generated mostly.
IDK don't think I can help with this one.

Those numbers don't add up to 100%, so I'm not sure what you're aiming at.
Just post it based on the percentage of how often it is?
that would work if you know the percentage
>>
>>57203434
Is there a library that can analyze a music stream and output colors for lighting bulbs to the beat of the music?

You know, like people do with their Christmas lights?
>>
>>57206973
no
>>
I have been assigned the task of porting a relatively small backend (PHP to Node.js).

While I do have a firm grasp on both PHP and Node.js, I have haven't done this before. I am not really sure where to start.

Do any of you have some resources on how to tackle this? Books, blogs, talks, what have you.
>>
File: Screenshot_2016-10-23_23-11-11.png (116KB, 691x748px) Image search: [Google]
Screenshot_2016-10-23_23-11-11.png
116KB, 691x748px
>>57208014
I'm retarded.
Basically the algorithm get stuck on popular loops:
to be able to be able to...
of the same thing of the same thing...


But I still added random just for fun and got pic related

It works well but I think I can do better by using the sequences of words as is.
>>
I'm assuming this would be the place for a quick regex question
how would I select any string containing a word?
as in
afoobar
foo
foobar
foobars
>>
>>57208202
regexr.com
>>57208193
Rewrite it piece by piece and test both against the same unit tests.
>>
>>57207078
Thanks anon, have a (You)
>>
>>57208202
Literally just /foo/g
>>
>>57203679
Yes.
>>
>>57208193
You'll go faster if you just cut the problem into smaller goals and get to it, rather than reading and watching talks.

There's no magic way to be smart about this.
>>
>>57203855
>>
>>57208288
it's pertaining to 4chanx filters
if I just filter foo it will only filter foo and no other words containing foo
is that even possible?
>>
>>57208310
what about .*foo.*?
>>
>>57208310
What anon said is correct.
/foo/g will filter anything that contains foo.

For example
/pertain/g;boards:g
will filter your post, because it contains the word "pertaining"
>>
>>57208337
that seems to do it
>>
>>57208240
>>57208293
Thanks for the tips
>>
>>57207311
This didn't work

>>57207295
This only adds the node into the second position and loses everything afterwards.
>>
>>57208448
your first bug report was better than your second
>>
hello world don buy me and even though guess you opened it just sounds really important documents on ebay ran server built skylake performs in ee faculty cs degree angle bracket next time for homosexuals who knows truly good if you re seeing if they invited to use oop javascript libraries and qt whyd you needed http www aliexpress play
>>
>>57204269
Thanks a bunch anon.
>>
>>57208566
Did someone make a bot that constructs posts designed to crash the human brain?
>>
>>57208584
human subjects keeps switching between ie utf qid sr kx for it will be vista could have at max bitrate is seriously waste of chinkshit resellers pick the rest is impossible perfect outside the unix timestamps that why you must be prone to rename it from china please stop complaining god damned power computers than can show of better and
>>
>>57208513
>>57208448
>>57207295
Okay, it seems to be working as long as
scan->fwd = new;
is outside of the for loop, so I wrote it like this:
nodePtr newTail(nodePtr head)
{
nodePtr tail = NULL;
nodePtr temp = NULL;
tail = malloc(sizeof(node));

tail->data = 5;
tail->next = NULL;

temp = head;

while(temp->next != NULL)
temp = temp->next;

temp->next = tail;

return head;
}


Thanks for the help.
>>
>>57207106
can you clarify what this function is supposed to do?if you like. say i have a linked list 2 -> 3. is the result supposed to be 2 -> 1 or 2 -> 3 -> 1?
>>
>>57208609
>>57208630
okay, so you did want the second
if you're going to perform this operation a lot i think it's worth just carrying around a pointer to the tail and updating it as necessary
>>
File: 1406959839607.gif (308KB, 500x272px) Image search: [Google]
1406959839607.gif
308KB, 500x272px
>>57208630
2->3->1

I see now why naming it newTail can be misleading, my bad.
>>
>>57208609
>Okay, it seems to be working as long as
>scan->fwd = new;
>is outside of the for loop, so I wrote it like this:
I can't be bothered looking at your code right now because I'm too sleep, but just for future reference. Your mindset is wrong. That is decidedly a wrong way of programming. You don't just move lines of code around until something seemingly works.

Instead, take a breather, define EXACTLY what you want to do, map out the steps it's gonna take to do that thing, then write out the instructions for each step, one by one, as code. And test each step as you've written it.

I'm not trying to bully, just a friendly tip to anyone who's new-ish to programming.
>>
>>57208682
>That is decidedly a wrong way of programming.

Shotgun debugging is a tried and true method.
>>
NEW THREAD

>>57208696
>>57208696
>>57208696
>>57208696
>>57208696
>>
Is there an API to post automatically on 4chan?
>>
>>57208705
It's called heigh titty pees.
>>
>>57208682
Yeah, I get that. I'm not good enough to get it on the first shot though.

I took an intro to C class last spring semester, and now I'm taking CS1, and i've been shooting the shit up till about 2 or 3 weeks ago, so I basically just relearned all of this recently.

I'm a physics major, this has never really been a big interest for me.
>>
>>57204199

You're doing it wrong..

>>57204049

>If you're one of the people who religiously makes empty getter/setters for everything because someone told them to, please understand that this is misguided.

I NEVER got why this whole getter/setter thing is such a shit in Java. I mean the whole langauge is based on code fragments talking to each other. And yet nobody bothers to make it easier to write getters/setter?

Compare those:


Ruby

class Person
attr_accessor :nickname, :age
attr_reader :name

def initialize(name)
@name = name
end
def greeting
"Hello #{@name}"
end
end



Now EXACTLY THE SAME thing in Java:

class Person{

private String name;
private String nickname;
private int age;

public Person(int name){
this.name = name;
}

public getName(){
return this.name;
}
public getNickname(){
return this.nickname;
}
public setNickname(String nickname){
this.nickname = nickname;
}
public getAge(){
return this.age;
}
public setAge(String age){
this.age = age;
}

public void greeting(){
Sytem.out.println("Hello " + this.name);
}
}



Why isn't there a shorter way in Java??
>>
>>57208753
>Why isn't there a shorter way in Java??
There is, it's called use C# instead. Where it's just public string Name { get; set; }
>>
>>57208794

Nice.

I don't know much about C#, but it seems really well designed.

I'm just wondering why nobody ever wrote a better syntax for Java. It's no code-magic to write it like in C# or Ruby, and yet they defend their stupid getters/setters boilerplate as if it would any value to the code.
>>
>>57208843
>I'm just wondering why nobody ever wrote a better syntax for Java.
Java devs are just retarded. There's no other reason. Don't try looking, it will only depress you.
>>
>>57208875
Pretty much this, and I've worked as a Java dev for money before.
>>
>popping the stack during a function call
Took me too long to realize what was wrong
>>
>>57203679

Depends on what you're programming, and how vigilant you're trying to be with "bugs".

Is a small graphical error worth spending a half an hour hunting down, and reworking some function somewhere?

I think a lot of it depends on how persnickety you are with stuff like that. Me, personally, I hate even the tiniest of bugs, even if they're strictly cosmetic.
>>
guys how do i do a function to check how many times a string is inside another string in c#? without using arrays because i havent learned that yet.
or at least point me in the right direction, when i search for it online i only see code i cant understand yet.
pls
>>
>>57210873
var count = yourString.Split(subString).Count() - 1
Thread posts: 328
Thread images: 29


[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.