Saturday 6 September 2014

Delta sadp-65kb


 Wolumen is one of my favourite places in Warsaw. You could even call it Europe's Huaqiangbei, poor man's SEG, 2 hectares crammed with electronics. Basically its like Hamfest, but 52 times a year plus permanent shops open all week.

 Sometimes I pick up broken crap there. Mostly because Im curious, for parts, or to fix. Recently I got this Delta sadp-65kb laptop power supply, it cost me a whooping $1.


 I couldn't sleep and decided to fix it at 3 in the morning :/ Best place was of course my bed, using 25 year old soldering iron and $3 multimeter :)


 Something bad happened on the input side and shorted rectifier bridge. Fuse blew after the fact.


 Yes, this is a 3.15A fuse in a 65W box, gotta love Chinese engineering :) I replaced rectifier with one salvaged from old ATX PSU, soldered power cable directly to rectifier and powered it up. Success, well that was easy!
 I put it back together properly, checked again and nothing, Murphy strikes again. Turns out banging with a hammer for 5 minutes to break ultrasonic plastic welds of the case is not a recommended procedure :o). Note to self - next time use vice to slowly crack case open. I whipped my magnifying glass and discovered almost every heavier part had cracked pads or solder joints, and common mode choke was hanging on one wire. You can see cracked pads below, 100 ohm resistor partially resoldered.


 Another 10 minutes scratching solder-mask and reinforcing solder joints, then putting choke back on its place.


 Back like new.


  Time for thermal compound under rectifier and some wood glue (PVA) for structural strength. Done.


 45 minutes to fix $10 power supply, not the best bang for your buck. On the other hand smell of flux fixed my insomnia.

Sunday 26 May 2013

World of Tanks in Borderless Windowed Mode


Borderless Windowed Mode is a magical mechanism that lets you play full screen while still having access to your desktop. Say goodbye to Alt-Tabbing. No more waiting for windows to change resolution and reinitialize all the screens, no more losing sight of your game when all you wanted to do was to quickly reply to a PM. Do you have second monitor? Dont you just love how moving mouse pointer to second monitor and clicking automatically Alt-Tabs you out of the game? Well, no more of that either!

What you get instead is game seemingly rendered into desktop wallpaper. It really feels like magic. You can have Web browser and instant message on top of the game. Perfect for people that prefer to do 10 things at once!
  My favorite trick is to set game window to be one pixel smaller than monitor resolution and set windows Taskbar to auto-hide. This way we get for example 1599x1200 game window plus one pixel worth of vertical taskbar on the right edge of the screen.




I can browse interwebs while waiting for the map to load/clanwar to start :o). Perfect!

Python script:

import win32gui
from win32con import GWL_STYLE, WS_CAPTION, WS_SIZEBOX, WS_DLGFRAME, WS_THICKFRAME
import time
import os

def main():
    os.system("start \"..\" G:\\World_of_Tanks\\xvm-stat.exe")

#   option = combination of those four: WS_CAPTION, WS_SIZEBOX, WS_DLGFRAME, WS_THICKFRAME
    option = WS_CAPTION + WS_SIZEBOX
#   window_name = name that appears on application title bar
    window_name = "W.o.T. Client"

    time.sleep(5)
    for x in range(60):
      time.sleep(1)
      hwnd = win32gui.FindWindow(None, window_name)
      if hwnd !=0:
        win32gui.MoveWindow(hwnd, 0,0,1599,1200, True)
        gwl = win32gui.GetWindowLong(hwnd, GWL_STYLE)
        win32gui.SetWindowLong(hwnd, GWL_STYLE, (gwl ^ option))
        break

if __name__ == '__main__':
    main()

You also need to edit your preferences.xml file located at
 C:\Documents and Settings\Administrator\Application Data\wargaming.net\WorldOfTanks\preferences.xml  (XP)
 %APPDATA%\Wargaming.net\WorldOfTanks\preferences.xml  (Vista/7/8)

Change those settings:
    <windowed> true </windowed>
    <windowedWidth> 1599 </windowedWidth>
    <windowedHeight> 1200 </windowedHeight>
according to your needs.

  From now on you can start WoT by just clicking on minimize.py script.

Ps: I wrote this script because Im to lazy to press Autohotkey bind every time I start the game, and Im too paranoid to run third party executables written by some random Russian dude :) Not to mention I dont like programs sitting in my taskbar doing nothing and eating ram. This script quits as soon as it finishes its job of making the game windowed = no wasted ram or cpu cycles. Plus its open source so everyone can see whats going on and there is no danger of trojans/viruses.

Monday 22 October 2012