Old thread: >>51653845
What are you working on, /g/?
Himegoto was shit and you trapfags should kill yourselves.
First for OOP scripting
>>51660641
>expecting help from people whose jobs you're trying to steal
When will the curryniggers learn?
You sure you want to do this, OP? I really suggest deleting the thread and making a new one.
>>51660640
Am I supposed to cast my mallocs or is this simply done to maintain compatibility with C++?
likeobject *obj = (object *) malloc(sizeof(object) * size);
>>51660705
I'm almost sure that you don't have to cast malloc in C but yuo have to in C++. So yeah the latter.
>>51660705
C++ compatibility. Actually there are better reasons to NOT cast malloc.
>>51660734
let's see
>qt anime gril screenshot
>tired pics of old codgers
Really, do you hate cute things?
If you could crossbreed any two programming languages, which ones would you pick; and what would you call the offspring?
>>51660756
>gril
>>51660756
mcfucking mckill yourself
>>51660761
Lua and D, I'd call it Lucifer.
>>51660761
Java and python
I'd call it TAKETHEPOO2THELOO
>>51660761
Lisp and C
I call it Gen-2
>>51660761
Javascript and Php :^)
>>51660810
python isn't for curryniggers, it's for ADD shitkids
Why do so many people believe C is an ancient and outmoded language?
Most programming languages look identical to C give or take some boilerplate.
Why do people still use Java when Scala exists
When subtracting numbers from registers in the ALU, do people usually do (A-B) (Input 1 - Input 2) or (B-A) (Input 2 - Input 1)?
>>51660899
They draw from C, yes, but at the same time they provide other abstractions that make it easier to work with the language and features that save a lot of programmer's time while also providing a more expanded and safer standard library.
How do you feel guys that your superior language doesn't generate $ for you?
You can talk shit about this and that language all day.
>>51660761
haskell + scala
maximum autism
Took a C class, but how do I get good?
This is my current plan:
K&R->SICP->Introduction to Algorithms->Contribute to open source project
>>51660973
Haskala
it deserves to happen
I have a table with a lot of foreign keys. When I insert into this table, I want to check to make sure that the foreign keys exist, ie insert a row into the foreign key's table if one doesn't already exist.
Which is the better way to do this (or am i missing the best way?):
A) INSERT OR IGNORE into all of the foreign key tables every time I insert into the table
B) do a try/catch, catch a failed foreign key constraint and insert then
It takes about 3x longer to do the INSERT OR IGNORE, but the try/catch feels hacky and gross
>>51660999
>Contribute to open source project
Stick to your own pet projects before trying to contribute to something else.
You'll probably be overwhelmed by the complexity of non-trivial programs.
>>51660999
K&R -> read mpv source code -> contribute to mpv -> profit
>>51660761
C and Java
I'd call it C#
>>51660761
C+++
>>51660705
malloc returns a null pointer in C, so you have to cast it to the type you actually want.
For example:int *v = (int *)malloc(n * sizeof(int));
allocates memory for a vector of n integers.
>>51661334
>a null pointer in C
real dpt here
>>51660709
>>51660709
>>51660709
>>51661334
void pointer you nigger and you cast it in C++, not required in C
>>51661334
You're fucking retarded. Read K&R last week and thinks he knows what he's talking about
>>51661334
whoops, I meant a void pointer, a null pointer is what you get if malloc can't find enough memory.
>>51660920
SBT is literally unusable.
ops image would look good on their knees. even has handles
how DO I get gud at C
I heard K&R is a meme
>>51661390
>>51661386
You're right, guess I need to thank my fucking C/C++ professors
>>51661584
Use Learn C The Hard Way
>>51661599
were they Pajeets?
https://www.fsf.org/appeal/
I hope you'll all be giving something.
We need the FSF.
>>51661584
I used C programming: a modern approach from King.
It's a very thourough book.
You should read K&R only AFTER you learned C.
http://pastie.org/private/40lahdhhvo0q51tdcwd6tg
Download from hebe board on 8 channel.
>>51661584
Write more C.
K&R is an excellent book. However it assumes you're experienced in programming those difficult 1960s languages already. Maybe read C Primer Plus, or start out with a different language if you're just beginning. Do not use any of the Learn x the Hard Way books.
>>51661634
Starting with Python is a good idea, since you can grasp the basic concepts of programming quick and then easily move to C
>>51661668
>recommending python, a dynamically typed, garbage collected, slow as fuck, "Just werks", reddit tier language to people who want to learn C, the next abstraction layer up from assembly
>>51661634
Oh, heh. Programming exercise: spot the bug in my bash program. (You don't have to know anything about 8 channel to find it.)
>>51661634
>FBI: The Post
>>51661668
no fuck python
Building a Magic: The Gathering client in c++ using Winsock and Open GL.
If anyone happens to know enough about those things combined, any brilliant ideas for serializing board states using minimal bandwidth?
http://pastie.org/private/xfcqvargmv35reehgj4evq
Fixed 8 channel downloader.
>>51661761
I genuinely appreciate teenage girls and have a 17 year old girlfriend.
>>51661809
Python is excellent. Get version 3.
>>51661851
json
>>51661736
to be fair, python is the least "just werks" of most if not all hgi level scripting languages
>reddit tier language
what the fuck does that even mean
i want this meme to end
>>51661872
JSON and XML were the obvious choices but since I don't need to be compatible with anything else in existence I figured I'd come up with something that shaves a few bytes off. Probably not the best use of time desu.
>>51661886
just make it abstractable and leave this problem for later, you got bigger issues to deal with right now if you're gonna create a networked game using opengl
>>51661897
Basically everything is already abstracted into "Sockets Helper", "UI Helper", etc
My biggest problem right now is how in the fuck did desu get added to the end of my post.
None of the network stuff particularly worries me. Currently trying to invent some manner of scripting language to write cards in (Card Script is my genius working name) that would make adding all the damn cards that exist nice and easy / able to be done by any idiot.
>>51661851
Protobuf
>>51661947
>My biggest problem right now is how in the fuck did desu get added to the end of my post.
Stupid new 4chan filters.
>None of the network stuff particularly worries me. Currently trying to invent some manner of scripting language to write cards in (Card Script is my genius working name) that would make adding all the damn cards that exist nice and easy / able to be done by any idiot.
Why not embedded Lua? The JIT is really fast and it's really easy to write in.
>>51661947
unless you really WANT to write your own scripting language, id suggest using lua or python.
and if you want some advice, look into the composition pattern for handling card effects
start working on that gameboard state because everything else will just be implementation details after you're finished with that
>>51661969
When I say scripting language what I meant was some manner of "compiler" that would take plain english descriptions such as "ETB: tap target creature" in a text file and be able to turn these into a card database for the server to use
I plan to distribute this at some point and can't include cards/art directly for copyright reasons so I want to make it super easy for the "average person" to
A: make their own DB of cards
B: be able to dick around with custom cards if they want for fun.
some understanding of copyright law would be super useful.
XMage (https://github.com/magefree/mage) seems to get away with just not including card images, I haven't bothered to look at how they deal with actual card implementations.
Generally not a fan of the Java Swing UI they're using and to a lesser extent not that big on RMI either so I'm using my uni break to write my own implementation to avoid boredom.
>>51660705
It's not just C++, the early C standards required the cast as well, like C80 or before or some shit so there's really no need.
>>51660665
That crystal makes me cringe
>>51661736
>recommending c, the next abstraction layer uo from assembly to a beginner
I wish webmcam would stop trimming random chunks of my video.
Why does every webm based application suck ass?
Can freetards get ANYTHING right?
>>51662172
all a beginner needs is variables (WITH EXPLICIT TYPES), control flow and basic functions. you could use java but really C is just cleaner because you don't need the OOP and "verbosity" (fuck you FAGGOTS for making me use that word) right away
Ask your beloved programming literate anything.
>>51662223
>all a beginner needs is variables (WITH EXPLICIT TYPES),
Did you mean implicit? Why should a beginner worry about irrelevant stuff like variable type?
>>51662252
HOLY SHIT GO DIE IN A FIRE FUCKING SHITKID
>>51662259
>OOP is too verbose
>somehow having to declare variable types for every variable isn't too verbose for a beginner when he could just type a name and a value
>>51662276
IF YOU WANT TO LEARN ANYTHING ABOUT PROGRAMMING YOU SHOULD KNOW WHAT A FUCKING INT IS AND WHAT A FLOAT IS AND SO ON AND IT'S NOT FUCKING MAGIC YOU'RE DOING SIMPLE OPERATIONS ON SETS OF BINARY BITS
rm -rf /* will fuck things up but what does rm * do?
>>51662289
It's funny seeing how many autistic people there are on 4chan
I wonder how much vagina you see with such a strong opinion about binary bits?
>>51662320
>>51662209
Also, does anybody have any of their own map generators I can test this on?
the conditions are basically:wall: 0
floor: 1
the map must be bordered by a 2 pixel wide border
map must be connected
Although if your map isn't one that connects, tell me, and I'll just connectify it for you.
I might as well turn this into a roguelike at some point, so I'll probably add door usage sometime soon.
Actually, fuck, I'll do even better: I'll turn this into an automatic roguelike.
Fuck, no, even better than that:
A roguelike where you compete with a computer to
A: survive the longest
B: finish first
>>51662223
>all a beginner needs is variables (WITH EXPLICIT TYPES), control flow and basic functions
lel, k tard.
>>51662380
yeah they definitely need abs() divmod() input() open() staticmethod()
all() enumerate() int() ord() str()
any() eval() isinstance() pow() sum()
basestring() execfile() issubclass() print() super()
bin() file() iter() property() tuple()
bool() filter() len() range() type()
bytearray() float() list() raw_input() unichr()
callable() format() locals() reduce() unicode()
chr() frozenset() long() reload() vars()
classmethod() getattr() map() repr() xrange()
cmp() globals() max() reversed() zip()
compile() hasattr() memoryview() round() __import__()
complex() hash() min() set()
delattr() help() next() setattr()
dict() hex() object() slice()
dir() id() oct() sorted()
>>51662380
explicit types are important so the user knows what is happening.
No random crashees because python decided to treat your variable as a string in one specific instance and nowhere else.
>>51662394
types are not even fundamental to programming (Lambda Calculus), you fucking uneducated pleb, programming is not even about computer in first place, that's why C is one of the most disgusting programming languages for learning. take a computer science class or read sicp some time.
>>51662432
>>>/reddit/
>>51662394
What about a middle ground ?
Static typing with compiler type-inference
Look at Scala's type system. It's really fucking cool.
>>51662432
>programming is not about computer science
Who said it was?
If you follow the thread up, the person was asking about programming, not compsci :^)
>>51662455
that actually sounds great. I'm just mainly against the idea of not being able to specify a type at all, and having to jump through hoops to check types.
>>51662459
where in my reply have you read computer science ? are you really this retarded ? please don't be this retarded.
>>51662495
you've gotten comp sci and programming mixed up if you don't think your post is talking about comp sci
>>51662507
i was referring to computers, the machines, not to computer science. and for your information, programming IS part computer science. please now refrain from posting, it's painful.
>>51662526
you have out-autismed me. congratulations, anon.
>>51662289
But they will know what an int is, what a float is, what a string is, what an array is and whatever else, they just won't have the type notations getting in their way, making it easier for them (i.e. not overly verbose for a beginner).
>>51662546
if they're literally 5 years old or have severe ADD it might be a problem to type types.
>>51662495
whoops, I misread computer as computer science.
2tired2sick
>>51662432
>computer programming is not even about computer in first place
Someone suggested to me yesterday that I switch from VB for my first project to using C#. I literally just started a fresh project and found that the simple act of creating an XML file is a hundred times more complex.
Why on earth did someone suggest this?
>>51662610
they're brainwashed microsoft shills. use java instead.
>>51662610
They're brainwashed Microsoft shills, use C++ with PugiXML instead.
How do I get a programming job?
>>51662610
>Someone suggested to me yesterday that I switch from VB for my first project to using C#
That guy is a fucking genius.
>>51662625
Build an ebin github account :DDDD
>>51662623
>guy uses visual basic
>C# is too complex
>use C++ instead
>>51662617
>Java
No thanks, I don't want to have to skin myself alive just to get some relief.
>>51662623
I need to use visual studio, because it's the easiest way to create a UI and make everything Just Work(tm). There's a default xml system in place, it's just a tonne more complex than it was in VB.
>>51662630
Clearly not, because this is now far harder and has completely handicapped me.
>>51662643
>No thanks, I don't want to have to skin myself alive just to get some relief.
epic meme!
>I need to use visual studio
>this is now far harder and has completely handicapped me
suit yourself
>>51662652
Well unless you can suggest a DE that can build GUI's as simply as visual studio can, that would also make my life easier, then I don't see how I'm wrong.
>tfw doing swift
Why is swift such a piece of shit.
It's like, badjava.
>>51662666
QtDesigner
>>51662666
http://www.eclipse.org/windowbuilder/
>>51662643
>Clearly not, because this is now far harder and has completely handicapped me.
At least it's a way more useful skill than VB.
>>51662691
>C++
>Javascript
Pass.
>>51662681
How is this any better?
I'd still be writing in C#, I'm not sure how a DE change will make any difference.
>>51662691
True enough.
>>51662707
java != javascript
>>51662718
When the entire argument is about which language is best, and what DE isn't shit, I think it's beyond me.
I don't know why I find this so insanely hard, I'm sure I understand the concepts of programming, but settling on what to use seems to be 99% of the issue.
Which one would be the best for the generation of xml files using inputs on a GUI and then also use those inputs to create folders/move files.
Also I need to use maps/dictionaries in order to store values.
Which language would best suit all of that.
>>51662707
C# is pretty easy, honestly. I'd expect even someone with only VB experience to bea ble to pick it up pretty easily. I think the WYSIWG editor in Visual Studio is pretty good so you shouldn't have to actually fiddle with XML too much, just drag and drop?
Ignore the naysayers. If you're writing a windows program, there is literally no reason to not use either C# or C++ and develop with Visual Studio. It makes life much easier.
>>51662707
Never said C# is the BEST skill. It's better than VB. Only a fool would not choose Go as the superior programming language.
I'm bored. Anyone have any Python questions/problems? I'm up for anything, who needs help?
>>51662787
Why'd you learn such a shitty language, and not a fast one, like C or C++?
>>51662786
>Only a fool would not choose Go as the superior programming language.
m8...
>>51662787
10/10
>>51662796
Who said that I didn't learn C or C++? I use Python at my agency and really love it, it is a blast to code in and you can do some pretty cool stuff in a short amount of time.
I bet you don't even program.
>>51662787
Why is python so awesome?
>>51662787
I do
1. How shit is codecademy
2. Why'd you do python
3. Is python a meme language?
>>51662823
>forced indents
>>51662787
how do I choose between Python and Ruby?
>>51662823
Functional programming has all the benefits of shitty scripting languages like Python (i.e., small code size, relatively fast to write) AND it'll usually compile to code that's comparable to efficient C/C++ code.
Again, why would you choose Python over Haskell or Racket?
>>51662849
>finger typing
>>51662787
what's the best python IDE?
>>51662824
FIOC and polymorphism. :^)
>>51662834
>1. How shit is codeacademy
I'm not too familiar with that site, but I generally recommend against those types of online course-based learning approaches (especially if you have to pay). Books and experience are always superior.
>2. Why'd you do python
Honestly, I chose it on a whim as the language of choice for my agency (about 9 years ago now). I heard good things at the time and it seemed like it had a bright future. I've been incredibly happy with my decision.
>3. Is python a meme language?
I tend to think anyone who uses the word "meme" in this way is retarded.
>>51662854
Build the same thing in both and you will find out why Python is better.
>>51662855
Once again, it doesn't sound like you actually code.
>>51662880
PyCharm is what some of my employees seem to like, but I prefer good ole vim.
>>51662916
>I heard good things at the time and it seemed like it had a bright future. I've been incredibly happy with my decision.
Pythonfags, everyone. Enjoy your great concurrency support.
>>51660640
Whats the best IDE for java?
>Inb4 java is fuggin shit x'DDDDD
>inb4 Muh hipster frameworks / functional programming x'DDD ;PpPP ;^)
>>51662973
IntelliJ with IdeaVim is decent.
>>51662973
Eclipse
>>51662916
>not using Emacs for Python
If you're going to use a shitty interpreted language, at least do so in an editor with amazing REPL support.
Opinion discarded.
Finally decided to use C# and just get on with it.
But obviously things are a lot less simple now, how does one write a foreach (file in folder) loop?
I'm not sure how to iterate in C# at all.
>>51662973
eclipse
>>51663062display_ACTIVEFOLDER.Text = folderBrowserDialog.SelectedPath;
foreach (int element in Directory.GetFiles(display_ACTIVEFOLDER.Text))
{
file = System.IO.Path.GetFileName(folderBrowserDialog.SelectedPath);
listBox_CAT.Items.Add(file);
}
Can someone tell me how much of a retard I am and how I would do this in a way that actually makes sense (currently the foreach says "can't convert type string to int")
>>51663153
Change int to var.
>>51663164
Done, but why?
I'd like to know why I was being retarded.
>>51663170
>Directory.GetFiles(display_ACTIVEFOLDER.Text
Returns strings, not ints.
>>51663187
This is probably a question with far too long an answer to expect a decent response, but how would I best create a way to give the selected files a category, then have them be displayed with that category, then add a description to the category and be able to call on that category in future and the filenames/description contained within it.
I understand I'd have to use a Dictionary, but beyond that I'm a bit lost. Not sure how I'd go about organising the dictionary in a way that I'd be able to edit on the fly.
This is an image of the UI I currently have, it seems awfully convoluted and pretty user unfriendly.
>>51663264
Forgot image.
>>51662610
Have you ever noticed there's pretty much no shitposting about VB, ever?
Ask yourself why.
>>51663164
change it to string you disgusting nigger
>>51663293
But I'm using C#....
>>51662240
where do you get all these webms from.
>>51660756
Don't be an idiot. You know it's bait with the tumblr filename.
>>51663310
Thank you for your question (though not programming related). I get the webms from the usual meme producers (4chan, reddit, tumbler, japan, neogaf ,...)
>>51663264
There're a million of ways to do this. The proper solution depends on how you iterate throught the data.
One way is to create a dictionary with the category as key and a list of file names as values. This way you get fast lookup times for finding files for a specific category. If you want to look up the categories for a specific file (assuming it can be tagged with multiple categories), the lookup time would be a disaster.
Is there any way to apply Python's indentation-delimited blocks to other languages? C# for example. Say, via a preprocessor or an editor plugin?
>>51663361
Yeah that's what I'm trying to do, I want each category to create a dictionary with the category on the left being used as the key and however mane filenames associated, and I want to force the filenames to only be associated to one category at a time. Removing the association would be as simple as removing the dictionary with the selected category key.
It seems like a highly complex and convoluted mess to me, there really doesn't seem to be a simpler way to display and enter the data that doesn't involve me writing a paragraph on it's usage.
>>51663389
It's not that complex. If you want to list all files by category, do something like this:for (pair in map) {
for (file in pair.value) {
// handle file
}
}
Looking up files for a specific category would look something like this:for (file in map[key].value) {
// handle file
}
>>51663434
Damn that looks a lot more confusing than I would've hoped. Still don't particularly understand.
Is there a nice neat way to create a dictionary entry with just a key and then add values to it later? I want to be able to use the listbox to display the dictionary keys so I can more easily delete the entry with that key.
Once I know how to do this all I have to do is parse the information in the dictionary to create an xml file and move the files into the created folders.
Storing data seems to be an insanely difficult task, because I want to store so many different types of data is it worth creating a temporary text file or something to hold it all in?
Need to be able to store, change or remove the category name, the associated filenames and a description.
Trying to implement the gspan algorithm for analyzing subgraph frequencies. Pic related. Anyone got any tips?
Sup, guys. I'd like to know the best guide to C++ programming. I tried googling but it returned so many results that I thought it would be more efficient asking you nerds. I have a little experience with Java, Javascript, Python and some C. What book or tutorial you did to make understand C++ better, /dpt/?
Also, I heard that if I start wearing girl clothes I will really get better at programming. Is that true? I mean, I'm asking for a friend.
I'm currently learning Java and I'm thinking about applying for internships after I heard that some coders inside companies didn't even know how to make a FizzBuzz. Is this true or just a meme? That's because I thougth that programmers/coders were like very knowledgeble and demi-gods of the computers if you know what I mean.
In Java will I have any problems if I have many threads reading and writing onto an array if the writing is in a synchronized function?
In my situation I would be using a few threads to read an index unique to itself and then write to it. Each thread will only read/write on an index that has no other thread using it, after every thread has written once they all read a new random unique index all together and write again. I'm wondering if there will be a problem reading/writing since the array they are sharing is not volatile/atomic. So far I see no problem from printing it a few times between a few iterations but I'm still worried.
>>51663613
http://en.cppreference.com/w/cpp/language
>Also, I heard that if I start wearing girl clothes I will really get better at programming. Is that true? I mean, I'm asking for a friend.
only if you're programming in haskell
Anyone here competent enough with C# to deal with an utter fucking retard whining at them for a while? Post some way to contact you, skype, steam or something like that.
I'm completely lost and clearly need a hand or I'm not gonna get anywhere.
>>51663640
normies in any profession are mostly stupid as hell
>>51663601
Add a new entry to the dictionary with as value an empty list. You'll be able to add files later on to the list.
I wouldn't bother with tmp files right now. Just leave it in memory and make it just work (tm) first.
>>51663670
Add a synchronization block on the array, not the writer.
>>51663743
>posting outdated information
>>51663670
they will still see the correct value in the array if they lock on the same monitor when reading the index.
also the array doesn't need to be volatile because it's just the reference to the array that becomes volatile, which is useless if it's always the same array and the reference is already known to each thread
>>51663831
Why would I trust the chart made by somebody somebody who's IQ is less than 55?
>>51663842
>somebody somebody
Because you just proved it right.
>>51663870
I reworded part of my sentence and forgot to remove the duplicate word.
For some reason, your perception seems to skip over those sorts of things when checking your post.
>>51663870
Not noticing:
>who's
>>51663870
>who's IQ
y-you too
>>51663798
I still have absolutely no idea how to create a dictionary with a key and an empty list as the string. That's all I'm struggling with at the moment.
Because I need it to hold 3 values, the key is the category name (which I hopefully can actually call later on), the filenames associated and then the long string of text that makes up the description.
It seems like what I want to do is the most complex thing in the world right now.
>>51663723
I'll help you, but I'm not putting anything that can be connected to me on here.
Post your steam.
This may be a bit of a stupid question. I've inherited/taken over development of an open source app; the current automatic update process uses HTTP downloads to transfer the updated files from a shared dropbox link. Unfortunately, the project's become popular enough that I'm able to overload the 100,000 daily hit limit on my account with an update that touches ten or more files. The project itself compresses down to about 3MB, but I'd prefer to retain the current individual file update method if possible. Anyone know of a free service that can be used instead of dropbox?
>>51662973
Use intellij idea. Community edition is free an actually uses javac for compiling and not some internal compiler shit like eclipse.
>>51663918
>open source app
Use github's Releases feature.
>>51663918
Can't you just distribute shit using git?
>>51663910
http://steamcommunity.com/id/sirdoombox
>>51663930
>>51663927
That's what I'm doing, but I don't want to force users to replace their entire folder if I update an XML file. I mean if I have to I can just change the current system to check if there's a new release at github and offer a prompt to download, but if there's an option that preserves the current system that would be nice.
>>51663900
Wrap the file name and description into a single object. Some the object should contain the field fileName and description.
Why is the documentation for libav* so terrible? Can anyone point me to anything that would help me figure out how to transcode audio files?
>>51663900
dude, it's literally a vending machine. Quit making mountains out of molehills. These data structures are made to help with making data retrievals faster and easier not more complicated for keeping hackers out. That is what closure is about.
dictionary.add( key, value );
>>51663954
A github release can have more than one file in it.
>>51664038
Like I said, it's a stupid problem that doesn't really need to be one. Currently I use appveyor to do the unstable builds, then package up the binary folder for the proper release. If possible I'd like to retain the current update code that allows for only updating the changed files.
https://github.com/chummer5a/chummer5a
Since sqg is almost kill, I'll post here, hope that someone will help SQLite newbie.
I'm trying to get values from SQLite Database in my Android App which are in between some dates. They are stored in long values.
Throwing everything inside whereClause works fine, but I know that it can be dangerous thank to injection attacks. What I can't get my head around is how to properly use whereArgs.
This is my working-but-vulnerable whereClause:whereClause += DreamTable.Cols.DATE + " BETWEEN " + jsonArrayDates.getLong(0) + " AND " + jsonArrayDates.getLong(1)
When I do it like this:whereClause += DreamTable.Cols.DATE + " BETWEEN ? AND ?";
whereArgsArray.add(jsonArrayDates.getLong(0) + "");
whereArgsArray.add(jsonArrayDates.getLong(1) + "");
and thenwhereArgs = whereArgsArray.toArray(new String[whereArgsArray.size()]);
It gives me big fucking nothing, no values. Help me plx, senpaitachi desu wa.
>>51662643
XML In C# is really easy.
There are better ways like Linq which look nicer but in no way is this xml hard.
Also if you have problems StackOverflow is great because 99% someones had that problem if not ask a question on there.
can someone explain instance variables in Java to me ?
>>51664084
The only problem is that your existing update code assumes the... wait a second. I've never seen anyone use negative version numbers before. It's like the version numbers are counting down to some critical release event.
Anyway, it assumes the individual files are always at the same location in the dropbox folder, rather than in a different location each release as with GH releases. If you want to take the brutal approach, you can use github pages instead of github releases, and then check all of your binaries into your gh-pages branch.
But honestly, maybe you should just redo your update code. It looks like crap.
>>51664228
each object instance of a class has its own "non-static" variables called instance variables. if you set a variable in an instance method to a certain value then the value will only apply to that particular object. if you set a static variable to a certain value then it will apply to all objects because there is only one static variable accessed statically through the class.
>>51664261
>this would never happen with python.png
nope, because python is no good for serious applications
Lua is so fucking good. I don't think I hate myself right now after spending an hour hammering out a project with some slick iterators. And it works with all test cases I've got and it's lightning quick too.
Why isn't there more love for this little language? It's got this really pleasing consistency of all its features since it's really just tables all the way down.
SQL question:
When I create a function where you have to enter several values.
Can I insert these values into several tables ?
Like two "INSERT INTO" one after the other ?
>>51664261
Heh. It's not my code, I just inherited it. Originally the negative numbers were a test naming convention and I never bothered to update it. These just I just discount it by five every time I update. I guess changing the update code to just pull down the latest proper release will do the job as well as the current system does, just with a bit less granularity.
>>51663368
do you mean like a linter?
lots of editors have plugins for them
>>51662113
it's nice enough for shell scripting. has wrappers for most posix apis and such. lack of parallelism sucks donkey balls though.
>>51664200
>Throwing everything inside whereClause works fine, but I know that it can be dangerous thank to injection attacks
Why would you care about local-only SQL-i? I.e. in queries that won't go outside of the phone, just used internally?
>>51660999
>think of something you want to make
>make it
ezpz
>>51664478
Not in a single query. You can do that within a single transaction, however.
>>51664676
Well, I think it's all about making good habits. I'll be, probably, making some webapp in the future, so why not learn now how to do it the proper way?
Also, I'm curious why it doesn't work.
Thanks for no answer.
>>51664763
>I'll be, probably, making some webapp in the future, so why not learn now how to do it the proper way?
When you get to that point you will use an ORM library instead of being a nigger picking the cotton and writing queries manually and worrying about them being not safe. So it's not really a habit to learn.
>>51664770
I'll look into it, thanks anon.
>>51664770
Man you just had to bring race into it. Stay classy, /g/
>>51664713
I'm not familiar with transactions.
But forget about inserting into two different tables.
I got the shit wrong. What I really need to do is inserting a single value into two different tables.
For example I insert some value in table named "room". I have to insert the idRoom into the room table but also in the table "available".
That's where I block
>>51664895
Why would you have a separate table for that instead of just another column in the room? Then you could just:INSERT INTO `room` (`id`, `available`) VALUES("some id", 1);
>have to make a small change in every function in every controller in the entire company application (over 30)
just fucking kill me
>>51664920
This, it would be better design to let 'availible' be an attribute of the room.
how would you implement hooks in plugins /g/? currently i have System and Plugin
>System sends message to Plugin
>Plugin handles it
and i want it
>system send message to hook object
>hook decides if it want to handle it
>if not, it sends it to plugin
problem appears when i have multiple hooks, what should happen? lets say hook1 handled data, should hook2 get to process this data? im confused here, what the logical answer, what would you expect developing such hooks?
>inb4 just be jourself
My college is giving out a small cash prize to 10 people who can come up with ideas for apps(desktop or mobile) that would be useful for the institution.
Can you please share some interesting ideas? Thanks
>>51664996
Add priority to the hooks so you know which order you want to pass the data to them. Then have the callback function return a boolean, if a hook returns true it means that the next hook is allowed to get the data, if it returns false then it blocks further propagation.
>>51664979
Regex that shit nigga
>>51665019
>the institution
What institution?
>>51660761
PHP and Haskel.
I'd call it Where is your God now?
who here /ruff victory/
Got things about to where they were before remodelling.
>>51665045
the college itself
>>51665129
School shooting detector.
>>51660761
php and C++ so i can fucking have typed functions and variable hints
>tfw 45K per annul
PHP4LYF
>>51660761
B and C. I'd call it D.
>>51664920
The database is already created and I can't modify it. That's a test requirement. But I tought of the same thing as you.
Anyway, any idea on how I should do that ?
Making a PowerShell script to automatically sync my library to Opus on my phone.
Problem is that my phone can't into internal mass storage without rooting, so I can't sync the files directly onto my phone (since Windows can't into mounting MTP as a filesystem).
How do I know a socket has received everything that was sent?
>>51665024
after rethinking multiple possibilities i know that theres no good answer to my problem
>priority
what if two hooks have the same priority? order could be unspecified.
i was also thinking about registering hook to specific message type, and allowing only one hook per type but this wont work too because i need multiple hooks per type, and multiple types per hook.
ill probably send it to all hooks and let the god decide what happen next
fixing my 4chan app so you faggots will stop bitching about it
>>51665382
Post it fag.
>>51665368
google "checksum"
>>51660761
rust and scala.
I'd call it Σ
>>51665407
You misunderstood me. When working with sockets in Python, the TCP headers and all that are skipped, you just get the messages.
So is there a way to find out if you've gotten everything?
>>51665399
try the app store m8
>>51665442
Send EOF or close the connection/send FIN.
TCP is reliable, either you got everything or an error. Excluding malicious intents.
>>51665491
I'd do that, but I'm connecting to a FTP server and it doesn't seem to send those.
The thing is, I'm currently sending LIST, and that works well. But when I send a second LIST, it just bitches the data connection's been closed.
is there a way to learn to enjoy programming
How do I link libraries in C
>>51666294gcc main.c -lmylib
>>51666267
there are two ways to enjoy it:
a) instant gratification by solving a trivial issue. decompose larger tasks into smaller tasks that give you instant gratification
b) having a difficult problem and getting into the flow as you look into it and slowly start to understand it. once a mental model starts forming and you eventually get that AHA! moment can be quite rewarding
A healthy mix of both makes you a good software dev. If you only focus on a) you'll be part of the problem called "cascade of attention-deficient teenagers".
I need a recommendation, guys.
I need a book that explores the following topics:
networking, guis, i/o, concurrency, general software development.
Something like the java tutorial, but slightly more on point and focused.
The book MUST contain exercises.
If any of you have titles that come to mind, feel absolutely free to post them , even if they don't cover 100% my requirements.
>>51666267
clash of code
https://www.codingame.com/clashofcode
>>51666267
the same way you enjoy anything else, like playing football. You play, if you like continue, if you don't, choose another sport or hobby
>>51666666
Confirmed double Satan
>>51666754
i don't like it but I'm going to uni for cs so i have to do it
>>51660761
Agda and ATS
I'm doing it right now
>>51666666
>666666
>>51666476
>networking, guis, i/o, concurrency, general software development.
I doubt you'll find all those topics in a single book.
What you might find is something like a "cookbook" which tells you how to write code for those things in a given language, but it will assume you already know how those things work. I can't really help you with such a book, only point you to http://it-ebooks.info/search/?q=cookbook&type=title
if you need a book specific to one of those topics I can help you with that
>>51666666
>>51666785
>i don't like it but I'm going to uni for cs so i have to do it
Well I assume you atleast like the more theorethical aspects of CS, otherwise you'll be miserable in there.
Try to implement something related to the topics you like, for example when you're studying the automata or a touring machine try to implement an UI so you can see the transictions of the states.
>>51660640
FAAAAAAAAAAAAGOOOOOOOOOOOOOOOOOOOOOOOOOT
>>51666918
no i don't really like anything about it
just seeing if there are ways people tolerate it
>>51666978
Then why the fuck are you doing it?
Apple open sourced Swift.
https://swift.org
Apple also now on Github.
https://github.com/apple
>>51667028
Awwww sheeeeit.
Oh yeah baby.
Some big stinky, apple reeking dogshit of a language!
>>51667028
Fuck off to your mac shilling threads macfag
>>51667028
They put the source on github, but there's no code of conduct. Expect this to be taken down shortly (or "swiftly" heh).
>>51667071
>or "swiftly" heh
>>51665368
> How do I know a socket has received everything that was sent?
On Linux, you can use ioctl(SIOCOUTQ) on the socket; this returns the amount of unsent (i.e. un-ACK'd) data.
Other than that, you're relying upon some form of in-band acknowledgement from the receiver.
Also, when the socket is closed, you need to use shutdown() to close the Tx end and read until EOF before calling close() on the socket. If you just call close(), the connection may just be reset (RST) and pending data lost.
Anyone else find it too difficult to listen to music while trying to be productive? Whether it's lyric-less, I get the feeling that I want to be doing something else. I am only in the learning phase though so maybe it'll only last as long as this phase does.
>>51665620
You know that FTP uses separate connections for control and data, right?
Are you handling setup and teardown of the data channel correctly?
Also, you need to use passive (PASV) mode if the client is behind a firewall or NAT. The default is for the data channel to be established by the server connecting to the client, which requires the client to accept inbound connections.
What is /dpt/'s C/C++ replacement?
Imb4
>using C++
>>51667291
Java
>>51666988
i didn't really want to do anything
but I'm expected to go to uni
and someone said I should do cs
Has anyone ever tried buying multiple cheaper second-hand GPUs just to use for GPGPU?
>>51667291
Ada
>>51667028
looking forward to seeing a Linux port for Swift soon
>>51667291
Rust, D, Anything but Ada
>>51667301
Spending eighteen hours a day on your PC doesn't equip you with the skills or aptitude to do CS.
You've been led on.
>>51667273
I'm quite similar. I continuously want to 'follow' the music and I find myself not doing what I am supposed to.
>>51667291
Rust.
>>51667282
>You know that FTP uses separate connections for control and data, right?
Yeah. The first LIST is transmitting correctly, so I'm not cocking that part up.
>Are you handling setup and teardown of the data channel correctly?
I think so. As I said, the first transmit happens correctly. My code for that is:cmd.send('LIST\r\n') #the command channel
while True:
data = conn.recv(256) #conn is the data channel
if not data:
break
#print data
print cmd.recv(256)
After that, I try to send another LIST, but the server responds with 'data connection closed.'
>>51667301
getting out of school with 50K in debt and no job is something you SHOULD NOT do
dont fucking go into a field you don't want, you WILL DROP OUT WITH DEBT
>>51667291
Go, its definitely time to break away from inheritance and move toward module-based OO. The Go guys were inspired a lot by Modula-2. Ada was also inspired by Modula-2 but Ada goes to far with an obsessive strictness in type declarations which can get in the way of ones flow of thought in programming
>>51667435
>interface{}
Coming along nicely
>>51667344
i know it's dumb but i never really have been interested in anything so whatever
>>51667408
i'm not paying for it at least
it's a scholarship
>>51667498
>basic OS X paint program
Finally. Is it going to be open source?
>>51667527
you sound like a person who needs some acid
like no joke, changed my life, i sounded a lot like you when i went to school before i dropped out.
go find a hippy friend, just dont let him trick you into taking more than one
Not necessarily a DPT stuff, but I have just been introduced to the concept of Monadic Second-Order logic [1,2], which are equivalent to Finite Automata.
I'm wondering why no mso2re tool exists that would convert a formula into a regex, so that one can `grep "$(mso2re --bre 'a formula')"`. An n-term MSO formula can degrade into a 2^2^...^2 (with n ^s) state minimal automaton, but that only shows how expressive the MSOs can be compared to regexs.
I'm thinking of implementing the aforementioned `mso2re` tool. Thoughts?
[1]: http://www.brics.dk/RS/95/21/BRICS-RS-95-21.pdf
[2]: http://www.fi.muni.cz/usr/kretinsky/MSO_Javier_Esparza.pdf
>>51667557
>you should try acid so you'll drop out of school like me
I'm good thanks.
>>51667557
how would acid help?
>>51667557
if you want to try psychedelic drugs, try shrooms, its so much more pleasant than acid. acid is like a near-death experience
>>51667537
Yes, if I manage to finish it. It's basically obsolete until I add a flood fill function & a select tool imo. Also been thinking about adding frames for sprite creation, but maybe that'll be a separate project.
Will keep ya updated
>>51667557
this tbqhwy faá Žm
>>51667596
the two didnt relate bro
i went to school for multimedia, dropped out after 2 years and have been making 50K a year since doing webdev.
The lsd will open up your mind, let you realize some possibilities, and hopefully find that motivation.
It works for drunks and people addicted to hard drugs, they realize whats important in life and shape up.
I found the motivation for development and wanting to solve problems, and spent literally every waking moment learning and developing, dropping out was a combination of lost interest in design, and i was working on more personal projects than school work, so i was starting to fail.
One of the compsci teachers helped me land a job with a local startup and i've been living the startup life since, and even got my debt to go away.
I've got plans to start my own company next year, and that seems to be on track.
I'm sorry the stoners and hippies you know cant do anything more than flip burgers, but the rest of us have some fucking motivation.
>C++
>int reference count
>Doesn't need to be thread-safe, but needs to be usable from multiple threads (caller needs to serialize calls, but each call could be from different threads)
Will a standard int suffice, or do I need something like a std::atomic or a manual memory barrier?
>>51667692
>One of the compsci teachers helped me land a job with a local startup and i've been living the startup life since
So you got lucky. Getting lucky has nothing to do with LSD, it has nothing to do with your ability or your credentials its just random luck
>>51667699
Use std::atomic. Even if modifying the int is thread safe on your system because the writes are sequential, the visibility of the int being changed may not be apparent to all the threads unless you use std::atomic
Whats the recommended way for remapping keys in Linux and OSX?
>>51667752
Remapping keys for what? A single application? Be more specific
>>51667760
The ctrl and alt keys are in the wrong place, for a programmer you should at the very least remap ctrl with capslock. I never use tab, so I want to remap tab with alt, I also want to move the apple key (windows key). I can do almos all of that in the OSX config except for tab. Vim users would probably want to remap the esc key.
>>51667709
>or your credentials
i am 100% a self taught developer, the only thing thats landed me a job is my motivation, which didn't exist until the lsd trip.
my only credential is a highschool diploma, the only work i had to show, was the work post acid trip when i got my motivation to become a developer.
do you know what i was doing everyday before the acid trip?
>wake up
>smoke weed
>go to bed
>repeat
i gave zero shits about life, and zero shits about me, i just wanted to fucking kill myself.
I had zero goals in life, every night i hoped that i just wouldn't wake up.
Tripping balls for 12 hours makes you seriously think about yourself and the world, it lets you realize there's more to life than yourself, you realize how beautiful and intricate the world around you really is and how much of a piece of shit you are just being lame and not giving a fuck, it gives you the motivation to help the world, and to keep it beautiful, and to be a part of something greater.
It brings back that spark you had when you were a child of dreams of being an astronaut.
LSD isn't there to make the world funny, or to have a laugh, that's what weed is for,
LSD helps gives you back the spark you've lost.
And once you have your spark, you can do fucking anything.
find your spark anon.
>>51667742
Yeah that's what I was thinking.
>>51662290
I know it's late, but that would just delete any file that's in the root folder.
Since it doesn't have the -r option, it won't delete anything inside the folders thus it won't delete anything from the system.
>>51667838
>the only thing thats landed me a job is my motivation
You just said you got your first job because one of your profs hooked you up with a start up. That's luck.
You could have LSD'd from here to bangkok and shangrila'd the meaning to life, but you'd be a homeless jobless bum if you didn't have the hookup. That's luck, it has nothing to do with whatever spark of motivation you got from LSD.
Pretty hilarious that you think motivation and drive have anything to do with success. Its luck and nepotism, there's nothing else.
>>51668001
>Its luck and nepotism, there's nothing else
this.
A million times this.
What's missing from prolog that makes it so unusable
>>51668110
concurrency
>>51668001
he gave me the contact to talk to
by that sense i was "hooked up" but only because i didnt know the job existed so i couldn't apply, i still went through a formal 3 week interview.
and after shitty management those bridges were burned, my next job was obtained purely on my skill and motivation, i haven't even mentioned the name of the first company in 4 years.
Before the lsd i wanted to kill myself
Afterwards i had such motivation for development it caught the eye of the compsci teacher
without LSD i would have never had the motivation or the interest to learn programming
without that interest i wouldnt have spent so much time in the library doing personal projects
without my personal projects i would have never gotten the attention of the compsci teacher
all of which i never had until my 12 hour trip
i would currently be jobless with an arts degree living with my mom if i didnt trip balls and find my spark again, i was in the same boat "well 3d is neat ill go into animation" then hated every second of it.
maybe you dont need lsd to find your spark
but just fucking find your spark
>>51668107
>you only succeed by knowing people
>80% of the startup scene in Silicon Valley is trust fund babies trying to get funding for their dog walking app
we need more idiots in Silicon Valley, come here and you will meet people just like yourself
>>51668174
You got lucky kid, just like everyone else who isn't living under a bridge at this very moment.
>>51668227
i'm sorry that's how you believe the world works
>>51668249
I'm sorry you're so degenerate you honestly believe frying your brain with drugs is the only way to achieve the transcendence required to get a fucking job.
>>51667752
to answer my own question, it looks like Karabiner (formerly KeyRemapForMacBook) is the only game in town for OSX. Ubuntu/Mint seem to use xmodmap (or xkp, or xev) which is an overly complicated terminal configuration tool. You would think someone would make an easy GUI key-remapping tool for Linux
>>51668174
i don't think I ever had a spark
i just feel like a robot, never really had any interests or wants
just do whatever I'm supposed to do
Is anyone doing Advent of Code? The problems are pretty basic so far, but I'm hoping they'll get more advanced soon.
>>51668329
How does a robot live?
What do you do for fun?
Watch TV?
>>51668329
I TRIED SO HARD AND GOT SO FAR
BUT IN THE END
IT DOESN'T EVEN MATTER
>>51668424
i just browse 4chan and engage in escapism
sometimes anime and videogames
when I was younger I would read a lot and use books for escapism but now I just have the internet
>>51668282
I'm sorry you instantly assume people who do drugs are degenerate
everyone walks the path of life differently
i'm sorry you're some straightedge neet and i dropped lsd twice and my life and obtained any motivation i need to land a job, making 50k a year doing php and even chief up with my bosses every day on lunch.
>maybe you dont need lsd to find your spark
>but just fucking find your spark
its not about doing the drugs, its about finding your motivation in life
LSD just happened to be how i found mine
Sorry its helped people with a history of decades of hard drugs use
Sorry its helped people overcome PTSD
Sorry its helped me with not killing myself
Sorry something you dislike helps others
Sorry i can smoke chronic weed every day with my boss and make 50K as a php developer
>>51660752
>Actually there are better reasons to NOT cast malloc.
Such as...?
>>51668329
has nothing in your childhood made you wish for greater?
Never wanted to go to space?
Never wanted to peruse science?
never wanted to peruse a life as a Chinese cartoon creator?
not trying to troll
but you've never had any motivation to do anything?
Because in this day and age, its all possible.
>>51668503
I do those things too but I don't consider myself a robotic automaton without interests or wants.
Surely, you have ambitions for the future, right?
>>51668527
>PHP developer
you really aren't helping your case here
>>51668527
Not him, but I think it's superstition. Same when people wear their 'lucky underwear' or perform a rain dance. It wasn't the drugs that changed you, but your idea of doing drugs to improve your life if that makes some sense.
Anyway, 50k is really nice for a self taught programmer.
My biggest drive to improve my coding is to work abroad. Sounds shitty, but at least it works.
>>51668577
i occasionally get motivation to do something but it's fleeting
really only lasts for a few hours
>>51668591
not really
I mean
I guess I'm supposed to finish college and then get a job
but it's not that I necessarily want to do that it's just I'm expected to
i don't really have urges to do anything
i sort of just spend my days killing time
>>51668527
You make an average salary at an average job doing average things like PHP dev and smoking weed. Are you... a normie?
struct list {
int val;
struct list *next;
};
Say I fill the list such that it's:5 -> 2 -> 4 -> 7 -> 3 -> NULL
How do I remove a specific element? Say I want to remove elements in this order: 2, 3, 5. I need to remove from middle, end, and front.
I'm learning C and pointers are bothering me. I can't wrap my head around it.
>>51667372
But are you creating a new data connection for the second LIST?
Each command that involves data transfer uses a new connection. The sender will close it after the transfer.
>>51668674
Pointer chasing.
>>51668626
>It wasn't the drugs that changed you, but your idea of doing drugs to improve your life if that makes some sense.
that actually does make a lot of sense, LSD was the only drug i treated as a "medicine" everything else was to party with. (ugh thankfully that part of my life is over)
>>51668614
i'm making more money in php being self taught, then /g/ expects you to make out of college.
Sorry you hate php, but i'm damned good with it. (migrated from C++ so i think that really helped my code quality a lot)
>>51668648
>I guess I'm supposed to finish college and then get a job
>but it's not that I necessarily want to do that it's just I'm expected to
My motivation for finishing school is so I can afford to leave my house and see the world.
i don't want to be stuck in my shitty suburban town my whole life.
Surely, you're telling me you're so comfortable with your life at this moment that you couldn't possibly yearn for more?
>>51668674
Treat it as three separate removals.
Sure, it's slow, but it;s a singly linked list...
>>51668674
>remove 2:
>change 5's pointer to point to 4 (i.e. set 5's pointer value = 2's pointer value)
>2 now removed
>>51668696
it's not that I have it so good or am so comfortable i want more it's just that I don't really care
i don't want to see the world
sure i could get money and get something nice but the novelty wears off after a few hours
>>51668689
I have a rough idea:struct list *aList;
//then fill aList
void remove(int val) {
struct list *temp = aList;
int i = 0;
while (temp != NULL) {
if (aList->val = val) { //found a match
if (i == 0) { aList = aList->next; break; } //remove front
}
}
}
hurry someone make a new thread before anime trapfags make it
>>51668674
> How do I remove a specific element? Say I want to remove elements in this order: 2, 3, 5. I need to remove from middle, end, and front.void remove(struct list **pp)
{
struct list **p = *pp;
*pp = (*pp)->next;
}
If you want to remove the first element from the list, the argument would be the address of the variable holding the pointer to the first element. If you want to remove some other element, the argument would be the address of the "next" field of the preceding element.
You can remove an element given only a pointer to the node for that element, as you have to change the previous element's "next" from the current element to the current element's "next", and you can't get the previous element from the current element.
This is one reason why doubly-linked lists are popular, as a pointer to a node is sufficient to remove the node.
>>51668737
I really don't believe you have zero aspirations anon.
I'm sure there's something you want and you just don't know it yet, because the prospect of just doing what's expected of you because you don't know any better is really depressing.
>>51668772
Anything's better than a furfag thread.
>>51668688
Yeah, I tried that. The socket I've set to listen for new connections times out, though.
Or should I create an entire new socket for every new command? That seems odd and wasteful.
>>51668655
nah man i shit post here every day or /k/
>>51668655
literally the highest php dedicated job in my city besides going to work for the hospital where i'm told you WILL be overworked for shit pay.
any other job and i'd have to be fullstack.
i prefer backend, non ui related development.
imo i've currently got a perfect pay to work effort ratio
Bills paid for every month
Can afford bullshit i down need
and have most of the money saved for my trip to poland next year
if the Department of corrections decides to purchase some of our services, i'll be getting a massive pay raise next year.
>>51668777
> You can remove
Should have been "You can't remove ...".
NEW THREAD :3
>>51668809
>>51668787
The listen socket can persist; you just need to accept() a new connection for each transfer.
Ensure that you close the socket for the data connection after you've finished reading the data.
Use e.g. "netstat -at" to check the state of any sockets.
>>51668861
It's still timing out on me. Thanks for the help so far, though, anon.cmd.send('LIST\r\n')
conn, addr = rcv.accept()
while True:
data = conn.recv(256)
if not data:
break
print data
print cmd.recv(256)
conn.close()
cmd.send('LIST\r\n')
conn, addr = rcv.accept()
while True:
data = conn.recv(256)
if not data:
break
print data
print cmd.recv(256)
conn.close()
First works without problem. Second times out waiting for a new connection.
>>51668811
Faggot.
>>51668900
Just check the "ftp" module to see a working example.