Skip to main content

Posts

Showing posts from October, 2017

Optimizing ASP.NET Core Docker Image sizes

There is a great post from Steve Laster in 2016 about optimizing ASP.NET Docker Image sizes. Since then Docker has added multi-stage build files so you can do more in one Dockerfile...which feels like one step even though it's not. Containers are about easy and reliable deployment, and they're also about density. You want to use as little memory as possible, sure, but it also is nice to make them as small as possible so you're not spending time moving them around the network. The size of the image file can also affect startup time for the container. Plus it's just tidy. I've been building a little 6 node Raspberry Pi (ARM) Kubenetes Cluster on my desk - like you do - this week, and I noticed that my image sizes were a little larger than I'd like. This is a bigger issue because it's a relatively low-powered system, but again, why carry around x unnecessary megabytes if you don't have to? Alex Ellis has a great blog on building .NET Core apps for Ra

C++ STL Unordered Set – std::unordered_set

In this tutorial you will learn about stl unordered set container in c++ and various functions applicable on it. Unordered Set comes under unordered containers. As we discussed in introduction to stl article , unordered containers internally implemented with hash tables. Each item calculated by hash function, to map to hash table . The main advantage is if we have effective hash function we can find elements in O (1) time. On average it can go to linear time. Simply we can say it’s based on type of hash function used. So we can say these are fastest among all containers. As name says that in unordered_set the order is not defined. Unordered set doesn’t allow duplicates. C++ STL Unordered Set – std::unordered_set Useful iterators to work on this unordered set: begin(): returns iterator to the beginning end(): returns iterator to the end of the list cbegin(): returns constant iterator to the beginning cend(): returns constant iterator to the end. First we need to include un

How to Recover Deleted Files After USB Drive Corrupt

Nowadays losing data is a common phenomenon! Imagine you’ve invested all your time in preparing an important presentation for your office and in the morning you’re not able to find the same. Here, panicking is not an option, and creating it again is an absolute ‘No! No!’ this is the exact time where you’ve to act smart and use a reliable Data Recovery Software. For explaining the whole procedure of recovering the data from USB drive we’ve tested prominent data recovery software named Disk Drill. Following are the steps to recover deleted files from USB Drive. How to Recover Deleted Files After USB Drive Corrupt? You can download the software for free and avail a Basic Pack with recovery upto 100 Mb, Pro and Enterprise packs are also available that offers the following: Pro Pack: Recover unlimited data, you can use the same pack in 3 different PCs, the scan is quick and more efficient, an option of partition search is available, supports all file systems and 300+ file formats. En

Recovering from the Windows 10 Insiders Fast 17017 volsnap.sys reboot GSOD/BSOD

NOTE: I'm not involved with the Windows Team or the Windows Insider Program. This blog is my own and written as a user of Windows. I have no inside information. I will happily correct this blog post if it's incorrect. Remember, don't just do stuff to your computer because you read it on a random blog. Think first, backup always, then do stuff. Beta testing is always risky. The Windows Insiders Program lets you run regular early builds of Windows 10. There's multiple "rings" like Slow and Fast - depending on your risk tolerance, and bandwidth. I run Fast and maybe twice a year there's something bad-ish that happens like a bad video driver or a app that doesn't work, but it's usually fixed within a week. It's the price I pay for happily testing new stuff. There's the Slow ring which is more stable and updates like once a month vs once a week. That ring is more "baked." This last week, as I understand it, a nasty bug made it out

C++ STL Multimap Container – std::multimap

In this tutorial you will learn about stl multimap i.e., std::multimap and all functions applicable on it with some example code. In previous articles we already learned about std::map container . It is an associative container which give priority to key values. But problem with map is it won’t allow duplicate values. But multimap allows duplicate values. Here in multimap both key and value pair becomes unique. And we already know that one of the great property of map and multimap is always elements automatically inserted into sorted order on fly. Keys can’t be modified once inserted. Only possible way is we have to delete and update with a new value. Implementation of multimaps follows a binary search tree type of implementation. C++ STL Multimap Container – std::multimap To work with multimap we need to include map header file. #include <map> Iterators that can be applicable on multimap: begin(): returns iterator to the beginning. end(): returns iterator to the end of

First Impressions - Jibo Social Robot for the Home

As you likely know, I have a BUNCH of robots in the house. Whether it be turning a tin can into a robot , driving a Raspberry Pi around with Windows IoT , building robot arms with my kids , or controlling a robot with Xamarin code , I'm ALL IN when it comes to home robots. I also have Alexa, Cortana, Siri...but they have no bodies. They are just disembodied voices - why not a social robot with a body AND a personality? Jibo is the first social robot for the home, and when their team emailed me to try Jibo out - and soon explore their SDK and build more skills into Jibo - I jumped at the idea. Jibo started as an Indiegogo campaign in 2014 and now I've got a pre-public version that I'm stoked to explore and expand. Jibo showed up in a surprisingly hefty box. He's about 8 pounds and about a foot tall. You turn him on and he starts his initial set up process. Since Jibo has a voice and touch screen, it's pretty straightforward to hook up to WiFi and download whateve

C++ STL Multiset Container – std::multiset

In this tutorial you will learn about STL Multiset container in C++ i.e. std::multiset and all functions applicable on it. Multiset is an associative container. Same like set this also follows some specific order to store elements. But only difference is these multisets allow duplicate values. And some more similarity to sets to multisets are both has the property that, value stored and corresponding key both are same. Elements in multiset are constant. We unable to modify after insertion of the element. If we want to update element then we should delete that element and again insert with updated element. The elements in the multiset are always sorted. C++ STL Multiset Container – std::multiset Iterators work on multiset: begin(): returns iterator to the beginning. end(): returns iterator to the end of the list. rbegin(): returns reverse iterator to reverse beginning. rend(): returns reverse iterator to reverse end. cbegin(): Returns constant iterator to beginning. cend(

SQL Server Tuning for Faster Queries

Your SQL Server Compact is capable of lightening-fast performance and stunningly efficient service even while handling huge work loads. But without regular SQL sever performance tuning, you can’t expect it to “win the race” any more than a race car could without regular tune ups. You will have an opportunity to read in-depth information about SQL Server performance if you visit this Stackify page. But for a basic overview of the most important principles for your SQL tune-ups, keep reading right here. Image Source About SQL Server Tuning It would be nice to think that you could handle SQL performance tuning in a single, end-all strike, but what it’s really going to take is a targeted, involved, and “never-ending” campaign. Slow SQL performance may be caused by only one or two slow but frequently used queries that are eating up all your active memory. It’s a “search and destroy mission.” Realize that your query processor has to compile, perfect, and generate an execute plan befo

PL/SQL Program to Print Patterns

Here you will get plsql programs to print patterns of stars, numbers and alphabets. Pattern 1: * ** *** **** ***** declare n number:=5; i number; j number; begin for i in 1..n loop for j in 1..i loop dbms_output.put('*'); end loop; dbms_output.new_line; end loop; end; / Pattern 2: ***** **** *** ** * declare n number:=5; i number; j number; begin for i in reverse 1..n loop for j in 1..i loop dbms_output.put('*'); end loop; dbms_output.new_line; end loop; end; / Pattern 3: * ** *** **** ***** declare n number:=5; i number; j number; k number; begin for i in 1..n loop for j in 1..n-i

PL/SQL Program to Find Greatest of Three Numbers

Here you will get plsql program to find greatest of three numbers. declare a number:=10; b number:=12; c number:=5; begin dbms_output.put_line('a='||a||' b='||b||' c='||c); if a>b AND a>c then dbms_output.put_line('a is greatest'); else if b>a AND b>c then dbms_output.put_line('b is greatest'); else dbms_output.put_line('c is greatest'); end if; end if; end; / Output a=10 b=12 c=5 b is greatest The post PL/SQL Program to Find Greatest of Three Numbers appeared first on The Crazy Programmer . from The Crazy Programmer https://www.thecrazyprogrammer.com/2017/10/plsql-program-find-greatest-three-numbers.html

Botwin offers an interesting alternative option for routing with ASP.NET Core

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this: public class SampleModule : Nancy.NancyModule { public SampleModule() { Get["/"] = _ => "Hello World!"; } } However, it may be that you want a routing style - the way you define your routes - that is like NancyFx BUT you want to use ASP.NET. Botwin is a library that lets you do just that. They say: This is not a framework, it simply builds on top of Microsoft.AspNetCore.Routing allowing you to have more elegant routing rather than have attribute routing, convention routing, ASP.Net Controllers or IRouteBuilder extensions. You can plug Botwin into your existing ASP.NET Core application, or you can even add a basic started Botwin app to "dotnet new" like this: C:\botwinexample> dotnet new -i BotwinTemplate C:\botwinexample> dotnet new botwin -n MyBotwinApp C:\botwinexample> dir 10/11/2017 10:14 PM 284 H

C++ STL Priority Queue – std::priority_queue

In this tutorial you will learn about STL priority queue in C++ i.e std::priority_queue and all functions applicable on it. std:: priority_queue is a container adaptor. This is almost same as queue container adaptor . i.e this also works as first in first out (FIFO). Elements always inserted at front position and deletion also done from front position. But only difference is elements in the priority queue has some priority. In this priority queue the element which is at top position has highest priority. To use priority queue we simply include queue header file. There is no special priority queue header file. We include queue header file but to gain property of priority to the elements we declare as priority_queue. See below for more understanding. C++ STL Priority Queue – std::priority_queue #include <queue> // this is enough to work with priority queue. But while declaring do priority_queue <data type> priority queue name ; The functions associated with priority q

Learning about the F# SAFE stack - Suave.io, Azure, Fable, Elmish

Last month I looked at a Functional Web with ASP.NET Core and F#'s Giraffe . Giraffe is F# middleware that takes ASP.NET Core's pipeline in a new direction with a functional perspective. However, Giraffe isn't the only F# web stack to choose from! There's Freya, WebSharper, and there's also a very interesting and quite complete story with The SAFE Stack . The SAFE Stack is an open source stack, like LAMP, or WAMP, or other acronym stacks, except this one is all open source .NET with a functional perspective. From the announcement blog : S uave model for server-side web programming A zure for cloud-based systems F able for Javascript-enabled applications. E lmish for an easy-to-understand UI programming mode To be clear, while this is a prescriptive stack, it's not a stack that forces you to do anything. You can swap bits out as you please. Fable is particularly interesting as it's an F# to JavaScript transpiler. Try Fable online here http://