I am a programmer but I am not your programmer. Some of what I write may be useful, especially if it is pointing you at information written by other people.
Sunday, May 29, 2016
Today's fun error message, brought to you by React, Babel, node and webpack
Child html-webpack-plugin for "index.html":
ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory'
$code\app\index.html in $code
Cause: a trailing comma in the dependencies section of my package.json file.
Of course.
Sunday, February 22, 2015
Project is not a WPF project.
For the last year, I've mostly just been maintaining my PAX app by adding the new schedule data and maps for each new PAX event. The last few times I opened it up to do that, I noticed that the design window always showed "Invalid Markup" for my xaml files, and sometimes when I built the project I got a strange avalanche of build errors, including
Error 50 Application is not supported in a Windows Presentation Foundation (WPF) project.
Error 47 Cannot add content to an object of type "ApplicationBar".
Error 5 Cannot add content to an object of type "PhoneApplicationPage".
....
I had no idea how to fix it, or why it was occurring - obviously, my project was not and never had been a WPF project. I made some notes for myself like 'closed Visual Studio, deleted bin and obj files, re-opened, and it was fixed' - then when it happened again, following the same process wouldn't fix it!
Finally this time, I managed to work it out. These errors occur if I have a *.xaml file open in the editing pane when I run a build. Wow. 100% reproducible, too. At least it's easy to fix...
Labels:
build,
debugging,
errors,
visual studio,
windows phone
Thursday, May 29, 2014
Pair programming
I'm currently taking the EdX course CS 169.1x from Berkeley, just for fun. I signed up ages ago but of course when it started I was busy and ignored it, so now I'm starting about four weeks late and catching up real fast.
Unfortunately, among other drawbacks, this means I'm completing a few weeks of homework in a couple evenings and don't have the time to schedule any pair programming sessions. I think pair programming would be a really interesting way to approach this and will probably try and do some when I am working at a more leisurely pace, but until then: here is my replacement discussion of pair v solo programming.
As luck would have it, I spent an hour or so the other day with a senior dev at work both trying to debug a routing issue I was having. While he knows a lot more than I do, he admitted that routing and MVC are not things he is too familiar with, so he was jumping around the code looking for what was happening, and going slow enough that I could follow along. In this case, as I mentioned, I had spent time debugging this before coming to him for help, so one of the helpful things here was that I could see where he followed the same process I had (yay!) and where he did something different, that I perhaps hadn't thought of. I'm not sure if I would have gotten the same value from just coming to him without going through it myself first. From my reading of the forums, many of the students in this class have been doing exactly that - doing the homework and then setting up a peer programming session to re-do it. When this pairs them with somebody who has no idea what they are doing, they might not get the learning experience I did, but they get the opportunity to try and explain what they did the first time which should help solidify the concepts.
In my work session, the other guy couldn't figure out what was going on either. Eventually when we'd clarified exactly what we expected to happen and what was happening, he said that it was time to start doing some simplifying refactoring to remove some of the apparently unused scaffolding code around everything - and as soon as he removed the routing registration from inside an area, the Url.Action calls began working. Neither of us knew why, and I still have to talk to one of our more MVC-knowledgeable colleagues to figure it out - but that step is one that would have taken me far far longer to go to on my own!
So, peer progamming experience: as the junior dev, I've found it very useful. Later in this course I might get the chance to be the more knowledgeable one, and we'll see how that goes.
Unfortunately, among other drawbacks, this means I'm completing a few weeks of homework in a couple evenings and don't have the time to schedule any pair programming sessions. I think pair programming would be a really interesting way to approach this and will probably try and do some when I am working at a more leisurely pace, but until then: here is my replacement discussion of pair v solo programming.
As luck would have it, I spent an hour or so the other day with a senior dev at work both trying to debug a routing issue I was having. While he knows a lot more than I do, he admitted that routing and MVC are not things he is too familiar with, so he was jumping around the code looking for what was happening, and going slow enough that I could follow along. In this case, as I mentioned, I had spent time debugging this before coming to him for help, so one of the helpful things here was that I could see where he followed the same process I had (yay!) and where he did something different, that I perhaps hadn't thought of. I'm not sure if I would have gotten the same value from just coming to him without going through it myself first. From my reading of the forums, many of the students in this class have been doing exactly that - doing the homework and then setting up a peer programming session to re-do it. When this pairs them with somebody who has no idea what they are doing, they might not get the learning experience I did, but they get the opportunity to try and explain what they did the first time which should help solidify the concepts.
In my work session, the other guy couldn't figure out what was going on either. Eventually when we'd clarified exactly what we expected to happen and what was happening, he said that it was time to start doing some simplifying refactoring to remove some of the apparently unused scaffolding code around everything - and as soon as he removed the routing registration from inside an area, the Url.Action calls began working. Neither of us knew why, and I still have to talk to one of our more MVC-knowledgeable colleagues to figure it out - but that step is one that would have taken me far far longer to go to on my own!
So, peer progamming experience: as the junior dev, I've found it very useful. Later in this course I might get the chance to be the more knowledgeable one, and we'll see how that goes.
Thursday, March 27, 2014
app download statistics
Currently, I write my app targeted at windows phone 7.1, which means it runs on all windows phones out there. There are some nice new features in the windows phone 8 sdk, and it seems like a lot of effort to run multiple versions, so I have been thinking about just ditching wp7 and building only for wp8. Before doing that, however, I thought it would be nice to have some actual numbers on what phones are running my app.
I thought I'd have to add this in my own analytics call, but it turns out the Dev Center offers an excel export of your download stats that includes the phone OS Version for each purchaser (along with other info like manufacturer, mobile operator, phone language, and somehow even user gender and age group). So I downloaded that report for the last year and found
- 140 users with wp7
- 225 users with wp8
- 78 users with unspecified OS versions (not sure how that works)
looks like over a third of my users are still on 7, so I should definitely make sure the app still works for them!
Tuesday, January 21, 2014
Automated Calendar Planning
My initial interest in AI planning comes from a promise I made to a friend years ago, which I was unable to keep. He was an amateur theater director, and he was complaining about the time and difficulty of building a rehearsal schedule, where constraints included
- actors available at different times
- rehearsal slots of different length
- scenes of different length
- scenes that contained varying combinations of actors
- a hard constraint that each scene be rehearsed at least once before the play opened (I think he actually said at least twice, ideally three times)
- a soft constraint that scenes would ideally be rehearsed in order
- the reluctant possibility that if it were impossible to have all the actors for a scene together for long enough, you could provide stand-ins to allow others to rehearse
As an over-ambitious junior programing student, I said I could build something that would do that! Unfortunately (although perhaps unsurprisingly), it turned out to be quite a bit more difficult than I had imagined, and I never got around to it. Last year, I started looking into the problem again and I did build a much simplified version for an unrelated scenario (given x conference attendees who have expressed preferences from 1-y for each of y conference workshops held over z timeslots, which attendees should go to which workshops?) but the Automated Theater Rehearsal Planner was still beyond me. In late January, as I poked through the list of uncompleted projects, I once again came across this one and decided to look seriously into it - as a professional programmer, surely this is something I can do! And in a serendipitous moment, while looking up resources on scheduling algorithms I discovered that this course had begun a few days earlier, so I signed up for it and this is now an active project that I hope to get into a useful state this year.
Some background info on the problem for reference
To understand the general domain of scheduling, I started at the broadest relevant page, http://en.wikipedia.org/wiki/Automated_planning_and_scheduling, and after looking through it selected these relevant links
- http://en.wikipedia.org/wiki/Preference-based_planning, which is relevant because of the soft constraints listed, such as preferring to rehearse in order and have all actors in a scene together
- http://en.wikipedia.org/wiki/Scheduling_(computing) (if one considers the director or the rehearsal space to be the resource being scheduled) which led to http://en.wikipedia.org/wiki/Job_Shop_Scheduling and eventually on to http://en.wikipedia.org/wiki/Genetic_algorithm_scheduling and finally to http://en.wikipedia.org/wiki/Scheduling_(computing)#Scheduling_optimization_problems and to this flow shop scheduling demonstration app: http://posh-wolf.herokuapp.com/ (although flow-shop appears more restricted than my problem).
Since it seemed likely that at least a broadly similar tool existed, I searched for free tools to try out in order to clarify what I needed to build exactly. (Or if perhaps it already existed). When searching for basic 'scheduling tools' or 'resource planning', the results tended to be about processes, such as scheduling a factory line and supplier logistics for organising delivery schedules - it may turn out that this is the same problem, but they don't quite seem to match. When I searched for 'rehearsals' (or similar), there were no specifically relevant results, however I found that there is a ton of software available for employee scheduling. Since it seemed that this should have significant overlap with the problem I'm looking at, it seemed worth installing a couple of the freeware options to check them out.
http://www.kappix.com/download.htm
http://www.simulation.co.uk/
I found that the basic issue with these tools is that employee scheduling operates on the assumption that you have a fixed number of slots to fill for each session, and are moving the people into the slots (and in the more complex tools, matching the people to the required tasks for each slot). For the rehearsals, I have a variable number of slots, based on how many people can attend, and I want to see which scenes (tasks) are relevant to the largest number of these people.
Now, for the Creative Challenge project in the class: I'm going to get my scheduler app into a user-friendly state and post it to the class.
Sunday, January 19, 2014
Deploying New Relic on Azure
I created a New Relic account a while ago, but never got around to deploying it, and then when I tried to log in again it told me
a) my account was not verified, I needed to click the verification link in the email
b) the verification link in the email was not valid
I emailed support and never heard back, so just gave up on it.
Today I saw they were doing a new promotion of access to Tutes+, which looked useful, so I figured it was time to sign up for a new account (as the old one was completely empty anyway, easier to abandon it than work through support). I signed up for a new account and chose to deploy the python agent. They provided some pretty easy-looking instructions, and I went to open up the django local copy of my python site, and it wouldn't run. Somehow, I have no idea why, I seem not to have python2.7 on my machine any more. So I had to reinstall that, following the steps at http://docs.python-guide.org/en/latest/starting/install/win/. Since I was resetting it all, I figured I'd try better practices this time and installed virtualenv as well.
C:\Dropbox\code\optimization\SimplySchedule>virtualenv --python=C:\Python27\python27.exe scheduler
(env)>pip install newrelic
....
***************************************************************************
WARNING: The optional C extension components of the Python agent could
not be compiled. This can occur where a compiler is not present on the
target system or the Python installation does not have the corresponding
developer package installed. The Python agent will instead be installed
without the extensions. The consequence of this is that although the
Python agent will still run, JSON encoding/decoding speedups will not be
available, nor will some of the non core features of the Python agent.
INFO: Only pure Python agent was installed.
***************************************************************************
....
I guess I probably don't have a C compiler installed, now I feel bad.
but....then it said I needed to relaunch the app with a different init string. Or, since I don't have access to actually do the launching, I need to edit the wsgi file.
modify the WSGI script file/module for your web application and insert at the start of that file:
import newrelic.agent
newrelic.agent.initialize('newrelic.ini')
I had no idea where that was at first, but after some googling (and temporary confusion between this and the wfastcgi.py file) I found the wsgi file in django.core and added those lines, but got an import error trying to start the server. I eventually realised that I had installed newrelic for python3, not python2 (sigh) but while noodling around looking for hints on that, I found a more detailed new relic setup guide which mentioned you should edit the newrelic.ini file to choose a real log file location and set the name of the app. So I did pip2 install newrelic, copied the files to the site-packages directory, and python27 manage.py runserver : everything works!While I was fiddling with everything, I also took the time to set up a slightly more useful index/home page for the site. Then when I went to push to github for deployment (which is super nice) the local repository wasn't associated with the remote - maybe I lost all the old settings when I installed windows 8.1 over the preview? So I also had to reassociate my local copy of the repository with github to push to that - and it's running with the new pages :)
Sunday, January 5, 2014
SQLite woes, cont.
At the end of my last post, I could launch the app and view events, but then got a Null Reference Exception while saving the events into the db. Oddly enough, debugging through the code showed that I was getting a SQLite error code 11 on *every second event*, and then getting a Null Reference Exception after a set of events.The call stack showed:
{System.NullReferenceException: NullReferenceException
at Community.CsharpSqlite.Sqlite3.sqlite3BtreeClose(Btree& p)
at Community.CsharpSqlite.Sqlite3.sqlite3_close(sqlite3 db)
at SQLiteClient.SQLiteConnection.Dispose()
at PAX7.Utilicode.DBHelper.Close()
at PAX7.Utilicode.DBHelper.Finalize()}
perhaps I'm calling close twice? I added a breakpoint in the DBHelper.Close() method to check this. I also wrapped the code inside the method in a try-catch-throw to Little Watson block to avoid crashing the app with this exception.
{System.NullReferenceException: NullReferenceException
at Community.CsharpSqlite.Sqlite3.sqlite3FindIndex(sqlite3 db, String zName, String zDb)
at Community.CsharpSqlite.Sqlite3.sqlite3StartTable(Parse pParse, Token pName1, Token pName2, Int32 isTemp, Int32 isView, Int32 isVirtual, Int32 noErr)
at Community.CsharpSqlite.Sqlite3.yy_reduce(yyParser yypParser, Int32 yyruleno)
at Community.CsharpSqlite.Sqlite3.sqlite3Parser(yyParser yyp, Int32 yymajor, Token yyminor, Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3RunParser(Parse pParse, String zSql, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3Prepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pReprepare, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3LockAndPrepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pOld, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3_prepare(sqlite3 db, String zSql, Int32 nBytes, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3_exec(sqlite3 db, String zSql, dxCallback xCallback, Object pArg, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3InitCallback(Object pInit, Int64 argc, Object p2, Object NotUsed)
at Community.CsharpSqlite.Sqlite3.sqlite3InitOne(sqlite3 db, Int32 iDb, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3Init(sqlite3 db, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3ReadSchema(Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3LocateTable(Parse pParse, Int32 isView, String zName, String zDbase)
at Community.CsharpSqlite.Sqlite3.sqlite3SrcListLookup(Parse pParse, SrcList pSrc)
at Community.CsharpSqlite.Sqlite3.sqlite3Insert(Parse pParse, SrcList pTabList, ExprList pList, Select pSelect, IdList pColumn, Int32 onError)
at Community.CsharpSqlite.Sqlite3.sqlite3Insert(Parse pParse, SrcList pTabList, ExprList pList, Int32 null_4, IdList pColumn, Int32 onError)
at Community.CsharpSqlite.Sqlite3.yy_reduce(yyParser yypParser, Int32 yyruleno)
at Community.CsharpSqlite.Sqlite3.sqlite3Parser(yyParser yyp, Int32 yymajor, Token yyminor, Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3RunParser(Parse pParse, String zSql, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3Prepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pReprepare, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3LockAndPrepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pOld, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3_prepare_v2(sqlite3 db, String zSql, Int32 nBytes, Vdbe& ppStmt, Int32 dummy)
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](T toInsert)
at PAX7.Utilicode.DBHelper.Insert[T](T obj, String statement)
at PAX7.Model.Schedule.sqlInsertEvent(Event newEvent)}
this one
{System.NullReferenceException: NullReferenceException
at Community.CsharpSqlite.Sqlite3.DbHasProperty(sqlite3 D, Int32 I, UInt16 P)
at Community.CsharpSqlite.Sqlite3.sqlite3Init(sqlite3 db, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3ReadSchema(Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3LocateTable(Parse pParse, Int32 isView, String zName, String zDbase)
at Community.CsharpSqlite.Sqlite3.sqlite3SrcListLookup(Parse pParse, SrcList pSrc)
at Community.CsharpSqlite.Sqlite3.sqlite3Insert(Parse pParse, SrcList pTabList, ExprList pList, Select pSelect, IdList pColumn, Int32 onError)
at Community.CsharpSqlite.Sqlite3.sqlite3Insert(Parse pParse, SrcList pTabList, ExprList pList, Int32 null_4, IdList pColumn, Int32 onError)
at Community.CsharpSqlite.Sqlite3.yy_reduce(yyParser yypParser, Int32 yyruleno)
at Community.CsharpSqlite.Sqlite3.sqlite3Parser(yyParser yyp, Int32 yymajor, Token yyminor, Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3RunParser(Parse pParse, String zSql, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3Prepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pReprepare, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3LockAndPrepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pOld, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3_prepare_v2(sqlite3 db, String zSql, Int32 nBytes, Vdbe& ppStmt, Int32 dummy)
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](T toInsert)
at PAX7.Utilicode.DBHelper.Insert[T](T obj, String statement)
at PAX7.Model.Schedule.sqlInsertEvent(Event newEvent)}
{SQLiteClient.SQLiteException: Unknown error
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](T toInsert)
at PAX7.Utilicode.DBHelper.Insert[T](T obj, String statement)}
{System.NullReferenceException: NullReferenceException
at Community.CsharpSqlite.Sqlite3.ENC(sqlite3 db)
at Community.CsharpSqlite.Sqlite3.sqlite3VdbeExec(Vdbe p)
at Community.CsharpSqlite.Sqlite3.sqlite3Step(Vdbe p)
at Community.CsharpSqlite.Sqlite3.sqlite3_step(Vdbe pStmt)
at Community.CsharpSqlite.Sqlite3.sqlite3_exec(sqlite3 db, String zSql, dxCallback xCallback, Object pArg, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3InitCallback(Object pInit, Int64 argc, Object p2, Object NotUsed)
at Community.CsharpSqlite.Sqlite3.sqlite3InitOne(sqlite3 db, Int32 iDb, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3Init(sqlite3 db, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3ReadSchema(Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3LocateTable(Parse pParse, Int32 isView, String zName, String zDbase)
at Community.CsharpSqlite.Sqlite3.sqlite3SrcListLookup(Parse pParse, SrcList pSrc)
at Community.CsharpSqlite.Sqlite3.sqlite3Insert(Parse pParse, SrcList pTabList, ExprList pList, Select pSelect, IdList pColumn, Int32 onError)
at Community.CsharpSqlite.Sqlite3.sqlite3Insert(Parse pParse, SrcList pTabList, ExprList pList, Int32 null_4, IdList pColumn, Int32 onError)
at Community.CsharpSqlite.Sqlite3.yy_reduce(yyParser yypParser, Int32 yyruleno)
at Community.CsharpSqlite.Sqlite3.sqlite3Parser(yyParser yyp, Int32 yymajor, Token yyminor, Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3RunParser(Parse pParse, String zSql, String& pzErrMsg)
at Community.CsharpSqlite.Sqlite3.sqlite3Prepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pReprepare, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3LockAndPrepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pOld, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3_prepare_v2(sqlite3 db, String zSql, Int32 nBytes, Vdbe& ppStmt, Int32 dummy)
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](T toInsert)
at PAX7.Utilicode.DBHelper.Insert[T](T obj, String statement)
at PAX7.Model.Schedule.sqlInsertEvent(Event newEvent)}
and this, seriously?
{SQLiteClient.SQLiteException: SQL logic error or missing database
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](T toInsert)
at PAX7.Utilicode.DBHelper.Insert[T](T obj, String statement)}
+ ex {SQLiteClient.SQLiteException: no such table: events
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](T toInsert)
at PAX7.Utilicode.DBHelper.Insert[T](T obj, String statement)} System.Exception {SQLiteClient.SQLiteException}
+ $exception {System.ObjectDisposedException: Cannot access a closed file.
at System.IO.__Error.FileNotOpen()
at System.IO.FileStream.get_Length()
at System.IO.IsolatedStorage.IsolatedStorageFileStream.get_Length()
at Community.CsharpSqlite.Sqlite3.sqlite3_fileSize(sqlite3_file id, Int32& pSize)
at Community.CsharpSqlite.Sqlite3.sqlite3OsFileSize(sqlite3_file id, Int32& pSize)
at Community.CsharpSqlite.Sqlite3.sqlite3PagerPagecount(Pager pPager, Int32& pnPage)
at Community.CsharpSqlite.Sqlite3.hasHotJournal(Pager pPager, Int32& pExists)
at Community.CsharpSqlite.Sqlite3.sqlite3PagerSharedLock(Pager pPager)
at Community.CsharpSqlite.Sqlite3.lockBtree(BtShared pBt)
at Community.CsharpSqlite.Sqlite3.sqlite3BtreeBeginTrans(Btree p, Int32 wrflag)
at Community.CsharpSqlite.Sqlite3.schemaIsValid(Parse pParse)
at Community.CsharpSqlite.Sqlite3.sqlite3Prepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pReprepare, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3LockAndPrepare(sqlite3 db, String zSql, Int32 nBytes, Int32 saveSqlFlag, Vdbe pOld, Vdbe& ppStmt, String& pzTail)
at Community.CsharpSqlite.Sqlite3.sqlite3_prepare_v2(sqlite3 db, String zSql, Int32 nBytes, Vdbe& ppStmt, Int32 dummy)
at SQLiteClient.SQLiteCommand.ExecuteNonQuery[T](T toInsert)
at PAX7.Utilicode.DBHelper.Insert[T](T obj, String statement)
at PAX7.Model.Schedule.sqlInsertEvent(Event newEvent)} System.Exception {System.ObjectDisposedException}
while events from all four days are visible on first load, only events on friday are saved back to the database (inspected with isolated storage explorer). It has correctly saved the star and reminder for the event I added to my schedule, however.
Tuesday, December 17, 2013
sharing app data for the live tile
So, the recommended way to share data between the app and the periodic task is by files in the isolated storage - perfect, that was my plan!
BUT, my periodic task project doesn't by default have access to the classes defined in the app - which will make it tricky to read and parse the schedule xml :/ And I can't make it reference that project, because it 'is not supported by a Background Agent'.
Clearly, I need to extract shared functionality to a library of some supported type, and reference it from both projects. I'll need
- event object definition
- schedule parser
Basically this is all the bits contained in my Model definition, which makes me feel like I must have structured it in a reasonable way :) Unfortunately, once I moved them, I found that I had a lot of View-related code in there, calling App.Resources, etc, which wouldn't work in a shared library :/ Well, I guess the cleanup required here will make the code better altogether, so it's worth doing!
I used this post as an example to get me started:
http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2011/11/this-is-continuation-of-this-post.html
Specifically, I have an SQLite db which is instantiated in the App.xaml.cs class, which I can't refer to from my library - and is probably the wrong place anyway. But, the DB seems to use the Assembly name to access it: and isn't the assembly name going to be different between the main app and the background task? There's not much reference on the web, but a couple of people say that it isn't possible to use sqlite in a background task. I was worried that I would have to update my model to use the db for the full list, and back to the flat file for the individual schedule, which would be a shame - but I decided to go ahead with the refactoring and try it - and everything ran! It didn't work, quite - it always said 0 events found - but it managed to instantiate the db connection and run through all the code without panicking, so must be most of the way there.
Unfortunately, I found that the database had starting renaming all events to "1.0" when they were stored. I figured out that this was because I had added a new field to the Event object, which was messing up the Insert statement. Once that was solved, I started hitting exceptions when the scheduled task tried to read the db - I figured that was because the db file was locked, because it was never being closed by the main process. I cleaned up the DBHelper file a little, turning it into a singleton and making sure that every operation which called Open() also called Close(). At this point, I decided should probably create an Interface for the DBHelper, which would make testing easier and also make migration easier if I switch away from SQLite at some point. I recently started actually trying to use some of Visual Studio's refactoring abilities, so here I did right-click on the class name -> Refactor -> Extract Interface. Then select which of the public methods I wanted in the Interface, and Done! Pretty nice.
Unfortunately, when I ran the app again, the database locking was even worse - even the original app process could never open it, always getting the same error. I decided that I did need a real mutex. I found the outlines in another stack overflow answer and added a check/hold/release mutext everywhere I had the open/close db work. Running with this made it clear that actually, it wasn't a deadlock - even when I turned off the background agent, I was getting 'unable to open database' errors every time. Clearly, the actual problem had been introduced when I updated the DB schema. I could validate with the Isolated Storage Explorer that it was being copied into storage correctly. I stepped through the code and verified that the db was being opened successfully on first contact - but then when it attempted to execute a query, the code tried to open a dbname of "Events.sqlite-journal", which threw a storage exception because it didn't exist.
I followed advice (from Stack Overflow, obvs) to create the journal file back at the start with the actual db file - but still got an error when trying to open it. To narrow down the problem, I tried opening the file straight after creating it - and still got the error. I think I should have been able to figure this out from there, but instead I went and searched to get a list of basic causes for this error - and the very first answer was 'you haven't closed the stream that was returned when you created the file'. Duh, I mean, really. Added a file.Close(), ran the app, everything works! Well, except a Null Reference Exception when I tried to add an event to my schedule, but lots of things worked. Some, at least. More than earlier today.
(this post was written as-it-happened, between december 17 and 26. Very useful for tracking what I had done when I was only doing random half-hours of work!)
Thursday, December 12, 2013
generating a live tile
I'm working on adding a live tile to my PAX app, to show the next item in the schedule. Finally got 'a' live tile working, with a couple headaches along the way.
1. Because I still have a 7.0 project, the nice simple API for 'ActiveTiles.FirstOrDefault' doesn't exist, so you have to use an Enumerator on the ActiveTiles set, and apparently I am still hazy on Enumerators so forgot to get next before trying to use the current tile.
2. I'm really making life more difficult for myself by continuing to target 7.0 devices, but I don't want to give up on them yet. But I do really want to offer a wide tile option to those who can use it! Fortunately Telerik offers a LiveTileHelper in their tools (which I already use and pay for) which handles the 'does this device support x' aspect of it, I haven't incorporated that yet but will definitely use it. I should probably read through all their docs to see what else there is, because I only found out about this by someone mentioning it in a stack overflow response about tiles.
3. Because I want the front of the tile to display a bunch of text, I'm going to have to generate a bitmap containing that text. I found a few examples on stack overflow , but somehow when I ran my app the generated image was not applied. I checked the tile docs and they mentioned that setting the BackgroundImage property to a null Uri would just be ignored, but I used the Isolated Storage Explorer to verify that the image was created and in the file system exactly where I expected. After going back to doublecheck anything I'd missed in the sample code, I noticed that their code looked like
BackgroundImage = new Uri("isostore:/Shared/ShellContent/Image.jpg", UriKind.Absolute),
whereas I had
data.BackgroundImage = new Uri("/Images/Tiles/paxTile.png", UriKind.Relative);
data.BackBackgroundImage = new Uri("/Images/Melbourne/melbTile.png", UriKind.Relative);
curiously enough the background image worked, but not the front image. I changed the front image to be in the format isostore:file, Absolute, and it worked! Still not sure why the requirements are different for the front and back - I left a comment on one of the MSDN pages for setting Live Tiles asking about this (and for a note to be added to the docs somewhere).Now I just have to design the tile layout and actually make it look decent. Here's the plan so far:
// __________________
// (x) // <- if you have more than one session on your schedule for the
// // next hour, this is how many. The tile just shows details on one.
// my great session... // max 14 chars? check font size
// rest of name?
// time // in users culture
//
// __PAX Digital Assistant__
// BACK
//______________________
//
// My session name is...
// 12:30: Unicorn
// Come play with my f...
// 12.30: Cat.
// Leave Me Alone Wit...
// 13:00: Main Theater
// _______________________
// layout wide:
//__________________________________________
//
// My session name is the funniest thing you eve...
// 12:30: Unicorn
// Come play with my friends while I make fun of y...
// 12.30: Cat.
// Leave Me Alone With My Collection of Pokemon...
// 13:00: Main Theater
//__________________________________________
Wednesday, November 27, 2013
Cannot access x.y.z.dll because it is being used by another process
Spent a while today trying to figure out why I couldn't run an app, which kept giving me the build error that a dll was being used by another process. I found this super nice tip which can help avoid a bunch of procmon/etc fiddling:
1. open a command line
2. go to the directory containing your locked dll
3. >tasklist /m my.locked.dll
via http://edwin.vriethoff.net/2009/01/26/find-out-which-process-is-locking-a-dll-without-extra-tools/
1. open a command line
2. go to the directory containing your locked dll
3. >tasklist /m my.locked.dll
via http://edwin.vriethoff.net/2009/01/26/find-out-which-process-is-locking-a-dll-without-extra-tools/
Monday, November 18, 2013
[TestMethod] public static void IAmInvisible()
Just spent a little time debugging some MSTests I was trying to add to a project, which just weren't showing up in the Test Explorer. Most of the 'help these tests don't show up' info out there is because someone is trying to add a new project, but in this case I was adding a new class to an existing project.
Eventually I tried adding a new set of tests identical to some working tests, and editing them bit by bit to look like my failing ones. Perhaps it should have been more obvious, but the offending difference was that I had marked the new tests as Static - that doesn't seem to be allowed, and I can't even find that restriction mentioned anywhere. I guess most people never try it?
Eventually I tried adding a new set of tests identical to some working tests, and editing them bit by bit to look like my failing ones. Perhaps it should have been more obvious, but the offending difference was that I had marked the new tests as Static - that doesn't seem to be allowed, and I can't even find that restriction mentioned anywhere. I guess most people never try it?
Tuesday, October 15, 2013
Phone devs love this one weird trick.
Just came across a really sweet fiddler trick to make life a little simpler for windows phone development: set up an autoresponder rule that serves the FiddlerRoot certificate from a nice short url, to save a little effort in the process of re-installing it every time you restart the emulator.
http://rikk.it/2013/07/capture-windows-phone-8-network-traffic-with-fiddler/
Saturday, June 8, 2013
File locations on azure
Spent the last few
days getting everything working in azure with correct folder permissions and so
on, leaning heavily on stack overflow
for hints. First I found that the templates didn't work in azure because I
hardcoded the template locations to c:\users\jafitzge…, had to figure out how
to put a location that would work in both the dev and production environments
- http://stackoverflow.com/questions/3038459/django-template-path
- http://stackoverflow.com/questions/6098275/django-problem-with-template-paths
Then I got
permissions errors trying to write my result files and debug files
[Errno 2] No such file or directory:
'SampleData2.csv'
[Errno 13] Permission denied: 'scheduledebug10.log'
I tried looking up
azure debugging options to see if there was a standard location for log files,
etc. http://msdn.microsoft.com/en-us/magazine/ff714589.aspx
is only about .net logging options apparently?
http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/7733a3d8-e80f-4ac9-b285-bf9c652896fd
is promising, how do I write to a file in python on azure? Answer leads to
http://msdn.microsoft.com/en-us/library/ee758708.aspx
which talks about using the Azure Managed Library to access Local Resources.
http://stackoverflow.com/questions/15146545/ioeerror-in-python-no-such-file-or-directory
suggested I needed to change from writing to the current working directory, and
instead write to the module directory.
Locally the file is at C:\Users\...\SimplySchedule which is
PROJECT_PATH.
Finally fixed all
the file permission issues by using the correct folders, and extracted the file
path calculations to a couple functions so I could be sure I was doing it the
same way everywhere.
Now working on
serving the saved schedule file as a download, which seems like should be done
using the MEDIA settings. Checking out the django docs again at https://docs.djangoproject.com/en/dev/topics/files/
means I should change the file save location from
import os.path
BASE =
os.path.dirname(os.path.abspath(__file__))
To
>>> from
django.core.files.storage import default_storage
>>> from django.core.files.base import ContentFile
>>> from django.core.files.base import ContentFile
>>> path =
default_storage.save('/path/to/file', ContentFile('new content'))
This stuff looks
relevant: http://stackoverflow.com/questions/883313/django-excel-xlwt/883351#883351
This implies I
should be saving my debug files to STATIC, not media - that makes sense! http://stackoverflow.com/questions/6619464/django-serving-from-media-but-not-static?rq=1
Also looks
interesting for when I create an actual model for all the data I'm throwing
around: saving an uploaded file as a model: https://docs.djangoproject.com/en/dev/topics/http/file-uploads/
Now I tried creating
public facing 404 and 500 templates and setting Debug=False but it didn't seem
to have taken hold when I deployed, although it was working as expected
locally. However when I went back to
look at it again a couple hours later it was working as expected. Possibly just
a caching issue.
So, current state - I have all the functionality requested available, although the site itself looks ugly as hell and super amateur. Still waiting for dad to go check it out and give some feedback, and until then it's time to get some PAX Aus app preparation done.
Friday, May 24, 2013
Django and sql azure, wtf?
Chapter 5 of the Django Book - Models
I thought about just
skipping this one as I don't anticipate needing a db for the schedule app, but
decided I might as well follow through, it'll probably come in handy soon
enough.
So step 1 I created
a sql database in azure to use, and now I need a sql engine for python.
I found https://pypi.python.org/pypi/django-pyodbc-azure/1.0.5
which told me to install pyodbc first, which was googleable enough, and
available for both 2.7 and 3.x. But the 2.7 version said it couldn't install bc
I don't have 2.7 in the registry…hmm.
After some hints from Stack Overflow, I checked the python version I
have for 2.7 and it's the 32 bit version, which won't be found by the 64 bit
installer. Ran the 32 bit installer and done. Then it said to use pip to
install itself, which I didn't have, but SO led me to this great page: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip…but
after running that, pip still wasn't recognised on the command line. Another
useful note on SO said it installed to python/scripts instead of just to
/python, so I had to add that to my path. And now I get 'failed to create
process'. Tried in admin mode, same error. Google was initially not forthcoming
about this error, but then turned up this: http://www.maphew.com/Python/python-fixit-snippets/
which suggested that it was unable to find python. Perhaps it is confused by my
python27 option? The location certainly hasn't changed since I installed it. I
uninstalled and reinstalled to be sure, but that didn't help.
Checking the Event
Viewer to see where it's trying to find python might help -nope, can't see any
relevant messages.
I went back and
installed Distribute, as it is mentioned in the same place as where I got pip.
No change.
I found this gui for
pip that lets you switch between active python installers - that might help,
because it could still be being caused by my dual 2 and 3 installation? https://sites.google.com/site/pydatalog/python/pip-for-windows
but it also failed. But it did point out that I have no pip.exe in c:\python27
- which is odd because I do have a Removepip.exe? Turns out pip.exe is in
c:\python27\scripts, but moving it just got me back to failed to create
process. Hmmmmmm.
So I went back to
the site, and noticed it had a downloadable zip. So I downloaded that, and ran
setup.py install, and it appears to have installed something? But not a full
package. In fact I can't even see a real pyodbc package...
But just to make
sure it isn't installed, let's try following the instructions on the
pyodbc-azure site. And nope, I get jango.core.exceptions.ImproperlyConfigured:
'sql_server.pyodbc' isn't an available database backend.
So, that was a
couple of unproductive hours, and I give up. I will instead attempt to follow
this tutorial (http://www.windowsazure.com/en-us/develop/python/tutorials/web-app-with-blob-storage/)
for connecting a python app to azure storage, which should be perfectly
adequate for anything. And to get
through the Django book I can just go ahead and use sqllite.
Getting started with
sqllite: http://sqlite.org/sqlite.html
Easy!
Quickly created and
connected to a database, created a model, turned it into tables, added data to
the tables, and started querying the data out of it
- All rows
- Filter: Field = x, field contains x (see Appendix C for field == x, or < x?)
- Get(): A single object instead of a list ( filter returns a list) uses same options as filter
- Order_by
- Slicing - works just like a python list!
- Use .update(x=1) instead of pub.name='a' to get more efficient sql translations (setting a field directly will cause all fields to be saved over)
- .delete() can be called on an object or a query set (result of .filter()) Django tries to save you from accidentally deleting everyhting by requiring the odd syntax x.objects.all().delete() to do that
Thursday, May 23, 2013
It really worked!
Chapter 4 of the
Django book got off to a poor start when I followed their instructions to run
'python manage.py shell', and unexpectedly got a syntax error from one of the
core django files. It seemed unlikely there was an actual issue with the file
(didn't I even run it myself yesterday?), and after googling the error one of
the results mentioned 'of course, I have python 3' so I remembered that I have
python 2 and 3 installed, but the django installation came with python 2. I
updated my path and the python 2 executable so I could call 'python2' to get
python 2 running, leaving my default of 3 still there, and running under python
2 succeeded.
However this does
mean I'll have to check my app, which was written in 3, for compatibility with
2 - at the very least all those print statements will be wrong :/ It also means
that I can't run my python programs in Sublime Text because it is in Python 3.
Whoa. Actually the
only change I had to make was remove the 'newline' option from csv.reader. Way
easier than expected!
Useful introductions
in the first half of this chapter: templates and contexts, template variables,
accessing lists, dicts, and methods through dots, basic logic tags available in
templates, filters, comments. Further details can be found in the appendix,
which they recommend you read so as to familiarise yourself with all the
available options.
And now part 2 -
using a template to create a view.
Step 1 - put the
full path to your templates files in the settings file. That's easy enough
locally, but I'll have to look up what it will be on azure. For now I guess I
can just use os.path of the settings file (prompted by their example) but that
might not be where I want it to live.
Step 2 - update the
views to call templates. Easy enough.
Step 3 - template
inheritance. Awesome!
I followed along
with code as they went, creating my own side example of attendee schedules to
make sure I was getting it - everything worked as expected, it felt really
simple but quite powerful. I committed it all to Azure and that worked straight
off as well.
Wednesday, May 22, 2013
Success: Django hello world on azure!
Something made me
think of verifying all the django packages in my github repository, as well as my local repository, and I realised
that the whole sql folder was missing. I tried to add the files in it manually
and got ' did not match any files' - so obviously there was something wrong with
my .gitignore file…I looked through it for everything python related, and
then noticed a 'sql' entry. Doh, it was ignoring the whole folder. Removed that
line, commit, deploy, and voila!
Now to figure out
manage.py…
So, found a
tutorial.
Step 1: run
manage.py runserver
Result: error
"ImportError: No module named 'django'
Googling implies a
path error : http://stackoverflow.com/questions/5428704/manage-py-runserver-importerror-no-module-named-mysite
Fixed!
And now, found an
introduction to django - a whole book, apparently. Which seems good as I have
no idea how to get my existing app running through django. http://www.djangobook.com/en/2.0/chapter02.html
Was good that they
included the test 'import django' instructions, as it turned out I didn't have
any of it in my PYTHONPATH - it was all just in my path.
I'll ignore the
database section for now, because I don't actually plan to use a database for
this at all. I've already done the
create project steps while setting up the site with azure. So I'm straight
through to chapter 3: setting up webpages!
Creating views.py
looks a little familiar from when I did the first half of that google app
engine course - I guess I really should have finished it :)
Pleasantly surprised
by the 'django automatically detects code changes' note, I was expecting to
have to restart the server :)
Doh, and an import
error. Foolishly copying and pasting, of course I don't have a module called
mysite.views, I gave it a much more descriptive name! And - got the hello world
page going.
Ooh, I bet this will come in handy at some point:
At any point in your view, temporarily insert an
assert False to trigger the error page.
So, half past twelve
and end of a chapter - time to commit, confirm it all works on azure as well as
my box, and go practice hindi. And it
all works exactly the same! A successful evening.
Tuesday, May 21, 2013
New project: python+django+azure
Dad emailed me a few weeks ago asking what's the best way to assign 200 conference attendees to workshops, where there are 10 workshops each running 3 times at the conference (all at the same time). So I said I'd write an app that would take a csv file of (attendee, pref, ... prefN) and spit out a csv file of attendee, slot1, slot2, slot3). Easy, I got a naive version up on github a few days later.
Then I realised that it would be kind of a nightmare packaging this app to send to dad for him to try and run and then me remotely debugging for him, and getting him to use an updated version. So the obvious solution is to put it online and have him access it as a web app. This has the side benefit of getting me to actually try building a real website again.
Since I've been meaning to try setting stuff up on azure forever, and the app is arleady in python, I chose a python site on azure. Since I don't know what I'm doing I looked for a tutorial, and the first one suggested I use Django. I'm not actually quite clear on what Django will handle and what I could do without it, but for now I'll go with it. Following the tutorial at
http://www.windowsazure.com/en-us/develop/python/tutorials/web-sites-with-django/ was super straightforward, although since I already had a github account set up I didn't even need to do the deploy with git, when I chose github as my source control it started just auto deploying the latest copy of master. Unfortunately at the end, instead of their nice example page, I had a server error :/
Possibly it's because I renamed my app SimplySchedule instead of the suggested DjangoApplication - I may have missed a place that used the original name? Seems odd though.
Soo….an early opportunity to learn how to check out the logs and troubleshoot! Starting here: http://www.windowsazure.com/en-us/develop/net/best-practices/troubleshooting-web-sites/
So I set a new deployment credential to use with ftp and git - fails the first time when I try and get the ftp site, you need to use the domain as well. The logs don't seem that helpful:
Aha - having turned on detailed logging, I got this info
D:\Python27\python.exe - The FastCGI process exceeded
configured request timeout
Module
|
FastCgiModule
|
Notification
|
ExecuteRequestHandler
|
Handler
|
FastCGI_SimplySchedule_ccdfe77c-40fe-4aec-84e4-bb292a25a799
|
Error Code
|
0x80070102
|
Requested URL
|
|
Physical Path
|
C:\DWASFiles\Sites\SimplySchedule\VirtualDirectory0\site\wwwroot
|
Logon Method
|
Anonymous
|
Logon User
|
Anonymous
|
So, it is at least getting to the site and running the fastcgi handler is setup…
I went and doublechecked all the config options, and restarted the site. When I tried visiting it again I got this:
ImportError at /
cannot import name sql
Request Method:
|
GET
|
Request URL:
|
|
Django Version:
|
1.4
|
Exception Type:
|
ImportError
|
Exception Value:
|
cannot import name
sql
|
Exception Location:
|
D:\home\site\wwwroot\site-packages\django\db\models\deletion.py
in <module>, line 5
|
Python Executable:
|
D:\Python27\python.exe
|
Python Version:
|
2.7.3
|
Python Path:
|
['D:\\Python27\\Scripts',
'D:\\home\\site\\wwwroot\\SimplySchedule', 'D:\\home\\site\\wwwroot\\site-packages', 'D:\\Windows\\SYSTEM32\\python27.zip', 'D:\\Python27\\DLLs', 'D:\\Python27\\lib', 'D:\\Python27\\lib\\plat-win', 'D:\\Python27\\lib\\lib-tk', 'D:\\Python27', 'D:\\Python27\\lib\\site-packages'] |
Server time:
|
Tue, 21 May 2013
06:19:54 +0000
|
Environment:
Request Method: GET
Request URL: http://simplyschedule.azurewebsites.net/
Django Version: 1.4
Python Version:
2.7.3
Installed
Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',a
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles')
Installed
Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File
"D:\home\site\wwwroot\site-packages\django\core\handlers\base.py" in
get_response
89. response =
middleware_method(request)
File
"D:\home\site\wwwroot\site-packages\django\contrib\sessions\middleware.py"
in process_request
10.
engine = import_module(settings.SESSION_ENGINE)
File
"D:\home\site\wwwroot\site-packages\django\utils\importlib.py" in
import_module
35.
__import__(name)
File
"D:\home\site\wwwroot\site-packages\django\contrib\sessions\backends\db.py"
in <module>
77. from django.contrib.sessions.models
import Session
File
"D:\home\site\wwwroot\site-packages\django\contrib\sessions\models.py"
in <module>
1. from django.db import models
File
"D:\home\site\wwwroot\site-packages\django\db\models\__init__.py" in
<module>
5. from django.db.models.query import Q
File
"D:\home\site\wwwroot\site-packages\django\db\models\query.py" in
<module>
13. from django.db.models.deletion import
Collector
File
"D:\home\site\wwwroot\site-packages\django\db\models\deletion.py" in
<module>
5. from django.db.models import signals, sql
Exception Type:
ImportError at /
Exception Value:
cannot import name sql
Welp, after a little blind web searching, I can't find anyone else hitting this error - I think. There is a mention of someone else who went through the tutorial and saw a 500 internal server error in a comment on this Stack Overflow question,: http://stackoverflow.com/questions/10990706/azure-free-website-with-python-django-not-running/15757329#15757329
But a 500 error could be lots of things, as shown by this question: http://stackoverflow.com/questions/12554725/azure-sdk-django-visual-studio-2012-publish-to-azure-succeeds-but-i-get-5?rq=1
So, I asked my question at the disqus comments on the tutorial - will wait a day for a response before going to Stack Overflow I guess
Sunday, September 23, 2012
Home debugging, part 2: can't create a new user account on windows 7, 'the user profile service service failed the logon'.
The next home network maintenance task took a little longer to solve. My mother wanted to create her own user account on the shared PC. She knew how to do this, but the new account kept giving an error when she tried to log on with it: 'the user profile service service failed the logon'. Cryptic.
It sounded easy. I was confident that I'd solve it in minutes. I googled it, and found several recommendations to delete the corrupt user profile/reg key and boom. But why would the newly created profile be corrupt? Turns out, it's not: it's not even created until you log on with it for the first time. So there was no profile to delete.
I tried turning off UAC, and creating a new account with admin rights instead of standard, but none of this worked. Eventually, I found this Microsoft Answers thread: http://answers.microsoft.com/
- open the Event Viewer (Start->Run->type "Event Viewer") and look at the Application logs
- Now find any Warnings (the Error messages are likely telling you that the user profile didn't work, which you already know) and click on each of them to read the details about it

- You should
be able to find a warning message that says 'Windows cannot copy
file x to location C:\Users\Temp...'
- Find the file mentioned by typing in the full directory location given to the address bar of Windows Explorer. (You can't browse to it because it will be hidden).
WARNING: deleting or changing
some files will break your computer. If you don't know what the file
mentioned is, you should find someone who knows more than you do.
- If you know what you are doing, now go ahead and delete or give universal write access on the file. Et voila, your new user account should log on successfully.
Home debugging, part 1: hacked wifi?
And now for something completely different!
I'm at home in Australia for a few weeks* visiting my parents, so obviously I've been doing a little home PC maintenance. Between my dad, sister and brother they are able to pretty well manage everything, so it hasn't been too bad.
My most stunning accomplishment has been setting up a Windows Homegroup so that they can all send documents to the printer from their laptops and the second desktop, instead of kicking off anyone currently using the PC with the printer for a minute.
More interestingly, a couple months ago, my sister rang me early in the morning to say that she thought the wifi had been hacked. I rolled my eyes and asked what was happening, and she said that overnight, all the phones (which get carried in and out of the house, and therefore off the wireless network) had stopped connecting to the local wifi and said the password was incorrect. The laptops which had stayed in the house were still connected, but the laptop that had left the house that day was also unable to connect. When I directed her to the router admin page, which according to Dad's notes still had the default password, she was unable to log in. It appeared that she was right, and someone had indeed managed to change the password on their wifi network. I gave her instructions for resetting the router and setting the network back up, and left her to it.
Fast forward: I've been home for about a week. I'm testing some phone stuff on two different phones. As each phone sits idle, it disconnects from the wireless network, then seamlessly reconnects when I wake it up. Until one doesn't. It says the password is wrong. Then the other phone won't reconnect either. I go find my sisters iPhone and it also won't connect - password incorrect. (I have no interest in disconnecting my laptop to test it as well.) It appears that whatever happened before, has happened again.I go find my sister's documentation from that incident: she didn't change any of the passwords involved, including the router sitting on the default password. So yea, I guess it's not inconceivable that someone got into it again? I reset the router, set back up the network and the voip line, and this time change the router password.
I still find it a little unbelievable that someone would have gotten into their wireless network twice, in this random corner of the suburbs, but I can't come up with another explanation.
*Yes, it was incredibly inconvenient for my house to flood days before I left on an international trip.
I'm at home in Australia for a few weeks* visiting my parents, so obviously I've been doing a little home PC maintenance. Between my dad, sister and brother they are able to pretty well manage everything, so it hasn't been too bad.
My most stunning accomplishment has been setting up a Windows Homegroup so that they can all send documents to the printer from their laptops and the second desktop, instead of kicking off anyone currently using the PC with the printer for a minute.
More interestingly, a couple months ago, my sister rang me early in the morning to say that she thought the wifi had been hacked. I rolled my eyes and asked what was happening, and she said that overnight, all the phones (which get carried in and out of the house, and therefore off the wireless network) had stopped connecting to the local wifi and said the password was incorrect. The laptops which had stayed in the house were still connected, but the laptop that had left the house that day was also unable to connect. When I directed her to the router admin page, which according to Dad's notes still had the default password, she was unable to log in. It appeared that she was right, and someone had indeed managed to change the password on their wifi network. I gave her instructions for resetting the router and setting the network back up, and left her to it.
Fast forward: I've been home for about a week. I'm testing some phone stuff on two different phones. As each phone sits idle, it disconnects from the wireless network, then seamlessly reconnects when I wake it up. Until one doesn't. It says the password is wrong. Then the other phone won't reconnect either. I go find my sisters iPhone and it also won't connect - password incorrect. (I have no interest in disconnecting my laptop to test it as well.) It appears that whatever happened before, has happened again.I go find my sister's documentation from that incident: she didn't change any of the passwords involved, including the router sitting on the default password. So yea, I guess it's not inconceivable that someone got into it again? I reset the router, set back up the network and the voip line, and this time change the router password.
I still find it a little unbelievable that someone would have gotten into their wireless network twice, in this random corner of the suburbs, but I can't come up with another explanation.
*Yes, it was incredibly inconvenient for my house to flood days before I left on an international trip.
Conflicts and setbacks
So, ran into a few challenges recently.
I have mentioned that I work at Microsoft, but here it becomes relevant that I specifically work on the Windows Phone marketplace: the experience you have when you install an app as a user. As part of my job, I was involved in investigating and diagnosing <a href="http://windowsteamblog.com/windows_phone/b/windowsphone/archive/2012/08/14/can-t-download-an-app-here-s-why.aspx">the recent problem installing app updates</a>, and I also know the team involved in managing app certification, so I was well aware of the subsequent <a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2012/08/14/app-publishing-temporarily-on-hold.aspx">delays in app publishing</a>.
This was pretty inconvenient for me personally, as I submitted the PAX Digital Assistant update for Prime to the marketplace only the day before certification was temporarily halted. I waited for my app to make its way through certification once everything resumed, and kept waiting. I checked at work and knew there were major delays catching up with the queue of apps that had built up, and so it wasn't unbelievable that mine hadn't made it through yet. I knew that I could contact the guys who ran the process and have my app fast tracked, but I couldn't decide if that was reasonable or not. In hindsight, I think it would have been: I had a good justification with the event actually happening, and other developers do contact a developer evangelist for similar deadlines. However I decided that it felt a little unfair to use my internal position like that, so I didn't do anything, and my app didn't make it through publishing until September 6, well after the useful moment had passed. Now I feel like I inconvenienced a bunch of people and made myself look flaky and unreliable, all for no good reason. Damn.
On the worse side, four days before PAX my apartment was flooded by a burst pipe, and my laptop was destroyed. As detailed in my last post, I did have a remote backup for the PAX app - but I hadn't done incremental uploads to the server of the last couple days of work I'd done before finishing it for Prime, so that work is now gone forever. The Flashcard app I'd created is also completely gone, as I hadn't bothered backing it up to the server at all (not a huge loss, but a foolish mistake). Could have been worse, of course: a month earlier the entire PAX app was stored only on my local machine and would have been gone. But could have been better as well. I need to make the incremental backup to the server as easy as the local incremental backup.
Subscribe to:
Posts (Atom)