2017年5月22日 星期一

PowerPC Emu

https://stackoverflow.com/questions/8971839/powerpc-emulation-qemu-pearpc-or

http://lassauge.free.fr/qemu/

2017年5月13日 星期六

wannacry

Patch install

For example, if the Windows6.0-KB934307-x86.msu file is in the D:\934307 folder, I would use something like the following:
wusa D:\934307\Windows6.0-KB934307-x86.msu /quiet /norestart /log:D:\934307\Windows6.0-KB934307-x86.evtx

2017年5月9日 星期二

sql #temptable

http://stackoverflow.com/questions/4391442/how-to-save-select-query-results-within-temporary-table

Look at SELECT INTO 

select *
into #TempTable
from SomeTale

select *
from #TempTable
SELECT ID as 'ID',
(SELECT <....> FROM table WHERE <...> ) AS 'Total No of people'
FROM somewhere

SELECT LTRIM(RTRIM(Names)) AS Names FROM Customer

SELECT CONVERT(varchar(10), field_name) FROM table_name
LEFT(colName, 1)


firstname lastname
Bill      smith
you can do something like
select firstname + ' ' + lastname from thetable
What I use for IsNotNullOrEmptyOrWhiteSpace in T-SQL is: link
SELECT [column_name] FROM [table_name]
WHERE LEN(RTRIM(ISNULL([column_name], ''))) > 0


Code
USE AdventureWorks2012;  
GO  
SELECT   ProductNumber, Category =  
      CASE ProductLine  
         WHEN 'R' THEN 'Road'  
         WHEN 'M' THEN 'Mountain'  
         WHEN 'T' THEN 'Touring'  
         WHEN 'S' THEN 'Other sale items'  
         ELSE 'Not for sale'  
      END,  
   Name  
FROM Production.Product  
ORDER BY ProductNumber;  
GO  



UPDATE
  MyTable
SET
  MyColumn = UPPER(MyColumn)


Finial save the result

LINK from stackoverflow
Use following syntax to create new table from old table in SQL server 2008 :
Select * into new_table  from  old_table 
Adding Column in existing Table:

ALTER TABLE Tb_Table1 ADD isdone  BIT DEFAULT 0
BIT column can have two values (0 = false, 1 = true) or no value at all (NULL)


Better techniques for trimming leading zeros in SQL Server?
I've been using this for some time:

SUBSTRING(str_col, PATINDEX('%[^0]%', str_col), LEN(str_col))








2017年5月2日 星期二

System Scheduler and Refresh tray icons - How to remove dead tray icon after killing a program/process

http://techforpassion.blogspot.hk/2014/04/refresh-tray-icons-how-to-remove-dead-tray-icons-after-killing-program.html


The FREE version of System Scheduler is fully functioning with no embedded advertising or other software.
Bullet Download System Scheduler FREE Version  ·Install File (2.5M)·   
http://www.splinterware.com/download/ssfree.exe

Best way to remove leading zeros from a non-numeric value in Excel &Convert numbers stored as text to numbers


I have many cells in an Excel sheet, using 9 characters of 0-9 and A-Z, that have some number of prefixed zeros:
000000123 
000001DA2 
0000009Q5
0000L210A
0000014A0
0000A5500
00K002200
I'd like to remove the leading zeros so that the values become:
123 
1DA2 
9Q5
L210A
14A0
A5500
K002200

=SUBSTITUTE(TRIM(SUBSTITUTE(B2,"0"," "))," ","0")
=IF(LEFT(A1) = "0" ,RIGHT(A1, LEN(A1)-1),A1)
Convert numbers stored as text to numbers

3. Click Data > Text to Columns

Data tab, Text to Columns button
On the Data tab, click Text to Columns.

4. Click Finish

Finish button
Click Finish right away and Excel will convert the cells.