<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David whyte on Medium]]></title>
        <description><![CDATA[Stories by David whyte on Medium]]></description>
        <link>https://medium.com/@kingstonwhyte87?source=rss-a31f1cba32d5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*W-ZIAlw3OWkfmKtGO4-T0Q.jpeg</url>
            <title>Stories by David whyte on Medium</title>
            <link>https://medium.com/@kingstonwhyte87?source=rss-a31f1cba32d5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 20:48:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kingstonwhyte87/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Custom Error Types With Rust]]></title>
            <link>https://medium.com/@kingstonwhyte87/custom-error-types-with-rust-63947a1ded01?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/63947a1ded01</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[error-handling]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 15:18:04 GMT</pubDate>
            <atom:updated>2024-09-10T15:18:04.631Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uN6wIgJrR3JrMhASZNeCTA.png" /></figure><p>So you are building this function to do a specific thing and you expect a success or an error. But you also expect different types of errors and you want to take different actions based on the error types. I recently had to deal with this, that is why I am making this tutorial.</p><p>So I have a create wallet function that makes you a new wallet on the blockchain that I am working on. I expect that the wallet is either created successfully, or there is some sort of error. I want to know what type of error happened because so many things could happen. There could be a file not found at the point of reading some data, there could be a network error at the point of talking to other nodes, etc…</p><blockquote>cargo add strum, strum_macros</blockquote><p>First of all, run the above command to add strum. Strum helps us convert enums to strings. This is much faster than implementing the Display trait for our enum.</p><p>Create an enum that contains all the possible enum types for this use case. Here I have defined 4 error scenarios that could occur while creating a wallet.</p><pre>#[derive(strum_macros::Display, Debug)]<br>enum WalletCreationError {<br>    FILE_NOT_FOUND,<br>    DATABASE_ENGINE_FAILED,<br>    NETWORK_ERROR,<br>    GENERAL_ERROR<br>}</pre><pre>use std::error::Error;<br><br>impl Error for WalletCreationError {<br>    <br>}</pre><p>You need to implement the Error trait for WalletCreation error because to return that enum as an error type normally that will not be possible because it has no Error trait. This is sort of like inheriting the Error property so that it can be cast or act like an Error.</p><p>Eventually, we will return it like this.</p><pre> return Err(Box::from(WalletCreationError::FILE_NOT_FOUND));</pre><p>Now let&#39;s look at the whole create wallet function</p><pre>fn create_wallet()-&gt;Result&lt;(), Box&lt;dyn Error&gt;&gt;{<br>    let a = 1; // to produce error <br><br>    match a {<br>        1=&gt;{<br>            return Err(Box::from(WalletCreationError::FILE_NOT_FOUND));<br>        }<br>        2=&gt;{<br>            return Err(Box::from(WalletCreationError::NETWORK_ERROR));<br>        }<br>        _=&gt;{<br>            return Err(Box::from(WalletCreationError::GENERAL_ERROR));<br>        }<br>    }<br><br>    return Ok(())<br>}</pre><p>We purposely try to generate an error from this function based on the value of a. Let&#39;s assume a is the result of an operation or set of many operations.</p><p>Now that we are done with the create wallet function, let us use it and handle the different error scenarios.</p><pre>fn main() {<br>    println!(&quot;Hello, world!&quot;);<br><br>    match create_wallet(){<br>        Ok(_)=&gt;{<br><br>        },<br>        Err(err)=&gt;{<br>            if let Some(wallet_error)= err.downcast_ref::&lt;WalletCreationError&gt;(){<br>                match wallet_error {<br>                    WalletCreationError::DATABASE_ENGINE_FAILED =&gt;{<br>                        println!(&quot;Database engine failed&quot;);<br>                        return ;<br>                    }<br>                    WalletCreationError::FILE_NOT_FOUND=&gt;{<br>                        println!(&quot;File not found&quot;);<br>                        return ;<br>                    }<br>                    WalletCreationError::GENERAL_ERROR=&gt;{<br>                        println!(&quot;General error &quot;);<br>                        return ;<br>                    }<br>                    WalletCreationError::NETWORK_ERROR=&gt;{<br>                        println!(&quot;Network error&quot;);<br>                        return ;<br>                    }<br>            }<br>        }<br>    }<br><br>}</pre><p><em>err.downcast_ref::&lt;WalletCreationError&gt;() </em>This part converts the boxed error to its internal type: WalletCreationError. The result is an Option&lt;T&gt; and then<em> if let Some(error) </em>checks this result if it has Some and not None. The rest is history. So I may want to display a different message based on the error type, or return a response, take some action, or even log some data.</p><p>So good luck, happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63947a1ded01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vhennus Manifesto]]></title>
            <link>https://medium.com/@kingstonwhyte87/amorgens-manifesto-dd692dc6a3b1?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd692dc6a3b1</guid>
            <category><![CDATA[governance]]></category>
            <category><![CDATA[metaverse]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[decentralization]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Tue, 13 Aug 2024 06:10:22 GMT</pubDate>
            <atom:updated>2024-08-13T06:16:05.408Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UY7q59GLXQYM3Bx1Eu4krg.jpeg" /></figure><p>vhennus is a digital nation, a group of people with one ideology in common, and that is love.</p><p>We believe in growth, care, love, giving, and happiness.</p><p>We believe in putting our religion, race, class, gender, and every other thing that divides us aside and putting love and care for one another first.</p><p>We are a united people who want to build and advance man. We want to grow, evolve, and make life better on Earth and beyond.</p><h3>The Passport</h3><p>Each citizen will get access to a digital passport that will serve as an identification tool. This passport can be used in malls, hotels, parks, digital platforms, etc.</p><h3>Our Anthem</h3><p>To love is to care for others, to treat others as we will treat ourselves. We will let go of ourselves and see beyond, see that we are one. We stopped dreaming for ourselves and started dreaming for us. Together we will grow, and shine throughout the galaxy. We do not fear, for no one can fight love. We are love, God is love, we build the future, let go of the past, and live in the present.</p><h3>What Do We Believe In?</h3><p>We believe in love. We don’t care about religion gender or ethnicity. We believe we have been separated by these things. Humanity has been raped, and deprived of growth and we believe it’s time to stand up and live. But the arms and legs and all organs must be in agreement. We must look beyond ourselves and care for others for that is love. Love cannot be learned or purchased and taught. Love is in you, you either are in love or you are not. It’s either you are light or you are not. Love has no standards or measurements, there is no little love or small love or faded love. You should be bothered when you watch the news and see people killed. The fact that the whole world is not constantly crying shows we don’t care and we are not one. Everyone should quit their jobs, no planes should fly, no business should be open, and the whole world should stop because a child was shot. We should all cry. if we can all care like this, the earth will be the “heaven”.</p><p>Love is our commandment, love is what we believe in. It shows in our business, platform, currency, and system, we do everything from a place of love.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q10GBcQDzeSLZn9F" /></figure><h3>Our Commitment to Citizens</h3><p>We want joy, happiness, and love for all our citizens and these are the things we pledge to do for them:</p><p><strong><em>Jobs</em></strong>.</p><p>We will not rest until resources are allocated properly and each citizen who wants a job has one. If a citizen is out there without a source of income, that is a problem for us.</p><p>vhennus businesses will be financed by vhennus and its citizens, these companies will only employ amorgans citizens. These companies will prioritize vhennus citizens. This way jobs are created for us. We will have a job board where companies can hire people in our nation.</p><p><strong><em>Access to funding for business.</em></strong></p><p>We believe that great and innovative ideas should be funded. Brilliant ideas have been suppressed for too long. We pledge to fund every logically viable business idea.</p><p>We have a portal where founders can package their ideas and share them with the public. Citizens can fund these ideas by buying the company tokens. Noncitizens can also buy the tokens and make a profit from the success of the companies. vhennus can also fund companies. We will have a team that will review each company and decide if the idea is viable. This review process will be recorded and any application decline must have a solid reason. A founder can appeal a decline and have a separate team review the application. The companies that get funded will be given funds in their wallet. The wallet address will be public, the salary of each founder and employee will be public and the public must know how this fund is spent. Every spend will be tracked and companies that transact with vhennus companies will be rewarded in company ratings. These ratings qualify companies for more funds. For example, a founder who chooses to buy flour from a vhennus company will get better ratings.</p><p>This way money circulates between vhennus businesses.</p><p><strong><em>Access to funds for research</em></strong></p><p>We will fund research that will advance humanity. Many inventions and innovations have been suppressed, we want to give hope, light, and a fertile soil for innovation to grow.</p><ul><li>Genetics</li><li>Technology to speed up plant growth</li><li>Alternative energy</li><li>Nural technology</li><li>AI</li><li>Transport technology for Earth and space</li><li>Computing</li></ul><p>These are a few priorities. We are open to any field of research that you want to do, as long as it advances and develops us. All you need is the knowledge and intellectual capacity to lead the research and the passion to keep going. We will fund it. We have a portal where you can submit your hypothesis and we will review it. This review process will be live-streamed and transparent.</p><p><strong>Access to information</strong></p><p>The knowledge we gain from our research will be available for citizens to use to propel their lives and businesses.</p><p><strong>Access to healthcare</strong></p><p>We care about your health, as a citizen, you will have access to healthcare research and information. You will have access to hospitals in your local counties. The hospitals owned by vhennus citizens are obligated to give citizens a discount.</p><p><strong>Access to recreation</strong></p><p>Citizens and the nation own golf clubs, resorts, hotels, parks, event centers, etc… Citizens will be given discounts.</p><p><strong>Access to a universal basic income</strong></p><p>Citizens who do not have jobs, and who are living in countries that have failed governments can apply for the UBI plan, they will get cryptocurrencies in their wallets every month.</p><h3>Our business relationship with the outside world.</h3><ul><li>We need to build valuable products that non-citizens/citizens will buy, and this will make up our exports.</li><li>Our companies will sell to everyone</li><li>The inflow of currency will boost our economy</li></ul><h3>Key Economic Metrics</h3><p>We must measure growth and progress so that we can get better. These are the key KPIs we will focus on.</p><ol><li>Monthly liquidity of currency. This tells us how much external currency is being exchanged. A 40 billion pound liquidity means 40 billion pounds has been extracted or injected into the market. in a month</li><li>Percentage of employed citizens</li><li>percentage Happiness of citizens.</li><li>The average salary of citizens</li><li>Population</li><li>Export valuation. This tells us how much money has come in from non-citizens. 20 billion euro export means that our companies brought in a demand for 20 billion Euros on our crypto market</li></ol><h3>Our currency</h3><p>Our currency as a nation is kura coin cryptocurrency and this will help fund our businesses. The more the demand for our currency, the richer and more powerful our economy becomes.</p><h3>Our Vision 2040</h3><ul><li>$300 billion in currency valuation</li><li>10 million citizens</li><li>All citizens have jobs</li><li>95% happiness index</li><li>$100 billion spent on research, breakthroughs in energy, biotech, and health tech</li><li>over 1,000 companies funded</li><li>Companies earning over $10 billion yearly combined revenue</li><li>Hubs, parks, hotels, golf courses, sports centers, established in every country</li><li>Every citizen is living above $1,000 per month, regardless of the home country they live in.</li></ul><h3>Our Vision 2090</h3><p>We have over 40 million citizens and have a market cap of over 1 trillion USD.</p><p>We have established a physical capital on earth that will be open to only citizens. Humans will be given new bodies and be called Newmans. These bodies will be able to live for as long as the owner wishes, these bodies will have resistance mechanisms for diseases, enhanced brain functionality, etc… Cars in the capital fly and run on air like humans. All electrical devices run on nuclear power or tap into the general electricity network in the ground. Robots do all hard labor including farming, manufacturing, and building. New animals and organisms will be created, the lions will not bite and the snake’s venom will nourish other creatures’ bodies.</p><p>People are living peacefully, focusing on things they are passionate about. Creators are creating new entertainment content with robots and AI, new types of plants and food are being created, and most professions involve creating something new with powerful technology, the rest are maintaining hardware and software technology, and managing projects. Many people are on 6-month vacations and get back to work in the other half of the year. Citizens are touring new worlds in temporary bodies, experiencing luxury, and engaging in real games of hunting and boxing. There is no crime as there is no need to commit any crime, robots and AI are used to monitor and secure the cities.</p><p>All technology interaction is through the mind, and 50% of human-to-human interaction is mind-to-mind. Humans can encrypt their thoughts and memories to improve privacy. Most people listen to music through a combination of the mind and ears. All movies are dream-like and immersive.</p><p>Beings and creatures are flying in the sky, glowing, birds with tails, and lions with wings. Nobody seems to be bothered, because it’s normal, There is a dome that blocks sun rays, the city is illuminated by its artificial lights, and plants are grown through advanced technology.</p><h3>Conclusion</h3><p>Let us forge a new world system together. I am excited to build this with you, and I hope you live to see this and live in this new city. Remember to keep shining the light, emitting love and joy. Never quit, never cave in, regardless of what you are going through, you are not alone, someone out there loves you, and cares about you, the world is simply disconnected and disoriented, and we can change this. No magic will happen, we need architects, builders, bricklayers, accountants, managers, etc.. to construct this new city.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd692dc6a3b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Digital Identification On The Blockchain]]></title>
            <link>https://medium.com/@kingstonwhyte87/digital-identification-on-the-blockchain-9013e52ac6a9?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9013e52ac6a9</guid>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Mon, 05 Aug 2024 13:22:02 GMT</pubDate>
            <atom:updated>2024-08-08T04:26:10.010Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXbRQopY-JgZBw2jXIFZBg.jpeg" /></figure><p>When Satoshi created Bitcoin, he never thought privacy would be an issue. Today, the use of centralized exchanges can be used to track Bitcoin addresses and identify the owner. Yes, we have mixers and other methods but my point is this need made people to create privacy coins. This means Satoshi is not all-knowing, he created Bitcoin as he deemed fit and it was never intended to be sufficient for all times. The markets evolve, habits evolve and so does everything around us. change is constant.</p><p>The Kuracoin ecosystem needs an identification method. if businesses are to thrive using kuracoin, there needs to be a method of identifying and punishing bad actors. This identification mechanism needs to still protect the identity of the user. We do not need to know that James bought coffee at 8 am, but we need to know if James has defaulted on a crypto loan. This identification system needs to make sure that two users cannot exist with the same credentials in the real world.</p><p>We need something that can identify every unique individual in our ecosystem. We cannot use a government-issued ID. I think we can use fingerprints, they are unique and easy to capture today. We can also use retina scans and DNA data later in the future.</p><p>Users will be able to scan their fingerprints on mobile devices once, and this can be used to identify and authenticate them anywhere in our ecosystem.</p><p>Our universal basic income service for example requires a system of identifying real-world people and making sure that one person does not get credit two times.</p><p>This identification mechanism will allow users to have their privacy and at the same time create a safe environment for people to transact.</p><p>You can create wallets without this ID, but it will be clear to everyone that this is an unidentified user. People can then choose to do business with whatever type of user they want. Some people may say, I’m only dealing with identified users and others may not care. I hope that identified wallets will become the standard. With your digital ID, you will be able to create as many wallets as you can. if you do anything malicious on any platform such as default on a loan, failure to uphold a contract, etc… the system will record this and assign negative rep points. I’ll make another article on rep points later.</p><p>Lastly, we are developing a token market on our financial system that allows people to raise funds for innovative and passion-fueled projects. We need accountability from the founders to the token holders and so we will need identification. I will write more on this token market later.</p><p>In summary, we need a way to uniquely identify users, and make sure we are punishing bad actors and at the same time give users privacy and anonymity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9013e52ac6a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The World's First Digital Nation]]></title>
            <link>https://medium.com/@kingstonwhyte87/the-worlds-first-digital-nation-a9907fdf29d5?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9907fdf29d5</guid>
            <category><![CDATA[government]]></category>
            <category><![CDATA[universal-basic-income]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 14:55:46 GMT</pubDate>
            <atom:updated>2024-03-22T15:14:14.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I1SkRfM2TvS7F0mI9-ga0g.jpeg" /></figure><p>We are living in a strange time today, It’s 2024 and it’s clear there is no limit to what can be done. Some people are pouring billions into anti-aging technology, some are going to the moon, and some want to die on Mars, it seems unreal but it’s real.</p><p>I am David Whyte John, and I come from Nigeria. People get offended when I say the truth about the country I live in, but that is just me. I am raw, I tell it as it is, I don&#39;t like adding much sugar to the tea I serve you. Nigeria is a failed state, but it’s one of many failed states. I grew up with a passion for making people&#39;s lives better. That was the reason I got into software, that was my drive, and still is. As I grew older, I started to buy the idea of leadership. I always hated it though, before age 14, I hated the idea that I had to lead. I preferred to hide and take the back seat, something about the responsibility made me scared. As I grew much older I realized Nigeria was in a hopeless situation and nothing will change. After calculating the future of Nigeria, I decided I needed to stop trying to fix a failed system. People keep getting renewed hope every 4 years but not me, I hate bullshit and I can easily see through it. Why not get into politics you may ask, well I may not make it out alive, I may not even make it to the point of contesting.</p><p>In 2019, I became a globalist, meaning I realized people needed help and care globally and not just in Nigeria. I am not a nationalist. Nigeria is just the name of a place. I realized the world system needed a fix, but instead of fighting the powers that be in their system, I wanted to create a new one. Something for everyone, everywhere.</p><p>I decided to start a new country, but my brother asked me where. So I searched if there was free land anywhere in the world, and sadly I couldn&#39;t find any unclaimed land. I then thought about sand-filling large portions of water and starting a new country on the sea. I did a feasibility study and realized this can be achieved with technology. Where do I get billions to make this new land? This was clearly not the way to go. I decided to start somewhere, digitally. I realized a country was different from a nation and if I wanted to create something global for everyone, then I needed to think about building a nation and not a country. A nation is a group of people with a common culture.</p><p>I make it sound simple, but this is a product of years of thought, and planning and I have had different versions and iterations of this idea.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5MXblHVD6cC9BVhHnN4gw.jpeg" /></figure><p>Love Nation is a digital nation, citizens will have digital passports, we will have a currency and platform, and we will have businesses and jobs for our citizens. We will grow our economy to become one of the richest nations in the world.</p><p>We are solving these problems :</p><ul><li>Jobs</li><li>Funding for businesses</li><li>Funding for research</li><li>Universal basic income for all citizens</li><li>Access to healthcare information and technology</li><li>Access to a global internet</li><li>Access to a global food supply system</li></ul><p>So now even if you are in a failed country, as long as you are a citizen of Love Nation, you will have access to these things. We cannot fix the wickedness and greed in their hearts but we can build a new system based on love, care, giving, and passion. I am David W. John, I am just a guy who is stupid enough to try. I am not afraid to build what will make billions of lives better.</p><p>Visa applications will be open in the next 6 months. Anyone from any race, religion, country, gender, etc can apply. We are removing all the barriers used to keep us from growing as humanity. We are done competing, and we believe it’s time to get building. So bring your creative minds, innovations, research, ideas, skills, beauty, voice, talent, and everything, we will make sure to harness everything together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9907fdf29d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Pointers in Go]]></title>
            <link>https://medium.com/@kingstonwhyte87/understanding-pointers-in-go-bc0e0388abae?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc0e0388abae</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[pointers]]></category>
            <category><![CDATA[stack]]></category>
            <category><![CDATA[memories]]></category>
            <category><![CDATA[heap]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Thu, 14 Sep 2023 18:08:46 GMT</pubDate>
            <atom:updated>2023-09-14T18:08:46.870Z</atom:updated>
            <content:encoded><![CDATA[<p>When the go compiler compiles code, it looks through all the functions in the program and allocates memory onto the stack and heap. When a variable has a small scope and is not referenced in other parts of the application, it is stored in the stack. When a variable has a big size or it’s data is referenced in other parts of the application, it is stored on the heap.</p><p>Now that we understand that every time we do this:</p><pre> b:= 9</pre><p>the compiler has to reserve some memory on the stack or heap to store it depending on the scope and size.</p><p>The CPU does not know how to store the number 9 for example so it stores it as 0s and 1s in it’s memory. The OS needs to know where our 9 is because there are millions of other data (0 and 1) stored in the RAM. The OS uses something called memory address to know where our data is stored.</p><p>A variable just holds the address of the data. It points to an address which holds some data.</p><pre> var a *int <br> b:= 9<br> a = &amp;b<br> println(a)</pre><p>In the code above, a stores the address for its value. At this point the initial value is 0. b also stores an address to 9 but does this behind the scenes. If we wanted the memory address of b we would need to do this &amp;b.</p><p>You cannot say a = b because a stores a pointer to an integer. b on the other hand holds an integer (but an actual address behind the scenes).</p><p>You can however do a = &amp;b as we have done, here you are saying that a should now hold the address of b and now a points to whatever b is pointing to. And so a will be 0xc000053f28. *a will be “9” because * de references.</p><p>Pointers can be confusing in go at first but after a while you will get a hang of it.</p><p><strong>A More Complex Example</strong></p><pre>type FactoryDAO struct {<br> db          *mongo.Client<br> ctx         context.Context<br> Collections map[string]*mongo.Collection<br>}<br><br>func InitializeFactory(db *mongo.Client, ctx context.Context) *FactoryDAO {<br> collectionList := []string{&quot;Users&quot;, &quot;VisaApplicationAnswers&quot;, &quot;VisaApplications&quot;}<br> collections := make(map[string]*mongo.Collection)<br> for _, key := range collectionList {<br>  col := configs.GetCollection(db, key)<br>  collections[key] = col<br>  // collections = append(collections[], map[string]*mongo.Collection{&quot;&quot;:col})<br> }<br> return &amp;FactoryDAO{<br>  db:          db,<br>  ctx:         context.TODO(),<br>  Collections: collections,<br> }<br>}</pre><p>Here you can see that in InitializeFactory function, we are returning a reference to FactoryDAO struct. Just like var a *int.</p><p>Now when we actually want to do the returning we create an instance of FactoryDAO, but we do not return that instance, we return a reference instead.</p><p>Thanks for following through.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc0e0388abae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UnityWeb API Integration — Unity C#]]></title>
            <link>https://medium.com/@kingstonwhyte87/unityweb-api-integration-unity-c-755360031fa7?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/755360031fa7</guid>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Tue, 25 Apr 2023 21:51:53 GMT</pubDate>
            <atom:updated>2023-04-25T22:05:54.758Z</atom:updated>
            <content:encoded><![CDATA[<h3>UnityWeb API Integration — Unity C#</h3><p>I have been working on a video game for a few months now. We use Unity and C#. We encountered a security issue; some players were cracking the game and changing the high score. We have been storing players&#39; high scores in a binary file in the local storage of the user&#39;s mobile device. We realized what we needed to do was to store data on a server. We also want players to have an identity and a wallet, we need to handle payments, etc…</p><p>We decided to build a server app with Rust. We chose rust because it&#39;s fast. We wanted to go with C but we would need to write an in-house framework to handle requests etc… I built the server in a few weeks and it works fine. Now I needed to connect the Unity game to the server. Let&#39;s talk about the game architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TvXH_yKp5OhTLtEShao_0w.png" /></figure><h3><strong>Architecture</strong></h3><p>We use an MVC architecture. We have models and views, in this case, it will be game scenes and 3D assets. We have controllers which help control the 3D experience. I decided to add a new layer to the model: the Network layer. This network layer connects to the API via HTTP and then exposes the results. We persist the data throughout the frames of the game by storing it in static variables. Later on, for heavy data, we will put them in an SQL DB that will be flushed every time a player closes the app.</p><h3><strong>Network Layer</strong></h3><p>We are using the Unityweb package developed by Unity. We are using C# coroutines that help us run the code in the background. Unity uses one thread, it’s very hard to use async await in Unity. I found that coroutines will be the best when using Unity.</p><p>We simply create an object from a request class, and we serialize that, and then convert it to bytes and send it to the server.</p><pre>using System;<br>using System.Collections;<br>using System.Collections.Generic;<br>using System.Linq;<br>using System.Text;<br>using System.Threading;<br>using System.Threading.Tasks;<br>using Assets.Scripts.Network.Models;<br>using Newtonsoft.Json;<br>using Service;<br>using UnityEngine;<br>using UnityEngine.Networking;<br><br>namespace Assets.Scripts.Network<br>{<br>    public  class PlayerAuthService : MonoBehaviour<br>    {   <br><br>        public  void Start()<br>        {<br>            <br>           // StartCoroutine(PlayerService.Login());<br><br>        }<br>        static IEnumerator SignUp()<br>        {<br>            SignupRequest signupRequest = new SignupRequest();<br>            signupRequest.email = &quot;email12@x.com&quot;;<br>            signupRequest.user_type = &quot;Player&quot;;<br>            signupRequest.name = &quot;John bot&quot;;<br>            string json = JsonConvert.SerializeObject(signupRequest);<br>            var unityWeb = new UnityWebRequest(APIData.GetURL() + &quot;/user&quot;, &quot;POST&quot;);<br>            byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(json);<br>            unityWeb.uploadHandler = (UploadHandler)new UploadHandlerRaw(jsonToSend);<br>            unityWeb.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();<br>            unityWeb.SetRequestHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);<br>            yield return unityWeb.SendWebRequest();<br><br><br>            if (unityWeb.isNetworkError || unityWeb.isHttpError)<br>            {<br>                Debug.Log(&quot;Error While Sending: &quot; + unityWeb.error);<br><br>            }<br>            else<br>            {<br>                Debug.Log(unityWeb.downloadHandler.text);<br>                var text = unityWeb.downloadHandler.text;<br>                SignupResponse result = JsonUtility.FromJson&lt;SignupResponse&gt;(text);<br>                Debug.Log(result);<br>            }<br>        }<br><br><br>        static public  IEnumerator Login()<br>        {<br>           <br>            LoginRequest loginRequest = new LoginRequest();<br>            loginRequest.email = &quot;email12@x.com&quot;;<br>            loginRequest.code = &quot;49039&quot;;<br>            string json = JsonConvert.SerializeObject(loginRequest);<br>            var unityWeb = new UnityWebRequest(APIData.GetURL() + &quot;/user/login&quot;, &quot;POST&quot;);<br>            byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(json);<br>            unityWeb.uploadHandler = (UploadHandler)new UploadHandlerRaw(jsonToSend);<br>            unityWeb.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();<br>            unityWeb.SetRequestHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);<br>            yield return unityWeb.SendWebRequest();<br><br>            <br>            if (unityWeb.isNetworkError || unityWeb.isHttpError)<br>            {<br>                Debug.Log(&quot;Error While Sending: &quot; + unityWeb.error);<br>                Debug.Log(&quot;Error Data: &quot; + unityWeb.downloadHandler.text);<br>            }<br>            else<br>            {<br>                Debug.Log(unityWeb.downloadHandler.text);<br>                var text = unityWeb.downloadHandler.text;<br>                LoginResponse result = JsonUtility.FromJson&lt;LoginResponse&gt;(text);<br>                Debug.Log(result.ToString());<br>            }<br><br>           <br>        }<br><br>        static public IEnumerator GetCode()<br>        {<br>            GetCodeRequest getCodeRequest = new GetCodeRequest();<br>            getCodeRequest.email = &quot;email12@x.com&quot;;<br>            <br>            string json = JsonConvert.SerializeObject(getCodeRequest);<br>            var unityWeb = new UnityWebRequest(APIData.GetURL() + &quot;/user/get_code&quot;, &quot;POST&quot;);<br>            byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(json);<br>            unityWeb.uploadHandler = (UploadHandler)new UploadHandlerRaw(jsonToSend);<br>            unityWeb.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();<br>            unityWeb.SetRequestHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);<br>            yield return unityWeb.SendWebRequest();<br><br><br>            if (unityWeb.isNetworkError || unityWeb.isHttpError)<br>            {<br>                Debug.Log(&quot;Error While Sending: &quot; + unityWeb.error);<br>            }<br>            else<br>            {<br>                Debug.Log(unityWeb.downloadHandler.text);<br>                var text = unityWeb.downloadHandler.text;<br>                GetCodeResponse result = JsonUtility.FromJson&lt;GetCodeResponse&gt;(text);<br>                Debug.Log(result.ToString());<br>            }<br>        }<br>    }<br>}</pre><p>Create an empty object in Unity and attach this code to it. Note this code is not production ready, because we need to pass request data dynamically. What you should do is pass the LoginRequest object into the service function (Login()). You can also use a better logging system, you can send log data every minute to the server, you can store data in CSV, etc…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQHQtwMe8xc5WfJgin3jLg.png" /></figure><p>I have a Network folder under scripts and here I can store all of the services. We have a Player authentication service, powerup service, wallet service, etc… I also have models that define what the requests and responses should look like.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=755360031fa7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android MVVM Architecture -Kotlin]]></title>
            <link>https://medium.com/@kingstonwhyte87/android-mvvm-architecture-kotlin-ceb919d3a002?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ceb919d3a002</guid>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Wed, 05 Apr 2023 13:13:50 GMT</pubDate>
            <atom:updated>2023-04-05T13:16:20.833Z</atom:updated>
            <content:encoded><![CDATA[<p>I believe the best way to learn is by practice, and that is why this tutorial will be practical. We are going to build a simple todolist app, but this app will use the MVVM architecture.</p><p>First lets look at what software architecture is. Software architecture is a blueprint that defines a set of rules and systems that address important needs. For some teams the need can be sustainability, security, readability, scalability etc… Why do we need software architecture? Well, it’s because we need to plan ahead. We do not know what would happen in the future, so we need to look ahead and plan. Lets say for example oracle database has a flaw and billion of dollars has been lost in the last few days. Now your team has an android application that connects to an oracle database, and they want the team to migrate to a new one. This sounds simple, but what if we had thousands of lines of code and we were making API calls to this database from the app in over 500 places. There are a few bad things that could happen.</p><ol><li>After we switch to MongoDB for example, we could have bugs. Every time we make changes to big applications we introduce bugs. This happens a lot. What you want to do is reduce that chances of this happening.</li><li>It will be hard to make the change and we may just end up screwing everything up.</li></ol><p>We need clean architectures. We now see why we need to be organized and think about the future. How do we make our code more maintainable, readable and reliable. Software architecture affects the security of software too. The easier it is to make changes, the quicker we can find vulnerabilities and address them.</p><h3><strong>Other Architectures?</strong></h3><p>Yes MVVM is not the first, we have MVC. This stands for Model, View, Controller. This means there is a model that defines a real world object. For example a User Java class. We have Views, for a web application, this will be some HTML code served via GET requests. Finally we have controllers. This will usually hold business logic. With MVC we still have do do much manipulation and processing of data in the view part of the application. For an android application this means we will be making API calls from the controller. SO now we have the business logic (calculating a users eligibility and pricing for a service or product for example) and API calls in one place. That’s a lot of code and a lot files. We want to separate concerns as much as possible. What happens when data changes in one part of the application, how does the application respond to this change? We will most likely do this in the controller too.</p><h3><strong>Now MVVM</strong></h3><p>MVVM is Model, View, View Model. This new architecture proposed by Microsoft adds more separation of concern for android applications. MVC is very good for the back-end, but we need more for android apps. Android apps have views, logic, database, they take in user data, and they need to react to this data all at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*7fyQDRUOr2IEKpHsv5BYPA.png" /></figure><p>From the diagram above, we can see how data flows. Data moves from View models to Views. The view model is the views primary source of data. The view is a combination of XML files and Classes that use the AppCompactActivity class. So for example a view will be <strong>HomePageActivity.kt</strong> and<strong> home_page_activity.xml</strong>. The view part of the app should only worry about displaying data. We should not have any logic here. The view model should decide what to display, and when. The View should determine how to display, what XML files to load and collect data from users.</p><p>The View model communicates with the models. The API service and Database also connect with the View model. We can customize this architecture to embed API services and database services as data sources for the view model. The truth is you can customize this architecture to fit your needs. The most important thing is separation of concern.</p><p>Lets Build an APP</p><p>We are building a simple todo list app that stores data in memory.</p><p>Create a simple app with a MainActivity</p><p>update the <strong>activity_main.xml</strong></p><p>This gives us a simple Edit text field to input a new todo item and a button to add. We also have a list view of our items (recycler view)</p><pre>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:orientation=&quot;vertical&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    tools:context=&quot;.MainActivity&quot;&gt;<br><br>    &lt;EditText<br>        android:id=&quot;@+id/titletxt&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginTop=&quot;24dp&quot;<br>        android:ems=&quot;10&quot;<br>        android:textColor=&quot;#000&quot;<br>        android:inputType=&quot;textPersonName&quot;<br>        android:hint=&quot;Enter Information&quot;<br>        android:textAlignment=&quot;center&quot;<br>        app:layout_constraintBottom_toTopOf=&quot;@+id/button&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintHorizontal_bias=&quot;0.497&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>    &lt;Button<br>        android:id=&quot;@+id/button&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginBottom=&quot;40dp&quot;<br>        android:layout_marginTop=&quot;20dp&quot;<br>        android:text=&quot;Submit&quot;<br>        android:layout_gravity=&quot;center&quot;<br>        app:layout_constraintBottom_toTopOf=&quot;@+id/recycler&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintHorizontal_bias=&quot;0.498&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot; /&gt;<br><br>    &lt;androidx.recyclerview.widget.RecyclerView<br>        android:id=&quot;@+id/recycler&quot;<br>        android:background=&quot;#E8DDDD&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;match_parent&quot;<br>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>        app:layout_constraintStart_toStartOf=&quot;parent&quot; /&gt;<br>&lt;/LinearLayout&gt;</pre><p>Create a model in a <strong>models folder </strong>called</p><pre>data class Todo(<br>    var title:String<br>)</pre><p>Create a view model in <strong>view_model folder</strong> called <strong>MainViewModel.kt</strong></p><p>This view model comes from <strong><em>androidx.lifecycle.ViewModel</em></strong></p><p>The important thing to know about view models is that they handle data, they store data in memory for your application to use. They are also observable by other activities and components of your app. This means that you can react to changes in data you store in the view models.</p><pre>class MainViewModel:ViewModel() {<br>    var lst = MutableLiveData&lt;ArrayList&lt;Todo&gt;&gt;()<br>    var newlist = arrayListOf&lt;Todo&gt;()<br><br>    fun add(todo:Todo){<br>        newlist.add(todo)<br>        lst.value = newlist<br>    }<br><br>    fun remove(todo:Todo){<br>        newlist.remove(todo)<br>        lst.value=newlist<br>    }<br>}</pre><p>Here we are defining two functions, add and remove. Add lets us put data in this view model and remove takes data out. We can have many view models. For example (HomeViewModel, UserViewModel, OrderViewModel, RequestViewModel …)</p><p>We can also have many functions in each view model such as add, remove, update, getFromChache, getFromDatabase, etc..</p><p>Create a <strong>ViewModelFactory.kt</strong> in <strong>view_model</strong> folder</p><pre>class ViewModelFactory:ViewModelProvider.Factory {<br>    override fun &lt;T : ViewModel?&gt; create(modelClass: Class&lt;T&gt;): T {<br>        if(modelClass.isAssignableFrom(MainViewModel::class.java)){<br>            return MainViewModel() as T<br>        }<br><br>        throw java.lang.IllegalArgumentException(&quot;Unknown model&quot;)<br>    }<br>}</pre><p>What this does is make sure that we are creating one instance of our view model. We only need one view model per view. If we have a screen that us user image, user profile data and some settings, we can have 3 liveData(userliveData, profileLiveData, settingsLiveData).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8QNOu8Hj6emW1A1Q5fEH8w.png" /></figure><p>Create a recycler for the recycler view. This basically helps us populate data efficiently as a list. We may need to update this list, and we need a way to render new data instantly. Recyclerviews were built to handle this.</p><p>NotesRecyclerAdapter.kt</p><pre>class NoteRecyclerAdapter(val viewModel:MainViewModel, val arrayList:ArrayList&lt;Todo&gt;, val context:Context)<br>    :RecyclerView.Adapter&lt;NoteRecyclerAdapter.NotesViewHolder&gt;(){<br><br>    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NoteRecyclerAdapter.NotesViewHolder {<br>        var root = LayoutInflater.from(parent.context).inflate(R.layout.item, parent,false)<br>        return NotesViewHolder(root)<br>    }<br><br>    override fun onBindViewHolder(holder: NoteRecyclerAdapter.NotesViewHolder, position: Int) {<br>        holder.bind(arrayList.get(position))<br>    }<br><br>    override fun getItemCount(): Int {<br>        return arrayList.size<br>    }<br><br><br>        inner class NotesViewHolder( val xbinding: View ):RecyclerView.ViewHolder(xbinding){<br>            fun bind(todo:Todo){<br>                xbinding.findViewById&lt;TextView&gt;(R.id.title).text = todo.title<br>                xbinding.findViewById&lt;Button&gt;(R.id.delete).setOnClickListener{<br>                    viewModel.remove(todo)<br>                    notifyItemRemoved(arrayList.indexOf(todo))<br>                }<br>            }<br><br>        }<br>}</pre><p>This takes data from our view model, and populates the view. We will use this from our Kotlin view file.</p><p>Update <strong>MainActivity.kt</strong></p><pre>class MainActivity : AppCompatActivity() {<br><br>    private var viewManager = LinearLayoutManager(this)<br>    private lateinit var viewModel:MainViewModel<br>    private lateinit var mainrecycler: RecyclerView<br>    private lateinit var button: Button<br><br><br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContentView(R.layout.activity_main)<br><br>        mainrecycler = findViewById(R.id.recycler)<br>        val application = requireNotNull(this).application<br>        val factory = ViewModelFactory()<br>//        viewModel = ViewModelProvider(this).get(MainViewModel::class.java)<br>        viewModel = factory.create(MainViewModel::class.java)<br>        button = findViewById(R.id.button)<br>        button.setOnClickListener{<br>            addData()<br>        }<br><br>        initailizeAdapter()<br>    }<br><br>    private fun initailizeAdapter(){<br>        mainrecycler.layoutManager = viewManager<br>        observeData()<br>    }<br><br>    fun observeData(){<br>        viewModel.lst.observe(this, Observer {<br>            Log.i(&quot;data&quot;, it.toString())<br>            mainrecycler.adapter = NoteRecyclerAdapter(viewModel, it, this)<br>        })<br>    }<br><br>    fun addData(){<br>        var textinput = findViewById&lt;EditText&gt;(R.id.titletxt)<br>        var title = textinput.text.toString()<br><br>        if (title.isNullOrBlank()){<br>            Toast.makeText(this,&quot;Enter value!&quot;,Toast.LENGTH_LONG).show()<br>        }else {<br>            var todo = Todo(title)<br>            viewModel.add(todo)<br>            textinput.text.clear()<br>            mainrecycler.adapter?.notifyDataSetChanged()<br>        }<br>    }<br><br><br>}</pre><p>Finally you should have the app working. You should be able to add data and remove data from the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vdjtatv1EDq0_Td5qYxMaA.png" /></figure><h3><strong>Next steps</strong></h3><p>Next steps is adding concurrency with Kotlin coroutines and adding more features to the app. You can build this simple app and apply MVVM to bigger projects. It’s really awesome on larger projects. We will talk about Kotlin coroutines next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ceb919d3a002" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DAu blockchain]]></title>
            <link>https://medium.com/@kingstonwhyte87/dau-blockchain-93afba5e6939?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/93afba5e6939</guid>
            <category><![CDATA[trade]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Sat, 20 Nov 2021 18:21:28 GMT</pubDate>
            <atom:updated>2021-11-20T18:31:49.685Z</atom:updated>
            <content:encoded><![CDATA[<h4>DAu Foundation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIKeJ8L9TUHLu2aZPZab0g.png" /><figcaption>Facilitating global trade</figcaption></figure><p>Hello, I am David whyte John. Here’s my little introduction to the DAu blockchain. DAu blockchain is a distributed ledger software, it&#39;s open-sourced and we all anyone take part in the network management. It is currently managed by DAu foundation in Rwanda, it was previously managed by Dewstech in the UK. I started the project because I wanted to build the fastest and most secure blockchain. I also wanted to develop with other nations and organizations the most stable and secure currency.</p><p><strong>DAu cryptocurrency white paper.</strong> <a href="https://docs.google.com/document/d/1RSXmFN_glkU1fnO6dVtM3ifj6RaJLhVIdAmhdCj1PLs/edit?usp=sharing">https://docs.google.com/document/d/1RSXmFN_glkU1fnO6dVtM3ifj6RaJLhVIdAmhdCj1PLs/edit?usp=sharing</a></p><p>The white paper contains enough information about what we are doing, so in this article, I will focus on talking about technology and our plans.</p><h3><strong>The technology</strong></h3><p>Security, scalability, fault tolerance, UX (Yes UX with APIs and servers). These were the things we looked at when we started this project. the dau ledger is being built with Go, we currently use only 2 external dependencies and we hope to get to 0 soon. Everything is built from scratch, but we also leverage the go library. We do not want to use any third-party codebases because of security concerns. We have an inbuilt database, a very basic KV store that is built to be light and fast. The ledger software communicates with client software and other servers, through the DAu protocol, built on top of TCP. Node discovery is done with TCP but there will be support for UDP soon. Our target for version 0.2 is 9,000 transactions per second, over a network of 3,000 nodes.</p><p>DAu is going to be a currency for everyone, we have strategic partnerships with companies and e-commerce organizations and we want to be able to use this currency to trade across the world. My goal is that businesses can move 1 billion dollars worth of money in seconds.</p><p>The foundation is also working on decentralized storage and computing and the DAu currency will be the mode of payment for these other blockchains. So basically DAu ties the LID blockchain, LID-DataLake blockchain together and hopefully, in the future, you will accept DAu as payment for your software or service.</p><h3>Why did we create DAu?</h3><p>DAu is more than a cryptocurrency. It&#39;s a new financial system built on principles that are strange in today&#39;s dollar system. We believe in private and we believe the people should manage the world&#39;s financial resources and not a few central banks dictating to the rest of the world. We want to work on poverty alleviation, financial inclusion, access to capital, infrastructure funding, research funding, and funding for governments. We believe many nations have been cheated and left out by the dollar system. Take a look at El Salvador. Africa needs DAu currency and we have started, in a few years&#39; time we will be launching a mainet and the whole world will be able to transact with DAu. We also believe banks can key into the future of money, which is DAu. Digital Gold.</p><h3><strong>Conclusion</strong></h3><p>We are working on cutting-edge research to advance blockchain technology. DAu foundation is an open organization, and feel free to always reach out and partner with us. Our discord channel <a href="https://discord.com/invite/HsjZV3ptvE">https://discord.com/invite/HsjZV3ptvE</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93afba5e6939" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How should new nodes get in sync with the network?]]></title>
            <link>https://medium.com/@kingstonwhyte87/how-should-new-nodes-get-in-sync-with-the-network-2b71aff8f48b?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b71aff8f48b</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[dau]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Sat, 20 Nov 2021 17:46:42 GMT</pubDate>
            <atom:updated>2021-11-20T17:46:42.240Z</atom:updated>
            <content:encoded><![CDATA[<p>DAu is a blockchain software with its own currency. It&#39;s built to be extremely fast, secure, and stable. At the DAu foundation, we develop blockchain software to facilitate global trade, this includes decentralized cloud, database, and 5G, and the new internet(metaverse).</p><p>We came across a huge problem while developing the DAu blockchain which is tailored to financial transactions. The problem we had was that sometimes nodes go offline or new nodes join the network and they need to be in sync with the rest of the network. If a new node starts off empty, it will not be able to accept new blocks because a previous block is needed to hash a new block.</p><p><strong>Our Solution</strong></p><p>Currently, most blockchain software allows users to download blockchain data from an existing node. The problem with this is that this node may have false data. We need to remember this is an open ledger. In version 0.1 of the dau blockchain, we were doing this same thing, downloading the data from one node to the new node.</p><p>If we decide to download from 4–9 nodes randomly, the problem is that 4–9 nodes cannot give a sure amount of truth because it is small compared to the 3,000 nodes on the network. We can decide to download data from the 3,000 nodes but that will take time and memory Our constraints are time t and memory m. We want to spend a constant or predictable amount of m and t. Lets say for example we have 300 million wallets, and they have a total of 1Gig of file date. We are taking into consideration the time it takes for the new node to get all 300million wallet addresses, metadata, last block etc. We are only consuming a defined storage resource m (300 million files with 20kb files each for example). We are compressing data from 3,000 nodes on the fly and saving the reduced result.</p><p>Our solution is to get a list of wallets that the new node should have. from all 3,000 nodes, and compare them, and come to a consensus on what the new nodes wallet list should be like. Then, we reach out to 80% of the nodes on the network randomly and ask for the last block of each wallet. We come to a consensus for each block, on the new server and save the block. Doing this over a TCP network helps to remove issues of dropouts and failed requests. This process has cut down the time and memory it takes for a new node to get in sync with the network. It is also secure because 80% of the network would have to be wrong for the new node to get false data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*4CQldnUEoMVuAquui3e8lQ.png" /><figcaption>New node sync process with DAu network</figcaption></figure><p><strong>Conclusion</strong></p><p>We are open to contributions on how we can make the DAu ledger after and more secure. Feel free to contribute on gitlab <a href="https://gitlab.com/daufoundation/dau">https://gitlab.com/daufoundation/dau</a> Also feel free to join the community on discord <a href="https://discord.gg/HsjZV3ptvE">https://discord.gg/HsjZV3ptvE</a>. We are working on working on a ledger that can take care of all global transaction needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b71aff8f48b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Html Parsing and formating for Email]]></title>
            <link>https://medium.com/@kingstonwhyte87/html-parsing-and-formating-for-email-3b30915185ed?source=rss-a31f1cba32d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b30915185ed</guid>
            <category><![CDATA[formatting]]></category>
            <category><![CDATA[parser]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[David whyte]]></dc:creator>
            <pubDate>Tue, 16 Jul 2019 10:59:02 GMT</pubDate>
            <atom:updated>2019-07-16T10:59:02.968Z</atom:updated>
            <content:encoded><![CDATA[<p>I was building an API lately, I wanted to send users an email when they signup. I created a utility for sending all mails n my application and I made it concurrent. I had some issue, I wanted to put some dynamic values in my html. For example, “Hello David, thanks for joining” I wanted the “David” to be dynamic, so that a users name is placed there. So I searched online, I was using sendgrid. In this article, I will be showing you guys how to format your Html dynamically, independent of any framework you want to use to send emails.</p><p>So here is the code, and then I will explain what it does.</p><p>template, err := template.ParseFiles(“./test.html”)</p><p>if err != nil {</p><p>panic(err)</p><p>}</p><p>var buf bytes.Buffer</p><p>data := map[string]interface{}{“Msg”: “Hello!”}</p><p>err = template.Execute(&amp;buf, data)</p><p>print(buf.String())</p><p>print(“Plug”)</p><p>if err != nil {</p><p>panic(err)</p><p>}</p><p>So you need to do import &quot;html/template&quot; at the top. We get the HTML file and then we create an io writer. bytes.Buffer implements the Writer interface so we are good. We do data := map[string]interface{}{&quot;Msg&quot;:&quot;Hello!&quot;} to map the data we want to format our HTML with and the values. You can have many more depending on what you need. Then we do template.Execute() note that we are making reference. then buf.String() gets the content of the HTML as a string, which is what we need.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b30915185ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>