[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/dpt/ - Daily Programming Thread

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 316
Thread images: 35

File: 1444327316540.png (3MB, 1704x2466px) Image search: [Google]
1444327316540.png
3MB, 1704x2466px
Old thread: >>51601187

What are you working on, /g/?
>>
>>51606575
First for D
>>
Second for Lua
>>
third for java
>>
Fourth for clover
>>
File: rsbwono.jpg (29KB, 300x300px) Image search: [Google]
rsbwono.jpg
29KB, 300x300px
>>51606610
>java
>>
Java
>>
>>51606575
What program will unfuck my autistic little head so I don't end up like OP's pic?
I don't want to want to be a girl
Why can't I just be normal?
>>
>>51606575
FAGGOT
>>
Rust
>>
File: .jpg (128KB, 1600x1200px) Image search: [Google]
.jpg
128KB, 1600x1200px
bython hahaha :DDDDD
>>
>>51606660
>D
>Lua
>clover
>picks on java
>>
I want to start working on actual projects instead of short scripts. Which should I do first? Contribute to existing free software projects or start my own?
I'm not that experienced at programming but wouldn't consider myself a noob either.
>>
>>51606872
Well it is the shittiest
>>
>>51606747
amnesia
>>
>>51606747
Just let it happen.
Not everyone was meant to be a manly man.

>>51606893
Find something you wish existed and make it happen.
In order to contribute to existing projects, you need to read the source code and gain a good understanding of how it's structured before you go pull requesting any changes.
>>
I'm really enjoying Processing.
What are some libraries that are just fun as fuck at what they do?
>>
>>51606945
>processing
isn't that that liberal arts psuedo-programming language designed to trick liberal arts majors into thinking they actually learned something at their $50,000 a year day cares?
>>
>>51606945
ew
>>
>>51606922
Anything that I wish existed is probably too large of a project for me to start with.

I know I need to understand how existing projects work first. The problem is finding a project that's small enough that I can make a reasonable impact on AND large enough that it's actually useful software.
>>
File: 1432509507470.png (127KB, 546x486px) Image search: [Google]
1432509507470.png
127KB, 546x486px
>>51606575
but I don't wanna
I mean, I do, but I don't
I do, it'd probably make me really happy, I think about it way more than I should, but I don't want to disappoint my parents more than I already have
they already think I'm a faggot
>>
>>51606993
>>51606922
>>
>>51606993
>they already think I'm a faggot
Then what's the problem?
If they think you're a faggot, would it really surprise them if their son became a literal faggot?
>>
>>51606993
just do what makes you happy
you only get one life after all
>>
>>51606993
Roll
>>
File: demo_new.webm (3MB, 640x360px) Image search: [Google]
demo_new.webm
3MB, 640x360px
progress
written from scratch in C with SDL
>>
>>51607127
Fucking web devs acting like they are cool and such
They arent even real programmers
>>
>>51607137
Pretty cool anon
>>
>>51607154
thanks friend
>>
File: 1430871246852.jpg (72KB, 735x445px) Image search: [Google]
1430871246852.jpg
72KB, 735x445px
>>51607039
well, no, but they're still hoping, and I don't want to confirm their fears
I can't imagine how disappointed they'd be
>>
Any tips for the Java OCA exam?
>>
>>51607176
so you're just gonna keep living a lie then?
>>
Java pleb here, working with GUIs and timer for the first time. I have a simple program that moves an image/label at a certain period of time everytime a button is clicked (jrb1 and jrb2)

But I don't understand. If I click jrb2 (makes the image goes faster) and then click jrb1 (makes the image goes slower), the timers add up (probably because a new timer object is made each time?)

Any good advices /g/? Is this a bad approach for a program that moves images around in a frame?

 public void actionPerformed(ActionEvent ae)

{

// Move the object randomly, subtract 75, so that the

// object should not meet the edges

lb.setLocation(r.nextInt(getWidth() - 75), r

.nextInt(getHeight() - 75));

}

}).start();

}

if (jrb2.isSelected())

{

// Create Random object

r = new Random();

// Create a timer and call it for every k seconds

new Timer(750, new ActionListener()

{

public void actionPerformed(ActionEvent ae)

{

// Move the object randomly, subtract 75, so that the

// object should not meet the edges

lb.setLocation(r.nextInt(getWidth() - 75), r

.nextInt(getHeight() - 75));

}

}).start();
>>
>>51607137
That looks pretty nice
>>
>>51606966
What's your recommendation for drawing coloured rectangles, then?
>>
>>51607216
SDL
>>
>>51607216
opengl
>>
>>51607216
FLTK is simple and easy.
>>
>>51607198
What on earth is going on with your whitespace and newlines?
>>
>>51607380
protip: they already think you're doing it behind their backs
>>
>>51607137
I like it. Post source. Even a tarball is fine.
>>
>>51607380
Please take this somewhere else.
>>
>>51607516
Sure, tarball coming up.
>>
In C#, imagine I have two tightly classes coupled together. Say, a flowchart block, and a slot for flowchart block that allows to collect blocks together.

As I expand functionality, I always have to, after observer compiler errors, come back to fields I added to these classes and put "public" in front of them.

One of the solutions I learned for avoiding this is to put one of classes inside another.
Is it the only one, or are there better?
>>
>>51607516
http://wikisend.com/download/423146/drawblade.tar.gz
>>
>>51606993
This >>51607096 life's to short to not do what makes you happy, but long enough to regret the things you didn't do. If they already think you're a faggot it's not like their opinion can get much worse. I'd love to, but at over 6' tall, it just isn't going to work out [spoiler]that won't stop me from messing around every so often though[/spoiler]. Now if only I could find a few more pairs of pants that would fit me, then I could shave my legs without other people finding out.
>>
>>51607612
cd MainGame; make; ./drawblade
>>
>>51607137
neat
>>
>>51607682
thanks bub
>>
>>51606575
>I like to code
>I'm going to take picture of my monitor

what is this shit.
>>
>>51607695

The point is that it's lewd you fucking idiot
>>
>>51607704

kys
>>
>>51607695
he literally became a woman
>>
Friendly reminder that using tranny threads is a hate crime and trivializes the plight of the transexual.
>>
>>51607851
tranny != crossdressing
>>
>>51607857
fuck away
>>
>>51607612
find -type f | xargs grep 'sizeof(char)'
./game.c: ret->custom_level_path = malloc(64 * sizeof(char));
./textbox.c: ret->text = calloc(maxCharacters, sizeof(char));
>>
just finished coding up a website for my databases class. I had to teach myself php to do this shit, and by teaching myself I mean looking at w3 tutorials and shit my eyes hurt and my shoulder feels dislocated from using the mouse too much I better get a fucking A on this goddamn motherfuckin assignment you guys nothing will make me madder. I had to write these bitch of a long SQL query for a certain page to work jesus fucking christ all of you web developers that take joy out of dealing with this shit on the daily is nothing short of a goddamn psychotic disorder, tell you what.

I'm going to sleep now.
>>
>>51607612
If you put up a github I will submit some pull requests.
>>
>>51607937
Well, you found all the important bits. Go home, everyone. It's over.
>>
File: 1448907930.png (24KB, 1552x82px) Image search: [Google]
1448907930.png
24KB, 1552x82px
Didn't think it was worth a whole thread but I'm developing a 4chan scraper and I found this shit

99% sure this isn't my fault, my code just drops the string into a table straight from Nagasaki's JSON
>>
How long were longest SQL queries you wrote by hand, /dpt/?

>>51607956
>bitch of a long SQL query
How long?
>>
File: ohfug.png (24KB, 850x400px) Image search: [Google]
ohfug.png
24KB, 850x400px
>>51607937
It's going to be graded and my prof has slight autism. I just do it to please him.
>>
>>51607981
Are you talking about the weird date?
>>
>>51608002
Yes
Aliens?????
>>
>>51607959
There is a github, but it has my name, email, etc. It's also a graded final project for my Intro to C class so that wouldn't be allowed. Thanks for the offer though; with it being due in 7 hours, I really could use all the energy I could find.
>>
>>51607985
$q = "SELECT * FROM EVENTS AS E WHERE EXISTS "
."(SELECT ER.Event_ID, ER.Email_ID FROM EVENT_REG AS ER WHERE EXISTS "
."(SELECT U.Email_ID, U.User_Name FROM USER AS U WHERE U.User_Name = '".$_SESSION['username']."' AND U.Email_ID=ER.Email_ID AND E.Event_ID=ER.Event_ID))";
>>
>>51607985
I used to write queries for a huge ETL project and would regularly be making select statements on hundreds of attributes across 50+ tables.
>>
>>51608047
nice sqli faggot
>>
>>51608047
That's not even long.
>>
>>51608080
but were they nested?
>>
File: 1362982448148.jpg (104KB, 400x320px) Image search: [Google]
1362982448148.jpg
104KB, 400x320px
>>51608096
>>
Been working on a full stack Javascript RSS feed reader for about 3 months. I now have one week to finish it. Also a friend who is a professional software engineer made the same webapp in 8 hours. FML
>>
>>51606993
r o l l i n g
>>
>>51608080
What database were you using?

My longest query is around 70 lines long with 7k characters.

I am referencing much less tables, about 5-10 total, but there is a lot of stuff packed into the thing, recursive query, geographic intersection...

Postgres explain picture for it looks like a monster, but I still enjoyed a lot exploring it trying to optimize query. And I succeed - request time went from about 30 seconds to about 1.
>>
>>51608132
sounds about right
RSS isn't hard
>>
>>51608132
git gud
>>
>>51608183
>full stack javascript
>rss feed reader
>3 months
>webapp
>professional software engineer
need chemo asap
>>
Is anyone else doing anything with Mumble? (bots, etc.)
>>
>>51608228
>who
>are
>you
>quoting
>>
>>51608243
I think he was replying to me about the state of the person I was replying to.
I, being >>51608183.
>>
>>51608250
I get the impression from his post that he's implying you are cancer.
>>
>>51608261
hm, interesting take.
his post is indeed quite undirected.
so, -> >>51608243
>>
>>51608261
correct
>>
File: 2012 euro chick2.gif (3MB, 550x309px) Image search: [Google]
2012 euro chick2.gif
3MB, 550x309px
How good does one have to be at programming to work get contracts and work remotely?
>>
>>51608285
why would you be saying that
I basically said the guy was dumb, as rss is easy
not cool
>>
File: tree.png (94KB, 866x1300px) Image search: [Google]
tree.png
94KB, 866x1300px
My girlfriend is having a rough day so I made this for her

http://159.203.142.122/midnight.php

Warning: autoplaying audio

I like to leave it on fullscreen
>>
>>51608322
i misquoted
lol
wops
>>
>>51608287
Holy shit that's a 10/10 qt
>>
>>51608324
not moving
>>
>>51608350
gif is not moving?
>>
>>51608346
how long have you been locked up in your basement
>>
>>51608287
Depends on the job mayne.
Some companies dont have the office space so programmers work from home.
>>
>>51608358
is it a gif?
yh, nothings moving
>>
>>51608361
Am I wrong?
>>
>>51608381
what browser are you on? The only gif is the leaf. That's all that should be moving. Everything else is static. The gif moves really slow (1.5-2s per frame).
>>
Write your story:
http://bfdss.net23.net/site15/page15.html
>>
>>51608324
what song is that?
>>
>>51608424
nevermind
>>
File: mamimi.gif (36KB, 450x443px) Image search: [Google]
mamimi.gif
36KB, 450x443px
>>51608424
ctrl u

or

https://www.youtube.com/watch?v=GLDhvJ0fmAw
>>
>>51608393
if you're in a country like murrica you may be right
>>
File: ss+(2015-11-30+at+11.43.28).png (246KB, 1391x1067px) Image search: [Google]
ss+(2015-11-30+at+11.43.28).png
246KB, 1391x1067px
MAKING

PROGRESS
>>
write your story anon
http://bfdss.net23.net/site15/page15.html
its recorded in read.html
>>
>>51608037
What day do you go to class? I sat in the back of the Intro to C class at your school last week, next to the military guy. Do you have the Pajeet Indian professor who talks about memory addresses way too much?
>>
File: write_story.png (17KB, 1255x290px) Image search: [Google]
write_story.png
17KB, 1255x290px
>>51608741
>>
>>51608801
I don't have his class, no.
>>
File: ss+(2015-11-30+at+12.02.50).png (207KB, 1256x863px) Image search: [Google]
ss+(2015-11-30+at+12.02.50).png
207KB, 1256x863px
Well, I think the system is now ready for implementing feedback. Wish me luck.
>>
File: 1446231944744.jpg (2MB, 2000x2610px) Image search: [Google]
1446231944744.jpg
2MB, 2000x2610px
>>51608875
Well I'm down in Boca but I will be driving up there this weekend. Good to know there are fellow /dpt/ers around.
>>
you guys afraid to click links
>>
Going to work on c for embedded systems, need e-book fellas, help please
>>
Going to work on c for embedded systems, need e-book fellas, help please

i have >>51608939 this book and want one more
>>
Is there a Gentooman's Library with the programming section still intact out there somewhere?
>>
>>51609190
http://g.sicp.me/books/listing.html
>>
>>51609203
nope, first place I checked. About 3 gigs missing.
>>
>>51606993
Röll
>>
>>51607216
C and a 2D framebuffer.
>>
>>51609260
How can you bitch about that which is perfect?

Stop being so perfect I guess? I love you Lisp <3
>>
>>51609058
>>51608741
could be dangerous if someone embeds arbitrary html to exploit some browser vulnerability?
>>
>>51609315
so I post it only in safe-places, heh
>>
>>51609315
nah, I removed the form for now. I think I have to usee htmlspecialchars($_SERVER["PHP_SELF"]) or something like 4chan
>>
//
""
<script>confirm("4chan's barrier");</script>
>>
>>51609396
You have to use a language that's actually useful for web development, not PHP.
>>
>>51609484
i'm not sure if my nopay-ware supports those. I'm glad it has PHP
>>
>>51606575
>What are you working on, /g/?

Just finished the client and (multi client) server for a simple file copying program over inet sockets in C.
>>
File: window_AK47_3674.jpg (431KB, 1600x1262px) Image search: [Google]
window_AK47_3674.jpg
431KB, 1600x1262px
Stupid question, but I'm new to C++.
If I want to read text from a file and save it to three different variables how would I do that?
Say I have a text file like this,
DICKS (2, 1)


How do I get C++ to read that line and dump "DICKS" into a string, and the two numbers into separate integers?

I'm trying
string key = "";
int x = 1;
int y = 0;
[spoiler][/spoiler]
ifile >> key >> x >> y;

but it doesn't seem to work. The output is only ever,
DICKS (0, 0)
>>
>>51609535
No idea how that spoiler tag got there, ignore.
>>
>>51609535
write a tokenizer, it doesn't work because you're trying to save space and ( to the integers probably
>>
>>51609535
Not sure if C++ would be too different, but in C I'd tokenize the line with strtok(). Use " ()," as the delim and then NULL for each call after the first; strdup() for DICKS, atoi() when the strings that are to be integers.
>>
>>51606575
do you use eclipse, netbeans or inteliJ for programming in java?

and why?
>>
itt we >muh some languages

>rust
>muh safety
>>
>>51609729
eclipse because netbeans a shit, haven't tried intellij because eclipse is good as fuck (you don't want to switch IDEs too often) and doesn't cost money
>>
>>51609733
>python
>muh codecademy
>muh ADD
>>
>>51609551
>>51609686
// AA (0, 0)
string key;
char rightParenthesis;
int x;
char comma;
int y;

ifile >> key >> rightParenthesis >> x >> comma >> y && (rightParenthesis == '(') && (comma == ',');

It's sloppy, but I got it working like this. I just want to hand in this assignment, I'll look into tokens later though.
Man, C++ makes strings so complicated.
>>
>>51609755
im thinking of switching to intelij. but for some reason i cant import my projects from eclipse to intelij. and when i do it manually i cant run that shit because its asking for a seperate SDK. but still, intelij looks fucking sexy
>>
>>51609755
>shit
whats so shit about netbeans?
>>
http://bfdss.net23.net/site16/page16.html
>>
>>51609733
>C++
>muh bloat
>>
>>51609820
what is the point of having both classes and structs?
>>
>>51609793
dated appearance
crappy font rendering
pig slow console I/O
non-existant code auto completion (just from what i'm trying out right now)
maybe fewer features than eclipse
>>
>>51609832
all righty.
but if i have to choose between eclipse and intelij. what do you recommend? and why.
>>
File: nqNQEFC.webm (2MB, 720x404px) Image search: [Google]
nqNQEFC.webm
2MB, 720x404px
Ask your beloved programming literate anything.
>>
>>51609852
i'm happy with eclipse so i'd recommend eclipse. but i haven't tried intellij as i said and others seem to like intellij (they might be shills though)
>>
>>51609867
Looks fun.
>>
>>51609876
got it. thanks
>>
>>51609867
Why is C++ so shit?
>>
>>51609826
Are you seriously this dumb?
Literally kill yourself.
>>
>>51609904
what can I do in a class that I can't do in a struct?
>>
>>51609918
>What can you do in C that I can't do in assembly?
Stop this muh bloat meme, it is retarded.
>>
>>51609918
Nothing.
https://www.google.com/search?q=difference+class+struct
>>
>>51609931
It's two things that provide the same feature.
>>
>>51609931
>Stop this muh bloat meme, it is retarded.
What the fuck are you talking about?
>>
>>51609940
Yet, they are using in different ways. It's all about convention. You use classes as templates for objects and structures as templates for data.
>>
>>51609943
He was complaining about having classes when we already have structs
>>
tell me what to use instead of PHP
>>
>>51609979
DJANGO
J
A
N
G
O
>>
>>51609979
Python or Java
>>
>>51609931
That's different, what I'm asking requires next to no difference in how you use it. What you're talking about is becoming even more lower level.
>>
>>51609979
Python or Ruby
>>
>>51610006
ruby sounds gay
>>
>>51610019
you sound gay tbvh f.a.m
>>
PHP's classic
>>
>>51610028
>people are literally evading the fucking filters because they want their special black people words back
>>
>>51610019
It is, do you like being RAILED? Use Ruby.
Python is a strong hetero man's choice of language, no homoerotic and/or phallic double entendres desu senpai.
>>
>>51610028
PHP's not gay
>>
>>51609979
Golang
>>
Python is fallic
>>
they may say it's outdated. But classic man use PHP
>>
and C++
>>
>>51609995
It does require something different. Classes are for objects, structures are not. It doesn't matter if structures have capability to act like classes. They are different things made for different stuff. BTW, the reason you can use structs as classes is because of compatibility with C(I think).
>>
/dpt/ I'm working on a visual novel section of my game, and I'm having trouble thinking of a good implementation as the states are event based so the whole 'one big function with wait for input' option isn't ideal.

What I need is a way to store segments of the story (add/remove characters from scene, write to text box, etc) which can then be iterated through after pressing enter/space.

So far I can only think of making a small callback like struct, hardcoding each segment and then adding them all in order to vector/list and iterating through on input, but it seems clunky.

Anyone have any suggestions?
>>
Python sound's like it should appeal to the 7 year old 'who we have to teach programming!' Ruby too desu
>>
>>51610102
Make a n-linked list so you have a series of structs(possibly from a external file, or hardcoded) and they are linked together by pointers for the options.
>>
Pee H Pee le classic pro gaming lan gwich.
>>
File: 1444986157051.jpg (455KB, 991x608px) Image search: [Google]
1444986157051.jpg
455KB, 991x608px
>Java "programmers"
>>
Pearl sounds gay too
>>
>>51607956
>finding SQL difficult
wtf is wrong with you
>>
>>51610152
Pearly white cummies.
>>
Ruby's for faggots
>>
>>51610159
/g/ syndrome.
>>
>>51609902
because backward compatibility. it's still more decent than most of programming languages.
>>
>>51609902
if you got problem with C++, then your IQ is probably not very high
>>
>>51610121
I learned about linked lists but never found a practical use in the programs I've written so far, this sounds right and will give me a chance to get to know them better, thanks.
>>
>>51606993
>no algol
feels based man
>>
>>51610286
One popular use of linked list is in Linux's scheduler.
>>
>>51609733
>java
>muh Muhable
>>
File: a.webm (132KB, 200x200px) Image search: [Google]
a.webm
132KB, 200x200px
Made a video output for my flowchart random map generator.

This works, but it also made me realize I'm approaching to executing the flowchart wrongly - as in very often the result of a flowchart will not be something I expect. I'm going to have to spend some time thinking how to do it properly.
>>
muh C++ is scary
>>
File: ss+(2015-11-30+at+02.53.50).png (82KB, 819x608px) Image search: [Google]
ss+(2015-11-30+at+02.53.50).png
82KB, 819x608px
>>51610341
Here's the flowchart that produces the video.
>>
>>51610341
im sorry to say this, but you may be overthinking things
that graph of yours is very simple. surely it would be easier writing it in code for this scale.
>>
QUICK!
You have 10 seconds to say something good about Java or you'll have to program in Scala all your life.
>>
>>51610367
Uh, what scale?
I'm making a tool that can be used to generate anything without writing code.
>>
>>51610369
if a program is written in java, I can instantly determine that it is bad, and not use it.
that is one good point about java
>>
>>51610381
You are an idiot.
>>
what to do
>>
>>51609852
DrJava
>>
>>51610378
oh, you actually made the flowchart tool yourself? I didn't realise.
I wouldn't call it a flowchart though, most other well-known 3d programs would call it something like a node-based interface (or anything including the word 'node', really)
give link, please (I know you gave it already a few threads back to GTP, but can't remember)
>>51610387
you asked for a pro, I gave you one. C# master race.
>>
File: 1443628616871.jpg (155KB, 1241x789px) Image search: [Google]
1443628616871.jpg
155KB, 1241x789px
>>51610387
found the Oracle employee
>>
>>51610412
The link to library I'm using to let user edit nodes/connections is https://github.com/LogicalError/Graph
>>
>>51610412
>that language is shit
>this nearly identical language is so much better

>>51610419
>memeing this hard
>>
File: WTF-pepe.jpg (7KB, 206x156px) Image search: [Google]
WTF-pepe.jpg
7KB, 206x156px
I have a java interview tomorrow,i had to do a function that takes a string ,does some calculations with it and returns a new string and also add unit tests.
I've done the requirement but heres the problem.
I've done the main function(the one that takes the string) and some auxiliary functions for each step of the problem and added them to the main function.
All my variables are in the functions,so i have no fields.
What is the best practice?
For example:Lets say you have to make a function that takes a car name as String ,does some calculations and then returns the result as String.
For me,i put all the steps of the function in auxiliary functions who i then call in my function in order to process the String and return the processed String.
>>
>>51610463
Thanks my friend. Now, I don't have to write how retarded >>51610412 is.
>>
>>51610547
The best practice of course is to post code and not a wall of text.
>>
>>51610442
wait, so it's not yours
but you're using it to make an image generation tool?
sounds pointless, when there are countless ones available, e.g. http://www.pixaflux.com/index.php
>>
>>51610463
There really is nothing redeeming about Java these days. If you actively choose to use Java in personal projects, then you simply don't know many languages. This is invariable. Java is universally hated so much because much better languages exist for almost everything Java aims to be good for. Most specifically C#.
>>
>>51610585
None of existing tools are really fitting in any way for generating random 2d bitmaps to be used as levels for games.
>>
>>51610595
C# is not a choice for many simply because it's pushed by Microsoft.
>>
>>51610595
Java is faster and is completely cross-platform and not much different from C#.
>>
>>51610621
>Java is faster
[citation needed]
>>
>>51610567
auxiliary function1() {
}

auxiliary function2(){
}

mainFunction(String s)
{
String result;
s = auxiliary function1(s);
Result = auxiliary function2(s);

return result;

Something like that.
The main function definition is given by them,i just gotta implement it to return the requirement.
All the work is done in the auxiliary functions that at their own turn have 1 or 2 auxiliary functions to further divide the problem for readability purpose.
>>
>>51610628
Just Google it.
>>
>>51610603
is your tool online and/or open source?
I like C#, so would be cool to have a look.
>>
>>51610639
heh, imagine reading wikipedia, scrolling to the bottom, and seeing 100 citations, each with the text "Just Google it."
>>
>>51610652
>comparing 4chan with Wikipedia.
>>
>>51610634
Why are you not posting actual code?

>>51610641
It's in a very initial state, ie not exceedingly useful. I came up with the idea last friday. Even if I share the code and someone improves upon it, by the time he does my version will probably bee to different for his code to be compatible.
>>
>>51610619
Why would that make it not a choice? Java is pushed by Oracle and Google.

>>51610621
>Java is faster
Lack of structs, raw pointers, non bound checked array access and SIMD implies otherwise. Not to mention that C# is just generally much more productive due to generally much better language features and tooling.
>inb4 posting the benchmark game benchmarks
>>
>>51610677
Microsoft has a history of repeatedly using EEE, others don't. And their deals with Novell regarding Mono do not make the situation any better.
>>
>>51610673
re-read my statement
I do not compare anything.

>>51610675
>ie not exceedingly useful. I came up with the idea last friday
okay then
care to share your idea? not going to copy it, I'm only interested.
>>
>>51606575
there is no information for new retards trying to get into this shit in the OP
>>
>>51610701
>Microsoft has a history of repeatedly using EEE, others don't.
>implying Oracle doesn't
>openoffice
>opensolaris
>mysql
>>
>>51610677
>raw pointers
>non bound checked arrays
How often do you write C# code that uses raw pointers and unsafe arrays?

If you are using them very often, then you are an idiot.

Also, check the benchmarks.
>>
>>51610675
>why are you not posting actual code
This is the structure of it.
I cant obviously post code as they will search for it.
Its 1 mainfunction and 2 or 3 auxiliary functions who split the problem and that process the given string(and some of them call other auxiliary functions too) .
Its an algorithmic problem.(not like open some binary file ,read first lines and output the result).
>>
>>51610701
>others don't.
I recall Oracle suing the shit out of Google for using Java API's.

I don't recall MS ever doing anything to Xamarin who make millions off selling their mono driven iOS and Android dev tools and runtime. Or anyone else for that matter. They also made a legally binding promise that they will never do so to any company that does the same thing.

I also recall Oracle threatening to sue companies who reported security issues in the JVM.

>And their deals with Novell regarding Mono do not make the situation any better.
What were they?
>>
>>51610704
You put some nodes on the windows, the system passes objects between them, at the end of all this you get a 2d map you can export to disk in some some format you choose. It works exactly like those image editors you linked, but is specialized producing the kind of randomly generated maps like those used, for example, in terraria.

>>51610732
Where is the extinguish? Openoffice still lives, Mysql still lives. I honestly have no idea about solaris because I don't know if it was ever truly alive.

>>51610748
You posted something that makes no sense. function 2 and function1
do not take any arguments. In any case, it would take a psychic to figure out what you want to find out with no code and no proper explanation save for "i am using multiple functions"
>>
>>51610741
>raw pointers
Whenever I want to use a native library in my C# code. Which is every now and again. Incredibly useful feature to have. The best part is, is that native library wrappers are a cinch to write in C# compared to Java. So they are very easy to come by for most things. There's two 100% complete API wrappers for DirectX for example. And at least one for OpenGL.

>unsafe arrays
I've used these a couple of times for messing around with image manipulation. Something Java is really not suited to at all.
>>
>>51610741
how often do you write Java code that does that?
oh right - you don't
because java can't.

features that allow you to get the best performance out of a language are quite critical when you have a large project in that language, as you don't need to write a specific module in a different language only to get that performance, leading to lowered maintainability.

>If you are using them very often, then you are an idiot.
agree with you on this, if you need high performance mission critical code, then you'll probably be writing it in C, or even lower. C# has great C interoperability though, so that's perfectly ok.
>>
>>51610791
>Where is the extinguish?
they are only alive today because of other open source ventures saving them, e.g. apache for openoffice.
everyone knowledgeable has dropped mysql for mariadb (literally, as mariadb is a drop-in replacement) because of Oracle.
Oracle makes Oracle Database, the proprietary db. Since they also govern mysql, you can see they have a conflict of interest.
Making mysql faster than OracleDB would cause them to lose money, so nothing extreme can be done to the project. MariaDB has no limitations.
>>
C# is better than Java just because of the sane type system. Forget about boxing. Generics done without hacks. Etc. And extension methods, oh my god, why no other language provides it.
>>
>>51610799
I don't write them in Java, because I don't need to. There are enough large projects out there that use only garbage collectors and safe arrays to prove that those are not required features for most of the projects. At least for the projects Java targets. Hell, if the performance is so critical that you are gonna care about array bound checking, why would you use a language that runs on a VM?
>>
>>51610848
There is still the fact that no extinguish happened.

And also what's more important is that EEE works to destroy standards, not products. So the situation you're describing with Mysql not only not happened, it also is not EEE.
>>
>>51610864
in C# you can turn the GC completely off if need be
>why would you use a language that runs on a VM?
lol, what, have you ever heard of AOT compilation?
see: .NET Native, Mono AOT. even java has it.

>>51610873
I don't understand you man
you use C# to make this flow thing, but you defend Java
your mind is fucked. You cannot like both languages.
>>
>>51610791
its the 4chan small chat ,i cant see more than 4 lines.
String auxiliaryfunction1(String s){
/*Do some calculations
*Call auxiliaryfunction3() to do some calculations*/
return processedString;
}

String auxiliaryfunction2(String s){
/*Do some calculations
*Call auxiliaryfunction4() to do some calculations
*Call auxiliaryfunction5() to do some calculations
*Calculate more..*/
return processedString;
}

String mainfunction(String s)
String result;
s = auxiliaryfunction1(s);
return auxiliaryfunction2(s);
}

public static void main(String[] args)
{
String processedString = mainfunction("stringToBeProcessed");
}
>>
>>51610798
you act like java doesn't have opengl wrappers. JNI is very easy to use with jnigen
>>
>>51610891
I have heard of AOT compilation. I will bring the same argument again, if you are gonna care about that kind of stuff, just use C++.
>>
>>51610891
>>I don't understand you man
>you use C# to make this flow thing, but you defend Java
>your mind is fucked. You cannot like both languages.
I *LOVE* both of them. Java is wonderful, and C# is wonderful too (except for potentially being a trap). Both Java and C# have amazing IDEs.
I also kind of like C++ with Qt extensions. C++ by itself, is, well, I used to hate it (ever since I discovered C), but I grew to accept it.
I also love Perl. Everything small that needs to be written quickly, I do in Perl.
>>
>>51610891
>you cannot like both of these very similar languages
>>
>>51610929
your
mind
is
FUCKED
>>
>>51610929
You love everything, Bob. Have you been smoking weed lately?
>>
>>51610895
If your question is, is writing functions like that acceptable, then the answer is yes it is.

If auxiliaryfunction1 and auxiliaryfunction2 are not used anywhere else in the project, creating them might be a bit counter-initiative, the way I see it, because the person who's going to be maintaining your code will have to jump around for no reason. The only reason to have them, in this situation, is, I think, when their names very well reflect what they do, so the person who's reading them won't even have to read them.

So this would probably be good:
function findUppercaseWords(text){
var words=splitTextToWords(text);
var result=retrieveUppercaseWords(words);
return result;
}


And this wouldn't:
function findUppercaseWords(text){
var x=aux1(text);
var y=aux2(x);
return y;
}


>>51610940
Why is it impossible to like both?
>>
>>51610992
Hate Pascal. Hate Pascal with passion.

Also actively dislike Python, because it is popular and I'm not proficient in it.

I also don't like Haskell because I never could manage to write anything productive in it.
>>
>>51610899
>you act like java doesn't have opengl wrappers.
I'm not acting like that at all. That would be you desperately looking for ways to defend java. I'm well aware Java has OpenGL wrappers. My point is that kind of shit is much harder to created. Even more so with the lack of pointers, structs and fucking unsigned integers, that would make native interop much more intuitive.

>JNI is very easy to use with jnigen
.NET has wrapper generators too. They just don't need to be so complicated as Java ones, and you don't need to use them as much just to pull in a simple function from a native library.
>>
>>51611042
Does C# have the ability to pull functions out of Linux's .so libraries?
>>
>>51610919
>if you are gonna care about that kind of stuff, just use C++.
For the same reason you wouldn't otherwise use C++ instead of C# or Java for any given project.
>>
>>51606575
What manga is this? I mean I see it everyday on /dpt/ but never bothered to ask.
>>
>>51611067
Not really, modern C++ is like Java. Just a bit uglier.
>>
>>51611064
yes. It's what GTK+ does.
>>
>>51611080
Garbage collection..?
>>
>>51611080
then what do you mean by "not really?". Are you saying C++ should always be used instead of Java?
>>
whats a good book to learn C?
>>
>>51611006
yes,all the auxiliary functions are only called once but their names reflect what they do.
So i have a mainProcessingFunction which takes a string to process and that which just calls the 2 auxiliaryFunctions on that string i have and returns the result.
But one of the auxiliary functions has 2 algorithms inside it,first one that puts the received string in the proper form first and 1 that processes it.
>>
File: ss+(2015-11-30+at+04.08.06).png (51KB, 611x635px) Image search: [Google]
ss+(2015-11-30+at+04.08.06).png
51KB, 611x635px
>>51611083
So how does that work? I assume you mean GTK#?
Downloaded it from http://www.mono-project.com/docs/gui/gtksharp/, and there are tons of DllImport, but they import from files with .dll extension.
>>
>>51611112
Seems fine, then; not sure what you really want to hear.

I also think that you're overthinking it all a bit. As long as you have a proper explanation of why you did something, and that makes sense, it's going to be accepted at job interview.
>>
File: smmugn.jpg (60KB, 736x682px) Image search: [Google]
smmugn.jpg
60KB, 736x682px
>>51611164
thanks senpai.
Java masterrace.
>>
>>51611176
>Java masterrace
>>
>>51606993
Roll
>>
is Practical C Programming a good book for intro to C?
>>
>>51606993
Jesus Christ, what a fuck up Swift is. Using Emojis as fucking variable names? Absolute clusterfuck syntax?

Nice going Apple, next you'll be claiming you invented shit firs... Oh wait, maybe you did.
>>
>>51611229
Basically The best
>>
>>51611133
not sure what's going on there.. *.dll imports.. i would have assumed means importing native windows dll's. But i presume you downloaded the source for linux? Maybe those files are only compiled on windows?
>>
>>51611246
It's the source they have on that page...
Right next to the linux screenshot.
http://ftp.gnome.org/pub/gnome/sources/gtk-sharp/2.12/gtk-sharp-2.12.10.tar.gz
>>
>>51611243
should I read it before reading K&R? should I read K&R at all?
>>
>>51611266
i dunno man. Not familiar with that stuff enough.

I'd be curious what they do to pull in the native GTK libraries though
>>
Is it possible to make games with Haskell? Wouldn't it be extremely painful without oop?
>>
>>51611286
Well, that invalidates your point a bit, doesn't it? All the stuff that's so easy to use in C#, turns out only to be only easy on Windows, making it increasingly more difficult to use a different operating system, and those are exactly the concerns I expressed when I was mentioning EEE.

>>51611308
Someone get this hothead outta here.
>>
>>51611308
How would you even do that
>>
>>51606575
I see a nipple.
>>
>>51611308
there's some openGL bindings , but they're pretty raw to use based off of what I've heard.


You can always write all your game logic very functionally, but your render code will be very iterative I imagine.
>>
>>51611318
>Well, that invalidates your point a bit, doesn't it?
What does exactly?
>All the stuff that's so easy to use in C#, turns out only to be only easy on Windows
I'm not really sure what you're talking about. I'm not sure how GTK# imports the GTK native libs, but that doesn't suddenly mean it must be difficult to do.

importing .so files is easy. see: http://www.mono-project.com/docs/advanced/pinvoke/

I'm not sure why i can't see it in GTK# though. Maybe they so something else I'm not familiar with.
>>
Should I read Practical C Programming or The C Programming Language 2nd Edition first?
>>
>>51611387
They have a game, Quake 3 clone, written in Haskell.

>>51611418
It's a man.
>>
>>51611308
Possible? Yes. Feasible? Nope.
>>
File: 1447789120441.png (151KB, 480x360px) Image search: [Google]
1447789120441.png
151KB, 480x360px
>>51611435
Introduction to Java.
>>
>>51611441
Im sure it didnt take long to make
>>
File: java-for-os-x-02-402x535.png (94KB, 402x535px) Image search: [Google]
java-for-os-x-02-402x535.png
94KB, 402x535px
ca we talk about the most superior language now?
>>
>>51611430
one possibility is that DLLImport is not needed for mono on linux, since GTK# is a core library there and the mono runtime can pull in those libraries behind the scenes.
>>
>>51611459
I'm not going to learn java first, I want to learn C first.
>>
>>51611430
So this essentially means that any program that uses DllImport to get native Windows stuff is not going to work anywhere but on Windows. You see this as an advantage, but in my eyes, Java makes it less easy to become dependent on operating system, and C# makes it very easy, and that definitely is not an advantage.

>>51611468
I'm not saying it's easy. I'm just saying it exists.
>>
>>51611489
>So this essentially means that any program that uses DllImport to get native Windows stuff is not going to work anywhere but on Windows.
That's not in any way correct.

>Java makes it less easy to become dependent on operating system, and C# makes it very easy, and that definitely is not an advantage.
I think it is in fact an advantage m80. Native interop a hugely useful feature. Making it needlessly painful to do it is stupid. Note that it IS possible to do it in Java, it's just 10x more work. So doing a cross platform wrapper for a native lib for Java is 10x more difficult than in C#. Also in any event, the programmer get's to choose the trade off of how cross platform his application is. Obviously it's easiest and most encouraged to avoid DLLImport unless you really need it. If you really need it then you know you'll have to do it for each platform you run on. It's up to you if this is worth the time and effort or not. You have this problem in both Java and C#, but in C# it's much easier to do both platforms.
>>
File: the-right-way.jpg (512KB, 1131x1600px) Image search: [Google]
the-right-way.jpg
512KB, 1131x1600px
>>51611477
Of course, you can always talk about Haskell here. What are you working on?
>>
which C book should I read first: The C Programming Language 2nd edition or Practical C Programming?
>>
>>51611176
Java user, frogposter, and weebshit all in one magical post.
Well done, you absolute mongoloid.
>>
File: pepe-732.jpg (5KB, 168x299px) Image search: [Google]
pepe-732.jpg
5KB, 168x299px
>>51611772
>>
>>51611772
if this was /a/, he would have probably gotten his post deleted. they usually delete any pepe posts.
>>
>>51611807
Why do we allow reddit memes here?
>>
>>51611829
the mods just don't care enough to do anything about it. unlike most boards, /a/ has mod support.
>>
>>51611846
that's what you think. one of these days, you're getting kicked out like rage comics got kicked out.
>>
Imagine you're writing a libary called ABCD.
All your objects are defined within an ABCD namespace right?
What if you then create a subsystem called EFG?
Should objects within EFG be accessed with ABCD::EFG:: or just EFG::?
ABCD::EFG is too long, and just EFG implies EFG is not a part of ABCD.
>>
>>51612171
Is EFG nested inside ABCD? If so, if you're outside of the ABCD namespace, you can access the members of EFG only with the full path ABCD::EFG::
>>
>>51612321
>Is EFG nested inside ABCD?
That's what i'm asking.
EFG and ABCD both need eachother.
Outside of ABCD yeah you can use ABCD::EFG but that's a bit too long.
I also just remembered the user can just create a namespace alias so that's no longer a problem.
>>
>>51610639
Every benchmark you'll find are mono (usualy an old version) or c#2, maybe 3 at a stretch.
Even if it is slower, and it could be, the superiority of the platform and VM is worth it
>>
>>51612171
>Should objects within EFG be accessed with ABCD::EFG:: or just EFG::?
>ABCD::EFG is too long, and just EFG implies EFG is not a part of ABCD.
I'd say this should be handled by the consumer of your library; it is their choice.
most languages have a 'using' keyword which allows you to choose the shorter version or fully qualified version.
internally, use whatever, as it doesn't matter
>>
>>51609918
A class can have private members by default or something. Fuck!
>>
>>51612389
The C++ standard library has no fear of long chains of namespaces.
std::chrono::high_resolution_clock::now()
:D
>>
>>51612831
I know right xD
>>
File: 1405808865564.png (137KB, 534x400px) Image search: [Google]
1405808865564.png
137KB, 534x400px
>>51612862
>>
>>51609940
so does for, while and goto.
Having multiple ways of doing the same thing is not all bad
>>
File: 1447502221212.jpg (26KB, 600x450px) Image search: [Google]
1447502221212.jpg
26KB, 600x450px
>>51611234
>Using Emojis as fucking variable names?
mfw Unicode.
>>
>>51611284
K&R will be your reference until you know everything about C.
>>
File: it vennad.jpg (3MB, 2040x8832px) Image search: [Google]
it vennad.jpg
3MB, 2040x8832px
schoolwork general now: python special
I need to load a txt database, it has many linesconsisting of Year-month-day Time - info
I need to print just the info with a queue number infront of it, starting with 1 and ending with the number as many lines are there. Any ideas?
>>
>>51613240
>Any ideas?
Yeah, do your own incredibly simple homework.
>>
>>51612885
Fucking who is that?

he just doesn't understand 4chan culture
>>
File: NORRRRM.png (26KB, 750x750px) Image search: [Google]
NORRRRM.png
26KB, 750x750px
>>51613263
>Yeah, do your own incredibly simple homework.
Thanks, you've been such a great help.
>>
>>51613327
You could do this with grep and awk. one line.
>>
>>51613327
It's simple shit, figure if out yourself
>>
>>51613344
yeah i've been trying, if you don't want to give me the full code, fine with me but give me direction then like this dude did>>51613342

thing is I can't proberly isolate the INFO part, I mean I can but then the script skips every other line for some reason.
>>
Why haven't you accepted Egison into your life yet, /dpt/?
>>
New thread
>>51613348
>>51613348
>>51613348
>>
>>51613379
Give an example of something you're trying to parse, and give an example of your expected extrapolation.
>>
>>51613452
Dumbass
>>
>>51613348
>>51613348
>>51613348
>>
>>51613457
26-11-2015 16:01:58-vadim 200
30-11-2015 17:24:13-vadim matkin
30-11-2015 17:24:13-fafafa latkim
is the data in the file.txt
I need to basically make a script to edit this. Therefore it needs to print out like this
1. vadim 200
2. vadim matkin
3. fafafaf latkim

then user selects which entry he wants to edit, types in number 2 and edits it.
>>
>>51613520
cat hah | sed s/[-:0-9]//g | sed s/^\ //g
>>
>>51613520
Oh I guess that doesn't quite work. One second.
>>
>>51613520
perl, convert it.
:~$ perl gay.pl hah
vadim 200
vadim matkin
fafafa latkim
~$ cat gay.pl
#!/usr/bin/perl
use warnings;
use strict;

while (<>) {
$_ =~ s/^\d+-\d+-\d+\s\d+:\d+:\d+-//;
print $_;
}
>>
>>51613632
alright, thanks.
>>
>>51613812
From what I can tell language to language regex is pretty much the same, so just convert it, make a counter and append the number to the beginning or somethin'. GL.
>>
>>51611308
Nope. Haskell is a Turing Tarpit for anything realistic.
Thread posts: 316
Thread images: 35


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.