[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: 20
File: the_more_you_know2.jpg (132 KB, 561x370) Image search: [Google]
the_more_you_know2.jpg
132 KB, 561x370
No dpt?
>>
>>44136319
have you tried to search for it you idiot?
>>
http://pastebin.com/F2bfgtkV
Rate my fizzbuzz
>>
Rate my method
            bool write( char c )
{
return write( &c, sizeof( c ) );
}
>>
>>44137129
I'd use a macro.

with this you're dealing with the over head of an unneeded function call.
>>
>>44137281
>with this you're dealing with the over head of an unneeded function call.
do you even inline
>>
>>44137129
>char c
>sizeof( c )
>sizeof( char )

Oh anon...
>>
>>44137281
underrated post
>>
>>44136804
i did. There is no /dpt/ thread.
>>
>>44137129
It's truly ebin
>>
>>44136963
>http://pastebin.com/F2bfgtkV


Good good = () => {
//code
};


what...?
Is that even legit C#?
does something like that exists in C++?
>>
>>44137440
auto lambda = [] () {
// code
};
>>
>>44137129

Wait, write needs two arguments? I thought it needed 3.
>>
>>44137322
#define DOUBLE(X) X*X

int y = 3;
int j = DOUBLE(++y);
>>
>>44137541
#define DOUBLE(X) X*X
double x = 3;
double d = DOUBLE(x);
>>
>>44136804
http://boards.4chan.org/g/dpt

the one there was has 300+ posts. threads still get autosaged after 300 in /g/ right?
>>
>>44137565
int j = ++y * ++y;
>>
>>44136319
how do you project a 3d pixel into a 2d frame buffer?
>>
>>44137565
>>44137541
I recommend to write your macro like this:
#define MACRO(x) (x+x)


Adding those parenthesis reduce the risk to do stupid stuffs.
>>
>>44137594
Demons flew out of my nose.
>>
>>44137629
what's the point of macros?
>>
>>44137619
Not a trivial question.
>>
>>44137643
>what's the point of macros?

To be a macro? Thus reducing common operations to a single implementation?
>>
>>44137629
Are you for real? You didn't fix shit. Consider
#define MACRO(x) (x*x)

MACRO(5 + 5)
>>
>>44137652
pin hole camera's were out before computers supposedly.. so how hard could it be?
>>
What is perl5/5.20/man/whatis ?

It's empty and has an ever changing modification time.
>>
>>44137655
like what?
>>
>>44136963
Here's what I understood:
Variables a, b, c are unused.
`args` is always of length 1 that contains a string with the format x.y.z where
x is the number from 1 to 100
y is the letter p, d, or f
z is the letter a, b, c
Finding the index of y in autism yields the numbers 15, 5, and 3.
Finally, for every x, the following sequence is tried:
x.p.a
x.f.b
x.d.c
x.a.d
which is just equivalent to:
if x % 15 == 0 then ....
if x % 5 == 0 then ....
if x % 3 == 0 then ....
and is done inside the good function. Each invocation of main is equivalent to testing a branch of the if statements.
I'm not sure if its a valid program though since mono compiler just shits at me.
>>
>>44137655
Isn't that what static functions are for? Or am I being ignorant to the difference?
>>
>>44137663
Yeah, I meant:
#define MACRO(x) ((x)*(x))
>>
>>44137643
If you find yourself typing something out often, you can define a macro for that.
>>
How many anons here licensed their code and released it?
>>
>>44137703
a lot under the WTFPLv2 license
>>
>>44137697
give me an example you nigger
>>
>>44137717
#define REFL_DEPENDENCY(field_, ...) \
::reflection::makeDependency(#field_, &::reflection::fieldGetter<ThisClass, decltype(field_), &ThisClass::field_>,\
&::reflection::remove_all_pointers<decltype(field_)>::type::reflection_s_uuid(REFL_MATCH),\
::reflection::FIELD_DEPENDENCY, ##__VA_ARGS__),\
>>
Working on a HTML 5 Javascribt multi user hack. Sort of deploy-botnet-to-connected-users thing.

How it works? HTML5 connects via canvas to Javascribt. Then with some socket engineering the user gets connected to my server with an open port. Then automatically the PC turns in the servers network list, making it accessible.

Will post the script once it's out.
>>
>>44137717
>2014
is that c++?
who the fuck uses that bloated shit?
>>
>>44137691
#define ADD(x, y) ((x) + (y))

//Codes

double x = 5.1, y= 2.7;
int a = 5, b = 7;

double resutDouble = ADD(x, y);
int resultInt = ADD(a, b);
>>
>>44137703
Three programs, all GPL due to the fact that most programs I studied to construct them were GPL as well. Better safe than sorry.
>>
>>44137703
http://pastebin.com/raw.php?i=VPdDuJhT
>>
>>44137711
The same
>>
>>44137683
>like what?

Like anywhere you need it.

Macros are evaluated at compile time, and basically replace the text where the macro is used with the text defined in the macro, before everything is compiled. This is different to functions, even inline functions, because functions change things like scoping (when you call a function, all the variables in the caller are not visible to the callee unless they're explicitely passed). So if you have a common operation that, for example, changes the state of a variable, it's far easier to have a macro that does it than to try to write a small function that has to take the variable by reference (which in C means a pointer to it) and then clumsily dereferences it.

It's also quicker to use macros in tight loops. Consider:

#define MIN(x, y) (x < y ? x : y)
#define MAX(x, y) (x > y ? x : y)


which are common macros. They're so simple that a) you wouldn't want to write them every time you wanted them b) there's no point in introducing the overhead of a function call.
>>
>>44137753
Personally, I think the GPL makes sense if you intend for your code to be studied.
>>
>>44137734
nice error message lol, better find that syntrax or string error quicly ;p
>>
>>44137745
what the fuck is
>Javascribt
>>
>>44137777
You don't need GPL if you're not working on a game whatsoever. Plain retarded to add a graphics library to a IP Tracking GUI Interface
>>
>>44137530
>What is overloading?
>>
>>44137541
a static inline function you fucking moron

macro is pointless in this case
>>
>>44137770
What language are we talking here?
std::min exists.
>>
>>44137794
It's a client based script language. U are using it now also! It's been out since 1980 or so, very useful for css hacks etc
>>
>write c++ program with flexc++/bisonc++
>never used either before
>compile
>200 lines of linker errors
>cant figure shit out for fuck
>spend 4 hours trying everything i knew
>try g++ instead of clang
>everything is ok
>end up having to install libc++ to get clang to work
>compile again
>everythings fine
>run program
>crashes repeatedly

i want to get off mr. bones wild ride
>>
>>44137703
GPL for everything.
>>
>>44137770
>This is different to functions, even inline functions, because functions change things like scoping (when you call a function, all the variables in the caller are not visible to the callee unless they're explicitely passed). So if you have a common operation that, for example, changes the state of a variable, it's far easier to have a macro that does it than to try to write a small function that has to take the variable by reference (which in C means a pointer to it) and then clumsily dereferences it.
>
>It's also quicker to use macros in tight loops

Jesus christ, please fucking kill yourself before writing another line of code or incredibly bad advice.
>>
>>44137794
Not knowing about Javascribt
>Pleb
>>
>>44137828
start leaning to programm c+ then. If you are a NOOB, better read a book first, you will fuck servers up and shit, don't pls.
>>
>>44137801
>macro is pointless in this case

#define DOUBLE(x) (x*x)

int n = 3;
int m = DOUBLE(n);

float p = 3.14;
float q = DOUBLE(p);
>>
>>44137703
I use mostly the zlib/Boost license, because it's the most permissive attributive one.
>>
>>44137819
>What language are we talking here?

C

>>44137842
>Hurf durf angry text

Got anything useful to say or do you just want to be angry? Everything I said in >>44137770 is perfectly correct.
>>
>>44137853
you have no idea what i'm saying do you
>>
>>44137541
#define oniichan_checkMyNewPantsu(x) x * x

oniichan_checkMyNewPantsu(y+++1)
>>
>>44137890
Please write >>44137853 using a single inline function.
>>
>>44137530
write is not a function defined by the standard stupid! :3
>>
>>44137899
please read the fucking thread before you blindly reply to people

fucking idiots
>>
>>44137899
>using a single inline function.
Stop being lazy. C is not a toy and explicit is better than implicit.

static int doublei(int n) { return n * n; }
static float doublef(float n) { return n * n; }

int n = 3;
int m = doublei(n);

float p = 3.14;
float q = doublef(p);


This is clearly not the right language for you.
>>
>>44137703
Whatever I release, I put in the public domain, but I do retain the rights to commissioned code.
>>
Dipropyltryptamine?
>>
>>44137828
>flexc++/bisonc++
Wut? Both flex and bison support C++, why would you used other programs for that? (except if this is the name of the executables)
Try to read a manual first, I remember you need to link with something
>>
>>44137938
>explicit is better than implicit

based Zen of Python
>>
>>44137853
Why would you make a useless function like this?
int m = n * n;
float q = p * p;
>>
>>44137916
Oh don't worry I've been here all along. You're wailing that a static inline function is better than

#define DOUBLE(x) (x*x)


You've been shown, multiple times, that you're wrong.
>>
>>44137975
Because it's a contrived example for the purposes of demonstration.
>>
>>44137979
DOUBLE(x+y)

Now go fuck yourself.
>>
>>44137979
You posted an incorrect macro, again.
>>
>>44137979
/g/ isn't one person you newfag
what the fuck is going on inside your head right now, i don't even
>>
>>44137979
#define SQUARE(x) (x*2)
>>
>>44137972
>language's zen says "explicit is better than implicit"
>uses implicit memory managment anyway
>>
>>44137848
No ive never used flex or bison before. Ive worked in c++ a lot. And have never had a problem with clang.
>>44137959
flexc++ and bisonc++ are the executables. they are separate from flex/bison, and flex++/bison++. They are supposed to be much more c++ than c stuff. Theres documentation for each one individually, but trying to use them together there is virtually nothing out there specific to those tools.
>>
>Want to program
>Decide to get a feel for it with Python on codeacademy before I jump into ebooks and such
>Everything is going great
>Get to this boolean shit with False or not True and True
Am I stupid that I don't get this concept yet?
>>
>>44138031
In fact >>44137979 is not >>44137629
>>
>>44137938
>Writing two functions instead of a single macro
>Duplicating code is better
>Being verbose is good C

Sure thing.

static int doublei(int n) { return n * n; }

long f = 3;
long g = doublei((int)f); /* God fucking damn it! */


Second try

static int doublei(int n) { return n * n; }
static long doublel(long n) { return n * n; }

long f = 3;
long g = doublel(f);

unsigned int i = 3;
unsigned int j = doublei(i); /* God fucking damn it! */


>explicit is better than implicit.
>explicit is better
>better
>>
>>44138004
More like because you can't find a real-world usage

>>44138048
that's true only if x is 0 or 2 (or something else that I have no idea right now)
>>
>>44138061
Codeacademy goes to shit at some point I heard. You're better off getting the ebooks.
>>
>>44138048
square *2
wtfamireading.avi
>>
>>44138080
>you can't find a real-world usage

Have you ever looked at any real C code, ever? Like, ever ever? Ever at all? Even once accidentally saw some reflected in a mirror this one time?
>>
>>44138062
It's still wrong, dipshit. And you're squaring the argument, not doubling it.
>>
>>44138071
I'll take 2 working functions over a broken macro any day.
>>
>>44138101
Nice argument faggot
>>
>>44138071
If you think that implicit>explicit, why the fuck are you writing C?
>>
>>44138101
>Have you ever looked at any real C code, ever?
>>44138120
>No
>>
>>44138134
>I can't find a real world example where macros are better, look at me
>>
>>44138071
And this is the point where you realize that it would be really cool to have generics in C that easily allow you to find your explicit type errors at compile time.
>>
>>44138161
>I can't find a real world example where macros are better

Spoon feeding time, I see.

PROTIP: The C & Single Unix Standard both define macros. Right there in the standard. There are a bunch *baked right into C*.

Obviously they do this because macros are useless and have no real world application. Glad you were here to clear that up.
>>
>>44138080
/* only use when x is 0 or 2 */
#define DOUBLE(x) (x*2)

int doublei(int i)
{
switch(i) {
case 0:
case 2:
return DOUBLE(i);
default:
return x*2;
}
}
>>
>>44138189
assembly has macros too
what's your point
nobody with half a brain uses macros
>>
>>44137801
I know that, I was showing that this >>44137594 would happen
>>
File: awful g posts #4.png (43 KB, 792x358) Image search: [Google]
awful g posts #4.png
43 KB, 792x358
Screencap for future reference.
>>
>>44138187
Yeah. Oddly, C always had the "auto" keyword but it wasn't implemented in K&R. C++11 has re-introduced it (with different semantics), so you can do real generics there. Can't remember if the newer C standards have absorbed that back in from C++, though.
>>
Can some one reference some sepples source code example of event based programming?
>>
File: 1410511451110.jpg (76 KB, 514x470) Image search: [Google]
1410511451110.jpg
76 KB, 514x470
>software engineering class wants a project idea
>been putting it off for 2 weeks
>still nothing
>due today

Goddammit.
>>
>>44138219
if(true) kill_you're_self();
>>
>>44138219
Take a look at how Haiku applications do it.
>>
>>44138237
How big project?
>>
>>44138237
stop the botnet.
>>
Trying to understand this output (learn c the hard way valgrind exercise)
 valgrind ./ex4  
==30182== Memcheck, a memory error detector
==30182== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==30182== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info
==30182== Command: ./ex4
==30182==
I am -16775752 years old
==30182== Conditional jump or move depends on uninitialised value(s)
==30182== at 0x4E8147E: vfprintf (vfprintf.c:1660)
==30182== by 0x4E8B388: printf (printf.c:33)
==30182== by 0x40055E: main (ex4.c:7)
==30182==
==30182== Use of uninitialised value of size 8
==30182== at 0x4E8093B: _itoa_word (_itoa.c:179)
==30182== by 0x4E845E6: vfprintf (vfprintf.c:1660)
==30182== by 0x4E8B388: printf (printf.c:33)
==30182== by 0x40055E: main (ex4.c:7)
==30182==
==30182== Conditional jump or move depends on uninitialised value(s)
==30182== at 0x4E80945: _itoa_word (_itoa.c:179)
==30182== by 0x4E845E6: vfprintf (vfprintf.c:1660)
==30182== by 0x4E8B388: printf (printf.c:33)
==30182== by 0x40055E: main (ex4.c:7)
==30182==
==30182== Conditional jump or move depends on uninitialised value(s)
==30182== at 0x4E84632: vfprintf (vfprintf.c:1660)
==30182== by 0x4E8B388: printf (printf.c:33)
==30182== by 0x40055E: main (ex4.c:7)
==30182==
==30182== Conditional jump or move depends on uninitialised value(s)
==30182== at 0x4E81549: vfprintf (vfprintf.c:1660)
==30182== by 0x4E8B388: printf (printf.c:33)
==30182== by 0x40055E: main (ex4.c:7)
==30182==
==30182== Conditional jump or move depends on uninitialised value(s)
==30182== at 0x4E815CC: vfprintf (vfprintf.c:1660)
==30182== by 0x4E8B388: printf (printf.c:33)
==30182== by 0x40055E: main (ex4.c:7)
==30182==
I am 0 inches tall
==30182==
==30182== HEAP SUMMARY:
==30182== in use at exit: 0 bytes in 0 blocks
==30182== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
[code/]
>>
>>44138267
Enough to base about a semester of work around it.
>>
>>44138189
>The C & Single Unix Standard...
The only stuff that need to be function-like macros in the C standard are:
assert
setjmp (may be a macro)
va_arg
va_start
va_end (may be a function)
va_copy (may be a function)
generic functions in tgmath.h

I can't think of anything else, every function CAN be also defined as a macro with function syntax but it should also be implemented as a real function. Same goes for SUS
I can't see how is this an argument, would you mind explaining me how this proves anything?

You still have not replied to my post, you can't find a example of a macro with function-like syntax that is better than a real function in real-world-code
>>
>>44138219
you have a loop that receives messages
>>
>>44138283
Scripting language it is.
Some inspiration: http://pastebin.com/yWVKBajR
>>
>>44138310
>(may be a macro)
meant to say
>may be a function
>>
File: magician-works.webm (1 MB, 1920x1080) Image search: [Google]
magician-works.webm
1 MB, 1920x1080
Working on a node-webkit based theme file synchronisation tool for Shopify because currently you can only edit Shopify themes using their on-site editor which is total dicks
>>
>>44138217
auto in C nowdays still means the same thing as in the past but gcc 4.9 supports __auto_type and C11 supports the totaly different _Generic keyword
>>
>>44138452
heh
http://stackoverflow.com/a/2192761
>>
>>44138349
I figured as much, pretty much just have a queue that the a loop processes until empty, and objects/functions that write to it
>>
>>44138520
The last one is very informative!
>>
>>44138568
>until empty
When it's empty you have to wait for a new message
>>
>>44138310
>I can't think of anything else

https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html
>>
>>44138608
These do not use the function-like syntax
>>
File: prev.gif (264 KB, 663x445) Image search: [Google]
prev.gif
264 KB, 663x445
I finished the basic GUI for the image downloader, but i can't find a decent suite for make it portable.
how do you make python programs portable ?
i tried py2exe but i get weird errors, pyinstaller same.
>>
Anyone know how to get autocomplete in Java using emacs? I've already got auto-complete and yasnippet installed.
>>
File: butts.png (562 KB, 937x650) Image search: [Google]
butts.png
562 KB, 937x650
>>44138634
>my folder when I also have a butts folder
>>
>>44138631
>function-like syntax

That was some additional requirement you invented, and I really don't care about it.
>>
>>44138634

I used pyinstaller with wxpython once and it worked great
>>
>>44138695
mine is full of cute boy though.
>>
>>44138427
That's really sexy. Are you using bootstrap for the node-webkit part?
>>
>>44138709
Read the thread, faggot
>>
>>44138711
pyinstaller works but when i execute the program and the main function starts (after i hit "download") it gives me a lot of errors from a module i'm using (haul) and i don't even know how to fix it
>>
>>44138716
Yeah UI is bootstrap with all the CSS tuned for a darker look.

Most devs despise bootstrap but I think it's fine to use for UIs, it's only when you're using BS style defaults as your design for a website that it's bad.

I just got integration with Shopify's APIs all finished, all I have left to do is package it for OSX and Windows then I can release it.
>>
>>44138634
A Python GUI toolkit that doesn't look like ass? Where do I get one?
>>
>>44138761
it's pyQt . Awesome to use plus QtDesigner.
>>
>>44138755
Will it be FOSS? I would love to take a look at it.
>>
>>44138755
>Most devs despise bootstrap
You what
>>
>>44137703
Released a couple of Machine Learning under GPLv2
>>
File: shift-em.jpg (51 KB, 420x285) Image search: [Google]
shift-em.jpg
51 KB, 420x285
>>44138727
>Read the thread

Sure. Shall I read this bit here >>44138310
right towards the bottom of the thread, after an entire discussion about macros, where the phrase

>function-like macros

is first used? Because up until that point, no one had tried to qualify it as "function like macros". Also the place where you said

>You still have not replied to my post, you can't find a example of a macro with function-like syntax

Which is odd, because I can't seem to find your post where you mention "function-like syntax" prior to that.
>>
>>44138794
What kind of brain damage do you suffer?
>>
Has anyone here used Snap before? This tutorial is confusing me so much, I don't understand how to modify state. Do I use a MonadState instance?

http://snapframework.com/docs/tutorials/snaplets-tutorial
>>
>>44138794
Nobody said these words, this is rigth but the disscussion was about it
Please stop being a retard or atleast stop posting
>>
>>44138823
Must be a very specific type of brain damage where I can't see anyone mention "function-like syntax" prior to >>44138310. Clearly this is a serious issue, as I can't see any of the mentions my web browsers "Find" function is showing me prior to >>44138310

It's almost as if...you moved the goalposts in >>44138310 and now trying to act like you meant that all along, but never once said it. That couldn't be it, could it?
>>
>>44138859
>the disscussion was about it

The discussion was about "macros". No one once mentioned "function-like" macros. Just "macros". What was that about "Explicit is better than implicit" again?
>>
>>44138788
A lot of developers I know have sticks up their asses and refuse to use any frameworks or libraries other than core ones like jQuery because they're adamant that they can code their own solutions ground-up faster.

I guess you could say they aren't good developers.

>>44138781
Unfortunately not as since I'm broke as fuck at the moment I'm hoping to make some money out of this (seeing as there seems to be a high demand for this in the Shopify community).

Once I've made enough to pay off some of my debt and secure my financial future I'll definitely release it FOSS though.

Or if I somehow land a well paying job that solves my financial issues I'll open source it then.
>>
>>44138860
I'm not >>44138310.
>>
>>44138860
Okay then, what is >>44137801 and >>44137853 talking about in that case? Regular macros? like
#define PI 3.14
?
No, they are talking about
#define DOUBLE(x) (x*x)

Who's trying to change the goalpost?
>>
>want to do long task with progress
>work around thinking the long task will block methodevents from being triggered
>use threads/tasks and what not
>give up and let it run synchronously
>events trigger anyway

Wasted 5 hours working around something that just works.
>>
>>44138885
>A lot of developers I know have sticks up their asses and refuse to use any frameworks or libraries other than core ones like jQuery because they're adamant that they can code their own solutions ground-up faster.
That's funny, I've always considered Bootstrap more "core" (certainly less bloated) than jQuery
>>
File: bait.png (67 KB, 623x624) Image search: [Google]
bait.png
67 KB, 623x624
>>44138881
>What was that about "Explicit is better than implicit" again?
Something that python developers don't actually follow
>>
kto z polski?
>>
>>44138219
Boost.Signals2
Qt Signal/Slot
Boost.Asio event handlers
>>
>>44138899
>Regular macros?

Those are all "regular macros".
>>
I'm looking for someone to write site-specific Firefox extensions to operate specific web sites. Please email rms at the gnu site if you want to volunteer.
>>
>>44139158
Let me fix it
>Object-like macros?
>>
>>44138061
What do you not understand?
>>
>>44139220
So you're saying you want an example of a useful object-like macro? Uh, O.K:

#define BUFFER_SIZE 1024
>>
>>44139264
:^)
>>
>>44138427
Cool. What WM are you using, if I may ask?
>>
>>44136963
>80 lines to write a fizzbuzz
Sorry anon, you are not what this company is looking for.
>>
>>44139347
Gnome 3.12, the theme is Numix. The rice on the top bar was achieved with this Gnome Extension:

https://extensions.gnome.org/extension/358/activities-configurator/
>>
Finally got my portfolio up. Feels good, mang.
>>
>>44138840
Anyone? :(
>>
>>44139583
Link?
>>
>>44139591
Haskell is so rarely used outside of the academia that if you have problems with it, you're on your own.

Just pick some more widely-used framework.
>>
>>44139347
it's gnome 3
>>
>>44139104

I'll check out both qt's and boosts implementations thanks
>>
>>44139653
/is/ there a more widely-used web framework than Snap?
>>
>>44139644
Nay.
>>
>>44139708
Yesod? Happstack?
>>
>>44139793
I'll probably have the same problem if I were to use one of those, to be honest. My main difficulty is with understanding how modifying state works.
>>
>>44139209
I-Is that you, S-Stallman-sama?
>>
>>44139708
>>44139868

Laravel is probably the most widely used web framework right now, unfortunately it's for PHP.

There's also Django and Pylons for Python.

I've been using a lot of node.js lately and have taken a liking to Sails.js

If you want event based i/o then you might as well just use node since that's exactly what it was designed for.
>>
>>44139209
Not sure if I understand but this would be a good idea

>>44139900
He siad that he does not post here
>>
>>44139909
>Django
Flask >>>>>>>>>>>>>>>>>>>. Djanigger
>>
>>44139940
>Flask

I knew I was forgetting something.
>>
Am I wasting my time learning Haskell or will I be able to transition to a job that uses it or uses a language like it? I really don't wanna be a web dev all my life -.-
>>
>>44139909
Vibe.d looks amazing, but I haven't tested it thoroughly yet.
I think he was talking about Haskell, though.
>>
>>44139909
>I've been using a lot of node.js lately and have taken a liking to Sails.js
For node what are the alternatives to sails?
>>
>>44139978
>he
>>
>>44139964
Web dev industry is currently entirely PHP and .NET, maybe a little bit of Java unless you manage to find a company with existing architecture in another language. If you want something that can transition easily to more than just web dev, I'd say Python, JavaScript (node.js) or Ruby would be your best bets. Haskell is awesome but unfortunately rarely used commercially.

>>44139982
I was looking at CompoundJS but it was a gimped clusterfuck as the time as they were in the middle of transitioning from RailwaysJS. It might be worth looking into.

RhapsodyJS sounds promising but I haven't used it.

Unless you really need a rails-like framework, then you're best off just going bare-bones with ExpressJS, it provides routing and all the minimal requirements for web apps.

Currently, Sails is my favourite because it's fairly well polished at the moment and the developers actually seem to pay attention to issues and pull requests I've submitted.
>>
>>44140056
Pretty sure they want to Haskell INSTEAD of web dev.
>>
>>44140198
>they
>>
File: ok kid HD 1080p.png (3 MB, 1500x1485) Image search: [Google]
ok kid HD 1080p.png
3 MB, 1500x1485
>>44140341
>>
>>44138695
can you post the first and last from the fist row? and the third from the third row?
>>
File: r.png (5 KB, 256x256) Image search: [Google]
r.png
5 KB, 256x256
opinions on rust? getting tired of ruby/js at my day job and was thinking about learning it, and actually building shit that no one else has yet. my fear is that it's still too young and that in 6 months will be vastly different than it is now, and that unless im heavily participating in the community and paying attention to everything, ill be out of the loop fast.
>>
>>44140498
By the end of the year we should see the first stable version (1.0), which means backwards-compatible changes from then on.

The language itself is very cool, C++'s equivalent to Scala without those amounts of complexity. They also aim to be at least as fast as C++ (rustc is built on LLVM, so it gets a good optimizer for free)
>>
>>44140498
go with D now, it's very similar to Rust so it'll be easy to switch when Rust is mature
>>
>>44137129
>inline
>>
>>44140426
>ok kid
>>
>>44140567
They are really different, not similar at all
>>
Is there a really good, mode, clean and lightweight implementation of signals and slots using C++11?

Qt is a fucking behemoth and I don't want to use it but I'll be damned if their signals and slots implementation isn't fantastic.
>>
>>44140603
Boost?
>>
>>44140603
Boost.Signals2 is pretty simple to use, but I'm not sure how to properly encapsulate them
>>
File: 1362251581866.jpg (452 KB, 800x1200) Image search: [Google]
1362251581866.jpg
452 KB, 800x1200
>>44140435
Sure. The third from the third row is 1362255325578.jpg right?

>inb4 I get banned
>>
File: 1362252687029.jpg (225 KB, 600x800) Image search: [Google]
1362252687029.jpg
225 KB, 600x800
>>44140435
>>44140630
>>
>>44140630
>>44140654
>lewd 2hus
>>
>>44140630
>>44140654
thanks
>>
File: 1362255325578.jpg (997 KB, 1920x1200) Image search: [Google]
1362255325578.jpg
997 KB, 1920x1200
>>44140435
>>44140654
>>
Hey /g/, I'm working on a audio visualizer. Suggestions?
>>
>can't have a struct that contains an array of a fixed size
;_;
>>
>>44141156
What?
>>
>>44138695
I require touhou butts. I need them... for reasons.
>>
>>44141204
struct shit
{
int[4] x;
};
>>
>>44141219
All of them?
>>
File: 1388359222642.jpg (377 KB, 990x860) Image search: [Google]
1388359222642.jpg
377 KB, 990x860
>>44141252
All of them would be nice if it's not too much to ask.

Have a patchy for your troubles.
>>
>>44141156
>>44141237
Well language? C#?
>>
>>44141279
C
>>
>>44141237
You can, you're just retarded.
struct shit { int x[4]; };
>>
>>44141291
Then your problem is that >>44141237 isn't C
struct shit
{
int x[4];
}
>>
>>44141312
>>44141311
fuck
dont bully
>>
>>44141343
Why are you trying to learn C ? It's fucking ancient.
>>
>>44141276
Uploading now, it will probably take 10 minutes because my connection sucks.
>>
>>44141429
I hate myself
>>
anybody here weeb enough to translate this for me?
-- tuple.lua
-- ?????????
-- ??:
-- ?immutable
-- ??????????? immutable ???
-- ????????????????????????????
-- ?flyweight
-- tuple.new(...) ??????????????????????
-- ?? tuple.new( ... ) == tuple.new( ... ) ??????
-- ??????????????????????????
-- ?nil??????
-- ???????? nil ???????
>>
File: Suwakoflapflap.gif (12 KB, 120x152) Image search: [Google]
Suwakoflapflap.gif
12 KB, 120x152
>>44141437
Thank you very much. Have some Suwako too!
>>
Can someone rate my Linux command to show installed packages that don't start with 'lib'

dpkg --get-selections | grep -v deinstall | awk '!/^lib/' > ~/installed
>>
>>44141487

dpkg --get-selections | awk '!/(^lib|deinstall)' > ~/installed


Fixed
>>
>>44137281
overrated post
>>
>>44136319
What should I make to put on github as a foot in a programming job door?
>>
>>44141478
https://dl.dropboxusercontent.com/u/8950820/touhou%20butts.zip

Have fun.
>>
File: 1375143150904.jpg (66 KB, 960x685) Image search: [Google]
1375143150904.jpg
66 KB, 960x685
>>44141623
I will! Thanks again.
>>
>>44141623
>Dropbox
>giving out fellow lolicons to Condi
That's not very nice of you, Anon.
>>
Besides /rbt/, is there a website that lists people's custom homepages w/ source? Want to steal someone's and edit it to suit my own needs.
>>
>>44141854

github
>>
>>44141802
Sorry ;_;

Can you suggest an alternative for future reference?
>>
C sockets question; why when I add the listening socket to the fd_set for reading and call select, is the listening socket's descriptor marked ready for reading?
>>
>>44141610
>he has never seen PS3 SDK headers
>>
File: d5CDK.png (9 KB, 665x697) Image search: [Google]
d5CDK.png
9 KB, 665x697
Rate my sepples, /dpt/

https://github.com/minexew/bleb/blob/master/src/bleb/repository_directory.cpp
>>
>>44137796
What exactly do you think GPL stands for ?
>>
>>44142094
Gnu public license or something
>>
>>44142046
Post a snippet.
>>
>>44142084
It's actually pretty good, I wouldn't mind working with you.

There's some documentation, okay symbol naming, consistent conventions, and no obvious sign of retardation.

7.5/10
>>
>>44142185
That would be illegal.
>>
>>44142143
so what makes you think it's good for games
>>
>>44142206
Well can you describe how bad it is then? What about accompaniment documentation? Demos? etc? Is the unofficial SDK (PSLight? or whatever) the same?
>>
>>44141931
pomf, puush, BayFiles
>>
>>44141931
wikisend
>>
>>44142255
>he has never seen the code of korean f2p games
>>
>>44141931
Mega, anonfiles
>>
>>44141931
POMF.SE
>>
>>44141156
Why would you do that?
>>
>>44141429
Because he may suck but at least he is not a flaming homosexual
>>
>>44142842
makes it easier to loop through the fields
>>
Hey I'm currently learning Lua and I keep seeing things like this,

EventFrame:SetScript("OnEvent", function(self,event,...)

What exactly is the point of the ... in the function? I see it all the time in the guide I'm reading and it is never explained.
>>
File: ss (2014-09-13 at 11.51.30).png (71 KB, 574x689) Image search: [Google]
ss (2014-09-13 at 11.51.30).png
71 KB, 574x689
>>44143115
Get Programming Lua, it's very useful. I was learning from it on the fly when coding a Lightroom plug-in.
Section 5.2
>>
>>44143211
What is it a book or something?
>>
>>44143236
Yes.
>>
>>44143377
Alright thanks I appreciate it a lot, I'm just barely learning it.
>>
What is the most production-ready Lisp that compiles to JavaScript?
>>
>>44142875
wat
>>
>>44143490
C++
>>
Has anyone here used Google or Bing's map API and C++ web/network stuff?

I'm trying to do the following in the simplest possible way:

Request map image tiles from the web through C++ and then render/draw the corresponding images through OpenGL.

I'm fine rendering the images, but I have never worked with web stuff and I have absolutely no idea how I'd request map tiles through either Google or Bing services...

what library would I use on the C++ side of things?

how would I request specific tiles?
>>
>>44142084
Way too much state per function, should split up into smaller parts, possibly see if they match any standard algorithms and use those.
Also saw at least one memory leak (lines 221-224, if getBytesAt returns false, contents is never free'd) - use smart pointers.
Probably more because of how convoluted and tangled the resource management is with function logic.
>>
>there's people that believe that C++ is low-level and unsafe

Here you have it, a multi-threaded 4chan client written in plain C++ with Boost.Asio, cURL, libJSON and my wrapper library:

StdThreadPool pool{1};

int main()
{
std::promise<void> done;

StdNetworkThread t;
auto& net = t.network();

net.get("api.4chan.org/boards.json")

// bind(pool, f) runs f in the thread pool
.bind(pool, [&](http::GetResponse&& res) {
auto boards = parse_boards_metadata(parse_json(move_response_body(res)));

return ask_board(boards);
})

.bind([&net](string&& board_name) {
return net.get("api.4chan.org/" + board_name + "/catalog.json")
.append(board_name);
})

.bind(pool, [](tuple<http::GetResponse, string>&& res) {
auto catalog = parse_catalog(parse_json(move_response_body(std::get<0>(res))));

return ask_thread_id(catalog)
.append(std::get<1>(res));
})

.bind([&net](tuple<long, string>&& url_info) {
auto& board = std::get<1>(url_info);
auto thread_id = std::to_string(std::get<0>(url_info));

return net.get("api.4chan.org/"+board+"/thread/"+thread_id+".json");
})

.fmap(pool, [&](http::GetResponse&& res) {
auto chosen_thread = parse_thread(parse_json(move_response_body(res)), false);

print_thread(chosen_thread);

done.set_value();
})

.run();


done.get_future().wait();
cout << "Done.\n";
}
>>
>>44144061
Hard to read, but noice regardless.
>>
>>44144061
>a language that has native unsafe features isn't unsafe
>>
>>44144061
>C++ with Boost.Asio, cURL, libJSON and my wrapper library
>50MB executable for a command line 4chan client.
>>
>>44144083
Thanks! I'm planning on writing a full-blown 4chan library with watchers, posting and other stuff so that people can make native clients for any platform

>>44144096
Primitives are usually unsafe, but the language has good tools to quickly build safe abstractions on top of those unsafe primitives

>>44144182
408k

Boost.Asio isn't template-heavy at all compared to other Boost libraries
>>
>>44144061
Wow, that's pretty darn ugly. Crossing C++'s pseudo-OOP with pseudo-FP is insanely perverted.
>>
Been sitting at this for half an hour, can someone help me with *efficiently* handling vector lookups that may be out of range, working on a word search, and when I find a matching character, I check the characters around it to see if they will work, however, when they are on the edges, this won't work, so I need a way to do this quickly, as this will be done many times.
The word search is stored in a 2 dimensional vector, I don't know what else to add to help with this, and sorry if I inconvenienced you.
>>
>>44144286
>Thanks! I'm planning on writing a full-blown 4chan library with watchers, posting and other stuff so that people can make native clients for any platform
I started something like that a few months ago.
Libfourchen.
Thread replies: 255
Thread images: 20

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.