Javascript Anonymous Function | How it Works | Examples

what do anonymous function do in javascript

what do anonymous function do in javascript - win

Bitcoin Newcomers FAQ - Please read!

Welcome to the /Bitcoin Sticky FAQ

You've probably been hearing a lot about Bitcoin recently and are wondering what's the big deal? Most of your questions should be answered by the resources below but if you have additional questions feel free to ask them in the comments.
It all started with the release of Satoshi Nakamoto's whitepaper however that will probably go over the head of most readers so we recommend the following articles/books/videos as a good starting point for understanding how bitcoin works and a little about its long term potential:
Some other great resources include Michael Saylor's "Bitcoin for Everybody"' course, Jameson Lopp's resource page, Gigi's resource page, and James D'Angelo's Bitcoin 101 Blackboard series. Some excellent writing on Bitcoin's value proposition and future can be found at the Satoshi Nakamoto Institute.
If you are technically or academically inclined check out developer resources and peer-reviewed research papers, course lectures from both MIT and Princeton as well as future protocol improvements and scaling resources. Some Bitcoin statistics can be found here, here and here. MicroStrategy's Bitcoin for Corporations is an excellent open source series on corporate legal and financial bitcoin integration.
You can also see the number of times Bitcoin was declared dead by the media (LOL) and what you could have earned if you didn't listen to them! XD

Key properties of Bitcoin

Where can I buy bitcoin?

Bitcoin.org and BuyBitcoinWorldwide.com are helpful sites for beginners. You can buy or sell any amount of bitcoin (even just a few dollars worth) and there are several easy methods to purchase bitcoin with cash, credit card or bank transfer. Some of the more popular resources are below, also check out the bitcoinity exchange resources for a larger list of options for purchases.
You can also purchase in cash with local ATMs. If you would like your paycheck automatically converted to bitcoin use Bitwage.
Note: Bitcoin are valued at whatever market price people are willing to pay for them in balancing act of supply vs demand. Unlike traditional markets, bitcoin markets operate 24 hours per day, 365 days per year.

Securing your bitcoin

With bitcoin you can "Be your own bank" and personally secure your bitcoin OR you can use third party companies aka "Bitcoin banks" which will hold the bitcoin for you.
Note: For increased security, use Two Factor Authentication (2FA) everywhere it is offered, including email!
2FA requires a second confirmation code or a physical security key to access your account making it much harder for thieves to gain access. Google Authenticator and Authy are the two most popular 2FA services, download links are below. Make sure you create backups of your 2FA codes.
Avoid using your cell number for 2FA. Hackers have been using a technique called "SIM swapping" to impersonate users and steal bitcoin off exchanges.
Google Auth Authy OTP Auth andOTP
Android Android N/A Android
iOS iOS iOS N/A
Physical security keys (FIDO U2F) offer stronger security than Google Auth / Authy and other TOTP-based apps, because the secret code never leaves the device and it uses bi-directional authentication so it prevents phishing. If you lose the device though, you could lose access to your account, so always use 2 or more security keys with a given account so you have backups. See Yubikey or Titan to purchase security keys.
Both Coinbase and Gemini support physical security keys.

Watch out for scams

As mentioned above, Bitcoin is decentralized, which by definition means there is no official website or Twitter handle or spokesperson or CEO. However, all money attracts thieves. This combination unfortunately results in scammers running official sounding names or pretending to be an authority on YouTube or social media. Many scammers throughout the years have claimed to be the inventor of Bitcoin. Websites like bitcoin(dot)com and the r / btc subreddit are active scams. Almost all altcoins (shitcoins) are marketed heavily with big promises but are really just designed to separate you from your bitcoin. So be careful: any resource, including all linked in this document, may in the future turn evil. As they say in our community, "Don't trust, verify".

Common Bitcoin Myths

Often the same concerns arise about Bitcoin from newcomers. Questions such as:
All of these questions have been answered many times by a variety of people. Here are some resources where you can see if your concern has been answered:

Where can I spend bitcoin?

Check out spendabit or bitcoin directory for millions of merchant options. Also you can spend bitcoin anywhere visa is accepted with bitcoin debit cards such as the CashApp card or Fold card. Some other useful site are listed below.
Store Product
Bitrefill, Gyft Gift cards for thousands of retailers worldwide including Amazon, Target, Walmart, Starbucks, Whole Foods, CVS, Lowes, Home Depot, iTunes, Best Buy, Sears, Kohls, eBay, GameStop, etc.
Spendabit, Overstock and The Bitcoin Directory Retail shopping with millions of results
NewEgg and Dell For all your electronics needs
Piixpay, Bitbill.eu, Bylls, Coins.ph, LivingRoomofSatoshi, Coinsfer, and more Bill payment
Menufy and Takeaway Takeout delivered to your door
Expedia, Cheapair, Destinia, Abitsky, SkyTours, the Travel category on Gyft and 9flats For when you need to get away
Cryptostorm, Mullvad, and PIA VPN services
Namecheap, Porkbun Domain name registration
Stampnik Discounted USPS Priority, Express, First-Class mail postage
Coinmap and AirBitz are helpful to find local businesses accepting bitcoin. A good resource for UK residents is at wheretospendbitcoins.co.uk.
There are also lots of charities which accept bitcoin donations.

Merchant Resources

There are several benefits to accepting bitcoin as a payment option if you are a merchant;
If you are interested in accepting bitcoin as a payment method, there are several options available;

Can I mine bitcoin?

Mining bitcoin can be a fun learning experience, but be aware that you will most likely operate at a loss. Newcomers are often advised to stay away from mining unless they are only interested in it as a hobby similar to folding at home. If you want to learn more about mining you can read the mining FAQ. Still have mining questions? The crew at /BitcoinMining would be happy to help you out.
If you want to contribute to the bitcoin network by hosting the blockchain and propagating transactions you can run a full node. You can view the global node distribution for a visual representation of the node network.

Earning bitcoin

Just like any other form of money, you can also earn bitcoin by being paid to do a job.
Site Description
WorkingForBitcoins, Bitwage, Cryptogrind, Coinality, Bitgigs, /Jobs4Bitcoins, BitforTip, Rein Project Freelancing
Lolli Earn bitcoin when you shop online!
OpenBazaar, Purse.io, Bitify, /Bitmarket Marketplaces
/GirlsGoneBitcoin NSFW Adult services
A-ads, Coinzilla.io Advertising
You can also earn bitcoin by participating as a market maker on JoinMarket by allowing users to perform CoinJoin transactions with your bitcoin for a small fee (requires you to already have some bitcoin).

Bitcoin-Related Projects

The following is a short list of ongoing projects that might be worth taking a look at if you are interested in current development in the bitcoin space.
Project Description
Lightning Network Second layer scaling
Liquid, Rootstock and Drivechain Sidechains
Hivemind Prediction markets
Tierion and Factom Records & Titles on the blockchain
BitMarkets, DropZone, Beaver and Open Bazaar Decentralized markets
JoinMarket and Wasabi Wallet CoinJoin implementation
Decentralized exhanges Decentralized bitcoin exchanges
Keybase Identity & Reputation management
Abra Global P2P money transmitter network
Bitcore Open source Bitcoin javascript library

Bitcoin Units

One Bitcoin is quite large (hundreds of £/$/€) so people often deal in smaller units. The most common subunits are listed below:
Unit Symbol Value Info
bitcoin BTC 1 bitcoin one bitcoin is equal to 100 million satoshis
millibitcoin mBTC 1,000 per bitcoin used as default unit in recent Electrum wallet releases
bit bit 1,000,000 per bitcoin colloquial "slang" term for microbitcoin (μBTC)
satoshi sat 100,000,000 per bitcoin smallest unit in bitcoin, named after the inventor
For example, assuming an arbitrary exchange rate of $10000 for one Bitcoin, a $10 meal would equal:
For more information check out the Bitcoin units wiki.
Still have questions? Feel free to ask in the comments below or stick around for our weekly Mentor Monday thread. If you decide to post a question in /Bitcoin, please use the search bar to see if it has been answered before, and remember to follow the community rules outlined on the sidebar to receive a better response. The mods are busy helping manage our community so please do not message them unless you notice problems with the functionality of the subreddit.
Note: This is a community created FAQ. If you notice anything missing from the FAQ or that requires clarification you can edit it here and it will be included in the next revision pending approval.
Welcome to the Bitcoin community and the new decentralized economy!
submitted by BitcoinFan7 to Bitcoin [link] [comments]

Introducing Nano P2PoW

https://preview.redd.it/o74aqab1d6761.png?width=758&format=png&auto=webp&s=cda357301d2b3e67afd5efd9a93be0a2ab602750
In this year of 2020 a lot of work was done on top of P2PoW. The news has accumulated and before the year is over I want to have the honor of sharing with the Nano community!

NanoJam victory and Rebranding

In 2019 it was a pleasure, after the recount of the votes, to discover Delegated Proof of Work was the winner of NanoJam, the first international hackaton of the Nano community, taking the first place! Due to the fact that many people confuse the old name of the project “Delegated Proof of Work” with the project “DPoW” (distributed PoW, which maintains a different system, with a centralized api), a rebranding was necessary. u/mitche50 from the Nano Center suggested the current name: P2PoW. I intend to remain with that name that certainly fell very well in our P2P project!

The importance of P2PoW for Nano

  1. P2PoW is the P2P alternative for DPoW (wich is distributed, but not descentralized). With P2PoW it is possible to delegate proof of work directly to “worker peers”, who currently work as miners, independently and autonomously. It is possible to use one worker at a time or several simultaneously; takes the reward who finishes the proof of work first, like a competition.
  2. P2PoW security is decentralized and there is no way for a user or worker to take undue advantage. The only way for the user to validate their transaction is to sign an extra reward transaction for workers. The only way for workers to earn the reward is to validate the user’s transaction. There are no single points of failure. This security mechanism is intrinsic to the Nano block lattice protocol.
  3. The P2PoW protocol, therefore, allows any Nano project in any device to have instant Nano transactions at any time, without the need for any extra registration, without the need to trust any server and without any central authority. P2PoW does not require any permission or bureaucracy to be integrated into software by developers and anyone can become a worker peer just as easily. P2PoW is the purely mathematical and the P2P solution for Nano Proof of Work delegation.
I explain this process better in 10 points in this article: https://anarkrypto.medium.com/nano-p2pow-d9c839a7ec49

Worker API Update -> V2.0.0

Many things have changed since the first version of Delegated Proof of Work (now P2PoW) to keep the API more robust, efficient, secure and updated with the changes of the Nano protocol. Let’s see:

- Adapting to the new difficulty

Now P2PoW API by default uses different PoW difficulties to send/change and receive transactions according to Nano protocol updates.
Minimum difficulty to send/change: 8X the old difficulty.
Minimum difficulty to receive: 1/8 the old difficulty.
In addition, workers can enable dynamic fee, this requires clients to pay more for larger PoW when the network is more saturated.

-Efficiency

While solving a work, the API automatically checks if the transaction has already been confirmed (possibly by a competing worker). If so, the api gives up the work and can focus all its resources on the next work.

-Logging

Now the P2PoW API comes with a more organized logging system, with different flags:
INFO: Common notices, such as startup and new work
Warning: User made an invalid request or with some invalid data
Error: Error in configuration, API or communication with node nano / worker
For those using Linux, logs can be tracked via journalctl
The user can also redirect the entire log to a file using arg: -o file.log

-Support for IPV6

In addition to IPV4, the decentralized registration system protocol is already able to convert IPV6 to the Nano account format and make it available to P2PoW clients automatically.

-Improvement of code in modules

To facilitate the work of developers who want to forge the code, the API now has its functions divided into “modules”, as well as a division of the configuration files.

https://preview.redd.it/bjb0zqe3c6761.png?width=414&format=png&auto=webp&s=b388de32fdd25dff3fc62f31cd39a73c1b2bf586
Code comments have also been added and improved.

P2PoW Client JS

To facilitate and improve the integration of P2PoW in applications, I announce the P2PoW client JS. A library with all the functions needed to use P2PoW. Check usage examples:
P2PoW.sync(delay, callback) //synchronize with workers
P2PoW.getWorkersOnline( ) //get workers list
P2PoW.requestInfo(workerAddress) //get a worker info
P2PoW.requestWork(user_block, workerIP) //solve a transaction

P2PoW Web Demo

P2PoW Web Demo
How about a simple and friendly online demo for any user to test P2PoW working in practice?
Try it Now : https://demo.p2pow.online

The P2PoW Demo is the first integration with the client JS and allows anyone to test the protocol without the need to install any software or understand programming!

P2PoW Website update

The site was also not left out! This is the new official P2PoW website: https://p2pow.online

https://preview.redd.it/zw3vobhbc6761.png?width=414&format=png&auto=webp&s=3a0787c73ec45a228fc85dd0dfee2d8d54c52938
https://preview.redd.it/ip30sp4cc6761.png?width=414&format=png&auto=webp&s=e9e5c6d1c831b1330ae6346138cd153617548486
The code is available at: https://github.com/anarkrypto/p2pow/tree/mastedocs

Implementations: C, PHP, IoT and Wallet with P2PoW!


https://preview.redd.it/qehthj4fc6761.png?width=414&format=png&auto=webp&s=44ce7d1d0d4347acc6adec62094eb73d5a4b5abc
The programmer and enthusiast Fabio Silva took advantage of P2PoW protocol to integrate into his projects focused on IoT and low processing devices:

myNanoEmbedded: lightweight C library

myNanoEmbedded is a lightweight C library that integrates Nano Cryptocurrency to low complexity computational devices (like IoT), with fast transactions and small fees by delegating the Proof of Work with P2PoW.
Support: BIP39, P2PoW, TRNG or PRNG entropyARM-A, ARM-M, Thumb, Xtensa-LX6 and IA64 compatible. Linux desktop, Raspberry PI, ESP32 and Olimex A20 tested platforms

myNanoPHP: library to integrate Nano to PHP

myNanoPHP is a PHP Nano Library optimized in size and speed, binding the C library MyNanoEmbedded for PHP. Works with P2PoW

Nano-electron

Nano-electron is a cross-platform wallet for Nano cryptocurrency.
Focused on lightness, agility and portability, this wallet uses the myNanoEmbedded C Library through a binding to provide greater performance. supports P2PoW

myNanoJS

myNanoJS is a C library that integrates Nano Cryptocurrency tools to NodeJS. supports P2PoW

myNanoJava

Java C bindings for Nano Cryptocurrency with Bitcoin support. Supports P2PoW

Nano Pruning — What will change in P2PoW

This subject will be explained in more detail soon, but so far everything indicates that the pruning will have no negative impact on the P2PoW protocol.
On the contrary, it will help! Since pruning does not apply to burn accounts, it will not affect the decentralized registration system of workers at all.
However, pruning will make P2PoW more efficient, because although P2PoW requires 2 transactions for each work (1 user transaction and 1 reward transaction), pruning will leave only the last transaction saved in the ledger (state block), therefore, in pruned nodes, P2PoW will not require extra storage compared to other methods of transact Nano!

The future of P2PoW

Many updates and features can make P2PoW even more complete and robust. Some possible implementations stand out:

Donations

This project is developed in a totally independent way.
All the progress mentioned here was the result of months of work!
You can encourage further development of this and other Nano projects with a Nano donation:
nano_18eoa1k16d4n1b5hb8hwxm5mmgp6zny7owhn8omc5bgxjahxsyznob9u536t

https://preview.redd.it/cmx6gdehc6761.png?width=330&format=png&auto=webp&s=f6fd341db1a578c4871688a50399de743cc94d1e

Discord Channel

If you have questions about the project, suggestions or other contributions you can join our channel #p2pow-discussion on The Nano Center’s Discord server: https://discord.gg/GhzdTkD

Last but not least, I wish everyone a happy end of the year! And that 2021 brings a lot of news to Nano. This was my Christmas present for the community!
submitted by anarkrypto to nanocurrency [link] [comments]

What is this called?

I'm designing a language for use by non-professional programmers. The focus is on usability and interactivity. I'd like to make it easy to draw graphs of equations. In examples of Mathematica and other systems I often see something like this:
draw(sin(x))
Here draw is a normal function that can be executed immediately but what is sin(x)? It's not a function to be executed immediately. It's meant to be evaluated by draw as x goes from 0 -> PI*2, or whatever the canvas later decides (it will be interactive). However, it's not a string to be evaluated either like draw('sin(x)').
I want to know what this thing is called so I can Google it and do research? An un-evaluated lambda? Free variables? Algorithmic function manipulation?
And what languages would you suggest I look at for inspiration?

[update]

Thank you for the answers. It sounds like this is called either symbolic computation (in Mathematica) or a lazy evaluated thunk (Haskell and Lisp). In all cases it requires the main language to support expressions which are parsed but not yet evaluated. Sometimes macros perform this task.
I'm using Javascript as my current host language and it doesn't support lazy evaluation or macros directly (without eval'ing strings), so you have to use anonymous functions. ex:
f = (x) => sin(x) draw(f) 
or
draw( x => sin(x) ) 

Clearly this is not something that should be in a language aimed at non-professionals since you have to understand that some things are evaluated immediately and others happen at "some point in the future". Maybe it would make sense in the context of math functions because most people have used something like this in school, but outside that it might be more trouble than it's worth.
The reason I'm investigating this is also for mapping and queries where you might need to de-structure something. ex: if you want to draw the planets to scale using a list of planet objects you'd need to de-structure the radius. In JS it would be something like:
draw( planets .map(p => p.radius) .map(r => new Circle(r)) ) 
but all of those parenthesis create noise that could be confusing.
Has anyone done research into the UX of programming languages?
submitted by joshmarinacci to ProgrammingLanguages [link] [comments]

Bitcoin Newcomers FAQ - Please read!

Welcome to the /Bitcoin Sticky FAQ

You've probably been hearing a lot about Bitcoin recently and are wondering what's the big deal? Most of your questions should be answered by the resources below but if you have additional questions feel free to ask them in the comments.
It all started with the release of Satoshi Nakamoto's whitepaper however that will probably go over the head of most readers so we recommend the following articles/books/videos as a good starting point for understanding how bitcoin works and a little about its long term potential:
Some other great resources include Lopp.net, Gigi's resource page, and James D'Angelo's Bitcoin 101 Blackboard series.
Some excellent writing on Bitcoin's value proposition and future can be found at the Satoshi Nakamoto Institute.
Some Bitcoin statistics can be found here, here and here. Developer resources can be found here. Peer-reviewed research papers can be found here, also course lectures from the Princeton crypto series.
Potential upcoming protocol improvements and scaling resources here and here.
The number of times Bitcoin was declared dead by the media can be found here (LOL!)

Key properties of Bitcoin

Where can I buy bitcoin?

Bitcoin.org and BuyBitcoinWorldwide.com are helpful sites for beginners. You can buy or sell any amount of bitcoin (even just a few dollars worth) and there are several easy methods to purchase bitcoin with cash, credit card or bank transfer. Some of the more popular resources are below, also check out the bitcoinity exchange resources for a larger list of options for purchases.
Here is a listing of local ATMs. If you would like your paycheck automatically converted to bitcoin use Bitwage.
Note: Bitcoin are valued at whatever market price people are willing to pay for them in balancing act of supply vs demand. Unlike traditional markets, bitcoin markets operate 24 hours per day, 365 days per year.

Securing your bitcoin

With bitcoin you can "Be your own bank" and personally secure your bitcoin OR you can use third party companies aka "Bitcoin banks" which will hold the bitcoin for you.
Note: For increased security, use Two Factor Authentication (2FA) everywhere it is offered, including email!
2FA requires a second confirmation code or a physical security key to access your account making it much harder for thieves to gain access. Google Authenticator and Authy are the two most popular 2FA services, download links are below. Make sure you create backups of your 2FA codes.
Google Auth Authy OTP Auth andOTP
Android Android N/A Android
iOS iOS iOS N/A
Physical security keys (FIDO U2F) offer stronger security than Google Auth / Authy and other TOTP-based apps, because the secret code never leaves the device and it uses bi-directional authentication so it prevents phishing. If you lose the device though, you could lose access to your account, so always use 2 or more security keys with a given account so you have backups. See Yubikey or Titan to purchase security keys.
Both Coinbase and Gemini support physical security keys.

Watch out for scams

As mentioned above, Bitcoin is decentralized, which by definition means there is no official website or Twitter handle or spokesperson or CEO. However, all money attracts thieves. This combination unfortunately results in scammers running official sounding names or pretending to be an authority on YouTube or social media. Many scammers throughout the years have claimed to be the inventor of Bitcoin. Websites like bitcoin(dot)com and the btc subreddit are active scams. Almost all altcoins (shitcoins) are marketed heavily with big promises but are really just designed to separate you from your bitcoin. So be careful: any resource, including all linked in this document, may in the future turn evil. As they say in our community, "Don't trust, verify".

Where can I spend bitcoin?

Check out spendabit or bitcoin directory for millions of merchant options. Also you can spend bitcoin anywhere visa is accepted with bitcoin debit cards such as the CashApp card or Fold card. Some other useful site are listed below.
Store Product
Gyft Gift cards for hundreds of retailers including Amazon, Target, Walmart, Starbucks, Whole Foods, CVS, Lowes, Home Depot, iTunes, Best Buy, Sears, Kohls, eBay, GameStop, etc.
Spendabit, Overstock and The Bitcoin Directory Retail shopping with millions of results
NewEgg and Dell For all your electronics needs
Coinbills, Piixpay, Bitbill.eu, Bylls, Coins.ph, Bitrefill, LivingRoomofSatoshi, Coinsfer, and more Bill payment
Menufy and Takeaway Takeout delivered to your door
Expedia, Cheapair, Destinia, Abitsky, SkyTours, the Travel category on Gyft and 9flats For when you need to get away
Cryptostorm, Mullvad, and PIA VPN services
Namecheap, Porkbun Domain name registration
Stampnik Discounted USPS Priority, Express, First-Class mail postage
Coinmap and AirBitz are helpful to find local businesses accepting bitcoin. A good resource for UK residents is at wheretospendbitcoins.co.uk.
There are also lots of charities which accept bitcoin donations.

Merchant Resources

There are several benefits to accepting bitcoin as a payment option if you are a merchant;
If you are interested in accepting bitcoin as a payment method, there are several options available;

Can I mine bitcoin?

Mining bitcoin can be a fun learning experience, but be aware that you will most likely operate at a loss. Newcomers are often advised to stay away from mining unless they are only interested in it as a hobby similar to folding at home. If you want to learn more about mining you can read more here. Still have mining questions? The crew at /BitcoinMining would be happy to help you out.
If you want to contribute to the bitcoin network by hosting the blockchain and propagating transactions you can run a full node. You can view the global node distribution here.

Earning bitcoin

Just like any other form of money, you can also earn bitcoin by being paid to do a job.
Site Description
WorkingForBitcoins, Bitwage, Cryptogrind, Coinality, Bitgigs, /Jobs4Bitcoins, BitforTip, Rein Project Freelancing
Lolli Earn bitcoin when you shop online!
OpenBazaar, Purse.io, Bitify, /Bitmarket Marketplaces
/GirlsGoneBitcoin NSFW Adult services
A-ads, Coinzilla.io Advertising
You can also earn bitcoin by participating as a market maker on JoinMarket by allowing users to perform CoinJoin transactions with your bitcoin for a small fee (requires you to already have some bitcoin).

Bitcoin-Related Projects

The following is a short list of ongoing projects that might be worth taking a look at if you are interested in current development in the bitcoin space.
Project Description
Lightning Network Second layer scaling
Liquid, Rootstock and Drivechain Sidechains
Hivemind Prediction markets
Tierion and Factom Records & Titles on the blockchain
BitMarkets, DropZone, Beaver and Open Bazaar Decentralized markets
JoinMarket and Wasabi Wallet CoinJoin implementation
Decentralized exhanges Decentralized bitcoin exchanges
Keybase Identity & Reputation management
Abra Global P2P money transmitter network
Bitcore Open source Bitcoin javascript library

Bitcoin Units

One Bitcoin is quite large (hundreds of £/$/€) so people often deal in smaller units. The most common subunits are listed below:
Unit Symbol Value Info
bitcoin BTC 1 bitcoin one bitcoin is equal to 100 million satoshis
millibitcoin mBTC 1,000 per bitcoin used as default unit in recent Electrum wallet releases
bit bit 1,000,000 per bitcoin colloquial "slang" term for microbitcoin (μBTC)
satoshi sat 100,000,000 per bitcoin smallest unit in bitcoin, named after the inventor
For example, assuming an arbitrary exchange rate of $10000 for one Bitcoin, a $10 meal would equal:
For more information check out the Bitcoin units wiki.
Still have questions? Feel free to ask in the comments below or stick around for our weekly Mentor Monday thread. If you decide to post a question in /Bitcoin, please use the search bar to see if it has been answered before, and remember to follow the community rules outlined on the sidebar to receive a better response. The mods are busy helping manage our community so please do not message them unless you notice problems with the functionality of the subreddit.
Note: This is a community created FAQ. If you notice anything missing from the FAQ or that requires clarification you can edit it here and it will be included in the next revision pending approval.
Welcome to the Bitcoin community and the new decentralized economy!
submitted by BitcoinFan7 to Bitcoin [link] [comments]

Trying to output my data to .csv, but I'm getting a file per line. Any help please?

First of all, apologies if I am missing one or more things that should be obvious. I haven't done any JS for about 1.5 years, and I am pretty rusty by now. In fact, I can barely remember having written this code, but would really like to get it working properly. With that out of the way, here is my code:
HTML:
     Dispodger    
home
JS:
function id(file) { return new Promise((resolve, reject) => { reader = new FileReader(); reader.onload = function(e) { parsedLines = e.target.result.split(/\r|\n|\r\n/); resolve(parsedLines); }; reader.readAsText(file); }); } document.getElementById('fileInput').addEventListener('change', function(e) { var file = e.target.files[0]; if (file != undefined) { id(file).then(id => { console.log(id) console.log(parsedLines) console.log(typeof id); var idInt = id.map(Number); var idFiltered = id.filter(function(v){return v!==''}); console.log(idFiltered) idFiltered.forEach(idFiltered => { getRelease(idFiltered); }); }); } }); function getRelease(idFiltered) { return fetch(`https://api.discogs.com/releases/${idFiltered}`, { 'User-Agent': 'Dispodge0.1', }) .then(response => response.json()) .then(data => { if (data.message === 'Release not found.') { return { error: `Release with ID ${idFiltered} does not exist` }; } else { const id = data.id; const artists = data.artists ? data.artists.map(artist => artist.name) : []; const country = data.country || 'Unknown'; const released = data.released_formatted || 'Unknown'; const genres = data.genres || []; const styles = data.styles || []; const tracklist = data.tracklist ? data.tracklist.map(track => track.title) : []; console.log(idFiltered); console.log(artists, country, released, genres, styles, tracklist) // return { idFiltered, artists, country, released, genres, styles, tracklist }; const rows = [ [idFiltered, artists, country, released, genres, styles, tracklist], ]; let csvContent = "data:text/csv;charset=utf-8," + rows.map(e => e.join(",")).join("\n"); var encodedUri = encodeURI(csvContent); var link = document.createElement("a"); link.setAttribute("href", encodedUri); link.setAttribute("download", "my_data.csv"); document.body.appendChild(link); // Required for FF link.click(); } }); } 
It's not far off working, as I'm getting back, for instance...
10,Lovetronic,US,1999,Electronic,Deep House,You Are Love (Jay's Afrotronic Vocal),You Are Love (After Hours Payback Session),You Are Love (Petalpusher Dub),You Are Love (Original Vocal) 
But that is just the output for the last release ID in the input file (of 10 lines), and I'm getting one file per release instead of joining them all into one single file.
I was looking at the method here, but to my eye that seems a lot more verbose than the apparently simpler method I found here. Any help please? I'm hoping there could be a fairly simple fix, since the output looks OK; it just needs joined into one file. Perhaps I need to iterate through the array somehow, but I'm not sure how. TIA.
Edit: I just took a look in the console, and I think I can see what's going on. I think it is giving me one file per array, but what I really want is to download is actually an array of arrays.
Edit2: I tried the method shown here, but I'm not getting any output at all, even after adding
document.body.appendChild(link); // Required for FF 
Edit3: I'm now trying to write a specific function to deal with the download, working from this example.
Edit4: I wrote a whole function to deal with the download called downloadCSV, and tried to call it from csv.html with the following button
 
But it doesn't seem to do anything at all; I'm not seeing anything happening in the console.
submitted by double-happiness to learnjavascript [link] [comments]

Questions about named, anonymous, arrow functions

Hello I would like to improve my JavaScript skills, it took me a while to figure how functions work. And by work I mean arguments de-structure, default values, spread operator, function recursion
Now I would like to get even better, write shorter and easier code to read by following Functional Programming and by Making Pure Functions.
And I would like to know if it's best practice to write one-line functions and discourage the usage of anonymous functions is recommended, here is a small snippet (taken from freecodecamp)
// The global variable var watchList = [ { "Title": "Inception", "Year": "2010", "Rated": "PG-13", "imdbRating": "8.8", }, { "Title": "Interstellar", "Year": "2014", "imdbRating": "8.6", "Type": "movie", "Response": "True" }, { "Title": "The Dark Knight", "Year": "2008", "imdbRating": "9.0", }, { "Title": "Batman Begins", "imdbRating": "8.3", "imdbVotes": "972,584", "imdbID": "tt0372784", "Type": "movie", "Response": "True" }, { "Title": "Avatar", "imdbRating": "7.9", "imdbVotes": "876,575", } ]; const reduced = ( { Title, imdbRating } ) => ( { title: Title, rating: imdbRating } ); const greaterThan = movie => parseFloat(movie.rating) >= 8.0; const filteredList = watchList.map(reduced).filter(greaterThan) console.log(filteredList); 
As you can see above, we have an array with objects as movies and we want our program to create a new array with only the data we want and apply a filter which returns movies with an equal or greater than 8 rating.
And my questions are the following:
Which snippet do you recommend ? (both snippets are equivalent) a. Named functions
const reduced = ( { Title, imdbRating } ) => ( { title: Title, rating: imdbRating } ); const greaterThan = movie => parseFloat(movie.rating) >= 8.0; const filteredList = watchList.map(reduced).filter(greaterThan) 
b. Anonymous Functions:
const filteredList = watchList.map( ({Title, imdbRating}) => ( { title: Title, rating: imdbRating } )).filter(movie => parseFloat(movie.rating) >= 8.0) 
Concerns: 1st snippet: uses some more advanced concepts of JavaScript as argument/object de-structure inside of the function which might be familiar to Junior Devs or Devs who are starting now and may end up being confused, however: The code is: 1. simpler to read 2. portable 3. you don't write many things with chained functions. 4. you keep the logic separate (create a new array and then filter the array by using different functions for each)
2nd snippet: this style of writing the code, you see it everywhere unfortunately, in writing APIs
app.get("/people", (req, res, next) => { ... }) 
However the code is not: 1. portable 2. you may end writing the same lines of code again and again
// the only difference here might be the API endpoint app.get("/users", (req, res, next) => { ... }) 
However it's much more code-friendly to other developers.
So what do you advice it's better doing? Should I follow the first (1st snippet) or the second (2nd snippet) approach?
Would you like to share your experiences when you had to write code based on 1st and 2nd examples?
submitted by MariosFFX to learnjavascript [link] [comments]

How to anonymously host the continued development of youtube-dl offshore

Original sources of this guide (might be more up to date in case you're viewing a mirror of it):
https://old.reddit.com/youtubedl/comments/jktx5b/how_to_anonymously_host_the_continued_development/
https://raddle.me/f/AntiCopyright/121477/how-to-anonymously-host-the-continued-development-of-youtube
In this guide I will go through how to anonymously host the continued development of youtube-dl offshore using companies that have a track record of being very resilient to DMCA takedowns. As a general disclaimer, youtube-dl is not illegal, no matter how much the RIAA wants it to be. Hosting it is not illegal, but the RIAA doesn't care about what's legal, so we'll have to act accordingly and not rely on companies that will bend over backwards for them. This post is basically my way of flipping the bird to the RIAA.
DMCA ignored hosting providers
RIAA report including DMCA ignored hosting providers
MPAA report including DMCA ignored hosting providers
United States Trade Representative report including DMCA ignored hosting providers
ESA report including DMCA ignored hosting providers
Europol report including DMCA ignored hosting providers
La Liga report including DMCA ignored hosting providers
Former bulletproof hosting reseller reviews offshore hosting providers
Former bulletproof hosting reseller on what the most warez friendly hosting providers are
(Novogara aka Ecatel recently got busted for tax evasion and are shady as hell in general, allowing anything to be hosted on their servers, so it's best to stay away from them.)
Take into account what data center the hosting provider uses. If they don't run their their own data center the company running the data center can shut down the server if the data center isn't DMCA ignored. That isn't to say that resellers can't be resilient, but it depends on how resilient the data center they use is.
This goes without saying, but keeping the hosting provider secret makes it a lot harder to take down.
Some countries like Ukraine, Kazakhstan, and Korea force hosting providers to use government SSL certificates, meaning that they can MITM the connection.
CDNs and proxies to hide the real hosting provider
DDoS-Guard - Highly recommended. Based in Russia. Doesn't care about DMCA at all. DDoS-Guard is mentioned in the MPAA's Notorious Markets report and currently provides protection for Nyaa (the world's largest public torrent tracker for anime and manga) and Sci-Hub (the world's largest piracy website for academic papers which is under constant legal pressure from big US publishers). Has a free plan and accepts Bitcoin for paid plans. DDoS-Guard might be inaccessible outside of Europe for a few hours/month, meaning that sites using it would be unreachable outside of Europe during that time. This is probably peering related, but I'm not sure. Just tell site visitors to use ProtonVPN's free plan and connect to one of their VPN servers in the Netherlands if that happens.
While I recommend DDoS-Guard, I'll list some other alternatives in case something happens:
CloudFlare - Might be a honeypot, especially since I'm not sure how they'd be able to get away with this otherwise, but CloudFlare works for now. Just don't expect privacy from them. They're a US based company so they'll probably be reigned in eventually, but for now they're having their Wild West days. CloudFlare has a free plan. If CloudFlare is not configured properly when set up the real hosting provider will be leaked. More info about that here: 1, 2, 3, 4, 5, 6, 7
It's a myth that Cloudflare does not forward DMCA complaints, they forward everything. However, Cloudflare does not store any "sensitive data", which means forwarding "useless" information is similar like ignoring the DMCA request. A general advice is that whenever you use Cloudflare you should use a bulletproof backend server as well to avoid DMCA takedown request in the first place, so less or nothing gets forwarded (less "leakage risk").
Source: CHEF-KOCH / Warez / Bulletproof Hosting.md
OVPN's public IPv4 proxy (the Switzerland proxy) - Swedish company that provided a proxy for The Pirate Bay for a while, went to court because of it, and won. The two advantages with their Switzerland proxy in particular is that it's hosted by Interxion - the same Netherlands based company that is hosting Feral Hosting's DMCA ignored seedboxes - and that Switzerland is a pretty good jurisdiction. OVPN also scores well on That One Privacy Site. Accepts Bitcoin.
Before we go into registering a domain, I think it's worth considering if it's really worth keeping the name youtube-dl or if it could be spun off into a more accurate and less trademark infringing name like media-dl, for example. It downloads video and audio from a lot more sites than just YouTube, after all.
Resilient TLDs (there are more options than just these)
.is - As of a few years ago ISNIC had only ever suspended one domain and it was connected to ISIS.
When we asked whether ISNIC would follow Greenland’s lead and move for a proactive suspension, we got a clear answer.
“The short answer is no. Such an action would require a formal order from an Icelandic court. ISNIC is not responsible for a registrant’s usage of their domains,” ISNIC’s Marius Olafsson told TorrentFreak.
“This policy applies equally to any .is domain,” Olafsson says, adding that it’s the domain owner’s responsibility to abide by the law, not theirs.
Source: https://torrentfreak.com/pirate-bay-finds-safe-haven-in-iceland-switches-to-is-domain-130425/
“Domains can hardly be considered illegal any more than a street address. A street address is not illegal even if there is illegal activity in one apartment at the address,” ISNIC says.
Source: https://torrentfreak.com/torrent-domain-suspensions-damage-credibility-registrar-says-140617/
.ru / .su - Good for anything that doesn't affect Russia or go against Russian interests.
.to - Used by a lot of torrent and other filesharing websites. I have never seen one get suspended. .to is managed by a US company though, so it being "bulletproof" could change.
.cr is a resilient TLD according to the International Intellectual Property Alliance's (IIAP) report:
thepiratebay.cr domain is still online despite actions against it from the Internet Corporation for Assigned Names and Numbers (ICANN) and the U.S. Embassy in Costa Rica. Other notorious infringing sites are following the trend of using .cr domains as a safe haven (e.g., kickasstorrents.cr). Costa Rica’s failure to deal effectively with its obligations regarding online infringement, more than eight years after they came into force under DR-CAFTA, is a serious concern.
In case you want cheaper options that are available on Njalla, .ws and .ch are said to be pretty good.
.ec is also looking pretty solid as Library Genesis (the world's largest book piracy website, which is under constant legal pressure from big US publishers) have been using it for some time without getting suspended.
Vulnerable TLDs
.com, .net, .cc, .tv, and .name are operated by VeriSign, a Washington DC based company that is controlled by the US government.
.org, .info, .asia, .aero, .ag, .bz, .gi, .hgn, .in, .lc, .me, .mobi, .mn, .sc and .vc are operated by Afilias, a company that blocked one of WikiLeaks' domains.
.site, .website, .tech, .online, .uno, .fun, .space, .store, and .press are operated by Radix, a company that has an anti-piracy partnership with the MPAA.
All TLDs operated by Donuts, a company that has an anti-piracy partnership with the MPAA.
Resilient domain registrars/resellers
Recommended:
Njalla - As anonymous as you can get when buying a domain. Njalla is a Nevis registered company that buys the more common domains from Canada based Tucows, which is pretty abuse friendly and some TLDs like .is they buy from the registry directly. They then lease it to you while legally speaking they own the domain. This means that you don't have to give them any personal information to register it and they take Monero. Njalla is mentioned in the RIAA and MPAA's Norotious Markets reports. Njalla has a Tor Hidden Service, PGP key, and has support for registration via XMPP with OTR. Njalla is run by one of the Pirate Bay founders and they kept the Pirate Bay sense of humor alive when dealing with DMCA.
Other:
NiceVPS - As anonymous as you can get when buying a domain. NiceVPS is a domain reseller based in the Dominican Republic that buys the domain from easyDNS and then leases it to you, meaning that you don't have to provide any personal information since they own the domain on paper. Accepts Monero. Has a Tor Hidden Service, PGP key, and warrant canary. I've seen NiceVPS recommended on some websites, but I'm not sure how solid it is. Doesn't seem to offer all of the TLDs that Njalla, Openprovider, and easyDNS offer, including a lot of the more resilient ones.
Openprovider aka Hosting Concepts B.V. - Netherlands based registrar that is one of the most abused registrars by rogue pharma sites. Doesn't suspend domains without a WIPO decision or court order. Has a full section dedicated to it in the United States Trade Representative's 2019 report and a brief mention in the 2020 report.
easyDNS - Canada based registrar that has a big focus on due process. The current registrar of The Pirate Bay's .org domain, which it defended against the RIAA. Wouldn't suspend a domain for a video downloader like youtube-dl unless ordered by ICANN, CIRA, or a court according to their takedown policy. Accepts Bitcoin.
There are a few resellers of bulletproof Russian and Chinese registrars that accept cryptocurrency, but because those are pretty much only used by cyber criminals they would not be a good look for this project. And there's also the risk that they'll just be gone one day without a word and no way to transfer domain and not much recourse. Because of those reasons I'm omitting them from this list. I think the above mentioned registrars and resellers will be good enough, the project is legal after all.
Worth considering:
In order to anonymously directly register a domain at any of the other mentioned services than Njalla and NiceVPS you'd have to fake the WHOIS information, which violates ICANN's rules and registrars usually suspend domains because of that. I could especially imagine easyDNS doing this. Not sure how the other registrars would react to that, but ICANN does have the power to withdraw their accreditation - meaning that the registrars would lose the ability to issue domains - if they don't follow ICANN's rules. In the cases of Njalla and NiceVPS they aren't a registrar, they just fill in their own details and buy the domain for you from a registry/registrar when you register a domain using them.
If you use Njalla or NiceVPS you're handing over control of the domain to somebody else and have to take their word for it that you'll always have access to the domain. It's easier to trust Njalla than NiceVPS in this case since it's known who owns Njalla and they have more of a track record than NiceVPS, which is fairly unknown.
TLS/SSL
Let's Encrypt - Free, uses open source software, backed by EFF, Mozilla, and others. Easy to set up and easy to maintain with an auto-renewal script.
If you're using CloudFlare, you'll have to use their phony SSL certificate.
Keeping your server secure and other technical advice
Check your server, and how reliable it is in terms of security and privacy, online services like https://centminmod.com can test your server and it's configuration to ensure nothing is "leaking".
Check if someone can see your hidden backend server IP via https://dnsdumpster.com. In general you should block every IP connection to your backend server, only allow your own connection, VPN's or reverse proxies. You quickly can check if someone has an "open" backend IP service via services like https://censys.io.
Source: CHEF-KOCH / Warez / Bulletproof Hosting.md
If you use CloudFlare, also check that your backend isn't leaking using CrimeFlare.
If you have set up email with your domain, use SMPT and a custom mail server so it doesn't leak your origin server IP. Email is the easiest way to leak origin server IP addresses.
Use SSH instead of VNC. With VNC the login information is sent unencrypted via plaintext, meaning that a rogue exit node in the Tor network and any server the login information is sent over on the clearnet could record your login information if they wanted to.
Use a password generator for all accounts and have it set to the max number of characters. Don't put the login information into a proprietary password manager or an online password manager. Make sure to back up the login information to multiple hard drives/SSDs/USBs/etc.
Try and make the site portable so that all software and all configurations can be saved to an ISO that can be spun up at any hosting provider at a moment's notice in case the site has to move at some point.
If you get a VPS, make sure it's KVM. KVM is much more secure than OpenVZ since OpenVZ doesn't have much separation between different customers on the same server. OpenVZ is also easy to oversell. Xen is also secure, but has worse performance than KVM.
Use nginx, it has a lot better performance than Apache.
Use MariaDB. It's a more up to date fork of MySQL developed by MySQL's original developer after he sold MySQL to Oracle. Contains bug fixes that sometimes have not gotten into MySQL yet. It is of course fully compatible with MySQL databases.
Basic security hardening (I'd probably use OSSEC + Shorewall instead of fail2ban and ufw, but I'm not an expert at this ¯\_(ツ)_/¯ )
nginx configuration for improved security (and performance): GitHub Gist | blog post (8.8.8.8 and 8.8.4.4 are both Google Public DNS resolvers, so if you enable OCSP stapling, use a more privacy friendly DNS resolver, like Njalla's public DNS, one of the DNS resolvers mentioned on PrivacyTools, one of the DNS resolvers in DNS66's settings, or an OpenNIC server that doesn't keep logs. Digitalcourage e.V. and Chaos Computer Club are pretty trustworthy organizations, so their DNS servers from DNS66's settings along with Njalla's DNS resolver are probably solid, at least. Few OpenNIC servers seem to last very long, judging by that most of them were added in 2019 and 2020. If you use CloudFlare for the site, just use CloudFlare's 1.1.1.1 DNS, they'll get site traffic data regardless, so just use them for that DNS resolver as well instead of sending out data to another party.
nginx tuning for best performance
nginx SSL/TLS hardening including HTTP Strict Transport Security
Top 25 Nginx Web Server Best Security Practices
Let's Encrypt auto-renewal script
If you need FTP server software, Pure-FTPd is the most secure option. Use SFTP instead of FTPS for better security and less of a headache.
Disable password access for administration, require login using a SSH key, and limit the number of login attempts.
Change default ports, like SSH. If anyone tries to access the default SSH port, have the firewall block them for a few hours.
Disable root login.
More security tips for SSH are available here. Don't implement port knocking though.
Disable nginx logging once everything is set up to protect user privacy and improve performance.
Keep the software up to date to decrease the risk of your serveVPS being hacked.
Don't use analytics. If you have to, self-host Matomo (formerly known as Piwik). It's open source.
Keep up to date backups of the site on multiple hard drives/SSDs/etc.
Anonymous payments
Bitcoin is fully traceable nowadays and tumbling/mixing your Bitcoin won't make any difference.
Tumblers are useless
Against my better judgement, I’m going with this click bait heading, but the premise is correct. Due to the software running real time analysis on the ledger, simply avoiding taint and breaking up coins is now entirely ineffective, as it matches the full bitcoin amount to be received over a period of time, as the software is built around a neural net of sorts (talking out of school here, I’m not a programmer) it appears to self-correct in real time as a more "likely" or "accurate" owner conclusion is reached.
Source: Blockchain Analysis and Anti-Money Laundering (X-post from /DarknetmarketsOz)
Meanwhile Monero was the only cryptocurrency that that the US government couldn't track when they took down one of one of the biggest darknet drug markets and seized the site operator's cryptocurrencies. This is because Monero is the only major cryptocurrency properly designed to be private.
Update:
There has apparently been some recent developments when it comes to tracing Monero. You can read more about it in my comment on Reddit or Raddle. I wouldn't worry too much about it at this stage though.
Use I2P or Tor when transacting with cryptocurrency. I2P has some privacy benefits in its design over Tor:
Unidirectional tunnels instead of bidirectional circuits, doubling the number of nodes a peer has to compromise to get the same information. Protection against detecting client activity, even when an attacker is participating in the tunnel, as tunnels are used for more than simply passing end to end messages (e.g. netDb, tunnel management, tunnel testing) Tunnels in I2P are short lived, decreasing the number of samples that an attacker can use to mount an active attack with, unlike circuits in Tor, which are typically long lived. I2P APIs are designed specifically for anonymity and security, while SOCKS is designed for functionality.
However, I2P doesn't have as much funding and reseach or as big of a developer community behind it. I2P's userbase is also a lot smaller than Tor's. A full comparison about that can be found here. Monero chose I2P over Tor.
More information about Monero + I2P/Tor is available here.
Either get cryptocurrency donations or use a peer-to-peer exchange that doesn't enforce KYC (Know Your Customer) to buy Monero or Bitcoin. Unlike centralized exchanges, private sellers on decentralized exchanges won't automatically submit all their data to the government. Even if you get all of the cryptocurrency via donations and it therefore has no connection to your real identity at all you should still anonymize it via Monero so that it can't be traced from the donation wallet to the hosting provider which you want to keep hidden.
Some private sellers on peer-to-peer exchanges won't require IDs, while some might require it. If nothing is mentioned, it's worth asking the seller before you send them any money. A few even accept cash meetups and cash by mail (watch out for being scammed or mugged though). If you do go to a crypto for cash meetup, make sure it's in a public place with lots of people in case something goes wrong. LocalCoinSwap, LocalCryptos, and LocalMonero even has sellers that accept gift cards (which you could buy with cash in a physical store). However, most gift cards are only redeemable in the country they were bought in, making this an option that won't work outside of the countries the sellers are based in. The one exception to this that I know of are Steam Wallet gift cards, which work internationally.
If your method of paying for cryptocurrency involves going somewhere to buy it/a gift card/a prepaid card/a burner phone, consider leaving your phone at home since it's essentially a tracking beacon. If it's a cryptocurrency for cash meetup you might want to have it with you in case something goes wrong though.
From what I've read there are some centralized exchanges that don't require KYC, but at least some of them freeze funds if they think it seems suspicious (which I would imagine a Tor IP would fall under) and they refuse to release the funds until they have been provided with an ID.
If you decide to buy cryptocurrency using a normal payment method, a wire transfer would be the option that involves the least amount of companies getting the transaction info, though I don't think you'd have much recourse with getting your money back if you got scammed and paid via wire transfer.
Bitcoin ATMs may require ID and usually have surveillance cameras around them, but this may vary depending on where you live.
If you bought Bitcoin, use XMR.to to exchange it to Monero. If the service provider only accepts Bitcoin and not Monero, exchange the Monero back to Bitcoin so that the Bitcoin has been anonymized. Don't pay in Bitcoin without exchanging it to Monero and back first.
Prepaid cards usually require SMS verification and are sometimes limited to purchases within the country they were sold in, so be sure to read up on whatever card you're considering using. Vanilla Visa gift cards used to be the go to for VPN buyers back in the day since they only required putting a zip code into a website, but things change, so read up about activation requirements and international purchases for the card in your country before buying anything and if you get information from an unofficial source, try and make sure that it's at least somewhat recent. If SMS activation is required there are two options. One option is buying a push-button burner phone and a prepaid SIM card at a physical store using cash, activate it at a major public place and then once the prepaid card is activated shut off the phone and take out the SIM card and the battery. Another option is buying access to a dedicated number in the same country that you bought the card in at an online SMS inbox site using cryptocurrency (the free SMS inboxes that have shared phone number might be used up already). The catch 22 there is that you wouldn't have any cryptocurrency yet at this stage, so it's not really an option unless you figure something out that I wasn't able to think of. If the prepaid card can't do international purchases you could withdraw the money into an anonymously created PayPal account (requires SMS verification). Expect the prepaid card and PayPal account to almost certainly get frozen if you try to pay with it over Tor. The risk is lower when paying via a VPN IP, but it's still a notable risk, especially if it's a VPN server with lots of users and you can never verify that the VPN provider isn't logging you. An anonymously paid for self-hosted VPN on a dedicated IP address in the same country that you bought the prepaid card would be less likely to cause the card to get frozen. A residential proxy/proxy would be the least likely to get the card frozen. Just don't connect to that residential or self-hosted VPN/proxy directly using your real IP address since your ISP would see that and since you would be the only user of that self-hosted VPN it would be directly identifying. You could use the prepaid card on public WiFi, but that will give out your general location and will give the WiFi network your IP address. It will also give the WiFi network your MAC address, so be sure to set the MAC address to be random (just search something like "[operating system] random mac address on wifi" on DuckDuckGo). Then there's the issue that most browsers other than Tor Browser, SecBrowser, and Bromite are bad combating browser fingerprinting. Sure you could also customize Firefox with arkenfox user.js (formerly known as ghacks-user.js) and a bunch of add-ons to combat all the different kinds of tracking, but you'll just make your browser more unique the more you modify it.
Anonymous Internet browsing
Use Tor when doing anything in connection with the site, including when using PuTTY and FileZilla. Verify the integrity of the Tor Browser installer using PGP before running it so that you know that it hasn't been tampered with. Use a bridge if you don't want your ISP/government to see that you're using Tor. Running Tor over a VPN may seem like a good idea, but even if the VPN provider really doesn't keep logs (which is impossible to verify) using Tor over VPN can make you easier to track since that makes the VPN service a permanent entry node [1][2][3][4] and there's also VPN fingerprinting. If Deep Packet Inspection (DPI) is a concern you can use Pluggable Transports [1][2] to disguise the Tor traffic. Keep Tor Browser up to date. Never run Tor Browser in full screen. That makes you more easily trackable as websites can detect the real resolution of your screen. Don't install any add-ons or plugins, that makes you a lot easier to track. If you have logged in and then logged out of a site it can link you to other accounts you have on the same site using session cookies if you login to those accounts without hitting the "New Identity" button to relaunch Tor Browser with a clean slate. Block JavaScript when the website doesn't require it, that's the closest thing you'll come to an ad blocker. Use the Hidden Service version of sites when available, that way your Internet traffic never goes onto the clearnet and it also adds three more proxies between you and the site's server for a total of six proxies.
Since you shouldn't use an ad blocker with Tor Browser it's important that you keep your operating system up to date to minimize the risk of getting infected in case you come across some malicious JavaScript via for example malvertising when you have JavaScript activated.
If you use Windows and don't want to switch to Linux (even though you can set up dual boot or just boot it from a USB without even having to install it on your computer), use a non-admin user account and have an admin account that you only use to authorize trusted software to run, that will mitigate 94% of critical Windows vulnerabilities. You can use a tool like W10Privacy to decrease the amount of tracking in Windows 10, just be sure that the tool you use is updated to match the latest version of Windows 10 or you might brick your OS.
Email
Use an end-to-end encrypted no logs email provider located outside of Five Eyes, Germany, Enemies of the Internet, and countries under surveillance - preferably ProtonMail - when signing up for all of those services. Use a different email address for anything not related to the administration of the website. ProtonMail has a Tor Hidden Service, but signing up for ProtonMail is only possible on the clearnet address, so you'd have to go into Tor Browser's privacy settings and change "Prioritize .onion sites when known" from "Always" to "Ask every time" when you register the ProtonMail account. Change it back to "always" once the registration is complete. And yes, it is possible to sign up for ProtonMail via Tor. It's not easy finding an exit node that hasn't gotten blocked yet, and you will most likely need a secondary anonymous email account on another email provider to send a verification code to, but it is possible. Don't try using a disposable email service, ProtonMail blocks pretty much all of them so you'll just waste time and will probably get your account frozen. Once you have made an account, go into Settings > Security and then wipe and disable the authentication logs. Once that's done - before you sign up for anything - log out and wait a while then log back in, just to see if their anti-fraud system decides to freeze your account or not.
If you go for a email provider other than ProtonMail, keep in mind that it has to be there for the long haul in order to be usable. If it suddenly shuts down without notice, you're pretty much shit out of luck. So try and go for one that has been around for a while and seems like it will continue to stick around.
Comparison of alternatives:
https://privacytools.io/providers/email/
https://www.safetydetectives.com/blog/email-comparison/#3
https://www.prxbx.com/email/
Other
Use a new username that you haven't used before.
Use end-to-end encryption for all private communications. ProtonMail has built-in end-to-end encryption between ProtonMail accounts. If you want to encrypt email with PGP when communicating with non-ProtonMail users follow this guide. That will allow you to import it into ProtonMail. Just remember that the subject line will not be encrypted by PGP. PGP/MIME gives out less metadata than PGP inline and is just better in general, so use PGP/MIME. For file transfers you can also use OnionShare if the receipient also uses Tor Browser or put the file(s) into a password protected .7z file using 7-Zip with the "Encrypt file names" option enabled + a password generator set to the max number of characters that you then upload to Disroot Upload. Be aware that the lufi software that Disroot Upload runs on keeps the filename visible after the file has been deleted. If you need an end-to-end encrypted pastebin, self-host PrivateBin or use Disroot's PrivateBin. Disroot uses a privacy respecting hosting provider and claim that they don't keep logs for services that don't require an account, such as Disroot Upload and Disroot's PrivateBin.
Use DuckDuckGo instead of Google. At least when doing work related to the site. It has a Tor Hidden Service that you can easily find by searching "duckduckgo onion" or "duckduckgo hidden service" on DuckDuckGo.
Rely on open source software and privacy respecting services when it comes to processing and storing data related to the site. PrivacyTools.io, awesome-privacy, AlternativeTo, and GitHub makes it easy to find privacy respecting alternatives.
Keep software on your devices up to date to decrease the risk of it being compromised by an exploit.
And yeah, I probably went pretty deep on some of the less relevant sections, but I thought it was best to include everything.
submitted by Fuck_the_RIAA to youtubedl [link] [comments]

Darknet MDMA market purchase study participants sought $100 prize x 10

Darknet MDMA market purchase study
Approved by Admins:
I am seeking participants in a darknet market study. Participation involves navigating through a simulated darknet marketplace, reading information about a darknet vendor and product, and answering questions about your impressions on a Qualtrics survey.
YOU MAY REMAIN COMPLETELY ANONYMOUS!
This is a completely simulated marketplace, located on a Surfacenet server (AWS), and therefore, does not require TOR or any specialised software to access. The entire site has been recoded to simulate an actual market and therefore, there is no requirement for the generation of a wallet, nor can actual products be purchased. You will not be directed to any actual darknet sites in the course of the participation.
To participate anonymously in the study, please use the following weblink: https://chfstsdarkmarket.s3-ap-southeast-2.amazonaws.com/index.html
By participating, you may choose to enter a prize draw to win 1 of 10 gift cards, each valued at AUD$100.
The study has been approved by the University of the Sunshine Coast Human Research Ethics Committee (approval number A201417)
FAQs Why are you conducting this study? We hope to better understand how buyers make purchasing decisions on darknet markets and what drives their purchase decisions
Factors include vendor appearance, ratings and reputation, forum comments, prices, advertisements and presentation of products, etc…
Is this a real darknet illicit market? NO – it is model of a darknet market with a combined forum hosted on the Surfacenet
Are these real vendors? NO – I created 16 vendors, logos, and pages offering products for sale, all with unique names and logos.
Can I really buy drugs and other items? NO – you cannot purchase anything on this site, you will not create a wallet, and you cannot expend funds
Can I access the darknet through this site? NO – at least, you shouldn’t. I have converted ALL of the onion hyperlinks to the local site to keep you safe
Do you collect any personal information? NO – you remain completely anonymous; in fact, feel free to use a VPN, TOR (either organic or built in to Brave) or other anonymising software
Must I run Javascript? NO – feel free to use any stripped down version of any browser and disable functionality of the browser (including extensions)
Must I create an account or log on to access the site? NO – the site does not have the usual access controls (including captchas) to limit access, also, the PGP keys are all bogus
What are you going to do with the data you collect? Analyse it and publish articles on our findings.
Will you make the findings available to the public? YES – as part of the publication process.
Thanks for your participation!
submitted by Dark_DoubleD to Drugs [link] [comments]

What is the point of storing unnamed functions in a variable?

What is the point of storing unnamed functions in a variable? Why not just create a regular function? Is there any point in doing things this way?
For example, in Javascript:
let show = function () { console.log('Anonymous function'); }; show(); 
Why not just create a function show() in the normal way, instead of storing it in a variable? They are both the same things, afaik.
submitted by No_Nefariousness2052 to learnprogramming [link] [comments]

This is a potentially stupid question, but I'm a little bit high and I'm confused. How exactly does a server get spun up?

So if I'm writing a node server file on my local computer, I spin it up by allowing my local host port 3000 (or frankly whatever I choose) and creating a "listening" state.
However, when you host servers online, where exactly do you host them? This may be a really stupid question, but when you upload your server code to an EC2 instance on AWS for example, is that considered a server because the code will run and live on there forever, always being open? And the only way to reach that code is via APIs that code serves, right? Like, what if you hosted on GoDaddy and had your own series of subdomains. Can you consider those subdomains servers if you deployed some kind of VM and ran the code from that VM which served directly to those subdomains?
Also, what are LAMBDA functions? Are they like anonymous functions or something in Javascript? I never quite got the grasp of what they were.
I'm [8/10]🥦 right now, uhh.
I'm sober now. This was NOT a troll post. You guys are awesome at /node. Fuck yeah. Go Lakers.
submitted by ibeeliot to node [link] [comments]

Proposal for an Emacs User Survey

Hi everyone,
I've had this idea for a while now to create and distribute a survey for Emacs users. The primary goal is for the community to have a better understanding of itself and how diverse it is based on interests and Emacs usage. I think it's amazing how the same piece of software can be so useful for so many different people, from software and web engineering, all the way to academia and journalism. On the flip side, there can be miscommunication at time from this diversity and how users essentially want different things from Emacs.
Right now, the most accurate data we have are the statistics on Melpa and the yearly Stackoverflow survey. I think there is so much more value we can gain by asking the right questions. But it is not an easy endeavor and I definitely need some help. Obviously, we don't want to bombard the wrong people with the wrong questions, so it has to be done right on the first try.

What needs to be tackled

Tentative Survey Questions

Would love to hear your thoughts on the topic! And if you are interested in helping out, I think my DMs are open.
EDIT: thank you for the badge!
submitted by abrochard to emacs [link] [comments]

Chrome OS Stable channel got promoted to Chrome OS 85. This is what changed!


https://preview.redd.it/w6v33efodnk51.png?width=1000&format=png&auto=webp&s=64a402d6eafbe49d4660ca46a5599bfd6e3473e7

_All right crew!

The Chrome OS Stable Channel got promoted to milestone today - from 84.0.4147.136 to 85.0.4183.84. As with every new milestone update, this brings massive new changes to the table, offering several new features, bug fixes, and security enhancements to better improve your Chrome OS user experience. Due to the sheer size, I may be missing a few things here and there. Here is what changed!

Like my content and want to buy me a coffee? You can support me on ko-fi using this link or by using the link in my Reddit profile. If you want to be kept up to date with everything new to Chrome OS, feel free to give me a follow. Thanks in advance for your support!! :)

Accessibility
Party like the 90's!
Ambient lock screen

This experimental feature is still in development. To try it out, you'll need to enable a Chrome flag. Copy-paste the following URL and change the dropdown from "Default" to "Enable": chrome://flags/#enable-ambient-mode 


New subpage to allow you to customize the Ambient lockscreen

Android subsystem

Goodbye Google Play Music. Hello YouTube Music!

Ash

Mic gain allows you to quickly adjust your microphone settings


Launcher search can now find Chrome OS Settings


New animation when windowing a maximized window.


Shelf apps will scale down if there are no more room left on the shelf. This behavior only applies if your Chromebook is in tablet mode.


Launcher search can now search for apps on the Google Play Store


Wi-Fi icon is much easier to see on the lockscreen.


Shelf items will be limited to the active desk. Requires modifying Chrome flag.


Virtual desk area now uses the accent color of your wallpaper

Assistant
Camera app

You can now pause and resume your video recording, and take a snapshot

Chrome

Tab groups and tab collapsing in action.


The brand new privacy redesign

Quickly see a small thumbnail preview of your tabs.



Quickly block third-party cookies


Extensions will be tucked away in this chrome icon


New permission chips
`

Printer labels, including the status of the printer, is integrated into Print Preview.

Chrome OS Settings

Chrome OS Settings search got a lot smarter


Sync your Wi-Fi passwords so that you don't have to remember them!

Family Link
Files app

New \"Open With\" and \"More Action\" when right-clicking a file

Input

Brand new bordered virtual keyboard.

Linux (Beta)
Media App SWA

This experimental feature is still in development. To try it out, you'll need to enable a Chrome flag. Copy-paste the following URL and change the dropdown from "Default" to "Enable": chrome://flags/#media-app 

OOBE (first-boot setup)
Print jobs app

See what's printing with the new Print jobs app.

PWAs
Quick Answers
Wallpaper picker app

The nitty-gritty stuff


This advanced section is a long list of things changed that impacts web developers and enterprise users. There are a lot more nitty-gritty stuff in the full changelog linked below, but this list covers the most important Blink and Chrome changes introduced in this release cycle.

Blink
Chrome
Enterprise

Platform changes


This part covers the most significant platform changes I found in this build, from platform version 13099.110.0 to 13310.59.0. Platform updates typically include low level changes like kernel, driver updates, and other device-specific fixes.

Linux 4.4
Linux 4.14
Linux 4.19
Linux 5.4
Libapps
Overlays

Click here to see the full official list of changes by Google (no platform logs, sorry). Enjoy, and happy updating!
submitted by kentexcitebot to chromeos [link] [comments]

A Guide To Develop Real Time Apps With Node.js

We have been using lots of mobile applications to carry out day to day tasks. So building applications that users can interact with in real-time has become a standard for many developers. The applications that today we use whether they are mobile, web or desktop apps have at least one real time feature. Mostly real-time messaging and notifications are the commonly used real-time features that we use in applications.

What Do Real Time Applications Do?

As mentioned before, real time applications functions within a time frame the user feels it is occurring in real time. Within real-time applications or real-time computing, the latency is set under a defined value, typically estimated in seconds.
Know the important points to consider while developing real time apps at- What To Consider While Developing Real Time Applications?

Role Of Node.js In Real-Time Applications-

Node js helps with its non-blocking I/O and event-driven features to the applications where speed and scalability are constant focus. Nodejs gives continuous two-way connections to applications like social media, forums, ad servers, or stock exchange software.

1. Reusing And Sharing-

Nodejs supports microservices architecture and it allows developers to reuse the library code package and share it in various projects. It not only saves development time and increases productivity.

2. Scalable And Rapid-

As Node Js is javascript based, it executes rapidly like JS. So an application with event loop easily handles multiple client requests.

3. Event Based Server-

Real time apps handles a large number of real-time users. Node.js development supports response based on the event-driven server that supports non-blocking functioning.

4. Proxy Server-

Node js will be your best choice where intermediary administrations are necessary. To use node.js server as a proxy server, a developer needs to add a code of 20-line, and your application will turn into an ideal fit to support streaming information from numerous sources.

5. SEO Friendliness-

The backend rendering by Node.js gives the website more visibility and engagement too. The applications get more speed and user experience as well as a get performance that is required to rank according to SEO prospects defined by Google.

Building A Real-Time Chatroom With Node.js-

Here we’ll see how to build a simple chatroom that users can use to communicate with connected users. With this, multiple users can connect to the chatroom and users can send messages that will be visible to all users connected to the chatroom.
Features of simple chatroom-

Application Environment Setup-

  1. Create directory
  2. Run the npm init to set up package.json file.

Install Dependencies-

Here we’ll use express, ejs, socket.io and nodemon packages to build app.
Command to install ejs- npm install express ejs socket.io –save

npm install nodemon --save-dev 
Add a start script to your package.json file to start the application with nodemon.
"scripts": { "start": "nodemon app.js", }, 
Use the following command to start app-
npm run start 

Set Up The Application Structure-

With all the Dependencies that will need for this project installed, build app project structure. For this, you have to create some directories. Get that done so that your app structure look like-
|--app.js |--views |--node_modules |--package.json |--public |--css |--js 

Step 1: Build Server-

It is necessary to get express up and run. For this open app.js file and paste the code as follows:
const express = require('express') const socketio = require('socket.io') const app = express() app.set('view engine', 'ejs') app.use(express.static('public')) app.get('/', (req, res)=> { res.render('index') }) const server = app.listen(process.env.PORT || 3000, () => { console.log("server is running") }) 
Now start working on the sockets.io initialization. Add the following code at the end of app.js file.
//initialize socket for the server const io = socketio(server) io.on('connection', socket => { console.log("New user connected") }) 
If you now run your server with npm start you will have the option to receive new socket connections. So let’s build a front-end.

Step 2: Build Front-End-

Create a template in views folder, and for this create index.ejs file and paste the below code:
 Simple realtime chatroom    

Realtime Chat Room

Anonymous
    Note how we have included the script of the client-side socket.io library and the custom javascript file we are going to use in this code.
      
    We have added a button with ID messageBtn to send a new message and button with ID usernameBtn to submit new username. All user messages will appear in the unordered list with ID message-list. If a user is typing a message, it will appear inside the div with class info. Now the buttons are static. Let’s connect the front-end to the server. Create a new Javascript file named chatroom.js inside the js folder of the public directory. Inside Javascript file, we have to connect the socket from front-end.
    (function connect() { let socket = io.connect('http://localhost:3000') }) () 

    Step 3: Send Message-

    Now we implement the send message feature. First, we will set up the front-end to emit a new_message event when a new message is submitted. Since the client-side should also be configured to get new messages other users send from the server, the application should also listen to receive_message events on the front-end and show the new message on the web page properly.
    We can get done both these tasks using the following code-
    let message = document.querySelector('#message') let messageBtn = document.querySelector('#messageBtn') let messageList = document.querySelector('#message-list') messageBtn.addEventListener('click', e => { console.log(message.value) socket.emit('new_message', {message: message.value}) message.value = '' }) socket.on('receive_message', data => { console.log(data) let listItem = document.createElement('li') listItem.textContent = data.username + ': ' + data.message listItem.classList.add('list-group-item') messageList.appendChild(listItem) }) 
    Each time the receive_message event occurs on the client side, we change our DOM to deliver the message into the screen. On the back-end side, when you receive a new_message event, you have to emit a new event to all clients. For this, use io.sockets.emit().
    Change connection event in app.js file as follows:
    io.on('connection', socket => { console.log("New user connected") socket.username = "Anonymous" socket.on('change_username', data => { socket.username = data.username }) //handle the new message event socket.on('new_message', data => { console.log("new message") io.sockets.emit('receive_message', {message: data.message, username: socket.username}) }) }) 
    At the time of handling new_message event, server emits a receive_message event to connected users. This event is received received by all users connected to the server, so that new messages are displayed on their chatroom interfaces.

    Step 4: I’m typing-

    For this, we add new event listener to the message input box to emit typing event when a keypress occurs. As keypress occurs on the message input box, it indicates user is typing a message, the typing event tells server that user is typing a message. The client side also listens to typing events emitted by the server to know whether another user is typing a message and show it on the UI.
    Inside the connect function in chatroom.js, we add the following code.
    let info = document.querySelector('.info') message.addEventListener('keypress', e => { socket.emit('typing') }) socket.on('typing', data => { info.textContent = data.username + " is typing..." setTimeout(() => {info.textContent=''}, 5000) }) 
    submitted by SolaceInfotech to node [link] [comments]

    what do anonymous function do in javascript video

    Lambda Functions - Mary had a little lambda by Anjana Vakil How Do I Tails?: A Beginner's Guide to Anonymous Computing ... Arrow Functions - Beau teaches JavaScript - YouTube 15 - C# - Anonymous functions, Lambda Expressions - Urdu ...

    Sometimes it's useful for an anonymous function to be able to refer to itself. For example, the function may need to recursively call itself or add properties to itself. If the function is anonymous, though, this can be very difficult as it requires knowledge of the variable that the function has been assigned to. This is the less than ideal solution: An anonymous function is not a function with the name "". It is simply a function without a name. Like any other value in JavaScript, a function does not need a name to be created. Though it is far more useful to actually bind it to a name just like any other value. But like any other value, you sometimes want to use it without binding it to a name. How do I make the HTML aware of JavaScript functions that are inside the anonymous function? Is there some sort of best practice in these situations? Thanks for all your help in advance. Well, if you give it a name, it's not anonymous anymore, is it? But the code that you are quoting shouldn't be an anonymous function anyway. leaving the name out is only good if your function is obviously correct, and very short. IMO it's very bad idea to use complicated function without a name. The anonymous function is declared with a variable name division and expecting two values from anonymous function calling. After passing 2 values from division(20,10) to function call then we will get 2 as output. 3. Anonymous Function with Return Statement. Syntax: function functionName(parameters1,parameters2,…) {return function(a,b,…..) The ECMAScript specification does not have any mention of the term anonymous. An anonymous function allows a programmer to create a function that has no name. In other words anonymous functions can be used to store a bit of functionality in a variable and pass that piece of functionality around it and created at runtime. Anonymous functions are declared using the function operator instead of the function declaration. Normal function definition: However, in the SpiderMonkey JavaScript engine, the serialized form of the function shows as if it has the name "anonymous". For example, alert(new Function()) outputs: function anonymous {} Since the function actually does not have a name, anonymous is not a variable that can be An anonymous function is a function without a name. An anonymous function is often not accessible after its initial creation. The following shows an anonymous function that displays a message: let show = function () { console .log ( 'Anonymous function' ); }; show (); Anonymous functions can be created in JavaScript. What do anonymous function do? Overwrite variables that are to be kept updated Process a variable before passing it on to another function Automatically define the scope of a value inside a parameter What you have done is created a new anonymous function that takes a single parameter which then gets assigned to the local variable myMessage inside the function. Since no arguments are actually passed, and arguments which aren't passed a value become null, your function just does alert(null).

    what do anonymous function do in javascript top

    [index] [277] [6742] [5923] [3053] [174] [409] [919] [8273] [4624] [9073]

    Lambda Functions - Mary had a little lambda by Anjana Vakil

    An arrow function in ES6 has a shorter syntax than a normal function and does not bind its own this.💻 Code: http://codepen.io/beaucarnes/pen/KWEVwQ?editors=... Mary had a little lambda, a function pure as snow. And for every program that Mary wrote, the lambda was all she needed to know. Python’s lambda, a tiny anonymous function, can be useful in a ... Try watching this video on www.youtube.com, or enable JavaScript if it is disabled in your browser. How to code to convert Celsius to Fahrenheit in JavaScript tutorial for beginners - Watch our blogs at : https://learnsimple1987.blogspot.in ===== SUBSCRIBE US ===== In this tutorial we are going ... Došlo je do pogreške. Pokušajte pogledati videozapis na adresi www.youtube.com ili omogućite JavaScript ako je onemogućen u vašem pregledniku. 23 JavaScript ES6 Anonymous function by Muhammed Essa. 4:34. 24 JavaScript ES6 Function Constructor by Muhammed Essa. 1:53. 25 JavaScript ES6 Arrow Function اكاديمية حسونة - ادخل سجل في موقع ويب الاكاديمية من الرابط التاليhttps://www.hassouna-academy.com/شرح جافا ...

    what do anonymous function do in javascript

    Copyright © 2024 best.betbonus-sport.pics