NoSQL edition #2
>2016
>using SQL
Nice Pajeet
Old thread
NoSQL edition #2
>2016
>using SQL
Nice Pajeet
Old thread
What to do when your entire development team are literal Pajeets except you?
>CouchDB
>relax
>Your data is fucked anyway.
NoSQL is shit.
NoSQL will always be shit.
NoSQL is only worth it if you don't value your data integrity, reliability and safety.
code in haskell so pajeet leaves
quit
Anyone?
But is SQL webscale? Have you heard about clustering? Sharding, my man. I think this is the best option for scalability, and Facebook and Google agrees with me.
>Is SQL webscale?
And here we have the commonly spotted Developo Moronicus in it's natural state, shitposting.
Just finished my Deep learning project using Caffe
youtube.com
>can't upload more than 120sec
But I need money, user
Get to know their daughters/sisters
For what purpose?
>inb4 sleep with them
No thanks
grow up. i know several pajeets and they are normal people.
Nice try Pajeet
Class A is in charge of controlling instances of class B. Class B sometimes needs to use functions in class A.
Should class A pass a reference to itself to class B's functions or should class B store a pointer to class A?
You should use functional programming
If you're dealing with a parent-child relationship (i.e. there's a unique A for every B) do the latter, otherwise the former.
That makes sense, thanks.
The only thing it could do is throw a compile-time error if the static_casts fail, but I think anything can be cast to void so I can't see it's actual use.
I'm learning C. How is this?
char* tostr(int n) {
char* str;
int div, len = 0, m = 1, i;
while (n >= m) {
++len;
m *= 10;
}
str = malloc(len);
div = pow(10, len - 1);
for (i = 0; n > 0; ++i, n %= div, div /= 10)
str[i] = '0' + n / div;
return str;
}
Should I stop my computers windows 10 upgrade. Its happening now and I still have time to stop the download.
>++len
>not len++
fuck you faggot hipster
Huh? You're probably just shitposting, but in this case it literally doesn't matter, does it?
It's quite common in C code, you have no idea what you are talking about.
gcc is smart enough to optimize len++ into ++len.
Another user learning C and very confused with some very basic thing.
If I write
#include
int main()
{
int a = 1;
int b = 4;
while (a < b)
{
printf("%d\n", a);
a = a + 1;
}
printf("Let's go!\n");
return 0;
}
I get exactly what´s expected, but if I write
#include
int main()
{
int a = 1;
int b = 4;
while (a < b)
{
printf("%d\n", a);
a = a++;
}
printf("Let's go!\n");
return 0;
}
I get infinite ones. I don´t know if they´re actually infinite, but my computer froze before I got to the end.
Why the hell is this happening? Why doesn´t a++ work like a = a + 1 like in a for loop?
yes
You shouldn't write a = a++;. Post-increment is binary operator so it's just a++;.
whats the deal with putting
do {
/* --- */
} while (0)
in macros?
The a++ is short for a = a + 1.
a = a++ results into a = a because the ++ operator increments AFTER the assignment.
Can someone post the Programming Challenges picture?
...
char * int_to_str(int n) {
char *buf=malloc(20); //uint32max=10
snprintf(buf,20,"%d",n);
return buf;
}
Oh.
Well, the error was even more stupid than I thought.
Thank guys.
Here's a Java babby's solution for the Prime Number Generator:
public static void generatePrimes(int limit) {
if (limit 2 && limit < 5) {
System.out.println(2 + "\n3");
return;
}
ArrayList primes = new ArrayList();
primes.add(2); // Added to optimize prime checking loop
primes.add(3); // ie. skip checking if n
i didnt know java had labels
How does one test C code?
valgrind?
I want to learn Java so that I can make apps for Android but I feel like it will be a waste unless I learn to program swift too as iPhones are more popular. What is your guys' opinion on that?
Only for loops.
learn C and only C
Any reason why?
Rollin
Grandfather of all C languages
>Here are its descendants
>C++
>Objective C
>C#
>F#
Besides, you can use C# for Xamarin so that you may write Android apps
I can read a little bit of this but I am disoriented by the fact it is not a C language.
But how will this help with mobile programming?
Learning C? Not at all.
>Xamarin is for mobile programming
Look it up, m8
This is a fantastic function. Ignore , his code doesn't meet your spec and over-allocates memory for no reason. Ignore , he doesn't realise that post increment needlessly copies to stack.
You have solved the problem you were trying to solve correctly, compactly and extensibly. The /ONLY/ suggestion I would make is this:
int tostr(int n, char &&out) {
int div, len = 0, m = 1, i, err;
while (n >= m) {
++len;
m *= 10;
}
(* out) = malloc(len);
if (str == NULL) {
return 1;
}
div = pow(10, len - 1);
for (i = 0; n > 0; ++i, n %= div, div /= 10)
(*out)[i] = '0' + n / div;
return 0;
}
always enable error checking in basic functions. Now when the caller uses this function, they can know whether or not to trust the out parameter.
For extra fun, try writing a function which takes an int input and prints the number in english.
Anybody have any program ideas that can convey your level of mastery if you've just been at it for ~1 year? This is for internships/co-ops
Depends on your level of mastery user
Write a maze-solver that gives a graphical output where the input is some csv data of a maze
F# is a derivative of ML
Noted, thanks mate.
char **out, not &&
>that post increment needlessly copies to stack.
que
You might as well prefer to let the user provide a buffer that they already allocated.
>doesn't realise that post increment needlessly copies to stack.
No.
You lose encapsulation by requiring the user to allocate a properly sized buffer. If this was a part of a library you should provide two functions: one that provides the buffer for you, and the other that you provide the buffer and it signals to the caller if the buffer is too small before filling it.
Can anyone highlight the fault in my code?
I have provided a screenshot to try and help anyone interested in helping out.
I'm basically trying to create a script which acts as Ctrl + S on a browser, it's almost complete after this fix. Except it's only grabbing CSS and not images, js etc.
for link in soup.find_all('link', href=True):
cssUri = link['href']
cssPath = base_url + cssUri
cssMatch = re.search(r'/([\w-]+\.css)', cssPath)
if cssMatch:
cssFilename = wget.download(cssPath)
print cssUri
print cssFilename # [Exhibit 1]
newContent = uniData.replace(cssUri, './' + title + '/' + cssFilename) # [Exhibit 2]
but don't you lose encapsulation anyways since the caller has to free the returned pointer in order to not leak memory?
>check out some nosql / data stores
>need at least 2 cores, 4gb of RAM and you better have a redundant network of at least 5 servers
no thanks
Sorry the actual fault in the code is that it is able to print each cssFilename correctly, however it would appear that once in the variable 'newContent', it only does a single replace
And the problem being?
Don't worry! Just pay for AWS Amazon botnet and they'll get you covered for 25 times the price you'd pay for a few servers but they're definitely better!
But Google has web scale SQL
>You lose encapsulation by requiring the user to allocate a properly sized buffer.
In this case, you might as well return a pointer, then. Requiring the user to supply you with one doesn't make much sense.
A failure could return 0 or something.
Not really (Technically yes, but it's a scale). When freeing you don't need any information about how the function works to be able to free it. When you are allocating, you do.
The first three links don't get replaced only the last one does.
Could it be that you keep overriding the variable and then only the last one is the result?
I think this is what it is, I removed the indent on the last line to be within the for loop but there's no difference
Are you talking about how it renames the file?
So perhaps what you need is something like:
link['href'] = './' + title + '/' + cssFileName
Instead of:
newContent = ...
Then you save that document instead?
There's not a whitespace issue (atleast not that I am aware of). The code functions without an IOError and it handles one which does have a space style (1).css perfectly fine.
Yes, basically if you do wget on a webpage, all the css links will be hardcoded to match the links on their server, however if you would like to view the html page with CSS, you must grab the CSS and replace the links with the actual paths on your file system
Okay I'll give this a try,
Thank you
When you know some computer graphics basics it's fairly obvious why there's a problem with this for games.
Sampling their points is the problem they're really dealing with. Point clouds are difficult to move about and especially animate.
In simple terms really: imagine you had a simple polygon somewhere. You wanted to move it, translate it along the X axis. What you do is add a value to every vertex of the polygon (or something very similar). Ezpz.
Try and do this with a point cloud. Even if we had a datastructure which doesn't require some sort of complicated reinsert we'd still have to translate WAY more dots than in the polygon case. And with actual animation the situation just becomes more complicated because any extra step in the translation process would be multiplied way more in the point cloud case compared to the polygon case.
You will notice that this company (which only really used their broad promises about using this for video games) has moved on to things like using what they've built to visualize point cloud data in situations where they don't have to move anything at all. Like when looking at data collected from scanning a real life environment. And in that field what they've done isn't innovative at all. It's pretty much the norm from what we can tell about their software.
So it's not feasible at all for video games. If you want to look at something cool you can look at raymarchers. They'd require artists to build their models in entirely different ways but much like this here they support much finer resolutions of things, repetition of objects is trivial. And I'm sure you could (like I did) write and understand a raymarcher/sphere tracer in maybe two days.
Also makes lighting way easier because of some of the characteristics it shares with raytracers. I'm exploring this right now. I've been procrastinating quite a bit though so I really don't have much to show.
guys whats the best java library to archive a bunch of images from Sup Forums
i feel like cloudflare is fucking with me with 401 requests or do I just need to emulate the GETS like a web browser
>best java library
Writing a program in a different language and then calling it from java.
If I'm 27 and I want to start programming games (the graphics and music would be contracted, not developed by me) where could I start from in order to be good at creating minimallistic games before being 35 yo and hopefully being hired by a company?
but it's practice for enterprise level senpai
you know, work and shit :(
It appears that if I do link['href'] = './' + title + '/' + cssFilename and then print soup (the HTML) it doesn't automatically replace the link['href']s in the soup document
Shouldn't the standard library be enough for that? Just use HttpUrlConnection and ImageIO.
I'll try it again but I was having 401 http connection issues.
I glimpsed over the docs and it seems like you need to do something like this:
new_tag = soup.new_tag('a')
new_tag['href'] = './' + title + '/' + cssFilename
link.replace_with(new_tag)
This is extremely weird, now it doesn't replace the bottom one anymore and just the top one haha
I think I'll leave it for now and come back to it once my head isn't fried
Enterprises use Haskell nowadays
user. I'm a Angel2D shill from /agdg/. I find that Game maker and the likes (unity, unreal etc). Doesn't teach you any of the real skills you need to just like make game.
It's not for getting hired unless you're looking for a company which uses a specific engine.
There's plenty of routes to choose. But I think that really for learning gamedev you'd like a framework (note the specific meaning of this word in context) for gamedev. I'd shill Angel2D at you. It's a fine framework and doesn't really make anything more complicated than it needs to be. But it's effectively abandoned by devs.
Another option is Urho3D. I haven't used it yet but Urho3D looks like a really sweet engine to go with. Angel2D is really convenient and incredibly easy to get going with. I wouldn't count it out because of the problems mentioned above. Their design philosophy makes it incredibly easy to dig into the framework yourself and do what you want with it.
I do find that the obfuscation you find within engines like Unity or gamemaker will probably not teach you the skills you need to be employable. Being an engine dev is way higher status and the further you move away from that the less merit there is in what you've done. If you want to appeal to unity gamedev companies later you can familiarize yourself rather quickly. The real experience in those engines are stuff like knowing their quirks (of which there's many). But being the kind of guy that can solve problems on his own is worth a lot more.
You often find if you go through what unity developers say at conferences they're very often working around unity rather than through it.
Obligatory mention of Handmade hero:
Handmadehero.org. Without a doubt the best resource you can find on game engines that I've found so far. And their movement in general is rather stunning. Look at their small conference. They get speakers like Mike Acton from insomniac games and the guy who did, D2 warcraft, SC and guild wars net code.
>netcode
Network infrastructure really.
Excellent suggestion (I'm a 3rd party, third person, thirdgender whatever), I think you screwed up one thing:
>char &&out
you meant char **out, right?
most people are just too stupid, seriously. they have a really hard time dealing with abstract concepts such as pointers.
But not with abstract concepts like math, functions and pretty much anything pertaining to CS in general?
>black/white
Sup Forums go back to your concentration camp.
use raw opengl
>But not with abstract concepts like math, functions and pretty much anything pertaining to CS in general?
most people struggle with math and economics etc too. don't you remember from when you were in school, it's like people were literally retarded in math class
only last one is starting with a '.'
I wrote a few functions like this..
Really the int to str should be regarded as a function you don't really need performant code for. Better would be something like (written on phone, bear with me)
int remainder = value;
int i=0;
Char* buff=malloc (sizeof(char)*bufdersize) ;
while(remainder!=0 && bufdersize > i){
buff[i++] = symbolsArray[(remainder/base) %base] ;
remainder=remainder/base; //gets rid of the lowest significant digit
}
Where symbolsarray is an array consisting of all the different characters available for representing the number (0-9 for instance) with their index corresponding to the value of the character.
Sorry about the mess. I'l elaborate later if I have to. But this method works generally for whatever base you want as long as the symbolsarray contains enough characters. You can translate a number into base 53 if you want.
ignore the race part then if it triggers you.
this is why functional programming will never take off: most programmers can't even understand it.
youtube.com
this shit cant be serious kek
I'll advised. Using GLEW/GLUT and GLFW doesn't hurt. It's very easy to build around really.
But raw opengl 'raw opengl' leaves you with too much platform specific implementation for no real reason.
holy fuck pajeet