<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
Make sure the individual PNG images have transparency | |
http://watermark.algid.net/en/create-transparent-png.php | |
Pack the images into a sprite png, and get the CSS | |
http://cly.jsser.com/sprites/ | |
Make buttons | |
http://dabuttonfactory.com/ | |
http://cooltext.com/ |
C# Regular Expressions Cheat Sheet | |
Cheat sheet for C# regular expressions metacharacters, operators, quantifiers etc | |
Character | |
Description | |
\ |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
namespace EDI.Import | |
{ | |
public class CSVRecord | |
{ |
Working with AsyncTasks on Android | |
from category Android | |
Introduction | |
Developing Android applications is a lot of fun because it offers a lot of possibilities to implement one's own ideas. Frequently i have to use AsyncTasks to do heavy work aside the ui thread. In the following i give a quick overview on AsyncTasks and provide some code snippets that might be useful for everyday development with Android regarding the use of AsyncTasks. | |
Lifecycle | |
An AsyncTask in Android is used to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers (more information). The structure follows call onPreExecute() for preparation, doInBackground() for doing the main task and return its result finally to the onPostExecute() method. Optional you can implement the onProgressUpdate() method e.g. to show a progressbar. | |
The following example can be used as template for an AsyncTask. | |
private class MyTask extends AsyncTask<Object, Void, Object> { |
// assumes dr is a SqlDataReader | |
List<string> columns_ = GetColumns(dr); | |
if (columns_.IndexOf("MissingField") == -1) { throw new Exception("Query did not contain \"MissingField\""); } | |
this.DBID = (int)dr["ID"]; | |
this.Created = (DateTime)dr["Created"]; | |
this.DataText = (string)dr["MissingField"]; | |
if (!dr.IsDBNull(columns_.IndexOf("MsgType")) { this.MsgType = (string)dr["MsgType"]; } |
if object_id('AsXMLAttribute') IS NOT NULL | |
DROP FUNCTION [dbo].[AsXMLAttribute] | |
GO | |
CREATE FUNCTION [dbo].[AsXMLAttribute] ( | |
@text varchar(max) | |
) | |
RETURNS varchar(max) | |
AS | |
BEGIN |
-- create a new table and insert records | |
-- ===================================== | |
select * into newtablename from MyFirstTable | |
-- copy records into existing table | |
-- ===================================== | |
insert into ReprocessTable(event_time, [msg]) select event_time, [msg] from FailedTable order by [id] | |
-- create a new table with records from another database |
select so.name, sc.[text] | |
from syscomments sc with (nolock) | |
inner join sysobjects so with (nolock) on so.[id] = sc.[id] | |
where [text] like '%create_job%' | |
/* raw | |
select * from syscomments sc with (nolock) where [text] like '%create_job%' | |
*/ |
SELECT | |
t.NAME AS TableName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB | |
FROM | |
sys.tables t | |
INNER JOIN | |
sys.indexes i ON t.OBJECT_ID = i.object_id |