As I have mentioned before I have been working, albeit slowly, on finally finishing the conversion of the site from ColdFusion to C#.NET. By and by recently chatGPT has roared onto the internet with a bang, might even say a BING, and although code assist AI, with github, has been in a sort of beta state for the last several months (or even year?) I have thought that a way to revitalize my enthusiasm for working on this site is the start to mess around with it.
As such I have decided to do multiple things. One is to try to use chatGPT while I work in the C# code for this site and document the journey in so doing. Two, since programming and philosophy are some of the main focuses of the site, that I will create a series called ChatGPT And Me (initially called Chatting With ChatGPT) where I will post various chats that I have with chatGPT on a wide range of subjects. Three, I will revive the Learning a new Programming Language series with chatGPT at the helm with critiques from me. I'm hoping this will be fun and interesting for both me and any audience there might be. posted by dharh 12:45 AM Feb 22nd, 2023 via idt
Saw an interesting article come up while reading: Pluralistic: Tiktok's enshittification.
posted by dharh 11:30 PM Jan 30th, 2023 via idt
I have neTodo working again, with some updates (changelog). That's about all I have to say.
posted by dharh 1:00 AM May 13th, 2022 via idt
Welp. It's been over 10 years since I last posted here. 8 years since I last did any work on this site. Many things have happened.
First it was just being lazy and not having the drive to post anything while I was working on redoing the backend of the site. Then the work slowed down to a crawl and eventually to a stop. I don't know if there is a link between my lack of drive and the health issues that started to show up in 2015, but by the end of 2016 I was in the hospital fighting for my life. A few hiccups and then Covid-19 we finally reach today. I am still AliveThe site is not dead and neither am I. The forced change of the backend host for this site has spurred me to try again to get going with this. To bring some order in the chaos where the mind dwells. The new host has given me some issues, half of which are currently resolved. The main thing that is working right now is the coldfusion version of neThing (v0.8) has been brought back up to full working status so I can post this. Working
Not Working
For a list of project (incomplete, but I will update) you can go here: Projects So here I go working again. posted by dharh 1:25 PM Mar 25th, 2022 via idt
This post was incomplete at the time, decided to post anyway (2022-03-25)
The release of the Official Google Chromebooks is nearing. On June 15th both Acer and Samsung will begin taking orders. So what's happened since I last did my review of the CR-48 and how might that show what's in store for these initial Chromebook consumer offerings. What's ChangedTouchpadWell for one, it doesn't suck anymore. The software has gotten alot better, in fact it was one of the first things they fixed. I still would rather they opted for a clickless pad, but at least I can do taps if I want to. All the issues of sensitivity diminishing at the edges of poor handling of right click gestures are gone. What's left is a pretty darn good touchpad that should only be better in the consumer version. What Hasn't ChangedKeyboard & Battery LifeThis should obviously be a no brainer, but one always hopes that there could be some magic voodoo in the software to eek out a few extra minutes or even hours in the battery life. posted by dharh 1:37 AM May 30th, 2011 via idt
12. Extract uppercase words from a file, extract unique words
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;
namespace lrn2CSharp12
{
class Program
{
static void Main( string[ ] args )
{
string file = "";
string line = "";
string[ ] words;
List<string> upperWords = new List<string>( );
List<string> uniqueWords = new List<string>( );
Console.WriteLine( "Input name of a file to read and count words." );
Console.Write( ":" );
try
{
file = Console.ReadLine( );
FileStream fs = new FileStream( file, FileMode.Open, FileAccess.Read );
StreamReader sr = new StreamReader( fs );
while ( !sr.EndOfStream )
{
line = sr.ReadLine( );
words = null;
if ( line.Length != 0 )
words = line.Split( ' ' );
if ( words != null )
{
foreach ( string w in words )
{
if ( char.IsUpper( w[ 0 ] ) )
upperWords.Add( w );
if ( !uniqueWords.Contains( w ) )
uniqueWords.Add( w );
}
}
}
sr.Close( );
fs.Close( );
}
catch
{
Console.WriteLine( "WTF?!?" );
}
Console.WriteLine( "Upper Words:" );
foreach ( string s in upperWords )
{
Console.Write( s );
Console.WriteLine( );
}
Console.WriteLine( );
Console.WriteLine( "Unique Words:" );
foreach ( string s in uniqueWords )
{
Console.Write( s );
Console.WriteLine( );
}
Console.WriteLine( );
Console.WriteLine( "Press esc to exit." );
while ( !keyPressHandler( Console.ReadKey( true ) ) )
{
Thread.Sleep( 250 );
/* no op */
}
}
private static Boolean keyPressHandler( ConsoleKeyInfo input )
{
if ( input.Key == ConsoleKey.Escape )
return true;
return false;
}
}
}
posted by dharh 1:08 AM May 30th, 2011 via idt
11. Input is HTML table, Remove all tags and put data in a comma/tab separated file.
Part of this was an exercise in looking up what others have already done. using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data;
using System.Text.RegularExpressions;
using System.Threading;
namespace lrn2CSharp11
{
class Program
{
static void Main( string[ ] args )
{
string file = "";
string html = "";
DataSet ds = null;
StringBuilder csv = new StringBuilder( );
Console.WriteLine( "Input name of a file with an HTML table in the current directory to convert to csv." );
Console.Write( ":" );
try
{
file = Console.ReadLine( );
FileStream fs = new FileStream( file, FileMode.Open, FileAccess.Read );
StreamReader sr = new StreamReader( fs );
html = sr.ReadToEnd( );
sr.Close( );
StreamWriter sw = new StreamWriter( fs.Name + ".csv" );
ds = ConvertHTMLTablesToDataSet( html );
if ( ds != null )
{
foreach ( DataTable dtc in ds.Tables )
{
int iColCount = dtc.Columns.Count;
for ( int i = 0; i < iColCount; i++ )
{
sw.Write( dtc.Columns[ i ] );
if ( i < iColCount - 1 )
{
sw.Write( "," );
}
}
sw.WriteLine( );
foreach ( DataRow dr in dtc.Rows )
{
for ( int i = 0; i < iColCount; i++ )
{
if ( !Convert.IsDBNull( dr[ i ] ) )
{
sw.Write( dr[ i ].ToString( ) );
}
if ( i < iColCount - 1 )
{
sw.Write( "," );
}
}
sw.WriteLine( );
}
sw.WriteLine( );
}
}
sw.Close( );
fs.Close( );
}
catch
{
Console.WriteLine( "WTF?!?" );
}
Console.WriteLine( "Press esc to exit." );
while ( !keyPressHandler( Console.ReadKey( true ) ) )
{
Thread.Sleep( 250 );
/* no op */
}
}
private static Boolean keyPressHandler( ConsoleKeyInfo input )
{
if ( input.Key == ConsoleKey.Escape )
return true;
return false;
}
private static DataSet ConvertHTMLTablesToDataSet( string HTML )
{
DataTable dt;
DataSet ds = new DataSet( );
dt = new DataTable( );
string TableExpression = "<table[^>]*>(.*?)</table>";
string HeaderExpression = "<th[^>]*>(.*?)</th>";
string RowExpression = "<tr[^>]*>(.*?)</tr>";
string ColumnExpression = "<td[^>]*>(.*?)</td>";
bool HeadersExist = false;
int iCurrentColumn = 0;
int iCurrentRow = 0;
MatchCollection Tables = Regex.Matches(
HTML,
TableExpression,
RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase
);
foreach ( Match Table in Tables )
{
iCurrentRow = 0;
HeadersExist = false;
dt = new DataTable( );
if ( Table.Value.Contains( "<th" ) )
{
HeadersExist = true;
MatchCollection Headers = Regex.Matches(
Table.Value,
HeaderExpression,
RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase
);
foreach ( Match Header in Headers )
{
dt.Columns.Add( Header.Groups[ 1 ].ToString( ) );
}
}
else
{
int columns = Regex.Matches(
Regex.Matches(
Regex.Matches(
Table.Value,
TableExpression,
RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase
)[ 0 ].ToString( ),
RowExpression,
RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase
)[ 0 ].ToString( ),
ColumnExpression,
RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase
).Count;
for ( int iColumns = 1; iColumns <= columns; iColumns++ )
{
dt.Columns.Add( "Column " + System.Convert.ToString( iColumns ) );
}
}
MatchCollection Rows = Regex.Matches(
Table.Value,
RowExpression,
RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase
);
foreach ( Match Row in Rows )
{
if ( !( ( iCurrentRow == 0 ) & HeadersExist ) )
{
DataRow dr = dt.NewRow( );
iCurrentColumn = 0;
MatchCollection Columns = Regex.Matches(
Row.Value,
ColumnExpression,
RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase
);
foreach ( Match Column in Columns )
{
dr[ iCurrentColumn ] = Column.Groups[ 1 ].ToString( );
iCurrentColumn++;
}
dt.Rows.Add( dr );
}
iCurrentRow++;
}
ds.Tables.Add( dt );
}
return ds;
}
}
}
posted by dharh 11:42 PM May 29th, 2011 via idt
« Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Next »
|
AI airships america batteries blogs books browser C# c++ chatGPT computers conversation copyright covid cpp cr-48 CSharp dharh disaster DIY DRM economy energy environment FCC gaming google government history HTML humor idt internet interview japan java javascript linkjack linux lrn2program MLP moving music nature nefeedeater neThing neTodo networking news opensource philosophy podcasts poverty programming projects python reading religion science sick simple software space sparce tagging technology twitter unbirthday video wiki
|