Random stuff I've found out or written. |
posted Oct 27, 2009 4:17 AM by Dave Jones
[
updated Nov 4, 2009 7:59 AM
]
Still having problems getting google to remove the "Adult content warning" from the first page of the site.. grrr.
Update: It's finally gone! |
posted Oct 22, 2009 8:10 AM by Dave Jones
I've had a few friends of friends that have stayed on my couch in the past few months. The latest couchsurfer Pheobe suggested that I sign up to http://www.couchsurfing.org/ which I have done,
I'll document my experiences here.
Dave |
posted Sep 3, 2009 8:14 AM by Dave Jones
I've just had all my email accounts disappear from my blackberry curve 8900.
It's because i'm using a custom theme, so I pulled the battery and then got stuck on the splash screen.
How to fix. 1. Hold down end call, until you get the main screen.
2. Click ok to the java.lang.nullpointer exception (if you have one, it might take 3 - 4 mins to clear )
3. go into settings themes and select a default theme.
4. do a battery pull.
5. Turn off radio and wifi,
6. go into your mail and mark all items "Read"
7. do a battery pull.
8. reactivate your custom theme,
9. reactivate radio and wifi.
And thats it, if I had known how to do that I wouldn't have bricked my first 8900!
|
posted Jun 2, 2009 4:28 AM by Dave Jones
posted Apr 2, 2009 3:56 AM by Dave Jones
posted Feb 18, 2009 2:26 AM by Dave Jones
I've just started at a new job at Augure in R&D. Finally a real job instead of contracting.
|
posted Feb 12, 2009 2:16 AM by Dave Jones
I've been enjoying life for the last month and a half, My new years resolution was to take every woman that I know out for a meal, and so far it's going great only one that said no, and a couple that have asked me to go out and eat a second time. life is great!
|
posted Jan 5, 2009 6:32 AM by Dave Jones
[
updated Feb 5, 2009 3:12 AM
]
Just one word.... WHY?
Ok that was a bit short, the real question is Why would you complicate your life to that extent when it's easier to do it yourself?
|
posted Oct 13, 2008 7:48 AM by Dave Jones
I've been working with one of the microsoft teams, and one of the problems I came up against was trying to get a webservice on tomcat running with c# using the svcutil.exe component.
There is little or no help available on the web so I was banging my head against the wall for the past two days or so.
Here's a quick howto:
Install Eclipse Ganymede, Tomcat 6.x and your c# editor of choice.
Add the tomcat server to Eclipse (new>server) and make sure that you take control of the instance and not launch a new instance when debugging.
Add a Dynamic Web Project and create a class.
public class HelloWorldExample {
public HelloWorldExample(){ } public String sayHello(String name){ return "Hello " + name; } }
save the file, right click the class in the project explorer , and then WebServices > Create WebService.
Slide the top slider all the way to the top ( this allows us to test at the final step) and click next.
And now the gotcha. check the SECOND check box not the "Wrapped" version. and then finish the wizard.
At this point you should be able to test the webservice with the eclipse webservice explorer.
Copy down the URL.
Create a new C# application. ( Don't use the Add webservice, it wraps the SvcUtil command behind and does a number of things that I want to explain)
Add a new text file to the application and call it GenerateProxy.cmd
edit the file.
set SDK="C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin" set DEST="C:\Documents and Settings\jones.d\Mes documents\Visual Studio 2008\Projects\WebApplicationTest2\WebApplicationTest2" set URL="http://localhost:8080/HelloWebService/services/HelloWorldExample?WSDL"
%SDK%\svcUtil.exe %URL% /out:%DEST%\Servicefile.cs /config:%DEST%\Servicefile.cs /language:CS /s /i
copy the above and change the DEST and URL , and possibly the SDK if you have a strange installation.
Find the .CMD and run it. (it's the same folder as the DEST variable)
Right Click project and include the two files, Servicefile.cs and Servicefile.cs.config
Now copy the contents of the Servicefile.cs.config into the web.config file, that's the node system.serviceModel and everything in it, at the end of the webconfig file. ie inside the configuration section.
Open the Servicefile.cs file and find the class that ends in Client. (this is your reference to the webservice)
Create a new instance ie.
HelloWorldExampleClient client = new HelloWorldExampleClient("HelloWorldExample"); labelReturn.Text = client.sayHello(textBox.Text);
where HelloWorldExample is the name of the endpoint in the client node.
and voila , bob is your fathers brother.
|
posted Oct 1, 2008 6:23 AM by Dave Jones
I had a bit of spare time on my hands and a laptop with visual studio 2008 installed, so I thought I would play a bit with linq.
The code below just returns the first line from the address object that matches a criteria, From the simple example below you can see that nothing much has changed from 2.0 anonymous delegates to the 3.5 linq queries, personally I'm not sure which I like better, the 2.0 anonymous delegate has a simplicity to it that I quite like. The 3.5 version , especially the second way is much clearer what it is doing.
I use the anonymous delegate a lot when coding in 2.0.
Dave.
class Program { static void Main(string[] args) {
List<Address> addresses = new List<Address>(); addresses.Add(new Address("1 City Road", "", "London")); addresses.Add(new Address("2 Bridge Avenue", "Chelsea", "London")); addresses.Add(new Address("3 Champs Elysee", "", "Paris"));
//3.5 version var result = from address in addresses.Cast<Address>() where address.City == "London" select address.Line1; foreach(string s in result){ Console.WriteLine(s); } //Better way var result2 = from Address address in addresses where address.City == "Paris" select address.Line1; foreach (string v in result2) { Console.WriteLine("=== " + v); }
//2.0 version. IEnumerable<Address> resultList = addresses.FindAll(delegate(Address a) { return a.City == "London"; }); foreach (Address s in resultList) { Console.WriteLine("--- " + s.Line1); } Console.ReadKey(); } }
class Address { string _Line1; string _Line2; string _City; public string Line1 { get { return _Line1; } set { _Line1 = value; } }
public Address(string line1, string line2, string city) { this.City = city; this.Line1 = line1; this.Line2 = line2; }
public string Line2 { get { return Line2;} set{ _Line2 = value;} } public string City { get { return _City; } set { _City = value; } }
}
|
|