Posts

Showing posts from January, 2012

Python Tkinter Layout Management with Grids -

for few days, i'm trying set simple application tkinter , have problems choose between pack, grid frames , widgets. here mockup of app. decided delete 2 buttons "générer" don't pay attention that. http://www.gilawhost.com/images/taajvonq.png i have 3 frames : framematrix (for checkboxes), frameimage (for flashcode) , framelink bottom part. those frames implemented grids. exemple link part (bottom), have : labellink = labelframe(framelink, text='mini lien', padx=5, pady=5) labelminilien = label(framelink, text = "http://minilien.fr/").grid(row=0, column=0) entrylink = entry(framelink, text=self.flashcode.lien).grid(row=0, column=1) buttonlink = button(framelink, text="suivre le lien").grid(row=0, column=2) however, don't know how put 3 frames together. main frame is self.frame=frame(root) and tried set frames below framematrix=frame(self.frame).grid(row=0, column=0) frameimage=frame(self.frame).grid(row=0, column=1)...

python - pip: Could not find an activated virtualenv (required) -

i trying instal virtualenv and/or virtualenvwrapper on mac osx 10.8.3 i have been fighting python last 2 days. able install python 2.7.4 using brew. before had virtualenv installed using easy_install. tried uninstall it, trying computer in same situation 1 of colleagues. maybe uninstalled success, maybe not. don't know how test it. supposed install virtualenv using - pip install virtualenv but gives me - could not find activated virtualenv (required). pip install virtualenvwrapper gives same output. also variable: pip_respect_virtualenv null: echo $pip_respect_virtualenv how can solve issue? thanks open ~/.bashrc file , see if line there - export pip_require_virtualenv=true it might causing trouble. if it's there, change false , run - source ~/.bashrc if not, run export pip_require_virtualenv=false terminal.

tcl - traversing a ttk::treeview in Tk -

is there simple way traverse items of tcl/tk ttk::treview if items in listbox? example: | |-- b visit | | |-- c order | | |-- d ----> b c d e f g | e v |-- f |-- g i understand correspond traversing tree in preorder , is, in fact, current solution. since have complete tree maximum depth n, can like: foreach lev1 [.tree children {}] { do_stuff $lev1 foreach lev2 [.tree children $lev1] { do_stuff$lev2 foreach lev3 [.tree children $lev2] { do_stuff $lev3 .... } } } but looking easier way it. i have considered adding tag (say mytag ) each node , use: .tree tag has mytag list of nodes. problem that, afaik, resulting order not guaranteed , may end different type of visit. recursive traversal ought trick you. along lines of proc traverse {item} { do_stuff $item foreach [.tree children $item...

boolean - return type of bool function -

what return type of sort of bool function...... know return type either true of false seems complicated when have got this.. bool mypredicate (int i, int j) { return (i==j); } this bool function used in library function called equal...... example is.... bool compare(int a, int b){ return a<b; } so perspective here return type of these bool function.when goes true & false.... your functions mypredicate , compare merely thin wrappers on binary operators == , < . operators functions: take number of arguments of given type, , return result of given type. for example, imagine function bool operator==(int a, int b) following specification: if a equals b return true otherwise return false and function bool operator<(int a, int b) following specification: if a strictly lesser b return true otherwise return false . then write: bool mypredicate (int i, int j) { return operator==(i, j); } bool compare(int a, int b){ return oper...

symfony - SELECT etat, count( * ) AS 'nombre' from commande GROUP BY etat; -

how transform query dql : select etat, count( * ) 'nombre' commande group etat; please try select c,count(c.id) nombre acmebundle:commande c group c.etat where clause not included. should have commande entity. return fields commande entity , count. can rectify needs

c# - Exception when I try to create Database on my test, using TeamCity for CI -

in 1 of test need create sql express database , populate it. it's run fine on machine when teamcity tries run same test throws following exception: test(s) failed. system.reflection.targetinvocationexception : exception has been thrown target of invocation. ----> system.data.sqlclient.sqlexception : create database permission denied in database 'master'. what causing this? in enterprise manager-> data base richt click on master db select properties , add permission

javascript - checklist of creating phonegap project- Can SomeOne add More elements -

for updated list pls see url http://www.aurigait.com/blog/checklist-of-creating-phonegap-project/ we doing core html dev. jquery mobile can used platform wide range device support & ease in making forms tradeoff of performance on lower-end devices. ui transitions not supported in various devices either can selectively apply transitions. ios , android navigation kept same or different since button navigation in available in android language / audio / tectical support analytics / notifications , intensity [notificatioin pages history] / adwords / geolocation based resposive layout resolution breakup we supporting resolutions of 320*480 , above. (for can have ui designs 320*480 (mobile portrait) / 768*1024 (tablet portrait) / 1280*720 (desktop) updates & news event calender & reminders user feedback forms swipe gestures sharing of content application single page applications [single page layouts implement those. (follow examples of paytm / asana / gmail)...

jsf - primefaces autocomplete selection returns null -

autocomplete works fine, mean when write gets values db , autocompletes when select value, shows selectedparty null.by way using converter selectonemenu , works fine, can selected value there problem autocomplete component. view; <p:autocomplete id="partysearchautoid" value="#{mycontroller.selectedparty}" var="party" itemlabel="#{party.partyname}" itemvalue="#{party}" converter="genericconverter" forceselection="true" completemethod="#{mycontroller.searchparty}"> <p:ajax event="itemselect" update="soainputtextid"/> </p:autocomplete> my controller; private party selectedparty; public list<party> searchparty(string query) ...

python - Layout of the output array img is incompatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels) -

i error: layout of output array img incompatible cv::mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels) when running following code: i1 = cv2.imread('library1.jpg'); i2 = cv2.imread('library2.jpg'); # load matching points matches = np.loadtxt('library_matches.txt'); img = np.hstack((i1, i2)) # plot corresponding points radius = 2 thickness = 2 m in matches: # draw keypoints pt1 = (int(m[0]), int(m[1])) pt2 = (int(m[2] + i1.shape[1]), int(m[3])) linecolor = cv2.cv.cv_rgb(255, 0, 0) ptcolor = cv2.cv.cv_rgb(0, 255, 0) cv2.circle(img, pt1, radius, ptcolor, thickness) cv2.line(img, pt1, pt2, linecolor, thickness) cv2.circle(img, pt2, radius, ptcolor, thickness) cv2.imshow("matches", img) this code getting corresponding features in 2 similar images different views. please ?? change line: img = np.hstack((i1, i2)) to: img = np.array(np.hstack((i1, i2)))

linker - Cross-compiling OpenGL / glew on linux for windows -

i'm trying cross-compile small test opengl/glew program , linker errors undefined references. $ /usr/bin/i486-mingw32-g++ -i/usr/i486-mingw32/include -l/usr/i486-mingw32/lib/ -lglfw -lglew32 -lopengl32 main.cc /tmp/cct8opvh.o:main.cc:(.text+0x50): undefined reference `glfwinit' /tmp/cct8opvh.o:main.cc:(.text+0xa6): undefined reference `glfwopenwindowhint' ... the same code work when compiling linux: $ g++ -i/usr/include -l/usr/lib/ -lglfw -lglew -lgl main.cc one thing caught eye every exported symbol cross-compiled libraries has underscore prefix: $ nm /usr/lib/libglfw.a | grep glfwinit$ 00000000 t glfwinit $ /usr/i486-mingw32/bin/nm /usr/i486-mingw32/lib/libglfw.a | grep glfwinit$ 00000000 t _glfwinit this seems common thing since libstdc++.a shares property, why cross-compiler linker looking non-underscore symbols? running arch following packages (local means aur): community/mingw32-binutils 2.23.1-3 community/mingw32-gcc 4.7.2-1 local/mingw32-glew 1....

indexing - How can I programmatically rebuild the Magento product flat data for a single, specified store view? -

i'm running multi-store installation of magento , i've reached point manual product imports , subsequent index rebuild taking long. want stagger jobs need know how isolate rebuilding of indeces on per-site basis. $indexer = mage::getresourcemodel('catalog/product_flat_indexer') /* @var $indexer mage_catalog_model_resource_product_flat_indexer */ $indexer->rebuild([store id]);

iphone - UIRefreshControl with a UITableView (not a UITableViewController) very difficult to refresh -

Image
if add uirefreshcontrol inside tableview (not tableviewcontroller), little smaller, can't refresh activated cause table hasnt height expected, there way modify sensivity of uirefreshcontrol? i have use finger when arrive bottom of uitableview, , continue getting bottom.

Retrieve URL from which an API Request is made in Django -

i have problem: developing api view in django must respond remote requests. is there way know url api call starts? thank yes, in http headers, there referer line, uri client came, if choose send it. people choose things isn't sent, , in case, there isn't can it. there several posts parsing http headers floating around, can use 1 of , borrow methods. this 1 of posts has several examples in it: parse raw http headers you need make django snag headers can parse them, isn't difficult do, believe there functions in standard library getting headers in web apps.

android - How to scale imageview / bitmap and pixels versus dips -

i have imageview on linearlayout. i imageview scale bitmap holds, takes max amount of space in linear layout, still keeps proper image scale. public static void sharedutilscaleimage(imageview view) { drawable drawing = view.getdrawable(); //-- bitmap bitmap = ((bitmapdrawable)drawing).getbitmap(); int bitmapwidth = bitmap.getwidth(); int bitmapheight = bitmap.getheight(); int widthparent = view.getwidth(); int heightparent = view.getheight(); //-- float density = 1; if (true) { density = micapp.getcontext().getresources().getdisplaymetrics().density; } //-- float xscale = ((float) widthparent * density) / bitmapwidth; float yscale = ((float) heightparent * density) / bitmapheight; float minscale = math.min(xscale, yscale); //-- matrix matrix = new matrix(); matrix.postscale(minscale, minscale); //-- bitmap scaledbitmap = bitmap.crea...

osx - OpenGL 4 tessellation on OS/X -

Image
apparently tessellation shaders able run under osx 10.8.3: http://www.geeks3d.com/20130507/gputest-0-4-0-cross-platform-opengl-benchmark-released-opengl-4-tessellation-test-enabled-under-mac-osx does have minimum example (c++, opengl , glsl) able compile , run? also features supported / unsupported? i aware of os/x not yet officially support tessellation shaders. i'm looking recipe hack used in gputest 0.4.0, apparently seem support on hardware. ok been running code through opengl profiler, seems using tessellation shader, not using opengl defines. as far can tell use glcreateshader(0x00008e87); // tess eval and glcreateshader(0x00008e88); // tess control i can confirm application use tessellation shaders have inspected shader source, i'm going try , integrate own codebase using hex values above , report back. edit if use following should work (see blog , video here ) so there lot of basic hacking of code working, have used following defines ...

Running Matlab from Java code -

this question has answer here: running matlab function java 5 answers sorry if ask simple question ask whether possible when executing java source have code in makes independent matlab programme run (not execute matlab code in java) ? think general question whether can start other programmes in process of execution of code in java. thank you. best, m i know can run external programmes this: import java.io.*; public class commandexection { public commandexection(string commandline) { try { string line; process p = runtime.getruntime().exec(commandline); bufferedreader input = new bufferedreader (new inputstreamreader(p.getinputstream())); while ((line = input.readline()) != null) { system.out.println(line); } input.close(); } catch (exception err) { err.printstacktrace(); } } public static void main(string ...

I keep receiving "Summary of failures for Google Apps Script: Script" error message even after I deleted all script for my google forms -

i attempted use script in googleforms have results emailed account , didn't work , sent me error emails constantly. deleted script, created new spreadsheets googleforms i'd created, , still receiving these error emails... looks this: **your script, script, has failed finish successfully. summary of failure(s) shown below. configure triggers script, or change setting receiving future failure notifications, click here. summary: error message count no item given id found, or not have permission access it. (line 20, file "code") 24 details: start function error message trigger end 5/7/13 9:45 pm sendformbyemail no item given id found, or not have permission access it. (line 20, file "code") time-based 5/7/13 9:45 pm** i've checked in script editor , such see if there anything, there nothing. frustrated work account , receive tons of these emails. i'd appreciate , help! did try "resources / triggers" inside ...

mysql - Insert duplicate rows for a new id based on result of another query -

so i'll best describe query i'm trying build. i have table i'll call user_records has data (several rows) relational id, userid (from table users ). each row, need duplicate each row user. know run this: insert user_records (userid, column1, column2, ...) select 10 userid, column1, column2... user_records userid = 1 this copy existing rows userid 1 userid 10. but want run userids active , don't exists in table. want execute query first: select userid users users.active = 1 , not exists ( select * user_records users.userid = user_records.userid) using joins or combining 2 queries, can run query , replace 10 in former query duplicates rows series of userids? thanks in advance! one way create cross join : insert user_records (userid, column1) select u.userid, ur.column1 user_records ur cross join users u ur.userid = 1 , u.active = 1 , u.userid not in (select userid user_records); sql fiddle demo this insert new r...

java - How to set text from an edittext from another class -

in application user presses textview , brings intent on screen user enters text want. here case statement case r.id.weapon: w = new intent(weapdescrip.this, popup.class); string weaponname = getsavedobject(); weapon.settext("weapon: " + weaponname); break; and here getsavedobject() private string getsavedobject() { // todo auto-generated method stub startactivity(w); string savedobject = (string) popup.savedobject; return savedobject; } and here popup class @override public void onclick(view v) { // todo auto-generated method stub savedobject = etsave.gettext(); //finish(); intent n = new intent(popup.this, weapdescrip.class); startactivity(n); } } when goes weapdescrip class text view doesn't change @ all any worth while in advance.

c++ - Instance of overloaded function in OpenCV -

hello trying implement fast feature detector code,in initial phase of following errors (1)no instance of overloaded function "cv::fastfeaturedetector::detect" matches argument list (2)"keypointstopoints" undefined please me. #include <stdio.h> #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/nonfree.hpp" using namespace cv; int main() { mat img1 = imread("0000.jpg", 1); mat img2 = imread("0001.jpg", 1); // detect keypoints in left , right images fastfeaturedetector detector(50); vector<keypoint> left_keypoints,right_keypoints; detector.detect(img1, left_keypoints); detector.detect(img2, right_keypoints); vector<point2f>left_points; keypointstopoints(left_keypoints,left_points); vector<point2f>right_points(left_points.size()); return 0; } the problem in line: ve...

How to unit test classes with bean validation? (Java EE) -

i'm unit testing classes annotated jsr303 constraints, can't find proper maven dependency javax.validation.validation in order create validatorfactory used in tests. , weird thing i've got problem validation class. constraints , validation factory resolve fine. netbeans (7.3) gives me "java ee api missing on project classpath" message every dependency i've tried far (both hibernate-validator , validation-api). here's of pom (including both dependencies): <dependencies> <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>eclipselink</artifactid> <version>2.3.2</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>javax.persistence</artifactid> <version>2.0.3</version> <scope>provided...

rails admin - Conditional read only on a field -

it seems should possible pass in conditional in place of true/false "read_only" expecting field, doesn't seem work. there way conditional read_only on field based on field's value? things i've tried don't seem work: read_only true if self.blah runs doesn't conditionally make read_only read_only true if bindings[:object].fieldname.blah gives error nomethoderror: undefined method []' nil:nilclass @ server start read_only true if value.blah gives error nomethoderror: undefined method[]' nil:nilclass @ server start read_only , passing in lambda instead of true/false pass block: field :user, :belongs_to_association "required. can't changed after creation." read_only bindings[:object].user_id.present? end end

r - Shading confidence intervals manually with ggplot2 -

Image
i have manually created data set of life expectancies accompanying 95% confidence bands. plot these on time scale prefer bands shaded rather dotted lines. code shown: p1 = ggplot() p2 = p1 + geom_line(aes(x=pl$time, y=pl$menle), colour="blue") p3 = p2 + geom_line(aes(x=pl$time, y=pl$menlelb), colour="blue", lty="dotted") p4 = p3 + geom_line(aes(x=pl$time, y=pl$menleub), colour="blue", lty="dotted") is there simple way shade interval rather have lines?? if i'm missing simple apologise in advance cannot find indicate simple way of doing this. it helpful if provided own data, think following after. first, create dummy data: ##i presume lb , ub lower/upper bound pl = data.frame(time = 0:10, menle = rnorm(11)) pl$menlelb = pl$menle -1 pl$menleub = pl$menle +1 then create plot. shaded region created using geom_ribbon : ggplot(pl, aes(time)) + geom_line(aes(y=menle), colour="blue") + geom_ribbo...

spreadsheetgear - How does one select an entire worksheet with Spreadsheet gear (.NET) -

i using spreadsheet gear component , need select cells in worksheet can apply consistent font setting across. how create irange represents entire worksheet? iworksheet. cells represents cells in worksheet: workbook.worksheets["sheet1"].cells.font.color = spreadsheetgear.colors.yellow;

data structures - Implementing my own tree Iterator in Java -

i trying implement iterator interface tree traversal. getting following error."incompatible types @ for(integer node : tr )" , "treeiterator.java uses unchecked or unsafe operations." unable fix error. can point out problem. //class implement iterator interace. class inorderitr implements iterator { public inorderitr(node root) { st = new stack<node>(); this.root = root; } @override public boolean hasnext() { //has next } @override public integer next(){ //next node } @override public void remove(){ throw new java.lang.unsupportedoperationexception("remove not supported."); } } //this class makes sure use foreach loop. class inordertreeiterator implements iterable { node root = null; public inordertreeiterator(node root){ this.root = root; } @override public iterator<integer> iterator(){ try{ retur...

ios - How to use date picker instead of textfield? -

i have 2 textfields , 1 button. used textfield entered date must use date picker. this code entering date textfield , display fields labels.how change date picker code? viewcontroller.h @interface viewcontroller : uiviewcontroller <nsxmlparserdelegate> - (ibaction)send:(uibutton *)sender; @property (unsafe_unretained, nonatomic) iboutlet uitextfield *date1; @property (unsafe_unretained, nonatomic) iboutlet uitextfield *date2; //will here define date picker @end viewcontroller.m @interface viewcontroller (){ nsmutabledata *webdata; nsxmlparser *xmlparser; nsmutablestring *returnsoap; bool treturn; } @end @implementation viewcontroller @synthesize date1,date2; - (ibaction)send:(uibutton *)sender{ nsstring *msgsoap= [nsstring stringwithformat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" "<soap:envelope xmlns:xsi=\"http://www.w3.org/2001/xmlschema- instance...

java - Xperia X10 SDK addon for android 2.3.3 -

i need xperia x10 android 2.3.3 android sdk addon cant find anywhere. need test app. can find it? in sony website there 1.6 version android sdk backward compatible. should work fine on android 2.3.3 . here's download link: http://developer.sonymobile.com/downloads/tool/sony-ericsson-xperia-x10-add-on-for-the-android-sdk/ it doesn't mention android version created on december 8, 2011 . perhaps it's you're looking for. source: http://developer.sonymobile.com/downloads/tool/ (list of downloads sony)

django models - how to connect a python code to the server? -

i have function in views.py print string. have run local server django. wrote code.the page of project must show word "hello world" , doesn't! me fix it? from django.conf.urls.defaults import * mysite.views import hello # uncomment next 2 lines enable admin: # django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', ('^hello/$', hello), # examples: # url(r'^$', 'mysite.views.home', name='home'), # url(r'^mysite/', include('mysite.foo.urls')), # uncomment admin/doc line below enable admin documentation: # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # uncomment next line enable admin: # url(r'^admin/', include(admin.site.urls)), ) judging have , receiving 404 not found presume going localhost:8000 however url setup says should go localhost:8000/hello/ (you have no page set index pattern url(r'^$', hello) ) you need foll...

c# - ExpressionPlayer does not play Azure Smooth Streaming Source -

Image
i'm writing vod solution. time have been working ssme:smoothstreamingmediaelement testing , utilise 1 of expression players. i'm using azure media services, smooth streaming. while these work fine in ssme can't them work expressionplayer. don't know why. i'm @ point i'm hard coding uri try , work below: void dataconectorpopulateplaylistdownloadcomplete(memorystream returndata, eventargs e) { <snip> var myplaylist = new expressionmediaplayer.playlist(); var playlistitem = new playlistitem(); playlistitem.mediasource = new uri("http://xxxxxms1.origin.mediaservices.windows.net/b78750fc-9e2f-448c-86e3-d5de084791ea/gopr0009.mp4-b2d2b578-3560-42c6-9927-2a791f395e19.ism/manifest",urikind.absolute); playlistitem.isadaptivestreaming = true; myplaylist.items.add(playlistitem); smoothplayerstreaming.playlist = myplaylist; <snip...

testing - How can I best assert a value can be converted to int in Python? -

i'm writing tests in python , 1 of tests need verify value either int or can converted int cleanly. should pass: 0 1 "0" "123456" should fail: "" "x" "1.23" 3.14 how can best write assertion? so, 100% sure, must like: def is_integery(val): if isinstance(val, (int, long)): # integer values return true elif isinstance(val, float): # floats can converted without loss return int(val) == float(val) elif not isinstance(val, basestring): # can't convert non-string return false else: try: # try/except better isdigit, because "-1".isdigit() - false int(val) except valueerror: return false # someting non-convertible return true in answers below thre check, using type conversions , equality checking, think not work correctly huge integers. maybe there shorter way

css - LESS, Media Queries, and Performance -

Image
i got started lesscss, , i've been having quite bit of success in regards how clean , readable css has become. however, don't think i'm using less fullest advantage. i'm in process of coding first fully-responsive site using less, , i'm concerned performance , speed . one thing note don't stick "breakpoint" methodology - scale things , down until break, write css fix them; results in anywhere 20 - 100 media queries. i'd start using less nest media queries inside elements, such example below: .class-one { //styles here @media (max-width: 768px) { //styles width } } .class-two { //styles here @media (max-width: 768px) { //styles width } } through initial testing, have found when reviewing compiled css output - methodology results in multiple (many!) instances of @media (max-width: ___px) . have scoured internet, , haven't found explicitly explains performance implications of nesting/bubbli...

Maven Release: Prepare/Perform after Rollback incorrectly succeeds with wrong content -

we use maven subversion internally. use maven's release plugin. noticed issue described below when running through following (correct, presume) steps. 1. run release:prepare : maven updates trunk version 1.0.0 . maven runs svn copy trunk/myproject tags/myproject-1.0.0 , creating tag myproject-1.0.0 . maven updates trunk version 1.0.1-snapshot . 2. run release:rollback : maven resets trunk version 1.0.0-snapshot . maven not remove tag, because maven doesn't kind of stuff. 3. commit more changes trunk, against version 1.0.0-snapshot . 4. run release:prepare again: maven updates trunk version 1.0.0 . maven runs svn copy trunk/myproject tags/myproject-1.0.0 , thinking created tag myproject-1.0.0 out of latest trunk. but, alas, subversion (1.6 , 1.7 alike) instead create tags/myproject-1.0.0/myproject on maven's behalf. 5. run release:perform : maven checks out contents of tag myproject-1.0.0 . maven builds contents , deploys r...

Can I block others from seeing my Python code? -

this question has answer here: undecompilable python 2 answers can block others seeing code? i'm working on in python. save it, it's (.py) , can right-click , see code. unlike c generate .exe can't (!) read. you can read assembly code generated process of compilation in c. code not hidden : it's bit more complex read, because asm. totally , definitively not hidden :) python made open source community, idea not hiding code. if ever want make .exe python code, can have try py2exe or freeze : http://www.py2exe.org/ http://wiki.python.org/moin/freeze cheers, k.

Connecting Access front end to SQL server back end connectivity problems -

i have access database migrated access sql server 2008 r2. have enabled tcp/ip connections on database , can connect across network database via ssms. however, when try use linked table manager in access, server not exist or access denied error message. using same username , password in access linked table manager connect on ssms. don't have idea else go this. anyone?

c++ - Graph based image segmentation -

how transform image undirected graph in order segment ?i using c++ , opencv . many in advance. what people understand under "graph-based image segmentation" in computer vision described here: http://en.wikipedia.org/wiki/graph_cuts_in_computer_vision . main reference want boykov & jolly 2001. code free on kolmogorov's homepage.

sql - how to hide the comma data in Oracle -

i have problem how hide comma when field got value comma. example if have many address . got idea? sql: select mhn.id_mohon, mhn.penyerah_nama, upper(mhn.address1), upper(mhn.address2), upper(mhn.address3), upper(mhn.address4) mohon mhn, kod_negeri kn mhn.penyerah_kod_negeri = kn.kod(+) , mhn.id_mohon = :p_id_mohon you can remove commas strings using replace function. like: select mhn.id_mohon, mhn.penyerah_nama, replace(upper(mhn.address1), ',', '') . . . you can concatenate address fields 1 value, if want them in 1 column: select mhn.id_mohon, mhn.penyerah_nama, upper(mhn.address1) || upper(mhn.address2) || upper(mhn.address3) || upper(mhn.address4) address

ipc - Got a DBus::Path with libdbus-c++ - what next? -

i have short test program using work out how use d-bus libdbus-c++ library. trying connect wpa_supplicant d-bus api (documented here ) in order read list of wifi aps , strengths. following this guide , have generated proxy header dbusxx-xml2cpp wpa_supplicant_dbus_service.xml --proxy=proxy.h , implemented wpas class stub handlers signals: class wpas : public fi::w1::wpa_supplicant1_proxy, public dbus::introspectableproxy, public dbus::objectproxy { public: wpas(dbus::connection &connection, const char *path, const char *name): dbus::objectproxy(connection, path, name) { } void interfaceadded(const ::dbus::path& path, const std::map< std::string, ::dbus::variant >& properties) {} void interfaceremoved(const ::dbus::path& path) {} void propertieschanged(const std::map< std::string, ::dbus::variant >& properties) {} }; the rest of code looks this: #include <dbus-c++/...

MySQL two tables two columns COUNT -

i have 2 tables teams - team_id , team_name (among other stuff) schedule - game_id, team_a, team_b, team_a_id, team_a_id (among other stuff) i trying create result find out number of times team_name (or team_id ) shows in either column team_a or team_b (or team_a_id or team_b_id ) teams team_id team_name 1001 new york 1011 cleveland 1021 detroit 1031 houston schedule game_id team_a team_b team_a_id team_b_id 1 new york cleveland 1001 1011 2 new york detroit 1001 1021 3 cleveland houston 1011 1031 answer: new york 2 cleveland 2 detroit 1 houston 1 try this: select count(*) teams t join schedule s on (s.team_a = t.team_name or s.team_b = t.team_name)

java - Caused by: com.google.gson.stream.MalformedJsonException: Expected EOF at line 1 column 21 -

i trying run sample java program retrieve top 5 defects rally. getting following error: querying top 5 highest priority unfixed defects... exception in thread "main" com.google.gson.jsonsyntaxexception: com.google.gson.stream.malformedjsonexception: expected eof @ line 1 column 21 @ com.google.gson.jsonparser.parse(jsonparser.java:65) @ com.google.gson.jsonparser.parse(jsonparser.java:45) @ com.rallydev.rest.response.response.(response.java:25) @ com.rallydev.rest.response.queryresponse.(queryresponse.java:16) @ com.rallydev.rest.rallyrestapi.query(rallyrestapi.java:179) @ queryexample.main(queryexample.java:36) caused by: com.google.gson.stream.malformedjsonexception: expected eof @ line 1 column 21 @ com.google.gson.stream.jsonreader.syntaxerror(jsonreader.java:1298) @ com.google.gson.stream.jsonreader.peek(jsonreader.java:390) @ com.google.gson.jsonparser.parse(jsonparser.java:60) ... 5 more the source code listed below: i...

android - Modify View from a different thread -

am geting json server content of listview. fine, want create progressdialog while json getin called. problem need call json (with http method) in different thread , show results in listview user. here doing, getin error "05-09 12:13:28.358: w/system.err(344): android.view.viewroot$calledfromwrongthreadexception: original thread created view hierarchy can touch views." try { final progressdialog progdailog; progdailog =progressdialog.show(this,"hi", "loading"); new thread(new runnable() { @override public void run() { try { jsonarray json = new jsonarray(executehttpget("http://m-devsnbp.insightlabs.cl/cuentos/json")); progdailog.cancel(); arraylist<hashmap<string, string>> taleslist = new arraylist<hashmap<string, string>>(); ...

php - Insert Data from one mysql table to another ( Notice: Array to string conversion ) -

i trying data htmlcode table tickets in database , trying insert in table users here flowing code wrote , gives me error notice: array string conversion i have little bit of idea stupidity trying insert array database should string , there easier way transfer data 1 table or correction of flowing code ? <?php try{ $conn = new pdo("mysql:host=localhost;dbname=mydb", "dbuser", "mypass"); } catch(pdoexception $pe) { die('connection error, because: ' .$pe->getmessage()); } $sql = "select `htmlcode` `tickets`"; $stmt = $conn->query($sql); if(!$stmt) { die("execute query error, because: ". $conn->errorinfo()); } $row = $stmt->fetch(pdo::fetch_assoc); // print_r ($row); //print...

GeoServer times out (504 Gateway Time-Out) when accessed from OpenLayers via nginx webserver -

i have developed openlayers web app uses geoserver. using nginx webserver proxy_pass setup geoserver. works expected when use "localhost" when switch ip address 504 gateway time-out error for http://98.153.141.207/geoserver/cite/wfs. i can access geoserver at http://98.153.141.207/geoserver/web via browser without problem appear proxy continues work expected. the geoserver log shows when problem occurs: request: describefeaturetype service = wfs version = 1.1.0 baseurl = http://98.153.141.207:80/geoserver/ typename[0] = {http://www.opengeospatial.net/cite}mylayer outputformat = text/xml; subtype=gml/3.1.1 then after minute, 504 gateway time-out in javascript console , shows in geoserver log: 09 may 06:02:15 warn [geotools.xml] - error parsing: http://98.153.141.207/geoserver/wfs/describefeaturetype?version=1.1.0&typename=cite:mylayer i have tried supposed problem url in browser , works fine. the nginx erorr log contai...

TextView won't clear for some Reason, Android -

i hope isn't stupid question. i'm having trouble clearing textview. i've looked around , keeps saying use: textview.settext(""); in oncreate doesn't seem work reason. basically, app accepts number edittext runs fibonacci sequence (when button clicked) , displays result in textview. well, sequence displays fine want textview clear every time click button - far keeps adding more text what's there. am placing textview.settext(""); in wrong location? or missing other concept? (i tried placing onclick - didn't work either). here code: public class mainactivity extends activity { // primary widgets private edittext edittext; private textview textview; private button button1; static arraylist<integer> fiblist = new arraylist<integer>(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); edittext = (edittext) findviewbyid(r.id....

c# - DropdownList SelectedItem is not working properly -

i'm facing strange problem when trying selected value of dropdownlist. have following controls on page: 4 dropdownlist, 2 textboxes, 6 listboxes , button. @ moment click on button controls preserve data can access them code behind. buut there 1 control doesn't behave in same way. it's 1 of 4 dropdownlist. when trying following empty string: string sdata1 = this.dropdownlist1.selectedvalue; --> works ok string sdata2 = this.dropdownlist2.selectedvalue; --> works ok string sdata3 = this.dropdownlist3.selectedvalue; --> works ok string sdata4 = this.dropdownlist4.selectedvalue; --> not working basically html markup have each dropdownlist: <asp:dropdownlist id="dropdownlis1" runat="server"></asp:dropdownlist> <asp:dropdownlist id="dropdownlis2" runat="server"></asp:dropdownlist> <asp:dropdownlist id="dropdownlis3" runat="server"></asp:dropdownlist> <asp:d...

jsf - Why did ajax break when sub forms are loaded in a c:forEach block? -

i found strange behavior using jsf 2.0 , ajax functionality. ajax seems no longer work if subpage loaded in c:foreach block. i using main form includes set of subpages dynamically (based on backend configuration): <c:foreach items="#{workflowcontroller.editorsections}" var="section"> <div class="imixs-portlet" > <ui:include src="/pages/workitems/parts/#{section.url}.xhtml"/> </div> </c:foreach> in case not possible use simple f:ajax render"..." tags. for example following code snippet work first subpage included in c:foreach tag : <h:commandbutton value="welcome me"> <f:ajax execute="name" render="output" /> </h:commandbutton> <h:outputtext id="output" value="#{childworkitemcontroller.name}" /> if try use f:ajax in subpage included after first subpage, in subpage ajax no longer work. so workin...

initialization - preload the selected values of a kendo multiselect that using a server bound data source and templated tags -

i have kendo multiselect follows. $("#tags").kendomultiselect({ change: onchange, datasource: { transport: { prefix: "", read: { url: "/opsmanager/api/activity/searchresourcestagged", data: getsubmitdata } }, serverfiltering: true, filter: [], schema: { errors: "errors" } }, itemtemplate: $('#resourceitemtemplate').html(), tagtemplate: $('#resourcetagtemplate').html(), datavaluefield: "k", value: [{"k":"[109]","n":"all open alerts","icon":"!","all":105}] }); with following templates: <script id="resourceitemtemplate" type="text/x-kendo-template"> <span data-icon="#:data.icon#" class="#: data.s || '' #">&nbsp;#:data.n #</span> # if...

c# - Identify Duplicate Nodes in XML Using XPath -

i trying identify duplicate group nodes in following xml structure. need find groups same name, wherever in tree. <report> <group name="a"> <group name="1"></group> <group name="2"></group> </group> <group name="b"> <group name="1"></group> </group> </report> similar post ( how identify duplicate nodes in xpath 1.0 using xpathnavigator evaluate? ) however, need identify groups same attribute rather same node value. how using linq xml find duplicates? var dubs = xdocument.parse(xml) .descendants("group") .groupby(g => (string)g.attribute("name")) .where(g => g.count() > 1) .select(g => g.key);

Breeze SaveChanges partial fail -

i'm thinking @ following scenario: on client-side update 2 entities , submit post json bundle. on server side interception , apply business logic. save works 1 of entities, other 1 fails. in opinion correct solution , why: 1. should rollback , return exception on client, or 2. commit update 1st entity , return message save worked 1 of entities? know guys ideablade consider savechanges single transaction(so crud functionality goes in single post), judging think 1. should correct approach. appreciate reasoned opinions.thanks! well depends on doing. bet save lot of time developing if roll back. if want though, can return list of failed , successful entities saved. user (assuming errors user errors) can make changes on errored entities , commit them again. may become difficult though. breeze attaches a state each entity , need need manage. on response, you'll need figure out entities failed , succeeded, update state on client, otherwise you'll resubmit commits don...