Reflecting on my first year in my new role as a Teacher, here’s just a little of what I have learned.
1. Vision. Don’t just focus on the bricks. See the cathedral.
2. Courage. Don’t be limited by your job description. Make a difference in any way you can.
3. Creativity. Think in new ways. Experiment with different ideas. Innovate.
4. Resilience. Rise above disappointments, complaints and people who work against you.
5. Empathy. Remember that everyone has a story. Be patient. Avoid talking to people when you haven’t had enough sleep.
6. Reflection. Admit when you are wrong and apologize. Occasionally apologizing when you weren’t wrong might be helpful too.
7. Collaboration. The power of a helpful, inspirational, global PLN is immeasurable. A trusted in-school PLN is even more valuable.
8. Communication: Talk. Explain. Ask. Listen. You can achieve a great deal via one conversation at a time.
9. Initiative. If you have an idea, run with it. Don’t wait for a better time, particular conditions or permission to try.
10. Persistence. If you believe in something, fight for it, negotiate for it, pay for it, work for it.
11. Humility. Ask for help. Consult. Get advice. If something is worthwhile, you don’t need your name on it. It’s not about who gets the credit.
If this video doesn't bring a tear to your eyes and makes you smile for the rest of the day, you should reconsider some issues..Watch it from beginning to end - you won't regret it.
from → Life
Sending Email from a C# application using Gmail account could not be easier. All It takes is writing few lines of code, and the magic appears, like in many C# implementations.
- add ‘using System.Net.Mail;’
- copy the code below (better - wrap it with a function), and change the relevant parameters. (username,password..)
Enjoy !
If you have any comment\improvement – drop me a line at the bottom.
from → C#, Code, Programming
log4net is a great tool for creating Log file. (apache product)
After a short research, I understood how to use that tool for a simple writing-logs task.
Basic steps for using described here, and can be execute in a few minutes.
(there is a small project at the end, so you don't have to 'bother' and implement the steps)
How To Use:
First, You will need the dll file (260 kb).
You can download it from here, or you can find it inside my attached project. (link at the bottom)
Put that dll file in a place that will be easy to reference to.
Add a Reference to that dll from your project.
Add the following code to the Assembly.cs file.
// Configure log4net using the .config file
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
// This will cause log4net to look for a configuration file
// called TestApp.exe.config in the application base
// directory (i.e. the directory containing TestApp.exe)
// The config file will be watched for changes.
In the app.config file:
Inside the 'configSections' tag,
Add a new section-line using 'log4net' name:
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
Add a new section ("log4net") to the same app.config file (Sibling to 'configSections')
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="C:\Documents and Settings\Admin\Desktop\Logfile.log" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value=
"%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="FileAppender" />
</root>
</log4net>
In the class:
Add using log4net;
Define a static logger variable at the top of your class.
Something like this:
private static readonly ILog log = LogManager.GetLogger(typeof(Program));
(Here 'Program' is the class name)
Start using the logger in your class, Enjoy !
My Test class is:
{
// A static logger variable that will reference the class name ('Program')
private static readonly ILog log = LogManager.GetLogger(typeof(Program));
static void Main(string[] args)
{
log.Info("Entering application.");
for (int i = 0; i < 3; i++)
{
log.DebugFormat("In The loop (i = {0})", i);
log.ErrorFormat("Error message (i = {0})", i);
log.FatalFormat("Fatal message (i = {0})", i);
log.WarnFormat("Warn message (i = {0})", i);
}
log.Info("Exiting application.");
}
}
The output is:
2009-11-04 09:36:46,078 [10] INFO Program [(null)] - Entering application.
2009-11-04 09:36:46,125 [10] DEBUG Program [(null)] - In The loop (i = 0)
2009-11-04 09:36:46,140 [10] ERROR Program [(null)] - Error message (i = 0)
2009-11-04 09:36:46,140 [10] FATAL Program [(null)] - Fatal message (i = 0)
2009-11-04 09:36:46,140 [10] WARN Program [(null)] - Warn message (i = 0)
2009-11-04 09:36:46,140 [10] DEBUG Program [(null)] - In The loop (i = 1)
2009-11-04 09:36:46,140 [10] ERROR Program [(null)] - Error message (i = 1)
2009-11-04 09:36:46,140 [10] FATAL Program [(null)] - Fatal message (i = 1)
2009-11-04 09:36:46,140 [10] WARN Program [(null)] - Warn message (i = 1)
2009-11-04 09:36:46,140 [10] DEBUG Program [(null)] - In The loop (i = 2)
2009-11-04 09:36:46,140 [10] ERROR Program [(null)] - Error message (i = 2)
2009-11-04 09:36:46,140 [10] FATAL Program [(null)] - Fatal message (i = 2)
2009-11-04 09:36:46,140 [10] WARN Program [(null)] - Warn message (i = 2)
2009-11-04 09:36:46,140 [10] INFO Program [(null)] - Exiting application.
Download
from → C#, Log, Programming
Today I had a great time discovering the Google-Translate-API and how easy it is for using. (those google guys are amazing)
Using that API, I wrote down a small C# app that translates text from English to Hebrew and vice versa.
The source can be used for your own purpose as well.
The studying process of C# and the Tech world is amazing,
I'm having great time on each step of the way. .
from → C#, google, Programming
Sorting is a common activity in the programming work.
Merge-Sort is one of the best implementation for Sorting,
Since Its running on O(nlogn) - which is the best run-time available for Sorting.
On one of my projects I had a requirement to sort Objects.
After a short research, I decided to write a Generic Merge-Sort Class that will work for me.
During the work, I found few major points that should be considered while using that Generic Class for Sorting. (publication)
- Preface
- Using
Now, Since the 2 sub-Arrays should be initialized with an infinite value, You should use the default-ctor to make that initialization.
- Example
(I know This is not an elegant implementation, but In that case there is no alternative.)
- Points for attention
You should also write your own 'overloading operators' that will be in use to compare objects: ==, !=, >, >=, <, <= plus 'Equals' and 'GetHashCode'. Please notice that 'GetHashCode' will be in use by the CLR implicitly - so you must write your own implementation that will return the same value for the same object.
- A simple (int32) Implementation, that Sorts an Array of Integers
- A Generic Merge Sort, Plus a simple 'Person' class that will demonstrate the using of the Generic code
Generic Merge Sort Download
from → C#, Code, Programming
CSince I'm not satisfied with all of the available 'Password-Generators', I decided t write one of my own. (in C#)
Its a Simple Password Generator that can
Generate a Password of any length.
You can download it at: Link

from → C#
Regular expressions are a language of their own. When you learn a new programming language, they're this little sub-language that makes no sense at first glance. Many times you have to read another tutorial, article, or book just to understand the "simple" pattern described.
In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters.
Here are some of the most useful Regular expressions Patterns.
- Username
Pattern:
/^[a-z0-9_-]{3,16}$/Description:
String that matches:
String that doesn't match:
- Password
Pattern:
/^[a-z0-9_-]{6,18}$/Description:
String that matches:
String that doesn't match:
Pattern:
/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/Description:
String that matches:
String that doesn't match:
- regexlib.com
- supercrumbly.com
- txt2re.com
from → Abstract, Programming