I am working with Visual Studio 2012 (Premium edition). I was using spring.dll and it needs some .xml files in the bin folder. When I was publishing to the dev server it was not copying the .xml files. Then I had to make this change so that it will copy all the files.

 

Please see the 2 sections required in the .csproj file.

Section 1
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
               CollectAllBinFiles;
               $(CopyAllFilesToSingleFolderForPackageDependsOn);
 </CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
Section 2
<Target Name="CollectAllBinFiles">
          <ItemGroup>
               <_CustomFiles Include="bin\**\*" />

               <FilesForPackagingFromProject  Include="%(_CustomFiles.Identity)">
                    <DestinationRelativePath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
               </FilesForPackagingFromProject>
          </ItemGroup>
     </Target>

Partition By in Sql server.

August 13, 2015

I thought this was cool.

I had to add a sort order for a list of unique id's in a table.
It is like a Group by. Otherwise, I had to loop through each of the records using a while loop.
E.G 
INSERT INTO dbo.CommunityLists (ListCategoryId, SortOrder,CommunityId ,
ListText, 
LastUpdatedBy,LastUpdated )
SELECT
5 ,
ROW_NUMBER() OVER(PARTITION BY CF .CommunityID ORDER BY CF.CommunityID)
 as Sortorder ,
CF .CommunityID,
CF .FeatureText,
1 ,
getdate()
FROM
      dbo .tbl_CommunityFeatures CF;

Parallel programming in .net.

 Collection<DataSet> comms = new Collection<DataSet>();
                     var sp1 = new Action(() =>
                           {comms = MarketingWebsitesDataManager.GetMarketingCommunities(BuilderCode, 1);
                           }
                           );
List<IAttachment> Attachmentsnew = new List<IAttachment>();
                     var sp2 = new Action(() =>
                           {
                                  Attachmentsnew = MarketingWebsitesDataManager.GetMarketingProductAttachmentsReader(BuilderCode, 1);
                           }
                     );

System.Threading.Tasks.Parallel.Invoke(sp1, sp2);

Both of these methods will be called at the same time. This will improve performance. 

Can be used if the param we are passing to method 2 is not getting changed in method 1.

or if the returned data from method 1 is not used in method 2 then we can use this.

This is part of .net 4.0


Concepts to remember. 


1) Sql is faster in getting the data.

2) .net is faster in processing the data.

3) When you select the data from the db. No of columns and rows matter because the size of the data getting transferred or read from the disk varies if the data is big.

4)It is better to convert the data from the reader to Bo than putting the value in a dataset and then converting it into Bo.


I was getting to a stage in life where it was hard for me to manage passwords and I started clicking “forgot password” which sends an email each time I had to log into an account.



A friend suggested me to use Pass keep. Woow. I have to say it is cool.

Makes my life a lot better. No more forgot password.

 

It took me some time to get this setup and enter all the password but once it is set up it is cool. It works like a charm. I have this password file in google drive and it syncs to the cloud.

 

There is a key file that is on my local computer to keep the password file safe.

I am happy. I like the Autotype feature of Kee pass. It is a lifesaver.

There is also a browser plug-in called "Kee Fox". Which enabled me to click a link to go to the site and log in.

 

If you are ready to spend some extra money on this use 1password my friend is using. He is happy with this. I am using Keypass. It is free but it is not that clean. I would recommend you buying 1password. I already entered all my data to kee pass so it will take a bit of effort for me to change to 1password.


I was under the assumption that looping was really bad. The more loops the worst the performance is.

 

I had 3 collections.

 

Let’s say communities, Products, and attachments.

Each community has products and each product have attachments.

We had like 600 communities with close to 10 products and each product has like 12 attachments.

 

We had the communities and products build. We had like 11,000 attachments which we had to add to the products.

We were looping through the 6000 community products and in each of the loop, we will loop through the 11,000 attachments.

It was taking like 23 seconds.

 

What we did was, we used Dictionaries with a key and an attachments collection.

In dictionaries, keys are stored in Hash.

 

Bucket

 

-----------------------------------------------------------

0               34 - abc                             1000 - Hashcode

                     34 - cdf

 

We build a dictionary of attachments with the key and the real attachments.

 

var attachDict = new Dictionary<string, List<IAttachment>>(StringComparer.Ordinal);

 

We build this collection by looping through the attachments.

 

foreach (var attach in Attachments)

         {

             var key = (attach.ModelId + attach.BuilderCode.Trim()).ToUpperInvariant();

             List<IAttachment> attachments;

 

             if (attachDict.TryGetValue(key, out attachments))

             {

                 attachments.Add(attach);

             }

             else

             {

                 attachments = new List<IAttachment>();

                 attachments.Add(attach);

                 attachDict.Add(key, attachments);

             }

         }

 

 

Then we looped through the communities and products and add the attachments where the key matches.

 

  foreach (var c in communities)

         {

             foreach (var prd in c.MarketingProducts)

             {

                 var key = (prd.MarketingProductId + c.BuilderCode.Trim()).ToUpperInvariant();

                 List<IAttachment> attachments;

                 if (attachDict.TryGetValue(key, out attachments))

                 {

                     prd.Attachments = new Collection<IAttachment>(attachments);

                 }

             }

         }

 

 

After making this change the query runs in < 1 sec.

----------------------------------------------------------------------------------

Sql - Please use distinct only when it is really required. When we use distinct it will copy the row to another temporary location to do a comparison

and see whether in the result set it exist, If it exists, it will skip that row otherwise it will add to the result set.


This is something which all the clients ask you when you are working for a small firm or when you work as an Independent freelancer. Do we have an answer for this ? Really ya... Any way from 100$ to ~(Infinity). In my experiences I have been in all the places. Working for a forture 500 where they spend millions of $ developing site to the best way possible. I also worked for small clients where I could complete developing a site in a day or 2. So it is kind of tricky to answer this Question. when I was hit with this Question I used to ask "what kind of budget are you looking at ?" This was giving a wrong impression to the clients who has no Idea how to develop a website because they thought i was trying to get as much money as I can but really I was not. Then I started answering the question a bit differently. I was amazed to see the responce. I will tell I can get something up and running for 100$ then some of the clients are a bit relectent to appeciate my skills. To be Frank there is no real answer to this Question. You can develop a site in any amount of $. I created my site up and running in 2 days then it was all about writing the content periodically. How much google spend to keep their site up and running.. ? Most of the people dont know what they need so we have to give some idea to educate them with what they need based on their busineess needs. This is too broad an area. you can go with 10$ hosting from godaddy or have a dedicated load balenced server farm. Who needs what is so important.

 

I used to talk to a lot of people in this area to get an idea of what we should be looking for.?

Factors

1) Are we making any profit from the site which is the key. If we are making a 1000$ a day trust me 10$ hosting with godaddy is not enough. some will argue yes we can then it comes to what is right and what is not right.

2) No of users is another key factor. 

3) what kind of data are we showing also matters. Privacy , Size of data etc, I can go on like this for another 2-3 hours.

Best thing I will say is talk to as many people as you can and gather as much details as you can and think a bit about the future plans before you decide on something.

 

 

 

Mvc overview.

December 9, 2011

It is pretty cool. I got my hands dirty developing sites in Mvc. So I thought I will write my initial feel of it. Everyone will say it is pretty cool. Is it like buying a new Ipad, Could be.. The best part of it is the ajax and the javascript libraries that make it pretty nice. Going forward I feel we don’t need much c# or vb.net, I feel if we can connect to db from javascript. I never tried that area though. The reason I was telling this is we can create a grid in javascript and likewise pretty much anything so that is cool right if you know javascript or some of it libraries.

Let me get to mvc now. The different types of view engines, granular control over the html we are creating. Friendly Url’s and now we don’t need the pageload getting called again and again for all postback and we don’t need to check Ispostback == true etc..  The get and post request are going to call different methods so that overload of interpreting the same code again and again will not be there.

Is it  like vb or asp now ? Where we write the code in-line with the html yes it is and it makes me feel that are we going to a better version of vb or asp. If you ask someone who has seen the technology coming and evolving you will know. It is like a vicious circle. We involve improve and start doing things which we did 10 years back and think it is pretty new.. is it ..ya..na..yaa could be… separation of concern is something which was pretty cool. Like a company where there are process and procedure and teams and tasks and each one is supposed to do certain things. I mean controller is person who calls the model and get data but don’t ask him how the data is going to be presented to the user. It is pretty nice for large scale development where I can create a model and controller which out even creating the view and some other team can work on the views. (UI guys) who are extremely good at user interface and the guys who are extremely good at building frameworks or writing business rules can concentrate on that.

Come on people no more pageload() and ispostback()..

Then I asked myself what are the disadvantages of using MVC over webforms. Umm..You know what now you cannot drag and drop a grid view control and assume everything is done for you. You need to write your own code. That suckes..but you can build more controlling and custom UI but you need to be good at UI because you have to do everything.

See some of the site I worked on

http://www.ryanhomes.com/

http://www.nvhomes.com/

radbox.me.
chart.io
Dinevore
SocialWorkout
Ohours.org

I happened to go to one of the tech meetup in NYC.
So i happened to see some cool products, so i thought I will share some of them with you.

After going to meetup's I feel i need a separate brain so that i can process everything what I heard. There is a huge explosion of new trends and products lines so it feels like someone said “60% of the existing companies will perish in next 10 years.” I kind of started thinking whether it is true.

radbox.me

This is the one i really liked. I always watch a lot of videos in different sites and it is hard for me find it after some time. mostly technology videos. I always thought about having a common place for all my favorite videos. here comes radbox.me As I am in office before heading home I browse a no of videos which i want to see on my way home, so that I can use that time properly. To your knowledge i am talking about presentation from technology gurus.. Of course I can watch movie too.. It is our choice whether to use it for good or bad....This comes handy. I can add all my videos into my profile and i can watch one after another on my phone.

chart.io

This is basically a google analytics for DB. You can monitor the data in the db like how many rows got inserted today. Whether the row count is crossing a limit. What tables are used most often? This is pretty easy to develop too. The only thing is for ui actions we need to run scripts in the db. At present this does not support sql but i am sure this will in future. This is definitely a nice one.

Dinevore.

I happened to see the presentation of this product from the ceo and founder. To be honest i didn’t like the presentation but the product and concept i liked. There is a lot to be done in this product. I work in downtown and try to use this to find a nice restaurant but i couldn’t find any nearby. That is sad but the product is promising if we have all the restaurant and menus available and in future if we can order from it this can make a difference in our life. Waiting for long queues to get our lunch is frustrating.

SocialWorkout

I am not sure whether this will come out as promising as we look at it but I feel this definitely will be a platform which can be used for events like nyc marathon etc. or I need to be a work out freak who does it regularly and have enough time for it . I am kind of a person who has no time to work out in my busy schedule and use an application for monitoring the work out will be too much for me. No time sorry..But can be good for people who take work out seriously.

Ohours.org

I am not sure about this too. This is basically like meeting people online. A common platform for meeting people online and schedule meetings.I feel if i can schedule all my meetings in a common place it would be nice but to tell others I am meeting this persons will be a privacy issue.