<?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 Carlos Gonzalez Juarez on Medium]]></title>
        <description><![CDATA[Stories by Carlos Gonzalez Juarez on Medium]]></description>
        <link>https://medium.com/@Carlos_molotov?source=rss-9b3319cf5aa7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CsNcr3Dm0eSHpp1mBptu2g.jpeg</url>
            <title>Stories by Carlos Gonzalez Juarez on Medium</title>
            <link>https://medium.com/@Carlos_molotov?source=rss-9b3319cf5aa7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:18:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Carlos_molotov/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[EIP 1102: Opt-in web3 access]]></title>
            <link>https://medium.com/@Carlos_molotov/eip-1102-opt-in-web3-access-9e0b9b2e09e?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e0b9b2e09e</guid>
            <category><![CDATA[metamask]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[improve]]></category>
            <category><![CDATA[eip]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Wed, 03 Oct 2018 17:17:28 GMT</pubDate>
            <atom:updated>2018-10-03T17:17:28.634Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you scared about this new <em>improvement</em>than will break your dApp? You have come to right place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*Q0JiqFxsEwU916U2M77Pnw.jpeg" /></figure><p>First of all, let me share you this <a href="https://github.com/ethereum/EIPs/pull/1102">link</a>, it is the Github issue where you will find the proposal about the conflict, and <a href="https://ethereum-magicians.org/t/eip-1102-opt-in-provider-access/414">here</a>, the discussion in Ethereum Magicians. But since “ain’t nobody got time for that!” I will explain here very quickly.</p><p>We all care about privacy, don’t we? Well, Metamask and the others don’t ☹️.</p><p>Until now 😃!</p><p>Metamask and most of the other tools that allow you and your users to use web3 inject that library into <strong>every</strong>web page. That means every page has access to know if you are an ethereum user, which accounts you have and what is your balance in those accounts. Not right.</p><p>This proposal establishes a specific pattern that every web3-enabled environment must follow to safely expose the web3 API, so your data is safe from fingerprinting. Some tools like Embark have already released a version of its software to be working with the standard, and the solutions are actually hard, so go fast to update your dApp before it is too late! Metamask said that it will start to stop populating web3 the 2nd of November and others like Status will follow up soon.</p><p>The Ethereum provider injected by MetaMask and other dapp browsers will now be available at window.ethereum. But this doesn&#39;t mean that you can get the same data as before or make transactions. Nope. You will have to do just a little bit more of effort, dapps must now request access to user accounts by calling a new method on the provider: ethereum.enable(). That&#39;s it.</p><p>For the end user, it won’t mean that much. They will just have to validate that a web has the right to get its data.</p><p>Right after confirming to connect, the UX will keep being the same so nothing to be scared of. Pretty much the same horrible UX we’ve been having until now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e0b9b2e09e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guesser Protocol]]></title>
            <link>https://medium.com/@Carlos_molotov/guesser-protocol-61a77676876?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/61a77676876</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[bet]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[guesser]]></category>
            <category><![CDATA[protocol]]></category>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Wed, 15 Aug 2018 11:55:20 GMT</pubDate>
            <atom:updated>2018-09-25T08:30:54.956Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pq0kKHe_YzVn2MWkFSF3mA.png" /></figure><p>The Guesser protocol aims to be the simplest set of smart contracts built to provide developers with the necessary tools to create betting platforms on Ethereum. In this post, we want to provide a high level outline of the structure of the smart contracts and how they interrelate to one another.</p><h3>How does it work?</h3><p>The best way to start describing the protocol is by providing a broad view of how it works, and then following up with a short description of the basic contracts.</p><p>Like the the 0x Protocol, we use relayers to show the data that the protocol stores. These relayers’ basic task is to handle the access to the bets they want to show, because the bets are not easily accessible to anyone. The protocol works with relayers for several reasons:</p><ul><li>Privacy: The event created by a user has a unique 256 bytes hash providing it a hidden status. This lets you differentiate between private and public bets.</li><li>Base layer approach: We want to build the protocol as open and spark as much creativity as we can, providing bet creators and developers an easy way to work with collectibles, private bets, group bets, games… We think this will enable new kinds of betting that haven’t been invented yet to be built on top of Guesser.</li><li>Creator Incentives: One of the incentives for someone building a client on top of the Guesser protocol is to be able to have events only accessible from their client (while being able to have events accessible from every client, too) and create a community around these. This plus the ability to create new kinds of custom bets with their own set of properties is a huge advantage from previous betting systems.</li><li>Scalability: Scalability issues are well known by blockchain developers and enthusiasts. Storing all the data in a contract makes no sense and requires a lot of resources to be able to maintain it, ending up with a more costly protocol. Following 0x’s steps, scalability is handled off-chain by the decentralized relayers.</li></ul><p>In this simple way, we give all the power to the creators (the relayers) to make the usage of the protocol they need in a highly custom way. With an easy to use protocol that also has the right financial incentives in place, creators of betting events or platforms will use the Guesser protocol in ways we might not imagine yet.</p><p>Eventually, some relayers may even want to join forces and share information to give users a better experience. They might do this to allow collaborative clients to have a higher amount of betting events or to make these events gather larger payouts, making them more attractive for the players.</p><p>If you want to have a look at the current code, check out: <a href="https://github.com/GuesserProtocol/GuesserCore/tree/master/contracts">https://github.com/GuesserProtocol/GuesserCore/tree/master/contracts</a>. You can read more about the structure of the 0x protocol in their whitepaper: <a href="https://0xproject.com/pdfs/0x_white_paper.pdf">https://0xproject.com/pdfs/0x_white_paper.pdf</a>.</p><h3>Kernel</h3><p>The kernel is the first entrance door of the protocol, and any developer that wants to use the protocol in the typical way should use these contracts by default and interact with them. To make the kernel fully upgradeable and still allow it to be easily improved, we are using two kinds of patterns:</p><ul><li>First, an eternal storage, which is basically a contract that contains the data and getters and setters.</li><li>Second, a delegated proxy (we’ll talk more about it in the next section)</li></ul><p>Thanks to the eternal storage of this structure, the contracts have the basic data they need in a storage contract and the functionality in a different set of contracts. These both sides are tied together by a registry that tracks who is allowed (and who isn’t) to access the storage contract.</p><p>This way, only contracts are allowed to see and modify the data. Future improvements as well as contracts with new functionalities can be added, allowing the protocol to grow its long term utility and not be deprecated in the early days.</p><p>If you want to have a deeper understanding of the Eternal Storage pattern, you can find more information here. <a href="https://fravoll.github.io/solidity-patterns/eternal_storage.html">https://fravoll.github.io/solidity-patterns/eternal_storage.html</a>. There is a lot of available resources about the proxy delegate, a nice one can be found here. <a href="https://fravoll.github.io/solidity-patterns/proxy_delegate.html">https://fravoll.github.io/solidity-patterns/proxy_delegate.html</a>.</p><h3>Main kernel contracts</h3><p>There are three main contracts in the kernel:</p><p>- Kernel: it’s the contract that ties everything together. It accesses the other solidity files and storage data. It’s the main contract the end user will use to interact with the system.</p><p>- Payments: the functions needed to interact with the payments, like the prize distribution mechanism.</p><p>- Oracle: This contract gets the outcome of an event.</p><p>- Terms: This contract contains the access some bet metadata. It has some limitations in terms of storage, since it saves the data in a bytes32 variable. This provides enough data for dates, which is its main purpose.</p><p>All these contracts only implement the basic stuff, and they are connected to a specific contract for a certain action. They are the kernel of the protocol. As mentioned, there is also a storage contract where we store the data and a registry providing programmable accessibility to the data.</p><h3>Delegated proxies</h3><p>These are a very important part of the protocol and probably deserve more attention than this short explanation. As we described in the previous section, the kernel contract’s purpose is just to communicate some functions and processing orders, but in the end, the proxies is where the action will be handled. This actions are separated by the same sections as the kernel: Kernel, Payments, Oracle, Terms.</p><p>For example, the Oracle kernel simply communicates with the proxies asking them for the information it needs. An Oracle Proxy can be, let’s say, a contract connected to <a href="http://witnet.io/">Witnet</a>. It could also be fixed to the owner of the bet, who will provide the outcome of his own event. In other cases, it could be the Payment proxies which handle the ERC20 and ERC721 transfers and balance for the bets.</p><p>The good thing about these proxies is that are fully upgradeable and can modify data as if they were its owners. Of course, adding new proxies to work with the protocol requires a few processes in order to double check that the contracts are secure to use. Once the protocol is able to implement a decentralized governance system, the community will be the one that will handle the process of accepting new proxies for the protocol so that developers can use them freely.</p><h3>Easy to use</h3><p>A protocol like Guesser is nothing without the help of a community. It has to be easy for developers to contribute to the protocol, and for developers that want to build their apps to use the protocol. It makes no sense to build a protocol that few people are able to use. For that reason, developing a set of modules that make it super easy to create custom betting systems is a priority to us as well. The development of this part hasn’t started yet, but it isn’t too far in our roadmap.</p><p>Our long term vision for the Guesser protocol is simple: to create a javascript npm module that developers can export with ease and, with no more that 6 well documented lines of code, have the platform ready to create custom betting systems.</p><p>On top of Guesser, developers will be able to create parimutuel betting systems, their own bookies, or mechanisms like lotteries. We plan to support any system that implies staking money on a prediction. Whether you as a developer want that to be a YouTube views forecaster, an e-sports betting platform or a casino roulette is up to your own creativity!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61a77676876" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain banking, ✅ or ?]]></title>
            <link>https://medium.com/@Carlos_molotov/blockchain-banking-or-91f9e40d5f97?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/91f9e40d5f97</guid>
            <category><![CDATA[banking]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[p2p-lending]]></category>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Sun, 22 Oct 2017 17:37:51 GMT</pubDate>
            <atom:updated>2017-10-22T17:37:51.515Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The promise of blockchain banking is always there. And that is “<em>bad</em>”. And that is “<em>normal”</em>.</strong></p><blockquote>When there will be banks? When I will be able to get a loan? When I will be able to get money from an ATM? How about having cash?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*gqbhlSp2iAqK1oiDGGUazg.png" /></figure><p>Many people ask me that, and sometimes I don’t know how to really answer. The part that made blockchains so popular is its decentralized platform which cannot be controlled or “<em>puppeted</em>” by the governments or banks. That has a good side and a bad, as everything. We are seeing already the good parts, like almost instantly international transfers or property management. But nowadays the requirements we have are sometimes a bit different.</p><p>Some of the problems with the current currencies are being solved at this very moment, as scalability and real-time transactions for example. There are many currencies working on those problems in their own ways. Also, the code can be always improved, so that is an advantage over the normal currencies. But there are still some issues in these new currencies generation <strong>we have to solve and we don’t know how.</strong></p><h3>Loans</h3><p>How can we lend money to someone we don’t know and be sure he/she will pay back? Since there is no identification platform being used widely, it is not possible to be sure you will get your money back in any way. For sure you can do it for your friends and family but still is not the best idea.</p><p>This is something we need to solve easily, and the one who makes... Ooh lucky him/her! 😀</p><h3>Cash</h3><p>Blockchain is connected and even when the world is getting more and more into the Internet, there is always places where that cannot happen yet. Also sometimes we don’t have Internet, or mobile connection or battery. Since the money validation is done checking the blockchain, offline crypto is not viable and therefore, paper money cannot be used.</p><p>I have heard that returning to paper money is going backwards. Well, sometimes we are not ready for the future and let’s not forget that cash has way more privacy than crypto, where there is a record of every transaction done.</p><p>And again, as before, lucky the person solves this problem 😀</p><h3>ATM</h3><p>This solved, we just need more people actually using crypto as a method of payment so companies will build more ATM. It is a matter of time, I hope.</p><p>In my opinion, <strong>crypto as a payment won’t truly happen until we stop using these currencies as a trading tool</strong> and, actually think in them as what it is, a currency.</p><h3>Banks</h3><p>Here is the controversial thing. Are traditional banks a good thing or a bad thing? I am not the one to answer that question.</p><p>Both ways are being developed now, but maybe the problem here is that we are still thinking how we used to. Decentralized banks are a thing, but still the same thing with different rope to cover it.</p><p>So let’s have a bit of thinking over them. Normal people use their banks nowadays to store their money over time and keeping its value up to date.</p><p>How can we manage to do it in crypto? Well, it is possible. Store the money it is done by default, but in order to gain a % over time we have to trust a smart contract to do kind of lendings. So we have the same problem. Lending.</p><h3>Current Solutions</h3><p>Yep. I was keeping this hidden, there are solutions for lending.</p><p><a href="https://www.saltlending.com/">SALT Lending</a></p><p>But. This a really new way to get liquidity and may not end up well. Only time will tell us. Also, there will be many more options of lending in the crypto market over the time, it is a mater of time it will happen and the first gainning the trust of the customers takes everything. Let’s the game start. 😈</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91f9e40d5f97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arrays and Solidity: A story about ]]></title>
            <link>https://medium.com/@Carlos_molotov/arrays-and-solidity-a-story-about-104edf955bb4?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/104edf955bb4</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Sat, 14 Oct 2017 10:07:16 GMT</pubDate>
            <atom:updated>2017-10-14T10:07:16.260Z</atom:updated>
            <content:encoded><![CDATA[<p>I don’t know if you have tried to create a contract in Solidity, but if you have tried, probably you saw its difficulties.</p><p>Currently, Solidity doesn’t not allow you to return a matrix as a parameter or a non fixed size array. So, the solution is easy, right? <strong>Use fixed size arrays. But sorry, that ‘won’t work’ probably.</strong></p><p>If you want, for example to return a fixed size string array and you code it, you will see it is not working and the compiler don’t say anything… That is not cool, it should, right?! 😤</p><p>Well… What if a string array is not really what you think it is?</p><p><strong>You cannot return string arrays.</strong></p><p>And the reason is: (pasted from the documentation)</p><p><em>“Not yet, as this requires two levels of dynamic arrays (string is a dynamic array itself).”</em></p><p>So you are returning a dynamic matrix instead of what you declared… 😩</p><p>Hey! But don’t leave yet! There is a hope! 😀</p><p>The problem is with strings, so what if we store the data in bytes? Yep, that’s is possible. The solution is quite easy to implement and here it is:</p><pre>setArrayContract: function() {<br>        App.contracts.ArrayTesting.deployed().then(function(instance) {<br>            arrayTestingInstance = instance;</pre><pre>//Let&#39;s send the word&quot;ethereum&quot;           <br>return arrayTestingInstance.pushArray(web3.fromAscii(&#39;ethereum&#39;) ,{from: App.account});<br>        }).then(function (result){<br>            console.log(result);<br>        });<br>    },</pre><pre>getArrayContract: function() {<br>        App.contracts.ArrayTesting.deployed().then(function(instance) {<br>            arrayTestingInstance = instance;<br>            return arrayTestingInstance.getArray.call({from: App.account});<br>        }).then(function (result) { </pre><pre>            //Parse bytes to readable ASCII    <br>           console.log(web3.toAscii(result[0])); });<br>    }</pre><p>Those are two javascript functions to that will call our smart contract sending first the bytes and the getting the bytes and transforming them.</p><p>Just to make it easier, the only that really matters here is:</p><pre>// ASCII to byte code<br>web3.fromAscii(&#39;ethereum&#39;)</pre><pre>//Byte code to ASCII<br>web3.toAscii(&quot;0x657468657265756d000000000000000000000000000000000000000000000000&quot;) </pre><p>Off course, your smart contract now works with bytes and not with strings, so you should change that in your smart contract.</p><p>Something like this can be useful:</p><pre>pragma solidity ^0.4.15;</pre><pre>contract ArrayTesting {</pre><pre>bytes32[5] arr;</pre><pre>function ArrayTesting(){</pre><pre>uint8 x = 0;</pre><pre>for(x; x&lt; 5; x++)</pre><pre>arr[0] = &quot;&quot;;</pre><pre>}</pre><pre>function pushArray(bytes32 _bytes) returns(bytes32){</pre><pre>uint8 x = 0;</pre><pre>for(x; x&lt;5; x++)</pre><pre>if(arr[x] == &quot;&quot;){</pre><pre>arr[x]= _bytes;</pre><pre>return arr[x];</pre><pre>x=5;</pre><pre>}</pre><pre>return _bytes;</pre><pre>}</pre><pre>function getArray() returns(bytes32[5]) {</pre><pre>return arr;</pre><pre>}</pre><pre>}</pre><p>And that’s all for today 😃👍</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=104edf955bb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing a DApp — Part ☝️]]></title>
            <link>https://medium.com/@Carlos_molotov/writing-a-dapp-part-%EF%B8%8F-8e858f4da741?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e858f4da741</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[truffle]]></category>
            <category><![CDATA[dapps]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Wed, 23 Aug 2017 21:04:34 GMT</pubDate>
            <atom:updated>2017-10-14T09:41:23.476Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I wrote my first DApp, or decentralised application in case you haven’t heard of it. And in this tutorial, I am planning to create a guide with the steps you need to do the same as I did, maybe a bit more simple since this is just to give you a pice of the cake.</p><p>In case you want to go more straightforward, <a href="https://github.com/carlosgj94/CryptoNotes">here</a> you have the link to the app I did so you can check it to help you in yours.</p><h4>Installation 🔧</h4><p>Here comes the boring part… But it will be easy, I promise!</p><p>I assume you have npm already because it’s a typical requirement nowadays that everything runs under node and javascript. The next thing you need to do is to install <a href="https://github.com/trufflesuite/truffle"><strong>Truffle</strong></a>. This is a framework that will help us <strong>a lot</strong> creating our ethereum solidity application, testing it and deploying it to the blockchain specified. To install it, just:</p><pre>$ npm install -g truffle</pre><p>I recommend you to check out their <a href="https://github.com/trufflesuite/truffle">Github</a> and the <a href="http://truffleframework.com/docs/">documentation</a>, very helpful with a lot of advices and good code.</p><p>The second and last requisite we have to start is <a href="https://github.com/ethereumjs/testrpc"><strong>testrpc</strong></a>. To install it, we’ll use <em>npm</em> again:</p><pre>$ npm install -g ethereumjs-testrpc</pre><p>This tool will create a local ethereum blockchain for us, very useful.</p><p>You can also use Metamask chrome extension to check the blockchain we will create with <em>testrpc</em> just installed.</p><h4>Let’s get the party started !🎉</h4><p>Go to the terminal and create a directory wherever you want, you can call it <strong>NotesDApp</strong> since that is what we are going to program. Go inside of it and write:</p><pre>$ truffle unbox pet-shop</pre><p>This is just one way to start a project with truffle. It comes with a few useful stuff that we will discuss later. It also comes with a lot of other things that we won’t use, but it’s easier to clean them than creating them and since they are not part of the real dapp it does not matter. You may have seen that it is a pet shop project, the reason it’s because it’s the starting tutorial of truffle. You can find that tutorial <a href="http://truffleframework.com/tutorials/pet-shop">here</a>, and even when I am trying to go a bit beyond, a really recommend you to take a look at that tutorial as well.</p><p>In case you are brave enough and you want start from zero, truffle also offers us a way to create a bare metal project:</p><pre>$ truffle init bare</pre><h4>Project structure 📑</h4><p>Once we created the project with <strong>truffle</strong>, it will have created the project structure for us. I am going to explain it so you can fin all you need and distinguish what you don’t.</p><pre>/contracts</pre><p>The contract directory is where we will write our <a href="https://medium.com/@Carlos_molotov/solidity-language-for-ethereum-c434cf03ea8c">Solidity</a> contracts. There will be also another file called <em>Migration.sol</em> don’t worry about it yet.</p><pre>/migrations</pre><p>Here is where the magic will appear. Truffle uses the migrations as the way to deploy the smart contracts. Also, the migration will keep track of the changes we make in our creations. We will learn how to use them in another episode.</p><pre>/test</pre><p>No need to explain this, <strong>you have to write tests.</strong> We have two options to create tests in truffle, you can choose between Javascript and Solidity. In these tutorials we will use Solidity.</p><pre>/src</pre><p>This one is not always needed, but is where you will write the frontend for the application. In case you don’t want to have a frontend, you don’t need this folder. In this example it already has all the files and the server we need to develop our web. It also contains files that we won’t need, but we will erase them later.</p><pre>truffle.js</pre><p>This is basically the truffle’s configuration file. You probably won’t have to touch it unless you want to deploy it to the real ethereum blockchain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e858f4da741" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solidity Language for Ethereum]]></title>
            <link>https://medium.com/@Carlos_molotov/solidity-language-for-ethereum-c434cf03ea8c?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c434cf03ea8c</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Sat, 19 Aug 2017 10:55:22 GMT</pubDate>
            <atom:updated>2017-08-19T10:55:22.747Z</atom:updated>
            <content:encoded><![CDATA[<p>In this guide, we are going to talk about this language for developing Ethereum smart-contracts. We are not going to go deep through the Ethereum platform in here since it goes out of the scope.</p><p>Here you have some of the key characteristics of the new language.</p><ul><li>High level language</li><li>Similar to Javascript</li><li><em>”Classes”</em> are called contracts in ethereum world</li><li>It may have functions</li><li>It may have events</li></ul><p>Just as a remember you can test the contract in the <a href="https://ethereum.github.io/browser-solidity/">Browser</a>. And deploy them in mist the official wallet.</p><p>—</p><h4>Contracts</h4><p>Inside a solidity file, you can have as many contracts as you need, just write them down of each other as you can see now.</p><pre>contract SimpleDapp {   <br>}<br>contract SimpleDappNew {<br>    <br>}</pre><p>Also, we have constructors as any other language and it will be called once the contract is deployed. To create one, just call a function with the same name as the contract. You can add variables to the constructor and everything, don’t be shy!</p><p>In solidity, it is possible to interact from one contract to another, to do so, we have to possibilities:</p><ol><li>Call another instance of other contract</li><li>Create a new instance of a contract</li></ol><p>You can see both examples in the following code:</p><pre>contract SomeOtherSimpleDapp{<br>    //This will be a reference form the other instance of the class<br>    SimpleDapp simpleDapp;<br><br>    //This will be a NEW instance of the contract<br>    SimpleDapp newInstanceOfSimpleDapp;<br><br>    function SomeOtherSimpleDapp(address whereIsMyOtherContract){<br>        simpleDapp = SimpleDapp(whereIsMyOtherContract);<br>        newInstanceOfSimpleDapp = new SimpleDapp();<br>    }<br><br>    function getSimpleDappSomeVar() constant returns (uint) {<br>      return simpleDapp.getSomeVar();<br>    }<br><br>    function getNewInstanceOfSimpleDappSomeVar() constant returns (uint) {<br>      return newInstanceOfSimpleDapp.getSomeVar();<br>    }<br>}</pre><p>As you may see, we are using functions up there, this takes us to the next point: <strong>functions.</strong></p><p>—</p><h4>Functions</h4><p>Primarily we have two basic kind of functions in solidity, the constant ones and the ones who modify the chain. The first ones allows us to check for data without having to pay with our gas, to do so, we just have to have to add the <em>constant</em> word to the function as we will see now.</p><pre>//This is not a constant function, so we will pay for it.<br>function setSomeVar(uint myVar){<br>        someVar = myVar;<br>    }<br>    <br>//This is a constant function.<br>function getSomeVar() constant returns (uint){<br>        return someVar;<br> }</pre><p>As we can see, you have to add the type of the variable you are returning, <strong>not as Javascript does.</strong> Off course, you can call functions inside other functions, but if any of them is not constant, you will have to pay for it. Here is an example:</p><pre>contract Child{<br>    uint8 public age = 1;<br><br>    function birthDay() { &lt;-- gas used: 26933 <br>        age = age + 1;<br>    }<br><br>    function nextYearIllBe() constant returns (uint8){ &lt;-- gas used: 0<br>        return age + 1;<br>    }<br><br><br>    function newBirthDay() { &lt;-- gas used 26991<br>        age = nextYearIllBe();<br>    }<br>}</pre><p>—</p><h4>Control structures</h4><p>The control structures don’t differ too much from Javascript and the normal ones works exactly the same way. Just in case you want more information you can read the doc here: <a href="http://solidity.readthedocs.io/en/develop/control-structures.html">Control Structures</a></p><p>—</p><h4>Inheritance</h4><p>The inheritance in Solidity works very similar as how Python uses it as its documentation says. When a contract inherits from multiple contracts, only a single contract is created on the blockchain, and the code from all the base contracts is copied into the created contract.</p><pre>contract owned {<br>    function owned() { owner = msg.sender; }<br>    address owner;<br>}<br><br><br>// Use &quot;is&quot; to derive from another contract. Derived<br>// contracts can access all non-private members including<br>// internal functions and state variables. These cannot be<br>// accessed externally via `this`, though.<br>contract mortal is owned {<br>    function kill() {<br>        if (msg.sender == owner) selfdestruct(owner);<br>    }<br>}</pre><p>Multiple inheritance is also possible, just write coma-separated the contracts that will be the father. If one contract inherited more than one time from different contracts (like using <em>owned</em> and <em>mortal</em> as fathers), only one object will be instantiated for both.</p><p>Beyond than this, we can implement as well interfaces really easily. Any contract with a <strong>function without body will be considered as an interface by the compiler.</strong> You can override a function just writing it again in the child contract.</p><p>If a constructor takes an argument, it needs to be provided in the header:</p><pre>contract PriceFeed is owned, mortal, named(&quot;GoldFeed&quot;) {}</pre><p>—</p><h4>Libraries</h4><p>Libraries are similar to contracts, but their purpose is that they are deployed only once at a specific address and their code is reused in the contracts. It can only access state variables of the calling contract if they are explicitly supplied. Libraries are far more complex and I won’t explain them in an initial post, but be sure to check out the official documentation <a href="http://solidity.readthedocs.io/en/develop/contracts.html?#libraries">official documentation</a> if you need more information.</p><p>—</p><h4>Types</h4><p>This section will be easy even when you come from Javascript. Solidity changes the way to create variables in order to have safe declaration of them. The list of basic types is the next:</p><ul><li>bool</li><li>uint</li><li>uint8 up to uint256</li><li>bytes</li><li>bytes32</li><li>string</li></ul><p>The bad news is that Fixed Point Numbers are not fully implemented yet, as the wiki says: “<em>Fixed point numbers are not fully supported by Solidity yet. They can be declared, but cannot be assigned to or from.</em>”</p><p>There are also other different types, and very useful in Solidity, one of them is the <strong>address</strong> which is a byte var with a length of 20. Also, this address have to members:</p><ul><li><strong>Balance: </strong>Shows the amount of money that address has.</li><li><strong>Send(): </strong>Allows us to send money to that direction. You need to pass an integer inside the function, so it knows how much it should send. <strong>You always must to be sure to check the value that send() returns,</strong> because it can return False and the operation won’t happen. This may happen because it runs out of gas for example.</li></ul><p><strong>Enums</strong> are quite easy to work with and allows us to create vars that have to specific values. Internally, they work as integers, so it won’t consume too much work for the program. Also, because of this reason, when you write a function that returns an enum, it will be converted to an uint and it return you the number. The good part is that you don’t have to bother about it, since the enums are integers internally and will work perfectly. Here is an example:</p><pre>enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }<br>ActionChoices choice;<br>ActionChoices constant defaultChoice = ActionChoices.GoStraight;</pre><p>—</p><h4>Data Location</h4><p>You may have thought that we finished the types very fast and that is true, but is just because we need to explain some other things before going to complex data.</p><p>Every complex type, i.e. arrays and structs, has an additional annotation, the “<em>data location</em>”, about whether it is stored in <strong>memory</strong> or in <strong>storage</strong>.</p><p>We will use in memory variables when we return something from a function and storage variables when we create a normal variable in the program.</p><p>To quickly understand the difference, basically we can say that when we use storage and memories variables together in an assignment, it will create a copy of the memory var and will assign to the storage variable. But when we assign an storage variable to an another storage variable, we are not creating another copy, we just send the reference of it.</p><p>By default, the assignation is done by the compiler, but we can change the type of data location manually in case we want to. So in case we want to return the reference of a variable in a function we can:</p><pre>function g(uint[] storage storageArray) internal {}</pre><p>—</p><h4>Arrays</h4><p>Arrays can have a compile-time fixed size or they can be dynamic. For storage arrays, the element type can be arbitrary (i.e. also other arrays, mappings or structs). For memory arrays, it cannot be a mapping and has to be an ABI type if it is an argument of a publicly-visible function.</p><p>Creating arrays with variable length in memory can be done using the new keyword and it is not possible to resize memory arrays.</p><pre>//In memory arrays<br>uint[] memory a = new uint[](7);<br>bytes memory b = new bytes(len);<br>//In storage array<br>uint[] x;</pre><p>Arrays have two members:</p><ul><li>length: It can change the size of the array.</li><li>push: To append elements to the end of the array, and will return the new length of the it.</li></ul><p>—</p><h4>Structs</h4><p>These types work exactly as in other languages and help us to define new types for our contracts. To define one:</p><pre>struct Campaign {<br>        address beneficiary;<br>        uint fundingGoal;<br>        uint numFunders;<br>        uint amount;<br>    }</pre><p>—</p><h4>Global variables</h4><p>When we talk about ethers, sometimes is a big unit to send or to work with, because of that, solidity provides us other units as Wei or Szabo. You can use this link to check them out: <a href="https://converter.murkin.me/">Ether unit converter</a>.</p><p>So you can use those units in your contracts to make the works easier for you.</p><p>Further than that, you can use also other time constants as years, week, minute, seconds…</p><p>Also some other functions as:</p><p>• <strong><em>block.blockhash(uint blockNumber) returns (bytes32):</em> </strong>hash of the given block — only works for 256 most recent blocks excluding current</p><p>• <strong><em>block.coinbase (address): </em></strong>current block miner’s address</p><p>• <strong><em>block.difficulty (uint): </em></strong>current block difficulty</p><p>• <strong><em>block.gaslimit (uint): </em></strong>current block gaslimit</p><p>• <strong><em>block.number (uint): </em></strong>current block number</p><p>• <strong><em>block.timestamp (uint): </em></strong>current block timestamp as seconds since unix epoch</p><p>• <strong><em>msg.data (bytes): </em></strong>complete calldata</p><p>• <strong><em>msg.gas (uint): </em></strong>remaining gas</p><p>• <strong><em>msg.sender (address): </em></strong>sender of the message (current call)</p><p>• <strong><em>msg.sig (bytes4): </em></strong>first four bytes of the calldata (i.e. function identifier)</p><p>• <strong><em>msg.value (uint): </em></strong>number of wei sent with the message</p><p>• <strong><em>now (uint): </em></strong>current block timestamp (alias for block.timestamp)</p><p>• <strong><em>tx.gasprice (uint): </em></strong>gas price of the transaction</p><p>• <strong><em>tx.origin (address): </em></strong>sender of the transaction (full call chain)</p><p>From all of those, the one I use the most is probably <em>msg</em>.</p><p>Another useful thing is the mathematical functions. The most important functions are:</p><pre>sha256(...) returns (bytes32)<br>sha3(...) returns (bytes32)</pre><p>The last function I want to talk about is:</p><pre>selfdestruct(address recipient)</pre><p>Which allows us to destroy the current contract and return the funds to its owner.</p><p>This is the end of the first solidity guide where you have learned a lot about it, but you should program in it in order to learn it. In next lessons we will check out some examples.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c434cf03ea8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducción al BI con Microsoft II]]></title>
            <link>https://medium.com/@Carlos_molotov/introducci%C3%B3n-al-bi-con-microsoft-ii-275fd7e6e472?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/275fd7e6e472</guid>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Sun, 28 Jun 2015 10:24:59 GMT</pubDate>
            <atom:updated>2015-06-28T10:24:59.154Z</atom:updated>
            <content:encoded><![CDATA[<p>Lo primero, recordar que la primera parte está aquí: — Parte 1: <a href="http://carlosis.me/2015/03/24/introduccion-al-bi-con-microsoft/">Introducción al BI con Microsoft I</a></p><h3>Entrando en materia</h3><p>En la primera parte vimos todos los conceptos generales para trabajar en Business Intelligence. No estaba centralizado, eran conocimientos aplicables a cualquier herramienta. En este ya entramos de lleno a Visual Studio. Además, por si acaso, he decido que también haré un pequeño recordatorio teórico, por si las moscas. Debo de recordar que para hacer este tutorial vamos a necesitar de las siguiente herramientas. — SQL Server BI — Visual Studio (community o cualquier edición más “pro”) — Plugin Visual Studio Data Tools BI (optimizado para business intelligence)</p><p>Esta vez, por petición de un usuario voy a subir el artículo en PDF, de forma que podáis descargarlo y leerlo tranquilamente.</p><p>Os dejo lo link aquí:</p><p>This is an embedded <a href="http://office.com/">Microsoft Office</a> PDF, powered by <a href="http://office.com/webapps">Office Online</a>.</p><p><em>Originally published at </em><a href="http://carlosis.me/2015/04/30/introduccion-al-bi-con-microsoft-ii/"><em>carlosis.me</em></a><em> on April 30, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=275fd7e6e472" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducción al BI con Microsoft I]]></title>
            <link>https://medium.com/@Carlos_molotov/introducci%C3%B3n-al-bi-con-microsoft-i-2b3754cfe2ea?source=rss-9b3319cf5aa7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b3754cfe2ea</guid>
            <dc:creator><![CDATA[Carlos Gonzalez Juarez]]></dc:creator>
            <pubDate>Sun, 28 Jun 2015 10:24:03 GMT</pubDate>
            <atom:updated>2015-06-28T10:24:03.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*p4qt2DaLD_eI_Ahq.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*7TJIyR7xbPd3V9pa.jpg" /></figure><h3>Conceptos generales</h3><p><strong>Business intelligence</strong> es el conjunto de estrategias que nos ayudan a convertir los datos en información de calidad. Para ello:</p><ul><li>Los datos deben estar centralizados y no dispersos en distintas bases de datos.</li><li>Los datos proceden de lugares distintos y con estructuras diversas, es nuestro deber juntarlos y darles forma.</li><li>Los datos han de ser procesados antes de entrar en el <em>Data Warehouse</em> *</li><li><strong>*Data Warehouse:</strong> es el lugar donde se integra TODA la información recopilada. Estos datos, antes de entrar deber estar depurados, modelados y normalizados. Además, absolutamente todo debe quedar registrado con fecha, nada se borra. De esta manera podemos hacer regresiones a antiguos momentos. Otra característica de estas máquinas es que son Orientadas a Temas, es decir, que todo tendrá cabida aquí. Simplemente deberemos organizar cada tema en una tabla para que todo sea entendible.</li><li><strong>Data Marts:</strong> Son un concepto muy parecido a los Data Warehouse, solo que estos tan solo están orientados a una temática dentro de la empresa.</li><li>Ambos sistemas de almacenamiento deben tener una estructura interna, un esquema de modelado para la tablas. Los más usados son los siguientes:</li><li><strong>Esquema en estrella:</strong> Este es el esquemas más usado y se caracteriza por tener una sola tabla central llamada Tabla de Hechos. Además, tiene una tabla adicional por cada una de las perspectivas que queramos tomar (dimensiones). Es la más utilizada puesto que ofrece un mayor rendimiento y menor espacio en disco, aunque a cambio, esté menos normalizada.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/0*12caDqS6NMtjPVJ1.gif" /></figure><ul><li><strong>Esquema de copo de nieve:</strong> Tiene una estructura más compleja, pero a cambio, más normalizada. Su característica principal es que no todas las tablas adicionales se relacionan con la tabla central.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rvZWwlXzOAr-2pAa.png" /></figure><p>Periódicamente, en el DW se cargan los datos, para ello, se debe realizar un proceso llamado ETL (extract, transform, load).</p><ul><li>Extraer: Sacar la información de todas las fuentes que tengamos a disposición.</li><li>Transformar: Procesar los datos, para su conversión en información útil y homogénea.</li><li>Load: Cargar los datos obtenidos en el DW o en el DM.</li></ul><p>Para realizar el ETL, en muchas ocasiones se utilizan Bases de Datos intermedias para reducir la complejidad. Estas BD’s intermedias donde se almacenan los datos son <em>areas de staging</em>* y/o un <em>ODS</em>*</p><p><strong>*Area de staging:</strong> Es un area de almacenamiento para la extracción de datos, mejorar la calidad y cambios aun no presentes en el DW.</p><p><strong>*ODS:</strong> El fin de estos es dar soporte a los sistemas transaccionales. Es decir, una base de datos de consulta cuyo fin es ayudar a que el DW no se sobrecargue.</p><p>Además de esos dos nombrados anteriormente, la carga de datos también se realiza mediante los <em>cubos OLAP</em> Los <strong>cubos OLAP</strong> (Online Analytical Processing) tienen como objetivo agilizar la consulta de grandes volúmenes de datos. Para ello, usa estructuras multidimensionales (las explicaré en el futuro), que aportan una velocidad de respuesta muy superior a los <em>OLTP</em>*.</p><p><strong>OLTP</strong> (Online Transactional Processing): Son sistemas diseñados con el fin de poder gestionar un gran numero de peticiones concurrentes sobre la base de datos. La prioridad de los mismos es obtener una respuesta rápida y no la inserción de datos.</p><p>Con esto terminamos la primera parte de la introducción al BI con Microsoft. Esta primera parte ha sido 100% teórica porque es necesario, pero en futuras sesiones tendremos cosas más prácticas. Para ampliar información podéis leer este libro de Salvador Ramos (MVP de SQL Server): <a href="http://www.solidq.com/es/microsoft-business-intelligence-vea-el-cubo-medio-lleno/">Microsoft Business Intelligence vea el cubo medio lleno</a></p><p><em>Originally published at </em><a href="http://carlosis.me/2015/03/24/introduccion-al-bi-con-microsoft/"><em>carlosis.me</em></a><em> on March 24, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b3754cfe2ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>