Wednesday, 18 September 2013

source folders not visible in Netbeans project after installing jRebel plugin?

source folders not visible in Netbeans project after installing jRebel
plugin?

I installed jRebel on Netbeans and this made all my source folders an
libraries to disappear from my projects - except Maven ones. Like this:

The source folders are still present on my drive:

I just need to restore their visibility in my opened Netbeans projects.
When I try to add source packages from the "Properties" menu of the
project, I do get the source back but as folders, not packages.
Help would be much appreciated!

node.js module or require.js

node.js module or require.js

i wonna programming web app and using express.js as webframework. As
testing framework i will use mocha and chai.
Node.js support modular programming, i can load module with require like
require("mocha"). On frontend i use require.js for organize my codes in
module, but this can be use in node.js to. It it better to use require.js
in node.js or better to use node.js standard module.
I know that require.js support AMD and testing codes with mocha it can
comlicated, because the codes will be load asynchronously.
Node.js require or require.js for module loading?

Tuesday, 17 September 2013

How to make navPreNext button visible in layer slider responsive?

How to make navPreNext button visible in layer slider responsive?

I am trying to using layer slider responsive provide by js . IN short I am
using layer slider and unable to show next and prev button on the slider.
Below is my code
<script type="text/javascript">
// jQuery $('document').ready(); function
// Calling LayerSlider on your selected element after the document loaded
$('document').ready(function(){
$('#layerslider').layerSlider({
responsive: false,
autoStart : true,
navPrevNext: true,
skin : 'default'
});
});
</script>
HTML
<div id="layerslider" style="width: 1404px; height: 404px;">
<div class="ls-layer">
<img class="ls-bg" src="../img/image-slider-1(small).png"
alt="layer1-background">
</div>
</div>

SQLite (and Android, sorry to be a cleche) is `in` a valid column name?

SQLite (and Android, sorry to be a cleche) is `in` a valid column name?

it's a short one, I've spent 10 minutes checking spellings and such but I
cannot find an error!
So I am wondering is "in" a valid column name in SQLite? I usually use
MariaDB (MySQL but with that old spirit and no Oracle) and provided one
escapes/uses statements properly all is usually well.
09-18 03:15:27.892: E/SQLiteLog(30043): (1) near "in": syntax error
09-18 03:15:27.892: E/SQLiteDatabase(30043): Error inserting state=1
time=1378810407
reading=13964 in=0
09-18 03:15:27.892: E/SQLiteDatabase(30043):
android.database.sqlite.SQLiteException:
near "in": syntax error (code 1): , while compiling: INSERT INTO
Readings(state,time,reading,in) VALUES (?,?,?,?)
Helpful right?
-- Describe READINGS
CREATE TABLE "Readings" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"reading" INTEGER,
"in" INTEGER,
"time" INTEGER,
"state" INTEGER
)
Use:
ContentValues values = new ContentValues();
values.put("reading", reading.asInt());
values.put("in", in.asInt());
values.put("state",State.OKAY.ordinal());
values.put("time", time.getTimestamp());
return (int) db.insert("Readings", null, values);
In is actually 0 btw, I have a whole heap of errors, some with different
in values. There are no type errors or silenced exceptions.
I did want to put "just a short one" but then I thought "No, they'll want
more" so sorry "it's a short one" turned out to be a lie.
Please do help, I didn't expect any errors, and I am not even sure what's
wrong.

Load content over ajax by click and onload?

Load content over ajax by click and onload?

I have a page where I have a menu that makes an ajax call when clicking
and it loads content in a div with a little animation with the footer. (as
can be seen here: http://perishablepress.com/slide-fade-content/ I'm
wondering if there is a way to have the first menu item to be loaded
already when opening the page. My code:
<ul>
<li><a class="blog" href="#blog">Blog</a></li>
<li><a class="contact" href="#contact">Contact</a></li>
</ul>
and the script:
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>jQuery(document).ready(function($) {
$('.blog').on('click', function() {
var href = $(this).attr('href');
if ($('#ajax').is(':visible')) {
$('#ajax').css({ display:'block' }).animate({ height:'0' }).empty();
}
$('#ajax').css({ display:'block' }).animate({ height:'200px'
},function() {
$('#loader').css({ border:'none', position:'relative', top:'24px',
left:'48px', boxShadow:'none' });
$('#ajax').load('blog.php ' + href, function() {
$('#ajax').hide().fadeIn('slow').colorFade({ 'fadeColor':
'#0e0e0e' }); }); }); }); });
jQuery(document).ready(function($) {
$('.contact').on('click', function() {
var href = $(this).attr('href');
if ($('#ajax').is(':visible')) {
$('#ajax').css({ display:'block' }).animate({ height:'0' }).empty();
}
$('#ajax').css({ display:'block' }).animate({ height:'600px'
},function() {
$('#loader').css({ border:'none', position:'relative', top:'24px',
left:'48px', boxShadow:'none' });
$('#ajax').load('contact.php ' + href, function() {
$('#ajax').hide().fadeIn('slow').colorFade({ 'fadeColor':
'#0e0e0e' });
});
});
});
});
So now I have to click "blog" or "contact" to have the content load, but
I'd like to have "blog" loaded as default when opening the page!
And also: Is there a way to have not only the content, but also another
version of jquery loaded, let's say when I click "contact" and my contact
form works with another jquery version.
I hope somebody can help a super-noob like me! Thanks lot in advance!

Need to download a very large amount of data from a database through a web service

Need to download a very large amount of data from a database through a web
service

I need to create an action that downloads certain records from my database
as a text file. The code below works fine for a toy example (few records).
When this code is pushed to production it turns out I run out of memory.
Amount of data I deal with is in order of Gbs
public FileResult Streammer()
{
MemoryStream file = new MemoryStream();
using (var db = new DbMapper())
{
while (true)
{
List<Record> records = db.GetNext(10000);
if (records == null)
break;
foreach (Record r in records)
{
byte[] data = r.GetBytes();
file.Write(data, 0, data.Length);
}
}
}
file.Position = 0;
return new FileStreamResult(file, "text") { FileDownloadName =
"junk.txt" };
}
Ideally, I would like to read chunks of records from the DB on the server.
As a single chunk is read it is immediately converted and streamed to a
client. The client would should a standard download indicator without
actually indicating the remaining time/size.
Any recommendations would be greatly appreciated.

Kendo UI grid popup edit custom template - calling function from input checkbox - chrome issue

Kendo UI grid popup edit custom template - calling function from input
checkbox - chrome issue

I'm using a custom edit popup template:
editable: { mode: "popup",
template: $("#popup_editor").html()
},
i have a checkbox that in the template that is not part of the grid fields:
<!-- popup editor template -->
<script id="popup_editor" type="text/x-kendo-template">
<input type="checkbox" name="MakeTemplate" onclick="checkMakeTemplate()"/>
</script>
the checkMakeTemplate() fires fine in ie but in Chrome it gives me a
"Uncaught ReferenceError: MakeTemplate is not defined"
Any help would be appreciated.