[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
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 19
File: pair_programming.png (198 KB, 640x480) Image search: [Google]
pair_programming.png
198 KB, 640x480
Daily Programming Thread

What are you working on, anonymous ?

# New & Revised /dpt/ Code of Conduct #
We want to ensure that the /dpt/ community, while large and diverse, remains
welcoming and respectful to all participants. To that end, we have a few
ground rules that we ask people to adhere to.

- *Be friendly and patient.*

- *Be welcoming.* We strive to be a community that welcomes and supports
people of all backgrounds and identities. This includes, but is not limited
to members of any race, ethnicity, culture, national origin, colour,
immigration status, social and economic class, educational level, sex,
sexual orientation, gender identity and expression, age, size, family
status, political belief, religion, and mental and physical ability.

- *Be respectful.* Not all of us will agree all the time, but disagreement
is no excuse for poor behavior and poor manners. We might all experience
some frustration now and then, but we cannot allow that frustration to turn
into a personal attack. It’s important to remember that a community where
people feel uncomfortable or threatened is not a productive one. Members of
the /dpt/ community should be respectful when dealing with other members as
well as with people outside the /dpt/ community.

- *When we disagree, try to understand why.* Disagreements, both social and
technical, happen all the time and /dpt/ is no exception. It is important
that we resolve disagreements and differing views constructively. Remember
that we’re different. The strength of /dpt/ comes from its varied community,
people from a wide range of backgrounds. Different people have different
perspectives on issues. Being unable to understand why someone holds a
viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human to
err and blaming each other doesn’t get us anywhere. Instead, focus on
helping to resolve issues and learning from mistakes.
>>
Got a weird bug, which I'm pretty sure is a logic error on my part. Anyone wanna help?

Language is Swift.

When I run this code in a Cocoa interface, it saves the value as a string and makes it the placeholder text instead of writing the value. The weird part is when I open the window back up, that value is the placeholder text, and when I submit it, it takes the value, just like I want it to do the first time around.

Effectively it causes a user interface bug where the user would have to save the api key, close the window, open it again, and click save again. Kinda weird.

import Foundation
import Cocoa

class SavePreferences: NSViewController {
@IBOutlet weak var apiKeySavedText: NSTextField!
let defaults = NSUserDefaults.standardUserDefaults()
var apiKey = ""
var apiKeyTitle = NSUserDefaults.standardUserDefaults().objectForKey("userApiKey")

//MARK textfield for api key
@IBOutlet weak var textFieldApiKey: NSTextField!

//MARK save API Key as default preference
@IBAction func btnSaveApiKey(sender: AnyObject) {
self.defaults.setObject(self.textFieldApiKey.stringValue, forKey: "userApiKey")
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { () -> Void in
self.defaults.synchronize()
print("apikey saved as", self.apiKeyTitle)
}
apiKeySavedText.hidden = false
}


override func viewDidLoad() {
super.viewDidLoad()
apiKeySavedText.hidden = true
if(self.defaults.valueForKey("userApiKey") != nil) {
textFieldApiKey.placeholderString = self.defaults.valueForKey("userApiKey") as? String
}
}

}
>>
>>52987029
I'm just working on this stupid fucking program that makes it easier to dub/trip/quad post

http://pastebin.com/Y9yaDZBV
>>
>>52987056
>http://pastebin.com/Y9yaDZBV
that creates about 500 requests per second on my machine, nice DoS script faggot
>>
how difficult is manual memory management? I've been doing some programming in school , mainly java, and dabbled in assembly (in an emulator), but I'd like to get into c/c++.

can an average idiot like myself handle c++?
>>
>>52987095
You don't need to do a whole lot of manual memory management in C++
>>
>>52987029
>>>/u/ faggot
>>
>>52987095
Manual memory management is difficult when you start throwing around pointers and need to "save things for later."
In C++ this is made a lot easier with shared_ptr and unique_ptr but it's still quite difficult.

Try to write your own locking algorithms sometime. Pull out "Introduction To Algorithms" and implement the CLH/MCS lock in C++ with smart pointers.
>>
>>52987112
Damn reaction speed still matters though. There might be too much latency between the API data and the state of the board for this to work on faster boards.
>>
>>52987136
>Introduction to Algorithms
not this, but
>The Art to Multiprocessor Programming
This book was written in a Java context, so some features may require the use of Assembly (in particular an equivalent to x86 CMPXCHG8B or CMPXCHG16B) to implement in C++.
>>
>>52987095
[Code]
int *a = new int[100];
...
delete[] a
>>
>>52987050
Found your bug. You're using swift
>>
function factorialize(num) {
var factorArray = [];
var factorSingle = 0;

for(var i = num; i == 1; i--) {
factorArray.push(i);
}

factorSingle = factorArray.reduce(function(a,b) {
return a * b;
});

return factorSingle;
}

factorialize(5);


Why isn't my for loop working? Trying to make an array from 5 to 1 to multiply them and return the factorial.
>>
>>52987280
>i'm not smart enough to contribute non-autistically, so i'll just shitpost :^)
>>
Anyone familiar with matlab? Trying to pass a concatenated string variable into fopen but it keeps throwing errors at me. Doing a normal string like 'c/.../.../..txt' works but having a path string concatenated with the filename string doesn't
>>
>>52987354
>I'm not smart enough to do my own homework so I'll ask a North Korean Sexbot enthusiast fishing post
>>
>>52987333
i == 1 is your problem
>>
>>52987029
I totally forgot, but

Go fuck yourself, you braindead faggot.
Seriously.
>>
>>52987333
>i = num; i == 1;
GUISE WHY IS IT NOT WORKING????
>>
>>52987394

now THATS a capital meme, carry on mate!!
>>
>>52987418
Do you have to act like a retard?
>>
>>52987430
Stupid questions get stupid responses. Go fuck yourself dipshit.
>>
>>52987430
>WHY ARENT U DOING MY HOMEWORK G???

I bet you're CS trash.
>>
File: 0103.jpg (13 KB, 252x276) Image search: [Google]
0103.jpg
13 KB, 252x276
>>52987440
What if I don't?
>>
>>52987453
I'll force feed you my semen until you do.
>>
>>52987430
I mean the point is that you knew where the problem was. that your for loop wasn't working, but you didn't look into it enough to figure out why it didn't work. You could have tried printing the contents of the array after the loop, to see if it was working,
>>
>>52987095
Not difficult at all

c++ isn't really a crazy language either, it comes with a load of bulky libraries that do shit for you. If you can program in Java, you can do C++.
>>
>>52987333
Because you're not using recursion :^]
def foo(a):
if a==1: return 1
return foo(a-1) *a
>>
>>52987463
You promise?
>>
File: XadkW.jpg (705 KB, 3473x1954) Image search: [Google]
XadkW.jpg
705 KB, 3473x1954
Programming some ultralight beams that I saw last night in my god dream
>>
>>52987507
You don't even need recursion
def fact(n)
(1..n).reduce(:*)
end
>>
>>52987526
I'm not prepared for those kinds of commitments.
>>
>>52987561
BLASPHEMY
>>
>>52987571
In ruby, reduce and inject (they're both the same) it's implemented as a for loop.
>>
>>52987029
Not to shitpost, but fucking really? What is this code of conduct shit?
This isn't Reddit or Github, fuck off with this shit
>>
>>52987661
It's a commentary on that you sperg.
>>
>>52987669
Oh fucking hell
Disregard that, I suck cocks
>>
>>52987661
It's supposed to be for irony, but no one seems to realize that it's not funny and that there really is people stupid enough to take it seriously.
>>
>>52987661
Fucking irony is dead.

REEEEEEEEEEEEEEEE
>>
>>52987669
>>52987796
>>52987820
>Any community that gets its laughs by pretending to be idiots will eventually be flooded by actual idiots who mistakenly believe that they're in good company.
>>
>>52987796
ironic shitposting is still shitposting, it's not funny, and at worst you're just enabling/encouraging real zionist sjw faggots
>>
>>52987876
there is literally nothing wrong with having a CoC
>>
>>52987967
Prime example of >>52987876
>>
>>52987967
>CoC
>reminds me of cock
TRIGGERED
>>
>>52987029
Good books about database engineering?
>>
>>52987029
>New & Revised /dpt/ Code of Conduct
>>52987967
EAT SHIT, GO CHOKE ON A BOWL OF DICKS AND DIE YOU COC LOVING FAGGOTS

>>52987661
>>52987796
>>52987876
>>52987882
stay vigil, brothers
the cancer is spreading
>>
>tfw your variables don't line up

help
>>
I could never feel safe coding unless I had proud feminists protecting my feelings.
>>
>>52988199
I never feel comfortable coding unless I'm wearing a schoolgirl outfit. :3
>>
>>52987095
>>52987503
You can always run the program through valgrind to see where you fucked up.
>>
Reminder that good solutions are better than bad solutions.
This may already seem extremely obvious, but /g/ often forgets this when they suggest functional or OOP solutions to any problem.
>>
>>52987095
The larger your program, the worse it gets.
>>
>>52987998
>database engineering
lmao
>>
>>52988402
what good solutions? for non-trivial problems you will have state and you should group things in structs/namespaces at the very least which is kind of OOP
>>
>>52987376
how can it be homework when I'm a NEET?
>>
>>52987095
You allocate memory and you free memory.
How hard could it possible be?

>assembly (in an emulator)
>(in an emulator)
Oh right, you're retarded, but don't worry! manual memory management is easy even for dumbfucks!
>>
Is it true that C++11 supports garbage collection?
>>
>>52988459
the implementation is not required to support it
>>
>>52988435
OOP as in what you'd see in C++, C#, or Java.
The OOP you'd find in C is technically OOP, but it's the only acceptable form of OOP.

And functional as in the functional you'd find in haskell.

These are what's know as bad solutions.
>>
>>52988459
yes, it's because the language is garbage itself

> 2016
> still using a language that can't even average integers
>>
>>52988471
lol k tard
>>
>>52988256
...what kind?
>>
>>52988478
Enjoy knowingly implementing bad solutions when good ones exist and you know it.
>>
>>52988486
enjoy being stuck in the 1980's and you know it
>>
>>52988471
>C++ classes aren't objects
>can't get a pointer to a C++ class
>can't check if one class is a subclass of another class

If C++ is object-oriented, then Python is functional.
>>
>>52988425
?

I want to write one for fun and learning, what's wrong with that?
>>
>>52988494
Are you saying 1980's solutions are good solutions?
Well whatever, it doesn't matter, the truth still stands than good solutions are better than bad solutions no matter where they came from.

I think you're also trying to imply that old things are bad, which isn't true and childish to think so.

>>52988508
I didn't say C++ was a good object oriented language.
>>
>>52988518
>good things are better than bad things
what are you even on about, tard
>>
This is the state of /dpt/ today.
They're actually arguing against good solutions and for bad solutions.
Who the hell argues for bad solutions? /dpt/ everyone.
>>
Give me a good reason to use private ever.
>>
>>52988536
you're a fucking retard
>>
>>52988529
Yes, that's exactly right. Good things are better than bad things, following that logic, we come to the solution than OOP and functional solutions are bad solutions.
It is really quite simple but this is something /dpt/ seemingly doesn't understand, that good things are better than bad things.
>>
>>52988543
>do my homework for me
>how do i google
kill yourself
>>
>>52988543
Because you're a naughty gurrl who can't be trusted to obey OO paradigms
>>
>>52988551
you either have severe assburgers or you should fuck off back to /b/ with your epin funposts
>>
>>52988553
Homework? Nigga just tell me why I shouldn't set everything to public. Do you hate freedom?
>>
>>52988558
So if I understand your argument correctly, you're saying that bad things are better than good things?
Why do you suggest so and do you have anything to support this claim?
>>
>>52988560
don't expect me to spoonfeed tards all the time

one of the major points of using OOP is for encapsulation. like if you have a car, do you drive just the bare chassis? no you have a body and an engine hood to cover the car so some fuck can't just pull out the spark plug or whatever so your car gets all fucked up
>>
>>52988580
Stop replying to him you stupid fuck.
Jesus christ I'm pretty sure you're the one actually baiting me to respond to you.
>>
Give me the hardest puzzle you got and I will solve it in less than 10 seconds.
>>
>>52988580
But you CAN open a car and pull out the spark plug.
>>
>>52988591
x86 emulator.
>>
>>52988589
>falling for the double bait
>>
>>52988594
not without breaking into it (using reflection) if you don't have the key
>>
>>52988580
So what you're saying is I should write my OO code to be fully public, then write a fully public OO wrapper on top of that code that handles all the stuff for you. That way you can use it without getting into the details, but you CAN go deep and fuck with the details if you want.
>>
>>52988543
In C++, private members are part of the class's public API. When you change your privates, all clients of your class need to be recompiled - you can't just drop in an upgraded version of your C++ library and expect it to work.

Not without the insane acrobatics of declaring all of your public members in one class, declaring all of your privates in another, and having the public class merely contain a pointer to the private class whose type isn't exposed in your API.
>>
>>52988598
Serious replies only please.
>>
>>52988543
>programming illiterate
https://code.org/
>>
>>52988617
Maybe.
>>
>>52988617
you can still fuck with the details of the private implementation

are you even trying to understand
>>
File: puzzle.png (237 KB, 742x476) Image search: [Google]
puzzle.png
237 KB, 742x476
>>52988591
>>
HELLO FROM THE OTHER SIDE
>>
>>52988650
I meant programming puzzles.
>>
>>52988636
Great, I knew OO was the solution to OO.

>>52988640
How? They're private, you'd need to do some dumb shit.
>>
>>52988626
Okay, I will be serious now.
Fully PC compatible VM with support for all common interfaces including DMA & PCI(E) and peripherals including a VGA compatible device and input.
x86 virtual CPU included and support for SSE and virtualization extensions.
All of this must be fully compliant and capable of running MS Windows, Linux, and *BSD and speeds comparable to vbox or qemu.

You said you wanted my hardest challenge, so here it is and hurry and and solve it in 10 seconds.
I'll be waiting, faggot.
>>
>>52988657
you as the programmer can change the private implementation. if you're merely using the object without changing its implementation, you can't use private methods and variables except with reflection
>>
>>52987029
plz, can you give challange boss plz


Can a nice 4chan cunt post all current programming challenges?

from
>Some cunt who wants the fucking challenges.
>>
>>52988591
Write a program that will determine if any arbitrary program will complete a computation on a given input.
>>
>>52988675
Yeah but what if someone needs to use a private variable to solve a problem or make my program behave in unexpected but beneficial ways? I think it's optimistic to believe your code is perfect and that implementation needs will stay the same forever.
>>
>>52988692
the private implementation may change in future versions which is one of the reasons they're set to private, so you don't have to worry about them. if you need functionality that the public interface can't offer then make your own implementation or use reflection.
>>
Getting decent cache efficiency seems to do about twice as well as normal blocking. Trying to get intrinsics in, or doing loop unrolling, however, makes things worse :(

But at least I've optimized this shit well enough to get a passing grade...
>>
It's funny how when you think about functional programming and have a laugh but then you realize that functional is actually a real paradigm that people use, and then you lose all faith in humanity.
>>
>>52988777
you are trying too hard
>>
>>52988809
it's true though
>>
>>52988809
You're not trying hard enough.
>>
Has anyone used my VichanSharp library? I posted it yesterday, wondered if anyone had a chance to try it out and has any feedback.

It's on NuGet and GitHub so having people contact me with bugs and feedback is obviously never going to happen.
>>
>>52988591
average 2 ints
>>
>>52988853
In D
>>
>>52988872
>D
XXXDDDDDDDDDDDDDDDDDDDD
EPIC MEME BRO

LOOK HE POSTED THAT LE EPIN FUNNAAAY MEME AGAIN GUYS LOLOLOLOLOLOLOLOL
>>
>>52987029
>that coc
Words cannot hurt you. Fuck you, nigger, chink, spic, gook, kike, wop, faggot, cunt, kimchi, slope, redneck, retard, pansy. Are you feeling hurt?
>>
>>52988777
Functional programming and object oriented and other ways programming are just tools. You may use one in one in one part of the project and another in another part of the project that might benefit from it. Learn how to encapsulate your shit and it shouldn't matter.

Languages who force you into a "paradigm" are shit and should feel shit, learn C++ (tm) today!

Also, >>52987998 anyone?
>>
boards.4chan.org/g/thread/52987029

I want to get the board ID out of this URL, any ideas? I've never been very good at string manipulation.
>>
>>52988914
>are just tools.
Imagine if someone created a tool that is completely and utterly useless and only breaks whatever it works on.
That is OOP and functional programming.
>>
>>52988922
if (url.IndexOf(@"/g/") != -1)
board = @"/g/ - Technology";

Always use the simplest option.
>>
>>52988922
strncpy(id + strlen(strerror(ENOMEM)), url + time(0), getpid());

That should do it.
>>
>>52988930
Object oriented programming is nothing more than thinking about the objects before thinking about what they can do.

Functional programming is nothing more than thinking about programming elements through the actions available to them.

You, like most, do not know what you're talking about.
>>
>>52988957
I agree with what you're saying, but to maintain the goalposts of my previous posts, you are still wrong.
>>
include <stdio.h>

int main(void) {
printf("Potato\n");
return(0);
}


I am smart now thx guys if any question just ask me i can answer anythin
>>
>>52988972
What fucking previous posts? Were you attacking the concept or weren't you? You spoke about the functional approach and the object oriented approach, so did I, are we not talking about the same thing?

>You're right, but you're wrong.
I dong get it, when did I ever contradict myself?
>>
PLEASE
>>
STOP
>>
>>52988994
awwww fook i forgot the hashtag pound symbol ###################
>>
>>52988994
why aren't you using the objectively superior allman style?
>>
REPLYING
>>
TO
>>
ME
>>
>>52989007
tha wat
>>
>>52988995
>being bait that hard
just ask him what's his experience in both oo programming and functional programming.
>imba <10kloc projects
>>
>>52988972
Wow, what an enlightening post. That sure raised the standard of academic education throughout this forum.
>>
>>52989035
>being bait that hard
It's not like I don't hear people complaining about OOP and FP all the fucking time without them even realizing what those things entail. If this is bait it's not a very good joke.
>>
>>52988891
18+
>>
File: 1449756574386.jpg (3 MB, 3264x2448) Image search: [Google]
1449756574386.jpg
3 MB, 3264x2448
>>52988930
kill yourself idiot

let me guess, you would defend pic related? if not, then what paradigm do you think isn't shit?
>>
is there any relatively simple way to transparently hook code in a specific process in gnu/linux? the original code shouldn't be modified
the only thing i found was debug registers but those can't be used from user space
>>
>>52989441
I don't know why on earth you keep posting that image.
What the hell is it supposed to prove? It was written by a novice.
>>
>>52989476
What are you trying to accomplish?
>>
File: It's not possible ....jpg (152 KB, 1003x767) Image search: [Google]
It's not possible ....jpg
152 KB, 1003x767
>Iter, Map and Fold are a subset of ZipN's
>>
>>52987029
Why can't any language compete with Python in terms of concise code & libraries?
>>
File: IMG_20160215_115641.jpg (60 KB, 512x385) Image search: [Google]
IMG_20160215_115641.jpg
60 KB, 512x385
>>52988256
I am sat here very comfortably wearing a frilly maid outfit right now (very awkward angle looking down, so whatever), sipping Earl Grey tea in the early afternoon - and designing a key management system around Let's Encrypt out of #!/bin/sh shell scripts and openssl -checkend.

It's nice how they're implementing ECDSA support on the staging server. I can't wait for it to go live, but it does mean I will have to handle more than one type of cert and handle it carefully.

Fortunately, ACME is easy and there's plenty of work out there already for me to build on, it's really just a framework around that. Probably going to cron job it. Just deciding what, precisely, I need is really the hardest part here.
>>
>>52989604
>& libraries
C has way more fucking libraries than memesnake. In fact, if any library does not expose a C interface, you can consider it completely useless.
>>
Working on a polynomial calculator in Java for class. I've got all of it done besides dividing and trying to do it recursively is making me realize how incompatible it is with the rest of my code so I've gone back and rewritten a lot of it.
>>
>>52989580
hooking functions in a video game, so when the specific function is called it calls my function first

it's easy to do but it's easy to detect that the original code is modified so i need a way to hook it without modifying the original code
>>
>>52989642
Is the game engine stuff dynamically linked?
If it is, you could use LD_PRELOAD to overwrite their functions, do your crap, then call the original.
>>
>>52988650
I can only get 8, but not 9.

Do I get half a gold star?
>>
>>52989593
>ZipN is a subset of FoldN
>>
>>52989663
they aren't, i do that for glxswapbuffers so i can draw on screen
>>
>>52988650
>>52989670
Well shit, it would be nice if the text mentioned you are adding 3 lines to the 'M' and not just a blank canvas.
I thought it was just a stock "uncomfortable scientist" image.
>>
>>52989622
Jesus christ, iron your clothes.

2/10, shit maid, would not hire.
>>
>>52989709
I don't think there will be a way to insert code without modifying the original functions then.
>>
>>52989773
debug registers seem like they do what i want however they can't be used from user mode and most things i find about them on linux are about gdb, guess i will do some more research
>>
>1989
>1999
>2011
>still can't average 2 ints in 1 cycle
MEMORY
O
D
E
L
>>
>>52989561
then tell me what is so good then if both OOP and FP is shit

fucking retard
>>
>>52988670
already done
>>
>>52989711
you get a gold star, friend
>>
I'm taking Java classes in uni right now and my professor spends like half the class time talking about how shit Java is

Why is it so widely used if it's such a shit language?
>>
>>52989868
you have a shit professor
>>
>>52989868
it's not shit, it's just ahead of its time
>>
>>52989881
>Stuart Reges
>shit
He left Stanford after they caught him doing cocaine and selling alcohol to kids, seems pretty cool to me
>>
>>52989868
>Why is it so widely used if it's such a shit language?
Unfortunately, popularity has nothing to do with quality.
Sun/Oracle just marketed the shit out of it and it unfortunately stuck on with the ENTERPRISE.
>>
>>52989898
the quality of java is a matter of subjective opinion. there are tremendous benefits of using java vs other languages
>>
>>52989906
can it average 2 ints?
>>
>>52989906
And there are tremendous benefits in using other languages instead of Java.
>>
>>52989911
int avg(int a, int b) {
return ((long) a + b) / 2;
}


>>52989913
yes, like C++ for instance can be useful it you need to get the maximum performance.
>>
>>52989906
>>52989913
Also, if Java is so great to use, why does everyone who writes Java try not to write Java?
You have shitloads of JVM crap like Jython, Jruby, Scala, etc.
>>
>>52989920
You can't be sure that long is longer than int.
>>
>>52989920
int avg(int a, int b) {
return (int) (((long) a + b) / 2);
}


forgot java has strong typing (which is a good thing)
>>
>>52989930
in java, you can. that is also another benefit of using java. an int is always a 32-bit and a long is always a 64-bit 2's complement integer.

>>52989927
those are obscure hipster meme languages. the real deal is by far more popular than those languages.
>>
File: 1455155298915.jpg (29 KB, 500x335) Image search: [Google]
1455155298915.jpg
29 KB, 500x335
>>52989868
>>52989898
This, cucks took over the industry unchecked and made it the standard. Now everyone is churning out cucks from cuck university. C/C++ for life fsggots
>>
Is there a programming language that can't average 2 ints?
>>
>>52989938
python can't average 1 int
>>
>>52989935
>C/C++
Please stop grouping those two completely different languages together.

>>52989938
Any Turing Complete language should be able to.
>>
>>52989938
any turing-complete language can average two ints, just with varying difficulty
>>
>>52989946
>>52989948
can it do it in 1 cycle?
>>
>>52989934
I didn't know it was shit Java and not glorious C. Sorry.
>>
>>52989931
that's not strong typing.
>>
>>52989977
how is it not? you have to explicitly cast from long to int
>>
>>52990020
strong and weak typing is about when you can circumvent the type system or not.

what you are doing here is actually an unchecked cast. a safe cast would have an semantic like

(int)(x) =
if (x > max_int or x < min_int)
raise exception(...)
return x


https://en.wikipedia.org/wiki/Type_conversion#Type_promotion
>>
>>52987056
>http://pastebin.com/Y9yaDZBV
>upper case method names
MY EEEYYES...
>>
>>52990136
it's C#
>>
>>52989711
how the heck do you get 8 triangles using 3 lines on a blank canvas anyway
>>
File: 1455530658361.png (198 KB, 742x476) Image search: [Google]
1455530658361.png
198 KB, 742x476
>>52988650
BOOM
what do I win?
>>
>>52990203
Oh fuck, bottom left isn't a triangle.
end me.
>>
>>52990225
nor is the thing to the right of it
>>
File: 1442003693768.png (155 KB, 500x464) Image search: [Google]
1442003693768.png
155 KB, 500x464
>>52990233
that's what happens when you rush shit at work.
>>
Where the fuck is the Umaru-chan /dpt/?!?!
>>
Best language for a cross platform desktop/GUI-based application?
>>
>>52990299
C++ w/ Qt.
>>
>>52990299
Java w/ JavaFX
>>
>>52990311
>seeples
>gui
>2016
ishyggy
>>
>>52990299
JS w/ Electron
>>
>>52990299
java or C++
>>
>>52990299
Python w/ Tkinter
>>
>>52990299
c# w/ Windows® forms
>>
>>52990455
>cross platform
>windows forms
end yourself
>>
File: clip+(2016-02-15+at+05.50.59).png (210 KB, 742x476) Image search: [Google]
clip+(2016-02-15+at+05.50.59).png
210 KB, 742x476
>>52990243
here is my solution I think it's correct
>>
>>52990197
Stop thinking in two dimensions.
>>
>>52990299
Free Pascal w/ LCL.
>>
>>52990299
C w/ Average Memory Model in 1 Cycle.
>>
>>52990299
TypeScript w/ Node-Webkit!
>>
>>52990469
do you have a picture or anything
>>
>>52990299
HTML w/ CSS
>>
>>52990465
it works on windows 7, windows 8 as well as windows 10

it's cross platform
>>
>>52990530
>pajeet
>poo in loo
>designated
>>
>>52987095
Mystruct *Mystruct_new()
{
Mystruct *mystruct =
calloc(1, sizeof(*mystruct));
return mystruct;
}
>>
Please suggest some programming project ideas that would use Artificial Neural Networks.
>>
>>52990591
>calloc
webcuck detected
>>
>>52990622
something to do with image recognition if you don't want to work too hard
>>
>>52990622
robocode
>>
>>52990512
A sphere. A "straight line" drawn on a curved surface is still a straight line.

Two axis rings (e.g. prime median & international dateline, continued around the "back" of the globe) will split a sphere into 4 wedges. another axis ring (e.g. equator) across them gives you 8 half wedges.
Each wedge will be (from the original sphere's surface) an equilateral triangle with three 90 degree angles.
>>
>>52989441
>Shitting on my unfinished code
Wew lad
>>
>>52990660
Sorry, not the international dateline, but 90E/W from pole to pole. There isn't really a friendly name for it that I can think of.
>>
>>52990629
Give me a good reason to not use calloc, it's much better then malloc + memset.
>>
>>52990660
I understand non linear coordinate systems but I was under the impression that some image wouldn't ask me to compose shapes in non standard euclidean space

also saying "non cartesian" would have been more clear than "not 2d"
>>
Looking to make a home automation software, was going to use voice control to control the server but after contemplating I have come to the conclusion that a web interface would be more appropriate at this time.

I would like to implement the oracle web logic server into the website so that I can scale the software and learn the REST api in the meantime.

What would /g/ suggest coding the software in, I would like to use java for TTS, but other than that I don't know much about web development. The site needs to be scaleable as I will be using my main computer & phone/tablet/laptop to control the server.

Also I have plex installed on the server and would like to be able to control music from the website and get it to play through the server which is connected to my speakers... is this possible?
>>
>>52990754

If you want to use it to zero initialize a block of memory, I guess it's fine. Otherwise, the zero initialization is a small waste of time to do and you are better off with just overwriting the junk values from malloc, although in the grand scheme of things, it matters little.

The OS doesn't always guarantee it has a block of memory that is 0 initialized for you ready for your calloc calls which makes it as fast as malloc.
>>
>>52990789
you don't need it to scale for that many devices

you can play music on the server, not sure if plex will help you with that tho, mpd is probably a better choice for that
>>
>>52987125
Kill yourself hetfag, women are leaving abusing and degrading hetero relationships and are seeking refuge with a lesbian relationship.
>>
>>52990299
Python with PySide
>>
>>52990822
>
iirc statistics say lesbian relationships have the highest number of reported abuse per couple, where as gay guys have the lowest
>>
>>52990812

I realize I don't need it to scale, but I would like for it to scale I have plenty of free time and may as well put everything I have into it and make it professional for usability.

I was wondering if I could utilize plex as a way of using their album art/web interface to play on the server from a remote host.
>>
>>52990792
Well if I was going to initialize all the members of the struct that I'm allocating then I would just use malloc, but sometimes I just want make sure there is absolutely no garbage memory in the worst case scenario.
>>
>>52990853
do you have additional computers you can scale with?

i don't think plex server itself will play any content, you need a client. you can then try to control the plex client from your app. don't think you'll be able to easily get the plex web interface integrated into your app though
>>
File: 1448821505008.png (427 KB, 514x662) Image search: [Google]
1448821505008.png
427 KB, 514x662
How does one check the proxy type and version via code? (That is, decide whether it's SOCKS5, HTTP or some other type.)
>>
>>52990467
yep that's it well done
>>
>>52990943
try it each way
>>
>>52990912

I have every computer in my home, 6 students, 2 computers each, some @ 4k, some @ 3440x1440 some @ 1080p some @ 720p, phones and tablets with various resolutions. I am creating this for the whole household to be able to control various things around the house, ofc requiring authentication for things in each others rooms but that's another topic and easy to solve.
>>
>>52991029
i mean if you're going to scale, you'll need more machine to run your app server on.

you can't scale with just one pc.
>>
>>52991046

I am running this on a Xeon 2650v3, I do not need it to scale past the cpu's limits, I mean scale-able as in the website scales with resolution, I know networking, just not web development
>>
>>52991066
use css flexboxes
>>
>>52991066
ohhh, that's what you meant by scale. my bad.

have you heard of responsive design? great for this sort of thing
>>
>>52987333
>javascript function that gets called right away in the code
>not using an IIFE

Embarassing.
>>
>>52991084
>>52991108

responsive design and css flexboxes, thank you very much guys!
>>
>>52990754
>better then malloc + memset
who said you should use memset?
>>
>>52990867
>make sure
>absolutely no garbage
>worst case scenario
the worst case scenario would be structure containing a pointer on a platform were null is not represented by all-bits-zero; so you failed
>>
What's the best C or Python 3 library out there for crafting packets?
>>
>>52991249
struct
>>
>>52991277
I meant crafting and sending network packets.
>>
>>52991311
consider literacy
>>
File: 1376693332623.jpg (31 KB, 245x204) Image search: [Google]
1376693332623.jpg
31 KB, 245x204
>/dpt/ will never stop the bullying of java
>>
>>52991249
>C
>library
You 'avin a giggle?
>>
>>52991249
Scapy
>>
>>52991367

Some of it is well deserved. Some not so much.
>>
>>52991367
>no bully
>coc
>cuck
>fuccboi
>>
>>52990842
oiled lesbians' fights streaming where?
>>
File: screenshot-4.jpg (40 KB, 404x349) Image search: [Google]
screenshot-4.jpg
40 KB, 404x349
>>52987029
I'm building a 2D game.

Am I literally retarded for wanting to make an engine from the ground up ?

>pic related
>>
>>52991592
yes
>>
>>52991592
no, it's very easy to make a 2d game engine, especially for that kind of game as in your pic. game engines are generally intended for 3d games (hence the unity engine was called unity3d), they have almost nothing to offer for 2d, they just constrain you in what you can do
>>
>>52991645
>very easy
show your code, fgt
>>
>>52991670
>gibs me dat
how about no
>>
>>52991223
Try using plain old malloc for something like snprintf, you will want the buffer cleared.
>>
>>52991592
You need Unity3D to render realistic frilly laces on the girls hats and stockings.
>>
>>52991728
>plain old malloc for something like snprintf
absolutely no problem with it
>>
>>52991714
>I have none
as expected, pajeet
>>
>>52991871
>he thinks you need to use unity3d/gamemaker/unrealengine4/etc to make a 2d game
>>
>>52991895
>I haven't shipped a game but I think it's easier to do it from scratch
fuck off to your designated place
>>
>>52991895
>he spends 7 years making a shmup with nothing more than autism and opengl
>>
>>52991907
>>52991917
even a pajeet can make a rudimentary version of flappy bird, with no pre-built babby engine. any high schooler can make pong. it's not that hard, faggots.
Thread replies: 255
Thread images: 19

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.