Developer’s Life 03-04.03.2018

in developer •  7 years ago 

Hello World and Hello Dear Readers. I am Software Developer and I have also blogged about stuff not related to programming, because not everything is code (at least not programming code). I decided to start writing more technical stuff. As a part of this I’ll try as much as I can to write something in the programming area each day.

If you are following me, you’ll know that one of my latest products is a tool for Generating Database related code. My primary focus in programming for some years is Java, Web and Mobile stuff. So, as a step in this direction I am extending my tool to generate database code for the Apple’s Swift programming language.

Currently I have touched two ways to store structured data on the iOS – Core Data and Sqlite (FMDB library). There may be some more ways, but I’m stopping to these for now.

Core Data framework uses a model XML file/files for describing your domain objects and and the xcode development environment generates the model classes and the other necessary stuff. I tried to generate the model files directly – they are xml files wrapped in some other file. It is a zip like file, but not exactly, because, when I generated a Zip file from my tool, the IDE didn’t succeed to recognize it. So I left it to the state where the tool can generate only the XML describing the model. You could open some created by the IDE file and copy and paste the XML descriptions. I marked it as “early alpha” because it is not fully tested (even by me). Currently there is a problem when I run an app with Core Data Framework included. The compiler is whining about some swift stuff that I couldn’t fix for know. Maybe because my mac is 10+ year old. I may check it out some time in the future when I upgrade my machine or when there is need for it.

The second way that I have found to store structured data on iOS native apps is using sqlite(FMDB). It is simple Objective C library that wrappes around sqlite.

So, using my Tool you will receive some files – Models Classes and Model Data Access Object Classes and A Base Dao Class – that will initialize the database itself.

I have been busy during the day with the everyday stuff, but this evening I fixed a thing that the xcode was whining about. I am working on an iOS application equivalent to my Android Application “Breathe In”. Along side some app specific code I’ve implemented data caching using my tool. So, what I have found is – when you pass value parameters to an SQL query, you must provided non-optional ones.

db?.executeUpdate(“…sql query..”, values: [var1Param ?? 0 ,var2Param ?? “”])

So if your incoming variables are optional you must place some default value like this (someVariable ?? 0) or (someVariable ?? “”).

let var1 = var1Param ?? 0
let var2 = var2Param ?? “”

When the parameters get too much the IDE is whining and you’ve got to introduce local variables.

https://tomavelev.com/GeneratorApp/

Let’s see how my Idea of writing about technical stuff goes. Good night for now.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Tom can I ask you a programmer question ?

Yes, of course. Sorry for the late answer. I am writing the posts at the end of the day - before I go to bed.

Do you have any knowledge about coinbase’s internal system that allowes them to move crypto for free and instantly by user to user email addresses? If so could you elaborate on how it functions?

Thank you

Hi worldofdave. Actually it is not that complicated. I'll show you a personal examples.. (It is actually a good idea to describe this comment in an article). Four or five years ago I was noticed of bitcoin from one colleague and I went to trading with it. But in active trading instead of HODL. So I lost some $ in the battle with the market and sold them out (Only if I hodl those 5+ bitcoins :D ). Half a year ago when bitcoin went to 2000$ I bought 0.1 bitcoins ( 0.124515 BTC ). I cannot find any info of those old transations??? Why? . I didn't checked the transaction last summer but right now from the information that I can get from here:
https://live.blockcypher.com/btc/tx/5a5b2eb3237355d38f0c5d81dc22493f9a35224855c4b52dc527fc529ea94d76/
I can see that there is a lot of going on (on-chain) beyond my stuff. They are
most likely using some internal database to store and show crypto information to their users, but internally they probably store the crypto in united wallets. And when you do internal transfer - they only change some records in a database - without on-chain actual transfers. This is part of their marketing, a way to attract more consumers. In marketing, controlling (technically, physically and psychologically) the consumer's stuff is key to success.

I hope it is ok that I post this here... This was my Layer 2 solution :btc logo.jpg

https://steemit.com/bitcoin/@worldofdave/a-layer-2-solution