/dpt/ - Daily Programming Thread

Grayson Miller
Grayson Miller

Old thread: jowforums.com/thread/70954990/technology

What are you working on, Jow Forums?

Attached: 69831040-p0.png (591 KB, 1088x978)

Other urls found in this thread:

jowforums.com/thread/70954990/technology
github.com/rootcoma/narf
dpaste.com/3YC7QAK
medium.com/@authmane512/how-to-build-an-apk-from-command-line-without-ide-7260e1e22676
medium.com/@authmane512/how-to-do-android-development-faster-without-gradle-9046b8c1cf68
hanshq.net/command-line-android.html
ntu.edu.sg/home/ehchua/programming/android/android_ndk.html
software.intel.com/en-us/articles/building-an-android-command-line-application-using-the-ndk-build-tools
nickdesaulniers.github.io/blog/2016/07/01/android-cli/
mywiki.wooledge.org/BashPitfalls
pastebin.com/Fvwyaegn
bad-dragon.com/
edx.org/micromasters/ubcx-software-development
chapel-lang.org/
sarabander.github.io/sicp/
youtube.com/watch?v=uQyT-5iWUow
minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h
pastebin.com/JYAuPM7K
pastebin.com/cP3NLKPV
en.wikipedia.org/wiki/Dependency_injection
github.com/rootcoma/cclife
pastebin.com/WdbZvP0D
jowforums.com/thread/70969573/technology
a.uguu.se/KEhmade0RWwf_SuperSecret_2.rar

Christian Sanchez
Christian Sanchez

What are YOU working on, OP? Nothing I assume
Bring back /prog/

Nicholas Martinez
Nicholas Martinez

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.

Attached: 1557279904231.jpg (217 KB, 900x882)

Nicholas Gonzalez
Nicholas Gonzalez

o-ok
im not working on anything, as usual, except looking for a job
keep up the good work and cute images

Ayden Price
Ayden Price

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"?

Attached: 1550148930246.jpg (16 KB, 240x334)

Ethan Gonzalez
Ethan Gonzalez

Got my programming socks on. Now it's time to write JavaScript!

Attached: 22dacbff8020c9b36da45fd9cd2cf008.jpg (50 KB, 453x680)

Charles Smith
Charles Smith

so long as you know at least one binary search tree, heap, etc

Ian Adams
Ian Adams

What are you working on, Jow Forums?

I'm making a video game!

Mason Jenkins
Mason Jenkins

list is the most important by far.

Alexander Edwards
Alexander Edwards

lists are wack

Caleb Campbell
Caleb Campbell

list[], dictionary{}, tuple(), set Set()

Ryder Phillips
Ryder Phillips

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

Benjamin Sanchez
Benjamin Sanchez

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 Jow Forums's programming challenges? It was basically just a list of simple challenges to get started in any language.

Angel Mitchell
Angel Mitchell

dictionary{}, tuple(), set Set()
all implementable with list/pair.

Christian Harris
Christian Harris

what's the benefit of using/having types?

Attached: 999999999.png (319 B, 124x91)

Lincoln Morales
Lincoln Morales

What would you recccomend for an IDE?
a text editor

Kevin Hill
Kevin Hill

Better performance.
Interfaces which are harder to misuse.
Maintainability.

Chase Morales
Chase Morales

To abstract bits into logical units.

Attached: 1504991125537.png (1.15 MB, 900x900)

Nolan Carter
Nolan Carter

lowers likelyhood of errors
allows for more readable and explicit code

Isaiah Martinez
Isaiah Martinez

Attached: lispbest.jpg (253 KB, 840x412)

Lincoln Gutierrez
Lincoln Gutierrez

Better performance.
Eh nu-javascript is faster than most non low-level languages

Josiah Perez
Josiah Perez

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.

Matthew White
Matthew White

Is this true?

Juan Perry
Juan Perry

I have no responsibility and do no development.
so what do you do all day? do you need to show up?

William Moore
William Moore

Lisps are an aberration. In my opinion they're the best form a dynamic language can take.

Lucas Brooks
Lucas Brooks

not at all

Ethan Lee
Ethan Lee

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.

Ryan Cox
Ryan Cox

Yes, JS is the fastest general purpose scripting language.

Elijah Sanchez
Elijah Sanchez

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

Michael Powell
Michael Powell

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

Matthew Brooks
Matthew Brooks

OK so not "non low-level" languages then you fucking spaghetti

Juan Long
Juan Long

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?

Benjamin Perez
Benjamin Perez

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.

Grayson Thomas
Grayson Thomas

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

Attached: 1546814469733.jpg (53 KB, 640x550)

Lucas Wilson
Lucas Wilson

fucked up the code at the end lmao

Andrew Thompson
Andrew Thompson

smfh famalam

Attached: dumass.png (56 KB, 794x458)

Hudson Gomez
Hudson Gomez

How long have you been working on this blob query? Post the statement and everything.

Carson Taylor
Carson Taylor

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

Jonathan Stewart
Jonathan Stewart

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

Jackson Parker
Jackson Parker

good for you but nobody really cares

Bentley Robinson
Bentley Robinson

goodnight dpt i love you

Bentley Jones
Bentley Jones

it's 1 PM here

Christopher Richardson
Christopher Richardson

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

Christian Taylor
Christian Taylor

Trying not to have an aneurysm while reading threads about the new side channel attacks.

Josiah Perez
Josiah Perez

/dpt/ loves you too

Jayden Gray
Jayden Gray

I’m making an operating system

Matthew Flores
Matthew Flores

i meant that if the end result is the same your boss is not going to notice but good for you pal

Jace Nelson
Jace Nelson

jowforums.com/thread/70954990/technology
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.

jowforums.com/thread/70954990/technology
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.

jowforums.com/thread/70954990/technology
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.

Colton Sanders
Colton Sanders

dropped out from computer engineering
now can't prove that I can program in my resume because no degree

Nolan Hughes
Nolan Hughes

Nice, you can clone this and save yourself the time of copying from osdevwiki github.com/rootcoma/narf

Matthew Kelly
Matthew Kelly

do a project, put it on github or something

Jason Robinson
Jason Robinson

What are you working on?
A bash script that makes data hoarding easier.

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

When I try to run it from the terminal, it doen't do anything.

Noah Morgan
Noah Morgan

You will either find a way, or an excuse.

Brody Kelly
Brody Kelly

I don't care what time it is, go to bed.

Nathaniel Williams
Nathaniel Williams

general purpose scripting language.
that doesn't make sense. and v8 is slower than both luajit and hotspot.

Ethan Martin
Ethan Martin

data hoarding easier.
?

Anthony Miller
Anthony Miller

"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.

Attached: 1555786551660.jpg (820 KB, 1039x1329)

Anthony Gray
Anthony Gray

it wasn't because of the anime picture?

Thomas Murphy
Thomas Murphy

Nice memory management!

Attached: wtf.png (22 KB, 1054x541)

Benjamin Gutierrez
Benjamin Gutierrez

wtf /dpt/ lied to me

Jaxon Thomas
Jaxon Thomas

My github profile pic is literally a cute anime girl. It was back then, and still is now.

But I should also note that I do have a CS degree.

Chase Myers
Chase Myers

jowforums.com/thread/70954990/technology
That's because your program has no side effects. It all got optimized to a no-op.

Christian Taylor
Christian Taylor

Good taste.

Jackson Ramirez
Jackson Ramirez

It's supposed to download code repositories from git, subversion, mercurial addresses.

Kevin Thompson
Kevin Thompson

    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" && ...

Sebastian Baker
Sebastian Baker

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?

Nathan Campbell
Nathan Campbell

Is there any good way to generate fresh Android project boilerplate shit without using the IDE?

William Wilson
William Wilson

Qt Creator

Levi Allen
Levi Allen

Not sure but the google results for searching for that are hilarious. I thought I remembered the google android docs having command like instructions.

Attached: AndroidDevelopmentGoogleSearch.png (85 KB, 1515x796)

Justin Kelly
Justin Kelly

that is almost all there is to it.
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

Connor Taylor
Connor Taylor

                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

Brody Sullivan
Brody Sullivan

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

Christian Torres
Christian Torres

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 , 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.

Attached: 72491702-p0.jpg (1.45 MB, 2185x1553)

Matthew Sanders
Matthew Sanders

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);

Brandon Thomas
Brandon Thomas

I'm not sure, but you could try this
FIELD.FIELDNUM = INTEREST.FIELDNUM
AND (SELECT (NO.ACADEMICS INTERESTED FROM FIELD FROM FIELD) > 10)

Josiah Wood
Josiah Wood

see
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

Mason Rodriguez
Mason Rodriguez

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

Ayden Evans
Ayden Evans

sizeof(obj->list)
I am also fairly sure this will give you the size of a pointer.

Isaiah Torres
Isaiah Torres

Messed up. Here:
AND (SELECT NO.ACADEMICS INTERESTED FROM FIELD) > 10

Isaac Gray
Isaac Gray

We should be able to just compile for arm and run elf binaries. I hope GNU makes some progress with Replicant

Aaron Gonzalez
Aaron Gonzalez

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.

Jonathan Reed
Jonathan Reed

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?

Bentley Cox
Bentley Cox

it says invalid column :/

Jonathan Carter
Jonathan Carter

size_t s = sizeof(<data type>) * <length of array>

Logan Sanchez
Logan Sanchez

There you have it.

medium.com/@authmane512/how-to-build-an-apk-from-command-line-without-ide-7260e1e22676
medium.com/@authmane512/how-to-do-android-development-faster-without-gradle-9046b8c1cf68
hanshq.net/command-line-android.html
ntu.edu.sg/home/ehchua/programming/android/android_ndk.html
software.intel.com/en-us/articles/building-an-android-command-line-application-using-the-ndk-build-tools
nickdesaulniers.github.io/blog/2016/07/01/android-cli/

Logan Bennett
Logan Bennett

I just found out French had recursive functionality in the standard.
portmanteau()
Worst English influencer to be honest.

Joshua Roberts
Joshua Roberts

learning microservice architectures and implementing one in ASP.NET Core

Robert Morgan
Robert Morgan

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.
mywiki.wooledge.org/BashPitfalls
pastebin.com/Fvwyaegn

Lucas Butler
Lucas Butler

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?

Mason Sanders
Mason Sanders

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];
}

Jayden Martinez
Jayden Martinez

I will try that, thanks

Asher Collins
Asher Collins

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.

Lucas Moore
Lucas Moore

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

Attached: tuba-tyrant.jpg (67 KB, 403x631)

Nolan Johnson
Nolan Johnson

New to Java, trying to use Math.pow(4, 1/2)

Can somebody explain why the output is 1.0 instead of 2.0?

Nathaniel Young
Nathaniel Young

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)}

Noah James
Noah James

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.

Julian Cook
Julian Cook

Thanks. Why doesn't the 4 need to be made to 4.0?

Ryan King
Ryan King

There are automatic conversions for integers to floats, but that happens AFTER the division happens.

William Sanchez
William Sanchez

method signature must be:

T &operator [] (size_t y)
T operator [] (size_t y) const

Luke Turner
Luke Turner

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?

Luis Wilson
Luis Wilson

for what language?

Connor Gonzalez
Connor Gonzalez

Wanting to #learntocode, not here to ask what language I should learn first like a plebiscite

Attached: 1520667591530.gif (1.98 MB, 480x360)

Noah Hughes
Noah Hughes

am looking for a decent learning tool
bad-dragon.com/

Gabriel Kelly
Gabriel Kelly

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?

Jace Fisher
Jace Fisher

glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);

I don't really know.

Gavin Lewis
Gavin Lewis

Your vertices are in the wrong order you fucking piece of shit

Lincoln Bailey
Lincoln Bailey

Holy fuck, this worked which is weird because I tried this before and it didn't. Looks like it was a line switcheroo

Levi Long
Levi Long

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?

Attached: 1552340452865.jpg (47 KB, 637x579)

Jordan Cooper
Jordan Cooper

Is there a language with manual memory management which isn't complete C(ancer)?

Attached: 1557182560187.gif (229 KB, 360x270)

Cameron Davis
Cameron Davis

nu-javascript is faster than most low-level languages too.

Levi Robinson
Levi Robinson

Webdev can be fine, if you have some choice in what technologies you can use.
t. rewriting Django clusterfuck to PL/pgSQL and Go

Christopher Taylor
Christopher Taylor

Fuck off to //boards.4channel.org/g/catalog#s=wdg%2F.

Cameron Flores
Cameron Flores

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.

Landon Sullivan
Landon Sullivan

edx.org/micromasters/ubcx-software-development

the best

Jonathan Wilson
Jonathan Wilson

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.

Asher Walker
Asher Walker

i cant program because my thumb hurts, kinda

Attached: eab.gif (37 KB, 600x502)

Daniel Jackson
Daniel Jackson

No. That place is just a Pajeet lego employment general. Optimizing webdev with actual programming belongs in /dpt/.

Luis Parker
Luis Parker

dumb frogposter

Benjamin Howard
Benjamin Howard

It's OK momma will kiss it and make it all better.

Attached: 1478361596031.png (45 KB, 720x644)

Thomas Ross
Thomas Ross

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

Camden Cruz
Camden Cruz

What are you working on, Jow Forums?
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.

Attached: stram.png (64 KB, 1200x994)

Julian Evans
Julian Evans

Hey Jow Forums.
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.

Luis Moore
Luis Moore

What's wrong with A*? If you want to trade off optimal results for speed, then you can just tune the heuristic.

Hunter Cruz
Hunter Cruz

doesn't need to be anywhere near perfect
A* doesn't quite cut it

Attached: 1482473163196.png (424 KB, 526x439)

Leo Powell
Leo Powell

Why is it so complex to compile c code without an IDE ?
Am I a brainlet ?

Aaron Howard
Aaron Howard

/* 
* 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]; }

Ryan Rivera
Ryan Rivera

yes, you are

gcc -O3 *.c

Grayson Walker
Grayson Walker

man gcc

Ryan Bell
Ryan Bell

I've read like 15 articles and I still don't understand what dependency injection is

Attached: index.png (7 KB, 225x225)

Lincoln Morris
Lincoln Morris

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 @[email protected] 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.

Luis Harris
Luis Harris

it should be

T &operator [] (size_t y) { return some_array[y]; }

T &operator [] (size_t y) const { return some_array[y]; }

Austin Johnson
Austin Johnson

fuck i meant

T &operator [] (size_t y) { return some_array[y]; }

const T &operator [] (size_t y) const { return some_array[y]; }

Bentley Williams
Bentley Williams

Where can I find the codepoint spec of Shift JIS and GB2312 so I can write decoders of them?

akarin a cute

Attached: 190515-114024.png (331 KB, 800x600)

Jayden Rivera
Jayden Rivera

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 user 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.

Isaac Watson
Isaac Watson

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.

Cameron Gutierrez
Cameron Gutierrez

Poo man's lambda.

Wyatt Perry
Wyatt Perry

Attached: 55149222-p3.png (183 KB, 623x528)

Daniel Phillips
Daniel Phillips

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.

Jacob Edwards
Jacob Edwards

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.

Logan James
Logan James

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)

?

John Rogers
John Rogers

i don't understand this image but it reminds me of tenshi eating a corndog

John White
John White

There is none.

Hudson Diaz
Hudson Diaz

Oh, thanks

Landon Ross
Landon Ross

Its 2 animated cute little girls that look like a sushi roll

Leo Scott
Leo Scott

thanks

sounded much more complicated in the shit I've read

Adrian Wilson
Adrian Wilson

they don't look animated

Brayden James
Brayden James

Whatever, nerd.

Attached: 1513305569040.gif (1013 KB, 500x375)

Chase Brooks
Chase Brooks

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.

Hunter Martinez
Hunter Martinez

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.

Carson Green
Carson Green

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 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
}

?
looks nice thanks, I'm gonna to make sure I understand this whole thing first and then I'll try it

Attached: 1524257489916.jpg (106 KB, 640x775)

Colton Garcia
Colton Garcia

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.

Nolan Wilson
Nolan Wilson

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.

Angel Myers
Angel Myers

Only static allocation. No malloc. What did you miss?

Nolan Reyes
Nolan Reyes

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.

Jaxson Jones
Jaxson Jones

Kill yourself, dumb pedo scum. You have no right to exist and you are not allowed here.

William Turner
William Turner

Everyone knows what static allocation is. Don't get Autismal.

James Green
James Green

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.

Mason Morris
Mason Morris

I'm bootstrapping a metacompiler for a parsing language (kinda like META II if you've heard of that)

Nolan Bell
Nolan Bell

Jai

Josiah Watson
Josiah Watson

manual memory management
Is RAII (C++, Rust) considerd manual or only malloc+free?

Gavin Gonzalez
Gavin Gonzalez

Hey Jow Forumsuys, 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?

Carson Peterson
Carson Peterson

What are you working on, Jow Forums?
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.

Attached: 1535406550130.webm (2.81 MB, 1152x720)

Robert Ward
Robert Ward

tied down to proprietary software and IPs like how web programmers are
What does this even mean? What are you talking about?

Cameron Flores
Cameron Flores

Chapel
chapel-lang.org/
Allows manual memory management or reference counted objects with automatic free.

Christian Adams
Christian Adams

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.

Jason Brown
Jason Brown

this

Brody Myers
Brody Myers

How do I access the second element of a pair inside a map?

Isaiah Jackson
Isaiah Jackson

map x;
x.values[1];

Lincoln Morales
Lincoln Morales

Access pair in map
Access second element in pair

Jose Nelson
Jose Nelson

tied down to proprietary software and IPs like how web programmers are
Wtf

Charles Wood
Charles Wood

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?

Thomas Long
Thomas Long

"Why yes, I do write in Clojure, how can you tell?"

Attached: 1517982968892.jpg (23 KB, 633x711)

Leo Ramirez
Leo Ramirez

Standard practice is to update the client copy immediately and correct it later if the server copy differs.

Owen Hernandez
Owen Hernandez

What's the point of 'safe' languages like Rust, Ada, Idris, etc when there are multiple hardware exploits that bypass every software mitagition imaginable?

Jaxon Garcia
Jaxon Garcia

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.

Caleb Bell
Caleb Bell

because you're colour blind

Michael Taylor
Michael Taylor

Wrong

Attached: wow-anon.jpg (78 KB, 884x574)

Hudson Morgan
Hudson Morgan

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

Nolan Robinson
Nolan Robinson

We're not here to do your database homework for you

Julian Nguyen
Julian Nguyen

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?

Jace Wright
Jace Wright

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

Jacob Rodriguez
Jacob Rodriguez

Took someone that long to spot that? I was merely pretending to be misinformed.

Attached: 1520487523557.png (12 KB, 333x496)

Jose Richardson
Jose Richardson

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

Easton Collins
Easton Collins

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.

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.

Blake Johnson
Blake Johnson

Press F12 a hundred million times in Visual Studio,
debugging
People don't actually do this, do they?

Attached: 1487909717699.jpg (50 KB, 512x384)

James Gonzalez
James Gonzalez

Camel case or underscores, tabs or spaces?

Adam Peterson
Adam Peterson

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.

Brayden Gutierrez
Brayden Gutierrez

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

Adam Hernandez
Adam Hernandez

Want to teach me as you go in exchange for help?

Christian Morgan
Christian Morgan

I want to deallocate an array in C. How would I go on about this?

Attached: 1440692151338.jpg (102 KB, 1612x1248)

Oliver King
Oliver King

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

Isaiah Fisher
Isaiah Fisher

No

Zachary Martin
Zachary Martin

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

Lincoln Diaz
Lincoln Diaz

Emancipate the array

Luke Wright
Luke Wright

free(array);

Charles Mitchell
Charles Mitchell

I'm coming from knowing Java so I've gotta learn C#
Congrats, you already know C#

Oliver Robinson
Oliver Robinson

Any pointer you get from malloc must eventually be passed to free. Beyond that, there is no manual allocation or deallocation.

Wyatt King
Wyatt King

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

Austin Sanders
Austin Sanders

Great, now my array is on a sex strike

James Hill
James Hill

Anyone? Please advice

Leo King
Leo King

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 ? 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?

Blake Mitchell
Blake Mitchell

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?

Attached: 1554048394941.gif (1.74 MB, 720x312)

Liam Butler
Liam Butler

I'm Chinese
Put on makeup and post feet

Easton Gomez
Easton Gomez

if you want to lose your boner worry about if it has mistakes

Charles Diaz
Charles Diaz

Please don't joke. I need to help my family out and I'm trying to think outside the box. Also
implying Jow Forumsirls exist

Logan Hernandez
Logan Hernandez

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?

Nicholas Price
Nicholas Price

Please don't joke.
It wasn't a joke
Bleach your asshole and I'll pm you

Blake Flores
Blake Flores

"invalid pointer"
what did he mean by this

Jordan Thomas
Jordan Thomas

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.

Nathan Torres
Nathan Torres

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

Aiden James
Aiden James

sicp is more about abstraction and its effects than lisp itself

sarabander.github.io/sicp/

Grayson Reyes
Grayson Reyes

there's no such error retard.

Ethan Bell
Ethan Bell

Good to know.

Hunter Torres
Hunter Torres

template <int N>
void foo(T (&a)[N]){ }

Who thought this was acceptable?

Nathan Jones
Nathan Jones

That's what you get for freeing an array and not keeping its memory in a pool.

Ayden Diaz
Ayden Diaz

K&R

Hudson Brown
Hudson Brown

first is absolute, second is relative.

Nicholas Adams
Nicholas Adams

Given the surprising nature of this optimization and its security consequence, we refer to it as the Write Transient Forwarding (WTF) optimization.

Attached: 1557404659957.png (368 KB, 582x747)

Joseph Gray
Joseph Gray

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

James Rivera
James Rivera

Bitwise left shift and bitwise or.

Gavin Garcia
Gavin Garcia

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.

Mason Campbell
Mason Campbell

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];

Henry Kelly
Henry Kelly

Intel please.

Attached: 1494184370609.gif (1.9 MB, 255x191)

Brayden Thompson
Brayden Thompson

i want to nakadashi akarin

Brody Walker
Brody Walker

Think I might use this, literally such a spastic I should have realised this from the beginning.
Long day I guess
Yeah, cheers lad

Liam Thompson
Liam Thompson

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?

Levi Davis
Levi Davis

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.

Ryan Martinez
Ryan Martinez

user can you tell us more about "Cunny thread scrubber 0.9.8"?

Alexander Nguyen
Alexander Nguyen

Dunno if this would help, it's C++ but might still be relevant:

youtube.com/watch?v=uQyT-5iWUow

Nolan Robinson
Nolan Robinson

Your getter function probably doesn't return a reference.

Benjamin Brown
Benjamin Brown

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.

Attached: untitled4.png (85 KB, 1089x811)

Kayden Walker
Kayden Walker

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?

Hudson Phillips
Hudson Phillips

You can do this, user. 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 user-KUN GO user-KUN

Attached: 1557186676502.gif (149 KB, 650x890)

Jeremiah Green
Jeremiah Green

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

Jason Jenkins
Jason Jenkins

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?

alias count(*) with AS, and reference it in the WHERE clause (alias of count > 10)

Jeremiah Price
Jeremiah Price

fuck this was obviously it. I finally got it. Thanks for all the help
Yeah I'm using C++ too. I'll watch the vid later, sounds interesting

Attached: 1517680310613.jpg (79 KB, 1280x720)

Logan Stewart
Logan Stewart

use cmake

Jason Green
Jason Green

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.

Ryder Brooks
Ryder Brooks

i'm trying to use cmake in conjunction with vcpkg to pull the dependencies, but it's hell

Angel Hall
Angel Hall

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.
lmaooooooooooooooooooooooooooooooooo there is none. As with the other user anon, you'll have to suck it up and start building a Makefile. or , 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.

Zachary Jackson
Zachary Jackson

What are some tips and tricks for writing unmaintainable spaghetti in C++?

Hunter James
Hunter James

use ninja for your build system
use cmake for your meta build system
use conan for package management
t. conan shill

Jonathan Butler
Jonathan Butler

Anyone have any experience with Red Gate tools?
Looking into their Data Masker.
Any similar/cheaper solutions?

Jason Thompson
Jason Thompson

Use template metaprogramming extensively.

Tyler Hill
Tyler Hill

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.

Attached: 1555170757976.jpg (110 KB, 918x804)

Mason Murphy
Mason Murphy

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

Kevin Carter
Kevin Carter

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.”);

Christian Adams
Christian Adams

What's "lock free programming"? Often see it in job postings.

Camden Sullivan
Camden Sullivan

Writing thread safe code that doesn't use locks.

Jace Hughes
Jace Hughes

whats a lock?

Christian Johnson
Christian Johnson

Often see it in job postings.
What country?

Aaron Richardson
Aaron Richardson

mutex or semaphore.
lock free basically uses only atomics?

Austin Morris
Austin Morris

can you explain jargon without using other jargon?

Anthony Collins
Anthony Collins

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 Jow Forums post.

Ian Russell
Ian Russell

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 user in a previous thread suggested bounding volume hierarchy). But maybe that's too approximate for you.

Attached: 1557947318470.png (115 KB, 1089x811)

Parker Harris
Parker Harris

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.

Camden Wright
Camden Wright

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!!!!

Attached: untitled5.png (84 KB, 881x654)

Nolan Morris
Nolan Morris

you do not know anything about parallel processing
I don't, that's why I asked

Jeremiah Robinson
Jeremiah Robinson

Yes, it's a bug. I got no idea what the fuck is going on.

Dylan Morris
Dylan Morris

god "spoonfeed me"-fags are insufferable

Kevin James
Kevin James

nearly as insufferable as people who complain about spoonfeeding when you ask a simple question

Luke King
Luke King

basically two peepees can not go same at vagene so the other has to be cock blocked "locked" while the other enters.

Elijah Powell
Elijah Powell

Your "simple question" essentially boils down to "spoonfeed to me how everything works".

Nathaniel Hernandez
Nathaniel Hernandez

basically two peepees can not go same at vagene
wait until you find about concurrent access vagenes

Zachary Phillips
Zachary Phillips

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!

Henry Taylor
Henry Taylor

i can do basic stuff like @life/age or @[email protected] 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”

Isaiah Young
Isaiah Young

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.

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.

Jason Scott
Jason Scott

I like recursive vagenes more. You can even make one yourself with InterlockedCompareExchange.

Parker Sullivan
Parker Sullivan

I wasn't the guy asking about the job offering, I was just curious what lock meant

Liam Bennett
Liam Bennett

make sure to use this: minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h

Dylan Richardson
Dylan Richardson

Yes. I unironically masturbate to benchmarks.

Alexander Lopez
Alexander Lopez

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!

Attached: Tsipras-pras.jpg (26 KB, 395x287)

Jack Jones
Jack Jones

C++
K&R
Are you trolling?

Luis Gray
Luis Gray

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).

Cameron Jenkins
Cameron Jenkins

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.

Samuel Thompson
Samuel Thompson

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;
}

Alexander Ortiz
Alexander Ortiz

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

Thomas Mitchell
Thomas Mitchell

That syntactic form dates all the way back to C. You can compile a declaration of

int (*p)[3];
in K&R C.

Aiden Turner
Aiden Turner

I am using vs 2017 for c++ is it worth upgrading to 2019?

Juan Miller
Juan Miller

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++).

Adam Sullivan
Adam Sullivan

Little by little, friend. Mine has some weirdness but it works for my uses:

pastebin.com/JYAuPM7K

Attached: makefile.png (156 KB, 2560x1308)

Aaron Morgan
Aaron Morgan

A mutex is a specific kind of semaphore.

Eli Smith
Eli Smith

Here's a batch file for a 64-bit mingw too:
pastebin.com/cP3NLKPV

It'd need to be tweaked if you're linking standard libs I think.

James Morris
James Morris

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

Aaron Wood
Aaron Wood

How can i contribute to Wayland developer if i am a junior programmer?

Oliver Price
Oliver Price

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();
}

Robert Reed
Robert Reed

forgot pic

Attached: the-sparks-are-gone.jpg (24 KB, 768x512)

Jason King
Jason King

call refresh() before newwin().

Chase Russell
Chase Russell

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?

Robert Long
Robert Long

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.

James Reed
James Reed

C++ question
how to capture everything by reference using lambda expression?

Attached: 1542487701644.jpg (74 KB, 599x403)

Easton Jones
Easton Jones

you were right with the first one but i'll take heed to mae everything window-specific anyways.
Thanks.

Jason Martinez
Jason Martinez

You can do this with c++

Dominic Sullivan
Dominic Sullivan

[&]

Thomas Price
Thomas Price

sankyu

Ryder Wright
Ryder Wright

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

William Diaz
William Diaz

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.

Levi Campbell
Levi Campbell

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?

Jordan Hughes
Jordan Hughes

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.

Jacob Lewis
Jacob Lewis

Anyone know of a good and understandable blog post or article explaining Lamport's paxos protocol?
inb4 Paxos made easy

Jace Price
Jace Price

Wish I'd seen these before starting with en.wikipedia.org/wiki/Dependency_injection

Nathaniel Harris
Nathaniel Harris

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

Benjamin Garcia
Benjamin Garcia

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.

Attached: untitled7.png (91 KB, 1920x963)

Jayden Martinez
Jayden Martinez

new thread when? :3

Austin Reed
Austin Reed

noooooooo vcpkg builds libraries :(
h8 it

Noah Lee
Noah Lee

in which case I can implement pure virtual function without its inherit

Charles Rodriguez
Charles Rodriguez

one hour before bedtime, should I masturbate or continue writing something in my fav language?

Michael Richardson
Michael Richardson

learn to type with one hand

Adrian Williams
Adrian Williams

github.com/rootcoma/cclife

Just follow this. Or this. pastebin.com/WdbZvP0D

Oliver Wright
Oliver Wright

Marie-sama is my new god.

Attached: Tidying-Up-with-Marie-Kondo-(2019)---S01E04---Sparking-Joy-After-a-Loss-(1080p-NF-WEB-DL-x265-MONOLI (110 KB, 1920x1008)

Easton Harris
Easton Harris

She is ugly.

Thomas Baker
Thomas Baker

What does the attractiveness of a woman have to do with programming?

Luke Lewis
Luke Lewis

So?

Attached: Tidying-Up-with-Marie-Kondo-(2019)---S01E04---Sparking-Joy-After-a-Loss-(1080p-NF-WEB-DL-x265-MONOLI (144 KB, 1920x1008)

Ryder Wood
Ryder Wood

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.

Easton Barnes
Easton Barnes

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?

Juan Cruz
Juan Cruz

programmers are doomed to choose ugly women only.

Joseph King
Joseph King

Take it back Anonymous.

Attached: Marie-gun.png (212 KB, 411x410)

Samuel Garcia
Samuel Garcia

How bad are you?

Henry Myers
Henry Myers

u cn du it n-ncurses s-sama
thanks you anonsamachan

Elijah Gomez
Elijah Gomez

Thank you, I was trying to do that, but I cannot figure out how to trigger the setter.

Isaiah Mitchell
Isaiah Mitchell

Bad to the bone

Attached: 14.gif (9 KB, 143x131)

Ryan Rodriguez
Ryan Rodriguez

She hangs out with pirates dude, be careful.

Attached: BADASS.jpg (102 KB, 1920x1008)

Nathaniel Brown
Nathaniel Brown

I like the pictures where she looks more white

Jace Hughes
Jace Hughes

god, asian women are really ugly.

Charles Lee
Charles Lee

You instantiate the class and save it in a variable myVar, then you just call

myVar.setArrayList(list);

Grayson Young
Grayson Young

I'd post the one where the husband hugs her but I can't find it.

Attached: tl-note.jpg (86 KB, 1920x1008)

Easton Reed
Easton Reed

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?

Christopher Richardson
Christopher Richardson

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.

Ryan Long
Ryan Long

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.

Christian Robinson
Christian Robinson

jowforums.com/thread/70969573/technology
jowforums.com/thread/70969573/technology
jowforums.com/thread/70969573/technology

Angel Stewart
Angel Stewart

takes a semen slurper to know a semen slurper

Attached: 18.gif (22 KB, 100x58)

Logan Ross
Logan Ross

when your manager tells you "good job" and means it

Henry Nelson
Henry Nelson

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"

Eli Jones
Eli Jones

when he co-opts you into coming up with an explanation so you both stay employed

Zachary Gonzalez
Zachary Gonzalez

nerd

Justin Lee
Justin Lee

Put it on GitHub I want to look at its progress in the future.

Brody Howard
Brody Howard

Hey can you hold this.
a.uguu.se/KEhmade0RWwf_SuperSecret_2.rar

Jaxon Robinson
Jaxon Robinson

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?

Disable AdBlock to view this page

Disable AdBlock to view this page

Confirm your age

This website may contain content of an adult nature. If you are under the age of 18, if such content offends you or if it is illegal to view such content in your community, please EXIT.

Enter Exit

About Privacy

We use cookies to personalize content and ads, to provide social media features and to analyze our traffic. We also share information about your use of our site with our advertising and analytics partners.

Accept Exit