[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ daily programming thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 27
File: couchDB.png (39 KB, 800x600) Image search: [Google]
couchDB.png
39 KB, 800x600
NoSQL edition #2
>2016
>using SQL
Nice Pajeet

Old thread
>>54788666
>>
>>54798180
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.
>>
>>54798203
code in haskell so pajeet leaves
>>
>>54798203
quit
>>
>>54798183
Anyone?
>>
>>54798206
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.
>>
>>54798220
>Is SQL webscale?
And here we have the commonly spotted Developo Moronicus in it's natural state, shitposting.
>>
File: 02.jpg (123 KB, 500x375) Image search: [Google]
02.jpg
123 KB, 500x375
Just finished my Deep learning project using Caffe

https://www.youtube.com/watch?v=jNZP_G3ezxY [Embed]
>can't upload more than 120sec
>>
>>54798214
But I need money, anon
>>
>>54798203
Get to know their daughters/sisters
>>
>>54798574
For what purpose?

>inb4 sleep with them

No thanks
>>
>>54798203
grow up. i know several pajeets and they are normal people.
>>
>>54798651
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?
>>
>>54798727
You should use functional programming
>>
>>54798727
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.
>>
File: cyberpunk wojak.jpg (115 KB, 500x638) Image search: [Google]
cyberpunk wojak.jpg
115 KB, 500x638
>>54798750
That makes sense, thanks.
>>
>>54798216
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;
}
>>
>>54799126
Should I stop my computers windows 10 upgrade. Its happening now and I still have time to stop the download.
>>
>>54799126
>++len
>not len++
fuck you faggot hipster
>>
>>54799140
Huh? You're probably just shitposting, but in this case it literally doesn't matter, does it?
>>
>>54799140
It's quite common in C code, you have no idea what you are talking about.
>>
>>54799140
gcc is smart enough to optimize len++ into ++len.
>>
Another anon learning C and very confused with some very basic thing.

If I write
#include <stdio.h>

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 <stdio.h>

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?
>>
>>54799242
yes
>>
>>54799242
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?
>>
>>54799242
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?
>>
File: g_challenges.png (302 KB, 1920x1080) Image search: [Google]
g_challenges.png
302 KB, 1920x1080
>>54799322
>>
>>54799126
char * int_to_str(int n) {
char *buf=malloc(20); //uint32max=10
snprintf(buf,20,"%d",n);
return buf;
}
>>
File: 1459887057923.jpg (41 KB, 400x424) Image search: [Google]
1459887057923.jpg
41 KB, 400x424
>>54799274
>>54799288
Oh.

Well, the error was even more stupid than I thought.

Thank guys.
>>
>>54799330
Here's a Java babby's solution for the Prime Number Generator:

public static void generatePrimes(int limit) {
if (limit <= 1) {
return; // Too lazy to support negative numbers
}

else if (limit == 2) {
System.out.println(2);
return;
}

else if (limit > 2 && limit < 5) {
System.out.println(2 + "\n3");
return;
}

ArrayList<Integer> primes = new ArrayList<>();
primes.add(2); // Added to optimize prime checking loop
primes.add(3); // ie. skip checking if n <= 3
System.out.println(2 + "\n3");

numLoop:
for (int n = 5; n <= limit; n += 2) { // Do not check even numbers
for (int i = 1; i < primes.size(); i++) { // Start i at second element to skip n % 2 == 0 check
if (n % primes.get(i) == 0) {
continue numLoop; // Skip printing n if n is not prime
}
}

primes.add(n);
System.out.println(n);
}
}
>>
>>54799367
i didnt know java had labels
>>
How does one test C code?
>>
>>54799556
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?
>>
>>54799384
Only for loops.
>>
>>54799702
learn C and only C
>>
>>54799743
Any reason why?
>>
>>54799330
Rollin
>>
>>54799276
http://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for
>>
>>54799799
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
>>
>>54799367
I can read a little bit of this but I am disoriented by the fact it is not a C language.
>>
>>54799974
But how will this help with mobile programming?
>>
>>54800031
Learning C? Not at all.
>>
>>54800031
>Xamarin is for mobile programming
Look it up, m8
>>
>>54799126

This is a fantastic function. Ignore >>54799332 , his code doesn't meet your spec and over-allocates memory for no reason. Ignore >>54799140 , 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
>>
>>54800343
Depends on your level of mastery anon

Write a maze-solver that gives a graphical output where the input is some csv data of a maze
>>
>>54799974
F# is a derivative of ML
>>
>>54800334
Noted, thanks mate.
>>
>>54800334
char **out, not &&
>>
>>54800334
>that post increment needlessly copies to stack.
que
>>
>>54800334

You might as well prefer to let the user provide a buffer that they already allocated.
>>
>>54800334
>doesn't realise that post increment needlessly copies to stack.
No.
>>
>>54800615
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.
>>
File: CtrlS.png (49 KB, 668x445) Image search: [Google]
CtrlS.png
49 KB, 668x445
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]
>>
>>54800678
but don't you lose encapsulation anyways since the caller has to free the returned pointer in order to not leak memory?
>>
>>54798180
>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
>>
>>54800694
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
>>
>>54800694
And the problem being?
>>
>>54800721
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!
>>
>>54798220
But Google has web scale SQL
>>
>>54800678
>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.
>>
>>54800720
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.
>>
>>54800729
The first three links don't get replaced only the last one does.
>>
>>54800852
http://stackoverflow.com/questions/14852140/whitespaces-in-the-path-of-windows-filepath
>>
>>54800852
Could it be that you keep overriding the variable and then only the last one is the result?
>>
>>54800883
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
>>
>>54800694
Are you talking about how it renames the file?
>>
>>54800897
So perhaps what you need is something like:
link['href'] = './' + title + '/' + cssFileName


Instead of:
newContent = ...


Then you save that document instead?
>>
>>54800872
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.

>>54800906
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
>>
>>54800913
Okay I'll give this a try,

Thank you
>>
>>54796099
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.
>>
File: PLPC165.png (128 KB, 411x205) Image search: [Google]
PLPC165.png
128 KB, 411x205
guys whats the best java library to archive a bunch of images from 4chan

i feel like cloudflare is fucking with me with 401 requests or do I just need to emulate the GETS like a web browser
>>
>>54800972
>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?
>>
>>54800987
but it's practice for enterprise level senpai

you know, work and shit :(
>>
>>54800913
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
>>
>>54800972
Shouldn't the standard library be enough for that? Just use HttpUrlConnection and ImageIO.
>>
>>54801061

I'll try it again but I was having 401 http connection issues.
>>
>>54801031
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)
>>
>>54801094
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
>>
>>54801006
Enterprises use Haskell nowadays
>>
>>54800998
Anon. 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.
>>
>>54801244
>netcode
Network infrastructure really.
>>
>>54800334
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?
>>
File: iq.jpg (40 KB, 887x508) Image search: [Google]
iq.jpg
40 KB, 887x508
>>54794948
most people are just too stupid, seriously. they have a really hard time dealing with abstract concepts such as pointers.
>>
>>54801293
But not with abstract concepts like math, functions and pretty much anything pertaining to CS in general?
>black/white
/pol/ go back to your concentration camp.
>>
>>54800998
use raw opengl
>>
>>54801313
>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
>>
>>54800852
only last one is starting with a '.'
>>
>>54799126
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.
>>
File: yourstolose.png (54 KB, 800x724) Image search: [Google]
yourstolose.png
54 KB, 800x724
>>54801313
>>54801293
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.
>>
https://www.youtube.com/watch?v=CHCJ7XQe7nE

this shit cant be serious kek
>>
>>54801320
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.
>>
>>54801455
holy fuck pajeet
>>
>>54801468
yeah use something to help you get a context and such, i just meant raw opengl as in not a game engine or anything like that
>>
type 'a t = {
cmp : 'a -> 'a -> int;
default : 'a;
mutable array : 'a array;
mutable length : int;
}
;;

let make cmp default = {
cmp = cmp;
default = default;
array = Array.make 1 default;
length = 0;
}
;;

let length heap = heap.length;;

let parent i = (i - 1) / 2;;

let left i = 2 * i + 1;;

let right i = 2 * i + 2;;

let print_t pp_a oc heap =
let rec loop l i =
if i < heap.length then
begin
Printf.fprintf
oc "%s%a" (String.make (2 * l) ' ') pp_a heap.array.(i);
print_newline ();
loop (succ l) (left i);
loop (succ l) (right i)
end in
loop 0 0
;;

let grow heap =
heap.array <-
Array.init
(2 * Array.length heap.array)
(fun i ->
if i < heap.length then
heap.array.(i)
else
heap.default)
;;

let swap heap i j =
let x = heap.array.(i) in
heap.array.(i) <- heap.array.(j);
heap.array.(j) <- x
;;

let insert heap x =
if heap.length = Array.length heap.array then
grow heap;
heap.array.(heap.length) <- x;
let rec loop = function
| 0 -> ()
| i ->
let p = parent i in
let c = heap.cmp heap.array.(p) heap.array.(i) in
if c < 0 then
begin
swap heap p i;
loop p
end in
loop heap.length;
heap.length <- succ heap.length;
;;
>>
Calling OpenGL "raw" is like calling precooked frozen hamburger patties "raw".
>>
>>54801543
let take heap =
let x = heap.array.(0) in
heap.length <- pred heap.length;
heap.array.(0) <- heap.array.(heap.length);
let rec loop i =
let l = left i in
let r = right i in
let add_if_valid i valids =
if i < heap.length then
i :: valids
else
valids in
let valids = add_if_valid l (add_if_valid r []) in
match valids with
| [] -> ()
| c :: cs ->
let c, xc =
List.fold_left
(fun (c, xc) j ->
let xj = heap.array.(j) in
if heap.cmp xc xj < 0 then
j, xj
else
c, xc)
(c, heap.array.(c))
cs in
if heap.cmp heap.array.(i) xc < 0 then
begin
swap heap i c;
loop c
end in
loop 0;
x
;;
>>
>>54801548
sorry i forgot the real wizards program in gpu assembly in the current year
>>
can i use indent to paste in the GPL into every .c .h file?
>>
File: WWE SMACKDOWN RAW.jpg (77 KB, 750x485) Image search: [Google]
WWE SMACKDOWN RAW.jpg
77 KB, 750x485
>>54801560
>>
>>54801290
He already clarified it here >>54800535 so yeah
>>
>>54799330
roll
>>
>>54801562
the program "indent" ? could be, but no, I don't think it has this feature.
>>
>>54799330
reroll
>>
Can someone tell me whats so hard about game engines. I dont understand why you couldnt just make something that accepts fbx scenes and program effects and animations as you need.
>>
>>54801548
Well sadly hardware vendors don't really release anything to assist with making 'raw' GPU code.
>>
>>54801672
>>54801570
>>
>>54801683
Vulkan still does not let you do it raw, it's just a bit lower level than OGL giving you *slightly* more control.
>>
>>54801716
>bit
>slightly
>>
>>54801665
Game engines are hard because they have to be fast. Very fast. Also they don't know their inputs ahead of time (designers make up whatever entities they want). They have very hard constraints compared to most programs and if you consider how competitive say a text editor is compared to games. A game engine is competing much more directly than a text editor. Most software written today is crap. It's not safe enough, it's not fast enough. With game engines having a crash is a major problem (unless you're Bethesda apparently). Missing your framerate is a big issue. Expectations are high.

That said there's plenty of games (like minecraft) which aren't really constrained because their aims are low.
>>
>>54801683
You can't expect people to reverse engineer GPU's and then do some OS magic to have your users platform send just what you want.

Raw Opengl just means that you're not using any intermediate functionality (like GLFW) anyhow.
>>
>>54801772
That would be fucking retarded and you should not do that.
>>
https://youtu.be/JWaDa8taiIQ
>>
>>54801725
>>54801716
Yes. Vulkan is not at all what's promised. It's really annoying a lot of people.

The best gain you get from it is really reducing the amount of drawcalls. Which is clearly a big deal. But vulkan is hard to consider as a close to the metal interface.
>>
>>54801786
Precisely. But there's hardly any real options to get 'closer'.
>>
>>54801790
Really? It's exactly what I expected. Not sure what's really disappointing about it, like things they promised but didn't deliver.

>>54801804
>volcano
>Vulkan
>>
how hard would it be to draw a square with vulkan?
>>
>>54801836
It's not difficult at all, just less immediately gratifying.
>>
>>54801787
God, thank you for this, I wish we could force every Californian "programmer" to watch it.
>>
>>54801818
vulkan is still irrelevant for most developers, people had way too high expectations for it
>>
People like to shit on MySQL, but it's got probably an order of magnitude more docs, guides, libraries and tools than anything else. What do Postgre etc actually do better?
>>
>>54798216
The static casts are to avoid unused variable warnings I think, if that helps.
>>
>>54801888
>vulkan is still irrelevant for most developers
It was never claimed to be relevant for most people, except indirectly by being used for engines like Unity or UE4.

>people had way too high expectations for it
Such as?
>>
>>54801787
MongoDB is nearly unusable if you need to count large datasets.

Doing a count on an index, mongo literally traverses the entire btree to provide you a count. Have millions of records? Enjoy waiting.
>>
>>54801888
vulkan is just as good as dx12. Whats not to like.
>>
File: 1460947667967.png (533 KB, 459x612) Image search: [Google]
1460947667967.png
533 KB, 459x612
>>54801560
>>
>>54801894
What are static casts in contrast to normal C casts?
>>
>>54802099
C cast can be direct cast (no ASM instructions) or conversion. static_cast are only direct cast.
>>
>>54801918
If you read their marketing material. Pretty much a list of what wasn't delivered on. You were promised stuff as getting control over the memory on the GPU.
>>
>>54802099
static_cast has a compile-time validation
>>
>>54802147
Which you absolutely have.
>>
>>54802158
Well, if you believe hard enough maybe. Most of us are bounded by reality.

But why are you doing programming when you can go to neverland?
>>
>>54802193
How do you not have control over memory?
>>
>>54802208
Compare this explanation of vulkan memory resources to the reality of what memory control would mean in C/C++ for instance.
https://developer.nvidia.com/vulkan-memory-management
>>
File: 1434072083646.jpg (13 KB, 320x160) Image search: [Google]
1434072083646.jpg
13 KB, 320x160
>>54802236
>basing your "knowledge" of the API off of simplified prose pieces
>>
>>54801244

I don't think it's a good sign I barely understand what you are saying but yeah, I guess that game engines are getting more and more complicate. Probably that means you skip most of the basic work creating a game but then you face the obstacles created by such game engine, which would be like the difference between creating a car from scratch in your garage or buying compatible pieces and creating one of the cars you can make with those premade pieces.

Anyway, this is a promotional video of the vocational training we have in Spain. You don't need to know spanish to enjoy it. Pay attention to 0:17
>>
File: guix_sd.png (7 KB, 159x141) Image search: [Google]
guix_sd.png
7 KB, 159x141
Trying to cross-compile NixOS for a Raspberry Pi 2, found a bug in nixpkgs. I actually am.

Daily remainder that both NixOS and pic related depend on non-strict evaluation and the lazy fixpoint pattern. So read your SICP.
>>
>>54802269
Why would you assume I learned about vulkan from that?
I gave you convenience you ungrateful bitch.
What kind of sense would it make to assume I posted what I learned from in an argument? We're not talking about simple things here. If you knew vulkan you'd not really ask that question. So of course I'm not going to point you to the specification. The reason you're asking is because you don't care enough.
>>
File: 1453682848207.jpg (24 KB, 248x243) Image search: [Google]
1453682848207.jpg
24 KB, 248x243
>>54802352
Your desperate bluffing is hilarious.
>>
>>54799330
swiggityroll
>>
>>54802316
you can make almost any program as long as you have the time and competence for it. especially now with mobile games where you have limited resources you can make simple 2d games and simple 3d games using old school-ish techniques that are still perfectly valid and build upon that. 3d games are mostly the same stuff with collision detection and heightmaps etc (not even much dynamic physics), just with higher polygon counts and fancier shaders
>>
>>54801543
What language is this?
>>
>>54802316
>i don't think it's a good sign
No its perfectly normal. You can't expect to know everything. You're obviously asking to learn.
I think you sort of have the right idea. But in short:
Using an engine is like buying a car. You can drive it and everything. But when it's your job to drive this car it'd be far too expensive to hire people to repair it all the time (hiring consultants who know the engine). So instead of buying your car you buy smaller pieces that allow you to see how they're connected well enough to learn how to fix issues.

That's the difference between using a library/framework for your game rather than an engine. An engine has all the bells and whistles complete for you. But getting help when things go wrong is either very hard or very expensive. I recommend starting with angel2D. Its very convenient and friendly in many ways while not being this big mess you can never understand. Just read the page on Angel2d.com.
It's a very good introduction to making games imo. I wish I'd have started there honestly.
>>
>>54802435
>vulkan will make it so that mac and linux have a viable gaming solution
>people still dont care
I knew you all were winfags.
>>
>>54798180
NoSQL is crap
>>
>>54802493
Apple didn't endorse Vulkan because they want to continue making people use Metal.
>>
>>54802493
>he fell for the vulkan meme
>>
>>54799330
rollan
>>
>>54802386
OK? So explain to me how you read that and can conclude you have memory control? Did you call 'valloc()' and get a pointer to memory (or similar interface) where you can do whatever? No there's still the old bindings you have to deal with. That's the really really small tl;dr i can give you.

The difference between this and opengl is very minor.
>>
>>54802535
this
>>
>>54802493
>viable gaming solution
>because of a graphics API
Anon you really don't know what's holding Mac and Linux back do you?
>>
>>54802507
I mean, there's this https://moltengl.com/moltenvk/ but it's not the same thing.

>>54802535
>Did you call 'valloc()' and get a pointer to memory (or similar interface) where you can do whatever?
Obviously you don't get a pointer that you can just use, how the fuck would that work? Most of the memory you allocate isn't even physically accessible from the client (CPU). You allocate a buffer, then when creating "API objects" which require a memory backing, you provide them with that buffer and an offset. So it's essentially the same thing, only you need to do it through the API.
>>
File: oracle-berkeley-db-11g-r2-6-728.jpg (100 KB, 728x546) Image search: [Google]
oracle-berkeley-db-11g-r2-6-728.jpg
100 KB, 728x546
>>54802504
Better go tell all these guys
>>
>>54802565
apparently you dont.
>>
>>54800334
>>54799126

You're both retards.

>fantastic function
>solved correctly

Your return codes are dumb and useless.

Your allocated space isn't initialized: no null terminator and if n <= 0, nothing is written to the buffer, leaving it as is.
>>
>>54802569
>how would that work?!?!
OK. So you're simply a retard. Can't even read a simple post.
Anon the problem is that there's no way of interfacing with the GPU that allows for proper memory control. If there was there would be the possibility of allocating a block of memory. Get an interface (again, as I said an interface, not a 'pointer' you retarded fuck) which allows you to do whatever there and then (since we're not in an ideal world where the hardware vendors aren't super secretive) pass it on to whatever renders our buffer for us.

I doubt you even know opengl if you can honestly delude yourself that what's been given here is anywhere close to the memory control you'd like. It's hardly even different.
>it's not physically accessible from the CPU
YES OF COURSE. But what the fuck do you think people mean we they say they want memory control? Do you think they mean that they're currently having no way to influence the GPU to do something with memory and are begging for a way to actually use the damned thing? No obviously not. They're asking for control. An interface that allows them to deal with memory on the GPU as they see fit. And a properly supported (by hardware vendors) graphics API could give them that. That's not what has been given though.

Can you not spend like 5 minutes learning before you make a fool of yourself on an anonymous image board? You clearly know jack shit about this. Everything you're describing means you're perfectly fine with opengl. There's nothing new in vulkan that'd help your very limited aspirations for memory control.
>>
>>54802587
Bait.
You don't even argue. So clearly you've shown you don't.
>>
>>54802707
Why don't you read the actual spec for once and see that you're wrong?
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#memory-device

>If there was there would be the possibility of allocating a block of memory.
vkAllocateMemory gives you RAW DEVICE MEMORY, referenced using a VkDeviceMemory handle. When you use it to provide backing for an object that needs it, you provide this handle and an offset, i.e. the same information as a pointer.

>which allows you to do whatever there and then (since we're not in an ideal world where the hardware vendors aren't super secretive) pass it on to whatever renders our buffer for us.
Vulkan buffers aren't vertex buffers. They're just memory.

It's mind-boggling that you know so little and are still acting as if you're the one with all of the facts. Your emotional responses also rule out you being a troll, too, which is even sadder.
>>
Why do people create new languages instead of just creating a lisp library implementing OOP or whatever?
>>
>>54802814
You could make the same argument with any Turing-complete language.
>>
>>54802833
Not really. You can express any program in any Turing complete language but you can't really implement logic programming in Java without it being obvious it isn't a language feature.
>>
>>54798180

> switch to ubuntu
> love it at first, it makes "pure" programming (IE 100% software) way easier
> later I realize neither my NXP ARM microcontroller devkit nor my Atmel Xplained devkit are supported on ubuntu

honestly I blame the embedded computer industry, must be full of old dudes on windows 95. Should have seen this coming to bh, having known the way embedded programmers are

Has anyone gotten the program "lpc21isp" to work? it's the one Adafruit recommends with their lpc810 kit, but I can't get any UART out of the cable when it tries to flash it
>>
>>54802873
I'll give you a more practical answer, then: because Lisp is not designed to be run on our computers.
>>
>>54802902
Neither is Java or C.

That's why you compile it.
>>
>>54802939
You know what I mean.

Those languages (particularly C) are made with compiling and running on a Von Neumann machine in mind. Lisp was not. Running a compiled Lisp program involves a lot of memory allocations and garbage collection, not to mention still having functions like eval.
>>
>>54802475
Glorious OCaml. The language of future.
>>
>>54802939
lisp is shit
>>
>>54802789
>they're not vertex buffers
OK it's pretty clear I overestimated how deep we are into the conversation.
There's an entire industry that's dissatisfied with how it doesn't work like I've described. And you're sitting here saying 'it's good enough you guys!' without having a clue.
I suggest you read that stuff you posted. Because I can't be bothered to explain to someone who doesn't even care enough to read what he's asking of others to read.
>>
>>54803059
https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
This is hilarious, please keep going.
>>
>>54802981
Lisp gets decent performance though. Much better than anything like Python or Perl.
>>
>>54802899
it's linux that is shit, especially ubuntu is fucking shit, it's just a wannabe windows, just because a company makes some crap like ubuntu doesn't mean you have to use it for fuck's sake, stupid memer
>>
how do i transform this python code in C++ code?

python version:
my_list = [] 

for i in points_list:
if i not in data_points:
my_list.append(i)



C++ version that i tried:

vector<Point> my_list;
for (size_t i = 0; i < points_list.size(); ++i) {
for (size_t j = 0; j < data_points.size(); ++j) {

if ((points_list[i].x != data_points[j].x) &&
(points_list[i].y != data_points[j].y)) {
my_list.push_back(points_list[i]);
}
}
}



but this not working for some reason,

basically i want the vector my_list to have all the points that do not belong to data_points.

any help is appreciated
>>
>>54803003
Nice argument faggot

>>54802997
Why is OCaml the language of the future instead of Haskell?
>>
>>54803062
>doesn't understand what he's on about so he just prepared a generic answer
Well done. Top tier discussion were having right here.
>>
>>54803074
Nice b8, or maybe you're retarded. Not like I care which it is though.
>>
>>54803091
This wasn't a discussion. This was a completely one-sided thing where all you did was say I was too stupid to know what I was missing. That's not an argument, whereas I was backing up what I was saying using the spec. You never even made your point clear, you just said that it was disappointing and that I should be able to read your mind to find out why. I explained why it was different from the way OpenGL did it and you just said "nuh uh".
>>
>>54803117
have fun with your fucking ubuntu lmfao
>>
>>54802899
You've tried a VM, right?
>>
>>54803147

...No
>>
>>54803077
Since you're already using std::vector (and have iterators because of it) why not use std::find?
>>
File: performance.png (31 KB, 819x424) Image search: [Google]
performance.png
31 KB, 819x424
>>54803074
Does Windows have a usable file system yet?
>>
>>54803121
I explained plenty. You pointed to a part of the spec which doesn't even align with what you're claiming. Also you don't seem to understand what a discussion is. But we can probably never go through everything you don't know so it's probably best we just accept the loss and consider you a waste waste of time.
>>
>>54803223
>You pointed to a part of the spec which doesn't even align with what you're claiming.
You're fucking retarded. Good day.
>>
>>54803077
test is inside loop. Took me a while. I'd do it like
for i in points_list:
result = False
for j in data_points:
result ||= i == j
if result:
my_list.append(i)

but in C++
>>
>>54803074
>microcontroller vendors didn't provide SDKs for Linux
>it's somehow Linux' fault

nice logic
>>
>>54803228
>i didn't read the spec so now I'm upset my imagination doesn't align with reality
Yeah it's upsetting. Good day.
>>
>>54803175
Any similar benchmarks that include HFS+ (natively on OSX, not FUSE?)
>>
>>54803230
this doesn't work
>>
>>54803256
>i'm an entitled smug fag
kys
>>
>>54803172
how would i use that?

i tried:

vector<Point>::iterator it;

but it trows a bunch of errors
>>
http://pastebin.com/HfdXTqAq

>Error C3861 'sseSqrt': identifier not found line 18

trying to compile this and I get this error

what do
>>
>>54803077
Probably because you're using && instead of || when checking if the point is different.

Also, you should implement == and != for Point, not write them ad-hoc.
>>
>>54803368
you mean this?

vector<Point> my_list;
for (size_t i = 0; i < points_list.size(); ++i) {
for (size_t j = 0; j < data_points.size(); ++j) {

if (points_list[i] != data_points[j]) {
my_list.push_back(points_list[i]);
}
}
}




it throws errors telling that
  no match for ‘operator!=’ in ‘points_list.std::vector<_Tp, _Alloc> ... 
>>
>>54803423
>you should implement == and != for Point
>>
>>54803437
i don't get what you're trying to say.

sorry anon
>>
File: cat.gif (16 KB, 180x236) Image search: [Google]
cat.gif
16 KB, 180x236
Has anyone ever unironically used Haskell for webdev?
>>
>>54803464
First of all, try your original code but change && to ||.

I'm saying that you should overload the == and != operators for the Point type so that you don't have to manually check x and y equality/inequality everywhere.
http://en.cppreference.com/w/cpp/language/operators
>>
File: parallelconcurrenthaskell.jpg (795 KB, 2100x2756) Image search: [Google]
parallelconcurrenthaskell.jpg
795 KB, 2100x2756
>implying Haskell is any better for threading than Java
>>
>>54803464
Operator overloading. Write the != operator for your points.
>>
>>54803490
>implying it isn't
>>
>>54798203
vote trump so their h1b doesn't get renewed
>>
>>54803504
>it's actually a potential solution
Well done. Better for everyone anyhow.
>>
>>54803280
how so? Is the algorithm wrong? Would you be so kind and point to the mistake you cunt? And are you >>54803077 or not?

Doing your part, I found that I was wrong on two things. Here's a working prototype of the beast:
>>> def stuff(points_list, data_points):
... mylist = []
... for i in points_list:
... result = False
... for j in data_points:
... result = result or i == j
... if not result:
... mylist.append(i)
... return mylist
...
>>> stuff([1,2,3,4],[1,3,5,7])
[2, 4]
>>>

As you can see, it correctly excludes 1 and 3 because they are in data_points.
>>
>>54803480
matey he has one append per iteration of the second loop, what you say is correct but it's not enough. Anon, you also should in the first place check whether the point is in data_points, and then, if it isn't, push it to my_list. Here, you push it once per data_point which doesn't match, see?
>>
>>54803518
feel free to rename result to found, I was uninspired
>>
File: fookin prawns.jpg (231 KB, 627x502) Image search: [Google]
fookin prawns.jpg
231 KB, 627x502
>>54798180

I'm a Hadoop admin. I don't know anything about CouchDB yet but I know I can install it in Hadoop.
>>
>>54803518
Dude, you are just implementing set symmetric difference.
def stuff(points_list, data_points):
return list(set(points_list) ^ set(data_points))
>>
>>54803582
>>54803518
NO NO NO
the points are defined as a tuple like this (1,2) (23,43) etc

so your code doesn't work
>>
>>54803478
https://github.com/ahushh/Monaba
>>
>>54803567
Eh, you're right. Didn't even think of that.
>>
>>54803567
>>54803673
Well, that's not the greatest solution.

Instead of checking whether it's already in the vector, do:
same = false
for b : bs
if a == b
same = true
if not same
add a
>>
>all this garbage about points
Just step through your code anon. Get an understanding of what's happening and all shall be revealed.
>>
File: sicp 4.jpg (118 KB, 365x600) Image search: [Google]
sicp 4.jpg
118 KB, 365x600
>>54803728
>tfw lisp masterrace
>tfw at most only ever 1 function needs debugging
>tfw an 8 line function is a long one for me
>>
>>54803775
kys
>>
File: KYS KYS KYS.gif (48 KB, 2034x1491) Image search: [Google]
KYS KYS KYS.gif
48 KB, 2034x1491
>>54803822
>not using lisp
KYS
>>
>>54803822
You're the most insufferable poster in this general. You're always fucking here, too. Do you ever sleep?
>>
>>54803838
lisp is shit
>>
>>54803849
KYS KYS KYS KYS KYS
https://www.youtube.com/watch?v=5pNfHAbARAY
>>
>>54803775
In Haskell, a 4-line function is long
>>
>>54803842
I don't sleep, I just dream.
>>
>>54803921
but do you dream in code
>>
>>54803090
>Why is OCaml the language of the future instead of Haskell?
Because with OCaml you can ensure complexity in space and time. With Haskell, everything change depending the way the function result is consumed.
>>
>>54803090
>Why is OCaml the language of the future instead of Haskell?
malformed question. neither language is the language of the future.
>>
>>54803628
FUCKING ADAPT IT YOU SUPERMORON!!! This is a damn demo you dumbfuck, I thought you asked for help, not spoonfeeding, but it seems that I was wrong. Screw you, you dick
>>
>>54803947
i do.

here's my website:

http://www.hicaduda.com/
http://slgonzalez.com/
>>
>>54803962
You CAN do that in Haskell, too. It's just not the default.
>>
File: 1412090205682.jpg (126 KB, 573x415) Image search: [Google]
1412090205682.jpg
126 KB, 573x415
Ask somebody who just implemented file transfer over IRC (not DCC) anything.

It's about 2kb/s (IRC server is 100ms away).
>>
>>54803995
Go to bed Pajeet
>>
>>54803628
>>54804010
Plus it happens to actually work, in the sense that we're in Python, so the function correctly processes lists of tuples. Get back to vidya. Or sport. Or whatever it is you were doing before failing this hard at understanding basic programming.
>>
>>54804061
>garbage collection
>no dependent types
He's right.
>>
>>54804064
not him but, it doesnt work you faggot
def stuff(points_list, data_points):
mylist = []
for i in points_list:
result = False
for j in data_points:
result = result or i == j
if not result:
mylist.append(i)
return mylist


a = [(7,21), (12,19), (11,16), (14,17),(12,22),(14,23),(16,21),(17,24),(12,26),(10,23)]
b = [(11, 16), (14, 17), (16, 21), (17, 24), (12, 26), (7, 21)]


print stuff(a,b)


output:
[(7, 21), (7, 21), (7, 21), (7, 21), (7, 21), (12, 19), (12, 19), (12, 19), (12, 19), (12, 19), (12, 19), (14, 17), (12, 22), (12, 22), (12, 22), (12, 22), (12, 22), (12, 22), (14, 23), (14, 23), (14, 23), (14, 23), (14, 23), (14, 23), (16, 21), (16, 21), (17, 24), (17, 24), (17, 24), (12, 26), (12, 26), (12, 26), (12, 26), (10, 23), (10, 23), (10, 23), (10, 23), (10, 23), (10, 23)]
>>
File: feminist diversity.jpg (49 KB, 600x450) Image search: [Google]
feminist diversity.jpg
49 KB, 600x450
why isn't the tech field diverse?
>>
>>54804173
women and minorities are stupid
>>
Fuzzy logic is warm and fuzzy

So comfy
>>
>>54804118
YOU messed up you megafag, I know python is whitespace-based which is dumb, but still, LOOK

ME
# snip
for j in data_points:
result = result or i == j
if not result:
mylist.append(i)
# snip


YOU
# snip
for j in data_points:
result = result or i == j
if not result:
mylist.append(i)
# snip


This stupidity of putting the if inside the loop is yours bro, it's engraved within your brain or something. Do a laser removal inside your head for the love of dog!
>>
>>54804028
Why use Haskell to do OCaml. It's far more simple to use OCaml.
>>
>>54804222
>whitespaces are dumb
I've literally never had problems due to this

Don't you normally indent your C code anyway?
>>
>>54804173
>white women with macbooks
2/10, would still bang out of desperation
>>
>>54804227
Because that's by far not the only difference between the two? None of Haskell's other features rely on laziness by default, that's just an orthogonal fact.
>>
>>54804241
No Shit Sherlock! Yes I indent - or rather my Emacs does-, but this indent is based off semantics, not the opposite. And as we've seen with this gigamoron, it makes this kind of type-what-you-see errors not as obvious as with a sane language.

>>54803090
Because it doesn't use whitespace as syntax
>>
>>54804286
I always indent exactly the same way as I would indent my C. I have no idea what the difference is in practice.
>>
I want to use SIMD in my program, is there any SSE intrinsics that let me split a __m128i into 16 8-bit integers?
It would make my program 10 times faster, easily.
>>
>>54804356
http://stackoverflow.com/a/12810604

?
>>
>>54804049

Why didn't you just use DCC?
>>
>>54804328
> not reading the post, the post

To be fair, it comes down to habits and preferences in the end. You always manually indent and you're fine with it in both languages, some aren't productive if their editor doesn't parse their python to offer them all the indent options for this line, some prefer to just type the C braces on a line of their own to close every scope, etc.

Have you tried typing Python code with semi-automatic indenting? Really a question, let's talk text editors. What do you use an in what syntax do you write?

Me: Spacemacs forever, mostly C++ these days, or Racket, or Clojure. I type my stuff in full, and then I do a gg=G to see if the indentation looks like what I expected. And it suits me well
>>
>>54802137
>direct cast
>no ASM instruction
So what does this cast qualify as?:
long l = 64;
int i = (int)l;

On little endian machines, assuming l is stored on the stack, it's just a read. So is this a direct cast only on little endian machines?
>>
>>54804418
It needs open ports, which I cannot always guarantee.

Speed is ~40KB/s now and everything is pretty stable on a wired connection.
>>
>>54804423
I use Vim, sometimes IntelliJ with a Vim plugin. Both autoindent just fine.
>>
File: 1338102658988.jpg (15 KB, 460x276) Image search: [Google]
1338102658988.jpg
15 KB, 460x276
Me:
>I think the bottleneck might be paxos.

Boss:
>We can dedicate more servers to running more paxos peers.

Mfw
Thread replies: 255
Thread images: 27

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.