Posts

Showing posts from April, 2015

Is there away to make CSS animations and gradients work across all browsers? -

i trying make css3 animations work across browsers @ minute getting work on web kit browsers. here code: h1 { font-family: 'bebasregular', sans-serif; font-size: 150px; padding-bottom: 100px; padding-top: 50px; background: #e9ab17 -webkit-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat ; -webkit-background-size: 75px 200px; color: rgba(255, 255, 255, 0.1); -webkit-background-clip: text; -webkit-animation-name: shine; -webkit-animation-duration: 5s; -webkit-animation-iteration-count: infinite; text-align:center; } i have since added code , still having problems. h1 { font-family: 'bebasregular', sans-serif; font-size: 150px; padding-bottom: 100px; padding-top: 50px; background: #e9ab17 -webkit-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), color-stop(0.5, #fff)) 0 0 no-repeat ; background: #e9ab17 -moz-gradient(linear,left top, right top, from(#e8a917), to(#f4b011), ...

oracle - Dynamic query to dynamic data -

i new oracle database, trying execute following query select o.id ovaid , (case when(select count(m.cid) ovamapper m m.id = o.id , m.solutionid = 1)>0 1 else 0 end) sol1, (case when(select count(m.cid) ovamapper m m.id = o.id , m.solutionid = 2)>0 1 else 0 end) sol1, (case when(select count(m.cid) ovamapper m m.id = o.id , m.solutionid = 3)>0 1 else 0 end) sol1 ovatemplate o order o.id instead of static values solutionid , select other table. any on appreciated you use join to table contain solutionid. ex select * ovatemplate join solutiontable on (solutiontable.ovaid=ovatempate.ovaid) after that, change static values solutionid

ruby on rails - How to exclude a collection of records with ActiveRecord? -

i have following: = select :client, :id, user.all.map {|u| [u.username, u.id]}, include_blank: "add client username" i'd exclude records user.all match current_user.manager_users . point select box doesn't show users added manager_users array has_many collection. you that: = select :client, :id, user.where("users.id not in (?)", current_user.manager_users.pluck(:client_id)).map {|u| [u.username, u.id]}, include_blank: "add client username" the new stuff here: user.where("users.id not in (?)", current_user.manager_users.pluck(:client_id)) .map{ |u| [u.username, u.id] } the current_user.manager_users.pluck(:client_id) part retrieve (only on db-level) client_ids of manager_users linked current_user. hope helps!

What APIs can I use to make a speech recognition program for windows and raspberry pi? -

i want make program uses speech recognition basic commands. want develop , able run in windows, want able run on raspberry pi, using linux or freebsd (probably linux.) apis available? have heard of google having 1 don't know find it, , not sure how works, , microsoft has one, think windows specific. thank you. you can try cmusphinx, it's used on linux, in particular on low-resource computers raspberry pi , on windows. for more details on using cmusphinx see tutorial .

unable to edit css with javascript -

i trying edit form these simple testings: <span id="a">30 <span id="aa" style="display:none;"><input type="text" id="aa" name="q"/></span></span> <span id="cq"><a href="javascript:changeqty()">change</a></span> <span id="cq2" style="display:none"><a href="javascript:save()">save</a></span> <script> function changeqty(){ document.getelementbyid("a").style.display="hidden"; document.getelementbyid("aa").style.display="inline"; document.getelementbyid("cq").style.display="hidden"; document.getelementbyid("cq2").style.display="inline"; } </script> but strangely,my attempt hide fields not working. can view hidden fields when click on change link. whats wrong doing ? there no ...

Idea on how to create a C function that takes a character string and returns a character string with date and time -

i'm pretty new c , write function takes character string , returns character string current date , time in front. need logging function don't want print directly output stream. #define time_format "[%y-%m-%d %h:%m:%s] " char *logmsg(char *msg) { char timestr[23]; time_t tms; struct tm *localtime; tms = time(null); localtime = localtime(&tms); strftime(timestr, sizeof(timestr), time_format, localtime); int lenmsg = strlen(msg); int newlen = sizeof(timestr) + lenmsg + 1; char *newstr; newstr = (char *) calloc(newlen,sizeof(char)); strcat(newstr,timestr); strcat(newstr,msg); return newstr; } i know bad idea allocate new memory every time call function functionality want. don't want limit message predefined length. just idea or design pattern helpful. lot! the right answer depends on intend function. can presume, using function create log string, use several times in program. going approach have currently, code lit...

linux - Is there any configure file read/write C code generator? -

i know how generate c scanner code flex or bison, unluckily, need c code read && -write- configure file, can not generate such code flex or bison, may can use configure file read/write library, think it's not flexible when want custom format of configure file, tips? i know of no such dedicated tool that, because it's not hard job. the reason have lexical , semantic analysis on input because have turn complex (free form text possibility of errors) simple (in-memory representation no errors). going other way simpler because can step through in-memory structures , output string representations. simplified example, let's config file has line: define xyzzy integer size 5 1 3 5 7 9 ; to create array called xyzzy 5 elements. on input, have tokenise (lexical analysis) character stream like: keyword:define name:xyzzy keyword:integer keyword:size constant:5 keyword:is constant:1 constant:3 constant:5 constant:7 constant:9 keyword:semicolon and use...

listview refresh aynctask in android -

i unable refresh listview. know there lots of available this. unable listview refreshed. lemme edit code little bit showing asynctask there 2 activities. first activity having list view see being shared , second activity has edit text box (to input inorder share) , button. on clicking button, returns me string json response , need add in previous activity. now problem is, when refresh first page hitting server gets response not want. should not go server. should add in list view adapter. i have commented code in postexecute(). have tried everyway not reflecting. public class shareasynctask extends asynctask<string, void, arraylist<eventsstreambean>> { public progressdialog pd = new progressdialog(eventstreamactivity.this); string success_share_val; @override protected arraylist<eventsstreambean> doinbackground( string... result) { // todo auto-generated method stub jsonobject jsonobj = new jsonobject(resul...

Single Sign-on VS Reduced Sign-On -

by using single sign-on, users can login once , gains access systems without being prompted login again @ each of them. how reduced sign-on works? aim of reduced sign-on , uses? reduced sign-on adds verification mechanism on top of kerberos. reduced sign on: concept handles above scenario prompting set of verification when try access critical applications. layer of authentication 1 of below list: 1) challenge question 2) digital certificate 3) hardware token number 4) smart card 5) biometrics reducing users' sign-on complexity problems requires balance between user satisfaction , security. if scale swings far toward security when trying prevent breach, user satisfaction decreases. similarly, if scale swings toward user satisfaction, can compromise security. see here full details.

dom - Insert HTML into text node with JavaScript -

i've got little text node: var node and want wrap span around every occurrence of "lol". node.nodevalue = node.nodevalue.replace(/lol/, "<span>lol</span>") it prints out "<span>lol<span>" when want "lol" span element. you may need node parent node, way can use innerhtml: node.innerhtml=node.childnodes[0].nodevalue.replace(/lol/, "<span>lol</span>"); here node.childnodes[0] refers actual text node, , node containing element.

visual c++ - How can i get a setMethod to input value one time, while being in a loop? is it impossible? -

a loop has setmethod private variable. want set-method add value in first turn of loop, , stop. how can that? code: for(int x = 0; x > 5; x++) { setnum(5); cout << getnum(); setnum(getnum() -1); } this code should output: 1 2 3 4 5 but when doing it outputs: 5 5 5 5 5 setnum(5) resetting. how prevent it? setnum(5) inside loop. insted of > put x < 5 , pass x parameter setnum() method. for(int x = 0; x < 5; x++) { setnum(x); }

svg - Adding background image to markers in jvectormap -

found couple of solutions here adding svg patterns dynamically doesn't seem work jvectormap. think problem may there no xmlns attribute defined on <svg> tag jvectormap attempt add these attributes not work. i tried changing of setattribute setattributens pattern , image . no dice. here attempt (based on solution: how dynamically change image pattern in svg using javascript ): // set namespace svg elements. var svgmap = $('.jvectormap-container > svg').get(0); var svgns = 'http://www.w3.org/2000/svg'; var svgnsxlink = 'http://www.w3.org/1999/xlink'; svgmap.setattribute('xmlns', svgns); svgmap.setattribute('xmlns:link', svgnsxlink); svgmap.setattribute('xmlns:ev', 'http://www.w3.org/2001/xml-events'); // create pattern markers. var pattern = document.createelementns(svgns, 'pattern'); pattern.setattribute('id', 'markeryellow'); pattern.setatt...

symfony - How to create list field type in sonata admin -

i'm using symfony 2.3 , newest sonataadminbundle. it's possible create editable fields in list view sonataadminbundle? best practice? try this: $listmapper ->addidentifier('title') ->addidentifier('artist') ->add('createdate') ->add('changedate') ->add('missing', null, array('editable' => true)) ->add('_action', 'actions', array( 'actions' => array( 'view' => array(), 'edit' => array(), 'delete' => array() ) )) ; notice array('editable' => true). booleans works, i'm not sure other fields.

asp.net - Expose few property of class at runtime in WCF service -

i have class ex user class in wcf service, in have 10 properties fname, lname, servicestatus, errormessage etc. now there method in service retrieve user info giving valid json input , gives output in json format (here exposing user class object). now problem: - when expose user class got properties in json output. there few cases don't want expose properties. in cases want expose 2 properties, or in few cases properties. want make json output more clear. is possible in wcf? please help. either don't put [datamember ] attribute or add [ignoredatamember] attribute property not want expose.

shell - Deleting log directories of a particular timestamp in UNIX -

i want delete directories 5 days old, based on directory name, instead of unix timestamp. let assume directories created test_2013-05-20-12:23:43 , on. i want delete directories 5 days older, i.e before 16th. is possible do? if not specific file name criteria use this find /path/to/files* -mtime +5 -exec rm {} \; note there spaces between rm, {}, , \; explanation the first argument path files. can path, directory, or wildcard in example above. recommend using full path, , make sure run command without exec rm make sure getting right results. second argument, -mtime, used specify number of days old file is. if enter +5, find files older 5 days. third argument, -exec, allows pass in command such rm. {} \; @ end required end command. read link more info

objective c - Managing the memory for an object passed in to an in-out argument -

i wonder how memory management must done method parameters used pass values method , (optionally) return updated values method. for example, -validate<key>:error: method in kvc has (id *)iovalue parameter can updated method. can return autoreleased object should input object when updating? there conventions case? there isn't particularly complex replacing object reference new object, taking nil reference , making valid when object first created. if using arc compiler realise old reference has been replaced, in other situation. if using mrr required observe normal retain / release conventions in order avoid memory leak.

How to use django class based views for sending json consist of different model querysets -

i have implement autocomplete search 2 different models "destination , regions", should send json response template according query results consist of 2 different querysets. do think view should use in case? can offer best practice here ? you build mixin use in listview . piggyback on various listview features pagination / model / qs creation. not different building plain generic.base.view though! from django.core import serializers class ajaxlistmixin(object): def dispatch(self, request, *args, **kwargs): if not request.is_ajax(): raise http.http404("this ajax view, friend.") return super(ajaxlistmixin, self).dispatch(request, *args, **kwargs) def get_queryset(self): return ( super(ajaxlistmixin, self) .get_queryset() .filter(ajaxy_param=self.request.get.get('some_ajaxy_param')) ) def get(self, request, *args, **kwargs): retur...

mysql - Composite Unique Index created on each deploy -

i'm using spring 3.2 hibernate 4.2.1.final , mysql 5.5. each time reload webapp hibernate creates new composite unique index of entities. for example in entity have: @table(uniqueconstraints = { @uniqueconstraint(columnnames = { "field1", "field2" }) }) on each deploy have new unique index on 2 field. is bug? thank marco you have give name of composite unique index key eg: @table(uniqueconstraints = { @uniqueconstraint(name="field1_field2_unique_key", columnnames = { "field1", "field2" }) }) here composite unique index key name : field1_field2_unique_key

java - Failed to Start Apache tomcat from eclipse juno in linux at port 80 -

at window platform have run tomcat eclipse juno. @ linux face problem when run web project eclipse got error message, while command line can able run tomcat. error message - port 80 required tomcat v7.0 server @ localhost in use. server may running in process, or system process may using port. start server need stop other process or change port number(s). i check port using nmap , other command the main point when run tomcat command line start, when start eclipse got error first, check again whether port indeed in use. believe have apache web server (httpd) taking port. second, on linux processes running under root user can use lower ports (under 100). when run tomcat command line run root (e.g. using sudo), when running eclipse running under user. the solution is: development use other port. e.g 8080 . for production: use special user account (not root) run tomcat. e.g. user named tomcat . configure listen port 8080. run apache web server (httpd)...

Numeric Search Box in Fusion Table with Mutliple Layers -

how doing? i'm complete fusion tables api novice , stuck set-up of search box. here's question: goal: create map shows location of american football teams , location of american football fan clubs in belgium. what i've done far: week i've started create map using 2 different overlays (coming 2 different fusion tables: 1 'clubs' table american football teams , 1 'fans' table american football fan clubs). i've implemented 2 checkboxes can turn each layer on , off. where stuck: number of fan clubs start grow in belgium, add search box gives me possibility display fan clubs @ least x number of members. this "filter" of course apply single 'fans' layer , 'teams' layer need remain unchanged. in 'fans' fusion table i've got column number of members per fan club. question: there way build such 'search box' filter if type "50" in search box display fan clubs @ least 50 members? (so ...

design patterns - How to add \n and delete space from perl regular expression -

i tried add \n output source: sub fileresult{ open $file; @listoffiles; while (<$file>) { if (m/^\s+ (\w+)/x) { push @listoffiles, $1; } } close $file; open $fh, '>', ".\input.txt" or die "cannot open input.txt: $!"; print $fh join "\n", "@listoffiles"; } close $fh; output like: a b c i want like: a b c without space @ begining of word , end of word. perhaps don't want substitute nothing , match it, m/^\s+ (\w+)/x instead of s/^\s+ (\w+)/x/ also can't see place print them, insert newlines between items, like: print join "\n", @listoffiles; or do { local $" = "\n"; print "@listoffiles" };

html5 - how to use Cordova with Jquery Mobile -

i want use cordova 2.7.0 cross platoform browser based mobile application using jquery mobile frame work. i new phone gap , jquery. i have downloaded cordova 2.7.0 phonegap. but how cordova-2.7.0.js file , wher loaded , how installed. using want use geolocation api in cordova. please advice add js file in of index.html: <script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script> do same jquery mobile file. regards, daniel

function assign to variable in C -

why following code return error when variable declared global. int add(int x, int y) { return x+y; } int ab = add(10, 20); int main(void) { printf("%d", ab); } but if call this: int add(int x, int y) { return x+y; } int main(void) { int ab = add(10, 20); // variable declare inside main printf("%d", ab); } then executes without error. initializers global variables must constant , can't arbitrary expression.

sql - MySQL update bigint field -

how update mysql database bigint field? currently our database has bigint(196605) field generating errors. pretty sure field limit 250 i.e. bigint(250) explains errors being generated. the field stores integer values 3 digits e.g. 100, not sure why bigint. in case, need fix field without loss of data. any appreciated! this common confusion ... bigint type has fixed size stored on 8b only difference between bigint(1) , bigint(20 ) number of digits gonna displayed 1 digit respectively 20 digits . if store 3 digits numbers ,and not think need more can use smallint unsigned type takes 2b instead of 8b save lot of space , performance increase. i suggest read this first.

java - Storing in Array from methods -

im trying double in array. question have store results user input in array. example, ask user initial population, first day , increase rate. calculate increase in population. meant store increase in population in array, can help? stuck. heres code: public static void main(string[] args) { scanner kd = new scanner(system.in); double temppop, temprate; int tempday; double growth; system.out.println("enter population: "); temppop = kd.nextdouble(); system.out.println("enter days: "); tempday = kd.nextint(); system.out.println("enter rate: "); temprate = kd.nextdouble(); final double scores = tempday; double scores [] = new double[(int) scores]; for(int = 0; < scores; i++) { scores[i] = getrate(temppop, tempday, temprate); system.out.println(scores[i]); } } public static double getrate(double temppop, int tempday, double temprate) { double popul, pops = 0; (...

web - Image change on click in jquery -

am using below code. have 2 images. plus , minus. on click of plus image should change minus. here image not changing. <script type="text/javascript"> $(document).ready(function () { $("#plus").click(function () { if ($('#divreg').is(":hidden")) { $('#divreg').show(500); document.getelementbyid('plus').src = "~/styles/min.jpg"; } else { $("#divreg").hide(500); document.getelementbyid('plus').src = "~/styles/plus.jpg"; } }); }); without seeing html via jsfiddle or similar see 1 problem. using server url as: ~/styles/min.jpg this parsed asp.net runtime , not jquery image path incorrect. change path test , see if works. if not, have other errors , should create test case on jsfiddle more help.

mysql - Searching datas with LIKE on result of CASE -

i want use sql syntax filter results of db outputs. firstly retrieve data want using case , when coditions. below... , case when acc.account_type = 1 bnk.description1 when acc.account_type = 2 bnk.description2 when acc.account_type = 3 bnk.description3 end item and , want check syntax on outcomes. acc.record_del_flg = 0 , item '%%' there have been thrown mysql exception.. unknown column 'item'. question how ? in advances everybody. please me how figure out. you can't use alias created on same level of where clause. hvae 2 choices, one, wrap in subquery select * ( select ...., case when acc.account_type = 1 bnk.description1 when acc.account_type = 2 bnk.description2 when acc.account_type = 3 bnk.description3 end item tablename ) x x.item '%%' second, use whole expression on where clau...

tfs2012 - TFS 2012 - How to make members of different teams have different current iterations? -

we have implemented tfs 2012 , have been using while now. have situation 2 teams work on same tfs project different iterations. though easy achieve it, 1 thing not solve: possible have 2 current iterations? mean each team have different iteration current? thanks, ademar well u can have 1 current iteration each project, u can assign iteration each team tfs project administrator console u can choose "set team's backlog iteration". choice u give selected team access iteration , wich hirachigly beneath it. works area's aswell. hope you for explaination see blog: blog rene van osnabrugge

asp.net - Custom Exception class doesn't work -

why classes inerithes system.exception don't work in try catch block? the following snipped doesn't fire catch block try { int = 3; int b = 0; int c = a/b; } catch (customex er) { console.write(er.message); } public class customex:exception { } the code provided cannot work because division throws dividebyzeroexception , you're catching customex inherits exception not dividebyzeroexception .

Error in reading hdf file using h5py package for python -

i want extract data hdf files downloaded modis website. sample file provided in link. reading hdf file using following lines of code: >>> import h5py >>> f = h5py.file( 'myd08_m3.a2002182.051.2008334061251.psgscs_000500751197.hdf', 'r' ) the error getting: traceback (most recent call last): file "<pyshell#3>", line 1, in <module> f = h5py.file( 'myd08_m3.a2002182.051.2008334061251.psgscs_000500751197.hdf', 'r' ) file "c:\python27\lib\site-packages\h5py\_hl\files.py", line 165, in __init__ fid = make_fid(name, mode, userblock_size, fapl) file "c:\python27\lib\site-packages\h5py\_hl\files.py", line 57, in make_fid fid = h5f.open(name, h5f.acc_rdonly, fapl=fapl) file "h5f.pyx", line 70, in h5py.h5f.open (h5py\h5f.c:1640) ioerror: unable open file (file accessability: unable open file) i have tried several other hdf files different sources getting same error. ...

c# - URL to specific Instance of WebRole in Windows Azure -

i have webrole in windows azure deployment few instances. in roles lot of caching. client asks everytime instance specific information, maybe not stored on requested instance. cached informations got "instance"-property, can route request in cloud specific instance (via internal endpoints). is there way url instance , not deployment? like: instance1.mydeployment.cloudapp.net? i think helpful. thank you. yes, there is. i'm not sure sdk came in, in csdef file can alter normal endpoints section this <endpoints> <inputendpoint name="endpoint1" protocol="http" port="80" localport="80" /> <instanceinputendpoint name="endpoint2" localport="80" protocol="tcp"><!--localport must 80 work--> <allocatepublicportfrom> <fixedportrange min="10016" max="10020"/> <!--make range covers # instances might need ...

css - Image width inline IE conditional comments -

i use different image inline width property when html page viewed in outlook. i believe way around using ie conditional comments, this: <img src="myimage.jpg" <!--[if !mso]><!-->width="600"<!--<![endif]--><!--[if mso]><!-->width="300"<!--<![endif]--> /> but doesn't seem working , doesn't render image @ in browser. seems using conditional comments within inline element doesn't work. any ideas?

https://bigquery.cloud.google.com/ not connected. retrying -

i trying work out query access google analytics api. not developer , progressing via developer route not option (notes - https://developers.google.com/analytics/devguides/reporting/core/v3/coredevguide ). i have been looking @ setting bigquery, struggling check can query in web interface because not load me. i logged in account using access our company url (i can access using ga interface). i can query http://ga-dev-tools.appspot.com/explorer/ interface successfully. what doing wrong? need go whole hog , set bigquery billing (i hesitant since want prove concept first). regards tristan if cannot access https://bigquery.cloud.google.com/ , work system administrator verify have network connectivity web site. if can access bigquery ui , can follow sign bigquery instructions enable ui you. not need sign billing run few queries on public sample tables, need sign billing if want load own data system , increase query quota limits. as bigquery integration google...

Ssrs 2008 dynamic columns returned by procedure -

in ssrs if there uncertain number of columns returned store procedure , if have dates column name s can per selection criteria of report,eg columns can name,[2013-05-03],[2013-05-04],[2013-05-05], on etc . how can show these columns in report. ssrs runs queries fmtonly option on populate list of columns. in other words, doesn't play nice dynamic columns because non-deterministic. comes down design issue data. 1 solution have procedure pivots columns row. allow pass data report processing. if there other obstacles preventing converting data, question post along more details.

html - Adjusting screen size for just one page in jQuery mobile -

i'm having problem adjusting size of 1 of pages in application. while i'm using <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi"/> for setting "normal" size of pages want adjust width of specific page because shows wider image. when i'm trying adjust like <div date-role="page" id="organigram" style="min-width:1000px;"> or through css: #organigram > .ui-page { min-width: 1000px; } it sets width of pages until visited specific 1 image. when i'm moving through "back" or "home"-button in page-header sizes normal (device-width) , page image stays new min-width. it's useless me way. tried change width of image inside page results in no width change @ all. ideas? if additional code needed i'll provide it. in advance! /edit: found work around using javascri...

How do you configure Qt Creator to use both Qt4 and Qt5? -

i download qt creator 2.7.0 (based on qt 5.0.2 (64 bit)). seems compile qt5. i know can download qt4 sdk, how can configure projects use qt4 instead if need to? please provide detailed instructions. i'm on ubuntu , not using repository supplied qt tools/libraries. answer: download qt4, compile (if necessary) in menu tools->options->build & run->qt versions, add qt4 manually similar qt5 config. need path qmake file. go kits tab in same options box, , add manual qt 4 kit. can change kit available app via projects tile , add kit button. add qt4 kit, remove qt5 kit, rebuild all. simple. ref: http://doc.qt.io/qtcreator/creator-targets.html

osx - NSOutlineView selected item move -

Image
i have nsoutlineview has 2 groups , select 1 item when init. when click headercell , let 1 group collapse , other expand, selected item moves next group. why happen? how can improve , make selected item not move? update: happens when cell move outside nsoutlineview .so guess problem cell reuse. update: before after: update: problem nsoutlineview 's index of row changes when outlineview collapses or expands.

html - How to align input text field in div by vertically? -

there following html code: <div id="top"> <div id="search"><h2 id="title">tasks</h2><input type="text" id="key-words-search"/></div> <div id="controls"> <?php echo chtml::link('button 1', array('add'), array('id'=>'add-vacancy', 'class'=>'button-style')) ?> <?php echo chtml::link('button 2', array('add'), array('id'=>'add-vacancy', 'class'=>'button-style')) ?> </div> </div> i'd align input text field in "search" div vertically. how can it? in advance. the best , compatible way use margin-top. example: <html> <head> <style type="text/css"> input { height:50px; margin-top:25px; } div { ...

multithreading - Asynchronously add views to fragment in Android -

i trying create fragment @ beginning show progressbar, other thread call function bring information (the information brought remote server - takes few seconds) populate views added fragment. have tried add views fragment got exception can't change ui on threads not on main thread. run on ui thread, here problem ui stacked until moment information brought server. here code: public class mainsalepage extends sherlockfragment { protected view manesalepage; protected list<saleobj> salelist; protected int numberofsalesonscreen; protected linearlayout saleconteiner; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { manesalepage = inflater.inflate(r.layout.main_page_fragment, container, false); numberofsalesonscreen = 0; saleconteiner = (linearlayout) manesalepage.findviewbyid(r.id.salescontainer); getactivity().runonuithread(new runnable() { ...

classloader - embedded Jetty in Eclipse RCP -

i have problem embeding jetty eclipse rcp application. in rcp application, when user click button, browser opened , jsp page shown. jsp files in separated directory, web application, can run in tomcat well. i have managed in main() method this: import org.eclipse.jetty.server.server; import org.eclipse.jetty.webapp.webappcontext; public class simplestserver { public static void main(string[] args) throws exception { int port = 8080; server server = new server(port); string webapp = "d:/workspace/preview"; webappcontext context = new webappcontext(); context.setdefaultsdescriptor(webapp + "/web-inf/web.xml"); // ------- // sorry! add question in 1 post, think might clue // if not use setdefaultsdescriptor, got error this: // java.io.filenotfoundexception: d:\bv\eupgrade\testenv\eclipse4-2\org\eclipse\jetty\webapp\webdefault.xml // why not go web.xml, goes path like: org\eclipse\jetty\web...

ajax - Cross origin OAuth authentication with ServiceStack -

i use api website authentication & authorisation of users , ideally keep ui site purely static content (html, js, css). have configured servicestack's oauth & openid (and credential/basic) providers, answer api.mysite.com/auth/{provider} requests i able users of www.mysite.com able authenticate , make calls api site via ajax. the bootstrapapi example project - although useful - demonstrates api & website running on same domain. is possible/secure static javascript client? could share cookie between sub-domains? could return access token client , have use calculate authorization header before each request? to address questions - is possible/secure static javascript client? yes could share cookie between sub-domains? yes could return access token client , have use calculate authorization header before each request? sure may use built in auth cookie. it's matter of setting cookies on top level domain, similar what's shown @ serv...

html - Is there a way to thicken a form legend underline? -

i want bootstrap legend's underline more thick. override twitter bootstrap css. is possible? yes can. legend { border-bottom:10px solid #000000; } to further increase/decrease thickness, can increase/decrease pixels in border-bottom . hope helps.

Driver INF File: Identifying supported OS Architecture from driver inf file -

i trying parse inf file of drivers in code identify os architecture supported them. i'm referring "inf manufacturer section" link: http://msdn.microsoft.com/en-us/library/windows/hardware/ff547454(v=vs.85).aspx i have driver inf file has manufacturer section as: [manufacturer] %hsd%=hsd,ntamd64 according manufacturer section documentation given in above link, inf model section name must decorated supported architecture , hence, "ntamd64" suggests driver valid 64-bit windows operating system. "hsd" suggest? which operating system refer to? how indentify this? hsd section identifier, has nothing target os. ntamd64 indicates os.

Multi-mode XML processors for Java and/or Scala -

one of benefits of using jackson json processing is: all modes [i.e. streaming, tree, , binding java objects] supported, , best of all, in such way easy convert between modes, mix , match. example, process large json streams, 1 typically starts streaming parser, uses data binder bind sub-sections of data java objects: allows processing of huge files without excessive memory usage, full convenience of data binding. are there xml processors java or scala support scenario? maybe want check out smooks http://smooks.org hth

asp.net - Oracle Database client error -

i have 64bit windows , have visual studio 2012 64bit. have installed 64-bit oracle client, getting message when try connect database server.. attempt load oracle client libraries threw badimageformatexception. problem occur when running in 64bit mode 32 bit oracle client components installed @ dataobjectsupport(721,6) any solutions? visual studio ide (at least 2012 , below) 32bit, not 64bit. if check path, runs from: "c:\program files (x86)\microsoft visual studio 11.0\common7\ide\devenv.exe" not, "c:\program files\microsoft visual studio 11.0". therefore, connect oracle database ide itself, need 32bit client installed (in addtion 64bit client, if need x64 apps).

sql server - Got unexpected value in TDS response at offset -

i using java, hibernate, sqlserver 2008 r2, jboss , getting exception, warning [com.microsoft.sqlserver.jdbc.internals.tds.reader] (pool-26-thread-7) connectionid:4 tds header contained invalid packet length:12590; packet size:8000 2013-05-21 15:59:15,777 severe [com.microsoft.sqlserver.jdbc.internals.tds.reader] (pool-26-thread-7) connectionid:4 got unexpected value in tds response @ offset:7992 2013-05-21 15:59:15,808 error [stderr] (pool-25-thread-2) exception in thread "pool-25-thread-2" 2013-05-21 15:59:15,808 error [stderr] (pool-25-thread-2) org.hibernate.transactionexception: jdbc rollback failed 2013-05-21 15:59:15,808 error [stderr] (pool-25-thread-2) @ org.hibernate.transaction.jdbctransaction.rollback(jdbctransaction.java:204) 2013-05-21 15:59:15,808 error [stderr] (pool-25-thread-2) @ com.wideplay.warp.persist.hibernate.hibernatelocaltxninterceptor.rollbackifnecessary(hibernatelocaltxninterceptor.java:149) 2013-05-21 15:59:15,808 error [stderr] (pool...

android - no MainActivity in the debug window in eclipse where I have the breakpoints -

Image
i trying debug eclipse there no "mainactivity" in "debug" window , in order select , check variables have breakpoints. i debugging device attached. i select debug as-> android application , go debug perspective. there, select name of application , gives me "threads" . if pause , select every thread , in no 1 can find mainactivity have set breakpoints.. a screenshot: if want debugger hit brac k point, have perform steps needed reach . in other word, since have set breckpoint inside onclicklistener of dialog have click on dialog 's button in order reach it.

batch command input menu -

i have question . possible make batch menu accept multiple commands @ same time? example : ( code ) @echo off set tries=6 :top cls set /a tries=%tries% -1 if %tries%==0 ( goto penalty ) echo have %tries% attempts left. echo please enter password proceed set /p password= if %password%==parola ta ( echo welcome name ping localhost -n 5 >nul cls echo connected! c: cd\ cls :menu cls echo ============= menu name ============= echo ------------------------------------- echo 1. system information txt file echo 2. selection 2 echo 3. selection 3 echo 4. selection 4 echo 5. selection 5 echo 6. selection 6 echo 7. selection 7 echo ------------------------------------- echo 8. selection 8 echo ------------------------------------- echo 9. selection 9 echo ------------------------------------- echo ==========press 'q' quit========== echo. set input= set /p input=please select number: if /i '%input%'=='1' goto selection1 if /i '%input%'==...

javafx - Include java.exe in the runtime built -

to create installer javafx application, have followed tutorial . , expected makes installer. the directory structure makes this: myapp +app +runtime +myapp.exe +myapp.ico the runtime contains java runtime. issue is, application creates java process , needs path of java.exe. on browsing through above folder runtime, not contain java.exe. i.e. runtime +jre +bin +java.dll missing java.exe how path of java.exe can use start other java process. or how start java process java.dll ? ps: this link discusses same question not answer it. the native packaging cookbook on fine tuning application bundle oracle java deployment team contains instructions on how customize pieces of jre included in self-contained application. i'll copy , paste relevant section here in case original link goes dead: if using packaging tools produce installable package there need tweak application image before wrapped installer. why?...

jquery - Initiating Datatable Filter when using Javascript to add Text to Input Field -

i using datatables http://www.datatables.net/ table in project. i want use datatables filter filter out items table based on pre-defined keywords contained within table. the user can type in filter great, want give them "shortcut" buttons text. i have working demo here http://jsfiddle.net/vjq5l/4/ you can see when going through buttons - firefox - netscape - osx etc have js working updates value of filter input field. only problem not filter, need press space on keyboard when focus on input field work. i sure there might quick solution adding filter call after each button pressed or blur event or something. not sure how it.. http://jsfiddle.net/vjq5l/4/ my js code $(function() { /* table initialisation */ $('#example').datatable({ "sdom": "<'row'<'span8'l><'span8'f>r>t<'row'<'span8'i><'span8'p>>", "olanguage": { ...

javascript - In PHP, how to destroy session and close the window? -

i want close tab destroy sessions in php. i have piece of code, doesn't work well. <?php session_start(); session_destroy(); ?> <script language="javascript"> settimeout("self.close();",10000) </script> help through, thanks. edit: doesn't close window expected. function openwin() { mywindow=window.open("","","width=200,height=100"); mywindow.document.write("<p>this 'mywindow'</p>"); } function closewin() { mywindow.close(); }

qt creator - Qt test-unit: Error: undefined reference to `imp__ZN5Q -

i trying create "qt unit test" following tutorial . created new project: qt gui application header file mentioned , class contains test function. added #config += testlib ".pro" file . however, when run code, errors: in function `simulateevent': error: undefined reference `_imp___zn5qtest15defaultkeydelayev' error: undefined reference `_imp___zn5qtest15defaultkeydelayev' error: undefined reference `_imp___zn5qtest5qwarnepkcs1_i' then in function 'mouseevent': error: undefined reference `_imp___zn5qtest17defaultmousedelayev' error: undefined reference `_imp___zn5qtest17defaultmousedelayev' error: undefined reference `_imp___zn5qtest17defaultmousedelayev' error: undefined reference `_imp___zn5qtest17defaultmousedelayev' error: undefined reference `_imp___zn5qtest5qwarnepkcs1_i' then in function 'simulateevent' again: error: undefined reference `_imp___zn5qtest15defaultkeydelayev' erro...

jQuery dialog issues -

we have application has large administration piece. using jquery dialogs on few of pages contain cascading dropdowns (data driven using ajax\json) , jquery date pickers. having lot of issues this. i have been googling around few weeks , have discovered many developers experiencing similar problems. have found lot of suggestions none of them seem resolve issues. issues have come on second time user navigates page containing 1 of these dialogs , seem recurring theme lot of complaints. our particular issues date picker in disabled on second load (more textbox date picker assigned to). of cascading dropdowns not set selected value on second page load , edit function. on jquery 1.7.2 , jquery ui 1.8.18 . has encountering these same issues found solution? ** new info - have discovered ie 9 issue only. works fine in firefox , ie 8 - trying come solution **

php - re- How to display pdf files from database in Google Docs? -

i want display pdf file in google docs using link. 'floc' file name in database contains .pdf files. here code---> <td><?php echo $file_row['fname']; ?> </td> <td><a href="http://docs.google.com/viewer?url=<?php echo urldecode($file_row['floc']); ?>"> <i class="text-warning">view </i></a></td> <td><em><i class="text-success"><?php echo $file_row['fdatein']; ?></i></em></td> thanks immediate help! try putting in iframe e.g. <iframe id="iframe1" src="http://docs.google.com/gview?url=http://yourpdf&embedded=true#:0.page.1">

PHP Strace result - mysql sleeping connections -

so, after running strace on sleeping connections, have come across few things have fixed (removed strace) wondering if can notice else strace result. it's mysql sleep state when analyse ntp netstat can see close_wait after while. hit several sleeping connections grind server half. process 13948 attached - interrupt quit read(14, "\21v\257\305\302\365\320\326", 8) = 8 close(14) = 0 mlock(0x1b50d70, 24) = 0 mlock(0xb766da80, 10624) = 0 gettimeofday({1369138768, 45552}, null) = 0 write(2, "[tue may 21 07:19:28 2013] [erro"..., 187) = 187 gettimeofday({1369138768, 45621}, null) = 0 write(2, "[tue may 21 07:19:28 2013] [erro"..., 195) = 195 getcwd("/home/site-name/site-name/current/www", 4096) = 39 time(null) = 1369138768 lstat64("/home/site-name/site-name/current/www/./zend/cache/backend/file.php", 0xbfeb553c) = -1 enoent (no such file o...

php - Illegal string offset, how to work with this data -

i've got array returned api call below. when try access data using key, illegal string offset. believe it's caused fact key names don't have ' around them, can't thing data coming external source. any idea why happening or can ? [data] => array ( [latest] => array ( [value] => 123.59000 [value_int] => 12359000 [display] => $123.59000 [display_short] => $123.59 [currency] => usd ) im trying access data echo $element['value']; if looping $array , have value in $element variable. you can expand array`s keys with: foreach ($array $key => $value) { echo $key . ' = ' . $value; } if want access value key, use without looping: echo $array['value']; according edit - if have large array assigned $array variable, loop array value assign...

C++ Structure Initialization -

is possible initialize structs in c++ indicated below struct address { int street_no; char *street_name; char *city; char *prov; char *postal_code; }; address temp_address = { .city = "hamilton", .prov = "ontario" }; the links here , here mention possible use style in c. if why not possible in c++? there underlying technical reason why not implemented in c++, or bad practice use style. using way of initializing because struct big , style gives me clear readability of value assigned member. please share me if there other ways through can achieve same readability. i have referred following links before posting question c/c++ aix c structure initialization variable static structure initialization tags in c++ c++11 proper structure initialization if want make clear each initializer value is, split on multiple lines, comment on each: address temp_addres = { 0, // street_no nullptr, // street_name "ha...