I personally was missing in my rather new Windows 8.1, the Quick Launch Toolbar - that used to exist in older Windows versions. So i created my own, new, custom QuickLaunch toolbar. Here's how:
Basically any valid Windows folder can become a new toolbar. So all you need to do is create a folder, wherever you wish on your hard-disk, with any name of your choice. I personally went to the Documents folder (start screen, type Documents, press enter), right-clicked and created a New -> Folder, which i have named 'QuickLaunch'.
Right-Click on an empty area of your Win 8.1 taskbar. From the menu, choose Toolbars -> New Toolbar and just select the folder of your choice - in my case it was C:\Users\luciancostin\Documents\QuickLaunchToolbar
There it goes - the toolbar already appears on our taskbar. Whatever shortcuts or programs we put in there, they will be automatically displayed (here's how to create for example, a 'show desktop' icon).
For adding my Firefox icon, i've browsed to C:\Program Files (x86)\Mozilla Firefox , right-clicked on the 'firefox' program, chose 'Create shortcut' from the context-menu, cut (ctrl+x) this shortcut, and pasted it in my newly created folder.
For further customization of the toolbar (because by default, it has a rather strange appearance, showing the title, and the names of the links in here), one must:
1. unlock the taskbar: right-click your taskbar ,make sure the 'Lock the taskbar' menu item is not checked.
2. feel free to drag the margins and the whole toolbar wherever you like it, and to your preferred size.
3. right-click the toolbar for options, uncheck the 'show title' and 'show text' menu items - to get to the original 'quicklaunch' toolbar look & feel.
4. lock back the taskbar: preferably you'd want it to stay in place, so better to lock it back. Just right-click your taskbar and check the menu item 'Lock the taskbar'
That's it! :-) our new toolbar:
marți, 21 aprilie 2015
Re-create "Show Desktop" Icon in Windows 8.1
I'm a rather new user of Windows 8.1, and this operating system is cracking me day by day. One of the functions i miss most of older Windows versions is the "Show Desktop" icon.
Of course it exists in the lower-right corner of the taskbar, but i miss it in my 'QuickLaunch' toolbar - just as actually i missed my QuickLaunch toolbar altogether (its default appearance is quite obscure anyway). The Quick Launch toolbar doesn't exist by default in Windows 8.1 (i believe also Win 8 and Win 7).
Luckily, Win 8.1 provides a way to create custom toolbars, and i named mine exactly 'Quick Launch' (here's how to create your personal, customized win 8 "quick launch" toolbar).
And creating a "show desktop" icon is also fairly easy.
- Find out the path of your toolbar folder (i've mine under C:\Users\luciancostin\Documents\QuickLaunchToolbar). If you don't know where it is - just right-click your taskbar, make sure the 'Lock the taskbar' menu item is not checked. Then right-click on an empty-area of your toolbar and select "Open Folder".
- Open Notepad. Go to your Start screen and type "Notepad" to find and open it. Or go to Start ->Programs->Accessories->Notepad, if you have a start menu installed.
- Paste these contents in your new file:
[Shell]
Command=2
IconFile=explorer.exe,3
[Taskbar]
Command=ToggleDesktop - Save your new file in the toolbar folder (found at point 1. above), with the following name: "Show desktop.scf" - use the doublequotes too - so that Notepad does not append a default .txt extension to your file and render it useless
- Have fun! :) Windows (at least mine) also adds the old, nice 'Show Desktop' icon to this new button :)
* The content of the file comes directly from Microsoft - more info at this link: https://support.microsoft.com/en-us/kb/190355
miercuri, 8 aprilie 2015
Git trouble on Windows with tilde filenames
I've had apparently unresolvable problems with tilde filenames .
On windows 8.1, immediately as i clone a repository to my hard drive, some filenames containing tilde (interestingly enough, not all of them) - instantly throw out an error. They immediately appear as deleted, and i cannot do anything to add them to the git index, ignore, delete from cache or whatever.
Apparently this is a fairly recent change in Git, dating since December 2014, and yes, the solution is as stated on the given link, to configure git with the following:
Here's the link to the author's reply:
http://stackoverflow.com/questions/29294910/unable-to-add-files-with-name-containing-tilde-followed-by-a-number
On windows 8.1, immediately as i clone a repository to my hard drive, some filenames containing tilde (interestingly enough, not all of them) - instantly throw out an error. They immediately appear as deleted, and i cannot do anything to add them to the git index, ignore, delete from cache or whatever.
Apparently this is a fairly recent change in Git, dating since December 2014, and yes, the solution is as stated on the given link, to configure git with the following:
git config core.protectNTFS false
As the author says, i also recommend putting it back once the files are added to the index, with:
git config core.protectNTFS true
Here's the link to the author's reply:
http://stackoverflow.com/questions/29294910/unable-to-add-files-with-name-containing-tilde-followed-by-a-number
sâmbătă, 14 martie 2015
Wordpress excerpt (fragment)- extragem X cuvinte din text (taiem textul la lungimea fixata)
Cateodata, in lucrul cu textul wordpress, avem nevoie sa afisam doar o parte, un fragment/excerpt - din comentariile deja selectate, sau din textul paginii (post-ului), etc.
Functia potrivita pentru a taia textul la o lungime fixata (in cuvinte) este:
Mai multe informatii la: http://codex.wordpress.org/Function_Reference/wp_trim_wordsWP_trim_words
Ex: wp_trim_words( $comment_text, 20 /* cuvinte */, '...' )
vineri, 13 martie 2015
ASP VBSCRIPT Regex / regexp (regular Expressions)
The RexExp Object
The RegExp object has three properties and three methods. The properties are:- Pattern property - holds the regular expression pattern
- Global property - True or False (default False). If False, matching stops at first match.
- IgnoreCase property - True or False (default True). If True, allows case-insensitive matching
- Execute method - executes a match against the specified string. Returns a Matches collection, which contains a Match object for each match. The Match object can also contain a SubMatches collection
- Replace method - replaces the part of the string found in a match with another string
- Test method - executes an attempted match and returns True or False
Dim re
Set re = New RegExp
With re
.Pattern = "some_pattern"
.Global = True
.IgnoreCase = True
End With
A Pattern can be any string value. For example,
if the pattern is "Hello
World", the RegExp object will match that in
the target string. If IgnoreCase is True,
it will match any case, so "hellO wORld" would be matched. If Global is
set to True,
it will contine to search the string for all instances of "Hello World". If
False, it will stop searching after the first instance
is found.Set re = New RegExp
With re
.Pattern = "some_pattern"
.Global = True
.IgnoreCase = True
End With
Execute method, returning Matches collection
Dim re, targetString, colMatch, objMatch Set re = New RegExp With re .Pattern = "a" .Global = True .IgnoreCase = True End With targetString = "The rain in Spain falls mainly in the plain" Set colMatch = re.Execute(targetString) For each objMatch in colMatch Response.Write objMatch.Value & "<br />" NextThe above will produce a list of 5 letter a's.
Test method, returning True or False
Dim re, targetString Set re = New RegExp With re .Pattern = "a" .Global = False .IgnoreCase = False End With targetString = "The rain in Spain falls mainly in the plain" re.Test(targetString)The above will return True as soon as it hits the first instance of "a"
Metacharacters
Metacharacters are special characters that can be combined with literal characters (which is all that have been used so far) to extend the power of Regular Expressions way beyond the simple examples already seen, and are what set Regular Expressions apart from simple string functions.| Character | Description |
|---|---|
| \ | Marks the next character as either a special character or a literal. For example, "n" matches the character "n". "\n" matches a newline character. The sequence "\\" matches "\" and "\(" matches "(". |
| ^ | Matches the beginning of input. |
| $ | Matches the end of input. |
| * | Matches the preceding character zero or more times. For example, "zo*" matches either "z" or "zoo". |
| + | Matches the preceding character one or more times. For example, "zo+" matches "zoo" but not "z". |
| ? | Matches the preceding character zero or one time. For example, "a?ve?" matches the "ve" in "never". |
| . | Matches any single character except a newline character. |
| (pattern) | Matches pattern and remembers the match. The matched substring can be retrieved from the resulting Matches collection, using Item [0]...[n]. To match parentheses characters ( ), use "\(" or "\)". |
| x|y | Matches either x or y. For example, "z|wood" matches "z" or "wood". "(z|w)oo" matches "zoo" or "wood". |
| {n} | n is a nonnegative integer. Matches exactly n times. For example, "o{2}" does not match the "o" in "Bob," but matches the first two o's in "foooood". |
| {n,} | n is a nonnegative integer. Matches at least n times. For example, "o{2,}" does not match the "o" in "Bob" and matches all the o's in "foooood." "o{1,}" is equivalent to "o+". "o{0,}" is equivalent to "o*". |
| {n,m} | m and n are nonnegative integers. Matches at least n and at most m times. For example, "o{1,3}" matches the first three o's in "fooooood." "o{0,1}" is equivalent to "o?". |
| [xyz] | A character set. Matches any one of the enclosed characters. For example, "[abc]" matches the "a" in "plain". |
| [^xyz] | A negative character set. Matches any character not enclosed. For example, "[^abc]" matches the "p" in "plain". |
| [a-z] | A range of characters. Matches any character in the specified range. For example, "[a-z]" matches any lowercase alphabetic character in the range "a" through "z". |
| [^m-z] | A negative range characters. Matches any character not in the specified range. For example, "[m-z]" matches any character not in the range "m" through "z". |
| \b | Matches a word boundary, that is, the position between a word and a space. For example, "er\b" matches the "er" in "never" but not the "er" in "verb". |
| \B | Matches a non-word boundary. "ea*r\B" matches the "ear" in "never early". |
| \d | Matches a digit character. Equivalent to [0-9]. |
| \D | Matches a non-digit character. Equivalent to [^0-9]. |
| \f | Matches a form-feed character. |
| \n | Matches a newline character. |
| \r | Matches a carriage return character. |
| \s | Matches any white space including space, tab, form-feed, etc. Equivalent to "[ \f\n\r\t\v]". |
| \S | Matches any nonwhite space character. Equivalent to "[^ \f\n\r\t\v]". |
| \t | Matches a tab character. |
| \v | Matches a vertical tab character. |
| \w | Matches any word character including underscore. Equivalent to "[A-Za-z0-9_]". |
| \W | Matches any non-word character. Equivalent to "[^A-Za-z0-9_]". |
| \num | Matches num, where num is a positive integer. A reference back to remembered matches. For example, "(.)\1" matches two consecutive identical characters. |
| \n | Matches n, where n is an octal escape value. Octal escape values must be 1, 2, or 3 digits long. For example, "\11" and "\011" both match a tab character. "\0011" is the equivalent of "\001" & "1". Octal escape values must not exceed 256. If they do, only the first two digits comprise the expression. Allows ASCII codes to be used in regular expressions. |
| \xn | Matches n, where n is a hexadecimal escape value. Hexadecimal escape values must be exactly two digits long. For example, "\x41" matches "A". "\x041" is equivalent to "\x04" & "1". Allows ASCII codes to be used in regular expressions. |
\d+ will match any digit one or more times, and is the equivalent to [0-9]+
<[^>]*> will match any html tag, and looks for an opening "<", followed by anything that isn't a closing block ">", followed finally by a closing block ">". It uses a "negative character set" [^>]
Constructing a RegExp pattern
Form input validation is a key area in which regular expressions can be used, and a common task is to validate the structure of an email address. Initially, the task needs to be broken down into its constituent rules:- Must have 1 or more letters or numbers
- Can have underscores, hyphens, dots, apostrophes
- Must have an "@" sign following this
- First part of domain name must follow the "@", and must contain at least 3 letters or numbers
- May contain underscore, dots or hyphen
- Must be at least one dot, which must be followed by the TLD.
SubMatches collection
There will be instances where, once a match is found, you want to extract parts of that match for later use. As an example, suppose you have an html page which contains a list of links:<a href="somepage.asp?id=12345">Company A</a><br /> <a href="somepage.asp?id=45678">Company B</a><br /> <a href="somepage.asp?id=66745">Company C</a><br /> <a href="somepage.asp?id=33471">Company D</a><br /> <a href="somepage.asp?id=90765">Company E</a><br /> ...The required parts are the Company name and the id in the querystring. These need to be collected and inserted into a database, for example. The html is fed in as the strSearchOn, and the pattern uses parenthesis to search for each item - The id ([0-9]{5}), which is a 5 digit number, and ([\w\s]+) which collects a series of letters and spaces, and will stop collecting them when the opening angle bracket is reached (</a>).
Set objRegExpr = New regexp
objRegExpr.Pattern = "somepage.asp\?id=([0-9]{5})" & chr(34) & ">([\w\s]+)"
objRegExpr.Global = True
objRegExpr.IgnoreCase = True
set colmatches = objRegExpr.Execute(strSearchOn)
For Each objMatch in colMatches
id = objMatch.SubMatches(0)
company = objMatch.SubMatches(1)
sql = "Insert Into table (idfield, company) Values (" & id & ",'" & company & "')"
conn.execute(sql)
Next
This is just a copy from another Author's page with just so very good and easy to understand info: http://www.mikesdotnetting.com/article/24/regular-expressions-and-vbscript
Thanks Mike
vineri, 6 februarie 2015
Google star rating microformats
Yes, it's an old situation. In the google search results, one can display rating stars below the page title.
How to do it? What does one add to the HTML code so google displays those stars?
Something like the stars rating found in this image:
Here is the current version, in microformat (there are also other options). Note that this code is valid for the current time-being (e.g. 2015), this has been subject of change over the years.
So here's the snippet i'm using:
The code is taken from https://support.google.com/webmasters/answer/146645?hl=en
Good luck!
How to do it? What does one add to the HTML code so google displays those stars?
Something like the stars rating found in this image:
Here is the current version, in microformat (there are also other options). Note that this code is valid for the current time-being (e.g. 2015), this has been subject of change over the years.
So here's the snippet i'm using:
<div class="hreview-aggregate">
<span class="item">
<span class="fn">Restaurant Italia</span>
</span>
<span class="rating">
<span class="average">4,5</span> din
<span class="best">5</span>
</span>
Din <span class="votes">25</span> de voturi
</div>
The code is taken from https://support.google.com/webmasters/answer/146645?hl=en
Good luck!
joi, 16 octombrie 2014
Typo3 6.1 installed , but Extension Manager crashes my Apache
I've finally got Typo3 6.1 installed on my machine, but as soon as i went to the backend section 'Extension Manager' - Apache crashed with no helpful error message or so.
The window popping up was about Apache HTTPD Server crashed with the following messages:Problem signature:
Problem Event Name: APPCRASH
Application Name: httpd.exe
Application Version: 2.2.21.0
Application Timestamp: 4e6a3015
Fault Module Name: php5ts.dll
Fault Module Version: 5.3.26.0
Fault Module Timestamp: 51af7101
Exception Code: c00000fd
Exception Offset: 00181e69
OS Version: 6.0.6002.2.2.0.768.3
Locale ID: 1048
Additional Information 1: f1e8
Additional Information 2: d4eb7cf28a4f910486e91a11f70d294f
Additional Information 3: 15a9
Additional Information 4: 60b89fd8e863194dd520967f621c3aa4
After a few facepalms, i've learned that the problem was described in the INSTALL file of Typo3. It was a problem due to the small Thread Stack size allocated by Windows for apache's threads by default.
I had to add these lines in my httpd.conf:
<IfModule mpm_winnt_module>The above sets the Thread Stack Size for about 18 MB, the original 8 MB given as sample in Typo3's Install file, was not enough.
ThreadStackSize 18388608
</IfModule>
Don't forget to restart Apache after the edit.
Good luck!
Abonați-vă la:
Postări (Atom)

