Posts

Showing posts from January, 2013

tsql - Problem with using max in the below update statement -

tsql - Problem with using max in the below update statement - hi i'm having problem using max statement in below query working on update tb_ts_cm_ofirecpt set amt = (coalesce (abs(cmledg.tranamt), 0) + coalesce (abs(cmledg_1.tranamt), 0)) * - 1, tranamt = abs(cmledg.tranamt) *-1, rtaxamt = coalesce (abs(cmledg_1.tranamt) * - 1, 0), tranid = cmledg.tranid tb_ts_cm_ofirecpt inner bring together cmledg on tb_ts_cm_ofirecpt.tranid = cmledg.refnmbr , tb_ts_cm_ofirecpt.descrptn = cmledg.descrptn left outer bring together cmledg cmledg_1 on cmledg.tranid = cmledg_1.parenttranid , cmledg.descrptn = cmledg_1.descrptn (tb_ts_cm_ofirecpt.impid = '195') , (tb_ts_cm_ofirecpt.action = 'reversed') tranid = cmledg.tranid tb_ts_cm_ofirecpt inner bring together cmledg - particualr line should tranid = select max(tranid) .... however kerep getting syntax error. appreciate yuor help regards, abhi not exclusively sure try: tranid = (select max(t...

deployment - What technology should I use/how should I deploy my killer web app? -

deployment - What technology should I use/how should I deploy my killer web app? - i decided time write "killer web app" dream about. :-) i've been programmer long can remember i'm not scared of technology, haven't been active in web world decade. looking help on direction should go. the app i'm considering: (in order of importance) 1) need charge customers securely using else's service 2) must scale 3) must inexpensive deploy 4) must reasonably responsive (much of client side javascript, there server interaction) 5) need database on end (not huge database, need scale client base) i'm thinking of using following: technology: mysql, php, javascript deployment: amazon cloud payment: paypal is right direction?? (any tutorial links appreciated) use know best. don't worry much technology choices. technologies list "safe" choices in sense many successful web apps have been built them, know can done. i...

asp.net - Applying Css Style to Asp:Menu MenuItem -

asp.net - Applying Css Style to Asp:Menu MenuItem - i'm creating vertical breadcrumb create website navigation mobile (iphone) website. similar maybe how http://news.bbc.co.uk/sport1/hi/football/default.stm works click "premier league" using asp:menu command , sitemapdatasource binding current levels links within sitemap , finding parent manually insert @ top of list. illustration resulting nav be: about, we, do, locations var mi = new menuitem(); mi.navigateurl = node.url; mi.text = node.title; mi.tooltip = node.description; mobilemenu.items.addat(0, mi); this fine , works perfectly. however, dynamically inserted top menuitem needs styled in different background colour. in illustration above "about" have darker bg colour 3 items below it. but there isn't kind of obvious property on menuitem this. how dynamically set style on menuitem inserting position 0? in reply used jquery li:nth-child() method set class li after utilize...

d3.js - Error in redrawing graph with update function -

d3.js - Error in redrawing graph with update function - i'm trying redraw , update graph every time slider moved, filters dataset within year range. unfortunately things aren't working , i'm unsure mistakes are. when seek run code error: error: invalid value <rect> attribute y="nan" error: invalid value <rect> attribute height="nan" i'm totally lost, help appreciated. link fiddle: http://jsfiddle.net/vyab4kcf/11/ you shouldn't doing this... request_data = data; and line referring global year when should local argument sexyear var yeardata = data.filter(function (element) { homecoming element.year == year }); should var yeardata = data.filter(function (element) { homecoming element.year == sexyear }); also, seek change event input works in ie... d3.select("#sexyear").on("change", function () { update(+this.value); }); this.value undefined here because...

rest - Python Tornado: Delete request never ends -

rest - Python Tornado: Delete request never ends - i having problems delete request in tornado. request arrives server , in handler work great, never returns response client. i have tried returning something, "return" , without "return" , result same. i using python 3.4, tornado 4.1 , restclient of firefox. @web.asynchronous @gen.coroutine def delete(self, _id): try: model = model() model.delete(_id) self.set_status(204) except exception e: logging.error(e) self.set_status(500) homecoming tornado documentation (tornado.web.asynchronous): if decorator given, response not finished when method > returns. request handler phone call self.finish() finish > http request. you need phone call tornado.web.requesthandler.finish method. work: @web.asynchronous @gen.coroutine def delete(self, _id): try: model = model() model.delete(_id) self.set_status(204) ...

android - ECC key generation error -

android - ECC key generation error - hi trying implement code provided anindonesian in flexiprovider - how encrypt/de formatted keypair on android. i getting nullpointerexception kpg.initialize(brainpoolp160r1); i new android , cryptography help appreciated. here have created page generates ecc key , encrypts/decrypts info , displays in text box. import android.os.bundle; import android.support.v7.app.actionbaractivity; import android.util.base64; import android.view.menu; import android.view.menuitem; import android.widget.textview; import org.bouncycastle.jce.provider.bouncycastleprovider; import java.security.invalidalgorithmparameterexception; import java.security.invalidkeyexception; import java.security.keypair; import java.security.keypairgenerator; import java.security.nosuchalgorithmexception; import java.security.nosuchproviderexception; import java.security.privatekey; import java.security.publickey; import java.security.security; import java.security.spec.ecg...

python imaging library - Re-coding Select JPEG Blocks with Pillow / PIL -

python imaging library - Re-coding Select JPEG Blocks with Pillow / PIL - is there someway in pil / pillow open jpeg file, modify portion of image , save image jpeg blocks modifications re-encoded? there libraries back upwards this: https://en.wikipedia.org/wiki/jpeg#lossless_editing what describing impossible. jpeg encodes in groups called mcus composed of 1 or more 8x8 info blocks. you'd have encode along info block or mcu boundary. the other problem dc coefficients (the [0,0] coefficient dc) encoded together. changing 1 means need alter ones follow. jpeg python-imaging-library pillow

html - Change column order using bootstrap push and pull -

html - Change column order using bootstrap push and pull - i have 3 columns in next order: <div class="container-fluid"> <h1>hello world!</h1> <p>resize browser window see effect.</p> <div class="row"> <div class="col-sm-3">left column</div> <div class="col-sm-6">center column</div> <div class="col-sm-3">right column</div> </div> </div> and want re-order force , pull. need center column on top, , others column size of 6. i found great reply may useful column order manipulation using col-lg-push , col-lg-pull in twitter bootstrap 3 bootstrap "mobile first" framework, html should reflect mobile version of site. pushing , pulling done on larger screens. html css twitter-bootstrap-3 responsive-design

pdflatex - Adding costume typeset tool TexWorks -

pdflatex - Adding costume typeset tool TexWorks - i currenly using texworks on linux. nail pdflatex 1 time bibtex 1 time , 2 more pdflatex pdf. fine. how , should add together costume typesetting compiles whole document in 1 click? pdflatex

jquery - dynamically changing selectbox -

jquery - dynamically changing selectbox - this question has reply here: use jquery alter sec select list based on first select list option 5 answers i have 2 selectbox. first 1 contains big category , , sec 1 contains little category countries , cities. america carifornia,ny,sandiego china beijing, shanghai state of japan tokyo, oosaka first selectbox <select name=countries> <option value=america>america</option> <option value=china>china</option> <option value=japan>japan</option> </select> second selectbox <select name=usacities> <option value=carifornia>carifornia</option> <option value=ny>ny</option> <option value=sandiego>sandiego</option> </select> now alter sec select box dynamically according first select box. useing jquery ...

php - Login [ Auth->identify() ] always false on CakePHP 3 -

php - Login [ Auth->identify() ] always false on CakePHP 3 - i started using cakephp 3 after time using cakephp 2 , having troubles create authentication login. the new auth function $this->auth->identify() homecoming false. on database, password encrypted perfect , query takes user it's ok too. my code: appcontroller: [...] class appcontroller extends controller{ public function initialize(){ $this->loadcomponent('flash'); $this->loadcomponent('auth', [ 'loginredirect' => [ 'controller' => 'admin', 'action' => 'index' ], 'logoutredirect' => [ 'controller' => 'pages', 'action' => 'display' ] ]); } public function beforefilter(event $event) { $this->auth->allow(['display...

openerp 7 - Existing report is not getting Download in OpenOfiice -

openerp 7 - Existing report is not getting Download in OpenOfiice - i trying modify existing study in open office(ex. point of sale receipt ) . when select download , showing error could not download url seems unsupported 1 . how can prepare error . openerp-7 odoo openerp-8 openoffice-writer odoo-8

javascript - Bootstrap's textarea renders oddly and ugly in firefox -

javascript - Bootstrap's textarea renders oddly and ugly in firefox - i'm trying create theme using bootstrap , i'm having problems textarea. works fine in chrome , chrome based browsers looks odd , ugly in firefox. here working fiddle (open in firefox). how prepare it??? want normal. , don't want break else fixing this. <div> <br /> <br /> <textarea id="s" type="text" name="s" value="enter text" ></textarea> </div> add css part: textarea { border: 1px solid #eee; } javascript html css twitter-bootstrap firefox

ruby on rails - money representation in mongoid -

ruby on rails - money representation in mongoid - how should work money mongoid? should configure bigdecimal? , @ rails level? activerecord have called money, afaik supports ar mongodb stores numbers in various bson info types (int, long int, double). recommend store money cents (if u.s. currency) , utilize long int datatype. ruby-on-rails mongodb mongoid

linux - What is the similar to printk in user mode? -

linux - What is the similar to printk in user mode? - we can utilize printk send debug message in kernal driver. have user mode ap phone call kernal driver. output user mode ap debug message kernal mode driver @ same time. how that? if understood question correctly, guess looking syslog c api. $ man 3 syslog tells need. linux debugging driver syslog printk

c# - How to convert blocking events to Observable? -

c# - How to convert blocking events to Observable? - i learning .net rx (reactive extensions) library , trying create proper observable read user input console. so far came this: public static iobservable<string> consoleinputobservable() { homecoming observable.create<string>(observer => { var cancelable = new booleandisposable(); while(!cancelable.isdisposed) { observer.onnext(console.readline()); } observer.oncompleted(); homecoming cancelable; }); } unfortunately, implementation has @ to the lowest degree 1 problem - there no way unsubscribe of it. so question is: how convert series of blocking events observable? thanks. edit: typos here go. note few things: this allows user supply appropriate scheduler command concurrency run, , yield each loop prevent getting gummed (although waiting on console pretty gummy an...

jquery - Rearrange image grid upon browser resize? -

jquery - Rearrange image grid upon browser resize? - i have pure css image grid wish improve create more responsive browser window size. columns , rows fixed, means when narrow browser window columns squashed, , ideal thing in scenario switch on fewer columns , more rows minimize image cropping (since images landscape oriented). html structure: <div class='padding'> <div class='column'> <div class='row'> <div class='thumb'> <div class='image' style='background-image:url(url)'></div> </div> <div class='thumb'> <div class='image' style='background-image:url(url)'></div> </div> </div> <div class='row'> <div class='thumb'> <div class='image' style='background-im...

java - Can not convert from element type Object to Session -

java - Can not convert from element type Object to Session - private static final set sessions = collections.synchronizedset(new hashset()); i storing sessions in set type reference variable called sessions s shown above. now, want iterate on these: for(session s : sessions){} however, type mismatch error @ says can not convert element type object session how prepare ? tl;dr: don't utilize rawtypes you using raw set , means compiler can know set contains object . you need specify generic type of collection: set<session> sessions = collections.synchronizedset(new hashset<>()); for more information, read this. java session servlets

Using PHP script to replace a field in HTML form -

Using PHP script to replace a field in HTML form - i need utilize php script replace 7th character of html form input field. eg. a234591q to become a23459iq replacing number1 letter. the problem don’t have acess php script file, need in html page client types data, or @ submit time. moises if have jquery library linked on page, can seek following. first should give input id e.g <input type="text" id="useranswer"> set onsubmit property of html form to: <form action="" onsubmit="replaceat(7,$('#useranswer').val())"> then define replaceat function. function replaceat(index,word){ newword=word.substr(0,index) + 'l' + word.substr(index+1); $('#useranser').val(newword); } i have given reply question not clear how plan implement without access source php

detect how a button was pressed in javascript -

detect how a button was pressed in javascript - is there way observe how button pressed? mouse clicked //mouse event highlighted via tab come in key //keypress event touched (mobile phones) //touch event is there short javascript way observe this? or need add together event listeners click, enter, , touch? want info form submits. thanks this how can handle highlighted via tab come in key //keypress event $('a').click(function(e) { console.log(e); // screen positions returns 0 on come in if( e.screenx == 0 && e.screeny == 0 ) { alert('enter'); } else if( e.type == "click" ) { alert('click'); } }); demo ofcause rest observe easily. javascript

ios - Orientation Lock of UIViewController - Xcode - Swift -

ios - Orientation Lock of UIViewController - Xcode - Swift - this question has reply here: setting device orientation in swift ios 11 answers how forcefulness view controller orientation in ios 8? 12 answers how forcefulness view controller remain in portrait mode programmatically? have created share extension ios app , need view remain in portrait mode of time, despite orientation of device. override methods below not work: override func supportedinterfaceorientations() -> int { homecoming int(uiinterfaceorientation.portrait.rawvalue) } override func preferredinterfaceorientationforpresentation() -> uiinterfaceorientation { homecoming uiinterfaceorientation.portrait } override func shouldautorotate() -> bool { homecoming false } you can uti...

objective c - How to rearrange NSDictionary according to the values? -

objective c - How to rearrange NSDictionary according to the values? - i need list dictionary values. highest mark lowest. how can handle this? i need list marks , corresponding names , details in table view. 2015-04-06 14:48:53.381 camelproject[3310:597950] valueforkey title = ( { camelid = 237; color = bg; comments = "fhjfnfnfjfihgjfmsndidm,almcmcuirowmvn vmmc jdmdmcm"; compid = 235; dateofbirth = "/date(1424725200000)/"; description = "rtrtttrtrehndskvn;lkdf;lm;mgemln;lm';' jknt;l"; fromuserid = 564987631; fromusername = 564987631; id = 4; indvmarks = "5;5;3;4;2;2;2;2;5;9"; marks = 39; name = name3sv; outof = 100; profilephoto = "2d0b36f3-71b3-4b5f-a375-7ad4d0aff1af.jpg\n"; toname = hasnam; tousername = 564987631; types = dsfv; userid = 564987631; fromname = hasnam; }, { camelid = 237; color = bg; comments = "";...

d3.js, mapbox/leaflet and meteor - animations on maps -

d3.js, mapbox/leaflet and meteor - animations on maps - i add together animated line mapbox/leaflet map have incorporated meteor app (something akin can seen here: d3, leaflet animation). aim draw great circle/geodesic arc connects 2 points - without using d3, i'm drawing static arc next code: template.explore.rendered = () -> l.mapbox.accesstoken = 'access_token_mapbox' map = l.mapbox.map('map', 'map_id', zoomcontrol: false) countrypair = countrypairs.findone() geojson = { 'type': 'featurecollection' 'features': [ { 'type': 'feature' 'geometry': 'type': 'point' 'coordinates': [ countrypair.country_a_longitude_dec countrypair.country_a_latitude_dec ] 'properties': 'name': 'country a' } { ...

in android only push some part of view instead whole view, while open keyboard -

in android only push some part of view instead whole view, while open keyboard - i want force part of screen instead whole view for illustration below screen when click on edit text in centerview scrollview want pushup, title bar , below sentinal button should remain same instead right i have read many post related issue also have set mactivity.getwindow().setsoftinputmode( windowmanager.layoutparams.soft_input_state_visible | windowmanager.layoutparams.soft_input_adjust_resize); i have set in menifest file android:windowsoftinputmode="statehidden|adjustpan" > general overview of design activity -----linearlayout------- weightsum(20) title bar(textview)------ weight - 3 fragment weight - 15 -----scrollview------- <linearlayout> --list_item 1 --lis...

Spring security logout handling -

Spring security logout handling - according spring security 4.0.0 document: 4.2.4 logout handling the logout element adds back upwards logging out navigating particular url. the default logout url /logout, can set else using logout-url attribute. more info on other available attributes may found in namespace appendix. however, after next security setting in doc, url /logout doesn't show logout page. instead, shows on contrary, url /login works properly. the next setting: spring framework 4.1.6 spring security 4.0.0 web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>test8</display-name> <welcome-file-l...

php - Making a directory based on username? -

php - Making a directory based on username? - i trying create directory mkdir code. when utilize code : mkdir("test"); then, "test" directory created. when seek this mkdir($_session['username']); then, got error saying warning: mkdir(): open_basedir restriction in effect. file() not within allowed path(s) what mean? tried $path = $_session['username']; mkdir($path); and mkdir("".$_session['username'].""); but gives me same error message. supposed do? make sure prefix folder name total path want create folders. ie, if trying create folders under /tmp/users might utilize code like: mkdir('/tmp/users/' . $_session['username']); you need create sure have configured php allow access path. see open_basedir ini directive: http://php.net/manual/en/ini.core.php#ini.open-basedir php

javascript - AngularJS UI-Router does not work as the way ng-router works -

javascript - AngularJS UI-Router does not work as the way ng-router works - i'm trying utilize angular ui-router library has more features ng-router. however, ng-router works in page while ui-router not work. angular code $stateprovider .state('map.main', { url: '/', template: '<h1>my contacts</h1>' }); //$routeprovider.when( //"/", { // template: '<h1>my contacts</h1>' //}); $locationprovider.html5mode(false); html code simple div tag ng-view or ui-view. anyone can think problems? there a working plunker you need adjust state def @ to the lowest degree this .state('map', { abstract: true, template: '<div ui-view=""></div>', }) .state('map.main', { url: '/', template: '<h1>my contacts</h1>' }); what can see, there new state "map" parent of ...

asp classic - display detailed error message on IIS 7.5 -

asp classic - display detailed error message on IIS 7.5 - i'm trying display detailed error message on page using web.config on remote server on hostgator running iis 7.5. i've tried can't work. <configuration> <system.webserver> <httperrors errormode="detailed" existingresponse="passthrough" /> </system.webserver> </configuration> when preview page error. error occurred on server when processing url. please contact scheme administrator. if scheme administrator please click here find out more error. perhaps other way detailed info (sorry, iis 8.5) see sample of 500.asp page in me comment above asp-classic web-config iis-7.5

java - Sorting Strings using Collections.sort? -

java - Sorting Strings using Collections.sort? - i'm attempting sort 2 strings using collection.sort() method, i'm having issues understanding logic of implementation. here have far. there issues implementation? note: want sort them alphabetically: "apple" > "orange" collections.sort(mailbox.getmessages() , (string a, string b) -> { if (string.valueof(a.charat(0)) > string.valueof(b.charat(0))) { homecoming -1; } else if (string.valueof(a.charat(0)) < string.valueof(b.charat(0))) { homecoming 1; } else { homecoming 0; } }); string implements comparable<string> implemented lexicographical comparison, in other words, default "apple".compareto("orange") < 0 . default sufficient. now collections.sort has variant takes comparator account, can use: collections.sort(mailbox.getmessages()); about own implementation: you shouldn't u...

authentication - Logged in session handling in server or client? -

authentication - Logged in session handling in server or client? - i have read of results (at to the lowest degree find in google search), 1 of famous seems this one, checked on github code, like this custom authentication in azure mobile services using node.js. all have points, , noticed generated token not persisted in database no solution far, meaning leave client responsibility of session handling , logout. think might thought allow server handle, on other hand, letting client cache returned token , handle re-establish authentication saves trip database adds little bit of code client side. also in microsoft azure article demonstrate how cache tokens returned service in ios application using sskeychain wrapper around ios keychain. what i'm searching if there reason there no solution demonstrating azure mobile services using javascript , consider good/better solution on server/client session handling. session authentication azure-mobile-services

Use C++ to compare changes in XML -

Use C++ to compare changes in XML - i have 2 big xml files have same schema different entries. each day entries alter , want able find: entry appears in file not file b entry appears in file b not file a entry appears in both file , b i'm new programming , i'm having hard time understanding efficient way approach this. using (trillions of) loops key this? ideas on route solve problem appreciated. give thanks you. example shortened xml file: <?xml version="1.0" encoding="iso-8859-1" ?> <site_entries> <entry> <id><![cdata[946757316]]></id> <url><![cdata[http://www.site.co.uk/cgi-bin/tr.cgi?tid=752276]]></url> <content><![cdata[specialized dolce sport 27 speed]]></content> <title><![cdata[bike]]></title> <price><![cdata[£600]]></price> <date><![cdata[01-aug-13]]></date> <display_reference><![cdata[214683-501429...

android - import class/method from java file -

android - import class/method from java file - i'm learning android , java, , having issues importing java file. i working time , date illustration in android api demos, , want set code relating creating time , date dialogs setting values etc separate java file, , in main java file run when application starts, declare buttons , onclick events. what best way this? need set code within class(that extends activity) or method? how utilize within main class? the code illustration is: package com.datetest; import android.app.activity; import android.os.bundle; import android.app.activity; import android.app.datepickerdialog; import android.app.timepickerdialog; import android.app.dialog; import android.os.bundle; import android.widget.textview; import android.widget.button; import android.widget.datepicker; import android.widget.timepicker; import android.view.view; import java.util.calendar; public class datetest extends activity { // display selected date , t...

opengl - how can glFlush() affect rendering correctness? -

opengl - how can glFlush() affect rendering correctness? - upon noticing there unexpected artefacts in other opengl programs, did digging , discovered can upgrade opengl stack on ubuntu: https://launchpad.net/~xorg-edgers/+archive/ppa after updating, gl rendering faster (my test programs below doubled in speed!) , without artefacts. so reply own question: how can glflush() impact rendering correctness? when drivers buggy. === original question === or, more correctly, fundamental bug classic untrendy non-shader-vbo-stuff? cdef struct xyz: float x, y, z cdef inline void _normal(xyz b,xyz a): glnormal3f(a.x-b.x,a.y-b.y,a.z-b.z) cdef inline void _draw_quad(xyz a,xyz b,xyz c,xyz d): glvertex3f(a.x,a.y,a.z) glvertex3f(b.x,b.y,b.z) glvertex3f(c.x,c.y,c.z) glvertex3f(d.x,d.y,d.z) cdef void _draw_grid(xyz a,xyz b,xyz c,xyz d): glbegin(gl_line_loop) _draw_quad(a,b,...

jquery - Vertically scrollable and horizontally draggable divs on mobile -

jquery - Vertically scrollable and horizontally draggable divs on mobile - i'm trying create mobile website card interface. interaction want create list of cards can scroll through , dismiss swiping them away. in order accomplish using jquery ui jquery ui touch punch create work touch devices. the problem i'm running when scroll touch event starting on div uses dragging horizontally, ignoring vertical swipe. there way prevent this, or different library improve suited needs? this website need for: http://tijmen.kervers.nl/b1.2 (it shows behaviour on touch device, works pretty much fine on desktops) a similar question has been asked before, remained unanswered: jquery-ui horizontal dragging vertical scrolling and less of import question; dragging pretty jerky causing this? i'm using several libraries , css frameworks on top of each other, guess colliding jquery ui. i'll looking after scrolling fixed, if knows causing great! edit2: nope, wasn...

How to perform Vector-Matrix Multiplication with BLAS ? -

How to perform Vector-Matrix Multiplication with BLAS ? - blas defines gemv (matrix-vector multiplication) level-2 operation. how utilize blas library perform vector-matrix multiplication ? it's obvious, don't see how utilize blas operation multiplication. have expected gevm operation. the matrix-vector multiplication of (m x n) matrix (n x 1) vector result (m x 1) vector. in short a*a(mxn)*x(nx1) + b*y(mx1) -> y(mx1) . of course of study can utilize incx , incy when vector included in matrix. in order define vector-matrix multiplication vector should transposed. i.e. a*x(1xm)*a(mxn) + b*y(1xn) -> y(1xn) . not have vector single row matrix. starting point there 2 possibilities. either utilize level-3 "gemm" ?gemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc) using ?gemm('n', 'n', 1, n, m, a, x, 1, a, m, b, y, 1) or more math. considering (x*a)^t = a^t * x^t row matrix x converted vector x^t...

transactions - How do I configure MS SQL server to avoid update lock (LCK_M_U) -

transactions - How do I configure MS SQL server to avoid update lock (LCK_M_U) - i have ms sql server database containing several tables. each table has field 'sn'. several clients can work database, every client operates records own value of sn. one type of client app legacy software written in python using pyodbc. understand, software can create long transactions - can execute update or insert statements , commit them several hours later. know, wrong that, not desirable modify software. transaction isolation level set read_commited read_committed_snapshot set on. everything work ok except next scenario: first, legacy clent starts transaction updates records whith sn value, sn = 1 another client app tries update records sn value, sn = 2 this situation results in lck_m_u lock sec client: ridlock field = 1 pageid = 311 dbid=5 id=lock2776cf380 mode=x associatedobjectid=...many numbers here... although 2 clients utilize different sn values results in lock. sus...

Nginx locations configuration for two directions -

Nginx locations configuration for two directions - i have little experience configuring nginx server , here trouble. trying set right locations. have 2 directs: address.com , address.com/api. for lastly direction(api) have setted locations , works fine. api located in /var/www/project/api folder. root /var/www/project; index index.php; server_name localhost; location /api { try_files /api/$uri $uri/ /api/index.php?$query_string; fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^/api/(.+\.php)(/.+)$; fastcgi_intercept_errors on; fastcgi_index index.php; include fastcgi_params; } location ~ \.php$ { try_files $uri =404; fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; include fastcgi_params; fastcg...

c++ - Qt: QList thread issue -

c++ - Qt: QList thread issue - the doc says qlist reentrant. next code thread safe? //worker thread ... if(mylist.size() == 0) { ... } //main thread foreach(qimage, mylist) { ... } all ... parts have nil mylist. mylist object in 2 threads same object. thread safe? if mylist const , hence accesses read only, thread safe. but if in @ to the lowest degree 1 thread code doing non-const access on object, not thread safe. to sure doing read-only operations, declare const reference on mylist , utilize 1 in concurrent code : const qlist<qimage> & constmylist = mylist; this has nil reentrancy. reentrancy tells if doing operations (read or write) on 2 different qlist instances in 2 different threads respectively, behavior defined. for instance, non-reentrant class may utilize static functions/members in non-static methods. if these static functions/members not guarded, class methods not reentrant : when working on 2 independent objects, behavior...

I cannot import the PircBotx lib from Maven Repository with Gradle on Android Studio -

I cannot import the PircBotx lib from Maven Repository with Gradle on Android Studio - im migrating eclipse android studio. wanna utilize gradle import pircbotx lib maven. message: error (15, 13) failed resolve: org.pircbotx:pircbotx:2.0.1 what wrong? should do? in advance. android maven android-studio android-gradle

javascript - knockoutjs div binding not working -

javascript - knockoutjs div binding not working - i'm trying bind dynamic values div reason div doesn't fetch info properly. this have: html: <div class="section-content tabcontent sc7" id="grideventlimits" style="padding: 0; background-color: #fff; display: none"> <div style="clear: both"> </div> <table> <tr> <td></td> <td></td> <td colspan="4"></td> </tr> <tr> <table class="sgrid" data-bind="visible: skills && skills.length > 0" style="width: 100%; border-collapse: collapse; border: solid 1px #aaa"> <thead> ...

Polymer broken on Safari after using Vulcanize -

Polymer broken on Safari after using Vulcanize - after vulcanizing (putting javascript external file google csp compliancy) polymer project (i'm using in google mobile app) realized safari (and hence ios) getting bug wasn't before: typeerror: undefined not function (evaluating 'document.registerelement('polymer-element', {prototype: prototype})') (anonymous function) this causing none of polymer things render on screen. ideas? i'm lost here. safari polymer

excel - Recall User Selections Within Multiple Modules -

excel - Recall User Selections Within Multiple Modules - my current code uses workbook_open event run userform asks user wants do, if select "a" populates userform listbox displays open workbooks.name(s). using listbox_dblclick event, want user able double-click name of workbook wish create active run tasks involve copying info 1 sheet (a workbook exported temporary folder semi-impossible naming system) workbook know name , location of. cannot seem listbox value recalled after double-click event. pointers? code within userform2: option explicit public vval string private sub listbox1_dblclick(byval cancel msforms.returnboolean) vval = me.listbox1.value phone call automateme unload me end sub private sub userform_initialize() dim wkb workbook me.listbox1 each wkb in application.workbooks .additem wkb.name next wkb end end sub the sub double-click event calls (the 1 having problems with) is: sub automateme() listbox1.value worksheets("...

debugging - Reference - What does this error mean in PHP? -

debugging - Reference - What does this error mean in PHP? - what this? this number of answers warnings, errors , notices might encounter while programming php , have no clue how fix. community wiki, invited participate in adding , maintaining list. why this? questions "headers sent" or "calling fellow member of non-object" pop on stack overflow. root cause of questions same. answers questions typically repeat them , show op line alter in his/her particular case. these answers not add together value site because apply op's particular code. other users having same error can not read solution out of because localized. sad, because 1 time understood root cause, fixing error trivial. hence, list tries explain solution in general way apply. what should here? if question has been marked duplicate of this, please find error message below , apply prepare code. answers contain farther links investigate in case shouldn't clear general reply alone. ...

osx - Prevent UIs interaction in Sparkle -

osx - Prevent UIs interaction in Sparkle - i trying utilize sparkle update app (not current app). start simple creating updater object: var updater = suupdater(forbundle: appbundle) the problem i'm having that line of code can open ui dialogs if go wrong. example: i can solve problem, concern code running on screensaver , popping dialog blocks point hard reboot way move forward. is there way prevent sparkle ever opening kind of ui? osx cocoa sparkle

sockets - TCP Server not receiving anything after initial connection. Python -

sockets - TCP Server not receiving anything after initial connection. Python - so, i've been experimenting python's socket module , i've created simple tcp client/server setup. everything's running on same scheme (win7x64), on ip 192.168.1.3 here's client (it's reverse tcp connection): import socket, subprocess, time me = '192.168.1.3' port = 1332 s = socket.socket(socket.af_inet, socket.sock_stream) while true: try: s.connect((me, port)) break except: time.sleep(1) s.send('[*] connected!') while true: info = s.recv(1024) output = subprocess.check_output(data, shell=true) s.send(output) s.close() here's server: import socket host = '0.0.0.0' port = 1332 s = socket.socket(socket.af_inet, socket.sock_stream) s.bind((host, port)) s.listen(5) def handler(client): req = client.recv(1024) print 'recieved: %s' % req command = raw_input('...

php - preg_replace: how do I strip off all white space and ? -

php - preg_replace: how do I strip off all white space and &nbsp;? - how strip off white space , &nbsp; ? i have input in wrapper create, [b] &nbsp; &nbsp; &nbsp; bold &nbsp; &nbsp; &nbsp; [/b] so before turning text bold, want strip off white spaces , &nbsp, , turn [b]bold[/b] , $this->content = preg_replace("/\[(.*?)\]\s\s+(.*?)\s\s+\[\/(.*?)\]/", "[$1]$2[/$3]", $this->content); but not work! can help please? there no need regex based solution. can utilize str_replace as: $input = "[b] &nbsp; &nbsp; &nbsp; bold &nbsp; &nbsp; &nbsp; [/b]"; $input = str_replace(array(' ','&nbsp;'),'',$input); echo trim($input); // prints [b]bold[/b] php regex preg-replace whitespace

android - Executing multiple statements with SQLiteDatabase.execSQL -

android - Executing multiple statements with SQLiteDatabase.execSQL - i've followed standard tutorial building database android. i've created class called dbhelper extends sqliteopenhelper. i've overridden create handler execute string. @override public void oncreate(sqlitedatabase db) { db.execsql(dbdefinitions.db_create); } dbdefinitions.db_create static string i've created. public static final string table_messages = "messages"; public static final string table_friends = "friends"; public static final string state_ok = "state_ok"; public static final string db_create = "create table " + table_messages + " (_id integer primary key, user_id integer not null, created_on integer, subject text not null, summary text not null, messagetext text null, read integer not null, status text not null default '" + state_ok + "'); " + "create table " + table_friends + " ...

Accessing XML using XSLT -

Accessing XML using XSLT - i have xml of next format <catalog> <cd> <title>cd name</title> </cd> </catalog> i can utilize xslt element value using following: <xsl:template match="/"> <xsl:for-each select="catalog/cd"> <xsl:value-of select="title" /> </xsl:for-each> but, trying figure out xsl code read xml in next format: <catalog> <cd title="cd name"/> </catalog> how do this? , if can post xslt tutorial link, much appreciated. thanks in advance i have xml of next format <catalog> <cd> <title>cd name</title> </cd> </catalog> can utilize xslt element value using following: <xsl:template match="/"> <xsl:for-each select="catalog/cd"> <xsl:value-of select="title" /> </xsl:for-each> but, trying figure ...