Posts

Showing posts from March, 2013

expressionbuilder - Microsoft Access - query checkbox based on textbox -

i have field text field containing dates. have checkbox named "delivered" if text field contains date, "delivered" checkbox value "true" / ticked. if text field isnull, checkbox value must "false" / not ticked i have tried following in query expression builder of checkbox: iif([datefield]="";false;true) but keep getting error expression being built incorrectly? you trying store calculation/dependent value in table based on field in same table, not advisable , should not carried forward. calculations should done when , required, display on forms, query export or reports show. more info on calculation field available here : http://allenbrowne.com/casu-14.html if want can create update query as, update tablename set deliveredfieldname = iif(len(datefieldname & '') = 0, false, true);

spring boot - HATEOAS methods not found -

my controller can't seem find hateoas methods "linkto". am missing something? pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>org.springframework</groupid> <artifactid>provider</artifactid> <version>0.1.0</version> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.1.5.release</version> </parent> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>s

c++ - Visualize motion/gesture from acceleration data -

i have implemented gesture detection algorithm user can define own gestures. gestures defined acceleration values send accelerometer. now question is: is possible visualize performed gesture, user can identify gesture performed? my first idea , try use verlet velocity integration (as describec here: http://lolengine.net/blog/2011/12/14/understanding-motion-in-games ) calculate corresponding positions , use form line strip in opengl. rendering works, result not @ performed gesture looked like. this code: float deltatime = 0.01; posdata null; null.x = 0.0f; null.y = 0.0f; null.z = 0.0f; this->vertices.push_back(null); float velx = 0.0f; float vely = 0.0f; float velz = 0.0f; (int = 0; < accdata.size(); i++) { float oldvelx = velx; float oldvely = vely; float oldvelz = velz; velx = velx + accdata[i].x * deltatime; vely = vely + accdata[i].y * deltatime; velz = velz + accdata[i].z * de

windows runtime - CryptographicBuffer.ConvertStringToBinary outputs a string rather than "binary" -

i'm using simple method save string: public static async void savestringasync(string stringdata, string filename) { storagefolder localfolder = applicationdata.current.localfolder; storagefile file = await localfolder.createfileasync(filename, creationcollisionoption.replaceexisting); ibuffer buffer = cryptographicbuffer.convertstringtobinary(stringdata, binarystringencoding.utf8); await fileio.writebufferasync(file, buffer); } when open saved file in notepad, see string in full glory. under impression saving binary mean if open file in notepad, i'll see garbage , random characters. i wanted see light obfuscation saving even though not security requirement (no passwords, sensitive data being saved of kind). there no way write out file show nonsense rather pure string?

javascript - Fire Key event from chrome extension: Uncaught TypeError: Cannot read property 'ime' of undefined -

i'm trying fire key events when clicking on chrome extension button. manifest: ... "background": { "scripts": ["a.js"] }, "permissions": [ "activetab", "input" ], ... a.js chrome.browseraction.onclicked.addlistener(function(tab) { ... chrome.tabs.executescript({ file: "script.js" }); }); script.js var e = new keyboardevent("keydown", {bubbles : false, cancelable : true, key : "left"}); var e2 = new keyboardevent("keyup", {bubbles : false, cancelable : true, key : "left"}); chrome.input.ime.sendkeyevents({contextid:0, keydata:[e, e2]}, function() {console.log("callback");}); what console prints is: uncaught typeerror: cannot read property 'ime' of undefined im on chrome 35 / ubuntu 12.04 thank you! this indicates chrome.input.ime api not available content scripts, chrome apis. you must op

css - Using Less, CSS3 calc() doesn't work correctly -

when use calc(100% + 20px) directly in chromes , firefox' inspector works fine , shown. however when insert less file gets converted 120% . doing wrong? i use less imho it's better mention in question because less try process maths including 100% + 20px . you either set strict math on : lessc -sm=on lessc --strict-math=on or use tilde-quote ~"100% + 20px" in order prevent statement being processed less. for instance: .class { padding-left: calc(~"100% + 20px"); }

javascript - using this rather than $(this) in an .each() call -

i've done quite lot of reading past day deeper understanding of vs. $(this) , how js determines interprets, still can't figure out 1 detail of plugin i'm analyzing deepen knowledge: $.fn.pluginname = function(options) { return this.each(function() { new $.pluginname(this,options); }); }; everything i've read indicates although this.each() used call jquery.prototype.each(), each object should referred $(this) within each() function, above uses regular ol' this, , can't figure why. $.pluginname declaration looks this: $.pluginname = function(el,options) { ... } any insights may have big help. edit: here's full source on github from mdn : when function called method of object, set object method called on. when call like $('#mydiv').pluginname() the function called method of jquery object $('#mydiv') . so, in case, this refers jquery object, don't need $() wrapper. a common case when need $()

java - Jackson serialization of Map of objects -

i'm attempting use jackson serialize , deserialize map containing arbitrary objects. according docs i've read should able use enabledefaulttyping() tell jackson store info need in serialization, , have written following simple test: @test public void testobjectmap() { final objectmapper mapper = new objectmapper().enabledefaulttyping(); final map<string, object> map = maps.newhashmap(); map.put("test1", new date()); map.put("test2", new inetsocketaddress(10)); try { final string ser = mapper.writevalueasstring(map); system.err.println(ser); final map<string, object> deser = this.mapper.readvalue(ser, new typereference<map<string, object>>(){}); asserttrue(deser.get("test1") instanceof date); asserttrue(deser.get("test2") instanceof inetsocketaddress); } catch (final ioexception e) { fail("failed", e); } } the s

sql - mysql 2 join error on multiple WHERE clause -

i trying call specific information sql table using following statement select `prop_street`, `prop_price`, `prop_status`, `agt_fname`, `agt_lname` `property`, `agent` property.prop_agent = agent.agt_fname && property.prop_status = ("sold" , "available sale", "under contract"); as can see, trying call listed sold , available sale , under contract . while try this, getting error operand should contain 1 coulmn happens when trying call more 1 prop_status this proper syntax you're trying do: select prop_street, prop_price, prop_status, agt_fname, agt_lname property p join agent on p.prop_agent = a.agt_fname p.prop_status in ('sold', 'available sale', 'under contract') some notes: join conditions belong in join clause, not clause. although there no functional difference, practice. && mean "and" in other languages, not sql. have use "and" use single quotes liter

c# - Bad MVVM practice? (CommandParameter) -

in code have 3 buttons. each of them execute different. have let them execute using same command gave them different commandparameter's specify difference. here's example of i'm talking xaml: <button command="{binding updatecommand}" commandparameter="add">add client</button> <button command="{binding updatecommand}" commandparameter="change">change client</button> <button command="{binding updatecommand}" commandparameter="remove">remove client</button> viewmodel: public mainwindowviewmodel() { clients.add(new client() { name = "client 1" }); clients.add(new client() { name = "client 2" }); //updatecommand = new clientupdatecommand(this); updatecommand = new delegatecommand(param => clientexecutecommand((string)param), param => clientcanex

Rails and Rspec - Has One Through Polymorphic -

i trying test has_one :through relationship in rails using shoulda matchers. my relationship structure looks (it's reverse polymorphic association - https://gist.github.com/runemadsen/1242485 ) class container < activerecord::base has_many :contents has_many :videos, through: :contents, source: :item, source_type: "video" end class content < activerecord::base belongs_to :container, dependent: :destroy belongs_to :item, polymorphic: true, dependent: :destroy end class video < activerecord::base has_one :content, as: :item has_one :container, through: :contents end this shoulda matcher code in rspec: # video_spec.rb { should have_one(:container).through(:contents) } the error is: undefined method `klass' nil:nilclass can tell me why i'm receiving error , how test association? assuming that's all code in spec file (i apologize if posted trimmed down version), need nest shoulda matcher under describe block vide

r factor - R how to change one of the level to NA -

i have data set , 1 of column has factor levels "a" "b" "c" "notperformed" . how can change "notperformed" factors na? set level na: x <- factor(c("a", "b", "c", "notperformed")) x ## [1] b c notperformed ## levels: b c notperformed levels(x)[levels(x)=='notperformed'] <- na x ## [1] b c <na> ## levels: b c note factor level removed.

c# - Getting error due to column name of my database table is "from" -

my database column name "from" getting error while change column name other name error not occuring.why? protected void button1_click(object sender, eventargs e) { sqlconnection con = new sqlconnection(configurationmanager.connectionstrings["mycon"].connectionstring); con.open(); string qry="insert mynew(name,age,from,address,job)values(@name,@age,@from,@address,@job)"; sqlcommand cmd= new sqlcommand(qry, con); cmd.parameters.addwithvalue("@name", textbox1.text); cmd.parameters.addwithvalue("@age", textbox2.text); cmd.parameters.addwithvalue("@from",textbox3.text); cmd.parameters.addwithvalue("@address", textbox4.text); cmd.parameters.addwithvalue("@job", textbox5.text); cmd.executenonquery(); con.close(); } when change column name city not getting error why happening? from reserved keyword in sql. if want use table name, have escape

windows - win32 ro win64 in the python output info? -

i have installed win7 ultimate 64 ,when enter python d:\python34\python python 3.4.0 (v3.4.0:04f714765c13, mar 16 2014, 19:25:23) [msc v.1600 64 bit (am d64)] on win32 why info not following: python 3.4.0 (v3.4.0:04f714765c13, mar 16 2014, 19:25:23) [msc v.1600 64 bit (am d64)] on win64 because windows 64-bit api entirely same windows 32-bit api , both referred win32 short. while there number of significant differences between windows 16-bit , 32-bit api, 32-bit , 64-bit apis can used interchangeably. the 64 bit (amd64) part of version banner lets know you're using 64-bit version of python.

qt - Python signals and slots between classes -

i trying gui app in python/pyqt have sliderdialog class send list of scalers mainwindow via signals , emits .... following code not work. sliders change value ... mainwindow not see signals, thought emit inform mainwindow. no. help? oh - know have not set pass scaler values, since signals don't work not pursuing this. from pyqt4 import qtcore pyqt4 import qtgui offset_y = 15 offset_x = 5 spacer_y = 20 spacer_x = 50 switch = [1.0, 2.0, 3.0, 6.0, 9.0, 12.0, 18.0] class mainwindow(qtgui.qmainwindow): sliderupdate = qtcore.signal('sliderupdate()') def __init__(self): super(mainwindow, self).__init__() sdlg = sliderdialog(self, 5) sdlg.connect(self, qtcore.signal('sliderupdate'), self.scalers) sdlg.show() def scalers(self) : print "in scalers of mainwindow!" class sliderdialog(qtgui.qdialog) : slidermoved = qtcore.pyqtsignal() def __init__( self, parent, datacount ) : super(

enums - C++ Switch on Data Type -

i have attribute class has enum specifying type of attribute ( int_64, uint 64, int_32, string, double, etc. ). attribute class uses boost::any hold vector of types specified enum. at moment in order work data have big switch statement, , @ least fundamental data types feel there easier way it. my switch statement looks this: switch(attribute.type) { case double: stmt->setnumber(col_counter, number(attribute.get_value<double>(row_counter))); break; case int_32: stmt->setnumber(col_counter, number(attribute.get_value<int_32t>(row_counter))); break; } attribute defined as: class attribute { public: template <typename t> t get_value(const unsigned index) const { const std::vector<t> * v = boost::any_cast<const std::vector<t> >(&data); return v->at(index); } data_type_enum type; std::string name; boost::

python - Find a file on a PC and replace a string erases whole file -

i need particular file on pc , replace portion of repeats of string within file. using python 2.6. script finds file instead of replacing instances of string, wipes file blank. idea why? import os os.path import join import fileinput lookfor = "particular.txt" texttosearch = "alonglineoftext@thefile" texttoreplace = "alonglineoftext@withnewtextinthefile" root, dirs, files in os.walk('c:\\'): print "searching", root if lookfor in files: line in fileinput.fileinput((join(root, lookfor)),inplace=1): line = line.replace(texttosearch, texttoreplace) print line break any suggestions? thanks i tested code , works fine 1 small bug: the following line: line = line.replace(texttosearch, texttoreplace) should replaced with: line = line.strip().replace(texttosearch, texttoreplace) otherwise each line appended newline - reason don't find replacements (since you're expecting them in diff

linux - shell get parse arguments -

this question has answer here: using getopts in bash shell script long , short command line options 28 answers i want use shell script this: myscript.sh -key keyvalue how can keyvalue ? tried getopts , requires key single letter! use manual loop such as: while :; case $1 in -key) shift echo $1 break ;; *) break esac done

GUI on C in VIsual Studio 2013 -

how create gui using c language in visual studio 2012/2013? libraries should use , there short introductory? you can use standard winapi in windows, let create simple graphical user interface program (but can painful) http://zetcode.com/gui/winapi/ (and especially: http://zetcode.com/gui/winapi/dialogs/ )

ios - AES encryption security provider error -

ok. have experienced problem quite sometime. feeling getting close, need pointed in right direction. using cool third party library called fbencryptorae: nsstring * encryptedmessage = [fbencryptoraes encryptbase64string:localquery keystring:key separatelines:no]; when post encrypted query server, following error: the aes/cbc/pkcs7padding algorithm not supported security provider have chosen here's constraints are: 128 bit key aes/cbc/pkcs5padding, base64 coldfusion based off of readings, pkcs5padding/ pkcs7padding same thing?? if kind , me understand: why getting error. is there sample code can view based off of constraints have? appreciate help. pkcs5padding , pkcs7padding produce same result aes, same. if using cbc iv required. how iv made same both encryption on ios , decryption on server? fbencryptoraes has iv capability (raw data) not (base64) defaulting "nil" (from docs). must correct. since fbencryptoraes not support need

setinterval - Jquery background-image cycle w/fade-in/out -

how can change progressive fade-in/fade-out commented out applies background image , not whole containing div? in current state entire div along content fading in/out along background image change, need crossfade or fadein/out apply background images transition. i understand why it's applying whole div , not figuring out how write differently affecting background-image. $(window).load(function() { var =0; var images = []; images[ 0 ] = 'images/image1.jpg'; images[ 1 ] = 'images/image2.jpg'; images[ 2 ] = 'images/image3.jpg'; images[ 3 ] = 'images/image4.jpg'; var image = $('#container'); //initial background image setup image.css('background-image', 'url(images/image4.jpg)'); //change image @ regular intervals setinterval(function(){ //image.fadeout(1000, function () { image.css('background-image', 'url(' + images [i++] +')');

wpf - How to receive the InkCanvas.StrokeCollected event in the view model -

in using mvvm pattern, have custom inkcanvas with: protected override void onstrokecollected(inkcanvasstrokecollectedeventargs e) { customstroke newstroke = new customstroke(e.stroke.styluspoints, e.stroke.drawingattributes); this.strokes.remove(e.stroke); this.strokes.add(newstroke); inkcanvasstrokecollectedeventargs enew = new inkcanvasstrokecollectedeventargs(newstroke); // raises system.windows.controls.inkcanvas.strokecollected event. base.onstrokecollected(enew); } how view model receive inkcanvas.strokecollected event? i can not bind xaml strokes strokecollection.collectionchanged event called 3 times custom inkcanvas. any appreciated. try this public window3() { initializecomponent(); var vm=new viewmodel(); this.datacontext = vm; canvas.strokecollected += vm.onstrokecollected; } viewmodel public class viewmodel { public void onstrokecollect

ibm mq - Getting error message while initializing IBM MQ from java class -

exception in thread "main" java.lang.unsatisfiedlinkerror: no mqjbnd05 in java.library.path while creating mqqueuemanager. i have no idea why happening.. can u please me. it's worth noting mqjbnd05 library loaded mq v6 java clients. mq v6 out of support. mqjbnd name of library v7 onwards.

Restrict application to install only on specific imei android devices -

i have developed education app specific people. want app installed on devices (on specific imei devices). i know that, after application installed, app can verify imei numbers. know that, can put restriction (like minimum sdk version) in manifest file. wondering, there device id restriction can add inside manifest file, verify while installation. if so, generate different apk files of them... from android there no way mean cannot restrict through permission yes through smart coding can achieve it 1) anyways imei numbers of users phone programatically can check condition on landing/splash page if imei==user_imei_number he/she can able see main page else not authority enter main page need create apk file each device 2) if dont know how many users use app can remote database in database can save new users imei number , in splash/landing page can check through webservice imei==users_imei_number (from remote database) he/she can use app off course need mention intern

java - Avoid "$" being URLEncoded -

i have string contains "$" in it. because of problem mentioned in urlencode value of map in spring , have urlencode it. don't want encode method encode "$" well. is there way can done? editing question wasn't clear in beginning : i trying avoid java change , see if can make change @ spring config. trying understand if there escape character make urlencode not encode $ , encode rest of it thanks help. you can split string $ , url encode elements in array get, , glue $

Android select and highlight text in edittext -

i app has edittext or textview can selected upon click , highlight selected text. how can that? tried overriding onclick method on edittext seems not working. here's i've tried far: etx.setonlongclicklistener(new onlongclicklistener() { @override public boolean onlongclick(view v) { int startselection = etx.getselectionstart(); int endselection = etx.getselectionend(); //string selectedtext = etx.gettext().tostring().substring(startselection, endselection); spannable spannable=new spannablestring(etx.gettext().tostring()); spannable.setspan(new foregroundcolorspan(color.blue), startselection, endselection, 0); etx.settext(spannable); return true; } }); <edittext android:id="@+id/tvordinancetitle" android:layout_width="wrap_content" android:textcolor="@android:color/black" android:cu

python - Nunmpy sum() function + comprehensions: int32 or in64? -

why numpy.sum , numpy.prod function return int32 when input list of int, , int64 if it's generator same list? what's best way coerce them use int64 when operating on list? e.g. sum([x x in range(800000)]) == -2122947200 sum((x x in range(800000))) == 319999600000l python 2.7 you using numpy.sum instead of built-in sum , side effect of from numy import * . advised not so, cause no end of confusion. instead, use import numpy np , , refer numpy namespace short np prefix. to answer question, numpy.sum makes accumulator type same type of array. on 32-bit system, numpy coerces list int32 array, causes numpy.sum use 32-bit accumulator. when given generator expression, numpy.sum falls calling sum , promotes integers longs. force use of 64-bit accumulator array/list input, use dtype parameter: >>> np.sum([x x in range(800000)], dtype=np.int64) 319999600000

Is it possible in any way (using C++ preprocessor etc) to replace shared_ptr<T> with T$, weak_ptr<T> with T%, and unique_ptr<T> with T? -

so far seems answer no. which unfortunate given how more visually noisy code becomes shared_ptrs on place. with c++11, 1 possible way use aliases (which cleaner imo macros). e.g. shared pointers, do: template<typename t> using shared = std::shared_ptr<t>; then, use following: shared<int> myint; // in fact std::shared_ptr<int> edit: live example .

excel - How to find partial value/text from cells in a column using vba? -

i have been looking around stackoverflow on 2 days, not find decent solution, here question. basically, need vba find cells contains value/text , change cells such value/text different color. for instance, want cells containing "holly" selected , changed different colors , text in of following forms: holly, holly, hollywood, holly w, hollyw, hollywo, etc. below have tried, no luck. instead of changing cells contains "holly," changes cells regardless of value/text in cell. option compare text sub dataverification() range("a:a").interior.colorindex = xlnone each cell in range("a:a") if ucase(activecell.value) "holly*" cell.interior.colorindex = 37 end if end sub

jquery - Replacing double quotes while sending parameter to javascript function -

this jsfiddle : http://jsfiddle.net/5kdek3vn/ i have button follows: <button class="buttoncss" title="modify artifact file" onclick="setfiledescriptionforupdate('!@#$%^&amp;*()_+-=~`{}|[]\:" ;'&lt;&gt;?,.="" ','state.dat','167','1','c:\\pp_artifactsuploadedfiles\evalid_318\state.dat');">modify</button> in on click calling setfiledescriptionforupdate function first parameter string , follows: !@#$%^&*()_+-=~`{}|[]\:";'<>?,./ when " involved in string creates problem. what changes can make avoid this?? please me. use below code :- var user = "hi \" user"; var test = user.replace("\"", ""); document.body.innerhtml = test;

vb.net - Why DataGridView cell does not accept value from textbox -

i populate datagridview1 typing cells or passing text cell textbox1 when clicking on button: buttonclick_passtexttodatagridview1 : datagridview1.selectedrows(0).cells(2).value = textbox1.text buttonclick2_update datagridview: dim cmdbuilder new oledb.oledbcommandbuilder(adp) adp.update(ds, "table1") what type in cells saved table, problem pass textbox1.text datagridview1.selectedrows(0).cells(2) not persist. any ideas this?

c++ - Programmatically control zoom Opencv -

Image
i've written simple program in opencv open tiff image. program identical this post (save 2 lines) i'll add here clarity: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main( int argc, char** argv ) { if( argc != 2) { cout <<" usage: display_image imagetoloadanddisplay" << endl; return -1; } mat image; image = imread(argv[1], cv_load_image_color); // read file if(! image.data ) // check invalid input { cout << "could not open or find image" << std::endl ; return -1; } namedwindow( "display window", window_autosize );// create window display. imshow( "display window", image ); // show our image inside it. movewindow("display window",0,0); //set window postion top left setwindowproperty("display window", cv_wn

ios7 - Why doesn't work a view controller at landscape when I show it? -

Image
i add uiviewcontroller on main screen code : settingviewcontroller *v=[ self.storyboard instantiateviewcontrollerwithidentifier: @"settingviewcontroller"]; [self addchildviewcontroller:v]; [self.view addsubview:v.view]; [v didmovetoparentviewcontroller:self]; my problem: presented view doesn't work @ landscape!! why?? you can add constraints programmatically on view controller (settingvc): // pure auto layout approach settingvc.view.translatesautoresizingmaskintoconstraints=no; // add constraints nslayoutconstraint *leftconstraint = [nslayoutconstraint constraintwithitem:settingvc.view attribute:nslayoutattributeleading relatedby:0 toitem:self.view attribute:nslayoutattributeleft

html - Having centered element and right-justified element in header all vertically aligned -

i'm trying make header web page 1 element in middle of header, , 1 right-justified in header. the ways think of doing was: using float - jsfiddle #centerheader { display: inline-block; height: 100%; vertical-align: middle; } #sociallinks { height: 100%; display: inline-block; vertical-align: middle; float: right; } using absolute positioning - jsfiddle #centerheader { display: inline-block; height: 100%; vertical-align: middle; } #sociallinks { height: 100%; display: inline-block; vertical-align: middle; position: absolute; right: 10px; } the problem both of these methods, social links/images no longer vertically aligned header, rather hugging top of page despite me setting them inline-block height of 100%, , vertical-align: middle. ( source of reasoning trying vertical align method) with float method, there appears additional problem of centered element not being horizontally centered within header, ra

php - Give a name to a session and check if a session with that name exists -

i'm building website there 3 kinds of login pages different type of users (ex. customers , salesmen). there pages should accessible specified users. if tries enter specific page, script check whether person allowed so. the way see it, should create different session names @ each login page , when somebody's trying access specific page, check whether it's right person in right place. i know checking if session exists can done via isset($_session) and found information session_name here: http://php.net/manual/en/function.session-name.php but don't seem put 2 things together. suggest solution? i've been learning php 3 weeks, please go easy on me. by registration set user permission 1 , 2 , save database along username , hashe pasword | id | username | password hash | user level | | 1 | user01 | t5ns4fdgn6sdn45d4t5zuk65fz6s4dt1 | 1 | | 2 | user02 | e8tdzjui56jn4fgvh635csd6trz6ghr8 | 2 | by every logi

java - Eclipse debug toolbar is not active -

Image
i started eclipse today and, when started debug, application stopped @ break point should have, debug toolbar not active, , there no possibility step on or anything. picture bellow - can check log, possible exceptions. runtime exception might stopping thread.

find complete image path in php? -

Image
i have serialized string : now want find image information string , store in variable. can find image path , prints below code $doc = new domdocument(); $doc->loadhtml($stry); $xpath = new domxpath($doc); $src = $xpath->evaluate("string(//img/@src)"); echo $src; but want print complete img tag atrributes height , width etc in below form : $a = "<img src=\"http://www.techveze.com/wp-content/uploads/2013/11/router.jpg\" alt=\"\" width=\"345\" height=\"120\" class=\"aligncenter size-full wp-image-1884\" />" ; anyone plz me...?? thanx. you need unserialize string. return array. image stored in index image . // unserialize string , turn array $array = unserialize($str); $a = $array['image']; // give image enclosing `<a>` tag // create document html snippet $doc = new domdocument(); $doc->loadhtml($a); // obtain image tag $img = $doc->getelementsbytagname('

wampserver - Dll file is missing When i Install Wamp server -

hai guys goodnoon all. when trying install wamp server2.5v in windows 7 64bit os error the program can't start because msvcr110.dll missing computer try reinstalling... i googled problem.. no solution helping me .. 1)i dwonloaded dll file , pasted in related path, 2)also downloaded vc10 sp1 vcredist_x64.exe , insatlled 3)also downloaded both version 2.5 2nd 2.4. both 64 , 32 bit os. nothing far solve issue.please me install wamp server. advance all.. http://forum.wampserver.com/read.php?2,123608 read this, there solution on forum, , comments of other people have same problem. maybe missing microsoft visual c++ 2008 redistributable package (x64) or microsoft visual c++ 2010 sp1 redistributable package (x64)

Handshake failure with Java when I try to do a POST -

i try contact *** , send data using post. i use jersey-bundle-1.18.jar have imported eclipse project. code: client client = client.create(); webresource webresource = client.resource("https://somesite.com"); multivaluedmap<string, string> map = new multivaluedmapimpl(); map.putsingle("key_name", api_key_name); map.putsingle("key_value", api_key_value); map.putsingle("message", "test"); map.putsingle("extension", "+0012345678"); clientresponse response = webresource.type("application/x-www-form-urlencoded") .post(clientresponse.class, map); // throws exception here return response.tostring(); when run code javax.net.ssl.sslhandshakeexception. certificate used site startcom, , don't think ca in java's default truststore, @ not least in java 6, according this poster i ran program jvm flag -djavax.net.debug=all , got: trigger seedi

java - JBoss DataSource configuration Issue -

i unable configure datasource in jboss. following configuration in jboss web.xml <jboss-web> <resource-ref> <res-ref-name>jdbc/testdatasource</res-ref-name> <!-- matches web.xml --> <jndi-name>java:jdbc/testdatasource</jndi-name> <!-- matches oracle-ds.xml --> <res-type>javax.sql.datasource</res-type> </resource-ref> </jboss-web> we have created oracle-ds.xml contains: <?xml version="1.0" encoding="utf-8"?> <datasources> <local-tx-datasource> <jndi-name>jdbc/testdatasource</jndi-name> <connection-url>jdbc:oracle:thin:@11.120.184.77:1521:starsdev</connection-url> <driver-class>oracle.jdbc.driver.oracledriver</driver-class> <user-name>cmsusr</user-name> <password>cmsusr</password> <min-pool-size>2</min-pool-size> <max-pool-siz

qt5.3 - unable to run exe created in Qt 5.3 on different windows machine -

Image
i facing issues run .exe files created in qt 5.3 on different windows system. have included .dll files. issue on latest system graphics card support application runs without issues on older systems gives blanck screen. i suspect has opengl support system. is there way can make sure application runs without glitches on systems? or possible have application created without oprngl support needed ? hoping hear solution this. thanks in advance. edit : following error when run code getprocaddress: unable resolve 'glbindframebuffer' getprocaddress: unable resolve 'glbindframebufferoes' getprocaddress: unable resolve 'glbindframebufferarb' and here screenshot of way screen looks note : please note when run .exe on new system updated graphics, screens looks perfect. did include opengl headers in qt project? because if did there going dependency on opengl each system , if 1 of them cannot support either need decrease minimum version of g

sql server - SQL Select - inserting values if not exist from another table grouping by another value -

i have 2 tables @sales --- register daily number of sales @o_date --- register opening dates i need fill in date gaps in @sales table each available date in @o_dates , has each code available available in @sales table please, select. declare @sales table ( code varchar(10) not null, date1 datetime not null, value numeric(10, 2) not null ); insert @sales ( code, date1, value ) values ('q', '20140708', 51), ('q', '20140709', 3), ('q', '20140710', 5), ('q', '20140711', 6), ('q', '20140712', 2), ('q', '20140713', 7), ('q', '20140714', 24), ('q', '20140715', 24), ('x', '20140709', 25), ('x', '20140710', 16), ('x', '20140711', 66), ('x', '20140712', 23), ('x', '20140713', 35), ('x', '20140714', 57), ('c', '20140712', 97), ('c', '

c# - Puma .NET exception 'System.Runtime.InteropServices.COMException' -

trying recognise set of images in folder (using puma .net ocr library), first image recognised successfully, after error: an unhandled exception of type 'system.runtime.interopservices.comexception' occurred in puma.net.dll additional information: <0x00000000>: ?????? ???. i have special class recognition, , error happens on line: puma.net.pumapage inputfile = new puma.net.pumapage(imagepath); i found this link , this one , don't seem in case. thank you i found answer using 'using' statement using(puma.net.pumapage inputfile = new puma.net.pumapage(imagepath)) { }

mysql - Joining 3 tables and count different fields -

i have query in loop through itemlist(alerts), these alerts have replies want know how many replies alert/item has, these alerts/items have sort of like(interaction) button want know how many people liked it, have query gives me how many replies have, don't know how can count how many interactions has... take @ , maybe me ? this query far: select a.title, a.lat, a.lon, a.alert_content_id, a.date_added, count(*) `alerts` left join `reply` r on r.alert_id = a.alerts left join `interactions` on i.alert_id = a.alerts group a.title, a.lat, a.lon, a.alert_content_id, a.date_added now count returns number of replies, how can count number of interactions well? desired result |a.title|a.lat|a.lon|a.alert_content_id|a.date_added|count(replies)|count(interactions)| count replies number of rows a.alerts == r.alert_id , count interactions number of rows a.alerts == i.alert_id so after bit more fidling found answer, returned needed. select a

Map Logic Help - Java -

package com.blackdeveraux.lunchroulette.places; import java.math.bigdecimal; import java.util.hashmap; import java.util.linkedlist; import java.util.list; import java.util.map; @suppresswarnings("serial") public class searchdata extends hashmap<string, object>{ public static final string base_url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json"; @suppresswarnings("unchecked") public list<place> buildplaces() { linkedlist<place> places = new linkedlist<place>(); list<map<string, object>> results = (list<map<string, object>>)get("results"); for(map<string, object> data : results){ place place = new place(); try { place.setname((string) data.get("name")); place.setreference((string) data.get("reference")); map<string, object> geom

javascript - Dont display all data you get from database at start -

i using simple script fetch data database, looks like: public function fetchbyvinevidence() { $success = false; try{ $con = new pdo( db_host, db_user, db_pass ); $con->setattribute( pdo::attr_errmode, pdo::errmode_exception ); $sql = "select * evidence_calculations vin = :vin limit 5"; $stmt = $con->prepare( $sql ); $stmt->bindvalue( "vin", $this->vin, pdo::param_str ); $stmt->execute(); while ($row = $stmt->fetch()){ echo "<tr>"; echo "<td>#4</td>"; echo "<td>".$row['street']."</td>"; echo "<td>".$row['city']."</td>"; echo "<td>".$row['claim_number']."</td>"; echo "<td>".$row['country']."<

Embedded Tomcat in OSGi Felix Container -

i have used embedded tomcat 7.0.53 in eclipse run gateway @ localhost. works when run gateway in eclipse. want run gateway in osgi felix container, got tomcat error: lifecycleexception. here the detailed error report: 2014-08-18 17:57:48 [org.apache.catalina.core.containerbase] severe - child container failed during start 2014-08-18 17:57:48 [org.apache.catalina.core.containerbase] severe - child container failed during start org.apache.catalina.lifecycleexception: failed start component [standardserver[-1]] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:154) @ org.apache.catalina.startup.tomcat.start(tomcat.java:341) @ at.ac.tuwien.auto.iotsys.gateway.obix.server.tomcatservernosecurity.<init>(tomcatservernosecurity.java:73) @ at.ac.tuwien.auto.iotsys.gateway.iotsysgateway$2.run(iotsysgateway.java:301) @ java.lang.thread.run(thread.java:745) caused by: org.apache.catalina.lifecycleexception: failed start component [standardservice[tomcat]] @ org

python - Can two celery applications be interdependent? or two tasks of one application be interdependent? -

my workflow follows, using celery rabbitmq step 1. large file broken multiple parts(let's 4), , put mq, step 2. workers(let's 2) process files , store somewhere. now, question , have task complete, , joining files, ofcourse synchronous task, i.e. parts of file should have been processed, so, do through celery make joining task dependent on step 2. do create separate application join files, somehow receive status of these workers, whether have finished processing files. or put joining of files task in mq, again (block waiting) assure that, parts processed, n join files, (this again can done worker) which approach achievable? make these 2 tasks interdependent yes 2 celery applications/tasks can interdependent. to achieve goal use celery canvas: http://celery.readthedocs.org/en/latest/userguide/canvas.html , more precisly 'chords' a chord task executes after of tasks in group have finished executing. from celery import chord @task de

jquery - Issue with this.variable -

i looking way give div.rune.ixxx / div.rune.i +index integer limited itself, called upon child within itself. layout: ...-container -> div.rune.i +index -> p here section of jquery having issues with... jquery("body").on("click", "td", function() { if($(this).is('td.entry-name') || $(this).is('td.icon')) { if(!this.i){this.i = 0;} //<--- issue here var gettext = $(this).siblings('td.index').text(); var gettype = $(this).siblings('td.type').text(); console.log(gettext); //id check $.getjson("http://ddragon.leagueoflegends.com/cdn/4.14.2/data/en_us/rune.json", function(response){ $.each(response.data, function (index, entry) { if(index == gettext) { console.log(entry.name); //name check if(gettype == "mark") { if($('div.mark-container').children(

haskell - What exactly makes Option a monad in Scala? -

i know monads , how use them. don't understand what makes, let's say, option monad? in haskell monad maybe monad because it's instantiated monad class (which has @ least 2 necessary functions return , bind makes class monad , indeed, monad). but in scala we've got this: sealed abstract class option[+a] extends product serializable { ... } trait product extends equals { ... } nothing related monad. if create own class in scala, monad default? why not? monad concept, abstract interface if will, defines way of composing data. option supports composition via flatmap , , that's pretty needed wear "monad badge". from theoretical point of view, should also: support unit operation ( return , in haskell terms) create monad out of bare value, in case of option some constructor respect monadic laws but not strictly enforced scala. monads in scala looser concept in haskell, , approach more practical. thing monads relevant