[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: 24
File: i-love-xml-280x300.png (37 KB, 280x300) Image search: [Google]
i-love-xml-280x300.png
37 KB, 280x300
<dpt>
<edition>XML</edition>
<old>54660278</old>
</dpt>
>>
>>54665664
>xml
>any year
>>
JSON fags on suicide watch
>>
>>54665657
>application of concepts
>pointer
>a way to reference an piece of memory
It's incredibly simple. The most difficult thing about pointers would be function pointers imo because the C-syntax for function pointer types is a little bit weird imo. It makes sense, but it's just different from everything else.

Applying pointers is just about pointing at shit and dereferencing them.
>>54665655
>Memes
I'm genuinely perplexed by the idea that you'd name a book like that. If your goal is to teach how to handle data in a program that's a broader topic than pointers.
>>54665670
Yeah. If you're just dealing with your own codebase. I also turn it off unless I'm using something new. If you're learning a new library (the way I learn to use libraries anyway) it's useful because it's like a mini-documentation/typing assistance.
>>
What do you guys use for your projects?
Should I use visual studio community or visual studio code?
>>
>>54665664
>XML
>not S-expressions
I hope Terry Davis kills you with his car.
>>
File: 1111.jpg (88 KB, 900x533) Image search: [Google]
1111.jpg
88 KB, 900x533
>>54665589
>Restrictions?
not sure what you mean, the plan was to make a server and a client project and I haven't really thought that much about features. Was thinking of having a simple contact list or a way to tell when a person is online, maybe support some images, emojis or whatever the fuck like in MSN.
I tried doing it in C# because that's what I've been using as of late due to classes(well that and Java, but fuck Java). Haven't used C++ in 2-3 years but I want to try learn QT in this short time if possible.
Problem with C# is, I couldn't get it to connect to the server at all and I'm having difficulties understating these EventHandlers.
The other 2 projects shouldn't be THAT difficult, but it is a pain in the ass considering one is to make a functioning Android app and the other is to make a simple working Unity game.

I really should make atleast something half-functioning in the next week so I can show it to my mentor and discuss further progress. Not to mention I need to write a paper on it and I haven't even started.
fuck
>>
>>54665664
>XML
8/10 ruse, I'm mad
>>
>>54665739
Code only supports web-based projects I think. I don't even think it has compiling capability.
>>
>>54665739
I use pycharm
>>
>>54665777
VS Code supports anything when you install the proper plugin.
>>
>>54665664
</dpt>

/thread


>>>/prog/
>>
>>54665790
Isn't that python only?
Never used it, only VB, that's why I'm trying to expand.
>>
>>54665842
yeah, but there are other jetbrains ides
>>
>>54665823
>prog
I wish.
>>
>>54665750
>I couldn't get it to connect to the server at all and I'm having difficulties understating these EventHandlers.
Post what you're doing.
>>
>>54665858
Are there only free trials available and no free versions?
They seem like they work crossplatfrom, are there better options out there for database building and general C/C# writing?
>>
>>54665928
It's free if you're a student, and it's also free for open source dev
>>
off the top of my head, I've barely practiced this. Is this correct?

  1 #include <stdio.h>
2 #include "struct_items_consumable.h"
3
4 void display_all(struct items_consumable *p);
5
6 void dispay_all(struct items_consumable *p) {
7 int *pend = p + (sizeof(p) / (sizeof(items_consumable));
8 for(; p < pend; p++) {
9 // do stuff for each struct member
10 }
11 }
>>
>>54665981
>
int *pend = p + (sizeof(p) / (sizeof(items_consumable));

No, that part is horribly wrong. sizeof(items_consumable) will return the size of a pointer, it looks like you're confusing that with sizeof an array.
>>
>>54665981
You should pass the size of the array to the function.
>>
So, I programmed pretty much one of my first actually useful programs (in C). While programming it, I always started it right from terminal and everything worked. Next I wanted it to start from the file manager, but turns out, it doesn't. It segfaults. The reason is (or so I figure) that my program needs several files that it can't find when I'm starting it from the file manager.

Is there any way to somehow explain to the program where to find those files, or even better somehow include the files (bitmaps) directly into the binary?
>>
File: 1418658712361.gif (458 KB, 360x240) Image search: [Google]
1418658712361.gif
458 KB, 360x240
How do you guys are so passionate about programming?

I know basics about programming and some languages at beginner level and I want to learn more languages, but I fail everytime to improve myself. When I learn basics about some programming language, I immediately lost my interest to it. Also, I have no idea about what I'm going to do after I learned basics.

What should I do after learning basics?
>>
> implying xml is a real thing


AHHAHAHAHAHAHAHAH
>>
>>54665885
it's gone, I remember using Tcplisteners and Tcpthreads for connecting
>>
>>54666061
Get the Algorithm Design Manual

If you don't enjoy algorithms, CS/programming might just not be for you
>>
File: YotsubaRealGood.png (40 KB, 128x331) Image search: [Google]
YotsubaRealGood.png
40 KB, 128x331
>>54666061
The secret is to have FUN.
Do things because you want to, not because you feel you have to, or you'll have no motivation and you'll be miserable.
>>
>>54665976
How do I prove I'm a student though?
When I try to download datagrip, it says that it's a 30 day trial.
Also, what's the main difference between datagrip and other IDEs?
>>
>>54665997
>>54666029
Alright, thanks.

Guess I'll try out things until I get the correct values.
>>
>>54666061
Start a project you find enjoyable. Protip: make something useful.
Don't listen to >>54666088, programming isn't all about algorithm design.
>>
>>54666095
Not him, but I just used my university email. Go to their site, they'll explain what you need to do.
>>
>>54666214
Im from the EU though
>>
>>54666353
And I'm in South Africa.
>>
Personally I prefer the HTML programming language over XML
>>
>>54666426
>USER HAS BEEN WARNED FOR THIS POST
>>
>>54666426
You're one of those special snowflakes in the YouTube ads about learning programming and can be clearly seen writing in HTML.
>>
>>54666061
this: >>54666191

don't learn programming "just because", learn it because you want to make some freaking cool shit
>>
how do i program a robot to feed old people SERIOUS REPLIES ONLY
>>
>>54666483
Admittedly, what puts a lot of people off is coming up with ideas. But really, whatever you want to do just do it. Hell, maybe you won't have the ability just yet to complete it but you'll learn along the way and be better for it.
>>
>>54666527
rewrite the linux kernel in haskell first then code a kernel module in clojure for the robot
>>
>>54666527
>helping old people
>>
>>54666528
I lack the idea to make something.
I dont want to make a simple game but I also dont have an idea to make some programs...
>>
Does anyone here attempt the Project Euler problems?
>>
>>54666629
>Project Euler
pretty useless if you want to be a programmer tbqh it's too math focused
>>
>>54666658
I was looking through it and it seems it'd be useful for learning and utilising data structures and such
>>
What's a nice name for a struct holding information of a file or directory?
>>
I get errors when I try recompile apk that I unzipped and browsed through. I imported everything into the thing that you make shit in.
>>
>>54666757
_info_t
>>
>>54666783
That's not how you use a toilet, Pajeet.
>>
If you have,

int a,b,c,d;
long double result;


Do you have to...

result = ((long double)a/(long double)b)*((long double)c/(long double)d);


Or is,

result = (long double)(a/b)*(c/d);


sufficient?
>>
>>54666629
>>54666711
i don't do them but they can be good exercises if you're mathematically inclined, you have to come up with clever algorithms and use data structures efficiently
>>
>>54666865
result = ( (long double) a / b ) * ( (long double) c / d );
>>
>>54666889
result = (long double) a / b * c/ d;
>>
>>54666903
not equivalent
>>
>>54666911
equivalent
>>
>>54666919
not even if they were integers would they be equivalent, you have to watch for overflow and for floats there are accuracy concerns
>>
>>54666945
>floats
they're long doubles; opinion discarded
>>
>>54666956
they're floating-point numbers, sperg
>>
>>54666970
not floats tho; git gud
>>
>>54666980
you think >>54666903 is equivalent to >>54666889, you're the one who should git gud
>>
>>54666993
> he thinks >>54666889 is equivalent to >>54666865
>result = (long double)(a/b)*(c/d);
anon...
>>
File: 1363324278434.jpg (138 KB, 500x1125) Image search: [Google]
1363324278434.jpg
138 KB, 500x1125
Disgusting hack of the day:
An easy way to send a char to a function expecting a char* thanks to little-endian abuse!

void foo(char* str);

for (short c=0x00; c<=0xFF; ++c)
foo((char*)&c);
>>
>>54666857
At least I can reach to wipe my ass, you fat fuck american.
>>
>>54667013
>result = ((long double)a/(long double)b)*((long double)c/(long double)d);
fuck off with this shitty bait
>>
>>54667013
>(long double)(a/b)*(c/d)
Not him, but that isn't equivalent to his solution:
(long double) a / b * c / d

In the first, c / d does not result in a long double
In the second, because of left-to-right associativity, the entire thing is long double
>>
>>54667046
>result = (long double)(a/b)*(c/d);
t. mental illness
>>
Things /g/ can't do:
- average 2 ints
- initialise a two-dimensional array
- divide 4 ints with the result being a floating point number
>>
>>54667066
you're fucking retarded
>>
>>54667072
here we go again
>>
>>54666889
I'm actually trying to compute (a/b)^(c/d) to high precision.
I heard that using ++ or -- on a floating-point data type is bad style, so I keep them as ints and typecast them before passing them as arguments.

int a,b,c,d;
long double result;

// compute (a/b)^(c/d)
result = powl(a/b,c/d); // result of (a/b) implicitly cast to (long double) before being passed?
result = powl((long double)a/b,(long double)c/d); // b implicitly cast to (long double) before dividing a?
result = powl((long double)a/(long double)b,(long double)c/(long double)d); // possibly redundant, looks ugly, but makes super duper sure it works
>>
Why is compiling on Windows so horrible? I ported my program to both Mac OS X and Linux and it worked just fine in a few minutes. On Windows on the other hand I have no fucking clue how to do anything, nothing fucking works, everything seems so horribly convoluted.
>>
(long double) a / b * c / d

This is sufficient. a / b is a long double. The result * c is a long double. The result / d is a long double. Nothing lost unless an overflow occurs
>>
>>54667121
>developing on Windows
Biggest modern meme so far. Even OS X is better for this, and that says a lot
>>
>>54667110
the first one is wrong, they get divided as ints with truncation
>>
File: xml.png (26 KB, 496x320) Image search: [Google]
xml.png
26 KB, 496x320
/dpt/-chan, daisuki~

Ask your much beloved programming literate anything (IAMA)

>>54665695
>>54665664
pic

>>54666629
The easiest machine applications are the technical/scientific computations.

>>54666865
inline double foo (double a, double b, double c, double d)
{
return (a / b) * (c / d);
}


>>54667072
What programming language ?
>>
>>54665664
Literally only use for RSS feeds and Google shopping.
>>
>>54667124
float a = 1e30f;
float b = 1e34f;
float c = 1e30f;
float d = 1e30f;
System.out.println(a / b * c / d); // 1.0E-4
System.out.println((a / b) * (c / d)); // 1.00000005E-4


same principle applies to long double, not just float

kill yourself
>>
>>54665739
Community
Code is basically for Linux/OS X or for general editing and external building (like rust or go)
>>
>>54667214
another example

float a = 1e34f;
float b = 1e30f;
float c = 1e34f;
float d = 1e30f;
System.out.println(a / b * c / d); // 9.9999992E7
System.out.println((a / b) * (c / d)); // 1.0E8


they're not equivalent
>>
>>54666757
Inode
>>
>>54667214
>>54667231
>java
>being used as a metric for anything
cool meme
>>
>>54667244
same thing happens in other languages you buffoon
>>
>>54667136
No it doesn't say a lot
OS X is UNIX certified
>>
>>54666089
>>Help programming isn't fun and doesn't hold my interest, wat do?
>The secret is to have FUN.
That's some "just be yourself" tier shitposting.
>>
I have a RDF/XML file (that is, RDF in XML notation).
This looks like:
<?xml version="1.0" encoding="UTF-8" ?>

<rdf:RDF
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">

<someThing>
<someData rdf:datatype="http://www.w3.org/2001/XMLSchema#long">data</someData>
</someThing>
...

</rdf:RDF>


I know created a separate XML Schema file where I created a few xsd:simpleTypes (mainly integers with restrictions). How can I "include"/import this local file correctly in my main file so I can use these new XSD datatypes in my data?
I'm absolutely unable to find any useful hints...
>>
>>54665823
We gotta restore it. We gotta do it. /prog/ was a great board. Tremendous people. You can't have a board without borders. /v/. They are sending their people. And believe me, they are not sending their best. Believe me. We're gonna make /prog/ great again. It's gonna be so great.
>>
>>54667256
nice meme
>>
>>54667289
weak bait
>>
>>54666061
>>54667260
The joy of programming come with Lisp.

http://www.braveclojure.com/

Join the master race, become a lisper.
>>
>>54666629
Yeah. Got to 51 a few months ago during the beginning of the semester. Haven't gotten any time now to work on it. It's fun if you like solving math problems.
>>
What does /dpt/ know about VLAs?
>>
>>54667310
>implying clojure is a real lisp

heh
>>
>>54667339
they're a meme
>>
>>54665664
doing an svg project for school does that count?
>>
File: kot ghoul.png (2 MB, 1217x879) Image search: [Google]
kot ghoul.png
2 MB, 1217x879
>>54666061
https://www.coursera.org/learn/learning-how-to-learn
I offer this course everywhere. It is #1 thing you should study if you want to learn anything (or do anything) and procrastination obstruct you of doing it.
Really. For 8 years I wanted to learn so much thing, but couldn't finished even one. I abandoned after week or month. And for last 6 month I practiced techniques from this course and now I am able to do things I want to do up to like 30 hours / week. Yes, you won't be able to do it right off the bat, you need to practice. Start with small steps.
Many universities make notes about that theme for their students, cause it is hard to success without knowing that things.
http://bsc.harvard.edu/procrastination
But try at least the first link I gave you. It is free.
>>
Is it OK to be accessing properties of objects that belong to other objects etc.. in this way or is there a better and more widely accepted way of doing it? Should I just never need to access properties more than one object away?

gif_image = self.picpanel.save_pic
full_path = self.picpanel.video_object.path
filename = self.picpanel.video_object.filename
>>
File: JUST.jpg (27 KB, 600x424) Image search: [Google]
JUST.jpg
27 KB, 600x424
>working at a bank
>data exchange between front and back end is done via XML and will be doing so for at least another 10 years
>>
>>54667110
>I heard that using ++ or -- on a floating-point data type is bad style,
Whoever told you that is a retard. If you need to increment a floating point number do it. You just need to now the limits of the IEEE754 standard. In the case of incrementing integer numbers coded as doubles incrementing that number above 2^53 won't work.
>>
>>54667395
is that python? anything goes in filthy python, i'm surprised you're even using OOP in python in the first place
>>
>>54667424
>2^53
long double is often more precise than double, so it might go higher than that while maintaining full integer accuracy
>>
>>54666061
yeah unless you enjoy it or have a goal in mind like a program you want to make, then you'll lose interest quickly and forcing yourself won't do much good. and since it seems you don't find programming particularly fun, think about what you want to do with it once you gitgud
>>
>>54667260
Nah bitch. You've only seen fun from the outside. usually watching your family make bets on when you are getting out of the closet.
>>
>>54667395
Off course it's ok
>>
>>54667476
Oh no. I enjoy programming, not the same person. I'm just making a comment about how retarded and redundant that advice is.
>>
>>54667072
>average 2 ints
int a, b;
((double) a + (double) b)/2;
>>
How do I compile a clojure program?
>>
>>54667513
incorrect
>>
>>54667440
>often
nope
>>
>>54667549
https://en.wikipedia.org/wiki/Long_double
>In C and related programming languages, long double refers to a floating point data type that is often more precise than double precision.
>On the x86 architecture, most C compilers implement long double as the 80-bit extended precision type supported by x86 hardware (sometimes stored as 12 or 16 bytes to maintain data structure alignment), as specified in the C99 / C11 standards (IEC 60559 floating-point arithmetic (Annex F)).

you're fucking lame as shit dude, just blurting out blatantly false statements
>>
>>54667588
inb4 "everyone can edit wikipedia"
>>
>>54667588
nice edit
>>
>>54667594
it should be common knowledge anyway

>>54667599
babby grade bait
>>
>>54665664
>>54660278
>>
>>54667425

pls no bully

I'm not hardcore enough to write my own algorithms but at least I can use le meme snek language to glue together bits and pieces that more competent programmers have written.

from tkinter import *
import subprocess as sp
from PIL import Image, ImageTk
from io import BytesIO
import threading
import json
import os
import time
from collections import deque
from tkinter import simpledialog
>>
>>54667549
Depends on the architecture. On x86_64 on Windows, Linux, and Mac long double is 80-bit or 128-bit.
>>
What's wrong with using C++ as C with classes?
>>
>>54667652
there's nothing wrong with it, it's far superior to using plain C
>>
>>54667525
lein uberjar
>>
>>54666089
The thing I want is to learn, I don't have to learn, I want to, but it is not fun which is not the issue btw. The issue is I don't know what to do.

>>54666191
I have no idea about what to do that is the main issue. If I would have find a project that I can enjoy, I would not asked this question.

>>54666483
What if I have no idea about making cool shit?

>>54667379
Oh, that looks interesting. Definitely going to check this. Thanks.

>>54667441
>yeah unless you enjoy it or have a goal in mind like a program you want to make, then you'll lose interest quickly
Yep, you summarized it very well. I am not saying that I don't enjoy programming, it's fun to learn. However, I don't have a goal or a program that I want to make. So, after a while I get bored and lose interest.
>>
>>54667652
Modern C++ is beautiful.
>>
>>54667687
>C++ and beautiful in the same sentence.
>>
>>54667685
>What if I have no idea about making cool shit?
break the problem down to its components, like if you want to make a 3d game, how do you render a cube? then look up projection matrices and shit like that
>>
>>54667652

The Core C++ guidelines should be illuminating for you. It's a modern language with a lot to offer.
>>
>>54667698
When have you written anything in C++ other than fizzbuzz the last time?
>>
>>54665664

> tfw you can't get the helloworld example from the official website of LWJGL to run
>>
>>54667648
>Depends on the architecture
No, depends on the C implementation.
>>
>>54667763
Yeah, and most C implementations will take advantage of what the arch offers. You are being pedantic.
>>
>>54667738
what errors are you getting? have you set up the dependencies in your IDE?
>>
>>54667788

Yeah, I think

I had to upgrade to java 1.8 and i still get this error

Exception in thread "main" java.lang.UnsupportedClassVersionError: src/HelloWorld : Unsupported major.minor version 52.0
>>
>>54667712
How does it feel being raped by China?
>>
>>54667783
>You are being pedantic.
I'm being correct; not my fault you're making wrong statements. It DOESN'T depend on the target architecture but on the implementation.
>On x86_64 on Windows, Linux, and Mac long double is 80-bit or 128-bit.
This is false. At least on x86_64 on Windows, "long double" is the same as "double" in Microsoft's implementation.
>>
>>54667815

What?
>>
File: 1444270936188.jpg (19 KB, 217x320) Image search: [Google]
1444270936188.jpg
19 KB, 217x320
in Java, should I use Class or Interface to make a binding to a C library using JNA?
>>
>>54667805
>Unsupported major.minor version
ahh i had that error for quite some time, i don't remember how i fixed it, it's something about your java JDK/JRE version, not directly related to LWJGL
>>
>>54667855
a class is fine
>>
>>54667652
If somebody wants to call library you made they have to first export C api just because you wanted to drink the OOP coolaid.
>>
>>54667889
>JNA
wait wut
>https://en.wikipedia.org/wiki/Java_Native_Access
>The developer uses a Java interface to describe functions and structures in the target native library.
what is this wizardry, never heard of it until now, sounds by the wikipedia text that you're supposed to use an interface
>>
>>54665664
Hahaha. This made me laugh. BLOG TIME
> be me, senior dev
> our company/startup merges with fortune 500 company
> we have a really good quality of code, awesome client satisfaction rate
> have to use mothercompany API to allow middleware auth microservice to authenticate their users
> it's soap
> k np
> ask for documentation
> "we don't have any"
> ask for an example SOAP request
> they give me one, it doesn't work
> "try changing this"
> still doesn't work
> continues for 2 weeks, I have a single task which is blocked so I just help others in the meantime
SOAP is deaaad. It has been dead since mind 2000s.
>>
File: output _3.webm (2 MB, 766x596) Image search: [Google]
output _3.webm
2 MB, 766x596
>>54665664
Particle physics neural networking on GPU, going quite well.

XOR problem solving quite good with low error rate.
>>
>>54667652
Nothing, as long as you don't use shit like overloading because you can't wrap it in extern C, making it MUCH less portable than C, and pushing you farther from C with classes
>>
>>54667907
yeah, I just tried now and it requires interface, since it extends another interface from JNA
problem is everything inside interface is final, and I'm new to Java (accustomed to Python and Ruby) and everything seems 10 times more difficult than ever

idk if i should keep trying with JNA or if traditional JNI would be better in the long run (for sure JNI will be faster)
>>
>>54667872

Yeah, it has something to do with compiling with an old version of Java. I was using the helloworld example which requires the nightly build of LWJGL, which compiles with java 1.8. After upgrading and changing my compiler in eclipse, it still won't even compile

I also had to upgrade eclipse, since apparently the one on the Ubuntu software center is old as hell and doesn't support Java 1.8
>>
>>54667932
i'm using JNI, never tried JNA, imo JNI is not too hard or bothersome, you can use jnigen if you want the "boilerplate" to be generated automatically to help you get started but i don't even use jnigen any more
>>
>>54667843
>>You are being pedantic.
>I'm being correct
No better indicator of autism exists.

> It DOESN'T depend on the target architecture
Yeah, let me just make long doubles 128-bit on my AVR.
>>
woah

>>> from collections import defaultdict
>>> d = defaultdict()
>>> d.default_factory = lambda: len(d)
>>> d.items()
[]
>>> d['test']
0
>>> d['hi']
1
>>> d['test']
0
>>> d.items()
[('test', 0), ('hi', 1)]
>>
>>54667982
You got told, eh? :^)
>>
>>54667970
thanks
>>
>>54667425
>implying using oop is a good thing
>>
>>54667648
>x86_64
>Windows
>long double
>80-bit
>128-bit
it's 64-bit you webshit
>>
>>54668006
Not really.
>>
>>54668036
>all i know is C
babby...
>>
>>54667687
Hahaha no
>>
>>54668052
You sure did: you didn't know what the fuck you were talking about and you were shown your place.
>>
>>54668047
depends on the implementation

>>54667783
the arch offers 80-bit floating point
>>
>>54668054
I know C, Java, Python, x86 asm, Haskell, Scheme, SQL, LaTeX and Go so stfu faggot
>>
>>54668095
>depends on the implementation
muh architecture tho >>54667648
>>
>>54668112
some compilers have 64 bit long doubles even on x86_64
>>
>>54668054
OOP is shit even if you do love OO languages
>>
>>54668047
You mean MSVC, not Windows. It's implementation dependent. It could be 80/128-bit but Microshaft just doesn't give a shit about having a good development environment. GCC on Windows long doubles are 16 byte.
>>
>>54668120
but this retard tho >>54667648
>>
>>54668123
well-written OOP is great for many types of programs
>>
>>54668036
>>54668123
Yeah we've all written things in Haskell a few times, buddy.
>>
>>54668128
>It's implementation dependent
b-but a-achitecture >>54667648
>>
>>54668146
>/g/ is one person
lad...
>>
>>54668112
Windows (non-CE) only runs on x86 and x86_64. x86 chips still have 80-bit floats available back to the before the Pentium, which I believe is the oldest chip Windows can run on.
>>
>>54668128
>Microshaft
you need to be 18+
>>
>>54668158
>muh non-sequitur
how about this fag tho >>54667648
>>
>>54668169
MSVC is shit lol the only excuse for using it is because you're using visual studio for its IDE capabilities
>>
>>54668097
>doesn't even know prolog
okay pajeet
>>
>>54668158
>only runs on x86 and x86_64
false
>>
>>54668123

I used to think this and then I finally got obkek oriented memegramming
>>
>>54668169
I run it on my desktop because I still occasionally play vidya. Xubuntu has been good to me and is a much better dev environment so every other computer I have runs it.
>>
>>54668178
>lol
kids are not allowed here
>>
>>54668199
RT isn't standard Windows. Windows for the desktop and server only run on x86 chips.
>>
File: 1462904653770.jpg (40 KB, 700x551) Image search: [Google]
1462904653770.jpg
40 KB, 700x551
>mfw using Django
>>
>>54668218
>RT isn't standard Windows
You don't even know what the fuck you're talking about. What do you consider "standard Windows"? Windows with x86 binaries? Of course, the x86 binaries are not ARM binaries. RT is the Windows build for ARM from exactly the same source code.
>and server only run on x86 chips
Windows Server 2008R2 is supported until 2020 and it works on Itanium. But I guess the Itanium build is not "standard Windows" either for a retard like you.
Fuck off and take this >>54667648 ignorant shit stain with you.
>>
>>54668294
I have plans to try it. Why don't you like it? What do you think is better?
inb4: something php
>>
minimax :: Players -> Lookahead -> Board -> Utility
minimax me lookahead board
| turn board == Finished || lookahead == 0 = evaluate me board
| turn board == me = maximise implicit_game_tree
| otherwise = minimise implicit_game_tree
where
implicit_game_tree :: [Utility]
implicit_game_tree = map (minimax me (lookahead - 1)) next_boards
where
next_boards :: [Board]
next_boards = map (pick_n_destribute board) legal_moves
where
legal_moves :: [Pond_Ix]
legal_moves = filter (legal_move board) [pond_first .. pond_last]

evaluate :: Players -> Board -> Utility
evaluate me board = case me of
Player_A -> (bank_A board) - (bank_B board)
Player_B -> (bank_B board) - (bank_A board)
Finished -> some_shit_that_determines_if_i_like_this_ending
>>
File: 1451683513443.gif (2 MB, 400x225) Image search: [Google]
1451683513443.gif
2 MB, 400x225
>>54668320
>Why don't you like it?
Yeah I guess Boi Story 3 didn't really get my reaction through well enough. I love it, I use it for work, and for a hobbyist project that is sure to bring in $ and £.

That being said, if you're going down that path, and this is going a bit off-topic considering this is /dpt/, I would suggest not using another full framework on top like Angular. Django is already fully featured and as battery-powered as you can get.

Extend the View functionality with frameworks that are View-only like Knockout.js or React.js

Anything else you use is personal choice
>>
>>54668382
SLUT
>>
>>54668364
attaboy. now try to sell it.
>>
Okay, so I was reading up on how to sum two integers.
It appears that Samsung has a patent for this shit?
They can sue me if I use that one line of code?
>>
>>54668425
>not wrapping your integers in classes or functions anyway
Are there really people like this in the current year?
>>
>>54667922

> 28000+ bodies
I barely see 30.
>>
>>54668425
Imagine if mathematicians weren't beta and actually patented their work

Calculus requires you to tip
>>
>>54668425
>sum two integers
>It appears that Samsung has a patent for this shit?
No, your information is incorrect.
>>
>>54668425
>>54668474
They do have a patent on averaging two ints though
>>
>>54668382
MOOOOOOOOOODS!
MODS MODS MODS!
>>
>>54668425
software in itself can't be patented in most countries
>>
>>54668318
Wow, you're actually mad we don't know enough about a shitty operating system? I could care less I didn't know server ran on Itanium, or RT is just Win8. I've never used either. And I'll probably forget those facts in the near future. Shouldn't you be churning out Java apps about now instead of wasting time posting on an anime imageboard?
>>
>>54668489
>patent on averaging two ints
No, they don't.
>inb4 US6007232A
Read the claims, dipshit! Oh, you don't understand? Then ask someone to explain it to you before spewing inane memes.
>>
>>54668525
>we don't know
The shut the fuck up and learn.
>I could care less
You could also learn some English.
>I'll probably forget
And keep memeing around, right? Worthless monkey!
>>
>>54668423
I could sell it to many desperate chinese international students who cant do this for $45 each
>>
>>54668552
>You could also learn some English.
>Worthless monkey!
Yeah... I'm the one who wasn't born in an English speaking country.
>>
>tfw refactored obfuscated concurent error passing to clean upward bubbling and centralised handling
>>
File: 1462288972664.jpg (16 KB, 640x640) Image search: [Google]
1462288972664.jpg
16 KB, 640x640
My professor doesn't realise that recursion is equivalent to a stack based while
>>
>>54669155
>he fell for the higher education meme
>>
>>54669155
>Going to class strictly more often that necessary to not get kicked out
It's like you're not even self-taught.
>>
WELP

https://www3.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html

I followed this example and i get UnsatisfiedLinkError

if I do nm hello.dll I can't find the function

I'm a C noob, how is it possible that a function that I included in the C file doesn't exist in the compiled DLL?
>>
>>54669200
>>54669171
Self taught then fell for the certificate meme. It was an assignment, I gave up on lectures.
>>
>>54669155
yeah but that is a very inefficient way to think about it
>>
>>54669302
if your C and header files look exactly like the example and they compiled successfully it should be there in the dll
>>
>>54669370
not at all, recursion is a meme, even the memiest use-cases like traversing a tree are highly intuitive using iteration with an explicit stack
>>
File: 106734234.jpg (51 KB, 648x595) Image search: [Google]
106734234.jpg
51 KB, 648x595
>>54669401
fucking hell, i didn't even save properly one file, i didn't know the compiler would go just fine if it founds and empty .c file
looks like i need a break
>>
>>54669155
Could you either explain or give me something to google? How exactly would you write a stack-based while?
>>
>>54669370
>what is tail call optimization
>>
>>54669155
Not with tail call optimisation. All recursive calls are within the same stack frame that way.
>>
>>54669411
I thought the biggest advantage and the meme of recursion is writing a small amount of code to perform something that would otherwise take a lot of code. I think it's obvious that you could make any recursive solution into an iterative one, and it might be easier to do so, but you can't do it in as few lines right?
>>
File: 1449232840877.png (110 KB, 269x271) Image search: [Google]
1449232840877.png
110 KB, 269x271
QUICK

Tell me how you name your private member variables.
>>
>>54669612
_camelCase patrician here
>>
>>54669636
>_
anon...
>>
File: 1459702589670.jpg (31 KB, 600x337) Image search: [Google]
1459702589670.jpg
31 KB, 600x337
like 10 minutes ago my 4chan started to blink (in complete site rhythmically disappearing and appearing like once a second) while 4chanx activated on chrome. did the botnet shut me down?
>>
>>54669728
>my 4chan started to blink
>>
>>54669728
no, go on /b/ and look at the sticky
fucking retarded mods
>>
>>54669589
it doesn't save all that many lines of code, and it usually doesn't matter if a function is 5 lines or 10 lines long

there are severe drawbacks to recursion like being forced to fragment your code into tiny little functions whereas with iteration you can embed a loop inside a different function, and with iteration there's an easy to follow top to bottom flow of the code, but with recursion you have "jumps" to the top of the function, so it's a bit like goto in that it can be horrible to read
>>
>>54669728
>>54669741
>>54669744


// ==UserScript==
// @name REMOVE BLINK
// @namespace http://your.homepage/
// @version 0.1
// @description REMOVE BLINK
// @author (You)
// @match https://boards.4chan.org/*/*
// @grant none
// ==/UserScript==

var element = document.getElementsByTagName("html")[0];
element.classList.remove("blink");
>>
File: fuuuuu.png (246 KB, 514x389) Image search: [Google]
fuuuuu.png
246 KB, 514x389
>>54669744
how do I deactivate it?
>>
>>54669768
thanks anon
>>
>>54669744
>go on /b/
holy shit his dick is like 2" tops
>>
>>54669589
The big advantage is slightly less code and maybe an easier way to piece together an algorithm, but you sacrifice:
- potentially blowing the stack
- making workarounds to force your code to be tail-call optimized, in order not to potentially blow the stack
When you take these into consideration, and when you start working on sizable projects where your time and effort is needed elsewhere, you'll realize why you will instinctively stick to the iterative approach, or at least only consider recursive when you can instantly see a tail-call optimized solution
>>
>>54669783

disabling 4chan x worked for me but now its just as unusable
>>
>>54669728
Doesn't blink with based Firefox.
>>
>>54665823
Kek'd
>>
>>54669612
AlTeRnAtInG_cAsE
>>
>>54667037
I just threw up in my mouth a little
>>
>>54669612
Random runes from Japanese, Chinese and Korean.
>>
>>54667408
That actually sounds really cushy. I would not have been surprised if it was a cobol-like fixed-length record format
>>
>>54669589
Recursion tends to be more intuitive
>>54669457
Simply put, before a function B is called from function A, a pointer to A is pushed to the stack so that when B returns, the program knows where to jump back to.
When using recursion (without tail call optimisation) you add a lot of these jump-back pointers to the stack.
The alternative way is to use iteration and manage your own stack.
For example to visit each node in a tree
def visit(node)
visit(node.left)
visit(node.right)

def visit(node)
stack = [node]
while !stack.isEmpty()
node = stack.pop()
stack.push(node.left)
stack.push(node.right)
>>
>>54669862
add
.blink{animation:none!important;}

to the custom CSS in 4chanx settings
>>
>>54669411
>recursion is a meme

holy fuck /g/ has gone to shit
>>
>>54667037
I don't get it. For what I understand it invokes the method 256 times each time passing an address of a local variable.

Am I missing something?
>>
File: 1430853197680.png (331 KB, 474x432) Image search: [Google]
1430853197680.png
331 KB, 474x432
>>54669991
>>
>>54669967
Based anon.
>>
File: 403851840.jpg (21 KB, 211x246) Image search: [Google]
403851840.jpg
21 KB, 211x246
>>54667037
I don't get it
>>
>>54670038
If you assign a char value, say '5' which is 0x35, to a short on a little endian machine, the bytes in memory will be "35 00".
If you take the address of that short and cast it to char*, it gives the valid NULL terminated C-string "5".

So, this "converts" a char to a char*.
>>
>>54669966
Thanks for the explanation.
>>
>>54669967
you are our saviour
>>
>>54669966
>Recursion tends to be more intuitive
nice meme
>>
DAE actually like the music on /b/ and keep the catalog open for it?
... no? Okay.
>>
>>54666061
Decided one say when I was 11 that I was tired of just doing stuff on the computer. I had heard about "programming" before and decided I wanted to make the computer do what I wanted it to do. Started making JavaScript lottery games and the rest was history.
>>
>>54670114
I liked it
>>
>>54670093
>If you take the address of that short and cast it to char*, it gives the valid NULL terminated C-string "5".
So, if I declare two local short variables (in the same scope) and assign 5 to both of them then both would have the same address?
>>
>>54670178
>So, if I declare two local short variables (in the same scope) and assign 5 to both of them then both would have the same address?
Not at all.
Assuming they both spill, they will each have a different address and the top of your stack will look like "35 00 35 00"
>>
>>54670112
Obviously some algorithms are more intuitive as iterative.
>>
>>54670178
>unmistakably trolling about wording because of converting contents vs converting adress, etc.
>>
>>54670242
>some
lad...
>>
>>54669612
names of my enemies
>>
Guys, I tried learning ncurses but I ran in to an error in the very beginning.
My code:
#include <ncurses.h>

int main(){
initsrc();
raw();
printw("Hello world!");
getch();

endwin();
return 0;
}

and I compile with
gcc -o hello hello.c -lncurses
. The problem is that it still throws linker errors
main.c:(.text+0xa): undefined reference to `initsrc'
. I've installed ncurses-dev and I'm out of ideas. What do?
>>
>>54670377
It's

```
initscr();
```

As in initScreen, not initSource. Tried it myself, and it works.
>>
>>54670469
D-did you just try to use markdown on fucking 4chan?

This is truly the end of days.
>>
>>54670487
Yeah lol, too used to using markdown. It should be.

go fuck yourself I am allowed to make mistakes


Also, :) :D XD
>>
>>54670469
Holy shit I didn't spot that...
Thanks
>>
>>54670178
only if using java:
String a="5";
String b="5";
a and b will point to the same string object
>>
>>54670499

jej ur triqueri dident werk :'''carat''')
>>
>>54670507
In Python too. And then you can modify it so 4==5.
>>
File: 1-20160414235141.gif (1 MB, 480x270) Image search: [Google]
1-20160414235141.gif
1 MB, 480x270
>>54670507
>>54670562
Mind = blow. It's retarded tho.
Thread replies: 255
Thread images: 24

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.