#functioncal
Explore tagged Tumblr posts
Note
1 - 7 for the munday meme! @a-hell-of-a-time
♡ Munday Meme ♡
1. When did you start writing on Tumblr?
I started writing on tumblr somewhere around 2008 or 2009? Roughly! I was still in school at the time, haha!
2. Who was your first muse?
My first muse ever was probably Beast Boy, I think? From Teen Titans [ the Cartoon Network show ] ; my first muse here was Integra Hellsing!
3. Who are your longest rp friends?
Daemion & Dahlia! ♡ They're not very active at the moment but I love them to pieces and met them a long time ago, when I was in another fandom. We've been friends for 12+ years now and even spend some holidays together when we can!
4. Favourite thing about roleplaying?
Believe it or not, role-playing is how I relax. It makes me feel good and brings me so much joy! Though my truly favorite thing is the friendships I get to make along the way! ♡
5. Least favourite thing about roleplaying?
Why is there daaramaaa. . . ? Most of us should be adults esp since HH & HB are adult shows. Come ooonnn, i wanna crryyy. Also, how come people are being held accountable for the actions of fictional things like they've committed the crimes themselves? Why is it being overcomplicated? I'm just here to have fun and vibe 😭
6. OTP for your muse?
Stolas x Therapy pls. I mean — Stolitz. For now.
7. NOTP for your muse?
I haven't given NOTPs much thought, tbh. I don't ship Stolas with most ladies, if that counts? I mean, I accept Stella coz she's canon. Plus, I am biased towards the exploration of their dynamics and enjoy the chaos and pestering between my Stolas and Kraehe's Stella! I'll need to annoy her again soon.
#✧・゚・゚✧ | ☾ | : jude answers.#✧・゚・゚✧ | ☾ | : munday.#ahellofatime#a-hell-of-a-time#i cant think of opts and notps without being given names for some reason ??? like brain#doesnt functionc#i can answer that for Integra easily! lol but not so much Stolas
2 notes
·
View notes
Text

What is ISR?
.
.
.
.
for more information
check the above link
#isr#functioncal#clientos#serveros#ubuntu#kubuntu#hostos#guestos#process#program#swapping#contextswitching#preemptivsheduling#logicaladdress#virtualmemory#computerscience#javatpoint
0 notes
Video
youtube
Maximum Repeatability Playlist #36 with 129 plays!
CARNIVAL NIGHT part2 by 嵐 (From 9:02)
#video#arashi#carnival night part2#top 100#i could not for the life of me find an actual video#especially that the tumblr video functionc an use#dammit again arashi
0 notes
Photo

trippy treat in all forms and strains
0 notes
Text
YXTX Mini Portable Washing Machine, Manual Non-Electric and Clothes Dryer Compact Laundry
YXTX Mini Portable Washing Machine, Manual Non-Electric and Clothes Dryer Compact Laundry
Price: (as of – Details) Special instructions on the use of the handle:A: The basic type of mobile phone cleaning: The main function is dehydration B: The upgraded mobile phone cleaning: both With cleaning function and dehydration functionC: Dear friends, don’t lift the white coat when using the handle, because once the coat is lifted, the handle will lose protection and the plastic inside is…

View On WordPress
0 notes
Text
CISSP PRACTICE QUESTIONS – 20210915
CISSP PRACTICE QUESTIONS – 20210915
The board of directors is discussing the organization of security function and its relation with the audit function. Which of the following is the most accepted practice? (Wentz QOTD)A. The security function should comprise internal auditsB. The audit function should include the security functionC. The audit committee shall govern the security functionD. The security function may be managed by…

View On WordPress
0 notes
Text
Mastering Async Await in Node.js
In this article, you will learn how you can simplify your callback or Promise based Node.js application with async functions (async/await).
Whether you’ve looked at async/await and promises in javascript before, but haven’t quite mastered them yet, or just need a refresher, this article aims to help you.
A note from the authors:
We re-released our number one article on the blog called "Mastering Async Await in Node.js" which has been read by more than 400.000 developers in the past 3 years.
This staggering 2000 word essay is usually the Nr. 1 result when you Google for Node.js Async/Await info, and for a good reason.
It's full of real-life use cases, code examples, and deep-diving explanations on how to get the most out of async/await. Since it's a re-release, we fully updated it with new code examples, as there are a lot of new Node.js features since the original release which you can take advantage of.
What are async functions in Node?
Async functions are available natively in Node and are denoted by the async keyword in their declaration. They always return a promise, even if you don’t explicitly write them to do so. Also, the await keyword is only available inside async functions at the moment - it cannot be used in the global scope.
In an async function, you can await any Promise or catch its rejection cause.
So if you had some logic implemented with promises:
function handler (req, res) { return request('https://user-handler-service') .catch((err) => { logger.error('Http error', err); error.logged = true; throw err; }) .then((response) => Mongo.findOne({ user: response.body.user })) .catch((err) => { !error.logged && logger.error('Mongo error', err); error.logged = true; throw err; }) .then((document) => executeLogic(req, res, document)) .catch((err) => { !error.logged && console.error(err); res.status(500).send(); }); }
You can make it look like synchronous code using async/await:
async function handler (req, res) { let response; try { response = await request('https://user-handler-service') ; } catch (err) { logger.error('Http error', err); return res.status(500).send(); } let document; try { document = await Mongo.findOne({ user: response.body.user }); } catch (err) { logger.error('Mongo error', err); return res.status(500).send(); } executeLogic(document, req, res); }
Currently in Node you get a warning about unhandled promise rejections, so you don’t necessarily need to bother with creating a listener. However, it is recommended to crash your app in this case as when you don’t handle an error, your app is in an unknown state. This can be done either by using the --unhandled-rejections=strict CLI flag, or by implementing something like this:
process.on('unhandledRejection', (err) => { console.error(err); process.exit(1); })
Automatic process exit will be added in a future Node release - preparing your code ahead of time for this is not a lot of effort, but will mean that you don’t have to worry about it when you next wish to update versions.
Patterns with async functions
There are quite a couple of use cases when the ability to handle asynchronous operations as if they were synchronous comes very handy, as solving them with Promises or callbacks requires the use of complex patterns.
Since [email protected], there is support for async iterators and the related for-await-of loop. These come in handy when the actual values we iterate over, and the end state of the iteration, are not known by the time the iterator method returns - mostly when working with streams. Aside from streams, there are not a lot of constructs that have the async iterator implemented natively, so we’ll cover them in another post.
Retry with exponential backoff
Implementing retry logic was pretty clumsy with Promises:
function request(url) { return new Promise((resolve, reject) => { setTimeout(() => { reject(`Network error when trying to reach ${url}`); }, 500); }); } function requestWithRetry(url, retryCount, currentTries = 1) { return new Promise((resolve, reject) => { if (currentTries <= retryCount) { const timeout = (Math.pow(2, currentTries) - 1) * 100; request(url) .then(resolve) .catch((error) => { setTimeout(() => { console.log('Error: ', error); console.log(`Waiting ${timeout} ms`); requestWithRetry(url, retryCount, currentTries + 1); }, timeout); }); } else { console.log('No retries left, giving up.'); reject('No retries left, giving up.'); } }); } requestWithRetry('http://localhost:3000') .then((res) => { console.log(res) }) .catch(err => { console.error(err) });
This would get the job done, but we can rewrite it with async/await and make it a lot more simple.
function wait (timeout) { return new Promise((resolve) => { setTimeout(() => { resolve() }, timeout); }); } async function requestWithRetry (url) { const MAX_RETRIES = 10; for (let i = 0; i <= MAX_RETRIES; i++) { try { return await request(url); } catch (err) { const timeout = Math.pow(2, i); console.log('Waiting', timeout, 'ms'); await wait(timeout); console.log('Retrying', err.message, i); } } }
A lot more pleasing to the eye isn't it?
Intermediate values
Not as hideous as the previous example, but if you have a case where 3 asynchronous functions depend on each other the following way, then you have to choose from several ugly solutions.
functionA returns a Promise, then functionB needs that value and functionC needs the resolved value of both functionA's and functionB's Promise.
Solution 1: The .then Christmas tree
function executeAsyncTask () { return functionA() .then((valueA) => { return functionB(valueA) .then((valueB) => { return functionC(valueA, valueB) }) }) }
With this solution, we get valueA from the surrounding closure of the 3rd then and valueB as the value the previous Promise resolves to. We cannot flatten out the Christmas tree as we would lose the closure and valueA would be unavailable for functionC.
Solution 2: Moving to a higher scope
function executeAsyncTask () { let valueA return functionA() .then((v) => { valueA = v return functionB(valueA) }) .then((valueB) => { return functionC(valueA, valueB) }) }
In the Christmas tree, we used a higher scope to make valueA available as well. This case works similarly, but now we created the variable valueA outside the scope of the .then-s, so we can assign the value of the first resolved Promise to it.
This one definitely works, flattens the .then chain and is semantically correct. However, it also opens up ways for new bugs in case the variable name valueA is used elsewhere in the function. We also need to use two names — valueA and v — for the same value.
Are you looking for help with enterprise-grade Node.js Development? Hire the Node developers of RisingStack!
Solution 3: The unnecessary array
function executeAsyncTask () { return functionA() .then(valueA => { return Promise.all([valueA, functionB(valueA)]) }) .then(([valueA, valueB]) => { return functionC(valueA, valueB) }) }
There is no other reason for valueA to be passed on in an array together with the Promise functionB then to be able to flatten the tree. They might be of completely different types, so there is a high probability of them not belonging to an array at all.
Solution 4: Write a helper function
const converge = (...promises) => (...args) => { let [head, ...tail] = promises if (tail.length) { return head(...args) .then((value) => converge(...tail)(...args.concat([value]))) } else { return head(...args) } } functionA(2) .then((valueA) => converge(functionB, functionC)(valueA))
You can, of course, write a helper function to hide away the context juggling, but it is quite difficult to read, and may not be straightforward to understand for those who are not well versed in functional magic.
By using async/await our problems are magically gone:
async function executeAsyncTask () { const valueA = await functionA(); const valueB = await functionB(valueA); return function3(valueA, valueB); }
Multiple parallel requests with async/await
This is similar to the previous one. In case you want to execute several asynchronous tasks at once and then use their values at different places, you can do it easily with async/await:
async function executeParallelAsyncTasks () { const [ valueA, valueB, valueC ] = await Promise.all([ functionA(), functionB(), functionC() ]); doSomethingWith(valueA); doSomethingElseWith(valueB); doAnotherThingWith(valueC); }
As we've seen in the previous example, we would either need to move these values into a higher scope or create a non-semantic array to pass these values on.
Array iteration methods
You can use map, filter and reduce with async functions, although they behave pretty unintuitively. Try guessing what the following scripts will print to the console:
map
function asyncThing (value) { return new Promise((resolve) => { setTimeout(() => resolve(value), 100); }); } async function main () { return [1,2,3,4].map(async (value) => { const v = await asyncThing(value); return v * 2; }); } main() .then(v => console.log(v)) .catch(err => console.error(err));
filter
function asyncThing (value) { return new Promise((resolve) => { setTimeout(() => resolve(value), 100); }); } async function main () { return [1,2,3,4].filter(async (value) => { const v = await asyncThing(value); return v % 2 === 0; }); } main() .then(v => console.log(v)) .catch(err => console.error(err));
reduce
function asyncThing (value) { return new Promise((resolve) => { setTimeout(() => resolve(value), 100); }); } async function main () { return [1,2,3,4].reduce(async (acc, value) => { return await acc + await asyncThing(value); }, Promise.resolve(0)); } main() .then(v => console.log(v)) .catch(err => console.error(err));
Solutions:
[ Promise { <pending> }, Promise { <pending> }, Promise { <pending> }, Promise { <pending> } ]
[ 1, 2, 3, 4 ]
10
If you log the returned values of the iteratee with map you will see the array we expect: [ 2, 4, 6, 8 ]. The only problem is that each value is wrapped in a Promise by the AsyncFunction.
So if you want to get your values, you'll need to unwrap them by passing the returned array to a Promise.all:
main() .then(v => Promise.all(v)) .then(v => console.log(v)) .catch(err => console.error(err));
Originally, you would first wait for all your promises to resolve and then map over the values:
function main () { return Promise.all([1,2,3,4].map((value) => asyncThing(value))); } main() .then(values => values.map((value) => value * 2)) .then(v => console.log(v)) .catch(err => console.error(err));
This seems a bit more simple, doesn’t it?
The async/await version can still be useful if you have some long running synchronous logic in your iteratee and another long-running async task.
This way you can start calculating as soon as you have the first value - you don't have to wait for all the Promises to be resolved to run your computations. Even though the results will still be wrapped in Promises, those are resolved a lot faster then if you did it the sequential way.
What about filter? Something is clearly wrong...
Well, you guessed it: even though the returned values are [ false, true, false, true ], they will be wrapped in promises, which are truthy, so you'll get back all the values from the original array. Unfortunately, all you can do to fix this is to resolve all the values and then filter them.
Reducing is pretty straightforward. Bear in mind though that you need to wrap the initial value into Promise.resolve, as the returned accumulator will be wrapped as well and has to be await-ed.
.. As it is pretty clearly intended to be used for imperative code styles.
To make your .then chains more "pure" looking, you can use Ramda's pipeP and composeP functions.
Rewriting callback-based Node.js applications
Async functions return a Promise by default, so you can rewrite any callback based function to use Promises, then await their resolution. You can use the util.promisify function in Node.js to turn callback-based functions to return a Promise-based ones.
Rewriting Promise-based applications
Simple .then chains can be upgraded in a pretty straightforward way, so you can move to using async/await right away.
function asyncTask () { return functionA() .then((valueA) => functionB(valueA)) .then((valueB) => functionC(valueB)) .then((valueC) => functionD(valueC)) .catch((err) => logger.error(err)) }
will turn into
async function asyncTask () { try { const valueA = await functionA(); const valueB = await functionB(valueA); const valueC = await functionC(valueB); return await functionD(valueC); } catch (err) { logger.error(err); } }
Rewriting Node.js apps with async/await
If you liked the good old concepts of if-else conditionals and for/while loops,
if you believe that a try-catch block is the way errors are meant to be handled,
you will have a great time rewriting your services using async/await.
As we have seen, it can make several patterns a lot easier to code and read, so it is definitely more suitable in several cases than Promise.then() chains. However, if you are caught up in the functional programming craze of the past years, you might wanna pass on this language feature.
Are you already using async/await in production, or you plan on never touching it? Let's discuss it in the comments below.
Are you looking for help with enterprise-grade Node.js Development? Hire the Node developers of RisingStack!
This article was originally written by Tamas Kadlecsik and was released on 2017 July 5. The heavily revised second edition was authored by Janos Kubisch and Tamas Kadlecsik, and it was released on 2020 February 17.
Mastering Async Await in Node.js from node
Mastering Async Await in Node.js published first on https://koresolpage.tumblr.com/
0 notes
Text
September 5, 2019
Learned something about Postgres today: you can use the arguments passed to a function by their order with $1, $2, $3, etc., instead of referencing them by name. Weird to me that it starts with 1, but okay, Postgres. You do you.
...although I can’t stop thinking about it, and tomorrow am gonna rig up a test to see what happens if I print $0.
Spent 90 minutes with Rob picking apart a particularly spaghetti-like report today as well. Turns out it is five functions deep! functionA calls functionB calls functionC calls functionD calls functionE and functionE returns a dataset and functionsB-D pass it up and up and up until functionA looks at it... And takes a count of the returned results! It does this six times. And I kept working through moving our applications to the shared codebase, which was also a lot of fun. I love my job!
Had a chill night. Got my hair done, showered, meditated, looked through the new IKEA catalog, and attempted to write over a finger of whiskey.
I think the root of my recent insecurity is how happy I am with Sean, ironically. He really is out of my league, and I am terrified to lose him. I am worried that he will wake up and leave me because I'm ugly/boring/stupid/etc., and that in turn is turning me into a really negative person which actually probably could push him away, so I get nervous about that, which in turn makes me more negative, and so on and so on.
I usually don't believe in distractions, but right now I think I need to take the pressure off of it and think about something else for a while. Really lean into my hobbies, become absorbed enough in something that I'm not worrying about how my hair looks or if I'm in bad lighting or if my outfit doesn’t match. Because that's a way to generate good energy, doing something you truly love and letting yourself get carried away by it.
And then when you go back to the thing that's bothering you, you are able to put it into perspective. Yeah, I'm not that attractive, but I'm a great programmer and a good writer and I have some wisdom in me, and when I'm not being anxious, I can actually be a fun person to hang out with, and I am patient and kind to people.
Somewhat paradoxically, I think it would help me to spend a little more time on my appearance. I hesitate because it feels inauthentic to me - putting on makeup doesn't change what I know I look like underneath - but if it gives me a confidence boost enough to lift me out of these doldrums, maybe it's not all bad. I'm trying to reframe it from being shallow to controlling how I present myself and my ideas and personality to the world. I'm not gonna go totally in the other direction and start spending hundreds of dollars a year on makeup, but there is a balance that can be struck there, right?
0 notes
Text
CISSP PRACTICE QUESTIONS – 20210913
CISSP PRACTICE QUESTIONS – 20210913
The CEO set out a grand growth strategy that involves a portfolio of mergers and acquisitions. As a CISO, which of the following is most crucial to align the information security strategy with the grand strategy? (Wentz QOTD)A. Neutrality of the security functionB. Independence of audit functionC. Exercise of due diligenceD. Use of due care Continue reading

View On WordPress
0 notes
Video
instagram
Scooped this earlier, it's a knock off but i had to do it for the price. Thing is a function machine #newscoop #toroglass #jellisglass #recycler #recyclegang #knockoff #functionmachine #functioncity #whirlpoolwatchers #oprahswookclub #oprahsbookclub #deeeecent #lit #glassaddict #glassofig
#functioncity#whirlpoolwatchers#recycler#oprahswookclub#glassaddict#toroglass#oprahsbookclub#lit#recyclegang#deeeecent#jellisglass#newscoop#functionmachine#glassofig#knockoff
0 notes
Video
instagram
Nice little glob from the other night, really wanted to use the @toro_glass grail on my platt so I had to come up with this fuckery. Also pardon my hair like always lol #geoffplattglass #toroglass #jellisglass #fuckery #oprahswookclub #oprahsbookclub #whirlpoolwatchers #functioncity #deeeecent #lit #glassofig
#deeeecent#oprahswookclub#functioncity#geoffplattglass#fuckery#lit#whirlpoolwatchers#oprahsbookclub#jellisglass#toroglass#glassofig
0 notes