Posts

Showing posts from May, 2011

Why my Galaxy Nexus is not detected by Eclipse in my android project? -

i have galaxy nexus android version : 4.2.1 downloaded project: color histograms here: http://www.stanford.edu/class/ee368/android/index.html when connect device pc hear , see connected , can browse files in device no problems. connected media device (mtp) but when click on eclipse menu run > run > (none applicable) did run > run > no compatible targets found...i select no new window pop up: android device chooser choose running android device it's empty. why it's not detecting device ? you need enable developer settings inside settings enabling on android 4.2 , higher different. i'm using dutch device bare in mind bad menu-translations. go settings -> about phone . tab multiple times on build-version (about 7 or 8 times, if remember correctly) unlock developer settings . go inside them , tick usb-debugging option -> reconnect device . hope helps edit: restarting adb service might also: use adb kill-server stop server

node.js - Installing plugins for mongoose - getting error -

i'm trying add in first plugin - mongoose-text-search. https://npmjs.org/package/mongoose-text-search i'm getting error: how error: text search not enabled can't figure out. i have schema in seperate file gets compiled model export. (works fine.) blogschema.js var mongoose = require('mongoose'); var textsearch = require('mongoose-text-search'); var blogschema = new mongoose.schema({ title: string, author: string, }], }); // give our schema text search capabilities blogschema.plugin(textsearch); var blog = mongoose.model('blog', blogschema); exports.blog = blog; this relevant code server side. when client sends request /search/, socket hangs - got error: socket hang up , on server side how error: text search not enabled message. server.js var express = require('express') , mongoose = require('mongoose') , textsearch = require('mongoose-text-search'); var search_options = { project: &#

ember.js - #if statement throws TypeError: node is undefined -

consider below snippet in handlebar written ember.js: <script type="text/x-handlebars" id="courses/selectedcourse"> <div id="selectedcourse"> {{#if isregistered}} <div class="xx"> registered course </div> {{else}} <div class="yy"> <button {{action registerforcourse}}>register</button> </div> {{/if}} <h1>{{coursetitle}}</h1> <div class="selectedcourseitem"> <img id="selectedcourse" {{bindattr src="imageurl"}}/> </div> </div> </script> issue1 : content not getting refreshed after registering course. issue2 : on changing selected courses couple of times, content displayed twice , overlapping. following message see in firebug: typeerror: node undefined

android - cyman mark two open souce code -

this isn't programming/coding question, figured guys know since information on google scarce. i have been using app named cyman mark 2 few weeks , seems pretty app, wanted make few changes personalize me didn't know if open source. did research , found nothing. know more it? again, i'm sorry isn't programming related question figured guys knowledgeable ones on subject. i creator of cyman system - can tell both cyman mark 2 , cyman mark 3x (for chrome) not open source right now. may in future, don't know. ps - apologies not being able reply mail. i'm lone developer , it's in spare time (i have full time job). reply many can.

jquery - Isotope, Meteor, hasClass returning false? -

if (meteor.isclient) { template.articles.rendered = function () { var container = $('.articles'); var antiiso = $(container.find(".article:not(.isotope-item)")); if( container.children().length > 0 ) { if ( !container.hasclass("isotope") ) { console.log(container); console.log(container.hasclass("isotope")); container.isotope({ // options itemselector : '.article', layoutmode : 'fitrows' }); } else if (container.hasclass("isotope") && antiiso.length > 0) { console.log("updating isos"); container.isotope('additems', antiiso, function() { container.isotope(); }); } } } console output: <div class="articles isotope" style="position: relative; overflow: hidden; height: 281px;

File size computation benchmark: C two times slower than C++? -

consider following code 3 different versions of file size computation. #include <iostream> #include <cstdio> #include <string> #include <fstream> inline long long int filesize1(const std::string& filename) { std::ifstream filestream(filename.c_str(), std::ios::binary); std::streampos first = 0; std::streampos last = 0; long long int size = -1; if (filestream.is_open()) { filestream.seekg(0, std::ios::beg); first = filestream.tellg(); filestream.seekg(0, std::ios::end); last = filestream.tellg(); if ((first != -1) && (last != -1) && (last-first >= 0)) { size = last-first; } filestream.close(); } return size; } inline long long int filesize2(const std::string& filename) { std::ifstream filestream(filename.c_str(), std::ios::binary); return (filestream) ? (static_cast<long long int>(filestream.seekg(0, std::ios::end).tellg

javascript - Sticky Header - buggy jumping on scroll -

i have specific problem on making sticky header jquery. tried commonly used snippets around web, perceived same buggy thing everywhere. at specific document height (scrollable until little more calling of sticky-effect) sticky header jumps between position: fixed , position: static . html: <header> <div id="not-sticky"></div> <div id="sticky"></div> </header> <div id="content"> ... jquery: var $sticky = $("#sticky"); var offset = $sticky.offset(); var stickytop = offset.top; var windowtop = $(window).scrolltop(); $(window).scroll(function() { windowtop = $(window).scrolltop(); if (windowtop > stickytop) { $sticky.css({ position: 'fixed', top: 0 }); } else { $sticky.css({ position: '', top: '' }); } }); css: header { width: 100%; } #not-sticky { padding: 50px 0; width: 100%; } #sticky { padding:

c# - Component TypeConverter trouble -

i have calss 2 properties. 1 property must seen (depended) in propertygrid when other property contains appropriate value. have created own custompropertiestypeconverter : public abstract class custompropertiestypeconverter<tcomponent> : typeconverter { ... public override propertydescriptorcollection getproperties(itypedescriptorcontext context, object value, attribute[] attributes) { var component = (tcomponent)value; //error line ... everything works fine, once. properties dissapear propertygrid after project rebuilding. when run project vs have got following error: [a]mycomponent cannot cast [b]mycomponent. type originates 'test, version=1.0.1.169, culture=neutral, publickeytoken=null' in context 'loadneither' @ location 'c:\users\g_o\appdata\local\microsoft\visualstudio\11.0\projectassemblies\hszseh7801\test.exe'. type b originates 'test, version=1.0.1.169, culture=neutral, publickeytoken=null' in context

internet explorer - Jquery onchange click causes browser to go back to top in IE -

i posted question few days ago regarding browser scroller moving top when jquery onchange click function occurred here: jquery page moves top on checkbox change function . resolved setting min-height of container, realize that did not fix issue in internet explorer. ideas?

c# - How to use properly linq to perform efficiently a conversion from a DataTable to a set of recursive objects? -

i'm working on software dealing tests, developping using visual studio 2008, c#3.5. tests saved sqlite database, , software intended process results. well, there information table gathering general information tests following columns: layeraname layeraid layerbname layerbid layercname layercid layerdname layerdid start: datetime indicate when result table has been created. stop: datetime indicate when result table has been modified last time. resulttablename: table name used displaying results in datagridview using virtualmode. the layers discriminated using ids , btw, layer c, layers behaving containers gathering childlayers. last layer, "layerd" linked table in database. public abstract class layer { public string name { get; set; } public int32 id { get; set; } public datetime start { get; set; } public datetime stop { get; set; } } public class project: layer { private int32 id { get; set; } public dictionary<int32, l

C++ converting binary(64 bits) to decimal -

i using string contain 64 bits binary. string abinary; abinary = "100011111011101100000101101110000100111000011100100100110101100"; initially tried this.. stringstream ss; ss << bitset<64>(abinary).to_ulong(); buffer = ss.str(); cout << buffer << endl; its work binary, 1 doesn't work. how can convert above 64 bits binary contain in string container decimal of string container too. it's overflowing, because to_ulong() 32-bits. c++-11 introduces function to_ullong() , want. if don't have that, can try splitting string two, 2 32-bit numbers, convert 64-bit, shift , add.

mysql - Get column values of the updated row -

this question has answer here: get updated value in mysql instead of affected rows 5 answers $query = "update transaction set c_status = :status c_name = :name , c_id = :id"; $stmt = $this->handle->prepare($query); $stmt->bindparam(':c_status',$status,pdo::param_str); $stmt->bindparam(':c_name',$name,pdo::param_str); $stmt->bindparam(':c_id',$id,pdo::param_str); return $stmt->execute(); using above syntax, able update record in transaction table. however, return boolean. want know if there way can transaction_id ( the auto_increment field in transaction table, c_id , c_name column of that ) , rest of columns? this question not related pdo mysql in general. update queries not intended return anything. row database have use select query.

angularjs - How do I use ng-class without ng-repeat? -

i relatively new angularjs , loving every moment of it! have unordered list of products. when user hovers on them, need list element have active class set on them. doing way: <ul> <li ng-repeat="product in products" ng-mouseover="showdetails(product, $event)" ng-class="{active: current == product}">{{product}}</li> </ul> and showdetails follows: function showdetails(product, $event) { $scope.current = product; ...some other logic... } now, working fine, however, wondering if possible set class without ng-repeat , having no product variable bind to? <ul> <li ng-mouseover="showdetails($event)" ng-class="{<i don't know put here> }">foo</li> <li ng-mouseover="showdetails($event)" ng-class="{<i don't know put here> }">bar</li> <li ng-mouseover="showdetails($event)" ng-class="{<i don'

How to append a new line to beginning of an existing file in java? -

assuming have txt file located in /mypath/sampletext.txt. how append new line beginning of file following in java while preserving original text file's contents?: string startstr ="--start of file--"; looking way without having create intermediary 2nd file , make modifications existing file if possible. read file contents first, prepend new line contents = newline + contents , write new conent in same file (dont append).

logging - Create a detailed self tracing log in bash -

i know can create log of output typing in script nameoflog.txt , exit in terminal before , after running script, want write in actual script creates log automatically. there problem i'm having exec >>log_file 2>&1 line: the code redirects output log file , user can no longer interact it. how can create log copies in output? and, possible have automatically record process of files copied? example, if file @ /home/user/deskop/file.sh copied /home/bckup, possible have printed in log or have write manually? is possible record amount of time took run whole process , count number of files , directories processed or going have write manually too? my future self appreciates help! here whole code: #!/bin/bash collect() { find "$directory" -name "*.sh" -print0 | xargs -0 cp -t ~/bckup #xargs handles files names spaces. gives error of "cp: not overwrite just-created" if file didn't exist } echo "starting log" exe

How do I check if a page is html5-based in python? -

i'm trying parse various pages on web using lxml module, like: def dom(self): return lxml.html.fromstring(self.content) but seems have switch lxml.html lxml.html.html5parser in case of html5 pages. http://lxml.de/html5parser.html so how can determine if page html5-based? have check doctype char char before parse it? edit: made simple regexp deal problem. seems work, yeah, i'm still looking neat ways. solution breaks sourceline method. import lxml.html lxml.html import html5parser def dom(self): content = self.content if self._is_html5(): elm = html5parser.fromstring(content) content = lxml.html.tostring(elm, method='html') return lxml.html.fromstring(content) def _is_html5(self): return bool(re.match(r'^<!doctype html>', self.content, re.i)) you don't have switch using html5parser html5 files. can, , should, use html5parser html files. browsers use html5 compatible parser html fil

wpf - Must have non-null value for 'Setter.Property' -

i reading this article on msdn site, in order understand datatrigger. i have created defaultviewmodel class looks this. namespace controltemplatedemo { public class defaultviewmodel { private list<todoitem> _list; public defaultviewmodel() { _list = new list<todoitem>(); _list.add(new todoitem { taskname="wedding",priority = 1,description="important wedding",typeoftask = tasktype.home}); _list.add(new todoitem { taskname = "toyota meeting", priority = 3, description = "wsr", typeoftask = tasktype.work }); } public list<todoitem> tasks { { return _list; } } } } and xamal code this. <window x:class="controltemplatedemo.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

FlurryAgent:Agent cache file doesn't exist while implementing Flurry analytics in android -

i implementing flurry in application,and have written code following code, @override protected void onstart() { // todo auto-generated method stub super.onstart(); log.i(tag,"onstart"); flurryagent.onstartsession(this,keys.flurry_key); flurryagent.setlogenabled(true); flurryagent.setlogenabled(true); flurryagent.setloglevel(log.info); flurryagent.onevent("mainscreen"); flurryagent.logevent("user on home screen"); } @override protected void onstop() { // todo auto-generated method stub super.onstop(); flurryagent.onendsession(this); } but after executing code above getting log as, 05-13 11:52:10.954: i/flurryagent(371): agent cache file doesn't exist. 05-13 11:52:10.954: i/flurryagent(371): generated id what mean? mean flurry not integrated in app? if not how can solve it? note:i have included required permissions in manifest. running project in em

c# - How to create an Access database backup on .Net? -

i'm working on windows forms application has connection access database. need create backup database. also, user has choose destination folder of backup. can give me on this? thanks you can use option of copying access db file location backup. it can done follows: file.copy(sourcedbname, destdbname, true); or you can add simple routine takes input database, zip , store it, in backup directory, optionally passing password, this: using ionic.zip; ...... private void backuptozip(string sourcedbname, string destzipfile, string password) { using (zipfile zipf = new zipfile(destzipfile)) { if (bkppass.length > 0) zip.password = password; zipentry ze = zip.updatefile(sourcedbname, string.empty); ze.comment = "working copy stored in date: " + datetime.today.toshortdatestring(); zipf.comment = "this zip archive has been created ......"; zipf.save(); } } can refer following link more snipet

c# - How to store name of dynamic checkbox in an String array -

how can store name of dynamically created checkbox in string array when don't know how many checkbox user select @ runtime. have 10 dynamic checkboxes , out of 10 user select 6 checkboxes randomly how can name of selected checkboxes , store them in string array. i know how use event handler on dynamic check box confused how declare straing array when don't know be size of array. here have done till - private void checkboxcheckedchanged(object sender, eventargs e) { checkbox c = (checkbox)sender; //label mylabel; string str = null; if (c.checked == true) { str = c.text; gpbox[gpcount] = new groupbox(); gpbox[gpcount].name = "gpbox" + convert.tostring(count); gpbox[gpcount].text = str; gpbox[gpcount].location = new point(5, gpposition); gpbox[gpcount].autosize = true; this.controls.add(gpbox[gpcount]); acommand3 = new

sql - Trouble with MySQL query -

ok, first-off admit mysql syntax has never been strongest point. so, here am. urls : id url code =============================================== 1 http://www.google.com abcd 2 http://www.freetemplates4u.com efgh 3 ... posts : id title address =============================================== 1 title 1 http://mize.it/abcd 2 title 2 http://mize.it/efgh 3 ... i want create query fetch following table title url ======================================================= title 1 http://www.google.com title 2 http://www.freetemplates4u.com in few words : take url - code pairs urls table search http://mize.it/ + code in posts table (in address field) combine final title , url in result table. i know has joins , concatenation, i'm lost. sidenote : don't care neither current database's structure, nor performance issues. want transfer existing data,

Sharepoint Server Configuration Database -

i'm sharepoint newbie , i'm on installation phase. question is: can 2 sharepoint servers (different versions & running on separate machines) point same configuration database? thanks in advance! no. several sharepoint servers within same farm (which logical concept in sharepoint) need point same configuration database. however, in case have 2 different versions (i assume you're talking sharepoint 2010 , 2013), not work there differences in configuration databases between 2 versions. it totally okay though host multiple configuration databases on same sql server if want.

user interface - Error calling similar() in Sikuli -

l = find("start_menu.png").similar(0.5).anycolor() click(l) the above excerpt code. "start_menu.png" refers image of windows start menu. got following error when executed this: file "c:\users\vprave~1.tsi\appdata\local\temp\sikuli-tmp8636618870597770744.py", line 1, in l = find("1368426219510.png").similar(0.5).anycolor().anysize() attributeerror: 'org.sikuli.script.match' object has no attribute 'similar' could 1 me out this? , 1 tell me how use anycolor() , anysize() ? find attempts find when it's called. code says, in prose, "find looks 'start_menu', make thing found 0.5 similar, make color" this wrong--you can't set similarity threshold after fact. instead, call seen in sikuli docs . instead, say l = find(pattern("start_menu.png").similar(0.5)) here's same code arranged vertically: pattern = pattern("start_menu.png") pattern.similar(0.5) l =

c++ - How to solve OpenCV Error "function not implemented (called functionality is disabled for current build or platform) when using VideoWriter_GPU? -

question intro i'm running opencv project in visual studios 2010 , have implemented cuda support (refer my previous question precise info on set-up). cuda-functionalities working fine - best of knowledge - , indeed improving speed on image processing. however, wanted attemp speed video-writing function in project replacing current cv::videowriter gpu::videowriter_gpu function. reason cv::videowriter seems somehow cause processes running outside of scope in videowriter called slowed down, resulting in images available @ directshow driver being dropped videocapture-function, hence messing algorithm i've implemented. problem to attempt solve issue, i've replaced videowriter-calls videowriter_gpu-functionality (and corresponding syntax), when run project (compile & run in debug-mode), following error-message (directly originating atthe calling of gpu::videowriter_gpu): opencv error: function/feature not implemented (the called functionality disabled current

WPF: Unable to access a style from App.xaml -

i facing weird scenario while accessing style app.xaml , 1 style. app.xaml: <style x:key="custombuttonstyle" targettype="local:buttoncontrol"> <setter property="template"> <setter.value> <controltemplate targettype="local:buttoncontrol"> <grid datacontext="{templatebinding datacontext}"> <border x:name="borderimg" visibility="{templatebinding visibility}" borderthickness="{templatebinding borderthickness}" borderbrush="{templatebinding borderbrush}" background="{templatebinding background}" cornerradius="{templatebinding bordercornerradius}" datacontext="{templatebinding datacontext}"> <image x:name="image" source="{templatebinding bgimage}" verticalalignment="{templatebinding verticalcont

optgroup - jquery-ui-multiselect-widget change selectedText on optgrouptoggle -

how change selectedtext optgrouptoggle? https://github.com/ehynds/jquery-ui-multiselect-widget/ optgrouptoggle: function(event, ui){ $("#select").multiselect('option', 'selectedtext', ui.label); }

c# - upload files in asp.net mvc -

i'd upload file in asp.net mvc. i've following codes. file returns null value. there anything, should try? .cshtml <input type="file" name="file" id="file" /> controller.cs [httppost] public actionresult index(bookmodel model, httppostedfilebase file, formcollection values) { try { if (!modelstate.isvalid) { return view("index", new bookmodel()); } if (file != null && file.contentlength > 0) { var filename = path.getfilename(file.filename); var path = path.combine(server.mappath("~/img/"), filename); file.saveas(path); model.imageurl = filename; } //sendmail(); } catch (exception ex) { return view("index", new

ajax - JQuery Select Populate -

i have items on html a input text (company) field , select (company_list) when user types in text field want jquery use /home/searchsynonym/ names , display in select (the searchsynonym takes value user types , wildcard search , returns id , name ) can 1 , new ti jquery leb you need clarify in format searchsynonym return ids , names? in json? if in json, try following: var companylist = $("#company_list"); $("#company").change( function(){ $.getjson("/home/searchsynonym/",{ query: $(this).val() }, function(response){ var responselist = ""; $.each(result, function(index, item){ responselist += "<option value='" + item.id + "'>" + item.name + "</option>"; }); companylist.html(responselist); }); }); this work if 'company' text field bears id="company" in tag decleration, 'company_list' drop

.htaccess - Redirect everything to a single page with htaccess -

i'm total noob in htaccess please keep simple. on website don't use www.-domain. on subdomain. however, when refer website refer www-section redirect subdomain. done php header() function. what want redirect on www.jeroened.be subdomain. but, want redirect http://www.jeroened.be/blog http://subdomain.jeroened.be/blog . the simpliest thing me redirected index.php redirect subdomain. this should you're asking for. redirects index page. rewriteengine on rewriterule . index.php you may hit issue though in redirect images, css, etc... index page! the following folder structure / .htaccess may more appropriate. "app/public" public (all files publicly accessibly go in here - index.php, css, etc...) "app/php" (php files application) rewriteengine on # if requested file doesn't exist, redirect request index.php rewritecond %{request_filename} !-f rewriterule . index.php

uiviewcontroller - How to create a container/child viewcontroller relationship in interface builder -

Image
to create code parent/child relationship between 2 view controllers it's matter of doing like: [self addchildviewcontroller:childviewcontroller]; [self.view addsubview:childviewcontroller.view]; where self parent view controller. but, what if want create same relationship interface builder? or in other words: there way re-create behavior of method addchildviewcontroller using interface builder? didn't find lot of documentation that, here old unresolved post topic: https://devforums.apple.com/message/455758#455758 without setting addchildviewcontroller relationship, none of rotation methods forwarded child view controller, here question come from. this i've done in ib: drag , dropped "view controller" object "object library" panel "objects" panel in identity inspector i've changed class uiviewcontroller subclass ("items view controller") connected view outlet controller connected other required outlets contr

c# - MVCjqDrid store GridSettings in session -

i have mvcjqgrid: @(html.grid("datagrid") .setjsonreader(new mvcjqgrid.datareaders.jsonreader { id = "id", repeatitems = false }) .setrequesttype(requesttype.post) .addcolumn(new column("name").setlabel("name").setsearch(true)) .addcolumn(new column("email").setlabel("e-mail").setsearch(true).setformatter(formatters.email)) .addcolumn(new column("phone").setlabel("phone").setsearch(true)) .setsearchtoolbar(true) .seturl(url.action("getdata", "controller")) .setsearchonenter(false) .setrownum(10) .setrowlist(new[] { 10, 15, 20, 50 }) .setviewrecords(true) .setpager("pager")) and controller: public actionresult getdata() { return view(new myentity[0]); } [httppost] public jsonresult getdata(gridsettings gridsettings) {

ios - how to unhook in Interface Builder? -

Image
simple question: how can unhook this: i copy-paste viewcontroller between projects , ib not unhook automatically -> means have 2 hooks between projects , storyboards. go interface builder, right click on view want unhook , on referencing outlets section click on (x) button appear next iboutlet.

css - background-size cover makes css3 animation choppy -

i have grid of images want animate top css3. works until put background-size: cover onto grid. animation becomes choppy. doing wrong, or can prevent this? when use jquery's animation function becomes worse. i found like: -webkit-backface-visibility:hidden; not trick. example: http://jsfiddle.net/pqdvz/ body{ overflow: hidden; margin: 0; padding: 0; background: #ccc; } div.container.animate{ top:-100%; } div.container{ position: absolute; right: 0; bottom: 0; top: 0; left: 0; -webkit-transition: top 1s ease-in-out; -moz-transition: top 1s ease-in-out; -o-transition: top 1s ease-in-out; -ms-transition: top 1s ease-in-out; transition: top 1s ease-in-out; } ul{ display: block; padding: 0; margin: 0; } li{ width: 25%;; float: left; height: 160px; background-size: cover; list-style: none; margin: 0; padding: 0; } there nothing wrong javascript, problems lays in css.

java - Delete consecutives values in ArrayList of Int -

i have created arraylist 30 000 values, after been sorted, have lot of consecutive values, example: 22001 22002 22003 22004 22010 22011 22020 and want have : 22001 22004 22010 22011 22020 arraylist<long> l = new arraylist<long>(); // values collections.sort(l); arraylist<long> liste = new arraylist<long>(); i didn't test it, should work (for lists containing 3 or more elements). it's unoptimized regarding memory usage. arraylist<long> resultlist= new arraylist<long>(); long prevnumber= l.get(0); (int = 1; < l.size() - 1; i++) { if (prevnumber.equals(l.get(i) - 1) && l.get(i + 1).equals(l.get(i) + 1)) { //print 'inbetween' consecutive number } else { //not consecutive, copy result list resultlist.add(l.get(i)); } prevnumber= l.get(i); }

html - Firefox renders CSS incorrectly (spacing varies) -

currently using concrete5 build website, located here: http://tinyurl.com/cee5rvo firefox pushes header (navigation , h1 tag) down on pages (such gallery) , have no idea why. chrome , ie10 both display correctly. thanks help. the best way handle add line #content div. #content { overflow: hidden; width: 800px; } the overflow hidden clear floats , stop undesired effect of pushing content down.

android - Could I use newer API to build my apk? -

i want use wonderful methods in newer version of android api. still work ok in lower os devices? thank time! no...it not work on lower os devices. if still need functionalities of newer apis, can go support packages .

Finding out whether a number is a palindrome or not in C# -

i new c# , doing program exercise. have managed program print reversed number of input given user, when move onto checking whether palindrome or not, not calculate answer correctly. prints 'not palindrome'. after error checking, realized reason why doing because last number gets stored in newnum last digit after being reversed , not entire number. how can rectify this?? my code int i, remainder = 0, newnum = 0; console.writeline("enter number: "); int uinput = convert.toint32((console.readline())); (i = uinput; > 0; = (i / 10)) { remainder = % 10; console.write(remainder); newnum = remainder; } if (newnum == uinput) { console.writeline("the number {0} palindrome", uinput); } else { console.writeline("number not palidrome"); } console.writeline(uinput); console.w

java - Validating XSD itself -

could please tell me how validate xsd file (not xml against xsd)? have checked many forums , sites (including so) , of them refers or other online validator. not one-time check us. our application involves xsl transformation using xsd, need determine whether xsd used in valid format or not, in, tags match, starting , closing one. tags aren't allowed child tag, etc. that's why need proper java code achieve same. any highly appreciated. you can try javax.xml.validation package schemafactory f = schemafactory.newinstance(xmlconstants.w3c_xml_schema_ns_uri); schema s = f.newschema(new file("1.xsd")); schema.newschema() api parses specified file schema , returns schema

sql - Selecting from Table A where it joins to all data in Table B -

i have table of documents, , table of tags. documents tagged various values. i attempting create search of these tags, , part working. however, getting results returned when matches tag. want results matches tags. i have created illustrate problem http://sqlfiddle.com/#!3/8b98e/11 tables , data: create table documents ( docid int, doctext varchar(500) ); create table tags ( tagid int, tagname varchar(50) ); create table documenttags ( doctagid int, docid int, tagid int, value varchar(50) ); insert documents values (1, 'document 1 text'); insert documents values (2, 'document 2 text'); insert tags values (1, 'tag name 1'); insert tags values (2, 'tag name 2'); insert documenttags values (1, 1, 1, 'value 1'); insert documenttags values (1, 1, 2, 'value 2'); insert documenttags values (1, 2, 1, 'value 1'); code: -- set parameters declare @tagxml varchar(max) set @tagxml = '<tags>

How do you share a static constant global string between two separate applications in Qt? -

i writing client , server separate applications. there global strings both should have access in order ensure proper communication between two. typical method provide such strings both applications? i imagine 1 possible method place strings in header file , distribute file both applications. there in qt can use obtain os-agnostic location place header file both applications know it? i'm looking solution benefits existing qt libraries, generic approach work well. i'm not sure "library" necessary, far qt has helped applications os-agnostic , don't want break paradigm. update add clarity : these global strings static , constant - meaning wouldn't change during runtime, shared memory isn't needed. don't want have header file in client , header file in server , have make sure contents same. edit: qsettings should trick, too, @amartel suggested. it persistent , access. make sure programs perform readsettings , writesettings when nece

c# - Combobox binding to Deep Properties with Caliburn.Micro -

my vm has property of model, authorization , has property of activeservice . public authorization authorization { { return this.authorization; } set { this.authorization = value; notifyofpropertychange(); } } i created additional property on viewmodel, called services populate dropdown with: public ilist<service> services { { return services; } set { services = value; notifyofpropertychange(); } } my view has combobox control named services . understanding of caliburn , it's conventions should work. doesn't display items correctly. has right number of items in list shows "cannot find view models.service" any on i'm doing wrong? edit so tried this; manually set displaymemberpath binding so: displaymemberpath="{binding authorization_activeservice_description}" and ad

ruby - How can I place my email processes/routine outside of my frontend server (Rails 3.2/devise/sendgrid/heroku) -

in order free frontend server, i'd place requests sent sendgrid ( authentificaiton, confirmation, passwiord reset , transactionnal emaisl such "no visit long time" email , daily email send. it's necessary plan need keep memory , power of main server web app , includes displaying pages possible. we'd keep emails routines eating of our main web app server memory/power. now on 1 single server (on dyno on heroku) (plus database). as plan have lot of traffic on front end, think make sense create dyno reserved email process (let's call "email server/dyno". but should talk app , database for ex if user signs up, main dyno web app has send message "email server" another ex: i'll have access same database use cron see if need send email if user subscribed 8 weeks ago , and has never signed in on website. so keep short, how can create set server deal emails should put same gems , environment how can "email server&quo

javascript - PhoneGap - Can't Find variable -

so made simple slideshow in js display photogalery in page, problem whenever try slideshow console shows me error referenceerror: can't find variable: next this code: slideshow js code: <script> var myimage= new array(); myimage[0]="1.jpg"; myimage[1]="2.jpg"; myimage[2]="3.jpg"; myimage[3]="4.jpg"; myimage[4]="5.jpg"; myimage[5]="6.jpg"; myimage[6]="7.jpg"; myimage[7]="8.jpg"; myimage[8]="9.jpg"; myimage[9]="10.jpg"; myimage[10]="11.jpg"; myimage[11]="12.jpg"; var imagecnt = 0; function next(){ imagecnt++; document.getelementbyid("whitebox").style.background = 'url(' + myimage[imagecnt] + ')'; } function previous(){ imagecnt--; document.getelementbyid("whitebox").style.background = 'url(' + myimage[imagecnt] + ')'; } </script> html body cod

javascript - ng-disabled doesn't appear to work -

i'm trying conditionally enable/disable save button using ng-disabled: <button type="button" title="save changes" ng-click="onsavechanges()" ng-disabled="{{!data.modified}}">save</button> i have $scope.data.modified variable changes true when data has been modified. regardless whether true or false, save button enabled. element inspection reveals value of ng-disabled toggles between "true" , "false" expect button enabled. when using angular js attribute (like ng-show, ng-hide, ng-disabled) should without snake notation ex. ng-disabled="!data.modified" . other ordinary attribute class, id have use snake notation. ex. class={{avaribaleincontrollerscope}}

jasper reports - give fixed path to file in Java project (Netbeans) -

i have java project generating jasper reports, give path of file (report) , run project runs fine, when have give jar file friend, need file placed in specific folder according code get's file path , have place file there, code below give idea public void generatereport(string datestart, string dateend) { inputstream stream = null; connection connection = null; class.forname("com.mysql.jdbc.driver"); connection = drivermanager.getconnection("jdbc:mysql://localhost:3306/app", "root", ""); stream = new fileinputstream(new file("").getabsolutepath() + "/reports/logreport.jrxml"); jasperdesign jasperdesign = jrxmlloader.load(stream); jasperreport = jaspercompilemanager.compilereport(jasperdesign); jasperprint jasperprint = jasperfillmanager.fillreport(jasperreport, null, connection); //frame.getcontentpane().add(datesetter, borderlayout.page_start); frame.getcontentpane().add(new

Android TextView append SpannableString forcing java.lang.RuntimeException on Nexus 7 -

i have serious problem crashes app. i'm loading text in app textview. parts of text clickable , should call activity - works fine devices. unfortunatelly not work on nexus 7 devices , don't know why. this stacktrace google: java.lang.runtimeexception: can't create handler inside thread has not called looper.prepare() @ android.os.handler.(handler.java:197) @ android.os.handler.(handler.java:111) @ android.widget.editor$userdictionarylistener.(editor.java:3836) @ android.widget.editor.(editor.java:192) @ android.widget.textview.createeditorifneeded(textview.java:8475) @ android.widget.textview.settext(textview.java:3611) @ android.widget.textview.settext(textview.java:3554) @ android.widget.textview.append(textview.java:3277) @ android.widget.textview.append(textview.java:3267) [...some app methods not relevant problem...] the java code: final string text = displayedtext; spannablestring link = makelinkspan(displayedtext, new view.onclic

How do I include an XSD file for a configuration section with a NuGet package? -

i have library pretty verbose configuration section. i've created xsd , distribute package when user installs package, visual studio knows xsd without user needing extra. how do this? you can include files want in nuget package placing them in content directory. these installed root of target project when package installed. if you're using nuspec file build package add following element under element. <files> <file src="configuration\myxsd.xsd" target="content\targetfoldername" /> </files> this create following file in target project \targetfoldername\myxsd.xsd once xsd in target project visual studio should pick automatically validating config section.

sitecore6 - In Sitecore 6 how to open a content item in the content editor from a custom Sitecore app? -

i have sitecore custom app search screen. user able click on link in search results , open content item in content editor. know how this? what need use fo parameter id of item value of paremeter @ end of content editor path, e.g.: http://localhost/sitecore/shell/applications/content%20editor.aspx?fo={4142d44b-2237-4795-b219-85e70420fced} edit after comment: if want start new application content editor within sitecore, can use method: sitecore.text.urlstring parameters = new sitecore.text.urlstring(); parameters.add("id", item.id.tostring()); parameters.add("fo", item.id.tostring()); sitecore.shell.framework.windows.runapplication("content editor", parameters.tostring()); this described in post launch content editor code and here solution mark ursino same thing using javascript onclick events: http://firebreaksice.com/link-directly-to-a-sitecore-item-in-a-custom-editor/

jquery - Enable/Disable using Radio is not working -

i trying disable/enable dropdown box based on user selection of radio buttons. have following jsfiddle: jsfiddle works fine on it's own. $('input[type=radio]').click(function() { var r_id = $("input[@name=sc]:checked").attr('id'); alert(r_id); if (r_id == "bname") { //enable name drop down $(".dname").prop('disabled', false); //disable specialty drop down $(".dspecialty").prop('disabled', true); } if (r_id == "bspecialty") { //enable specialty drop down $(".dspecialty").prop('disabled', false); //disable name drop down $(".dname").prop('disabled', true); } }); the same exact code in following page not working: website demo i ran code on local xampp server. appears the issue coming chosen.jquery.js file. if remove script example.jquery.html intended behavior.