The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

20150609

how to escape tag name in document selector inside javascript onclick return confirm which also contains php values

i wanted to display another tag value inside an onclick return confirm message that also contained php code, so it was a challenge to figure out how to escape all the single quote and double quotes variables. this one gave me a run for my money, but here's the example code that finally works:

...
<input type="text" name="newString">
<button type="submit" onclick="return confirm('Change [ <?= $this->oldString ?> ] to [ '+document.getElementsByName('newString')[0].value+' ]?')">change string</button>

...

20150311

phpstorm automatically select/show current/selected/open file in project list, like eclipse's "linking the Project Explorer view to the active editor"

when i select a file in the phpstorm editor view, i want to automatically see where it is in the project view list.

here's how you do it (in mac osx):
* make sure the project view is visible: cmd+1 or View > Tool Windows > Project
* click the settings icon (cog wheel) in the project view > select Autoscroll from Source



references:
PhpStorm 8.0.2 Help/Project Tool Window

Autoscroll from Source
"If this option is on, PhpStorm automatically navigates from a file in the editor to the corresponding node (file, class, field, method, etc.) in the Project tool window."
PHPstorm project navigation

20150217

mac norwegian keyboard curly braces brackets shortcut

alt+shift+8:
left curly bracket, {

alt+shift+9:
left curly bracket, }

20150211

do you close an html link tag in html5? NO.

I just read w3schools article on the html link tag:
Differences Between HTML and XHTML
In HTML the <link> tag has no end tag.
In XHTML the <link> tag must be properly closed.

so I naturally wondered: "What about HTML5?"

In HTML5, the link tag isn't closed and looks like this:
<link rel="stylesheet" href="default.css">

Source: W3 HTML5 The link element

20150128

where and how to view java ee tutorial Order example database tables?

after you build the order application and it’s deployed successfully to glassfish:
click the Servers tab in netbeans
expand the Java DB node

right click on the sun-appserv-samples and click Connect
now expand jdbc:derby://localhost:1527/sun-appserv-samples [ on Default schema]
expand Other schemas
expand APP
expand Tables


20140606

[SOLVED] what is the @T() method and where is it documented? razor? c# .net?

today i finally figured out what the "T method" is :)
it's a part of Orchard CMS and is used for localization (translating strings to other languages/locales):

example:
<br/>
@T("Price"): <b>$@Model.Price</b><br />
@Model.Sku<br/>

from the orchard article "Building the Templates":
This is very plain rendering of the shape. Notice the use of the T method call to wrap the "Price" string literal. This enables localization of that text.

from the orchard article "Localizing the Orchard Application and Orchard Modules":
All strings in the Orchard application are output through a single T() method that can look up a translated string based on the default site culture.

from the orchard article "How Orchard Works":
Localization of the application and its modules is done by wrapping string resources in a call to the T method: <%: T("This string can be localized") %>


20140604

orchard asp.net c# mvc - how to include jquery-ui.min.css file

in your view file, e.g. myView.cshtml:

@{
Style.Include("jquery-ui.min.css").AtHead();
}



put the jquery-ui.min.css file in your MyModule/Styles/ folder:
MyModule/Styles/jquery-ui.min.css

the rendered HTML will look like this:
<link href="/Modules/MyModule/Styles/jquery-ui.min.css" rel="stylesheet" type="text/css" />


thanks to Adding jquery ui themes Question for help.


UPDATE 20140610

orchard has a jQuery module already, so all i actually had to do was this:
@{
  Style.Require("jQueryUI").AtHead();
  Script.Require("jQueryUI").AtHead();
}


thanks to Nicholas Mayne