It's been around for a few years at least. And it's pretty amazing. It's not going to be able to write every single type of app out there, but it certainly does exactly what it says it does.
Phil Martin
Posts
-
If You Had It To Do Again... -
If You Had It To Do Again...It all comes down to what you need, as usual. If it is just to display some marketing content with a few forms to get some customers in contact - wordpress all the way. There's loads of templates out there, and if you can't find one that fits you can find people that produce wordpress templates for you for very small amounts of money. WordPress is all yucky, and you'll need to take a shower afterwards, but you'll be up and going so quickly with a pretty great result. I inherited the management of a WordPress site that made use of the Advanced Custom Fields plugin. You can attach any sort of fields to any post type (blog, page etc). It made getting a UI to edit content so simple, and the backend php was a breeze to copy and paste to get going. Each time I tinker with it I mentally recoil in horror at just how much boilerplate I'd have to write to get the same effect in asp.net MVC. If you're after something a bit less one-size-fits-all, I'd go for a static site generator. Theres LOADS of them out there. Set up your templates, content markdown, run a command, and out pops regular plain html read to be statically served. But for a complete web app - I can't go past asp.net. I love the debugging experience. Node in vscode is almost as nice, but I'm just not as familiar with it.
-
If you would have to choose between GIT and SVN or between SVN and GIT?Mercurial or Fossil. For Mercurial, better windows GUIs, you won't have changesets disappear (I'm looking at you detached heads) and a whole bunch of other objective and totally sound reasons unrelated to me my intense personal dislike of Git :) .
-
Inquiring Minds Wanna Know...Yes, but only if it adds to the why and how it's used. If it is just a backing field to some other property, them almost always no. If it is some super important field necessary to making the simulated annealing work just right, then mostly definitely yes.
-
Choosing a new language for web development.Thanks Marc. I've been swimming in the muck that is the current web-dev swamp, and your excellent description was enough to give me enough hope there is a manageable way through this mess :)
-
The new serializer is coming (for real this time)Looking great Lloyd. That GenerateCSharpCode() will be the feature I'm looking forward to :) Every serializer I've written in the last 5 years must have that. I've found that to be the easiest way to handle changing file versions over time. Is it binary compatible with anything else? I'm assuming no, just curious.
-
Way of Kings: Brian Sanderson (free amazon download)It's a fantastic book. It's a great strategy for Sanderson now that the second book is available. Free first book, and the second book $10 or so on Kindle, and it's about 10% bigger again. Best $10 I have spent in a loooooong time.
-
Microsoft is about to make Office 365 even better for small and medium sized businessesI subscribed to Office 365 because it was an overall more cost effective greenfields choice for me. I had no existing office license to use, so I needed to either buy a license ($200 or so) or go Office 365 ($15 or so). I also also wanted hosted mail, and I was originally going to go for Google Apps (because it was familiar) for $5 a month, but then needed a license for office. So I decided to go for Office 365 because I got Outlook as my online mail clients (its pretty nice) and desktop installations of Office as well. So I'm ahead for the first 2-3 years, at which point I would have likely upgraded again anyway. Also, I have found the animating UI elements in Office 2013 to be the big surprise feature for me. It sounds silly, but when you edit chart data in excel, or chart ranges, all the chart smoothly animates to the new state, giving some nice feedback on how things changed. Oh, SkyDrive for Business is just the worst. Never ever use it. Ever. And the way it integrates with the desktop applications - ugh. With a poor or missing network connection you sit staring at a busy cursor for 15 seconds.
-
How can i make this program Parrallel ?Thanks for taking the time to reply. And I agree, parallel.for would have been the least invasive. And no offense taken!
-
How can i make this program Parrallel ?Ha! I wish I had multitasking hard disks! My choice of wording was poor, and I hope the code clarified the intent, i.e. choosing the simplest point in the original code to parallelize. Will the changes be optimal? No. Will they be parallel with significant and measurable difference? Yes. And yes, there are many other options, but I think this was one of the simpler approaches to understand. If they already understood ways to set up a dataflow to achieve the task, I'm pretty sure they would have already done it that way.
-
How can i make this program Parrallel ?Thanks for clarifying that for me Rob. And I agree with you, there are many other things I'd do first and differently. I was aiming for minimum effort on the developer's part with minimum side effects. I'll edit the post and try to be a little less ambiguous about my intent.
-
How can i make this program Parrallel ?There are a number of ways you can approach this. The simplest is to execute the body of your outer loop for multiple files at the same time. You can use the Task Parallel Library that is part of .Net for this. The 'Task' classes let you run code in parallel and wait for results at the end. If you choose to do that, the problem is now "How do I merge results of concurrent indexes into one big index" Some possible solutions are:
- Use a lock to protect access to the index
- Create separate indexes and merge them at the end.
I would go with the second because it uses less shared state, and has less chance of me introducing a difficult to find bug
var indexFilesTasks = (from fname in fnames
select Task.Run(() => IndexSingleFile(fname, stopWords, () => worker.CancellationPending))).ToArray();Task.WaitAll(indexFilesTasks);
index = MergeIndexes(from t in indexFilesTasks
select t.Result);The IndexSingleFile() method contains all your code in your foreach (var fname in fnames) loop. The MergeIndexes() method takes multiple Dictionary() structures, and merges them together. Below is the code I used for these. Note this isn't the "best" way, but just one way of approaching the problem.
Dictionary<string,IndexEntry> IndexSingleFile(string filename, HashSet<string> stopWords, Func<bool> isCancelling) {
var index = new Dictionary<string,IndexEntry>();// Open file, read in file contents, // process each line one at a time // split into words, add word to index if not already present // increment occurrence count for this file and record line number. string\[\] lines = File.ReadAllLines(filename); for (int i = 0; i < lines.Length; i++) { string\[\] wordsInLineRaw = Regex.Split(lines\[i\], @"\\W+"); string\[\] wordsInLine = new string\[wordsInLineRaw.Length\]; for (int p = 0; p < wordsInLineRaw.Length; p++) { wordsInLine\[p\] = wordsInLineRaw\[p\].ToLower(); } // Process each word found in line for (int j = 0; j < wordsInLine.Length; j++) { string w = wordsInLine\[j\]; // If word in stop list break if (stopWords.Contains(w)) continue; //if word not in index add it if (!index.ContainsKey(w)) { i
-
Headset with Microphone.Wouldn't you have you shout pretty loud if you were using it from a distance? :)
-
FaarrrkkkkYou just summed up just about every mobile site ever. I hates em.
-
How did you learn to code? Help aspiring developers by sharing your experienceOh wow, I had forgotten about those. I remember typing in a basic program for measuring race times for a sports carnival at school. I never did find out if it worked. Come to think of it, my QA skills may not have improved much :) I am not sure what the modern equivalent would be, and I'm pretty glad I can just copy and paste now.
-
Is there a programming language...Yeah, it is unfortunate. In the engineering applications I write, I've created a ScalaryQuantity and a VectorQuantity class. They are just the usual numeric structures which support all the normal arithmetic, but supports keeping track of units, and converting units when necessary. There's a big run time overhead involved, but for me it is worth it because it has helped me catch many errors far earlier in the process of developing new calculations.
-
Is there a programming language...Yes. F# supports units of measurement[^]. For example, you can do this:
[] type years
let myAge = 32
The downside this is strictly language support, and not runtime support. Units are lost at runtime, but it's still pretty handy.
-
Browsing NuGet has its advantages...Thanks Brisingr. That is very cool, it looks like I might have a new compression library to use! Yes, one could use a CryptoSteam, but one of reasons I use Zip is that almost every computer has basic tools to access them, and embedding a encrypted file in there stops that.
-
Browsing NuGet has its advantages...Wow, a c# implementation of a 7zip decompressor! That is very impressive of SharpCompress. I had a quick look at it, but it couldn't find it - does it support compressing to zip with password encryption?
-
Browsing NuGet has its advantages...Reactive extensions, mongoDB, Dynamic Expresso, SharpZipLib.