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 - "1 = 2"
-
I overheard this on my way back to home.
Girl 1: I bought a new phone yesterday.
Girl 2: Let me see it.
*hands over the phone*
Girl 2: There is no Instagram?
Girl 1: No, Instagram wasn't installed when I bought the phone.
Girl 2: That's weird.
*me almost dead*31 -
So I "grade" homework for programming 1 students...
Task was to produce an output like:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
...and this was committed!
I really had to hold back laughter...
This looks purposefully obfuscated...26 -
public boolean even( int num ) {
if ( num < 0 )
num = -1 * num;
while ( num > 1 )
num = num - 2;
if ( num == 0 )
return true;
else
return false;
}19 -
I'm stuck between 2 options:
1) Rant about my problems
2) Share DevRant with colleagues
Am I the only one with this problem? 😂16 -
Got 2 Computers and 2 Laptops
1 is using Elementary OS
1 is using Arch
1 is using Linux Mint
1 is using OSX
And 0 Windows
Feels good man!15 -
There are two types of people :
1. People who do backup
2. People who will start doing backup
Yesterday I advanced from type 2 to type 1 :-/9 -
Basic math class for devvys
Lemme prove that 2 = 1
a = b
a^2 = ab
a^2 - b^2 = ab - b^2
(a + b) (a - b) = b (a - b)
a + b = b
b + b = b
2b = b
2 = 1
Find a place where I got wrong...
And if you fall by this, you should go to preschool again18 -
1. Started to program Python 3
2. Thought of doing a little program just for fun
3. Now 1 1/2 years in developing state with nearly 3000 lines of code and 11 modules
4. Python skills :)14 -
Theres only 2 kinds of people in this world:
1. var username;
2. var user_name;
Hint: one of them will burn in hell57 -
I had 2 options.
Option 1: Read and increase knowledge.
Option 2: Take a sentence out of context and make a meme3 -
Try this line of javascript in a browser:
<pre id=p><script>n=setInterval("for(n+=7,i=k,P='p.\\n';i-=1/k;P+=P[i%2?(i%2*j-j+n/k^j)&1:2])j=k/i;p.innerHTML=P",k=64)</script>8 -
Idealistic goals:
1. Learn python
2. Start a project and see it through
Realistic goals:
1. Learn how to initialize variables in python
2. Make plans for 20192 -
1: Man did you see the latest windows build fucked up design?
2: What are you mean?
1: I MEAN NOT ALIGNING REFRESH BUTTON ESPECIALLY WHEN YOU PRESS IT.
2: What??? Where???5 -
Submitting long written text on browser.
Novice:
1. Type
2. Submit
Experienced:
1. Type
2. Ctrl+a Ctrl+c
3. Submit4 -
Overheard this conversation today:
1: look at this! My shiny new iPhone can measure stuff!
2: how accurate is it?
1: not very, it is pretty buggy.
2: how did the bugs get in there?
3: it is an apple so4 -
It was a basic java lesson. We had four values that we stored in a array. We had to make some calculations with the values. Then we had to sort those four values. That's the solution our teacher proposed:
if (arr[0] > arr[1]) {
int temp = arr[0];
arr[0] = arr[1];
arr[1] = temp;
}
if (arr[1] > arr[2]) {
int temp = arr[1];
arr[1] = arr[2];
arr[2] = temp;
}
if (arr[2] > arr[3]) {
int temp = arr[2];
arr[2] = arr[3];
arr[3] = temp;
}
if (arr[0] > arr[1]) {
int temp = arr[0];
arr[0] = arr[1];
arr[1] = temp;
}
if (arr[1] > arr[2]) {
int temp = arr[1];
arr[1] = arr[2];
arr[2] = temp;
}
if (arr[0] > arr[1]) {
int temp = arr[0];
arr[0] = arr[1];
arr[1] = temp;
}7 -
I just can't learn dance moves, every tutorial is like 1, 2, 3, 4 ... 1, 2, 3, 4 where's the freeken first step?5
-
I'm now typing clean code. [1]
And it shows - the code really looks better. [2]
.
.
.
.
[1] I cleaned my keyboard by removing every single key and wiping it with alcohol.
[2] After I bought a new monitor, that is.1 -
Want to piss off the person reviewing your PR?
don't just return true or false use 1 == 1 for true and 1 == 2 for false.
Watch the glorious rage unfolds 🤘🤘🤘6 -
Always answer these 2 questions in your commit message: (1) what will happen if this commit applied? (2) why this change is being made?2
-
How machine learning works,
Interviewer: What's your biggest strength?
Developer: I am a quick learner
Interviewer: what is 1 + 1
Developer: 30.
Interviewer: Not even close, Its 2.
Developer: 210 -
Ruby’s fanciness bit me in the butt today. It’s pretty rare, but often confusing AF when it happens.
array = [1, 2, 3, 4, 5, 6, 7]
array.count +1 +2
# => 1
What the fuck?
array.count +1 +2 +3
# => 1
What the fuck?
+1 +2 +3
# => 6
Okay.
(array.count +1 +2 +3)
# => 1
What the fuck?
(7 +1 +2 +3)
# => 13
Okay...
array.count + 1 + 2 + 3
# => 13
Alright, so spaces matter here...?
((array.count) +1 +2 +3)
# => 13
But not here!? ... Oh. I think I know what’s going on.
Array#count
Returns the number of elements. If an argument is given, counts the number of elements which equal it using ==
Well fuck me.
Ruby is seeing `array.count(+1+2+3)` instead of `array.count()+1+2+3` since `+1` is a value, not an operator followed by a value as is the case with `+ 1`.
Now, why was I using +1 +2 instead of adding some spaces like I normally would? So they would match what was in the comment next to them for easier reference. Heh.
Future dev, I did this for you! So this is all your fault. :|36 -
CS Exam :
What is 3/2?
My answer : 1.5
Result : Wrong
Correct Answer : 1
Maths Exam :
What is 3/2?
My answer : 1
Result : Wrong
Correct Answer : 1.5
#Frustated (-_-)4 -
At a job interview.
Them: Can you please write a function that calculates fibonacci numbers on the whiteboard please.
Me:
fib=_=>($=>$.round(($.pow((1+$.sqrt(5))/2,_)-$.pow(-2/(1+$.sqrt(5)),_))/$.sqrt(5)))(Math)18 -
how people count
normal people: 1 2 3 4 5 6....
me: 0 1 2 3 4 5 6...
them: wtf u doing, 0 is not included8 -
YOU: if(exp){ statement 1;} else { statement 2;}
v/s
THE GUY: exp ? Statement1 : statement 2;
She says not to worry about!!9 -
"We need you to give 110% so that the total is greater than the sum of the parts... Eg: 1 + 1 > 2"
You're addressing a team who use logic to make you money. What the fuck are we supposed to do with this shit?
1 + 1 > 2?
false
Fuck off.7 -
Every Group Project in CS Major
Group 1:- Hey group 2 what project are you making ..?
Group 2:- Can't tell , Top Secret
FINAL Day:-
Group 1:- Railway Ticket Booking System
Group 2:-Railway Ticket Authorization System
Evaluators :- I think I saw similar idea somewhere....😂3 -
1. have an exciting app idea
2. create project folder
3. include WebPack
…
47. lose all passion for project and give up
GOTO 11 -
For fucks sake if I send you a clearly described 5 step install instructions do not start on step 3! Yes you fucking moron instructions labeled 1,2,3,4,5 should be carried out one after the other! Not in random order.
Seriously, how deranged are you that you have never ever encountered a step-by-step instruction before?!
Don't give me that "oh, should I have started with step 1 first? You weren't very clear about that. I think it is a bit too complicated."
Here are some more instructions:
1. Close your PC
2. Donate it to someone with detectable IQ level
3. Go fuck yourself
4. Please die
5. Yes, start with step 15 -
Method 1:
1. Read others' people answers on wk70
2. Apply
3. ???
4. Profit
Method 2:
1. cd <ProjectName>
2. git init
3. dotnet new sln
4. dotnet new console #or webapi/lib
5. code .
6. git commit -m "Initial commit"
7. git remote add origin <github link>
8. git push origin master -u
9. profit1 -
story points that equate to hours.
1 = 1 hour
2 = 1-2 hours
3 = 3-4 hours
5 = 6-8 hours
8 = Kill. Me.
13 = Now.3 -
Before we started a new project, as a team, we set some ground rules like: frequent, small, digestible PRs.
PR#1: 52 files (week 1)
PR#2: 107 files (week 2)
JUST FUCK OFF MATE!!!2 -
DELETE FROM TABLE invoices.
The next week was spent inputing the data by hand because:
Who needs database back-ups?2 -
Guy 1: Can I come to your house
Guy 2: No don’t I don’t want to be ashamed by my fat mother
Guy 1: How fat is your mom
Guy 2: FAT 323 -
1. When you want Stickers, but things are actually going well and you have nothing to Rant about except
2. GOTO 12 -
Programmer 1: We have a problem
Programmer 2: Let’s use RegEx!
Programmer 1: Now we have two problems -
The debugging loop for Minecraft Spigot plugins on a 4GB RAM laptop:
1. Start Eclipse - 1'
2. Edit code.
3. Build plugins - 2'
4. Close Eclipse to make RAM room for Minecraft.
5. Upload plugins to server with FTP - 1'
6. Start server and launch Minecraft - 2'
7. Enter the server.
8. Find bugs.
9. Stop the server, close Minecraft.
[Go back to 1.]17 -
Searching for other occurrences of highlighted word in Android Studio
1 - highlight word
2 - CMD+F
3 - Enter
In Xcode
1 - highlight word
2 - CMD + C
3 - CMD + F
4 - CMD + V
5 - Enter4 -
Me: Which option would you like?
Option 1: £x.xx
Option 2: £x.xx
Client: Can we have all the functionality of option 2 but at option 1 price!1 -
People on devRant: "it took me 1/2/3 hours to fix that bug, omg, what a time waste!!"
Me: *wrestles some bugs for 1/2/3 DAYS*
I'm confused, how is fixing a bug within hours a ranting material...?11 -
!rant
User: "Hello, I'd like to hear a torrent joke."
Tracker: "I will refer you to people who can tell you a torrent joke."
Peer 1: "Why d"
Peer 2: "cken "
Peer 3: "road?"
Peer 4: "id th"
Peer 3: "cross"
Peer 1: "e chi"
Peer 5: " the "
Peer 2: "the o"
Peer 4: "To ge"
Peer 1: "side."
Peer 5: "ther"
Peer 2: "t to " -
If god was a programmer, do you think he made us like
int sex = rand()% 2+1;
if (sex == 1){
std::cout << “it’s a girl!”;
}
else if (sex == 2){
std::cout << “its a boy!”;
}17 -
My small collection
2 DD 8" floppy disks
2 MD 2-D 5" 1/4 floppy disks
2 HD 3" 1/2 floppy disks
1 Jaz disk
1 unassembled 3" 1/2 floppy disk
1 PalmOne sticker to learn the letters of Graffiti 2 (I had a M100, but I do not anything related to it anymore.)5 -
1- Copy/Paste (code)
1- Googling before trying to fix a bugs by myself first.
1- Never finish my side projects.
2- (Worst) Still doing all the above.3 -
Step 1: open CMD
Step 2: *color 2*
Step 3: *mode 1000*
Step 4: forget what you actually wanted to do -
I just want to mention some old software from 50 years ago that is running on Voyager 1 and 2 and needs to be maintained and cut due to nuclear power source depletion.
https://popularmechanics.com/space/...2 -
There are 2 types of bosses:
Type 1: Who think you are avoiding work
Type 2: Who are not your bosses -
How we click notifs in devRant.
1-1. SOMEONE mentioned you in a comment!
1-2. SOMEONE commented on your rant!
2. SOMEONE ++'d your rant!
.
.
.
.
.
.
.
.
999. SOMEONE ++'d your comment!
1000. One (or more) new comments on a rant/collab you commented on!
Sorry creators, but..... (silence, drops mic)1 -
Python: RandInt(0, 2) generates a random value between 0 and 2. Range(0, 2) generates a list of all numbers between 0 and 1. Boy, there's some consistent syntax.
-
there it is, couting with: 2 instantes of VisualStudio, 3 of chrome, 1 of firefox, 1 of gvim, 1 of notepad.exe, 1 of Spotify and 2 real notepads in the desk.
2 projects, 4 databases and 1 deadline tomorrow 😂.
man, the 2 monitor setup really helps, when you can, go get one for yourself.3 -
Come up with a bad version of flipping a bool's value. (value = !value)
I'll start with a bad way of doing it in C# (.NET):
char[] bca = boolWert.ToString();
if (bca.Length == 4 && bca[0] == 't' && bca[1] == 'r' && bca[2] == 'u' && bca[3] == 'e')
{
boolWert = !bool.Parse($"{bca[0]}{bca[1]}{bca[2]}{bca[3]}");
}
else if (bca.Length == 5 && bca[0] == 'f' && bca[1] == 'a' && bca[2] == 'l' && bca[3] == 's' && bca[4] == 'e')
{
boolWert = !bool.Parse($"{bca[0]}{bca[1]}{bca[2]}{bca[3]}{bca[4]}");
}
else throw new Exception("y e s");4 -
I swear my brain has 2 sides:
1: c or c++ would be great for this project
2: lol c++ hard so nodejs
1: but c++ would be so much faster and c-
2: NODEJS6 -
[Me at night]
1 Me: should I sleep?
2 Brain: right after finishing this module
3 Me: <drinking coffee>
4 goto 16 -
char *screw={'1','2'};
char **This={screw+1,screw+2}
char ***Shit=This
printf("%s ", *--*++Shit+1);
Exactly4 -
When you're reviewing code and you find:
switch(intIn) {
case 1:
serial.println("1");
break;
case 2:
serial.println("2");
break;
case 3:
serial.println("3");
break;
etc
case 123:
serial.println("Correct response ");
break;1 -
Ionic 1
For ionic push notification which is best
(1) Onesignal push notification
(2) Cordova plugin push notification
.? -
Dear devRant,
when my ++'s finally reach 2^32-1, or let it be 2^64-1, the next inc. will better make it -2^32 or -2^64 because tHAT IS HOW IT WORKS AND THAT IS WHAT I WOULD EXPECT4 -
Best explanation of callback from Stackoverflow:
Guy 1 to Guy 2: Hey dude I wanna do something when a user clicks in there, call me back when that's happens alright?
Guy 2 calls back Guy 1 when a user clicks here -
// Task: add one to the input number
// Sane people:
// print(int(input())+1)
// Me:
n = [*(reversed(bin(int(input()))[2:]))]
tmp = ""
for i in range(len(n)):
tmp = n[i]
tmp = "1" if tmp == "0" else "0"
n[i] = tmp
if tmp == "1":break
if tmp == "0":n+=["1"]
n = "".join(reversed(n))
n = int(n,2)
print(n)7 -
Me - 1+1 is 2
Client : Did you say 1+1 is 2
Because even i thought 1+1 is 2 and i think we should go ahead with 1+1 2 because that seems like a good thing to me.
***"1+1 is 2" can be replaced by some long tech discussion
#my brain hurts3 -
When writing code that has to be evaluated by a college prof, redirect all the best practices to /dev/null2
-
2 in 1 Rant: When your deployment process isn't automated and consists of copying and pasting between servers (1) and the "implementer" of this "deployment" STILL messes up the copying and pasting (2). How?!2
-
Today's conversation in our odc
Person 1: Jenkins Down
Person 2: YouTube or Facebook
Person 1: No... Twitter
Person 2: Gud it means you guys are not blocked...
Awesome troll...
😂 😂 😂 -
1. Hard reset his Android phone
2. Install the same junk apps again
3. Complain why the phone is lagging
4. goto 1.1 -
Finishing the whole front end for a pretty big site in 2 hours with 2 people and only 1 knows HTML and CSS2
-
Epic comment:
1+2+3+4+....infinity = -1/12
SRC: Numberphile
Dear god, id like to file a bug report(see attached video)6 -
1. Wrote super complex snippet w/o comments.
2. Commit & push.
3. Read code after 1 month
4. Ask yourself how you wrote that.1 -
Fuck me sideways, it took me so long to figure out what caused a certain bug. Thanks python
>>> list = [[0] * 2] * 2
>>> list
[[0, 0], [0, 0]]
>>> list[0][0] = 1
>>> list
[[1, 0], [1, 0]]9 -
// Posting this as a standalone rant because I've written the best piece of code ever.
// Inspired by https://devrant.com/rants/1493042/... , here's one way to get to number 50. Written in C# (no, not Do diesis).
int x = 1;
int y = x + 1;
int z = y + 1;
int a = z + 1;
int b = a + 1;
int c = b + 1;
int d = c + 1;
int e = d + 1;
int f = e + 1;
int g = f + 1;
int h = g + 1;
int i = h + 1;
int j = i + 1;
int k = j + 1;
int l = k + 1;
int m = l + 1;
int n = m + 1;
int o = n + 1;
int p = o + 1;
int q = p + 1;
int r = q + 1;
int s = r + 1;
int t = s + 1;
int u = t + 1;
int v = u + 1;
int w = v * 2 * -1; // -50
w = w + (w * -1 / 2); // -25
w = w * -1 * 2; // 50
int addition = x+y+z+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v;
addition = addition * 2;
if (addition == w)
{
int result = addition + w - addition;
Console.Writeline(result * 1 / 1 + 1 - 1);
}
else
{
char[] error = new char[22];
error[0] = 'O';
error[1] = 'h';
error[2] = ' ';
error[3] = 's';
error[4] = 'h';
error[5] = 'i';
error[6] = 't';
error[7] = ' ';
error[8] = 'u';
error[9] = ' ';
error[10] = 'f';
error[11] = 'u';
error[12] = 'c';
error[13] = 'k';
error[14] = 'e';
error[15] = 'd';
error[16] = ' ';
error[17] = 'u';
error[18] = 'p';
error[19] = ' ';
error[20] = 'm';
error[21] = '8';
string error2 = "";
for (int error3 = 0; error3 < error.Length; error3++;)
{
error2 += error[error3];
}
Console.Writeline(error2);
}5 -
TIL that in JavaScript [1, 2, ] gives you a 2 elements array, while [, 1, 2] gives you a 3 elements array
WTF JavaScript???7 -
How the fuck 4 months of design(2 designers) can be developed with 2 months of development work. (1 developer)
BRILLIANT PROJECT MANAGEMENT IDEA6 -
2 interviews today, 2 tomorrow and 1 on Friday.
I've only been put on gardening leave on Monday. Things are going well.3 -
"Sweet, I fixed story 1 and can commit! ...but issue 2 is pretty small, let me just work on that first so there's 1 pull request".
4 hours later, issue 2 not done yet, and I can't push push story 1 to QA until I finish it. I really need to stop doing that.4 -
Add 1 - Remove 2
-implement-
Why did you add this?
Alright - Remove 1 and Add 2.
-implement-
I like what you did with 1 but I'm not sure about what you did here with 2.
-wait...wait...wait...-
Hey, just noticed the way you had 1 and 2 before you started making a bunch of unnecessary changes was better, go back to that.
Peer reviews are awesome! -
1. Think about it.
2. Get super hyped.
3. Tell everyone.
4. Go to step 1.
5. Plan it
6. Execute
7. Profit.3 -
There are only 2 hard problems in software:
1. Naming things
2. Cache invalidation
3. Off by 1 errors3 -
Heroku/Render
Deploy 2 apps
app #1 sends request to app #2 every minute
app #2 sends request to app #1 every minute
they never sleep
profit?5 -
1. Make change
2. Restart backend
3. Doesnt work
---
1. No changes
2. Restart backend again
3. Works
FUCK OFFFFFF7 -
heres something interesting:
The golden ratio is 1.618...
If you're not familiar with it, doing 1/goldenratio
the result is 0.618...
It gives you back the float component exactly.
Discovered that it is actually part of a series.
First of all:
2-(((5-sqrt(5))/2)-1) =
1.618033988749895 -> thats our golden ratio
In other words:
(2%gold) =
0.381966011250106
While:
((5-sqrt(5))/2) =
1.381966011250105
Ok, now we're getting somewhere. We can turn these into variables
First of all, lets see if we can get the golden ratio back out:
2-(((5-sqrt(5))/2)-1) = 1.618033988749895
Okay good.
The formula looks something like
j-(((i-sqrt(i))/2)-1)
Where j = (i*2)+1
That means we can easily figure out what j we need from our i value. (i-1)/2 = j
We run it back far enough we get
1-(((3-sqrt(3))/2)-1) =
1.3660254037844386
Thats the golden ratios little brother. Doesn't look anything like it, but it is part of the series.
And I found a boat load of research documents scattered *all* over the net, where this number and others in the series inexplicably crop up in power series, in chemistry, and elsewhere. Just looks like random floats if you don't know better.
We can actually go lower in the series:
0.5-(((2-sqrt(2))/2)-1)
1.2071067811865475
At the lowest positive value for j, we get
0-(((1-sqrt(1))/2)-1) = 1
It's kinda elegant.
I even wrote a little script to do the conversions:
def gr(k):
....i = k
....j = (i-1)/2
....return j-(((i-sqrt(abs(i)))/2)-1)
The dots are so devrant doesn't break pythons formatting.3 -
Work log..
Day 1
1) Starts a new project.
2) Can't connect windows machine to the new router.
3) Wastes one day connecting.
Day 2
1) Switched to Linux (dual boot).
2) Parrot OS sound issue, don't know why.
3) Fixed the issue, upgraded the system. No brain fucked.
4) Sets up Dev Environment, Starts the project.
5) All this in 4 hrs.
#DumbWndows
Now, I'm staying here. #LoveLinux2 -
Today's achievement: wrote game of life in K3.
neigh:{(+/,/-1 0 1!'\:/:-1 0 1!\:x)-x}
life:{(x*2=neigh x)|3=neigh x}15 -
### Functions ###
range = $(if $(filter $1,$(lastword $3)),$3,$(call range,$1,$2,$3 $(words $3)))
make_range = $(foreach i,$(call range,$1),$(call range,$2))
equal = $(if $(filter-out $1,$2),,$1)
### Variables ###
limit := 101
numbers := $(wordlist 2,$(limit),$(call range,$(limit)))
threes := $(wordlist 2,$(limit),$(call make_range,$(limit),2))
fives := $(wordlist 2,$(limit),$(call make_range,$(limit),4))
fizzbuzz := $(foreach v,$(numbers),\
$(if $(and $(call equal,0,$(word $(v),$(threes))),$(call equal,0,$(word $(v),$(fives)))),FizzBuzz,\
$(if $(call equal,0,$(word $(v),$(threes))),Fizz,\
$(if $(call equal,0,$(word $(v),$(fives))),Buzz,$(v)))))
### Target ###
.PHONY: all
all: ; $(info $(fizzbuzz)) -
PHP
It stands for PHP Hypertext Preprocessor? The definition of itself is a stack overflow?
Also, (1+1) . 2 = "22"?
Please, somebody....10 -
!rant
Just completed Monkey Island 1 and 2 again, 30+ years after I last played them.
1. What an awesome blast from the past
2. I am getting old.......
3. Can't wait for Monkey Island 3 (the real third)4 -
ranters! who knows what this is ?
0 = Ø
1 = { 0 } = {Ø}
2 = { 0, 1 } = { Ø, {Ø} }
3 = { 0, 1, 2 } = { Ø, {Ø} , {Ø, {Ø}} }
4 = { 0, 1, 2, 3 } = { Ø, {Ø}, {Ø, {Ø}}, {Ø, {Ø}, {Ø, {Ø}}} }10 -
When you write print(string), which type of people are you:
A) 1. ( 2. string 3. )
B) 1. () 2. string
C) Autocomplete guys
D) hodor
*applies for echo, printf, println, etc.
** python2 and c++ are discriminated on purpose9 -
So in Ruby, everything is passed to functions by value. However, when you manipulate objects, you're actually manipulating references. A simple example:
```
a = [3]
b = a
c = a
b.push(2)
print a
print b
print c
# => [3, 2][3, 2][3, 2]
```
Here's a more complicated example from the problem I was solving:
```
table = Array.new(5) { Array.new() }
1.upto(5 - 1) do |i|
1.upto(5 - 1) do |j|
table[i] = table[j]
end
table[i] << rand(1..6)
end
```
I have been running around in circles this morning because I forgot that. This makes C++ for example, more clear than Ruby since C++ explicitly shows the intent to the programmer.5 -
Probably pure coincidence but if you look at the deconstruction of the dedekinds like so:
>>> decon(6)
offset: 1, exp: [[Decimal('2'), Decimal('1')], [Decimal('3'), Decimal('1')]]
>>> decon(20)
offset: 2, exp: [[Decimal('2'), Decimal('2')], [Decimal('5'), Decimal('1')]]
offset: 1, exp: []
>>> decon(168)
offset: 3, exp: [[Decimal('2'), Decimal('2')], [Decimal('5'), Decimal('2')]]
offset: 2, exp: [[Decimal('2'), Decimal('2')], [Decimal('3'), Decimal('1')], [Decimal('5'), Decimal('1')]]
offset: 1, exp: [[Decimal('2'), Decimal('3')]]
>>> decon(7581)
offset: 4, exp: [[Decimal('2'), Decimal('3')], [Decimal('5'), Decimal('3')], [Decimal('7'), Decimal('1')]]
offset: 3, exp: [[Decimal('2'), Decimal('2')], [Decimal('5'), Decimal('3')]]
offset: 2, exp: [[Decimal('2'), Decimal('4')], [Decimal('5'), Decimal('1')]]
offset: 1, exp: []
>>> decon(7828354)
offset: 7, exp: [[Decimal('2'), Decimal('6')], [Decimal('5'), Decimal('6')], [Decimal('7'), Decimal('1')]]
offset: 6, exp: [[Decimal('2'), Decimal('8')], [Decimal('5'), Decimal('5')]]
offset: 5, exp: [[Decimal('2'), Decimal('5')], [Decimal('5'), Decimal('4')]]
offset: 4, exp: [[Decimal('2'), Decimal('6')], [Decimal('5'), Decimal('3')]]
offset: 3, exp: [[Decimal('2'), Decimal('2')], [Decimal('3'), Decimal('1')], [Decimal('5'), Decimal('2')]]
offset: 2, exp: [[Decimal('2'), Decimal('1')], [Decimal('5'), Decimal('2')]]
offset: 1, exp: [[Decimal('2'), Decimal('2')]]
>>> decon(d('2414682040998'))
offset: 13, exp: [[Decimal('2'), Decimal('13')], [Decimal('5'), Decimal('12')]]
offset: 12, exp: [[Decimal('2'), Decimal('13')], [Decimal('5'), Decimal('11')]]
offset: 11, exp: [[Decimal('2'), Decimal('10')], [Decimal('5'), Decimal('10')]]
offset: 10, exp: [[Decimal('2'), Decimal('11')], [Decimal('5'), Decimal('9')]]
offset: 9, exp: [[Decimal('2'), Decimal('9')], [Decimal('3'), Decimal('1')], [Decimal('5'), Decimal('8')]]
offset: 8, exp: [[Decimal('2'), Decimal('10')], [Decimal('5'), Decimal('7')]]
offset: 7, exp: [[Decimal('2'), Decimal('7')], [Decimal('5'), Decimal('6')]]
offset: 6, exp: []
offset: 5, exp: [[Decimal('2'), Decimal('6')], [Decimal('5'), Decimal('4')]]
offset: 4, exp: []
offset: 3, exp: [[Decimal('2'), Decimal('2')], [Decimal('3'), Decimal('2')], [Decimal('5'), Decimal('2')]]
offset: 2, exp: [[Decimal('2'), Decimal('1')], [Decimal('3'), Decimal('2')], [Decimal('5'), Decimal('1')]]
offset: 1, exp: [[Decimal('2'), Decimal('3')]]
the powers in the 2's column go:
1, 2, 2, 2, 3, 3, 2, 4, 6
which are predicted by:
https://oeis.org/search/...
Again, probably only a coincidence, but kinda beautiful.2 -
Saw the following SQL in an SP at work:
Type_ID = CASE Product.Type_ID
WHEN 1 THEN 1
WHEN 2 THEN 1
WHEN 3 THEN 2
WHEN 4 THEN 3
END
Seems a little bit redundant to me :-)...1 -
On one side, I don't want devs in my firm to know about devRant //Coz they know my %Username%
But on the other side, the more, the merrier.. I could rant about stuff with all those I work with..3 -
I am introducing the Thunderdome policy:
2 Tickets enter 1 Ticket leaves. (Aka 1 Ticket gets worked on the other one gets deleted.) -
Not nice, Plug… not nice! You define a Plug Module with 2 functions (init/1 & call/2) and the result of init/1 is passed in as the second argument of call/2… but init/1 is executed in compile time and call/2 in runtime.
WHY?!?!
I can't think of any other behavior that… well… behaves that way!
It's not even in the official docs (¬_¬)1 -
Angular 1.x V Angular 2 ! Which one do you prefer ?
Saw the enhancements in V.2 they are way off the initial base ...6 -
!rant
GRUB_INIT_TUNE="300 369 2 329 2 82 1 0 2 82 1 92 1 98 1 0 1 130 1 0 1 123 7"
"Feel Good Inc" - Gorillaz up to the second "feel good"1 -
Scenario 1) Server -> proxy -> client
Scenario 2) Server -> proxy -> 2nd proxy -> client
Scenario 1 works on some web browsers
Scenario 2 always works3 -
Since finally fixing my email server I keep periodically getting emails with random subjects like "asdfasdfasdf" from all my test messages...
-
This morning, I tried to abstract myself from my computer while trying to calculate sqrt(1.81).
I came up with what I thought to be a genius method. I tried to find B such as (1+B)^2=1.81. Then I ended up calculating the discriminant of 1+2B+B^2 and had 4*1.81. Sounded funny at first, but upon calculating the positive solution amongst the 2 possible ones, I ended up with (-2+2sqrt(1.81))/2 = ... sqrt(1.81)-1. Upon replacing in the initial equation, one gets (1+sqrt(1.81)-1)^2 = (sqrt(1.81))^2 = 1.81.
I'm sorry for having let you down, dear pasokon. Please forgive me.2 -
I've got 4 different cPanel's, 1 Heroku, 2 WordPress hostings, 1 student AWS and I still do not know how to manage
-
This is how my AntLang code looks like:
repeat[{echo',|{[+]<x*2>,(4le+)take(0eq(x\4)mod 6)take<(+\1)%3>}'x};{1};<1>]
:D -
What we should do:
1. Find problem
2. Stop debugger
3. Change code
4. Restart debugging
What we all do:
1. Find problem
2. Forget about the debugger and change code immediately
3. Stop and Restart debugging -
Gonna buy a "cheap" mechanical keyboard...
Which one of these :
1. https://amazon.com/Redragon-KUMARA-...
2. https://amazon.com/dp/B01M0QEYR4/...3 -
Just started feeling productive in angular 1...now angular 2 is here. Should I leave it all and move to angular 2 or keep learning and improving myself in angular 1?6
-
What theme do you use?
1. Light
2. Dark
How often do you get a headache?
1. Once a month
2. Once a week
3. Once a day
What other factors do you think is causing you headaches?12 -
If there is tech support that is just plain awesome, it these:
1) Namecheap
2) Newegg
3) Nyko
The ones that are meh include:
1) Linksys
2) AOL
3) Microsoft9 -
DailyCodingProblem: #1
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
For example, if our input was [1, 2, 3, 4, 5], the expected output would be [120, 60, 40, 30, 24]. If our input was [3, 2, 1], the expected output would be [2, 3, 6].
this is my quickly solution in php:
$input_array = [1, 2, 3, 4, 5];
echo('INPUT ARRAY:');
print_r($input_array);
echo("<br/>");
foreach($input_array as $key => $value){
$works_input_array = $input_array;
unset($works_input_array[$key]);
$result[] = array_product($works_input_array);
}
echo('OUTPUT ARRAY:');
print_r($result);
outpout:
INPUT ARRAY:Array ( [0] => 3 [1] => 2 [2] => 1 )
OUTPUT ARRAY:Array ( [0] => 2 [1] => 3 [2] => 6 )5 -
so... self-referential arrays.
do you know any languages that have them? thoughts?
what I mean is (in pseudo-c# syntax) :
string[] r = new string[]{ "1", "2", self[0] + " and " + self[1] };
which would result in an array with items:
1
2
1 and 29 -
Best Linux distro for a 2-in-1 laptop that I also want to use as a tablet? Are there any that can run Android apps natively (like ChromeOS but not ChromeOS because I also wanna do dev)?2
-
For web automation, what do you prefer?
1. Playwright
2. Puppeteer
3. Selenium
4. Something else
&
1. Python
2. TypeScript
3. JavaScript
4. Something else9 -
The credit card autocomplete function of Google chrome issues TWO bank statements each autocomplete. 1. -1$ 2. +1$ :/
-
People hate on Python a lot. I just used the Python ternary operator for the first time. I found it easier to read than the C++ ternary operator:
0 if i==0 else 2 if i==segmentMax-1 else 1
vs
i==0 ? 0 : i==segmentMax-1 ? 2 : 1
I think Python did a good job in this case.18 -
Funny conversation I overheard while buying groceries ..
Person 1: why is it, programmers always seem so sad, negative.. Depressed?
Person 2: well, the less you know the happier you go.
Take a look at retards.
Person 1: sigh. I want to be happy.
Person 2: Remove your lust and you're left with happy.
Person 1: wut?
Person 2: look at that retard over there, shouting happy by itself.
Person 1: I see. But how would I apply it.
Person 2: well, I don't think shouting like that retard requires much application.
Person 3(me): don't worry, be happy. -
Heard while playing Clue:
Person 1: It was the Jamaican, with the spear, in the jungle.
Person 2: What Jamaican?
Person 1: Trouble... -
Merging datas using spark sql with two conditions.
my code:
1.merge with first condition
2.merge with second condition
3. 1.unionall(2)
This gives some extra datas(total=10000 and result=10220)
$better way?any way? -
Achieved a 2:2 in computer science and graduating (got interviews with for some jobs). I have some sits in some modules, which could change my grade to a 2:1.
From a company point of view, is it worth going for the 2:1? Will it open more jobs / better salary straight away? Or shall I go for the first job offered with the 2:2 I got.7 -
1. Enter repository of proprietary Node package that you maintain
2. Run `npm outdated | tail -n +2 | awk '{ print "npm i " $1 "@latest" }' | bash`
3. push to master3 -
What kind of developer you are? What you write first LHS or RHS while assigning values?
Step 1: a+b
Step 2 : const a = a+b;
or
Step 1: const a;
Step 2 : const a = a + b;23