Re: Unable to locate the .NET SDK

2020-12-15 Thread David Rhys Jones
Hi

I had this problem before.i fixed it by updating the 2019 installer for
visual studio and then downloading the required files in the updated
installer.


Hth

Davy


On Sun, 13 Dec 2020, 04:56 David Burstin,  wrote:

> Totally agree Mike. That is exactly what I do too. Saves headaches and
> regret and allows for painless experimentation.
>
> On Sun, 13 Dec 2020, 14:52 mike smith,  wrote:
>
>> Which encourages me to run it all on a VM, and use snapshots liberally so
>> I can revert.
>>
>> On Sun, Dec 13, 2020, 13:53 Greg Keogh  wrote:
>>
>>> Have a check of your path variable?  Some install/updates are fairly
 brain dead when they modify it, periodically I copy it out to a text editor
 and clean up removed apps, check for valid paths etc

>>>
>>> Howdy, I saw some web posts around that subject, but my PATH looked
>>> sensible.
>>>
>>> I noticed the dotnet --info showed all my runtimes were in Program Files
>>> (X86) whereas they were in the 64-bit one on my other machines. This weird
>>> difference had me worried and I didn't know how to alter it. So by 1pm I
>>> had done no work and since the weekend was upon me I ran lots of backups
>>> and screenshots and formatted C: and reinstalled the latest Win10 image
>>> 20H2.
>>>
>>> This has fixed my Core project problem and the dotnet --info output
>>> matches my other machines.
>>>
>>> I don't feel so bad about the reinstall, as a lot of crap accumulates
>>> over 3 years or so with countless updates and new major software releases.
>>> It took about 8 full man-hours to get everything back to a familiar shape,
>>> but I notice my program list is much smaller and lots of strange folders
>>> and settings have vanished, so I feel my PC is much "cleaner" now. I
>>> suppose it's worth doing this every couple of years if you have the stamina
>>> for it. Most of my time was wasted configuring IIS, putting credentials
>>> back everywhere, creating my favourite shortcuts and Start Menu arrangement.
>>>
>>> I have one utterly weird and unexpected problem ... the default font in
>>> notepad, VS2019 output window, Edge text display, and many other places has
>>> reverted to some italic font. So I've got this stupid italic output all
>>> over the place and I can't find where it's coming from or how to get the
>>> normal Segoe (I think?) back again.
>>>
>>> Cheers,
>>> *Greg K*
>>>
>>> P.S. I forgot to mention Friday week ago that it was the 25 anniversary
>>> of the release of JavaScript.
>>>
>>


Re: Xamarin macOS app

2020-07-15 Thread David Rhys Jones
Hello,
I've not done it, but have you explored doing a window in dotnet core and
seeing what it looks like when you publish to macos?

Davy

David JONES
djones...@gmail.com
+33 7 66 42 54 07


+33 6 52 03 96 70



On Wed, Jul 15, 2020 at 5:46 AM Greg Keogh  wrote:

> Folks, I have to create a sample desktop app on macOS in coming weeks,
> nothing too hard, just a file picker, some text boxes and a scrolling text
> results display. I already did a Mac console app sanity check and it uses
> my C# NuGet package okay and displays correct results (which took about 15
> minutes and is a tribute to the cross-platform promises of .NET). Now I
> have to make a window to impress the customer.
>
> Has anyone used a Xamarin.Mac Cocoa project to make a Mac desktop app?
> I've read all the docs and I'm about to start, I have no choice, so I was
> just wondering if anyone's trod this path.
>
> I notice the UI design process is a thin shell over using
> Xcode's designer, you just Alt+Tab between them and code silently migrates
> back to C#. It seems fair enough to let Xcode do all the heavy UI lifting,
> but it seems a bit clumsy.
>
> The whole Xamarin.Mac platform is such a thin shell over the native Apple
> processes that for a moment I consider skipping Xamarin completely and just
> learning Xcode and Swift like a native. But then I realised that I will
> want to consume .NET packages and libraries, so it's back to Xamarin.Mac.
>
> *Greg K*
>


Re: [OT] Impact of covid19 on devs

2020-05-31 Thread David Rhys Jones
Hi,

I was working as a contractor for an Oil company,  they had to remove all
contractors.  I've been partially laid off, I am still employed by my
company but the Government is paying my salary.
I'm being forced to do online training while they look for work for me.  I
was planning to change jobs, but there is zero market out there at the
moment. All the usual head hunters have gone quiet.

Davy.


On Mon, Jun 1, 2020 at 4:29 AM Tom Rutter  wrote:

> Hi folks,
>
> I’m curious to hear how these lockdowns and such have affected the dev
> market. Any thoughts and experiences to share?
>
>


Re: [OT] DevOps login fails

2020-02-03 Thread David Rhys Jones
I've had this problem before but with Azure.
The problem was the browser, try logging in with Edge and see if that
helps.

David JONES



On Mon, Jan 27, 2020 at 11:59 PM Greg Keogh  wrote:

>
> https://{yourorganisation}.visualstudio.com is now the old format.. The
>> newest is now https://dev.azure.com/{yourorganisation} (Since Microsoft
>> changed from Visual Studio to Azure Devops sometime last year)
>>
>
> Okay, I'll change my bookmarks to the new format. Sadly it doesn't help my
> problem.
>
> My problem is so serious that I sent a free tier support request, and I
> have had 3 exchanges with a support person already who asked for a Fiddler
> dump and some screenshot from my Azure AD portal screen. We determined that
> the problem is independent of my network and environment. I suspect an AD
> problem. It's still in flight …* GK*
>


Re: OT: Robo Vacs

2020-01-20 Thread David Rhys Jones
Hi,

I've had three Roomba's in the last 12 years. They are not good if there is
someone with long hair in the place, hair will strip off the brushes in no
time.

Robby died of a stuck left wheel after 2 years

Son of Robby died from a stuck right wheel after 3 years

Zombie Robby, with parts from Robby and Son of Robby died after failing to
detect the stairs due to dust buildup on the sensors.

Robby the Constantly Horny, has been trying to mount the Fan leg for the
last 5 years, he's on battery number 2, brushes x3.

I love my roomba(s), they love eating cables and herding the waste paper
bin around the kitchen. When they get bored they go and hide under the sofa
or between the chair legs of the dinning table, when he's not humping the
upright fan.

Davy

David JONES
djones...@gmail.com
+33 7 66 42 54 07


+33 6 52 03 96 70



On Mon, Jan 20, 2020 at 11:50 AM David Connors  wrote:

> Hi All,
>
> Very off topic but what success has anyone had here with robo vacs?
>
> Our 11 month old German Shepherd is blowing her coat and the place is dog
> hair central hence the question.
>
> I know a few people who have had them but they've died after a few months
> etc. The better ones that can self empty etc seem to be around the $1500
> mark - which gets up there in price as we have two floors and they haven't
> invented one that climbs stairs yet. :)
>
> David Connors
> da...@connors.com | M +61 417 189 363
> Telegram: https://t.me/davidconnors
> LinkedIn: http://au.linkedin.com/in/davidjohnconnors
>
>


Re: Core 3.0 and C# 8

2019-09-26 Thread David Rhys Jones
Hi

You are using 2019 right. 2017 can't run 3.0.
If you are using 2019. Download the installer again and the add the package
from the list.

Davy

On Fri, 27 Sep 2019, 06:18 Greg Keogh,  wrote:

> Folks,
>
> I'm keen to experiment with C# 8 features and get familiar early, but I
> can't get any project to use it. In Visual Studio 2019 16.2.3 I've tried to
> create Standard, Core and Framework projects of all the latest versions,
> then set the Build Advanced Language Version to 8 or preview, but it's
> never available.
>
> I thought Core 3.0 projects could use C# 8, but the highest choice I have
> is 2.2. So I installed 3.0 manually and dotnet --list shows me the
> following (truncated) as installed, but I never see 3.0 list in target
> frameworks.
>
> >dotnet --list-runtimes
> Microsoft.AspNetCore.App 3.0.0 [C:\Program
> Files\dotnet\shared\Microsoft.AspNetCore.App]
> Microsoft.NETCore.App 3.0.0 [C:\Program
> Files\dotnet\shared\Microsoft.NETCore.App]
> Microsoft.WindowsDesktop.App 3.0.0 [C:\Program
> Files\dotnet\shared\Microsoft.WindowsDesktop.App]
> >dotnet --list-sdks
> 3.0.100 [C:\Program Files\dotnet\sdk]
>
> So I have two issues: (1) I can't pick Core 3.0 Framework (2) How on earth
> do I coax C# 8 into action?
>
> Any advice would be most welcome. Perhaps there are really strict
> conditions or dependencies I'm not aware of.
>
> Cheers,
> *Greg*
>
> P.S. Public holiday in Melbourne for some sort of ball game. A horse race
> I can understand, but this?
>


Re: Friendly URL for intranet apps

2019-09-23 Thread David Rhys Jones
Hi,
Also check to see if the web server, iis or other, is accepting All ips or
named Ips.  you might have to add   http://servera  to the list of bindings.

Davy.

David JONES
djones...@gmail.com
+33 7 66 42 54 07


+33 6 52 03 96 70



On Sun, Sep 22, 2019 at 1:51 AM Tom P  wrote:

> Cheers. Will speak to the admin about setting this up.
>
> On Fri, 20 Sep 2019 at 15:13, DotNet Dude  wrote:
>
>> An A or CNAME dns record can do what you want
>>
>> On Fri, 20 Sep 2019 at 15:04, Tom P  wrote:
>>
>>> Hi folks
>>>
>>> I’m moving an intranet app from an old server to a new server. Currently
>>> the users access the site with a URL like http://*serverA*/appName/.
>>>
>>> The issue is now that I’m moving the app the server name in the URL will
>>> change to http://*serverB*/appName.
>>>
>>> All the users are forced to update their bookmarks which is a bit lame
>>> in my view.
>>>
>>> I’m sure this isn’t a new issue. What is a good way to handle this?
>>>
>>> Would be good to have a URL like http://myapp.mydomain.com.au but where
>>> would this be set up? In IIS somewhere? DNS entry? How and where to set it
>>> up?
>>>
>>> Cheers
>>>
>> --
>>> Thanks
>>> Tom
>>>
>> --
> Thanks
> Tom
>


Re: JSON deserialize

2019-07-24 Thread David Rhys Jones
Hi
Just my .02c but I have had nothing but problems with microsoft json
serializers.

Davy

On Wed, 24 Jul 2019, 05:33 Greg Keogh,  wrote:

> > it's worth noting that NewtonSoft Json.NET will NOT be installed by
> default as of .Net Core 3.0:
>
> I was preparing an invoice to send to James Newton-King to charge him for
> the countless hair-tearing hours of my life wasted trying to get rid of
> version conflict errors in my builds. So many wildly different versions of
> the library have become glued to so many components and libraries that he's
> effectively created a gigantic maths puzzle. And why does he keep updating
> the major and minor version numbers when (as far as I can tell) the
> commonly used part of the API doesn't change? I've seen other complaints
> that he's not following a sensible versioning strategy.
>
> I was also pleased to read several weeks ago in the Core release blogs
> that Microsoft will provide a leaner faster Json processing library, and
> hopefully they won't keep churning out new versions like confetti. Good
> riddance to Newtonsoft and yet another external dependency.
>
> *Greg K*
>
>>


Re: [Off Topic] Drop Box alternatives with a large number of files (about 0.5M+ files).

2019-05-23 Thread David Rhys Jones
Hi,
I use onedrive, with the save space and download files as you use them. I
also limit the amount of bandwidth it's using. I've not experienced the
same issues that you have.
My git repository is in my onedrive folder which is a bit bigger than your
set up,

Regards
Davy



*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*



On Thu, May 23, 2019 at 9:38 AM Greg Harris 
wrote:

> Hi All,
>
> Sorry, this is a bit of a long rambling request for advice on using or
> replacing dropbox due to performance reasons with a large number of files
> (about 0.5M+ files).
>
> I used to be a huge supporter of dropbox.  It used to just work and was
> reasonably responsive.  Then it just stopped working for me last year.
>
> I think this may have been around the time when the OS updates were made
> for Spectre and Meltdown Security Flaw.  The drop in effective performance
> of the CPU may have pushed the machine below the capacity to run the
> software???
>
> I attempted to get some help from dropbox but that was a huge waste of
> time.
>
> I have now just got around to looking at alternatives.
>
> The first one I tried was One Drive.  Because I am in a Microsoft setup,
> One Drive was the first logical choice.
>
> My current One Drive setup has 283K files in 105K folders with 70GB in the
> cloud and 27GB on the local machine.
>
> With One Drive in use, I have noticed the “One Drive Sync Engine” along
> with the “Windows Search Indexer” tasks running all the time, pushing up
> the CPU usage and the fans on the system are running to cool it down (which
> beforehand never happened).  It is somewhat clever enough to know when
> there is interactive use and push the priority of the task down.  But if I
> go away from my desk for a few minutes the task is taking a lot of CPU and
> the fans are running again.
>
> What I am looking for in a dropbox alternative is:
>
> 1.   Reasonable performance
>
> 2.   Online backup of working files
>
> 3.   Reasonable price (yes I will pay for it)
>
> I think that my options are:
>
> 1.   https://www.dropbox.com – Should I go back and try again
>
> 2.   https://onedrive.live.com/ - Are the problems I am having
> consistent with your experience?
>
> 3.   https://www.google.com/drive/
>
> 4.   https://www.box.com/
>
> 5.   Other
>
> I am running an old Intel Xeon 2.8GHz with 32 GB RAM as the base machine
> with a 3 core 10 GB VM inside it as my primary work horse machine.
>
> It has been clear the Moore’s law has died in the last five years, so I
> have seen no clear and present need to upgrade this machine.  I am thinking
> that may be wrong, do I just need a new machine???
>
>
> Thanks for your help on this :-)
>
>
> Greg Harris
> Harris Consulting Group Pty Ltd
> g...@harrisconsultinggroup.com
> www.HarrisConsultingGroup.com 
> phone: (international) +61 407 942 982
> phone: (within Australia) 0407 942 982
> Sydney
> Australia
>


Re: [OT] Sql Server writes causing contention

2019-03-27 Thread David Rhys Jones
Hello,

Have you tried copying the data in place, by creating a temporary column to
contain the data while you drop and recreate your column?

Davy.


*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*



On Wed, Mar 27, 2019 at 5:44 AM Tom P  wrote:

> A further update: moving a specific text column from the old table seems
> to cause the LOB data to be present on the new table. The specific text
> column holds callstack values.
>
>
> On Wed, 27 Mar 2019 at 15:34, Tom P  wrote:
>
>> Still problematic and with LOB data.
>>
>> I ran another test and by not copying the text values from the old table
>> to the new it successfully works and no LOB data. Including the text
>> columns from the old table in the copy seems to be where the problem is. I
>> even tried casting during the move but no luck.
>>
>> On Wed, 27 Mar 2019 at 14:48,  wrote:
>>
>>> Sorry, does that mean it ran the same, or also has the LOB data
>>> separated?
>>>
>>>
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>>
>>> Greg
>>>
>>>
>>>
>>> Dr Greg Low
>>>
>>>
>>>
>>> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913
>>> fax
>>>
>>> SQL Down Under | Web: www.sqldownunder.com
>>> 
>>>  |http://greglow.me
>>> 
>>>
>>>
>>>
>>> *From:* ozdotnet-boun...@ozdotnet.com  *On
>>> Behalf Of *Tom P
>>> *Sent:* Wednesday, 27 March 2019 2:46 PM
>>> *To:* ozDotNet 
>>> *Subject:* Re: [OT] Sql Server writes causing contention
>>>
>>>
>>>
>>> Same result unfortunately
>>>
>>>
>>>
>>> Cheers
>>>
>>>
>>>
>>> On Wed, 27 Mar 2019 at 12:54,  wrote:
>>>
>>> Can you change the object names in the script below and see if it
>>> returns the same results on that system? (At least to isolate something
>>> system-related as a starting point)
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>>
>>> Greg
>>>
>>>
>>>
>>> Dr Greg Low
>>>
>>>
>>>
>>> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913
>>> fax
>>>
>>> SQL Down Under | Web: www.sqldownunder.com
>>> 
>>>  |http://greglow.me
>>> 
>>>
>>>
>>>
>>> *From:* ozdotnet-boun...@ozdotnet.com  *On
>>> Behalf Of *Tom P
>>> *Sent:* Wednesday, 27 March 2019 10:20 AM
>>> *To:* ozDotNet 
>>> *Subject:* Re: [OT] Sql Server writes causing contention
>>>
>>>
>>>
>>> Hi Greg
>>>
>>>
>>>
>>> When I run this on my local Sql install and insert dummy data all works
>>> as expected like you. However on the actual server when I MOVE the data
>>> from the original table to the new one then the problems comes up and the
>>> new table has LOB_DATA.
>>>
>>>
>>>
>>> I am not sure where to go from here. Any ideas?
>>>
>>>
>>>
>>> Cheers
>>>
>>>
>>>
>>> On Tue, 26 Mar 2019 at 09:49,  wrote:
>>>
>>> Hi Tom,
>>>
>>>
>>>
>>> Got to try it and now puzzled. If I run this:
>>>
>>>
>>>
>>> CREATE TABLE [dbo].[Log_New](
>>>
>>> [LogID] [bigint] IDENTITY(1,1) NOT NULL,
>>>
>>> [DateTime] [datetime] NOT NULL,
>>>
>>> [Type] [varchar](30) NOT NULL,
>>>
>>> [Message] [varchar](max) NULL,
>>>
>>> CONSTRAINT [PK_Log_New] PRIMARY KEY CLUSTERED
>>>
>>> (
>>>
>>> [LogID] ASC
>>>
>>> )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY =
>>> OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
>>>
>>> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
>>>
>>> GO
>>>
>>>
>>>
>>> ALTER TABLE [dbo].[Log_New] ADD CONSTRAINT [DF_Log_New_DateTime] DEFAULT
>>> (getdate()) FOR [DateTime]
>>>
>>> GO
>>>
>>>
>>>
>>> SELECT OBJECT_NAME(object_id),
>>>
>>>alloc_unit_type_desc,
>>>
>>>page_count
>>>
>>> FROM sys.dm_db_index_physical_stats
>>>
>>>(DB_ID(), NULL, NULL, NULL, 'DETAILED')
>>>
>>> WHERE OBJECT_NAME(object_id) = N'Log_New';
>>>
>>>
>>>
>>>
>>>
>>> What I see is this:
>>>
>>>
>>>
>>>
>>>
>>> If I add 10,000,000 rows (10 million rows), still the same:
>>>
>>>
>>>
>>> WITH Counts
>>>
>

Re: Async Await.

2019-03-26 Thread David Rhys Jones
Some call APIs  but the vast majority are just mapping calls. Changing one
object into another.

Davy

On Tue, 26 Mar 2019, 21:51 Greg Keogh,  wrote:

>
> This is pretty typical for the entire project.
>> var legalEntity = await CreateLegalEntityObjectAsync(...);
>> var billingAccount = await CreateBillingAccountObjectAsync(...);
>>
>
> But what's inside all the awaited methods? Are they actually doing
> anything asynchronously (web service calls, overlapped file IO)? Got the
> source code or look in ILSpy? --* GK*
>
>>


Re: Async Await.

2019-03-26 Thread David Rhys Jones
Yes David, there are whole chains of method calls, all awaiting for
something to complete, the only part that is not async is the database call!



*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*



On Tue, Mar 26, 2019 at 2:34 PM David Gardiner 
wrote:

> Presumably inside these methods are other calls to additional async
> methods?
>
> This sounds like an example of how "viral" the async/await stuff can be,
> in that once you call an async method at the lowest level, everything
> further up ends up needing to become "async/awaited" too.
>
> David
>
> On Tue, 26 Mar 2019 at 06:45, David Rhys Jones 
> wrote:
>
>> Hi Greg,
>>
>> This is pretty typical for the entire project.
>> var legalEntity = await CreateLegalEntityObjectAsync(...);
>>
>> var billingAccount = await CreateBillingAccountObjectAsync(...);
>> var billingAccountUid = billingAccount.UserName;
>> var billingAccountTaxServiceAddressPcode =
>> billingAccount.InternalView.TaxServiceAddressPcode;
>>
>> var primaryGroup = await CreatePrimaryGroupObjectAsync();
>>
>>
>> Davy
>>
>> *... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
>> .. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*
>>
>>
>>
>> On Tue, Mar 26, 2019 at 11:10 AM Preet Sangha 
>> wrote:
>>
>>> *forking* hell!
>>>
>>> regards,
>>> Preet, in Auckland NZ
>>>
>>>
>>>
>>> On Tue, 26 Mar 2019 at 22:52, Greg Keogh  wrote:
>>>
>>>>
>>>> I've started a new post, and one of the applications here uses Async
>>>>> Await for nearly every method call, even for simple calls that just create
>>>>> an object and return it.
>>>>>
>>>>
>>>> How on earth is that sort of thing coded? How are intrinsically
>>>> synchronous methods forcibly turned into async ones? Is it like this?...
>>>> (I'm just guessing)
>>>>
>>>> var foo = await Task.Run(() => return new Foo());
>>>>
>>>> *Greg K*
>>>>
>>>>>


Re: Async Await.

2019-03-26 Thread David Rhys Jones
Hi Greg,

This is pretty typical for the entire project.
var legalEntity = await CreateLegalEntityObjectAsync(...);

var billingAccount = await CreateBillingAccountObjectAsync(...);
var billingAccountUid = billingAccount.UserName;
var billingAccountTaxServiceAddressPcode =
billingAccount.InternalView.TaxServiceAddressPcode;

var primaryGroup = await CreatePrimaryGroupObjectAsync();


Davy

*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*



On Tue, Mar 26, 2019 at 11:10 AM Preet Sangha  wrote:

> *forking* hell!
>
> regards,
> Preet, in Auckland NZ
>
>
>
> On Tue, 26 Mar 2019 at 22:52, Greg Keogh  wrote:
>
>>
>> I've started a new post, and one of the applications here uses Async
>>> Await for nearly every method call, even for simple calls that just create
>>> an object and return it.
>>>
>>
>> How on earth is that sort of thing coded? How are intrinsically
>> synchronous methods forcibly turned into async ones? Is it like this?...
>> (I'm just guessing)
>>
>> var foo = await Task.Run(() => return new Foo());
>>
>> *Greg K*
>>
>>>


Async Await.

2019-03-26 Thread David Rhys Jones
Hello all,

I've started a new post, and one of the applications here uses Async Await
for nearly every method call, even for simple calls that just create an
object and return it.

Are there any pitfalls for using this many await methods in an application?

Davy.



*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*


Re: [OT] 5G

2019-03-04 Thread David Rhys Jones
Oz is getting 5g? How about they fix the blank parts up a bit first.

https://www.nperf.com/en/map/AU/-/355.Vodafone/signal/?ll=-30.60009387355006&lg=157.6757812503&zoom=4

*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*



On Sun, Mar 3, 2019 at 10:38 PM David Connors  wrote:

> I'm not sure what the specific health concerns are but there is always a
> loonie fringe who whinges about EMF. A lady I used to live next to wouldn't
> let her son use the PS4's bluetooth controller because she thought it (and
> wifi) would make him infertile or have cancer of something. If you're that
> worried about EMF you should stop driving cars.
>
> From a geek perspective, 5G is going to be pretty awesome. Loads of
> bandwidth, very, very low latency. In a practical sense, I am not sure it
> is going to make any difference - we can already watch HD video and
> download huge files etc on LTE ... and I never touch the sides of my data
> allowance as it is.
>
> Maybe cost reduction for plans will be a big deal for people not on a
> 'business grade' plan?
>
> David Connors
> da...@connors.com | M +61 417 189 363
> Telegram: https://t.me/davidconnors
> LinkedIn: http://au.linkedin.com/in/davidjohnconnors
>
>
>
> On Mon, 4 Mar 2019 at 05:52, Tom Rutter  wrote:
>
>> Hi all
>>
>> What are your thoughts on 5G? I’m hearing a lot of about health concerns
>> and 5G.
>>
>> Cheers
>> Tom
>>
>


Re: Blazor comments

2019-01-29 Thread David Rhys Jones
Flash died because it was bug ridden and provided a huge amount of
backdoors into pc's. Silverlight was only there to take flash's market
share. When flash died so did silverlight it's mission accomplished.
Microsoft's goal for many years is to be web based only. The keep trying to
push developers towards web based architecture.

.02c



On Wed, 30 Jan 2019, 07:53 Arjang Assadi  until a rendering engine is included I can not see any benefit to using
> blazer or any other WASM equivalents. Flash as bad as it was , was a better
> solution , no idea what the big idea was to kill it off , or for that
> matter ms unilaterally killing silver light.
>
>
> On Wed, 30 Jan 2019 at 5:26 pm Greg Keogh  wrote:
>
>> Folks, has anyone else in here given Blazor a good bash and got comments?
>> I've run some sanity tests on 0.7 and it's looking pretty good. You can
>> reference packages and projects, there's basic binding (which I hope they
>> improve), you can break things up into "components" and nest them, separate
>> code-behind if you want, register and inject services, define routing, make
>> async web calls, deploy to Azure web apps, etc. All this stuff I mentioned
>> is in the docs, but I had to try it myself to see if it really works. The
>> only thing I haven't tried yet is rendering a large complex page to see how
>> it performs and responds to DOM changes.
>>
>> So finally it looks like there's a real chance in the .NET ecosystem that
>> the crazy zoo of JS frameworks to make SPAs will be displaced by a familiar
>> and respected languages and frameworks. Great, but suddenly I was slapped
>> hard by a shocking realisation … we're still stuck using the web browser
>> and HTML (and some JS glue) for rendering the UI.
>>
>> The web browser cannot render complex business app UIs. Where are the
>> rich controls and layout features we are used to on the desktop, or in
>> Silverlight, or Flash or Java Applets for that matter? HTML was created to
>> render simple text and pictures and now 27 years later it's completely
>> effing stupid that we're still trying to create apps with it. We're
>> changing how those apps are written, but we're still stuck with the damn
>> browser and HTML for rendering.
>>
>> I have an example … a few weeks ago I wondered by a web page was taking
>> 40s to load. It turned out I was loading a tree (a fake one, as there is no
>> tree control) with 4000 nodes, each one in a div and 3880 of them were
>> hidden. So the page looked small and tidy, but there were thousands of
>> hidden divs. I spent hours of suffering inventing a click-demand-load
>> technique. There is no virtualisation in HTML, which is taken for granted
>> in real UI frameworks.
>>
>> There endeth the good news and the bad news.
>>
>> *Greg K*
>>
>


Re: SPA decision

2017-04-05 Thread David Rhys Jones
I'm working on a SPA at the moment,  except it's not, there is a client
side facing SPA and an angular / MVC admin site.

The MVC side of things are pretty straight forward, even with all the
angular stuff in there complicating things.

The SPA site is, a youg devloppers wet dream of technologies, Gulp, Less,
you name it it's in there.  The code is buggy and never does what you
expect it to do. This morning, I'm trying to figure out why the Less styles
don't output the correct css on my machine but on the build server
everything is working fine.

Both ways of doing it work, as long as you keep the number of different
technos down to a bare minimum.

 Davy.


*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*


On Mon, Apr 3, 2017 at 11:44 PM, David Connors  wrote:

>
>
> On Tue, 4 Apr 2017 at 05:57 Greg Keogh  wrote:
>
>>
>> Don't laugh, I was mentally caught up in the "fad" of SPAs, probably
>> because there are so many articles, meetups and discussions of the subject
>> around me.
>>
>
> I personally can't wait to see the MVC versions of Google Maps and GMail.
>
> David.
>
> --
> David Connors
> da...@connors.com | @davidconnors | LinkedIn | +61 417 189 363
>


[Advice] Xamarin as a next step.

2017-03-13 Thread David Rhys Jones
Hi,

I'm currently working on Web aps, using javascript / angular / c# back ends
with sql.

I've been doing c# since it was in beta 1, javascript since the last
centurary and angular since monday ;-)

My manager now wants me to learn Xamarin, but I don't feel confortable
doing mobile apps etc.

How stable is the technology, should I buckle down and learn it, or should
I start looking for another job?

Thanks.

Davy

*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*


Re: Client-side data into asp.net post

2017-01-23 Thread David Rhys Jones
Of course the "correct" way to do this, is install a number of javascript
packages, some NPM, grunt, gulp and 30+ other incompatible things that you
don't need.

;-)

Davy


*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*


On Mon, Jan 23, 2017 at 6:11 AM, Greg Keogh  wrote:

> . hooking into the form submit event (javascript) and appending any number
>> of hidden input fields...
>>
>
> That's not quite what I'm doing, but I think I've cracked it anyway. I
> tried various asp.net controls to hold the client-side value, Label,
> TextBox and HiddenField, with different properties like innerHTML, value,
> etc. The correct combination is this:
>
> JS
> var ctl = document.getElementById("hiddenIdCtl");
> ctl.value = id;  // The value the script extracted
>
> C#
> string id = hiddenCtl.Value;
>
> Only this combination works -- *Greg*
>


Re: [OT] node.js and express

2016-11-21 Thread David Rhys Jones
I follow a number of CSS and javascript blogs, the boss thinks it's so I
can stay ahead of the wave. The real reason is it gives me a chuckle every
day when they try to solve a problem that they themselves inflicted by
using a precompiler/framework that wasn't really needed in the first place.

A colleague is currently trying to implement a work around on a problem
that is related to Less and knockout. Take a look at the less home page and
see how they changed 3 lines of CSS into a whole mess of pre-compiler crap.


*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*


On Tue, Nov 22, 2016 at 12:13 AM, DotNet Dude  wrote:

>
> On Tue, Nov 22, 2016 at 9:43 AM, David Connors  wrote:
>
>> 80% of the cost of an application starts after you finish dev and a well
>> written modern, responsive web app costs very little to maintain (and works
>> on all the things both network and device).
>>
>
>>
> Not in my experience. I'm yet to see one of these well written modern
> responsive web apps you speak of. We normally get hired to go in and fix
> the mess left by devs learning on the job. We also can't really blame the
> devs for everything as with all the new frameworks and such coming out each
> week (slight exaggeration) they are always learning on the job and can't be
> expected to write good stuff.
>
>


Re: [OT] node.js and express

2016-11-21 Thread David Rhys Jones
I agree completely,

where's the like/up rep button for you Dr Greg?


*... .. /  --- -.-. / .-.. . --. . .-. . / ... -.-. .. ... / -. .. --
.. ..- -- / . .-. ..- -.. .. - .. --- -. .. ... /  .- -... . ... .-.-.-*


On Mon, Nov 21, 2016 at 10:33 PM, Greg Low (罗格雷格博士) 
wrote:

> I’m simply amazed at what we’ve done to ourselves as an industry.
>
>
>
> I was on a project a while back. With 12 devs and 7 months’ work, the core
> business web app was created. The guys worked hard. At the end, they were
> still struggling to get it to look right on different browsers.
>
>
>
> But in the end, I looked at the outcome and knew in my heart that I could
> have created it as a winform app by myself in around a week.
>
>
>
> This is progress?
>
>
>
> We started building web apps because the IT people were fed up with trying
> to deploy Windows apps. It wasn’t because users were crying out for a lousy
> visual experience, and apps that throw away their work if they stop using
> them for the session timeout period.
>
>
>
> I think we “fixed” the wrong problem.
>
>
>
> Regards,
>
>
>
> Greg
>
>
>
> Dr Greg Low
>
>
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913
> fax
>
> SQL Down Under | Web: www.sqldownunder.com | http://greglow.me
>
>
>
> *From:* ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-bounces@
> ozdotnet.com] *On Behalf Of *Stephen Price
> *Sent:* Monday, 21 November 2016 6:59 PM
> *To:* ozDotNet 
> *Subject:* Re: [OT] node.js and express
>
>
>
> Goodness, you are not alone.
>
> I'm more surprised that you are surprised, that's all.
>
>
>
> Some links to confirm you are not alone (and some funny, cause it's true,
> reading)
>
> https://hackernoon.com/how-it-feels-to-learn-javascript-in-
> 2016-d3a717dd577f#.cdvrepjwi
>
>
>
> https://medium.com/@wob/the-sad-state-of-web-development-
> 1603a861d29f#.kqtp9oyq6
>
>
>
> There was a hilarious one written by a Java developer where she all but
> dissolved in tears and screaming... but I can't find it right now. Funny
> because it was pretty spot on, not because a poor soul was suffering.
>
>
>
> If this shit was easy, everyone would be doing it. There's job security in
> the pain, somewhere.
>
>
>
> cheers
>
> Stephen
>
> p.s. All opinions and beliefs are my own. I'm not sure how they came to
> be, for that I can only blame those I've hung around, in real life and
> online.
> --
>
> *From:* ozdotnet-boun...@ozdotnet.com  on
> behalf of Greg Keogh 
> *Sent:* Monday, 21 November 2016 2:48:54 PM
> *To:* ozDotNet
> *Subject:* Re: [OT] node.js and express
>
>
>
>
>
> You're not alone Greg. It's like going back to spaghetti but everyone
> around me doesn't agree.
>
>
>
> Thanks heavens someone is sympathetic. I thought I was crazy, but I'm glad
> to know you are too! -- *Greg*
>


Re: Entity Framework - the lay of the land

2016-09-21 Thread David Rhys Jones
>> SQL Functions suck. Oh my, they suck and they are hard to fix and
cumbersome to figure out where perf is bad.

I agree, don't use SQL functions in where clauses, joins or aggregates.
It's ok to use if you have a small dataset but otherwise  steer clear.

Davy


*Si hoc legere scis nimium eruditionis habes*.


On Wed, Sep 21, 2016 at 2:22 PM, Corneliu I. Tusnea 
wrote:

> I'll jump in with my experience (just last year).
> Using EF7 (EF Core 1.0 now?)
>
> I always disliked EF version but I liked the original Linq2Sql which was
> quite lightweight compared to EF.
>
>1. Database design and DTO design is very very strictly monitored and
>mapping Table > Entity is very strict with only the exact fields required.
>2. I find EF perfect for most simple reads of data as long as I don't
>have to join or simple very exact joins. Yes, I know Dapper and PetaPoco
>but heck, I really don't want to maintain strings.
>3. Views rule. Whenever we need more complicated data we do it in a
>view. We can review, optimize and tweak that as needed.
>4. SPs rock. Same as above, any work that can be moved in an SP is
>done in an SP (very few scenarios in our case)
>5. SQL Functions suck. Oh my, they suck and they are hard to fix and
>cumbersome to figure out where perf is bad.
>6. And most importantly. SQL is long-term-storage NOT the source of
>truth. We use Akka and we (now) consider SQL as eventual storage of data.
>Everything we do is in memory and whenever we have a chance we'll tell SQL
>about it (mostly so after a restart we can start with the data from SQL).
>You want to save some settings? Sure, it's in memory and hey sql, here is
>an update. Want to read a setting? It's in memory no need to ask SQL about
>it.
>
> I think EF7 (as I said previous versions were garbage), like every other
> technology can be abused.
> The problem is that it can be abused way to easily.
> Teams use it and abuse it instead of understanding the synergy that needs
> to exist and where the power EF offers should be used.
>
> My 2 cents,
> Corneliu.
>
>
>
>
>
>
>
> On Tue, Sep 20, 2016 at 9:06 PM, Tony McGee  wrote:
>
>> Oh boy, this is a technique I see way underutilised when using EF:
>>
>>
>> *All objects from EF were transformed into new objects for use in the
>> website *e.g. If I just want a high level list of the product categories
>> a customer has purchased, it's far too easily get stuck in a rigid thought
>> pattern due to the object model. It says I need a Customer that has an
>> Orders collection each having a set of Line Items, dollar values,
>> quantities, special delivery instructions, product names, descriptions,
>> packaging dimensions, blah, blah, blah NO.
>> Bringing the whole database across the wire and aggregating in
>> application memory is inviting a world of pain.
>>
>> An EF query projection containing the customer id/name and product
>> category name could avoid a huge complicated SELECT * across six different
>> table joins that becomes impossible to index.
>>
>>
>>
>>
>> On 20/09/2016 19:20, David Rhys Jones wrote:
>>
>>
>> I've been working with EF now for a few years,  here's a list of what
>> went wrong / what went right.
>>
>> *Large public Website*
>>
>> *Good:*
>> No complex queries in EF, anything more than a couple of tables and a
>> stored procedure is called.
>> All objects from EF were transformed into new objects for use in the
>> website
>> *Bad:*
>>The context was shared between processes and thusly began to grow
>> after an hour or two, causing a slowdown of EF. Regular flushing solved this
>>   Updates into the database set the FK property but did not attach the
>> object, this resulted in data being correct for a moment, but then
>> overwritten with the original values when the savechanges was called.
>>
>>
>> *Large Multinational Bank - Bulk Processing*
>>*Good:*
>>Most processing was done without EF,
>>   The website used EF to query the same data.
>>*Bad:*
>>Framework implemented IEnumerable as each interface, thus
>> service.GetClients().Count()  resulted in the entire table being returned.
>> Changing the interface to IQueryable allowed the DB to do a count(*)
>>
>> *Large Multinational,  low use public website. *
>>*Good:*
>>   EF context is queried and disposed of as soon as possible, leaving
>> the website responsive
>>*Bad:*
>>  Bad design of the

Re: Entity Framework - the lay of the land

2016-09-20 Thread David Rhys Jones
I agree that it's a call that you don't need if you are sure that the
object that you have now has not been updated by someone else.

However even if I was updating via an SQL Statement (SP or inline) then I
would do a select to get the updated line back from the database,
especially if it wasn't an update but rather an insert.
The problem is always how stale your data is, by forcing the update before
the insert you are sure that you have all the latest information before the
update.

Davy



*Si hoc legere scis nimium eruditionis habes*.


On Tue, Sep 20, 2016 at 12:27 PM, Greg Low (罗格雷格博士) 
wrote:

> But if you know the ID of something and you want to update it, why do a
> round trip to read it first, then to do another round trip to update it
> like you could have in the first place?
>
>
>
> Regards,
>
>
>
> Greg
>
>
>
> Dr Greg Low
>
>
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913
> fax
>
> SQL Down Under | Web: www.sqldownunder.com | http://greglow.me
>
>
>
> *From:* ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-bounces@
> ozdotnet.com] *On Behalf Of *David Rhys Jones
> *Sent:* Tuesday, 20 September 2016 8:03 PM
>
> *To:* ozDotNet 
> *Subject:* Re: Entity Framework - the lay of the land
>
>
>
>
>
> That's still the best way to update something
>
>
>
> Get the object first, then update that reference, instead of trying to
> attach a new object with the same Id.
>
>
>
> There is a performance hit, but you are updating it's not needed to be
> quick. If your requirement is speed when updating, then you shouldn't be
> using EF.
>
>
>
> Davy
>
>
>
>
> *Si hoc legere scis nimium eruditionis habes*.
>
>
>
>
>
> On Tue, Sep 20, 2016 at 11:53 AM, Greg Low (罗格雷格博士) 
> wrote:
>
> Have they fixed the update situation yet? I remember that you had to
> select something before you could update it. (At least previously)
>
>
>
> Regards,
>
>
>
> Greg
>
>
>
> Dr Greg Low
>
>
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913
> fax
>
> SQL Down Under | Web: www.sqldownunder.com | http://greglow.me
>
>
>
> *From:* ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-bounces@
> ozdotnet.com] *On Behalf Of *David Rhys Jones
> *Sent:* Tuesday, 20 September 2016 7:20 PM
> *To:* ozDotNet 
> *Subject:* Re: Entity Framework - the lay of the land
>
>
>
>
>
> I've been working with EF now for a few years,  here's a list of what went
> wrong / what went right.
>
>
>
> *Large public Website*
>
>
>
> *Good:*
>
> No complex queries in EF, anything more than a couple of tables and a
> stored procedure is called.
>
> All objects from EF were transformed into new objects for use in the
> website
>
> *Bad:*
>
>The context was shared between processes and thusly began to grow after
> an hour or two, causing a slowdown of EF. Regular flushing solved this
>
>   Updates into the database set the FK property but did not attach the
> object, this resulted in data being correct for a moment, but then
> overwritten with the original values when the savechanges was called.
>
>
>
>
>
> *Large Multinational Bank - Bulk Processing*
>
>*Good:*
>
>Most processing was done without EF,
>
>   The website used EF to query the same data.
>
>*Bad:*
>
>Framework implemented IEnumerable as each interface, thus
> service.GetClients().Count()  resulted in the entire table being returned.
> Changing the interface to IQueryable allowed the DB to do a count(*)
>
>
>
> *Large Multinational,  low use public website. *
>
>*Good:*
>
>   EF context is queried and disposed of as soon as possible, leaving
> the website responsive
>
>*Bad:*
>
>  Bad design of the database has resulted in needless queries bringing
> back data that is not used. All EF generated queries are complicated.
>
>  A mixture of stored procedures and EF context is used within a
> process resulting in incorrect values.
>
>
>
>
>
> I quite like EF, it's efficient to write queries in if you know what is
> being generated at the database level. I always output the SQL query to the
> debug window so I know what is being passed to the DB.
>
> But if the query is not self-contained and requires a lot of tables, then
> a specific stored procedure should be used.  However, do not update with a
> stored procedure if you are using Entity to read back the values. Do POCO
> updates and read the linked objects and attach them correctly.
>
>
>

Re: Entity Framework - the lay of the land

2016-09-20 Thread David Rhys Jones
That's still the best way to update something

Get the object first, then update that reference, instead of trying to
attach a new object with the same Id.

There is a performance hit, but you are updating it's not needed to be
quick. If your requirement is speed when updating, then you shouldn't be
using EF.

Davy


*Si hoc legere scis nimium eruditionis habes*.


On Tue, Sep 20, 2016 at 11:53 AM, Greg Low (罗格雷格博士) 
wrote:

> Have they fixed the update situation yet? I remember that you had to
> select something before you could update it. (At least previously)
>
>
>
> Regards,
>
>
>
> Greg
>
>
>
> Dr Greg Low
>
>
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913
> fax
>
> SQL Down Under | Web: www.sqldownunder.com | http://greglow.me
>
>
>
> *From:* ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-bounces@
> ozdotnet.com] *On Behalf Of *David Rhys Jones
> *Sent:* Tuesday, 20 September 2016 7:20 PM
> *To:* ozDotNet 
> *Subject:* Re: Entity Framework - the lay of the land
>
>
>
>
>
> I've been working with EF now for a few years,  here's a list of what went
> wrong / what went right.
>
>
>
> *Large public Website*
>
>
>
> *Good:*
>
> No complex queries in EF, anything more than a couple of tables and a
> stored procedure is called.
>
> All objects from EF were transformed into new objects for use in the
> website
>
> *Bad:*
>
>The context was shared between processes and thusly began to grow after
> an hour or two, causing a slowdown of EF. Regular flushing solved this
>
>   Updates into the database set the FK property but did not attach the
> object, this resulted in data being correct for a moment, but then
> overwritten with the original values when the savechanges was called.
>
>
>
>
>
> *Large Multinational Bank - Bulk Processing*
>
>*Good:*
>
>Most processing was done without EF,
>
>   The website used EF to query the same data.
>
>*Bad:*
>
>Framework implemented IEnumerable as each interface, thus
> service.GetClients().Count()  resulted in the entire table being returned.
> Changing the interface to IQueryable allowed the DB to do a count(*)
>
>
>
> *Large Multinational,  low use public website. *
>
>*Good:*
>
>   EF context is queried and disposed of as soon as possible, leaving
> the website responsive
>
>*Bad:*
>
>  Bad design of the database has resulted in needless queries bringing
> back data that is not used. All EF generated queries are complicated.
>
>  A mixture of stored procedures and EF context is used within a
> process resulting in incorrect values.
>
>
>
>
>
> I quite like EF, it's efficient to write queries in if you know what is
> being generated at the database level. I always output the SQL query to the
> debug window so I know what is being passed to the DB.
>
> But if the query is not self-contained and requires a lot of tables, then
> a specific stored procedure should be used.  However, do not update with a
> stored procedure if you are using Entity to read back the values. Do POCO
> updates and read the linked objects and attach them correctly.
>
>
>
> Davy.
>
>
>
>
>
>
> *Si hoc legere scis nimium eruditionis habes*.
>
>
>
>
>
> On Tue, Sep 20, 2016 at 10:03 AM, David Connors  wrote:
>
> On Tue, 20 Sep 2016 at 13:59 Greg Low (罗格雷格博士)  wrote:
>
> I often get coy when I hear comparisons with Stack Overflow, Twitter,
> Facebook, Blog Engines, etc. though.
>
> Most of those platforms are happy to just throw away transactions when the
> going gets heavy.
>
> Also, most of their workloads are read-only and so highly cacheable at
> every layer of whatever architecture you choose.
>
>
>
> Once you throw consistency and transaction isolation under the bus shit
> gets pretty easy pretty quick.
>
>
>
> David.
>
>
>
> --
>
> David Connors
> da...@connors.com | @davidconnors | LinkedIn | +61 417 189 363
>
>
>


Re: Entity Framework - the lay of the land

2016-09-20 Thread David Rhys Jones
I've been working with EF now for a few years,  here's a list of what went
wrong / what went right.

*Large public Website*

*Good:*
No complex queries in EF, anything more than a couple of tables and a
stored procedure is called.
All objects from EF were transformed into new objects for use in the
website
*Bad:*
   The context was shared between processes and thusly began to grow after
an hour or two, causing a slowdown of EF. Regular flushing solved this
  Updates into the database set the FK property but did not attach the
object, this resulted in data being correct for a moment, but then
overwritten with the original values when the savechanges was called.


*Large Multinational Bank - Bulk Processing*
   *Good:*
   Most processing was done without EF,
  The website used EF to query the same data.
   *Bad:*
   Framework implemented IEnumerable as each interface, thus
service.GetClients().Count()  resulted in the entire table being returned.
Changing the interface to IQueryable allowed the DB to do a count(*)

*Large Multinational,  low use public website. *
   *Good:*
  EF context is queried and disposed of as soon as possible, leaving
the website responsive
   *Bad:*
 Bad design of the database has resulted in needless queries bringing
back data that is not used. All EF generated queries are complicated.
 A mixture of stored procedures and EF context is used within a process
resulting in incorrect values.


I quite like EF, it's efficient to write queries in if you know what is
being generated at the database level. I always output the SQL query to the
debug window so I know what is being passed to the DB.
But if the query is not self-contained and requires a lot of tables, then a
specific stored procedure should be used.  However, do not update with a
stored procedure if you are using Entity to read back the values. Do POCO
updates and read the linked objects and attach them correctly.

Davy.



*Si hoc legere scis nimium eruditionis habes*.


On Tue, Sep 20, 2016 at 10:03 AM, David Connors  wrote:

> On Tue, 20 Sep 2016 at 13:59 Greg Low (罗格雷格博士)  wrote:
>
>> I often get coy when I hear comparisons with Stack Overflow, Twitter,
>> Facebook, Blog Engines, etc. though.
>>
>> Most of those platforms are happy to just throw away transactions when
>> the going gets heavy.
>>
> Also, most of their workloads are read-only and so highly cacheable at
> every layer of whatever architecture you choose.
>
> Once you throw consistency and transaction isolation under the bus shit
> gets pretty easy pretty quick.
>
> David.
>
> --
> David Connors
> da...@connors.com | @davidconnors | LinkedIn | +61 417 189 363
>


Re: Xamarin phone targets

2016-08-25 Thread David Rhys Jones
My windows phone runs 8.1 and it's not compatible with windows 10 so don't
believe that statement. Also you are reliant on the carrier to allow you to
update the OS, which many don't.

But the market share of windows phones is so low it's hardly worth
supporting. Especially when the phones you are targeting now will be
obsolete in two years.

02c



*Si hoc legere scis nimium eruditionis habes*.


On Thu, Aug 25, 2016 at 5:31 AM, Greg Keogh  wrote:

> After a fair amount of searching I found the extract below. The
> highlighted bit about automatic upgrades to Windows 10 surprised me, is it
> happening already, or when will it happen? So I guess the choice about
> writing a Windows phone app in Silverlight or UWP comes down to what the
> app potential user's might own -- *GK*
>
> 
>
> If you want to create a single app that targets the full breadth of
> Windows 10 devices, create a universal Windows app. You’ll design the app
> by using a single project and your pages will render properly no matter
> what device is used to view them.
>
> Start with a universal Windows app project template. Design your pages
> visually, and then open them in a preview window to see how they appear for
> various types of devices. If you don’t like how a page appears on a device,
> you can optimize the page to better fit the screen size, resolution, or
> various orientations such as landscape or portrait mode. You can do all of
> that by using intuitive tool windows and easily accessible menu options in
> Visual Studio. When you’re ready to run your app and step through your
> code, you’ll find all of the device emulators and simulators for different
> types of devices together in one drop-down list that is located on the
> *Standard* toolbar.
>
> Windows 10 is fairly new, so you’ll also find project templates that
> target Windows 8.1. You can use those project templates if you want and
> your app will run on Windows 10 phones, tablets, and PCs. However, all
> devices that run Windows 8.1 will receive an automatic upgrade to Windows 10,
> so unless you have specific reasons why you’d rather target Windows 8.1, we
> recommend that you use the project templates that target Windows 10.
>
> On 25 August 2016 at 12:18, Greg Keogh  wrote:
>
>> Folks, a new cross-platform Xamarin project in VS2015 gives you projects
>> including UWP and Windows Phone 8.1. I'm not sure which of these I should
>> use to continue and develop an app that includes Windows phones as a target
>> device. I'm not sure if the 8.1 Silverlight target is now obsolete and I
>> should use the UWP project specifically configured for phone devices. To
>> further confuse me, I'm not sure which generation of devices are support by
>> which projects, so for example would a UWP target only work for very recent
>> phones?
>>
>> Can anyone clarify the relationship between the phone devices, their OSs
>> and Xamarin project target types?
>>
>> Thanks
>> *Greg K*
>>
>
>


Re: Training/Mentoring a developer who doesn't seem to use many modern development productivity tools

2016-07-19 Thread David Rhys Jones
In the last few contracts that I have done, they all used resharper, and in
this current one they don't. The only thing that I am missing is the rename
function, it's much harder to use the stock visual studio one.

Codemaid has become my favorite productivity tool,  if you can convince
your team to use it, the auto format / rearrange on save is great.
I also try and push the Micrsofot Analysers and CodeCracker analysers.
It's so much nicer to read code that you haven't written when everyone
codes exactly the same way.
.02c


*Si hoc legere scis nimium eruditionis habes*.


On Tue, Jul 19, 2016 at 9:40 AM, Tom Rutter  wrote:

> I must be the only one that uses the toolbars still. Never used resharper
> either. I may be missing out
>
>
> On Tuesday, 19 July 2016, Preet Sangha  wrote:
>
>> Thankyou.  I'm giving her the benefit of the doubt for the time being.
>> But I'll take your advice for my self too. Funny I can't recall the last
>> time I used a toolbar in vs but for some reason I've never switched them
>> off.
>>
>> On 19/07/2016 7:10 pm, "Wallace Turner"  wrote:
>>
>>>
>>>
>>> >>Yeah I reckon I must be bombarding her - I'll ease up a bit.
>>>
>>> I don't know all the details but someone (especially as a programmer)
>>> should know their own shortcomings (eg, oh i can't believe i was doing it
>>> that way!) and be doing everything possible to get up to speed otherwise I
>>> would question the quality of the person as a programmer.
>>>
>>> As for addressing the problem I find learning all the resharper
>>> shortcuts vital - not learning them by heart perhaps but going thru them
>>> one at a time, looking at how you would normally select/highlight/refactor
>>> something and see how much quicker it is with R#
>>>
>>>
>>> https://www.jetbrains.com/resharper/docs/ReSharper_DefaultKeymap_VSscheme.pdf
>>>
>>> Also get rid of ALL the menu bars in visual studio
>>>
>>>
>>> On Tue, Jul 19, 2016 at 12:55 PM, Tom Rutter 
>>> wrote:
>>>
 Yeap I like this idea. Just watching videos with lots of shortcuts gets
 old real quick. Good luck and let us know how it goes, I'm curious how it
 works out.


 On Tuesday, 19 July 2016, Preet Sangha  wrote:

> This is what I've been trying to do this past week. Yeah I reckon I
> must be bombarding her - I'll ease up a bit.
>
> Thanks
>
>
> On 19 July 2016 at 16:16, DotNet Dude  wrote:
>
>> I'd prioritise the most productive tools/keystrokes in terms of
>> productivity and have her do some pair programming. You or someone else 
>> who
>> sits with her can occasionally ask her to use some shortcuts. Just don't
>> bombard her with shortcuts as she won't absorb them. One or two per pair
>> session should help a lot.
>>
>> On Tuesday, 19 July 2016, Preet Sangha  wrote:
>>
>>> Guys I wonder if I can ask for some advice please.
>>>
>>> I'm currently leading a project with a developer who originally came
>>> from a Delphi background but has been using visual studio (C++ and C#) 
>>> for
>>> a few years now. However I'm finding that she doesn't seem to have much
>>> experience of many of the productivity features available in modern 
>>> tools
>>> like visual studio, or the OS or office for instance.
>>>
>>>
>>> By these I mean even simple things like autoformating, intellisense
>>> (well some), keystrokes to comment/uncomment, snippets, or  refactoring 
>>> for
>>> instance. I even had to teach her to do auto build on starting execution
>>> (PF5 etc), or to use the keyboard to save or build. Things like 
>>> resharper
>>> are a pipe dream it seems. I felt as though I was doing magic 
>>> incantations
>>> when I started writing some unit tests... Nearly everything she does is
>>> sort of 'most manual way possible" it sometimes seems.
>>>
>>> Now generally I'm happy to let other do it their way but I find that
>>> her productivity is very low and I'm thinking part of it might be this
>>> factor. I know we all have different styles, and I'm far from dictating
>>> other use my style however I do feel that a modern developer should be
>>> aware of the capabilities of their development environments.  If her
>>> productivity was OK I wouldn't care how she used whatever tool.
>>>
>>> What I'd like to do is encourage her to do some directed training
>>> that would help her productivity and thus personal development. I've 
>>> tried
>>> putting together some Pluralsight (it's paid for by our employers so 
>>> it's
>>> always there) playlists for her, but I get the "I did some of the 
>>> training,
>>> and then stopped to get some work done". I've been more than happy for 
>>> her
>>> to actually do the courses lowering the workload for this reason.
>>>
>>> I'd really like her to get the best out of her tools and not be
>>> hamstrung. Can 

Re: REST calling REST

2016-06-21 Thread David Rhys Jones
Hi
I run across this sort of oddity regulaly
I've just started a project to support an existing system, I recently came
across a DB call that was wrapped in an async await call, I found that it
was throwing exceptions 2 /3 of the time.

I removed the async await, and the pallalel foreach to populate the
objects, and all was working correctly and running 2 seconds faster, the
website already calls the service async with ajax.
I'm against using async calls inside server code when accessing outside
resources. If the process is too long then it needs refactoring to simplify
the call.

.02c
Davy



*Si hoc legere scis nimium eruditionis habes*.


On Tue, Jun 21, 2016 at 4:42 AM, Greg Keogh  wrote:

> Are the calls on the same server? If so remove the async await, from the
>> call and try again, did you get an error?
>>
>
> Yesterday I gave up and used a synchronous WebClient.DownloadString inside
> the WebApi controller and it worked fine.
>
> Today as an experiment I rejigged the code a bit. I made the controller
> method async Task and inside it I created two Task using
> await WebRequest Task.Factory.FromAsync(beginxx,endxx). I did a WhenAll on
> the two tasks and they all worked fine.
>
> One call was to localhost where I was debugging and the other to a remote
> server. So today this has disproved my theory (like you had) that debugging
> and calling localhost was a problem. Today it all just works!
>
> It opens up philosophical questions about where in the WebApi call stack
> should the asynchrony start and stop. Web searches find lots of often
> contradictory arguments and advice on this matter.
>
> *GK*
>


Re: [ot] upgrading to windows 10

2016-03-02 Thread David Rhys Jones
i've got a windows 10 laptop so I'm familiar with the desktop, it's the
upgrade process that I'm worried about, from past experience it never goes
well.



*Si hoc legere scis nimium eruditionis habes*.


On Thu, Mar 3, 2016 at 12:04 AM, Greg Keogh  wrote:

> Hey guys
>> Anyone got any advice on upgrading windows 7 to windows 10?
>>
>
> Went through the whole process two weekends ago, but on the desktop only
> with my developer's hat on (I have only used Win10 on a tablet for about 5
> minutes). Some non-techie friends just look at it and go "it's sort of
> prettier isn't it, but where are my programs?" I explain the Start bar menu
> and tiles to them and off they go, and that's about it, they don't care
> about anything else.
>
> As a power Win10 desktop user, I find Wi10 to be Win7 with more pretty
> clutter to get in the way of what you want to actually do. Internally they
> both feel about the same and all of my old apps installed and ran okay. But
> everything takes more clicks and more navigation to find and run quickly in
> Win10. I spent hours and hours stripping Win10 back to look and feel like
> Win7. And I must stress that I didn't do that out of spite, or because I
> resist change ... I did it because I had to! Win10 contains so much
> worthless garbage and clutter that I had to strip it out to keep my
> productivity up. All tiles, flat apps, superfluous icons, wallpaper,
> plug-ins, Cortana, etc ... all erased or hidden. I've pinned the dozen apps
> I use every day to the start bar and I'm back to working normally. So the
> big question is ... why did I do that? Why was it necessary? I'm not the
> only one. Somebody in the marketing and art departments that produce Win10
> must be slightly askew to reality. Win10 feels a bit like an unfinished
> iMac.
>
> So overall, I think you'll have little technical trouble going from 7 to
> 10, but as a power user I guess you'll spend a bit of time tweaking the
> desktop to your liking, as I did.
>
> *GK*
>


Re: [OT] New laptop

2015-11-30 Thread David Rhys Jones
On a bit of a tangent, I started a new job a couple of weeks ago and was
given a Dell Inspiron 7000, with windows 10 installed.  It was randomly
resetting, locking up or keys stopped working. I searched on the web for
solutions and came up with graphic card drivers as the cause, it wasn't

Eventually I installed a personal copy of Norton on my work machine, it
found 20+ viruses non of which Defender had caught. Then I ran this script
to clean up the image.

fsutil resource setautoreset true c:\&fsutil usn deletejournal /d /n
c:&Dism.exe /online /Cleanup-Image /StartComponentCleanup&&sfc
/scannow&Dism.exe /Online /Cleanup-Image /RestoreHealth&sfc
/scannow&Dism.exe /Online /Cleanup-Image /StartComponentCleanup
/ResetBase&pause

After that it's been a joy to use.

Davy.


*Si hoc legere scis nimium eruditionis habes*.


On Wed, Nov 25, 2015 at 2:14 AM, Tom Rutter  wrote:

> Any updates on the surface book guys? Any deal breakers pop up? I'm
> probably going to put in an order today and break the bank so thought I'd
> check one last time just in case lol
>
> On Tue, Nov 17, 2015 at 10:45 AM, Stephen Price  > wrote:
>
>> Still early days but so far it's the best laptop I've owned. Ever.
>>
>> On Tue, 17 Nov 2015 at 9:33 AM, Tom Rutter  wrote:
>>
>>> Have any devs here had a play with the surface book yet? Thoughts?
>>>
>>> On Wed, Oct 7, 2015 at 8:18 PM, DotNet Dude 
>>> wrote:
>>>
 In case anyone here hasn't heard yet and is interested the new Surface
 Book will apparently be available in Oz on Nov 12th. Looks to be expensive
 though

 On Thu, Sep 24, 2015 at 10:10 AM, DotNet Dude 
 wrote:

> I also read somewhere next version of Surface Pro likely to be
> announced oct 6 so anyone interested may want to wait to see what happens
> there
>
>
> On Thursday, 24 September 2015, Ken Schaefer 
> wrote:
>
>> Microsoft are going to start offering Signature editions via their
>> new stores in Aus (first one opening soon-ish in Sydney). They might 
>> offer
>> the same online I guess, once the store opens.
>>
>>
>>
>>
>>
>>
>>
>> *From:* ozdotnet-boun...@ozdotnet.com [mailto:
>> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Tom Rutter
>> *Sent:* Wednesday, 23 September 2015 3:57 PM
>> *To:* ozDotNet 
>> *Subject:* Re: [OT] New laptop
>>
>>
>>
>> Any things to look out for if I buy direct from US? I've always
>> purchased locally
>>
>>
>>
>> On Fri, Aug 28, 2015 at 2:31 PM, Eddie de Bear (Gmail) <
>> eddie.deb...@gmail.com> wrote:
>>
>> The Signature Editions are the exact same machines (HP, Lenovo, etc)
>> BUT stripped bare of all the crapware.. From what I remember reading when
>> Microsoft first started with them, it’s a clean windows install, with all
>> the correct tweeks, drivers etc to get the most out of the hardware..
>>
>>
>>
>> Here is a link to their US store:
>> http://www.microsoftstore.com/store/msusa/en_US/cat/categoryID.69916600
>>
>>
>>
>>
>>
>> *From:* ozdotnet-boun...@ozdotnet.com [mailto:
>> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *mike smith
>> *Sent:* Friday, 28 August 2015 2:11 PM
>> *To:* ozDotNet 
>> *Subject:* Re: [OT] New laptop
>>
>>
>>
>> On Fri, Aug 28, 2015 at 10:44 AM, Eddie de Bear (Gmail) <
>> eddie.deb...@gmail.com> wrote:
>>
>> This is where Microsoft could really make a difference, if they would
>> stop thinking about just the US and make the Signature Edition 
>> laptops/PCs
>> available in Australia…
>>
>>
>>
>> Do they make them (or rebadge) ?  If the former, whose their
>> manufacturer?
>>
>>
>>
>>
>>
>> *From:* ozdotnet-boun...@ozdotnet.com [mailto:
>> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Thomas Koster
>> *Sent:* Friday, 28 August 2015 10:09 AM
>> *To:* ozDotNet 
>> *Subject:* Re: [OT] New laptop
>>
>>
>>
>> On 27 August 2015 at 19:28,  wrote:
>>
>> What’s peoples views on Lenovo ATM given there have been a few PR
>> things happen in the last 12 months…? price v performance v reliability?
>>
>>
>>
>> Are you talking about Superfish?
>>
>>
>>
>>
>> http://arstechnica.com/security/2015/02/lenovo-pcs-ship-with-man-in-the-middle-adware-that-breaks-https-connections/
>>
>>
>>
>> Consider how this could have happened and all the people who would
>> have had to sign off on this. I'll let people make up their own minds 
>> about
>> the competence and trustworthiness of Lenovo...
>>
>>
>>
>> --
>>
>> Thomas Koster
>>
>>
>>
>>
>>
>>
>>
>> --
>>
>> Meski
>>
>>  http://courteous.ly/aAOZcv
>>
>>
>> "Going to Starbucks for coffee is like going to prison for sex. Sure,

[OT]Work in Sydney.

2015-09-17 Thread David Rhys Jones
Hi all
I've got a colleague who is moving to Sydney next wednesday to start his
visa process.

Does anyone know of .Net positions that are open?

Thanks
Davy


*Si hoc legere scis nimium eruditionis habes*.


Re: Odd text encoding

2015-09-10 Thread David Rhys Jones
I cant understand why they don't just store the XML in the ntext column
directly in the first place...
maybe someone was hoping that gzip run can save some size?

Re Davy:
>> There are also performance implications with binary data,
>I think its quite the contrary, there is an extra step involved going to &
from base64 and binary.

Database performance, high critical databases it's faster to write text
than binary, this might have changed with the last version of SQL but it
was true up until '2008

>> it's usually more secure to store as base64
>oh god not again. base64 is just a representation of the data in printable
ASCII characters. -  think binary (base2), hex (base8) :)
>base64 has absolutely nothing to do with security.

>if security is what you are after, use proper encryption such as AES on
the original data, then base64 the output if you need >to send/store as text

Completely missed my point, I'm not talking about encryption at all,  it's
more secure to store as base64, as you don't get problems trying to get the
data back out. Just that what you put in is what you are getting out,
without strange driver problems or Collation issues.

Davy.




*Si hoc legere scis nimium eruditionis habes*.


On Thu, Sep 10, 2015 at 12:00 PM, Nelson  wrote:

> I cant understand why they don't just store the XML in the ntext column
> directly in the first place...
> maybe someone was hoping that gzip run can save some size?
>
> Re Davy:
> >> There are also performance implications with binary data,
> I think its quite the contrary, there is an extra step involved going to &
> from base64 and binary.
>
> >> it's usually more secure to store as base64
> oh god not again. base64 is just a representation of the data in printable
> ASCII characters. -  think binary (base2), hex (base8) :)
> base64 has absolutely nothing to do with security.
>
> if security is what you are after, use proper encryption such as AES on
> the original data, then base64 the output if you need to send/store as text
>
>
>
> Nelson Chan
>
> On 10 September 2015 at 19:50, Davy Jones  wrote:
>
>> Probably because binary data was easy to put in and easy to get out, but
>> what you put in is not what you get out.
>> There are also performance implications with binary data, it's usually
>> more secure to store as base64 in a varchar(max) or text.
>> Absolutely no reason to store in an unicode column.
>> Davy
>>
>> Sent from my iPhone
>>
>> > On 10 Sep 2015, at 09:47, Greg Low (罗格雷格博士)  wrote:
>> >
>> > The data was stored by Biztalk, and of course it shoved binary data
>> into an ntext data type column. The next two questions are:
>> >
>> > 1. Why put base 64 encoded data into an ntext (unicode) column when
>> such a limited range of values can be generated?
>> > 2. Why use a deprecated data type (ntext) in the first place?
>> >
>> > I'm sure that both questions are above my paygrade :-)
>> >
>> > Regards
>> >
>> > Greg
>> >
>> > Dr Greg Low
>> > SQL Down Under
>> > +61 419201410
>> > 1300SQLSQL (1300775775)
>> >
>> >> On 10 Sep 2015, at 5:10 pm, Thomas Koster  wrote:
>> >>
>> >> It is strange that base-64 encoding is even used here at all. Surely
>> >> proper binary data types have been available in relational databases
>> >> since the dark ages?
>> >> --
>> >> Thomas Koster
>> >>
>> >>
>> >>> On 10 September 2015 at 16:40, Greg Low (罗格雷格博士) 
>> wrote:
>> >>> That was my first reaction too. Haven't spent time staring at base64
>> >>> encoding for a long time. Knew someone would recognise it though. The
>> brains
>> >>> trust comes through again!
>> >>>
>> >>> Regards
>> >>>
>> >>> Greg
>> >>>
>> >>> Dr Greg Low
>> >>> SQL Down Under
>> >>> +61 419201410
>> >>> 1300SQLSQL (1300775775)
>> >>>
>> >>> On 10 Sep 2015, at 3:55 pm, Stephen Price 
>> wrote:
>> >>>
>> >>> How did you get my Azure certificate? wtf??
>> >>>
>> >>> Seriously though, the trailing == on the end (plus the overall look)
>> makes
>> >>> it look exactly like an Azure publish certificate.
>> >>>
>>  On Thu, 10 Sep 2015 at 08:39 Greg Low (罗格雷格博士) 
>> wrote:
>> 
>>  Perfect thanks Thomas.
>> 
>>  I'll just have to add a base64 decode function and I should be fine.
>> 
>>  Regards,
>> 
>>  Greg
>> 
>>  Dr Greg Low
>> 
>>  1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676
>> 4913
>>  fax
>>  SQL Down Under | Web: www.sqldownunder.com
>> 
>>  -Original Message-
>>  From: ozdotnet-boun...@ozdotnet.com [mailto:
>> ozdotnet-boun...@ozdotnet.com]
>>  On Behalf Of Thomas Koster
>>  Sent: Thursday, 10 September 2015 10:33 AM
>>  To: ozDotNet 
>>  Subject: Re: Odd text encoding
>> 
>> > On 10 September 2015 at 10:21, Greg Low (罗格雷格博士) 
>> wrote:
>> > This one’s driving me crazy and I thought the brains trust might
>> have
>> > an idea.
>> >
>> > Here’s a value that’s stored in an ntext column in a SQL Server DB:
>> >
>> H4sIAAAEALVW0W7aMBT9lanvre0wBkN

MEF - Microsoft Extension Framework. Opinions requested.

2015-05-27 Thread David Rhys Jones
Hi all,

 I recently joined a new team and one of the Developpers is one of those
guys that likes to complicate things for the hell of it.

The current technology he is trying to push is  MEF (Extension Framework)
with every web page / section in a new plugin.

Can I have some opinions on what it's really like to use MEF.

Thanks
Davy

*Si hoc legere scis nimium eruditionis habes*.


Re: Peer-to-Peer

2015-04-27 Thread David Rhys Jones
I've looked at them before, expecting exactly the same thing as you Greg.

As far as I can tell, it still needs a central server to store the names.
So the point of all that horrible complexity escapes me.

I ended up scrapping everything that I had done with the p2p classes, and
wrote a small web service to cache the names.
My clients look for the web service in the local Ip address range and
connect to it. The actual p2p code that I wrote to do the communication
between processes was also scrapped and written as a web service that
stores messages and routes when the requesting client asks for information.
I'm still experimenting with it, at the moment I've got 4 raspberry pi's,
4x Windows PC and an old linux machine processing messages.



*Si hoc legere scis nimium eruditionis habes*.


On Mon, Apr 27, 2015 at 10:17 AM, Greg Keogh  wrote:

> I may be a bit slow this afternoon but what do you have (what sort of
>> clients and environment) and what do you want to do (have them chat?)?
>>
>
> I read a few pages of the P2P chapter and I realise that my original
> question is a bit wonky. The P2P classes do not provide a means of
> communication per se, they seem to be mostly related to registration and
> discovery, which is done through a Windows service. Peer apps register
> themselves with an ID, a port and a naming convention, then they can
> discover each other, but after that the ball is in your court.
>
> It looks like the P2P classes just help all the peers find each other,
> then it's up to you to use the port and ID you find to start communicating
> in an appropriate manner, whatever you choose that to be.
>
> So it doesn't really work the way I naively expected, and may not be
> appropriate for my simple needs of everyone broadcasting to everyone else
> (a kind of chat I guess!).
>
> However, I have more reading to go and if I find anything startling I'll
> let you know.
>
> *Greg K*
>


Re: Async'ing a library

2015-04-09 Thread David Rhys Jones
I've been playing with this idea.

A couple of things, I like it but.

If you put it in the business layer, the presentation layer is only going
to be calling one business method, so no benefit.
If you put it in the datalayer, then handling transactions can be a bit of
a nightmare.
So, I can't see a use for doing it this way, although I really do like the
idea.

On the upside I have found out a lot about the new parallel stuff in 4.5.

Davy.









*Si hoc legere scis nimium eruditionis habes*.


On Sat, Mar 28, 2015 at 5:32 AM, Stephen Price 
wrote:

> Yeah, generally speaking, if you think you understand something, you must
> have it wrong.
>
> Also, as soon as you comprehend something, someone will change it. Just
> assume you have no idea and be done with it. Run with it until someone
> complains about it. :)
>
> On Sat, Mar 28, 2015 at 12:17 PM, Greg Keogh  wrote:
>
>> Folks, I have an existing library with lots of traditional non-async
>> methods in it, and I want to provide async versions of the old methods.
>> Would you consider this to be a simple and trustworthy way of getting this
>> done?
>>
>> public Thing GetThing(int key)
>> {
>>   // This is the existing method
>>   return ...
>> }
>>
>> public Task GetThingAsync(int key)
>> {
>>   return Task.Run(() =>
>>   {
>>  return GetThing(key);
>>   }
>> }
>>
>> So I just make matching pairs where the old methods are just wrapped in
>> Task.Run(...). It seems too easy. This is Framework 4.5, and I have a vague
>> recall that Task.Run doesn't work this easily in 4.0 and it's a bit more
>> verbose.
>>
>> *Greg K*
>>
>
>


Re: [OT] Dev environment setup

2015-03-12 Thread David Rhys Jones
Hi,
I've tried VM's but mine is installed directly, Visual studio is such a
performance hog.


*Si hoc legere scis nimium eruditionis habes*.


On Thu, Mar 12, 2015 at 5:50 AM, Tom P  wrote:

> Hi
>
> How do the experienced devs here setup their personal laptops/desktops for
> development? Do you just install VS directly on the machine and not worry
> about it or use "virtual machines" (just learning these) to isolate the dev
> stuff? Any good reasons for the latter or simply do it as a "just in case"?
>
> --
> Thanks
> Tom
>


Re: [OT] Unbelievable ad tracking

2014-12-19 Thread David Rhys Jones
Was it an android?  It detects from surfing habits.  Google Now tells me
how congested the roads are on a friday night to the PUB!


*Si hoc legere scis nimium eruditionis habes*.


On Fri, Dec 19, 2014 at 9:31 AM, Tony Wright  wrote:
>
> You think that's bad. I bought a new phone and the next day it told me
> that it thinks it knows where I live. It was right. A little bit creepy...
> On 19/12/2014 7:19 pm, "Mark Thompson"  wrote:
>
>> Yep, had the same thing happen to me when I was looking at buying a
>> Surface a few months ago. Got ads for months afterwards. I find it ironic
>> that if you bought the product they are advertising, it is effectively a
>> waste of money for the advertiser continually bombarding you with ads for
>> something you already own.
>>
>> Welcome to the digital age - privacy is a luxury now!
>> --
>> From: Greg Keogh 
>> Sent: 19/12/2014 6:05 PM
>> To: ozDotNet 
>> Subject: [OT] Unbelievable ad tracking
>>
>> Folks, a couple of days ago I ran a Google search for a set of
>> fine-tipped pens, found them at Officeworks, and went down and bought them
>> (as well as some paper and other stuff). This evening I went to this web
>> page:
>>
>>
>> http://www.myerrorsandmysolutions.com/how-to-install-certificates-file-cer-on-microsoft-windows-phone-based-devices/
>>
>> In the middle of the page is a huge ad for the exact same pens that I
>> bought. The URL of the ad is (truncated):
>>
>> http://www.googleadservices.com/pagead/aclk? [cut] &adurl=
>> http://www.megaofficesupplies.com.au/pelikan-artline-draw-system-pen-6-nib-sizes-1-2-3-4-5-8-black-wallet-6/%3Fdfw_tracker%3D2252-8735
>>
>> I'm really, REALLY pissed off. I hate ads, I hate being tracked, I have a
>> tiny set of white-listed cookies, I erase my browsing history every few
>> days, and I didn't put anything that could identify me in any web pages in
>> the last few days. So how the f***nig hell is this possible?! This is
>> insidious, frightening and depressing.
>>
>> *Greg K*
>>
>


Re: [OT] Windows 10 Preview

2014-11-14 Thread David Rhys Jones
doesn't matter if you resize the command window you don't get more lines,
you have to change the buffer and width in the properties to make it work.


*Si hoc legere scis nimium eruditionis habes*.


On Fri, Nov 14, 2014 at 9:24 AM, Stephen Price 
wrote:

> Yes, I had a play. My favourite new feature was so small but oh, so big.
> Resizable cmd window. Its always been resizable in height but never width.
> I've looked for it with every windows release since windows 95. Only took
> 20 years. :)
>
> On Fri, Nov 14, 2014 at 2:43 PM, Greg Keogh  wrote:
>
>> Folks, I download the 3911MB WIndows 10 Technical Preview ISO and
>> installed it in VMware Player and it seems to be running quite well. The
>> first thing you notice of course is that it's returned to mostly using the
>> shell we're familiar with. Tile apps open full screen initially, but you
>> can mercifully size them the traditional way. The start menu is a blend of
>> the old with new live tiles, which is fancy looking but a bit of a gimmick.
>> The Start Menu is crammed with all the piffle that used to be on the old
>> welcome screen (News, Finance, Maps, etc) and there's no "Remove from this
>> menu" option. The strange thing is that the WIndows 8 tiled welcome screen
>> seems to have gone, it thought it would remain but just be buried slightly.
>>
>> Overall, it feels like Windows 7 blended with some flat tiled apps, but
>> oh lord it's better than Windows 8 where it was like two Siamese twin
>> operating systems stitched together. I could live and work on this, but as
>> a developer I'm biased and blinkered against seeing whatever new features
>> it might have that would attract the normal carbon blobs who would use it.
>> I haven't seen anything yet that makes me go wow! Anyone else had a bash at
>> it?
>>
>> *Greg K*
>>
>
>


Re: .NET Core is now open source

2014-11-14 Thread David Rhys Jones
You are forgetting the "Must have apple kit" to develop and compile, that
adds quite a bit more onto the $99.
The need to buy a mac just to write IPhone apps is what is stopping me from
doing so.
Davy.


*Si hoc legere scis nimium eruditionis habes*.


On Fri, Nov 14, 2014 at 9:56 AM, Michael Ridland  wrote:

>
> Ha ha you could never use Apple as a reference for being friendly To devs,
> in the early days of iOS their platform was hardly documented and ide
> absolute junk, then you couldn't even talk in public forums about anything.
> Swift was many many years overdue. Apple don't give a $&#& about
> developers, probably never will.
>
>
> On Friday, November 14, 2014, Stephen Price 
> wrote:
>
>> It's exciting. In comparison, to develop in the Apple world, you download
>> XCode for free, sign up to the Developer program ($99) and that's it.
>> Compare to Microsoft is somewhat more expensive. MSDN Ultimate is around
>> the $10K mark. The Visual Studio Community stuff is great to see. I'm
>> wondering what the difference will be between community versions and
>> enterprise versions.
>> As a solo developer will I be able to do everything with the community
>> versions? Open source is fantastic step but I am left wondering how
>> Microsoft will make money from that. Services, as someone else mentioned?
>>
>> The other advantage to making .Net open sourced is that more eyes will
>> view the code, resulting in better code. Microsoft do a great job improving
>> their code but imagine how much better it could be if you multiply the
>> number of people working on it! We all gain from this and is there a
>> downside? Not one I can think of...
>>
>> On Fri, Nov 14, 2014 at 2:58 PM, David Kean 
>> wrote:
>>
>>>  This is something that my immediate team has been pushing for a little
>>> while internally and finally announced yesterday:
>>> http://blogs.msdn.com/b/dotnet/archive/2014/11/12/net-core-is-open-source.aspx
>>> .
>>>
>>>
>>>
>>> This is going to be pretty massive for Microsoft and the community. It
>>> will be the biggest code base that we've open sourced and is one of the
>>> biggest changes I've seen in the ~13 years I've been using .NET (and now
>>> working on .NET).
>>>
>>>
>>>
>>> Thoughts?
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>


Re: 3d Trilateration

2014-10-20 Thread David Rhys Jones
Just for info I found a good implementation in python and converted that to
C#.

I can share if anyone has the same requirements in the future.

Davy.


*Si hoc legere scis nimium eruditionis habes*.


On Wed, Oct 8, 2014 at 3:11 PM, Davy Jones  wrote:

> Hi
>
> Yeah i've looked at that one before, my problem is 3d in a box not
> geolocation.  i'm currently trying to convert a java class but it's full of
> bugs. And trying to squash them.
>
> Davy
>
> Sent from my starfleet datapad.
>
> On 8 oct. 2014, at 13:58, Preet Sangha  wrote:
>
> have you hunted around gis.stackexchange.com
>
>
> http://gis.stackexchange.com/questions/66/trilateration-using-3-latitude-and-longitude-points-and-3-distances
>
> On 8 October 2014 04:54, David Rhys Jones  wrote:
>
>> Hi all,
>>
>> Does anyone have code / link to a library that can do 3d Trilateration?
>>
>> *I've been looking for the last hour, lots of theory and references to
>> matlab but nothing that looks like what I need.*
>>
>> *Thanks*
>> *Davy.*
>>
>> *Si hoc legere scis nimium eruditionis habes*.
>>
>>
>
>
> --
> regards,
> Preet, Overlooking the Ocean, Auckland
>
>


3d Trilateration

2014-10-07 Thread David Rhys Jones
Hi all,

Does anyone have code / link to a library that can do 3d Trilateration?

*I've been looking for the last hour, lots of theory and references to
matlab but nothing that looks like what I need.*

*Thanks*
*Davy.*

*Si hoc legere scis nimium eruditionis habes*.


Re: [ot] intranet

2014-07-28 Thread David Rhys Jones
Second one note,  I use a tablet and one note to take notes in meetings.
 I've tried using a wiki, but everyone in the team gave up on it after just
one week,

Davy

Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Mon, Jul 28, 2014 at 9:50 AM, Preet Sangha  wrote:

> One note.  All the richness of office with all the elegance of a wiki.
> On Jul 28, 2014 5:22 PM,  wrote:
>
>> Anyone have or use an internet system to record their procedures, manuals
>> etc.   I have all sorts of docs for installing dotnet,  cerating a orchard
>> cms site etc but need a central location to records these...maybe something
>> like a wiki or intranet system?
>>
>>
>>
>> Any suggestion would be appreciated?
>>
>>
>>
>> Anthony Salerno | Founder | SmallBiz Australia
>> Innovation | Web | Software | M2M | Developers | Support
>> +613 8400 4191 | 2Anthony (at) smallbiz.com.au  | Po Box 135, Lower
>> Plenty 3093 ABN : 16 079 706 737
>>
>> www.smallbiz.com.au | www.linkedin.com/in/innovativetechnology
>>
>>
>>
>>
>>
>>
>>
>


Re: linq question

2014-05-20 Thread David Rhys Jones
If you have all the constraints set up correctly and you are using EF.

from t in tasks
  .Include ("TaskTags")
  .Include("TaskTags.Tags")
 where t.tagId = 9 select t;

you should get back a nice object with all the info that you want.

Davy.


 Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Tue, May 20, 2014 at 1:56 PM,  wrote:

> Starting to enjoy linq but have dilemma..
>
>
>
> I have 3 tables  tasks, tasktags, and tags
>
>
>
> How can i create a linq query that returns all the tasks that have tag o f
> tagid=9
>
>
>
> Some tasks may have many tags, so only want to return unique tasks.
>
>
>
> What methodology should i use to achieve this?
>
>
>
>
>
>
>
> Anthony Salerno | Founder | SmallBiz Australia
> Innovation | Web | Software | Developers | Support
> +613 8400 4191 | 2Anthony (at) smallbiz.com.au  | Po Box 135, Lower
> Plenty 3093 ABN : 16 079 706 737
>
> www.smallbiz.com.au | www.linkedin.com/in/innovativetechnology
>
>
>
>
>
>
>
> Anthony
>
>
>
>
>


Re: FW: linq and timezone conversion

2014-05-19 Thread David Rhys Jones
But

if the list is being enumerated to do the update, wouldn't a second attempt
to enumerate the list, ie: in the UI, fail?

How do you reuse the enumeration without requerying / copying the list.

Intrigued.

Davy.



Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Mon, May 19, 2014 at 3:03 PM, Greg Keogh  wrote:

> If you have to call one of your own methods in an IQueryable to the
> database, and you can't replace it with one of the 
> DbFunctions<http://msdn.microsoft.com/en-us/library/system.data.entity.dbfunctions(v=vs.113).aspx>methods,
>  then do an AsEnumerable() and you can do whatever you like on the
> local collection (assuming it's a reasonable size). This also avoids making
> an intermediate List<> -- Greg
>
>
> On 19 May 2014 22:10, David Rhys Jones  wrote:
>
>> Hi,
>> you can't use local functions in a database query,
>> your query would look like this, Select IssueId, IssueTitle, EtaDate =
>> ?? from vwIssues.
>>
>>  get all the data from the database with a .ToList();
>>
>> then loop over the collection and call the method, you could even do this
>> with a parallel loop.
>>
>> Parallel.ForEach( issues, x => x.EtaDate = NodaTimeUtil.
>> ConvertToMelbourneTimeZoneFromUtc(x.ETADate.Value));
>>
>> Davy.
>>
>> Davy,
>>
>> "So you want to keep data which is local, only ever going to be local,
>> only needed locally, never accessed remotely, not WANTED to be made
>> available outside our building, which can only WEAKEN our security by being
>> off site, hosted offsite." BOFH: Simon Travaglia
>>
>>
>>
>>
>> On Mon, May 19, 2014 at 1:38 PM,  wrote:
>>
>>>
>>>
>>>  var issues = from n in db.vwIssues
>>>
>>>  where n.IsDeleted == false & n.Archived == false
>>>
>>>  orderby n.ETADate descending,n.PriorityOrder
>>> ascending, n.DateModified descending
>>>
>>>  select new IssueViewModel
>>>
>>>  {
>>>
>>>  IssueId = n.IssueId,
>>>
>>>  IssueTitle = n.IssueTitle,
>>>
>>>  ETADate =
>>> NodaTimeUtil.ConvertToMelbourneTimeZoneFromUtc(n.ETADate.Value),
>>> //doesn't
>>> like it
>>>
>>>  Status = n.StatusName,
>>>
>>>  };
>>>
>>>
>>>
>>>
>>>
>>> How do i achieve the above requirement, ie change date to local time as
>>> date
>>> in db is UTC
>>>
>>>
>>>
>>>
>>>
>>> Anthony Salerno | Founder | SmallBiz Australia
>>> Innovation | Web | Software | Developers | Support
>>> +613 8400 4191 | 2Anthony (at) smallbiz.com.au  | Po Box 135, Lower
>>> Plenty
>>> 3093 ABN : 16 079 706 737
>>>
>>> www.smallbiz.com.au <http://www.smallbiz.com.au/>  |
>>> www.linkedin.com/in/innovativetechnology
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>


Re: FW: linq and timezone conversion

2014-05-19 Thread David Rhys Jones
Hi,
you can't use local functions in a database query,
your query would look like this, Select IssueId, IssueTitle, EtaDate =
?? from vwIssues.

get all the data from the database with a .ToList();

then loop over the collection and call the method, you could even do this
with a parallel loop.

Parallel.ForEach( issues, x => x.EtaDate = NodaTimeUtil.
ConvertToMelbourneTimeZoneFromUtc(x.ETADate.Value));

Davy.

Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Mon, May 19, 2014 at 1:38 PM,  wrote:

>
>
>  var issues = from n in db.vwIssues
>
>  where n.IsDeleted == false & n.Archived == false
>
>  orderby n.ETADate descending,n.PriorityOrder
> ascending, n.DateModified descending
>
>  select new IssueViewModel
>
>  {
>
>  IssueId = n.IssueId,
>
>  IssueTitle = n.IssueTitle,
>
>  ETADate =
> NodaTimeUtil.ConvertToMelbourneTimeZoneFromUtc(n.ETADate.Value), //doesn't
> like it
>
>  Status = n.StatusName,
>
>  };
>
>
>
>
>
> How do i achieve the above requirement, ie change date to local time as
> date
> in db is UTC
>
>
>
>
>
> Anthony Salerno | Founder | SmallBiz Australia
> Innovation | Web | Software | Developers | Support
> +613 8400 4191 | 2Anthony (at) smallbiz.com.au  | Po Box 135, Lower Plenty
> 3093 ABN : 16 079 706 737
>
> www.smallbiz.com.au   |
> www.linkedin.com/in/innovativetechnology
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


Re: [OT] Copy & Paste from protected Web page

2014-05-19 Thread David Rhys Jones
is caching enabled for the Css in the server.  [OutputCaching]
does the server have the permissions set to allow all in the machine /
server config.

Add a web config into your css directory as mentioned here:
https://stackoverflow.com/questions/4375208/web-config-wildcards-in-location-and-authorization

Davy

Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Mon, May 19, 2014 at 10:19 AM, noonie  wrote:

> Greetings,
>
> I'm trying to figure out an issue that a user has reported. When they copy
> text from a Web page into Microsoft Word they are prompted for credentials
> on one site but not on another, similarly configured, site.
>
> Both sites are basic auth over https and both are ASP.net apps with very
> minor differences. The major differences are in their proxy configurations.
> I can understand why credentials are required but not why they seem to be
> automatically offered in one case but not in the other.
>
> Where can I find some documentation about how Windows and Office conspire
> together to grab CSS files so Word can decide what text formatting to offer?
>
> --
> Regards,
> noonie
>


Re: [OT] Thurday afternoon rant

2014-04-29 Thread David Rhys Jones
Could you serialize an ExpandoObject?

Davy

Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Tue, Apr 29, 2014 at 3:05 PM, Michael Ridland  wrote:

>
> There's also the xsd and XML serialisation so you can deal with clr
> objects entities.
>
>  But just use json 
>
>
>
> On Tuesday, April 29, 2014, Greg Keogh  wrote:
>
>> That piece of code looks so freaking ugly Greg. new
>>> XElement("dasdass",new XElement( ... )) .. w t  f 
>>>
>>
>> Hi CIT, that was an ancient post, where have you been, in the bunker
>> writing top secret code for the new fighters? I know you can't answer, or
>> you'll have to kill us.
>>
>> That functional XML / LISPish like code isn't so bad if you format it
>> carefully. I try to line-up the parentheses vertically to help me when it
>> gets long (unlike my terse example).
>>
>> Authors of some languages tend to love writing impenetrably ugly
>> functional code. Some languages tend to produce code that only looks
>> impenetrably ugly!
>>
>> GFK
>>
>


Re: [OT] Specflow

2014-04-29 Thread David Rhys Jones
Hi,
I use specflow on a daily basis, with IE automation.

Some tips:


Start with the generic case and then add methods that use this generic case
to make things easier.

ex:

   When I am logged in as "username" with password "password"

then I create steps for

  When I am logged in as a User
  When I am logged in as an Administrator
 When I am logged in as a User without a shopping basket




Use one class for your steps, ie SpecflowSteps.cs
but make this partial and create classes that separate your steps into
logical groupings.




For testing on Asp.Net websites I use this

  public static Regex AsAspId(this string text)
{
if (string.IsNullOrEmpty(text))
{
throw new NotImplementedException();
}

return new Regex(text + "$");
}

So I can match buttons and links by the name in the code and not the
generated name.

And here is a Link does not exist step using it.

 [Given(@"I cannot see the link ""(.*)""")]
public void GivenICannotSeeTheLink(string p0)
{
Regex search = p0.AsAspId();
Link link =
WebBrowser.Current.Link(Find.ById(search).Or(Find.ByAlt(search)).Or(Find.ByName(search)).Or(Find.ByClass(search)));
Assert.IsFalse(link.Exists, "Link found {0}", p0);
}

As I said before this is only run in IE, the testing team / developers use
it to test functionality, then the testing team will test in the 4 browsers
that we support for inconsistencies.

Hth
Davy

Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Tue, Apr 29, 2014 at 10:25 AM, Dave Walker  wrote:

> Yeah we are. Works alright but have big issues with some browsers being
> flakey.
>
> We use it in conjunction with a selenium grid that in theory you can have
> a heap of instances running on with all variants of browsers. You can also
> integrate it with online services e.g. https://saucelabs.com/
>
> Good things to do
> * Take screenshots of the issues, IE has big issues with this
> * If you can integrate taking videos - that'd be great but apparently we
> can't do it. Lame
> * We have had three separate goes at this now - building an object model
> around our product has been the best way forward as we are future proofing
> implementation details. We have a ISearchControls implementation for
> example that can look at any one of our 2 or 3 sites and knows how to
> search. Before that it was a huge mess.
> * Integrate with build ASAP
> * Developers and testers should own the tests - our test division was
> really ansty about us changing or tests but what would happen was that the
> test team would fall behind (creating these tests are slow) so a feature
> would sit in our test queue, or would not have enough tests
> * If you use a grid make sure that you can enlist your development machine
> into the grid - use a capability filter to make sure that only your tests
> get run. But it's a good way to diagnose issues before the expense of the
> build run.
> * Have lots of machines on the grid and make them run in parallel so that
> they get done faster. Otherwise your build process will take ages.
>
>
>
>
>
>
> On 29 April 2014 15:45, Kirsten Greed  wrote:
>
>>  Hi All
>>
>> Not sure if this is OT or not, but is anyone using Specflow?
>> I am wondering if the practice works in reality...
>>
>> www.specflow.org
>> Thanks
>> Kirsten
>>
>
>


Re: [OT] Thurday afternoon rant

2014-04-10 Thread David Rhys Jones
Xml is never the best solution, sometimes it's the only solution though,
frequently it's the easiest as well.

.02c
Davy

 Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Thu, Apr 10, 2014 at 10:03 AM, Greg Keogh  wrote:

>  I can appreciate the hierarchical nature of XML, but for configuration
>> it is quite frequently an overkill.
>>
>
> How keen are you on LINQ to XML? Thanks to XElement I find creating,
> saving, loading and reading XML quite convenient these days and often use
> an XML fragment as a hepped-up INI file. I like being able to do this:
>
> var elem = new XElement("root", new XAttribute("id", 123), new
> XElement("active", true));
>
> And to pull values back out there are casts to help, and casting to a
> nullable works in case the node doesn't exist, thereby reducing code
> clutter.
>
> int id = (int)elem.Attribute("id");
> bool active = (bool)elem.Element("active");
> Guid? uid = (Guid?)elem.Attribute("uid");
>
> Greg
>
>
>>
>>
>>
>> On 10 April 2014 17:26, Stephen Price  wrote:
>>
>>> Ooops. I seem to have stumbled into the wrong room. This is the
>>> ozMedicalComplications list, right?
>>>
>>> ;)
>>>
>>>
>>> On Thu, Apr 10, 2014 at 2:28 PM, Greg Keogh  wrote:
>>>
  If there is one technology that drives me nuts every time I have to
> work with it, it's XML, XPATH and  associated crapping XML Namespaces.
> Why does everything have to be so bloody painful.
>

 XML isn't as painful as most other current technologies, it's like a
 paper cut with lemon juice spilt on it. Whereas trying to overcome security
 barriers is like having a kidney stone, or trying to get a fresh checkout
 of your solution to build is like a migraine, or trying to write a html5
 app is like a spinal prolapse.

 Linq to XML avoids XPATH, but whenever I have to got back to the old
 XML model I have to lookup the XPATH syntax and how to add a namespace.
 Albihari's C# nutshell book has a couple of pages of "reminders" on old XML
 tricks which save a lot of time.

 Greg K

>>>
>>>
>>
>


Re: Debugging Function parameters

2014-04-08 Thread David Rhys Jones
Hi,

Best guess it's Customer Id.  -
Turn on the exception for NullReferenceException

Debug -> Exceptions -> Common Language -> System
Then check,

NullReferenceException
ArgumentNullException
NotImplementedException

That will help you correct any problems, however you really need to
refactor that and pass a single object with properties. It will save you a
lot of time.

.02c
Davy

Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Tue, Apr 8, 2014 at 10:10 AM,  wrote:

> I have a function with  about 10 arguments,  one of the variables is
> failing,  ie Object reference not set to an instance of an object.
>
>
>
> Is it possible to determine which variable is causing the issue?
>
>
>
>
>
> Public Function AddCustomer(ByVal CustomerId As Nullable(Of Integer),
> ByVal Company As String, ByVal TradingAs As String, ByVal AccessName As
> String, ByVal Address As String, ByVal Address2 As String, ByVal Suburb As
> String, ByVal State As String, ByVal Postcode As String, ByVal CountryId
> As Integer, ByVal PostalAddress As String, ByVal PostalAddress2 As String,
> ByVal PostalSuburb As String, ByVal PostalState As String, ByValPostalPostcode
> As String, ByVal PostalCountryId As String, ByVal Phone As String, ByValFax
> As String, ByVal Email As String, ByVal Firstname As String, ByValLastname
> As String, ByVal UserEmail As String, ByVal Username As String, 
> ByValUserPassword
> As String, ByVal Website As String, ByVal Mobile As String)
>
>
>
>
>


Re: Visual Studio Macros stopped working?

2014-03-06 Thread David Rhys Jones
At least I don't have to search.  My marco that I use every 2 -3 mins has
stopped working
(Close document reformat and remove usings).

Davy

Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Thu, Mar 6, 2014 at 6:28 AM, Mark Hurd  wrote:

> On 6 March 2014 12:18, David Kean  wrote:
> > Thanks. It's a known issue that we're tracking and coming up with a plan
> to address those VS customers affected by it.
>
> Good. It's not too hard to find once you decide to start Googling for
> the problem, but, like I said in my StackOverflow question, I
> originally assumed it was something I did.
>
> --
> Regards,
> Mark Hurd, B.Sc.(Ma.)(Hons.)
>


Re: Signing up for Azure - Mobile Verification Failed?

2014-02-24 Thread David Rhys Jones
I have a google voice account set up for just this sort of problem, US
phone number comes through to gmail.

Davy.


 Davy,

"So you want to keep data which is local, only ever going to be local, only
needed locally, never accessed remotely, not WANTED to be made available
outside our building, which can only WEAKEN our security by being off site,
hosted offsite." BOFH: Simon Travaglia




On Mon, Feb 24, 2014 at 4:35 AM, mike smith  wrote:

> See if Amazon will take your money.
>
>
> On Mon, Feb 24, 2014 at 2:18 PM, Corneliu I. Tusnea <
> corne...@acorns.com.au> wrote:
>
>> It's the Austalian one and it recognized me as from Australia and asked
>> for mobile in Au format 4xx xxx xxx
>> The "funny" part is that it worked perfectly this morning. Exactly the
>> same site, same browser, no error, got an SMS confirmation and signed up...
>> But, to make the story really fun, 5h after I managed to sign-up and got
>> my "welcome" email I got an account cancelled notification:
>> *This mail is confirmation that your subscription below was cancelled on
>> Monday, February 24, 2014. *
>> And my account does not work anymore. FTW :(
>>
>>
>> On Mon, Feb 24, 2014 at 12:22 PM, mike smith  wrote:
>>
>>> Is it an American site, and perhaps looking for an American based card?
>>>  (maybe it just wants an American billing address, if it wants an SSN,
>>> you're  SOL )
>>>
>>>
>>> On Sat, Feb 22, 2014 at 12:56 PM, Corneliu I. Tusnea <
>>> corne...@acorns.com.au> wrote:
>>>
 Guys,

 I've been trying for the last 2h to sign up for a new Azure
 Subscription and I always fail during the Mobile Verification.
 I've tried various valid mobile numbers but they all fail with *We
 were unable to verify your account.*

 This is very annoying and .. bad bad experience ...
 I really want to give them my credit card but heck, they don't let me
 do it :(

 I've tried calling Microsoft Australia support and they told me "come
 back Monday". I tried calling Azure Customer Support through a number I got
 from the MS Support Chat and they also said "leave a message as we are
 outside of business hours".

 Just a whinge ... trying to use 24x7 service supported by a 8AM-5PM
 support team

 Take my credit card ... please please ... just make it less painful  :(

 Thoughts?

 Corneliu.


>>>
>>>
>>> --
>>> Meski
>>>
>>>http://courteous.ly/aAOZcv
>>>
>>> "Going to Starbucks for coffee is like going to prison for sex. Sure,
>>> you'll get it, but it's going to be rough" - Adam Hills
>>>
>>
>>
>
>
> --
> Meski
>
>http://courteous.ly/aAOZcv
>
> "Going to Starbucks for coffee is like going to prison for sex. Sure,
> you'll get it, but it's going to be rough" - Adam Hills
>


WCF and paramless constructor.

2013-10-25 Thread David Rhys Jones
One of the developers here just asked a strange question that I don't know
the answer to.


imagine this class is

[DataContract]
public class Orange : ResponseBase
{
public Orange(string color)
{
Color = color;
}

public string Color { get; set; }
}

In reflector ResponseBase is marked as Serializable and has a Parameterless
constructor.

with a shared assembly between the web-service and the client.

Orange can be serialized  and then de-serialized in the client without a
parameterless constructor.

What is going on? how is the object reconstructed or are we looking at
errors down the line if we change transport protocols.  I'm guessing that
the object is being shared and not serialized?


Davy,

"Every time I press one of these black controls, labelled in black on a
black background, a little black light lights up black to let me know I've
done it."  Douglas Adams.


Re: Code commenting

2013-09-13 Thread David Rhys Jones
For the last 5 years or so the only comments that I have left in code. are
the public interface XML comments that are well written with examples. not
the usual you find.
/// 
/// Gets the User by Id
/// 
public void GetUserById(long id){}

I have left comments that point out that a bug exists in something we can't
control.
like a "Log.Debug" in a tight loop that I've put "if log.IsDebug" around
for performance reasons.

a couple of years ago, we were working on a project that was full stylecop
and code analysis doing it by TDD.  When the company changed it's
acceptance rules to be more strict, we were 90% compliant. However they
complained that there were only 12 comments in the entire solution.

if you have to make comments in the code, always prefix it with something
that is constant so the task list picks it up.  The HACK, TODO and UNDONE
are adequate, I've found that customizing this list is counter productive
because you miss the other developers tags if they add them without consent
of the team.

2c
Davy

Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


On Fri, Sep 13, 2013 at 10:38 AM, Sam Lai  wrote:

> No comments at all is a bit extreme. I get what you're saying, but there
> are still valid reasons for comments. For example, if you had to do an
> unusual hack because of a bug in the framework, you'd want to leave a
> comment in the code so the next person who comes along doesn't spend hours
> re-writing it so it is done properly only to realise after that a bug
> exists.
>
> Do docstrings/javadocs count as comments?
>
> I agree about no 'person x made this change on y because of issue z'
> comments though; if your source control doesn't make that easy to
> determine, then get a new source control system.
>
>
> On 13 September 2013 17:56, Davy Jones  wrote:
>
>> Hello
>> If you are doing this in code. It points to the fact that someone is not
>> pulling their weight.
>> Code should not have comments. If you need them to explain something, the
>> code is too complex.
>> If you add them so modifications on one bit of code come back to you so
>> you can fix. Make it simpler.
>> If you add them to Blame later, you should be doing peer reviewed
>> checkins to bring everyone up to the same level.
>> If you are commenting code because it might be useful later. Delete it!
>> That is what source control is for.
>>
>> There is no excuse for comments in code.
>>
>> Davy
>>
>> Sent from my starfleet datapad.
>>
>> On 13 sept. 2013, at 08:56, mike smith  wrote:
>>
>> Blame is a useful tool, ofttimes though, I'd call it credit.  For
>> instance, you receive a crashdump from an old version, it shows you where
>> the app crashed, and maybe you have a slight idea why.  Use blame on a
>> current version, look at changes around the crash line and you've got a lot
>> of the info you might need to generate a hotfix.  With all the caveats that
>> hotfixes imply :)  If your devs are diligent linking the svn comment with a
>> number from your CR system, that's another link.
>>
>> But I'd hate to see it actually present in the code.
>>
>>
>>
>>
>> On Fri, Sep 13, 2013 at 2:50 PM, Craig van Nieuwkerk 
>> wrote:
>>
>>> A lot of source control systems give you that out of the box. I know Git
>>> and SVN both do with the BLAME command. I wouldn't want the comments
>>> scattered throughout the code.
>>>
>>>
>>> On Fri, Sep 13, 2013 at 2:45 PM,  wrote:
>>>
 Anyone suggest a method to autmaticlly comment code when lines have
 changed?  Would be great to be able to see who changed what when viewing
 the code.

 ** **

 At the moment,, we write comments like //xxMOD 12AUG13   XX=PROGRAMMER
 INITIALS

 ** **

 WE use TFS but we like to write comments in code sometimes.  Any
 extensions able to do this?

 ** **

 Anthony

 Melbourne StuffUps…learn from others, share with others!


 http://www.meetup.com/Melbourne-Ideas-Incubator-Stuffups-Failed-Startups/
 



 --
 NOTICE : The information contained in this electronic mail message is
 privileged and confidential, and is intended only for use of the addressee.
 If you are not the intended recipient, you are hereby notified that any
 disclosure, reproduction, distribution or other use of this communication
 is strictly prohibited.
 If you have received this communication in error, please notify the
 sender by reply transmission and delete the message without copying or
 disclosing it. (*13POrtC*)

 ---
 

 ** **

>>>
>>>
>>
>>
>> --
>> Meski
>>
>>http://courteous.ly/aAOZcv
>>
>> "Going to Starbucks for coffee is like going to prison for sex. Sure,
>> you'll

Re: Parallet.ForEach

2013-06-24 Thread David Rhys Jones
Hi, I found out what was causing my problems.

I replaced the outer List with a ConcurentBag and everything is
working fine.

3 Little Tips.

 1. Don't use IEnumerable and Parallel.ForEach, List is much faster.
 2. Use ConcurrentBag for your results, or one of the other objects in
the concurent namespace.
 3. Parallel.Foreach does wait until all processing happens, unless it hits
an exception that doesn't get passed back.

I was seeing messages "100 items returned", with 0 results in the grid.
NullReferenceExceptions in the linq queries and "99 items returned" with
100 in the grid.
WAG, I guess it was a concurrency Issue that wasn't throwing an exception
back at me.

 Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


On Mon, Jun 17, 2013 at 4:02 PM, Mark Hurd  wrote:

> I don't know enough about Parallel.ForEach to debug this, although I
> do think you existing code would need a thead-safe .Add at least.
>
> However, could you change this to:
>
> ICollection data = GetCustomers();
>  var customers = data.AsParallel().select(
>  (source) =>
> {
> DisplayableCustomer destination = new DisplayableCustomer();
>Mapper.Map(source, destination);
>return destination;
> });
>
> ? (As a .NET 3.5 developer guessing)
>
> --
> Regards,
> Mark Hurd, B.Sc.(Ma.)(Hons.)
>
> On 17 June 2013 22:15, David Rhys Jones  wrote:
> > Oops sent too quickly.
> >
> >  ICollection data = GetCustomers();
> >  Parallel.ForEach(
> >  data,
> >  (source) =>
> > {
> > DisplayableCustomer destination = new DisplayableCustomer();
> >Mapper.Map(source, destination);
> >customers.Add(destination);
> > });
> >
> >  later on I order the data.
> >
> >  var sorted = from c in customers orderby c.ZipCode descending select c;
> >
> >  the error, occurs ( very rarely)  in the   orderby c.ZipCode
> > NullReferenceException :  c is null.
> >
> > What am I doing wrong?  the parallel should all complete when it finishes
> > right, it's not waiting for thread pools to be created / deleted and
> > returning before the data is done?
> >
> > the ICollection is a List but I could change that to a
> threadsafe
> > list if needed.
> >
> > Davy,
> >
> > The US Congress voted Pizza sauce a vegetable. Don't even try to
> convince me
> > of anything in the states is sane any more!
> >
>


Re: Parallet.ForEach

2013-06-17 Thread David Rhys Jones
Oops sent too quickly.

 ICollection data = GetCustomers();
 Parallel.ForEach(
 data,
 (source) =>
{
DisplayableCustomer destination = new DisplayableCustomer();
   Mapper.Map(source, destination);
   customers.Add(destination);
});

 later on I order the data.

 var sorted = from c in customers orderby c.ZipCode descending select c;

 the error, occurs ( very rarely)  in the   orderby c.ZipCode
NullReferenceException :  c is null.

What am I doing wrong?  the parallel should all complete when it finishes
right, it's not waiting for thread pools to be created / deleted and
returning before the data is done?

the ICollection is a List but I could change that to a threadsafe
list if needed.

Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


Parallet.ForEach

2013-06-17 Thread David Rhys Jones
Hi guys,

I'm having a very wierd problem.

I've got a collection that I map like this

ICollection data = GetCustomers();

Parallel.ForEach(
 data,
 (source) =>
{


 Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


Re: Unity is doing my nut in!

2013-04-15 Thread David Rhys Jones
Code smell,  I'm not sure.

I'm used to using spring, with one config for test, one for dev local, one
for the TFS, prod etc.

Testing all the parts individually would be better, but some of my services
rely on other services so I have to test that they play nice together. I
gave up trying to have multiple configs, it's a headache to configure. I've
mocked out the database and now running all the tests through the complete
object hierarchy, coverage is at 98%  that last two percent is staring me
in the face mocking me!


 Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


On Mon, Apr 15, 2013 at 11:03 AM, Dave Walker  wrote:

> I'd suggest it's a code smell to be using your IOC container in your test
> environment. You can test parts in isolation by instantiating them
> individually and mocking out their dependencies.
>
>
>
>
> On 15 April 2013 09:05, David Rhys Jones  wrote:
>
>> I'm trying to mock one of the classes, but I also have tests that use the
>> concrete class.
>>
>> I could test the whole thing together but that defeats the point of unit
>> testing.
>>
>> I don't like the "automagically" part, is there some way I can tell it to
>> give me the class in the configuration I want?
>>  Davy,
>>
>> The US Congress voted Pizza sauce a vegetable. Don't even try to convince
>> me of anything in the states is sane any more!
>>
>>
>>  On Sat, Apr 13, 2013 at 3:11 AM, Stephen Price <
>> step...@perthprojects.com> wrote:
>>
>>> Where are you using the container to get your registered interfaces?
>>> Inside or outside the using block?
>>>
>>> The property will automatically be populated when you ask unity for an
>>> ITransactionService. Its been a while since I used unity, but with ninject
>>> you have to add a [Inject] attribute on the property. There might be
>>> something similar for unity... Constructor dependencies are created
>>> automagically
>>>
>>>
>>> On Apr 13, 2013 12:21 AM, "David Rhys Jones" 
>>> wrote:
>>> >
>>> > I'm having a huge problem trying to get unity to work, I've spent a
>>> whole day fighting it and can't get anywhere. I've used Spring.Net for a
>>> long time and have no problems.
>>> >
>>> > This is my class.
>>> >
>>> > public class TransactionService : ITransactionService
>>> >
>>> > {
>>> >
>>> > [
>>> >
>>> > Dependency]
>>> >
>>> > public ITransactionData TransactionData { get; set; }
>>> >
>>> > }
>>> >
>>> > And this is my Setup.
>>> >
>>> > using (var u = new UnityContainer())
>>> >
>>> > {
>>> >
>>> > u.RegisterType()
>>> >
>>> > .Configure()
>>> >
>>> > .ConfigureInjectionFor(new
>>> InjectionProperty("ConnectionString",
>>> "Server=waihopar11-0125;Database=Spirit;Trusted_Connection=True;"));
>>> >
>>> > u.RegisterType()
>>> >
>>> > u.RegisterType("mock");
>>> >
>>> > .Configure<
>>> >
>>> > InjectedMembers>()
>>> >
>>> > // This bit I don't know how to do. how do I set
>>> the "Mock" TransactionData on the  TransactionService.
>>> >
>>> > // I Can't find any examples that work with Unity 2.0..
>>> >
>>> > .ConfigureInjectionFor(new
>>> InjectionProperty("TransactionData", ?? );
>>> >
>>> >  Help!
>>> >
>>> > thanks.
>>> >
>>> > Davy,
>>> >
>>> > The US Congress voted Pizza sauce a vegetable. Don't even try to
>>> convince me of anything in the states is sane any more!
>>>
>>
>>
>


Re: Unity is doing my nut in!

2013-04-15 Thread David Rhys Jones
I'm trying to mock one of the classes, but I also have tests that use the
concrete class.

I could test the whole thing together but that defeats the point of unit
testing.

I don't like the "automagically" part, is there some way I can tell it to
give me the class in the configuration I want?
 Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


On Sat, Apr 13, 2013 at 3:11 AM, Stephen Price wrote:

> Where are you using the container to get your registered interfaces?
> Inside or outside the using block?
>
> The property will automatically be populated when you ask unity for an
> ITransactionService. Its been a while since I used unity, but with ninject
> you have to add a [Inject] attribute on the property. There might be
> something similar for unity... Constructor dependencies are created
> automagically
>
>
> On Apr 13, 2013 12:21 AM, "David Rhys Jones"  wrote:
> >
> > I'm having a huge problem trying to get unity to work, I've spent a
> whole day fighting it and can't get anywhere. I've used Spring.Net for a
> long time and have no problems.
> >
> > This is my class.
> >
> > public class TransactionService : ITransactionService
> >
> > {
> >
> > [
> >
> > Dependency]
> >
> > public ITransactionData TransactionData { get; set; }
> >
> > }
> >
> > And this is my Setup.
> >
> > using (var u = new UnityContainer())
> >
> > {
> >
> > u.RegisterType()
> >
> > .Configure()
> >
> > .ConfigureInjectionFor(new
> InjectionProperty("ConnectionString",
> "Server=waihopar11-0125;Database=Spirit;Trusted_Connection=True;"));
> >
> > u.RegisterType()
> >
> > u.RegisterType("mock");
> >
> > .Configure<
> >
> > InjectedMembers>()
> >
> > // This bit I don't know how to do. how do I set
> the "Mock" TransactionData on the  TransactionService.
> >
> > // I Can't find any examples that work with Unity 2.0..
> >
> > .ConfigureInjectionFor(new
> InjectionProperty("TransactionData", ?? );
> >
> >  Help!
> >
> > thanks.
> >
> > Davy,
> >
> > The US Congress voted Pizza sauce a vegetable. Don't even try to
> convince me of anything in the states is sane any more!
>


Unity is doing my nut in!

2013-04-12 Thread David Rhys Jones
I'm having a huge problem trying to get unity to work, I've spent a whole
day fighting it and can't get anywhere. I've used Spring.Net for a long
time and have no problems.

This is my class.

public class TransactionService : ITransactionService

{

[
Dependency]

public ITransactionData TransactionData { get; set; }

}
And this is my Setup.

using (var u = new UnityContainer())

{

u.RegisterType()

.Configure()

.ConfigureInjectionFor(new InjectionProperty("ConnectionString",
"Server=waihopar11-0125;Database=Spirit;Trusted_Connection=True;"));

u.RegisterType()

u.RegisterType("mock");

.Configure<
InjectedMembers>()

// This bit I don't know how to do. how do I set the "Mock" TransactionData
on the  TransactionService.

// I Can't find any examples that work with Unity 2.0..

.ConfigureInjectionFor(new InjectionProperty(
"TransactionData", ?? );
  Help!

thanks.

 Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


Re: occasionally connected application design problem

2013-03-27 Thread David Rhys Jones
This is just an Idea,

Message Queues, - pick your flavor.

Server and Clients have incoming queues.

the server queue thread turns continuously listing to it's incoming queue
and post backs all the updates / insert / deletes to the client queues
(except the one making the update);

the clients connect when they can and pull down as much information
possible from their queue and make the changes. (* it's in order so
shouldn't be a problem).

I suppose there is a way to do it with Sql Server, are all the clients
working with the same version?


Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


On Wed, Mar 27, 2013 at 11:06 AM, Corneliu I. Tusnea  wrote:

> Greg,
>
> I'm sure the SQL guys will tell you about some "magical tool" that can do
> all of this for you hands free and without any headaches (fingers crossed)
> but my take would be the good old REST API model.
>
> 1. For every Table have two columns LastUpdated, LastUploaded and
> LastDownloaded. Every change you do locally you update the LastUpdated to
> UTC now (never use local times!)
> 2. Keep a table with the "sync status" of each table where all you need to
> store is the TableName, LastUploaded and LastDownloaded.
> 3. Have a background thread that tries to monitor for network events
> (don't continuously try to ping your server as your'll burn the battery of
> those devices).
> http://www.codeproject.com/Articles/64975/Detect-Internet-Network-Availability
> 4. When you have connectivity all you need to do is select top 100 from
> each table where LastUpdatd for the Status for the table < LastUpdated of
> the row.
> (I don't know if I make sense but basically you want to select all the
> rows that were changed since point of your LastUpdated in your Status
> table).
> You then try to push those back to your server. For every row that "made
> it" to the server you update the LastUploaded to UtcNow or even better I
> would update it to the time just before you started the sync.
> 5. You do the reverse for downloading data. You ask the server for all
> changes since your LastDownload. Once all the changes were received, you
> update your own LastDownload.
> With a bit of reflection and some clear naming conventions you could code
> all of this generically enough that you can simply run it on your database
> disregarding the number of tables & columns.
>
> I'm now going to let the SQL guys deliver their magical tool :)
>
> Regards,
> Corneliu.
>
>
>
>
> On Wed, Mar 27, 2013 at 8:41 PM, Greg Harris wrote:
>
>> Dear People,
>>
>>
>> I need some help to get some good ideas for a design issue I am facing…
>>
>>
>> The application will be geographically dispersed and only occasionally
>> connected to the internet with a slow / unreliable connection.
>>
>> The users at remote branch offices are doing daily data entry to their
>> own local databases (probably SQL express databases).
>>
>> On a periodic basis the remote branch offices need to synchronise data
>> with head office (probably a full SQL database).
>>
>> Most (99%) of data will travel from the remote branch offices the head
>> office some reference data may travel back to the remote branch office.
>>
>>
>> There are a couple of design ideas that I have had:
>>
>>
>> SQL Server Replication: (
>> http://msdn.microsoft.com/en-us/library/ms151198.aspx) I do not know how
>> well this will work on wires that are of such poor quality.  Also how easy
>> (hard) it will be to support remotely.
>>
>>
>> Program based updates: Have a program running in the background at each
>> site attempting connection with head office transferring data.  All rows
>> would have a transferred status flag, that would be set once successful
>> transfer has been acknowledged.
>>
>>
>> File extracts: Once an hour produce a text file (with check sum) of all
>> data entered in the last hour, background job copies file to head office
>> server which will then apply updates to head office server.
>>
>>
>> Please share with me and the group what design ideas and experiences you
>> have had that worked well and the ones you would avoid if faced with the
>> same design decision again today.
>>
>>
>> Many thanks
>>
>> Greg Harris
>>
>
>


Re: LINQ select nullable Id

2013-03-04 Thread David Rhys Jones
Hi Greg.
FirstOrDefault() will return 0 for non null Ints,  So I'm guessing that
t.Id is an (int).

So you're going to have to do something like this.

List abs = new List();
for (int i = 0; i < 10; i++)
{
abs.Add(new AB { Id = i });
}

int? id = null;
IEnumerable output = from t in abs where t.Id == 1000
select t.Id;
if(output.Any())
{
id = output.First();
}

Assert.IsNull(id);

or This.

public static int? FirstOrNull(this IEnumerable query)
{
if (query.Any())
{
return query.First();
}

return null;
}

 int? alternative = (from t in abs where t.Id == 1000 select
t.Id).FirstOrNull();

hth.
Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


On Mon, Mar 4, 2013 at 11:20 AM, James Chapman-Smith <
ja...@chapman-smith.com> wrote:

>  Try this:
>
> ** **
>
>int? id =
>
>   (from t in things where t.Name == "Foo" select t.Id)
>
>   .ToArray()
>
>   .Concat(new int?[] { null })
>
>   .First();
>
> ** **
>
> Cheers.
>
> ** **
>
> James.
>
> ** **
>
> *From:* ozdotnet-boun...@ozdotnet.com [mailto:
> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Greg Keogh
> *Sent:* Monday, 4 March 2013 18:20
> *To:* ozDotNet
> *Subject:* LINQ select nullable Id
>
> ** **
>
> Folks, I want to select the int Id of an entity in a DbSet, or int? null
> if it's not found. Like this *wrong* sample:
>
>  
>
> int? id = (from t in things where t.Name == "Foo" select
> t.Id).FirstOrDefault();
>
>  
>
> In this case I get int zero if there is no match but I want null. Is there
> some way of rearranging this to get an Id or null? Remember that the query
> has to convertible down to SQL.
>
>  
>
> Greg K
>


Re: File/folder sync options for Windows

2012-04-06 Thread David Rhys Jones
Hi,

I use all of the following.

1.
xcopy \\server \\local /x /y /z /d
xcopy \\local \\server /x /y /z /d /u

if you want to copy a new file, you need to do it manually to the server.

2.  Dropbox

3.  Write an app that uses file system watcher and copy the files / delete
the files on the server.

Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!



2012/4/6 Greg Low (GregLow.com) 

> Hi Folks,
>
> ** **
>
> Anyone got recommendations for file sync? Just a couple of PCs that want
> to share one or more folders between them and also to a NAS that they both
> can access. Happy for the main folder to live on the NAS and for the other
> two PCs to sync with it.
>
> ** **
>
> I spent time today looking at Offline files in Windows 7 and while it
> looked promising at first, after wasting hours trying to debug its issues,
> I’ve decided it’s not for me.
>
> ** **
>
> Regards,
>
> ** **
>
> Greg
>
> ** **
>
> Dr Greg Low
>
> CEO and Principal Mentor
>
> *SQL Down Under***
>
> SQL Server MVP and Microsoft Regional Director
>
> 1300SQLSQL (1300 775 775) office | +61 419201410 mobile│ +61 3 8676 4913fax
> 
>
> Web: www.sqldownunder.com
>
> ** **
>


Re: New look of Visual Studio, what are your thoughts?

2012-02-27 Thread David Rhys Jones
Hi,

I read Scott's blog, and then went back to the Microsoft blog to take a
second look.

*Things that I use a lot that are missing.*

Solution Explorer, Properties and Macro Explorer icons in the tool-bar.


*Toolbar changes.*

[image: Inline image 1]

*Comment / Uncomment .  *
I use CTRL+K C  / CTRL+K U ,  so no problem there.

*New Project. *
Never use it from there, always do it from the solution explorer.

*File Open.*
Always click this Icon, it's the same in Word, Excel, Sql Server Management
basically all windows applications.
not looking for the biggest splodge of yellow on the screen will be annoying

*Save*
Ctrl+S  or CTRL+SHIFT+S

*Find In Files, *
Always use, because it's next to the quick find, if quick find doesn't work
I click the little icon next to it and try again. except. in 2011, it's
completely in the wrong place.

*Bookmarks*
Ctrl + K + K, Ctrl + K + N , CTRL + K + P


Overall, it won't effect me too much, except when I do support, (searching
in files, and opening source files).

*
A quick glance at the Solution Explorer window*

[image: Inline image 2]

There are Six icons there,  Back, Forward, Home?, Cascade Windows?,
synchronize views?, Find in Files (white) ? and Settings?

In VS  you have Properties, Show Hidden Files, Refresh,, view code,
(view designer), Class Diagram.

I'm not sure how those match up in the new Visual studio, but switching
between versions is going to be a major pain in the arse.
*
Properties Box*
The 2010 version looks much better than the 2011 version, the tabs are well
separated and the highlighted tab is clear that it's a part of the form on
the right. The 2011 version looks disassociated.

On my machine, (XP 32bit) I have.

VS2005
VS2008
VS2010
Sql Server Management 2008
Office 2003

The company I work for will not upgrade to the Ribbon version of office,
because of all the support calls it would generate. So I have to do VSTO
projects in 2008,   I have an app that won't upgrade (.xsd files) to 2005
or 2010. And we are currently doing desktop UI application in .net 4.0.

In any one week I will have used all three version of VS, and accessed a
number of different DB's some with auto-completion some without, all using
the same UI.

Please provide a "Classic Skin" as well. to emulate the VS2010 icons so the
switching will not be as shocking.

Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!



On Mon, Feb 27, 2012 at 6:47 AM, Scott Barnes wrote:

> I've also done a blog post decoding the grey into more finite principles,
> ie "i dont like grey.." isn't enough, so i've made a feeble attempt to
> decode the problem with flat grey vs depth based grey.
>
> Decoding the use of grey in Visual Studio vNext
> http://www.riagenic.com/archives/858
>
> ---
> Regards,
> Scott Barnes
> http://www.riagenic.com
>
>


Re: [OT] t-sql, dealing with null

2012-01-19 Thread David Rhys Jones
Oh and I forgot, you can write positive queries for negative results.

ie   select * from address where city <> 'New York'   -- Never use this
form.

consider
*
 1.   select * from address where not addressId in (select addressId from
address where city = 'New York')*

 *2.   select * from address where isnull(city,'') <> 'New York'   *


If the City field isn't index the 2nd  query comes out best,

If city field is indexed, then the 1st query is better.  If you forget to
index the field Sql Server Management Studio will even suggest the index.


Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!



On Thu, Jan 19, 2012 at 12:31 PM, Wallace Turner wrote:

>  thanks for that detailed response, very interesting. for the record the
> SP was not that short, it was something more complex buried deep within the
> stored proc.
>
>
> >Isnull + coalesce in queries when you have to, but I try to write only
> positive queries, or queries against non null fields.
>
> Good advice, thanks again.
>
>


Re: [OT] t-sql, dealing with null

2012-01-18 Thread David Rhys Jones
Rule number 1,

 Don't do business logic in the database.

.02c
Davy,

The US Congress voted Pizza sauce a vegetable. Don't even try to convince
me of anything in the states is sane any more!


Re: ASCII to int

2011-10-10 Thread David Rhys Jones
int total = 0;
string str = "abcdefghijklmnopqrstuvwxyz";
foreach (char c in str.ToCharArray())
{
total += (int)c;
}

Assert.AreEqual(42, total);


Davy,


"Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live."
- Martin Golding

"After a bit of digging, it was pretty clear that the 'issues' were in the
data access class. It was named 'summoner.cs'"  DailyWTF



On Mon, Oct 10, 2011 at 3:37 PM, Tom Gao  wrote:

> Hi All,
>
> ** **
>
> Does anyone know how to convert a string of ASCII characters to int? 
>
> Eg
>
> “abcd” to some form of int.
>
> ** **
>
> I need to do a bunch of calculations on strings the only way is if they’re
> in int not sure if anyone know of a good way to do this.
>
> ** **
>
> Thanks,
>
> Tom
>


Re: int identity(1,1) -> decimal

2011-02-04 Thread David Rhys Jones
Ok lest try this again without gmail sending it prematurly.

I've got a demo application that has this table in a SQL 2000 database.


CREATE TABLE [dbo].[Fruit](
[id_fruit] [int] IDENTITY(1,1) NOT NULL,
[name] [nvarchar](255) NULL
) ON [PRIMARY]

I run this code against it.

  public IFruit GetFruitByName(IDbTransaction transaction, string name)
{
string sql = "select top 1 * from fruit where name = @name";
List parameters = new
List();
parameters.Add(Database.
>
> CreateParameter("@name", name));
> FruitBuilder builder = new FruitBuilder();
> using (IDataReader reader = Database.ExecuteReader(transaction,
> sql, CommandType.Text, parameters, CommandBehavior.SingleRow))
> {
> IFruit fruit = builder.BuildOne(reader);
> return fruit;
> }
> }
>
There is nothing really strange in the calls but what I am getting is, the
id_fruit  column in the Select returned is returned to Ado.Net (3.5) as a
Decimal type and not an integer.

I've tried searching, and can't find anything to suggest why, any Ideas?

grazie mille

Davy,


"Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live."
- Martin Golding


int identity(1,1) -> decimal

2011-02-04 Thread David Rhys Jones
Hi guys
  This really has me stumped.

I've got a demo application that has this table in a SQL 2000 database.


CREATE TABLE [dbo].[Fruit](
[id_fruit] [int] IDENTITY(1,1) NOT NULL,
[name] [nvarchar](255) NULL
) ON [PRIMARY]

I run this code against it.

  public IFruit GetFruitByName(IDbTransaction transaction, string name)
{
string sql = "select top 1 * from fruit where name = @name";
List parameters = new
List();
parameters.Add(Database.CreateParameter("@name", name));
FruitBuilder builder = new FruitBuilder();
using (IDataReader reader = Database.ExecuteReader(transaction,
sql, CommandType.Text, parameters, CommandBehavior.SingleRow))
{
IFruit fruit = builder.BuildOne(reader);
return fruit;
}
}







Davy,


"Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live."
- Martin Golding


Re: Forcing Dispose to be Called.

2011-01-25 Thread David Rhys Jones
Thanks all for the suggestions,

Each has its own merits, however I can't see one solution that would solve
the problem.

Spring.Net will inject a new object at each call, and will dispose the
object when it goes out of scope at the end of it's life.

For the record I feel dirty every time I have to write ,

 public IPricingService PricingService { private get; set;}

 using(PricingService){

}

it feels wrong, but thats how spring is configured here.

I think I will have to use a Session/Context type approach,

Cheers.

Davy,


"Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live."
- Martin Golding



On Tue, Jan 25, 2011 at 09:39, James Chapman-Smith
wrote:

> Hi David,
>
>
>
> It’s easy to force developers to call Dispose but your library calls must
> use a particular signature.
>
>
>
> Given an interface definition like so:
>
>
>
> public interface IPricingService : IDisposable
>
> {
>
> IEnumerable GetPrices(int @ref, DateTime date,
> PricingProviders pricingProviders);
>
> }
>
>
>
> Implement the service like this:
>
>
>
> public class PricingService : IPricingService
>
> {
>
> private PricingService();
>
>
>
> public static T Using(Func func)
>
> {
>
> using (IPricingService pricingService = new PricingService())
>
> {
>
> return func(pricingService);
>
> }
>
> }
>
>
>
> public IEnumerable GetPrices(int @ref, DateTime date,
> PricingProviders pricingProviders) { ... }
>
>
>
> public void Dispose() { ... }
>
> }
>
>
>
> Then your developers call the service like this:
>
>
>
> var prices = PricingService.Using(ps => ps.GetPrices(10, DateTime.Now,
> PricingProviders.All));
>
>
>
> The only way to access the service is through the static Using function
> that calls dispose when the function is done.
>
>
>
> You can still use closures to get at the IPricingService instance if need
> be, but it will be disposed when the function finishes.
>
>
>
> How’s that?
>
>
>
> Cheers.
>
>
>
> James.
>
>
>
> *From:* ozdotnet-boun...@ozdotnet.com [mailto:
> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *David Rhys Jones
> *Sent:* Monday, 24 January 2011 23:08
>
> *To:* ozDotNet
> *Subject:* Forcing Dispose to be Called.
>
>
>
>
> Hi all,
>
> Background:
>
>  I've got a service connection that is limited to 5 logins, (internal app
> written in another dept, Java Webservice not WCF compatible.),  I've
> implemented a library (C# 3.5) that calls this and a number of different
> services to provide a coherent data source for our Excel (2003)
> applications.
> In my dispose, I clean everything up correctly, connections are closed,
> webservice is disposed etc.
>
> Problem:
>
>  I need to find a way to force the developpers in my team and in the other
> teams that use my library to call the Dispose method after each use of the
> library.
>
> Is there a pattern or does anyone have an idea, how I can put a limit on
> how long the object can be used for?
> I can think of some really kludgy ways using elapsed time and throwing an
> exception.
>
>
>
> Examples:
>
>
> Good : all calls are closed, webservice is disposed, sockets closed etc.
>
>  // Spring.Net
>  public IPricingService PricingService { private get; set; }
>
>  public IEnumerable GetPrices(int ref, DateTime date)
>  {
> using (PricingService)
> {
> return
> PricingService.GetPrices(ref,date,PricingProviders.All);
> }
> }
>
>
> Bad : object is not closed, open sockets and the login used for this call
> will block until the webservice timeout.
>
>  // Spring.Net
>  public IPricingService PricingService { private get; set; }
>
>  public IEnumerable GetPrices(int ref, DateTime date)
>  {
>  return
> PricingService.GetPrices(ref,date,PricingProviders.All);
>   }
>
>
> thanks
>
> Davy,
>
>
> "Always code as if the guy who ends up maintaining your code will be a
> violent psychopath who knows where you live."
>
> - Martin Golding
>
>
>


Forcing Dispose to be Called.

2011-01-24 Thread David Rhys Jones
Hi all,

Background:

 I've got a service connection that is limited to 5 logins, (internal app
written in another dept, Java Webservice not WCF compatible.),  I've
implemented a library (C# 3.5) that calls this and a number of different
services to provide a coherent data source for our Excel (2003)
applications.
In my dispose, I clean everything up correctly, connections are closed,
webservice is disposed etc.

Problem:

 I need to find a way to force the developpers in my team and in the other
teams that use my library to call the Dispose method after each use of the
library.

Is there a pattern or does anyone have an idea, how I can put a limit on how
long the object can be used for?
I can think of some really kludgy ways using elapsed time and throwing an
exception.



Examples:


Good : all calls are closed, webservice is disposed, sockets closed etc.

 // Spring.Net
 public IPricingService PricingService { private get; set; }

 public IEnumerable GetPrices(int ref, DateTime date)
 {
using (PricingService)
{
return
PricingService.GetPrices(ref,date,PricingProviders.All);
}
}


Bad : object is not closed, open sockets and the login used for this call
will block until the webservice timeout.

 // Spring.Net
 public IPricingService PricingService { private get; set; }

 public IEnumerable GetPrices(int ref, DateTime date)
 {
 return
PricingService.GetPrices(ref,date,PricingProviders.All);
  }


thanks
Davy,


"Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live."
- Martin Golding


Re: [OT] VBScript return string runtime error

2010-11-29 Thread David Rhys Jones
Just as a side note.

The last time I developped a com interface in .net and used that object in
excel I had a hell of a lot of problems with versioning etc.

What I ended up doing, and it worked very well, was wrap the Com .net object
in a WSC windows script component. I don't know if they are stil usable in
windows 7, but they fixed no end of silly errors.  The bonus is you can
change the interface of the script object and it still retains the same
reference, making bug fixes a doddle.

Davy.


On Mon, Nov 29, 2010 at 12:29, Greg Keogh  wrote:

> I've replicated your problem with a simple VB6 class.
> I'm not sure of the actual cause but your fix is:
>id = client.SendRequest((request))
> (cut)
>
> Mark, pardon my French, but holy shit! That works. Putting (()) around the
> object argument sends it and gives me a string reply, which previously gave
> me the runtime error.
>
> I'd been searching for hours and never found any such syntax or clues
> anywhere. Where did you get that trick?
>
> Now I'm passed that hurdle I've reached the next one ... I'm getting
> "Unable
> to find assembly ", which I know is a lie. In this case I'm passing a
> string as an argument and getting back the same object that I'm passing in
> my previous problem. So now I can send it, but not get it back. Some sites
> hint at missing serializable attributes or incorrect COM attributes on the
> interface or classes, but that doesn't seem likely so far. Oh well, I'll
> keep slogging away and let you know if I find the answer.
>
>
> http://stackoverflow.com/questions/1733087/unable-to-call-c-code-from-vbscri
> pt-activex-error
>
> Thanks heaps,
> Greg
>
>