Thanks for the clarification, all good then :-). I can confirm my account is not a zombie! If this extra context was in the original comment, it would have been a lot easier for me to understand why people approach it with caution.
Tomas Petricek
Posts
-
fsharpConf 2018 -
fsharpConf 2018Sorry. If this kind of post is not welcome here, please let me know and I'll delete it, or delete it yourself. I was only posting this, because the previous instance of the conference was advertised here by the administrators, so I assumed it is fine. I would not, of course, post this if it was not a free community event. As for "what's stopping me from being an active member now"? Mostly things like work, family and open-source which all takes more of my time than it did 9 years ago, but is it really that surprising that people's preferences for how to spend their time change in a decade? I had a good time here when I was active, but I did not expect that leaving CodeProject for some time will get you this sort of treatment when you come back hoping to share something that you're doing which might be of interest.
-
fsharpConf 2018Back in March 2016, I organised fsharpConf 2016, a virtual one day conference on F# hosted on Channel 9 and fsharpConf even made it to the CodeProject homepage. Reading the thread about it brings back some good memories from when I was an active CodeProject member! We are doing fsharpConf again this year! It will be live on Channel 9 on Monday 16 April and you can find the full agenda at fsharpconf.com. The program covers a lot of topics including web programming, F# to JavaScript compiler Fable, machine learning, cloud and even quantum computing! I was quite surprised to see the last edition on CP homepage; if that could happen again, that would be amazing. If you need any help with that, let me know!
-
fsharpConf 2016 liveHahaha, does answering here resurrect the thread, or not? :baaaa!: Anyway, we're doing fsharpConf again this year (see fsharpconf.com) and I managed to remember that I saw it back in 2016 on CodeProject, which was awesome (thanks so much for sharing it with all the CPians) and I was wondering if we could make the same thing happen again this year... And as I was trying to find out if my memory is right, I came across this 2 year old thread and remember all the good times with CodeProject back in the days :-)!
-
A career questiondnh wrote:
Sounds fine, more years of parties, girls, drinking etc.
I don't want to speak for others, but ... :zzz: you know...
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
C# or VB.NET ? Which one do you perefer ?F# :cool:
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Learning F#Hi Josh, First of all, I should mention that I started learning F# more than a year ago and I'm using it a lot (so I'm very glad to hear that it will get more support from Developer Division). Regarding the books, I have seen both of them. "Foundations of F#" by Robert Pickering and I think it is a great book that I would recommend to anyone with C# backround. There is also second book "Expert F#" by Don Syme and others, which explains more details and uses the new F# syntax, so if you want to become F# expert, you'll need this one (too) :-). I agree that there are only a few resources about F#, but I hope that it will get better. As someone already mentioned, you can read an introduction to OCaml language, because F# is largely based on this language. Anyway, I started writing a tutorial about F# some time ago (though it is quite short and covers many things, so it may not be appropriate for a complete beginner in the field). It is almost done :-), but I still have a few remaining parts to finish, but if you (or anyone else) wanted to read at the unfinished version, send me a private message. I hope to publish it on my blog in a next few days. BTW: I'd be glad to post it to the F# section at CodeProject once Chris creates this section :rolleyes:
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
I think I'm becoming vegetarian...Jonathan [Darka] wrote:
Right and of course vegetables/fruit don't have proteins. Vegetable proteins are far superior to animal proteins and have significantly less carcinogenic properties.
Hmm, maybe... but meat proteins certainly taste better :laugh:
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Friday Programming QuizThis time I'll abandon Visual Basic, if you won't mind :) In F# it can be solved using one recently added feature called computation expressions (similar to Haskell monads). It's not that trivial to implement, so I will not send full code, but after writing some supporting code, it could be used like this:
// You'll probably want to keep code to perform action
// and rollback together, so I'll write it like this..
let operation1 () =
Compensable
(code { do printf "First action.."
// .. any ordinary F# code ...
// returns 'Some' if succeeds, otherwise 'None'
// (so it can return some value and not just bool)
return Some(42) })
(fail { do printf "Reset first.." })// Use the 'compensable' operations here...
let main () =
trans
{ let! v = operation1()
do! operation2(v+v)
do! operation3()
// ... some more F# code }If the
operation2
fails, theoperation3
will never be executed and the code that forms thefail
part of theoperation1
will be called - it is not needed to write this explicitly, because thetrans
block which wraps the code handles this automatically. It's just a quick sketch, but you can see the most beautiful thing - that is that once you write the code that makes this possible, you don't have to do anything special to execute it and handle compensations - just write 'primitive operations' in some way (combining function to execute the opearion with a function that does the compensation) and wrap the code in some block (I used the nametrans
). All the compensation handling is hidden in a few basic functions (that the code sample I posted doesn't show). PS: It's actually very interesting example :) I'm currently learning for some exams, but after that I'll write a blog post about this. Thanks for the inspiration!Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Friday Programming QuizI think part of the scariness is the VB syntax for queries. VB queries contain almost anything you may ever need (I was quite suprised when I tried it :-)). That's the VB style of doing things - it makes programming easier, but you can easily write really ugly and inefficient code. The C# queries are slightly better (they don't direcly support 'Skip' and 'Take'), but in general the simplicity still hides a lot from what is actually going on. I think that when the same thing is written using the new language features (general purpose features, so no queries!), it doesn't look that scary. It will be a bit longer though (I'm switching back to C#, since I'm not sure how VB does anonymous functions - though I expect that it will be uglier than in C#):
// It would look roughly like this..
args.Select(a => Int32.Parse(a).SortBy(a => a).Skip((args.Length - 5) / 2).Take(5)Using this syntax it is much easier to see what the code actually does - It's sill not perfect, but it's probably the best that can be done in C#/VB-like language. In functional languages (e.g. in my favorite F# for .NET) solutions like this are more natural (once you learn the language basics), because supporting code like this was the goal of the language design from the beginning.
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Friday Programming QuizRama Krishna Vavilala wrote:
Full marks to a VB.NET 9.0 solution.
Now, that's a challenge!! I haven't used VB for at least 5 years, but here we go...
Sub Main(ByVal args() As String)
For Each n In (From a In args Select r = Int32.Parse(a) Order By r Skip (args.Length - 5) / 2 Take 5)
Console.WriteLine(n)
Next
End SubHomepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
New York to LondonAnd I guess you had much better food than in usual airline company :-)!
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Friday Programming Quiz [modified]I admit that my code may look a bit scary because I used a few "advanced" functional tricks, but once you get the idea than it is easy to understand and easy to write. When I attended my functional programming class I didn't understand anythin either and I wasn't very interested in playing with it to learn it because it is quite difficult to do anything fancy in Haskell, but than I started playing with F# which is a lot of fun because you can use everything from .NET so it's very easy to start... Anyway, I think that functional programming is slowly getting into a real world - look at C# 3.0 or Python - they both have quite a lot functional concepts in them...
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
A word gamelike..
A I * A
:) ?Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Friday Programming Quiz [modified]... or if you want just a one line version (excluding the data initialization), then it can be written like this:
drinks |> List.filter (snd >> Seq.for_all ingset.Contains) |> List.map fst
:rolleyes:
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Friday Programming Quiz [modified]Very nice quiz for functional languages :-). In F# it looks like this:
let drinks = [
("Anna Kournikova", ["Vodka"; "Kahlua"; "Skim Milk"]);
("Flaming Dr Pepper", ["Beer"; "151 Rum"; "Amaretto"]);
("Pina Colada", ["Rum"; "Coconut Juice"; "Pineapple Juice"]);
("Mint Julep", ["Mint"; "Bourbon"; "Sugar"])];;
let ingred =
["Vodka"; "Rum"; "151 Rum"; "Beer"; "Amaretto";
"Kahlua"; "Skim Milk"; "Mint"; "Sugar"];;let ingset = Set.of_list ingred;;
drinks |> List.filter (fun (_, ing) -> ing |> Seq.for_all ingset.Contains )
|> List.map fst;;Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
WTF !!Now, this is your chance to apply at Mozilla as a web browser develper! C'mon, it CAN'T be Microsoft's mistake! :laugh:
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
Ummm... What'sGoogle cache[^] still contains the original version :-) and it looks that the download[^] wasn't deleted from CP.
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
bustedAhh, I see - another World 2.0 feature!
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers -
A question of style: inline delegatesYes, I knew he was :-), but lambdas in C# 3 are much nicer when compared to anonymous delegates so I had to answer in C# 3.
Homepage: TomasP.net | Photo of the month: Calendar | C# and LINQ, F#, Phalanger: My Blog
Latest article: Phalanger, PHP for .NET: Introduction for .NET developers