Saturday, November 5, 2016

Getting Hidden App Data From Your Google Drive

Some Android applications use space on your Google Drive to store data.  You can't see this data by browsing drive the normal way.  You can get access to it if you get the access token from the app and do a few other things.

I use an app to keep some notes and other things.  They require getting the paid version of the app to backup your data.  I wanted to see if I could get it myself without paying for the app.  I found out how to do this from this Stackoverflow post http://stackoverflow.com/questions/22832104/see-hidden-app-data-in-google-drive.  The example there uses php. Since I have been learning Python recently, I decided to see if I could do the same thing with Python.

 There is a pretty good explanation of why you need to go through all the steps you need to go through to get your data in the accepted answer for that post, so I won't go into too much detail about that here.


Tuesday, August 2, 2016

More Python - From web servers to machine learning

I have an idea for building something with python that uses machine learning.  It also involves the web.  I have been working towards getting this all to work.
I started with the machine learning parts.  I am using the scikit learn library.  I have also looked into the tensor flow library that Google made.  I decided to stay with scikit learn for now.  It looks like you can transition pretty easily if it turns out I need to.
To test some parts of my idea I needed a web server.  I created one in python.  It took a bit of reading and several iterations before I got something that I liked.  It is now setup so that it will serve any files in a folder or allow me to do things with any custom urls that I want.
I'll try to post more about this soon.  Maybe I'll post some code.  Probably not.  I never have time for that anymore.

Thursday, June 23, 2016

Learning python

I've started learning python.  I started looking into it because we may be doing some things with it at work if we move away from coldfusion.
In a previous post I mentioned the Unity3d terrain editor and the ability to import and export the terrain height data.  I decided to try to create one of those height map images using python.   I found a Perlin noise library for python and started working on it.  I haven't quite got it right yet, but I was able to generate a file that can be imported.
I will try to post more about this with some actual code when I get it working.

Friday, April 22, 2016

Unity 3d terrain

I started a new 3d unity project to play around with terrain creation.  You can add a terrain object and then they have tools for raising and lowering the ground.  There are also tools for changing textures and quickly adding trees.
You can also import and expory the terrain height data.  I am thinking it would be cool to use random noise, which I have posted about before, to generate this height data.

Tuesday, April 5, 2016

Continuing with Unity

I came up with an idea for a simple game using mostly the sample assets.  I created a red crate using the pink crate.  Then I made a prefab called a finish zone.  Pushing the red crate into the finish zone gets you to the next level.

I made a couple other robots that walk back and forth between barriers or edges.  One is blue and doesn't hurt you.  The other one is red and kills you if you touch it.

With those pieces I made a few levels.  I'm thinking of changing the graphics and turning it into a kids game.

It is pretty cool how simple it is to get a complete game.  I also made a simple menu.  One thing I haven't figured out yet is a nice way to size the controls and menu items for different screens.

Saturday, March 26, 2016

Unity 3d 2d project

I continued working on my 2d project today.  I was able to get some other npc characters to animate.  I added one of the pre-made killzone objects to them so if my character touches them the game restarts.

I was also able to add mobile controls and build an apk and play it on my phone.  It is really hard to play with the pre-made controls and default settings.  The character moves really fast.  It has all been very easy to do so far.

I watched part of a video about sprites and animators to help get started.

Thursday, March 24, 2016

Unity 3d exploration

I tried playing around with Unity 3d today.  This was the second time I have played with it.  Last time I made a 3d project and played around with some of the assets we have.  It was pretty cool and pretty easy to get a car setup that I could drive around.  

This time I tried a 2d project.  It was even easier.  They have some sample assets that let you build a game with a little robot guy that can jump on platforms.   I will hopefully be able to create a whole game sometime.

Maybe someday I'll actually finish one of these things I keep posting about.

Wednesday, March 23, 2016

Progress on Replacing iAds with Admob

I was able to get the first app working with Admob.  It was like I mentioned in the previous post, I had to create the adunit in code.  I was able to find a simple example on Stack Overflow and mostly just use it as is.  I had to create a header file to go along with the example file that was provided and then call that in my viewDidSomethingSomething function.  I don't have it open right now so I can't remember what that is called.

I had it all in place and everything would build and run, but then I was getting an exception.  It turned out I had messed something up by trying to drag things around in some area of XCode where you can graphically see your app.  I reverted a mainwindow.xib file back to what I had started with and everything started working.

I have to do a little more testing to see how it looks in the different simulators and make sure I have my adunit id correct but then I think it is finished.  Then we just have to submit it and get it re-approved by Apple.  That is always a fun process.

Sunday, March 20, 2016

Removing iAds from apps

I have several apps published on the Apple Appstore.  Four of them are using iAds and that service is going to be discontinued soon.  I am going to switch them all to use Admob.

I started working on the first one.  It is a pretty basic game that was built for us by a contracted developer.  It has been a few years since it was originally created.  I don't know if it was built poorly or the recommended ways of doing things have just changed since then, but it is not built in a way that works with the basic admob examples.  They suggest that your app use a storyboard and this one does not.

It looks like I will have to create the adunit in code and add it to the view.  I found a few examples of this on Stack Overflow but I haven't had time to try it yet.

I don't have the source code for 2 of the other apps yet, someone is going to send it to me, and the fourth one was built with a framework called Moai.  That last one is going to take some time to get fixed.  I have to setup a development environment for that framework and the framework isn't officially supported anymore from what I can tell.

I'll post more about all this soon I hope.

Friday, March 11, 2016

Service worker offline cache

I continued my exploration of service workers today.  I looked at offline caching  mostly.  Actually a lot of my time was spent messing with some example code that seems incorrect or out of date. I'm going back to my working code now.  I'll just have to slowly modify it to do what I want.

My goal is to have some simple options that I can pass into my framework that would allow turning on an offline cache for a site.  This would include a list of pages and a way to specify other pages that would be dynamically cached.

Just now I had another thought.  I should think about what it would take to make an offline cache of changes to a dynamic site. Then sync those changes when you come back online.

Thursday, March 10, 2016

Service Worker Framework

I have started working on my service worker framework or module.  I don't know if it will ever be useful to anyone but me, but I am learning a lot.

I created a base service worker that can be included in the one on my site.  I played around with passing an options object to the service worker using postMessage.  It is pretty interesting playing around with this stuff at this stage of the development.  There seem to be a lot of odd things that can happen.  You see a lot of messages and errors in the console.  I haven't gotten it all sorted out yet.

I am using Chrome for testing this.  You can easily see if you service worker has been registered in the Resources area of the dev tools.  Then you can delete it so it can be re-registered.  I'll try to keep posting more as I continue to work on this.

Thursday, February 25, 2016

Magento 2

I downloaded and setup a Bitnami virtual machine for Magento 2 over the last few days.  I'm going to start looking into what it takes to make extensions for Magento.  I have worked on building an extension for Magento 1.9 in the past, but I didn't get it finished.

I would like to build a few of these extensions and put them out on the Magento marketplace.  From what I have seen so far it is very easy to extend and modify pretty much any part of the way Magento works.  My knowledge of php is somewhat limited too, so I am looking forward to getting into more depth with a language other than Coldfusion.  I am just getting started, but the way Magento works seems very interesting.

Sunday, February 21, 2016

MySQL Ignore Index

I had to use something in a MySQL query last week that I haven't needed before.  IGNORE INDEX  I was aware that you could do this sort of thing, but I don't recall ever using it or seeing it in use before.  I have a query that joins a couple tables and looks for records with a particular foreign key value.  For some values of that column it was using an index that I added specifically for this query.  This was taking 1-2 seconds to run.  For other values it would use a different index and take 25-30 seconds to run.  I added an IGNORE INDEX for the one that I didn't want.  Then it started using a different index that had the same problem, so I had to ignore that one too.  Now it seems to be working quickly for all values and using the index that I want.  In most cases I have found that the database is pretty good and finding indexes that work best, but I guess not in this case.

Monday, February 15, 2016

Adding Google AdSense ads

I added google ads to my blog today.  This was very easy.  I already had Google AdSense setup on my account so it just took a minute to link the account and select a layout that works.

I also added ads to my main site mattdyer.us.  That site is setup as an AngularJS 2 site.  I am just getting started setting it up.  I was able to just put the ads in my main html file though so I didn't have to worry right now about whether they would work well with an angular site.  Adding those ads was also pretty easy.  I spent most of the time just playing with a layout to get a nice side bar and a main area for content.  I also did some reading about routing in Angular 2.  Hopefully now I can start adding some other pages to my site.

Trolley Problem Thoughts

A few days ago I read about the trolley problem.  It was mentioned in an smbc-comics.com comic.  I hadn't heard of this before, but I have considered similar situations before when thinking about driverless cars.

When I thought about it the ideas of social class came to mind.  Would you be less likely to throw the switch if the five people on the current track appeared to be homeless, or possibly drug users, and the single person on the other track was perhaps a railroad worker.  It could matter how long you have to make your decision.

Previous thoughts I have had involved driverless cars attempting to save their occupants.  Given a choice should the car run over pedestrians to save the occupants of the vehicle.  For example if the car was unable to stop in time should it choose to go off a cliff killing the occupants, or run over some number of pedestrians and stop safely.

I think current driverless cars would probably go off a cliff to avoid colliding with the people, but probably only because they have never encountered a cliff before.  I don't know if they have any preset knowledge about what situations could destroy the car, or if it all comes from learning while driving.

Sunday, February 14, 2016

Service worker exploration

About a week ago I took another look at service workers.  I looked at them once before but I only got as far as getting one registered.

This time I got a little further.  I'm thinking of building a module that would allow easily doing some offline caching and other things that are possible with service workers.  I think building something like that would be a good way to learn all about service workers.

Angular 2

I setup my first angular 2 site over the last few days.  I started with the js version of the five minute quick start.

The site replaced my old mattdyer.us site.  It is now hosted on github sites.  There are only a few files.  I haven't gone too far beyond the example site yet.

I'm hoping the site will continue to grow now.  I've got a lot of ideas for things ro work on.

Coding

  I'm not sure where I heard this, and it wasn't worded this way, but it helps to think about coding this way. Basically, any progra...