Archived projects

WaiMaiPayDemo: https://github.com/ahmetson/wai-mai-paiBackend Source Code: https://github.com/ahmetson/api-wmpThis was the project I was working on in 2017.WaiMaiPay is a delivery man's app that notifies the clients as it gets closer. Sometimes, people are not checking their smartphones. The delivery guy using it should call the customer. WaiMaiPay calls the clients as delivery guy is closer.It tracks the distance by GPS.https://github.com/ahmetson/smartcontract-practiceA side project I tried to make for the internsLearn by creating real projects.Blockchain part: https://github.com/ahmetson/element-words-smartcontractsGame: https://github.com/ahmetson/element-wordsA demo for the Neo hackathon.https://www.youtube.com/watch?v=hVdgSr93qtghttps://www.youtube.com/watch?v=YGLvEwzZU5c 

Read More

Israel vs Hamas: peaceful solution

The 7th October 2023 event is a terrific event that occurred in Israel.What I want is for Israelis to show mercy for this. Because the politics that Hamas is playing versus what Israel is playing are on the different level.Israel is more powerful than the established, prosperous nuclear power supported by the collective West, especially by the USA.To have a piece, we should have mercy. What I despise is that Israel is pretending to be merciful because mercy is not a punishment but forgiveness. Where is the mercy in the warnings when they want to punish Palestinians anyway?Another thing I despise in the politics of Israel is playing the victim when they are the aggressor against Palestinians.What is the real mercy is when in Africa, white people were ruling over the black people, some black people uprised against them. They used all methods to be heard—mainly bombing near the schools.Eventually, they took the victory and brought justice to the black people by giving them the same rights as white people. Nelson Mandela, the leader of this uprising, was named Person of the Year. He is respected by the West, which didn't focus too much on his bombings.What is the solution for Israel giving up half of the land to the Palestinians? To avoid revenge and hatred from their side, Israel, as the wealthiest country, could compensate with money by helping to build Palestine by modernizing it.Rather than spending much on the military budget, they could pay more on building Palestine. Jews would not be richer and have a comfortable life as today, but in return, they would get peace, and they wouldn't have to fear danger behind the border.When a girl X breaks up with a boyfriend and feels a massive hatred in her heart, she casts on porn or goes to a club to have nights with dozens of people. You can't have mercy on such kind of people too much.When girl Y is sent to trade her body at age 15 by her alcoholic parents, the girl is doing the same bad, unjustified things as girl X. But you should have mercy on girl Y because of the conditions that created it. 

Read More

Notes on "Practical Deep Learning for Coders"

31 October 2023Course: https://course.fast.ai/Book: https://github.com/fastai/fastbookIntroDeep Learning is a computer technique to extract and transform data using multiple neural network layers.Top used use cases:NLP: answer questions; speech recognition; summarize; classify; find; searchComputer Vision: satellite image interpretation, face recognition, captionMedicine: finding anomalies; counting features in slides; measuring; diagnosingBiology: classifying genomic tasks; analyzing cell interactionsImage GenerationRecommend Systems: search engines, home page layout, product recommendationPlaying GamesRoboticsFinancial, Logistics, etc...In 1943, Warren McCulloch and Walter Pitts developed a mathematical model of artificial neurons. It's declared in "A logical calculus of the ideas immanent in Neurous Activity."The neuron could be represented as addition and thresholding.Frank Rosenblatt gave artificial neurons the ability to learn. He even created the first device on this principle: Mark I Perceptron.We are now about to witness the birth of such a machine - capable of perceiving, recognizing, and identifying the surroundings without any human training or context."The Design of an Intelligent Automata"Frank RosenblattMarvin Minsky and Seymour Papert wrote a book called "Perceptrons." They showed that the device needs multiple layers to learn simple mathematical functions.Perhaps the most pivotal work in neural networks was the "Parallel Distributed Processes" by David Rumelhart, James McCallen, and the PDP Research Group, released in 1986.PDP approach for the programming framework defined requires:process unit setsstate of activationoutput function for each unitconnectivity pattern among unitspropagation rule for propagating through the network of connectivitiesactivation rule for combining inputs impinging on a unit with the current state of that unit to produce output for the unitlearning rule whereby patterns of connectivity are modified by experiencean environment where PDP must operateModern Neural Networks use an approach similar to PDP. The book says that the theoretical knowledge was misunderstood, and the issues held back the development until 2010. But also says that despite having two layers, it was too big and too slow to be helpful. Recent advancements in the hardware allowed training neural networks with more layers.For learning, it is best to use Jupyter Notebooks. The Jupyter Notebooks are software that allows you to include assets and code together.The deep learning uses the neural networks. It's part of machine learning. The deep learning model process and its training apply to the general concepts of machine learning.Machine learning is another form of programming where instead of the algorithm, you write the desired output, and the software finds the path.The term "machine learning" was coined by Arthur Samuel from IBM in 1949. In his 1962 classic essay "Artificial Intelligence: A Frontier of Automation," he wrote machine technique.Rather than describing each step to solve the task, show an example of the problem to solve. Then, let the program figure out the algorithm.There is an actual performance of weight assignment. Then, there is an automatic means of testing performance—a mechanism for improving performance by changing weight assignments.The weights are variables. The weight assignments are a choice of those variables. The program inputs are variables. In modern terminology, machine learning programs are called models.The weight assignment is the second input describing the actual input. In modern terminology, weight assignments are called model parameters.Automatic testing means you let two models work against each other. Actual performance is the desired result. After each iteration, you adjust the model to test the outcome.If you automate the iteration to adjust the model parameters, the program could learn from experience.This automatic iteration is called model training.Once the weights were adjusted, they became part of the model. The neural networks are mathematical functions. The mathematical proof called the Universal Approximation Theorem shows this function can solve any problem in theory.The general approach to adjusting weights is made via Stochastic Gradient Descent (SGD), a mathematical method.The model includes weight, a function producing results, and performance updating weights. The functional part is called architecture.Prediction is the result. The loss is the measurement of the performance. It's measured against the labels.Transformers are code that is applied during the training. There are item and batch transformers. The inputs are not used to train. Some part of the set is kept separated to test that training.The training input is called a training set, while testing data is used as a validation set. Over time, as the validation set is set, the model starts memorizing the labels. Thus, it doesn't find the generalizing patterns. This is called overfitting.Overfitting is the single, most important issue in the model training.Resnet is one of the architectures. It could have 18, 34, 50, 101 and 150 layers. The more layers mean training and with less data will be prone to overfitting.The model that has trained weights is called pre-trained model. It's better to build on the pre-trained models by changing some layers with yours. Using pre-trained model for a task different than what it was originally trained is called transfer learning.Fine tuning is a transfer learning technique where parameters of pretrained models update by additional epoch. Epoch is how many times the model looks at the data.Machine learning has some limitations:A model can not be created without dataIt can learn the patterns from input dataDeep Learning VocabularyLabel - a data we are trying to predictArchitecture - a template of a model we are tring to fit a model; an actual functionParameters - values in model that change what task it can do and updates throughout the training process.Fit - update the parameters such that predictions of model using input to match output labels. Also called Train.Fine Tune - special technique in transfer learning to update pre-trained model.Epoch - one complete task to pass through input dataLoss - a measure how good model is using validation setTraining set - data for trainingValidation set - data for measuring lossOverfitting - training remembers specific features of input than generalizing pattern.CNN - neural network for computer vision

Read More

Phishing by Vera token

2 August 2021Being myself in the crypto industry and as a developer, I never thought I would be scammed. But that happened. And it happened quickly. I was using https://farmfol.io/ to track my wallet balance. And saw that it has 100K USD. I thought that someone deposited his tokens to me accidentally. So, I researched the token. The token is called Vera. And it’s domain name is http://thevera.io/. The website had a “claim” button. I clicked on it to approve my wallet. Then, I suddenly realized that they might withdraw my crypto wallet. It was on Binance bright chain, where transaction confirmation speed is 3-4 seconds. I was a few seconds late before the transaction was confirmed. As a result, I was screwed for 2BNB (~600$). I tried to remove the token from my wallet but without luck. Then I tried to transfer tokens to an empty address, but that didn’t work either. Tokens are smart contracts where the token developer programs every token function. The developer of the Vera token puts a high fee on any transaction or completely rejects any method call. This case also proved my Blockchain idea that makes users own their wallets and accounts. What is the point of having a private key when the tokens in my balance are without my acknowledgment? Or when I can’t do anything with them because the developers decided like this. Solution: The Seascape blockchain will have one token with unlimited minting. When users create a new token, they allocate the part of the native token and add an alias name. Since the core part of the token is a native token, the transferring and burning of the token will be available for any user.Besides that, since all tokens are backed by the native token, through the native token, users will be able to exchange tokens with each other without any dex.

Read More

RNB Blockchain whitepaper

9th May 2021OVERVIEWGenerating secure random numbers is a challenging task. By fast numbers, I mean that a) predicting what the next number is impossible, and b)  It generates numbers without putting them in favor of one of the stakeholders.The nature of public blockchain, with its decentralized p2p architecture, is ideal for producing secure numbers.This whitepaper discusses the implementation of secure random numbers using blockchain. GOALS OF THE PROJECTFree public random number generatorSecure, where numbers are not predictable.Generated numbers are stored in the database permanently for checking in the futureGenerated numbers are not programmed to drop specific numbers with high probability.RNG V 0.0 User-generated numbersSince the creation of the blockchain takes some time, we decided to make a quick version of the RNG. This short version of the RNG blockchain is versioned as 0.0.In this version, the nodes accessing the RNG send a random number in their transactions. The sum of all random numbers divided by all senders within the block is defined as a new Random number for the block.The RNG V 0.0 will have the following transitions:Request a new Random number   (DONE)- accepts (one random number) in byte32 format. This number is used to generate a random number. To get a random number, the caller should stake some tokens.- returns another random number in byte32 format. It requires 0.01 RNG tokens to be cut from the staked RNG tokens.Send a random number- accepts (one random number) in byte32 format. This transaction could be sent by participating validators only.Stake a token- Stake 100 RNG tokens. It will register a user to generate a random number. A new stake will be added to the previous ones if a user has already staked tokens.Get a staked token amount- accepts a wallet address- returns an amount of staked tokens for the user.Change fee- accepts a new fee for requesting a Random Number and deadline (up to 24 hours in seconds and a minimum of 1 hour).- whether this was accepted.If ⅔ of the users call this transaction with the same fee, the fee for requesting payment will be updated.RNG V 1.0 THEORETICAL SPECIFICATIONSHow does the RNG blockchain work without going to the programming language and technology used in it?The idea is that the RNG blockchain generates random numbers in every block of the blockchain.All validators of the RNG blockchain must provide a unique wallet address for every block for consensus voting. The sum of all unique wallet addresses divided by the number of voters is the Generated Random number of that block.  We came up with three solutions to prove that the signature is nondeterministic.Any node that participates in the generation of random numbers also has a representative signature. This signature stakes 100 RNG tokens, which allows this node to participate in number generation. Any unique signature used once can be used to withdraw 50% of the staked RNG tokens per user from the blockchain within the next 30 days after usage of the signature. Suppose the unique signature is used for withdrawing a token. In that case, the representative node is kicked out from the participation of random number generation, while the rest of 50% of staked RNG tokens are redistributed among other stakeholders. So, it is in the interest of all stakeholders to try to find the signature or guess it for the other stakeholders to prevent them from cheating.The node client should always be public, meaning everyone could join the blockchain for random number generation without anyone’s permission. Since the sum of the hash of all wallets is changing dramatically even after the addition of one more signature, it will allow the blockchain to be unpredictable if many nodes connect to the blockchain from around the world.There is the option where anyone, whether a unique signature or representative signature or not related to the RNG signature, can put 1 RNG token, the future block number, and the possible value. If the value generated in the future in the block number is correct, the wallet address could take 50% of all stake RNGs in the blockchain. This will keep all stakes trying to put unpredictable signatures, while those who want to earn money will always try to check the blockchain for prediction. This will ensure that generated random numbers are safe.RNG Blockchain Technical RequirementsIt is a blockchain in Cosmos Network created with Cosmos SDK on the tendermint core. RNG blockchain has the following features:A lightweight clientStates in key-value format: 2.1. A list of all unique addresses of every representative address.    Representative Account => array of unique addresses    Unique address => representative2.2 List all random numbers since block one, including unique addresses and their numbers.    Block number => struct(random_address, array(unique addresses), unique_address_amount, proposer)2.3 A list of representative addresses with their staked RNG tokens amount.    Representative stake => stake amount2.4 A balance of each address of RNG tokens that are not used for staking:    Wallet address => balance2.5 A prediction list for each block    Block number => array of Structs(predicted_address, payment_address)    Prediction reserves => balance.Functions such as3.1 Stake RNG tokens to add a representative token to the data structure 2.33.2 A function to push unique address for generating random numbers, 3.3 Generating random number by the sum of all unique addresses pushed to the server, 3.4 Unstaking tokens with the representative address3.5 Unstaking tokens with a unique address, which automatically distributes 50% of staked tokens to other token holders, while 50% goes to the individual address3.6 claim additional tokens for stakes that they got from other stake token distribution, 3.7 Spend 1 RNG with the random number and the block to predict the upcoming number to withdraw 50% of all staked tokens.An easy RPC to fetch the random number by event broadcast or rest API.A bridge to the Ethereum blockchain where RNG tokens are minted. Bridge to transfer into or out from rng blockchain rng tokens.an intelligent contract on the Ethereum blockchain locks RNGs transferred to the RNG blockchain.RNG blockchain Technical implementationWe edit the voter module by adding additional features, such as auto-generating the private keys that voters submit to the block (automatically by the module). The voter module will store the private keys in the local storage, encrypted by the voter’s primary signature.We will also create a new rng-history module to store all the rng states. This module is connected to the voter module to get the voter’s signatures.Finally, we edit the consensus module to connect to the rng-history module to write data into rng states.RNG tokenRNG tokens are erc20 tokens on the Ethereum blockchain. USDT tokens back them. 1 usdt = 10 rng token. If a user wants to mint 100 RNG tokens, he has to call the mint function of the RNG token. The mint function will lock ten USD on behalf of the user to issue RNG tokens.If a user wants to take back his USDT tokens used to mint RNG tokens, then the user calls the burn method in the RNG token, which will burn RNGs while transferring the locked USDTs to the user.MILESTONESWrite the whitepaperTill 16th May, write all technical aspects of the RNG blockchain and RNG token.Write the Demo blockchain (without bridge)Till the end of May 2021, write the RNG blockchain using Cosmos SDK.Write the RNG tokenTill 10th June 2021, write the RNG token with mint and burn functions.Write the Bridge blockchain.Till 20th June 2021, write the RNG bridge between the RNG blockchain and the Ethereum blockchain.Launch of the productTill 30th June 2021, test the system and launch it.Write the Whitepaper 2.0 for the profitable version of the RNG blockchainHow do RNG blockchain nodes earn money? In the next version of the blockchain, this should be possible.

Read More

Welcome to Ahmetson.com

Hello and Welcome to the Medet Ahmetson's thoughts.

Read Posts