<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-644371684395223601</atom:id><lastBuildDate>Thu, 03 Oct 2024 15:57:22 +0000</lastBuildDate><category>Facebook</category><category>C#</category><category>MS SQL Server</category><category>Multi Threading</category><category>Virtualization</category><category>Vmware</category><category>WPF</category><category>Windows 7</category><title>Meena Fawzy&#39;s Blog</title><description></description><link>http://meenaf.blogspot.com/</link><managingEditor>noreply@blogger.com (Meena Fawzy)</managingEditor><generator>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-604369861831970704</guid><pubDate>Sun, 09 Jun 2013 22:29:00 +0000</pubDate><atom:updated>2013-06-12T18:13:55.840+02:00</atom:updated><title>App Settings Database Provider</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;head&gt;
    &lt;style type=&quot;text/css&quot;&gt;
        .auto-style1 {
            direction: ltr;
        }
    &lt;/style&gt;
&lt;/head&gt;

&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;Description:&lt;/b&gt;
        &lt;br /&gt;
&lt;div&gt;
App Settings Database Provider is a library for the .NET platform to store and retrieve app settings from MS SQL Server database instead of a configuration file, It also has a feature where you can override database settings with the normal appSettings section from the configuration file.
    &lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;Features:&lt;/b&gt;
        &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A simple way to store and retrieve application settings from MS SQL Server database&lt;/li&gt;
&lt;li&gt;Override database settings by adding keys in app/web.config&lt;/li&gt;
&lt;li&gt;Refresh keys/values from database every certain time&lt;/li&gt;
&lt;li&gt;Handle OnChanged event per key&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;How to install&lt;/b&gt;
        &lt;br /&gt;
Using Nuget Package Manager Console&lt;br /&gt;
&lt;div style=&quot;-webkit-box-shadow: rgb(110, 110, 110) 2px 2px 3px; background-color: #202020; border-radius: 5px; border: 4px solid silver; box-shadow: rgb(110, 110, 110) 2px 2px 3px; color: #e2e2e2; display: block; font-family: Segoe UI, Trebuchet MS, Verdana, Helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; line-height: 17px; overflow: auto; padding: 15px;&quot;&gt;
PM&amp;gt; Install-Package AppSettingsDatabaseProvider
        &lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;How to use&lt;/b&gt;
        &lt;br /&gt;
&lt;ul style=&quot;list-style: none; text-align: left;&quot;&gt;
&lt;li style=&quot;margin: 10px 0; text-align: left;&quot;&gt;You can use the static property &lt;b&gt;AppSettingsDatabaseProvider.SettingsManager.AppSettings[&quot;MyKey&quot;]&lt;/b&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 10px 0; text-align: left;&quot;&gt;How can i &lt;b&gt;add key&lt;/b&gt; to the settings
                &lt;div style=&quot;display: block; margin-left: 20px;&quot;&gt;
Just set the key with the desired value  &amp;gt; AppSettingsDatabaseProvider.SettingsManager&lt;b&gt;.AppSettings[&quot;MyKey&quot;] = &quot;MyKeyValue&quot;;&lt;/b&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin: 10px 0; text-align: left;&quot;&gt;How can i &lt;b&gt;delete key&lt;/b&gt; from the settings
                &lt;div style=&quot;display: block; margin-left: 20px;&quot;&gt;
Just set the key with null or empty string and this will delete it directly from the database &amp;gt; AppSettingsDatabaseProvider.SettingsManager&lt;b&gt;.AppSettings[&quot;MyKey&quot;] = &quot;&quot;;&lt;/b&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin: 10px 0; text-align: left;&quot;&gt;How do i inistinitiate a new Settings inistance
                &lt;br /&gt;
                &lt;div style=&quot;display: block; margin-left: 20px;&quot;&gt;
&lt;div class=&quot;auto-style1&quot;&gt;
AppSettingsDatabaseProvider allows you to use multiple tables with different settings using the same database by using a new settings instance for every table
                    &lt;br /&gt;
You can inistintiate a new inistance from the &lt;b&gt;Settings&lt;/b&gt; object using one of the following constructors
                &lt;br /&gt;
If you are inistintiating a new inistance by calling the empty constructor or passed a false value for initialize parameter then you have to call the Initialize method to load the app settings data from the database and start the refresh timer
                &lt;br /&gt;
&lt;b&gt;Constructors&lt;/b&gt;
                    &lt;/div&gt;
&lt;div style=&quot;margin-left: 20px;&quot;&gt;
&lt;ol&gt;
&lt;li&gt;Constructor with empty parameters&lt;/li&gt;
&lt;li&gt;Constructor Initialize Parameter
                            &lt;ol&gt;
&lt;li&gt;initialize: load the app settings data from database and start refresh timer&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Constructor with Parameters
                            &lt;ol&gt;
&lt;li&gt;connectionString: database connection string&lt;/li&gt;
&lt;li&gt;tableName: AppSettings table name&lt;/li&gt;
&lt;li&gt;refreshSettingsEveryMilliseconds: Refresh application settings from database every &lt;b&gt;Milliseconds&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin: 10px 0; text-align: left;&quot;&gt;How to subscripe to &lt;b&gt;OnChanged event&lt;/b&gt; per key
                &lt;br /&gt;
                &lt;div style=&quot;display: block; margin-left: 20px; text-align: left;&quot;&gt;
Just hook the event AppSettingsDatabaseProvider.SettingsManager.AppSettings.Events[&quot;MyKey&quot;].OnChanged&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin: 10px 0; text-align: left;&quot;&gt;
                &lt;br /&gt;
                &lt;b&gt;Public properties&lt;/b&gt;
                &lt;br /&gt;
                &lt;table style=&quot;background-color: #dfefff; border: thin solid #000000; width: 100%;&quot;&gt;
                    &lt;thead style=&quot;background-color: black; color: white;&quot;&gt;
&lt;tr&gt;
                            &lt;th style=&quot;border-style: none;&quot;&gt;Name&lt;/th&gt;
                            &lt;th style=&quot;border-style: none;&quot;&gt;Description&lt;/th&gt;
                            &lt;th style=&quot;border-style: none; white-space: nowrap;&quot;&gt;get/set&lt;/th&gt;
                        &lt;/tr&gt;
&lt;/thead&gt;
                    &lt;tbody&gt;
&lt;tr&gt;
                            &lt;td&gt;AllowNormalAppSettingToOverride&lt;/td&gt;
                            &lt;td&gt;Enable/Disable override database settings by adding the key in the configuration file&lt;/td&gt;
                            &lt;td style=&quot;white-space: nowrap;&quot;&gt;get | set&lt;/td&gt;
                        &lt;/tr&gt;
&lt;tr&gt;
                            &lt;td&gt;ConnectionString&lt;/td&gt;
                            &lt;td&gt;Database connection string&lt;/td&gt;
                            &lt;td style=&quot;white-space: nowrap;&quot;&gt;get | set&lt;/td&gt;
                        &lt;/tr&gt;
&lt;tr&gt;
                            &lt;td&gt;Events&lt;/td&gt;
                            &lt;td&gt;Access the events manager class&lt;/td&gt;
                            &lt;td style=&quot;white-space: nowrap;&quot;&gt;get&lt;/td&gt;
                        &lt;/tr&gt;
&lt;tr&gt;
                            &lt;td&gt;RefreshSettingsEveryMilliseconds&lt;/td&gt;
                            &lt;td&gt;Refresh settings from database every milliseconds&lt;/td&gt;
                            &lt;td style=&quot;white-space: nowrap;&quot;&gt;get | set&lt;/td&gt;
                        &lt;/tr&gt;
&lt;tr&gt;
                            &lt;td&gt;TableName&lt;/td&gt;
                            &lt;td&gt;AppSettings table name in database&lt;/td&gt;
                            &lt;td style=&quot;white-space: nowrap;&quot;&gt;get | set&lt;/td&gt;
                        &lt;/tr&gt;
&lt;tr&gt;
                            &lt;td&gt;Settings[string] indexer&lt;/td&gt;
                            &lt;td&gt;Access app settings by name, if empty or null will delete the settings&lt;/td&gt;
                            &lt;td style=&quot;white-space: nowrap;&quot;&gt;get | set&lt;/td&gt;
                        &lt;/tr&gt;
&lt;/tbody&gt;
                &lt;/table&gt;
&lt;/li&gt;
&lt;li style=&quot;margin: 10px 0; text-align: left;&quot;&gt;
                &lt;br /&gt;
                &lt;b&gt;Public methods&lt;/b&gt;
                &lt;br /&gt;
                &lt;table style=&quot;background-color: #dfefff; border: thin solid #000000; width: 100%;&quot;&gt;
                    &lt;thead style=&quot;background-color: black; color: white;&quot;&gt;
&lt;tr&gt;
                            &lt;th style=&quot;border-style: none;&quot;&gt;Name&lt;/th&gt;
                            &lt;th style=&quot;border-style: none;&quot;&gt;Description&lt;/th&gt;
                        &lt;/tr&gt;
&lt;/thead&gt;
                    &lt;tbody&gt;
&lt;tr&gt;
                            &lt;td&gt;GetGenerateSchemaSqlScript&lt;/td&gt;
                            &lt;td&gt;Get the sql schema generation script&lt;/td&gt;
                        &lt;/tr&gt;
&lt;tr&gt;
                            &lt;td&gt;Initialize&lt;/td&gt;
                            &lt;td&gt;Initialize the settings class, load settings from database and start the refresh timer&lt;/td&gt;
                        &lt;/tr&gt;
&lt;tr&gt;
                            &lt;td&gt;Refresh&lt;/td&gt;
                            &lt;td&gt;Refresh the app settings data from the database&lt;/td&gt;
                        &lt;/tr&gt;
&lt;/tbody&gt;
                &lt;/table&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>http://meenaf.blogspot.com/2013/06/app-settings-database-provider.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-3997530256535792693</guid><pubDate>Thu, 28 Jun 2012 11:29:00 +0000</pubDate><atom:updated>2012-06-28T13:30:33.796+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MS SQL Server</category><title>MS SQL Server datetime milliseconds accuracy</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
During my work on a project needs a high accuracy in time calculations I have faced
        a weird behavior for sql server datetime milliseconds operations, actually datetime
        ignores the milliseconds difference, to cut it short try the below example and check
        the result&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
1-Difference between .650 and .649 = &lt;span style=&quot;color: red;&quot;&gt;0 !!!&lt;/span&gt;&lt;br /&gt;
2-Difference between .650 and .647 = &lt;span style=&quot;color: red;&quot;&gt;3 !!! &lt;/span&gt;
        &lt;br /&gt;
3-Difference between .650 and .645 = &lt;span style=&quot;color: red;&quot;&gt;3 !!! &lt;/span&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: whitesmoke; border: thin solid #808080;&quot;&gt;
DECLARE @Date1 DateTime, @Date2 DateTime&lt;br /&gt;
&lt;br /&gt;
SET @Date1 = &#39;2012-06-21 12:5:2&lt;span style=&quot;color: red;&quot;&gt;.650&lt;/span&gt;&#39;&lt;br /&gt;
SET @Date2 = &#39;2012-06-21 12:5:2&lt;span style=&quot;color: red;&quot;&gt;.649&lt;/span&gt;&#39;&lt;br /&gt;
&lt;br /&gt;
DECLARE @Diff Int&lt;br /&gt;
SET @Diff = DateDiff(MS, @Date2, @Date1 )&lt;br /&gt;
SELECT &#39;Difference between the 2 dates is: &#39; + CONVERT(VARCHAR,@Diff) AS Result
        &lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
After reading more about datetime accuracy i have found that it&#39;s rounded to increments
            of .000, .003, or .007 seconds&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you need more accuracy then you need to use datetime2 data type &lt;span style=&quot;font-size: x-small;&quot;&gt;
                (Supported in SQL 2008)&lt;/span&gt; which support to 100 nanoseconds&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
References:&lt;/div&gt;
&lt;div&gt;
datetime: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms187819.aspx&quot; target=&quot;_blank&quot;&gt;
                http://msdn.microsoft.com/en-us/library/ms187819.aspx&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
datetime2: &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/bb677335.aspx&quot; target=&quot;_blank&quot;&gt;
                http://msdn.microsoft.com/en-us/library/bb677335.aspx&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Hope this helps :)&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://meenaf.blogspot.com/2012/06/ms-sql-server-datetime-milliseconds.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-4529241215986812476</guid><pubDate>Wed, 17 Jun 2009 05:47:00 +0000</pubDate><atom:updated>2009-06-17T09:20:12.550+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Facebook</category><title>How to send notification to your facebook application users?</title><description>first you need to get a list of your application users, if you don&#39;t know how to get your application users you can read this post &lt;a href=&quot;http://meenaf.blogspot.com/2009/06/how-to-get-your-facebook-application.html&quot;&gt;How to get your facebook application users?&lt;/a&gt; and then continue reading this post&lt;br /&gt;&lt;br /&gt;first of all there&#39;s 2 types of notification we have to understand the difference between the 2 types&lt;br /&gt;&lt;br /&gt;1- user to user notification&lt;br /&gt;&lt;br /&gt;2- application to user notification&lt;br /&gt;&lt;br /&gt;i have got the below description from facebook wiki to make it clear to understand the difference between the 2 types&lt;br /&gt;&lt;br /&gt;User-to-user notifications can be sent from an application user to the friends of the user, whether or not they use the application.&lt;br /&gt;&lt;br /&gt;Application-to-user notifications are sent on an application&#39;s behalf and do not require an active session&lt;br /&gt;&lt;br /&gt;the method notifications_send takes some parameters like this&lt;br /&gt;&lt;br /&gt;api.notifications_send(&lt;br /&gt;&quot;replace with your api_key&quot;&lt;br /&gt;,&quot;replace with a call_id&quot;&lt;br /&gt;,&quot;replace with your sig&quot;&lt;br /&gt;,&quot;1.0&quot;&lt;br /&gt;,[132456,321654]&lt;br /&gt;,&#39;Please visit http://apps.facebook.com/findouttopfriends/&#39;&lt;br /&gt;,&quot;JSON&quot;&lt;br /&gt;,&quot;app_to_user&quot;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;this method returns a comma separated list of the recipients who were successfully sent notifications.&lt;br /&gt;&lt;br /&gt;there are some restrictions on the html that will be sent as notification can be found here &lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Allowed_FBML_and_HTML_Tags#Notifications:_Allowed_Tags&quot;&gt;Notification html restrictions&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;for more information about how to send notification visit facebook wiki at &lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Notifications.send&quot;&gt;Send application notification&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;hope this helps.</description><link>http://meenaf.blogspot.com/2009/06/how-to-send-notification-to-your.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-7509428567840925952</guid><pubDate>Tue, 16 Jun 2009 05:41:00 +0000</pubDate><atom:updated>2009-06-16T09:40:26.523+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Facebook</category><title>How to get your facebook application users?</title><description>The only way you can get your facebook application user&#39;s is by implementing your own solution&lt;br /&gt;here&#39;s the step to store your application users in your database&lt;br /&gt;&lt;br /&gt;1- Open your application settings&lt;br /&gt;&lt;br /&gt;2- Go to &quot;Authentication&quot; settings&lt;br /&gt;&lt;br /&gt;3- In &quot;Post-Authorize Callback URL&quot; write a URL that facebook pings with some post parameters for the user authorizes your application&lt;br /&gt;fb_sig_user is the user id that authorized your application and for more info visit &lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Post-Authorize_Callback_URL&quot;&gt;Post-Authorize Callback URL&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4- when user removes your application facebook pings another URL with fb_sig_user post parameter which is the user id&lt;br /&gt;&lt;br /&gt;5- to set the &quot;Post-Remove Callback URL&quot; go to your application  settings page&lt;br /&gt;&lt;br /&gt;6- Authentication settings then write your &quot;Post-Remove Callback URL&quot;&lt;br /&gt;&lt;br /&gt;after doing these steps so you have the user ids that authorized your application but don&#39;t store more info to not break the facebook policy&lt;br /&gt;&lt;br /&gt;sample applications &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://apps.facebook.com/findouttopfriends/&quot;&gt;Find out your top 10 friends&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://apps.facebook.com/cupidmatchmaker/&quot;&gt;Cupid Match Maker&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps :-)</description><link>http://meenaf.blogspot.com/2009/06/how-to-get-your-facebook-application.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-893366339736169857</guid><pubDate>Mon, 15 Jun 2009 03:37:00 +0000</pubDate><atom:updated>2009-06-15T07:41:00.431+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Virtualization</category><category domain="http://www.blogger.com/atom/ns#">Vmware</category><category domain="http://www.blogger.com/atom/ns#">Windows 7</category><title>Vmware has no internet connectivity on Windows 7</title><description>I have been working on this problem for 2 days and guess what yahoo finally I got it solved :-)&lt;br /&gt;I have Vmware workstation 6.5.0 build-118166 and installed on Windows 7 RC Build 7100 Everything just working fine like a charm, the only problem is there&#39;s no internet connectivity on any of the installed Vmware instances&lt;br /&gt;I have tried so many solutions after googling like add new key to the registry to let windows 7 identify the virtual network adapters…etc but none of these solutions worked for me&lt;br /&gt;So I thought it might be useful to share with you the solution that worked for me and here’s the straight forward steps :-)&lt;br /&gt;&lt;br /&gt;1- Click start--&gt;Program Files--&gt;Vmware--&gt;Virtual Network Editor, then right click on “VMware Workstation” and run as Administrator&lt;br /&gt;&lt;br /&gt;2- Go to Host Virtual Adapters and remove all the network adapters (virtual network--&gt; VMNet1 and VMNet8)&lt;br /&gt;&lt;br /&gt;3- Then click Apply&lt;br /&gt;&lt;br /&gt;4- Click Add and select VMNet1&lt;br /&gt;&lt;br /&gt;5- Apply again&lt;br /&gt;&lt;br /&gt;6- Go to Host Virtual Network Mapping tab&lt;br /&gt;&lt;br /&gt;7- Click the &gt; next to VMnet1 and change the address and subnet to be “IP:&lt;br /&gt;192.168.125.0 , Subnet: 255.255.255.0”&lt;br /&gt;&lt;br /&gt;8- Then Apply&lt;br /&gt;&lt;br /&gt;9- Go to the NAT tab and select VMNet1&lt;br /&gt;&lt;br /&gt;10- Make sure VMNet1 is selected as “VMnet Host” and click Edit&lt;br /&gt;&lt;br /&gt;11- Change the Gateway IP Address to be (192.168.125.1)&lt;br /&gt;&lt;br /&gt;12- Click Apply, Restart then click Apply again&lt;br /&gt;&lt;br /&gt;13- Go to the DHCP tab&lt;br /&gt;&lt;br /&gt;14- Remove any exist virtual network&lt;br /&gt;&lt;br /&gt;15- Add VMNet1&lt;br /&gt;&lt;br /&gt;16- Click Apply&lt;br /&gt;&lt;br /&gt;17- Select Properties of VMNet1 in DHCP tab&lt;br /&gt;&lt;br /&gt;18- Enter a Start and End Address for DHCP Scope, as an example (192.168.125.80&lt;br /&gt;to 192.168.50.100)&lt;br /&gt;&lt;br /&gt;19- Change lease duration for DHCP to a few days to avoid client renewal timeouts&lt;br /&gt;&lt;br /&gt;20- Click ok then Apply&lt;br /&gt;&lt;br /&gt;21- For every VM in the settings of the network adapter change the network connection to be Host only: A private network shared with the host&lt;br /&gt;&lt;br /&gt;22- Go to your windows 7 network adapter settings&lt;br /&gt;&lt;br /&gt;23- Open Network and Sharing Center on your windows 7&lt;br /&gt;&lt;br /&gt;24- On the left menu click change adapter settings&lt;br /&gt;&lt;br /&gt;25- Choose the network adapter that gives your windows 7 internet connectivity&lt;br /&gt;&lt;br /&gt;26- Right click and select properties, Then go to sharing tab&lt;br /&gt;&lt;br /&gt;27- Select allow other network users to connect throw this computer’s internet&lt;br /&gt;connection&lt;br /&gt;&lt;br /&gt;28- Then select VMNet1 network adapter as the home networking connection&lt;br /&gt;&lt;br /&gt;29- Clear allow other network users to control or disable the sharing internet&lt;br /&gt;connection&lt;br /&gt;&lt;br /&gt;30- Click apply and restart all you VMs and finally they will get internet connectivity :-)&lt;br /&gt;&lt;br /&gt;I know it’s too long steps but I tried to be clear as much as I can to not miss any step that causes a new problem as usual&lt;br /&gt;&lt;br /&gt;if you needed any help don&#39;t hesitate to ask me :-)</description><link>http://meenaf.blogspot.com/2009/06/vmware-has-no-internet-connectivity-on.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-6823244157844860327</guid><pubDate>Wed, 03 Jun 2009 23:10:00 +0000</pubDate><atom:updated>2009-10-02T08:32:19.603+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Facebook</category><title>Facebook multi friend selector inside iframe and XFBML</title><description>&lt;div&gt;Multi friend selector facebook control is one of the hottest controls in the facebook library, almost all facebook apps using this contrl to invite friends but I did not find anywhere that has a proper documentation for this control to be used inside iframe with XFBML, so i thought it&#39;s better to share my experience with people that trying to get it work&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; since facebook multi friend selector is FBML so it cane be used directly in the markup it has to be inside a fbml server tag like this&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&amp;lt;fb:serverfbml&amp;gt;&lt;br /&gt;  &amp;lt;script type=&amp;quot;text/fbml&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;fb:request-form action=&amp;quot;http://apps.facebook.com/findouttopfriends/&amp;quot;&lt;br /&gt;    target=&amp;quot;_top&amp;quot; method=&amp;quot;POST&amp;quot; invite=&amp;quot;true&amp;quot;&lt;br /&gt;    type=&amp;quot;Find out your top 10 friends&amp;quot;&lt;br /&gt;    content=&amp;quot;Come and find out your top 10 friends! &amp;amp;lt;fb:req-choice url=&amp;amp;quot;http://apps.facebook.com/findouttopfriends/&amp;amp;quot; label=&amp;amp;quot;Let me check my friends&amp;amp;quot; /&amp;amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;      &amp;lt;fb:multi-friend-selector showborder=&amp;quot;false&amp;quot;&lt;br /&gt;      actiontext=&amp;quot;Invite your friends to use find out your top 10 friends application.&amp;quot;&lt;br /&gt;      rows=&amp;quot;5&amp;quot; cols=&amp;quot;5&amp;quot; bypass=&amp;quot;cancel&amp;quot; target=&amp;quot;_top&amp;quot;&lt;br /&gt;      exclude_ids=&amp;quot;ExecludedIDS&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/fb:request-form&amp;gt;&lt;br /&gt;  &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/fb:serverfbml&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;This is the compelete code for the multi friend selector control&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The trick is the action url is where the user will be redirected after clicking skip or invite friends so if this url is your application URL like http://cupidmatchmaker.pickmegift.com/ then you end with nested page inside your iframe, so you should consider using facebook home page url &quot;http://facebook.com&quot; but if you want the skip or invite action to redirect to page in your application the url should look like this http://apps.facebook.com/cupidmatchmaker/ yourpage.aspx but you need to change this url to your real url and dont use mine :-)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;for the sample application visit: &lt;a href=&quot;http://apps.facebook.com/findouttopfriends/&quot;&gt;http://apps.facebook.com/findouttopfriends/&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;for facebook wiki pages: &lt;br /&gt;&lt;span style=&quot;font-size: 0.8em&quot;&gt;&lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Fb:multi-friend-selector&quot;&gt; 1-http://wiki.developers.facebook.com/index.php/Fb:multi-friend-selector &lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://wiki.developers.facebook.com/index.php/Multi_friend_selector&quot;&gt; 2-http://wiki.developers.facebook.com/index.php/Multi_friend_selector &lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;hope this helps, waiting your feedback...&lt;br /&gt;&lt;/div&gt;</description><link>http://meenaf.blogspot.com/2009/06/facebook-multi-friend-selector-inside.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>8</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-882503703590187161</guid><pubDate>Fri, 29 May 2009 11:29:00 +0000</pubDate><atom:updated>2009-05-29T17:15:04.965+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><category domain="http://www.blogger.com/atom/ns#">Multi Threading</category><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>How to multi threading in WPF / ProgressBar example</title><description>&lt;div&gt;I will show you how to work with multi threading in Windows Presentation Foundation (WPF) using a very simple scenario.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We will build a simple WPF program that block the application window without blocking the main thread and shows progress bar using multi threading&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First we need to have the delegates and the members that will be used to begin the progress thread as the following.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;private delegate void NoParametersDelegate(); // to be called to begin the progress thread.&lt;/div&gt;&lt;div&gt;private delegate bool ProgressDelegate(); // to set the progress bar value and return boolean weather to end the thread or not.&lt;/div&gt;&lt;div&gt;private IAsyncResult asyncResult; // thread IAsyncResult to be used to release the thread resources in case we need to close the application during the thread is alive&lt;/div&gt;&lt;div&gt;private bool endProgress; // to be used to identify if we want to end the progress thread or not&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create the button click event handler that will begin the progress thread and disable the main window during the progress operation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;private void btnStart_Click(object sender, RoutedEventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;asyncResult = null; // reset the IAsyncResult object.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;endProgress = false; // set the flag that indicate we want to end the progress thread or not.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;NoParametersDelegate thread = new NoParametersDelegate(Start); // create the thread delegate;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;asyncResult = thread.BeginInvoke(null, null); // begin invoking the progress thread and set the asyncResult to be used to release the thread resources.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;this.IsEnabled = false; // disable the window.&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The next method will start progress thread&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;private void Start()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;// infinite loop.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;while (true)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;// here&#39;s the trick, we invoke new delegate &quot;ProgressDelegate&quot; that will be the communication channel &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;// between the progress thread and the main thread to enable the progress thread to set the progress bar value and to check if the main thread want this thread to be closed or not.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;bool endThread = (bool)this.Dispatcher.Invoke(new ProgressDelegate(delegate()&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;// check if the progress reached the maximum value then end the progress thread.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;if (progressBar.Value == progressBar.Maximum || endProgress)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;progressBar.Value = 0;// reset the progress bar value.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;this.IsEnabled = true; // enable the window.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;return true;// notify the progress thread to be ended.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;progressBar.Value += 1; // increase the progress bar.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;return false;// notify the progress thread to continue.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}));&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;// end the progress thread.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;if (endThread)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;Thread.CurrentThread.Suspend();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;// this is for the sake of demo only to simulate progress.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;Thread.Sleep(50);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The last step we will create the main window closing event handler to release the resources of the progress thread if it&#39;s still running.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;if (asyncResult != null)&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;// release the progress thread resources.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;asyncResult.AsyncWaitHandle.Close();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally i tried to make it simple as much as i can so if there&#39;s anything that I missed please let me know :-)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Full source code can be downloaded from live skydrive here:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;iframe scrolling=&quot;no&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; frameborder=&quot;0&quot; style=&quot;width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;&quot; src=&quot;http://cid-e1460a6686d7dd48.skydrive.live.com/embedrowdetail.aspx/Blog%20sources/MultiThreadingWPF.zip&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://meenaf.blogspot.com/2009/05/how-to-multi-threading-in-wpf.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-644371684395223601.post-3995161959051097764</guid><pubDate>Sat, 23 May 2009 19:58:00 +0000</pubDate><atom:updated>2009-05-24T02:13:31.702+03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><title>What is Extension Methods ?</title><description>It&#39;s a new feature in .Net Framework 3.0 that enable us to add methods to any existing type without any modification in the original type.&lt;br /&gt;&lt;br /&gt;Extension method is a static method with a special signature (the first type of the first parameter in the method signature is preceded by the this modifier), Also must be in a static class.&lt;br /&gt;&lt;br /&gt;The compiler translate any extension method into a static method call, this means extension methods cannot access private variables declared in the type they are extending.&lt;br /&gt;&lt;br /&gt;To bring the extension methods into the scope add using statement to the namespace contains this the extension methods.&lt;br /&gt;&lt;br /&gt;Extension methods example in C#:&lt;br /&gt;&lt;br /&gt;namespace ExtensionMethods&lt;br /&gt;{&lt;br /&gt;public static class MyExtensions&lt;br /&gt;{&lt;br /&gt;   public static int WordCount(this String str)&lt;br /&gt;   {&lt;br /&gt;       return str.Split(new char[] { &#39; &#39;, &#39;.&#39;, &#39;?&#39; }, StringSplitOptions.RemoveEmptyEntries).Length;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This example will result a new method named WordCount that will be added to any String type, this method will take no arguments because (this keyword as we notice in the method signature) tells the editor this is extension method to be added to the type String and this method return int number with the word count found in this string.&lt;br /&gt;&lt;br /&gt;Syntax to use this extension method:&lt;br /&gt;&lt;br /&gt;using ExtensionMethods;&lt;br /&gt;&lt;br /&gt;namespace MyNamespace&lt;br /&gt;{&lt;br /&gt;public class Test&lt;br /&gt;{&lt;br /&gt;   public Test()&lt;br /&gt;   {&lt;br /&gt;       string str = &quot;Hellow World&quot;;&lt;br /&gt;       int wordCount = str.WordCount();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What if there&#39;s a method with the same signature in the type String?&lt;br /&gt;The  compiler will check if there&#39;s a method with the same signature in this type, if found then will be called and the extension method will be ignored, otherwise it will call the extension method.&lt;br /&gt;&lt;br /&gt;Can i add parameters to the extension method?&lt;br /&gt;Yes you can, As shown in the next example.&lt;br /&gt;&lt;br /&gt;namespace ExtensionMethods&lt;br /&gt;{&lt;br /&gt;public static class MyExtensions&lt;br /&gt;{&lt;br /&gt;   public static int WordCount(this String str, char[] separator)&lt;br /&gt;   {&lt;br /&gt;       return str.Split(separator, StringSplitOptions.RemoveEmptyEntries).Length;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Then  the calling will be:&lt;br /&gt;&lt;br /&gt;using ExtensionMethods;&lt;br /&gt;&lt;br /&gt;namespace MyNamespace&lt;br /&gt;{&lt;br /&gt;public class Test&lt;br /&gt;{&lt;br /&gt;   public Test()&lt;br /&gt;   {&lt;br /&gt;       string str = &quot;Hellow World&quot;;&lt;br /&gt;       int wordCount = str.WordCount(new char[] { &#39; &#39;, &#39;.&#39;, &#39;?&#39; });&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Finally it&#39;s not recommended to use extension methods except to extend types that you cannot  create a new type derived from the existing type, otherwise it&#39;s better from a design perspective to create a new type derived from the existing type.</description><link>http://meenaf.blogspot.com/2009/05/what-is-extension-methods.html</link><author>noreply@blogger.com (Meena Fawzy)</author><thr:total>2</thr:total></item></channel></rss>