This is a blog about what I see and think, codename XDage. For find pic diff games, please visit http://findpicdiff.blogspot.com
Saturday, December 15, 2012
My personal view: solutions for American's Gun Control
From my point of view, it's not this or that. People have the right to have guns, though they also have the duty to not harm innocent people.
I have a few possible solutions.
First one: let people to decide who can have guns and who should not have guns. Community based organization, with voting each year, should have control of the power in a community.
1. Each community center should form a Gun Under Control Society, with by-laws that is voted by the society.
2. To buy a gun and own guns, people must apply for licenses from Gun Under Control Society
3. Each year, the Gun Under Control Society should renew license to the gun owners, based on the society's own by-law.
4. Make it illegal to have guns without licenses
Second one: Learn from auto insurance industry. Allow the auto insurance companies to also have the gun insurance. Treat guns as cars, require license, yearly renewal. And the insurance is to pay off to people who get hurt by guns. I'm sure the auto insurance industry will come up with efficient ways to evaluate people, to see if they are responsible enough for getting guns.
Looks like my 2nd solution would be the best one. Spread the word, and let's act on it.
Xinyang Qiu
Saturday, November 5, 2011
How to create a asp.net virtual application with SQL CE 4.0 in GoDaddy shared hosting account
I tried to create a simple asp.net WCF site using SQL CE 4.0 on my GoDaddy shared hosting account today. I need to do the following in order to deploy the application successfully. I’m using Visual Studio 2010 Ultimate.
1. In my WCF application, right click and choose “Add Deployable Dependencies” context menu, select “SQL Server Compact” and choose OK. This will copy all the assemblies that I need to the bin directory
2. I use the Visual Studio build in publish feature to do the publish, something like following:
3. I chose IIS with Fx 4.0 in GoDaddy account. I deployed my WCF application to a sub directory, which I need to convert to “Virtual Application” by using GoDaddy’s IiS Manager, like following:
4. I also need to give the App_Data directory writable permission for application in FTP File Manager
Finally, my application works. I didn’t realize this is so hard. I wish GoDaddy supports web deploy technology, which Visual Studio will be able to deploy much easier.
Have fun.
Tuesday, May 3, 2011
Word 2010 Macro to automatically save current txt file as pdf file
Here’s a word 2010 macro I created for my self which does the following things:
1. select all
2. Change font size to 24
3. Change page Margins to narrow
4. Save the current file as pdf (change current file name from .txt to .pdf, and save to the same directory)
5. put the marco to the quick access toolbar
The marco:
Sub MacroGenerateKindlePdf()
'
' MacroGenerateKindlePdf Macro
'
'
Selection.WholeStory
Selection.Font.Size = 24
With Selection.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = InchesToPoints(0.5)
.BottomMargin = InchesToPoints(0.5)
.LeftMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.BookFoldPrinting = False
.BookFoldRevPrinting = False
.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
.LayoutMode = wdLayoutModeDefault
End With
Dim name As String
name = ActiveDocument.name
name = ActiveDocument.Path + "\" + Strings.Replace(name, ".txt", ".pdf")
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
name, _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=True, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
SendKeys ("{HOME}")
End Sub
Monday, May 2, 2011
How to convert Chinese txt to pdf and view it in Kindle
With the following blog, it appeared Chinese txt files can be read in Kindle.
http://lifeofxdage.blogspot.com/2011/03/how-to-get-your-kindle-3-to-show.html
But I got into some warning when trying to read a Chinese txt file and went through only a few pages out of a few thousand pages.
So I fall back to making txt as pdf files.
This is what I normally do:
a. Separate a big txt file to a few files each about 300k size. 300k size of Chinese txt files are about 1000 pages when converted later. The reason doing that is because my Kindle 3 performs badly when pdf file has too many pages. I wrote a small program to do that, or you can do it via Microsoft Word.
b. Opening one of the txt file in Microsoft Word 2010, by drag and drop the txt file to an opened word. It will ask to convert the txt by auto determining its encoding. e.g. Chinese Simplified (GB2312), click OK.
c. Select all, make font size 24, page layout, margin narrow
d. Save as pdf file
Then you’ll have a pdf file which can be downloaded to Kindle.