VS2012 Keyboard Shortcuts
Collapsing all Sections = CTRL M + O
Expanding all Sections = CTRL M + P

Discoholic 🪩

JBB: An Artblog!
KIROKAZE
tumblr dot com

Origami Around

❣ Chile in a Photography ❣

★
YOU ARE THE REASON

Kaledo Art

ellievsbear

blake kathryn
Not today Justin

titsay
No title available

#extradirty
Keni
Cosimo Galluzzi
Game of Thrones Daily

roma★
$LAYYYTER

seen from Netherlands
seen from United States
seen from United States
seen from Türkiye

seen from United States

seen from France
seen from United States

seen from New Zealand

seen from United States
seen from Russia
seen from Nepal

seen from United Kingdom

seen from United Kingdom
seen from United States

seen from Iraq

seen from United Kingdom

seen from Canada

seen from France
seen from Germany
seen from Germany
@sonborj
VS2012 Keyboard Shortcuts
Collapsing all Sections = CTRL M + O
Expanding all Sections = CTRL M + P
It's been 7 episodes and I still don't see the Dead People who ended season 2. what's happening with GOT?
Philippine's maze of Cellphone Prefix Codes.. useful when you're subscribed to unlimited plans
Windows Azure and the local developer's concerns
Has it ever happened to you that when a .NET application is endorsed to you, that you need to run a dozen of apps and services just to see what the application is about. Database, Website, APIs, Configuration Credentials, etc. And then you go to the next concern, WHERE DO I RUN THESE THINGS? should i use my extra laptop? or my desktop? should i use my current development machine?
Enter Windows Azure ( Window's Cloud Computing Service ). Azure offers you all the machines, services, apis that you will need.
AJAX Start and Stop
Have you had problems in Javascript ajax calls where in you dont know if all calls have been finished or not?
Have you met some untraceable errors in your js code and later on found out that it was because an AJAX call was still running and the values from it has not loaded yet?
Enter ajaxStart() and ajaxStop .... this attaches an event for any AJAX call still running and if it has stopped.
How to save a form via ajax and not map each property
function updateBookingDetails() { var isvalid = $('form').valid(); if (isvalid) { var URL = '/BookingsManagement/AjaxUpdateBooking'; //load gif image $("#divLoadingImage").html('<center><img id="imgLoading" src="/Content/images/common/loading-image.gif" /></center>'); var form = $('form'); var formCollection = form.serialize(); $.post(URL, formCollection, function (response, status, xhr) { $("#divLoadingImage").html(response); showToast(); //redirect to Main Booking Grid if hidden field 'BookingResult' = true if ($("#BookingResult").val() == "true") { //delay setTimeout(function () { window.location = "/BookingsManagement"; }, 3000); } }, "html" ); } }
How to map .NET class properties with same keys
usually, when we want to map 2 objects with same properties, we set a.key1 = b.key2 , a.key2 = b.key2 , so on....
there's a class in .NET that makes this easier ... System.Reflection
so in your C# class, put a using System.Reflection
then do something like below in your method. Mine is a sample where I am updating a class name SiteFeatures. Parameter is also of the same class, and I also have the id.
CODE STARTS HERE
public bool Edit(SiteFeature aSiteFeature, int id) { try { SiteFeature item = context.SiteFeatures.Where(b => b.SiteFeatureID == id).SingleOrDefault(); if (item != null) { // Iterate the Properties of the destination instance and // populate them from their source counterparts PropertyInfo[] destinationProperties = item.GetType().GetProperties(); foreach (PropertyInfo destinationPI in destinationProperties) { //dont include index PK if (destinationPI.Name == "SiteID") continue; PropertyInfo sourcePI = aSiteFeature.GetType().GetProperty(destinationPI.Name); destinationPI.SetValue(item, sourcePI.GetValue(aSiteFeature, null), null); } context.SaveChanges(); } return true; } catch (Exception ex) { return false; } }
CODE ENDS HERE
Captcha pang PINOY
I saw these 2 questions in a registration form which is uniquely Pinoy:
1. Who is the King of Comedy?
2. What is larger than McDo?
Eh di Pinoy lang makakasagot nito diba?
Son, it's not about if it's malignant or benign, it's about your faith in God
one of the best advises i got happened when i had a cyst removed from my ass
you know why Starbucks is such a hit here in RP? not because of the coffee, we got lots of arabica and robusta mills here. It's because it gives us a taste of America, and just a few minutes inside that store makes us feel that we got a chance of immigrating or being there in the US of A. So if you want to buy a franchise of a popular US brand, make sure you bring with it something that will transport us to the snows of Boston, the beaches of Miami, the limelight of Hollywood. Don't just bring the brand, bring the country.
Talk N Text Unli Promo
Unli text to All Network for 30 days
TEXT
UA300 to 4545
Smart Unli promo mega 250
MEGA 250 is Smart Prepaid’s newest offer that provides a CALL + SMS + DATA promo for only P250.00, that lasts for 30 days!
The package includes unlimited text to ALL Networks (Smart, TNT, Sun, Globe & TM), 180 minutes call to Smart, Sun and TNT and up to 100MB mobile internet browsing valid for only P250!
To register, text MEGA250 and send to 2477.
FAQs
What is MEGA 250?
MEGA 250 is Smart Prepaid’s newest offer that provides a CALL + SMS + DATA promo priced at P250.00, that lasts for 30 days! The package includes unlimited text to ALL Networks (Smart, TNT, Sun, Globe & TM), 180 minutes call to Smart, Sun and TNT and up to 100MB mobile internet browsing , for only P250!
Available packages are as follows:
SRP Package Package Validity 250.00 MEGA 250 Unlimited SMS to ALL Networks (Smart, TNT, Sun, Globe & TM) + 180 minutes calls to Smart, Sun, TNT + 100 MB Mobile Internet 30 days
Who can avail of the promo?
Promo is exclusive to Smart Prepaid subscribers nationwide.
How can a subscriber avail of the promo?
Promo is available via registration only. Simply have at least P250 airtime load, and register to the package.
SRP Package Package Validity Availment via Registration 250.00 MEGA 250 Unlimited SMS to ALL Networks (Smart, TNT, Sun, Globe & TM) + 180 minutes calls to Smart, Sun, TNT + 100 MB Mobile Internet 30 days Text MEGA250 to 2477
Can I avail of the promo multiple times in a day?
No. Multiple availment of this promo is not allowed.
Can I avail of other promos while subscribed to this promo?
Yes. A subscriber can still avail of the other voice and SMS promos and services even if he/she is subscribed to this promo, provided none of which are packages with unlimited SMS. Subscriber will be allowed to register again after expiry of the promo.
CALLS
Who can I call using the promo?
A total of 180 minutes call transactions for 30 days can be used to call all subscribers nationwide who are using the following networks and are in the following areas:
Domestic
Smart
Sun
TNT
How do I call using the promo?
To call domestic mobile, dial *2477 + 11-digit mobile number. i.e. *247709101234567
SMS
Who can I text using the promo?
Unlimited SMS may be used to send texts to All Networks which include Smart, TNT, Sun, Globe and TM.
DATA
How can I access Mobile Internet though this promo?
Mobile internet browsing up to 100MB for 30days may be used via mobile phone browsing.
What if I consumed more than 100MB?
Consumption in excess of 10MB shall be charged prevailing rates.
OTHERS
Is P1 maintaining balance required for this promo?
No. P1 Maintaining balance is not required to avail of this promo.
Are these regular services or on promo?
This is a promo available promo available until November 15, 2012.
If subscriber is on roaming, can he call or text using the promo?
No, the subscriber cannot register to this promo while roaming is activated.
Per DTI-NCR Permit no. 8390 series of 2012
Using Google as your mail sender in ASP .NET
<system.net> <mailSettings> <smtp deliveryMethod="Network" from="[email protected]"> <network host="smtp.gmail.com" userName="[email protected]" password="yourpassword" port="587" enableSsl="true"/> </smtp> </mailSettings> </system.net>
NOTE the enableSsl TAG!!!!
How to use Regular Expressions in Programming
Have you ever wondered of a Programming tool that will help you find all occurrences of a word in a very large text file? You can't use SQL because this is a text file that can't be imported into your database fields.
Enter REGEX.
Regular Expressions or more popularly know as REGEX is a powerful tool to search text or string patterns in large text files.
How do you use it? For C# , do this :
1. put in your using block
using System.Text.RegularExpressions;
2. In the code itself initialize the Regex class and the Regex Pattern .
string mytext = "<li> list 1 </li> <li> list 2 </li> <li> list 3 </li>" ;
var allmatches = Regex.Matches(mytext,@"<li>([^)]*)</li>");
3. The part of ([^)]*) means the REGEX tool will capture all the occurrences of text that are in between <li> and </li>
4. Now to use the captured occurrences
foreach (Match aMatch in allmatches ) { string capturedtext = aMatch.Groups[1].Value; //do something with the captured text
Console.WriteLine(capturedtext); }
5. Match is a class under the REGEX mother class
6. Console printout will be 123
Works wonders for privacy addicts
Generating Method Stubs in C#
Ever been in a coding situation where an idea hits you and you plan to create a new method while doing a code line in a main method?But you don't want to leave the main method since you are in a middle of something.... Enter Generate Method Stubs...
VS creates an empty method for you by right clicking on the new method you are calling.
What a smooth method!
Kendo Upload widget and MVC
How do you save an uploaded file using a Kendo Upload widget?
Important Notes:
1. Don't use kendo's sample name for the control which is photos[] . Just use photos or anyname without the array symbol [].
2. Use IEnumerable<HttpPostedFileBase> as a parameter in your controller, and make sure the parameter name is same as the control name, in our case it's photos.
The API from Kendo uses a sample that sets the name of the input control to photos[] . You need to override this to just photos for processing in the Controller.
@using (Html.BeginForm()) {
<div>
<input name="photos[]" id="photos" type="file" />
</div>
}
View
<input name="photos" id="photos" type="file" />
Controller
[HttpPost] public ActionResult UploadForm(int id, FormCollection collection, IEnumerable<HttpPostedFileBase> photos) {
foreach (var file in photos) { //check for null. kendos control uploads an empty input file by default if (file == null) continue; //check for content if (file.ContentLength == 0) continue; // Some browsers send file names with full path. This needs to be stripped. var fileName = Path.GetFileName(file.FileName); var physicalPath = Path.Combine(Server.MapPath("~/Uploads"), fileName); file.SaveAs(physicalPath);
}
}