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

/dpt/ - Daily Programming Thread


Thread replies: 352
Thread images: 33

File: 4aX1VW1 (1).png (819KB, 1282x722px) Image search: [Google] [Yandex] [Bing]
4aX1VW1 (1).png
819KB, 1282x722px
Old thread at >>51680061

What are you working on, /g/?
>>
First for Java
>>
2nd for Go
>>
third for turd lol
>>
I need help. I have two identical programs compiled with MinGW G++ on Windows 7 and for some reason geometry shaders aren't working on Windows 8 or 10. I'm trying to troubleshoot what could be causing this the only thing it could be is geometry shading. Do I have to compile on Windows 8 or 10 or is there some kind of problem with geometry shading? Shading in general is working fine across systems, it's just when I get geometry shaders involved.
>>
>following Tour of C++
>write simple class and test main
>compile
>many, many errors
hm
>>
Is there a C book that acts like a man page for every C library header?

K&R doesn't go into implementation details at all.
>>
>>51686209
it prints the printable characters fine, but character codes 187, 191, and 239 all turn in to -17, -65, -69 (i.e. the correct character code minus 256) any idea why?
Node* treeBuilder(int* characterFrequency)
{
PriorityQueue huffmanPQ;
for(int i = 0; i < 256; i++)
{
if(characterFrequency[i] > 0)
{
Node* newNode = new Node(i);
insert(huffmanPQ, newNode, characterFrequency[i]);
}
}
if(traceLevel==2)
{
printf("Printing initial queue:\n");
printPriorityQueue(huffmanPQ, myItemPrinter, myPriorityPrinter);
}
while(!isEmpty(huffmanPQ))
{
Node* leaf1;
int priority1;
remove(huffmanPQ, leaf1, priority1);
if(traceLevel==2)
{
printf("First removal:\n");
printPriorityQueue(huffmanPQ, myItemPrinter, myPriorityPrinter);
}
Node* leaf2;
int priority2;
remove(huffmanPQ, leaf2, priority2);
if(traceLevel==2)
{
printf("Second removal:\n");
printPriorityQueue(huffmanPQ, myItemPrinter, myPriorityPrinter);
}
Node* nonleaf = new Node(leaf1, leaf2);
if(!isEmpty(huffmanPQ))
{
insert(huffmanPQ, nonleaf, priority1+priority2);
if(traceLevel==2)
{
printf("Combined inserted:\n");
printPriorityQueue(huffmanPQ, myItemPrinter, myPriorityPrinter);
}
}
else
{
return nonleaf;
}
}
}
>>
>>51686204
man <standard library>
>>
>>51686231
"char" is typically signed, i.e. it holds values in the range -128 to 127.
>>
>>51686231
Annotate your code Jesus fuck.
>>
Working on the implementation of linearity in my language's type theory.

My current idea is that every value that wants to be linear will contain a "linear nugget", or a value that has no information other than that it may only be used linearly. The module system will prevent users from being able to deconstruct the aggregated linear values (can't deconstruct through pattern matching if you're not allowed to mention the constructor).

In order to create or destroy these "nuggets", you will need to use a module/function/block tagged as "unsafe", which is also required to do FFI. "Unsafe" basically just means that you're doing something that the compiler cannot verify, so it has to trust you.
>>
>>51686259
Oh, and the other benefit of "unsafe" is that they are the only places where it is possible to introduce a bug. So the amount of code you have to check when debugging is vastly narrowed down. And if you're getting a bug even though you aren't using any unsafe parts yourself, you know that the problem is coming from upstream.
>>
working on a script that detects if a thread is started with an anime image & automatically hides it if it is
>>
>>51686251
oh, ok thanks
>>
>>51686086
>monkey trouble
>>
>>51686332
What's easier?
Detecting the diversity of the color palette (anime pics have large swarths of empty color) or uploading it to iqdb and blocking the thread if it returns a high confidence match?
>>
>>51686399
use a neural net
>>
>>51686332
>>51686399
>blocking anime
>not blocking traps
gay
>>
>>51686105
wut, there is no Go in OpenBSD? why don't you simply install it by hand and distribute the binary?

>>51686399
why not both, the 1st first, and the second only if the 1st step fails
>>
>>51686473
you have a neural net that can detect anime images?

would you mind uploading the trained weights? i would like to block anime images myself
>>
>>51686478
How would a software know a character is a trap?
It would literally have to be a neural net that crossreferences the pic on google to grab the show name and then looks for "crossdress" or "trap" keywords in close proximity to mentions of the show.
And then it would still fail whenever the show gets a shortened nickname.
>>
>>51686478
>program to determine whether an anime "girl" is a girl or a trap

I would legitimately pay money for this. It's so fucking annoying spending 2/3 hours a week sorting through images searching for bulges and flagging them for deletion if present.
>>
Finally got paging installed and malloc sort of working on my OS.
>>
>>51686399
what about checking if the contour is black?

>>51686513
let's do it ITT, then.
we need a logo ASAP
>>
File: 1447832306816.png (420KB, 726x537px) Image search: [Google] [Yandex] [Bing]
1447832306816.png
420KB, 726x537px
>>51686513
>draw a girl
>call it a boy
your neural net can't tell the difference
what's the difference between bulge and a puffy vulva to a computer?
>>
>>51686498
I don't, but I'm sure you can find some online and if not you could just train it yourself.
>>
>>51686399
the latter is easier but not as reliable. if a picture is a screencap (like this thread) it misses it more often than not & if i lower the recognition threshold i get too many false positives. i'm in the middle of a rewrite to incorporate the former to account for this
>>
//MyClass.hpp
template <typename T>
class MyClass {
public:
int thing();
};

//MyClass.cpp
template <typename T>
MyClass<T>::thing() {}
// isn't this how you do it? wiki/compiler aren't helping
>>
>>51686636
You forgot the return type in the definition.
>>
>>51686646
thanks boy
>>
>>51686584
>draw a girl
>call it a boy
That's a girl, not a trap
>>
>>51686519
The bar is so low with programming anyone with an ass that warms a seat can get a job.

It's crazy how incompetent you can be and still get a job and even be considered mediocre.
>>
File: 9a1hQfU.jpg (63KB, 1280x720px) Image search: [Google] [Yandex] [Bing]
9a1hQfU.jpg
63KB, 1280x720px
>>51686676
tell that to /a/
>this is a japanese boy detective
>>
>>51686680
Where are you located and where is this true? I am seriously considering packing up and moving to a city with better job prospects.

Literally the only jobs here are fluff positions like SENIOR JAVA ARCHITECT. Nothing entry level.
>>
I've got an svn repo on a secure server, a personal server I ssh into and my laptop. the secure server is only accessible from the personal server. Right now I'm basically using svn on the server and scp'ing the stuff to my computer to work on. Is there an easy way to make this simpler?

repostin on live thread
>>
>>51686783
yeah use git
>>
>>51686799
That would change absolutely nothing
>>
>>51686773
So say you're a senior java architect. No one knows what the fuck they are doing.

Also actual job listing aren't the only way to get a job. Pound the pavement, send your resume out to 100 companies. Don't just wait for shit to be posted on a website or come to you.
>>
i am linking it
why is this happening
It's something to do with templates isn't it?
this is my last retard sepples question of the day
#include <iostream>
#include "Vector.hpp"

int main() {
Vector<int> myvect(5);


for (int i = 0; i < myvect.size(); i++) {
myvect[i] = i * 2;
}

for (int i = 0; i < myvect.size(); i++) {
std::cout << myvect[i] << std::endl;
}

return 0;
}
→ cat Vector.hpp
template <typename T>
class Vector {
public:
Vector(int s);
~Vector();
int size();
T& operator[](int i);

private:
int sz;
T *elems;
};
→ cat Vector.cpp
#include <stdexcept>
#include "Vector.hpp"

template <typename T>
Vector<T>::Vector(int s) {
if (s < 0) {
throw std::length_error{};
}
this->elems = new T[s];
this->sz = s;
}

template <typename T>
Vector<T>::~Vector() {
delete[] this->elems;
}

template <typename T>
int Vector<T>::size() {
return this->sz;
}

template <typename T>
T& Vector<T>::operator[](int i) {
if (i < 0 || i >= this->size()) {
throw std::out_of_range{"Vector::operator[]"};
}
return this->elems[i];
}
→ g++ main.cpp Vector.cpp -std=c++14
/tmp/cccqrElu.o: In function `main':
main.cpp:(.text+0x16): undefined reference to `Vector<int>::Vector(int)'
main.cpp:(.text+0x29): undefined reference to `Vector<int>::size()'
main.cpp:(.text+0x44): undefined reference to `Vector<int>::operator[](int)'
main.cpp:(.text+0x67): undefined reference to `Vector<int>::size()'
main.cpp:(.text+0x82): undefined reference to `Vector<int>::operator[](int)'
main.cpp:(.text+0xb4): undefined reference to `Vector<int>::~Vector()'
main.cpp:(.text+0xc7): undefined reference to `Vector<int>::~Vector()'
collect2: error: ld returned 1 exit status
>>
>>51686858
All templated functions must be defined in the header. Only full specializations may be defined in the source file.
>>
>>51686858
All template code needs to be in a header file, you can't compile them and link them, you can only compile and link code that uses instances of them.
>>
>>51686903
Nice, thanks.
>>
File: angry_pepe.jpg (39KB, 900x900px) Image search: [Google] [Yandex] [Bing]
angry_pepe.jpg
39KB, 900x900px
FUCK JAVA, IF YOU THINK THAT JAVA IS A GOOD IDEA FUCKING KILL YOURSELF, YOU ARE THE CANCER THAT THE WORLD IS SUFFERING FROM, FUCK YOU FUCK YOU FUCK YOU, I WISH FOR JAMES GOSLING TO FUCKING DIE A PAINFUL DEAD FUCK YOU.
JAVA IS MORE ABOUT CIRCLEJERKING ABOUT GETTERS AND SETTERS AND MAKING NEW FILES THAT IMPLEMENT GLUE METHODS THAN ACTUALLY PROGRAMMING.

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

I want to cry
>>
>>51686977
are you mad bro? is java too big for your little head?
>>
>>51686977
dumb frogposter
>>
how do I learn powershell scripting?
>>
File: javabean.jpg (93KB, 682x732px) Image search: [Google] [Yandex] [Bing]
javabean.jpg
93KB, 682x732px
>>51686991
>>51686992
I fixed my problems by using the C preprocessor :^)
Eclipse whines but who cares, lol
>>
>>51687023
you download busybox.exe and learn to use that instead
>>
>>51687086
> java
> eclipse
> c preprocessor

this might be even more retarded than the people who use haskell
>>
>>51686926
>header files
Kek. It's hilarious how many people drink the kool-aid.
>>
SWIFT
W
I
F
T
>>
>>51687142
>java
I am forced to

>eclipse
I am forced to

>c preprocessor
I am forced to if I do not want to write tons of glue code.
>>
>>51687147
What?
>>
>>51687165
Your to retarded to work. Just stop your job right now.
>>
>>51687147
I answered his question, do you have any idea what the fuck you're talking about?

FYI a good idea would be to just not reply and save yourself some humiliation.
>>
>>51687199
>your to
stop
>>
>>51687150

>tfw swift and other new meme languages will make programming a dead end career unless you're really talented
>>
>>51687170
If your header files are literally anything but a place to lay out your structs, your code is already horrendous.

Function prototypes shouldn't be necessary in well-structured code. Functions should all be declared as they're needed, with main() at the very bottom of your file.

When compiling, instead of making the compiler parse and link hundreds of disparate files, it's much more efficient (in terms of both compilation time AND execution time) to concatenate all of your code with #includes and process it as a single file. Doing this lets the compiler inline functions project-wide.
>>
>>51687258
People make structs that aren't templated?
>>
>>51687258
>Function prototypes shouldn't be necessary in well-structured code.
What is mutual recursion?

>Doing this lets the compiler inline functions project-wide.
LTO is already a thing without having to totally sacrifice incremental builds.
>>
>Functions should all be declared as they're needed, with main() at the very bottom of your file.
Nah, fuck off Grandpa.
>>
>>51687284
>using templates

Enjoy your code bloat. If you want real metaprogramming that isn't shit, I highly suggest writing your own DSL and not relying on C++'s aborted implementation.
>>
>>51687295
my code won't compile otherwise
>>
>>51687288
Mutual recursion is an exception, but it's generally pretty rare anyway. There's nothing stopping you from putting the prototype before the relevant pair of functions.
>>
>instead of just using templates, save bloat by writing an entire new programming language
>>
>>51687307
or programming in D
>>
>>51687307
What do you mean bloat? explain
>>
Either you use templates and generate more code, or you use generics and generate less efficient code. Your choice.
>>
File: 1442526249444.png (6KB, 281x215px) Image search: [Google] [Yandex] [Bing]
1442526249444.png
6KB, 281x215px
Hey guys, wanna hear a joke?
Go's type system.
>>
I like templates
>>
>>51687370
>not just writing your own metaprogramming functions that work better than templates
>>
>>51687380
I don't get it.
What type system?
>>
>>51687393
Enlighten me as to how they work without generating specializations or using generics (void pointers).
>>
File: 1447230701697.png (351KB, 342x391px) Image search: [Google] [Yandex] [Bing]
1447230701697.png
351KB, 342x391px
>>51687384
I won'r use templates because I don't understand how they work or how they are useful.
>>
File: dpt87.png (20KB, 1896x116px) Image search: [Google] [Yandex] [Bing]
dpt87.png
20KB, 1896x116px
i don't understand what i'm supposed to do on this step. i made an int array[256] where each position in a character and the number stored in it is the frequency of that character in the file. i made a priority queue using the frequencies at priorities and converted it into this tree
Printing tree.
-17: level 8
-65: level 8
newline: level 8
E: level 9
D: level 9
q: level 6
p: level 5
l: level 4
i: level 3
r: level 4
n: level 4
g: level 7
f: level 7
x: level 7
v: level 7
b: level 7
U: level 9
L: level 9
-69: level 9
h: level 9
.: level 7
,: level 7
u: level 4
o: level 4
a: level 4
t: level 4
c: level 5
m: level 5
space: level 3
s: level 5
d: level 5
e: level 4

maybe my brain's fried but i have no idea what it's asking me to do or what the point of it is. the task is to compress a text file on a character basis
>>
>>51687408
You have a program that parses your source code for you and, when it finds certain tokens, compares against something (maybe we can call it a template) and then expands the token appropriately.
>>
>>51687432
So, generating specializations?
>>
>>51687258
>>51687307
Let's seem some brilliant stuff you've written.

Do you ever reuse pieces or do you just write the same shit over and over like most Ctards.
>>
File: jbtemplates.png (42KB, 638x357px) Image search: [Google] [Yandex] [Bing]
jbtemplates.png
42KB, 638x357px
>>51687362
>>51687411
>>
>>51687432
Isn't that how template programming works in C++?
>>
>>51687446
Jesus Christ.
>>
>>51687432

In D, you can import a file as a string literal at compile time. You can perform almost arbitrary operations on it, and then insert it as code.
>>
File: z3f1WiK.jpg (62KB, 551x550px) Image search: [Google] [Yandex] [Bing]
z3f1WiK.jpg
62KB, 551x550px
>>51687432
What do you think templates are you fucking moron.
>>
>>51687446
>I will avoid using what I don't understand
That makes sense.
>>
>>51687465
I do that in C as well. It's called preprocessing.
>>
>>51687477
How does a games developer not know how to use constructors?
>>
>>51687479
Let's see some of it big talker. You can't do the same stuff with the shitty C preprocessor that you can with C++ templates or D mixins.

Code or get the fuck out
>>
>>51687479
No, you don't.
>>
>>51687514
I don't use C's preprocessor. I use one I wrote myself, in C.
>>
>>51687529
It's shit compared to D
>>
>>51687529
beautiful
>>
>>51687540
But my optimized C code runs faster than D code, which is all that matters.
>>
>>51687529
So you generate specializations of functions? How is what you did not a shit version of templates or a shit version of D's mixins.
>>
>>51687432
>>51687479
>>51687529
>completely fucking missing the point
>>
Im making an Auschwitz simulator in C++ for fun and learning
>>
>>51687501
He's stubborn in learning about writing code in a different paradigm.
>>
>>51687555
Doubt it.
>>
>>51687555
You are way full of shit man, let's seem some code.
>>
>>51687545
The entire point was that instead of using some language's poorly-designed-by-committee solution to metaprogramming, a DSL is a better choice with very little required time investment.

>>51687556
The template spec is filled with unnecessary bloat and it's incredibly easy to abuse them.
>>
>>51687575
>Auschwitz simulator
What happens?

>>51687580
>templates can be abused
explain
>>
File: conv.png (2MB, 885x633px) Image search: [Google] [Yandex] [Bing]
conv.png
2MB, 885x633px
I have an 8-bit AVR microcontroller development board and I would like to interface this device with it (pic related). My goal is to use it for connecting analog sensors (light + temperature) to the microcontroller to perform some measurements as the μC itself does not have any A/D conversion capabilities.

This device is an A/D and D/A converter chip equipped with i2c bus. As I have never used any bus with a μC, which resources would you recommend for learning about interfacing i2c devices with microcontrollers?
>>
>>51687596
I have literally had coworkers misusing templates result in compile times bloating to minutes. Replacing their use of templates with a DSL + custom preprocessor brought our compile time back down to 3 seconds, and even retards can use it.
>>
>>51687580
You still haven't answered my original question.
>>51687370
>>51687408
>>
>>51687596
it's still very early in the development, but you can get jews and gas || incinerate them
>>
>>51686142

Hmm... can you describe the bugs in more detail for what you're getting on Windows 8 and 10 compared to Windows 7?
>>
>>51687580
Show some examples

> The template spec is filled with unnecessary bloat and it's incredibly easy to abuse them.

Are you writing a compiler? No, you are not.

You reinvented templates and you want to think that there is some reason you work like a fool. You claim better speed than D which is a huge red flag because anyone who cares about speed would know that any difference in speed between the languages/compilers pales in comparison to the architecture of the program by a factor of 100 to 1000.
>>
>>51687619
Explain what misuse of templates is

>>51687626
Please don't tell me you believe in that bullshit
>>
>>51687647
If Hitler didn't kill 6,000,000 Jews why look up to him?
>>
>>51687657
That's a valid point, actually
>>
>>51687647
obviously the jews died of starvation by allies bombing the food before it came in to Auschwitz
>>
>>51687657
Because he conquered Europe?
>>
>>51686086
Just started researching physically based shading. After that I'm not sure what to do, maybe make an entire renderer with an editor or something
>>
Why are C fags so deluded?
>>
>>51687699
It's like a religion. It's more painful to admit you are wrong and learn something new than to fight and rationalize.
>>
Check my php script, leave a comment
http://tymko.2fh.co/gbook172/gbook.php
>>
>>51687726
>>
>>51687726
Why would I admit to being wrong of something with which I have no issues? Anti-C fags are much more fanatical on /g/ than C fags.
>>
>want to do entity scripting in an engine with C

>do I have structs on the C side?
>do I use a table on the lua side?

>what is the registry?
>how would it be used with C?

>absolutely no documentation

then how was it done years back?
>>
I can choose programming in my next semester, the only problem is it's Pascal. Is it relevant, is it interesting? I had C and C++ for 3 years and learned some PhP and javascript on the side. Should I go for it?
>>
Having second thoughts about my "linear nugget" proposal.

The other thing I was thinking about was simply having a wrapper that made any value inside of it linear. To use the value, you would simply map a function over it; the wrapper would act like a functor.

This is all within the core type theory anyways; it's only introduced at elaboration time, so you would never (as a programmer) be touching either concept.
>>
>>51687785
>Learning a language that sounds like it was named after a fancy waiter.
>>
>>51687785
I did pascal, it's basically visual basically
>>
>>51687785
CHANGE SCHOOLS NOW
>>
>>51687771
> C is fine
> are you too stupid to manage your own memory?
> code reuse? that's for idiots
> no I don't write software anyone else uses, why?
>>
>>51687780
You're not a very creative thinker, are you? Have you done anything for yourself in the last couple of weeks you've been stuck on this?

The registry is documented just fine. If you're as familiar with C and Lua as you claimed you were, you shouldn't be having any issues with it.
>>
>>51687820
C is fine for what it's used for. Right tool for the right job. Every good programmer can appreciate the benefits of using C for certain tasks.
>>
>>51687780
>then how was it done years back?
in C++.
>>
>>51687850
C is the right tool for the job when there is no other compiler for your architecture.
>>
>>51687803
>>51687806
>>51687809
just yes or no bros
>>
>>51687876
How about extremely low level stuff like drivers and kernels?
>>
>>51687886
NO
>>
>>51687902
C++ works just fine for that. You'd have to forget a bunch of the STL but that's not a big loss.
>>
>>51687886
yes if its the only (real) programming language available
>>
>>51687902
Their aren't many people doing "extremely low level stuff" and most drivers outside of Linux are C++.
>>
>>51687902
>>51687916

C++ can do anything as low level as C can
>>
File: wheeeeee.gif (499KB, 300x250px) Image search: [Google] [Yandex] [Bing]
wheeeeee.gif
499KB, 300x250px
Hey guys, should I be casting the return value of malloc and pointers i'm about to free like
free((char *) string);
>>
>>51687902
There is no advantage to C over C++ as a language and many advantages to C++.
>>
>>51687785
>the only problem is it's Pascal

Hahaha oh wow college education can be a joke.
>>
>>51687927
Can being the keyword, but most low level projects are building on top of 20 year old technology.
>>
>>51687911
>>51687927
True. But then C++ has a lot of complexity. If not everyone on your team is a experienced C++ dev, then using C can be advantage.
>>
>>51687959
You can write C++ code with the same complexity as C code. Most C code is valid C++ code.
>>
>>51687928
NO
>>
>>51687825
>Have you done anything for yourself in the last couple of weeks you've been stuck on this?

I learned to drive a stickshift and shitposted on /o/; I also completed several shots for a music video in NukeX and Resolve.

>If you're as familiar with C and Lua as you claimed you were, you shouldn't be having any issues with it.

If it shows me exactly what I want then there would be no issue; I had something working, but then it began "bottlenecking" if that's the right term.
>>
>>51687959
> C
> advantage

A good C++ programmer should be able to write programs that are far less complex than C, with complexity being the interactions you have to take into account at any one time.

C++ allows complexity to be broken up far better than C.
>>
If everything was written in C, the world would be a better place, prove me wrong.
>>
>>51688018
What would C be written in?
>>
>>51687996
I'm talking about complexity in terms of all the stuff you have to learn to be able to understand any piece of C++ code and design and write good C++ code.
>>
>>51688025
It's already written in C m8.
>>
>>51688018
There was a time when everything was written in C and software was broken as fuck.

Go back to windows 3.1 if you think that.
>>
>>51688025
The C compiler is written in C
>>
>>51687785
Yes, if you aren't the kind of autist that freaks out when "{" is written as "begin", you'll be fine.
>>
>>51688032
It's far better in the long run, the complexity of even C++ is far outweighed by the complexity of a non-trivial piece of software.
>>
How to learn C?
>>
>>51688059
>It's far better in the long run
That really depends on the project. Certainly if you have plenty of good C++ programmers, C++ seems like the best option.
>>
File: cat.gif (16KB, 180x236px) Image search: [Google] [Yandex] [Bing]
cat.gif
16KB, 180x236px
>>51688074
by reading pic related
>>
>>51688074
http://c.learncodethehardway.org/book/
>>
>>51687967
C code is shitty C++ code.
C code is not shitty C code.
>>
>>51687928
We talked about it faggot in the last thread.
>>
>>51688099
C won't save you from bad programmers.
>>
CS freshman working with Python 3.5 here.

Is there ANY way to call a method every x seconds that doesn't use time.sleep or threading?

I have no idea how threading works yet and it's fucking my shit up, and time.sleep just freezes everything in tkinter.
>>
>>51687991
>but then it began "bottlenecking" if that's the right term.
What EXACTLY do you mean by this?
>>
>>51688123
Didn't say it would. It just means you can use programmers who know C well enough on your code base pretty easy without having to know all of C++.
>>
>>51688108
That's a /really/ retarded argument.
>>
What does this do?
if(rp->p_flag & SSWAP) {
rp->p_flag =& ~SSWAP;
aretu(u.u_ssav);
}
>>
>>51688129
>Is there ANY way to call a method every x seconds
This is just bad, full stop.
>>
Finished my event bus in Go.
>>
>>51688145
some entities randomly stopped moving/working

most likely the order of operations in which I did things
>>
>>51687615
>interfacing i2c devices
google seems to show lots of results
>>
>>51688171
That's nowhere near how you use the term "bottleneck".

Post some code.
>>
>>51688155
No it isn't, it illustrates the point that C++ is a refinement of C, which it is.
>>
>>51688162
Why?
I want to decrease something by 1 every 10 seconds.
>>
File: YEAAAAAH COLA.jpg (141KB, 1280x720px) Image search: [Google] [Yandex] [Bing]
YEAAAAAH COLA.jpg
141KB, 1280x720px
You have 10 seconds to explain why I shouldn't malloc every variable.
>>
>>51688181
took that photo on 11/17

haven't worked in that project since

I have made a new project entirely for messing around with just entities and lua

once that's good, I can move that into the other project
>>
>>51688198
then calculate the number when you need it using the time at start
>>
>>51688205
Go ahead and do it and come back when you have a nervous breakdown.
>>
>>51688205
H E A P
E A
A E
P A E H
>>
>>51688205
Because this will happen
>>
>>51688205
Stacks are fast, heaps are not.
>>
>>51688106
That only teaches pointers and memory management in C. Do you imply that the only thing you need to learn is that and all other stuff can be picked up by writing / reading code?

>>51688107
I'll check it.
>>
>>51688212
But, you haven't even implemented anything I told you. Learn the registry, and use it instead of doing this half in C and half in Lua in some disgusting manner.
>>
>>51688107
this is really bad
don't even bother with it

zed shaw is a moron
>>
Hey /dpt/, I know you guys shit over web dev all the time (I do too, kek) but I need to write a web app. How do I go about writing an optimized JS application? I know that when you append |0 to the end of your javascript numbers, that forces them to be processed as integers, is there some way I can just declare integer instead of var and have that done automatically for me?

Basically, let's say I'm forced to write relatively high-performance Javascript. Is there a way?
>>
>>51688260
OH, you wanted a picture of recent code

Sorry m8, I am overloaded with all the different ways to do things, I don't even know which direction to go anymore
>>
>>51686204
The GNU libc reference manual is pretty good.

https://www.gnu.org/software/libc/manual/html_node/
>>
>>51688284
There actually is a way: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array
Also tell the guy high-performance JS is a joke.
>>
>mfw you can play catch with pointers and free memory blocks long after they've gone out of scope

I fucking love C holy shit.
>>
~50 lines of code (bloat, i know)
D macro preprocessor
# at the start declares a macro, # afterwards declares the identifier of the macro (the position matters)

runs at compile time, so you could use mixin to insert the processed code

can't use macros in macros, or generate macros with macros yet

>>51688315
can be done in C++ and D
>>
>>51688315
>not just letting the OS manage your memory
Kek.
>>
File: 1422485801172.jpg (134KB, 550x550px) Image search: [Google] [Yandex] [Bing]
1422485801172.jpg
134KB, 550x550px
>>51688315
>I love dangerous stuff that harms the stability and security of software
>muh low level language
>>
File: macros.png (2KB, 167x128px) Image search: [Google] [Yandex] [Bing]
macros.png
2KB, 167x128px
>>51688358
>>
>>51688369
(\ is a space)
>>
In shellscripts, how do you get more than one option to work together? So, in this example, both options require an argument. But if I were to run this doing using both options at the same time, like -id or -di, then it treats the second option as if it were an argument and it doesn't work.

#!/bin/bash

options=':d:i:'

while getopts $options option
do
case $option in
d) du $OPTARG --max-depth=2 -k | sort -n
echo
;;
i) df $OPTARG -T | awk '{ print $1,$2,$6,$7 }' | column -t
echo
;;
esac
done
>>
>>51688285
Does this help at all?
void loadEntityPrototype(lua_State vm, int prototype, const char *path) {
luaL_dofile(vm, path);
lua_pushnumber(vm, prototype);
lua_getglobal(vm, "prototype");
lua_settable(vm, LUA_REGISTRYINDEX);
}


Sample prototype script:
prototype = {
new = function()
return {
name = "Sample",
foo = 0
}
end,

update = function(self)
self.foo = self.foo + 10
end,

draw = function(self)
return "%s(%d)":format(self.name, self.foo)
end
}
>>
>>51688364
>I'm too incompetent to write code that doesn't crash
>Better shit over people who can
>>
>>51688018
it is, that's why people can become rich profiting from retarded software bugs
>>
>>51688403
If an option requires an argument, you have to provide it, and you can't merge option flags (i.e. you have to use "-i<arg> -d<arg>").
>>
>>51686086
Just started making a GNOME Shell extension that shows MPV's video in a small floating window if I go away from MPV's current workspace so that I can keep watching while doing whatever I do in that workspace. Other plans I have are to make it change corners on click/hover in case it's covering something important, and making the size user configurable.
>>
>>51688412
yeah I also drive a car without brakes because I can calculate how much time the car takes to stop after I take my foot off the gas pedal because I studied physics. It's not my fault you're a shit driver who can't do the same.

This is your retarded logic
>>
>>51688183
Refinements remove things by definition. Whatever way of c++ is best, c++ is not a refinement by any means
>>
How do I get the subtraction of a set in C? Like let's say I have the series 1, 2, 3, 4 and I want to subtract 2 from it, then I need to return 1, 3, 4.

Do I pass arrays and shit? That seems like a lot of work.
>>
>>51687771
>Anti-C fags are much more fanatical on /g/ than C fags.

That is a damned lie.
>>
>>51688074

K & R

For functionality: Buy an arduino
>>
>>51688716
C has no built-in set type, so first decide how you are going to represent your sets.

http://stackoverflow.com/questions/2630738/c-how-to-implement-set-data-structure
>>
>>51686204
H&S
>>
it's literally impossible to make an array of strings in c++
>>
>>51688935
he's not wrong
>>
why is Swift code so ugly?
    switch mode {
case .Usage:
usage()

case .Clean:
try rmtree(try findSourceRoot(), ".build")

case .Build(let configuration):
let rootd = try findSourceRoot()
let manifest = try Manifest(path: "\(rootd)/Package.swift", baseURL: rootd)
let pkgname = manifest.package.name ?? rootd.basename
let depsdir = Path.join(rootd, "Packages")
let computedTargets = try determineTargets(packageName: pkgname, prefix: rootd, ignore: [depsdir])
let targets = try manifest.configureTargets(computedTargets)
let dependencies = try get(manifest.package.dependencies, prefix: depsdir)
let builddir = Path.join(getenv("SWIFT_BUILD_PATH") ?? Path.join(rootd, ".build"), configuration.dirname)

for pkg in dependencies {
try llbuild(srcroot: pkg.path, targets: try pkg.targets(), dependencies: dependencies, prefix: builddir, tmpdir: Path.join(builddir, "\(pkg.name).o"), configuration: configuration)
}

// build the current directory
try llbuild(srcroot: rootd, targets: targets, dependencies: dependencies, prefix: builddir, tmpdir: Path.join(builddir, "\(pkgname).o"), configuration: configuration)

case .Version:
print("Apple Swift Package Manager 0.1")
}

>
do ... catch
instead of
try ... catch

>BUT try is still a keyword that does different things
>must bind variables in pattern matching with let
>must use . in the names of enum constructors being matched
>must use case in enum definitions, but only required once and can be left out afterwards
>>
>>51688889
+=
>>
>>51688935
Yet another reason why C is better.
>>
>>51688952
>Developer Apple Inc.
gee, I wodner
>>
>>51688409
thanks, let me take a look and get back to you

sorry about the delay, I had to help someone transfer a DV tape through thunderbolt
>>
>>51689003
but that took so many ideas that could be good and puked on all of them
same problem as Objective-C, just more modern
>>
>>51688997
It's literally impossible to make an array of strings in any language
>>
>>51689026
>but that took so many ideas that could be good and puked on all of them
The Apple legacy
>>
File: halp.png (13KB, 519x448px) Image search: [Google] [Yandex] [Bing]
halp.png
13KB, 519x448px
Im sutck with python with this problem:

So i have a class A with a function, this function is being called by a parent class every so often. Then i have an other class B that would watch class A and execute a function whenever a specific function of A is called by its parent class.

pic related (4chan and mook is a nigger and i cant post any code for some retarded reason)

How do i do this?
>>
>>51688746
Nah. There's this huge "C tards are so stupid and fanatical" thing on /g/. But people that vocalize that are far more comman than the C tards. Mostly because Anti-C fags include the FP fags etc
>>
if a function can accept 3 parameters, do you have to send it 3 or can you send less?
>>
File: Untitled.png (38KB, 703x367px) Image search: [Google] [Yandex] [Bing]
Untitled.png
38KB, 703x367px
>>51688935
What?
>>
@51689088
>Mostly because Anti-C fags include the FP fags etc
Here we go
>>
>>51689089
what do you mean can accept
if it's not variadic, no
>>
>>51689088
>tfw FP fag who has a hard on for C
>>
>>51689092
no one will fall for your shit garett
>>
Precedence is important.

I'm not an anti-C fag, I'm an anti-(C fag).
>>
>>51689092
an array has fixed size
a string does not
>>
>>51689129
Then explain how I just compiled and executed that program.
>>
>>51689129
>a string has no fixed size

Why are you making up definitions?
>>
>>51689127
Five star post

Rolling
>>
>>51689140
all strings but the last have the same length
>>
File: Untitle2d.png (42KB, 713x410px) Image search: [Google] [Yandex] [Bing]
Untitle2d.png
42KB, 713x410px
>>51689187
There you go. I just changed the size of that array. That array of type std::string. You see where your logic might be faulty here?
>>
>>51688284
> High performance
> javascript

Look up asm.js
>>
C++ is so complicated holy shit
I need to slow down, do some practice problems or something
>>
>>51689205
oh
then the string content isn't stored in the array, just the header (which is constant size)
so its not really an array of strings
it's an array of metadata about strings
>>
>>51688693
> Refinements remove things by definition

C++ removes the need to micro-manage memory and removes the need to use functions instead of integrating data structures into expressions.

You can focus on the 'oh no more syntax' and get side tracked if you want though.
>>
>>51689028
why? You can make an "array" of "strings" in lots of languages, unless you're trying to argue over the definition of "array" or "string"
>>
File: content locked.png (72KB, 473x353px) Image search: [Google] [Yandex] [Bing]
content locked.png
72KB, 473x353px
dammit, guess i gotta make a facebook now
>>
File: 1443576115872.gif (4MB, 300x300px) Image search: [Google] [Yandex] [Bing]
1443576115872.gif
4MB, 300x300px
>>51689234
>Moving the goalposts
>>
>>51689254
cancer
don't visit that website ever again
>>
>>51688935
>>51688949
>>51688997
>>51689028
>>51689234

I know people still stuck on C are retards, but this is really above and beyond, even for you idiots.

Now I know why you guys don't get anything done, you're all about technicalities instead of reality.
>>
>>51689254
someone post the image with the locked-down sites and the 404 girl.
>>
char *stringArray[4] = {"An", "array", "of", "strings"};

Commies BTFO
>>
>>51689320
Not an array of strings.
>>
>>51687432
I can't believe those retards who made the language didn't think of that! We could call this "class plans" or "class arrangements"! No idea what that template garbage is but it sounds problematic
>>
>>51689333
If that's not an array of strings, then literally no language supports arrays of strings.
>>
>>51689333
Please give me your most likely super pedantic reason why that's not an array of strings
>>
>>51689350
that's his useless, pedantic point.
>>
>>51689350
>>51689356
Just ignore him. He is baiting you.
>>
>>51689356
Array of pointers to character that begin arrays. That notation is just syntactical sugar for assigning each pointer the address of the first character of each string.
>>
>>51686086
I am trying to implement a solution that doesn't run like absolute shit for the ugly numbers challenge. So far as I can tell, the fastest way to do this is described here: http://www.necessaryandsufficient.net/2008/08/google-code-jam-ugly-numbers/

But I only vaguely grasp why this is so much more efficient. I compiled an example solution that implemented this and for a 13 digit number it returned the result in less than a second. By comparison, my brute force garbage took like 2 minutes.

Could anyone break this method down into simpler terms?
>>
>>51689333
Triple threes confirms
>>
What is a string?
>>
>>51689398

Something you use to make clothes
>>
Why don't you metaprogram, /dpt/?

Why haven't you started programming code that programs for you yet?
>>
File: 1447218789771.jpg (834KB, 1024x919px) Image search: [Google] [Yandex] [Bing]
1447218789771.jpg
834KB, 1024x919px
>>51689377
That's the dumbest shit I've ever heard. Who would even do that? Literally all the alternatives solutions provided create arrays of strings better than this in theory and in practice.
>>
>>51689398
A piece of text.

"String" <- the value of a string
>>
>>51688409
The code seems to work, thank you for that

After reading what prototype-based programming is (although the code shown was for javascript), and just so I understand this: when I create a "type" of entity (player, coin, goomba, etc) I call this code to put it into the lua state?

loadEntityPrototype( LS, 0, "objPlayer.lua" ); 


Is the next step for the "individual" entity that is going to be used?

I read the registry documentation again, so I set an entity to the prototype that's in the registry?

Sorry if I am off by a bit or alot
>>
>>51689377
By that logic it's not an array either since arrays themselves are just pointers
Dumbass
>>
>>51689409
>using primitive languages with distinguished syntactic layers
>>
>>51689422
Then explain how these are not arrays of strings.
>>51689320
>>51689205
>>
>>51689320
so you can't create an empty array of strings, then pass it to another function to fill it?
>>
>>51689422

"A piece of text"

Please never say this if someone wants to hire you
>>
>>51689433
> 25MB hello world
>>
>>51689416
>Who would even do that?
What? That's exactly what it is. People that implement C do that.

>>51689431
That's correct.

>>51689442
Believe it or not, I'm not the original anon that argued against it.
>>
>>51689454
He's not wrong. Text is literally an irl string of characters.
>>
>>51689459
>That's correct.
>What is abstraction
Dumbass
>>
>>51689454
>>51689464
Obviously from a programming perspective it is the stupidest sounded way to define a string, but in reality, that's what it is, yeah.
>>
File: 1429157823568.png (49KB, 1028x1068px) Image search: [Google] [Yandex] [Bing]
1429157823568.png
49KB, 1028x1068px
>>51689391
c++ example
>>
>>51689447
You can, it would be tougher in C, but easy in a higher-level language like Java or D
>>
>>51689459
>What? That's exactly what it is. People that implement C do that.
And there are clearly much better, less convoluted alternatives.
>>
>>51689474
0/10. Shit font, did not even bother reading.

Poor language choice too desu.
>>
>>51689485
>tougher in C
>what is a char*
Kek. Confirmed for pleb.
>>
>>51689490
Take notes kids, this is what it looks like if you 'code' but never challenge yourself and wind up doing nothing.
>>
If it can't live exclusively on the stack, allocated at compile time, or does not hold elements in contiguous memory, it is not an array.
>>
>>51689490
thanks for your input senpai!
>>
Tabs or spaces?
Spaces make more since but I find them disgusting. But it makes more since when aligning text, because tab width isn't standard, and spaces are always one character
>>
>>51689503
I say so since you have to worry about the length of the string you're putting in the array and making sure the array will be big enough to hold it
>>
>>51689485
what about c++? trying to and it tells me this
huffman.cpp: In function ‘int main(int, char**)’:
huffman.cpp:160:53: error: cannot convert ‘std::string (*)[8] {aka std::basic_string<char> (*)[8]}’ to ‘std::string* {aka std::basic_string<char>*}’ for argument ‘2’ to ‘void characterCodeCreator(Node*, std::string*, std::string)’
characterCodeCreator(huffmanTree, characterCode, "");



//main
string characterCode[256][8];
characterCodeCreator(huffmanTree, characterCode, "");


// Function characterCodeCreator fills an array of strings to contain character codes derived from the huffman tree.
void characterCodeCreator(Node* huffmanTree, string* stringArray, string pathFromRoot)
{
if(huffmanTree->kind == leaf)
{
stringArray[huffmanTree->ch] = pathFromRoot;
}
else
{
characterCodeCreator(huffmanTree->left, stringArray, pathFromRoot+'1');
characterCodeCreator(huffmanTree->right, stringArray, pathFromRoot+'0');
}
}


i've included <string>
>>
>>51689527
Tabs masterrace.
>>
>>51689527
Tabs
>>
>>51689503
Let's see it then.

How come you "C IS BEST" faggots never want to actually produce any code? Can you even do it? Or maybe you're afraid you'll get it wrong since C is such a minefield. Or maybe you know it is a retarded amount of work to something simple. Or maybe you just know you'll be shown up.
>>
>>51689527
Doesn't matter in 2015
>>
so when tou have a cheigbne rhe balmer beak * 50, what sould toun develop
>>
File: 2015.jpg (30KB, 848x476px) Image search: [Google] [Yandex] [Bing]
2015.jpg
30KB, 848x476px
>>51689552
>>
>>51689581
what
>>
>>51689548
Jesus christ you fucking sperg.

"It's hard in C."
"No it's not."
"How come you guys never post your code????? because you can't code it in C??? cause C is shit?????? WHERE IS YOUR CODE....!!!"

void fill_string_array(char strings[][64], int n);
char string_array[10][64]
fill_string_array(string_array, 10);

What's so fucking complicated?
>>
>>51689588
hard to say mnabn cant eallt develp a pormper stenc in my hand
>>
>>51689591
>avoids implementating the function
>it's not possible in C
>>
>>51689426
What creates the data for the individual entity is the entity's prototype's constructor ("new" in my example).

You would store the ID that you use when loading the prototype with each entity, and use that ID to bring up the appropriate functions when iterating through them.
// creating
entities[new].used = true;
entities[new].prototype = prototype;
lua_pushlightuserdata(vm, entities + new);
lua_pushnumber(vm, prototype);
lua_gettable(vm, LUA_REGISTRYINDEX); // get the prototype table
lua_pushstring(vm, "new");
lua_gettable(vm, -1); // get the constructor
lua_pcall(vm, 0, 1, 0); // call the constructor
lua_settable(vm, LUA_REGISTRYINDEX); // register the data table with the entity's address

// iterating
for(int i = 0; i < MAX_ENTITY_COUNT; ++i) {
if(entities[i].used) {
lua_pushnumber(vm, entities[i].prototype);
lua_gettable(vm, LUA_REGISTRYINDEX); // get the prototype table
lua_pushstring(vm, "update");
lua_gettable(vm, -1); // get the update method
lua_pushlightuserdata(vm, entities + i);
lua_gettable(vm, LUA_REGISTRYINDEX); // get the data table
lua_pcall(vm, 1, 0, 0); // call the update method
}
}
>>
>>51689548
Last time I posted my C code someone bitched about me using #include <string.h>

C-keks are the worst.
>>
>>51689604
jesus christ that code is giving me cancer
>>
>>51689599
I knew you'd ask. You can't even program in your own language of choice.

void fill_string_array(char strings[][64], int n) {
char *string = "Fuck you anon";
for (int i = 0; i < n; i++) {
strcpy(strings[i], string);
}
}

Tough.
>>
File: 1441654804176.gif (2MB, 400x333px) Image search: [Google] [Yandex] [Bing]
1441654804176.gif
2MB, 400x333px
>>51689591
HARD CODED LENGTHS ARE YOU FUCKING SERIOUS!!1!

Loololol
>>
>>51689614
That's Lua's stack API for you.
>>
File: 1449245433527.jpg (52KB, 800x600px) Image search: [Google] [Yandex] [Bing]
1449245433527.jpg
52KB, 800x600px
Hey, how would i go about to take the say 500 "best" items in an array? Lets say all are integers and i want the 500 highest ones. Is there any efficient way to do this?
>>
>>51689527
Somebody somewhere always fucks it up. You can automatically convert all tab alignments to all space alignments, but not all space into the same tab alignments without mixing them with spaces. At some point indentations and alignments will always get mixed up.
There is no reason to bother with tabs. Just configure your editor to handle (n) spaces as a single character, but still save it as space.
>>
>>51689052
>Class B(object):
should be...
class B(parent)

...if it's a child of the parent function.
>>
>>51689628
We're on the topic of arrays on the stack you fucking moron.
>>
what's the next step above doing stupid little console i/o programming exercises like printing fibonacci numbers, pig latin, check if palidrome, and stuff like that? i want to create an actual program, complete with a gui and all
>>
Pre-emptive new thread
>>51689650
If you post in it before this thread hits 310, you're worthless
>>
>>51689621
Uhh, where is the memory for those character arrays coming from?
>>
>>51689659
Learn a graphics API.
>>
>>51689659
The intermediate is doing console i/o programs that aren't stupid and little. Then you can do "complete programs with a gui and all"
>>
>>51689659
Have you considered web dev? It's perfect for meme-tier programmers like you who only care about what shit looks like.
>>
>>51689667
The argument that was passed to it; see the god damn post before it you retard.
>>
File: 1441948329696.png (17KB, 241x230px) Image search: [Google] [Yandex] [Bing]
1441948329696.png
17KB, 241x230px
>>51689647
Ahh suddenly it's arrays on the stack now I guess. That's very convenient for you all of a sudden.
>>
>>51689687
All arrays can exist on the stack
>>
>>51689692
I can't even see the goalposts any more. Do you want me to prove you can write arrays of C strings directly to the hard drive with a magnet?
>>
>>51689684
Oh cool, that makes sense because no string will ever be longer than 10 characters.
>>
>>51689680
A little too far; you're obviously mad that you've only ever done console programs

>>51689687
Kidding, right? Jesus fuck.

char **strings = malloc(10 * sizeof(char *));
for (int i = 0; i < 10; i++) {
strings[i] = calloc(64, 1);
}
fill_string_array_2(strings, 10);

//...
void fill_string_array_2(char **strings, int n) {
// body is the same
}

Hang yourself for being so incompetent and ignorant.
fill_string_array_2(strings,
>>
>>51689703
Maybe if the goalposts were on the stack you wouldn't need to put so much effort into finding them
>>
>>51689707
You don't even know 2-dimensional arrays? Fuck. That's 10 arrays of 64. Quit embarrassing yourself
>>
>>51689744
>nobody will ever need more than 640 characters
fuck off bill
>>
>>51689744
Because no string will be longer than 64? Kek.
>>
>>51689715
Now you're leaking memory AND hard coding the lengths WHILE putting them on the heap?

Come on man, now you're just trolling, you actually use C++ just like everyone else don't you?
>>
>>51689744
>>51689754
Hence >>51689715 you autists
>>
>this
>fucking
>thread
>>
>>51689766
>leaking memory
>a fucking fragment of code
Serious right now?
>>
>>51689777
don't worry triple 7
>>51689664
>>51689650
>>
>>51689780
Does free run on scope exit like unique_ptr? I haven't looked into C11
>>
>>51689780
>leaking ANY memory
>>
>Arguments claiming C and C++ do not have strings

If the interpreter/VM for your language of choice is written in C or C++, then if C and C++ do not have strings, then neither can your language.

If your language of choice compiles to native code, and the generated assembly from your language is equivalent to what would be produced by C or C++, then at least one of these languages has strings.

As a general rule:
If language X implements strings, and those strings form an in-memory structure Z, then if Z can be implemented in language Y, Y also supports strings.

Q.E.D.
>>
>>51689766
anon, clearly you are expected to write an entire class to satisfy this autist.
>>
>>51689807
No, obviously not.
>>51689809
It's a fragment, not even whole function. It's not even a fucking program. You can't say it leaks memory just because the fragment didn't include the calls to free().
>>
>>51689816
Wtf are you talking about, Ruby? Just because a language is built upon another language doesn't mean it's possible to do everything that language does in the base language.

You can't have empty strings in C, but you can have empty strings in Javascript, Python, etc.
>>
>>51689843
>he posts in dpt
>he doesn't know c
>>
>>51689857
Please point out where the memory was lost, then.
>>
>>51689852

>You can't have empty strings in C, but you can have empty strings in Javascript, Python, etc.

What is an empty string in Javascript, Python, etc? It's when the in-memory structure has a size attribute of 0.

So if you make the following struct in C:
struct my_string {
char *str;
size_t len;
size_t cap;
};


Oh hey, I can have empty strings!
>>
>>51689962
OK but you can't concatenate strings in C (like "hello " + "world" so you're still wrong.
>>
>>51689962
But that's not a string, that's a structure. Strings in Python are a real data type.
/s
>>
>>51689962
char* emptystring = "\0";
char* emptystring2 = NULL;
>>
>>51689983
strcat()
>>
>>51689983
strcat()
you're retarded
your "Hello" + "world" literally just calls strcat().
>>
>>51689999
nice quads/almost quints
>>
This is why I'm glad I learned C as my first language.
>>
>>51689990
>>51689999
You can't do
print("Hello " + "World"); 
in C so you're wrong.
>>
>>51690020
char* h = "Hello ";
char* w = "World";

printf(h + w);
>>
>>51689984

Are you implying structures are not real data types?
>>
>>51686231
that doesn't work bitch
>>
>>51690003
Thanks

>>51690044
They aren't built-in. If a string is built into a language, it is an actual string, even if that language was implemented in a language that doesn't have real strings.
(this is what they actually believe)
>>
>>51690020
Either 13, handicapped/web dev, or pretending to be retarded.
>>
>>51690043
>posts code without testing it
>>
>>51690020
>>51690043
try
printf("Hello" " world\n");
>>
>>51690095
for fucks sake C
you cant add two fucking pointers heyzeus christ
>>
>>51689631
Yes anon. First you sort the array, then you print the last 500 elements.
>>
>>51690062
>They aren't built-in.

Bruh..
>>
File: 1448517428438.jpg (60KB, 500x500px) Image search: [Google] [Yandex] [Bing]
1448517428438.jpg
60KB, 500x500px
>>51689391
>>51689474
Anyone understand how to do this z210? P-please, I just want to understand how this works.
>>
You know when you've just fapped, then take a piss, and some urine get into the sperm tracts and it burns like hell?
Getting that right now.
>>
>>51690253
Yeah. Body wash sucks too.
>>
>>51690062
>They aren't built in
>If they are build in.. they aren't built in
... whoa...
>>
>>51690365
Heh, all of my posts here were facetious, but you misunderstood: if Python is implemented in C for example, and Python has the built-in string type, then Python does have real strings, while C does not, because it had to be built in order for Python to use.
I sound like an irrational theologist right now.
>>
350 posts and you're just gonna let it die?
>>
Looking for a little basic help with jscript\CSS.

I have a list of objects set out like:
Name
description
item id (in text, not an actual id)

I have a nodelist that I'm filtering down, I want to filter it further based on any itemid that's less than a threshold. I can access the text with class.innerhtml and I can turn it into a workable integer with parseInt. Thing is I've been using getelementsbyclassname and queryselectorall to filter the list and they only really want to work with strings.

I figure I can call parseInt and contain .innerHTML within a variable as a number, great; but how am I supposed to use that to filter my nodelist? Is there a selector function that will accept variables, and allow me to check it against another number?

This is my first time scripting anything and it's hard to put into words what my issue is, hopefully I came across alright.
Thread replies: 352
Thread images: 33
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK