Posts

Showing posts from March, 2013

java - How to have integration tests setUp() manipulate HSQL data in an in-memory DB running in embedded Jetty container? -

java - How to have integration tests setUp() manipulate HSQL data in an in-memory DB running in embedded Jetty container? - i trying run integration tests against rest web service process started in embedded jetty container within maven integration test phase. much working. i want configure server utilize in-memory hsql db such each junit test can setup database (create tables, insert records), , tear downwards (delete records). the application context of web services process defines next datasource: <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="#{applicationproperties['jdbc.driver.class.name']}" /> <property name="url" value="#{applicationproperties['jdbc.url']}" /> <property name="username" value="#{applicationproperties['db.user']}" /> <pro...

jslint - How can I ensure that all of my JavaScript functions return a value? -

jslint - How can I ensure that all of my JavaScript functions return a value? - i've had numerous bugs happening because of missing return in function. see, when of code write in ruby, it's easy forget explicit returns. so i'd utilize similar jslint (which use) check functions homecoming something. yes, think it's improve explicitly homecoming when it's not required hunt downwards missing returns. so, there tools check returns? or maybe can assert in runtime in simple manner? please don't suggest coffeescript, i'm aware of existence. jsunit example: <script language="javascript" src="jsunitcore.js"></script> <script language="javascript"> function testwithvalidargs() { assertequals("somefunction should homecoming something", "expected homecoming value", somefunction(2, 3)); } </script> javascript jslint

multithreading - Blackberry multi threading issue -

multithreading - Blackberry multi threading issue - i developping blackberry application communicates server via http requests( javax.microedition.io.httpconnection ). on device, user clicks ui items, , device sends requests server, when response comes, ui changes. communication takes place under new thread, while ui thread pushes , pops progressdialogscreen. the problem sometimes, when response comes , progressdialogscreen popped, ui not alter after couple seconds ui changes. if have requested in between when progressdialogscreen popped , when new screen pushed, there comes mess. first oldest new screen pushed, , newest new screen pushed. , situation can observed server responsing wrong requests. problems occur on simulator , device. the other problem is, 2 same response returns 1 request. able see these 2 problems on simulator @ logs, have not able see issue on device since can not see logs. edit: string utf8response; httpconnection httpconn = null; try{ httpconn =...

lisp - Issue on displaying successive items of an infinite stream -

lisp - Issue on displaying successive items of an infinite stream - ; defining stream-for-each (define (stream-for-each proc s) (if (stream-null? s) 'done (begin (proc (stream-car s)) (stream-for-each (stream-cdr s))))) ; defining method display stream (define (display-stream s) (stream-for-each display-line s)) (define (display-line x) (newline) (display x)) ; creating stream uses newton-raphson ; method find square root of 2 (define (sqrt-improve guess x) (avg guess (/ x guess))) (define (sqrt-stream x) (define guesses (cons-stream 1.0 (stream-map (lambda (guess) (sqrt-improve guess x)) guesses))) guesses) now testing it.. => (stream-ref (sqrt-stream 2) 11) value: 1.414213562373095 so seems stream working correctly; when seek , display it: => (display-stream (sqrt-stream 2)) 1. ;the procedure #[compound-procedure 13 stream-for-each] has b...

c# - Incompatible Type when using web service -

c# - Incompatible Type when using web service - i have utilize web service returns string result, gets string parameters too, things have done this: 1- have added service reference project. 2- have created instance of service class 3- have phone call want function within class instance here code: myservicens.pscowsdlporttypeclient mys= new myservicens.pscowsdlporttypeclient(); string res; res =mys.srvreq("11320000", "21310000", "13901009", "1", "3"); but problem when phone call mys.srvreq error below: the content type text/xml; charset=iso-8859-1 of response message not match content type of binding (text/xml; charset=utf-8). if using custom encoder, sure iscontenttypesupported method implemented properly. first 572 bytes of response were: ?xml version="1.0" encoding="iso-8859-1"?soap-env:envelope soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/...

Android SQLite- View 'raise()' exception messages in Log -

Android SQLite- View 'raise()' exception messages in Log - if wrote trigger 'then raise(abort, "my error message")' clause sqlite in android app, there way view "my error message" in logcat? wanted know if it's @ possible write own custom error messages log rather have rely on sqlite's vague error codes when constraints fail. thanks. android sqlite

drupal - How do I make a template file for a specific display in a view when I have multiple displays of the same type -

drupal - How do I make a template file for a specific display in a view when I have multiple displays of the same type - i have view using articles on front end page (view called frontpage top). in 1 block display (named: top story) selects recent article. in other block display (named: top 5 stories) selects 2nd-6th recent. i need create template single top story, , display other 5. this template: views-view--frontpage-top.tpl.php works, it's beingness used both blocks. the way know how multiple views, these closely related i'd maintain them in one. possible, , if filename like? it doesn't seem documented in views2 ( http://drupal.org/node/352970 ) , ( drupal: views, can displays have different styles view? ) close not same. if "right" way create multiple views ok that, cannot find resource saying , i'd prefer not if don't have to. thanks! each display can themed independently another. in views admin, go display want custom...

Architectural considerations for having a portable C++ domain layer interfaced with Java(JNI) and C#(C++/CLI) -

Architectural considerations for having a portable C++ domain layer interfaced with Java(JNI) and C#(C++/CLI) - i need create desktop app pretty complex , handles particular domain. domain has entities @ end. want ui of desktop app portable different frameworks such java(eclipse rcp plugin) , .net(visual studio plugin). 1.)can write domain layer using c++ , interface java using jni java 2.)use same c++ layer point 1.) interfacing .net (c++/cli) plugin vstudio what architectural considerations, pitfalls, future issues 1 face if 1 relies on portable c++ layer interfaced higher level apis java , c# rich client desktop application for illustration 1 of issue face cannot debug , step native code java. there many such items? should rewrite domain layer using .net , java each type of environment rather keeping portable c++ layer? why isn't such approach adopted industry? practical issues 1 faces when 1 has jni layer in between view , domain layer? interfacing doma...

git - Submodule merge failure - "not checked out" warning -

git - Submodule merge failure - "not checked out" warning - how can merge submodule after having had next warning? warning: failed merge submodule sites/all/modules/contrib/panelizer (not checked out) that error message comes submodule.c , merge_submodule() method: int merge_submodule(unsigned char result[20], const char *path, const unsigned char base[20], const unsigned char a[20], const unsigned char b[20], int search) { struct commit *commit_base, *commit_a, *commit_b; int parent_count; struct object_array merges; // [...] if (add_submodule_odb(path)) { merge_warning(path, "not checked out"); homecoming 0; } and add_submodule_odb() method checking .git presence within said submodule. so, jefromi comments, didn't git submodule update described in pro git book. should see question "git - easy way pull latest of submodules" more on how content ...

python - How do I query in ElementTree as in Xpath? -

python - How do I query in ElementTree as in Xpath? - this sample query might in php: foreach(steps step) { aret_eles = xpath->query(t_elequery, step) } now in python: for step in index steps: aret_eles = ?!?!?!?!!??!?!!??!! i tried this: for step in index steps: aret_eles = xpath.query(t_elequery, step) it didn't work. i've imported elementtree xml.etree.elementtree , though. the official page able find on xpath in elementtree didn't have documentation or examples.... , know how horribly bad python official's tutorials are. so, i'm looking resource. if have lxml, high-performance, full-featured version of elementtree, installed can utilize xpath follows: >>> lxml import etree >>> xml = """<ham><spam>hello!</spam> <spam>goodbye!</spam></ham>""" >>> tree.xpath("//spam/text()") ['hello!', 'goodbye!'] ...

java - generating inheritance mapping using the hypejaxb -

java - generating inheritance mapping using the hypejaxb - i using hypejaxb3, , trying find syntax adding inheritance. e.g wants define xsd relation class circle inherits shape . find hyperjaxb customization guide @ https://wikis.sun.com/display/glassfish/hyperjaxb3reference couldnt find specific steps defining inheritance. just utilize xml schema complex type extension mechanism: <xsd:complextype name="shape"> <xsd:sequence> ... </xsd:sequence> </xsd:complextype> <xsd:complextype name="cicrle"> <xsd:complexcontent> <xsd:extension base="geometry:shape"> <xsd:sequence> <xsd:element name="radius" type="double"/> </xsd:sequence> </xsd:extension> </xsd:complexcontent> </xsd:complextype> hj3 generate circle extend shape - appropriate jpa mappings, including inherita...

Spring Security 3: Setting up tomcat 6 for SSL -

Spring Security 3: Setting up tomcat 6 for SSL - i trying setup spring security 3 running on tomcat 6 ssl. i need test secure-connection https configured ssl on tomcat , exported certificate out of generated keystore still application doesn't run. redirects me https on port 8443 , says "this webpage not available". <intercept-url pattern="/login" access="isanonymous()" requires-channel="https"/> could tell me else need test secure connection login page? is 8443 proper https port tomcat instance? if not, you'll need port-mapping within http element in spring security: <http> ... <port-mappings> <port-mapping http="9080" https="9443"/> </port-mappings> </http> ssl spring-mvc spring-security certificate tomcat6

database - Joomla 1.7 creating component for backend using multiple talbes and editing multiple fields ask for suggestion -

database - Joomla 1.7 creating component for backend using multiple talbes and editing multiple fields ask for suggestion - for joomla 1.7, have 3 tables database. display manufacturers backend component com_manufacturers database has columns: id, name, address i trying have each name link connect table called 'hours'to display edit page particular id. 'hours' table has columns defined as: hour_id, hour_manufacturerid {fk}, hour_dayofwork, hour_open, hour_close in models , views folder, have done display list. connect hours table next? in models/manufacturers.php , have class extends jmodellist. tables folder has job connect database, in models/....php dbo(). views has display list of manufacturers. how particular link move url ?option=com_manufacturers&views=hours&id=1 on first name, id=2 , id=3 ? after create models/manufacturer.php , views/manufacturer/tmpl/default.php , view.html.php --> tried have models connect table ...

h 264 Hardware encoding /decoding For IOS(IPhone/Ipad)? -

h 264 Hardware encoding /decoding For IOS(IPhone/Ipad)? - i have done real time video processing in ios using avfoundation framework , help of this link.i have tested working fine. want utilize h264 encoding , decoding[before draw] .i seek h264 encoded info avcapturesession ,so have set avvideocodech264 in avcapturesession's videosetting,before start capturing . nsdictionary* videosettings = [nsdictionary dictionarywithobjectsandkeys:value,key,avvideocodech264,avvideocodeckey, nil]; [captureoutput setvideosettings:videosettings]; above code doesn't produce alter in output buffer,same buffer format before. how accomplish requirement ? possible ? if please help me getting started ,h264 in ios. there's no direct access encoded keyframes. may found insightful comments here: how stream live video iphone media server wowza? a pair avvideocodech264, avvideocodeckey may used parameters in outputsettings in nserror *error = nil; nsdictionary *ou...

css - Superfish Full Width Mega Menu -

css - Superfish Full Width Mega Menu - i working on superfish menu fullwidth mega menu. failed position of dropdown fullwidth; i.e streched along entire length of menu rather absolute positioning i'm getting, suggetion css helpful. check link horizontal + multi-column sub-menus might help auto sized mega menu superfish mega menu css positioning superfish megamenu

c# - Fluent WPF API for inherited properties -

c# - Fluent WPF API for inherited properties - occasionally i'll have wpf c# code i'd write in "fluent" manner. for example, might want setup window containing scrollviewer : new window() .setcontent( new scrollviewer() .setcontent( ...)) to accomplish sort of api, i've been using extension methods such these: static class fluentscrollviewer { public static scrollviewer setcontent(this scrollviewer obj, object val) { obj.content = val; homecoming obj; } } static class fluentwindow { public static window setcontent(this window obj, object val) { obj.content = val; homecoming obj; } } now, window , scrollviewer both inherit content property contentcontrol . yet, i've had define setcontent extension methods each class separately. if seek instead: static class fluentcontentcontrol { public static contentcontrol setcontent(this contentcontrol obj, object val) { obj.con...

php - How to check if opcode cache is running on a server? -

php - How to check if opcode cache is running on a server? - is possible check if php opcode cache installed , running on server without having ssh access server? i've checked phpinfo() , can see no reference apc or eaccelerator, i'm aware there other opcode cache systems , not totally sure checking phpinfo() plenty allow me know 1 way or other. var_dump(function_exists('apc_store')); or equivalent library of choice. if using web server sapi, per usual, create sure restart server process after editing php.ini see new additions reflected. php linux opcode

python - Move an entire element in with lxml.etree -

python - Move an entire element in with lxml.etree - within lxml, possible, given element, move entire thing elsewhere in xml document without having read of it's children , recreate it? best illustration changing parents. i've rummaged around docs bit haven't had much luck. in advance! .append , .insert , other operations default >>> lxml import etree >>> tree = etree.xml('<a><b><c/></b><d><e><f/></e></d></a>') >>> node_b = tree.xpath('/a/b')[0] >>> node_d = tree.xpath('/a/d')[0] >>> node_d.append(node_b) >>> etree.tostring(tree) # finish 'b'-branch under 'd', after 'e' '<a><d><e><f/></e><b><c/></b></d></a>' >>> node_f = tree.xpath('/a/d/e/f')[0] # nil stops moving 1 time again >>> node_f.append(node_...

asp.net - Is there a basic, standard .build file for NAnt? -

asp.net - Is there a basic, standard .build file for NAnt? - basically, i'm trying integrate cruisecontrol.net nant. i've got cc.net set up, i'm getting exception when tries build nant. build failed - not find '*.build' file in 'c:\inetpub\myproject\' okay, no big deal, have create build file. not sure is, found 1 in helloworld illustration came nant, looks this: <project name="hello world" default="run"> <property name="basename" value="helloworld"/> <property name="debug" value="true"/> <target name="clean"> <delete> <fileset> <include name="bin/${basename}-??.exe"/> <include name="bin/${basename}-??.pdb"/> </fileset> </delete> </target> <target name="build"> <mkdir di...

php - How can I replace things in minify and css files -

php - How can I replace things in minify and css files - i'm using minify and have css file "style.css" body{ background: url(image.png); } and when making mini in /path/to/min/dir/f=style.css because of want create url of backgound total this body{ background: url({$url}/image.png); } and in mimify class create assign or replace smarty to mimi this body{background: url(/path/to/image.png);} you can't minify , have dynamic values in (it supposed caching). if you've got dynamic url's, inline css or add together css header in html/php file, not in css file php

php - Processing an unknown amount of checkboxes -

php - Processing an unknown amount of checkboxes - i'm generating unknown amount of checkboxes in form using mysql, number vary, $frinfoq = mysql_query($frinfo) or die (mysql_error()); while($frow = mysql_fetch_assoc($frinfoq)) { $username = $frow['username']; $ct = $frow['country']; $fruuid = $frow['uid']; ?> <tr><td><p><?php echo $username; ?></p></td><td><p><?php echo $ct; ?></p></td><td><form method="post" action="<?php echo $_server['php_self']; ?>" id="delf"><input type="hidden" value="<?php echo $fruuid; ?>" /><input type="checkbox" name="add[]" value="<?php echo $fruuid; ?>" id="a_t_game" /><form></td></tr> <?php } ?> when form submitted , processed ...

reporting services - SSRS Multi Value Parameter. Check whether "Select All" is selected -

reporting services - SSRS Multi Value Parameter. Check whether "Select All" is selected - i have multi value parameter in ssrs report. want find out whether (select all) checked in parameter. in other words, whether values in parameter checked or values checked. is possible? i able find out number of selected values through parameters!parameter.count. there way find out total of items in parameter? in case still having issues doing this, coded easy fix. =iif(countrows("dataset").equals(parameters!parameter.count),"it equal","this not equal") reporting-services parameters multivalue

algorithm - How to sum sequence of floors numbers? -

algorithm - How to sum sequence of floors numbers? - how can sum next sequence: ⌊n∕2⌋ + ⌊n+1∕2⌋ + ⌊n+2∕2⌋ + ...... + (n-1) what think discard floor , sum within each floor !! guess. give me hint or general formula helps me sum them thanks since you're asking on programming q&a site, must assume want computational answer. here goes... int sum = 0; (int j=0; j<n-1; ++j) { sum += (n+j)/2; } the int automatically truncate floor. the less smart ass reply this. allow n = 2k . sum becomes k + k + k+1 + k+1 + ... + 2k-1 + 2k-1 = 2(k + k+1 + ... + 2k-1) and can utilize formula 1 + 2 + ... + = a(a+1)/2 with bit of algebra finish off. algorithm sum floor

extjs4 - Panel inside my panel throwing an error - Cannot call method 'setSize' of undefined -

extjs4 - Panel inside my panel throwing an error - Cannot call method 'setSize' of undefined - here panel open: ext.define("ez.view.usefullinks.panel", { extend: "ext.panel.panel", alias: "widget.usefullinkspanel", layout: "border", border: 0, initcomponent: function() { this.sitepanel = ext.create("ez.view.usefullinks.sitepanel"); this.items = [ this.sitepanel ]; this.callparent(arguments); } }); and here panel causing error: ext.define("ez.view.usefullinks.sitepanel", { extend: "ext.panel.panel", alias: "widget.usefullinkssitepanel", region: "center", layout: "fit", initcomponent: function() { this.items= [ '<iframe frameborder="0" src="http://www.google.com" width="100%" height="100%">' ] } }); is there wrong here? i have follow initcomponent syntax. have bo...

How do I identify a tab in Magento? -

How do I identify a tab in Magento? - i want replace template comments history tab of sales - order view section of magento's admin. how identify tab , correctly reference it? i able replace template comments history section of info tab in order view using next layout update: <adminhtml_sales_order_view> <reference name="order_history"> <action method="settemplate"><template>popcap/sales/order/view/history.phtml</template></action> </reference> </adminhtml_sales_order_view> i've been using alan storm's layoutviewer module (http://alanstorm.com/2005/projects/magentolayoutviewer.tar.gz) far, can't figure out right reference path. any help appreciated. give thanks you. the easiest way turn on template hints admin area executing next query against magento db insert core_config_data (scope, scope_id, path, value) values ('default', 0, 'dev/debug/tem...

c++ - Is there a way to prevent a class from being derived from twice using a static assert and type trait? -

c++ - Is there a way to prevent a class from being derived from twice using a static assert and type trait? - i realize contrived example, want compile check prevent this... class {}; class b : public {}; class c : public {}; class d : public b, public c { boost_static_assert((is_base_of_once<a,d>::value)) }; the next should work: boost_static_assert(((a*)(d*)0 == 0)) if exists twice, should rising ambiguity error, while otherwise test succeed (because compares 2 null pointers). c++ multiple-inheritance typetraits static-assert

android - C2DM / Phonegap plugin? -

android - C2DM / Phonegap plugin? - i add together force messaging phonegap android app , believe c2dm waybest way create work - point me in right direction set up? there plugin or tutorial help this? also - need plugin - possible add together c2dm app traditional android way without messing phonegap setup? yes, c2dm android force solution. on https://github.com/awysocki/c2dm-phonegap can find illustration implementation. the files in com.google namespace have included unchanged, session "google io session overview: android + app engine: developer’s dream combination", see http://bradabrams.com/2011/05/google-io-session-overview-android-app-engine-a-developers-dream-combination/ so these steps should perform: add 3 com.google classes project create class called c2dmreceiver (naming convention) inherits c2dmbasereceiver , implement necessary abstract events set androidmanifest.xml the androidmanifest looks like <!-- set own permission secur...

c preprocessor - Can pre-build events affect the defines and the include paths of a Visual Studio project? -

c preprocessor - Can pre-build events affect the defines and the include paths of a Visual Studio project? - is possible modify list of defines/include paths passed visual studio compiler pre-build step? since not find info on this, tend think cannot. visual-studio c-preprocessor custom-build-step

how to use vim to automatically format xml tags when I press 'enter'? Should I write a plugin or modify vimrc? -

how to use vim to automatically format xml tags when I press 'enter'? Should I write a plugin or modify vimrc? - let's i'm working on html file, , cursor between open , close tags: <button>i</button > when nail enter, want vim automatically format this: <button > </button > i cursor position. i'm thinking modifying vimrc file, like: inoremap <cr> "if previous character > , next character <, <cr>o" but don't know how previous/next character of cursor. i hope makes sense, tried search everywhere couldn't find help, maybe i'm searching wrong keywords, or taking wrong approach. inoremap <expr> <cr> '<cr>' . (search('\v>\%#<','bcn') ? '<esc>o' : '') vim

android - How do I search Libraries in eclipse? -

android - How do I search Libraries in eclipse? - how include libraries in file searches within in eclipse? i'm trying include android source code library in search using ctrl+h, , can't find alternative so. instasearch eclipse plugin index , search within jars have source attachements. not enabled default can set in preferences. android eclipse

Select Dummy Boolean Column SQL / Access -

Select Dummy Boolean Column SQL / Access - hi new may have help? months :) trying select statement dummy boolean column. example: select id,name, fakecolumn booleancolumn customers how can achive ? i using microsoft access 2007 i can select dummy column returns me text column type. cast dummy column boolean type using cbool e.g. select id, [name], cbool(fakecolumn ) booleancolumn customers; sql ms-access boolean

Integrating Qt with Visual Studio (C++) in Win32Proj -

Integrating Qt with Visual Studio (C++) in Win32Proj - short summary: qt class crashes @ class construction part when calling parent qwidget constructor. error message shows: "first-chance exception @ 0x0048fca9 in myapplication.exe: 0xc0000005: access violation reading location 0x00000000." details: i'm working on project add together overlay user interface 1 client, much steam has when press "tab+shift" while game play. original application written in visual studio environment without ui stuff, , decide utilize qt job. since project pretty complex transform qt project .pro file, want utilize qt library (including lib , include folder , utilize in project). it works fine when write in c language. menu show it's not clickable. seems in order create qt event loop work, have declare custom widget class rather grouping of c functions. i added qt class project, modify include , lib folder, generate moc file, including in project. compiles when...

cocoa touch - UIView is equal to 0x0 -

cocoa touch - UIView is equal to 0x0 - i have uiview in application. have object iboutlet connected view. have checked , rechecked, , positive connected. reason, every time seek draw view in uiwindow, never draws. so, looked in debugger. showed view equal 0x0, though it's connected in ib. in addition, uiwindow equal 0x0 well, , connected. doing wrong? why iboutlets equal 0x0? thanks! are loading right nib file? cocoa-touch iboutlet

model view controller - Java: Error handling in MVC project. How correct implement? -

model view controller - Java: Error handling in MVC project. How correct implement? - for example: have webapplication based on mvc . also, app used: spring , struts 2 , hibernate frameworks. lets go on little scenario: user seek save instanse, example: bo book. so, user fill form fields , send request server: what happened on server? execute action method action.save(); inside action.save() phone call service.save() ; inside service.save() phone call daohibernate.save() ; inside daohibernate.save() phone call gethibernatetemplate().save() ; method gethibernatetemplate.save() - framework implementation, cant access method. know, if fail within method throws dataaccessexception . so, @ moment think, how right implement logging , error handling? on level? on dao level? service level? or on level struts actions? what think this? or need on each level? what best practices can recommended? here architecture: how want handle error on d...

android Date parsing -

android Date parsing - i have next string need parse date: 2012-01-31t08:41:12.5462495+01:00 now have tried next code doesn't work: public static string format_date_iso = "yyyy-mm-dd't'hh:mm:ss.sssz"; public static date fromisodatestring(string isodatestring) throws exception { dateformat f = new simpledateformat(format_date_iso); f.settimezone(timezone.gettimezone("zulu")); homecoming f.parse(isodatestring); } i assuming becase time zone should +0100 , in case +01:00. how solve this? thanks. there 2 problems: the time zone specifier the precision of seconds i haven't found easy way prepare time zone specifier part in simpledateformat , i'd tempted manipulate string - it's fixed length, it's not hard remove final colon. can utilize "yyyy-mm-dd't'hh:mm:ss.sssssssz" as format string. note according docs, joda time does handle time zone offsets using colons, that's ...

java - Trying to pass an int between two classes on Android platform -

java - Trying to pass an int between two classes on Android platform - i'm trying pass int between 2 classes using bundle. have looked online , seems should easy do, not working me :( help much appreciated! trying pass int life 1 page in simple game. here code first page passing int life = 5; .... if(input.equalsignorecase(teststr)) { intent = new intent("com.name.pagetwo"); i.putextra("com.name.pagetwo.life", life); startactivity(i); mpbuttonclick.stop(); } and on sec page, trying receive int intent = new intent("com.name.pagetwo"); bundle extras = i.getextras(); int temp2 = extras.getint("life"); int life = temp2; when seek run it, tries go on sec page , says application has unexpectedly stopped, when comment out code continues running normal, know putting in code here wrong somewhere. in advance! you're creatin...

mysql - SQL Select from multiple tables where Name contains query -

mysql - SQL Select from multiple tables where Name contains query - i have 3 tables next columns tablea name description ..... tableb name description .... tablec name description .... i want select query select name , description these 3 tables if name contains query. select name, description tablea name '%yoursearch%' union select name, description tableb name '%yoursearch%' union select name, description tablec name '%yoursearch%' mysql sql

javascript - Which is better practice for adding a class using jQuery? -

javascript - Which is better practice for adding a class using jQuery? - $("#" + parentelementid + " label").attr("class", "disabled") vs $('#radiolabel').addclass('disabled'); which pros , cons? thanks here advantages of 2 ways this: addclass("disabled") pros: if have other classes on object, addclass() preserve while adding new class. pretty much want preserve ability utilize other classes css styling reasons or mutual selector reasons addclass() makes possible add together disabled class without disturbing other classes on same object other reasons. the code reads little more self-explanatory since name addclass() tells reading code it's doing. addclass() automatically manages separators between class names there no accumulation of separators when have multiple class names can occur if current classname , add together onto string manipulation. attr("class") = ...

Scala BigDecimal how to display more decimals? -

Scala BigDecimal how to display more decimals? - first of all, aware there similar topic regarding partition of 1 3. however, code quite different , don't know how apply info given there situation. appreciate , help. i made pi calculator in scala , @ end of code print result. however, want have much larger number of decimals , don't know how accomplish that. current output : expected decimals: 34 3.141592653589793238462643383279500 here's code: package thebrain object calculator { def main(args: array[string]) { var = 100 var j = 100 var lastvalueonfirstline = j+i var array = new array [bigdecimal] (0) var counter = i-1 (d <- j lastvalueonfirstline 1) { var almostpi = bigdecimal(0) var pi = bigdecimal(0) (b <- 0 d 1) { var partialanswer = (if (b%2 != 0) {-1} else {1} )/((bigdecimal(2)*bigdecimal(b))+bigdecimal(1)) almostpi = partialanswer + almostpi } pi = 4*almostpi array = array:+pi } (z <- counter 0 -1){ var ar...

ruby on rails - Application Error on Heroku: An error occurred in the application and your page could not be served -

ruby on rails - Application Error on Heroku: An error occurred in the application and your page could not be served - have working rails app on development issue deployed. working after doing clouldmailin add together on seemed cause dependencies issues? help understanding issue in logs appreciated. 2012-01-11t23:35:07+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/ railties-3.1.3/lib/rails/application.rb:96:in `initialize!' 2012-01-11t23:35:07+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/ railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing' 2012-01-11t23:35:07+00:00 app[web.1]: /app/config/environment.rb:5:in `<top (required)>' 2012-01-11t23:35:07+00:00 app[web.1]: /app/config.ru:4:in `require' 2012-01-11t23:35:07+00:00 app[web.1]: /app/config.ru:4:in `block in <main>' 2012-01-11t23:35:07+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/ rack-1.3.5/lib/rack/build...

Hide Volume Level Pop Up MPMusicPlayerController Xcode -

Hide Volume Level Pop Up MPMusicPlayerController Xcode - i'm using mpmusicplayercontroller play list of mp3 in app. the problem when set volume level, according app configuration, appears volume level pop up. i tried find property in order hide it, didn't find. the code i'm using is: if (audioplayer) if ([audioplayer isplaying]) [audioplayer stop]; self.musicplayer = [mpmusicplayercontroller applicationmusicplayer]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(handleplaybackstatechanged:) name:mpmusicplayercontrollerplaybackstatedidchangenotification object:self.musicplayer]; [self.musicplayer begingeneratingplaybacknotifications]; [self.musicplayer setaccessibilityelementshidden:yes]; self.musicplayer.volume = volume; [self.musicplayer setqueuewithitemcollection:mediaitemcollection]; self.musicplayer.repeatmode = mpmusicrepeatmodeall; [self.musicplayer play]; my question is, way avoid pop up? thanks. ...

How to save the state of an NSPopUpButton? - Cocoa -

How to save the state of an NSPopUpButton? - Cocoa - i have been searching everywhere , not been able find , bugging me. can't figure out how save current state of nspopupbutton, if user changes it, app load state next time run app. have tried nsuserdefaults , been adding new item pop button has weird name. it sounds you've failed set initial value user default. for example, if bind nspopupbutton using "selected value" binding default "popupselection" must insure nsuserdefaults always returns 1 of nspopupbutton 's entries "popupselection". you accomplish including plist in project, "defaults.plist", contains default value wish "popupselection" (and default values wish other preferences), @ application startup load plist bundle: nsstring *defaultspath = [[nsbundle mainbundle] pathforresource:@"defaults" oftype:@"plist"]; nsdictionary *defaultsdict = [nsdictionary dictionarywithcontent...

java - Too many open files error but lsof shows a legal number of open files -

java - Too many open files error but lsof shows a legal number of open files - my java programme failing with caused by: java.io.ioexception: many open files @ java.io.unixfilesystem.createfileexclusively(native method) @ java.io.file.createnewfile(file.java:883)... here key lines /etc/security/limits.conf . set max files user @ 500k: root soft nofile 500000 root hard nofile 500000 * soft nofile 500000 * hard nofile 500000 i ran lsof to count number of files open -- both globally , jvm process. examined counters in /proc/sys/fs . seems ok. process has 4301 files open , limit 500k: :~# lsof | wc -l 5526 :~# lsof -uusername | wc -l 4301 :~# cat /proc/sys/fs/file-max 744363 :~# cat /proc/sys/fs/file-max 744363 :~# cat /proc/sys/fs/file-nr 4736 0 744363 this ubuntu 11.04 server. have rebooted positive these p...

Export data from mathematica script -

Export data from mathematica script - i writing mathematica script , running in linux batch shell. script gives result list of numbers. write list file 1 single column without braces , commas. this, tried utilize export comand as export["file.txt", a1, "table"] but error: export::infer: cannot infer format of file test1.txt i tried other format got same error. please tell wrong , can do? give thanks beforehand from understand trying export file in table, why don't seek , export["file.txt", a1, "text"] wolfram-mathematica mathematica-8

Animation queue using jQuery slider -

Animation queue using jQuery slider - i having problem animation queue when using jquery ui slider show/hide , position elements on timeline - slider seems working when go move slider fast animation gets real messy - hoping help @ to the lowest degree helping me making more smooth here code $("#content-slider").slider({animate: true, min: 0, max: 290, step: 10, change: handlesliderslide, //handlesliderchange, //start: getimagewidth, //stop: function() { }}, slide: handlesliderslide, stop:handlesliderslide}); function handlesliderslide(event, ui) { $('#devilinme').text(ui.value);$("#content-scroll").prop({scrollleft: ui.value * (maxscroll / 290) }); if (ui.value == 0) { (i=0; i<100; i=i+10){ $('#container_'+i).stop(true, true) $('#marker_'+i).stop(true, true) $('#text_'+i).stop(true, true) } } if (ui.value == 10) { (i=0; i<100; i=i+10){ $('#container_'+i).stop(false, true) $('#marker_...

Hosting a GWT Webapp in IIS -

Hosting a GWT Webapp in IIS - i trying configure asp.net web application through web.config, host gwt webapp in specific folder. i've managed configure mimemap .manifest file extension in system.webserver/staticcontent section however, i'm stuck clientcache. want add together caching rule files ".nocache." served next headers: "expires", "sat, 21 jan 2012 12:12:02 gmt" (today -1); "pragma", "no-cache" "cache-control", "no-cache, no-store, must-revalidate" anyone knows how within iis 7+ ? the file time stamp automatically checked in iis , browser requests server updated file based on timestamp, .nocache. files don't need special in iis. however if wanted browser cache .cache. files next httpmodule sets cache expiration date 30 days files end in .cache.js or .cache.html (or extension). browser won't request updated versions of these files. using system; using system.collections...

git - Only fetch commit history? -

git - Only fetch commit history? - is somehow possible fetch commit history remote repository? i've tried pass --bare alternative when cloning, seams download content well. would possible utilize scp on ssh protocol? i want able to run git shortlog -se in end. work repos services github. as far know, there no such alternative in git itself. using git protocols, should able retrieve commit objects, not trees or blobs. mean understanding how git works , using libgit2. another, , easier, alternative utilize the github api, repo commits api. obviously, work repos hosted on github. git ssh

android - Button is not clickable after TranslateAnimation -

android - Button is not clickable after TranslateAnimation - i'm trying move button (with animation) upon click. want move 100 pixels bottom on first click, 100 pixels on second, 100 pixels bottom on 3rd , on. have simple layout file (main.xml): <?xml version="1.0" encoding="utf-8"?> <button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="press begin animation" /> my launching activity follows: public class testactivity extends activity { public final string tag="testactivity"; boolean totop=false; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); button b=(button)findviewbyid(r.id.button); b.setonclicklistener(new onclick...

interface - Netbeans - How do I hide the vertical bar w/colors? -

interface - Netbeans - How do I hide the vertical bar w/colors? - haven't found alternative in ide hide it, there configuration files it? never utilize it, , in effort optimize screen space multiple tab groups, save me pixels. :-p here's bar in question: http://i.stack.imgur.com/inwum.png i believe referring diff sidebar. remove utilize menu item located @ view > show diff sidebar. menu item toggled menu item when active there check beside it. netbeans interface

javascript - Upload Image to localStorage -

javascript - Upload Image to localStorage - i'm curious if it's possible upload image straight localstorage (for chrome extension). yes. but store image there, not upload it. you should careful image size. safe maximum size around 500 kb, , around 2mb guaranteed crash, when effort load it. javascript google-chrome base64 local-storage

Javascript webpage expect to at least load a map, but actually can't load anything -

Javascript webpage expect to at least load a map, but actually can't load anything - below html page embedded javascript. map api key valid web domain, , page can load map if hide javascript functions , left initialize() there, google's official illustration code, otherwise see nil after page loaded(i.e. blank page). can help me find reason why? thanks! <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>real-time iphone tracker</title> <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abqiaaaazcrhlfuxvqmbi3qyky87zhstzvktwp4txcazpl7xj82pgpeoixsavcidel2ro_s1xloggxkbpbg6hq&sensor=true" type="text/javascript"></script> <script type="text/javascript"> var xmlobj; function createxmlhttprequest(){ if(window.activexobject) { homecoming new activexobject("microsoft.xmlhttp"); ...

Mysql fulltext search, include date into rank -

Mysql fulltext search, include date into rank - is possible include date search rank in way? update, expand question right doing following, using ln of datediff multiplier add together weight current news: select title,description,full_text,created, match(title,description,full_text) against ('patient molecular')*1/ln(datediff(now(),created)) rank articles match(title,description,full_text) against ('patient molecular')*1/ln(datediff(now(),created)) order rank desc but maybe there way include date rank native way? mysql

wcf - Interfaces in contract on client -

wcf - Interfaces in contract on client - i have such contract: [datacontract] [knowntype(typeof(person))] public class gadget { [datamember] public int id { get; set; } [datamember] public string name { get; set; } [datamember] public iperson person { get; set; } } it represents gadget belongs person. came simple example, it's not of import whether makes sense or not. so, instead of returning person class, homecoming iperson interface. client can no longer generate strong typed object, generate this: public object person { get; set; } now question is: possible allow client generate iperson interface? should have plenty information, because can instantiate person (only known type). interfaces not transfered adding service reference. these interfaces exist in .net, service suppossed interoperable. as far wsdl concerned there no way tell person , iperson apart. if want utilize interface need move across manually. means ed...

python - Random Tetris Shape -

python - Random Tetris Shape - i trying write python programme draw random tetris shape onto board. here's code: def __init__(self, win): self.board = board(win, self.board_width, self.board_height) self.win = win self.delay = 1000 self.current_shape = self.create_new_shape() # draw current_shape oan board self.current_shape = board.draw_shape(the_shape) def create_new_shape(self): ''' homecoming value: type: shape create random new shape centered @ y = 0 , x = int(self.board_width/2) homecoming shape ''' y = 0 x = int(self.board_width/2) self.shapes = [o_shape, t_shape, l_shape, j_shape, z_shape, s_shape, i_shape] the_shape = random.choice(self.shapes) homecoming the_shape my problem in "self.current_shape = board.draw_shape(the_shape). says the_s...

android - Proguard giving me random errors -

android - Proguard giving me random errors - so, out of bluish error message. description resource path location type obsolete proguard file; utilize -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg /think fast line 1 android lint problem and have no thought did wrong. publish app , random error. have never messed file. here file proguard: -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -keep public class * extends android.app.activity -keep public class * extends android.app.application -keep public class * extends android.app.service -keep public class * extends android.content.broadcastreceiver -keep public class * extends android.content.contentprovider -keep public class * extends android.app.backup.backupagenthelper -keep public class * extends android.preference.preference -keep publ...

ios - Call SEL(selector) of a class in iPhone? -

ios - Call SEL(selector) of a class in iPhone? - i have class in calling method(with sel parameter) of class follows // class 1 +(ccscene *) scene { // 'scene' autorelease object. ccscene *scene = [ccscene node]; // 'layer' autorelease object. helloworldlayer *layer = [helloworldlayer node]; // add together layer kid scene [scene addchild: layer]; // returns cclayer object id myclasslayer = [myclass objwithbackgroundsprite:objbackground withrect:cgrectmake(160,100, 300,120) atpoistion:pos_top]; sel callonclick; [myclasslayer addbuttonwithimage:buttonbackground selector:callonclick withdisabledimage:disabledbackground]; [scene addchild: myclasslayer]; // homecoming scene homecoming scene; } // class 2 -(void)addbuttontohudwithimage:(nsstring *)imagename selector:(sel)selector withdisabledimage:(nsstring *)disbdimagename { ccmenuitem *menuitem1 = [ccmenuitemimage itemfromnormalimage:imagename selectedimage:imagename disabledimage:disbdimagename tar...

jpa 2.0 - Bind specific parameter (one) in JPQL -

jpa 2.0 - Bind specific parameter (one) in JPQL - in database have partitioning table column 'status' improve performance. database administrator inquire me set in query value column straight in sql (not bind parameter). i can alter binding set hint queryhints.bind_parameters on false, parameters within sql. can set not bind on 'status' parameter ? example result when bind_parameters = true select t0.* s_jobs_org_unit_cfg t0 ((((t0.org_id = ?) , (t0.scheduler_next_activation < sysdate)) , (t0.active = ?)) , not exists (select ? s_jobs t1 (((t1.order_id = t0.order_id) , (t1.org_id = t0.org_id)) , not ((t1.status = ?)))) ) bind => [472100, y, 1, e] and result when bind_parameters = false select t0.* s_jobs_org_unit_cfg t0 ((((t0.org_id = 472100) , (t0.scheduler_next_activation < sysdate)) , (t0.active = y)) , not exists (select 1 s_jobs t1 (((t1.order_id = t0.order_id) , (t1.org_id = t0.org_id)) , not ((t1.status = e)))) ) code: ...

How to stop 403 and 404 http errors from facebook bots and/or refresh share cache -

How to stop 403 and 404 http errors from facebook bots and/or refresh share cache - i'm getting lots of 403 , 404 errors facebook bots after changing directory construction on server few weeks ago. of course, such errors should expected in situation until cache clears, , has happened in cases. however, i'm still getting error select grouping of share links. i've tried repeatedly clear cache through debug tool corresponding pages, , looks perfect in output, bad requests maintain coming. (lint tool: lint tool url). here examples logs: http access log: 69.171.224.251 - - 443 [13/jan/2012:06:22:01 -0500] "get /web/user/images/b0/b0ahhsjq1c1oex0tbs5glamcsx4wkdpt.240.jpg http/1.1" 403 338 and http error log: [fri jan 13 05:55:01 2012] [error] [client 69.171.228.249] file not exist: /var/xxx/www/html/web/user/images/1/ab/absiktlhds3rcupyyftxsp8j9u7vvavr.240.jpg these ip addresses point facebook. perhaps linting wrong url? how can find out ur...