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 - "bool"
-
*listens to music using Samsung earphones*
Person next to me: Nice song
Neighbor: Nice song
Aliens: Nice song14 -
"I'm not paying for a website that's going to be free to visit, that doesn't make sense"
-A million $ idea guy28 -
Some ideas for variable names. Thank me later :))
1. bool sheet;
2. int entionally;
3. char mander;
4. double penetration;
5. string cheese;
6. long schlong;23 -
That moment when you make your code such that even dummies can understand it, implement smart ass algos, do all those comment line things for definitions. Then you show your project to your teacher who has this to say :
"Why are you showing me copied code?"
I am like10 -
When people say: "All you do is sit in front of your PC doing stuff. Get a life"
Me: This is my life!5 -
/*
It's a pretty long rant. Hope you didn't get bored :P
*/
So I have this friend of mine who has learnt Python at good level (that's what he says) and is with me in all classes in college. I have worked with C, C++, C# and Java only and hated Python when it was taught (wk44).
So the following happened in the last 2 weeks:
Once he wrote a Python function in terminal just returning a hard coded string (lame right) and will show me how cool is it and that it is sooo much easier.
Whenever we do a mini project together he will force that we use Python. Even in Image processing when everyone is ready to work on Matlab, he insists that Python would be a better option.
We asked that this XYZ is very easy to implement on Matlab.
We then had to listen about the large and great community of Python and that it has Libraries for everything and that it is the greatest programming language ever.
One day he saw my C# project for DFA and NFA simulation which was the greatest project I have "completed" myself, and went like "Hmph, if I was you, I would use python and make a more "professional" code" (then went on arguing as always)
This happened today in Networking lab-
(Sockets was taught and we are expected to learn its programming aspects)
All students: Open linuxhowtos.org and start reading on socket programming
He : Opens some websites and downloads books on Networking with Python or someting
Now while I am reading the documentation of sockets and bind, he opens spider IDE, copy-paste the code in the book and start bugging ME that he is getting all these errors like literally showing me those errors and whining about all those problems.
Me: We are supposed to learn this in C. Here take a look at this link.
HE: No I'll use Python cuz it is better than your C. It has libraries for everything and is much easier.
Me: Alright whatever I am fed up, do whatever you want11 -
Now I lay me down to rest,
I pray I pass tomorrow's test.
If I should die before I wake,
That's one less test I'll have to take.6 -
Today when showing a game that I made:
X: So you used Unity, it's so easy
Me: Yeah I mean compared to....
X: Thus since you used a game engine, I can't say your game was completly developed by you.
Me: So you are saying that since a builder didn't make bricks thus he can't claim credits on the building he made?13 -
Watching a tutorial.
* Uses the mouse in order to select and format code, instead of the shortcuts VS code provides
* Does multiple "bool == true"-comparisons
* Doesn't use string interpolation and makes unnecessary .toString() calls
* Adds fucking parentheses around the whole fucking expression he wants to assign
value = (expression)
* Explanations so vague, the EU wants to hire him to reform the internet
Fucking waste of time even on x2.25 speed.10 -
int main()
{
bool NeedPoints = true;
int Points = 0;
if (NeedPoints)
{
Points++;
if (Points > 10)
{
CreateAvatar();
NeedPoints = false;
}
}
}29 -
My team are the best coworkers I've had. Admittedly I'm only 4 years into my professional career, but my team makes me stay with my current job.
My team do a lot of silly things to keep everyone in a good mood, and stress free. This week we've had a game where in a quote moment you just yell the name of a primitive type (like BOOL). Why? No idea, but we're enjoying it.
We also have a chicken hat that we named Barry. He sits with people on their desk to do code reviews and such. When people leave they get their own Barry to take with them to their new job. We introduce people to him as a regular member of the team.
Sometimes work sucks. Being a developer can be hard, and can be stressful. Working with this team makes it worth it. -
Do the 'best' programmers use fewest lines of code?
The best programmers write the appropriate number of lines of code. No more, no less.10 -
aslkfjasf. i've spent 12 hours today (and lots more over the past two days) trying to reproduce a bug that my [sort of] coworker insists is present. I haven't seen any proof of it anywhere, let alone steps to reproduce it.
I've poured through the code, following all of its tangled noodles of madness from start to fuck-this-shit. I've read and reread the pile of demon excrement so many times i can still read the code when i close my eyes. so. not. kidding.
anyway, the coworker person is getting mad because i haven't fixed the bug after days, and haven't even reproduced it yet. This feature is already taking way too fucking long so I totally don't blame him. but urghh it's like trying to unwind a string someone tied into a tight little ball of knots because they were bored.
but i just figured out why I haven't been able to reproduce it.
the stupid fucking unreliable dipshit ex-"i'm a rockstar and my code rocks"-CTO buffoon (aka API Guy, aka the `a=b if a!=b`loody pointless waste of mixed spaces and tabs) that wrote the original APIs ... 'kay, i need to stop for breath.
The dumbfuck wrote the APIs (which I based the new ones on mostly wholesale because wtf messy?), but he never implemented a very fucking important feature for a specific merchant type. It works for literally every type except the (soon-to-be) most common one. and it just so happens that i need that very specific feature to reproduce this bug.
Why is that one specific merchant type handled so differently? No fucking idea.
But exactly how they're handled differently is why I'm so fking pissed off. It's his error checking. (Some) of his functions return different object types (hash, database object, string, nullable bool, ...) depending on what happened. like, when creating a new gift, it (eventually...) either returns a new Gift object or a string error basically saying "ahhh everything's broken again!" -- which is never displayed, compared against, or recorded anywhere, ofc. Here, the API expects a Hash. That particular function call *always* returns a Hash, no matter what happens in the myriad, twisting, and interwoven branches the code could take. So the check is completely pointless.
EXCEPT. if an object associated with another object associated with the passed object (yep) has a type of 8. in which case, one of the methods in the chain returns a PrintQueue that gets passed back up the call stack. implicitly, and nested three levels in. ofc.
And if the API doesn't get its precious Hash, it exclaims that the merchant itself is broken, and tells the user to contact support. despite, you know, the PrintQueue showing that everything worked perfectly. In fact, that merchant's printer will be happily printing away in the background.
All because type checking is this guy's preferred method of detecting errors. (Raise? what's that? OOP? Nah, let's do diverging splintered-monolithic with some Ruby objects thrown in.)
just.
what the crap.
people should keep their mental diarrhea away from their keyboards.
Anyway. the summary of this long-winded, exhaustion-fueled tirade is that our second-most-loved feature doesn't work on our second-most-common merchant type.
and ofc that was the type of merchant i've been testing on. for days. while having both a [semi] coworker and my boss growing increasingly angry at me for my lack of progress.
It's also a huge feature, and the boss doesn't understand that. (can't or won't, idk)
So.
yep.
that's been my week.
...... WHAT A FUCKING BUFFOON!rant sheogorath's spaghetti erroneous error management vomit on her sweater already your face is an anti-pattern dipshit api guy two types bad four types good root swears oh my3 -
That moment when your password is constantly rejected and you realize that the fucking NUM LOCK IS OFF.
(ノಠ益ಠ)ノ彡┻━┻
(⌐■_■)–︻╦╤─ 💻6 -
Me-
/ / / / / / / / /
if (bool == true)
{
bool = false;
}
if (bool == false)
{
bool = true;
}
/ / / / / / / / /
My friend-
/ / / / / / / / /
bool = !bool;
/ / / / / / / / /
*not a real story*15 -
bool success = false
if !success {
success = try()
}
if !success {
success = try()
}
if !success {
throw new GiveUpException()
}8 -
Going through code left by a senior developer who quit.. Dated 2015..
public static T IfThenElse<T>(bool isTrue, T ifYes, T ifNo)
{
if(isTrue) { return ifNo ; }
else if(!isTrue) { return ifNo ;}
Debugger.Break();
throw new Exception("") ;
}
.....
There was a unit test for it well
....
............. Wow, just wow9 -
Just found this while trying to understand some code:
```
bool ok = true;
if(ok) {
// lots of code here
} else {
// even more code here
}
```
I thought this was worth my first rant...6 -
You know whom I hate more than apple fanboys, "language" fanboys!
Yeah...that's a thin now.
(I'll post the whole story when I reach my room)8 -
I am once again reminded how much of a clusterfuck C++ as a whole is.
They recently (C++17) added this cool new attribute called nodiscard.
You can put it on a function like this
[[nodiscard]] bool writeMessage(...)
and the compiler will check if the returned value was discarded or not, and give a warning accordingly.
Pretty neat if you're returning an error code and you want to enforce that it gets checked, right?
Except it doesn't work in template classes.
It just doesn't do anything there.12 -
I've taken over a project with legacy code, this is one of the methods:
private bool areEqual(string value1, string value2)
{
return value1 == value2;
}
Also, the opening brackets are on a new line10 -
Company: Govt says you should stay home to prevent spreading the disease. PLZ WFH.
People start to WFH.
VPN gets overwhelmed.
Me: Cannot connect to VPN.
Boss: Then go in the office!!!
Me: Uhh...3 -
Telling an Arch beginner to try Gentoo is same as telling someone who switched from Java to C to try assembly.3
-
bool True = false;
bool False = true;
if (True == true)
{
False = True;
}
else
{
True = true;
False = !true;
}
if (!False == !!true && True == !false)
{
False = True;
True = (!!False)true;
}
Console.WriteLine("Banana");5 -
Remember the time when someone appreciated your code and praised the implementation, said that your code was better??
Yeah, neither do I.1 -
Saw one of these in store today.
Who designs these "Ergonomic" things?
My fingers starts aching just by looking at this..13 -
Person: "What is bool?"
Me: "Boolean, true or false."
Person: "But why is it called that?"
Me: ...
Brother: "Because it's based on boolean algebra. Made by George Boole."
https://en.m.wikipedia.org/wiki/...7 -
Genuine snippet of code from something we are rewriting from scratch..
// Returns true if section length is greater than maximum path
public bool isOversized(double sectionLength) {
return false;
}
Fffuuuuuu6 -
My predecessor used auth as a bool. The only way he kept basic users from accessing admin functions was by including the word "admin" or "user" in the URL so any user could be the administrator by just changing the URL parameters after logging in
For example, mysite.com/admin/editorderdetails vs. mysite.com/user/editorderdetails -
Created a bool and set the value 1 instead of true
Took 10 fucking minutes to realize what I did wrong even with the red underline calling me an idiot6 -
Let's say you have a MySQL database table for jobs. Each job has 1 associated ticket. You want to keep track if the ticket is closed or not. Every sane person creates jobs table, tickets table, keeps bool value for ticket state and relationship between them.
But because our database is designed by a half braindead amoeba, we have one table only, so each job has to be updated individually with a new ticket number and its state. Beacuse it sooo much faster to update (daily!) 13k jobs than just 100 tickets.
As a bonus - if the ticked is closed, the column "ticket_closed" is "No", if it's still open the value is "FALSE". Yes, both as varchar/strings.7 -
Every language ever:
"You can't compare objects of type A and B"
Swift, on the other hand:
"main.swift:365:34: note: overloads for '==' exist with these partially matching parameter lists: (Any.Type?, Any.Type?), ((), ()), (Bool, B ool), (Character, Character), (Character.UnicodeScalarView.Index, Character.UnicodeScalarView.Index), (CodingUserInfoKey, CodingUserInfoKey ), (OpaquePointer, OpaquePointer), (AnyHashable, AnyHashable), (UInt8, UInt8), (Int8, Int8), (UInt16, UInt16), (Int16, Int16), (UInt32, UIn t32), (Int32, Int32), (UInt64, UInt64), (Int64, Int64), (UInt, UInt), (Int, Int), (AnyKeyPath, AnyKeyPath), (Unicode.Scalar, Unicode.Scalar ), (ObjectIdentifier, ObjectIdentifier), (String, String), (String.Index, String.Index), (UnsafeMutableRawPointer, UnsafeMutableRawPointer) , (UnsafeRawPointer, UnsafeRawPointer), (UnicodeDecodingResult, UnicodeDecodingResult), (_SwiftNSOperatingSystemVersion, _SwiftNSOperatingS ystemVersion), (AnyIndex, AnyIndex), (AffineTransform, AffineTransform), (Calendar, Calendar), (CharacterSet, CharacterSet), (Data, Data), (Date, Date), (DateComponents, DateComponents), (DateInterval, DateInterval), (Decimal, Decimal), (IndexPath, IndexPath), (IndexSet.Index, IndexSet.Index), (IndexSet.RangeView, IndexSet.RangeView), (IndexSet, IndexSet), (Locale, Locale), (Notification, Notification), (NSRange,
NSRange), (String.Encoding, String.Encoding), (PersonNameComponents, PersonNameComponents), (TimeZone, TimeZone), (URL, URL), (URLComponent s, URLComponents), (URLQueryItem, URLQueryItem), (URLRequest, URLRequest), (UUID, UUID), (DarwinBoolean, DarwinBoolean), (DispatchQoS, Disp atchQoS), (DispatchTime, DispatchTime), (DispatchWallTime, DispatchWallTime), (DispatchTimeInterval, DispatchTimeInterval), (Selector, Sele ctor), (NSObject, NSObject), (CGAffineTransform, CGAffineTransform), (CGPoint, CGPoint), (CGSize, CGSize), (CGVector, CGVector), (CGRect, C GRect), ((A, B), (A, B)), ((A, B, C), (A, B, C)), ((A, B, C, D), (A, B, C, D)), ((A, B, C, D, E), (A, B, C, D, E)), ((A, B, C, D, E, F), (A , B, C, D, E, F)), (ContiguousArray<Element>, ContiguousArray<Element>), (ArraySlice<Element>, ArraySlice<Element>), (Array<Element>, Array <Element>), (AutoreleasingUnsafeMutablePointer<Pointee>, AutoreleasingUnsafeMutablePointer<Pointee>), (ClosedRangeIndex<Bound>, ClosedRange Index<Bound>), (LazyDropWhileIndex<Base>, LazyDropWhileIndex<Base>), (EmptyCollection<Element>, EmptyCollection<Element>), (FlattenCollecti onIndex<BaseElements>, FlattenCollectionIndex<BaseElements>), (FlattenBidirectionalCollectionIndex<BaseElements>, FlattenBidirectionalColle ctionIndex<BaseElements>), (Set<Element>, Set<Element>), (Dictionary<Key, Value>.Keys, Dictionary<Key, Value>.Keys), ([Key : Value], [Key : Value]), (Set<Element>.Index, Set<Element>.Index), (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index), (ManagedBufferPointer<Hea der, Element>, ManagedBufferPointer<Header, Element>), (Wrapped?, Wrapped?), (Wrapped?, _OptionalNilComparisonType), (_OptionalNilCompariso nType, Wrapped?), (LazyPrefixWhileIndex<Base>, LazyPrefixWhileIndex<Base>), (Range<Bound>, Range<Bound>), (CountableRange<Bound>, Countable Range<Bound>), (ClosedRange<Bound>, ClosedRange<Bound>), (CountableClosedRange<Bound>, CountableClosedRange<Bound>), (ReversedIndex<Base>, ReversedIndex<Base>), (_UIntBuffer<Storage, Element>.Index, _UIntBuffer<Storage, Element>.Index), (UnsafeMutablePointer<Pointee>, UnsafeMut ablePointer<Pointee>), (UnsafePointer<Pointee>, UnsafePointer<Pointee>), (_ValidUTF8Buffer<Storage>.Index, _ValidUTF8Buffer<Storage>.Index) , (Self, Other), (Self, R), (Measurement<LeftHandSideType>, Measurement<RightHandSideType>)"17 -
bool rant = false
I became my school's computer club president just last year. Although it's a computer club most of them aren't specially good in computer. We learn Photoshop for mostbof the time. So I decided to bring in unity3d and teach it myself.
I did managed to teach them in a slow pace. What came to me as a surprise is that I inspired another student to held unity class in school to teach other students game making .
Sometimes little thing we do may influence people in a big way we don't know.2 -
Today I gave my Network assessment (code) on an A4 sheet as told by the professor. He will later type the code and check if runs or not and award marks !!
ಠ▃ಠ 凸ಠ益ಠ)凸 Where is my stress ball?4 -
Oh dear Apple,
so you're telling me that for the camera API, the requestAuthorization() method returns a bool and for the PhotoLibrary it returns an enum. Why are you going with an enum when there are 2 states and the camera api doesn't use an enum?
(The 2 methods serve the same purpose, the enum exists in the camera api as well and has the exact same states)
And why do I need access to users photos, if I only want to write photos?2 -
Function bool NewSpeedTestingStandard()
{
AskUserToLoadAPage();
return UserUsesPhoneWhileLoad()
? "Fail" : "Pass";
}8 -
Saw this in a previous developer's code which is currently in production.
public bool reset;
public bool Reset
{
get{ return reset; }
}
This was done for most if not all the properties.3 -
! ! ! WARNING: BAD PUNS ! ! !
Float: Bool, you're so basic.
Bool: Why are you boolean me?
...
I'll see myself out6 -
When you spend so much time using PHP that you start naming variables with $ in other languages without releasing.
bool $haha = true;
if (haha) ...
haha is not defined.3 -
Fucking shit i just had a 3 days chat with google's cloud engineer about an issue i had in a project. eventually the issue occured due to an update they made on some projects involving IAM changes that required some changes from my part in my security toles. Like wtf haven't you heard of data fixes when you roll out such changes?! I just had my production env down for 72hours for their fuckup.
At least send an email regarding it so we could set it up in time1 -
I see this in code:
bool status;
status = true;
It makes me want to hit things. INLINE THAT SHIT! bool status = true; It's not hard. JFC. And of course I don't have the authority to change it.3 -
Best laptop to run your linux distro
"Razer founder and CEO Min-Liang Tan has announced that Razer is soon going to support Linux distros on its Razer Blade laptop series officially. To welcome the suggestions from the community, Razer has created a new Linux Corner hub"5 -
I just had a programming test.
I'm such a fucking stupid retard.
What I should've written:
static bool NotAnd(bool a, bool b) => !(a && b);
What I did:
static bool NotAnd(bool a, bool b) => a != b;
So instead of !AND, I wrote a fucking XOR. I got everything else right but not the simplest of all.
Great birthday so far.4 -
Tbh my current job is as close to perfect as I can imagine ever existing. The best and smartest engineers I've ever met (better than Google, better than anywhere), all working on something we think is really really important (autonomous cars), and solving hard problems every day (some of which no one else has ever solved before).
Only downside is an internal sense that when I'm not working I'm delaying a product that will save people's lives.4 -
while (!SolveProblem())
{
cryCounter++;
If (cryCounter.getDays > dueDate.days)
{
bool cried = tryNotToCry();
if (cried) cryALot();
}
}1 -
Last night i had to write sms center for a panel for my client
I was awake till 5 am 😧 why you ask ?
They had a restful api and also a webservice but neither was complete 😑
And the documents of it was f*#$& worst
They had UserName as parameter but the actual one was userName 😑😐 thats not just it they had more
Also they missed some parameters for some functions 😑
They had parameters for Count and instead of int they said its a Bool and on the description it said 1-100
Im so frustrated1 -
And then, looking for the source of a bug in the code .... I randomly found this:
public bool IsOperationStarted { get; set; }
public bool IsOperationStartedTrue
{
get { return IsOperationStarted == true; }
}
public bool IsOperationStartedFalse
{
get { return IsOperationStarted == false; }
}4 -
bool isTrue(bool val){
If(val == true){
return true;
}
else if(val == false){
return false;
}
else{
cout<<"Wrong value";
}
Function isTrue is the future ! 😂😂😂2 -
Hey everyone!
Today I learned that true is not boolean and my functions typed for bool can actually return bool OR true!3 -
I had rough week last week. Accidentally deployed dev code to production, soon found out there was no production version of code to do a redeploy. Deployed another app to production, it was working fine then another Dev changed a data type in the database from bool to nullable Boolean which broke some Linq queries. Looked like I deployed crap code. 3rd week with company.
-
package main
import (
"log"
"strings"
)
type Present struct {
from string
to string
}
type Santa struct {
presents []Present
}
type Person struct {
Name string
Nice bool
Presents []Present
}
func (santa *Santa) givePresents(person Person) []Present {
result := []Present{}
if person.Nice != true {
return result
}
for _, present := range santa.presents {
if strings.Compare(present.to, person.Name) == 0 {
result = append(result, present)
}
}
return result
}
func main() {
santa := Santa{
[]Present{
{"devRant", "Alex"},
{"Johanna", "Alex"},
{"Alex", "devRant"},
{"Alex", "Johanna"},
},
}
persons := []Person{
{"Alex", true, []Present{}},
{"Johanna", true, []Present{}},
{"devRant", false, []Present{}},
}
for idx, person := range persons {
persons[idx].Presents = santa.givePresents(person)
}
log.Println(persons)
}2 -
Interviewer: Could you please make a class to force it create one instance at most?
Me: Sure!
(I didn't know the singleton pattern)
class A {
public static bool isCreated = false;
A() {
if(isCreated == true)
throw new Exception();
isCreated = true;
}
}5 -
bool showUpLateToWork=true;
bool rememberHeadPhones=false;
String DayOfWeek=Tuesday;
int hoursSpentOnPhoneLastNight=
int productivity = 100 - hoursSpentOnPhoneLastNight;
if(showUpLateToWork)
missStandup();
}
if(rememberHeadPhones)
Productivity +=10
Else
Productivity -=50;
While (hourOfDay(now()) <17)
{
drinkMntDew();
discussDataQualityIssuesWithBusiness();
lookThroughTonsOfPoorlyWrittenCodeForDefectThatBusinessWantsFixedYeasterday();
dieOnTheInside();
curseProjectTeamForPassingCrapCodeToMaintainaceTeam();
cry();
curseComputerApplicationsForNotResponding();
visitBathroomWhileLurkingDevrant();
}
goHome();
while (!asleep && hourOfDay(now()) > 17)
{
playWithPuppy();
qualityTimeWithMyWife();
pkayLeagueOfLegends();
netflixAndChill('litterally');
for (int i =1; i <=5; i++)
showLoveUsingLoveLanguage(i);
try
{
makeBaby();
} catch
{
learnPatience();
}
cuddle();
if(!wifeAwake)
checkDevrant()
}1 -
I fix antique code for a living and regularly come across code like this, and this is actually the good stuff!
Worst usecase for a goto statement? What do you think?
int sDDIO::recvCount(int bitNumber){
if (bitNumber < 0 || bitNumber > 15) return 0; //ValidatebitNumber which has to be 0-15
//Send count request
if (!(send(String::Format(L"#{0:X2}{1}\r", id, bitNumber)) && flushTx())){
bad: //Return 0 if something went wrong
return 0;
}
String^ s = recv(L"\r"); //Receive request data
if (s->Length != 9) goto bad; //Validate lenght
s = s->Substring(3, 5); //Take only relevant bits
int value; //Try to parse value and send to bad if fails
bool result = Int32::TryParse(s, value);
if (!result) goto bad;
int count = value - _lastCount[bitNumber]; //Maximumpossible count on Moxa is 65535.
if (count < 0) count += 65536; //If the limit reached, the counter resets to 0
_lastCount[bitNumber] = value; //This avoids loosing count if the 1st request was
//made at 65530 and the 2nd request was made at 5
return count;
}4 -
This is gonna get someone illogically upset, but idc about that.
I know it's ignorance of semantics but I'm tired of propagated ignorance changing the meaning of things.
Non-binary is NOT a legitimate term for whatever 'gender' you are!
I get what *whoever-started-it* was going for, but it's NOT valid. If you want to say that youre not male or female, fine... just don't abuse binary systems to do it. Just say youre non-bool/anti-boolean or identify with one of the, apparently 50, shades of gray.
I keep getting into logical loops to nowhere about this nonsense. No one is even defining what's supposed to be the 1 vs the 0. Which then makes me think '1 must be male... genitalia=1 in many ways...' which then sources back to the historic validity of males vs undervalued/less than human interpretations of females...
Then <brake>.
Ofc these people aren't going into the historical significance... they don't even realise how binary works! Ofc they'd have no clue that all 0s= no data... and 0s only have significance when viewed in placement to the 1s.
Let's all start using proper terminologies, like non-boolean. Maybe i can start a trend by paying people pennies to learn/teach wtf a boolean value is, and that binary can represent anything. With proper encoding the array is limitless... so being binary is actually a giant spectrum... therefore makes no sense to be "non-binary".
Ok... im done. It had to be said.
Who wants to start identifying as non, or educating wtf is, boolean with me???42 -
So, whenever I delay windows 10 update restart a few times, things start breaking. Wifi doesn't work, 100% cpu, ram or mem usage, sound problems etc. And all this goes away once I submit my soul and update. I'm sick of this shit 😡. Today I got a BSOD after which it updated and things seem fine FOR NOW.
Does this happen to other Win 10 users?8 -
Once I told a good friend that I will make a website for his business. I do all IT stuff he only has to do the content. Halfway done with the site I asked if he has written anything. He had not. Then a week later I asked again. He had nothing. So I sat down with him and helped him write what he does and why people should go to him. Then I told him to ask a mutual photographer friend to take pictures for him. A week went by when I asked him if he has contacted the guy. He had not. Then I was like: "Dude! If you are not willing to put any effort into making this happen then why the hell should I?"
In the end he didn't do anything. And that's the story of my friend never getting a free website.
The End.1 -
So I've been maintaining our company's web products for a few years now with a great senior dev, but why would it ever make sense to have a
bool somebool = returnsBool();
if (somebool == true)
...
WTF?!?! I still fine them in the code to this day.6 -
Hey guys and girls, quick question.
Im currently writing my own collection-framework in Go.
It has a Collection-Interface, that looks like this:
Clear()
Size() int
ToSlice() []interface{}
Add(...interface{}) error
Remove(...interface{}) error
Contains(...interface{}) (bool, error)
The library should also contains stuff like stacks and queues, so datastructures, that dont fit that interface perfectly.
So should i write a weird implementation of the interface for them, like Remove for stacks (high pitched internal screaming), or should i just say fuck it, and dont implement the Collection-Interface for these specific types ?3 -
So today morning I got a driver related BSOD after which during restart, my pc went into windows update. Everything was going fine when power failed and it shut off. Now I am stuck with this...
Good thing I have linux in dual boot so work is getting done. -
The borrower
Dart: Can I borrow your let?
JavaScript: Fuck off!
Dart: Please spare me your var then... You don't seem to need it anymore.
JavaScript: I said fuck off weirdo!
Dart: Can I borrow your var?
C#: 🧐... Kotlin. Is that you again?
Dart: No, I'm Dart.
C#: That what?
Dart: Haha, Just Dart.
C#: So, you need my var?
Dart: Yes, and also your String.
C#: Just that.
Dart: and your int, your bool, double and List
C#: Just that.
Dart: All your types... Maybe.
C#: 🚍☎️🗃️💺📺🛏️🎻🔦 🧤 Here you go.
Dart: Thanks💃
Dart: Can I borrow your pointer?
C: 👴 Huhh?
Dart: Your pointer. Yes that pointing stuff.
C: Borrow what?
Dart: Your pointer.
C: Poin...
Dart: Pointer!
C: Ponita
Dart: 🏃...
C: Here is my Pony bear... Hellooo. You there?1 -
public const bool DEBUG_THAT_SHIT = ConfigurationManager.ParseBool("debugThatShit");
public const bool DEBUG_THAT_OTHER_SHIT = ConfigurationManager.ParseBool("debugThatOtherShit");
public bool iMadeANewFeature = ConfigurationManager.ParseBool("newFeature")?true:false;
Fucking new guy, can you not fucking read the other constants and make them look the same? Apparently not and I am the asshole. -
I really hate PHP frameworks.
I also often write my own frameworks but propriety. I have two decades experience doing without frameworks, writing frameworks and using frameworks.
Virtually every PHP framework I've ever used has causes more headaches than if I had simply written the code.
Let me give you an example. I want a tinyint in my database.
> Unknown column type "tinyint" requested.
Oh, doctrine doesn't support it and wont fix. Doctrine is a library that takes a perfectly good feature rich powerful enough database system and nerfs it to the capabilities of mysql 1.0.0 for portability and because the devs don't actually have the time to create a full ORM library. Sadly it's also the defacto for certain filthy disgusting frameworks whose name I shan't speak.
So I add my own type class. Annoying but what can you do.
I have to try to use it and to do so I have to register it in two places like this (pseudo)...
Types::add(Tinyint::class);
Doctrine::add(Tinyint::class);
Seems simply enough so I run it and see...
> Type tinyint already exists.
So I assume it's doing some magic loading it based on the directory and commend out the Type::add line to see.
> Type to be overwritten tinyint does not exist.
Are you fucking kidding me?
At this point I figure out it must be running twice. It's booting twice. Do I get a stack trace by default from a CLI command? Of course not because who would ever need that?
I take a quick look at parent::boot(). HttpKernel is the standard for Cli Commands?
I notice it has state, uses a protected booted property but I'm curious why it tries to boot so many times. I assume it's user error.
After some fiddling around I get a stack trace but only one boot. How is it possible?
It's not user error, the program flow of the framework is just sub par and it just calls boot all over the place.
I use the state variable and I have to do it in a weird way...
> $booted = $this->booted;parent::boot();if (!$booted) {doStuffOnceThatDependsOnParentBootage();}
A bit awkward but not life and death. I could probably just return but believe or not the parent is doing some crap if already booted. A common ugly practice but one that works is to usually call doSomething and have something only work around the state.
The thing is, doctrine does use TINYINT for bool and it gets all super confused now running commands like updates. It keeps trying to push changes when nothing changed. I'm building my own schema differential system for another project and it doesn't have these problems out of the box. It's not clever enough to handle ambiguous reverse mappings when single types are defined and it should be possible to match the right one or heck both are fine in this case. I'd expect ambiguity to be a problem with reverse engineer, not compare schema to an exact schema.
This is numpty country. Changing TINYINT UNSIGNED to TINYINT UNSIGNED. IT can't even compare two before and after strings.
There's a few other boots I could use but who cares. The internet seems to want to use that boot function. There's also init stages missing. Believe it or not there's a shutdown and reboot for the kernel. It might not be obvious but the Type::add line wants to go not in the boot method but in the top level scope along with the class definition. The top level scope is run only once.
I think people using OOP frameworks forget that there's a scope outside of the object in PHP. It's not ideal but does the trick given the functionality is confined to static only. The register command appears to have it's own check and noop or simply overwrite if the command is issued twice making things more confusing as it was working with register type before to merely alias a type to an existing type so that it could detect it from SQL when reverse engineering.
I start to wonder if I should just use columnDefinition.
It's this. Constantly on a daily basis using these pretentious stuck up frameworks and libraries.
It's not just the palava which in this case is relatively mild compared to some of the headaches that arise. It's that if you use a framework you expect basic things out of the box like oh I don't know support for the byte/char/tinyint/int8 type and a differential command that's able to compare two strings to see if they're different.
Some people might say you're using it wrong. There is such a thing as a learning curve and this one goes down, learning all the things it can't do. It's cripplesauce.12 -
Why do windows users keep installing those bloated anti viruses and firewalls that just slow the hack of their system when windows essentials is enough with near to no impact
Those are the same people that got their system full with malware4 -
So the other day, I was working on some Python project when there was this bug that kept transforming. Like seriously, I would turn from "bool not defined" to "function does not exist" to literally "file does not exist"... within the FILE. And when I fixed them, new bugs kept popping up, and I couldn't find anything that was a problem. Nothing. There was this one function in there that, if I changed even the comments in there, would break. And so.... I turned off Atom and turned it on again. ( ha ) Didn't work. I restarted my computer. I copy pasted the file into another file. I used another IDE. I restarted GHCI. I restarted Jupyter Notebook... and after 6 hours... I found that it was because an if statement has a comparison between a bool and a bool, with a = in the middle. (not ==). I swear I almost threw the computer on the floor.1
-
"Tahnik, it's about your code that I'm reviewing. There's bool variable called homeMainCreatePostChoseImageFromLibrary. Any idea what that variable is doing?"
"That's the button the user can click to chose an image from library when creating a post"
"Oh ok. Can you put a comment on that variable?"
"..."4 -
So...Microsoft is releasing a Linux based IoT OS. What does devRant community has to say about it?9
-
I've accidentally submited a wpf bool-to-visibility converter with inversed rules. On SVN, right to the trunk.
-
This was in 1st semester and our CSE course went under some major course revision. Python was to be taught in place of C. Now the professor we had was very famous and we were excited to be in his class. But little did we knew he had no knowledge of Python at all. He used to tell the lab assistant to teach.It was so bad that I lost all interest in programming!!
But we all studied python later in our winter holidays for further courses.
Next semester we had OOP and this is what happened:
1st lab:
Professor(different): I expect you have basic knowledge in programming so I have uploaded.
Every question was related to structures in C.
In the same semester, we had data structures where we were 'expected' to know C or C++.
Later we came to know that Python was not going to be of any use in any course ! First semester went into dustbin.
/*
It was pretty long rant. Hope you didn't get bored :P
*/ -
I'm developing a new (just for fun) programming language and I'm wondering what features I should add next? These features are already implemented:
- Printing text
- Variables
- user-input
- Datatype conversion (String, Int, Float, Bool, List, Dictionary)
- lists/arrays
- dictionaries
- Sorting
- Shuffling
- random numbers & choices
- Math stuff like: log, abs, floor, ceiling, sin, etc...
- Time & Date
- Working with files
- If-else statements
- Ternary operators
- Loops (for & while)
- Functions
- Classes
- Error handling
- Importing libraries & other scripts
- Arrow/callback functions
- Escaping (\)
is there anything you often use missing?11 -
Maybe Rant
It's 1:30 AM and I finally finished implementing a simple function after more than an hour.
Not sure if I should be upset about my stupidity or glad that I solved it.
If anyone is interested in learning Haskell I totally recommend these exercises: https://github.com/data61/fp-course
filtering :: Applicative f => (a -> f Bool) -> List a -> f (List a)
filtering p = foldRight (\a -> lift2 (bool id (a:.)) (p a)) (pure Nil)1 -
generally, the quality of code is inversely proportional to the number of public booleans
thing.IsThatTypeOfThing
thing.IsAVerySpecificTypeOfThatThing
thing.CanDoSomething
thing.EnableSomething
apparently that's where we're heading now :/ -
"Can you go through this hours-long process to reproduce an issue i saw and debug it? I don't have bandwidth."
"Sure, but I'm pretty sure the issue is actually due to your recent changes in [related feature], and I'm pretty busy myself."
"No, that's not how that works. Please figure out the real issue." (Strongly implying it was my fault)
*Goes through hours-long process to reproduce* (yes this procedure could be improved but this is a rant not a planning meeting)
*Of course, it was his change*
"Oh. Well, it's not really a priority." -
You know prior to becoming a dev and learning the ticket system I never had a dislike against any number now I hate most of all of them
-
Why is there a - 1 plus option? Just listened to a podcast by stackoverflow where they explained how they removed the down vote option on comments out of the idea that you cant be wrong on what you think..
Just throwing an idea5 -
Does anyone know the most optimal general purpose algorithm for checking if two points on a graph are connected? I believe a* is the best for finding the shortest path but is is the best for just getting a bool of if there is a path at all?25
-
I look in the docs at the function send(..., copy=True, ...).
I want to understand what copy is for and I read the description of the parameter: "copy (bool) – Should the message be sent in a copying or non-copying manner."
BuT whAt DoES thAt MEAn ?!5 -
PHP are you freaking kidding me right now? Why are you forcing me to write ugly and meaningless code like this?
Today I just learned that boolval("false") will return true.
I'd deffo expect this from casting operators, but not from a function which even has val inside of its name.
What purpose is to have functions like these in language if they just serve as plain wrapper for casting operators8 -
Started working as a "working student" in an it company to write unit tests. (which then will be executed automatically - so automated unit tests)
Realised that I write more or less the same code just changing the names and some parameters (sometimes more if it's not an number but a bool for example but it's pretty much the same scheme)
So I bought a tool for 1$ to use "auto complete" on custom templates.(I type testgetbool and the tool replaces this to the test case only asking for the variable name.)
So now I'm writing automated automated tests 😁😅
(which is btw pretty boring but cost & time effective)2 -
> [PM from a totally different project / team comments on already-closed 10-line PR] How about we [add a totally new feature involving several engineer-weeks to patch over a fixable bug in another part of the system] instead?
> [me] we can talk about that, but it's nontrivial and we should scope any work relating to it to be sure we're doing the right thing
> [him] [starts private email chain] this should be simple. Why isn't this as simple as that other change?
> [me] [explains why]
> [him] I think it should be simple. We'll talk about it offline tomorrow and maybe you can do it next week.13 -
I just found out, there is a GCC flag that prevents you from using integers in a bool context in C.
Like wtf?!
Not only is this the original "bool" implementation of C, but it's also a widespread concept for use in NULL checks and the likes.5 -
Meetings are the way of parasites to keep shining without doing shit. Why do they gave to drag me into their bullshit meeting?!$&2
-
I think we should have a decent web app for devrant. And... make it open source so we all could give a hand 🖐️8
-
Bad coding style:
bool condition = false;
if(condition) { /* enough whitespace so that braces appear offscreen in editor*/ }{
std::cout << "hahahahaha" << std::endl;
}6 -
You gotta love PHP:
<?php
$bool = true && false;
var_dump($bool); // false, that's expected
$bool = true and false;
var_dump($bool); // true, ouch!
Source: http://php.net/manual/de/...
http://php.net/manual/de/...3 -
Noob question
Is it better to implement a cryptpgraphic algo in a function or in a class? Also how?
More info:
I have a cryptography class and I really enjoy implementing the different techniques that we study in class. At first I was just implementing the techniques in a simple function with 3 parameters; key, message and a bool for encryption or decryption. But as they are getting more complex, it is becoming harder to continue implementing them in a single function block. So I thought of using a class but ran into the problem of how do I even do that? Do I make different methods for key generation, encrypting and decrypting?
P.S. It's really just for learning how the crypto technique works and not for anything serious.12 -
You know ya listening to too much daft punk when you start calling methods after the song your listening too, SearchDaFunc Func returning to a polling Func, anyway here's Da Funk
https://youtube.com/watch/... -
var me = new Developer();
while(TimePassing())
if (time > 9am && time < 10am)
{
bool success;
me.TryStayAwake(out bool success);
if (success)
me.Code();
}
else
{
if (bedtime)
me.ActivateSuperAwakeMode()
}1 -
public static bool IsYouCrazy()
{
// I can't stand random
// carriage returns
bool hasRandomBlankLines = true;
Return hasRandomBlankLines;
} -
{
while(time_to_exams > 0){
me.shouldBeLearning(true);
time_to_exams--;
}
public void shouldBeLearning(boolean bool){
if(bool){
should_be_learning = false;
waste_time_on_DevRant = true;
} else {
waste_time_on_DevRant = true;
}
}
} -
int reading;
bool status;
long barcode;
char entry;
unsigned value;
bool disabled;
🎈🎈🎈🎈🎈🎈🎈🎈🎈
float theyall; -
public void DailyLife(bool sleep)
{
While( WaitingForCompile && !sleep)
{
BrowseDevrant();
FindNew("Girlfriend", "tinder");
RefreshIfCold(coffee);
}
DebugCodeIfErrorFound();
DailyLife(Datetime.Now >= Sleep.Time);
} -
Foreach (DevrantUser user in devRantUsers)
{
Bool hundredPlusPlus = false;
While (user.hundredPlusPlus == false)
{
Rant myRant = new Rant(awesomeness);
user.postRant(myRant);
If(myRant.plusPlus >= 100)
hundredPlusPlus = true;
}
}3 -
Doesn't the existence of NULL in a language mean, that there cannot be a boolean type? Because a bool is defined by the fact, that it can have two possible values. Having NULL changes that.
Without NULL a variable of the type bool could be True or False, two possible values. With NULL is can be True, False or NULL, three possible values.
I hate NULL.18 -
*starts reviewing code that I wrote at some ridiculous hour*
var glPassiveDebugging bool = !true
and to think people say that I'm too serious, and never do anything silly... -
I have a small job I work with another team on Fridays. For the last 2 weeks we've had issues with an API for our accounts server not working correctly. It's been a shitter because it only accepts XML. I've been tearing my hair out all day and getting very little usable info from the company that made the API as we reached the point where we couldn't do anything else without the API working.
Today we discovered the issue. It's that the API receiving the XML was failing because the Bool values were in capital. As far as their API is concerned, "TRUE" != "true". Something not mentioned anywhere on their (incredibly short) documentation.
I might go insane tonight. -
Genuine 1 line function found in a production system:
private bool NotExists(int typeId) {
return !collection.Any(item => item.typeId == typeId) ? false : true;
}
I can't decide how many double negatives are involved here!1 -
Bool rant: true;
Bool dev: false;
I purchased my Lenovo P90 a year ago and it never updated since.
Lenovo even took the P90 off the upgrade plan. Is that why I spent around 350$ on it?
I'm sill running android 4.4.4 and can't find a ROM because the phone is intel based.
When I asked them in E-Mail I got a copy-pasted anwser to use the phones update function(it returns that I'm running the newest version)1 -
Probably a veery long time ago, but being able to use what you use in if(...){} for e.g. booleans like "bool(ean) isX = a == x;".
And than reusing that value in if again and so on.
Even if it sounds trivial, there was a time where it was not and "==" was only associated with "you use that in if/while only" rather than "a == b" returns a bool(ean)/int.
Same goes for other arithmetic operators and && / || ofc.6 -
let rant: (Bool, Bool, String) -> Void = { (isRant, isDev, contents) in
print(contents)
}
rant(false, true, "
So, a year ago more or less, I set out to teach myself some server-side programming on the side.
Many (MANY) tutorials, Digital Ocean droplets created and destroyed, coffee mugs and FMLs later, I can say 'Hello World' from Node.js - built from source and not running as a sudoer - using express and forever on Ubuntu, behind another Ubuntu server running nginx - also built from source so to add headers-more and naxsi - using all sorts of goodies to enhance security and talking to each other via SSH. Oh, and taking to the world over HTTPS with a grade A on SSL Labs (I know this doesn't mean much to you. Yeah you, rolling your eyes over there. So why don't you just bugger off before even commenting? Haha)
Feels good man.
")2 -
Rust noob Q:
Given x a variable on the heap, e.g.
let x = String::from("Hello, devRant!");
Then, given some function that I didn't write (from a library) that takes ownership of its argument:
fn some_function(y: String) -> bool { ... }
How would you handle this situation:
if some_function(x) {
another_function(x); // not ok, because x has gone out of scope in the line before
}
Is it idiomatic to just clone() x in the first call? That seems bad practice, because it's the second (or some other additional) call that needs x. What should I be doing instead?8 -
When you are fed up with buggy API:s:
bool m_HasRecordBeenStarted_becauseIAudioPlayerIsStupidAndReturns1InGetPlaybackLengthWithNoSound; -
using System;
using System.Text;
using System.Text.Encodings;
//Bitwise XOR operator is represented by ^. It performs bitwise XOR operation on the corresponding bits of two operands. If the corresponding bits are same, the result is 0. If the corresponding bits are different, the result is 1.
//If the operands are of type bool, the bitwise XOR operation is equivalent to logical XOR operation between them.
using System.Text.Unicode;
using System.Windows;
using System.IO;
namespace Encryption2plzWOrk
{
class Program
{
static void Main(string[] args)
{
//random is basically a second sepret key for RSA exhanges I know there probaley is a better way to do this please tell me in github comments.//
Random r = new Random();
int random = r.Next(2000000,500000000);
int privatekey = 0;
int publickey = 0;
string privateKeyString = Console.ReadLine();
byte[] bytes3 = Encoding.ASCII.GetBytes(privateKeyString);
foreach(byte b in bytes3)
{
privatekey = b + privatekey;
}
int permutations = random/ 10000;
if(privatekey < 256)
{
while(permutations > 0)
{
foreach (byte b in bytes3)
{
privatekey = privatekey + (privatekey ^ permutations)*20;
}
}
}
publickey = privatekey*random;
Console.WriteLine("your public key is {0}",publickey);
}
}
}
would this be considerd ok HOBBYIST encryption and if not how would I do a slow improvment I used bitwise to edit bits so thats a check :D12 -
val true : bool = isFrustrated(me : Human)
1) Honestly fuck SML. Who's goddamn idea was it to make a useless fucking programming language that does absolutely nothing relevant unless you're trying to learn recursion. Who's fucking idea was it to not be able to even have side effects. And who gives a shit if you can explicitly declare the type of variables on every single fucking line that's what comments are for if you really need it. All this is aside from the fact that nobody ever has been like "OH UNMUTABLE TYPES? WOW IM SO HAPPY THIS IS SO USEFUL". At this point I feel like SML is basically a DFA - ABSOLUTELY FUCKING USELESS
2) Aside from that, who's idea was it to duplicate two classes. There's 15-122 (Principles of Imperative Computation) and 15-150 (Principles of Functional Programming). So far the ONLY fucking thing different is we learned about work and span in 15-150 - OTHER THAN THAT ITS LIKE TAKING THE EXACT SAME COURSE. BUT AGAIN. So then I have to fucking sit in lecture and pay attention for that tiny bit of information that is new amongst the giant cesspool of information that isn't. BECAUSE I ALREADY LEARNED IT.
Oh and did I mention that both classes are required to graduate as a CS major? Fuck me.
Thanks devRant for helping <3
Edit: We are 4 weeks into the semester so you'd expect we'd have gotten into the new stuff by now right????5 -
I try to find new stuff which is related to what I already know or is close. I like learning new technologies and techniques 😄. By this I continuously gain more knowledge thereby making me a better developer.
-
We have this C# class which is like the core of our entire business logic. If you are in another class and it doesn't contain an argument in the constructor and/or property of that core class you're gonna have a bad time.
That core class has lots of useful business logic bools, "IsSomething", "HasSomething" etc. However that core class has a parameterless constructor which is sprinkled dangerously throughout our app, meaning the object is often not initialised properly and it's a 2 day mindfuck to make sure your "IsSomething" bool is actually false and not just false because the other business logic that bool relies on wasn't initialised and the bool has never had a chance to be true.
It's difficult to trust even a simple "if' statement. And if you're somewhere were you've had a list of that core class passed in, you need to trace how the list was initialised to make sure all your bools have been set 😴4 -
//In the code block below. What are both self methods refering to? do both self methods refer to the Suit enum because it is inside the enum block? I am trying to better understand self. Please see link for expanded question.
enum Suit {
case spades, hearts, diamonds, clubs
var rank: Int {
switch self {
case .spades: return 4
case .hearts: return 3
case .diamonds: return 2
case .clubs: return 1
}
}
func beats(_ otherSuit: Suit) -> Bool {
return self.rank > otherSuit.rank
}
}
https://code.sololearn.com/c9KIG0ab... -
Having some issues with my laptop seizing up in graphical linux desktop environments, probably due to some peripheral power management. I saw there was a bios setting for "make linux work" but I couldn't find mention of it in the manual (why is this usually so hard to find, anyway?), so I googled a bit before I messed with it.
https://forums.lenovo.com/t5/...
Worst case I guess I'd just reset the bios, but it always blows my mind seeing issues like these go seemingly unaddressed. That's a 12 page discussion from 2018 where you brick your laptop - a fairly high end one at that - by flipping a bool and the latest response is "Same issue here".
Is it just PR practice to not acknowledge these things or is it likely that they are legitimately unaware? Does it not get escalated properly or do they reckon there's not enough benefit to address it?
Whatever the case, my faith in Lenovo is certainly starting to show cracks. I used to see it as the "correct" laptop brand, but nowadays I'm equally iffy about all of them.3 -
//TODO:Describe your day with block of code
using Friend.Drive;
using Coffie.Machine;
using MyCheck;
namespace Raspik.Week.Thursday
{
public class Init
{
#region Morning
public void Init()
{
this.status = _status.WakeUp;
this._getReadyToWork(Coffee, Closes, Laptop Bag);
bool success = this.getToBus();
if(!success)
Friend.Drive.ToWork(Beer,ListenToMetal());
Coffee.Machine.DoubleEspresso();
MyCheck.WorkOn(Jira.Moderate, Jira.Blocker);
#endregion
#region Noon
this._eatFood(Beef,Ale)
this._devRant.CheckInteresting();
this._facebook.CheckInteresting();
this._workEvents += new EventHander(InternetStatus);
this._coolEvents +=new EventHandler(Purge_Nerf_War);
MyCheck.WorkOn(Jira.All);
MyCheck.HappyHour(Beer,Whiskey);
MyCheck.OnlineMeeting(Client);
this.GoHome(Friend.Drive.Home);
#endregion
#region Evening
while(true)
this._baby.Diaper.Change;
this._goToSleep(this.KissWifeAndChild));
}
}3 -
I have just declared the following bool flag:
bool m_HasRecordBeenStarted_becauseIAudioPlayerIsStupidAndReturns1InGetPlaybackLengthWithNoSound;
FML -
typedef bool Bool;
Class Description
{
public:
inline Bool IsTypeA() const { return IsType(TYPE_A); }
inline Bool IsTypeB() const { return IsType(TYPE_B); }
inline Bool IsTypeC() const { return IsType(TYPE_C); }
Bool IsType(DescriptionType T) const { return (T == Type()); }
DescriptionType Type() const { return m_Type; }
private:
DescriptionType m_Type;
}
I can't make this shit up3 -
class devRantPost
{
bool isRant = false;
string title = "Feature idea";
string content = "\n
If you try to buy something and the purchase fails, the error message should say this: Stop trying to use Lucky Patcher!";
bool isTried = totallyNot;
bool isWorked = false;
string purpose = "Research";
string content2 = "Pls don't ban me!";
}3 -
So today I used a single int to pass on date, a number and a bool because I needed to display additional info ASAP, but a rebuild was out of the question so I built the int instead of a variable that was passed along and parsed it in JavaScript
-
Thought that it might be a good idea to ask this question here.
Im looking for a nice logging events service for a side project that is a b2b (so my clients got their own users). My targets are tracking users behavior/events/actions in the app while been able to shred the data that belongs to each customer. A great benefit would be having a solution that would allow me to export part of the data (in sql like way) so i could provide the users the option to download their users data as well.
Was thinking about mixpanel but i dont think they have any option to export the data via api. Heap analytics is also an interesting one, but their nice features are limited to corporates..
Any suggestions? Thanks!4 -
Guys, is any one worked with d3.js ?
I need a graph and my data source is a 2d array, A Boolean array I mean.
bool[,] matrix;3 -
if using ! in front of a variable - casts it to bool, if necessary - and flips the bit, why CSS uses "!important" to mean important, when it actually means unimportant...4
-
How deep do you go when trying to find a solution?
I have a need for combinations of items. I have used built in functions in Python for this. When I first used those I wanted to learn how they worked internally. I read through the source and thought that was cool. I don't think I really understood that code very well.
Now I need the same solution in C++. There is not a prebuilt combinations function in C++. There is a prebuilt verion of next_permutation. I can build upon that to make my combinations code. However, I am in the middle of trying to make something work. So I found this nice SO question:
https://stackoverflow.com/questions...
The code I ended up using:
template<class RandIt, class Compare>
bool next_k_permutation(RandIt first, RandIt mid, RandIt last, Compare comp){
std::sort(mid, last, std::bind(comp, std::placeholders::_2, std::placeholders::_1));
return std::next_permutation(first, last, comp);
}
template<class BiDiIt, class Compare>
bool next_combination(BiDiIt first, BiDiIt mid, BiDiIt last, Compare comp)
{
bool result;
do{
result = next_k_permutation(first, mid, last, comp);
}while(std::adjacent_find(first, mid, std::bind(comp, std::placeholders::_2, std::placeholders::_1)) != mid);
return result;
}
I am mostly able to figure out what is going on with the templates. I still am not understanding the basic algo behind permutations.
Our data set is tiny. 4 items max. So efficiency isn't really a big issue here.
How long do you spend learning how it works versus just finding a solution for the task at hand?
In general I need to spend more time learning different kinds of algorithms. So I should probably add permutations to that list of ones to study.1 -
So I started Software Engineering university and we started learning java. Before uni I was a c# developer and after two months I decided to work on my own project again in unity. When I was writing the code for this small game I realised that I get a lot of errors. Turns out that I just initialized boolean instead of bool. Thanks java
-
In type systems without variadic generics, tuples should be defined as a type-level conslist:
Tuple<int, Tuple<string, Tuple<bool, TupleEnd>>>
Consider the possibilities, even just in a regular type system, then consider how much more is possible with dependent types!4 -
Was asked to look at another teams repo to see how they use Cassandra. In that repo, I found a function that creates a map[int]bool populated with a handful of numbers all with true as the value. The function then checks the existence of an int in that map and return a true if it exists.