Ranter
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
Comments
-
Aaronz2697yWhy do I have the feeling that your one of the devsπ€? and that your promoting you're app? anyway it seems to be a good appπ keep up the work.
-
hacker17657yπ
Takes me a minimum of five tries to solve a simple math problem in the morning haha.. -
xenira7407ySleep as android supports qr code and nfc tag since like forever.
Saved me a couple of times, as I just can't get out of bed. Now there is a QR code in my bathroom. -
With a few phones I couldn't get a keyboard behind the lockscreen so had to force reboot the fucker to get it silently.
-
hacker17657y@coolq
let x = 1,
y = [2, 0, 0];
let answers = y.map((x) => x + 2);
console.log(answers);
// sorry >:) -
-
I think I should really give this app a try.
But something also tells me that this a reaaaaaly bad idea πππ -
But what happens if you forget about the alarm after waking up early. Like how to find the fridge to take a photo when your in a train. Shit can get embarrassing.
-
@Hammster true. But Math stuff is possible everywhere. Or shaking your phone for a while. Surely looks funny tho xD
-
@BambuSource jerking your phone in public like a maniac could get you in even more trouble. Especially as male. xD
-
@BambuSource call me biased, but people would call-out a man shaking his phone in near to kindergarten kids more then a woman would.
I did not exclude women though since this looks still retarded as fuck :P -
I need a reverse alarm clock which forces me to fall asleep on time more than I need an alarm clock.
-
LuPaw6037yThe app I'm using genereates a 10 digit captcha for me to type in. That works for me ^^
-
@Kushtrim this app doesn't allow this. you can't even uninstall it if this feature is activated
-
coolq48207y@JFK422
Haha, nice.
@hacker
# Lexical Analysis,
def lex(code):
code = code.replace('(', ' ( ')
code = code.replace(')', ' ) ')
return [x for x in code.split(' ') if x]
# Parsing stage,
def parse(tokens):
tree = []
stack = []
work = tree
for token in tokens:
if token == '(':
work += [[]]
stack += [work]
work = work[-1]
elif token == ')':
work = stack.pop()
else:
work += [token]
return tree
def evaluate(ast):
for token in ast:
if type(token) is list:
return evaluate(token)
elif token.isdigit():
return int(token)
elif token == '+':
return sum(evaluate([x]) for x in ast[1:])
code = '(+ 1 1)'
print(evaluate(parse(lex(code))))
# Sorry x)
P.S: Made this on the spot π -
coolq48207y@hacker
So there's three stages going on here.
1). Lexing(breaking the code up into tokens or symbols)
2). Parsing (build an abstract syntax tree. For now you can think of it like a multi dimensional array, but each dimension is made from the '(' and ')' )
3). Evaluation (walk through the abstract syntax tree, and evaluate each symbol recursively)
The best way to find out how this works is to isolate each function. Find out what each one does and produces. Then try and run though the program like a computer. You'll learn a lot! -
hacker17657y@coolq ah, I see. What is the point of "lexical code analysis"?
What is its objective? -
coolq48207y@hacker
Lexical Analysis is just turning a string:
"(+ (+ 1 1) 1)"
into a list:
['(', '+', '(', '+', '1', '1', ')', 1', ')']
Parsing is just turning this:
['(', '+', '(', '+', '1', '1', ')', 1', ')']
Into:
[
[
+,
[
+,
1,
1
],
1
]
]
And for the evaluation stage:
Sees: [...].
Runs itself on that.
Sees: + [...] 1
Runs itself on argument 1
Sees: + 1 1
Adds them together and returns the value
Sees: + 2(returned value) 1
Adds them together and returns
Then we have 3 and we return that into the print statement which then prints the "3" in this case.
Note that the [...] is just a list, couldn't be bothered to write all the elements π -
Mitiko62057y@ThatDude Thanks!
@BambuSource A link: https://play.google.com/store/apps/...
Also the one you posted is paid in my country -
@Hammster it happened to me. I was on a bus. I had to remove the battery of my phone π
Related Rants
Hands up, who actually uses this shit?
Seriously, this is one of the most innovative apps I've used in the past year. The developer must be having fun torturing hundreds of people every day. But fuck this shit, it works (and most alarm clocks didn't work for me)
undefined
alarm clock
alarmy
β°
i'm already awake for too long
fuck this
i need sleep