Fail while upgrading to windows 10 from 7, Error 0xC1900101 – 0x40017: Potential fix

I have tried to upgrade windows 10 from 7 for 5 times but failed. It reverts back to windows 7 then displays a window with error in second_boot with number 0xC1900101 – 0x40017 but on my 6th attempt I was successful.
IMG_7619 - Copy

 

Logs are stored in c:\windows  beside windows bt and ws.   I assume the ones where I could find the reason for failure get deleted once windows recover to previous version.  so if you face a problem tries to copy those logs when it restarts using a linux installation or Live CD.  then search for *.log  in c:\windows   setuperr.log and setupacc.log should have useful information.

Before the last successful attempt. I did the following:

1. sfc /scannow this by the way always discovered errors for me not sure why.

2. updated everything from windows update. except security essentials.

3. From previous failed attempt I already uninstalled Avast. I turned off firewall in my second failed attempt but turned it back on.

4. Unplugged all USBs except keyboard and mouse.

5. Removed some hidden and left over drivers, please see this: https://support.microsoft.com/en-us/kb/315539

6. Uninstalled some potential troublemaking software particularly media center extenders, Media center is gone from Windows 10. so they can be trouble.
Here are some drivers I removed.
– Old Nvidia display driver. because I switched to AMD.

– HP printer. My HP printer already broken. and I found out so many HP printer driver leftovers something like 10 . I removed their software(s) a lot of them and each one trying to restart the computer anyway. ugh HP

– PC USB driver for OneSeg TV. probably you don’t have this.

– PCI driver for Satellite TV tuner card. this works with Media center so it is useless.

– Removed all usb drivers that are not active. they include several flash drives. also drivers for hard disks I no longer have.
I think what likely fixed the issue is 5 & 6 particularly media center extenders and old drivers for Nvidia. when I installed AMD I didn’t uninstall Nvidia first. but there is good chance that HP with their horrendous software and/or other usb drivers caused the issue. I suggest you try the same but be careful you don’t remove something essential. Make sure to restart after you do all.

Also I tried the install from ISO. but I don’t think related, but my previous 5th attempt was from ISO too.

Finally, there is a slim chance that weird funny thing happened when I logged in to Linux when it restarted after 70% that magically fixed the issue.

Construct 2: Convert array or key/values to a c2_dictionary json object

Here is a converter I made to convert a one dimensional php array or simple key/values to a c2_dictionary json object to load json data from string into a dictionary object for construct 2 game maker

OR:

“key”=>”value”,

Add reversed key value to allow for easy lookup by key/value (e.g. beside key:value, value:key)

Keep pebble time watchface backlight on for longer than 3 seconds

The pebble time watchface dims pretty fast and it only lasts 3 seconds, unfortunately there is no option right to increase that. in watchface it is possible to change this behavior programatically here is how i did it.


  1.   static int seconds;
  2.   static void set_backlight(){
  3.   light_enable_interaction();
  4.   if (seconds<=4)return;
  5.   app_timer_register(3000,set_backlight, NULL);
  6.   }
  7.   static void accel_tap_handler(AccelAxisType axis,int32_t direction) {
  8.   light_enable_interaction();
  9.   seconds = 10;
  10.   app_timer_register(3000,set_backlight, NULL);
  11.   }
  12.   static void main_window_load(Window *window) {
  13.   ...
  14.   accel_tap_service_subscribe(&accel_tap_handler);
  15.   ...
  16.   }
  17.   static void tick_handler(struct tm *tick_time, TimeUnits units_changed) {
  18.   if (seconds>0)seconds--;
  19.   ...
  20.   }
  21.   static void init() {
  22.   ...
  23.   tick_timer_service_subscribe(SECOND_UNIT, tick_handler);
  24.   ...
  25.   }
  26.  

How to validate form fields in magento without submitting the form

If you want to validate a form in Magento using prototype validations, if you use


  1.  myForm = new VarienForm('myform-id');
  2.  myform.submit = function () {
  3.   results=myForm.prototype.submit.bind(myForm)();

then the form will be submitted automatically if there is no error. That’s perfectly fine unless you want to do other work before submitting, for example submitting the form in an ajax request.

Instead you can do this to test


  1.  myForm = new VarienForm('myform-id');
  2.  myform.submit = function () {
  3.   results=myForm.validator.validate();

If results return true then there is no error.

How to check if user is an admin in wordpress

The best way so far to check whether the current user is a super admin user with full permissions in wordpress is to use current_user_can function and check for manage_options . If user has manage_options they clearly have full permissions. I use this for example to hide ads from me and to hide google analytics so that it doesn’t count me while I’m logged in as admin.

  1.  <?php if (!current_user_can( 'manage_options' )):?>
  2.  google analytics code goes here
  3.  <?php endif;?>