Sunday, February 11, 2018

for NodeJS use Atom as your Text Editor

Just look at that syntax coloring!


And the shortcut to run Atom, if the install failed to create one, is:

C:\Users\yourname\AppData\Local\atom.exe


Node.js: how to exit from the Node console

Node.js: how to exit from the Node console


How to exit from Node command line
So you loaded the Node console by typing node at the command line, played around with it and want to get back to your OS command line. Press CTRL+C (even on a Mac, especially on a Mac!), or just call the process.exit() method to exit from the Node console.
$ node
> 9+23
32
> process.exit()
$ 

Same thing if you started up a basic Node http listener routine from the command line.

C:\Users\yourname\Documents\nodeStuff>node myfirstt.js
^C
C:\Users\yourname\Documents\nodeStuff>


There you go!

Saturday, January 27, 2018

National Lampoon - Every Issue from 1970 - 1998

Just saw that Netflix movie and was surprised that it was so difficult to find these online.  They were on the Internet Archive for a time, but perhaps due to legal issues, have been pulled.

There was a DVD-ROM or CD-ROM of the archive published, but not only no longer for sale, but not even available on eBay.

But I finally dug up the archive.

Here it is.

So here you go, enjoy:

http://www.microrican-gaming.com/NL/

https://web.archive.org/web/20170420082453/http://www.microrican-gaming.com/NL/



Saturday, January 6, 2018

To View Constraints in SQL Server database

quick and dirty:
SELECT * FROM sys.objects
WHERE type_desc LIKE '%CONSTRAINT'



Clearer:

SELECT OBJECT_NAME(object_id) AS ConstraintName,

SCHEMA_NAME(schema_id) AS SchemaName,

OBJECT_NAME(parent_object_id) AS TableName,

type_desc AS ConstraintType

FROM sys.objects

WHERE type_desc LIKE '%CONSTRAINT'

For specific  table:

add the following to very end:
AND OBJECT_NAME(parent_object_id)= 'theNameOfYourTable'


thanks to: https://bhaveshgpatel.wordpress.com/2009/11/04/sql-server-list-all-constraints-of-database-or-table/

Thursday, December 28, 2017

ASP.NET GridView : Change Command Field to Template Field

For example, with a Delete button.

From:

<asp:CommandField ShowDeleteButton="True" />


To:


<asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="lbDelete" runat="server" CommandName="Delete"
                                                            Text="Delete">
                                                        </asp:LinkButton>
                                                    </ItemTemplate>
                                                </asp:TemplateField>

Sunday, December 3, 2017

ASP.NET AJAX Cheat Sheet

REMEMBER: Only the stuff inside the UpdatePanel gets updated from the postback.
 
In Design View: In this order, from Toolbox (AJAX section), add
Script Manager, UpdateProgress, then Update Panel.

If you are using Master Pages, and this is a content page, put this under <asp:Content element.


For UpdateProgress, fill out AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="100".



Add <ContentTemplate> before any Div's.

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
 
 <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="100">
        <ProgressTemplate>
            <h1 class="red">Please be patient....updating database....</h1>
        </ProgressTemplate>
    </asp:UpdateProgress>


    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

<div all the stuff on your page></div>

    </ContentTemplate>
</asp:UpdatePanel>