<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[TreeNodes - Medium]]></title>
        <description><![CDATA[TreeNodes Software - Medium]]></description>
        <link>https://medium.com/treenodes?source=rss----8a49757a6f91---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>TreeNodes - Medium</title>
            <link>https://medium.com/treenodes?source=rss----8a49757a6f91---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 24 May 2026 02:28:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/treenodes" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Intro To React Javascript Library]]></title>
            <link>https://medium.com/treenodes/intro-to-react-javascript-library-for-building-user-interfaces-4984e2f5e02c?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/4984e2f5e02c</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es2015]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Nermien M. Barakat]]></dc:creator>
            <pubDate>Sun, 07 May 2017 11:45:44 GMT</pubDate>
            <atom:updated>2017-05-07T11:45:55.520Z</atom:updated>
            <content:encoded><![CDATA[<h3>Intro To React.js Library</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*4Nyxq5XNH6DRRRBqvDuKcQ.jpeg" /></figure><h3>What is react ?</h3><p>React is Javascript library for building user interfaces (UIs). <em>React is the </em><strong><em>V</em></strong><em> (</em><a href="https://edgecoders.com/what-exactly-is-react-js-d04ebfb5c610"><em>View</em></a><em>) in </em><strong><em>MVC.</em></strong></p><p>React is declarative, efficient, and extremely flexible. What’s more, it works with the libraries and frameworks that you already know like jQuery’s UI plugin.</p><h3>Why React ?</h3><p>React is probably one of the best choices for building UI. Good design, support and community.</p><p>React was built to solve one problem: building large applications with data that changes over time. To simplify the process of building complex UIs.</p><h3><strong>How was the idea to develop React conceived ?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hSIQsI36RQ6Zd9V7oqoZpA.jpeg" /></figure><p>Short: Conceived at Facebook. Heavily used on products made by Facebook and Instagram. <strong>Built to simplify the process of building complex UIs.</strong></p><p>The story of <a href="http://facebook.github.io/react/index.html">React</a> started within the confines of Facebook. React was created by Jordan Walke, a software engineer at Facebook. Jordan deserves all the credit for creating React. He was influenced by XHP, a PHP-based component system that is still in use at Facebook, but also by functional programming ideas.</p><p>Pete Hunt wanted to use React at Instagram, so he helped to extract React from Facebook-specific code. This prepared React to be open sourced.</p><p>Later, Facebook put a team of engineers behind React and also received great contributions from the open source community. Significant contributors include Sebastian Markbåge and Ben Alpert, among many others. <a href="https://www.quora.com/How-was-the-idea-to-develop-React-conceived-and-how-many-people-worked-on-developing-it-and-implementing-it-at-Facebook"><em>Source</em></a></p><h3>Sites Using React</h3><p>Facebook, Instagram, Dropbox, NETFLIX, Airbnb, PayPal and <a href="https://github.com/facebook/react/wiki/sites-using-react">More</a>.</p><h3>Prerequisites to use react :</h3><p>Javascript basics</p><ul><li>Declaring variables</li><li>Creating and invoking functions</li><li>DOM the Document Object Model (basically how Javascript Talks to the Browser)</li></ul><p>ES2015</p><ul><li>Class syntax</li><li>Arrow functions</li><li>spread operator</li></ul><h3><strong>To understand some of the concepts under which React operates.</strong></h3><ul><li><strong>Declarative</strong></li></ul><p>React makes it painless to create interactive UIs. Design simple views for each <a href="https://facebook.github.io/react-native/docs/state.html#state">state</a> in your application, and React will efficiently update and render just the right components when your data changes. <a href="https://facebook.github.io/react/">Source</a></p><p><em>I.e React is the </em><strong><em>V</em></strong><em> (</em><a href="https://edgecoders.com/what-exactly-is-react-js-d04ebfb5c610"><em>View</em></a><em>) in </em><strong><em>MVC </em></strong>that is used to render views like HTML pages dynamically based on some Props/<a href="https://facebook.github.io/react-native/docs/state.html#state">state,</a> which is often in the form of data. React then updates the generated views whenever the original <a href="https://facebook.github.io/react-native/docs/state.html#state">state</a> changes.</p><p>Declarative views make your code more predictable and easier to debug.</p><ul><li><strong>The virtual representation of views in memory</strong></li></ul><p>For the browser’s case, we write HTML using JavaScript in React relying on the power of JavaScript to generate HTML that depends on some data, rather than enhancing HTML to make it work with that data. Enhancing HTML is what other JavaScript frameworks usually do (for example, Angular.js extends HTML with features like loops, conditionals, and others). <a href="https://edgecoders.com/what-exactly-is-react-js-d04ebfb5c610"><em>Source</em></a></p><ul><li><strong>Component-Based</strong></li></ul><p>Build encapsulated components that manage their own state, then compose them to make complex UIs.<a href="https://facebook.github.io/react/">Source</a></p><p>Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.</p><ul><li><strong>Learn Once, Write Anywhere</strong></li></ul><p>You can develop new features in React without rewriting existing code.</p><p>React can also render on the server using Node and power mobile apps using <a href="https://facebook.github.io/react-native/">React Native</a>.</p><h3>In order to write your first react components you have to be <strong>familiar</strong> with some of the features react offers like How to:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*N48Es16mTk4niYho8MeDAw.png" /></figure><ul><li>Write React components</li><li>Render data to the page</li><li>Communicate components i.e pass data from one component to another?</li><li>Handle user events</li><li>Capture user input</li><li>Talk to remote servers.</li></ul><p>Now that we know what React is and what you have to covre to write React first component. Let’s start exploring how to build things in <a href="https://medium.com/@nerimbarakat/intro-to-react-2-41b84dd74b5d">the next article.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4984e2f5e02c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/intro-to-react-javascript-library-for-building-user-interfaces-4984e2f5e02c">Intro To React Javascript Library</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro To React.JS and how to set React component and the virtual DOM]]></title>
            <link>https://medium.com/treenodes/intro-to-react-2-41b84dd74b5d?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/41b84dd74b5d</guid>
            <category><![CDATA[dom]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Nermien M. Barakat]]></dc:creator>
            <pubDate>Sun, 07 May 2017 11:43:40 GMT</pubDate>
            <atom:updated>2017-05-06T22:31:04.827Z</atom:updated>
            <content:encoded><![CDATA[<h4>Set React component and the virtual DOM</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CVPjmgaFk6KUHZzDlcHiCw.png" /></figure><p>Now that we know what React is and what you have to cover in the first article ( <a href="https://medium.com/@nerimbarakat/intro-to-react-javascript-library-for-building-user-interfaces-4984e2f5e02c"><strong><em>Intro to React</em></strong></a> ). Let’s set and prepare our fist react component.</p><p>When using React, we solve problems using component based architecture. So We have to start thinking in term of components to build our application. First we create components, and if a component gets too complex we break it into smaller, simpler components.</p><p>Let’s try to imaginary identify some components we might use in comment widget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*UBAouaS_E2wklpuJM2Vp_w.jpeg" /></figure><ul><li>The First component is what brings everything together. Let’s call it ( MainBox ).</li><li>This will be the root component.</li><li>The second component we have is the picture. Let’s call it (PhotoBox).</li><li>Third box will be the comment form let’s create it and call it (CommentForm). And this will allow users to add new comment to our feed.</li><li>The 4th will be (CommentBox) and<strong> We will reuse (commentBox) component over and over again but with different data each time.</strong></li></ul><p>It will look like this after we apply our visuale boxes. You can call your component StoryBox / StoryImage / StoryForm / Story or whatever you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*pnaVKu4nvUfOkxu1s5X6BA.jpeg" /><figcaption>React Component architecte</figcaption></figure><p>Now after we used and identified our components.</p><h3>What is a component in react ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*s5tvmdWSP3odc3m4Fagaxg.png" /><figcaption><a href="https://www.kirupa.com/react/images/c_c_c_c_c_c_144.png">Image source</a></figcaption></figure><h3><a href="https://facebook.github.io/react/docs/components-and-props.html">Components and Props</a></h3><p>Components let you split the UI into independent, reusable pieces, and think about each piece in isolation.</p><p>Conceptually, components are like <strong>JavaScript functions</strong>. They accept arbitrary inputs called <strong>props </strong>and return React elements describing what should appear on the screen i.e <strong>They ultimately generate what becomes our HTML code.</strong></p><h3><a href="https://facebook.github.io/react/docs/components-and-props.html">Functional and Class Components</a></h3><p>The simplest way to define a component is to write a <strong>JavaScript function</strong>:</p><pre>function Welcome(props) {<br>  return &lt;h1&gt;Hello, {props.name}&lt;/h1&gt;;<br>}</pre><p>This function is a valid React component because it accepts a single <strong>“props” object</strong> <strong>argument </strong>with data and <strong>returns a React element</strong>. We call such components “functional” because they are literally JavaScript functions.</p><p>You can also use an <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Classes">ES6 class</a> to define a component:</p><pre>class Welcome extends React.Component {<br>  render() {<br>    return &lt;h1&gt;Hello, {this.props.name}&lt;/h1&gt;;<br>  }<br>}</pre><p>The above two components are equivalent from React’s point of view. Classes have some additional features that we will discuss in later in another blog post.</p><p>Let’s look at this simple component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*yifAABQ2XIQuxeu8h78Fkw.jpeg" /></figure><p>When the render method is call on it, it return output #1.</p><pre>&lt;div&gt; <br>&lt;P&gt;Hello,Wold!&lt;/p&gt;<br>&lt;P&gt;10:00AM&lt;/p&gt;<br>&lt;/div&gt;</pre><p>Later on we will call <strong>this</strong> same component’s render method again and we will generate output #2. But with 10:30AM. So we create a new component but it <strong>doesn’t</strong> mean that the whole DOM has changed. That’s where the <strong>virtual DOM</strong> comes in. Wait a second.</p><h3><strong>What is the virtual DOM?</strong></h3><p>The virtual DOM is an in-memory representation of the real DOM elements generated by React components before any changes are made to the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*lGG5MQajFK4m-G9Gzm756g.jpeg" /><figcaption><a href="http://i.dailymail.co.uk/i/pix/2014/01/23/article-2544539-1AE7111D00000578-757_634x361.jpg">Image source</a></figcaption></figure><p>It’s a step that happens between the <strong>render function being called </strong>and the displaying of elements on the screen.</p><p>A component’s render method <strong>returns</strong> some markup, but it’s not the final HTML yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/1*P2C0RlAPQwnEguKPXAVyeA.jpeg" /><figcaption>VIRTUAL DOM</figcaption></figure><p>It’s the in-memory representation of what will become real elements.</p><p><strong>This is step 1.</strong></p><p>Then that output will be transformed into real HTML, which is what gets displayed in the browser.</p><p><strong>This is step 2.</strong></p><pre>&lt;div&gt; <br>&lt;P&gt;Hello,World!&lt;/p&gt;<br>&lt;P&gt;10:30AM&lt;/p&gt;<br>&lt;/div&gt;</pre><p>So <strong>why go through all this to generate virtual DOM?</strong></p><p>Simple answer — This is what allows react to be fast. It does this by means of virtual DOM diffing. Comparing two virtual trees — old and new — and make only the necessary changes into the real DOM in our case only this paragraph will be replaced.</p><pre><br>&lt;P&gt;10:30AM&lt;/p&gt;<br></pre><p>Virtual DOM <a href="https://facebook.github.io/react/docs/reconciliation.html">diffing</a> allows React to <strong>minimize changes</strong> to the DOM as a result of user actions — therefore, increasing browser performance.</p><p><strong>Useful reading:</strong></p><ul><li><a href="https://cardlife.blog/what-is-virtual-dom-c0ec6d6a925c">What is Virtual DOM?</a></li><li><a href="https://hashnode.com/post/the-one-thing-that-no-one-properly-explains-about-react-why-virtual-dom-cisczhfj41bmssp53mvfwmgrq">The one thing that no one properly explains about React — Why Virtual DOM</a></li><li><a href="http://reactkungfu.com/2015/10/the-difference-between-virtual-dom-and-dom/">The difference between Virtual DOM and DOM</a></li><li>Code school <a href="https://www.codeschool.com/courses/powering-up-with-react">Powering Up With React</a></li><li><a href="https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060">How to write your own Virtual DOM</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41b84dd74b5d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/intro-to-react-2-41b84dd74b5d">Intro To React.JS and how to set React component and the virtual DOM</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DateTimeOffset Simple initialising and usage with different TimeZones]]></title>
            <link>https://medium.com/treenodes/datetimeoffset-simple-initialising-and-usage-f92b2d8e535?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/f92b2d8e535</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[datetimeoffset]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Sat, 06 May 2017 22:37:26 GMT</pubDate>
            <atom:updated>2017-05-05T17:59:21.388Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T-K6RVkZxfd5lr-iN9iGLQ.png" /></figure><p>Many many articles online talking about when, why and how to use DateTimeOffset.</p><p>On the top list:</p><ul><li><a href="https://msdn.microsoft.com/en-us/library/bb384267(v=vs.110).aspx">Choosing Between DateTime, DateTimeOffset, TimeSpan, and TimeZoneInfo</a></li><li><a href="http://stackoverflow.com/questions/4331189/datetime-vs-datetimeoffset">DateTime vs DateTimeOffset</a></li><li><a href="https://msdn.microsoft.com/en-us/library/system.datetimeoffset(v=vs.110).aspx">DateTimeOffset Structure</a></li></ul><p>I have used it myself in many projects, last one is a website used by different distributors in many different countries with thousands of customers under each distributor, and I found DateTimeOffset is the solution for managing datetime between different time zones.</p><p>You can find many examples online on how to use it in details, but the one I wanted to list here as a reminder for my self is how to initialise it with a certain time zone offset and read from the DateTimeOffset the current date time based on this time zone.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd1f2f7879feed8c271b29aad6a56b9a/href">https://medium.com/media/dd1f2f7879feed8c271b29aad6a56b9a/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f92b2d8e535" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/datetimeoffset-simple-initialising-and-usage-f92b2d8e535">DateTimeOffset Simple initialising and usage with different TimeZones</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Properties — the basics]]></title>
            <link>https://medium.com/treenodes/properties-the-basics-45f49c695027?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/45f49c695027</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[csharp]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Sat, 04 Mar 2017 23:45:20 GMT</pubDate>
            <atom:updated>2017-05-07T20:57:18.845Z</atom:updated>
            <content:encoded><![CDATA[<p>Properties in C# is a special type of methods called accessors, they are accessed as if they are public member fields but with read, write and compute the value.</p><p>Is is declared like a field but with a get and set blocks inside, <em>get</em> is to read the property value and must return the same property type, <em>set</em> is to write to the property, using an implicit parameter called value.</p><p>Typically properties read and write from/to fields,</p><pre>private int _salary;<br>public int Salary<br>{<br>  get { return _salary; }<br>  set { _salary = value; }<br>}</pre><p>but we can also declare properties without depending on a field “automatic properties — introduced in C# 3.0”, when an automatic property is use, the compiler generates a private field for this property.</p><pre>public int SalaryAutomaticProperty { get; set; }</pre><blockquote>From <a href="https://msdn.microsoft.com/en-us/library/x9fsa0sw.aspx">MSDN</a>:</blockquote><blockquote>A property is a member that provides a flexible mechanism to read, write, or compute the value of a private field. Properties can be used as if they are public data members, but they are actually special methods called <em>accessors</em>. This enables data to be accessed easily and still helps promote the safety and flexibility of methods.</blockquote><h4>Read Only Properties:</h4><p>We can make a property read-only by not adding a set accessor to the property body:</p><pre>public int ReadOnlySalary { get; }</pre><pre>private int quantity;<br>private int price;<br>public int ReadOnlyTotalPrice { get { return quantity * price; } }</pre><pre>myClass.ReadOnlyTotalPrice = 10; // compile error</pre><p>We may also mark the <a href="http://stackoverflow.com/a/3917846/20126">set accessor as private</a>, while this will prevent class consumers from changing the property value but this doesn’t mean that this property is a read only, it just means that the property set accessor is not accessible out side this class.</p><pre>public int PrivateSetTotalPrice { get; private set; }</pre><p>… And also note, that if we started to add a body for the get accessor, we will have to add a body for the set accessor as well, which may not make sense with read only purpose properties.</p><p>We can also make the property private field a readonly, which will make sure that the field will never change after initializing.</p><p><a href="http://stackoverflow.com/a/3917805/20126">how to implement a read only property</a></p><p>Starting from C# 6.0 we can declare a read only property as an <a href="https://visualstudiomagazine.com/articles/2015/06/03/c-sharp-6-expression-bodied-properties-dictionary-initializer.aspx">expression-bodied property</a></p><pre>public int ReadOnlyExpressionTotalPrice =&gt; quantity * price;</pre><p>Which can <a href="https://msdn.microsoft.com/en-gb/magazine/dn802602.aspx#CodeSnippetContainerCode_ef42d096-fb37-4a3c-a162-30daa56224e4">contain more logic</a>:</p><pre>public string Config { get; } = string.IsNullOrWhiteSpace(<br>  string connectionString =<br>    (string)Properties.Settings.Default.Context?[&quot;connectionString&quot;])?<br>  connectionString : &quot;&lt;none&gt;&quot;;</pre><h4>Initializing properties:</h4><p>To initialize a property we can do this using the container class constructor or give the property’s private field value on deceleration.</p><p>Starting from C# 6.0 we can initialize the property inline like this:</p><pre>public int InlineInitProperty { get; set; } = 10;</pre><p>and it can be used on read only properties as well</p><pre>public int ReadOnlyInlineInitProperty { get; } = 10;</pre><p>Finally, It is highly recommended to read “<a href="http://csharpindepth.com/Articles/Chapter8/PropertiesMatter.aspx"><em>Why Properties Matter</em></a><em>”!</em></p><p><a href="https://github.com/amrelgarhy/samples/tree/master/BasicsCSharp"><em>examples used</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45f49c695027" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/properties-the-basics-45f49c695027">Properties — the basics</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Different ways to hide an HTML Element]]></title>
            <link>https://medium.com/treenodes/different-ways-to-hide-an-html-element-cb6973071e42?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/cb6973071e42</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[technical]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Mon, 05 Sep 2016 22:22:20 GMT</pubDate>
            <atom:updated>2017-05-06T22:22:36.419Z</atom:updated>
            <content:encoded><![CDATA[<p>There are different ways to hide an HTML element from the client, just hiding not removing.</p><pre>&lt;div&gt; <br> &lt;p&gt;Line 1&lt;/p&gt;<br> &lt;p class=&quot;hide&quot;&gt;Line 2&lt;/p&gt;<br> &lt;p&gt;Line 3&lt;/p&gt;<br> &lt;p&gt;Line 4&lt;/p&gt; <br>&lt;/div&gt;</pre><p>We need to hide p.hide element, so the user can’t see it.</p><h3>Display:</h3><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/display">Display css property</a>, display is the most important and most used css property to control HTML elements layout.</p><p><em>display:none; </em>can be used to hide an HTML element from the view and it will appear as if it was not there on the page, means the HTML element will be hidden without blocking any space.</p><p>Example: <em>Text 1 | Text 2 | Text 3</em></p><p>If we apply <em>display:none;</em> on Text 2, it will be: <em>Text 1 | | Text 3</em></p><p>So to hide p.hide element using display property:</p><pre>p.hide{<br>   display:none;<br>}</pre><h3>Visibility:</h3><p><a href="https://developer.mozilla.org/en/docs/Web/CSS/visibility">Visibility property</a> is the CSS property to manage HTML visibility, unlike display which has different values to control the element layout, visibility is used jut for show and hide elements</p><p><em>visibility: hidden </em>can be used to hide an element from the client, but it will keep the element space visible like this: <em>Text 1 | | Text 3</em></p><p>When to use which? based on requirements and the case you have, you just need to test it on all browsers, and there will be an unrecognizable performance differences between different ways</p><p><a href="http://stackoverflow.com/a/11757103/20126">Performance differences between visibility:hidden and display:none</a></p><h3>Opacity:</h3><p><a href="https://developer.mozilla.org/en/docs/Web/CSS/opacity">Opacity property</a> is controlling the transparency of the html element, so we can use it to make the element fully transparent and this will hide the element from the client view.</p><p>Just make sure to test it on all browsers because on older IE browsers it had some special ways to implement. (hope that no one still using old IE browsers, because the wont see many things any way :) )</p><p>And the same as Visibility property, it will hide the element but will keep blocking its space, so the client will see an empty space instead of the element.</p><h3>Background color and color</h3><p>While it is rarely used, but we can change the <a href="https://developer.mozilla.org/en/docs/Web/CSS/background-color"><em>background-color</em></a><em> element css </em>property and all child elements to be the same as the background color of the page or the same as container background.</p><p>Will need to change the text <em>color </em>as well to make sure that text is not visible as well.</p><p>And on some elements we may need to remove borders, that’s why this way is not common to use.</p><h3>Font size:</h3><p>We can hide text elements by setting <a href="https://developer.mozilla.org/en/docs/Web/CSS/font-size"><em>font-size</em></a><em> </em>property to 0</p><h3>Position:</h3><p>Using the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position"><em>position </em></a>property and <em>top left</em> we can make the control appear outside the client view.</p><h3>Clip-Path (Clip):</h3><p>Last way I want to mention on this post is using <a href="https://developer.mozilla.org/en/docs/Web/CSS/clip-path">clip-path</a> css property</p><p><strong>References:</strong></p><p><a href="http://adaptivethemes.com/using-css-clip-as-an-accessible-method-of-hiding-content">Using CSS clip as an Accessible Method of Hiding Content</a></p><p><a href="https://snook.ca/archives/html_and_css/hiding-content-for-accessibility">https://snook.ca/archives/html_and_css/hiding-content-for-accessibility</a></p><ul><li><a href="http://stackoverflow.com/questions/2928688/how-to-hide-elements-without-having-them-take-space-on-the-page">How to hide elements without having them take space on the page?</a></li><li><a href="http://stackoverflow.com/questions/775060/how-to-hide-the-content-of-the-div-in-css">how to hide the content of the div in css</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb6973071e42" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/different-ways-to-hide-an-html-element-cb6973071e42">Different ways to hide an HTML Element</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Cloud Drive Windows Client]]></title>
            <link>https://medium.com/treenodes/amazon-cloud-drive-windows-client-8fb0bfcb26a7?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/8fb0bfcb26a7</guid>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[hints]]></category>
            <category><![CDATA[firewall]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Wed, 27 May 2015 21:40:11 GMT</pubDate>
            <atom:updated>2017-05-06T22:22:42.424Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><a href="https://www.amazon.com/clouddrive">Amazon Cloud Drive</a> is your place for everything digital. Cloud Drive offers free mobile apps, secure access from any computer, and it’s built in to your Amazon devices — so you can access your digital content everywhere you are.</blockquote><p>When it comes to files hosting I trust amazon based on my previous experiences, and based on the cheap offers they have.</p><p>Also there are many file hosting web services are bases on Amazon cloud hosting and file hosting such as Dropbox which is built on Amazon S3.</p><p>So when Amazon released the Cloud drive, I signed up and started using their website, but it is not allowed to upload big files (larger than 2GB) through the website.</p><p>And for that reason I download the windows client application,</p><p>Downloaded and installed successfully on a windows 8.1 machine.</p><p>BUT: when I started to upload or download a file:</p><p>- If the file is big or trying to upload a folder, the application get closed without any error messages.</p><p>- If I am uploading a single small file an error message appear “this folder/file failed to upload”. <a href="http://screencast.com/t/RPU2kiC9SQNP">http://screencast.com/t/RPU2kiC9SQNP</a></p><p>-If I am downloading a file, nothing happen, it just don’t download it.</p><p>On this windows 8.1 machine there are just windows defender anti virus running which is not blocking anything.</p><p>To solve this Issue we need to allow this application in Firewall like this <a href="http://www.wikihow.com/Add-Exceptions-to-Windows-8-Firewall">http://www.wikihow.com/Add-Exceptions-to-Windows-8-Firewall</a></p><p>or using the following steps:</p><p>1- Open control panel</p><p>2- Windows Firewall</p><p>3- Turn windows firewall on and off</p><p>4- Select Inbound rules</p><p>5- From the right side actions click: New Rule</p><p>6- Select Program and next</p><p>7- Browse for “C:\Users\USERNAME\AppData\Local\Amazon\Cloud Drive\AmazonCloudDrive.exe”</p><p>8- Allow connections.</p><p>9- Based on security needs select from or all “Domain”, “Private” and “Public”</p><p>10- Add a name, something like “Amazon Cloud Drive Rule” and finish</p><p>11- Go to Outbound Rules</p><p>12- Do the same as we did for Inbound Rules starting from point #5</p><p>These steps will make a rule in your Firewall to allow Amazon Cloud Drive to upload and download files.</p><p>Now start uploading/downloading files and It should work.</p><p>Also I believe that others may face the same issue because of their antiviruses and should create an exception rule to allow this application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fb0bfcb26a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/amazon-cloud-drive-windows-client-8fb0bfcb26a7">Amazon Cloud Drive Windows Client</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[nopcommerce: How to get Role Name from applied discount coupon?]]></title>
            <link>https://medium.com/treenodes/nopcommerce-how-to-get-role-name-from-applied-discount-coupon-cabe008d83e4?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/cabe008d83e4</guid>
            <category><![CDATA[nopcommerce]]></category>
            <category><![CDATA[mvc]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Thu, 11 Oct 2012 09:08:02 GMT</pubDate>
            <atom:updated>2017-05-06T22:22:41.664Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/192/0*16JQfRQb8rT7AAR9.jpg" /></figure><p>- Create a discount from the cms admin</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/0*TE66Ge3k_95LTGf-.png" /></figure><p>- Add a requirement for that discount and select “Must be assigned to customer role” and choose a role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/0*yG3QRxA0dB-X_ocM.png" /></figure><p>The next steps can be done anywhere in the website, I will use the CommonController to show the role name inside the website header beside the user email</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Wbk85o9Jabfk0hg.png" /></figure><p>- Go to CommonController and inside the HeaderLinks method add these lines:</p><pre>// Added by treenodes 10 Oct 2012<br>            string discountRoleName = string.Empty;<br>            if (discount !=null &amp;&amp; discount.DiscountRequirements != null)<br>            {<br>                var requ = discount.DiscountRequirements.FirstOrDefault();<br>                foreach (var customerRole in customer.CustomerRoles.Where(cr =&gt; cr.Active).ToList())<br>                    if (requ != null &amp;&amp; requ.RestrictedToCustomerRoleId == customerRole.Id)<br>                        discountRoleName = customerRole.Name;<br>            }</pre><p>So the method will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I7hsp9Xf7UY0Hy66.png" /></figure><p>- You will need to declare the _discountService, so declare it in the Fields region</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/0*xX5f4XXDyahSG9-F.png" /></figure><p>and then initialize it in the controller constructor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/0*kZ1Kx1Np8mcQHjfR.png" /></figure><p>- Add DiscountRoleName property inside the HeaderLinksModel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*1VAc7ixtsCfrSxuk.png" /></figure><p>- Inside the HeaderLinks view, inside the IsAuthinticated check, add this:</p><pre>&lt;li&gt;&lt;a href=&quot;#&quot;&gt;@Model.DiscountRoleName&lt;/a&gt;&lt;/li&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*TDSSBzZRdp14x4qr.png" /></figure><p>- Login to the store and apply a coupon code you just created, you will see the role name of this applied discount coupon in the header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/0*KFhazIdzUecpRMie.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cabe008d83e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/nopcommerce-how-to-get-role-name-from-applied-discount-coupon-cabe008d83e4">nopcommerce: How to get Role Name from applied discount coupon?</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Large file upload — asp.net]]></title>
            <link>https://medium.com/treenodes/large-file-upload-asp-net-f95abb8b4d86?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/f95abb8b4d86</guid>
            <category><![CDATA[upload]]></category>
            <category><![CDATA[mvc]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[telerik]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Mon, 23 Apr 2012 21:08:05 GMT</pubDate>
            <atom:updated>2017-05-06T22:22:46.457Z</atom:updated>
            <content:encoded><![CDATA[<p>Uploading large files in ASP.Net or MVC is a little confusing for some of us.</p><p>I faced this confusing issue more than a year ago and solved it by the help of some articles online, but recently I faced the same issue I faced 1 year ago, and totally forgot how to fix it.</p><p>So I wanted to list here the URL which solved all my issues a year ago, and solved it recently as well:</p><p><a href="http://www.telerik.com/help/aspnet-ajax/upload-uploading-large-files.html">Telerik Uploading Large Files</a> , This article contain everything which helps to edit the web.config and IIS to make uploading large files a nice task.</p><p>To know more about these properties you will edit in the web.config, I recommend to take a look at this <a href="http://msdn.microsoft.com/en-us/library/e1f13641.aspx">msdn page</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4MVXfIvUksZuBJFy.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f95abb8b4d86" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/large-file-upload-asp-net-f95abb8b4d86">Large file upload — asp.net</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Organize JavaScript and jQuery events — DOM-ready execution]]></title>
            <link>https://medium.com/treenodes/organize-javascript-and-jquery-events-dom-ready-execution-ab9045baa005?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/ab9045baa005</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jquery]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Thu, 19 Apr 2012 15:32:31 GMT</pubDate>
            <atom:updated>2017-05-07T20:59:19.446Z</atom:updated>
            <content:encoded><![CDATA[<p>In complex websites javascript and jquery events can conflict with each other, especially if you are using the same javascript files for different website pages.<br>There are many techniques to solve this issue, and I found a good solution by following these articles:<br><a href="http://paulirish.com/2008/automate-firing-of-onload-events/">Automate firing of onload events</a><br><a href="http://paulirish.com/2009/markup-based-unobtrusive-comprehensive-dom-ready-execution/ ">Markup-based unobtrusive comprehensive DOM-ready execution</a><br><a href="http://www.viget.com/inspire/extending-paul-irishs-comprehensive-dom-ready-execution/">Extending Paul Irish’s comprehensive DOM-ready execution</a></p><p>But while using this technique I faced an issue, I wanted to call more than one init function on the same page load, for example if I have my page as sections: header, login popup, inner form, footer. And each section needs to have its own init functions which load automatically when this section DOM-ready.</p><p>In <a href="http://viget.com/inspire/extending-paul-irishs-comprehensive-dom-ready-execution">Extending Paul Irish’s comprehensive DOM-ready execution article</a><br>He used the body element to run the selected action in the selected controller</p><pre>&lt;body data-controller=&quot;&lt;%= controller_name %&gt;&quot; data-action=&quot;&lt;%= action_name %&gt;&quot;&gt;</pre><p>And since body element is always one in any page, so we can’t call more than one controller action.</p><p>I extended this technique to use any html element in the page, something like that:</p><pre>&lt;i class=&quot;initializer&quot; data-controller=&quot;&lt;%= controller_name %&gt;&quot; data-action=&quot;&lt;%= action_name %&gt;&quot;&gt;&lt;/i&gt;</pre><p>Like that i can use this element multiple times in the page for different controllers and actions.<br>But this required to edit <a href="http://viget.com/inspire/extending-paul-irishs-comprehensive-dom-ready-execution">JASON GARBER</a> javascript UTIL function to fit this change.<br>Using the body element code was:</p><pre>UTIL = {<br> exec: function( controller, action ) {<br> var ns = SITENAME,<br>     action = ( action === undefined ) ? &quot;init&quot; : action;<br> if ( controller !== &quot;&quot; &amp;&amp; ns[controller] &amp;&amp; typeof ns[controller][action] == &quot;function&quot; ) {ns[controller][action]();}<br> },<br> init: function() {<br>   var body = document.body,<br>       controller = body.getAttribute( &quot;data-controller&quot; ),<br>       action = body.getAttribute( &quot;data-action&quot; );</pre><pre>UTIL.exec( &quot;common&quot; );<br>    UTIL.exec( controller );<br>    UTIL.exec( controller, action );<br>   }<br> };</pre><pre>$( document ).ready( UTIL.init );<br>And using my way it required changing the code to be:</pre><pre>var SiteName = SiteName || {};</pre><pre>SiteName.Common = {<br> init: function () {<br> // generic event bindings<br> }<br>};</pre><pre>SiteName.UTIL = {<br> exec: function (controller, action) {<br> var ns = SiteName,<br> action = (action === undefined || action == null) ? &quot;init&quot; : action;</pre><pre>if (controller !== &quot;&quot; &amp;&amp; ns[controller] &amp;&amp; typeof ns[controller][action] == &quot;function&quot;) {<br> ns[controller][action]();<br> }<br> },</pre><pre>init: function () {<br>    SiteName.UTIL.exec(&quot;Common&quot;);</pre><pre>var initializers = $(&#39;.initializer&#39;);<br>    $(&#39;.initializer&#39;).each(function () {<br>       var controller = this.getAttribute(&quot;data-controller&quot;),<br>           action = this.getAttribute(&quot;data-action&quot;);</pre><pre>SiteName.UTIL.exec(controller, action);<br>    });<br> }<br>};</pre><pre>$(document).ready(SiteName.UTIL.init);<br>And as you see in my code I loop on all elements which use class &#39;initializer&#39; and read/call from them one by one controllers - actions.</pre><pre>By applying this edit, you will be able to assign multiple different controllers in the same page based on the page sections.</pre><pre><a href="http://techblog.treenodes.com/wp-content/uploads/2012/04/JSSample.zip">Download Demo</a></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab9045baa005" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/organize-javascript-and-jquery-events-dom-ready-execution-ab9045baa005">Organize JavaScript and jQuery events — DOM-ready execution</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplest menu using CSS]]></title>
            <link>https://medium.com/treenodes/simplest-menu-using-css-26898b8a1be0?source=rss----8a49757a6f91---4</link>
            <guid isPermaLink="false">https://medium.com/p/26898b8a1be0</guid>
            <category><![CDATA[technical]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Amr Elgarhy]]></dc:creator>
            <pubDate>Mon, 03 Oct 2011 12:57:22 GMT</pubDate>
            <atom:updated>2017-05-06T22:22:53.501Z</atom:updated>
            <content:encoded><![CDATA[<p>Many web designers I met had problems while creating menus, specially which contains nested sub menus.</p><p>In some cases it is a real pain, but in most of cases it is simple, and the problem come when the designer start to implement the simple menu the hard wrong way, it will take ages from him to implement a simple menu while it just need few lines of css code.</p><p>Also he may think it can’t be done without javascript and jquery.</p><p>Try to think simple while writing your next menu and may be you will need my code as a starting point for a more complex menu.</p><p>What I am listing here is a very simple menu, putting in mind that this menu may contain infinite number of submenus.</p><p>Lets start with html:</p><pre>&lt;ul&gt;<br>        &lt;li&gt;Main 1 &gt;<br>            &lt;ul&gt;<br>                &lt;li&gt;Sub 1 &gt;&gt;&lt;/li&gt;<br>                &lt;li&gt;Sub 2 &gt;&gt;<br>                    &lt;ul&gt;<br>                        &lt;li&gt;Sub SUB 1&lt;/li&gt;<br>                        &lt;li&gt;Sub SUB 2&lt;/li&gt;<br>                        &lt;li&gt;Sub SUB 3&lt;/li&gt;<br>                    &lt;/ul&gt;<br>                &lt;/li&gt;<br>                &lt;li&gt;Sub 3&lt;/li&gt;<br>            &lt;/ul&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;Main 2 &gt;<br>            &lt;ul&gt;<br>                &lt;li&gt;Sub 1&lt;/li&gt;<br>                &lt;li&gt;Sub 2&lt;/li&gt;<br>                &lt;li&gt;Sub 3&lt;/li&gt;<br>            &lt;/ul&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;Main 3 &gt;&lt;/li&gt;<br>        &lt;li&gt;Main 4 &gt;&lt;/li&gt;<br>    &lt;/ul&gt;</pre><p>This html use UL and LI to draw the menu html, you can use divs instead of UL and LI, this will not cause a problem.</p><p>The only hint I can point about the previous html code is that the sub menus html are inside the parent menu html.</p><p>Such as ‘Sub 1 &gt;&gt;’ is inside the parent ‘Main 1’, this will make our job easier.</p><p>Next CSS:</p><p>[sourcecode language=”css”]<br> ul li ul li<br>{<br>clear: both;<br>}</p><p>li<br>{<br>list-style-type: none;<br>float: left;<br>margin: 0 10px;<br>cursor: pointer;<br>width:100px;<br>}</p><p>li ul<br>{<br>display: none;<br>padding: 0;<br>}</p><p>li:hover &amp;gt; ul<br>{<br>display: block;<br>}<br>[/sourcecode]</p><p>The most important lines for us are starting from line 15, everything before this is just for making things looks better and formatted better.</p><p>As you see it is just 4 lines of code to make the menu functional, the trick exists in line 21, which will show the UL which exists under any LI and the user hovered on it, and the ‘&gt;’ means that we will show just the first level of UL not all nested UL.</p><p>Feel free to add more nested submenus and see how simple it is.</p><p><a href="http://amrelgarhy.com/wp-content/uploads/2011/10/SimpleMenu.htm">Demo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26898b8a1be0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/treenodes/simplest-menu-using-css-26898b8a1be0">Simplest menu using CSS</a> was originally published in <a href="https://medium.com/treenodes">TreeNodes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>