Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Get a devDuck
Rubber duck debugging has never been so cute! Get your favorite coding language devDuckBuy Now
Search - "casting"
To become an engineer (CS/IT) in India, you have to study:
1. 3 papers in Physics (2 mechanics, 1 optics)
2. 1 paper in Chemistry
3. 2 papers in English (1 grammar, 1 professional communication). Sometimes 3 papers will be there.
4. 6 papers in Mathematics (sequences, series, linear algebra, complex numbers and related stuff, vectors and 3D geometry, differential calculus, integral calculus, maxima/minima, differential equations, descrete mathematics)
5. 1 paper in Economics
6. 1 paper in Business Management
7. 1 paper in Engineering Drawing (drawing random nuts and bolts, locus of point etc)
8. 1 paper in Electronics
9. 1 paper in Mechanical Workshop (sheet metal, wooden work, moulding, metal casting, fitting, lathe machine, milling machine, various drills)
And when you jump in real life scenario, you encounter source/revision/version control, profilers, build server, automated build toolchains, scripts, refactoring, debugging, optimizations etc. As a matter of fact none of these are touched in the course.
Sure, they teach you a large set of algorithms, but they don't tell you when to prefer insertion sort over quick sort, quick sort over merge sort etc. They teach you Las Vegas and Monte Carlo algorithms, but they don't tell you that the randomizer in question should pass Die Hard test (and then you wonder why algorithm is not working as expected). They teach compiler theory, but you cannot write a simple parser after passing the course. They taught you multicore architecture and multicore programming, but you don't know how to detect and fix a race condition. You passed entire engineering course with flying colors, and yet you don't know ABC of debugging (I wish you encounter some notorious heisenbug really soon). They taught 2-3 programming languages, and yet you cannot explain simple variable declaration.
And then, they say that you should have knowledge of multiple fields. Oh well! you don't have any damn idea about your major, and now you are talking about knowledge in multiple fields?
What is the point of such education?
PS: I am tired of interviewing shitty candidates with flying colours in their marksheets. Go kids, learn some real stuff first, and then talk some random bullshit.18
(I wrote most of this as a comment in reply about Microsoft buying GitHub on another rant but decided to move it here because it is rant worthy. Also, no, I'm not a Microsoft employee nor do I have any Microsoft stock).
Microsoft buying GitHub makes sense. They contribute more to the open source community on GitHub than any other company. (Side note, they also contribute/have contributed to the Linux Kernel).
Steve Ballmer isn't running the show anymore. Because of that, we have awesome things like:
* Visual Studio Code - Completely free and powerful light weight IDE for coding in just about any script or language. This IDE is also open source, hosted on GitHub. It can be installed on Win/Mac/Linux.
* Visual Studio Community Edition: fully featured flagship IDE free for solo developers and students, can be installed on Win/Mac.
* Fully featured Sql Server running in a Docker container.
* .Net Core, which can be compiled to native binaries of Windows, MacOS AND Linux. You can't even do that with Java, you have to first have the JVM installed in order to run any kind of Java code on any of those operating systems. .Net Core is also an absolutely beautiful framework with so many features at your disposal.
Yes, they've done bonehead things in the past but who/which company hasn't. Yes, they have Cortana. Yes, they force Bing on you when searching with Cortana (does anyone actually regularly use Cortana? Or Bing?). Yes, their operating system costs money. Yes, their malware-style Upgrade-to-Windows-10 tactics were evil and they admitted such. Yes, they brought ads and other unfortunate things to Skype. I'd be lying if I said I wasn't concerned about that Skype bit translating over into GitHub. BUT, the fact that so many of their employees use GitHub daily means they are dogfooding the platform, which is a positive thing.
Despite the flaws, from the perspective of a software engineer they really should be given a lot of credit for all these new directions they are moving in now. They directly aim to help and contribute to the developer community. Plus, Windows 10 is finally getting a dark theme! haha.
I think Microsoft buying GitHub makes a lot of sense. Of course do what you want about it, feel how you want about it, but casting the same ol' shade at them for anything they do seems a bit like automatic reflex more than anything else.
I'm bracing myself for the impending wave of angry hornets from the nest I just kicked. In all seriousness though, I welcome discussion on the topic even if you feel differently than I do. I'm not saying there's no reason to dislike them, just saying there are lots of new reasons to hate them less and/or appreciate what they are doing now.20
My boss is Russian and he sits right next to me. He often talks to himself in Russian (while typing furiously). makes me think he is casting a spell for his code to attack. lol13
Inner Me: Where the fuck is this bug coming from
> Set a breakpoint in every single place where the method I'm using is being called.
> Try calling the method before every function call
Inner Me: FUCKING DAMNIT! It's been hours now
Inner Me: No way it's the library I'm using.
Inner Me: That couldn't possibly be the problem
> Try running it again and delete some more shit
Inner Me: FUCK MEEEEEEEE
> Getting delirious
> Begin to look at some stupid memes.
> Come back to it.
> Have an Ah-ha moment
> Try running it again but rearrange the order of the method calls
> Still no luck
> try git stashing a bunch of my changes
> git stash apply them back
> erase the method call entirely
Inner Me: well that sort of worked, but now all my numbers are incomplete
Inner Me: FUCKING FINE!!! I'LL LOOK IN THE GODDAMN LIBRARY
Inner Me: FUUUUUUUUUUUUUCCCCCCCCKKKKK a stupid integer casting was occuring to my floats!!!
Now Talking to my girlfriend.
Me: The problem was in the library I was using
Girlfriend: How are you going to fix it if it's in the library?
Me: ... I can, because I wrote the library...
Me: FUCK ME RIGHT?
Me: I guess moral of the story; sometimes the problems starts with ourselves
GF: Hahaha. Thats Deeep2
I've been working on implementing a fairly large feature on a project at work--
**Sorry. I should rephrase that**
I've been *trying* to work on implementing a fairly large feature on a project at work.
It's slightly complicated because I'm not as "in the know" with the project as I should be. I get tossed around projects a lot as the only designer+developer so I've got my hands in a lot of buckets... Or git repos I should say... My source tree has a lot of tabs open and each project is run by someone with their own ideologies on how stuff should be done and laid out and what not. Basically jumping between these projects leaves you mildly capable on all of them but not amazing at any of individual one them--
There's a bug I've been trying to fix.
--Stupid simple bug, literally just a casting issue or something but there's so much data in this one object that it's taking a few solid minutes of concentration to figure out which variable is busting it all up. It shouldn't take long to fix...
But it has. It has taken 4 days.
...To fix what is basically a null reference exception.
Every time I sit down to work on this bug real quick I get pulled away to do a wireframe or change a flow chart or diagram or colour or print styling.
Every. God. Damn. Time.
4 days. Soon to be 5.
My commits are real low at this point guys.
Please boss man, just let me code...4
The new mobile app codebase i'm working with, was clearly written by someone who just read a book on generics and encapsulation.
I need to pull out 2 screens into a separate library to have it shared around. The 1 networking request used is wrapped up in a 'WebServiceFactory' and `WebServiceObjectMapper`, used by a `NetworkingManager` which exposes a generic `request` method taking in a `TopLevelResponse` type (Which has imported every model) which uses a factory method to get the real response type.
This is needed by the `Router` which takes a generic `Action` which they've subclassed for each and every use case needing server communication.
Then the networking request function is part of a chain of 4 near identical functions spread across 4 different files, each one doing a tiny bit more than the last and casting everything to a new god damn protocol, because fuck concrete types.
Its not even used in that many places, theres like 6 networking calls. Why are people so god damn fucking stupid and insist on over engineering the shit out of their apps. I'm fed the fuck up with these useless skidmarks.3
Me: Return data from Firebase into unity project
Firebase: Returns data as object
*Type casting fails for 6hrs*
Finally find the reason Data return type is int64 and I was saving as int32
Now I sit and question my life while listening to epic music2
Senior E: "Man, every time I do code review I thought this is the stupidest code ever written - then I look at the author, oh wait it's me"
Me: "Well, the perfect code is the code never gets written"
SE: "Casting appreciative look with a nod"
I'm basically an introvert. I've lived most of my childhood with my mother alone with few friends and the ones I had betreyed me real hard at some point. So how come that I'm now founding a startup, speaking in front of a big audience at meetups and have a nearly 60/40 work/social life?
At some point I decided to be more social. Making that decision alone had a huge impact. It took several years though, to implement this decision. Some day I cut off my draining social bounds and found energyzing relationships by simple doing what I wanted to do. I started to reach out and experiment with a lot of hobbies like bow casting and going to board games evenings. I made little steps. E.g bow casting is a sport where you don't necessarily interact with others within the sport, but you have the opportunity to interact about the sport.
A physiologist once told me the neat fact, that being an introvert is just an attribute that does not contradict the skill being socially involved. So it is possible with training and decisions to learn how to be more extroverted. For in introvert this is more exhausting and challanging, but definitely possible.
So today I balance my social life and work by visiting meetups, playing board games and all that stuff that makes me comfortable. There I get to know people with similar interests and similar struggle ;)
At some point the work was just not enough to be happy, I identified my missing social interactions as the root cause so I decided to change that.
On the other hand, don't think you have to be social. Don't think you have to care about everything others expect you to care about. It's bullshit. Don't care about that. Rather ask yourself what you want for yourself. Certainly a social life is part of that, but you alone decide how this will look like. E.g. After I decided hey I just don't give a fuck if you like cuddling your cat and when it's birthday is, several months or years later I started to be interested in these things from my own, not because some dippshit society construct expects me to care about it.
So to wrap up:
Introvert is an attribute, social life is a skill.
Deciding for yourself and giving a fuck about others is key.
It takes a shit load of time. But it works.
In the royal city of Aagra. My phone broke and knowing the exploitative bitch I used to meet back then I was certain had I disappeared amid a conversation she would break up with me, so I debugged an Android 2.3 image with no documentation and shaky hands from frustration while cursing her every family member in Hungarian. (Passers-by probably thought I was casting spells on my computer)20
Common Lisp code has (imo) one of the cleanest syntax possible in programming language. I really would like for Lisp dialects other than Clojure to make a heavy comeback. And we now hace Quicklisp which is a package repo for CL code.
I really want to see more people into Lisp, it really is a great language man you just need to get past the (()) and it makes sense I promise.
Guys please try CL. If you already have awesome code skills and have some free time try going throughe the gigamonkeys book. Completely free online and setting up an Emacs environment with SBCL or CLISP is a breeze. I use Lisp to experiment and it gives a lot of room for exploring new concepts.
Another cool language that is emerging is Smalltalk in the form of Pharo. If you have been casting asside OOP because of the way many mainstream languages do it then maybe you will like Smalltalk as a pure OOP form.
I just want more people in this shit and this community sure has some awesome programmers, so why not?
one of the leading dudes in CL is currently Eitaro Fukamachi, one dude...doing amazing things. My aim is to give him a hand.8
Do you guys think it’s time “Hackers” gets its 2020 remake? I know it was cheesy for its time (1995) but 8 year old me was INTO that music video montage direction and that movie inspired was what inspired me to get into tinkering with electronics/embedded systems.
Rewatching it tonight and the casting is so on point, too.5
GOD ALMIGHTY I HATE SWIFT & XCODE...
Why the fuck does it take a horrendous amount of time to muck about with layout constraints. Why the heck does xcode choose to add constraint layouts to elements that already have pissing constraints! Why does dealing with something as trivial as tables have to be so god damn fucking involved when HTML and CSS let me create and style tables in fuck all lines.
And what the hell is up with how pissing long xcode takes just to figure out that 1 extra line of code I've just added. You jump to another file and xcode finally decides to be an ide again and bitch at the fact that you've forgotten to add some parameter or that they've decided to rename paramter "x" since version fuck nows what.
Working with abstract classes is fun, lets use protocols (because interfaces are too old school) and then lets tack on something we call extensions and then lets make people piss about with convenience initializers.
And lord almighty, what the fuck is up with casting, what all this ?! BS. What's wrong with just checking if the value is null in the first place, or whats wrong with giving something an initial value, oh because having to unwrap shit is more elegant right??
And good god, I need to own a fucking cinema screen just to have the storyboard open, there's less fucking panels on the Sistine Chapel ceiling
then there is in xcode.1
This is so far my worst Monday.
Ran to Emergency (A&E) because I was having breathing problems. Came back to work with Inhaler.
Work started with type casting and linker errors.
I hope the day ends well :(
Data representation is one of the most important things in any kind of app you develop. The most common, classic way to do it is to create a class with all the fields you want to transport, for example User(name, lastName). It's simple and explicit, but hell no, in my current company we don't play that kindergarten bullshit, the only way we know how to do things here is full hardcore. Why would anyone write a class to represent a Song, a Playlist or an Album when you can just use a key-> value map for pretty much everything? Need a list of songs? No problem, use a List<Map<String, String>>, OBVIOUSLY each map is a song. Need a list of playlists? Use a List<List<Map<String, String>>>... Oh wait, need to treat a value as a number and all you have are strings? That's what casting is for, dumbass.
No, seriously, this company is great. I'm staying here forever!1
When the previous developer doesn't appear to know what casting is...
var foo = Convert.ToBoolean(objDictionary["someKey"].ToString());1
Plans for 2019 are to release two products.
1. A text-based strategy game engine that will act as the core of two or more progressive web applications, using Node.js/Express, EJS, and SCSS. It will be proprietary, subscription-based, and playable 24/7 online or offline as a web site or mobile app with nightly/weekly/monthly events and items (think KoL, on steroids, with butter on top.)
I am currently undecided whether to go with MongoDB, MySQL or PostgreSQL, so any feedback - without derailing the other choices, and understanding that it needs to be minimal at first with the ability to expand to millions of users - would be appreciated.
2. I'm sculpting collectors figurines of guinea pigs, molding, casting and then selling a limited set that are hand-painted by me with a certificate of authenticity, as well as marketing blank versions of each with a choice of three colors (including white, and either red or black for eyes - a total of five) for people to either paint by themselves, family members, or friends.
This will also have a website that allows you to choose the breed and colors (changing the picture according to your choices), as well as allowing people to use it as a social media outlet - as if their own guinea pigs had profiles instead of humans. It's also planned to support rescues worldwide and educate folks about properly caring for cavies.5
Casting never worked well with humans. On the other hand, programmers don't mind working with it.
Programmers != humans2
Python..... please cast my integers and such to string for me. I don't want to have to keep typing str().... pretty please?4
Some compilers give an error message on forgotten type casting. From that it shows good typing style casting. So you also avoid clerical errors that can lead to the program crash in the worst case. With some types it is also necessary to perform type casting comma on others Types, however, do this automatically for the compiler.
In short:Type casting is used to prevent mistakes.
An example of such an error would be:
int main ()
int * ptr = malloc (10*sizeof (int))+1;
By default, one tries to access the second element of the requested memory. However, this is not possible, since pointer calculation (+,-) does not work for a void pointer.
The improved example would be:
int * ptr = ((int *) malloc (10*sizeof (int)))+1;
Here, typecasting is done beforehand and this turns the void pointer into its int pointer and pointer calculation can be applied. Note: If instead of error "no output" is displayed on the sololearn C compiler try another compiler.1
Now Casting: Designers, Engineers, Inventors and Makers! Calling all Designers, Engineers, Inventors and Makers! Intel, legendary Executive Producer Mark Burnett and MGM Television are looking for the most innovative makers to join Season 2 of America's Greatest Makers. Do you have an amazing idea for the next big smart connected device? Apply now for the chance to make your dream a reality using Intel's latest technology including the Intel Curie Module and upcoming advanced developer platforms that can connect to a broad array of input and output devices (including cameras and displays). Winner walks away with $1 million dollars! What will YOU make?
Could be fun
I spent three days looking for an error that caused my app to not displaying the layout (the app still was running but it was a black screen). On the third day, i discovered that when I register a SensorEventListener I have to cast the listener to SensorEventListener, otherwise it wont load, or even show errors on the logcat.
"Choosing a typeface is an act of subtlety, like casting an actor: the best person to play a gardener is somebody who looks like they might belong outdoors — not somebody who is covered in flowers and shrubbery." - Josh Collinsworth
After my trainig period in the new job (10 weeks), I joined a different department with very expirenced guys, one of them got my mentor, with him I was at my first plant (continues casting platn where next to me where thousands of kg molten steel) where we updated all controllers to a OS. From him I learned all the real life best practice stuff as well as the internal dev tools.
Without him I would not be able to be mentor to my new college now.
And also he became a friend
"So our price widget doesn't allow decimals, you'll have to create a custom widget"
I do it.
"Hey, It's not working and I verified it's applying the filter correctly. I noticed my price is a string in your index, maybe that's incorrect and causing it to not work?"
They say: "Yep, you'll need to run an update to fix that and change all to floats" (charges an arm and a leg for the thousands of index operations needed to update the data type)
I clear the index and send a single one as a test, verifying it's a float by casting it using (float) then var_dumping. It shows "double(3.99)", but when it gets to Algolia, it's 0.
So I contact support.
"Hi, I'm sending across floats like you say but it's receiving it as 0, am I doing something wrong? Here's my code and the result of the var_dump"
They respond: "Looks like you're doing it right, but our log shows us receiving 3.999399593939, maybe check your PHP.ini for "serialize_precision" and make sure it's set to -1"
I check and it's fine, then I realize that var_dump is probably rounding to 2 decimal points so I change my cast to (float) number_format($row['Price'], 2) and wallah...it works.
Now I've wasted days of paying for their service, a ton of charges for indexing operations, and it was such a simple fix.
if they had thrown an error for the infinite decimal, that would have helped, but instead I had to reach out to find out that was the issue.
Last nite, one of my projects started crashing with a ClassCastException because it couldn't cast a string to a boolean, inside an if. This is Java. You can't even run a project if you evaluate a string inside an if. Has anyone seen such a thing before? I'm running BBQLinux which at least for me it has a lot of permissions issues and somehow things got so f'd up that it even messed up the Android image to a point that the compiler couldn't find a method to set a string into a TextView. I'm not kidding.2
Still working on this oldass project. Casting enums to different enums.. longass methods call another longass methods at the end...