Re: Blazor css overrides

2023-12-02 Thread Tony McGee via ozdotnet

It's not always the last selector that overrides previous ones.
You're probably running into specificity issues from the original 
stylesheet, and the !important is nuking them from orbit, to be sure. 
Using !important isn't a great solution in general terms, but for this 
use case is probably fine.


https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity


On 1/12/2023 14:50, Greg Keogh via ozdotnet wrote:

Folks, TGIF

Our Blazor app has a simple classic shape with a local wwwroot/app.css 
file containing all the styles for the app. I had to allow people to 
customise the appearance, and my way of doing that works, but not as 
smoothly as I hoped and I think someone might be able to suggest a 
better more elegant technique.


If someone starts the app with query parameter ?t=contoso then the 
startup code appends a line like this into the 


href="https:///somecompany/.blob.core.windows.net/ 
/myapp//_contoso.css_">


They can edit this external css file and override selectors without 
touching the original app's files. Firstly ... is this sensible? It 
works, but there is a problem.


To override a certain colour they have to code something like this:

.HeadLinkSel { background-color: BlueViolet !important; }

Note how the !important is needed, sometimes. I can't figure out why 
yet, but !important needs to be added to the overrides most of the 
time. I thought that the last selector override all previous identical 
ones, and it's really irritating and confuses people settings the 
overrides. Can anyone explain this?


Maybe my whole technique is flawed and naïve. I'm keen for suggestions 
or links to recommended techniques for doing this sort of thing.


Cheers,
/Greg Keogh/

-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: Blazor popularity and use

2023-09-07 Thread Tony McGee via ozdotnet

Not so fast, Stockholm syndrome is comfy sometimes 

https://world.hey.com/dhh/turbo-8-is-dropping-typescript-70165c01
https://devclass.com/2023/05/11/typescript-is-not-worth-it-for-developing-libraries-says-svelte-author-as-team-switches-to-javascript-and-jsdoc/

-T

On 8/09/2023 13:05, Greg Keogh via ozdotnet wrote:
Then we can finally consign JavaScript to the rubbish bin of history 
where it belongs.


/GK/
-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Junked business registry overhaul blew out by $2.3b

2023-08-29 Thread Tony McGee via ozdotnet

Worse, they were probably drowning in XML schema definitions.
Only one mention of XML in the redacted report, but three mentions of 
SBR1, so that still counts. 


-T


On 29/08/2023 16:35, Greg Keogh via ozdotnet wrote:

Couldn't they recruit enough COBOL programmers?

/Greg K/

On Tue, 29 Aug 2023 at 16:30, mike smith via ozdotnet 
 wrote:


Here's a non paywalled one


https://www.innovationaus.com/burning-12m-a-month-govt-scraps-business-register-overhaul/



-- 
ozdotnet mailing list 
To manage your subscription, access archives: https://codify.mailman3.com/ 

Re: [OT] Assign app role in subscription

2023-05-08 Thread Tony McGee

Hey Greg,
In the Select Members panel on the right, it'll show users and groups in 
the list by default, but doesn't show applications. You may just need to 
search for the application service principal by name.


I traced these steps in one of my subscriptions and it found the 
application no worries - scroll down a bit to "Assign a role to the 
application": 
https://learn.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal


cheers,
Tony


On 8/05/2023 14:50, Greg Keogh via ozdotnet wrote:
Folks, my Azure Portal pages have changed subtly sometime over recent 
months and I can no longer find a way of assigning a role to an app. 
It tooks hours to figure out how to do this a year ago and I wrote 
down instructions for myself, but they don't apply any more due to UI 
changes.


I have created an App in the AD blade and I have its name, Id and 
secret. I want this app to have read access to my subscription so it 
can enumerate accounts, containers, etc.


I go to the Subscriptions > IAM > Role Assignments. + Add Role 
Assignment > select *Reader* > at this point I expect Select members 
to offer me my app for the role, but it never appears in the list on 
the right.


That's where I've been stuck for days now. I can't give my app the 
Reader role to my subscription. Are there any Azure portal boffins who 
know how to do this?


Thanks,
/Greg K/



Re: Replacement for old PictureBox

2023-03-15 Thread Tony McGee

Hi Greg,

The WinForms PictureBox control is pretty basic, it's mostly designed 
for displaying images, not really for drawing.
In the distant past I've used Leadtools Imaging Pro for a WinForms 
document management project that required annotation, but that can get 
expensive if your needs are basic and looking towards the future I can't 
quite tell what their .NET 7+ story is anymore.
These days it might be worth looking into SkiaSharp canvas drawing, and 
there are also some PDF export samples in the github repository.


cheers,
Tony


On 16/03/2023 09:45, Dr Greg Low via ozdotnet wrote:


Hi Everyone,

I’m migrating an old VB6 app to .NET. It used a PictureBox control and 
of course that had all sorts of options for drawing all over it.


In the end, it was used to generate JPG images that were printed.

I’d really prefer to use PDF as output anyway.

Does anyone have a favourite control that presents a drawable surface 
that you can output as a PDF? (Or ideally as a JPG as well?)


I get the impression that the .NET version of the PictureBox is way 
different, although it does seem to expose a Graphics object that you 
can then draw on. Is it better to stick with the standard .NET control 
and work out how to migrate the code?


Regards,

Greg

Dr Greg Low

1300SQLSQL (1300 775 775) office | +61 419201410 mobile

SQL Down Under| Web: https://sqldownunder.com 
| About Greg:https://about.me/greg.low 






Re: [OT] Finding duplicate rows in Sql Server

2022-11-17 Thread Tony McGee
Also be aware that there's a gotcha when using WHERE abc NOT IN (SELECT 
xyz FROM ...) that has bitten me a few times in the past... 
Perhaps not an issue in this scenario because it's an ID and likely NOT 
NULL, but if the select subquery ever returns a NULL value for xyz the 
condition evaluates to false and may give you unexpected results.  WHERE 
abc IN (SELECT xyz FROM ...) doesn't have the same problem, it 
effectively ignores the NULLs.


cheers,
Tony


On 17/11/2022 16:24, Alan Ingleby via ozdotnet wrote:

If the ID is unique across all records,

SELECT * FROM  WHERE ID NOT IN (SELECT MAX(ID) FROM 
GROUP BY NAme,Desc,Date,Etc)


On Thu, 17 Nov 2022 at 16:02, Tom P via ozdotnet 
 wrote:


Apologies if this is basic for probably most of you but I just
can't get my head around it.

I have a flat table in sql server which contains lots of
duplicates, differing only by one column.

Id,Name,Desc,Date,Etc
1,abc,abc abc,2022-11-17,a
2,abc,abc abc,2022-11-17,a
5,def,def def,2022-11-17,a
4,abc,abc abc,2022-11-17,a
3,def,def def,2022-11-17,a
6,xyz,def def,2022-11-17,a

I'm trying to write a query that finds all duplicates _excluding
the ones with the highest Id_. So for the above example it would
return the following:

Id,Name,Desc,Date,Etc
1,abc,abc abc,2022-11-17,a
2,abc,abc abc,2022-11-17,a
3,def,def def,2022-11-17,a

There are many millions of rows to process so looking for
something efficient. Any advice would be appreciated.

Regards
Tom

-- 
ozdotnet mailing list

To manage your subscription, access archives:
https://codify.mailman3.com/ 




--
Alan Ingleby



Re: Platform x64 argument

2022-10-12 Thread Tony McGee
My understanding is that you target what you want to support, so if he's 
only shipping fully managed code and supporting x64 systems then it 
doesn't matter too much but in that case may be sidelining x86 or ARM 
users for no real reason.
It gets more complicated if you need to support multiple architectures 
or have unmanaged dependencies where you need to match the bitness of 
the dependencies with the application process, this is where AnyCPU and 
AnyCPU (32-bit preferred) options will start to shine.


https://dzone.com/articles/what-anycpu-really-means-net

-Tony

On 13/10/2022 08:45, Greg Keogh via ozdotnet wrote:
Folks, one of my colleagues insists on compiling everything as 
platform x64 mainly because he thinks "it's an x64 world and it 
creates a better impression". For a year I've tried to convince him 
that for managed code that it's a complete waste of time. I've told 
him that ildasm.exe shows that for x64 and AnyCPU the generated IL and 
the manifests are identical, I even told him that dumpbin.exe shows 
the only non trivial difference in the PE headers is a couple of flags 
that show x86/x64 and PE32/PE32+, but they don't affect the loading 
and running of a PE containing IL and metadata.


Does anyone have paradigm-shattering evidence I can give my colleague 
to break his habit? (I'm hoping I'm right of course!!)


/Greg/



Re: VS2022 recent list stall

2022-08-29 Thread Tony McGee

Done!
Ta, probably should have done that first instead of complaining here.
I suspect I may not be registering the feedback button often because the 
UserVoice scars haven't faded yet... 

- Tony

On 30/08/2022 11:03, David Kean wrote:


Tony, can you Report a Problem on the git line staging – they are 
monitoring feedback on it.


*From:* Tony McGee via ozdotnet 
*Sent:* Monday, August 29, 2022 12:50 PM
*To:* ozdotnet@ozdotnet.com
*Cc:* Tony McGee 
*Subject:* Re: VS2022 recent list stall

Heh, yeah VS2022 search text boxes appear to be a bit wonky occasionally.

Tim Corey called it out in a MAUI first look video a few months back 
when something similar happened in the 17.3 preview bits. I guess it's 
not fixed yet... https://youtu.be/HmyfjAaPW0g?t=109 
<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fyoutu.be%2FHmyfjAaPW0g%3Ft%3D109=05%7C01%7Cdavid.kean%40microsoft.com%7C4ddadcff21464557971e08da896966dd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637973383541159693%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=9FH3DLd5dxaFZ0VNWYGJQ%2FU47DtyGoUERt13UM40X94%3D=0>


Speaking of annoyances with the latest VS2022 - the new git line 
staging thing is so aggressive with the mouse popup up at the end of a 
line now, making edits to a diff painful:


https://devblogs.microsoft.com/visualstudio/git-line-staging-released/ 
<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevblogs.microsoft.com%2Fvisualstudio%2Fgit-line-staging-released%2F=05%7C01%7Cdavid.kean%40microsoft.com%7C4ddadcff21464557971e08da896966dd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637973383541159693%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C=Ysdiz86YftzsxLqsSSZaMYKj3QzhYjRn7VMVQA0DT7A%3D=0>


On 29/08/2022 12:20, Greg Keogh via ozdotnet wrote:

Has anyone else got a problem with the *Open recent* list in the
latest VS2022? Type some search text and it just stalls busy with
empty results.

I've also noticed that the *Replace in Files* feature over
external folders has the same bug I reported several weeks ago. It
will tell you "x occurrences(s) replaced" but no files are
touched. I reported this back then, but a support person noticed a
duplicate posted after me, so I got marked as a duplicate (but I
was first!!). I would have thought that this was a really serious
issue, but it seems to have gone quiet. Doesn't anyone else use VS
for global changes? It's a powerful feature.

/Greg/





Re: VS2022 recent list stall

2022-08-28 Thread Tony McGee

Heh, yeah VS2022 search text boxes appear to be a bit wonky occasionally.
Tim Corey called it out in a MAUI first look video a few months back 
when something similar happened in the 17.3 preview bits. I guess it's 
not fixed yet... https://youtu.be/HmyfjAaPW0g?t=109


Speaking of annoyances with the latest VS2022 - the new git line staging 
thing is so aggressive with the mouse popup up at the end of a line now, 
making edits to a diff painful:

https://devblogs.microsoft.com/visualstudio/git-line-staging-released/


On 29/08/2022 12:20, Greg Keogh via ozdotnet wrote:
Has anyone else got a problem with the *Open recent* list in the 
latest VS2022? Type some search text and it just stalls busy with 
empty results.


image.png

I've also noticed that the *Replace in Files* feature over external 
folders has the same bug I reported several weeks ago. It will tell 
you "x occurrences(s) replaced" but no files are touched. I reported 
this back then, but a support person noticed a duplicate posted after 
me, so I got marked as a duplicate (but I was first!!). I would have 
thought that this was a really serious issue, but it seems to have 
gone quiet. Doesn't anyone else use VS for global changes? It's a 
powerful feature.


/Greg/



Re: Hawkeye replacement - find control and get instance name and maybe other properties

2022-07-14 Thread Tony McGee
There was a dotnet equivalent to the Spy++ tool called ManagedSpy back 
in the day.

This looks like related, no idea if it still works:
https://github.com/ForNeVeR/ManagedSpy

-Tony

On 14/07/2022 14:35, David Burstin via ozdotnet wrote:

Hi all,

Does anyone know of a current tool that can be used like Hawkeye used 
to be - specifically I want to be able to run a winforms app and then 
use the tool to target specific controls to see what their instance 
name is. I am fixing a bug in a legacy program and half the struggle 
is working out where the meatballs are in all the spaghetti.


I am running VS 2022 Professional, so no access to enterprise tools.

Cheers
Dave





Re: Blazor deploy error

2022-07-12 Thread Tony McGee

Hah, https://wiki.c2.com/?TrimYourPosts


Speaking of email signatures, on the list I find myself referring to 
them more often as it's become harder determine the message origin since 
the cutover. All messages are now showing as "From: ozDotNet" now, with 
an mix of To: and Cc: from those who have replied in the thread. Is 
anyone else seeing this also, is this a mailman setting?


Example: https://imgur.com/a/s1x3fMJ

-Tony


On 13/07/2022 09:18, David Connors via ozdotnet wrote:
This thread was held up in moderation because of the size of it. I've 
changed the limit on the server to 2meg per message up from the 1meg I 
had. Mailman ships with 20KB per message as the limit... reminds me of 
the quaint old days of the internet in the early 90s when people would 
tear you a new one for wasting bandwidth by having an e-mail signature 
that was too big.


David Connors
da...@connors.com  | M +61 417 189 363
Telegram: https://t.me/davidconnors
LinkedIn: http://au.linkedin.com/in/davidjohnconnors




Re: C# 6+ Random algorithm changed

2022-06-30 Thread Tony McGee

Oh nice, thanks, I missed this news for .NET 6.
I've used Mersenne Twister in the past for an app where the RNG pool 
didn't need to be cryptographically secure but the algorithm did have to 
be explicitly specified in the deliverable.


Also, interesting detail in the implementation as noted - if you just 
use the Random directly, or use the new Random.Shared thread safe 
instance you get xoshiro256**. However, if you seed Random, or derive 
from it then it possibly becomes a breaking change and you get the old 
behaviour: https://source.dot.net/#System.Private.CoreLib/Random.cs


There doesn't seem to be a way to explicitly opt-in or even seed the new 
PRNG implementation though, so looks like it's been done as purely 
performance optimisation, which is interesting.


-Tony

On 1/07/2022 11:22, Greg Keogh via ozdotnet wrote:
TGIF folks, FYI - I discovered by accident yesterday in this article 
 
that the algorithm used by the Random class has changed. Historically 
it has used the Knuth subtractive algorithm 
, which is 
old and respected, and reasonably simple. It holds its internal state 
in a seeded int[56] array (I don't know how it scores on cruel tests 
like BigCrush ).


It's been replaced with one of the set of new *xoroshiro* algorithms, 
which I didn't know about until yesterday. The code is so short that 
you can't believe they actually work and produce results that pass 
tests that even some of the famous ones like Mersenne Twister can 
fail. I'm just amazed by the brevity and quality 
 (C code links top-right).


ILSpy shows how Random has been completely rejigged to use the new 
algorithm or fallback to the internal Net5CompatDerivedImpl class.


/Greg K/



Re: It's that time of year - F#

2022-06-28 Thread Tony McGee
A lot of the early advantages of F# have eventually come to C# over the 
years - higher order functions, immutability, type inference, pattern 
matching, etc so that can't be helping F# adoption.


I remember seeing a slide from MS Build several years back that 
indicated an order of magnitude fewer VB.NET developers than C#, and it 
was two orders of magnitude for F#. The original presentation escapes 
me, but I found the slide here with Eric Sink talking about F# in 2019: 
https://ericsink.com/entries/fsharp_incremental.html


-Tony


On 29/06/2022 09:33, Dr Greg Low via ozdotnet wrote:


It has to be a pretty “brave” or “interesting” choice for a dev team 
lead though doesn’t it ? (depending upon your perspective)


Unless you’re doing something really, really out of the ordinary, 
choosing to use a language where there’s even a possibility of an 
actual list of companies who use it would seem awfully hard to 
justify. Given there are 4 listed in Australia, and on average pretty 
small, I wonder how many of those did so because they wanted to find a 
place to use it. I’m sure there will be more, but even so, that’s 
quite something.


I certainly remember the hype when it appeared.

Mind you, there have been many interesting languages over the years. 
And their fate has not always seemed logical.


Regards,

Greg

Dr Greg Low

1300SQLSQL (1300 775 775) office | +61 419201410 mobile

SQL Down Under| Web: https://sqldownunder.com 
| About Greg:https://about.me/greg.low 



*From:*David Kean via ozdotnet 
*Sent:* Wednesday, 29 June 2022 9:06 AM
*To:* ozDotNet 
*Cc:* David Burstin ; David Kean 


*Subject:* RE: It's that time of year - F#

I asked Don and he pointed me to 
https://github.com/fsprojects/fsharp-companies, which lists a few.


*From:*David Kean via ozdotnet 
*Sent:* Wednesday, June 29, 2022 8:11 AM
*To:* David Burstin via ozdotnet 
*Cc:* David Burstin ; David Kean 


*Subject:* Re: It's that time of year - F#

I'll ask around and get back to you.



*From:*David Burstin via ozdotnet 
*Sent:* Friday, June 24, 2022 3:40 PM
*To:* ozDotNet 
*Cc:* David Burstin 
*Subject:* It's that time of year - F#

Hi folks,

It's been about a year since I asked, so here it is again. Does anyone 
know of any F# work being done in Melbourne, or anywhere in Australia?


I've managed to do some small F# helper apps for my employer, but 98% 
of what I do is C#. I'd really love to find somewhere that uses F#.


On the plus side - F# has helped improve my C# approach dramatically, 
and C# is constantly introducing more functional ideas (although 
discriminated unions and active patterns would be lovely).


So, anyone know anything?

Cheers

David




Re: [OT] C++ Stupidity and Delusion

2022-06-23 Thread Tony McGee
Yeah, Rust is an interesting and evolving language, which makes it a 
bold decision to allow use at a systems level.


I came to .NET via C++ in the early '00s and still use it occasionally 
but C++ is almost unrecognisable from those days.  So I thought I'd have 
a play around with Rust instead late last year but ended up slinking 
back to C#, temporarily defeated but plan to go back at some stage. It's 
well documented but can seem fairly cryptic at times.


Object scope/lifetime is baked into the type system and the 
compiler/checker is quite punishing compared to C/C++/C#.  Most 
languages let you learn as you go (mostly) but with Rust the trick seems 
to be having to know all the language idiosyncrasies up front, which as 
a beginner makes simple stuff seem hard, and hard stuff seem almost 
impossible.


-Tony

On 24/06/2022 14:02, David Connors via ozdotnet wrote:
I was doing some reading last night about Rust - 
https://www.rust-lang.org/ - mainly prompted by the fact that Linus 
Torvalds has now said that they will introduce Rust code into the 
Linux kernel. It will be interesting to see how this progresses - I've 
never heard of anyone doing kernel/device driver level type 
development in anything other than assembly, C or C++.


Rust's claim to fame is C-like performance but with memory safety and 
no garbage collector.


David Connors
da...@connors.com  | M +61 417 189 363
Telegram: https://t.me/davidconnors
LinkedIn: http://au.linkedin.com/in/davidjohnconnors



On Fri, 24 Jun 2022 at 10:18, Greg Keogh via ozdotnet 
 wrote:


It's Friday and I promised to turn the heat up in the kitchen
again and stir the possums. The text below is pasted from my
latest Blog Post
.
I can't apologise for what I say, I'm really angry about this --
/Greg Keogh/

___

C++ Stupidity and Delusion

I recently returned to writing C++ after a 17-year gap and I have
concluded that C++ has become the stupidest language in
contemporary common use and fans of the language are living in
some form of mass delusional insanity.

When I wrote C++ from about 1993 to 2003 it was basically "C with
Classes" and it claimed to guide you away from C spaghetti code
into the superior and trendy OOP world of software development.
That claim was generally fulfilled, but I often found myself
creating classes that didn't need to exist, and there was always
the risk of creating "spaghetti classes". /It's worth noting that
opinions of OOP have not aged well and web searches for "OOP
sucks" or "OOP is bad" will produce some withering criticism./

Upon returning to C++ after a long absence, I am shocked and
angered by what I have found. Several major enhancements over the
decades have added so many features to the language with so much
syntax that it looks like an unstoppable academic research project
that went out of control and became a joke. And ironically, the
community using the language don't seem to realise they're part of
the joke.

I have recently watched lots of videos about C++, and the ones
taken at conventions are the most worrying because people like
Bjarne and Herb come on stage and are cheered like heroes by an
audience that uncritically drools over upcoming C++ features that
are discussed in great detail. What makes me both angry and
incredulous is that most of the recently added and upcoming C++
features are either making the language more and more complex, or
they are features that have been built-in to other popular
programming languages for a lifetime.

Languages like Java and C# have had parallelism, reflection,
networking support, UI designers, modules and much more for
decades, but here we are in the far distant science fiction future
of 2022 and the C++ committees are only now proposing to add these
features that are vital for software development. C++ is so far
behind the ecosystem of other modern languages that it's another
joke they don't get, and they continue to blindly cram the
language with more libraries and syntax stolen from other
languages to try and keep it up to date with its modern
contemporaries.

Writing C++ is so staggeringly complex that I need cheat-sheets
always open, and sometimes I must Google search on how to write
every line of code correctly. As a result, my C++ coding speed
often hovers at around 10 to 20 lines of code per hour. It took me
3 solid days of hair-tearing suffering to find a library that made
REST web service calls, compile it, and make it work. A colleague
took two days to get a zip library working and at one point he
said, "lucky I don't live near a cliff". Both of those tasks could
be coded in a few lines of a modern language in less than a minute.

  

Re: [Trivia] PowerShell / .Net implicit string conversions

2022-06-23 Thread Tony McGee

Yeah PowerShell has/has a number of oddball things like this.
You can use "$(Get-Date -f x)" where the x can be any standard .net 
format code (d, G, etc).


Both of the following were thankfully fixed in PS6+ as the defaults are 
much better now, but the ones I always got snagged on with PowerShell 5 
were:

 - Export-Csv forgetting to specify "-NoTypeInformation"
 - Out-File without specifying "-Encoding Ascii" (the default used to 
be Unicode, now it's UTF8NoBOM)


What always intrigues me though is observations that .net developers (vs 
sysadmins for example) often approach using PS from an API perspective, 
obviously from knowing the BCL API surface as we do so well. 
Conversely, sysadmin powershell will often look like WSH/wscript that 
they're more used to.


e.g. for the timezones earlier, the Powershell-y way is something like:
> get-timezone -list | where BaseUtcOffset -eq '09:30:00' | select 
DisplayName,SupportsDaylightSavingTime


DisplayName  SupportsDaylightSavingTime
---  --
(UTC+09:30) Adelaide   True
(UTC+09:30) Darwin    False

Kudos to the folks at Microsoft for allowing each and any coding style 
to work regardless for everyone under the tent, of course!


-Tony


On 23/06/2022 18:10, Richard Carde via ozdotnet wrote:
I have no idea how widely known this is, but it annoyed me for an hour 
or so.


PS C:\> *(Get-Date).ToString()*
23/06/2022 2:06:24 PM

PS C:\> *"$(Get-Date)"*
06/23/2022 14:06:33

Huh?

I know why there's a difference.  Anyone been stung by that before?

The implicit conversion does this:

PS C:\> 
*(Get-Date).ToString($null,[System.Globalization.CultureInfo]::InvariantCulture)*

06/23/2022 14:07:43

Regards,

RC




Re: ozdotnet - New List Infrastructure

2022-06-21 Thread Tony McGee

Agreed, many thanks to our benevolent list maintainer(s).
Untiring effort, all the way back to when it was called ausDotNet.

PS. That NUC sounds like a champion, it belongs in a museum as Indy 
would say


-Tony


On 21/06/2022 15:17, David Burstin via ozdotnet wrote:
Thanks David for all the work you do to keep this list going. Really 
appreciated.


On Tue, 21 Jun 2022, 14:34 David Connors via ozdotnet, 
 wrote:


Hi All,

I've readded everyone to the new mailman3 hosted environment.
There are a few changes to how message headers are presented etc
as a result of the move to mailman3.

If you want to change your subscription etc then head to
https://codify.mailman3.com.

I am not going to continue keeping the old archives at
http://prdlxvm0001.codify.net/mailman and will bin that server as
soon as I've removed the other lists from it that no one uses any
more.

David Connors
da...@connors.com  | M +61 417 189 363
Telegram: https://t.me/davidconnors
LinkedIn: http://au.linkedin.com/in/davidjohnconnors

___
ozdotnet mailing list -- ozdotnet@ozdotnet.com
To unsubscribe send an email to ozdotnet-le...@ozdotnet.com


___
ozdotnet mailing list --ozdotnet@ozdotnet.com
To unsubscribe send an email toozdotnet-le...@ozdotnet.com




Re: Technology euology

2022-03-24 Thread Tony McGee

> Remoting - Farewell old chum.

I believe they're called smart contracts these days ;-)

T



Re: Online source code management tools - GIT / Visual Studio / Bit Bucket / Other ???

2021-06-10 Thread Tony McGee

Hi all,
I tend to use command line as well, with Sourcetree sourcetreeapp.com 
 as an occasional lifeline when the 
git-fu fails. 


-Tony



On 10/06/2021 14:07, Stephen Price wrote:

Hello Mr Groggy. 

I've been using github for everything. I don't use the in built VS 
tools except for comparing history. I used to use beyond compare but 
the VS context tends to make the diff more useful than a pure text diff.


I use the command line for everything. A team leader suggested I learn 
the cmd line git and don't even install the VS git extensions (it was 
optional back then) and for 99% of stuff command line is what I 
understand.

I sometimes use Gitkraken for visualising branches and diffs of branches.

I do have some code in VisualStudio.com but its essentially an 
upstream duplication of what's in my github. Work in github world and 
occasionally push upstream so client has their copy.


Use what works until it doesn't. Good luck!

cheers
Stephen

*From:* ozdotnet-boun...@ozdotnet.com  
on behalf of Greg Harris 

*Sent:* Thursday, 10 June 2021 10:02 AM
*To:* ozDotNet 
*Subject:* Online source code management tools - GIT / Visual Studio / 
Bit Bucket / Other ???


Hello Again Community,

I am 
disappointed with myhttps://MyAccountName.visualstudio.com/_git/MySolutionName 
 repository 
on VisualStudio.com.


It is feeling clunky and just not working for me from within Visual 
Studio.


What tools are people using for secure private cloud source control 
with what client tools?


I am feeling that Visual Studio is not the tool to use to manage my 
source code, it may be okay as an editor / compiler, but it just does 
not integrate well with the repository, are there better solutions, or 
am I just failing to read the manual properly?


Thanks for your help on this :-)

Groggy Harris





Re: WCF ServiceClient async

2020-05-22 Thread Tony McGee


It's not svcutil magic, it's built into WCF - the channel factory on the 
client creates an implementation of the service interface that supports 
both synchronous and asynchronous calls: 
https://marcinjuraszek.com/2018/01/async-wcf-with-channelfactory.html


Judicious mapping of the ServiceContract/OperationContract names in the 
service interface can let you call the method you want.
The poor maintenance person later on might say that Add Service 
Reference/svcutil is the kinder option for generating the proxies 
though. :-)


T


On 22/05/2020 16:23, Greg Keogh wrote:

TGIF again,

The svcutil command is doing something magical when it generates WCF 
client code. The generated interface and class have both synchronous 
and async methods for each service method. And it doesn't matter if 
your original service methods are async or not, you still get pairs 
generated either way. If I have a service with a non-async method 
GetData() and I run it through svcutil I get a class like this (trimmed):


public class MyServiceClient : ServiceClient
{
  public Task GetDataASync();
  {
    return base.Channel.GetDataAsync();
  }
}

Getting async methods is fabulous, but where on earth do they come and 
how do they work? I spied into the IL to see what's happening, but all 
generated methods call into a generic TChannel (transparent proxy) 
which contains no recognisable code. Is it dynamic code generation? 
But it gets worse...


Svcutil generates vast overkill code, so I prefer to make my own 
client by manually coding a class with the exact same signature as the 
generated one above. This works, but /all the async methods are 
missing/. What the hell is the difference between the svcutil 
generated code and mine? Where did the async methods come from, and 
where did they go?


/Greg K/





Re: Marshall C++ string to C#

2019-11-25 Thread Tony McGee
You could return a BSTR and let the interop marshaling do clean up for you:

https://www.codeproject.com/Articles/1189085/Passing-strings-between-managed-and-unmanaged-code



On Tue, 26 Nov. 2019, 11:09 Greg Keogh,  wrote:

>
> msg is a stack variable, you can't return it iirc. Either create a var on
>> the heap, or pass  msg in as a parameter.
>>
>
> D'oh! You're right. I changed the code to the following and it's working.
> Notice use of CoTaskMemAlloc, which I think is the least worst choice of
> heap allocation functions according to the MSDN docs.
>
> Notice that I've completely forgotten what the lengths are supposed to be
> for string lengths, is it x2 for wchar? is it correct to allocate 200 bytes
> for 100 wchars? The compiler is giving me an overrun warning. You're
> supposed to use sizeof or something like that, but my brain has gone mushy
> on all those rules now (which is part of the reason I never want to code
> this assembler crap again!).
>
> Even worse … what about the memory leak in CoTaskMemAlloc? I make the
> buffer, copy in the string and return it, but it's now leaked. Should I use
> a global static buffer that can be released later? When?
>
> *GK*
>
> [image: image.png]
>
>
>


Re: [OT] Load testing web app

2019-08-21 Thread Tony McGee

Hi,
Visual Studio has load test projects built-in, but they're deprecated 
and will disappear soon:

https://docs.microsoft.com/en-us/visualstudio/test/quickstart-create-a-load-test-project?view=vs-2019

There's a whole raft of alternatives though: load impact k6, 
eggplant.io, Tricentis Flood, SmartBear LoadUI/LoadNinja...




On 21/08/2019 13:50, Tom Rutter wrote:

Hi all

I’m looking for a tool to load test a legacy web app (not specifically 
.net). Preferably something in the cloud but if I must I can get 
something installed on premises. Any recommendations?


Cheers





Re: Distributing Azure apps

2019-07-15 Thread Tony McGee
Phil Haack has a timely post on this: 
https://haacked.com/archive/2019/07/12/deploy-to-azure/


cheers,
Tony

On 15/07/2019 14:52, Donald wrote:
We use Azure DevOps as well, but for the adhoc deployment it is 
possible to publish a Zip file to be deployed via Powershell, ftp or Kudo

see https://docs.microsoft.com/en-us/azure/app-service/deploy-zip
for more information on Kudo https://github.com/projectkudu/kudu/wiki

Don.

On Mon, 15 Jul 2019 at 13:02, Greg Keogh > wrote:



We normally do it from Azure DevOps now with an Azure Web App
Deploy task but quote from here might help:

https://stackoverflow.com/questions/19377217/deploying-a-web-site-to-azure-as-a-package


Thank heavens! There is a way. Now I have something to research.

Thanks heaps, Greg (K)





Re: [OT] SQL Server DB designed for reporting

2019-01-31 Thread Tony McGee
One way to do this is to have a regular job that uses SQL Server
Integration Services package(s) to extract data from the source system,
transform it, cleanse, etc then load it into a destination database (ETL)

Often, but not always, the destination database has a star schema with fact
and dimension tables, that a data warehouse can be built upon. Tools like
SQL Server Analysis Services or Excel/Power BI can understand and slice the
data for the user interface

For large volumes of data there's usually an initial load, then subsequent
runs capture any changed data from the source system and load it
incrementally


On Fri, 1 Feb 2019, 08:27 Tom P  Hi Folks
>
> I have a normalised database for an application that is working well but
> is not performant for reporting. I’ve tried and tried to optimise my
> reporting queries but they are just too slow as the data volume is large in
> the database. What techniques are there to tackle this?
>
> I was thinking of creating denormalised tables for the reports which would
> work but how to automate this so that whenever the main normalised tables
> are updated then the changes “flow into” the denormalised reporting tables
> and stay in synch?
>
> I’m sure this is not a new problem so surely some of the people here have
> been in this situation. Any advice would be appreciated.
>
> Cheer
> Tom
> --
> Thanks
> Tom
>


Re: [Possibly OT] Job scheduler from Sql Server

2019-01-03 Thread Tony McGee
I'm not sure if there's anything within SQL Server that does this
specifically.

If you're planning to write some code to achieve it though then I would
recommend first looking into Hangfire (https://www.hangfire.io) to greatly
reduce that burden.

On Fri, 4 Jan 2019, 08:39 Tom P  Hi folks
>
> I suspect this may require .NET so asking here for advice.
>
> Say I have a schedules table in Sql server with 2 columns (for
> simplicity), name and a cron value. What I wish to build is something which
> will send an email whenever it is time based on the schedules table records.
>
> Will this require a .NET windows service for example to poll this table to
> take action or is there something already present in Sql server (agent?)
> which can do this?
>
> Cheers
> Tom
>
> --
> Thanks
> Tom
>


Re: [OT] Big Windows 10 update

2017-12-12 Thread Tony McGee
Although there's plenty of room for improvements on scheduling when updates
happen (e.g. "active hours" as currently designed isn't good enough IMHO), I
don't see many complaints here about change or the frequency of updates.

Complaints are quite rightly that the software was working before it was
updated, and then afterwards it ranges from flaky to utterly broken.

I'm sure Microsoft is keenly aware of the complexities of updating billions
of Windows devices globally, but the rest of us just want a hassle free
update process and to get on with it. :)



On 13 Dec 2017 13:09, "Stephen Price"  wrote:

What we are experiencing is not a new thing. Change is constant. Each new
release of software, for all things, comes with new bug fixes, new bugs and
new features. Some we need some we don't.
The pain we are feeling is a combination of lack of control combined with
the frequency of these changes.
Once upon a time we had to wait several years for a new release (take
Visual Studio as an example). Now we see new updates weekly and sometimes
daily.
Hopefully the pain we feel is shorter lived as a result. We can communicate
with the Devs much easier now. Often we can see the name of the developer
who checked in the code. We can comment on the codebase and raise issues.
Take the recent icon colour change of VScode for example. For those who
were not watching, they changed the colour to orange (or green depending on
the branch). People were NOT happy. The Devs listened and in about a week
or maybe two it was back to the familiar colour.
Imagine having to wait 2 years to get your icon colour fixed or some other
life altering bug.
You can't make everyone happy all of the time. We are all at the whim of
the developers of the code we use. If you don't like that, you have
options. Feedback or change software. Or write your own.
If you don't like something, change it. If you can't change it, change how
you think of it.

Hmm, might make this a blog post.

On 13 Dec. 2017 9:10 am, David Connors  wrote:

On Wed, 13 Dec 2017 at 10:08 Grant Maw  wrote:

Never thought I'd ever see myself switching to Linux but I have to say that
I'm starting to look very, very hard at it, for all the reasons that Mike
and the Gregs have outlined above. I just wonder if I REALLY need to learn
a new OS at my age ... life is too short :)


I bought a chromebox on a lark a while back.

It said it needed a new OS so I clicked reboot. OS installation and reboot
was ~10 seconds.

Le Sigh.

I was boned by one of these updates in a customer meeting. It half installs
before it wants to reboot and that took out my WiFi. Windows said it wanted
to reboot - sure fine. 1 hour later...

David.

-- 
David Connors
da...@connors.com | @davidconnors | https://t.me/davidconnors | LinkedIn | +61
417 189 363 <+61%20417%20189%20363>


Re: Marshalling strings

2017-10-23 Thread Tony McGee
My understanding would be that either the caller allocated a large enough
buffer and passes it to the library in which case the callee does a copy
and doesn't need to worry about it
-or- the callee keeps the pointer they've given out and expects the caller
to pass it back to another function to do the free/dealloc.

I believe there's standard functions for allocating things like BSTR's from
the COM days (SysAllocString/SysFreeString) where the callee allocates and
the caller is responsible for deallocation but passing out raw wchar_t
pointers without agreeing on a deallocation method isnt great.

On 24 Oct 2017 15:14, "Greg Keogh"  wrote:

> Folks, my REST web service makes calls to C++ functions in a native DLL.
> The functions return wchar_t* which I marshal into a managed string.
>
> The author of the C++ code doesn't know when to free the buffer he's
> allocated for the string (neither do I). The very last statement in his
> function is return char_ptr, so the function ends and the buffer becomes a
> leak. I consume the pointer after his function ends, so when can he delete
> it?
>
> Is there some trick I'm forgetting? Or are we doing it the wrong way?
>
> *Greg K*
>


Re: Context menus for .sln file

2017-07-04 Thread Tony McGee
Hopefully I'm not breaking any rule to give Directory Opus a plug, it's
great for this stuff and loadsmore.
Link: http://www.gpsoft.com.au/
e.g. http://imgur.com/LPcOuOJ

No affiliation at all, just an extremely happy customer - it's actively in
development locally in Brisbane so shout out if anyone from GPSoftware on
this list.




On Wed, Jul 5, 2017 at 2:19 PM, Greg Keogh  wrote:

> Folks, back on Windows 7 I made some registry tweaks to add some really
> handy extra "Open with" shell context menus for the .sln extension. My Blog
> Post
> 
> on doing this is still online.
>
> On Windows 10 the registry changes have no effect. I spent a few hours
> searching and experimenting today to get it working, but no luck. Has
> anyone fiddled in this area? Maybe there are other ways of getting a "right
> click to build" facility. I really miss the convenience of those commands
> on the .sln file, and on other extensions as well.
>
> *Greg K*
>


Re: Entity Framework - the lay of the land

2016-09-20 Thread Tony McGee

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 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: SQL foreign key question

2016-02-08 Thread Tony McGee
This can sometimes happen to a primary key if you use the visual query
designer to create a FK relationship and don't change the defaults before
clicking OK.

It looks like it's ignored in the insert query execution plan.
On 9 Feb 2016 2:32 pm, "David Burstin"  wrote:

> I came across this (snipped to protect the innocent):
>
>
>
> CREATE TABLE [dbo].[V2_BREC_NMIStatusHistory] (
>
> [NMIStatusHistoryId] INT   IDENTITY (1, 1) NOT FOR REPLICATION
> NOT NULL,
>
> 
>
> CONSTRAINT [PK_V2_BREC_NMIStatusHistory] PRIMARY KEY CLUSTERED 
> ([NMIStatusHistoryId]
> ASC),
>
> CONSTRAINT [FK_V2_BREC_NMIStatusHistory_V2_BREC_NMIStatusHistory]
> FOREIGN KEY ([NMIStatusHistoryId]) REFERENCES [dbo].
> [V2_BREC_NMIStatusHistory] ([NMIStatusHistoryId])
>
> );
>
>
>
>
>
> Notice that the primary key identity field has a foreign key constraint *on
> itself*. How does this work?
>
>
>
> I would have thought that any attempt to add a record would check the
> table for the existence of the new key, and as it obviously wouldn’t exist
> yet, that would break the foreign key constraint resulting in the record
> not being written. But, the table has plenty of data.
>
>
>
> Anyone have any ideas how this actually works, or does it just do nothing?
>


Re: Any Powershell gurus?

2016-01-16 Thread Tony McGee

Hi Greg,

It seems unfortunate that you can't specify the drive letter directly 
with Mount-DiskImage
It can be set though, with a bit of mucking around and without the need 
for a dummy drive letter first:


$ImagePath = 
'R:\en_sql_server_2014_enterprise_core_edition_x64_dvd_3935310.iso'
$Volume = Mount-DiskImage -ImagePath $ImagePath -NoDriveLetter -PassThru 
| Get-Volume;

$Filter = "DeviceID = '$($Volume.Path.Replace('\','\\'))'"
Get-WmiObject -Class Win32_Volume -Filter $Filter |% { $_.DriveLetter = 
'Z:'; $_.Put() }


The Get-Volume cmdlet returns a MSFT_Volume CIM class with a DriveLetter 
property, however it's readonly.


cheers,
Tony


On 17/01/2016 10:17, Greg Low (罗格雷格博士) wrote:


Hi Folks,

Anyone know how to do either of the following via Powershell:

·Mount an ISO as a specific drive letter

·Change the drive letter of a mounted ISO

Mount-DiskImage doesn’t seem to have any option for choosing a drive 
letter.


Set-Partition doesn’t seem to recognise a mounted ISO as a partition.

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 





Re: Geographic lookups

2014-08-17 Thread Tony McGee
geonames.org has both free and premium web services, as well as 
downloadable sets of data if you wanted to roll your own.



On 17/08/2014 19:59, Stephen Price wrote:

Hey all,

Am looking for some kind of service for lookups. Country, that gives 
states and regions. Citys optional. Any good ones ppl can recommend?


cheers
Stephen




Re: Surface RT Prices Slashed $349

2013-07-18 Thread Tony McGee
Yeah Rocky Lhotka wrote a great set of posts on Windows 8/RT 
side-loading earlier in the year.

http://www.lhotka.net/weblog/Windows8WinRTSideloadingUpdate.aspx

The deployment story is way too complicated  costly for Small/Medium 
businesses. I really hope Microsoft addresses this issue. With such a 
huge disincentive to deploying Win8/RT LOB applications a lot of SMB's 
will be tempted to toss it in the too hard basket for internal 
applications and look at more viable alternatives.




On 18/07/2013 19:40, Arjang Assadi wrote:

HI Ian,
Nop, the story is quite a sad one: 
http://www.zdnet.com/the-enterprise-sideloading-story-on-windows-8-its-complicated-706742/
In short without Windows 8 Enterprise and buying 100 liceenses for 
3000$ for deployment this is not possible.
It is a pity, SurfaceRT is light and awesome for making apps that 
would circles around other devices but again due to wisdom of 
Licensing Guru it is only good for using with whatever the rest of non 
developer users can use it for.
Is there a way to complain directly to Balmer? Windows Phone also had 
some issues that made it useless for development, one being that it 
required a user interaction to send SMS! Damned tryed to do it for a 
getting notifie if a customer websire is down service.

Thanks
Arjang
On 18 July 2013 16:28, Ian Thomas il.tho...@iinet.net.au 
mailto:il.tho...@iinet.net.au wrote:


Maybe a review of what WinRT *is* could help? This

http://www.infragistics.com/community/blogs/nick-landry/archive/2012/06/19/developing-apps-for-microsoft-surface-windows-8-windows-rt-and-windows-phone.aspx
is from Infragistics, a bit old, but still valid I think:

Also see this

http://www.winsupersite.com/blog/supersite-blog-39/windows8/winrt-replacing-win32-140605
and this

http://msdn.microsoft.com/en-us/library/windows/apps/br230302%28v=vs.110%29.aspx#convert.


Ian Thomas

Victoria Park, Western Australia

*From:*ozdotnet-boun...@ozdotnet.com
mailto:ozdotnet-boun...@ozdotnet.com
[mailto:ozdotnet-boun...@ozdotnet.com
mailto:ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Arjang Assadi
*Sent:* Thursday, 18 July 2013 5:13 PM
*To:* ozDotNet
*Subject:* Surface RT Prices Slashed $349


http://visualstudiomagazine.com/articles/2013/07/16/microsoft-cuts-surface-prices.aspx

Is it me that found the price was reasonable to begin with but
deployment of non-App Store Apps was the pain?

Are people developing and deploying their own custom (NON-APP
STORE) apps to RT with ease? If yes, then can anyone enlighten me
regarding the process to use? (With VS 2012 Professional)

Thank you






Re: SQLite and SQL Server schemas

2013-01-22 Thread Tony McGee
Depending on your application it might make more sense to try to 
constrain the SQLite identity column to 32 bits, but if you can't do 
that you should be able to use a 64bit integer for the SQL Server column:


CREATE TABLE [dbo].[ExampleTable]
(
[ExampleId] [bigint] IDENTITY(1,1) NOT NULL,
[ExampleName] nvarchar(50) NOT NULL,
CONSTRAINT [PK_ExampleTable] PRIMARY KEY CLUSTERED
(
[ExampleId] ASC
)
) ON [PRIMARY]
GO

INSERT [dbo].[ExampleTable] (ExampleName)
SELECT N'Your Data'


On 22/01/2013 9:20 PM, Greg Keogh wrote:
Folks, I was considering being able to swap SQLite and SQL 
Server/Compact/Azure as the backend of my app. I use POCOs as the 
entities and I can generate multiple EDXMs for the databases and load 
them dynamically a runtime. It's a bit tricky to keep everything 
neutral and abstract the database away, but it was looking feasible 
as a good cooding exercise.
Then I suddenly reaslised that the POCOs aren't neutral because the 
SQLite IDENTITY columns are 64-bit and the SQL ones are 32-bit. I ran 
a diff on the POCOs and was suddenly reminded of this difference. Dammit!
So, do I make all the IDENTITY columns in the SQL databases 64-bit to 
match (if that's possible), or perhaps there is some other lateral 
thinking trick I'm missing.
Having a completely replaceable database is a lovely thing to have, 
but tricker in practise than I initially thought with EF5 and POCOs. 
Has anyone attempted this sort of thing before?

Greg




Re: [OT] FYI, Large Dell Monitor Sale (again).

2012-06-05 Thread Tony McGee

Looks like a Logitech Cordless Desktop Comfort Laser.
The Trackman Wheel  Quickcam Pro were the giveaways, folks tend to 
either go nuts on Logitech kit or steer well clear.



On 5/06/2012 4:42 PM, Corneliu I. Tusnea wrote:

Any idea what keyboard is the one in the pictures?
http://www.amazon.com/gp/customer-media/product-gallery/B002R9HQLI/ref=cm_ciu_pdp_images_0?ie=UTF8index=0isremote=0 
http://www.amazon.com/gp/customer-media/product-gallery/B002R9HQLI/ref=cm_ciu_pdp_images_0?ie=UTF8index=0isremote=0 



(The split keyboard in picture 1) ?






Re: Trouble converting utf-8 resource to string

2012-04-15 Thread Tony McGee
Have you tried constructing a StreamReader object (passing in the Stream 
object + Encoding into the StreamReader constructor)

then calling XDocument.Load(StreamReader) to create the document?


On 15/04/2012 6:26 PM, Greg Keogh wrote:


Folks, I have an XML file as an embedded resource. The file looks like 
this and I know it's utf-8 encoded because in the binary editor I can 
see it starts with 0xEFBBBF


?xmlversion=1.0encoding=utf-8?

root

stuffFoobar/stuff

/root

However, when I run the following code to get the raw bytes from the 
resource and convert it to a string I don't get the nice string I 
expect. The resulting string starts with the character 0xfeff which is 
a Unicode BOM and then XDocument dies attempting to parse that string.


using(Stream s = 
typeof(Program).Assembly.GetManifestResourceStream(MyProgram.XMLFile1.xml))


{

byte[] buff = new byte[s.Length];

s.Read(buff, 0, buff.Length);

string xml = Encoding.UTF8.GetString(buff, 0, buff.Length);

XDocument doc2 = XDocument.Parse(xml);

// This dies because xml[0] is the character 0xfeff

}

I've tried different overloads of Encoding classes but it makes no 
difference. I could have sworn I was a boffin of bytes and encoding, 
but I've no idea what's going on here. Any ideas anyone?


Greg





Re: File/folder sync options for Windows

2012-04-08 Thread Tony McGee

I use SyncBack http://www.2brightsparks.com/

They have a free version which just runs as an icon in the background 
but quite configurable with different sync options and sounds like it 
should do what you need.
They also have Std/Pro paid versions which can run as a service  
includes load of plug-ins, add-ons  the kitchen sink.


In general, syncing between network file shares is fine with SyncBack 
but SFTP/FTPS performance left a little to be desired back in 2008 when 
we tested it. Not sure what it's like now.
For anywhere that needs both network file share  SFTP sync we use 
BatchSync Secure instead http://www.3dftp.com/products.htm


Cheers,
Tony


On 6/04/2012 8:41 PM, Greg Low (GregLow.com) wrote:


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 
4913 fax


Web: www.sqldownunder.com http://www.sqldownunder.com/





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

2012-02-24 Thread Tony McGee

  
  
Seconded - we still support a really old Windows Mobile apps that
requires Visual Studio 2003, database projects that need to support
both SQL Server Reporting Services 2005 and 2008 incompatible
versions of RDL and report viewer controls, and some ASP.NET 4/.NET
4 web projects that require VS2010.
I reckon our case of having to install up to four different versions
of Visual Studio side by side is not that uncommon. It's maddening
having to fight against the VS project upgrade wizard that always
seems to be waiting in ambush.


On 24/02/2012 6:24 PM, Nick Randolph wrote:

  
  
  
  
  
Oh
the sheltered life you live. Break out of the MS bubble for
a while and watch what happens in the real world. Even some
dev shops are stuck on VS2008 in the same way as some
enterprises are on WinXP.
 

rant If you do anything related to the old Windows
Mobile platform, for example, you have to use VS2008 – and
no, there are some cases where we can’t just build a Windows
Phone version. Microsoft officially screwed us when killing
Windows Mobile as there is no alternative for line of
business applications that require peripherals and/or
ruggedized devices L
/rant
 

  Nick
Randolph
  |
  Built to Roam Pty Ltd | Microsoft MVP – Windows
  Phone Development | +61 412 413 425 | @btroam
The
  information contained in this email is confidential. If
  you are not the intended recipient, you may not disclose
  or use the information in this email in any way. Built to
  Roam Pty Ltd does not guarantee the integrity of any
  emails or attached files. The views or opinions expressed
  are the author's own and may not reflect the views or
  opinions of Built to Roam Pty Ltd.

 

  
From: ozdotnet-boun...@ozdotnet.com
[mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of
David Kean
Sent: Friday, 24 February 2012 3:58 PM
To: ozDotNet
Subject: RE: New look of Visual Studio, what are
your thoughts?
  

 
Thanks for the feedback. On the three different
versions things, why are you using three? What you building
that still requires 2005/2008?
 
From: ozdotnet-boun...@ozdotnet.com
[mailto:ozdotnet-boun...@ozdotnet.com]
On Behalf Of mike smith
Sent: Thursday, February 23, 2012 9:35 PM
To: ozDotNet
Subject: Re: New look of Visual Studio, what are your
thoughts?
 
On Fri, Feb 24, 2012 at
4:15 PM, David Kean david.k...@microsoft.com
wrote:
 We showed off the new look today: http://blogs.msdn.com/b/visualstudio/

  

 Thoughts?

I agree, somewhat, about the colour, but feel you've gone
too far towards monochrome.  And if you make me learn a new
set of damned icons, I won't use the bloody thing.  This is
one thing I wish Microsoft would stop tinkering with.
 Icons, menu layouts, dialog layouts.   Some of us don't
move on completely from one version to another, but use 3
different versions of VS.  Do you have any idea how painful
this is? 

 

   


  Take the
  comment/uncomment icons. WTF are they meant to represent?


   


  /rant


   


  
  
  -- 
  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

  


  



Re: makecert fixed on RSA ?

2011-12-27 Thread Tony McGee

Hi Tom,

The signature algorithm that you can select from there (md5, sha1, etc) 
is a particular type of algorithm called a cryptographic hash function 
that is used for generating a small hash value from a much larger 
quantity of data. AES is a different type of algorithm (symmetric key) 
used to encrypt bulk quantities of data and so doesn't make sense to use 
it in that context.
The public key algorithm of the certificate (in this instance, RSA) is 
something different again, and is typically used to encrypt a small 
amount of data such as a symmetric key or hash value from the previous 
algorithms.


The Windows CryptoAPI does support using both symmetric key and 
asymmetric (public) key algorithms, but how you would use both at the 
API level depends upon your particular application. The makecert tool 
you're playing with leads into a fairly complex set of topics, so unless 
you have a specific goal in mind it's difficult to provide detailed 
direction through the mailing list.


To get a better handle on the difference between hashing/symmetric 
key/asymmetric key algorithms and what they're used for I would 
recommend picking up a cryptography fundamentals book such as Bruce 
Schneier's /Applied Cryptography/ 
http://www.schneier.com/book-applied.html or a similar tome. From there 
it would make sense to head over to Technet or narrow your study to a 
specific book on how Microsoft has implemented these fundamentals in 
Windows and what's achievable/recommended practices:

http://social.technet.microsoft.com/wiki/contents/articles/windows-pki-documentation-reference-and-library.aspx
http://www.microsoft.com/learning/en/us/book.aspx?ID=9549locale=en-us 
http://www.microsoft.com/learning/en/us/book.aspx?ID=9549locale=en-us


Cheers,
Tony

On 27/12/2011 7:49 PM, Tom Gao wrote:


Thanks for everyone's response

Many thanks Peter for your detailed response.

I am trying to understanding X509 better and also windows certificate 
store. As I haven't spent much time playing with certificates in the 
past. My initial assumption was after looking at my self generated 
certificate that in my test certificate generated using the command.


makecert -r -pe -n CN= DevServer TestCert 26/12/2011  -ss 
MyCertificateStore -sr localmachine


When opening certificate store in mmc, and browsing to the certificate 
location I could clearly see Signature Algorithm my initial 
assumption is that you can change this from sha1RSA to something 
else. My thoughts were about changing the signature algorithm to 
something else and not necessarily to AES. There didn't appear a way 
to do this via the certificate store. Actually I later realised that 
the only way to do this is at the time of generation for the certificate.


-a algorithmThe signature algorithm

md5|sha1|sha256|sha384|sha512.  Default to 'sha1'

It would appear that makecert supports the following algorithms. 
However does that mean that the windows server 2008 certificate store 
only supports certificates with the above algorithm? My understanding 
of x509 certificate is that it PKI so then what about other PKI 
algorithms out there?


Also does this mean we can't create certificate for symmetric 
encryption? Does this then mean that windows certificate store do not 
support symmetric encryption?


I'm not trying to achieve anything just trying to understanding 
certificates and the certificate store better. Sorry for loads of 
silly questions. But I really just wanted to confirm my understanding.


Many thanks,

Tom

*From:*ozdotnet-boun...@ozdotnet.com 
[mailto:ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Peter Maddin

*Sent:* Tuesday, 27 December 2011 6:17 PM
*To:* 'ozDotNet'
*Subject:* RE: makecert fixed on RSA ?

For what's it's worth (from work I did ages ago).

RSA is an asymmetric cipher (as is Elliptic Curve(ECC)).

AES is a symmetric cipher as is Rijindael, twofish, OneFish, BlowFish etc.

I think AES is very similar or a variation of  Rijindael (see The 
Differences Between Rijndael and AES, 
http://blogs.msdn.com/b/shawnfa/archive/2006/10/09/the-differences-between-rijndael-and-aes.aspx).


As far as I understand it, as an asymmetric cipher is slow, it is used 
to encrypt exchange keys for a symmetric cipher (exchange keys are 
generally randomly generated) and to encrypt digital hashes (aka 
digital signatures). The DSA used to be the SHA-1 algorithm, but as 
this function has been broken, a better digital hash should be used 
(i.e. SHA-224, SHA-256, SHA-384, and SHA-512).


This forms the basis of PKI and asymmetric keys are mostly distributed 
using X.509 digital certificates. Certificates can be used to 
distribute both pairs of asymmetric keys (private and public) or just 
the public ones. The public keys are made publically available while 
private keys are kept as securely as possible. It does not make sense 
to distribute symmetric keys via X.509 certificates. I am not sure 
that this even possible. I think the Diffie--Hellman key 

Re: Any one using Rockford Lhotka's CSLA?

2011-06-02 Thread Tony McGee


We used an older version (3.0.x) it on a green field LOB Windows Forms 
project around 2007 targeting .NET 3.0 and then 3.5 as soon as it became 
available. CSLA.NET has advantages and disadvantages I guess.
It's not an ORM, but can work with your choice of ORM to persist 
business objects.
We'd would likely use it again with v4.0 for new code, but wouldn't look 
forward to logistics of porting a v3.0 legacy code base to the latest 
version when we need to move to .NET 4.

Here's a mini-review, apologies for the length!

*Good points:*
- There's a fairly decent sample application and lots of little code 
projects that comes with the sample app showing how the library can be 
used with multiple UI  n-tier technologies.


- It's great for providing structure to business objects that live 
behind CRUD screens, the n-level undo and support for ErrorProvider. In 
particular the databinding support was really good. In fact, the major 
reason we stuck with it was simplification of the plumbing code - 
consistent business rules and implementation of INotifyPropertyChanged. 
CSLA databinding (and databinding in general) is much better with WPF, 
and there's support for model binding in ASP.NET MVC but I haven't used 
it as much with those two.


- The business logic framework methods allow you to perform fairly 
advanced logic in a structured way that automatically gets called when 
you change a property. CSLA v4.0 seems even better in this regard where 
business rules are full classes in their own right instead of just 
methods on the business object class.


- User feedback is directly integrated into subsequent versions of the 
library. e.g. Property getters/setters and the business rules 
architecture in v3.0 heavily relied on magic strings in your class that 
made refactoring a pain. This has been fixed in v4.0


- The learning curve is moderate, not too bad, but not trivial either. 
Once you get the basics, you can keep applying the same patterns.


- It's open source so in the worse case scenario so your project isn't 
left in the lurch if Magenic folds and you can dig deep in case things 
break or try to understand what's going on.


*Bad points:*
- The free documentation seems to be limited to snippets on the forum, a 
couple of DNR.TV episodes and the sample app. There's a print book and 
video series available and an ebook series in the works. The books  
videos cost a little bit of money but it's comparable to buying any 
other 3rd part component. If you haven't used CSLA.NET before they're 
worth every dollar. Having said that though, the latest print book 
targets the 3.8(?) version of the library, which is different from the 
latest RTW version so you'll only be able to take the concepts away  
not the code.


- The library is in constant flux, and breaking changes seem to creep in 
a lot. So much so that we stuck with the most recent 3.0 version 
throughout the 3.5-3.8 releases, and now porting our business objects to 
4.0 seems like it would involve almost as much effort as starting from 
scratch.


- When we tried to apply the framework to a few scenarios where the 
business object wasn't backed by a database entity it would occasionally 
felt like the framework was a little bit rigid. There were only a few 
cases so we shoehorned, it but it might have been just as worthwhile to 
abandon it in those cases.


- There are some quirks relating to what's happening under the hood 
(n-level undo I think), e.g. creating two separate instances of a new 
business object the framework would sometimes get confused as to which 
one was which.

e.g. var c1 = Customer.NewCustomer(); var c2 = Customer.NewCustomer();
The workaround was to incorporate a Guid into the 'identity' of the 
object from a override method that is called by the framework if the 
object hadn't been saved yet. After it had been saved, returning the 
database assigned identity was sufficient. I might have been committing 
some cardinal CSLA sin here, so not sure whether it was a bug or by 
design or whether it's still like that in v4.0.


 - The difference between 'read only' business objects and 'read/write' 
business objects is fixed at compile time - you inherit from specific 
base classes. Likewise with Parent/Child business objects. The framework 
seems especially rigid in this regard, but I'm sure there's a reason for 
it, I just never understood it fully.



Cheers,
Tony McGee


On 2/06/2011 2:57 PM, Kirsten Greed wrote:


Hi All

Is anyone using http://www.lhotka.net/cslanet/

I am thinking EF4 may be good for reading and writing data from tables 
-- but not for implementing domain logic.


Kirsten



*From:*ozdotnet-boun...@ozdotnet.com 
[mailto:ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Greg Keogh

*Sent:* Thursday, 2 June 2011 12:14 PM
*To:* 'ozDotNet'
*Subject:* RE: building the domain model - what tools to use?

Folks, I've also been trying to do

Re: Handling 3rd party assemblies with build servers

2011-02-08 Thread Tony McGee

Interesting, our dev team was talking about this issue just today.
In our team we check in any 3rd party assemblies into a folder like 
you've done. If an assembly is downloadable in source form we do a 
compilation and then the source goes with the pre-built assembly and 
generally works pretty well.


One of the other devs mentioned difficulty with the DevExpress 
components not installed on the build server and causing issues with 
building if the bundle wasn't installed there. We should probably talk 
to the vendor, but it was quicker to just perform the install even if it 
feels dirty to make a dependency on any part of machine config other 
than vanilla Visual Studio.

I'm interested if anyone has solved this issue as well!

Tony


On 8/02/2011 2:09 PM, David Burela wrote:
For the last few years I've used a fairly standard way of handling 3rd 
party assemblies.
In source control, I create a folder called 3rd Party Assemblies 
which is where I put all the external references (like nSubstitues, 
Ninject, etc.).


/DavidSolution
DavidSolution.sln
/3rdPartyAssemblies
/nSubstitue
/Ninject
/...
/Project1
/Project 2
/...


It works well, learnt it from Mitch years ago. However something that 
has always tripped me up, is how do you handle assembiles that are 
installed on the computer?
Here I am thinking of *Telerik, Component art, DevExpress,* and most 
other purchased libraries.


At the moment I am using Telerik, you need to install it onto your 
machine and it puts the license file somewhere.
We have a number of devs working on the same project, so we all 
install the tools on.
Now when it comes to building, i'll need to install the tools into the 
build server. Whenever a new version comes out, i'll need to get 
everyone to update the computers and if they forget, then people are 
out of sync, or they could be working on 3 different projects and 
their other projects may not be upgraded yet.


If I copy all the Telerik controls that I need into the 3rd Party 
Assembly folder, then when I upgrade my version of Telerik I can just 
copy the new .dlls into the 3rd party assembly folder, and all other 
devs will automatically pull down those .dlls with a get latest. and 
hopefully the build server will work with them just in the 3rd party 
assembly folder, but there might be a license issue?


Putting the .dlls into the 3rd party assembiles folder seems like a 
good idea to make sure that the project is on a specific version of 
the tools. BUT then you lose some other features like having Telerik 
automatic migration your solution references to the latest version of 
the assemblies.




*So to sum up my question:*
With the libraries that you need to install (Telerik, Component Art, 
DevExpress). How do you guys handle the assembly references? Include 
in source control, install the framework on EVERY computer? or some 
other solution?

-David Burela




Re: [OT](ish) Interview Questions

2011-01-20 Thread Tony McGee

You're hired! Coffee as a Service (CaaS) is going to be the next big thing.


On 20/01/2011 11:02 AM, Noon Silk wrote:


Haha, wow, I would completely fail here. I must admit I have no
technical understanding of the process of coffee making. I could
explain the process of walking to the local cafe though.





Re: Visual Studio installer problem

2010-12-03 Thread Tony McGee

+1 recommendation for the WiX toolset.
Depending on how complex your requirements are you may not even need a 
custom action just to write configuration to an XML file. We've had 
success collecting some MSI variables at install time and then using an 
xpath expression to save the values to app.config.



On 4/12/2010 10:48 AM, Mitch Denny wrote:
Time to switch to WiX I'm afraid. You can typically migrate your 
Installer derived classes to WiX managed custom actions (DTF).


Sent from my Windows Phone

From: Greg Keogh
Sent: Saturday, 4 December 2010 8:48 AM
To: 'ozDotNet'
Subject: Visual Studio installer problem

For years now I’ve been making MSI files with the Visual Studio Setup 
projects. My setups are all out of the box, the only fancy bit is that 
I sometimes use a Custom Action DLL to collect parameters from added 
Dialogs and write the values to an XML file for the installed app to 
use. I’ve been using the CA for years as well.


Yesterday one of my typical Setup projects became “diseased” and the 
first time I ran the installed WinForms app it would run a repair and 
overwrite my XML file of collected parameters. This auto-repair runs 
the first time I run the installed app. Once this “first-run-repair 
disease” sets in, it gets stuck in the project forever. Backing out 
changes will make no difference. The only way to cure the “disease” is 
to delete the whole project and make another one.


I spent 4 hours trying to overcome the problem yesterday. This morning 
I’ve spent another 2 hours creating a fresh Setup project and 
bit-by-bit I carefully added changes to the project. When I added 
custom BMP images to the setup dialogs the “disease” appeared and is 
now permanent again. I find it hard to believe that adding the images 
would cause the disease. So I’m going to delete it all and start over 
again to try and find a pattern.


6 hours of unpaid work and still counting and people are waiting for 
my MSI ... Anyone seem this problem before?


Greg