Old thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
I can, but then again, I have a pretty big dick...
I really hope you didn't think that was a gotcha moment
i use my big dick to fuck and cum into my computer
I use mine to slap your mouth
Working on your mum, OP.
Reminder that C programmers are good at wanking, all alone.
6th for Go.
More like Go fuck yourself, am i rite?
No, this was obviously UB. But the retards who unironically recommend C don't even know the basics.
It's not UB. Don't question the size of my dick. You don't want to get raped again.
>am i rite?
no
>obviously UB
>obviously
pretty big word for a dipshit that doesn't know C
Is there a better language than C to use in developing my robotic dildo?
Riddle me this batman
#include
int main()
{
int x=1;
std::cout
haskell
any particular reason?
But seriously, rust. It's pretty much as fast as C, but you don't get memory bugs and you get to work with ML constructs instead of mucking around barely above the ASM level. It also has all the primitives you need for any low-level task, so it's a great fit.
Yeah, that's a part of C/C++ that is just fucking stupid. But then again, it couldn't be easier to avoid.
>"new" dev software for campus computers
> Borland C++ compiler
Its like calling with a rotary dial phone. Who the fuck still uses Borland C++?
Fact: C is undefined behavior.
BTFO
T
F
O
Is it actually Borland C++ or is it the newer Embarcadero tools?
Whats going on here?
Why 1 as the second output?
learn not to be fucking stupid nigger
that's undefined behavior
Any half competent monkey should be able to do that. You can't? Then C is clearly not for you!
could y'all post your dick pics? interested here.
The new Escobar tools. Do they have any relevance today?
I really hoped for access to Intel XE when they announced a "brand new expensive compiler suite"
>Do they have any relevance today?
They're actually pretty good, yeah. The delphi stuff was always better than the C++, because it was Borland's bread and butter, but the RAD tools are nice.
I last showed off my level editor program for game maker a few weeks ago. Ive been busy moving so I havent been able to make much progress but I have focused a bit on aesthetics the past few nights and Im pretty happy with how it has been turning out so far. All of the colors are variables so I can change them all very easily. I made it match my windows color so it would blend together more nicely.
So what do you Sup Forumsents think?
What cross-platform GUI framework could I use for linux-based audio applications development? QT is too slow (I need microsecond precision for events) and JUCE's linux support is shit right now
Looks very barren for a map editor.
looks like shit desu jason
Have you considered GTK?
Heres another picture where you can see the properties and tab (thats not finished). I also changed the window color to show how the aesthetics work.
Yeah the objects tab shows the list of spawnable things and I accidentally deselected the default object so you cant see the settings. Fixed in pic related.
:( Any tips for improvements? Also I named the project Jason Lee because its short for JSON LEvel Editor. Its not my name.
STFU OSGTP
looks pretty bad.
Oh and here's a demo of the last update if you missed it. It is uglier but shows how it works.
I prefer this one desu.
Mind if I ask why? What about it do you prefer?
It doesn't hurt my eyes. Can you actually drag stuff around instead of clicking on the coordinates?
Their Delphi stuff looks really useful given that I havn't heard anything about Pascal or Delphi for over a decade.
I don't think Delphi is very popular any more. Still, it'll be fun to tinker with.
Yes you can. You can drag them, click the coordinate to type it in, or scroll the coordinate to make it change by the change amount which is what I prefer to do. In my recent update I added a toggle that combines the X and Y as well as the Xscale and Yscale so you can scroll the x or shift scroll the y. Thats my favorite and feels more like photoshop.
It looks weird when you add the outline to the selected object, the object looks bigger than it actually is. It would be better to put the outline on the edge of the object, not next to it. Or use dotted or dashed lines for the outline.
It's actually quite nice once you see how it works, I'll take my criticism back. But still, I slightly prefer the colors on the GIF.
I think companies will refuse switching to other tools when Delphi even supports Android now
ignore OSGTP
Well, that's the thing -- many places have already switched.
Thats a great idea. The outline was bothering me before so I made it so it would blink white instead of that weird dark color. I am about to record a new demo so you can see what Im talking about. Great suggestion tho; I would love to see it on the inside.
Thanks :D I usually roll with a dark theme on my computer and thats just the colors I grabbed from windows and the material design guidelines. I plan on making the default colors for a light theme but since Im the only one using it at the moment that what I set.
How do I change a 1 dimensional array into a 2D one?
For example I have an array of 100 0s and I want to split it up into 10s
ignore urself u fucken faglord
Stick to the dark layout. the light version will burn your eyes if you work at night without flux
I'm using python if it matters
#include
#include
int fact(unsigned int n)
{
if (n == 1 || n == 0) return 1;
return fact(n - 1) * n;
}
int main(int argc, char *argv[])
{
if (argc != 2) {
fprintf(stderr, "%s \n", argv[0]);
exit (1);
}
int i = atoi(argv[1]);
unsigned int j = fact(i);
printf ("!%d = %u\n", i, j);
return 0;
}
I can't get it to go higher than !31 because the number gets too large, what can I do?
(its running on a rpi)
libgmp
I have not. Thx user :)
But why?
Write or find a bignum library.
Because he is stupid and suck at coding.
Order of evaluation is implementation defined
also
>iostream
Stop shitposting at me you weirdo.
Trying to learn Scala and functional programming
>CannotQuack
>+quack()
The absolute madman!
Yeah the contrast burns my eyes but whatever I just changed it while I recorded the demo. I have the light theme set first then my personal dark overwrites the variables. When I want to switch I just comment out my color change.
Without further ado, I present a demo of the current state of Jason Lee
From suckless.org
>GMP - GNU’s bignum/arbitrary precision library. Quite bloated, slow and calls abort() on failed malloc
>Alternatives: libtommath, TomsFastMath, MPI, libzahl (WIP), hebimath (WIP)
Why is all the text in your interface so large and bold?
I think it would look better to use monospace fonts for the object names and properties.
Also,
>Sup Forums
anybody?
STFU
you cycle it appropriately in a for and assign the appropriate values to the new 2D array
you can map 1d indexes to 2d:
arr_2d[y,x] = arr_1d[y * width + x]
where width is the width of the 2d array.
someone explain this
#include
int main()
{
int a = 1;
printf("%d %d %d %d\n", a++,a++,a++,a++);
return 0;
}
output
4 3 2 1
rewriting C with the haskell kernel
you can compute 1000 factorial in C using strings.
my program runs in a millisecond computing 1000 factorial
go learn assembler and use a disassembler
My guess is that as the parameters get pushed onto the stack, they get evaluated. Stack then looks like this
1
2
3
4
Then they get printed from left to right in the parameter list, resulting in the behavior you see there. Spitballing here though
haha yeah ok lol
Is this true?
I want to change my job and this looks like a good opportunity.
What are the most useful/requested languages to learn?
I'm currently learning HTML to start with, and plan Java or Javascript next (I know the 2 are not similar despites the name, so which one would be more useful for real situations, like, let's say developping smartphone apps or games)?
Unsequenced modifiers, the exact order of operations in your example is not defined in the standard, so it's up to implementation of the compiler. I think gcc outputs 1 2 3 4. Use -Wunsequenced to warn you when it happens. Easy workaround is to simply split up the line in four lines. It's a little annoying but usually not a big deal.
...
Tried out Ubuntu Mono nonbold size 11. The issue is that without bold it looks blurry for me for some reason. It is more noticeable with a dark theme under it. There is something in the way that GM:S processes fonts that makes them look stupid.
Recommendations for a different mono font?
actually it runs in 0m0.031s
my bad
pic related
post code
Use long (or uint64_t or whatever) to go further or use a library for arbitrary precision like others suggested. Advanced option: Implement a simple one yourself for this purpose. It's simpler than it sounds and very fun in C++. Not so much in C though.
oi lad, what's your font there?
wingdings
its closed source :^)
>oi lad, what's your font there?
in the terminal is "ProFontIIx Regular" size 7
on sublime text in the default one that comes with sublime
Try Bitstream Vera Sans Mono
>inb4 he set a string with the value of 1000!
>in the terminal is "ProFontIIx Regular" size 7
Thanks.
Make a snap to grid toggle m8.
no, just replying to the 2nd question, by telling him to ask there instead
here is something I just did.
int buff[1024];
int main(void){
int i, j, r, t;
buff[0] = 1;
t = 1;
for (i = 1; i < 1000; i++){
r = 0;
for (j = 0; j 0){
buff[j] -= r * 100000;
}
}
if (r > 0){
t++;
buff[t] = r;
}
}
for (i = t; i >= 0; i--) printf("%05d", buff[i]);
return 0;
}
No idea about performance though
Some online compiler says
real 0m0.005s
user 0m0.003s
sys 0m0.001s
very nice. its better than mine
oh wait, t should be initially 0. it doesn't really matter though.
who /javaEE/ here?
Ugly code, but neat idea. Also it should be
for ( i = 1; i
Whoops, missed that too.
here is one with long long
#include
long long buff[1024];
int main(void){
int i, j, r, t;
buff[0] = 1;
t = 0;
for (i = 1; i 0){
t++;
buff[t] = r;
}
}
for (i = t; i >= 0; i--) printf("%05d", buff[i]);
printf("\n%d", t);
return 0;
}
time is a bit chaotic but total time is ~0.012 for 2000! 32 bit version takes ~0.018s
It can go slightly faster if it were using base 0xFFFF instead of base 100000 but that would be a pain to print in base 10 and printing it would probably take more time than actually calculating it.
can someone give the TL;DR version of the argument you had about pointers
why wouldn't it be possible to convert a pointer to an integer and the integer back to pointer
It is possible, the user who argued otherwise is wrong.