Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "big int"
-
Today in IT class our teacher said: 'you can only use char and int in a switch statement'
I was confused because I was 100% sure that you could also use string and so when I got out of school I immediately looked it up.
It is true, well it was true until 2011 when Java 7 was released which added the possibility to also use the string data type in switch statements.
In this I see a huge problem with the education system. Teachers (almost) never 'update' their knowledge and then teach outdated stuff to their pupils. While this may not be a problem in some subjects, it definitely is a huge problem in IT.
The development world is always evolving but if the teachers don't follow along the pupils get taught outdated stuff which, in my opinion, is a really big problem when they finish school and go out in the world to find jobs.9 -
Oh god, I was like 13 and just found out about RPG Maker 2000. I got a pirated copy from a friend because ive got no internet at that time. I remember, my first project was with a friend of mine and dayum, we were so dumb and unknowing.
Once we wanted to implement a counter of how many fights a player had.
The problem was, we only knew about switches (boolean variables) and so we started to implement boolean variables like these:
hadOneFight
hadTwoFights
hadThreeFight
and so on, as something like a counter.
We took this to 50 before I asked my friend if this is the right way of doing this.
He answered: "thats probably the reason, why games are so big nowadays" (he just installed morrowind at home...)
Then at one day, I reached the point I didnt knew what I should do next in this project, so I looked around at all the other functions we never even tried and I found something called "variables".
Those where the "real" variables like string and int and wow, suddenly the possibilities where endless. I told him about variables at telephone and what we could do now, but that just got him somehow frustrated so he told me, that he wants to leave this programming thing4 -
Fuck this day!
Like really fuck it!
I have one of the most terrible crunch-time i ever experienced.
I’v been working 12+ hours every day with an ever-changing project timeline.
It started simple, we made a timeline, it was risky even then but it was realistic, we started working immideatly, everything looked good then a few days in BOOM! Actually our project management completely forgot client B’s projects soo we need to do that too with the same fucking deadline!!! (About 10x more work in waay less time)
Then this morning i got an email from the graphics team that we need to document our design process RIGHT FUCKING NOW! Because management wants documentations, in the middle of a fucking crunch-time.
Today it almost got physical with my project manager, i told him that he is not a programmer, i dont fucking care about his shit, just fuck off and let me work because we won’t be ready based on his unrealistic bs.
I feel like completely fucked over, like we were told 2 days before deadline that the whole company and people’s jobs depends on us now because if we wont finish this clients won’t pay.
WE ARE TWO PROGRAMMERS for studio of 10-12 people!!!
Soo i’w been thinking about getting the fuck out of here ASAP, i got an offer from a pretty big international gamedev company just what i needed, i already did their test before all of this, i passed A+.
We scheduled a skype interview for today. I had completely no time to prepare or chill off, just got out of the office, got into a starbucks and i’m interviewing. No time to even check my mic or internet, the call was so shit i could not hear anything, they neither because the plaza was loud af. Meanwhile im nervous about work, about the interview, about can they hear me at all because of the noise. I fucked it up. BIG time! I was so done i could not reverse a fucking string in c++ or explain what is a signed int!!!
Needless to say they said no.
Need time to think about it or realize what happened? Nice dreams. Back to the office and continue working.
I can’t do this anymore. My girlfriend came for me and took me home at 10pm but all i could do was stare at the floor on the subway. I don’t want people to lose their jobs but i just phisically can’t do this anymore.
Meanwhile any time i talk to my project manager about being tired he says like “hshshsbsb i have 60 hours in the last 4 days i got the worst part, i would be grateful in your place..” like fuck off dude, i dont give fuck about how you feel about this. This is not okay for me, you did this to the project, your fucking job is to manage it! I have one day off before going back to this, i have completely no idea what to do now...
[ps: this is not Nemesys. They did not let me work on my own stuff because i would be a competitor, so i left.]5 -
I wrote a base converter in AssemblyScript that could take a numeric or string radix of 2-36. String options being binary, ternary, etc.
Then I couldn’t figure out how to color scheme it, so went about it the lazy way.
I present to you: Choose your own damned background and text colors.
https://baseconverterwebassembly.netlify.app/...6 -
Staring at computer trying to figure out why I can't read a float from modbus. I swapped the bytes correctly for my platform. I also ensured the endianess of the words matched my platform (byte endianess is not the sames as word endianess, fml). Was driving home thinking about what could be wrong. My mind saw this code:
uint32_t newint;
for(int count=0; count<2; count++){
newint |= words[count] << count;
}
Then I am fuck! It should be:
newint |= words[count] << (count*16);
This was later turned into float. I kept getting values in the 1e-40 or some shit. Now it makes sense. The upper word was not set.
This is such newb shit. Fuck you newb shit I should just know!
Reading more I realized that the endianess of words can vary between devices even though the spec calls for big endian words. Fuck you non-compliant vendors! So I gotta add a flag for fucked up devices. Fine. The pay off is a generic way to add modbus to our opcua server. I want this easily editable in the field. For now it is readonly. So that makes it nicer.
Just a little torqued that I solved this driving home instead of at work. Too close to the code. I think tomorrow I will have my boss review it to tell me of other logical crap I missed.3 -
Opinions please.
I want to share a small model in my iOS app. Now on android I'd do with with ViewModelProviders, but on iOS I'm going with SharedDataContainer which is basically a singleton class that store key value data.
Is there any better approach? Data will not be bigger than 10 list items with guid (key) and int (value)
However; when I have big data I do cache on disk or hello OOM exceptions (or whatever they call that bitch on iOS) -
Sometimes in our personal projects we write crazy commit messages. I'll post mine because its a weekend and I hope someone has a well deserved start. Feel free to post yours, regex out your username, time and hash and paste chronologically. ISSA THREAD MY DUDES AND DUDETTES
--
Initialization of NDM in Kotlin
Small changes, wiping drive
Small changes, wiping drive
Lottie, Backdrop contrast and logging in implementation
Added Lotties, added Link variable to Database Manifest
Fixed menu engine, added Smart adapter, indexing, Extra menus on home and Calendar
b4 work
Added branch and few changes
really before work
Merge remote-tracking branch 'origin/master'
really before work 4 sho
Refined Search response
Added Swipe to menus and nested tabs
Added custom tab library
tabs and shh
MORE TIME WASTED ON just 3 files
api and rx
New models new handlers, new static leaky objects xd, a few icons
minor changes
minor changesqwqaweqweweqwe
db db dbbb
Added Reading display and delete function
tryin to add web socket...fail
tryin to add web socket...success
New robust content handler, linked to a web socket. :) happy data-ring lol
A lot of changes, no time to explain
minor fixes ehehhe
Added args and content builder to content id
Converted some fragments into NDMListFragments
dsa
MAjor BiG ChANgEs added Listable interface added refresh and online cache added many stuff
MAjor mAjOr BiG ChANgEs added multiClick block added in-fragment Menu (and handling) added in-fragment list irem click handling
Unformatted some code, added midi handler, new menus, added manifest
Update and Insert (upsert) extension to Listable ArrayList
Test for hymnbook offline changing
Changed menuId from int to key string :) added refresh ...global... :(
Added Scale Gesture Listener
Changed Font and size of titlebar, text selection arg. NEW NEW Readings layout.
minor fix on duplicate readings
added isUserDatabase attribute to hymn database file added markwon to stanza views
Home changes :)
Modular hymn Editing
Home changes :) part 2
Home changes :) part 3
Unified Stanza view
Perfected stanza sharing
Added Summernote!!
minor changes
Another change but from source tree :)))
Added Span Saving
Added Working Quick Access
Added a caption system, well text captions only
Added Stanza view modes...quite stable though
From work changes
JUST a [ush
Touch horizontal needs fix
Return api heruko
Added bible index
Added new settings file
Added settings and new icons
Minor changes to settings
Restored ping
Toggles and Pickers in settings
Added Section Title
Added Publishing Access Panel
Added Some new color changes on restart. When am I going to be tired of adding files :)
Before the confession
Theme Adaptation to views
Before Realm DB
Theme Activity :)
Changes to theme Activity
Changes to theme Activity part 2 mini
Some laptop changes, so you wont know what changed :)
Images...
Rush ourd
Added palette from images
Added lastModified filter
Problem with cache response
works work
Some Improvements, changed calendar recycle view
Tonic Sol-fa Screen Added
Merge Pull
Yes colors
Before leasing out to testers
Working but unformated table
Added Seperators but we have a glithchchchc
Tonic sol-fa nice, dots left, and some extras :)))
Just a nice commit on a good friday.
Just a quickie
I dont know what im committing...3 -
How is it possible?
I installed a treeview module. I followed all the documentation and the module is showing. Perfect!
Me: create 3 roots,
Module: all is ok.
Me: 😊create 2 nodes,
Module: everything is fine.
Me: 😁3rd node
Module: ... Kaput. tree displays like the nodes are in random order.
Me: 🤨Check the database, and fix the set.
Module: Aah much better.
Me: 😃Try to change an int.
Module: Noooooo! Big mistake!!!
Me: 🤔Ok, ok, ok, rollback! 😧
Module: still in random situation
Me: 😶 and now what? -
Sometimes, GCC is cool with you, warn you for every no-return int function or little parenthesis which could make the code easy to read.
And sometimes, you can get the fuck off, because initialized variables are no big deal. Really ... -
I need to tell you the story of my MOAB (Mother of all bugs).
I need to write some stuff in C (which i am fairly used to) and have a function that allocates memory for a Matrix on the heap. The matrix has a rows and columns property and an associated data array, so it looks like this
struct Matrix{
uint8_t rows;
uint8_t columns;
uint8_t data[];
}
I allocate rows*columns + 2 bytes of memory for it.
I also have a function to zero it out which does something like this
for(int i=0; i < rows*columns;i++){
data[i]=0;}
Let‘s come to the problem:
On my Mac the whole stuff works and passes all tests. We tried the code on a Linux machine and suddenly the code crashed in various places, sometimes a realloc got an invalid pointer, sometimes free got an invalid pointer and basically the code crashed at arbitrary points randomly.
I was confused af because did i really make THAT many errors?
I found out that all errors occured when testing my matrices so i looked more into it and observed it through the debugger.
Eventually i came to the function that zeroes out my matrix and it went unusually high and wondered if my matrix really was that big.
Then i saw it
The matrix wasn‘t initialised yet
It had arbitrary data that was previously in the heap.
It zeroed out a huge chunk of the heap space.
It literally wrote a zero to a shitload of addresses which invalidated many pointer.
You can imagine my facepalm2