Sergei's profileSergeianPhotosBlogListsMore Tools Help

Blog


    January 26

    Memory Note on Quick Recreation of New Lines in Visual Studio

    Say you’ve extracted string “Hello,\r\nWorld!” in a debugger and you want to display it correctly with new line characters instead of C# escape sequence. Here is a quick way to do it:

    1. Create new text file.
    2. Copy and paste text into that file.
    3. Open “Find and Replace” dialog.
    4. Make sure that Use Regular Expressions checkbox is checked.
    5. Type in Find What: \\r\\n
    6. Type in Replace with: \n
    7. Click Replace All
    January 06

    The Future of Human Intelligence

    Humanity is quickly approaching that day when we are no longer bound by limitations of original human body. It may not happen in tomorrow, but it is coming. There are a couple stories set in the environment that has no restrictions of human body. That results in a number of conflicts that make stories unique and interesting.

    The first one is on my movies list and it is Ghost in the Shell. The second story was just recently recommended to me and it is Kadath in the Cold Waste.

    Here is a quick summary about Kadath in the Cold Waste from edkeys website

    One of the main questions which this utopia asks that the others we have studied have not is: if we have the option, do we want the dominant species on Earth to remain human? Within a hundred years, it is a virtual certainty that the most intelligent being on the planet will not be human, or even organic. How will we deal with this moment when it arrives? Will we subjugate intelligent machines to retain our superiority? Or will we make way gracefully for the 'next stage' of life? For that matter, will we even have a choice in the matter at all?

    As of this moment Ghost in the Shell consists of a movie that started several seasons of anime series. I was not that impressed with the movie, but I thought that season 1 of Ghost in the Shell: Standalone Complex series beats any CSI style show without any doubt. Watching movie first is still a nice introduction to the series.

    LiveJournal Tags: ,,

    January 04

    Lots of Information about Superfruits

    In my search for Costco Blueberry Extract replacement I have stumbled upon http://www.naturalnews.com website. It has a lot of information about superfruits such as blueberries and cranberries.

    The top ten consumer questions about superfruit juices: Pomegranate, blueberry, acai and cherry article is quite informative. Pomegranate and Blueberry Juice Consumer Shopping Guide is a very good research of manufacturer labels. My conclusion was to learn more about POM manufacturer.

    As a result I decided to try POMx Pill. The only problem that is always there is how do I know that it really works? In the end, I have to believe in something.

    January 02

    Take Control Over Flash

    Flash is notorious for having huge wholes that are used to compromise computer. Both Firefox and  Internet Explorer on Vista and Windows XP are exposed to Flash bugs. Keeping flash disabled by default is a preferred solution from security standpoint. However, Flash has become so widespread that it is difficult to keep browse web without it.

    Internet Explorer provides a way to manage Add-ons, but Add-on cannot be enabled for a specified set of trusted websites. That was true for every version of IE until IE 8. Internet Explorer 8 allows users to keep Flash enabled while managing list of trusted sites. If default * (star) access option is removed, then the user has unobtrusive prompt to enable Flash on per website basis. This prompt is done similar to download prompts which are easy to ignore.

    LiveJournal Tags: ,

    How to Group SQL Result Set by Time of Day

    Here is a quick template I have created for myself some time ago:

    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    
    CREATE FUNCTION [dbo].[DateTimeScale] 
    (
          @date as DateTime
    )
    RETURNS varchar(50)
    AS
    BEGIN
          DECLARE @min as int
          SET @min = DatePart(minute, @date)
          SET @min = @min / 5
    
          DECLARE @minStr as varchar(10)
          IF (@min < 10)
                SET @minStr = '0' + convert(varchar, @min)
          ELSE
                SET @minStr = convert(varchar, @min)
          
          RETURN 'D' + convert(varchar, DatePart(day, @date)) 
                + ' H' + convert(varchar, DatePart(hour, @date)) 
                + ' M' + @minStr
    END
    

    DateTimeScale function can be used to normalize time presentation for certain time of the day intervals. Expression @min / 5 is used to define granularity of time intervals.

    Conditional execution of @min < 10 is used to add zero prefix to numbers below 10, so sorting can be effective.

    LiveJournal Tags: ,