Previous thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
>starting a thread with Sup Forums material
I can't wait to see 310 shitposts.
Working on making data look pretty.
kys, op
uh... can you not with this OP pic? Sup Forums is a pro-Hillary and left wing board
Number guessing game
11
Do I win?
Don't post in this Sup Forumsshit thread.
It's pretty likely that this thread is going to be deleted by a janitor anyway.
>Draw a girl
>Call it a boy
no one reply to this thread, it's made by a fucking racist
Dear /dpt/,
I have this IntPtr in C# which is a pointer to a buffer
And now I want to read the data there as a struct without copying or using Marshal
I currently do this using MY_STRUCT* my_struct = (MY_STRUCT*)ptr_buffer;
However, this gives me an array when I only really want a single struct for simplicity
Is there any way I can do this in C#?
sage
if you reply to this thread you implicitly support white supremacy and are human scum just stop
>draw an underage girl
>call her 18 years old
I implicitly support robot supremacy though
Actually, it's a girl who identifies as a boy, and thus being dressed like a girl is cross-dressing.
Your favorite programming language is shit.
I'm honestly curious about your project if you're resorting to unsafe memory management in C#.
What is your reasoning for doing this?
Who are you quoting?
we are, look at the replies in this thread, everyone hates bigots like Drumpf
I use unsafe everywhere in C# because it's faster and easier for me
In this case I'm just handling raw input from gamepads though
>bigots like Drumpf
>Drumpf
are you making fun of his heritage?
racist!!!!!!!
We want more Indians to be imported so we can look good in comparison and get promoted
>thinks you can be racist towards whites
lol
>everyone
you mean the butthurt shillary samefag
>everyone hates bigots
agreed
Trump is less hated than Hillary, and I'm not even a bigot. :^)
trump will still allow LEGAL immigrants
NO FUCKING C# FAGS
NO FUCKING UNITY FAGS
AND ABSOFUCKINGLUTLY NO FUCKING WINDOWS FAGS
KEEP THIS FUCKING THREAD CLEAN OF FILTH
For fucks sakes, since you newfags apparently need to get the fucking message AGAIN
>we do not want your cancer
>half of the posts in this thread are already solely political and not programming related
>not everyone that doesn't want your fucking company is part of one big conspiracy
>no amount of fucking ironic shitposting that isn't even fucking bait at this point will change this
>pepe and wojak posters are normally robots
You've already got your own fucking board and subreddit (>and), fuck off.
I seriously hope this thread is deleted quickly before more ACTUAL programming posts are pointlessly made in this stupid fucking Sup Forums thread.
you're the one shitting up the thread fucking idiot
Why do you hate C#?
For a shit language it's not completely shit, certainly miles better than Java
>certainly miles better than Java
epic
t. NEET who exists only to fiddle with conf files
How would this work with boxed objects?
What do you mean?
There's no boxing/unboxing that way
>I'm retarded so everyone else must be
C# is a good language, faggot.
t. projecting NEET
I mean how could you memcpy into a boxed object
Well, you can just write boxed_object = unsafe_array[0];
At least if it's a value type
>write unportable js, python ...
nobody gives shit
>write unportable c
everybody's getting buttmad
If you use anything else than gcc for c then you might as well just kill yourself
I am trying code web app in Java for { game }. The { game } take input two integers and give output sum of two integers... I try implementing with Builder pattern but no avail. Please tell what are design patterns very suitable for this problem ? Thank you kindly for help.
liftM2 (+) (read getLine) (read getLine)
Java doesnt have pointers they said...
public class Pointer{
T item;
public Pointer(T item) { this.item = item; }
public T get() { return item; }
public void set(T item) { this.item = item; }
}
public class Swap{
public static void swap(Pointer a, Pointer b){
Pointer temp = new Pointer(a.get());
a.set(b.get());
b.set(temp.get());
}
}
also 404 captcha
Reminder that pointers are just array indices, and as such they form a comonad
(+ (read) (read))
lmaoing @ ur lang
Heard of boxing/unboxing?
it's called purity senpai
THIS
I want /dpt/ to stay pure at least.
>linux
>pure
This is like having to chose between wolf and dog poo to eat for dinner.
Tard monkey.
Any free as in freedom OS is considered as pure. Proprietaryfags are the cancer of humanity and of this thread.
It's only pure because nobody will ever bother running it.
>Proprietaryfags are the cancer of humanity and of this thread.
There's a lot of very good proprietary software, though.
No, it's called faggotry. Lisp unlike Haskell assumes you have a pair and a brain, and instead of making you tiptoe around the most basic operations to get shit done, provides you with the power to play with the compilation and even the parsing of programs to build the layer of abstraction you yourself want to work in, not that of the language.
No, "good" and "proprietary" very rarely can go together.
{-# LANGUAGE TemplateHaskell #-}
Shut up you hypocritical power-misusing cultist liar, my ideology is better and truly free and I spit at (((((((you)))))))
>he never used Control.Lens
user...
What?
Lenses are a shitty meme
Too bad no one actually uses it for anything worthwhile. But then again, neither do they Haskell.
>can't read my own code
W-what books do I get.
Are you sure it's your code?
>not nowing the flamewars of ancient days by heart
Pitiful, user...
But yet I shall enlighten thou!
osnews.com
Its Java. It's become a convolution of nested if statements and method calls. Here's a snippet.
else {
if(toCheck == "ENTER"){
textData.newLine();
if(textData.lineCursorIsIn >= 0){
textData.incrementLineCursorIsIn();
}
ourCursor.locationX = 0;
ourCursor.locationY = ourCursor.locationY + ourCursor.heightOfEveryOtherCharacter();
}
if(toCheck == "BACK_SPACE"){
if(textData.backSpace()){
textData.decrementLineCursorIsIn();
if(textData.lineCursorIsIn < 0){
ourCursor.locationY = ourCursor.locationY - ourCursor.heightOfEveryOtherCharacter();
}
ourCursor.locationX = textData.getSizeOfLineN(textData.lineCursorIsIn) * ourCursor.widthOfOneCharacter();
}
else{
textData.decrementLineCursorIsIn();
ourCursor.locationX = ourCursor.locationX - ourCursor.widthOfOneCharacter();
}
}
if(toCheck == "ESCAPE"){
textData.displayAllText();
}
if(toCheck == "SPACE"){
textData.addCharacter(" ");
ourCursor.locationX = textData.getSizeOfLineN(textData.lineCursorIsIn + 1) * ourCursor.widthOfOneCharacter();
}
}
...
Name better IDE?
>u cant
My heart hurts reading the retarded comments
Emacs
Abstract that shit out.
That entire block you just posted that's apparently sitting in an else could be put into a method called "KeyCheck" or something.
Personally, I find Allman-style brackets easier to read for things like this.
Since you said 'very rarely', it must mean you think there is proprietary software which is good.
Give some names.
Depends on the language you're using and if you limit yourself to any particular operating system.
Working on this:
So it is a "me" problem, is there not a book for something like this.
That's the plight of uns Übermenschen mein Freund... But don't lose faith: the Dark Age is over, iff We want it.
how to fix this asp.net error?
>The type or namespace name 'SubscriptionDetailEventArgs' could not be found (are you missing a using directive or an assembly reference?)
am i missing a .dll file?
Try learning English first, Pudoo.
>it must mean you think there is proprietary software which is good
It may or may not be, as I am not an artist I can't know however people have multiple times claimed the superiority of Photoshop in comparison to other free software, however the people I know who made these comments did not try krita so it might be incorrect.
wrote a small python script to fix playlists exported from audacious, so that they're playable on my Fiio X1
>am i missing a .dll file?
Yes, and probably a using statement.
You're using some sort of shopping cart library and you don't have the library available.
Object references are kinda like pointers anyways. Why is this necessary?
>a.set(b.get());
Disgusting.
Kill yourself:
So Rufus for Linux? Noice, but did you get anything working yet or did you start with slapping a GUI together with QtDesigner?
You go first.
>design patterns
>Java
It's pasta, faggots.
>its pasta
kys
Started it last night, the GUI is finished, now working on device discovery from /sys/block.
Meanwhile in C++:
template
void swap(T& a, T& b)
{
T tmp{std::move(a)};
a = std::move(b);
b = std::move(tmp);
}
Protip: Java7+ supports switching on strings.
Meanwhile in a codebase of somebody who actually knows how to C++:
std::swap(a, b);
Cool, cool. You should probably change the button labels in the log window though, as in, make them just "Clear", "Save" and "Close" since the "log" seems a bit verbose and redundant in the context of the log window.
template
void swap(T&a, T&b)
{
T temp=a;
a=b;
b=temp;
}
Doesn't take advantage of move semantics.
so? like i give a fuck you fucking nerd
Creative software is really where proprietary software shines. Audition, Vegas, Photoshop, etc.
All very good.
x,y = y,x
Python Meisterrasse
Meh, its like that on the original.
how's your riffle?
OMG OPTIMIZED
void swap(int&, int&):
pushl %ebp #
movl %esp, %ebp #,
subl $16, %esp #,
movl 8(%ebp), %eax # a, tmp88
movl (%eax), %eax # *a_2(D), tmp89
movl %eax, -4(%ebp) # tmp89, tmp
movl 12(%ebp), %eax # b, tmp90
movl (%eax), %edx # *b_4(D), D.5140
movl 8(%ebp), %eax # a, tmp91
movl %edx, (%eax) # D.5140, *a_2(D)
movl 12(%ebp), %eax # b, tmp92
movl -4(%ebp), %edx # tmp, tmp93
movl %edx, (%eax) # tmp93, *b_4(D)
nop
leave
ret
void swap(int&, int&):
pushl %ebp #
movl %esp, %ebp #,
subl $24, %esp #,
subl $12, %esp #,
pushl 8(%ebp) # a
call std::remove_reference::type&& std::move(int&) #
addl $16, %esp #,
movl (%eax), %eax # *_4, D.5158
movl %eax, -12(%ebp) # D.5158, tmp
subl $12, %esp #,
pushl 12(%ebp) # b
call std::remove_reference::type&& std::move(int&) #
addl $16, %esp #,
movl (%eax), %edx # *_9, D.5158
movl 8(%ebp), %eax # a, tmp93
movl %edx, (%eax) # D.5158, *a_2(D)
subl $12, %esp #,
leal -12(%ebp), %eax #, tmp94
pushl %eax # tmp94
call std::remove_reference::type&& std::move(int&) #
addl $16, %esp #,
movl (%eax), %edx # *_13, D.5158
movl 12(%ebp), %eax # b, tmp95
movl %edx, (%eax) # D.5158, *b_7(D)
nop
leave
ret
burger king
Intellij IDEA, of course.