Posts

Showing posts from 2013

java - Monitor bean injection failure -

we have application spring beans (3 levels) running on tomcat, beans annotated @autowired , mandatory. what monitor bean injection failure (which can indicate deployment problem). the way i'm thinking have 2 options so: instead of using @autowired load beans in static block, if load fails do something surround code try{...} catch (nullpointerexception e) , if bean null exception thrown. check if beans equal null @ every method. i think #1 elegant , least amount of code add, wondering whether there elegant way without static block. thanks there quiet few options here. favorite annotate required dependency @autowired(required=false) , in method anotated @postconstruct test , handle missing dependency: ... @autowired(required = false) private bean dependency; @postconstruct private void init() { if(dependency==null) { // handle missing dependecy } } there quiet interesting article checking of required dendecies in spring. it's bit ol

How to configure log4r 1.1.10 with rails 3.2.13 and ruby 2.0.0 p0 -

i newbie ruby on rails , struck configuring logging application developing i followed steps answered in question a link in log directory, log file gets created. nothing gets written log file. i using ruby 2.0.0 p0. how debug , fix this? struck on day. got fixed. having rails.logger = log4r::logger.new("application log") in environment.rb file. once removed it, logging worked fine.

c++ - How to use singleton and pure virtual function together? -

class base{ static base* m_selfinstance; public: static base* getinstance(); virtual void abc() = 0; }; class der:public base{ public: void abc(){cout << "derived...\n";} }; base* base::m_selfinstance = null; base* base::getinstance() { if(m_selfinstance == null) { /*throws error here , it's natural, because it's violates c++ standard*/ m_selfinstance = new base(); } return m_selfinstance; } int main() { base *b = base::getinstance(); //b->abc(); system("pause"); return 0; } in case how deal singleton , pure virtual function together. if i'll make m_selfinstance = new der(); things works fine. real problem occur if there more derived classes der_1 , der_2 @ time istance m_selfinstance

Issue with jQuery ui tabs -

i've following jquery code , $("#tabs").tabs({ select: function(event, ui) { window.location.replace(ui.tab.hash); },}).addclass( "ui-tabs-vertical ui-helper-clearfix" ); except first tab other tabs jquery adding style attribute value display:none ,due i'm getting error while loading openlayers map in second tab.because while creating map corresponding div in hidden state.so added below code, $("#tabs").tabs("widget").find('#tab-2').attr('style','display:block'); but leads problem,while loading third tab,second tab in visible state,is there alternate solution issue? i had similar problem not using jqueryui. because control the way tabs worked set width , height 0 rather using display: none hide tabs allowed map - gmaps in case render. the other thing @ callback. i.e render map on click of tab rather when page loads. there method doing think: http://api.jqueryu

How to change the location of a control from a groupbox to form in vb.net? -

not able take out control groupbox @ runtime in vb.net. see code: integer = 0 groupbox1.controls.count - 1 dim ctrl control = groupbox1.controls(i) if ctrl.text = "test" ctrl.location = label1.location end if next the control "test" textbox placed inside groupbox1. control "label1" label placed outside of groupbox1. when change location of textbox, moved somewhere, not @ label1.location. there other way this? try this: ctrl.parent = form1 and change location: ctrl.location = label1.location

c - Run multiple executables all at once -

i have c sockets application, different executables of must run @ same time @ once, preferably in different terminals. how do it? example, there 4 exes, ./one, ./two, ./three, ./four. i want them run in different linux terminals without slightest of time difference. how can it? there @ least "slightest of time difference". have exe's agree on time proceed , sleep until time before doing whatever need do.

Trouble getting footer to stay in the bottom of the page -

i'm using twenty ten theme. i don't know if matters, make footer stretch way out of page (100%), put outside wrapper div, instead of: <wrapper> <main> </main> <footer> </footer> </wrapper> i've put way: <wrapper> <main> </main> </wrapper> <footer> </footer> the css footer looks this: #footer { height: 100px; background:#393939; font-size:12px; color:#777; margin:0; padding:20px; z-index:999; bottom:0; clear:both; } the footer lays directly under content, if content of page short, footer not in bottom of page, on page: http://skiss.nu/hff/?page_id=10 if add "position: absolute;" footer stays @ bottom of page, laying on content om pages more content. you need have position 'fixed'. #footer { height: 100px; background:#393939; font-size:12px; color:#777; margin:0; padding:20px; z-index:999;

html5 - Dragging a local file into textarea with Opera 12 -

i creating application using html5 able drag local text file textarea. works fine in firefox 20.0.1, chrome 26.0.1410.64 m , internet explorer 10 not in opera 12.15 or safari 5.1.7. instead of text of file appearing within text area new page opens containing text. understand this answer should expect problems safari implication should work opera 12. any explaining or overcoming problem appreciated. the application, near finished, @ grideasy.github.io source files @ https://github.com/grideasy/grideasy.github.io to see effect click on 'content' button , drag text file text area. both safari , opera pass detect feature code below if(window.file && window.filereader && window.filelist && window.blob) { dropzone = $('drop_zone'); dropzone.value=""; dropzone.addeventlistener('dragover', handledragover, false); dropzone.addeventlistener('drop', handlefileselect, false); d

facebook - An internal error occurred while linting the URL. Like button not working. Link not recognised -

my blog link stopped being recognised on facebook (www.makeupbydyna.com). can post it, text, not thumbnail or of sort. button not working either. have tried going on facebook's debugger , says "an internal error occurred while linting url." have tried filing bug report "create button" visible. how fix error?

css selectors - What is the alternative to CSS-selecting an ancestor -

css(3) has descendent selectors, e.g. td em {color: red}; , no ancestor selector , apparently. so, should instead of td {border: 1pt solid red} em; ? i.e., how can set style on ancestors of (x)html element? note: javascript not relevant workaround, xpath'y might be. you can wait css4 selectors implemented, do td! em { border: 1pt solid red; } see http://dev.w3.org/csswg/selectors4/ . or... var xpathresult = document.evaluate("//td[.//em]", document, null, xpathresult.any_type, null); while (e=xpathresult.iteratenext()){ e.classlist.add("border"); } see https://developer.mozilla.org/en-us/docs/dom/document.evaluate . normal browser support caveats apply.

android - Holo theme and custom background for my button -

i have problems add blue color on button when user press it. works if there no drawable in background button in case, have add custom background , want blue color when user clicks on button. here code <button android:id="@+id/create_profile" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/info_account" android:layout_centerhorizontal="true" android:background="@drawable/btn_create_profile" /> blue color not platform draws you. standard buttons have selector drawable background, involves set of images view. button example standard button image, pressed button image (with blue overlay drawn above), disabled (half transparent), etc. button knows it's current state , displays appropriate image. so want draw pressed button , create selector drawable this: <selector xmlns:android="http://schemas.android.com/apk/res/andro

jpa - Object not fetch well in java -

i have problem fetching objects in java. there object entity bean class , contains object b (other entity bean class) field. object created without b , later object b attached action. problem users can not see object b in object a, looks null. in database fine , after time object looks (contains b). happens in cases, in other object looks begin. want use 2 virtual machines running application (maybe can problem) , oracle application server. help? stojan code looks like: entity class defined (b entity class). @entity @table(name = "a") public class a{ ... @manytoone @joincolumn(name="id_b", referencedcolumnname="id") private b b; ... } object of class created in action, example: public createa_action(){ a = new a(); saveobject(a); } where 'saveobject' method persist or merge object in database. later, there call of other method, this: public addbtoa_action(){ a = geta(); b b = g

sql - Steps to be followed for performance analysis of Java EE/Oracle application -

we developed application using java ee , oracle , want increase performance of both java , database side. need proper approach or steps this. it depends on data have in database. can manage until 5 million data out problem,more may performance problems. if have massive data in databank go database partition. example: create table sales_range (salesman_id number(5), salesman_name varchar2(30), sales_amount number(10), sales_date date) partition range(sales_date) ( partition sales_jan2000 values less than(to_date('02/01/2000','dd/mm/yyyy')), partition sales_feb2000 values less than(to_date('03/01/2000','dd/mm/yyyy')), partition sales_mar2000 values less than(to_date('04/01/2000','dd/mm/yyyy')), partition sales_apr2000 values less than(to_date('05/01/2000','dd/mm/yyyy')) ); select * table partition (partitionname);

java - double click on jlist in netbeans -

i want select item in list mouse. found code didn't work. mouselistener mouselistener = new mouseadapter() { public void mouseclicked(mouseevent e) { if (e.getclickcount() == 2) { int index = list.locationtoindex(e.getpoint()); system.out.println("double clicked on item " + index); } } }; list.addmouselistener(mouselistener); try code, sample application works fine !!!!!! import java.awt.borderlayout; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import javax.swing.jframe; import javax.swing.jlist; import javax.swing.jscrollpane; public class calc { public static void main(string args[]) { string labels[] = { "a", "b", "c", "d", "e", "f", "g", "h" }; jframe frame = new jframe("selecting jlist"); frame.setdefaultcloseoperation(jframe.exit_on_cl

How to set dot(.) at fixed place automatically in javascript? -

Image
please consider highlighted portion in image attached above. in portion want auto generate dot after add respective digits required in field length field. i.e. field :- rate per unit consider example of field here want auto generate dot(.) after press 11. are looking .tofixed(2) ? https://developer.mozilla.org/en-us/docs/javascript/reference/global_objects/number/tofixed

c - why cant i manage ~382MB of memory when i have it available? -

objective: manage unsigned long tombola[5][10000000]; $top gives me: top - 14:05:35 4:06, 4 users, load average: 0.46, 0.48, 0.44 tasks: 182 total, 1 running, 180 sleeping, 1 stopped, 0 zombie cpu(s): 14.4%us, 2.4%sy, 0.0%ni, 82.5%id, 0.6%wa, 0.0%hi, 0.0%si, 0.0%st mem: 3092064k total, 1574460k used, 1517604k free, 168944k buffers swap: 1998840k total, 0k used, 1998840k free, 672756k cached program has, malloc size of (5*10000000) * 8bytes =382mb, fill 0s , read of stored in tombola: long int **tombola; if((tombola=(long int **)malloc(5))==null){ /*malloc()*/ printf("\n\tmemory error-1"); exit(1); } for(i=0;i<5;i++){ if((tombola[i]=(long int *)malloc(10000000*sizeof(long int)))==null){ printf("\n\tmemory error-2"); exit(1); } } /*malloc()*/ for(i=0;i<5;i++){ for(j=0;j<10000000;j++){ tombola[i][j]=0; } }

jquery - How to call a function on submit? -

i not able call jquery on submit. alert in function not displayed. i want display alert of checked checkbox names. here's code: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> <script> $(document).ready({ $("#rolemanagement").submit(function() { alert("hi"); var selected = new array(); $('#checkboxes input:checked').each(function() { selected.push($(this).attr('name')); }); $.each(selected, function(key, value)

c++ - Error when calling std::find on a user-defined object -

so keep error message called: no match 'operator==' in '(&__first) >std::_list_iterator<_tp>::operator* _tp = course == __val' in following code: int main(){ course not_found("not_found", "not_found", 0); course x("comp2611", "computer organiaztion", 2); hashtable<course> q(not_found, 17, 36); q.insert(x); } template <class hashedobj> class hashtable{ public: hashtable(const hashedobj& notfound, int bucket, int base); void insert(const hashedobj& x); private: const hashedobj item_not_found; vector<list<hashedobj> > thelist; }; template <class hashedobj> void hashtable<hashedobj>::insert(const hashedobj& x){ list<hashedobj>& whichlist = thelist[hash(x)]; typename list<hashedobj>::iterator itr; itr = std::find(thelist[0].begin(), thelist[0].end(), x); if(itr == thelist[hash(x)].end()) whichlist.insert(thelist[

How can I access another domain's cookies from a Silverlight app? -

i have 2 different webpages. first php app creates cookie ( http://www.phpapp.com ). second silverlight app ( http://www.silverlightapp.com ). the question how access cookie created php app silverlight app hosted on second website? thanks! i'm afraid it's impossible due security restrictions - browser won't allow site access cookies domain. check out: cross-domain cookies silverlight not sending cookies in cross-domain browser requests the first link gives workarounds.

c - What does the prototype "const int* foo(int)" mean,especially in contrast to "int* foo(int)"?I understand the second only -

this question has answer here: what difference between const int*, const int * const, , int const *? 12 answers i know int* foo(int) prototype means foo function takes integer argument , returns pointer integer.but following mean? const int* foo(int); i tried reason failed.my book doesn't see stuff in library function prototypes.so please tell me means. so value pointed returned address can't change via address (useful when foo() returns address of const). const int* p2c = foo(int); *p2c=10; <-- "error"

Python: NameError: free variable 're' referenced before assignment in enclosing scope -

i have strange nameerror in python 3.3.1 (win7). the code: import re # ... # parse exclude patterns. excluded_regexps = set(re.compile(regexp) regexp in options.exclude_pattern) # line 561: excluded_regexps |= set(re.compile(regexp, re.i) regexp in options.exclude_pattern_ci) the error: traceback (most recent call last): file "py3createtorrent.py", line 794, in <module> sys.exit(main(sys.argv)) file "py3createtorrent.py", line 561, in main excluded_regexps |= set(re.compile(regexp, re.i) regexp in options.exclude_pattern_ci) file "py3createtorrent.py", line 561, in <genexpr> excluded_regexps |= set(re.compile(regexp, re.i) regexp in options.exclude_pattern_ci) nameerror: free variable 're' referenced before assignment in enclosing scope note line 561, error occurs, second line in code above. in other words: re not free variable. regular expression module , can referenced fine in first line. it se

jquery - Javascript Alertify wait for confirmation then go to another page -

i new alertify.js . trying is, when user cicks on link, browser should show confirmation box. if user clicks of go next page. if user clicks cancel stay on same page. possible using alertify.js . here html code. <a href="index.php" class="alert">logout</a> here javascript code. $(".alert").on('click', function(){ alertify.confirm("are sure?", function (e) { if (e) { return true; } else { return false; } }); }); but problem whenever click on link, go index.php page before clicking on confirm. please me, stuck days. in advance. the problem is impossible make code wait. need cancel original click , call code navigate new page. $(".alert").on('click', function(e){ e.preventdefault(); var href = this.href; alertify.confirm("are sure?", function (e) { if (e) { window.location.href = href;

sql - can check and default constraint work together in sqlite -

i trying check @ time of creating table if field 'undefined' change blank space ' '. - create table ( id real primary key, name text check(*** if field 'undefined' change ' ' ****) ); you can create trigger task - create trigger insert_table_name before insert on table_name each row when new.text = 'undefined' begin new.text:= ''; end; and in case want other task can perform in trigger.

cordova - undefined error while inserting data into table -

i trying insert db , display data in listview. getting error. 05-14 19:43:56.336: e/web console(1480): typeerror: result of expression 'c[0]' [undefined] not object. @ file:///android_asset/www/jquery_mobile/jquery.mobile-1.2.0.min.js:2 this trying do function listdata(tx, resultset) { div = null; list = null; var row = null; list = $("<ul>").attr({ 'data-role' : 'listview', 'data-inset' : 'false', 'id' : 'mylist' }); count = resultset.rows.length; $(list).remove(); $.each(resultset.rows, function(index) { row = resultset.rows.item(index); var li = '<li><a href="#">' + row['date'] + '</a></li>'; list.append(li); }); div = '<div data-role="collapsible" data-inset="false" data-iconpos="right" data-collapsible="true&quo

windows 8 - Java System.getProperty("user.home") directory missing separator -

Image
whenever user enters "~" argument, program replaces system.getproperty("user.home"). after debugging, see replaces "~" "c:userssoulbeaver" , not "c:/users/soulbeaver". going through previous questions incorrect user.home folders , found out java tries fetch path hkey_current_user\software\microsoft\windows\currentversion\explorer\shell folders\ however, i'm using windows 8 , there seemingly nothing wrong: at point i'm assuming java "eats" backslash... how prevent happening? update since code requested, here is. taken allen holub's solving java's configuration problem /** * every enum element in array, treat keys[i].name() key * , load associated value following places (in order): * * <ol> * <li>a -d command-line switch (in system properties)</li> * <li>if no -d value found, environment variable same name key</li> * <li>if no environmen

browser - Is there a way to emulate HTML/CSS zoom properties in Windows Phone 8 WebBrowser? -

i want display website in windows phone 8 webbrowser view , fix viewport zoom display content in logical screen resolution, e. g. 300 css pixels wide element should take 300 physicals pixels on device device pixel ratio of 1.0 while taking 600 physical pixels on hi-res screen 2.0 device pixel ratio. windows phone 8 webbrowser view elements rely on @-viewport when comes configuring web page's viewport: http://msdn.microsoft.com/en-us/library/ie/hh869615%28v=vs.85%29.aspx http://dev.w3.org/csswg/css-device-adapt/#the-lsquozoomrsquo-descriptor yet, zoom properties not implemented , therefore cannot used. there css or javascript approach achieve desired behaviour?

Unable to read shared memory data using boost created by Qt -

i've created qt shared memory program write string shared memory. after writing, need read boost program. tried using simple programs, couldn't read string using boost interprocess. here qt code writing shared memory. , i'm double checking if string written reading shared memory same program. void cdialog::loadstring() { if(sharedmemory.isattached()) { if(!sharedmemory.detach()) { lbl->settext("unable detach shared memory"); return; } } lbl->settext("click on top button"); char sstring[] = "my string"; qbuffer buffer; buffer.open(qbuffer::readwrite); qdatastream out(&buffer); out << sstring; int size = buffer.size(); qdebug() << size; if(!sharedmemory.create(size)) { lbl->settext("unable create shared memory segment"); qdebug() << lbl->text(); } sharedmemory.lock();

regex - How I can find slash "/" into html with regular expression in Dreamweaver? -

Image
i try find slash in code [\/][^] expression: <td>12321/213213</td> but not work (... image how work here: if you're looking regular expression 1 time find/replace, following regex works: \b\/\b the \b means word boundary tested in rubular

android - Proguard Error: Unknown option '(' in argument number 12 -

i can't export project proguard, error , out of solutions.. don't know argument number 12 ... [2013-05-14 17:38:39 - livewallpaper] proguard returned error code 1. see console [2013-05-14 17:38:39 - livewallpaper] error: unknown option '(' in argument number 12 my project.properties: # enable proguard shrink , obfuscate code, uncomment (available properties: sdk.dir, user.home): proguard.config=proguard.cfg # project target. target=android-13 and proguard.cfg empty. thanks! ok found solution using proguard parseexception default proguard.cfg on android my problem workplace directory folder name "(" character .. moved directory without whitespaces or "(" , solved it.

android - chart values not showing for bar chart achartengine -

i creating default bar chart using achartengine library. values doesn't show properly. want show chart value @ top of bar , align center. me values first bar visible, want see values both bars. how can that? appreciate help. here code public intent getintent(context context) { // bar 1 int[] y = { 124, 135, 443, 456, 234, 123, 342, 134, 123, 643, 234, 274 }; categoryseries series = new categoryseries("demo bar graph 1"); (int = 0; < y.length; i++) { series.add("bar " + (i+1), y[i]); } // bar 2 int[] y2 = { 124, 135, 243, 256, 234, 223, 242, 234, 223, 243, 234, 274 }; categoryseries series2 = new categoryseries("demo bar graph 2"); (int = 0; < y.length; i++) { series2.add("bar " + (i+1), y2[i]); } xymultipleseriesdataset dataset = new xymultipleseriesdataset(); dataset.addseries(series.toxyseries()); dataset.addseries(series2.toxyseries()); // how &quo

How to solve the Difference between Google Maps and Geocoding? -

ok here odd situation. have been facing long time on many maps have created. here 1 sample address : hotel tamisa golf, camino viejo de coín, 3, mijas costa, málaga, 29649 , spain if go maps.google.com , search address, comes exact hotel tamisa golf. but if use google map's geocoding method using example provided google themselves, , search address on there, showing totally different location. miles away actual location. http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html is there way fix should show exact location on map? that "address" "place" not "postal address". the geocoder finds coordinates associated postal address, looks thinks address "urbanización mijas golf, 13s, 29651 mijas, málaga, spain": geocode the places api finds "places": place

What is the equivalent command for objdump in IBM AIX -

i not able find objdump command in ibm aix 5.1 machine. want assembly instructions (disassemble) library generated in aix. linux has objdump command , solaris dis command this. equivalent command in ibm aix? you can use dis command disassemble object files on aix, should come xlc. it may easier install gnu bintools suite objdump though. available aix linux toolbox .

php - MySQL inner join with two tables -

i'm new mysql , php , i'm struggling inner joins between 2 tables. i'm constructing script reads os commerce database , tells me products on order. in order product on order value in products_attributes table set '134', reads product_id , not product_model in 'products' table. products_attributes(table name) options_values_id product_id products(table name) product_id product_model i want select items have value of '134' in products_attributes table match product_ids both tables product_model "products" table. feel code easy reason i'm struggling how construct query , display it. select product_model products p,products_attributes pa p.product_id = pa.product_id , pa.options_values_id = 134 or select p.product_model products p inner join products_attributes pa on (p.product_id = pa.product_id) pa.options_values_id = 134

installation - InstallShield doesn't create one big Setup-file -

Image
this question has answer here: howto create installshield msi no files needed locally? 4 answers i have created project in visual studio ultimate 2012 , have activated installshield can create setup-file project. deal installshield doesn't create 1 big setup-file, rather 1 folder contains setup-file can run install project. if take setup-file out of folder, setup fail. know doing wrong? feel whole purpose of creating setup-file have 1 exe-file, not forced go through folder find setup-file. added image of folder: there variety of scenarios call different build configurations. single self extracting exe not desired. however, if desire, build single image configuration instead. personally, if don't have reason have setup.exe ( setup prereqs, multiple instances, minor upgrades , on ) i'd build single msi.

spring mvc - Use spaces into the tab titles with liferay tabs -

i'm working spring mvc portlets , liferay tabs. i'm having problem put spaces tab title. let's want define inside jsp: <liferay-ui:tabs names="sample tab 1, sample tab 2" refresh="false" value="${mycontrollervalue}" > <liferay-ui:section> <jsp:include page='/jsp/mypage1.jsp' flush="true"/> </liferay-ui:section> <liferay-ui:section> <jsp:include page='/jsp/mypage2.jsp' flush="true"/> </liferay-ui:section> </liferay-ui:tabs> this not working @ (eventhough, it's example documentation) , problem spaces names (it works fine if use names="tab1,tab2", that's not want show in tab titles) besides, need control tab show controller. this: if(whatever){ renderrequest.setattribute("mycontrollervalue", "sample tab 1"); } and causes problem, because need show tab names in several languages, i'd need pass ta

mysql - Adding a database record with foreign key -

let's there database 2 tables: 1 customer table , 1 country table. each customer row contains (among other things) countryid foreign key. let's assume populating database data file (i.e., not operator selecting country ui). what best practice this? should 1 query database first , id's countries, , supply (now known) country id's in insert query? not problem 'country' example, if there large number of records in table being referred? or should insert query use sub query country id based on country name? if so, if record country not exist yet , has added? or approach? or depend? :) i suggest using join in insert query country id based on country name. however, don't know if that's possible every sgbd , don't give more precision on 1 you're using.

How to show the delegated `constructor` reference issue in javascript? -

in example below noticed comment "fixes delegated constructor reference" , i'm curious -how can show "not working / working after add line of javascript? full gist here => https://gist.github.com/getify/5572383 thank in advance function foo(who) { this.me = who; } foo.prototype.identify = function() { return "i " + this.me; }; function bar(who) { foo.call(this,"bar:" + who); } bar.prototype = object.create(foo.prototype); bar.prototype.constructor = bar; // "fixes" delegated `constructor` reference functions in javascript objects. when create function foo in javascript, interpreter automatically creates prototype property foo.prototype , object. interpreter creates constructor property on object refers foo itself: console.log(foo.prototype.constructor); // reference foo; console.log(foo.prototype.hasownproperty("constructor")); // true; this same process takes p

bitwise operations in c++, how to actually use it? -

i understand 11001110 & 10011000 = 10001000 but want test myself so declare unsigned char , print out, gives me blank. unsigned char result; result= 11001110 & 10011000; cout<<result; also tested unsigned int, gives me 0, not expected 11001110 , 10011000 aren't binary numbers (at least in compiler's mind). binary 11001110 206 , , 10011000 152 , want (i think): result = 206 & 152; or use std::bitset , print result binary.

javascript - How do I do an JOIN-type query in IndexedDB -

i have tried following tutorial @ http://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/ regards doing queries in indexeddb, example not work. how join type query in indexeddb? have set objectstores indexes, cant seem syntax? indexeddb key-value (document) store. doesn't have join query or querying on multiple object store. can query multiple stores in transaction. how suppose make join query in indexeddb. i have bit of writeup modeling relationship http://dev.yathit.com/ydn-db/schema.html using library. here joining query select * supplier, part supplier.city = part.city . var iter_supplier = new ydn.db.indexvalueiterator('supplier', 'city'); var iter_part = new ydn.db.indexvalueiterator('part', 'city'); var req = db.scan(function(keys, values) { var sid = keys[0]; var pid = keys[1]; console.log(sid, pid); if (!sid || !pid) { return []; // done } var cmp = ydn.db.cmp(sid, pid); // compare keys

ocaml - How can I declare a module (actually a Set.Make) in mli file? -

i have airport.mli , airport.ml . in airport.ml , have module airportset = set.make(struct type t = airport let compare = compare end);; this no problem. i have function val get_all_airport : unit -> airportset.t;; , generates airportset . so in airport.mli , need show module airportset airportset recognized. how can that? module airportset : (set.s type elt = airport) (the parens unnecessary, putting them there know signature expected, in general case of form sig ... end ).

list - prolog delete head from a clause -

i using yap. suppose have scenario: p(x,y) :- q(x), f(x,y), g(x). i need put body of predicate in list using command listing(p) . expected output should be: [q,f,g]. how can that? with service predicate enum_conj((a, b),x) :- !, (enum_conj(a, x) ; enum_conj(b, x)). enum_conj(x, x). we can do ?- clause(p(_, _), p), setof(f, j^a^(enum_conj(p, j), functor(j, f, a)), l). l = [f,g,q], p = (q(x),f(x,y),g(x)) all builtins used iso standard

jquery - Lazy loading with wordpress not working in contents added via ajax -

i making pagination working infinite scroll. lazy loading not working in these contents. using following ajax function $.ajax({ url: nexturl, type: 'get', success: function(html){ newdata = $(html).find('div#ajax_pagination'); $("#ajax_pagination").append(newdata); $(html).find('img[data-lazy-src]').each( function() { lazy_load_image( ); }); }, }); it showing error uncaught referenceerror: lazy_load_image not defined any ideas? the function defined inside function in "lazy_load" file, private scope. other functions outside scope cannot call it.

ibm mobilefirst - IBM SmartCloud Enterprise Worklight Server URL and console login credentials? -

i running instance of ibm worklight server in ibm smartcloud enterprise: ibm worklight server v.5.0.0.3 red hat enterprise linux 5.8 64b byol. i can log ibm worklight application center on port 9080 without problem. i want log worklight server console itself. understanding url should ip address followed port 8080 , /worklight/console. two questions: url doesn't seem correct because invariably times out. second question, once have correct login id need default userid , password. grateful assistance. the ibm worklight console , default, not come credentials. there no need username/password in order access it. if not mistaken, "smartcloud" version of worklight being run on websphere liberty profile, means port number 9080 , not 8080 (port 8080 used when using embedded worklight server (which runs on jetty) in worklight studio plug-in eclipse (developer edition of ibm worklight)). try http://your-host-here:9080/worklight/console

textmate2 - When I do git diff | mate2 it opens Textmate but doesn't show me the diff -

i have tried manner of git diff commands. from using actual commit hashes: $ git diff e2951679823lkdasdkjn38 7jhlkdjhlakj3kl2jlj2a90 | mate2 to using 2 branches: $ git diff master develop | mate2 both of launch textmate2 don't show me files want see. i able diff on gemfile.lock on last 2 or 3 commits in textmate. how do that? check out mate -h . can give tm2 hint on bundle want use -t switch. following compares 2 branches, piping output textmate in diff mode: git diff master develop | mate -t source.diff to see single path, following: git diff master develop -- <paths> | mate -t source.diff this common syntax number of other commands (like git log). can read more on git diff manpage : git diff [options] [<commit>] [--] [<path>…] git diff [options] --cached [<commit>] [--] [<path>…] git diff [options] <commit> <commit> [--] [<path>…] git diff [options] <blob> <blob> git diff [options]

ruby on rails - how to permit an array with strong parameters -

i have functioning rails 3 app uses has_many :through associations not, remake rails 4 app, letting me save ids associated model in rails 4 version. these 3 relevant models same 2 versions. categorization.rb class categorization < activerecord::base belongs_to :question belongs_to :category end question.rb has_many :categorizations has_many :categories, through: :categorizations category.rb has_many :categorizations has_many :questions, through: :categorizations in both apps, category ids getting passed create action this "question"=>{"question_content"=>"how spell car?", "question_details"=>"blah ", "category_ids"=>["", "2"], in rails 3 app, when create new question, inserts questions table , categorizations table sql (82.1ms) insert "questions" ("accepted_answer_id", "city", "created_at", "details", "p

objective c - Intermittent Crash on KVO Notification -

here's what's going on: i've got singleton monitoring device's event store changes. have property called events i've wrapped in eventssignal racsignal . _eventssignal = [racable(self.events) startwith:nil]; when application finishes launching, prompts user access calendars (standard approach) using requestaccesstoentitytype:completion: . completion block executes on background queue, dispatch main queue: -(void)promptforaccess { [_store requestaccesstoentitytype:ekentitytypeevent completion:^(bool granted, nserror *error) { dispatch_async(dispatch_get_main_queue(), ^{ [self willchangevalueforkey:ekeventmanageraccessiblekeypath]; _accessible = granted; [self didchangevalueforkey:ekeventmanageraccessiblekeypath]; if (_accessible) { // load events [_store reset]; [self refresh]; } }); }]; } the call [self refresh] loads new events event store, cal

MySQL stored procedure without parameters -

i'm trying create procedure gives me syntax error. not of seems problem delimiter $$ create procedure inactivity() language sql begin [mysql block] end $$ delimiter; i figured out myself. wrong there no space between delimiter , semicolon.

Are SET statements within INSERT syntax valid SQL -

i have been using queries such insert table set foo='alice', bar='bob' , work within mysql, , have been wondering, query valid sql server implementations, or mysql unique implementation? have had mssql syntax, references (foo,bar) values ('alice','bob') valid. have tested further myself, don't have access many other server implementations. no, not valid standard sql. as far know mysql dbms supporting strange syntax. btw: here dbms play with: http://sqlfiddle.com

Code Error While Using SQL Output and ASP.NET -

i have below stored procedure in sql server 2008 not generating errors in sql, generating 1 in web application states "'getgeninfo_delete01_01_22' expects parameter '@fpath', not supplied". novice @ sql, trying return field vb.net before row deleted. suggestions helpful. alter procedure [dbo].[getgeninfo_delete01_01_22] @idx int, @fpath varchar(100) output begin select @fpath = (select filepath geninfo_e1_01_22 id=@idx) delete geninfo_e1_01_22 id = @idx end here vb code calling stored proc using con new sqlconnection(connstr) using cmd new sqlcommand() cmd.commandtype = commandtype.storedprocedure cmd.commandtext = "getgeninfo_delete01_01_22" cmd.parameters.add("idx", id) dim returnparameter = cmd.parameters.add("@fpath", sqldbtype.varchar) returnparameter.direction = parameterdirection.returnvalue cmd.connection =

PHP, MySQL HTML error in result -

hello i'm new , i'm trying make simple dynamic html. have written following code seems dose not work. can me. because following line $row[name]"); echo (""); echo (""); echo (""); echo (""); } ?> <html> <head> <title>untitled document</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body> <table> <tr> <td align="center">edit data</td> </tr> <tr> <td> <table border="1"> <? mysql_connect("localhost","user","pass"); mysql_select_db("computers"); $order = "select * vnc"; $result = mysql_query($order); while ($row=mysql_fetch_array($result)){ echo ("<td>$row[name]</td>"); echo ("<td>$row[department]</td>"); echo ("<td>$row[p

c# - Playing 30 sound effects at the same time repeatedly -

i'm trying play 30 piano notes @ same time in xna application on windows phone 7. have imported , loaded wave files below protected override void loadcontent() { spritebatch = new spritebatch(graphicsdevice); sound3 = content.load<soundeffect>("1"); sound5 = content.load<soundeffect>("3"); sound6 = content.load<soundeffect>("4"); sound7 = content.load<soundeffect>("5"); sound8 = content.load<soundeffect>("6"); } every sound effect file less second, i'm trying play of them @ same time. play them using loop runs every second.(so @ every loop 30 sounds played goes on , plays same 30 sounds each second) works fine few seconds stops playing sound (the loop still working) again starts working once or twice , again stops working . makes bad noises if audio system cant support many sounds play @ time. i'm not sure how can solve prob

php - Adding different unique classes to Wordpress wp_nav_menu? -

i'm trying put in different <img> tags in each <li> generated wp_nav_menu() . meaning want wp_nav_menu generate this: <ul id="main-menu"> <li id="menu-item-219" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-219"> <a href=""> <img id="icon-one" /> link 1 </a> </li> <li id="menu-item-220" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-220"> <a href=""> <img id="icon-two" /> link 2 </a> </li> </ul> instead of (the original output): <ul id="main-menu"> <li id="menu-item-219" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-219"> <a href=""> link 1

ember.js - EmberJS: Updating property inside object -

little , strange issue. have array of objects. here controller. ambiantbox.ambiantscontroller = ember.arraycontroller.extend({ myarray: [], filldata: function(){ //loop this.myarray.push({index: 0, status: 'hide'}) //loopend }, updatestate: function(idx){ arr=this.get('myarray'); for(i=0;i<arr.length;++i){ obj=arr[i] if(obj.index==idx){ console.log(idx); obj.set('status','show'); console.log('==========='); }}} }); i call updatestats function viewside. works fine till line console parameter idx code seems break set object. there no errors in console well. strange. appreciated. if want use ember's set , get 's it's idea use ember.object , ember.array well. try this: ambiantbox.ambiantscontroller = ember.arraycontroller.extend({ myarray: em.a(), filldata: function(){ obj = ember.object.create({index: 0, status: 'hide'}); this.

c# - Upload document to Server using HttpPost -

the application "a" requires upload word-file [as byte array] external application using post. the filecontent should added named parameter in request body , have make post request upload file. i have sample code, in java. write equivalent c# code. in c#, not find similar object multipartentity. java code snippet: string resturl = hosturl + "/rest/upload/0b002f4780293c18"; string filename = "testrestuploadbyfolderid" + calendar.getinstance().gettimeinmillis() + ".txt"; file testfile = createnewfile("c:/temp/rest/" + filename); filebody content = new filebody(testfile, "application/octet-stream"); system.out.println(" file name : " + content.getfilename() + " ... " + content.gettransferencoding()); multipartentity reqentity = new multipartentity(httpmultipartmode.browser_compatible); reqentity.addpart("filename", new str

postgresql - Deployment issues of Psycopg2 Python App -

i have created application in python tested , runs on computer (mac osx 10.8.3 python2.7.3 postgresql9.2.4 psycopg2-2.5). app compiled using py2app, , can see build included packages/modules application contents folder. psycopg2 imports correctly on machine, , app runs fine, when application runs on computer (i've tried 4 different computers...), fails open, , console message reads importerror: dlopen(/applications/app.app/contents/resources/lib/python2.7/psycopg2/_psycopg.so, 2): library not loaded: libpq.5.dylib i have searched , modified code extensively through s.o. , google no avail. psycopg2 links not address issue. http://initd.org/psycopg/articles/2010/11/11/links-about-building-psycopg-mac-os-x/ i have removed , reinstalled psycopg2 & postgresql numerous times, building source, macports, homebrew, etc. current environment listed above, postgresql 9.2.4 installed homebrew, , psycopg2-2.5 installed source while explicitly linking pg_config location in setup.cf