tag:blogger.com,1999:blog-6833288524558564142024-02-08T02:12:03.510+01:00The Royal Nick Humphrey IT Blog, Global EditionIT, computer and programming tutorials and tips that i couldnt find anywhere else using google, from my daily work as a Senior Developer of solutions using Java and Linux.Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.comBlogger272125tag:blogger.com,1999:blog-683328852455856414.post-54678565278022030722018-09-13T15:30:00.000+02:002018-09-13T15:30:11.884+02:00[SOLVED] jboss-javaee-multi: mvn clean install wildfly:deploy Could not find artifact sun.jdk:jconsole:jar:jdk<div class="tr_bq">
I was trying to deploy the wildfly quickstart app "jboss-javaee-multi: Example Using Multiple Java EE 7 Technologies Deployed as an EAR"</div>
<br />
in Red Hat Developer Studio (version 12.0.0.GA), following the README instructions:<br />
<b>mvn clean install wildfly:deploy</b><br />
<br />
but it would fail:<br />
<blockquote>
[INFO] Reactor Summary:<br />
[INFO]<br />
[INFO] jboss-javaee-multi 0.0.1-SNAPSHOT .................. FAILURE [ 3.292 s]<br />
[INFO] jboss-javaee-multi: EJB Module ..................... SKIPPED<br />
[INFO] jboss-javaee-multi: WAR Module ..................... SKIPPED<br />
[INFO] jboss-javaee-multi: EAR Module 0.0.1-SNAPSHOT ...... SKIPPED<br />
[INFO] ------------------------------------------------------------------------<br />
[INFO] BUILD FAILURE<br />
[INFO] ------------------------------------------------------------------------<br />
[INFO] Total time: 4.755 s<br />
[INFO] Finished at: 2018-09-13T15:16:40+02:00<br />
[INFO] ------------------------------------------------------------------------<br />
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:deploy (default-cli) on project jboss-javaee-multi: Execution default-cli of goal org.wildfly.plugins:wildfly-ma<br />
ven-plugin:1.0.2.Final:deploy failed: Plugin org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final or one of its dependencies could not be resolved: Could not find artifact sun.jdk:jconsole:jar:jdk<br />
at specified path C:\Program Files\Java\jdk-10.0.2/../lib/jconsole.jar -> [Help 1]<br />
...</blockquote>
but then I found this thread <a href="https://developer.jboss.org/thread/276771" target="_blank">jconsole not found</a> where James Perkins wrote:<br />
<blockquote class="tr_bq">
Could you try 1.2.1.Final? That version should work with Java 9.</blockquote>
so to fix my problem i opened the <b><i>jboss-javaee-multi\pom.xml</i></b> and changed the value of <i>version.wildfly.maven.plugin</i> from:<br />
<b><version.wildfly.maven.plugin><i>1.0.2.Final</i></version.wildfly.maven.plugin></b><br />
to:<br />
<b><version.wildfly.maven.plugin><i>1.2.1.Final</i></version.wildfly.maven.plugin></b><br />
<br />
then I reran the mvn command in Terminal and it worked:<br />
<b>mvn clean install wildfly:deploy</b><br />
<br />
Thx James :)Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-66718712386355727572017-11-20T10:35:00.004+01:002017-11-20T10:49:13.765+01:00gimp list of basic image editing use cases (UC) [ONGOING]this will b an ongoing list of basic editing UC in gimp (or image editing, generally):<br />
<b><br /></b>
<br />
<h3>
make selection transparent</h3>
<i>select a part of the image to remove and make it see-through</i><br />
<br />
<br />
<ol>
<li><span style="font-family: "courier new" , "courier" , monospace;">Open your image.</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">Select the area you want to make transparent. Select the appropriate selection tool from the Tool window or the Tools - Selection Tools menu on the Layer window.</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">In the Layer window (the one showing your image), select Layer - Transparency - Add Alpha Channel (unless it's greyed out--already done).</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">Select Edit - Clear.</span></li>
<li><span style="font-family: "courier new" , "courier" , monospace;">Save the file.</span></li>
</ol>
<br />
<br />
src: "<a href="http://geekswithblogs.net/TimH/archive/2006/03/20/72797.aspx" target="_blank">How to make a transparent background/selection on an image using GIMP</a>"<br />
<br />
<br />
<br />
<br />
<br />
... to be continuedNickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-52944828688139664502017-01-06T12:43:00.002+01:002017-01-06T12:50:14.787+01:00[SOLVED] phpstorm project view increase font sizePHPSTORM SETTINGS<br />
<br />
Editor > Colors & Fonts<br />
"Save As" for "Scheme" n save a copy of th default scheme, eg "Nick CF (Default copy)"<br />
click "Apply"<br />
<br />
<br />
Appearance & Behavior > Appearance<br />
check "Override default fonts by (not recommended):"<br />
Name: i selected "Menlo"<br />
Size: 16<br />
click "Apply"<br />
<br />
RESTART PHPSTORM.<br />
<br />
NOTE: <a href="http://stackoverflow.com/questions/5380487/is-it-possible-to-change-the-font-size-of-the-project-panel/29029244#comment44572628_17448729" target="_blank">essential comment that helped me solve this</a>.Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-24996336208946118372016-06-07T16:50:00.005+02:002016-06-07T17:17:58.249+02:00[SOLVED] mac osx el capitan: customize menubar clock date & time (hack)/////////////// SETTING THE OSX MENUBAR DATE & TIME; based on: <a href="http://apple.stackexchange.com/a/182435/156582">http://apple.stackexchange.com/a/182435/156582</a><br />
<br />
TERMINAL TAB 1<br />
<br />
$ <b>cd</b><br />
<br />
$ <b>nano -w setClock.sh</b><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">#!/bin/bash</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">killall -KILL SystemUIServer</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">while true</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">do</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> defaults write com.apple.menuextra.clock "DateFormat" "EEEE' 'y.MM.dd' 'HH:mm:ss' 'z' ''week:'' 'ww"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">done</span><br />
<br />
$ <b>chmod +x setClock.sh</b><br />
<br />
[START]<br />
<br />
$ <b>./setClock.sh</b><br />
<br />
<br />
TERMINAL TAB 2<br />
<br />
<i>IF</i> the menubar clock reappears w incorrect desired display format, run:<br />
<br />
$ <b>killall -KILL SystemUIServer</b><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>repeat (back to <i>[START]</i>) until the clock renders properly. it sometimes takes several attempts.<br />
<br />
<i>ELSE</i>, stop the script:<br />
<br />
<br />
TERMINAL TAB 1<br />
<br />
ctrl-c (stop the "while" loop)<br />
<br />
///////////////<br />
<br />
<br />
NOTE about the <i>DateFormat</i> value string:<br />
<br />
<b>"EEEE<span style="background-color: lime;">' '</span>y.MM.dd<span style="background-color: lime;">' '</span>HH:mm:ss<span style="background-color: lime;">' '</span>z<span style="background-color: lime;">' '</span><span style="background-color: orange;">'week:'</span><span style="background-color: lime;">' '</span>ww"</b><br />
<div>
<br /></div>
<div>
spaces seem to need to b surrounded by single quotes ' ', as did <i>week</i> since <i>w</i> was getting interpreted as smth else.</div>
<div>
<br /></div>
<div>
it will render like this:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRz1pZs2Pe_ttQLvtGeezQD0Tg-hE52BeqxcZVFqJ1pnyUrQT4pgLGEPaIWqhKW9uhCV3OhftzTTdDFfVTb7b0-_6BoYFvHiGLhPlYjwgFEtQ_w6oi0TI5tiArnuGJzOn7HoT6xHIIr5M/s1600/Screen+Shot+2016-06-07+at+16.36.38.810+CEST.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="38" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRz1pZs2Pe_ttQLvtGeezQD0Tg-hE52BeqxcZVFqJ1pnyUrQT4pgLGEPaIWqhKW9uhCV3OhftzTTdDFfVTb7b0-_6BoYFvHiGLhPlYjwgFEtQ_w6oi0TI5tiArnuGJzOn7HoT6xHIIr5M/s400/Screen+Shot+2016-06-07+at+16.36.38.810+CEST.png" width="400" /></a></div>
<div>
<br /></div>
<div>
<br />
NOTE 2: this unfortunately doesn't persist thru reboots or logging out (but it does persist if u lock the screen then log back in again), but i don't normally turn off my macbook so.. please tell me if u hav corrections or tips or improvements or new info :)</div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-74328986121630738532016-05-31T13:00:00.000+02:002016-05-31T13:44:23.198+02:00[SOLVED] php+jquery page loading twice (2 GET requests) instead of oncei was using jquery to set an element's css <i>background-image</i> inside <i>$(document).ready(function()...</i> , and when i removed that code th page would load once instead of twice:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">var url = el.data("imgbg"); // get the url string</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">el.css("background-image", "url('"+url+"')"); // set bgimg url</span><br />
<br />
what was causing the extra page reload/GET request was an <b>empty url string</b>!<br />
<br />
putting a simple if-test on url fixed it:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>if (url != "")</b> el.css("background-image", "url('"+url+"')");</span><br />
<br />
:)<br />
<br />
my fiddle confirming this behavior:<br />
<br />
<iframe width="100%" height="300" src="https://jsfiddle.net/nickleus/2gkv8q4m/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-17420887923447610552016-04-11T15:26:00.001+02:002016-04-11T15:26:20.314+02:00jquery how to get this selector as string in event handler/listenerThis won't show you the DOM path, but it will output a string representation of what you see in eg chrome debugger, when viewing an object.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij_Epw0THKqDmtGZuqmR8Uvzny4EZbEKVv5J-o-LORTLBqaF9SAy7GKujoV5QNZtD-peSNznBsThOE5d9Pl4bZa1HfBWjN-J_RLJHgCuWW5-kTLnufWV-lu8o5ufJRu69PlIf-7KRTsms/s1600/Screen+Shot+2016-04-11+at+15.22.07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij_Epw0THKqDmtGZuqmR8Uvzny4EZbEKVv5J-o-LORTLBqaF9SAy7GKujoV5QNZtD-peSNznBsThOE5d9Pl4bZa1HfBWjN-J_RLJHgCuWW5-kTLnufWV-lu8o5ufJRu69PlIf-7KRTsms/s320/Screen+Shot+2016-04-11+at+15.22.07.png" width="320" /></a></div>
<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"> $('.mybtn').click( function(event){</span><br />
<span style="font-family: Courier New, Courier, monospace;"> <span class="Apple-tab-span" style="white-space: pre;"> </span>console.log(<b>"%s", this</b>); // output: "button.mybtn"</span><br />
<span style="font-family: Courier New, Courier, monospace;"> });</span><br />
<br />
<a href="https://developer.chrome.com/devtools/docs/console-api#consolelogobject-object">https://developer.chrome.com/devtools/docs/console-api#consolelogobject-object</a><br />
<div>
<br /></div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-10264036339465106432016-03-22T14:14:00.000+01:002016-03-22T14:14:02.530+01:00PHP INCLUDE/REQUIRE PATH SCHEMEa path-include/require-scheme that will work everywhere.<br />
paths can b copied to any file n will work, w/o needing to b changed--<br />
as long as the __ROOT__ variable is properly configured at the top of the file u paste into :)<br />
<br />
<br />
<script src="https://gist.github.com/nickleus/a9ea55bb2e9fb8642ba8.js"></script>Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-52335436518056681442015-10-08T11:00:00.001+02:002015-10-08T11:02:25.198+02:00HTML5 form validation w jQuery ajax POSTa simple impl of a web form that uses built-in <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms_in_HTML#Constraint_Validation" target="_blank">HTML5 validation</a>, but submits the form using ajax, inside a <a href="https://api.jquery.com/click/" target="_blank">jQuery click-event handler</a>, instead of the default HTTP post request vis a vis the form tag.<br />
<br />
<div class="codepen" data-default-tab="result" data-height="268" data-slug-hash="qOjOGe" data-theme-id="0" data-user="nickleus">See the Pen <a href="http://codepen.io/nickleus/pen/qOjOGe/">HTML5 form validation w jQuery ajax POST</a> by Nick Humphrey (<a href="http://codepen.io/nickleus">@nickleus</a>) on <a href="http://codepen.io/">CodePen</a>.</div><script async="" src="//assets.codepen.io/assets/embed/ei.js"></script>Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-26107077074401282212015-09-29T16:24:00.001+02:002015-09-30T10:35:49.088+02:00jquery reusable handler function for event binding n how to send an array of eventData parameters/arguments for dynamic inline ckeditor instancestoday i learned how to write reusable jquery handler functions for event binding n how to send an array of eventData parameters/arguments to the handler n how to extract them in the handler.<br />
<br />
the context for this was to optimise code reuse for dynamic, inline ckeditor instances, to make them initialized/editable on doubleclick/dblclick, instead of the default single click.<br />
<br />
what i'll show u further down is an improvement on this <a href="http://output.jsbin.com/etorir/4">original, user-written ckeditor code</a> i started out with:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">// note: this block is inside "document ready"</span>
<span style="color: #008800; font-weight: bold;">var</span> ed <span style="color: #333333;">=</span> {
init<span style="color: #333333;">:</span> <span style="color: #008800; font-weight: bold;">function</span> () {
ed.wysiwyg();
},
wysiwyg<span style="color: #333333;">:</span> <span style="color: #008800; font-weight: bold;">function</span> () {
$(<span style="background-color: #fff0f0;">".ckeditorInline"</span>)
.on(<span style="background-color: #fff0f0;">"dblclick"</span>, <span style="color: #008800; font-weight: bold;">function</span> (e) {
e.preventDefault();
e.stopPropagation();
$(<span style="color: #008800; font-weight: bold;">this</span>).attr(<span style="background-color: #fff0f0;">"contenteditable"</span>, <span style="background-color: #fff0f0;">"true"</span>);
CKEDITOR.inline(<span style="color: #008800; font-weight: bold;">this</span>); <span style="color: #888888;">// "Turns a DOM element with the contenteditable attribute set to true into a CKEditor instance"</span>
$(<span style="color: #008800; font-weight: bold;">this</span>).focus(); <span style="color: #888888;">// makes the toolbar popup after a double click. (you'd think it would b click(), but not in this case)</span>
});
}
};
ed.init();
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
n when i needed to initialize a dynamic ckeditor instance i had to duplicate some of the code, like this:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">// inside some other function</span>
<span style="color: #888888;">// ...</span>
item.find(<span style="background-color: #fff0f0;">".ckeditorInline"</span>).on(<span style="background-color: #fff0f0;">"dblclick"</span>, <span style="color: #008800; font-weight: bold;">function</span> (e) {
e.preventDefault();
e.stopPropagation();
$(<span style="color: #008800; font-weight: bold;">this</span>).attr(<span style="background-color: #fff0f0;">"contenteditable"</span>, <span style="background-color: #fff0f0;">"true"</span>);
CKEDITOR.inline(<span style="color: #008800; font-weight: bold;">this</span>);
$(<span style="color: #008800; font-weight: bold;">this</span>).focus();
});
<span style="color: #888888;">// ...</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
not very effective, right?<br />
<div>
<br /></div>
<div>
<b>here's how i improved it, as described up top</b>:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #008800; font-weight: bold;">var</span> bindDblclickToCkeditorInline <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">function</span>(event) {
event.preventDefault();
event.stopPropagation();
$(<span style="color: #008800; font-weight: bold;">this</span>).attr(<span style="background-color: #fff0f0;">"contenteditable"</span>, <span style="background-color: #fff0f0;">"true"</span>);
CKEDITOR.inline(<span style="color: #008800; font-weight: bold;">this</span>);
$(<span style="color: #008800; font-weight: bold;">this</span>).focus();
console.log(event.data); <span style="color: #888888;">// print the eventData array param</span>
};
$(<span style="background-color: #fff0f0;">".ckeditorInline"</span>).dblclick([<span style="background-color: #fff0f0;">"existing ckeditor instance on pageload"</span>, <span style="background-color: #fff0f0;">"a second param"</span>], bindDblclickToCkeditorInline);
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
n now when i need to initialize a dynamic ckeditor instance i can reuse the code w a simple one-liner, like this:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">// inside some other function</span>
<span style="color: #888888;">// ...</span>
item.find(<span style="background-color: #fff0f0;">".ckeditorInline"</span>).dblclick([<span style="background-color: #fff0f0;">"dynamic ckeditor instance"</span>, <span style="background-color: #fff0f0;">"a different param"</span>], bindDblclickToCkeditorInline);
<span style="color: #888888;">// ...</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
cool, huh?</div>
<div>
<br /></div>
<div>
i got this idea while reading the <a href="https://api.jquery.com/dblclick/">jquery dblclick() api page</a>.<br />
<br />
<br />
<br />
<b>UPDATE 20150930</b><br />
<br />
after writing this post yesterday i discovered an extremely useful piece of information regarding jquery binding, so that i don't even need that one-liner to manually bind dynamically added DOM elements: "<a href="http://lucisferre.net/2012/08/19/three-useful-jquery-event-binding-tips/">binding way up the DOM tree</a>".<br />
<br />
the only change needed is to line 10 above:<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">10</pre>
</td><td><pre style="line-height: 125%; margin: 0;">$(<span style="background-color: #fff0f0;">".ckeditorInline"</span>).dblclick([<span style="background-color: #fff0f0;">"existing ckeditor instance on pageload"</span>, <span style="background-color: #fff0f0;">"a second param"</span>], bindDblclickToCkeditorInline);
</pre>
</td></tr>
</tbody></table>
</div>
<br />
change it to this and u won't need to do anything extra for dynamically added elements (i.e. code block #4 on this page is now unnecessary!):<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">10</pre>
</td><td><pre style="line-height: 125%; margin: 0;">$(<span style="background-color: #fff0f0;">"body"</span>).on(<span style="background-color: #fff0f0;">"dblclick"</span>, <span style="background-color: #fff0f0;">".ckeditorInline"</span>, [<span style="background-color: #fff0f0;">"existing ckeditor instance on pageload"</span>, <span style="background-color: #fff0f0;">"a second param"</span>], bindDblclickToCkeditorInline);
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
###<br />
<br />
i used <a href="http://hilite.me/">hilite.me</a> for source code highlighting:<br />
<blockquote class="tr_bq">
<i>hilite.me converts your code snippets into pretty-printed HTML format, easily embeddable into blog posts, emails and websites.</i></blockquote>
</div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-29672979415642811592015-09-09T14:10:00.001+02:002015-09-09T14:10:23.857+02:00[SOLVED] dynamically created jquery-ui ".resizable" div not resizingi have jquery code inside a document.ready function that initializes all existing ".resizable" divs with a list of options n custom event listener functions<br />
here's how i was able to add a dynamic jquery-ui resizable div to the HTML DOM n initialize it so it's immediately resizable AND has the same options config that the pre-existing resizable divs got in the main document.ready resizable declaration:<br />
<br />
below is a jquery method where i create a dynamic div (elem), with an inner div w class "resizable ui-resizable" that i want to initialize as "resizable":<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">$(".selector").on("someevent", function(){</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ...</span><br />
<span style="font-family: Courier New, Courier, monospace;"><i style="background-color: yellow;"> // the dynamic div, elem, gets a "resizable" child div</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b> elem</b>.html('<div class="<b>resizable ui-resizable</b>"><p>dynamic, resizable div</p></div>');</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ...</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<i style="background-color: yellow; font-family: 'Courier New', Courier, monospace;"> // get the resizable options(+event functions: create, start, stop, resize)</i><br />
<span style="font-family: Courier New, Courier, monospace;"> var options = $( ".resizable" ).resizable( "option" );</span><br />
<i style="background-color: yellow; font-family: 'Courier New', Courier, monospace;"> // get the elem div's inner "resizable" div</i><br />
<span style="font-family: Courier New, Courier, monospace;"> var resizeElem = elem.find('.resizable');</span><br />
<i style="background-color: yellow; font-family: 'Courier New', Courier, monospace;"> // initialize it w the options declared elsewhere in the document.ready script--we don't need to write double code</i><br />
<span style="font-family: Courier New, Courier, monospace;"> resizeElem.resizable(options);</span><br />
<i style="background-color: yellow; font-family: 'Courier New', Courier, monospace;"> // <b>this last part was key to get it working--u have to get the instance, then initialize THAT w the options TOO!</b></i><br />
<span style="font-family: Courier New, Courier, monospace;"> var resizeInst = resizeElem.resizable("instance");</span><br />
<span style="font-family: Courier New, Courier, monospace;"> resizeInst.option( options );</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
<div>
<br /></div>
<div>
<br /></div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-51947624684205257372015-07-15T11:42:00.000+02:002015-07-15T11:46:18.043+02:00[SOLVED] installing Node.js: npm not found: Mac OS X Installer (.pkg) Universali wanted to test out <a href="https://nodejs.org/">Node.js</a>, so i downloaded the <a href="https://nodejs.org/download/">Mac OS X Installer (.pkg) Universal</a> (specifically, <a href="https://nodejs.org/dist/v0.12.7/node-v0.12.7.pkg">node-v0.12.7</a>), n the installation completed fine, n it said that <b>node</b> n <b>npm</b> were installed here:<br />
<div>
<br /></div>
<div>
<i>/usr/local/bin/node</i></div>
<div>
<div>
<i>/usr/local/bin/npm</i></div>
</div>
<div>
<br /></div>
<div>
and PATH contains that path:</div>
<div>
<span style="font-family: Courier New, Courier, monospace;">echo $PATH</span></div>
<div>
<br /></div>
<div>
output:</div>
<div>
<div class="p1">
<span class="s1"><i>/usr/bin:/bin:/usr/sbin:/sbin:<b>/usr/local/bin</b>...</i></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">but when i try updating npm:</span></div>
<div class="p1">
<span class="s1">
</span></div>
<div class="p1">
<span class="s1"><span style="font-family: Courier New, Courier, monospace;">sudo npm update -g npm</span></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">i get:</span></div>
<div class="p1">
<span class="s1">
</span></div>
<div class="p1">
<span class="s1"><i>sudo: npm: command not found</i></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">and "ls" confirms that it isn't installed:</span></div>
<div class="p1">
</div>
<div class="p1">
<span class="s1"><span style="font-family: Courier New, Courier, monospace;">sudo ls -la /usr/local/bin</span></span></div>
<div class="p1">
<br /></div>
<div class="p1">
output:</div>
<div class="p1">
<i>...</i></div>
<div class="p1">
<span class="s1"><i>lrwxr-xr-x 1 nick admin 32 May 2 2014 <b>mvnyjp</b> -> ../Cellar/maven/3.2.1/bin/mvnyjp</i></span></div>
<div class="p1">
<span class="s1"><i>-rwxr-xr-x 1 <b>root admin</b> 36046288 Jul 10 00:51 <b>node</b></i></span></div>
<div class="p1">
<span class="s1"><i>lrwxr-xr-x 1 root admin 45 May 12 15:40 <b>protractor</b> -> ../lib/node_modules/protractor/bin/protractor</i></span></div>
<div class="p1">
</div>
<div class="p1">
<span class="s1"><i>-rwxr--r-- 1 nick staff 2757 Mar 2 12:11 <b>pstorm</b></i></span></div>
<div class="p1">
<span class="s1"><i>...</i></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1"><a href="https://developer.appcelerator.com/devlink/profile/570711/chris-barber">Chris Barber</a> <a href="https://developer.appcelerator.com/question/146720/npm-not-found">reports</a> that <b>/usr/local/bin/npm</b> should be a symlink to <b>/usr/local/lib/node_modules/npm/bin/npm-cli.js</b></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">i can run <i>npm</i> through <i>node</i>:</span></div>
<div class="p1">
<span class="s1">
</span></div>
<div class="p1">
<span class="s1"><span style="font-family: Courier New, Courier, monospace;">node /usr/local/lib/node_modules/npm/bin/npm-cli.js -v</span></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">outputs:</span></div>
<div class="p1">
<span class="s1">
</span></div>
<div class="p1">
<span class="s1"><i>2.11.3</i></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">"ls"-ing "lib":</span></div>
<div class="p1">
<span class="s1">
</span></div>
<div class="p1">
<span class="s1" style="font-family: Courier New, Courier, monospace;">ls -la /usr/local/lib</span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">shows a curious ownership/permission setting for "<i>node_modules</i>" directory:</span></div>
<div class="p1">
<span class="s1">
</span></div>
<div class="p1">
<i>drwxr-xr-x 6 <b>24561 wheel</b> 204 May 18 09:57 <b>node_modules</b></i></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1"><span style="background-color: lime;">to fix this, the solution seems to be as simple as creating that symlink</span>:</span></div>
<div class="p1">
<span class="s1">
</span></div>
<div class="p1">
<span class="s1"><span style="font-family: Courier New, Courier, monospace;">sudo ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm</span></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="p1">
<span class="s1">i tried updating <i>npm</i> again:</span></div>
<div class="p1">
<span class="s1"><span style="font-family: Courier New, Courier, monospace;">sudo npm update -g npm</span></span></div>
<div class="p1">
<br /></div>
<div class="p1">
<span class="s1">this time it outputs:</span></div>
<div class="p1">
<span class="s1"><i>/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js</i></span></div>
<div class="p1">
<i><span class="s1"></span></i></div>
<div class="p1">
<i><span class="s1"></span></i></div>
<div class="p1">
<span class="s1"><i>npm@2.13.0 /usr/local/lib/node_modules/npm</i></span></div>
</div>
<div>
<span class="s1"><br /></span></div>
<div>
<span class="s1">:)</span></div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-85541647800607595282015-06-30T12:43:00.001+02:002015-06-30T12:45:44.805+02:00php add conditional html tag parameter: example how to avoid having to escape quotes w complex (curly) variable parsing syntaxi have a php/html application where i want to add a conditional html tag "<i>title</i>" attribute if a value for "<b>email</b>" exists.<br />
<br />
the trouble people usually run into is the escaping of single and/or double quotes, but if u use php's "<a href="http://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex" style="background-color: magenta;"><span style="color: black;">complex (curly) variable parsing syntax</span></a>", then u don't have to escape any quotes at all (generally):<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: cyan;"><a href="#" </span><span style="background-color: yellow;"><? if($this->data['email'] != '') echo </span><span style="background-color: lime;">"</span><span style="background-color: yellow;"> title=</span><span style="background-color: orange;">'</span><span style="background-color: magenta;">{$this->data['email']}</span><span style="background-color: orange;">'</span><span style="background-color: lime;">"</span><span style="background-color: yellow;"> ?></span><span style="background-color: cyan;">>Email</a></span></span><br />
<br />
so if "<b>email</b>" is set, then the rendered output for the tag will look like this:<br />
<span style="background-color: cyan;"><span style="font-family: 'Courier New', Courier, monospace;"><a href="#" </span><span style="font-family: 'Courier New', Courier, monospace;">title=</span></span><span style="background-color: orange; font-family: 'Courier New', Courier, monospace;">'</span><span style="background-color: magenta; font-family: 'Courier New', Courier, monospace;">example@example.com</span><span style="background-color: orange; font-family: 'Courier New', Courier, monospace;">'</span><span style="background-color: cyan; font-family: 'Courier New', Courier, monospace;">>Email</a></span><br />
<br />
<i>the "title" attribute will most likely be rendered with double quotes (""), not single (''), but for purposes of illustration, i'm showing u the relationship between the php code and the rendered output.</i><br />
<br />
fyi, the "<a href="http://php.net/manual/en/language.types.string.php#language.types.string.parsing.simple">simple syntax</a>" way is like this:<br />
<span style="background-color: cyan; font-family: Courier New, Courier, monospace;"><a href="#" </span><span style="background-color: yellow; font-family: Courier New, Courier, monospace;"><? if($this->data['email'] != '') echo </span><span style="background-color: lime; font-family: Courier New, Courier, monospace;">'</span><span style="background-color: yellow; font-family: Courier New, Courier, monospace;"> title=</span><span style="background-color: orange; font-family: Courier New, Courier, monospace;">"</span><span style="background-color: lime; font-family: Courier New, Courier, monospace;">'</span><span style="background-color: yellow; font-family: Courier New, Courier, monospace;">.$this->data['email'].</span><span style="background-color: lime; font-family: Courier New, Courier, monospace;">'</span><span style="background-color: orange; font-family: Courier New, Courier, monospace;">"</span><span style="background-color: lime; font-family: Courier New, Courier, monospace;">'</span><span style="background-color: yellow; font-family: Courier New, Courier, monospace;"> ?></span><span style="background-color: cyan; font-family: Courier New, Courier, monospace;">>Email</a></span><br />
<br />
(gives identical output as "complex" syntax)Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-70524456816723835672015-06-25T11:18:00.003+02:002015-06-25T11:41:33.404+02:00ckeditor how to add custom icon button image to toolbar: CKEDITOR.getUrl()i've built a custom ckeditor toolbar dropdown menu, but i was struggling to find out how to add a custom pilcrow icon for the dropdown, until i found this:<br />
<a href="http://blog.ale-re.net/2010/07/custom-icon-in-ckeditor-toolbar.html">http://blog.ale-re.net/2010/07/custom-icon-in-ckeditor-toolbar.html</a><br />
<br />
so here's how i got it to work:<br />
<br />
<span style="font-size: x-small;"><span style="background-color: #e4e4ff; font-family: Menlo;">editor</span><span style="background-color: white; font-family: Menlo;">.</span><span style="background-color: white; color: #7a7a43; font-family: Menlo;">ui</span><span style="background-color: white; font-family: Menlo;">.</span><span style="background-color: white; color: #7a7a43; font-family: Menlo;">add</span><span style="background-color: white; font-family: Menlo;">( </span><span style="background-color: white; color: green; font-family: Menlo; font-weight: bold;">'MyParagraphDropdown'</span><span style="background-color: white; font-family: Menlo;">, </span><span style="background-color: white; color: #660e7a; font-family: Menlo; font-weight: bold;">CKEDITOR</span><span style="background-color: white; font-family: Menlo;">.</span><span style="background-color: white; color: #660e7a; font-family: Menlo; font-weight: bold;">UI_MENUBUTTON</span><span style="background-color: white; font-family: Menlo;">, {</span></span><br />
<pre style="font-family: Menlo;"><span style="font-size: x-small;"><span style="background-color: white; color: #660e7a; font-weight: bold;"> label</span><span style="background-color: white;">: </span><span style="background-color: white; color: green; font-weight: bold;">'Paragraph styling'</span><span style="background-color: white;">,
</span><b style="background-color: lime;"><span style="color: #660e7a;">icon</span>: <span style="color: #660e7a;">CKEDITOR</span>.<span style="color: #7a7a43;">getUrl</span>(<span style="color: green;">'../../images/pilcrow.png'</span>)</b><span style="background-color: white;">,
</span><span style="background-color: white; color: #7a7a43;">onMenu</span><span style="background-color: white;">: </span><span style="background-color: white; color: navy; font-weight: bold;">function</span><span style="background-color: white;">() {
</span><span style="background-color: white; color: navy; font-weight: bold;">var </span><span style="background-color: white; color: #458383;">active </span><span style="background-color: white;">= {};
</span><span style="color: grey; font-style: italic;">// Make all items active.</span><span style="color: grey; font-style: italic;"> </span></span></pre>
<pre><span style="background-color: white; font-family: Menlo; font-size: x-small;"><span style="color: navy; font-weight: bold;"> for </span>( <span style="color: navy; font-weight: bold;">var </span><span style="color: #458383;">p </span><span style="color: navy; font-weight: bold;">in </span><span style="color: #458383;">items </span>)
<span style="color: #458383;">active</span>[ <span style="color: #458383;">p </span>] = <span style="color: #660e7a; font-weight: bold;">CKEDITOR</span>.<span style="color: #660e7a; font-weight: bold;">TRISTATE_OFF</span>;
<span style="color: navy; font-weight: bold;">return </span><span style="color: #458383;">active</span>;
}
} );</span>
</pre>
<br />
<br />
here's the pilcrow ( <span style="background-color: white; color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.3999996185303px;">¶ )</span> glyph icon button image i created (png w transparent background); <b>16x16</b> (font color [dark grey]: <b>494949</b>):<br />
<div class="separator" style="clear: both; text-align: left;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwyW0eUosAO0wXImsUwVCod_2nQIHE0LDeIS1zUet-tAtTREAtnBMBMQfz_sRkgUg0244ZBrJGUXkCopa4IIhDBtRGeQc5vePhIVRHULhDVbEBu4lwujLIbQ8Ke-t6THvb9quBdlxEVvc/s1600/pilcrow-dark-grey-494949.png" /></div>
<div>
<br />
and here's what it looks like in the ckeditor toolbar:<br />
<div class="separator" style="clear: both; text-align: left;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8YHp8UkKfkT7I1IIzK2qI4a2s8108vVSXN0e2Ws2F0JYaAdao_LQyeNVSBou-c33uJQgjJAwIiM-cNksPF8NsfW2TGbdg3tGSd4Xhu5nhQMLw3CprEjSXHDPFYrO_PCsQ-vm28r6UJSw/s1600/Screen+Shot+2015-06-25+at+11.25.13.png" /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br /></div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-86750219756155732322015-06-09T15:55:00.000+02:002015-06-09T15:56:06.489+02:00how to escape tag name in document selector inside javascript onclick return confirm which also contains php values<div>
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:</div>
<br />
...<br />
<b><span style="font-size: large;"><input type="text" name="<span style="background-color: cyan;">newString</span>"><br /><button type="submit" onclick=<span style="background-color: lime;">"</span>return confirm(<span style="background-color: yellow;">'</span>Change [ <span style="background-color: #d9d2e9;"><?= $this->oldString ?></span> ] to [ <span style="background-color: orange;">'+</span>document.getElementsByName('<span style="background-color: cyan;">newString</span>')[0].value<span style="background-color: orange;">+'</span> ]?<span style="background-color: yellow;">'</span>)<span style="background-color: lime;">"</span>>change string</button></span></b><br />
...Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-8502368461781358672015-03-11T12:22:00.004+01:002015-03-11T12:25:27.110+01:00phpstorm 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 <a href="https://www.jetbrains.com/phpstorm/">phpstorm</a> <i>editor view</i>, i want to automatically see where it is in the <i>project view</i> list.<br />
<br />
here's how you do it (in <i>mac osx</i>):<br />
* make sure the <i>project view</i> is visible: <b>cmd+1</b> or <b>View > Tool Windows > Project</b><br />
* click the <i>settings icon</i> (cog wheel) in the <i>project view</i> > select <b>Autoscroll from Source</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2zzneE2q359V6vlm6K7dYplPOY4fhyphenhyphennv9qVi8RKCUSc_hhQbdc6ovXlKOYD3Qyv19W4QddOPWCDqmf4tLHblrMbZu5h5D4I9PGboQRovKnhDQCbvz78gRKnjXpRSL8Gw-1rcbjJefnEo/s1600/phpstorm+autoscroll+from+source.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2zzneE2q359V6vlm6K7dYplPOY4fhyphenhyphennv9qVi8RKCUSc_hhQbdc6ovXlKOYD3Qyv19W4QddOPWCDqmf4tLHblrMbZu5h5D4I9PGboQRovKnhDQCbvz78gRKnjXpRSL8Gw-1rcbjJefnEo/s1600/phpstorm+autoscroll+from+source.png" height="113" width="400" /></a></div>
<br />
<br />
references:<br />
<a href="https://www.jetbrains.com/phpstorm/help/project-tool-window.html">PhpStorm 8.0.2 Help/Project Tool Window</a><br />
<br />
<b>Autoscroll from Source</b><br />
<blockquote class="tr_bq">
<i><span style="background-color: white; color: #404853; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px;">"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 </span><span class="control" style="background-color: white; border: 0px; color: #404853; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-stretch: inherit; line-height: 22px; margin: 0px; padding: 0px; vertical-align: baseline;">Project</span><span style="background-color: white; color: #404853; font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px;"> tool window."</span></i></blockquote>
<a href="http://stackoverflow.com/a/10755066/557194">PHPstorm project navigation</a><br />
<br />Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-14486736369360265972015-02-17T14:11:00.000+01:002015-02-17T14:11:02.321+01:00mac norwegian keyboard curly braces brackets shortcut<b>alt+shift+8</b>:<br />
left curly bracket, <b>{</b><br />
<br />
<b>alt+shift+9</b>:<br />
left curly bracket, <b>}</b>Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-52864413002428596332015-02-11T22:47:00.000+01:002015-02-11T22:47:22.451+01:00do you close an html link tag in html5? NO.I just read <a href="http://www.w3schools.com/tags/tag_link.asp">w3schools article on the html link tag</a>:<br />
<blockquote class="tr_bq" style="background-color: white; box-sizing: border-box; color: #333333; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 21.4285717010498px; margin-bottom: 10px;">
<i>Differences Between HTML and XHTML<br />In HTML the <link> tag has no end tag.<br />In XHTML the <link> tag must be properly closed.</i></blockquote>
<div style="background-color: white; box-sizing: border-box; color: #333333; font-family: Verdana, Geneva, Tahoma, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 21.4285717010498px; margin-bottom: 10px;">
<br /></div>
so I naturally wondered: "What about HTML5?"<br />
<br />
In HTML5, the link tag isn't closed and looks like this:<br />
<span style="color: #222222; font-size: inherit; white-space: pre-wrap;"><b><link rel="stylesheet" href="default.css"></b></span><br />
<br />
Source: <a href="http://www.w3.org/TR/html5/document-metadata.html#the-link-element">W3 HTML5 The link element</a><br />
<br />Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-79826633155714872512015-01-28T18:32:00.003+01:002015-01-28T18:32:59.684+01:00where and how to view java ee tutorial Order example database tables?<div class="p1">
<span class="s1">after you build the <a href="https://docs.oracle.com/javaee/7/tutorial/persistence-basicexamples001.htm">order application</a> and it’s deployed successfully to glassfish:</span></div>
<div class="p1">
<span class="s1">click the <b>Servers</b> tab in netbeans</span></div>
<div class="p1">
<span class="s1">expand the <b>Java DB</b> node</span></div>
<br />
<div class="p1">
<span class="s1">right click on the <b>sun-appserv-samples</b> and click <b>Connect</b></span></div>
<div class="p1">
<span class="s1">now expand <b>jdbc:derby://localhost:1527/sun-appserv-samples [ on Default schema]</b></span></div>
<div class="p1">
<span class="s1">expand <b>Other schemas</b></span></div>
<div class="p1">
<span class="s1">expand <b>APP</b></span></div>
<div class="p1">
<span class="s1">expand <b>Tables</b></span></div>
<div class="p1">
<span class="s1"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMhlvvafC0hJ3PmOoiwqPJh5IlsJggT6TxRcdc0kjRGDSeGxBaSiZMS1cfIK0ifP5XJgv-56DNkJSqg2h3pSeKVqNzXoEHaCTesdO0Fse5TntBLvsLvbicdNh1p-58yUCmR8hCd2DnHc8/s1600/java+ee+examples+db+schema+browse+location.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMhlvvafC0hJ3PmOoiwqPJh5IlsJggT6TxRcdc0kjRGDSeGxBaSiZMS1cfIK0ifP5XJgv-56DNkJSqg2h3pSeKVqNzXoEHaCTesdO0Fse5TntBLvsLvbicdNh1p-58yUCmR8hCd2DnHc8/s1600/java+ee+examples+db+schema+browse+location.png" height="124" width="320" /></a></div>
<div class="p1">
<span class="s1"><br /></span></div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-4185373343983367622014-06-06T14:29:00.001+02:002014-06-06T14:30:38.075+02:00[SOLVED] what is the @T() method and where is it documented? razor? c# .net?today i finally figured out what the "<a href="http://docs.orchardproject.net/Documentation/Using-the-localization-helpers">T method</a>" is :)<br />
it's a part of Orchard CMS and is used for localization (translating strings to other languages/locales):<br />
<br />
example:<br />
<span style="font-family: Courier New, Courier, monospace;"><b><br/></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>@T("Price"): <b>$@Model.Price</b><br /></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b>@Model.Sku<br/></b></span><br />
<br />
from the orchard article "<a href="http://docs.orchardproject.net/Documentation/Creating-a-module-with-a-simple-text-editor">Building the Templates</a>":<br />
<i>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.</i><br />
<br />
from the orchard article "<a href="http://docs.orchardproject.net/Documentation/Creating-global-ready-applications">Localizing the Orchard Application and Orchard Modules</a>":<br />
<i>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.</i><br />
<br />
from the orchard article "<a href="http://docs.orchardproject.net/Documentation/How-Orchard-works">How Orchard Works</a>":<br />
<i>Localization of the application and its modules is done by wrapping string resources in a call to the T method</i>: <span style="font-family: Courier New, Courier, monospace;"><b><%: T("This string can be localized") %></b></span><br />
<br />
<br />Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-24707883847344053922014-06-04T10:18:00.002+02:002014-06-10T11:40:02.967+02:00orchard asp.net c# mvc - how to include jquery-ui.min.css filein your view file, e.g. <b>myView.cshtml</b>:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">@{<br /> Style.Include("jquery-ui.min.css")<strike>.AtHead()</strike>;<br />}</span><br />
<pre style="background: white; font-size: 10pt;"></pre>
<div>
<br /></div>
<div>
<div>
put the <b>jquery-ui.min.css</b> file in your <b><i>MyModule</i>/Styles/</b> folder:</div>
</div>
<div>
<div>
<i>MyModule</i>/Styles/jquery-ui.min.css</div>
</div>
<div>
<br /></div>
<div>
the rendered HTML will look like this:</div>
<div>
<div>
<b><link href="/Modules/<i>MyModule</i>/Styles/jquery-ui.min.css" rel="stylesheet" type="text/css" /></b></div>
</div>
<div>
<br /></div>
<div>
<br />
thanks to <a href="https://orchard.codeplex.com/discussions/251684">Adding jquery ui themes Question</a> for help.<br />
<br />
<br />
UPDATE 20140610<br />
<br />
orchard has a jQuery module already, so all i actually had to do was this:<br />
<div>
<span style="font-family: Courier New, Courier, monospace;">@{</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"> Style.Require("jQueryUI").AtHead();</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"> Script.Require("jQueryUI").AtHead();</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">}</span></div>
<div>
<br /></div>
<br />
thanks to <a href="https://twitter.com/nickleus/status/474103398418378753">Nicholas Mayne</a><br />
<br /></div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-49961779289901100592014-05-23T14:35:00.003+02:002014-06-04T11:35:10.245+02:00windows 8.1 useful shortcuts under mac boot campwindows 8.1 useful shortcuts under mac boot camp<br />
<br />
for norwegian users (mac with norwegian keyboard keys)<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGtilzLSfZMbM2OD820eWZejyRQEB5HuIydkMp-w_KsixsiA5HAyC3F11rRwkA7QZZbZRj3Jo2jinuOBSeJQHu3WWb6oirnBNYSuiZ_WmKmwFOVqMv5HTA7JeDFURkoGikXf14Cz5OOdY/s1600/norwegian-keyboard.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGtilzLSfZMbM2OD820eWZejyRQEB5HuIydkMp-w_KsixsiA5HAyC3F11rRwkA7QZZbZRj3Jo2jinuOBSeJQHu3WWb6oirnBNYSuiZ_WmKmwFOVqMv5HTA7JeDFURkoGikXf14Cz5OOdY/s1600/norwegian-keyboard.png" height="273" width="320" /></a></div>
<br />
<br />
##########<br />
CHROME<br />
##########<br />
<br />
MOVE TO TAB LEFT/RIGHT: <b>fn+ctrl+arrow up/down</b><br />
<br />
##########<br />
INPUT<br />
##########<br />
<br />
BACKSLASH ( \ ): <b>(<i>right</i>)alt+(<i>right</i>)shift+/</b><br />
<br />
##########<br />
NAVIGATION<br />
##########<br />
<br />
LINE HOME/END: <b>fn+arrow left/right</b><br />
<br />
##########<br />
SYSTEM ACTIONS<br />
##########<br />
<div>
<br /></div>
<div>
LOCK SCREEN: <b>fn+cmd+L</b></div>
<div>
PRINT SCREEN: <b>fn+shift+F11</b></div>
<div>
<br /></div>
<div>
<br /></div>
<i>...more to come as i find more useful shortcuts</i><br />
<i><br /></i>
<i><br /></i>Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-91765776947451472832014-05-22T11:41:00.001+02:002014-05-22T12:07:48.617+02:00[SOLVED] mac boot camp windows 8.1 can't select text, context menu pops upi installed windows 8.1 through boot camp on my mac (mavericks) and was having trouble selecting text because when i would select something, then hold left finger in to be able to select more text by using my second finger, a context menu would pop up right away when i tried expanding the selected text by moving my second finger.<br />
<br />
i finally figured out how to configure the keyboard settings through boot camp so that text selection and expansion works as described above:<br />
<br />
1. open "<b>boot camp control panel</b>" in windows<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh43Hy9fEQqxL-rvhumqhplIej2kO5DFgRigVHV7K3lA_z5z-Qr4mHT0FU3aXZEI1W3IyRZ1CZdcLZ_Pnj4QwnAIoWeiJR9gGzvm2r8X8lmPdxqOouZbhb0lusqCT4sZg-d-aEALFlPy08/s1600/open+boot+camp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh43Hy9fEQqxL-rvhumqhplIej2kO5DFgRigVHV7K3lA_z5z-Qr4mHT0FU3aXZEI1W3IyRZ1CZdcLZ_Pnj4QwnAIoWeiJR9gGzvm2r8X8lmPdxqOouZbhb0lusqCT4sZg-d-aEALFlPy08/s1600/open+boot+camp.png" height="195" width="200" /></a></div>
<br />
2. select the "<b>trackpad</b>" tab<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJD8bzp1n8Ai3vGtPsON5Tc_dljwpXX377jKA-vnpM5sEg9mxaoxdr_Db1pHMjU2MEAUp1f2jDHk3rjMnrbQ0ehbilffXRsdnclqg0jW2EorLMwZn4HDzhE8Wqoxr6JHF56a6djEwFvIE/s1600/mac+boot+camp+windows+8_1+keyboard+settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJD8bzp1n8Ai3vGtPsON5Tc_dljwpXX377jKA-vnpM5sEg9mxaoxdr_Db1pHMjU2MEAUp1f2jDHk3rjMnrbQ0ehbilffXRsdnclqg0jW2EorLMwZn4HDzhE8Wqoxr6JHF56a6djEwFvIE/s1600/mac+boot+camp+windows+8_1+keyboard+settings.png" height="232" width="320" /></a></div>
<br />
configure it as shown in the image above:<br />
<i>One Finger</i> > <i>Tap to click</i>: <b>unchecked</b><br />
<i>One Finger</i> > <i>Secondary click</i>: <b>checked</b> > choose either <b>Bottom right corner</b> or <b>Bottom left corner</b><br />
<i>Two Fingers</i> > <i>Secondary click</i>: <b>unchecked</b><br />
<br />
click <b>Apply</b> or <b>OK</b><br />
<b><br /></b>Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-69160906343369937122014-05-16T14:05:00.001+02:002014-05-16T14:07:10.561+02:00mac boot camp install windows 8 - additional important info/stepsi originally tried installing windows 8.1 on my mac macbook pro osx mavericks and thought that a 32GB partition would be large enough, but after installing, there was only like 4GB left, <b>os i started over and made the partition 80GB instead</b> (i am going to install visual studio + some other large programs).<br />
<br />
when boot camp loads the window install, i scrolled down to the partition i made while in boot camp in mac, selected it and clicked <b>Next</b>:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGCUA7bTOBVt9P8zPIsuDs6tC2FCAmRnTCqDxG5UwYjIDyKqdDlAY2lXD5AmXc805af9hXb079S_z-LXCKr-JL0CXQv7Hm85Psa02sDFJIVASRy2cyg1M5CxRVfBegA9VHPamPIn-BZv8/s1600/IMG_0402%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGCUA7bTOBVt9P8zPIsuDs6tC2FCAmRnTCqDxG5UwYjIDyKqdDlAY2lXD5AmXc805af9hXb079S_z-LXCKr-JL0CXQv7Hm85Psa02sDFJIVASRy2cyg1M5CxRVfBegA9VHPamPIn-BZv8/s1600/IMG_0402%5B1%5D.JPG" height="320" width="240" /></a></div>
<br />
then i got this error message:<br />
<i>windows can't be installed on drive 0 partition 4</i><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgujHaWa41pscsHRXm_FH3PXjNAzRb8fBK5CbSjcagVS3XG2yK3NFvO-KQAuBi_zDsSaxkw04uyP1ue8cO0kNUJx260VBwsEexuCrk5gHchO31P5y4nvdFXJTb1sQdgwwFa8QQITNTVhg/s1600/IMG_0403%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgujHaWa41pscsHRXm_FH3PXjNAzRb8fBK5CbSjcagVS3XG2yK3NFvO-KQAuBi_zDsSaxkw04uyP1ue8cO0kNUJx260VBwsEexuCrk5gHchO31P5y4nvdFXJTb1sQdgwwFa8QQITNTVhg/s1600/IMG_0403%5B1%5D.JPG" height="320" width="240" /></a></div>
<br />
so i clicked the <b>Format </b>link (see screenshot above), and was warned that it was about to format the drive (this is normal)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB1-InKeNl-UlCbs0KuuRxGzYdPhcQ7LM2ZHknxxGEbDuTqn_rImJyo-dw-0NYtPiKCf9rM7_RYU0sTWDLjBF9zqAURaM_VJca9h653pU1m8wGbRBfzshB8Q5wM2hX6OI89YMFVnu3-MU/s1600/IMG_0404%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB1-InKeNl-UlCbs0KuuRxGzYdPhcQ7LM2ZHknxxGEbDuTqn_rImJyo-dw-0NYtPiKCf9rM7_RYU0sTWDLjBF9zqAURaM_VJca9h653pU1m8wGbRBfzshB8Q5wM2hX6OI89YMFVnu3-MU/s1600/IMG_0404%5B1%5D.JPG" height="320" width="240" /></a></div>
<br />
click <b>Next</b> again:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBjlC4MrBC_PsTO4vuieNb8p-B9VdY8sJUct6Qdg3ErJIKq4Ulhh1t7rx2GA4LcewHiZpI5ET81AVoBP1ewRXoSbw0_JOMvH8dY1LHYiZWaBvt5F12mjA1XhinxequTHPovYb4r5iIT-8/s1600/IMG_0405%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBjlC4MrBC_PsTO4vuieNb8p-B9VdY8sJUct6Qdg3ErJIKq4Ulhh1t7rx2GA4LcewHiZpI5ET81AVoBP1ewRXoSbw0_JOMvH8dY1LHYiZWaBvt5F12mjA1XhinxequTHPovYb4r5iIT-8/s1600/IMG_0405%5B1%5D.JPG" height="320" width="240" /></a></div>
<br />
then the installation proceeded as normal:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq9FesXuoZ9gZ6_H3QjeVAMQhN_eRQEcbskoFPs_uuKbhBraiOYgs34rUZIKdGSGJUjZeLteUumdthHpahvP4BfXZ4wMgq9sb0gWq4zZSXxl8kHO-24ZwA_LEE8MPXmtdTYXwQI056nXk/s1600/IMG_0406%5B1%5D.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq9FesXuoZ9gZ6_H3QjeVAMQhN_eRQEcbskoFPs_uuKbhBraiOYgs34rUZIKdGSGJUjZeLteUumdthHpahvP4BfXZ4wMgq9sb0gWq4zZSXxl8kHO-24ZwA_LEE8MPXmtdTYXwQI056nXk/s1600/IMG_0406%5B1%5D.JPG" height="320" width="240" /></a></div>
<br />Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0tag:blogger.com,1999:blog-683328852455856414.post-39336301920517714802014-05-16T11:51:00.004+02:002014-05-16T13:51:30.650+02:00[SOLVED] gimp mac can't export png - saving failed, error while saving, could not save imagei installed gimp on mac and tried exporting an image to png, but got this error:<br />
<i>Saving '/Users/me/Documents/nick-cv-img2.png' failed:</i><br />
<i><br /></i>
<i>Error while saving '/Users/me/Documents/nick-cv-img2.png'. Could not save image.</i><br />
<br />
the solution was simple:<br />
<br />
<a href="https://bugs.archlinux.org/task/35363#comment110197">https://bugs.archlinux.org/task/35363#comment110197</a><br />
<br />
<b>Menu > Image > Mode > Convert to Color Profile ...</b><br />
<br />
Then just click "<b>Convert</b>" to convert it to "<b>RGB workspace (sRGB built-in)</b>"<br />
<br />
Now exporting to PNG just works flawlessly.<br />
<br />
<b>thanks to Felix Yan (felixonmars)</b><br />
<b><br /></b>
<b><br /></b>Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com2tag:blogger.com,1999:blog-683328852455856414.post-58091809739021269142014-05-05T11:02:00.001+02:002014-05-16T13:51:46.687+02:00mac - mule studio - where is maven home?<div class="p1">
i'm testing out mule studio and got a warning/error about maven, that it needed to be installed/configured, so to find out where the maven home folder was, i ran this in <b>Terminal</b>:</div>
<div class="p1">
<br /></div>
<div class="p1">
<b>mvn -version</b></div>
<div class="p1">
<br /></div>
<div class="p1">
which returned the following:</div>
<div class="p1">
<i>...</i></div>
<div class="p1">
<i>Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)</i></div>
<br />
<div class="p1">
<i>Maven home: <b>/usr/local/Cellar/maven/3.2.1/libexec</b></i></div>
<div class="p1">
<i>...</i></div>
<div class="p1">
<br />
i had previously installed maven like this:<br />
<br />
<div class="p1">
<b><a href="http://brew.sh/">brew</a> install maven</b></div>
<div class="p1">
<br /></div>
</div>
Nickleushttp://www.blogger.com/profile/05936484998179906590noreply@blogger.com0