Old thread: >>51648793
What are you working on, /g/?
>>51653845
First for D
Second for D.
Third for D
my D
>>51653845
>posters: 5
why?
First for please send help.
Doing my first ever proper project, I'm working in VB because I'm utterly useless.
I need to create an array, dictionary or iList of some sort that stores a single string from a listbox on the left side and then any number of strings from the left side, and have them be readable from the strings acquired from the left listbox.
I understand the basic concept but actual implementation is making my brain melt.
>>51653958
Sorry but doing it in VB actually is a huge barrier to getting help here.
>>51653977
True, I understand the syntax but I'm not sure of the concept that would allow me to input the first string into the dictionary from the left listbox and then have any possible number of the ones added after it.
I know I'd just do dictionary.add([stringfromleft],[stringfromright], [stringfromright], [stringfromright], ) but I don't know how I would go about having the string from right being run in a loop because it'd add multiple entries to the dictionary which isn't helpful.
One of my classes required me to do two projects on an Arduino. For one of them I did a super basic calculator. Each led is a digit 0-9 (red are 0-4, yellow are 5-9), and depending on what the answer is, the corresponding led will flash i.e. 41 will flash led 4 and led 1.
The first answer you see in the Webm is for 9 + 2 and the second is for 8 * 8. It handles addition, multiplication, subtraction and division. Parentheses can also be used.
Nothing major to brag about, but it was nice getting done. Here's the code
http://pastebin.com
>>51653977
>>51654008
I'll also want to store a (possibly) large amount of text from a textbox underneath in the last value of the dictionary so I can use it also.
>>51654035
And here's the actual pastebin I meant to post
http://pastebin.com/wpx9rxZj
>>51654040
>>51653977
>>51654008
Okay let me try again, how would I go about declaring a variable and using a string from elsewhere as it's name.
Say I called listbox.SelectedItem and wanted to use whatever that value was as the name of my variable.
>>51654118
Using a reflection.
Where can I learn how to plan and prepare for a large programming project, like with a notebook and pen? I really want to do something but the amount of work I need to put into it is overwhelming to me. Would mythical man month/no silver bullet be a useful read?
Is it possible to use variadic functions in a shared library?
how good is code:blocks, I have windows.
>>51654147
I'm so sorry.
>>51654146
and if it is, are they as "stable" as other c functions? As in, would a different build of the same lib still link correctly?
>>51654147
Use a text editor instead, and write your own makefiles
http://strawpoll.me/6161383
first for a ruff victory.
>>51654118
You shouldn't, it's a stupid idea and a flimsy solution.
>>51654008
https://msdn.microsoft.com/en-us/library/xfhwa508%28v=vs.110%29.aspx
Look at the samples and play around with Dictionary first, because you don't understand the syntax. I think what you want in VB terms is a Dictionary(Of String, List(Of String)), a dictionary with a String as the key and a List of Strings as the values.
since theres a new thread
this might be more sys admin related but what's the best way to remotely execute a program on another computer, i'm trying to get my raspberry pi to open programs on my computer
what i've done so far is set up a ssh server on my windows machine and i've tried using psexec which works mostly well for the first part, but 1: i have to make myself admin to launch programs in the current user session and 2: authenticating over the network takes like 5 extra seconds and is really slow
should i try to figure out if i've done something wrong with psexec or do you guys know of better ways to do it
>>51654165
>>51654185
I guess I could install linux, is it better than windows for programming?
>>51654202
Hell yeah
>>51654204
i need it running in my current user session, running it straight from the ssh server runs it in the background
>>51654202
Depends if you want to program for windows or not. I just use mingw and notepad++ on windows.
>>51654217
whats a good distro for an old laptop I won't have to bullshit with? linux mint?
>>51654256
Yeah, Linux Mint is a quick install and good for learning to use Linux
>>51653958
Can there be duplicate strings on the left side? If so, you won't want to use a Dictionary, you should instead use a 2D List (a list of lists)
>>51654197
I got the dictionary thing down, I just have no idea how I add an inconsistent number of strings from a listbox into it, whilst only adding the one string from another listbox to use as the key.
Making a for loop won't cut it because it'll just create another dictionary each time.
>>51654338
Nope, I want to display the one from the left, proceeded by all the ones they selected from the right, and give them an option to clear that entry to do it again, but attempting to create another entry whilst one is still displayed will throw an error asking them to clear the one they already have.
>>51653936
still looks like a samefag. could be using a proxy. it's a shill job regardless
>>51654387
>Making a for loop won't cut it because it'll just create another dictionary each time.
What?
>>51654328
what about debian?
>>51654413
There's no way that multiple people like superior languages! It must be a single person posting through a proxy!
>>51654431
Yep I literally just read my post again.
I assume I can have multiple dictionary entries that all use the same string from the left as a key. Which makes a lot more sense. I got it now.
>>51654453
hardly anyone uses D to even know whether or not to like it.
>>51654387
Like I said, make it a Dictionary(Of String, List(Of String)). Then you'd Add each of the keys with a New List(Of String) for the value, and then add any number of strings to the list corresponding with the key.
>>51654460
You cannot, the Dictionary connects one key to one value. However, you can make that value contain multiple items, for example by making it a List.
>>51654467
>X language is not as widespread as Y
>therefore there's no people that know X
How's my JavaFX Disk Usage Analyzer?
It's WinDirStat made multi-plat, without file manip (thats what you have terminal and filemanagers for), works with network drives that you have a relative path to from the system, no IP/UDP accessed network drives.
Are any of these worth reading?
>>51654529
I didn't say either of those things. I said:
"hardly anyone uses D to even know whether or not to like it."
Which is perfectly correct.
>>51654553
Part 2
>>51654553
They're being given for free for a reason.
>>51654565
Which is a cute opinion of yours*
>>51654553
>>51654570
>old
>free
>probably outdated
Naw
>>51654516
Isn't the 2nd value the key? Or is the key literally whatever you want it to be, as long as it's consistent?
What is the best statically typed functional language?
>>51654621
The key is whatever string you want it to be, the value is a list that contains a set of strings. So the dictionary creates a one-to-one relationship between a string and a list then the list contains multiple strings.
>>51654516
>>51654621
Can't convert selected items to List(OfString) I can't think of a way to make the thing accept multiple strings without a loop.
>>51654453
>i'll shill this obscure language all of a sudden
>hey guys have you read this book [i wrote] :^)
>>51654442
Debian or Ubuntu are the only distros worth thinking about. I use Ubuntu because it just works and I'm NOT a trendy faggot who thinks you should never use ubuntu (and I have a newer computer). Debian is okay for old servers that never should be updated. Do an ubuntu minimal install if you want new software on an old computer.
>>51654665
use a loop. You shouldn't be creating the Dictionary inside the loop, only adding to it or to one of the values for a key it contains.
>>51654641
Haskell.
My professor has given me the go-ahead to use pre-computed primes for my assignment, noting that in many cryptographic implementations, it is common to use primes that are essentially safe and verified. Also, I did point out that while the assignment specifies the must generate the prime numbers ourselves, it does not specify that they must generate them at the same time as the other parts of the public and private keys. He tells me I'd make a good lawyer, were I not studying computer science.
So I guess... I now have a working implementation of ElGamal using the discrete logarithm problem, that can exchange an AES key and send messages back and forth between two processes, all in a couple hundred lines of Ruby.
Now all I need to do is modify the program to work for elliptic curves instead.
How's everyone else's work?
Daily reminder that you know if a language is a meme language if none of the software you use is written in it.
>>51654586
It's not an opinion. It's a fact. D is dismally unpopular, despite being as old as C#.
>>51654187
Rock and stick are better
>Defends you (Hit people with rock OR stick, they go away)
>Never leave you (can't move)
>Always for you (no sentience)
>Changeable at will
>Easily replaceable
>LITERALLY man's oldest ally
>>51654198
Well you could make a socket server / client then run x program from x socket input
>>51654802
What about software you write in the memelang?
>>51654146
>>51654183
anyone know the answer to this? google is being difficult
>>51654802
this
>>51654693
>Ubuntu
>NOT a trendy faggot
anon...
>>51654802
Does the compiler count?
>>51654848
is there anything special I have to do? or does it just werk?
>>51654187
Fuck I can't even argue this.. I will include it on next shill-poll
>>51654823
Lol let's be serious, you aren't writing any real software.
>>51654884
Fuck no the compiler doesn't count, does a circle jerk with a bunch of dudes count as getting layed?
>>51654704
Tried multiple different ways now, I have absolutely no idea how I'm supposed to get a string out of a listbox collection.
I've tried everything I can think of, a single string seems to pass fine using SelectedItem but not having any luck at all with SelectedItems.
>>51654809
>>51654889 is meant for you.
>>51654146
>>51654183
>>51654828
Let us put it like this: libc is available as a shared library, and printf is a part of libc. Because printf is a variadic function, therefore we can conclude that variadic functions may appear in shared libraries.
As for linking complications... there shouldn't be any. Register and stack calling conventions should be the same for a platform regardless of which compiler one is using, and regardless of whether the amount of arguments is fixed or variable.
>>51654848
>>51654934
Thanks
Working through nand2tetris and figuring out how to implement a multiplexer using only And, Or, Xor, Nand and Not gates
I'm probably retarded, but given a point in 2-space, I draw a square around that point with a sides 1 unit away. How do I find the length of the diagonals?
Say the point is at (5,5), the mid points of each edge are (5.5,5), (4.5,5), (5,4.5) and (5,5.5), but what are the corners?
>>51655143
The diagonals are the hypotenuse of the resulting triangle.
The length of the triangle is 2 units, so is the height.
Using pythagoras' theorem:
H^2 = 2^2 + 2^2
H^2 = 4 + 4
H = 2.83
>>51655143
2 * sqr(2 * x ^ 2)
I'm the retard working in VB
Suddenly getting exceptions shot at me for no discernable reason.
I spent ages working on this and trying to figure it out, and suddenly I'm fucked.
Programming is hard, I give up.
Is it even worth trying XNA out? I've read it died out or something. Ive got some c# skills, and want to try entry level vidya coding. Or should I switch to Unity or get to learn some C++?
>>51654809
>You can write on either and it's OK
>You can write with either and it's OK
>Over a million uses each
>Both are 100% free
>Any size (for old and small!)
>No incompatibilities with anything
>No allergies to them
Who /rock'n'stick/?
>>51655283
Just use Jewnity.
>>51654871
It is just the opposite. Pseudominimalism and Arch Linux are the latest hipster trends.
>>51655442
The worst part is the elitism within the Lingus community. If you don't use Arch or some other gay do-everything-yourself distro you get castigated by otherwise know-nothings who managed to follow a guide.
Despicable.
>>51655252
If you used a reasonable, easy language like Python 3, I answer all questions and will even write some code for you because I'm a huge faggot.
If one has experience with HTML, CSS, JavaScript and PHP, how long would it take to learn how to make Drupal and WordPress themes?
>>51655473
I'm trying to make a program that generates an XML file using inputs and what not, and then sort it into files.
With a simple to use GUI and have it be widely compatible without having to download anything extra really.
Can I do this with python? If so send me an email with your username for skype or steam or something, I'd be happy to dump this into the trash to actually have a chance at getting it finished.
[email protected]
>>51655143
the pythagorean theorem motherfucker
>>51653845
finally working on my messenger again, cleaning a lot of shit up at the moment before i add a chunk of features
any idea how to get image data from js before sending it to the server (so i can convert to base64 and encrypt)
512kb is way too small
>>51655252
>Suddenly getting exceptions shot at me for no discernable reason.
Please explain. C# and VB (because they're both .NET) have the greatest error messages in the world.
What are you doing?
>>51655461
If you don't use Arch or some other gay do-everything-yourself distro you may as well just use windows. or just use windows regardless
>>51654146
Yes. Note that on Win32, variadic functions always use the cdecl calling convention, whereas functions exported from DLLs normally use stdcall (which can't handle variadic functions).
How do i do the parts in red? Java btw, thanks.
>>51655540
I agree with the tripfaggot. Not everyone is cut out to use Arch. Some of you delinquents are masquerading as Arch specialists when you barely know how to do jack shit without following a tutorial.
>>51655568
nigger are you retarded?
>>51655584
yes
>>51655568
If you're storing this shit in a tridimensional array, iterate through the grade column and check if gaydicks[i][j][k] < 40.
then iterate through student id, and change his group to Faggot.
>>51655581
i don't use linux. i think using something like ubuntu is completely pointless when you can just use windows 7 instead. i don't see any significant benefit to using ubuntu over windows. if you're going to use a hobbyist OS you may as well use something that is targeted to hobbyists rather than normies.
Ask someone who's spent the last 3 hours solid trying to get strings in a listbox converted to a fucking list anything.
VB seems to have the most awful online community ever, Google has been literally no help, many solutions all of them completely wrong.
>>51655610
>i don't use linux.
It's obvious.
>>51655540
I use Windows and Debian. Fight me 1v1.
>>51655283
XNA is basically monogame now. Which is rather excellent.
>>51655568for(final Student student : students) {
if(student.getGrade() < 40) {
System.out.println(student.getID());
}
if(student.getID() == 95) {
student.setGroup(Groups.WEB);
}
}
>>51655643
Why debian?
>>51655635
Why using VB? VB classic or.NET?
>>51655608
>not recognizing a two dimensional data structure
>>51655635Dim lst As New List(Of String)()
For Each s As String In listBox.items
lst.add(s)
Next
Or something like that.
>>51655610
Actually, I have a piece of shit laptop that runs way better with Ubuntu than Windows. I am sure there are more obvious examples of how running Ubuntu instead of Windows exist, but I am speaking from personal experience.
>>51655667
Because I'm a scrublord. Though lately, I've been switching many of my VMs (and my old laptop) over to Xubuntu.
>>51655686
Because it seemed like the right choice at the time, simple and easy to create nice looking GUIs which was kinda important.
I assume .NET, I just downloaded Visual Studio 2015, booted it up in VB mode and got to work.
Turns out it's an absolute fucking mess and so many people posting solutions that make absolutely no sense, in a different language entirely or for VBA which I can't use either.
Now I've sunk about 10 hours into it and got nothing to show for it for it.
Seems to be a far more convoluted and stupid language than it first appeared.
>>51655696
p drunk desu but it looks like three
then again i would just use a hash.
>>51655696
it's a one-dimensional collection of objects
>>51655734
well yeah but it can be represented as three.
how would you math out a three dimensional array as one anyway? even two kinda confuses me when iterating through.
>>51655519
> any idea how to get image data from js
FileReader API.
If the browser supports it, an <input type="file"> element will have a .files[] property containing the list of selected files. Use FileReader.readAsArrayBuffer() on one of them to obtain the file's contents.
If the browser doesn't support FileReader, you're out of luck.
>>51655723
alright then but when my mom had ubuntu instead of windows on her old desktop it ran like gay garbage
>>51655486
Anyone?
>>51655726
You should try Arch in a VM nigga, shit's fun as hell to setup
>>51655729
What the fuck?
You made a bad bad bad decision.
Use C# instead. VB.NET only ONLY exists to pull VB classic programmers into the .NET ecosystem easier. It's not a nice language for .NET development at all.
Sounds like it will be easier for you to re do the whole thing in C#.
>>51655766
>shit's fun as hell to setup
yeah maybe the first time, afterwards you realize that not having an installer available is a pain in the ass
>>51655743
the data isn't three-dimensional. you could say it has two dimensions but not three. ID, class group and average grade is one dimension and then the students make up the other dimension. but really you're over-complicating it. the question wants you to have a bunch of Student objects in a collection such as an ArrayList which is one-dimensional.
>>51655666
Thanks, I owe you one.
>>51655749
how large of an image? (i'd like 5mb absolute max)
>>51655759
You want help making a website?
Do you need help wiping your own ass too?
>>51655759
I don't know about Drupal, but WordPress is heavily based on PHP. Sure, it'll have a learning curve but the fact that you already know the basics will help you a lot.
>>51655772
More than likely, not a chance I'm doing it tonight though.
I hope I can port something over instead of having to start entirely from scratch, but maybe a fresh start might yield better results anyway.
>>51655743
> well yeah but it can be represented as three.
Maybe, but that would be dumb (the array will be extremely sparse). I 1-D array of tuples or a 2-D (Nx3) array would make more sense.
> how would you math out a three dimensional array as one anyway?
a3[i][j][k] = a1[(i*n_j + j)*n_k+k]
where n_j and n_k are the number of elements in the 2nd and 3rd dimensions.
Essentially, a[i] starts at
a + i*sizeof(a[0])
And the size of an N-element array is N times the size of each element.
>>51655812
porting will be fine i'd say. The reason why you're having trouble understanding why your VB isn;t working right, should become clear as you port it to C#.
I think you can get it converted automatically. Which might makes things easier for you.
>>51655729
Hey, turns out listbox.Items is a collection, so this is even easier.Dim lst As List(Of String) = listBox1.Items.Cast(Of String)().ToList()
>>51655812
10 hours of work is not that much to work
Only one NEET day
>>51655788
ah yeah, you're right.
*puts down the bee--* no.
I'm not the guy who was asking the original question, just a tired moron.
>>51655827
Cool, thanks for the explanation.
>>51655643
Why use two OSes without seemless integration? I've been using MSYS2. It's a million times less painful that going between Windows and Debian.
My laptop is currently Windows, but as soon as the semester is over and I don't need Atmel Studio I'm reinstalling Crunchbang++. I hate Windows, but engineers are a bunch of keks.
>>51655513
>[email protected]
>dicksinmyan.us
I had a kek, thank you
I might hve to recommend Java if you reaalllly want the gui.
>>51655880
>Why use two OSes without seemless integration?
Because I haven't got a need for seamless integration? Whenever I need something to work elsewhere, I just grab the code and recompile under Loonix.
>I hate Windows
I really don't mind Windows. Often time it doesn't have the tools I need (Valgrind, pls!), but it's not as bad as some people make it out to be.
Also, video gaymes.
>>51655798
There's no limitation on size. If you want to impose one, you can check the size of the file via the .size property on the element of the file list before you start reading it.
>>51655931
Still no Valgrind on Windows, luckily MSYS and mingw cover most other software I care about.
Windows is slow (on a hard disk especially), very buggy, very power consuming on a laptop (my little Acer laptop gets 4hr under W7 and 9hr under CB), is a piss-poor development environment unless you are using the tools MS wants you to use, and the "I know better than you" shit MS pulls (especially on W10) is obnoxious. It's only saving grace IMO (and it's not even by its own merit) is that I can play video games on it.
As soon as I can get decent graphics drivers for Linux and can run a minimal W7 VM and play my games on that I'm never looking back.
>>51656090
>Still no Valgrind on Windows
I know, and that's a problem.
> unless you are using the tools MS wants you to use
VS is pretty good, though. And I mostly use C# so it's a natural fit. MonoDevelop isn't quite there yet.
>>51655899
It's my legit email, I use it for more or less everything.
Just finished a responsive mobile hamburger menu thingy. The scss is messy but it works :DDDDDDDD
>>51656214
This is programming thread mate.
>>51656214
Well show us the program then. Run it senpai.
>>51656115
I've been using Atmel Studio, which is VS based with a avr-gcc backend, and I don't like how everything is packed up into 'projects' which I assume is a VS thing. It makes it shitty for git (merge conflicts out the ass because a fucking recompile) and it's impossible to edit multiple projects at once, although maybe VS has that feature.
What's so great about C# in comparison to other languages? I've just looked at the wiki and it seems like Java-MS with some influences from VisualC++. I mainly stick to LuaJIT and the massive library I've built up with it. Been thinking about putting it together into a formal language with MetaLua and some C libraries.
>>51656090
>Windows is slow (on a hard disk especially), very buggy, very power consuming on a laptop
Why do people actually believe this pig slop? None of this is true at all. Linux is nice in lots of ways, but being faster, less buggy and less power consuming as a desktop environment? The exact opposite it true. Though all those could arguably be true for a headless server environment.
>As soon as I can get decent graphics drivers for Linux
People have been waiting for this since the 90's. GPU manufactures are only going to bother to optimise the drivers for the OS's most of their customers run. Don't expect linux to be one of them for a long time.
In any case, using windows for VS alone is worth while. Pretty much what I do.
>>51656152
Obviously not applying for jobs.
>>51656235
Actually this is the /dog petting thread/
Id ask wdg but theyre not around today.
Whats a good level of skill you would want before applying for junior web dev jobs? Ive got a few personal projects im trying to finish after I make a website for my barber. If I were to continue small projects like that would it be appropriate to look for entry level jobs by summer time?
>>51656326
>I've just looked at the wiki and it seems like Java-MS with some influences from VisualC++.
It pretty much is Java-MS with C++ gizmos attached to it. That's what makes it great.
Imagine if Java was enjoyable to program in.
That's C#.
>>51656368
>Why do people actually believe this pig slop?
Because it's true. I've been using it since I was ??? Windows is markedly less reactive than a Linux distro, especially when you aren't using an SSD. The difference becomes negligible then. I run into programs freezing under Windows that don't under Linux distros and overall more freezes and crashes under WIndows. I've never seen FF freeze or crash under Debian. And yes, power consumption is important for a laptop, thank you for ignoring that bit.
>using windows for VS alone is worth while. Pretty much what I do.
You didn't have to tell me. I knew.
>>51656412
It's not a question of should I apply. Why haven't you applied yet
If you get rejected you'll have time to improve
>>51656420
>Imagine if Java was enjoyable to program in.
Not possible.
>>51656445
I think the implication is that it becomes possible with C#.
>>51654802
>Daily reminder that you know if a language is a meme language if none of the software you use is written in it.
Daily reminder youre a code monkey if you only use languages because everyone else uses them
this babby duck mentality is what causes "worse is better" which is why outdated and inferior technologies continually become standard in the industry
holy shit i hadn't even posted itt yet and people have already shilled for D
good work guys
now if only it didn't treat NOGC like shit
>>51656434
>'ve been using it since I was ??? Windows is markedly less reactive than a Linux distro
>markedly
Markedly by what? placebo? Do you have any kind of metric anywhere that makes this up? Should be easy to prove. The GUI on linux is insanely bloated compared to windows. Everything sits on top of X, which a monster. Utterly unsuited to its task on modern systems and introduces measurable lag. Read about the problems with X sometime. Wayland is meant to fix this, but hardly anyone is supporting that properly yet. Not to mention less optimised or functional GPU drivers make things even slower on top of that.
>And yes, power consumption is important for a laptop, thank you for ignoring that bit.
I didn't, i mentioned it specifically. Learn to read. Linux is terrible for power management because the UI rendering frameworks are so fucking bloated, everything takes way more fucking cycles. And again, shitty drivers tend to be less power optimised. Every benchmark I've seen on this shows linux being much worse than windows on any laptop i've seen them both tested on.
>>51656235
>implying jawvascripting isn't programming
>>51654802
Java. Because everyone else is using it and I don't want to look dumb.
>>51656502
Plenty of people are out there taking leaps with things like Rust, D etc. Plenty of software uses Lua. But you can't write real software with Lisp when hello world is a 25MB binary.
>>51656509
Do D programmers like Dogs or shitpaws?
You have +1 on board for your shilling if you're dog people.
>>51656665
Oh fuck you that was my get
Who's the dead cunt who stole my ruff victory?
>>51656666
>>51656638
C++11 and ISPC, because I actually know what the fuck I'm doing.
>>51656498
das rite
I feel useless. I always lurk these threads but never actually program anything.
>>51656738
That's why no one will remember your name.
>>51656526
>The GUI on linux
You sure you know enough to be arguing the point?
Of course I don't have empirical data, I presume you have none that proves Windows is faster, either. This is just opinion.
X is a monster, but still quicker than Windows' system (which I presume is every bit as much of a monster, it's just hidden from you), still more power efficient than Windows' system (4hrs vs 9hrs, I've actually run a battery test to completion, i.e. it's not false advertizement).
>>51656498
I knew the implication and rejected it. Programming a "high-level" procedural statically-typed language is not fun, no matter the language.
>>51656436
Ok anon that gave me a good deal of motivation thanks
>>51656790
That depends if you are trying to get something done or if you just want to jack off to your language choice.
>>51656790
>Programming a "high-level" procedural statically-typed language is not fun, no matter the language.
And what's your suggestion?
>>51656830
machine language
>>51656790
what about haskell?
>>51656325
I can't. :(
>>51656779
>Of course I don't have empirical data
You say that as if it would be hard to find. The issues with X regarding lag and tearing are very well established. It's not an opinion, I just bothered to educate myself on both systems.
>but still quicker than Windows' system
Based on what? because it "feels" faster? Windows has had proper windows compositing since vista, which linux is still waiting to get.
>still more power efficient than Windows' system (4hrs vs 9hrs, I've actually run a battery test to completion, i.e. it's not false advertisement).
It's not advertised at all. I've read multiple benchmarks on this over the years and linux is always way behind due to the reason I mentioned. Have you read benchmarks to the contrary anywhere?
>>51656830
Python or Ruby. Anything outside of their scope is reinventing the wheel and masturbatory time-wasting.
>>51656853
>procedural
Haskell is functional
>>51656885
Python is a great language.
Lua is always useful to know if you're into plugin development too
>>51656802
It's what I do, anon, motivate people
>>51656885
You cannot be fucking serious. Do you think the web browser you wrote this in is written in Python?
Do you think your phone's batter life would last an hour if all the software was written in Ruby?
>>51656967
>web browser
reinventing the wheel
>phone software
reinventing the wheel
Go implement some more linked lists in C retard. Everyone else will be starting new projects in Python.
>>51656967
Slow down there, he is specifically talking about high level languages, not all languages. Read that reply thread again.
As long as speed/efficiency is not a concern (so not web browsers) it is usually a much more sensible choice to use a high level language, and Python and Ruby are some of the best out there.
>>51656875
>I just bothered to educate myself on both systems.
pffffttttthahaha, that's rich. You don't know shit about Windows' subsystems or their performance. You've also never heard of a compositor.
>because it "feels" faster?
Yeah? Show me a system that is not noticeably faster that is actually faster.
>I've read multiple benchmarks on this over the years
I also don't give a damn about benchmarks from years ago. I spent a couple hours time editing config files on a modern machine, most benchmarks compare OOTB. Linux gives you the opportunity to better the battery life, Windows gives you next to nothing.
I also don't like your "I'm educated and know things you don't" attitude, it's annoying and completely fake. You aren't fooling anyone.
>>51657016
I am primarily a Linux user and can't fathom how anyone could say X is actually good on a modern desktop. It is completely outmoded by now.
>>51657042
Never said X was good, just better. Now fuck off.
>>51657016
I exclusively run Linux and I think X is shit. Any battery costs associated with Linux + a DE are simply well-worth it to me. Hopefully Mir or Wayland can actually save us from the pile of garbage called X11.
>>51657058
I'm not the guy you were talking to btw, should've clarified.
I am sure that Windows' compositor is cobbled together with numerous hacks to keep it shiny, but it is a faster 'experience' for some reason than X.
As some other guy said I do hope Wayland catches on quickly.
>switch to a library that generates HTML instead of writing it myself
>it doesn't put any white space between elements
>white-space: nowrap;breaks
Making a paint program in objective-c and Cocoa
>tfw not a large enough community to get spoon fed on every problem I encounter
I think I'll give up.
>>51657139
If you've gotten this far, haven't you worked out by now that you just put your mind to it, write out/plan your thoughts on paper, and try and fail until you find a solution?
Then once you have that, you assume it sucks and go back and make it better.
Always assume your code sucks, but don;t be afraid to write bad code. Bad code that works can be improved.
>>51657139
>>tfw not a large enough community to get spoon fed on every problem I encounter
>I think I'll give up.
How about you learn to become self sufficient ya fucken dweeb
>>51657177
A less helpful and nice way of saying what I said.
>>51654547
Looks interesting. No idea what the fuck any of it means but it looks interesting.
>>51657016
>You don't know shit about Windows' subsystems or their performance.
presumptions
>You've also never heard of a compositor.
I was the one mentioning it. What are you on about?
>Show me a system that is not noticeably faster that is actually faster.
???
>I also don't give a damn about benchmarks from years ago.
Try modern ones then.
>I also don't like your "I'm educated and know things you don't" attitude, it's annoying and completely fake.
You could simply explain why i'm wrong, instead of insulting me. That might be a better way of discrediting me.
Even other linux fags agree it's slower than windows >>51657071
>>51657095
I don't even dislike windows. I'm running it right now. But if you don't recognise that the entire UI stack on linux is a bloated cluster fuck and measurably slower than Windows and OS X UI stacks, then you are simply ignorant of the issues. There's fuck tons of articles out there about the issues in linux regarding driver support, optimised driver support, battery life issues and X performance written by linux developers seeking the best way to solve those problems.
>>51657205
now you act as retarded as agdg
>>51657217
wat is agddg
>>51657215
>I don't even dislike linux*
i mean
>>51657281
btw, are you using Wayland and if so what WM? I use i3 on X and haven't looked into it enough to switch yet.
>>51657301
right now I'm using xfce, but usually use Unity. I tend to prefer to use whatever is most popular, for best all round support.
Using parallels on OS X for the VM.
>>51657344
I see, xfce is nice but I don't like DEs much. It's the best of a bad bunch I guess.
>>51657301
there's no "WM" for wayland; the WM, compositor and display server are the same thing in the wayland architecture; the only non-reference compositors are from gnome and kde; there's nothing like i3 yet
HI GUYS,
Im looking for a REALLY easy way to view and edit database data (a web front-end application thing). ANY SUGGESTION
>>51657412
>there's nothing like i3 yet
There are a couple of tiling wayland compositors floating around, mostly based off of SWC. Also Enlightenment 20 is a wayland compositor.
>tfw debugging
>>51657427
input box. when you hit submit, the text is sent as a query to your database. the result of the query is output to the windo.
>>51657457
>tfw spending 30 minutes tracking down a single character typo
worked perfectly afterwards tho
>>51657488
>ftw debugging in F#
Feels fucking good man.
>>51656654
>But you can't write real software with Lisp when hello world is a 25MB binary.
This is a myth that keeps floating around that you can judge the efficiency of a programming language by the size of its runtime spread mainly by people who have nothing better to do that look at the size of their hello world. Lisp has good reasons for having a large runtime, mainly it uses a lot of compile time functionality at runtime. The size of the runtime has no effect on the the memory efficiency of the language. The runtime does not grow, its permanently fixed in size. Anyone who complains about language runtimes are fizzbuzzers
FAGGOTS
>>51657215
>But if you don't recognise that the entire UI stack on linux is a bloated cluster fuck
True
>and measurably slower than Windows and OS X UI stacks
Not true (well I've never used OSX)
>then you are simply ignorant of the issues.
>>I also don't like your "I'm educated and know things you don't" attitude, it's annoying and completely fake.
Substantiate your claim that Windows is faster then, oh Mr. man of science. I've used both for many years and I know Windows is laggy and slow. Show me evidence it isn't and I'll reinstall Windows over again and do what I need to make it not so, because I'm obviously doing something wrong. I use it daily and I want it to be better so my life is a little less hell. And if this is just you defending the product you identify a part of yourself with, please fuck off forever.
>Even other linux fags agree it's slower than windows
One never said it was faster, just that X was shit. Also this is an anonymous board. You think I'm retarded?
>>51657610
Even if you igore the huge runtime size, the first part of his sentence is still right, LISP isn't usable for any real world applications. Sooner or later it will get in your way and the development will be a torment from that point onwards.
>>51657215
http://blog.zorinaq.com/?e=74
>>51657641
I would agree that most people who hype Lisp dont really understand Lisp, they dont understand that Lisp is a metaprogramming language in the strictest sense of the definition of metaprogramming. This makes Lisp a niche programming language for a kind of programming very few people can utilize. That niche is still very much real world, albiet very obscure
>>51657641
I'd like to see some solid examples of how it gets in your way worse than other dynamic languages like Ruby, Python, et al
I'd highly recommend Haskell for systems programming and web development
ATM i'm building a site with Yesod.
>>51656885
>Python or Ruby.
What's /g/'s opening on Ruby?
How does it stand up against Python?
>>51656967
>Do you think the web browser you wrote this in is written in Python?
Actually, a great deal of the interactivity in Firefox is scripted in Javascript.
>>51657951
Ruby is better than python in almost every way imaginable, except for the fact you actually have to know what you're doing. Ruby is very easy to fuck up and impale yourself on.
It's like comparing a rapier to a foam nerf sword. The rapier is obviously going to do sword-stuff a lot better, but you can gut yourself if you're careless.
Abstracting machine code was a mistake
>>51657908
I played around with Yesod a bit a couple years back. Felt like a total clusterfuck.
>>51657908
>Haskell
>Web Development
Sir your autism is showing
>>51657985
Von Neumann pls go
>>51657630
you're the FAGGOT you FAG GIT
I have an executor service with a fixed thread pool I submit runnable tasks to. Currently I'm doing busy-waiting if a certain condition is met (when there are no tasks available but there are threads running) by polling in a while loop.
Instead in that situation I want the main thread to wait till the end of any of the run() methods in the current working threads since that is when new tasks may be available.
How do I do that? I tried using a countdown latch but I fucked it up horribly.
I apologize if this isn't the right area to ask. I am trying to learn C. I am learning about boolean operators. I want to make it so I plug in a number to go to a specific example, and it simply outputs the answer of my selection. Here is my code as of right now.#include <stdio.h>
int main()
{
/*NOT operator will indicate that the option you want isn't the one written. NOT is written as !. NOT is evaluated before all other operators.*/
/*AND operator will indicate that something is true only if both things are true. AND is written as &&. AND is evaluated before OR.*/
/*OR operator will return a true if either of the statements are true. OR is written as || (pipe).*/
int choice;
printf ("Which example would you like to read? Your options are 1, 2, and 3. ");
scanf ("%d", &choice);
if (choice = 1) {
!( 1 || 0 );
}
if (choice = 2) {
!( 1 || 1 && 0 );
}
if (choice = 3) {
!( ( 1 || 0 ) && 0 );
}
return 0;
}
I was trying to use printf for the boolean examples which gave errors on compilation, removing printf doesn't make any errors but nothing is output (assuming of course these examples should output a 0 for false and a 1 for true). What do?
>>51658115
please reviewif (choice = 1) {
I don't believe this matches your intent
>>51658115
Use switch
Print line on Java = println()
Print line on Javascript = log()
Print line on Python = print
Print line on C = printf()
>Print line on C++ = cout()
Cpptards will defend this.
>>51658161
>Print line on Java = println()
*System.out.println()
>>51657009
> All software for a phone has already been written
> No new software needs to run at the full speed of a computer, 1/100th the speed is fine
> I can only write in python, so I pretend that's all I need
>>51657978
/g/ agrees?
ruby developers also smarter than python devs?
>>51658161
>Java
System.out.println();
>JavaScript
console.log();
>Python
print()
>C
printf
>C++
std::printf
:))
>>51658161
>Print line on Javascript = log()
console.log()
?
>>51658195
>std::printf
isnt it std::cout ?
>>51658161
>Print line on C = printf()
But it's puts(). However, I agree that C++ stringstreams are fucking stupid.
>>51657951
Big parts of Adobe Lightroom and WoW are written in Lua, doesn't mean Lua is all you need.
>>51658177
No, because anybody who titles themselves as either one is a retard.
Ruby is very powerful but should never be considered ones primary language.
>>51658115
single = is assignment operator not comparison. use == if you want to compare two values.
What you're actually doing if choice == a number is pretty much nonsense. I actually have no idea what the fuck you think it's doing but
NOT(1 or 0) is just an expression that would always evaluate to 0. It's like saying Invert(true or false) which is Invert(true) which is (false).
But you're not doing anything with the value, you're just stating it for no reason or side effect.
Once you've managed to get the if statement thing working you should look up how to do a switch because a switch does exactly this thing.
>>51658115
Here's an idea, there's probably a better way to do this with printf, but you could write a function:
void print_bool(int b) {
if (b) {
printf("true\n")
} else {
printf("false\n");
}
return;
}
and then pass your boolean expression as an argument to print_bool inside your conditionals like so:
print_bool(!(1 || 0));
>>51658161
I made a variable argument type safe Println in C++11 in around 10 lines, I don't know what you're so butthurt about.
>>51658229
th-they had potential
>>51658242
>>51658240
So where does ruby stand next to python?
is >>51657978 true?
>>51658177
labeling yourself by any language is a CS 101 retard thing to do.
Someone who is even a mediocre programmer should know lots of languages and not have much problem switching.
I literally sat down and started writing C# in visual studio only knowing it was sort of like Java. No books, no tutorials, no prior knowledge.
>>51658282
They are fundamentally flawed and are ridiculously ugly.
>>51658320
I like em'. How are they fundamentally flawed?
>>51658345
Hard-codes the order of the arguments, making code ridiculously difficult to internationalise.
Also, did I mention that they're fucking ugly?
>>51658287
> So where does ruby stand next to python?
Q: Which is smarter, a hamster or gerbil?
A: Who gives a fuck, neither realize they are trapped in a cage.
>not using D's godly I/O
It's like you niggers want to write a for loop every time you need to print the contents of an array
>>51658316
>labeling yourself by any language is a CS 101 retard thing to do.
While I agree with this writing C# when you know Java isn't at all relevant. C# was created to steal Java users away from Java and has the same broad properties. You can label yourself with being familiar with paradigms e.g. OO or FP languages.
>>51658417
Educate me, I don't know D
>>51658430
Just look at this example son. Want to write a program that converts from decimal to binary, but don't want to write that second loop for printing the each element of the array? D's got your back.%( %)
is the part that handles all this.
Soup /tg/,
I'm a programming newfag working in Python and I'm making some shitty guessing game where you see three shapes, they get mixed up, and you have to click the one that you think has the ball under it. You know the one, people usually play it with cups.
Anyway I made two buttons, one is a square and one is a circle. The third I figured would be a triangle but then I ran into an issue. How do you tell if a point is inside a triangle? For a square it's just "is this point greater than X1 and Y1 and less than X2 and Y2?" For a circle it's just "is this point further than (radius) from the centerpoint of the circle?" For a triangle though, the bounds are sloped lines not contiguous with any graph lines. I know this might be a stupid question, but do any of you guys have experience with this? I'm tempted to just do some geometry and strongarm it but I feel like there's probably something more elegant that I'm overlooking.
>>51658555
>but don't want to write that second loop for printing the each element of the array?
meh, other languages can do this to.
Go:package main
import "fmt"
func main(){
array := []int32{1,2,3,4,5,6,7,8,9}
fmt.Printf("%v\n", array)
}
>>51658226
Do you really think there is only one way to print to the console?
>>51658648
But can you control how each element is printed out exactly?
>>51658377
>Hard-codes the order of the arguments, making code ridiculously difficult to internationalise.
I don't see how they go hand in hand...
>>51658710
No, that it can not do.
Should I use spring rest or spring hateoas for a web service?
>>51658555
>It has X minor feature built-in, therefor IT'S THE FUCKING BEST.
>>51658555
lisp is better(format nil "[~{~a~^, ~}]" '(1 2 3)) ==> "[1, 2, 3]"
(format nil "I saw ~[no~:;~:*~r~] el~:*~[ves~;f~:;ves~]." 0) ==> "I saw no elves."
(format nil "I saw ~[no~:;~:*~r~] el~:*~[ves~;f~:;ves~]." 1) ==> "I saw one elf."
>>51658755
Yup!
>>51658316
Being a language ideologue will indeed inhibit your development as a programmer, but there is a _big_ difference between smashing out some shitty code and being a career developer in that language (no matter how similar it may be to other languages). When you've internalised a language's community, tools, ecosystem, and environment, I think it's fair to call yourself a "C# guy" or whatever (I know this goes beyond just the language but, practically, languages don't exist in a vacuum).
When will Go and D join forces to become GoD?
>>51658828
You drunk m8? I know I am.
>>51658778
Too bad it didn't achieve that without sacrifacing readibility even further.
>>51658888
Noice quads m80
>>51658878
>You drunk m8?
Only slightly.
>>51658712
I only know English, so I don't even know if my example is proper or not, but say you want to print out an object and what colour it is. Something like "red balloon".
So you have something likestd::string thing = "balloon";
std::string colour = "red";
std::cout << colour << " " << thing << std::endl;
Now you want to internationalise your code. You start with French. You'll actually be picking which strings to print at runtime, but you'll basically havestd::string thing = "ballon";
std::string colour = "rouge";
std::cout << colour << " " << thing << std::endl;
But that gives the wrong answer. In French, it's supposed to be "ballon rouge".
To fix it, you'll need to add conditionals or something stupid to fix it, and that would be very complicated, very fast.
You could be less retarded and use format strings (like every other language, besides C++).#include <stdio.h>
int main()
{
char *thing = "balloon";
char *colour = "red";
char *format = "%s %s\n";
printf(format, colour, thing);
}#include <stdio.h>
int main()
{
char *thing = "ballon";
char *colour = "rouge";
char *format = "%2$s %1$s\n"; // This is POSIX compliant
printf(format, colour, thing);
}
I've just discovered codewars. This should make for an interesting couple of days until I get bored and want to work on real projects.
>>51658955
But what stops you from using std::printf/sprintf/snprintf/svnprintf in C++?
>>51659004
I was specifically addressing stringstreams and why they're shit. If you ever find yoursled using Meme++ for any reason, you SHOULD be using the C stdio functions.
>>51659027
But I write C++ for a living and no codebase I worked on used the streams, we just use templated wrapper around sprintf with expansion for custom formatting.
navigator.userAgentreturns like 4 browsers. How do I figure out user's web browser?
3d graphics programming is cool,
but it's too hard for me...
>>51653879
>>51653899
>>51653906
>>51653908
What happened? /g/ used to hate D
>>51659085
It's just a meme. Nobody actually uses D for anything.
>>51659094
i use it for ur mum lel
>>51659081
It's one of the most confusing, challenging, and rewarding things you can undertake as a programmer.
>>51659147
That was really motivating. Thanks dude.
whats the best data structure for storing the world of an open world game like GTA or Fallout?
Anyone doing the advent of code? Here's my answer for the first one, written in D:stdin.byLine.front.map!(a => a.predSwitch('(', 1, ')', -1, 0)).sum.writeln;
`predSwitch` is a function from the standard library that does simple pattern matching.
>>51659187
Array
>>51659187
That would involve a multum of various data structures.
>>51659187
std::stack
Writing an IRC bot in D.
>tfw compile-time compiled regular expressions to parse messages
gotta go fast
>>51659187
Hash map. Otherwise things will be way too slow.
>>51658828
The irony is that D1 was more similar to Go than it is to modern D. The fact that it didn't catch on proves that Go is just a shitty meme language that hipsters use because "muh google corporate backing"
>>51659147
>not ML
>not LT
>not crypto
>not qCS
Fuck off, dweeb.
>>51658648
>fmt.Printf
>format dot print format
nice language
>>51659292
all useless
>>51659290
In that vein, I can't wait until Rust undergoes a major paradigm shift and people stop functional-shitting on it.
Not that I don't appreciate certain functional features, but jesus christ.
Also, hopefully it's wrested from the grasp of SJW homos.
>>51659317
That's what your mum said. You made her change opinion.
>>51659246
Why not just use a normal parser, then, instead of the abomination known as regex?
>>51659326
Why?
>>51659326
Didn't they establish a council or something composed of fags and women to make the community more "inclusive"?
>>51658161
console out?
>>51659290
Golang's success is in large part due to people on Python 2.7 wanting to jump ship to another language instead of going to Python 3.x
>>51659353
I don't quit buy that but...
Any organization that tries so hard for diversity first should just have people call them out for not having certain races or minorities until the whole thing collapses.
I need to come up with an idea, /dpt/. I want some sort of graphical interactive idea. Preferably not a game; just did one and I hate it. I'm stumped. Any ideas?
>>51659382
Use cinder, make a camera auto look at the person talking
>>51659382
Make a fun little graphical physics sim. Like the falling sand games, or truck dismount.
humans can perceive latency much better than memers will have you believe. extrapolating 2 ms past the start of the current frame being rendered makes the input feel ridic responsive but it introduces occasional extrapolation errors which are undesirable. moving the target time back by 2-4 ms cleans up the input a ton because we're extrapolating less into the future, but i won't move it back by even 2 ms because of how slow it feels compared to 0 ms or +2 ms. targeting the start of the current frame being rendered seems like the optimal choice.
>>51659372
There aren't any Maoi members of the Rust committee. This is a sleight against my country's aborigines.
>>51659403
i mean the start time of when rendering begins, not when the frame will begin to get displayed.
>>51659399
>falling sand
oh, wow
I remember this
that was an awesome simulation.
the ??? type was fun to play with
>>51659406
Exactly Anon.
They don't have any spic beaners, hook nose heabs, pan-sexuals, abos, japs, chinks, gooks, polaks, towel heads, beach shitters, fence jumpers, raft captains, kimchi slant eyes, camel jockeys, surrender monkeys, or bjork clones and frankly I won't support those kinds of close minded organizations.
>>51659326
to be fair, most of the early users either came from functional languages (in order to find a safer C that's more to their tastes) or, being involved in the early compiler creation process, were introduced to functional languages. but yeah i do keep seeing a lot of idiots try to force it into becoming a functional language where it's not really meant to be one. like last week i saw maybe 3 or 4 parser combinator libraries for Rust pop up on HN.
i just can't wait until Rust becomes the exact same as C is now so all the C faggots can start moving to Rust and give it a large community and a large set of libraries (plus this would probably kill off all the SJW bullshit).
what are some good vim plugins
my autocomplete-me breaks all the time
I'm using Netbeans on Fedora Linux to program on C++. My compiler is the gcc.
Rate me
>>51659682
pleb
>>51659565
>like last week i saw maybe 3 or 4 parser combinator libraries for Rust pop up on HN.
What exactly is bad about this? Parser combinators aren't married to the functional paradigm.
>>51659782
the idea behind parser combinators is literally based on higher order functions. with Rust you're not supposed to use closures everywhere (as they're usually way slower than alternative solutions and they tend to be awkward to use in general at a low-level) and high-level abstractions are not one of the ideas the language is meant to promote. parser combinators might even be a better idea in a language like C# which, even though it's more like conventional imperative languages than Rust, is heavy on abstraction and supports closures, higher order functions, etc. very well.
if you're trying to use Rust to write software from a high-level standpoint then you're not using the right language for the task.
Is there a good guide for writing a dead simple compiler from scratch? Nearly everything I've found is
>use lex and bison :^)
>>51659878
>the idea behind parser combinators is literally based on higher order functions
Parser combinators aren't necessarily higher-order functions. What if a parser was just a string of bytecode, or something like that?
In any case, I also don't see how closures are somehow some ultra-high-level-and-slow construct. All a closure is is a function pointer and the data you captured.
>if you're trying to use Rust to write software from a high-level standpoint then you're not using the right language for the task.
That's silly.
>>51659882
Use a functional language. With parser combinators.
>>51659882
depends what language you're using and what language you're implementing. the best book i've found for programming language implementation is Essentials of Programming Languages because it pretty much delves into every possible idea you might want to implement into your language and the code used in it is all very readable (even if you're not familiar with Lisp/Scheme), but the main down-side of it is that it focuses entirely on interpreters and barely even talks about compilers.
most people say go with The Dragon Book if you're using C or C++ or some language like that, but i never really found it to be as good as people said. i like the LLVM Kaleidoscope tutorials a lot, but they kind of just dive straight into the code immediately and don't explain everything super in depth.
>>51657173
This has pretty much been my strategy so far. I'm starting to get a hang of the Cocoa drawing API now though.
Thanks 4 the advice
>>51659882
The classic compiler tutorial is "Lets Build a Compiler", the text is also the source code, its was written in Turbo Pascal, it can still be compiled in Free Pascal
http://compilers.iecc.com/crenshaw/
>>51659882
why the hate on flex/yacc
>>51659882
go hard or go home
dragon book
>>51659663
Have you tried Spacemacs + CEDET?
>>51660391
No, thanks for the tip.
filtering stuff from list,
Currently i have a list of object that looks like this, and I want to eliminate duplicate objects.
my expected result should be like this
UserList.java
String username
List<String> tagId;
List<String> roleTitle
Hi coders of /g/, I am looking for someone who has a good amount of coding experience in C++. Please contact me if you have experience in any of the following fields:
-Network engineering
-Coding games
-Penetration testing
-Hacking Prevention Systems
I am willing to pay for your work. The price is up in the air until we discuss the work that needs to be done, there is also an opportunity for forming a relationship where I would be willing to pay you for more work down the line.
>>51660484
What's your opinion on transexuals? This is important.
>>51660484
>coders
no thanks
>>51660505
they suck balls
>>51660466
halp plz.
>>51660466
Set/hashset
>>51660572
What time is it in Bangalore, Sanjay?
>>51660632
11:26 AM, and it's Putesh.
I hope someone can help me. been working this for week and yeah I googled it.
NEW THREAD
>>51660640