The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
[Programming] Mirror, mirror, on the wall, show the git diff for them all
This is the PA programming thread, home to programmers everywhere. Here we talk about cats, ponies, synergised high-efficiency software cloud platforms, and occasionally programming. Apparently the old OP is, well, old, so we've constructed a revolutionary new cost-effective commercial-grade solution for all your enterprise needs.
PADev.net is a project started up by this thread to support PA developers. A discussion about shared hosting turns into an idea to have hosting and a community to support those working on hobby programs and web services and what not.
Some things require a dedicated VPS but the bar of entry isn't that low. The cost is not extravagant but the know-how required to manage one is daunting for many. PAdev.net provides a share of hosting and support, a $5 monthly fee nets you a shell account on the hub server and the expertise of your peers.
Community members looking to help out can request an account for the website, where all members can create and maintain guides and share project updates. There is no cost to have a community account, just contact an administrator. Also available are you@padev.net email accounts or forwarders.
Python - One of the most popular scripting languages around, Python is the go-to language for...just about everything, actually. Its high scalability and widespread support through third-party libraries make it useful for many applications, from simple five-minute jobs to complex Web servers. Python can also be embedded or bound into lower-level languages such as C, letting you write performance-critical code as well as providing access to libraries written for those languages.
Ruby - Another popular scripting language, Ruby is best known as the basis for Ruby on Rails, a framework for Web development that competes with its Python equivalent, Django. While not quite as famous as the juggernaut that is Python, Ruby is nonetheless prolific - modern versions of RPG Maker use it as their scripting language, for instance. And, of course, it can be embedded into other applications, much like Python.
Lua - Yet another scripting language. Lua is built on two principles: simplicity and minimalism. Designed with embedding in mind, Lua's overhead is tiny (it can be counted in hundreds of kilobytes at most) and the language itself only provides a handful of constructs...until you master the black arts of tables and metatables. Those who have done so claim to have seen the face of God; these claims are as yet unsubstantiated. What we do know, however is that in recent years Lua has garnered much attention thanks to LuaJIT, a project that provides not only a just-in-time compiler for Lua (granting a massive speed boost - almost C-like performance, in fact), but also an FFI (foreign function interface) library, allowing Lua scripts to directly call C functions without the hassle of writing boilerplate C bindings.
C and C++ The Ones Who Came Before. C and C++ are old, clunky, archaic...and the most popular languages in existence. C was conceived in an era when memory was limited and programs were generally written in non-portable assembly languages. The underlying concept (which persists to this day) was that a compiler would take C code, turn it into assembly, and then turn that into an executable or library. Thus, programmers now only had to port most of the codebase instead of all of it! (the situation has improved considerably since then, of course - these days, only the really low-level stuff has a tough time being cross-platform). C++ came some time later, and shook things up significantly with the concepts of classes and generics. Modern C++ also includes the Standard Template Library, or STL, which provides all sorts of useful functionality to make life almost painless. These days most people will learn something simpler like Python before these guys, but make no mistake - everything from your operating system to your favourite video games to your microwave can trace its roots back to one of the two.
C# - The poster boy for Microsoft's .NET Framework, C# is a JIT-compiled language modelled after C++, but without any of the associated pain. Though initially developed as a robust alternative for Windows development, Microsoft makes the specifications available at no cost, which has led to other implementations popping up - the most well-known being the cross-platform Mono. The main draw of C# is its ease of use: with a ridiculous number of APIs available by default and the ability to call into native code, you'll have a tough time finding something higher-level that you can't do in C#. The fact that Visual Studio, one of the best IDEs around, also supports C#, is just icing on the cake.
Android - Directly responsible for bringing this OP into the 21st century, Android is a pseudo-operating system framework which runs on top of Linux. Android is primarily written in Java, though it also combines elements of C, C++ and sometimes even Python, and is designed for mobile devices. The Android application framework represents an almost entirely event-driven paradigm written primarily in Java which heavily utilises usage of background services, model-view-controller, and sub-classing as a method of changing behaviour of standard pieces. Also, it runs on your phone!
class BaseCls
{
public:
virtual void Cleanup() {};
SIGNAL *ReleaseSignal() {
//stuff
Cleanup(); //SIGSEGV, code 1 "address not mapped to object"
//stuff
};
}
class derivedCls : public BaseCls
{
public:
void Cleanup() {};
}
class ddCls : public derivedCls
{
//nothing useful
}
void Function (void){
ddCls thing;
//this goes straight to the base class because the intermediates do not overload it...
// so it calls the virtual in the base class?
thing.ReleaseSignal();
}
This is obviously greatly simplfied, but the general flow is the same.
Only change is going from GCC 4.6/C++03 to GCC 4.9/C++11. I assume it is something to do with calling the virtual function, but I really have no idea.
Cleanup() is an empty function everywhere I've seen it, so I don't know why they bothered making it virtual (or making it in the first place).
So the call order here would be base::releasesignal -> derived::cleanup. Everything should be fine here unless something interesting happens in those stuff blocks
Actually it should be going into derivedCls' cleanup shouldn't it?
Why is it attempting to use the BaseCls? Sounds like there might be a compiler option or some such that's fucking with this?
Only compiler options are -O0 and -std=gnu++11, with -Wall and -Wextra for good measure. Static analysis on the two classes doesn't come up with anything, either.
My next thing to try is either Address Sanitizer or Valgrind.
I'd try Valgrind.
Do you accidentally delete the pointer prior to using it?
I hope not, because this has been our production code for a few years now. :P
The thing is that the Cleanup function does exactly nothing, so the only thing I can really think is that something bad is happening when the 'this' pointer is getting copied for the cleanup() call?
The trouble with undefined behaviour is that "undefined" also includes "works for several years, and then one day, another thread/process uses a bit more memory at the wrong time, which then causes the pointers to break." =P
It's getting to become my personal pet hate about C and C++. =( I really do like C++ - I enjoy templates, the flexibility etc, but having to consistently code defensively because it always felt like undefined behaviour is right around the corner got tiring.
The trouble with undefined behaviour is that "undefined" also includes "works for several years, and then one day, another thread/process uses a bit more memory at the wrong time, which then causes the pointers to break." =P
It's getting to become my personal pet hate about C and C++. =( I really do like C++ - I enjoy templates, the flexibility etc, but having to consistently code defensively because it always felt like undefined behaviour is right around the corner got tiring.
C lets you shoot yourself in the foot. C++ lets you reuse the bullet.
C gives you enough rope to hang yourself with. C++ provides the tree object to tie it to.
C gives you enough rope to hang yourself with. C++ gives you enough rope to tie your neighbors up, rig a schooner, and hang yourself from the yardarm.
I had a ticket created by one of our vendors that a report I'd just recently put into place failed and failed again after rerunning.
Worked with the guy who'd helped me schedule it. Fixed it by having it just always report success.
Seriously though. Basically, when a report is run as a scheduled ops job in this system, it expects certain return values that you have get from extracting some values from a record structure and blah blah blah. A bunch of stuff that they never talked about in our report writing training for this system, just assumed someone would tell you when you tried to set up one as an ops job.
But because of the way this report ran, it would never report success because by the time it reaches the part of the code where it can check for any records returned, all the records have been processed and it no longer thinks it has any.
Java slowly saps your soul so you want to kill yourself.
I use Java. I find it's fine. So long as I never have to touch anybody else's Java and they never have to touch mine.
As soon as I'm asked to install somebody else's package or git something and configure its deployment, lo it is revealed that I know nothing about computers.
Java slowly saps your soul so you want to kill yourself.
I use Java. I find it's fine. So long as I never have to touch anybody else's Java and they never have to touch mine.
As soon as I'm asked to install somebody else's package or git something and configure its deployment, lo it is revealed that I know nothing about computers.
This so much. Also moving back to C++ from Java is as terrible as moving from C++ to Java was (I used Java for just one project, usually we're a C++ shop).
Stuff like "Why doesn't the compiler accept
if (randomPtr != null) doStuff()
?"
Grobian on
0
TraceGNU Terry Pratchett; GNU Gus; GNU Carrie Fisher; GNU Adam WeRegistered Userregular
public int countOccurrences(final Term t) {
+ final AtomicInteger o = new AtomicInteger(0);
+
+ if (equals(t)) return 1;
+
+ recurseTerms((n, p) -> {
+ if (n.equals(t))
+ o.incrementAndGet();
+ });
+
+ return o.get();
+ }
+
0
DynagripBreak me a million heartsHoustonRegistered User, ClubPAregular
i'm finally learning to program and really enjoying it using python. went through the code academy course quickly and am now practicing in codewars, will also do some OCW comp sci 600 assignments. Tomorrow the Introduction to Interactive programming in python course starts up in Coursera, and I'm really excited about that.
Python is great and everything but I find looking at it an exercise in frustration: the white spacing drives me insane. It's very much just my opinion on Python. When I've had to code in it, it was pretty swell. Still would rather code in C# (or god forbid, Java), though.
C# is for cheaters and lazy people, which is exactly the kind of developer I am.
Python is awesome because it's pretty to look at. White space controlled languages make it so much more pleasant to read, in my opinion. All of the haters here are savages.
Has anyone tried connecting to carbon.padev.net sftp with FileZilla in windows? It doesn't seem to work anymore for me. PSFTP(Putty) command line worked fine though.
Python is awesome because it's pretty to look at. White space controlled languages make it so much more pleasant to read, in my opinion. All of the haters here are savages.
I'll stab you!
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Python is awesome because it's pretty to look at. White space controlled languages make it so much more pleasant to read, in my opinion. All of the haters here are savages.
I'll stab you!
This would be a welcome end to my week!
I'm at 46 hours and it looks like it won't be ending any time soon.
Python is awesome because it's pretty to look at. White space controlled languages make it so much more pleasant to read, in my opinion. All of the haters here are savages.
Python is awesome because it's pretty to look at. White space controlled languages make it so much more pleasant to read, in my opinion. All of the haters here are savages.
I'm with you on this one.
"I hate whitespace controlled languages! All forcing me to indent everything consistently."
Don't you already indent stuff consistently?
"Yes. But it doesn't even use brackets."
Why do you need brackets when things are indented consistently?
"Because brackets make me feel safe."
+5
jaziekBad at everythingAnd mad about it.Registered Userregular
Python is awesome because it's pretty to look at. White space controlled languages make it so much more pleasant to read, in my opinion. All of the haters here are savages.
I'm with you on this one.
"I hate whitespace controlled languages! All forcing me to indent everything consistently."
Don't you already indent stuff consistently?
"Yes. But it doesn't even use brackets."
Why do you need brackets when things are indented consistently?
"Because brackets make me feel safe."
I indent stuff randomly because fuck the man.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
For you React folks, this looks pretty nifty - live editing of code in the browser which then gets re-run, while preserving state. (in the real world, it's when you save files, but still pretty handy).
video here. It's not quite the same as the existing livereload you get with grunt/ember-cli/etc, this one preserves the state of your app and changes the code under it, rather than just automatically hitting "refresh".
I really don't have the time and sit and rewind a video over and over and sometimes don't even have sound. Sometimes I get up to take a shit or go make dinner and come bang out another 10-15 minutes. That's annoying to deal with.
Written tutorials are far better.
Unity in particular has a nasty habit of having video tutorials.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Posts
I'd try Valgrind.
Do you accidentally delete the pointer prior to using it?
The thing is that the Cleanup function does exactly nothing, so the only thing I can really think is that something bad is happening when the 'this' pointer is getting copied for the cleanup() call?
It's getting to become my personal pet hate about C and C++. =( I really do like C++ - I enjoy templates, the flexibility etc, but having to consistently code defensively because it always felt like undefined behaviour is right around the corner got tiring.
C lets you shoot yourself in the foot. C++ lets you reuse the bullet.
C gives you enough rope to hang yourself with. C++ provides the tree object to tie it to.
C gives you enough rope to hang yourself with. C++ gives you enough rope to tie your neighbors up, rig a schooner, and hang yourself from the yardarm.
Worked with the guy who'd helped me schedule it. Fixed it by having it just always report success.
But because of the way this report ran, it would never report success because by the time it reaches the part of the code where it can check for any records returned, all the records have been processed and it no longer thinks it has any.
I use Java. I find it's fine. So long as I never have to touch anybody else's Java and they never have to touch mine.
As soon as I'm asked to install somebody else's package or git something and configure its deployment, lo it is revealed that I know nothing about computers.
No reason...but do you ever need one?
Legends of Runeterra: MNCdover #moc
Switch ID: MNC Dover SW-1154-3107-1051
Steam ID
Twitch Page
This so much. Also moving back to C++ from Java is as terrible as moving from C++ to Java was (I used Java for just one project, usually we're a C++ shop).
Stuff like "Why doesn't the compiler accept ?"
coding, whooo
C# is for cheaters and lazy people, which is exactly the kind of developer I am.
Also valgrind didn't work because we strip glibc, lolllllllll
Especially if you've got someone who mixes tabs and spaces.
And can we agree that nothing is fun with those people around?
SPACES ARE BETTER THAN TABS MIRITE?!
Nintendo ID: Incindium
PSN: IncindiumX
I'll stab you!
This would be a welcome end to my week!
I'm at 46 hours and it looks like it won't be ending any time soon.
I'm with you on this one.
"I hate whitespace controlled languages! All forcing me to indent everything consistently."
Don't you already indent stuff consistently?
"Yes. But it doesn't even use brackets."
Why do you need brackets when things are indented consistently?
"Because brackets make me feel safe."
I indent stuff randomly because fuck the man.
I hope you pay for that.
I remember writing fizzbuzz like that once.
video here. It's not quite the same as the existing livereload you get with grunt/ember-cli/etc, this one preserves the state of your app and changes the code under it, rather than just automatically hitting "refresh".
I really don't have the time and sit and rewind a video over and over and sometimes don't even have sound. Sometimes I get up to take a shit or go make dinner and come bang out another 10-15 minutes. That's annoying to deal with.
Written tutorials are far better.
Unity in particular has a nasty habit of having video tutorials.
And anything Minecraft-related. Seriously annoying.
This is the strongest argument for controlled whitespace that I have seen to date.
I bet there's still a legal move in python that does something like that.