Posts

Showing posts from April, 2011

sql server - T-SQL : UNION ALL view not updatable because a partitioning column was not found -

how can insert in view date constraints? here tables resulted after clicking on script create table : table 1 : create table [dbo].[tbl_zaua_1_17]( [id] [int] not null, [date] [datetime] null, constraint [pk_tbl_zaua_1_17] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] go set ansi_padding off go alter table [dbo].[tbl_zaua_1_17] check add constraint [ck_tbl_zaua_1_17] check (([date]<'2014-01-18 00:00:00.000' , [date]>'2014-01-16 00:00:00.000')) go alter table [dbo].[tbl_zaua_1_17] check constraint [ck_tbl_zaua_1_17] go` table 2 : create table [dbo].[tbl_zaua_1_11]( [id] [int] not null, [date] [datetime] null, constraint [pk_tbl_zaua_1_11] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_pag

javascript - Remove '=' character from a string -

this question has answer here: how replace occurrences of string in javascript? 34 answers i have string follows: var string = "=09e8d76c-c54c-32e1-a98e-7e654d32ec1f"; how remove '=' character this? i've tried couple of different ways '=' character seems causing conflict if it's first character work... var string = "=09e8d76c-c54c-32e1-a98e-7e654d32ec1f".substring(1); if it's not first character work... var string = "=09e8d76c-c54c-32e1-a98e-7e654d32ec1f".replace("=", ""); if it's in there more once work... var string = "=09e8d76c-c54c-32e1-a98e-7e654d32ec1f".split("=").join("");

wordpress - Read more link returns blank page -

i've created custom theme , i'm using template blog page. in template have code calls specific posts according category. far good, problem when post contains "read more". link active when click on empty page instead of whole article. this code: <?php $args = array( 'category_name' => 'blog', 'post_type' => 'post', 'posts_per_page' => 10, ); query_posts($args); while (have_posts()) : the_post();?> <?php global $more; $more = 0; ?> <?php echo '<p class="date"><i class="fa fa-calendar"></i> '; echo get_the_date(); echo '</p>'; echo '<h2>'; echo '<a class="permalink" href="';

compiler construction - Apache FIPS support issue -

i have compiled openssl fips library cd openssl-fips-2.0.1 ./config make make install cd openssl-1.0.1c ./config fips shared make depend make make install it has installed in /usr/local/ssl $sudo /usr/local/ssl/bin/openssl version openssl 1.0.1c-fips 10 may 2012 compile apache fips supported openssl cd httpd-2.2.27 ./configure --prefix=/usr/local/httpd-fips --with-ssl=/usr/local/ssl --enable-so make make install added following option in apache sslfips on , got following error $sudo /usr/local/httpd-fips/bin/apachectl -t syntax error on line 38 of /usr/local/httpd-fips/conf/extra/httpd-ssl.conf: invalid command 'sslfips', perhaps misspelled or defined module not included in server configuration

android 4.x with facebook SDK and action bar -

i'm starting develop app android 4.0 uses facebook login. to develop app facebook sdk minimum required sdk it's 2.2 need action bar uses minimum required sdk 3, should develop app facebook sdk , action bar? use appcompat support library google: http://developer.android.com/tools/support-library/features.html#v7-appcompat

c# - Accessing a Mailbox Within An Outlook Account -

i writing application automate sending of e-mails specific mailbox within account available on outlook. able accounts available doing: outlook.application application = new outlook.application(); outlook.accounts accounts = application.session.accounts; i can iterate through available accounts doing: foreach (outlook.account account in accounts) { console.writeline(account.displayname); } my question is: how access mailboxes within exchange account in list. lets first element in accounts list. i have read few other questions on accessing inbox folder contents of mailbox, looking send email item later create using chosen mailbox in "from" field. thanks help.

ios - UICollectionView reload Failure -

Image
whenever tries reloaddata uicollectionview ends following error. sure not releasing variable. nsmutablearray data not released. 1 faced similar issues? can provide me work around? 2014-04-22 22:28:55.010 salesapp[6901:19d03] *** -[uiviewanimationcontext completionhandler]: message sent deallocated instance 0xa4475f0 the nszombie gives me nothing useful..:-( in advance

javascript - What is forcing inline styles in my markup? -

Image
i know totally gonna downvoted, because although think legitimate concern , i'm sure other people have them, it's "codeless" question. :) answer before gets on hold. i make sure not use unnecessary inline styles. today noticed, there script forcing inline styles in markup , can't smoke out. provide website link @ request (i don't wanna come off i'm fishing traffic), way can see happens website loads fine, after hover or click on element, inline style magically appears. here's visual aid thank you so, whenever use jquery apply styles, applies them inline, style="" attribute. check jquery "mystery styles" having trouble with. grep command friend. good luck!

c - kill a specific thread in GDB -

i want kill specific thread in gdb. how attach program gdb. (gdb) r ./bin/myprog arg1 arg2 i current running threads by (gdb) info threads 3 thread 0x7ffff61fe700 (lwp 28549) 0x000000323b6db7ad in foo () /lib64/libc.so.6 * 2 thread 0x7ffff6bff700 (lwp 28548) bar () @ ./src/myprog.c:229 1 thread 0x7ffff7506740 (lwp 28547) 0x000000323be0822d in pthread_join () /lib64/libpthread.so.0 this how tried kill thread (say thread 3) (gdb)t 3 [switching thread 3 (thread 0x7ffff61fe700 (lwp 28549))]#0 foo () @ ./src/myprog.c:288 (gdb)call raise(3,0) here assumed signature of raise raise(threadid displayed in gdb, signo 0) but thread not getting killed. should use different signo or thread id wrong? note: read this question in did not me signal handling in multithreaded apps complicated. thus, makes more sense switch thread, make sure not holding resources (such locked mutexes) , invoke pthread_exit() on behalf if exited on own accord.

android - Can't display dynamically made grid layout -

here code create dynamic text views , create grid layout. grid layout not showing tablerow[] tr = new tablerow[arry1.length]; final textview[] tx = new textview[arry1.length]; gridlayout tl = (gridlayout) findviewbyid(r.id.tablelayout1); tl.setrowcount(arry1.length*2); tl.setcolumncount(1); final button = new button(s1.this); b.settext("hi"); gridlayout[] gl = new gridlayout[arry1.length]; (i = 0; < arry1.length; i++) { final string cat = arry1[i].tostring(); tx[i] = new textview(s1.this); tx[i].setlayoutparams(new tablerow.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content)); tx[i].setallcaps(true); tx[i].settextsize(15); tx[i].settext(cat); gl[i] = new gridlayout(s1.this); gl[i].setlayoutparams(new layoutparams(layoutparams.wrap_content,layoutparams.wrap_content)); gl[i].setvisibility(view.visible); tr[i] = new tablerow(s1.this); tr[i].setlayoutparams(new layoutparams(layoutparams.wrap_content,layoutparams.wrap_content)); tr[i].addview(tx[i],ne

Aligning multiline Java strings in Eclipse -

i'm little new eclipse formatter system. given assignment string on couple of lines this: string cypher = "optional match (update:update {name: {name}})," + "(update)-[:installed_in]->(installation)<-[:current]-(computer:computer {name: {computername}})" + "return update, installation, computer"; i wish have eclipse format when hitting ctrl + shift + f , produce following, + signs aligning nicely under = : string cypher = "optional match (update:update {name: {name}})," + "(update)-[:installed_in]->(installation)<-[:current]-(computer:computer {name: {computername}})" + "return update, installation, computer"; how can achieve that? i'm using formatter.xml file i've imported eclipse: http://pastebin.com/ithw8lub maybe tweak here needed? i played around formatter settings in eclipse, , not able achieve exactly looking for. suspect not

git - How to keep/maintain public and private code in the same repository? (at repository hostings) -

i'm working on own project has 2 parts: a. kernel/generic code (public part) b. code works proprietary protocol etc (private part, available me , few authorized persons) i want repository hosting (maybe github, assembla, ...) allows working in public , private branches in same repository. i don't want 2 repositories because i'm actively working on both parts , want avoid diverged repositories. which solution available me? which allows working in public , private branches in same repository. that doesn't seem compatible how git works: if have access repo, can clone all content (including branches). a git hosting service bitbucket or gitlab allows protect branch (meaning cannot push back). still able see content. gitolite doesn't prevent read-access @ branch level . so 2 separate repos still best approach, repo (kernel) declared submodule of repo b.

html - javascript: get height of pseudo :before element -

i need height of pseudo :before element. sounds no-brainer, cannot work. have tried: $('.test:before').height() // --> null and jsfiddle suggestions wrong ? update: height of .test depends on content. need is, when height gets bigger pseudo element, need add padding right of element. however, because height of pseudo element set css don't know in program super-late reply, but: can use vanilla javascript pseudo-element dimensions using getcomputedstyle method: var testbox = document.queryselector('.test'); // or jquery: testbox = $('.test').get(0); - want js element, without jquery wrapper var pseudobeforeheight = window.getcomputedstyle(testbox, ':before').height; // returns (string) "70px" this return string of pixel value, regardless of css declaration (e.g. 4.375rem = 70px , 10vh = 70px , calc(8vh + 1rem) = 70px , number (in pixels) can do: var pseudoheightnum = parseint(pseudobeforeheight); with rega

layout - Counter-clockwise iOS CircleLayout -

Image
i'm using modified version of apple's circlelayout wwdc found here: https://github.com/mpospese/circlelayout . my current code draws first element @ top , lays out rest in clockwise fashion. how can use code layout starts first element @ top , draws next elements counter-clockwise along path? trigonometry bit rusty. i believe portion of code needs changing is: - (uicollectionviewlayoutattributes *)layoutattributesforitematindexpath:(nsindexpath *)path { uicollectionviewlayoutattributes* attributes = [uicollectionviewlayoutattributes layoutattributesforcellwithindexpath:path]; attributes.size = cgsizemake(item_size, item_size); attributes.center = cgpointmake(_center.x + _radius * cosf(2 * path.item * m_pi / _cellcount - m_pi / 2), _center.y + _radius * sinf(2 * path.item * m_pi / _cellcount - m_pi / 2)); return attributes; } current: desired: replacing angle negative value changes orientation. in cas

php - Facebook events graph not working -

i'm trying facebook page events. i've checked app id , app secret correct , still keep getting error. <?php ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); ob_start(); require 'facebook/src/facebook.php'; $fb = new facebook(array( 'appid'=>'appid', 'secret'=>'appsecret' ) ); $page_events = $fb->api('/pageid/events?fields=description,location,name,owner,cover,start_time,end_time', 'get'); printf ('<pre>%s</pre>', $page_events); ?> the error message: uncaught oauthexception: invalid oauth access token signature. thrown in i'm not sure you've implemented or not code missing- user login/authentication the code not authenticating user. after creating $fb object; use this- $user_id = $fb->getuser(); if($user_id) { try { // proceed api calls - user authenticated @ po

Passive Monitoring with Nagios / Icinga - How to monitor external hosts correctly? -

good morning, our goal monitor many external clients open source monitoring solution icinga or nagios.. because of our customers have multiple devices 1 dynamic public ip, still looking 1 solution works of our clients. amount of clients , networks high can use vpn connect them icinga. fit if clients send check reports icinga host. many other monitoring solutions, such gfi max let clients report through tcp 443 or tcp 80 (failover). if interval has been interrupted, monitoring server mark client critical failure. here more information our internal infrastructure: - icinga core 1.11.1 / nagios - static ip monitoring server - endian firewall at client side: - windows devices nsclient++ - no static ip - nat , firewall configurable based on information can suggest solution let clients send information icinga server, please? besides possible realize scenario without vpn, static ip or dynamic dns? thank helping me out! ok found solution. nsca it's not big deal mak

linux - How to run a bash function() in a remote host? in Ubuntu -

this question has answer here: shell script: run function script on ssh 2 answers i running bash script, when try run functions on remote machine, says bash: keyconfig: command not found here script: keyconfig() { sed -i.bak -r "/^$1/s/([^']+')([^']+)('.*)/\1$2\3/" $3 } remoteexecution() { ssh ppuser@10.101.5.91 " keyconfig $1 $2 $4 " } remoteexecution resone error: when ssh ppuser@10.101.5.91 " keyconfig $1 $2 $4 " you trying execute command keyconfig on remote machine 10.101.5.91 not there: 2 solution problem 1) make script on remotehost contains keyconfig code same name or 2) execute following instead of function ssh ppuser@10.101.5.91 "sed -i.bak -r "/^$1/s/([^']+')([^']+)('.*)/\1$2\3/" $3" please note may have add few escape depending

php - How can I get the amount of memory that remains for Redis -

with redis command info can current memory usage: for example: 'used_memory' => int 600832 'used_memory_human' => string '586.75k' (length=7) 'used_memory_rss' => int 1998848 'used_memory_peak' => int 845056 'used_memory_peak_human' => string '825.25k' (length=7) 'used_memory_lua' => int 31744 and want check how memory left redis . way see check cat /proc/meminfo , compare it. there other way it? there no built-in functionality in redis supply information. the available memory machine-wide. parsing /proc/meminfo indeed way info. see here python example: nagios plugins check_memory we use similar script on our dedicated redis machines (which run several redis-server instances piece), send alerts our in-house exception handling portal when our memory limit reached. kind regards, tw

jquery - my website is a disaster on IE 9 and less -

i have been developping website works on browsers, including ie 11, tried on ie 8 , 9, turned ugly unbelievable caos, css doesn't work, (at least of it) , javascript works terribly. here website: http://dev.ux-pm.com as can imagine, terrified fact, right before deadline website, please if give me headlines of how fix thankful. i using css3, html5 , jquery 1.11.0 it looks need doctype http://validator.w3.org/check?uri=http%3a%2f%2fdev.ux-pm.com%2f&charset=%28detect+automatically%29&doctype=inline&group=0 this clear quite few issues things looking wrong on older versions of ie won't fix everything. validating not cure find more compliant code less bugs occur.

32bit 64bit - Strtol implementation different behaviour on 32 and 64 bit machine -

#include <ctype.h> #include <string.h> #include <stdio.h> #include <tgmath.h> #include <limits.h> #include <stdbool.h> #include <errno.h> #define negative -1 #define positive 1 #define octal 8 #define decimal 10 #define hexadecimal 16 #define base_min 2 #define base_max 36 long int strtol (const char * str, char ** endptr, int base) { if(base < 0 || base == 1 || base > base_max) { errno = einval; return 0l; } else { bool conversion = true; int = 0, sign = positive, save; while(isspace(*(str + i))) i++; if(*(str + i) == '\0') { conversion = false; save = i; } if(*(str + i) == '-') { sign = negative; i++; } else if(*(str + i) == '+') i++; if(base == 0) // find out base { if(*(str + i) == '0')

c# - Is it possible to use Task<bool> in if conditions? -

in windows phone 8 have method public async task<bool> authentication() . return type of function bool when tried use returned value in if condition error says can not convert task<bool> bool . public async task<bool> authentication() { var pairs = new list<keyvaluepair<string, string>> { new keyvaluepair<string, string> ("user", _username), new keyvaluepair<string, string> ("password", _password) }; var serverdata = serverconnection.connect("login.php", pairs); rootobject json = jsonconvert.deserializeobject<rootobject>(await serverdata); if (json.logined != "false") { _firsname = json.data.firsname; _lastname = json.data.lastname; _id = json.data.id; _phone = json.data.phone; _profilepic = json.data.profilepic; _thumbnail = json.data.thumbnail; _email = json.data.email; return tr

c# - Indexing through an Object -

so have datagrid. when row doubleclicked value passed mvvm. list implementation: private list<object> _allqueries { get; set; } public list<object> allqueries { { return _allqueries; } set { _allqueries = value; this.notifyofpropertychange(() => allqueries); } } datagrid implementation: <telerik:radgridview selecteditem="{binding selecteditem}" itemssource="{binding allqueries, mode=twoway, updatesourcetrigger=propertychanged}" autogeneratecolumns="true"> implementation of selecteditem public object selecteditem { get; set; } when put breakpoint selecteditem used it's working perfectly, values being brought. question how interact columns or properties using (var ctx = db.get()) = ctx.interactions.find(selecteditem2); examples of selecteditem be: id = 200 date = 4/24/2014 name = "billy bob" is there way index through properties of object selecteditem[0] give me id number. for generic ob

json - Combining type and field serializers -

let's assume have case class following setup: case class place(id:java.util.uuid, name:string) i can write (working!) serializer type follows: class placeserializer extends customserializer[place]( format => ( { case jobject(jfield("id", jstring(s)) :: jfield("name",jstring(x)) :: nil ) => place(uuid.fromstring(s), x) }, { case x:place => jobject( jfield("id", jstring(x.id.tostring())) :: jfield("name", jstring(x.name)) :: nil) } ) ) but assuming case class has lot more fields, lead me enumerating entire structure of object ast, creating that's verbose encode primitives. json4s appears have field serializers can act on specific fields, boilerplate methods included transform names , discard fields. these, however, have following signature serialize , deserialize partial functions

proof - Prove using induction that the loop invariant holds -

//precondition: n > 0 //postcondition: returns minimum number of decial digits // necessary write out number n int countdigits(int n){ 1. int d = 0; 2. int val = n; 3. while(val != 0){ 4. val = val / 10; // in c++: 5 / 2 === 2 5. d++; 6. } 7. return d; } invariant: before evaluating loop guard on line 3, n rightmost d digits removed identical val. ( assume number 0 takes 0 digits write out , number takes 0 digits write out). prove using induction loop invariant holds. now i've thought proof induction assuming replacing variable within equation k true must prove k+1 true. i'm not given equation in question , block of code. here's base case: just before evaluating loop guard on line 3, d equal 0 , on line 2, val == n, if n has rightmost 0 digit removed, val. therefore, base case holds. i'm not sure how write inductive step after since i'm not sure how prove k+1.. the logic same equation,

javascript - Validate specific format without using "-" to split the string -

hi need validate string before sending form, format must be llll999999xxx where l letter 9 number x letter or number. i figure out how using - split, problem users use enter value out - , going strage if ask - in format. (in moment ask , pls enter format llll-999999-xxx wich no good.) how can validate this, without using - , ideas? sorry im newbie @ javascript <script language="javascript"> function rfc(cual) { mensaje = "pls enter format llll-999999-xxx" pat = /[a-z]|[a-z]/ pat2 = /[a-z]|[a-z]|[0-9]/ val = cual.split("-") if (val.length == 3){ if(val[0].length == 4){ if(!comp(val[0],pat)){ alert( mensaje) return false } } if(val[1].length == 6){ if(isnan(val[1])){ alert('no es un numero') return false } } if(val[2].length == 3){ if(!comp(val[2],pat2)){ alert(mensaje) return false

ios - Google analytics click event shows error -

i have developed iphone app, want integrate google analytics in app. i following link of google analytics tracking click events, https://developers.google.com/analytics/devguides/collection/ios/v2/events but when write shows me error: no known instance method selector sendeventwithcategory - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *__strong)indexpath { [self.tracker sendeventwithcategory:@"uiaction" withaction:@"buttonpress" withlabel:@"label" withvalue:[nsnumber numberwithint:100]]; } please , in advance. let't try: - (bool)sendeventwithcategory:(nsstring *)category withaction:(nsstring *)action withlabel:(nsstring *)label withvalue:(nsnumber *)value; { bool rv = no; id<gaitracker> tracker = [gai sharedinstance].defaulttracker; if(tracker!=nil) { rv = [t

node.js - Check when Faye has finished the publish function -

i'm quite new working faye , have small question concerning it. i'm trying call redirect function page after publish string faye. the problem is: redirect happens before faye has gotten chance make it's connections , send channel. my question is: there way check when faye has succesfully published , execute function afterwards? thanks! there way check if publishing message has been successful or not: var publication = client.publish('/foo', {text: 'hi there'}); publication.then(function() { // ok }, function(error) { // not ok, redirect }); this 1 documented .

objective c - iOS Dropbox API - Re-Authenticating (Error 401) -

i've been having issues ios app using dropbox. used run dropbox core api fine, no problems uploading file, it'll show me error 401. i've seen everywhere need re-authenticate. sorry if question sounds dumb, meant re-authentication here , how do it? you need login dropbox again.

actionscript 3 - Replacing a movieclip with another movieclip, keeping the same instance name -

i'm new actionscript question might stupid one. i'm trying replace movieclip movieclip, while keeping instance name of previous. i have menu selection of buttons, each leading same screen movieclip , scrubber bar. tried defining movieclip through variable, tried redefining through event listener function, i'm guessing can't this: var mc: movieclipsymbol1 = new movieclipsymbol1; private function selectionscreen(): void { selectionscreenbutton1.addeventlistener(mouseevent.click, screenbutton1); selectionscreenbutton2.addeventlistener(mouseevent.click, screenbutton2); private function screenbutton1(event: mouseevent): void { var mc: movieclipsymbol1 = new movieclipsymbol1; movieclipscreen(); } private function screenbutton2(event: mouseevent): void { var mc: movieclipsymbol2 = new movieclipsymbol2; movieclipscreen(); } } public function movieclipscreen(): void { stage.addchild(mc); } because of scrubber bar code did, need kee

c++ - QDateTime widget looks bad under Mac OS X -

Image
i have project based on qt 5.2.1 , has qdatetime widget calendar pop-up (calendarpopup option set on true). when run app under ubuntu 13.10 (or looking in qt designer) qdatetime looks like: and it's ok. under mac os x 10.9.2 looks like: as can see white area higher arrow , looks pretty ugly. i've been searching information found nothing. can me find workaround issue? note: better without creating custom widget. able set styles or in qdatetime class? problem solved appending "border: 1px;" qdatetime style sheets. looks like: not perfect, enough me. @bowdzone giving me idea!

groovy - Jenkins Email-ext plugin exception raised during template rendering -

i using jenkins email-ext plugin , part works great, every , exception raised during template rendering: null java.lang.nullpointerexception errors. these errors seem occur when server under higher load, hard pin down exactly. exception raised during template rendering: null java.lang.nullpointerexception @ org.codehaus.groovy.runtime.callsite.geteffectivepojopropertysite.acceptgetproperty(geteffectivepojopropertysite.java:51) @ org.codehaus.groovy.runtime.callsite.abstractcallsite.callgetproperty(abstractcallsite.java:227) @ simpletemplatescript3$_run_closure1.docall(simpletemplatescript3.groovy:143) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.codehaus.groovy.reflection.cachedmethod.invoke(cachedmethod.j

java - How to extract the digest algorithm from a X509Certificate -

i can extract oid , name of signature algorithm x509certificate instance such "sha256withrsa" how extract name of digest algorithm e.g. "sha256" . is there way beside string splitting "with" or fixed mapping of oid's? side question: safe split "with" ? a certificate contains signature algorithm oid maps unique couple digest/algorithm. therefore easiest way found digest algorithm use mapping table oid -> digest algo. unfortunately know no centralized location can find these oid. can collected in these rfc: algorithms , identifiers internet x.509 public key infrastructure certificate , certificate revocation list (crl) profile additional algorithms , identifiers rsa cryptography use in internet x.509 public key infrastructure certificate , certificate revocation list (crl) profile updates rsaes-oaep , rsassa-pss algorithm parameters internet x.509 public key infrastructure: additional algorithms , identifiers dsa

PHP obsever pattern -

i using simple php observer pattern in zend. controller notifing particular observer. in input parameter id , return type array . still giving object return response in controller. subject follow: <?php class newsubject implements subject{ public $observers = array(); function __construct() { } public function getdata(id){ $this->id = id; $this->notify(id); } public function attach(observer $obsever) { $id = spl_object_hash($obsever); $this->observers[$id] = $obsever; } public function detach(observer $obsever) { $id = spl_object_hash($obsever); unset($this->observers[$id]); } public function notify(id) { foreach($this->observers $obs) { $obs->update(id); } } } ?> observer follow: <?php class newobserver implements observer{ public function update($id) { $modelmethod = new modelmethod();

How to parse a soap response in java -

i want parse soap response (xml file) in java. example want extract value cv2 last operation in file (event.xml). used xpath in code have error compilation: "exception in thread "main" java.lang.classcastexception: org.apache.xerces.dom.deferredtextimpl cannot cast javax.xml.soap.node" if have ideas, please me :) please see below soap xml <?xml version='1.0' encoding='utf-8'?> <soapenv:envelope xmlns:soapenv="..."> <soapenv:body> <ns1:commandresponsedata xmlns:ns1="..."> <ns1:commandresult> <ns1:transactionresult> <ns1:operationresult> <ns1:operation name="operationname" modifier="modify"> <ns1:parameterlist> <ns1:stringparameter name="n1">v1</ns1:stringparameter>

java - Send email to myself using SMTP and Apache Camel -

i trying write apache camel route sending email myself, based on part 4 of tutorial: https://camel.apache.org/tutorial-example-reportincident.html from("file://target/subfolder") .setheader("subject", constant("new incident reported")) .convertbodyto(string.class) // send email .to("smtp://myid@localhost?password=&to=myname@mycompany.com"); but i'm getting this, , no email in inbox: 395 [main] debug org.apache.camel.example.reportincident. reportincidentroutestest - routing rules are: [eventdrivenconsumerroute[endpoint[direct:start] -> delegate(delegate(pipeline[deadletterchannel[delegate(setheader(org.apache. camel.file.name, beanexpression[bean:org.apache.camel.example.reportincident. filenamegenerator@244aeb52 method: generatefilename])), recipientlist[log:org.apache.camel.deadletterchannel?level=error]], deadletterchannel[delegate(sendto(endpoint[velocity:mailbody.vm])), recipientlist[log:org.apache.camel.deadlet

java - Identify if the session is idle and flush in Decoder with Mina? -

i using apache camel in conjunction apache mina have tcp server. using specific protocol decoder in code. in decoder, waiting x amount of bytes before send them downstream route. i implement able understand session got idle or closed , send bytes have got downstream route (it doesn't matter if didn't total x bytes). have tried implementing iofilteradapter overriding method sessionidle() not sure how use it. overriding sessionidle() method closing (or configuring want) session when session idle time has been reached. you can set idle time inside handler class (or extending iofilteradapter ) overriding sessionopened() method. should work: @override public void sessionopened(final iosession session) throws exception { session.getconfig().setidletime(idlestatus.both_idle, this.idletimeout); } you can use other idle states defined in idlestatus class. there there states: public static final idlestatus reader_idle = new idlestatus("reader idle&q

php - How to multiple regexes into one regex -

hi have 3 regex preg_match in 1 if.. i want know if it's possible mix 3 regex in 1? this if 3 regex : if(!preg_match("#\s#",$file) && !preg_match("#\.\.\/#",$file) && (preg_match_all("#/#",$file,$match)==1)): (i want: no "space" , no "../" , 1 "/") thanks help. edit add needed in list point (more readable): no "space" no "../" 1 "/" it's quite simple. let's start step step crafting regex: first of all, let's use anchors define begin&end of string: ^$ i want: no "space" , we've got \s matches non-white space character: ^\s+$ no "../" , let's add negative lookahead ^(?!.*[.][.]/)\s+$ , note don't need escape dot inside character class. forwardslash, we'll use different delimiters one optional "/" , add negative lookahead prevents 2 forwardslashes ^(?!(?:.*/){2})(?!.*[.][.]/)\s+$

how to change jquery ui input textbox background image -

Image
i have custom image text field . using jquery mobile input textbox . want apply custom image background input text box. please guide me how can this. just apply image background in css: <form> <label for="text-1">text input:</label> <input type="text" name="text-1" id="text-1" value="hello world!" /> </form> #text-1 { background-image: url("http://lorempixel.com/1000/40/abstract/1/") !important; color: white; text-shadow: 0 1p 0 #333; } demo update: op wants background on slider handle too: add container around slider make css selector easier: <div id="slidercontainer"> <label for="slider-1">slider:</label> <input type="range" name="slider-1" id="slider-1" min="0" max="100" value="50" /> </div> apply background div cl

Objective-C class for working with fractions -

i'm trying learn programming, , language chose start objective c! i'm studying : programing in objective-c fourth edition, , bit stuck @ classes chapter. we have following code : #import <foundation/foundation.h> @interface fraction: nsobject; -(void) print; -(void) setnumerator: (int) n; -(void) setdenominator: (int) d; @end @implementation fraction { int numerator; int denominator; } -(void) print { nslog(@"%i/%i" , numerator, denominator); } -(void) setnumerator:(int)n { numerator = n; } -(void) setdenominator:(int)d { denominator = d; } @end int main (int argc, char * argv[]) { @autoreleasepool { fraction *myfraction; myfraction = [fraction alloc]; myfraction = [fraction init]; [myfraction setdenominator:1]; [myfraction setnumerator:3]; nslog(@"the value of myfraction :"); [myfraction print]; } return 0; } i copied code bo

instantiation - Work with methods, setters and getters in java -

i have class: public class person { /** * */ private static final long serialversionuid = 1l; private string firstname = "vasya"; private string lastname = "pupkin"; private integer age = 58; private integer phone = 2; @override public string tostring() { return "person [firstname=" + firstname + ", lastname=" + lastname + ", age=" + age + "]"; } public void setname(string name) { firstname = name; } public void setlastname(string lname) { lastname = lname; } public void setage(integer personage) { age = personage; } public void setphone(integer personphone) { phone = personphone; } public string getname() { return firstname; } public string getlastname() { return lastname; } public integer getage() { ret

php - Table starting from present date -

$sqlstr = "select name, datescheduled table datescheduled > now() order datescheduled desc"; i echo table results above. row each day next 90 days regardless of whether or not mysql table has entry day. how can this? add: $query1 = mysql_query($sqlstr); echo "<table><tr>"; echo "<th>name</th><th>date scheduled</th>"; while ($rows = mysql_fetch_assoc($query1)) { echo "<td>" .$rows['name']. "</td>"; echo "<td>" .$rows['datescheduled']. "</td>"; } echo "</tr><table>";

php - convert setHeader to use https -

can please in converting bit of code send header response via https in php protected function _senduploadresponse($filename, $content, $contenttype='application/octet-stream') { $response = $this->getresponse(); $response->setheader('http/1.1 200 ok',''); $response->setheader('pragma', 'public', true); $response->setheader('cache-control', 'must-revalidate, post-check=0, pre-check=0', true); $response->setheader('content-disposition', 'attachment; filename='.$filename); $response->setheader('last-modified', date('r')); $response->setheader('accept-ranges', 'bytes'); $response->setheader('content-length', strlen($content)); $response->setheader('content-type', $contenttype); $response->setbody($content); $response->sendresponse(); die; }

asp classic - Trying to make a chat room for my website but cannot find working JavaScript. Could you help me please? -

i in middle of making chat rooms website, have been stuck on 1 part several days, finding proper javascript make div refresh chat bubbles. use asp code website. any this? appreciated. also: great if make database chat-entry field without having reload entire page. thanks. heres code snippet of have far: <div class="chatroomdiv"> chat bubbles here </div> <form action="chat_say.asp" method="post"> <input type="text" name="speech" /> <input type="submit" value="say" /> </form> i have no idea i'm working when work js please bare me. i suggest using ajax post, if using jquery, rather call $.post() function. eg. $.post( "chat_say.asp", { messge: $("#speech").val()}) .done(function( data ) { $(".chatroomdiv").html(data); }); i have not tested code @ , should treated pseudo code. the data variable data recieved asp

java - How to redirect a jsf page to home page if session does not exist -

am creating jsf application have embedded applet in main page. problem cant figure out how check if session exist before loading applet main page , if session not exist want redirect user home page i recommend use filter: public class loggedfilter implements filter { @override public void dofilter(servletrequest request, servletresponse response, filterchain chain) throws ioexception, servletexception { httpservletrequest httpservletrequest = (httpservletrequest) request; httpsession session = httpservletrequest.getsession(false); if (session == null) { httpservletresponse httpservletresponse = (httpservletresponse) response; httpservletresponse.sendredirect(httpservletresponse.encoderedirecturl(httpservletrequest.getcontextpath() + "/")); } else { chain.dofilter(request, response); } } and of course map filter jsf pages in web.xml : <filter> <filter-name>

angularjs - angular child scope can not refer to parent -

i new angular , try figure out how scope works. i assume child scope inherit scope parent. see angularjs wiki in angularjs, child scope prototypically inherits parent scope. so create simple test code in pluncker but when change scope variable child scope, not reflect change parent scope? why it? did wrong? scopes inherit property parent when property is missing . in code, when don't type yet, property missing , inherited parent scope, start typing, property created on child scope a separate property . after creating property on child scope, ng-model keeps updating property on child scope. in case need bind parent scope's properties, try $parent.out_var1 : <input type="text" ng-model="$parent.out_var1"> demo

php - Class with magic methods, global array, or..? -

i downloaded simple mvc, , converting how be. i see in index.php entry point file, register object (class code below) instantiated , template , router object passed accessible globally in mvc architecture. what difference using global array instead? isn't simpler? or there better way of handling this? i'm looking better way of passing these objects. i have read magic methods not because it's hard debug , re-factor. have read similar things global arrays. class registry { private $vars = array(); public function __set($index, $value) { $this->vars[$index] = $value; } public function __get($index) { return $this->vars[$index]; } } if question "what's registry class, better array?" then: class wrapper around array, it's useless. imo it's because thought using classes instead of arrays automatically makes code object oriented (which wrong). or maybe he/she wanted give array fancy name make

css - Blur effect on scaleX(-1) for IE 11 -

when try flip image on internet explorer 11, works flipped image loose quality , looks blurry. .edit{ transform:scalex(-1); } try here ie 11 : http://jsfiddle.net/ugm23/4/ is there way fix render quality css or in way? thanks lot! try not use scale(-1) . can rotate instead: -ms-transform: rotate(-180deg) this should result in same effect , not blurry... don't have ie11 test this, have try ;)

sql - 'MOD' is not a recognized built-in function name -

i wanted use mod function in sql server 2008r2 , followed link still got message: 'mod' not recognized built-in function name. declare @m int set @m = mod(321,11) select @m error: msg 195, level 15, state 10, line 2 'mod' not recognized built-in function name. why can't use function link above? the mod keyword exists in dax language (tabular dimensional queries), not tsql use % instead. ref: modulo

c# - I want to update my stock quantity keeping along the previous quantity. -

i want update stock quantity keeping along previous stock status. need update previous data adding or lessening depending upon inward or outward transaction. not getting stock updated in currentstock table. //this start of problem segment sqlcommand cmd2 = new sqlcommand("select stock currentstock itemname=@a", con); con.open(); int x=0; cmd2.parameters.addwithvalue("@a",combobox2.selecteditem.tostring()); sqldatareader dr = cmd2.executereader(); if (dr.read()) { x = dr.getint16(2); } if (radiobutton1.checked == true) { x = x + convert.toint16(textbox1.text); } else if (radiobutton2.checked == true) { x = x - convert.toint16(textbox2.text); } con.close(); sqlcommand cmd1 = new sqlcommand("update currentstock set stock=@a itemname=@b",con); con.open(); cmd1.parameter

r - Clustered Standard Errors with data containing NAs -

i'm unable cluster standard errors using r , guidance based on post . cl function returns error: error in tapply(x, cluster1, sum) : arguments must have same length after reading on tapply i'm still not sure why cluster argument wrong length, , causing error. here link data set i'm using. https://www.dropbox.com/s/y2od7um9pp4vn0s/ec%201820%20-%20dd%20data%20with%20controls.csv here r code: # read in data charter<-read.csv(file.choose()) view(charter) colnames(charter) # standardize naep scores charter$naep.standardized <- (charter$naep - mean(charter$naep, na.rm=t))/sd(charter$naep, na.rm=t) # change nas in year.passed column 2014 charter$year.passed[is.na(charter$year.passed)]<-2014 # add column indicator in treatment (passed legislation) charter$treatment<-ifelse(charter$year.passed<=charter$year,1,0) # fit model charter.model<-lm(naep ~ factor(year) + factor(state) + treatment, data = charter) summary(charter.model) # account cluste

r - Horizontal xtable on summary of data from read.csv -

i've got csv file looks this: rtt,from,req,bytes,ttl 202,10.0.0.10,1,64,64 191,10.0.0.10,2,64,64 ... i trying produce latex summary() using library(xtable) , so: library(xtable) pings <- read.csv("pings.csv") s <- summary(pings$rtt) xtable(t(s)) this produces output: \begin{table}[ht] \centering \begin{tabular}{rrrrrrr} \hline & min. & 1st qu. & median & mean & 3rd qu. & max. \\ \hline 1 & 40.70 & 42.70 & 43.40 & 44.90 & 44.10 & 202.00 \\ \hline \end{tabular} \end{table} this almost want, except first column containing empty value , 1 . clearly, i'm missing vital, basic knowledge data types , conversions in r. problem of course t(s) produces: min. 1st qu. median mean 3rd qu. max. [1,] 40.7 42.7 43.4 44.9 44.1 202.0 wherein [,1] should explain xtable's output. can please point out me i'm doing wrong? if i'm trying run xtable on summary, get > x