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


Thread archived.
You cannot reply anymore.



File: 69831040_p0.png (591 KB, 1088x978)
591 KB
591 KB PNG
Old thread: >>70954990

What are you working on, /g/?
>>
>>70963358
What are YOU working on, OP? Nothing I assume
Bring back /prog/
>>
File: 1557279904231.jpg (217 KB, 900x882)
217 KB
217 KB JPG
>>70963363
I'm working on my wayland compositor. I'm specifically doing a fuckload of refactoring to get wp_linux_explicit_synchronization working.
I wouldn't normally talk about it unless I had something new to say, but you asked.
>>
>>70963378
o-ok
im not working on anything, as usual, except looking for a job
keep up the good work and cute images
>>
File: 1550148930246.jpg (16 KB, 240x334)
16 KB
16 KB JPG
What are the most important data structures to know very very good?

>inb4 all of them

There is like 5000 bazillion binary tree kinds you have AVL Red/Black Heaps and other shit which one is the most used in the "real world"?
>>
Got my programming socks on. Now it's time to write JavaScript!
>>
>>70963406
so long as you know at least one binary search tree, heap, etc
>>
>>70963358
>What are you working on, /g/?

I'm making a video game!
>>
>>70963406
list is the most important by far.
>>
>>70963434
lists are wack
>>
>>70963434
list[], dictionary{}, tuple(), set Set()
>>
>>70963406
Linked list
Priority queue
Double ended queue (dequeue)
Heap (goes hand-in-hand with priority queue)
Binary search tree
Trie (Not even that important, it's just my favourite data structure)
Hashmap
>>
I need to learn C++ for Uni. I only have experience with C#, Python and some Java. I run Linux btw.

What would you recccomend for an IDE?

Also, can someone post that image of /g/'s programming challenges? It was basically just a list of simple challenges to get started in any language.
>>
>>70963455
>dictionary{}, tuple(), set Set()
all implementable with list/pair.
>>
File: 999999999.png (319 B, 124x91)
319 B
319 B PNG
what's the benefit of using/having types?
>>
>>70963472
>What would you recccomend for an IDE?
a text editor
>>
>>70963478
Better performance.
Interfaces which are harder to misuse.
Maintainability.
>>
File: 1504991125537.png (1.15 MB, 900x900)
1.15 MB
1.15 MB PNG
>>70963478
To abstract bits into logical units.
>>
>>70963478
lowers likelyhood of errors
allows for more readable and explicit code
>>
File: lispbest.jpg (253 KB, 840x412)
253 KB
253 KB JPG
>>70963492
>>
>>70963492
>Better performance.
Eh nu-javascript is faster than most non low-level languages
>>
>>70963358
I got a "DevOps" graduate job after finishing my cs degree, and basically I have no responsibility and do no development.

I've fucked up big time I think. Never work for a BigCorp.
>>
>>70963531
Is this true?
>>
>>70963542
>I have no responsibility and do no development.
so what do you do all day? do you need to show up?
>>
>>70963528
Lisps are an aberration. In my opinion they're the best form a dynamic language can take.
>>
>>70963554
not at all
>>
>>70963472
I used a text editor until my makefile got too confusing.

Then I used CLion. See what works for you is the only real answer.
>>
>>70963554
Yes, JS is the fastest general purpose scripting language.
>>
>>70963557
Right now I'm waiting for someone to give me a set of certificates. I turn up out of fear / guilt / obligation. I would even go back to my webshit job with my tyrant boss.

good luck everybody
>>
>>70963358
Im refactoring backend for work, whatever idiot made this snit should be shot. Server started going out of memory few days ago.Old shit was O(N^3) with at least N db queries. After i managed to figure out what for fuck sake was going on i managed to reduce complexity to O(N*log(N)) and 2 db queries. And no more memory problems and its much faster now... fuck web developers
>>
>>70963585
OK so not "non low-level" languages then you fucking spaghetti
>>
>>70963600
>Old shit was O(N^3) with at least N db queries.
> i managed to reduce complexity to O(N*log(N)) and 2 db queries

you managed to reduce 100 queries to 2 queries how?
>>
>>70963613
If its anything like my webshit job its probably replacing a foreach -> query to a query with some kind of aggregate function.

I'm guilty of writing shitty php but in my defense my boss was always on my ass.
>>
File: 1546814469733.jpg (53 KB, 640x550)
53 KB
53 KB JPG
I am making a program which is supposed to store an array in SQLite in C.
I heard that storing as BLOB would work fine, considering how pointers work in C

This is the code for storing

rc = sqlite3_bind_blob(stmt, index, obj->array, sizeof(obj->array), NULL); //index is the position of the parameter in the SQL statement

If you ignore the opening, preparing and stepping of sqlite...please note that it works fine binding variables like integers and chars and is displayed in the table when using
echo .schema | sqlite3 table.db

However, the column that is supposed to store the array is just displayed as 0
When I try to retrieve it using this code....

if (sqlite3_step(stmt) == SQLITE_ROW)
unsigned int *array_new= (unsigned int*)sqlite3_column_blob(stmt, index); //index is the position of the column of the table

...and tries to iterate through it and print its length(sizeof(array_new)/sizeof(array_new[0])) it prints nothing and just says the length is 2.

what am I doing wrong? Everything else works fine
>>
>>70963635
fucked up the code at the end lmao
>>
File: dumass.png (56 KB, 794x458)
56 KB
56 KB PNG
>>70963642
smfh famalam
>>
>>70963642
How long have you been working on this blob query? Post the statement and everything.
>>
I am making a program which is supposed to store an array in SQLite in C.
I heard that storing as BLOB would work fine, considering how pointers work in C

This is the code for storing

rc = sqlite3_bind_blob(
stmt, index, obj->array, sizeof(obj->array), NULL
); //index is the position of the parameter in the SQL statement


If you ignore the opening, preparing and stepping of sqlite...please note that it works fine binding variables like integers and chars and is displayed in the table when using
 echo .schema | sqlite3 table.db 


However, the column that is supposed to store the array is just displayed as 0
When I try to retrieve it using this code....
if (sqlite3_step(stmt) == SQLITE_ROW)
//index is the position of the column of the table
unsigned int *array_new = (unsigned int*)\
sqlite3_column_blob(stmt, index);


...and tries to iterate through it and print its
 length(sizeof(array_new)/sizeof(array_new[0])) 
it prints nothing and just says the length is 2.

what am I doing wrong? Everything else works fine
>>
>>70963613
Not with me being smart but with old developer being retarded.. turns out data had to be collated from 4 tables and packed oddly.Why? No idea but our front end and other stuff require it. So all i did is write 2 big sql queries with bunch of joins etc... old developer knew only where clause and nothing else. Turns out 3 inner joins are much faster than triple nested for loop that does same shit and since i already had all data from 2 queries all i had to go is loop it once and a bit more...
>>
>>70963684
good for you but nobody really cares
>>
goodnight dpt i love you
>>
>>70963704
it's 1 PM here
>>
>>70963695
Eh i wanted to rant... and if it helps demonstrate web dev stupidity and keep few anons from making my mistake in going web dev im happy
>>
Trying not to have an aneurysm while reading threads about the new side channel attacks.
>>
>>70963704
/dpt/ loves you too
>>
I’m making an operating system
>>
>>70963714
i meant that if the end result is the same your boss is not going to notice but good for you pal
>>
>>70961436
The edges do have points defining them, but the visibility check I'm implementing has the ray only from the center of each element to the center of each other. Since the elements will be pretty tiny, that's an acceptable approximation to me.

>>70961878
>If you're feeling adventurous maybe create some sort of implicit shape from each connected set of edges. You see how the inner portion of the outer circle covers the entirety of the outer edges, maybe you could create an implicit shape that is that inner edge and goes off into infinity. It would isolate the inner portion entirely and you'd just have to check if you're inside or outside that implicit shape.
You are completely overestimating my ability to write code. I understand how that would work in mathematics, but translating that into coding would be way beyond my level, never mind my time to implement it. Very elegant solution, though.

>>70961899
I'll try that, thanks. I've seen some other resources on the matter (mostly application in games too), but they were poorly explained for the most part.
>>
>dropped out from computer engineering
>now can't prove that I can program in my resume because no degree
>>
>>70963732
Nice, you can clone this and save yourself the time of copying from osdevwiki https://github.com/rootcoma/narf
>>
>>70963750
do a project, put it on github or something
>>
>What are you working on?
A bash script that makes data hoarding easier.

I'm having some problems with it though.
http://dpaste.com/3YC7QAK

When I try to run it from the terminal, it doen't do anything.
>>
>>70963750
You will either find a way, or an excuse.
>>
>>70963710
I don't care what time it is, go to bed.
>>
>>70963585
>general purpose scripting language.
that doesn't make sense. and v8 is slower than both luajit and hotspot.
>>
>>70963772
>data hoarding easier.
?
>>
File: 1555786551660.jpg (820 KB, 1039x1329)
820 KB
820 KB JPG
>>70963750
"Serious" open-source contributions look very good on a CV.
I've been told by people at my last 2 jobs that my open-source shit is why I was hired.
>>
>>70963802
it wasn't because of the anime picture?
>>
File: wtf.png (22 KB, 1054x541)
22 KB
22 KB PNG
>>70963759
Nice memory management!
>>
>>70963814
wtf /dpt/ lied to me
>>
>>70963814
My github profile pic is literally a cute anime girl. It was back then, and still is now.

>>70963802
But I should also note that I do have a CS degree.
>>
>>70962907
That's because your program has no side effects. It all got optimized to a no-op.
>>
>>70963358
>>70963378
>>70963802
Good taste.
>>
>>70963796
It's supposed to download code repositories from git, subversion, mercurial addresses.
>>
>>70963772
    if [[ ! -z "$2" && ! -z "$3" && ! -z "$4" && ! -z "$5" && ! -z "$6" && ! -z "$7" ]]; then

if [ verify_add $1 $3 $6 $7 ]; then
if [ verify_backup $2 $6 ]; then
if [ verify_repository $3 $7 ]; then
if [ clone_repository $3 $7 $6 $2 ]; then
compress $4 $6+=$2 $5
fi
fi
fi



if (( $# > 7 )) && verify_add "$1" "$3" "$6" "$7" && ...
>>
>>70963802
Yeah, I've heard about them but find it very difficult to find something to do. Other than having something to show, it would probably be a good way to experience programming in the real world rather than just school stuff.
How did you find the things you could contribute to?
>>
Is there any good way to generate fresh Android project boilerplate shit without using the IDE?
>>
>>70963472
Qt Creator
>>
>>70963974
Not sure but the google results for searching for that are hilarious. I thought I remembered the google android docs having command like instructions.
>>
>>70963667
that is almost all there is to it.
>>70963682
Inserting
char *sql = "INSERT INTO Indexer (indexOne, indexTwo, id, idTwo, list) VALUES(?, ?, ?, ?, ?);";
rc = sqlite3_prepare_v2(db, sql, strlen(sql) + 1, &stmt, NULL);

rc = sqlite3_bind_int(stmt, 1, obj->indexOne);

//indexTwo, id, idTwo...

rc = sqlite3_bind_blob(stmt, 12, obj->list, sizeof(obj->list), NULL);



Selection
 char *sql = "SELECT indexOne, indexTwo, id, idTwo FROM Indexer WHERE id=(SELECT MAX(id) FROM Indexer);";
rc = sqlite3_prepare_v2(db, sql, -1, &stmt, NULL);

if (sqlite3_step(stmt) == SQLITE_ROW)
{
obj->index_one = sqlite3_column_int(stmt, 0);
obj->index_two = sqlite3_column_int(stmt, 1);
obj->id = sqlite3_column_int(stmt, 2);
obj->id_two=sqlite3_column_int(stmt, 3);
unsigned int *temp = (unsigned int*)sqlite3_column_blob(stmt, 11);
//memcpy(temp, obj->list, sizeof(temp));

printf("List: \n Length: %lu \n", sizeof(temp)/sizeof(temp[0]));
for(int i=0;i<sizeof(temp)/sizeof(temp[0]);i++)
{
if(temp[i]!=0)
printf("%d, ", temp[i]);
}


Not including opening, step, finalize and close
>>
>>70964034
                rc = sqlite3_bind_blob(stmt, 5, obj->list, sizeof(obj->list), NULL);

Oversight...there are 12 variables but it would be too much code so I just took the most important ones
>>
select FIELD.FIELDNUM, FIELD.TITLE, count(*)
as "NO. ACADEMICS INTERESTED"
from FIELD
inner join INTEREST
on FIELD.FIELDNUM = INTEREST.FIELDNUM
group by FIELD.FIELDNUM, FIELD.TITLE
order by FIELD.FIELDNUM ASC

anyone have any suggestions how I can apply a where to this to restrict the out put as where there is more then 10 academics interested?

Thanks
>>
File: 72491702_p0.jpg (1.45 MB, 2185x1553)
1.45 MB
1.45 MB JPG
>>70963948
It depends on what you're interested in, I guess.
The type of stuff I generally work on is something that I personally want or is solving an issue that affects me. You'd probably lose motivation if you aimlessly try to write some random program that you don't have a personal investment in.

I'm >>70963378, and I only really started working on a Wayland compositor because I personally wanted to use it, and the rest of the ones at the time were pretty shit. It looks more impressive to people since everything I did was specialised as fuck, so nobody outside of a very small group of people know what the hell I'm talking about, but a few thousand lines of code contributed somewhere would be all you need to show some general programming skill.
>>
>>70964034
Why are you inserting 5 values buy binding a blob to the 12th index?

>
char *sql = "INSERT INTO Indexer (indexOne, indexTwo, id, idTwo, list) VALUES(?, ?, ?, ?, ?);";
rc = sqlite3_prepare_v2(db, sql, strlen(sql) + 1, &stmt, NULL);

rc = sqlite3_bind_int(stmt, 1, obj->indexOne);

//indexTwo, id, idTwo...

rc = sqlite3_bind_blob(stmt, 12, obj->list, sizeof(obj->list), NULL);
>>
>>70964076
I'm not sure, but you could try this
FIELD.FIELDNUM = INTEREST.FIELDNUM
AND (SELECT (NO.ACADEMICS INTERESTED FROM FIELD FROM FIELD) > 10)
>>
>>70964133
see
>>70964057
There are 12 but if I posted them all it would reach the character limit. Besides it works just fine with those 5. The other 7 variables are kinda useless
>>
>>70964012
That's what it feels like at times, I don't like having to boot up Android studio to generate a project and then strip the bloat from it
>>
>>70964133
>sizeof(obj->list)
I am also fairly sure this will give you the size of a pointer.
>>
>>70964142
Messed up. Here:
AND (SELECT NO.ACADEMICS INTERESTED FROM FIELD) > 10
>>
>>70964156
We should be able to just compile for arm and run elf binaries. I hope GNU makes some progress with Replicant
>>
>>70964012
Also yeah, you could generate projects with the android tool in the past back when it used ANT, but they made no such tool for gradle. Fucking lunatics.
>>
>>70964158
ah that could be true. As the struct is passed by reference(if that's the correct term) as in function(&obj);
In this case, what should be done then?
>>
>>70964171
it says invalid column :/
>>
>>70964190
size_t s = sizeof(<data type>) * <length of array>
>>
>>70963974
There you have it.

https://medium.com/@authmane512/how-to-build-an-apk-from-command-line-without-ide-7260e1e22676
https://medium.com/@authmane512/how-to-do-android-development-faster-without-gradle-9046b8c1cf68
https://www.hanshq.net/command-line-android.html
http://www.ntu.edu.sg/home/ehchua/programming/android/android_ndk.html
https://software.intel.com/en-us/articles/building-an-android-command-line-application-using-the-ndk-build-tools
https://nickdesaulniers.github.io/blog/2016/07/01/android-cli/
>>
I just found out French had recursive functionality in the standard.
>portmanteau()
Worst English influencer to be honest.
>>
>>70963358
learning microservice architectures and implementing one in ASP.NET Core
>>
>>70963772
>When I try to run it from the terminal, it doen't do anything.
Not surprising, your script is broken everywhere. This should help a bit.
https://mywiki.wooledge.org/BashPitfalls
https://pastebin.com/Fvwyaegn
>>
I implemented a C++ custom class the other day overloading the bracket [] assignment with help from the kind anons in /dpt/.
It's working fine, but I have a problem. The [] operator returns a value, and when I try to do an assignment like class[a] = T, the compiler complains about having a value on the left side of the assignment, which is absolutely right.
The naive way of solving this is just making the [] operator return a pointer I guess, but then I'd lose the capacity to return a value, which makes things like T a = class[b] not possible.
What is the clever way to fix this and have the best of both worlds?
>>
>>70964273
Don't you use the reference character '&'? Something like this?

public:
int& operator[] (const int index);
};

int& IntList::operator[] (const int index)
{
return m_list[index];
}
>>
>>70964209
I will try that, thanks
>>
>>70964105
I enjoy programming while studying it but I don't know of any open source projects that I'm interested in. I barely even know about any since I'm not already active in that stuff.
>>
File: tuba tyrant.jpg (67 KB, 403x631)
67 KB
67 KB JPG
Trying to make a mod for Terraria. Only problem is I'm coming from knowing Java so I've gotta learn C# and will need to get a thorough reading done of the tmodloader documentation
>>
>>70963358
New to Java, trying to use Math.pow(4, 1/2)

Can somebody explain why the output is 1.0 instead of 2.0?
>>
>>70964308
No, right now it looks kinda like
class {
object<T> mat;
struct Proxy {
object<T>& m;
size_t x;
T operator [] (size_t y) { return m.get(x,y) }
}
Proxy operator[] (size_t x){ return Proxy(*this, x)}
>>
>>70964503
1/2 are integers, so you're doing integer division, which means that the result is 0.
Anything to the power of 0 is 1.

So change it to 1.0/2.0 to use floating point numbers.
>>
>>70964517
Thanks. Why doesn't the 4 need to be made to 4.0?
>>
>>70964568
There are automatic conversions for integers to floats, but that happens AFTER the division happens.
>>
>>70964513
method signature must be:

T &operator [] (size_t y)
T operator [] (size_t y) const
>>
>>70963358
Wanting to #learntocode, not here to ask what language I should learn first like a plebiscite, am looking for a decent learning tool. If anyone has any suggestions?
>>
>>70964635
for what language?
>>
File: 1520667591530.gif (1.98 MB, 480x360)
1.98 MB
1.98 MB GIF
>>70964635
>Wanting to #learntocode, not here to ask what language I should learn first like a plebiscite
>>
>>70964635
>am looking for a decent learning tool
https://bad-dragon.com/
>>
OpenGL fuckery here:
I have a few cubes in a row behind each other.
When I look at them from the font I see the front side of the cube which is nearest to the camera.
But when I turn everything by 180% aka look at the scenery from behind I still see the front side of that same front cube (now backside of back cube). It's overriding everything in between. That front cube is the last thing which is rendered. When I switch the render order so that the back cube is rendered last, the same shit happens with that cube. I would post code but it's a mess. Is this some depth buffer fuckup?
>>
>>70964770
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);

I don't really know.
>>
>>70964770
Your vertices are in the wrong order you fucking piece of shit
>>
>>70964808
Holy fuck, this worked which is weird because I tried this before and it didn't. Looks like it was a line switcheroo
>>
File: 1552340452865.jpg (47 KB, 637x579)
47 KB
47 KB JPG
>>70964630
I don't understand. What does it mean when you stack two function headers like that? How does this work and what am I aiming for by doing this?
>>
File: 1557182560187.gif (229 KB, 360x270)
229 KB
229 KB GIF
Is there a language with manual memory management which isn't complete C(ancer)?
>>
>>70963531
nu-javascript is faster than most low-level languages too.
>>
>>70963714
Webdev can be fine, if you have some choice in what technologies you can use.
t. rewriting Django clusterfuck to PL/pgSQL and Go
>>
>>70965203
Fuck off to >>>/g/wdg/.
>>
>>70963358
can't get the 'box' function to work in the ncurses terminal, what am i doing wrong?
init();
// figure out why box doesn't work
WINDOW* board = newwin(10, 10, 1, 1);
box(board, 0, 0);
wrefresh(board);
refresh();
end();

init just starts color (if its enabled) and begins ncurses mode. end ends ncurses mode.
>>
>>70964635
https://www.edx.org/micromasters/ubcx-software-development

the best
>>
I am starting to believe that Kotlin is the brainchild of 500 different idea guys who all wanted their neat feature added in, regardless of how it fits into the rest of the language. I am going to begin compiling a list of things about Kotlin that are shit.
>>
File: eab.gif (37 KB, 600x502)
37 KB
37 KB GIF
i cant program because my thumb hurts, kinda
>>
>>70965207
No. That place is just a Pajeet lego employment general. Optimizing webdev with actual programming belongs in /dpt/.
>>
>>70965310
dumb frogposter
>>
File: 1478361596031.png (45 KB, 720x644)
45 KB
45 KB PNG
>>70965310
It's OK momma will kiss it and make it all better.
>>
>>70963802
But how does one get the know-how and wherewithall to contribute meaningfully to OS projects? Even with the skills the project maintainer could still ignore all your pull requests...
>>
File: stram.png (64 KB, 1200x994)
64 KB
64 KB PNG
>>70963358
>What are you working on, /g/?
Working on trying to convert a stream of mp4 data to a raw h264 stream.

It looks like I need to look at what my SPS and PPS values are since VLC is shitting the bed reading them. I am one step closer to reinventing a shittier wheel though, by copying the old wheel.
>>
Hey /g/.
So... I need a pathfinding algorithm for a certain tile-based game that doesn't need to be anywhere near perfect, regarding choosing the shortest path, but needs to be as computationally light as possible. A* doesn't quite cut it. Is there any good alternatives you could suggest? So far, I'm trying to implement A* with jump point search to make it at least a bit faster.
>>
>>70965393
What's wrong with A*? If you want to trade off optimal results for speed, then you can just tune the heuristic.
>>
File: 1482473163196.png (424 KB, 526x439)
424 KB
424 KB PNG
>>70965393
>doesn't need to be anywhere near perfect
>A* doesn't quite cut it
>>
Why is it so complex to compile c code without an IDE ?
Am I a brainlet ?
>>
>>70965139
/* 
* The operator returns a reference, this gives a directs access to the data.
* Then you can do:
*
* object[index] = shit;
*
* and it will modify the data contained inside 'object'.
*/
T &operator [] (size_t y) { return some_array[y]; }

/*
* The operator returns a copy of the data, you can't modify the data inside
* 'object' but only in your local copy.
*/
T operator [] (size_t y) const { return some_array[y]; }
>>
>>70965507
yes, you are

gcc -O3 *.c
>>
>>70965507
man gcc
>>
File: index.png (7 KB, 225x225)
7 KB
7 KB PNG
I've read like 15 articles and I still don't understand what dependency injection is
>>
bois, 'artist' here with no background in programming being forced to script a little.

i've got a particle system where i'd like to decay the size of the particles over time.
i've got access to particles expected life span (@life) and age (@age)

i can do basic stuff like @life/age or @life-@age and then remap those results to a different range, but i'm wondering how i'd go about getting a bit more control over something like this (say, i wanted exponential decay instead).

also, is there a good place to just brush up on basic math for programming purposes. i haven't touched the stuff for a decade.
>>
>>70964630
>>70965515
it should be
T &operator [] (size_t y) { return some_array[y]; }

T &operator [] (size_t y) const { return some_array[y]; }
>>
>>70965567
fuck i meant
T &operator [] (size_t y) { return some_array[y]; }

const T &operator [] (size_t y) const { return some_array[y]; }
>>
File: 190515-114024.png (331 KB, 800x600)
331 KB
331 KB PNG
Where can I find the codepoint spec of Shift JIS and GB2312 so I can write decoders of them?

>>70963358
akarin a cute
>>
>>70965139
Member functions can be const-qualified. Adding const to this position of a member function declaration means it can be called on a const object. You can overload member functions on constness just like you can overload free functions on the constness of pointer or reference parameters, with the non-const cases being chosen preferentially. This is called const overloading.
Usually you use it for transitive constness - for example, std::vector's operator[] has const and non-const overloads that return const and non-const references to the chosen element.

The other anon doesn't know the context. Const overloading is not necessary in the proxy object. You only need the T& case. If you did want to add const overloading for the 2D Matrix class, you'd overload the Matrix's operator[] with a const alternative which returns a different Proxy object whose only operator[] returns a const reference.
>>
>>70965539
>>70965546
Well back to codeblocks I guess.
I'm not sure if you guys did really learn 15k lines of options only so you could compile or if you're making fun of me.
>>
>>70965547
Poo man's lambda.
>>
File: 55149222_p3.png (183 KB, 623x528)
183 KB
183 KB PNG
>>70965608
>>
>>70965547
It means turn your dependencies into parameters rather than hardcoding them. Rather than using new inside your constructors, the caller news all your objects and passed them to your constructors which do nothing more than assign them.
>>
>>70965547
instead of having

import LinkedList

class Foo
{
List aList = New LinkedList(); // Foo has a hard dependency toward LinkedList
}


you do

// no more need to import LinkedList

class Foo
{
List alist

Foo(List l) // We let the user inject the list instance by himself
{
alist = l;
}
}


This way your class Foo doesn't have to know about Linkedlist and now can actually work with anything implementing the List interface.
>>
In Python, what's the difference between using
class Player(Entity):
def __init__(self, param):
Entity.__init__(self, param)

and
class Player(Entity):
def __init__(self, param):
super().__init__(param)

?
>>
>>70965621
i don't understand this image but it reminds me of tenshi eating a corndog
>>
>>70965725
There is none.
>>
>>70965756
Oh, thanks
>>
>>70965754
Its 2 animated cute little girls that look like a sushi roll
>>
>>70965651
>>70965701
thanks

sounded much more complicated in the shit I've read
>>
>>70965764
they don't look animated
>>
File: 1513305569040.gif (1013 KB, 500x375)
1013 KB
1013 KB GIF
>>70965772
Whatever, nerd.
>>
>>70965765
There are a bunch of frameworks and patterns that make the idea of "let somebody else instantiate your objects" less tedious. But when you boil it down to its core, that's all it is.
>>
Is there a C GUI/game framework that can use only static allocation? I prefer static allocation for meme reasons, but an obvious thing like SDL doesn't seem to permit me to only use static allocation.
>>
File: 1524257489916.jpg (106 KB, 640x775)
106 KB
106 KB JPG
>>70965609
Oh gotcha. So I need to overload the [] operator for both the case where I want to modify the actual value inside the object like in object[index] = value as >>70965515 said, and the case where I want a copy of the data, which is thing = object[index], because I don't want the value of my array modified when 'thing' changes.

I don't understand the second paragraph though. Why is const overloading not neccesary in the Proxy object? Do I need to do this?

Proxy operator[] (size_t x){
return Proxy(things) //this proxy would overload the non-const [] operator
}
Proxy2 operator[] const (){
//this proxy would overload the const [] operator
}

?
>>70965581
looks nice thanks, I'm gonna to make sure I understand this whole thing first and then I'll try it
>>
>>70966071
Why not just make your own clib with your own malloc?
I think you can actually shadow functions from libs with your own so you only need to implement your own malloc, calloc, free. That assumes that the libraries you use like SDL do not statically link clib though.
>>
>>70966077
You don't _have_ to write both but a const Matrix will be useless unless you have the const overload. The non-const overload supports both assignment to and from, but can't be called on a const Matrix.

>Do I need to do this?
That's right.
>>
>>70966119
Only static allocation. No malloc. What did you miss?
>>
>>70966071
>I prefer static allocation for meme reasons,
hmm? anyway I'd suggest statically allocating X bytes and writing a simple linear allocator for that. Remember alignment.
>>
>>70966200
Everyone knows what static allocation is. Don't get Autismal.
>>
>>70966187
YOU FUCKING RETARD.
Make your your own library that reserves memory from stack/heap. Implement malloc and calloc there that give memory blocks from reserved memory.
Shadow malloc, calloc and free from clib.
The program now uses stack locally and all dynamic memory comes from your retarded library.
>>
>>70963358
I'm bootstrapping a metacompiler for a parsing language (kinda like META II if you've heard of that)
>>
>>70965167
Jai
>>
>>70965167
>manual memory management
Is RAII (C++, Rust) considerd manual or only malloc+free?
>>
Hey /g/uys, is it easy to outsource data science tasks and projects? I was thinking of applying to a data science job on top of the job I'm working at because I really need the extra money. I'm already exhausted to the brim and I'm learning the skill on the side.

Do any of you know if data scientists at companies are usually tied down to proprietary software and IPs like how web programmers are? Or is it just doing shit in Python on your own terms?
>>
File: 1535406550130.webm (2.81 MB, 1152x720)
2.81 MB
2.81 MB WEBM
>>70963358
>What are you working on, /g/?
Gaymen stuff in Lua
  TargetDirection = I:GetTargetPositionInfo(0, 0).Direction

AbsoluteTargetElevation = -math.deg(math.atan(TargetDirection[2] / math.sqrt(TargetDirection[3] ^ 2 + TargetDirection[1] ^ 2)))
AbsoluteTargetAzimuth = math.deg(math.atan(TargetDirection[1] / TargetDirection[3] ))
--I'm not sure what I'm doing here
AbsoluteTargetAzimuth = (AbsoluteTargetAzimuth + 360) % 360

AdjustedElevation = I:GetConstructPitch() - AbsoluteTargetElevation
AdjustedAzimuth = I:GetConstructYaw() - AbsoluteTargetAzimuth
--AdjustedAzimuth should never be above 180
if AdjustedAzimuth > 180 then
AdjustedAzimuth = AdjustedAzimuth - 180
end
if AdjustedAzimuth < -180 then
AdjustedAzimuth = AdjustedAzimuth + 180
end
VerticalAdjustment = (math.cos(math.rad(I:GetConstructRoll())) * AdjustedElevation) + (math.sin(math.rad(I:GetConstructRoll())) * AdjustedAzimuth)
HorizontalAdjustment = -(math.sin(math.rad(I:GetConstructRoll())) * AdjustedElevation) + (math.cos(math.rad(I:GetConstructRoll())) * AdjustedAzimuth)

HorizontalAdjustment = HorizontalAdjustment / 33
VerticalAdjustment = VerticalAdjustment / 33
-- set vertical and horizontal adjustments for hologram projector
I:Component_SetFloatLogic_1(33, 16, 3, -HorizontalAdjustment - 0.01)
I:Component_SetFloatLogic_1(33, 16, 4, VerticalAdjustment + .68)


I'm trying to place an image of a box so that it lines up with my planes current target. Webm related. My code works when the planes pitch angle is close to 0, but doesn't work as pitch approaches +-90 degrees. I have a vague idea of what I need to do, but I'm too stupid to figure it out.
>>
>>70966293
>tied down to proprietary software and IPs like how web programmers are
What does this even mean? What are you talking about?
>>
>>70965167
Chapel
https://chapel-lang.org/
Allows manual memory management or reference counted objects with automatic free.
>>
>>70966306
>working in degrees
If it doesn't work well as the pitch approaches +/- 1/2pi, just round the values away from the extremes. Straight up/down is a very small amount of time, so nobody would notice a small deflection in your values i.e. clamp it to 1-2% off and it should be fine.
>>
>>70963998
this
>>
How do I access the second element of a pair inside a map?
>>
>>70966354
map x;
x.values[1];
>>
>>70966354
Access pair in map
Access second element in pair
>>
>>70966293
>tied down to proprietary software and IPs like how web programmers are
Wtf
>>
i have a basic question about app development.
So i build a smol app for my company and its pretty database driven.
There is a webservice which sends data in json and the app pretty much just displays is pretty.

So if i take an action in the app that would lead to a database update. Atm call my service method and post the data it requires, some IDs mostly.
Here is what im curious about.
Do i "manually" update my model, maybe not even waiting for the success response.
Or do i post, wait for a response, maybe an updated model and then just call some kinda refresh method?

Its pretty basic, but i dont really know what to prioritize. If i do #1 things can get out of sync and its prone to developer errors that are hard to find if you arent careful. What if the actual DB is correct, but i just forgot to update the status within my model?
#2 will probably take too long if the json loads get bigger? And also its extra data and data is expensive on phone?
>>
File: 1517982968892.jpg (23 KB, 633x711)
23 KB
23 KB JPG
>>70963358
>"Why yes, I do write in Clojure, how can you tell?"
>>
>>70966414
Standard practice is to update the client copy immediately and correct it later if the server copy differs.
>>
What's the point of 'safe' languages like Rust, Ada, Idris, etc when there are multiple hardware exploits that bypass every software mitagition imaginable?
>>
>>70966318
>>70966406
English isn't my first language and I'm Chinese; I apologize. I essentially work as a assistant web developer for basically peanuts as it's my only job and we are forced to log in through the company's credentials to clock in and through their invision account. Basically they see everything we do.

What I'm asking is, is it realistically easy to outsource data science tasks? Or will it be easy to get caught like that one man who outsourced his shit at Verizon? I always hear people outsourcing their tasks but it's always menial garbage like making scripts to automate stuff.
>>
>>70966445
because you're colour blind
>>
File: wow anon.jpg (78 KB, 884x574)
78 KB
78 KB JPG
>>70965756
Wrong
>>
>>70966465
It's safety for you, the programmer, so things don't fuck up at runtime which is dangerous and unpredictable.
At least that's what I think it is
>>
>>70964076
We're not here to do your database homework for you
>>
>>70966448
oh wait, thats fucken smart.
So i essentially do both and the "too much data" point is irrelevant?
i mean it is 100% for me and my apps, but in general?
>>
Im on my first professional project. Is it common to sit on your ass for hours waiting on a code review for a pull request? I notified him and assigned a merge request to our senior developer but it takes him ages to review it and I think he forgets occasionally. I don't want to nudge him too much because I know he has a lot on his plate but also don't want to keep building on code that he might want to change
>>
File: 1520487523557.png (12 KB, 333x496)
12 KB
12 KB PNG
>>70966477
Took someone that long to spot that? I was merely pretending to be misinformed.
>>
What I thought I would be doing as a professional programmer
>Write a linear algebraic transformation formula in polynomial time!

What I'm actually doing as a professional programmer
>Press F12 a hundred million times in Visual Studio, because nothing is documented and then I have to Miss Marple the shit out of basic functions like save() because they call 15 different subfunctions through interfaces and I have no fucking clue what they even do
>>
>>70966465
Safety isn't just about security, and even then, it's no more difficult to write a secure program in one of those languages than it is in an unsafe language. Actually, I am playing with the idea of a systems language that does protect against side channel and micro-architectural attacks.

>>70966489
You're still incurring the cost of sending and receiving data from the server. However, you can reduce this cost by transmitting state deltas instead of entire state copies.
>>
File: 1487909717699.jpg (50 KB, 512x384)
50 KB
50 KB JPG
>>70966503
>>Press F12 a hundred million times in Visual Studio,
>debugging
People don't actually do this, do they?
>>
Camel case or underscores, tabs or spaces?
>>
>>70966489
I assume you don't re-send and re-store the whole thing, or at least you don't have to. Transmit only the changes between versions of the JSON.
>>
>>70966484
Meanwhile every modern gui program dumps a thousand uncaught exceptions into the debug log.
Hell, even official WPF documentation recommends binding disabled buttons to ValidationError[0], which throws an exception every single frame when there are no errors
>>
>>70964458
Want to teach me as you go in exchange for help?
>>
File: 1440692151338.jpg (102 KB, 1612x1248)
102 KB
102 KB JPG
I want to deallocate an array in C. How would I go on about this?
>>
>>70966550
What I use is ThisCase for user created types and functions, but this only works for C++, every other language I know is very inconsistent
camelCase is fucking gross to look at
>>
>>70966550
No
>>
>>70966492
This depends entirely on your culture
Ask a colleague discreetly and don't assume you get anyone senior to look at it within a week
>>
>>70966575
Emancipate the array
>>
>>70966575
free(array);
>>
>>70964458
> I'm coming from knowing Java so I've gotta learn C#
Congrats, you already know C#
>>
>>70966575
Any pointer you get from malloc must eventually be passed to free. Beyond that, there is no manual allocation or deallocation.
>>
>>70966492
Don't you have anything else you could do?
I work on a very small project and even we get 20-30 tickets a day
>>
>>70966593
Great, now my array is on a sex strike
>>
>>70966472
>>70966293
Anyone? Please advice
>>
>>70966186
Got it, I'm gonna try to get it working with non-const matrixes before I try to make it fancy though.
Why do I use a &operator here >>70965581 ? And why did you say I only need the T& case?
There's a detail about the implementation I've not mentioned and might be relevant. I'm not accessing the vector's variables directly inside the proxy, I'm calling a getter because I need to do some calculations to get the actual position inside of the array. I am, however, not modifying anything about the matrix, so I assume this getter can be const. Does this change anything about how I override the [] operators?
>>
File: 1554048394941.gif (1.74 MB, 720x312)
1.74 MB
1.74 MB GIF
>be at an intership for a month now
>today was the first time my pull request got accepted without comments
>was immediately merged into the main branch
>get a boner
Is this normal?
>>
>>70966472
>I'm Chinese
Put on makeup and post feet
>>
>>70966679
if you want to lose your boner worry about if it has mistakes
>>
>>70966690
Please don't joke. I need to help my family out and I'm trying to think outside the box. Also
>implying /g/irls exist
>>
Finally ordered a Common Lisp book (ANSI Common Lisp; Paul Graham). Should I start reading SICP while I wait, or would that be a waste of time?
>>
>>70966752
>Please don't joke.
It wasn't a joke
Bleach your asshole and I'll pm you
>>
>>70966607
>"invalid pointer"
what did he mean by this
>>
>>70966677
T &operator[] means the same thing as T& operator[]. It's a stylistic thing, some people prefer the former style because it clarifies some quirky complex declarations.
You return T& because a reference to T can be assigned to.
I presume the getter returns a non-const reference to the the selected element. In that case, the getter should not be const.
The getter may just be unnecessary fluff though, the proxy can access the members of its surrounding class just fine.
>>
>>70966503
>>Write a linear algebraic transformation formula in polynomial time!
well you can just take job interviews over and over again if that's your thing
>>
>>70966791
sicp is more about abstraction and its effects than lisp itself

https://sarabander.github.io/sicp/
>>
>>70966825
there's no such error retard.
>>
>>70966864
Good to know.
>>
template <int N>
void foo(T (&a)[N]){ }

Who thought this was acceptable?
>>
>>70966659
That's what you get for freeing an array and not keeping its memory in a pool.
>>
>>70966903
K&R
>>
>>70965725
first is absolute, second is relative.
>>
File: 1557404659957.png (368 KB, 582x747)
368 KB
368 KB PNG
>Given the surprising nature of this optimization and its security consequence, we refer to it as the Write Transient Forwarding (WTF) optimization.
>>
Got an array that holds binary - 0, 1's
Need to bring them together to create a number in C.
Not really sure how to go about this
>>
>>70967028
Bitwise left shift and bitwise or.
>>
>>70967028
Just iterate over the array and accumulate it to a sum variable.
If the rightmost number is 1 add 1, next add 2, add 4 etc. Add nothing if 0.
>>
>>70967028
The trick is getting the cycle started, since zero × zero = zero it can be done like this.
number = 0;
for(i = 0; i < length(bits); i++) number := 2*number + bits[i];
>>
File: 1494184370609.gif (1.9 MB, 255x191)
1.9 MB
1.9 MB GIF
>>70967024
Intel please.
>>
>>70963358
i want to nakadashi akarin
>>
>>70967063
Think I might use this, literally such a spastic I should have realised this from the beginning.
Long day I guess
>>70967084
Yeah, cheers lad
>>
>>70963802
How did you market that to employers? Did you document all OS contributions on your resume or just link your github and mention you do OS?
>>
>>70966835
Got it
>The getter may just be unnecessary fluff though
Well, more or less. The getter as I said has some calculations in the body to get the correct position based on the two parameters (The matrix is actually a 1D vector), and I didn't want to re-type those calculations every time which is why I wrapped it in a getter.
>The proxy can access the members of its surrounding class just fine
The problem I have now is somewhat related to this, actually. When I try to declare my T& operator[], the compiler says that the value of my getter function is an rvalue. I assume the problem is the return value of the getter function is not alive outside of the scope of the operator? Tried to access the matrix element of the parent class but it complains about the matrix not being static. I'm trying to wrap my head around this but fuck me this is convoluted as fuck or I'm extremely dumb. Or both.
>>
>>70963802
>Anon can you tell us more about "Cunny thread scrubber 0.9.8"?
>>
>>70967418
Dunno if this would help, it's C++ but might still be relevant:

https://www.youtube.com/watch?v=uQyT-5iWUow
>>
>>70967418
Your getter function probably doesn't return a reference.
>>
File: untitled4.png (85 KB, 1089x811)
85 KB
85 KB PNG
>>70963748 here. Imma kill myself, mates.

Some improvements, at least. Now I know I just need to start improving my detection condition. The one I'm using right now is
 if( (abs(Tij1(L)-Tij(K)) >= abs(Tij(L)-Tij(K))) && (abs(Tij2(L)-Tij(K)) >= abs(Tij(L)-Tij(K)))   )

Which basically is supposed to mean that, if the angle between the element L and K is contained within the angle between the element i and K, then there's some shadowing going on and one of those elements is obstructed. But something is obviously wrong, since there are some still undetected ones around. Pic related, every blue circle represents a point that is visible to the black circle, but at least 8 are still around that shouldn't be.
>>
>>70966668
I’m not sure I can help, but as a dev based on in the UK that shit is not normal. Or maybe it’s normal for China? Either way it sounds insane, can you find something else?
>>
File: 1557186676502.gif (149 KB, 650x890)
149 KB
149 KB GIF
>>70967585
You can do this, anon. I believe in you. If not today, tomorrow, if not tomorrow next week. Regardless of the time it takes, I have faith you will defeat this challenge. GO ANON-KUN GO ANON-KUN
>>
trying to start a c++ project but i can't find anything like an equivalent of a pom.xml (java), package.yaml (haskell), requirements.txt (python) and i want to rip my hair out
>>
How hard is the oracle MySQL developer exam for someone with no industry experience? How much more hireable would it make me if I've got a BS already?

>>70964076
alias count(*) with AS, and reference it in the WHERE clause (alias of count > 10)
>>
File: 1517680310613.jpg (79 KB, 1280x720)
79 KB
79 KB JPG
>>70967523
fuck this was obviously it. I finally got it. Thanks for all the help
>>70967511
Yeah I'm using C++ too. I'll watch the vid later, sounds interesting
>>
>>70967840
use cmake
>>
I'm at a bookstore right now. I'm slowly learning python, but I am interested in basically how computers work on a larger scale. What should I look for to teach me what is going on in all those chips and circuits and how it relates to programming languages.
>>
>>70967866
i'm trying to use cmake in conjunction with vcpkg to pull the dependencies, but it's hell
>>
>>70965507
>>70965614
It's absolutely horrible, you're more or less forced to learn Makefile, like it or not, if you have a decently sized project. Sucks but it is what it is. Start simple and take it slowly.
>>70967840
lmaooooooooooooooooooooooooooooooooo there is none. As with the other anon anon, you'll have to suck it up and start building a Makefile. or >>70967866, which I absolutely despise but people seem to like it for big projects, so whatever. I just think having to deal with make is bad as it is, another layer on top of it which is twice as convoluted and actually ends up generating hierarchical makefiles is hell on earth.
>>
What are some tips and tricks for writing unmaintainable spaghetti in C++?
>>
>>70967840
use ninja for your build system
use cmake for your meta build system
use conan for package management
t. conan shill
>>
Anyone have any experience with Red Gate tools?
Looking into their Data Masker.
Any similar/cheaper solutions?
>>
>>70967938
Use template metaprogramming extensively.
>>
File: 1555170757976.jpg (110 KB, 918x804)
110 KB
110 KB JPG
What skills/frameworks/languages should I learn if I want to make some quick money on online jobs and where should I go to find such jobs?
Im talking like 500$ a month not 100k yearly like you guys want in the west.
I live in the Balkans that's enough for me.
>>
>>70967938
use boost to create things that are already available both in boost and the stl, then do stuff with those things in the most pre-C++11 way you can think of
>>
>>70963635
>>70963642
>>70964034
R U new to C?
rc = sqlite3_bind_blob(stmt, 12, obj->list, sizeof(obj->list), NULL);

If obj->list is a pointer, than sizeof(obj->list) will give you the size of the pointer. It will not tell you how big the data pointed to is.
char *pc = malloc(26);
int *pi = malloc( 82 * sizeof(double) );
if( sizeof(pc) == sizeof(pi) )
printf(“C hates you.”);
>>
What's "lock free programming"? Often see it in job postings.
>>
>>70968002
Writing thread safe code that doesn't use locks.
>>
>>70968017
whats a lock?
>>
>>70968002
>Often see it in job postings.
What country?
>>
>>70968036
mutex or semaphore.
lock free basically uses only atomics?
>>
>>70968105
can you explain jargon without using other jargon?
>>
>>70968126
to be fair senpai I'm sure there are trillions of pages on google that can explain you what a lock is better than a 4chan post.
>>
File: 1557947318470.png (115 KB, 1089x811)
115 KB
115 KB PNG
>>70967585
You said "center of each element to the center of each other", but this one's is certainly obstructed. You've changed to point-edge intersection instead?

Anyway, try to make the simplest possible case that reproduces the problem, it's much easier to debug the algorithm with easy to understand shapes. Try a single edge looking at a circle or a single edge looking at two walls, one behind the other. From the visible edges outside of the larger circle it feels like you have some ordering problem.

Also, my take on that problem would be this: do ray casting with some sort of an accelerator structure (another anon in a previous thread suggested bounding volume hierarchy). But maybe that's too approximate for you.
>>
>>70968126
if you do not know what are mutex, semaphore and atomic you do not know anything about parallel processing. You should learn the basics before trying to understand lock free programming.
>>
File: untitled5.png (84 KB, 881x654)
84 KB
84 KB PNG
>>70967821
I'm gonna do it, mate. I'm gonna fucking McKillMyself. I can't take this anymore.

WHY THE FUCK DOES THAT FUCKING NIGGER DOT NOT REALIZE HE CAN'T ACTUALLY SEE THOSE FUCKING TRIANGLES!!!! FUCKING STUPID COMPUTER!!!!
>>
>>70968143
>you do not know anything about parallel processing
I don't, that's why I asked
>>
>>70968136
Yes, it's a bug. I got no idea what the fuck is going on.
>>
>>70968160
god "spoonfeed me"-fags are insufferable
>>
>>70968176
nearly as insufferable as people who complain about spoonfeeding when you ask a simple question
>>
>>70968160
basically two peepees can not go same at vagene so the other has to be cock blocked "locked" while the other enters.
>>
>>70968187
Your "simple question" essentially boils down to "spoonfeed to me how everything works".
>>
>>70968190
>basically two peepees can not go same at vagene
wait until you find about concurrent access vagenes
>>
>>70967938
Write macros with implicit variable names and shit to make it look like Perl.

#include <stdio.h>

#define BEGIN_FORI(START, END) do { int i; for(i = START; i < END; i++) {
#define END_FORI } } while (0)
#define BEGIN_FORI0(END) BEGIN_FORI(0, END)

int main()
{
BEGIN_FORI0(10)
printf("%d", i);
END_FORI;

return 0;
}


Beautiful. Now you'll never have to write all that loop code yourself!
>>
>>70965565
>i can do basic stuff like @life/age or @life-@age and then remap those results to a different range
If it is a floating point value between 0 and 1 at an intermediate step, then that is very easy. If it doesn’t, make it do that.

Make yourself one or more interpolation functions that take a 0...1 float and have it return a 0...1 float. Inside the function, use various math operations to get what you want. pow, sqr, sort, etc

Look up “lerp” (linear interpolation) and “interpolation function”
>>
>>70968002
Lock-freedom is a specific property of a concurrent object (usually a data structure). It ensures that, if multiple threads are concurrently accessing the object, one thread cannot impede the progress of the other threads without making progress itself. This is not true for concurrent objects that rely on mutual exclusion, as a suspended thread that is doing nothing useful could still be preventing other threads from doing anything. Lock-free objects tend to be more efficient in scenarios where you have many more threads than CPU cores.

>>70968160
If you know nothing about concurrency and a job posting asks for knowledge of lock-free programming then you are not even close to being prepared for it. Move on.
>>
>>70968248
I like recursive vagenes more. You can even make one yourself with InterlockedCompareExchange.
>>
>>70968268
I wasn't the guy asking about the job offering, I was just curious what lock meant
>>
>>70968255
make sure to use this: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h
>>
>>70966679
Yes. I unironically masturbate to benchmarks.
>>
File: Tsipras pras.jpg (26 KB, 395x287)
26 KB
26 KB JPG
>>70968255
But that's just the first step. You're not only using i as a variable, you want j, k and others, too. You could write all defines yourself, but
that's not a real programmer's way. What if you'd want a variable "JohnLennon"? You wouldn't write all 20 macros like BEGIN_FORJOHNLENNON0, BEGIN_WHILEJOHNLENNONISZERO and others that you have written. You need to automatize it.

You need to write a program in Prolog (I mean, what else?) that takes a config file (in your own, binary format, you care about efficiency after all) that contains a list of all variable names and produces a header that contains all macros. Convenient and quick!
>>
>>70966923
>C++
>K&R
Are you trolling?
>>
>>70968285
It's short for interlock. Also called a semaphore or mutex (short for mutual exclusion). It's used to prevent race conditions (where one thread tries to read or modify data while another thread is modifying it).

A thread requests a lock. If it isn't being used, the request is granted and the thread proceeds. If another thread is already using it, either the request is rejected or the requesting thread is suspended until the request can be granted (i.e. when the thread holding the lock releases it).
>>
>>70968354
Well, in a way it all began with a language designed to run on the most shitty computer available at the time, so it's only natural that its successors would inherit the shittiness of the original.
>>
>>70966354
std::map<std::string, int>    myMap;
myMap[“str”] = 22;
myMap[“dex”] = 10;
myMap[“int”] = -17;

for(auto it : myMap) {
std::cout << it->first << “ is “ << it->second << std::endl;
}
>>
>>70967951
web development with javascript and maybe php, I don't even know what js framework is the new meme but you should have no troubles finding good paying online work, and if you're motivated you can learn all you need to learn in under a year
>>
>>70968354
That syntactic form dates all the way back to C. You can compile a declaration of
int (*p)[3];
in K&R C.
>>
I am using vs 2017 for c++ is it worth upgrading to 2019?
>>
>>70968354
Not who you're replying to, but it's a fair comment.

It isn't entirely clear exactly what the OP was complaining about, but one of the main factors behind the ugliness of C/C++ types is the fact that type operators (things which construct one type from another, mainly pointer-to and array-of) can be either prefix (pointer) or postfix (array). That was a decision originating in K&R C. It gets worse when you throw in the syntax for function types, so distinguishing "pointer to function returning array", "function returning array of pointers", "array of pointers to functions" etc is far from straightforward.

C++ gets uglier still due to being a fundamentally different (and more complex) language while having to retain backward compatibility with C syntax (i.e. anything that has meaning in C must have roughly the same meaning in C++).
>>
File: makefile.png (156 KB, 2560x1308)
156 KB
156 KB PNG
>>70965507
Little by little, friend. Mine has some weirdness but it works for my uses:

https://pastebin.com/JYAuPM7K
>>
>>70968374
A mutex is a specific kind of semaphore.
>>
>>70968502
Here's a batch file for a 64-bit mingw too:
https://pastebin.com/cP3NLKPV

It'd need to be tweaked if you're linking standard libs I think.
>>
>>70968391
Im already a CS student I just gotta learn some framework I guess
React or Angular or Vue whatever shitty JS shit there is there
>>
How can i contribute to Wayland developer if i am a junior programmer?
>>
My sparks of joy are dying, why won't the box render in ncurses?
#include <ncurses.h>

int
main()
{
initscr(); cbreak(); noecho();
WINDOW* board = newwin(22, 22, 2, 2);
box(board, 0, 0);
wrefresh(board);
refresh();
getch();
endwin();
}
>>
File: the sparks are gone.jpg (24 KB, 768x512)
24 KB
24 KB JPG
>>70968682
forgot pic
>>
>>70968516
>>70968682
call refresh() before newwin().
>>
>>70963358
I want to make a program where, upon rightclicking a file, you have an option to use my program on the file. What it would do is prompt the user for credentials and fill out/pull from a webform in the background based on the name of the file and add load the result, if any, to the clipboard. This should be distributed as an executable so that others can simply install it and have that rightlick option on their laptop. I don't know what tools I need for this.

It only really needs to be run on Windows. Am I correct in thinking that Powershell would work for this? I believe powershell scripts can be packaged as .exe using iexpress. Yes? Or am I way off?
>>
>>70968699
>>70968682
actually I think the problem is with getch(), use wgetch() instead. I haven't touched ncurses in a long time, I don't remember anything. I'm just reading old code.
>>
File: 1542487701644.jpg (74 KB, 599x403)
74 KB
74 KB JPG
C++ question
how to capture everything by reference using lambda expression?
>>
>>70968780
>>70968699
you were right with the first one but i'll take heed to mae everything window-specific anyways.
Thanks.
>>
>>70968767
You can do this with c++
>>
>>70968812
[&]
>>
>>70968920
sankyu
>>
>>70967917
>>70967939
ok after finally getting it working, cmake + vcpkg is pretty comfy
i saw conan too but it looks like vcpkg has more packages so i just went with that
if vcpkg requires building all the packages and conan just pulls binaries i might switch to that, compiling libraries is so time consuming
>>
I'm learning PHP and Javascript. I grew tired of trying to swim against the current and didn't want to end up like that Suckless guy who killed himself. I'm trying to immerse myself in normie culture for the sake of my mental health, and it's going pretty good. PHP is fun to write, Javascript sucks entirely, Apache2 prefork is solid, and the CW superhero shows aren't really that bad.
>>
Java again.
I am creating some elements in a class and passing them onto an ArrayList. How do I make it so that I can use the "updated" versions of the ArrayList for my other class?
>>
>>70968847
No, that's why I changed the answer. It didn't make much sense to me that a refresh() would be required before.
It works if you just use wgetch() and remove all the refresh(), the reason it works the other way is I think:
>man curses
>Note that curses does not handle overlapping windows, that's done by the panel(3X) library. This means that you can either use stdscr or divide the screen into tiled windows and not using stdscr at all. Mixing the two will result in unpredictable, and undesired, effects.
>>
Anyone know of a good and understandable blog post or article explaining Lamport's paxos protocol?
>inb4 Paxos made easy
>>
>>70965651
>>70965701
Wish I'd seen these before starting with https://en.wikipedia.org/wiki/Dependency_injection
>>
>>70968995
What do you mean with updated, as in it has the elements you put in there?

Just save a reference to it in your other class. Create a variable for it in the class, then use a setter or a constructor to set it to your existing list.

If that was confusing plz post code and I will give clearer directions
>>
File: untitled7.png (91 KB, 1920x963)
91 KB
91 KB PNG
>>70968144 here again. Fuck it. It's good enough for my mesh (hopefully). Perhaps once I'm paid to do this shit I'll come back to fix it.
>>
new thread when? :3
>>
>>70968956
noooooooo vcpkg builds libraries :(
h8 it
>>
in which case I can implement pure virtual function without its inherit
>>
one hour before bedtime, should I masturbate or continue writing something in my fav language?
>>
>>70969240
learn to type with one hand
>>
>>70968516
https://github.com/rootcoma/cclife

Just follow this. Or this. https://pastebin.com/WdbZvP0D
>>
>>70968682
>>70968693
Marie-sama is my new god.
>>
>>70969369
She is ugly.
>>
>>70969391
What does the attractiveness of a woman have to do with programming?
>>
>>70969391
So?
>>
>>70969391
I would say, "Fuk u bitch," but I feel like that would be a low quality post.

ncurses-san and mesh vision detection-san you two can do it! Also, next OP please no anime.
>>
>>70968996
>This means that you can either use stdscr or divide the screen into tiled windows and not using stdscr at all. Mixing the two will result in unpredictable, and undesired, effects.
how do i split?
Also, yesterday or the day before the window would be drawn with |'s but now its a bunch of ugly letters. What happened?
>>
>>70969412
programmers are doomed to choose ugly women only.
>>
File: Marie gun.png (212 KB, 411x410)
212 KB
212 KB PNG
>>70969391
Take it back Anonymous.
>>
>>70969432
How bad are you?
>>
>>70969420
>u cn du it n-ncurses s-sama
thanks you anonsamachan
>>
>>70969071
Thank you, I was trying to do that, but I cannot figure out how to trigger the setter.
>>
File: 14.gif (9 KB, 143x131)
9 KB
9 KB GIF
>>70969436
Bad to the bone
>>
File: BADASS.jpg (102 KB, 1920x1008)
102 KB
102 KB JPG
>>70969436
She hangs out with pirates dude, be careful.
>>
>>70969461
I like the pictures where she looks more white
>>
>>70969461
god, asian women are really ugly.
>>
>>70969441
You instantiate the class and save it in a variable myVar, then you just call
myVar.setArrayList(list);
>>
File: tl note.jpg (86 KB, 1920x1008)
86 KB
86 KB JPG
>>70969473
I'd post the one where the husband hugs her but I can't find it.
>>
This thread has inspired me to do something with ncurses. I've been wanting to have a learning project in Haskell, I'm not that good but I would like to at least try and see if I could do something real.
Any suggestions for an easy haskell + ncurses application?
>>
>>70969422
The way I understand it is that in ncurses you either use stdscr(refresh, getch, ...) or windows(wrefresh, wgetch, ...). The important part of that quote is:
>Mixing the two will result in unpredictable, and undesired, effects.
In the original code, you call refresh() after wrefresh(), so it's redrawing stdscr(which is empty) after you drew your window with wrefresh(). getch() will do the same.
For some reason, calling refresh() before newwin() just happens to work and stdscr is filled with your new window. It works but I don't think for the right reasons.
>>
Sepples has to be the most dick sucking semen slurping language on Earth holy fucking shit does this monstrosity shit the bed HARD when you have to deal with the terrible OOP
Everything that's not sugar syntax for C is a fucking mistake and bjarnigger strocuck should be executed publicly and broadcasted live on TV worldwide.
>>
>>70969573
>>70969573
>>70969573
>>
File: 18.gif (22 KB, 100x58)
22 KB
22 KB GIF
>>70969572
takes a semen slurper to know a semen slurper
>>
>>70966679
>when your manager tells you "good job" and means it
>>
>>70969636
>When you tell your boss that something won't work 3 years earlier and it finally ends up backfiring and you get to tell your boss, "I told you so"
>>
>>70969648
>when he co-opts you into coming up with an explanation so you both stay employed
>>
>>70965772
nerd
>>
>>70964458
>>70966566
>>70966620
Put it on GitHub I want to look at its progress in the future.
>>
>>70964458
Hey can you hold this.
https://a.uguu.se/KEhmade0RWwf_SuperSecret_2.rar
>>
>>70968858
never touched C++, but I understand it's pretty expansive. My only programming experience is in R, Python and VBA. Any advice on what I should be learning / searching for within it to make this?



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.