C# Extract HTML Image URLs From Source
I made a web request and stored the web page's mark up in a string. Then passed it into this method that I found here. This will return a list of Uri objects. (ListSpeech Recognition Concepts.. Best Title I Got!
I found a really interesting QA article today while trying to figure out how to get C# speech recognition to guess what the user meant to input. Then correct the input, if needed.
My goal is to improve the programs natural language processing capabilities. I am trying to create an Iron Man's Jarvis interface type program. I have it working rather well now. It is hooked into the Wolfram Alpha's API. So you can ask Jarvis questions like, "How many people live in New York City?" or "What is 3 minus 4 equal?" Well enough about Jarvis. Information about my Jarvis project is coming in another post.
This post is for those of you who were wondering about creating a Google-ish "Did you mean" type response to user queries. Like I am currently looking into. This article should give you the keywords and jargon your looking for. Also links to great pre-existing solutions for you to use.
My goal is to improve the programs natural language processing capabilities. I am trying to create an Iron Man's Jarvis interface type program. I have it working rather well now. It is hooked into the Wolfram Alpha's API. So you can ask Jarvis questions like, "How many people live in New York City?" or "What is 3 minus 4 equal?" Well enough about Jarvis. Information about my Jarvis project is coming in another post.
This post is for those of you who were wondering about creating a Google-ish "Did you mean" type response to user queries. Like I am currently looking into. This article should give you the keywords and jargon your looking for. Also links to great pre-existing solutions for you to use.
Knowing what to search for, is half of the battle. :)
#################################################################################
The question asked on Stackoverflow: Click here for source site.
#################################################################################
I have the following requirement: -
The question asked on Stackoverflow: Click here for source site.
#################################################################################
I have the following requirement: -
I have many (say 1 million) values (names). The user will type a search string.
I don't expect the user to spell the names correctly.
So, I want to make kind of Google "Did you mean". This will list all the possible values from my datastore. There is a similar but not same question here. This did not answer my question.
My question: - 1) I think it is not advisable to store those data in RDBMS. Because then I won't have filter on the SQL queries. And I have to do full table scan. So, in this situation how the data should be stored?
2) The second question is the same as this. But, just for the completeness of my question: how do I search through the large data set? Suppose, there is a name Franky in the dataset. If a user types as Phranky, how do I match the Franky? Do I have to loop through all the names?
I came across Levenshtein Distance, which will be a good technique to find the possible strings. But again, my question is do I have to operate on all 1 million values from my data store?
3) I know, Google does it by watching users behavior. But I want to do it without watching user behavior, i.e. by using, I don't know yet, say distance algorithms. Because the former method will require large volume of searches to start with!
4) As Kirk Broadhurst pointed out in an answer below, there are two possible scenarios: -
- Users mistyping a word (an edit distance algorithm)
- Users not knowing a word and guessing (a phonetic match algorithm)
I am interested in both of these. They are really two separate things; e.g. Sean and Shawn sound the same but have an edit distance of 3 - too high to be considered a typo.
........... Click the link above to see the answers for the question. Or here... Click here for source site.
Sql Server Error: @schedule_uid is not a parameter for procedure sp_add_jobschedule.
@schedule_uid is not a parameter for procedure sp_add_jobschedule.Recently had to resolve an issue with this error when sending in a SQL script. We right clicked a server job and when to:
Script Job As > CREATE TO > New Query Editor Window
in SQL Server 2008. The script was going to be ran on SQL Server 2005 server.
On SQL Server 2005 the parameter is @schedule_id and on SQL Server 2008 this parameter is @schedule_uid. If you remove the parameter this will allow the script to be ran on both 2005 and 2008.
C# WPF - Dynamically Loading Images Asynchronously Into a StackPanel From a List of Image URL's
Recently, I needed to be able to load images from URLs into
a WPF window without locking up the UI thread. After looking at multiple
websites that posted how to do this or something similar, I wanted to share the
solution I came up with after doing research on this topic.
What this does is takes a list of URLs and loads them asynchronously
into the StackPanel without locking up the UI. If an image load fails, it inserts
an error image and message. For each
image URL, a background worker is created to download the image using WebClient
on a different thread. After each image is loaded the program will add it to
the form.
Here is the using statements. I had to give System.Windows.Shapes an alias because of the System.IO.Path namespace. They both contain an object called Path. This solved the ambiguous issue naming issue.
Just checking to make sure the folder exists. If not, create it.
This main try/catch is where it all happens. A rule of thumb, always leave breakpoints in your catches. Here we create a hard coded list of strings and loop over them and fetch each one in background worker. This will asynchronously load the images without locking up the UI thread.
Here is the DoWork event. Its job is to download the image to the image folder and return the path of the downloaded image to the WorkCompleted event. If there is an issue we return NULL so we can load in our error image.
In the work completed event we check for NULL and then add our controls to the StackPanel. I add a label then the image to the StackPanel's Children property. I load the images into a BitmapImage object by passing in the image path. Then I set it to the Image object which can be added to the StackPanel.
This method is really handy and I found it in one of the source links. This will load up the error image we have in the solution. This is my first WPF project so I had to figure out how to do resource handling in WPF vs. Winforms/Webapps. There is not a huge difference, but it is a little different.
Here is the XAML I added to the window. Note the use of the ScrollViewer around the StackPanel node.
Download Example
Sources:
http://stackoverflow.com/questions/8266475/how-to-download-image-synchronously-in-background
http://stackoverflow.com/questions/569561/dynamic-loading-of-images-in-wpf
http://stackoverflow.com/questions/6250240/how-to-add-a-scrollbar-to-a-stackpanel
Diving Into Android Development Tonight
I have downloaded Andorid SDK bundle, ADT Plugin, and Java. This is a new laptop and I forgot to install java after I got it. I will outline my steps here and offer any tips or tricks I find along the way. I have experience writing in Java, so this will assume you do also. Wish me luck.
- Download the Android SDK.
- Install the ADT plugin for Eclipse (if you’ll use the Eclipse IDE).
- Download the latest SDK tools and platforms using the SDK Manager.
- Install Java... If you have not already... *cough* :)
Follow the steps here: Creating an Android application
The link above is what I followed for creating my first project. Pretty straight forward. Only thing I did different was name my project Sandbox.
To get this to run on an older LG android phone I had to download it's OEM USB drivers. Then use an android command "adb devices" in the SDK's Platform-tools folder. To see if my device was properly connect. This page helped "Using Hardware Devices"
Next I had got the app to run on my Nexus 7. I had to use windows device manager to point the driver update at the files I downloaded from ASUS. Just another FYI.
I did the next page and got the app to open and send an INTENT into another Activity. Well I am to the screen now. I just need a great app idea now. I have my developer environment set up. Follow the rest of the my first app guide if you need. It is a great starting point. I just needed to figure out how to launch my apps on devices. Super excited to get going with Android development.
The Best Google Features You're Probably Not Using »Google is a vast machine with all types of apps, programs, and tools. A lot of these—like Gmail and Google Docs—are clearly useful and beloved by many.
The Best Google Features You're Probably Not Using »Google is a vast machine with all types of apps, programs, and tools. A lot of these—like Gmail and Google Docs—are clearly useful and beloved by many.
Joomla!(TM) Development Services | Portland, OR | Social Media Services - Salyris Studios
Check them out pretty awesome studio! :)Joomla!(TM) Development Services | Portland, OR | Social Media Services - Salyris Studios
C# & ASP.Net: Get the Row Index from a ASP.Net GridView's RowCommand event.
I have used this before and it works.
int rowIndex = Convert.toInt32(e.CommandArgument);
If that one above doesn't work you can try this. Lets say that the rowcommand is triggered by a linkbutton you would do to get the row index.
Source: http://www.daniweb.com/web-development/aspnet/threads/363842/how-to-get-rowindex-of-gridview-using-datakey-obtained-in-rowcommand
GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;int rowIndex = row.RowIndex;
This Eclipse plugin adds FTP support. Edit server files from Eclipse. http://www.aptana.org/downloads/start#
This Eclipse plugin adds FTP support. Edit server files from Eclipse.http://www.aptana.org/downloads/start#
This check for syntax errors and allows debugging with breakpoints.http://www.phpeclipse.com/ #PHP
This checks for syntax errors and allows debugging with breakpoints in PHP. :)http://www.phpeclipse.com/
Sprite Animation with HTML5
Great article about sprite animation with HTML5.http://blogs.msdn.com/b/davrous/archive/2011/07/21/html5-gaming-animating-sprites-in-canvas-with-easeljs.aspx
Handle Enter Key for search and login page
This Article is where I found my answer:
http://stackoverflow.com/questions/6140640/handle-enter-key-for-search-and-login-page
The panel tag has a DefaultButton property. I simply give it the ID of the button you click to search. After that all the controls inside would fire the search button if you pressed 'ENTER'.
Before:
After:
Java and C# Comparison
A great reference for porting back and forth or learning either. Java and C# ComparisonC#: EPPlus Open Xml Server Side Automation
Create advanced Excel 2007/2010 spreadsheets on the server
EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).
EPPlus supports:
- Cell Ranges
- Cell styling (Border, Color, Fill, Font, Number, Alignments)
- Charts
- Pictures
- Shapes
- Comments
- Tables
- Protection
- Encryption
- Pivot tables
- Data validation
- Many more...
It had the basic functionality needed to read and write a spreadsheet.
C# & SharpzipLib : How to put each file in a directory in their own zip file.
I needed to zip every file in a folder into their own zip files. After a while on Google I finally decided to code it for myself. So here is a method you can use to do this, just pass in two paths and your good to go.
Download SharpZipLib Here:(http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx)
This page helped me figure this out. Check it out.
Subscribe to:
Posts (Atom)
About Me
Popular Posts
-
C# WPF - Dynamically Loading Images Asynchronously Into a StackPanel From a List of Image URL's
-
Speech Recognition Concepts.. Best Title I Got!
-
Jarvis virtual assistant - William Arends C# & .NET
-
Joomla!(TM) Development Services | Portland, OR | Social Media Services - Salyris Studios
-
C# & ASP.Net: Get the Row Index from a ASP.Net GridView's RowCommand event.
-
C# Extract HTML Image URLs From Source
-
Sql Server Error: @schedule_uid is not a parameter for procedure sp_add_jobschedule.
-
Voice searches on Jelly Bean.
-
This Eclipse plugin adds FTP support. Edit server files from Eclipse. http://www.aptana.org/downloads/start#
-
(no title)
Labels
Blog Archive
Powered by Blogger.
.png)