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

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 317
Thread images: 39

File: 1480590811928.png (389KB, 934x1000px) Image search: [Google]
1480590811928.png
389KB, 934x1000px
What are you wroking on, /g/?

Old thread: >>62011075
>>
File: 1499115552473.jpg (899KB, 3840x2160px) Image search: [Google]
1499115552473.jpg
899KB, 3840x2160px
First for C

As for what im working on:

Teminal based audio player using SDL
>>
first for feeling like you should learn lisp and never doing it
>>
>>62015605
?
not sure what you mean
>>
trying to do a C project for fun after years of C++, what's a good container library?
>>
>>62015605
sorry man but C++ really is the language of gamedev. If You Don't Like It, Don't Use It.
>>
>>62015621
typedef struct {
int size;
int data[size];
} Container;
>>
>>62015621
why would you want that ?
C with containers is basically C++.
>>
File: 2345t6y7uijhbgv.png (121KB, 934x1000px) Image search: [Google]
2345t6y7uijhbgv.png
121KB, 934x1000px
>>62015577
your png is now optimized
>>
>>62015636
STL containers are hit or miss.
>>
>>62015634
C has dependent pair types?
>>
>>62015634
also
void function(int size, int data[size]) {...}
>>
>>62015634
kek
>>
whats the "official" name for what we refer to as 32bit and 64bit architectures?
x86 and x86-64?
>>
>>62015648
It's just a C99 extension to canonicalize a common design pattern.
>>
>>62015674
can you please fuck off to /v/
>>
>>62015675
i386 and amd64
>>
>>62015674
It's correct.
>>
>>62015675
IA-32 and AMD64
>>
File: aZMpqxn_460s.jpg (55KB, 460x636px) Image search: [Google]
aZMpqxn_460s.jpg
55KB, 460x636px
>>62015634
keks
>>
>>62015676
it's a flexible array member then?
>>
>>62015693
i misclicked what i wanted to post.
fugg.
inb4 banned for this
>>
File: 1498866208019.png (717KB, 1000x793px) Image search: [Google]
1498866208019.png
717KB, 1000x793px
>>62015706
you're going away for a long time buddy
>>
>>62015706
Surely if you get banned this means the /v/ crossposting retard will at least get sent to jail
>>
Is this true?

>>>/v/387795471
>>
>>62015674
dude look the fuck out, C++

what's next, php? oooh shit there's some scary bad langs up in here, someone might get upset

>>62015699
You might as well call it that, though I think you can have more than one
>>
Anyone has experience with libpng in C? How do I handle RGBA data layout? I use unsigned 8 bit integer for RGB to lay numbers from 0 to 255 and just came to realization that last alpha parameter probably takes float between 0 to 1 rather than unsigned int, however how do I even go about getting a 8 bit float? Or is the Alpha value for RGBA output a 32 bit float? Cannot find anything in the documentation.
>>
>>62015734
I don't know about videos, about the language, it depends.
>>
>>62015743
desu just use a higher-level library unless you absolutely have to do that
>>
>>62015743
what is this project for?
>>
>>62015737
What are you going to do with C aside of hello worlds?
>>
>>62015743
use rgba5551
>>
>>62015772
raytrace C compiler to Javascript
>>
>>62015772
>>62015786
ESL >>>/out/
>>
>>62015743
No idea but if you can afford another library stb image is godlike
>>
>>62015788
?
>>
>>62015788
Thank you, I meant "aside from".
>>
>>62015769
Have 4 grayscale images from which I am meant to extract relevant colour channel values and mix them together to produce final output image. The only remaining part is getting alpha values to work, and that was producing a lot of problems until I realized that alpha in RGBA goes from 0 to 1, meaning that the data I was passing was probably wrong (0-255).

Tried casting float to unsigned char but that just rounds it down. Could it be possible that libpng uses 0 to 100 int metric instead? The documentation is just all over the place.

>>62015800
Does it support grayscale input and RGBA output?
>>
>>62015577
FAGGOTS
>>
>>62015867
>Have 4 grayscale images from which I
no i meant why are you doing this project
>>
>>62015786
I think that raytracing a C++ compiler to Python is better.
>>
>>62015636
>Screen Shot 2017-08-01
wut

fucking google botnet now asks for the type of street sign...
>>
>>62015896
Modelling friend asked if it possible to put together something like this since doing it manually takes time.
>>
Making a dynamic currency converter in React.

If you change the value for USD for ex, all the other cryptocurrencies and currencies change their value to match the equivalent of USD. You can edit any currency and all the other currencies will change in value to the equivalent of them in USD.
>>
guile is throwwing this error when I try to run it
guile: error while loading shared libraries: libguile-2.2.so.1: cannot open shared object file: No such file or directory

but I know that's full of shit
ll /usr/local/lib
total 14592
drwxr-xr-x 7 root root 4096 Aug 21 10:06 ./
drwxr-xr-x 10 root root 4096 Jan 25 2017 ../
drwxr-xr-x 3 root root 4096 Aug 20 20:30 guile/
-rw-r--r-- 1 root root 9791306 Aug 21 10:06 libguile-2.2.a
-rwxr-xr-x 1 root root 1043 Aug 21 10:06 libguile-2.2.la*
lrwxrwxrwx 1 root root 21 Aug 21 10:06 libguile-2.2.so -> libguile-2.2.so.1.2.0*
lrwxrwxrwx 1 root root 21 Aug 21 10:06 libguile-2.2.so.1 -> libguile-2.2.so.1.2.0*
-rwxr-xr-x 1 root root 5096264 Aug 21 10:06 libguile-2.2.so.1.2.0*
-rw-r--r-- 1 root root 16039 Aug 21 10:06 libguile-2.2.so.1.2.0-gdb.scm
drwxrwsr-x 3 root staff 4096 Jul 16 22:22 ocaml/
drwxr-xr-x 2 root root 4096 Aug 21 10:06 pkgconfig/
drwxrwsr-x 4 root staff 4096 Jan 25 2017 python2.7/
drwxrwsr-x 3 root staff 4096 Jan 25 2017 python3.5/

what gives?
>>
>>62015930
What's the point in doing such tasks in C or C++, if it will be much faster in Python in terms of writing and debugging a script.
>>
>>62015953
Your guile package is out of date.
>>
>>62015942
you have your own thread >>>/g/wdg
>>
>>62015953
tried using LD_PRELOAD ?
>>
>>62015964
Already had some experience using libpng so thought might as well try, but the hidden details really fuck one over. I agree that python would probably be easier.
>>
Now that webapps are deprecated what are people supposed to use for cross platform GUI applications?
>>
>>62015982
i like this one more though.
>>
>>62015953
Try creating a file 99config.conf file in the/etc/ld.so.conf.d/ dir and put
/usr/local/lib
in the file, then run
sudo ldconfig
and then try again.
>>
>>62015982
let's see you mental gymnastics.

try to prove that it is not programming.

I'll grab my pop corn
>>
>>62015988
When the computational speed of a final result doesn't matter, usually the lower level languages only complicate things.
>>
>>62015981
?
didn't install it from a package
everything that's there was put there from sudo make install

>>62015983
LD_PRELOAD=/usr/local/liblibguile-2.2.so.1 guile
ERROR: ld.so: object '/usr/local/liblibguile-2.2.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
guile: error while loading shared libraries: libguile-2.2.so.1: cannot open shared object file: No such file or directory
>>
>>62015926
i steal memes my dud. what you think i do ?
>>
>>62015743
r g b and a are all the size of the color depth as an int, not a float
that would be dumb.
>>
Is github very slow today or is it my connection?
>>
>>62015998
>Now that webapps are deprecated
source?
>>
>>62015998
Javascript
>>
>>62016037
same here

don't know what's happening
>>
>>62016053
obselete
>>
>>62016059
>obselete
source?
>>
File: 1486237213522.jpg (99KB, 288x402px) Image search: [Google]
1486237213522.jpg
99KB, 288x402px
Which prorgramming language is the best for a newb? I figured I might get better responses here than in dqt
>>
>>62016094
Malbolge
>>
>>62016021
>>62015983
just realized i mistyped the command, yeah that works
LD_PRELOAD=/usr/local/lib/libguile-2.2.so.1 guile
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)>

thanks m8
>>
>>62016094
Depends on what you want to do
>>
File: union.png (153KB, 480x444px) Image search: [Google]
union.png
153KB, 480x444px
>>62015591
>>
>>62016094
Haskell
>>
>>62016125
?
>>
>>62016103
I want to prepare for CS since I'm going to university next semester, so I guess a language that helps me get a basic understanding of how programming works/whose principles translate well to other languages, if that makes any sense
>>
>>62016012
yup, works
>>
>>62016136
C
>>
>>62016105
lol that's funny
>>
>>62016094
Scheme. You can try it out a bit here:

http://www.bootstrapworld.org/materials/spring2017/courses/hour-of-code/
>>
>>62016136
What course is it? Usually they start you off with C, Java or Python.
>>
>>62016144
He wants to prepare for CS, not /dpt/.
>>
>>62016136
>whose principles translate well to other languages
OCaml.
>>
>>62016159
>prepare for CS
My CS very first course was on C
>>
>>62016154
I think we're going to use Java for the first few semesters and then C/C++ later
>>
>>62016136
My uni thought us C, then C++, then required we know java, prolog, python and scala in some courses even though they never thought us (which is fine because once you know a bit about programming you can teach yourself).
>>
>>62016136
Unironically C and OCaml. If you hate frogs SML is fine too. OCaml just happens to be the best modern ML implementation.
>>
>>62016102
I think you need to run `ldconfig` before using your program without LD_PRELOAD
yw
>>
>>62016177
Well at my university we are only being taught Java.
>>
>>62016204
At my university we are taught Java in the first year and C in the second. And we're just kind of expected to know Python and PHP.
>>
>>62016202
yeah this guy >>62016012
already told me
>>
 
[null,null] == ","

This returns true in Javascript.
>>
File: Screenshot_2017-08-21_17-54-03.png (23KB, 349x530px) Image search: [Google]
Screenshot_2017-08-21_17-54-03.png
23KB, 349x530px
Got a free license. What's actually useful in this list?
>>
File: bad_output_3.png (786KB, 1530x488px) Image search: [Google]
bad_output_3.png
786KB, 1530x488px
>>62016036
That was my initial assumption too, but when you run out of ideas and notice that something may be off you start thinking.

Maybe someone can help spot what exactly is wrong with the image transformation in pic related? The left picture is the desired output, middle uses RGBA alpha and right just uses RGB. How do I get to the final output based on my current outputs? Not sure why the pink color occurs.
>>
>>62016488
What did Brendan Eich(faggot slayer) mean by this?
>>
>>62016527
>same software different name
Picking any one of them is losing.
>>
>>62016527
ReSharper and dotTrace
>>
>>62016527
Intellij idea is a /comfy/ java ide
>>
File: 35.jpg (25KB, 304x300px) Image search: [Google]
35.jpg
25KB, 304x300px
Where the fuck is line 35?
>>
>>62016570
>>62016580
Is CLion shit?
>>
>>62016627
I don't know, I find C IDEs to be awkward in general.
>>
>>62016537
looks to me like you got the color depth wrong or there's empty packing in your struct
print some lines of both as hex with printf
>>
File: 11228833.gif (323KB, 500x517px) Image search: [Google]
11228833.gif
323KB, 500x517px
>>62015577
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

/*
* Takes int target = value to look for
* returns -1 if not found, index if otherwise
*/
int
binary_search(vector<int>& rng, int target)
{
int probe;
int max = rng.size();
int min = 0;
bool probe_changed;
do {
probe_changed = false;
probe = (min + max) / 2;
if (rng.at(probe) == target) {
return probe;
} else if (rng.at(probe) > target) {
/*push back*/
max = probe;
probe_changed = true;
} else {
/*push forward*/
min = probe;
probe_changed = true;
}
} while (!(probe_changed));

return -1; // not found
}

int
main()
{
vector<int> v{ 12, 122, 123, /*127,*/ 223, 301, 442 };
sort(v.begin(), v.end());

cout << binary_search(v, 441) << endl;

return 0;
}
>>
File: nazrin_jerry.png (81KB, 369x338px) Image search: [Google]
nazrin_jerry.png
81KB, 369x338px
>>62016716
>int only
>>
>>62016755
>using templates
You are the reason why most o fthe sepples code is shit
>>
File: light_kek.png (160KB, 253x424px) Image search: [Google]
light_kek.png
160KB, 253x424px
>>62016778
>not using generics
>>
File: 6BYGcfx.jpg (36KB, 659x317px) Image search: [Google]
6BYGcfx.jpg
36KB, 659x317px
>>62016488
According to co-worker,

because `[null,null].toString()` evals to `","`


I don't know why he knew this (it's a Haskell place) and I'm not going to ask.

Anyway AFAIK you're supposed to use === precisely to stop such retarded conversions from occurring.
>>
>>62016716
that just checks the middle doesn't it? since changing the probe ends the loop immediately
>>
>>62016661
All input images are 8 bit per colour channel, so I went with 8 bit for output depth, thought that would be enough. Am using uint8_t for color values. Might have to read up on empty packing though, not sure if it occurs.
>>
>>62016820
What do you use Haskell for?
>>
>>62015577
We are making a web browser! >>62016683

Also we've been on HN https://news.ycombinator.com/item?id=15000253
>>
>>62016871
Whatever the clients need, we're contractors
>>
>>62016889
Can you give some examples? I'm curious what clients would actually request to be done in Haskell specifically.
>>
>>62016796
>tfw no typesafe * based generics
>>
>>62016883
How can I join?
>>
File: wut.webm (3MB, 1280x720px) Image search: [Google]
wut.webm
3MB, 1280x720px
>>62016820
>because `[null,null].toString()` evals to `","`
Yeah, that makes so much more sense.
>>
>>62016883
Why try to reuse links2 code when you could just fork surf. It's like 3k lines of C or something.
>>
>>62016909
Join the IRC on Rizon: #/g/netrunner

>>62016918
Read HN, is from scratch
>>
File: arisa moves.gif (1MB, 500x280px) Image search: [Google]
arisa moves.gif
1MB, 500x280px
Is Scheme used for anything other than reading SICP?
>>
>>62016527
Resharper.

Rider if you're not on Windows.
>>
>>62016883
>Written in C++
DROPPED
>>
>>62016582
ultimate trollan
>>
>>62016105
What kind of extra shitcode is this?
>>
>>62016951
It's used as scripting language in many places. Guile is GNU's official scripting language and GDB uses it for scripting, there's also package manager written in it.
Other bigger software also use scheme for scripting for example GIMP and the guys who created s7 scheme.
John Carmack is also pushing scheme for scripting language for VR stuff.
>>
>>62016905
AFAIK most clients don't request anything in Haskell specifically. They request a product and we deliver it (in Haskell). From what I know from the boss, this usually results in "hey how did you do that, can you teach us this Haskell stuff?" later on.

There are some clients that do request specific Haskell work though but those usually have existing codebase they need help with.

As far as I know, it's pretty much never the case of "we want X and we want it in Haskell!".

Not really sure how much I could say about _what_ the projects actually are here though.

>>62016911
presumably that converts a list of ``strings'' into a comma-separated string and null evaluates to empty string, so you end up with just the ","
>>
File: yeeeh.jpg (24KB, 449x287px) Image search: [Google]
yeeeh.jpg
24KB, 449x287px
>>62016582
Some times you need to... read between the lines
>>
>>62016094
C
>>
File: 14453526565790.jpg (7KB, 250x241px) Image search: [Google]
14453526565790.jpg
7KB, 250x241px
>>62016996
>>
File: drinking rum, whiskey.gif (1MB, 217x217px) Image search: [Google]
drinking rum, whiskey.gif
1MB, 217x217px
>>62016996
>>62016582
>>
>>62016951
>Is Scheme used for anything other than reading SICP?
reading the little schemer
>>
File: 1501758673358.jpg (166KB, 711x610px) Image search: [Google]
1501758673358.jpg
166KB, 711x610px
I'm this guy >>62015169
I've tried this recipe:

> http://code.activestate.com/recipes/82965-threads-tkinter-and-asynchronous-io/

But my download button still freezes. The problem is that a method I call to crawl links need about a minute or two to finish, and the app becomes unresponsive (in this recipe, I've just put sleep(120) to simulate that).

I think I need multiprocessing rather than threading.
>>
>>62017188
No you need threading. tkinter being single threaded is not a problem. Your application blocking the thread it's running it (by waiting for download) is a problem. You want something like:

* Press download
* Set some "in progress" image, start progress bar, whatever
* Fork thread that performs the download. Maybe this thread will talk back to interface and update progress bar sometimes. Or make it display part of an image that it has downloaded so far.
* Once download completes, thread terminates and you can display your full image.
>>
>>62016537
You probably got the channel ordering wrong.
32 bit 'RGBA' comes in at least 4 flavors: RGBA, ARGB, BGRA, ABGR depending on byte order.
>>
File: 1465915251830.png (183KB, 386x406px) Image search: [Google]
1465915251830.png
183KB, 386x406px
wtf? copyFrom is a void function, it doesn't even return anything. How does it make sense?
#include <iostream>

class DateClass // members are private by default
{
int m_month; // private by default, can only be accessed by other members
int m_day; // private by default, can only be accessed by other members
int m_year; // private by default, can only be accessed by other members

public:
void setDate(int month, int day, int year)
{
m_month = month;
m_day = day;
m_year = year;
}

void print()
{
std::cout << m_month << "/" << m_day << "/" << m_year;
}

// Note the addition of this function
void copyFrom(const DateClass &d)
{
// Note that we can access the private members of d directly
m_month = d.m_month;
m_day = d.m_day;
m_year = d.m_year;
}
};

int main()
{
DateClass date;
date.setDate(10, 14, 2020); // okay, because setDate() is public

DateClass copy;
copy.copyFrom(date); // okay, because copyFrom() is public
copy.print();

return 0;
}
>>
>>62017188
>>62017258
I looked at the code in your link. It should work just fine. Next step is for you to post your own code with steps to replicate so we can have a look at what's going wrong. Remove everything that's not strictly necessary for you it to demonstrate the issue: we don't need your crawler or anything.
>>
>>62017286
why would it need to return anything?
>>
>>62017286
What are you asking exactly? You're not using copyFrom's return value to anything, so why do you care it's void?
>>
>>62017286
oh i get it
>>
>>62017286
It mutates the object state: it just copies the attributes of the object you're passing to it. Welcome to imperative programming I guess.
>>
>>62016951
It's used for HTDP too.
>>
>>62017333
>Welcome to imperative programming
gross desu

nice digits
>>
>>62017258
>>62017314
Oh boy, I deleted all changes because I thought the solution does not work. I'm going to try again.

captcha: select all images of fork
>>
File: 1456205750415.jpg (84KB, 1000x928px) Image search: [Google]
1456205750415.jpg
84KB, 1000x928px
The power of microcucks
https://web.archive.org/web/20170818080940/http://cc.bingj.com/cache.aspx?d=1462716999241&mkt=de-DE&setlang=en-US&w=xEsMxqoa0KJSwMsTh3p_8w2qryykfDvB
>>
File: fx.jpg (22KB, 553x110px) Image search: [Google]
fx.jpg
22KB, 553x110px
>f(x) function
>no x in the function
???
>>
why don't more languages support tail-calls and arbitrary stack sizes?
>>
>>62017415
>arbitrary stack sizes?
You don't see how this could go wrong?

Tail calls is a no-brainer though.
>>
>>62017407
maybe it's a constant function

:
^
)
>>
>>62017407
It's a constant function.
>>
>>62017415
It's not waiting for a switch to magically solve world hunger and optimize all tail calls.
>>
>>62017431
>You don't see how this could go wrong?
what? pajeets deciding exponential time solutions are good ideas?
>>
>>62017446
Stack classically grows downwards
stack smashing the heap
>>
>>62015621
klib.

>>62015693
With prices like that, this chick's probably covered head to toe in STDs.

>>62016951
Well, TinyScheme is used as an embedded scripting language in GIMP... and a lot of adware.
>>
>>62017435
>>62017437
What does that even mean?
Constant functions still have x variable. That expression is just a point, a single value
>>
>>62017442
how hard could it possibly be for a language to see that a statement that says
return func()

should just drop everything in the current stack frame since it's no longer relevant

it'n nowhere near the complexity of solving world hunger
>>
>>62017467
I'm afraid you might be retarded.
>>
File: horizontal_line1600.png (526B, 1600x1600px) Image search: [Google]
horizontal_line1600.png
526B, 1600x1600px
>>62017467
f(x) = 1 for all x.
>>
>>62017478
That's not a horizontal line, that's a vertical line
>>
>>62017467
>Constant functions still have x variable.
your thinking of functions with a constant derivitive

a constant function is a horizontal line (aka changing X doesn't change Y)

that said >>62017407
looks like it might need an X as a factor in e's exponent
mite b wrong tho
>>
>>62017489
https://www.desmos.com/calculator/xjuz9gnwg4
>>
>>62017505
that's a y = 0.45 line, dumb niggy
>>
>>62017516
I meant y = 1
>>
>>62017493
>>62017407
>>62017467
https://www.desmos.com/calculator/nbbue4ejg1
see, this is what I think they meant
>>
>>62017377
>>62017314
Me again. Thanks anon, but I realized I'm too stupid to implement this without freezing my whole app, and IDE. I'm learning programming for six months, so this is too big of a bite for me without having someone to hold my hand through the whole process. Gonna google more.
>>
>>62017407
>different values of x returning the same value
It's not a function
>>
>>62017516
>>62017522
you might be retarded
>>
>>62017415
Why don't you just use a loop and stop being a faggot?
>>
>>62017549
Go back to middle school
>>
>>62017550
no u
>>
>>62017476
There is clearly a typo there. Value is supposed to increase by 28% not stay constant
>>
File: 58b.png (175KB, 600x600px) Image search: [Google]
58b.png
175KB, 600x600px
I'm not like racist or anything, buy I have a racist question: why do pajeets that create online courses/tutorials almost never give a single fuck about aesthetics? (i.e. any consistency in the code style, non-retarded whitespace, grammar, the list can go on)
>>
>>62017596
To get some views from fellow pajeets and earn money
>>
>>62017458
Or you can say the heap grows upward, smashing the stack eventually.
It's just a matter of proportion.
Although with 64 bits you have practically infinite address space, so this is never a problem.
>>
>>62017591
that may be so, but constant functions do not have x variables
>>
>>62017596
>I'm not like racist or anything
This is the most normalfag post I've seen in a while
>>
>>62017530
Yeah, that's right. Thanks.
Book's sample run says that 20th day is 138 and that fits your function
>>
>>62017596
>I'm not like racist or anything,
d r o p p e d
>>
>>62017620
I know, I know. I guess that can be substituted with "serious responses only, no memes pls".
>>
>>62017618
y(x)= x/x
>>
File: woah.jpg (37KB, 600x600px) Image search: [Google]
woah.jpg
37KB, 600x600px
>>62017458
>stack smashing the heap
>>
>>62017641
what does that supposed to mean?
>>
>>62017641
that just simplifies to y(x)=1
no x on the right side
>>
>>62017596
Fuck off, we don't want your dirty non-racist kind here
>>
>>62017665
>0/0 = 1
ok buddy
>>
>>62017675
BUUUUUUUUUUUUUURN
>>
>>62017675
>
>>
I'm making a program that's gonna have basic painting capabilities, like the old MS Paint. The working "picture" will never be more than 800x800 "pixels" wide. How fast, or efficient should the algorithms for drawing lines, ellipses and the bucket fill be considering todays processing power? I want to add those features as quickly as possible.
>>
>>62017659
constant, noncontinuous function, undefined at x = 0
>>
>>62017665
>>62017675
btfo
>>
>>62017704
You'd have already added them if you hadn't wasted time on 4chan. As long as you don't do anything incredibly retarded, the efficiency of your algorithms doesn't matter at all. In this case, that is.
>>
>>62017750
Ok.
>>
>>62017779
You can represent your image as an array, and paint on it that way. The ellipses and lines are going to be very fast, no problem at all. The bucket fill takes the longest, but it should be very fast as well, since you can do it in linear time.
>>
>>62017704
Some rough napkin calculations:
Modern cpus can do about 100 billion instructions per second.
800x600 32 bit image is 2 million bytes.
100 billion / 2 million / 60 gives you a playroom of over 800 instructions per byte at 60Hz, so as long as you can compute one rgb channel in less than 800 instructions, you're fine.
>>
>>62017548
>a function is only a function if it's injective
>>
>>62017879
>implying people are using """Modern CPU"""
dumb webdev poster
>>
>>62015693
what the fuck lolis are for cutes not for lewds ;_;
>>
>>62017933
It's cute if she doesn't know what she's doing. You know, if she's unconscious.
>>
>>62017974
but you're lewding her ;_;
>>
>>62017919
That's what the question was concerning you retard.
>>
>>62015693
Version without watermarks?
>>
>>62017933
Never heard of cutelewd? It's the best.
>>
>>62017986
kys degenerate faggot
>>
File: 1445682062741.png (1MB, 1024x1387px) Image search: [Google]
1445682062741.png
1MB, 1024x1387px
>>62018001
Half a minute on Google
>>
File: 1498425422545.jpg (129KB, 689x1104px) Image search: [Google]
1498425422545.jpg
129KB, 689x1104px
>>62018009
this
>>
File: not the police.png (1MB, 653x1433px) Image search: [Google]
not the police.png
1MB, 653x1433px
what's going on in this thr-
>>
File: 1473954404607.jpg (40KB, 426x960px) Image search: [Google]
1473954404607.jpg
40KB, 426x960px
>>62018073
>>
File: 64470338_p0.png (690KB, 1000x1411px) Image search: [Google]
64470338_p0.png
690KB, 1000x1411px
>>62018059
my soulmate...

>tfw waiting for Jenkins
>>
>>62018009
Excellent taste!
>>
>>62015577
I'm just about to get an interview for a backend development position
Any suggestions/tips/comments?
>>
>>62018182
You should go in like you already work in there. Be confident and act like you belong. When you meet the interviewer, you need to shout "what the fuck are you doing in my office", "I'm calling security" etc. Just common sense stuff, really.
>>
>>62016038
you don't go outside your basement much, don't you anon?
>>
>>62018182
make sure you know how to solve 25 horse question
>>
File: 15_f.png (523KB, 799x599px) Image search: [Google]
15_f.png
523KB, 799x599px
Implementing DOF in my c++ raytracer
Never try to make a renderer folks it will get very addictive very fast
>>
anyone know the cause of this error:
ld: -f may not be used without -shared


im running:
ld -g -m elf_i386 -lssp -T ../krnl1m.ld -nostdlib -fno-stack-protector  -okrnl.x kstart.o main.o video.o debug.o kbd.o sched.o tasks.o ../lib/libc.a
>>
why js is not oop?
>>
>>62018582
It sounds like -f can't be used without -shared
>>
>>62018591
Some idiot thought the delegation pattern was better and the entire web is now fucked because of it
>>
In my C book there are 3 graphical sub chapters labeled "(optional)". Are they worth going trough or spending hours doing exercises in them?

Is C graphics even relevant today?
>>
>>62018617
Train your abstract logic on different levels lazy fatass
>>
>>62018595
when i run:
ld -g -m elf_i386 --lssp -T ../krnl1m.ld -nostdlib -no-stack-protector  -okrnl.x kstart.o main.o video.o debug.o kbd.o sched.o tasks.o ../lib/libc.a


i get:
ld: cannot find -lssp
, which I don't know the location of, or where i should get it.

but when i run without it i get:
ld -g -m elf_i386 -T ../krnl1m.ld -nostdlib -no-stack-protector  -okrnl.x kstart.o main.o video.o debug.o kbd.o sched.o tasks.o ../lib/libc.a
main.o: In function `fault':
main.c:105: undefined reference to `__stack_chk_fail_local'
sched.o: In function `init_tasks':
undefined reference to `__stack_chk_fail_local'
../lib/libc.a(doprintf.o): In function `do_printf':

undefined reference to `__stack_chk_fail_local'
ld: krnl.x: hidden symbol `__stack_chk_fail_local' isn't defined


which is supposed to be mitigated by the -lssb, from what the googles told me.
>>
LTO is shit. Is it common to include files containing implementations, and compile an entire project as a single compilation unit?
>>
>>62018595
oh, and adding the
-shared
gives me the same error.
>>
>class hierarchy made in Java
Ok this kind of make sense
>class hiearchy made in sepples
Holy shit why would you inherit this and have reference to that here
Why do sepplesfags say that only reason to use sepples over C is the OOP but then they can't even use it right.
>>
>>62018684
OOP is the worst reason to use sepples, use RAII + templates + STL.
>>
>>62018694
>templates
kys
>>
>>62018701
I hope you love void*.
>>
>>62018701
will C++ ever add real generics?
>>
>>62018665
in certain industries it is. check out the unity build. its an alternative to pre-compiled headers, and doesn't need specific compiler support to use. but its used to speed up incremental compilation. not really related to LTO, PGO or other types of LTCG
>>
>>62018710
If you beg the committee hard enough.
>>
>>62018665
>>62018712
I should probably have said "single compilation unit" because all the Unity (tm) shit has washed out "unity build" as a searchable term. but its informally used to referred to single compilation unit.
>>
reminder that qt and web apps are the only good options for cross platform applications that span windows, macos, linux, android and ios with single source cross compatibility and a consistent/familiar look
>>
>>62018712
>>62018740
Perfect, I was just checking to make sure I wasn't being retarded.
>>
>>62018701
>compilation of functions with abstract data types while keeping the speed of normal data types is somehow bad
>>
>>62018777
m-muh code bloat
>>
>>62018789
[citation needed]
>>
>>62018816
Templates do bloat code size, that's the point.
The excessive indirection of void pointer+function pointer based generics often have more of a hit though.
>>
>no idea what to study
>decides to take Computer/Software Engineering
Did I fuck up or is this a solid but a demanding choice?
>>
>>62016972
makes a loop if statement not activate 1% of the time
>>
>>62016080
cite THIS *untips katana
>>
damn, I can't believe this shit is still alive. is there anyone here who was here two years ago? five?
>>
>>62018918
hehe benis in bagina
>>
>>62018918
>>no idea what to study
That means you have absolutely no reason to be in university and are burning money. Think about it like this, do you go to the grocery store everyday and just peruse, or do you go there when you know you need something?

This is the problem with the modern era, they push their younglins, or the youngins push themselves, to go to these overpriced funhouses for no reason other than the erroneous notion that "i-if you have t-the paper then you have the keys to life", despite said youngin having no real passion or reason to be there in the first place. And don't tell me you actually do have a passion, because if you did, then you'd be pursuing it, and this post would not exist.

With that being said, CS is becoming increasingly obsolete as the "entrepreneurs" make more and more useless "apps" that hemorrhage money, codemonkeys sell themselves shorter and shorter, wizards make simpler and simpler frameworks for even the most inept of people to follow, and employers find cheaper and cheaper to enact said frameworks. Switch to something medical or biochemically related, at least you'll be a little valuable.
>>
>>62018918
do you like difficult video games that punish you for 50 hours before you can do any of it correctly?
programming is like the big boy version of that.
EE is probably the biggest boy though.
>>
>>62017548
u dumb?
that's not how it works
it's not a function if a single value of X can have more than one value
if two different values of X have the same value it can still be a function
>>
>>62019092
actually the biggest boy is like
software project management
it's pretty hard to do that well
i guess sometimes it doesn't matter though so people get away with doing it poorly
if there is a ship deadline that absolutely must be hit then it can be pretty difficult to do while still keeping your team happy
>>
>>62019075
i think i was here 2 years ago
>>
What's the deal with perl6?

looks fun
>>
>>62019145
>perl
>fun
Larry pls...
>>
>>62018918
>Computer/Software Engineering
Aren't they supposed to be different things?
>>
>>62015577
I'm making a videogame that plays itself but you can interject commands into with an in game scripting engine. like a text adventure game with graphics.

you can try to steal but only a genius like me could pull it off. in fact i recommend you don't steal and embarrass yourself.
>>
Beginner here, how demanding is programming outside of stuff like Visual Studio? No idea what kind of laptop to get for Uni, and the Thinkpad general isn't really helpful when it comes to specs for programming.
>>
File: goth.jpg (16KB, 577x47px) Image search: [Google]
goth.jpg
16KB, 577x47px
>>62017407
I think this book it trolling me
>>
>>62019200
if you're just starting school then any 'good' standard laptop should be fine.

look specifically for 1920x1080 screen and anything with more ram than the other options in your price range. having an SSD is also really nice since compiling writes a lot of temp files.
>>
>>62019216
6000 years on wikipedia:

"Gotham" as a term for New York City was coined by Washington Irving in an 1807 November issue of his literary magazine, Salmagundi, based on the legends of the English village of Gotham, whose inhabitants are known for their folly.[4]
>>
>>62019200
PCs 30 years ago were already fast enough for programming. All you need is a text editor.
>>
>>62019200
Depends on what language you're using. Generally speaking, though, I'll say that using visual studio for anything is a bloated and time-wasting experience. In fact, using Windows for programming (for anything out of C# or Java) is a hassled experience. With macOS or linux, programming most languages is as simple as downloading the compiler using a single-line command, and downloading vim or emacs. Hell, you can even use Atom if you want VS-like functionality with (slightly) less bloat.

And if you were wondering, it is possible to get macOS on most intel laptops.
>>
>>62019200
lots of ram, like a fuckload

everything else is up to what you'll be making
suprise suprise, if your not working with sound stuff, you don't need a sound card!
not multithreading? single core is fine!
not working with graphics? no gpu required!
I worked on a single core 1.8 Ghz/ 2GB ram/ integrated graphics laptop for a long while

only thing that gave me trouble was the RAM
>>
Does Rust have objects?
>>
>>62019243
>>62019259
>>62019269
>>62019273

I'll look for something with a good screen, at least 8GB RAM and an SSD then, I hope an i3 is fine so my budget doesn't explode. Our classes will be with Win10 so gonna start with that, I'll look into Linux and such later on. Thanks for all the help.
>>
>>62019075
I was here 5 years ago; only opening threads for a couple of days though after 2+ years break
>>
>>62019320
no need, you can run linux in a VM for all your programming needs. i recommend some lightweight distro
>>
Question for all wage cucks. I got a pretty good offer at a consultancy company. What is your opinion on working for a consultancy company? From my perspective, I get located at a company, work my magic and move on to the next company.
>>
>>62019320
spare the SSD if your on a budget, 16GB of high-quality ram is a better investment imo
>>
>>62019292
Yes and no
>>
looking to learn programing should i learn c or c++
>>
>>62019392
both nigger
which one you learn first is up to you I guess tho
>>
>>62019392
c
>>
>>62019392
d
>>
>>62019402
good thanks i was going to start with c for low level work as i have dabbled with assembly as part of school.
>>
>>62019379
Can't find any laptops with 16GB RAM that wouldn't cost a kidney. Everything's expensive in northern Europe. Cheapest I can find is 12GB for 560 euros but the screen is garbage.
>>
>>62019425
>Europe
wew
>>
>>62019424
C++ is a nightmare language, absolutely terrible for beginners. Usually C++ classes just teach a bad combination of C and C++, so you might as well try to just learn proper C. It will be good for low level stuff and assembly knowledge is helpful
>>
>>62019448
good i want to write some homebrew for some hacked game consoles in the future like the 3ds. just some small quality of life shit.
>>
>>62019392
b
>>
>>62019378
I work for consultancy. It's pretty cool because you get to work on different projects throughout the years rather than being stuck on something you might hate. Expect to be paid a fifth or less what the client is actually being charged for your time, that bit kind of sucks (but understandable why it happens).

Depending on nature of work, you may be working with people from all over the world across timezones. This kind of sucks. Just now I got meetings slotted in for tomorrow by 2 Americans, one at 8am and another at 6pm my time. If you won't be working remotely but mostly on-site then I can't comment as I don't have experience there. That sounds cool though, you get to travel. Unless you have a family then not so cool I guess.
>>
why isn't csi properly loading my scm file?
it loads most things, but any definition that uses other functions defined in the file doesn't load
>>
>>62019075
>is there anyone here who was here two years ago? five?
been here on and off since 2014
>>
Need embeddable language to prototype my C engine.
Thinking about Common Lisp but it's 2017, is there anything better?
>>
>>62019574
a scheme, like chibi scheme
or lua..
>>
>>62019468
That's always C or C-like C++. You wouldn't be using much STL in those projects for example.
>>
>>62019597
>lua
not language
>scheme
not properly standardized
>>
>>62019608
>not properly standardized
u wot m8
>>
>>62019508
The fact that you work on different projects for different clients does sound interesting. I'll be mostly working on-site in a team if I have to believe the job description.
How long do you work on each project?
>>
>>62019617
the base language such and no implementation implements all of the srfi
>>
>>62018918
dont do it. i did well in maths but had no idea what to do. had the atar score for software engineering so i chose that because the world of IT allow people to start again from scratch. my brain and programming dont go together. this field isnt for those who arent enthusiastic for it. The best coders out there do this shit for fun because they enjoy the challenge. i treated the course like it didnt require thousands of hours of self driven work & i suffered for it later on in the course because my foundation had holes in it. Unless you already knew that this is what you wanted years before you chose it... dont choose it
>>
>>62019618
We're usually in pretty long term contracts. My last project I've been on for 2 years and the one I'm on now I've been on for ~4 months? However there are many other projects in company which are not that long, i.e. have 3 months total deadlines.

Admittedly I think that perhaps we're somewhat unusual in that aspect but my sample size is just myself. I suspect if your consultancy specialises in something then you will do a lot more of the "hop in team, work couple of weeks to fix their problems, hop on another team" that you mention. Sorry that I can't be of more help.
>>
File: 1437671076472.jpg (72KB, 712x715px) Image search: [Google]
1437671076472.jpg
72KB, 712x715px
At what point should someone learn C++ if at all?
>>
Alright, help me make some design decisions /g/.

I'm working on a game engine and a game. I want the game engine to be self-contained, so that I can re-use it for another game later. So the engine has to provide an api that the game can use, and the engine has to have zero dependencies on the game. What's the best way to structure my projects?

Compile the engine to a DLL that the game consumes? Or keep the engine stuff in a separate folder (and git repo) and just compile/link it in as usual? Chances are my game would depend on a specific version of the engine, so I think it'd be best to bundle the engine into the game repo somehow. With a DLL I could just copy in a DLL of the right version, so maybe that's better?

C++ btw.
>>
>>62019710
After already being familiar with C and Java.
>>
>>62019710
early on, just after C
ignore >>62019710
java was built to be like C++, not the other way around learning C++ before Java makes sense
>>
>>62019634
srfi aren't part of the standard. its a "request" for implementation, literally in the name. which eventually become part of the next standard
and chibi scheme is fully r7rs (small) compliant, along with r6rs (small) and r5rs (full) for older versions.

which srfis do you need?

(insert rant about CL)
why do you need the "big" language if you're embedding it? also, have you ever tried to embed something like SBCL or any other full Common Lisp, that supports CLOS and ASDF? it's not easy. the generally recommend route for embedding CL is to use ECL -- which is a tiny fraction of the language. like r7rs small.

so, with that logic you can't use common lisp there either.

also >lua is not a language
you're special kind of dumb if you actually believe that
>>
>>62019717
>I want the game engine to be self-contained, so that I can re-use it for another game later.
that's kinda the point of an engine, isn't it?
>>
>>62019766
>why do you need the "big" language if you're embedding it? also, have you ever tried to embed something like SBCL or any other full Common Lisp, that supports CLOS and ASDF? it's not easy. the generally recommend route for embedding CL is to use ECL -- which is a tiny fraction of the language. like r7rs small.
Why the fuck are you rambling if you have no idea what you are talking about?
I have experience with embedding ECL in to C and C++ programs. ECL implements pretty the full CL standard.
>>
>>62019777
It depends. Some are special purpose and built specifically for one game. You can cut a lot of corners doing this, if you allow for some coupling between game and engine code.
>>
>>62019774
not familiar with C#, but just looking at that it doesn't look like it works
>>
>>62019754
C++'s OOP implementation is shoddy and half-assed. Java gets that right at least. C++ has other strengths, but it's good to know what things are "supposed" to look like.
>>
>>62019816

Yeah, I messed it up copying, give me a sec
>>
>>62019683
Thanks for answering senpai.
The company specialises in Java stuff. I guess I'll just have to find out during the interview.
>>
>>62017464
>and a lot of adware

Source?
>>
>>62019819
java is a mess
nothing is "supposed" to look the way your average java codebase ends up looking

learning java first puts things in your hand without knowing why they were put there
the amount of unneeded code Java programmers write, especially beginner ones, is sickening desu senpai
>>
>>62019826

Alright

class Program
{
static void Main()
{
int number;
for (number = 1; number <= 100; number++)
{
if (number % 3 == 0 && number % 5 == 0)
{
Console.WriteLine("BuzzFizz");
}
else if (number % 5 == 0)
{
Console.WriteLine("Buzz");
}
else if (number % 3 == 0)
{
Console.WriteLine("Fizz");
}
else
{
Console.WriteLine(number);
}
}
}
}


So this code is not the best but my knowledge of C# is VERY limited. What do I learn now to improve it? I don't want a solution because everybody here is better than me at coding but I want to learn so just give me some terms/commands to read about.
>>
>>62019873
get rid of the unnecessary braces
>>
Trying to wrap my head around vibe.d and dlang, learning new language / framework.
Making encrypted file storage thinggy with a friend of mine, gonna start tomorrow. Already set up the development environment on my server.
>>
>>62016911
lol @ webm
>>
>>62019881
>unnecessary
Wrong.
>>
>>62019873
>
int number;

uneeded, declare it as part of the for loop

also
>BuzzFizz
fizzbuzz doofus
>>
>>62019881

Ok, so almost everybody here is better than me at coding
>>
>>62019832
Good luck. Out of interest, what are they offering you money wise and what's your experience like? Or are you only going to find out after interview? I have no idea how much Java consultancy could offer.
>>
>>62019903

I'm not even familiar with this game, I'm not a native speaker of English. To me it's a coding exercise, not a children's game.
>>
Are you guys using else's often? like when i'm returning some value from function and doing if's for this, i never do else. Just if(return) or return
>>
>>62019934
Between 40k/60k in euro. I've been an Android developer for 5 years and have no experience in backend stuff (what I'm applying for).
>>
I work as a software engineer doing dull business integration software. I never have any desire to do anything like programming at home. I've been working software engineer for over 2 years now (recently into my second job) and in that time I've basically done fuck all related in my own time. Its really the last thing I want to do after doing it all day. Wish I could be motivated to work on some cool shit.
>>
>>62019091
My tutition is like $100 every 6 months...
>>
>>62019989
OK. For reference I was given 50k USD starting right out of university (42k euro today); minor professional experience before then and few years of activity in community. Makes me feel better that others aren't getting 100k starting offers, thanks. Good luck again; maybe we'll cross paths one day though I doubt it (unless you ever have to deal with Haskell's inline-java!)
>>
>>62020009
why would you do anything except make games?

computers are just toys.
>>
>>62020009
I feel you. I used to be productive as fuck but for past 2+ years of full-time software engineering, I rarely want to sit after work and do more shit. Much rather read relevant books or whatever or just dick around. Though I'm hoping to get back into free-time coding of cool shit sooner than later... It's not too bad as long as you have other hobbies and not just jerking off from 5pm until bed time though.
>>
>>62016951

Scheme has almost no syntax. This is great for learning.

If you want to go into production use CommonLISP, Racket or Clojure, which have a big ecosystem and power libraries.

But it's still a good idea to learn Scheme first, so you can get the pure LISP1 greatness and fuck around with Macros before dwelling into sad reality, where writing your own compiler is not such a reasonable idea..

And I can only repeat:
Even if you never touch a LISP again, it will make you a better coder overall. Learning something like Haskell will be easier and even using something like Python will benefit from studying LISP.
>>
New thread:

>>62020058
>>62020058
>>62020058
>>
So I'm interested in studying operating system design, with the intention of creating a toy OS that I can boot on bare metal. I have a couple of recommendation requests:

1) The book. Should I start with the MINIX book, or Lion's UNIX, or something else?

2) The hardware. I want something completely open and free - I'm not touching x86 with a bargepole. Is RISC-V a good idea? Can you get hobbyist boards with RISC-V processors? I haven't really looked into that yet.
>>
>>62019092
Yes
>>62019179
Here it's the same thing. I'm obviously talking about the software aspect
>>62019669
But I've always wanted to code. I just never really had the money to buy more than a basic C++ book untill now.
>>
>>62019873
Needs more LINQ.
>>
>>62019292
If you mean OOP then no
Thread posts: 317
Thread images: 39


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.