Posts

Showing posts from March, 2012

xcode - How to send recursive json request with nsmutableurlrequest in ios? -

xcode - How to send recursive json request with nsmutableurlrequest in ios? - in ios create this "{ "email":string, "password":string }" json request body, passing nsdata create string email=myname@domain.com&password=mypassword to sethttpbody method of nsmutableurlrequest.this works fine im ok this. but if want create this "{ "post": { "title":string, "room_id":int, "content":string, } }" json request body? tried create string combinations solve recursion didnt work out really. checked methods of nsmutableurlrequest couldnt find related solve this. edit: this creates post should fine, need equivalent string email=myname@domain.com&password=mypassword recursive case. when send info should not work. when send string provided works. nsstring *usertoken = [appdelegate token]; nsstring *posttopic = @"111testtopic"; n...

windows - How to Manage Java SDK/JRE Installs -

windows - How to Manage Java SDK/JRE Installs - i know how best manage java sdk/jre installs on windows environment. periodic java updated released, process of managing things seems little cumbersome. presently next on regular basis: realize new update exists (via notification or via news) download new version install new version update java_home latest version. update path using java_home (add %java_home%\bin path if not included) remove previous installation(s). update apps may depend on java (i.e. eclipse, netbeans, glassfish, etc) my problem that, seems lot of manual steps i found info setting java_home,setting path, multiple installations, multiple versions, java ee install, java ee install issues this doesn't consider 32 vs 64 version type questions or possible problems when removing versions is there improve way manage this? the short answer: no. the longer answer: many developers rely on having multiple installations of jdk/jre in or...

Trackpad Asus q200e -

Trackpad Asus q200e - i bought asus q200e laptop, , trackpad keeps having issue stops beingness able scrolls or utilize other gestures. works, other times not. i tried reinstalling driver, says it's installed , can't continue. trackpad

windows - Out of virtual memory address space (Borland C++ Builder 6 program) -

windows - Out of virtual memory address space (Borland C++ Builder 6 program) - i have problem application written under c++ builder 6. after time of running (week, month) application crashes , closes without error message. in application log shortly before crash many "out of memory" exceptions. looked @ process when throwing out of memory exceptions (screenshot below) , has lots of uncommitted private memory space. can reason of such behavior? i had such problem once, couple years ago. reason alternative "use dynamic libraries" unchecked in linker options. when checked problem disappeared , vice versa. test application made calling "new char[1000000]" , delete. memory freed every time (no committed memory rising in windows task manager), after time got out of memory, vmmap showed same thing. lots of reserved private memory of uncommitted. now problem returned can't prepare same way. don't know if reason had builder 6 , 2010 istalled on...

How to find text on a webpage and get its XPath or CSS with Selenium and Java -

How to find text on a webpage and get its XPath or CSS with Selenium and Java - there page lists items on dynamic table. order , number of items on table changes randomly. i find 1 of items "itemx" based on text "itemx" , , utilize xpath or css in part of code. i can find element based on text "itemx" driver.findelement(by.cssselector("body")).gettext().matches("^[\\s\\s]*itemx[\\s\\s]*$"); but how can xpath or css? i can't seem find on web. out there shows how verify or find text using xpath. me it's opposite. have text , want find xpath. both xpath , css selectors arbitrary. there no reply in general case. selecting first c in <a><b></b><c></c><c></c></a> css selector might c:first-of-type , or a > c:nth-child(2) , or a c:first-of-type , or a > b + c , or number of other things. xpath there many ways of representing it. if alter markup, should...

What is the difference Between Assignment and Creating Instance of String in C#? -

What is the difference Between Assignment and Creating Instance of String in C#? - i have sample code. var charmass = new char[] { 's', 't', 'r' }; string mystring = new string(charmass); string mystring2 = new string(charmass); string mystring3 = "str"; string mystring4 = "str"; bool bb1 = object.referenceequals(mystring, mystring2); bool bb2 = object.referenceequals(mystring, mystring3); bool bb3 = object.referenceequals(mystring3, mystring4); why bb1 , bb2 false? know equals must show true, because compares values, memory allocation strings? why mystring3 , mystring4 pointing same block of memory in heap mystring , mystring2 not? c# compiler optimizes same literals point same string instance msdn: the intern pool conserves string storage. if assign literal string constant several variables, each variable set reference same constant in intern pool instead of referencing several different instances of string h...

asp.net mvc 4 - File upload form with MVC4 Web-API: Getting Error 101 (net::ERR_CONNECTION_RESET): The connection was reset. Error -

asp.net mvc 4 - File upload form with MVC4 Web-API: Getting Error 101 (net::ERR_CONNECTION_RESET): The connection was reset. Error - i'm getting webpage not available error when trying access controller action in mvc4 web-api app vs2010. trying upload little sized (less 1mb) pdf document, create byte[] pass on service. however, can't either normal controller or api controller. app works , views/partials/etc. show fine except 1 (the page file upload form). view typed partial. i've tried using method shown here: upload file mvc 4 web api .net 4 here: http://blogs.msdn.com/b/henrikn/archive/2012/03/01/file-upload-and-asp-net-web-api.aspx , both of them don't work because action attribute can't find action. whether set api/documents or home/api/documents won't work. gave , went html helper beginform, hoping find way...but didn't. after giving on fancy web-api stuff (couldn't async work), figured i'd go old school , pass in file through fo...

Confused About Pointers in C and changing data at memory addresses -

Confused About Pointers in C and changing data at memory addresses - i think understand concept improve if can assist me in current project i'm working on. want utilize c edit info @ specific memory addresses, using pointers. specifically, have 2 character arrays (strings) need both read info @ specific locations, , write @ specific locations. i'm confused syntax of pointers, such * , -> , & . from understanding, * refers info kept @ current memory address of pointer. so, example, if wanted edit info @ origin memory address of char *p , like: (*p) = 'c'; now, if wanted alter character @ 2nd memory address origin of p ? also, understand & refers location of pointer. don't know how utilize syntax. here example: int orig_length = strlen(original_string); //-1 \0? char *poriginal, *pnew_string; poriginal = &original_string; while(orig_length>0) { k = 0; j = 0; while(isalpha(*(poriginal+j))) { j+...

c++ - Game sometimes crashes when closing or process stay in memory -

c++ - Game sometimes crashes when closing or process stay in memory - my problem sometimes, when closing game, 1 of 2 may occur: process stays in memory , have killed manually game crashes i'm not sure if 2 related or independent issues. both of happen rarely, have eliminate these situations. as crash, made dump , says crash occurs in peekmessage() function. code looks this: bool running = true; /// reset timer timer.reset(); msg msg; zeromemory(&msg, sizeof(msg)); /// message pump while(running) { int msg_count = 10; while (peekmessage(&msg, null, 0, 0, pm_remove) && msg_count-->0) { ::translatemessage(&msg); ::dispatchmessage(&msg); if (msg.message == wm_quit) { running = false; break; } } if (applicationactive) { prepareframe(); renderframe(); } else sleep(1); sleep(1); } from see it, message handling routi...

MySQL to JSON in PHP -

MySQL to JSON in PHP - i have basic mysql database table people 3 columns ( id, name, distance ) i trying output php json web app can pick up. tried using solution answer: $sth = mysql_query($con,"select * people"); $rows = array(); while($r = mysql_fetch_assoc($sth)) { $rows[] = $r; } print json_encode($rows); however returning blank array of [] . update: changed mysqli , added dumps: $sth = mysqli_query("select * events",$con); $rows = array(); var_dump($sth); while($r = mysqli_fetch_assoc($sth)) { var_dump($rows); $rows[] = $r; } print json_encode($rows); returns: null [] swap query , connection in mysql_query-statement: $sth = mysql_query("select * people", $con); besides that, mysql-library deprecated. if you're writing new code consider using mysqli_ or pdo. php mysql json

ios - UILabel how to tighten letter spacing -

ios - UILabel how to tighten letter spacing - i know how programatically "tighten letter spacing"? this alternative available uilabel made in xib file, , handy sometimes. i know question has been asked before, don't see reply mentions beeing available in interface builder, curious... you looking this: @property(nonatomic) bool adjustsletterspacingtofitwidth property of uilabel new in ios6 . ios uilabel

java - Rabbit MQ - why my setup not provide messages to all clients? -

java - Rabbit MQ - why my setup not provide messages to all clients? - i have code in jruby: class receiver def initialize(channel_id) @channel_id = channel_id mill = connectionfactory.new factory.sethost("localhost") connection = factory.newconnection @channel = connection.createchannel @channel.exchangedeclare(exchange_name, "direct"); @channel.queuedeclare(queue_name, true, false, false, nil) @channel.queuebind(queue_name, exchange_name, routing_key) @consumer = queueingconsumer.new(@channel); @channel.basicconsume(queue_name, true, @consumer); end def receive string.from_java_bytes @consumer.nextdelivery.getbody end private def queue_name @channel_id end def exchange_name @channel_id end def routing_key @channel_id end end this code responsible getting messages in architecture. however, when have ie. 2 instances of receiver same channel_id (which exchange name, , r...

Does anyone know how to troubleshoot a Worklight SQL adapter? -

Does anyone know how to troubleshoot a Worklight SQL adapter? - i'm newbie worklight. have imported module 6.1 developerworks getting started worklight sample http://www.ibm.com/developerworks/mobile/worklight/getting-started/ i getting error in error configured in javascript "can't cities list. check database connection" does know how troubleshoot? connection parameters in "sqladapter.xml" straight forward. for worklight mysql adapter request reach mysql database, need add together mysql-connector-java-5.1.23-bin.jar project. you can download mysql connector/j file via url: http://dev.mysql.com/downloads/connector/j/ choose "platform independent" in dropdown, , click download button .zip option. uncompress .zip file , re-create mysql-connector-java-5.1.23-bin.jar yourproject\server\lib. sql adapter worklight

javascript - jQuery Performance Issues When Checking For Duplicates -

javascript - jQuery Performance Issues When Checking For Duplicates - i have html table populated product list when user uploads csv file. often, table have on one thousand rows. problem is, when user clicks "submit" have check duplicate entries in 1 of inputs every row. takes extremely long amount of time , times unresponsive script warning. here script i'm using check duplicates: // check duplicate products $('#match_table').submit(function(evt) { var arr = document.getelementsbyname("pid[]"); var sorted_arr = new array(); (var = 0; < arr.length; i++) { sorted_arr[i] = new array(); sorted_arr[i][0] = arr[i].value; sorted_arr[i][1] = arr[i].id; } sorted_arr.sort((function(index){ homecoming function(a, b){ homecoming (a[index] === b[index] ? 0 : (a[index] < b[index] ? -1 : 1)); }; })(0)); var resu...

With WPF, want to open a second window full screen not in the primary screen -

With WPF, want to open a second window full screen not in the primary screen - with wpf, want open sec window total screen. problem when main window not in primary screen, sec window doesn't open in same screen main window. popups within primary screen. there anyway can open within same screen main window? thanks. you should able setting startup location new window center on owner. gotcha doing don't window it's opened set owner automatically need yourself. doing window should open window2 instance total screen on same monitor: window2 newwindow = new window2 { owner = this, windowstartuplocation = windowstartuplocation.centerowner, windowstate = windowstate.maximized }; newwindow.show(); wpf window screen

http - Embedding a live video stream into my android project -

http - Embedding a live video stream into my android project - i newb please bear me... i trying add together live video stream (http://fancystreems.com/default.asp@pageid=112.php) android app project. found code online want display(webview) video app instead of whole webpage. help appreciated. here code modified: import android.app.activity; import android.net.uri; import android.os.bundle; import android.view.menu; import android.widget.mediacontroller; import android.widget.videoview; public class gaiamenu extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.gl); videoview player = (videoview)findviewbyid(r.id.player); string httpliveurl = "http://fancystreems.com/default.asp@pageid=112.php"; //for android 2.3.3 used httplive:// prefix player.setvideouri(uri.parse(httpliveurl)); player.setmediacontroller(new mediacontroller(this)); player.r...

ios - Why UIView doesn't need QuartzCore.framework to work? -

ios - Why UIView doesn't need QuartzCore.framework to work? - i realized every views backed calayer. wondering why when utilize uiview don't need import quartzcore.framework in our project ? i know need if need set properties shadowoffset illustration i'm sure in own implementation need set these properties. thanks answers. because not accessing calayer properties or methods straight unless alter properties of uiview's layer. internally, uiview uses it. edit reason don't need link utilize uiview because uiview compiled library. of symbols within have been resolved (or flagged weak a.k.a. resolved @ runtime) , compiler , linker utilize them are. ios uiview uikit core-animation calayer

ios - Better pattern than passing NSDictionaries as parameters? -

ios - Better pattern than passing NSDictionaries as parameters? - as our codebase matures i'm starting not pattern of passing dictionaries way bundle info message passing or, worse yet, function arguments. necessitates sending , receiving function both having undocumented api of string literals. ..in function.. nsdictionary *info = [nsdictionary dictionarywithobjectsandkeys: thisobject, @"thiskey", thatobject, @"thatkey", nil]; [[nsnotificationcenter defaultcenter] postnotificationname:@"my_notification" object:nil userinfo:info]; .... and in someclass 's listener - (void)someclasslistener:(nsnotification *)notification { nsdictionary *info = [notification userinfo]; thisobject *ob1 = [info objectforkey:@"thiskey"]; thatobject *ob2 = [info objectforkey:@"thatkey"]; } you have remember thiskey , thatkey keys of type this...

php - Mysql query returning resource id #8 instead of desired value -

php - Mysql query returning resource id #8 instead of desired value - hi trying find how prepare query homecoming right result. here query: $selectshoeratingquery = "select cast(round(avg(rating)*2)/ 2 decimal(10,1)) rating shoe_id = '$_get[id]'"; $shoerating = mysql_query($selectshoeratingquery); the query should homecoming number 1 decimal place (3.5). works fine when testing in phpmyadmin, on site returns resource id #8 . the database connection works fine. mysql_query returns resource. need row it: $query = mysql_query($selectshoeratingquery); $row = mysql_fetch_row($query); $shoerating = $row[0]; and, unless have no selection - don't utilize mysql_ set of extensions! they're deprecated, , pdo et. al. better. , query vulnerable. php mysql

javascript - ForEach Array value in jQuery JSON result -

javascript - ForEach Array value in jQuery JSON result - okay, want process javascript request foreach value returned within json response jquery request, here's current code i'm using request function waitforevents(){ $.ajax({ type: "get", url: "/functions/ajax.php?func=feed&old_msg_id="+old_msg_id, async: true, /* if set non-async, browser shows page "loading.."*/ cache: false, timeout:50000, /* timeout in ms */ success: function(data){ var json = jquery.parsejson(data); **//foreach json repsonse['msg_id'] phone call function** settimeout('waitforevents()',"1000"); }, error: function (xmlhttprequest, textstatus, errorthrown){ alert("error:" + textstatus + " (" + errorthrown + ")"); settimeout('wa...

sql server - make .bak file compatible to other mssql version -

sql server - make .bak file compatible to other mssql version - this question has reply here: restore problem sql server version? 5 answers client has .bak file created mssql version. facing compatibility issue on own mssql version restore up. want know if there anyway create .bak file compatible version (like converting online) no. , client must utilize same sql server version if want exchange backups. depending on role (developer, admin etc) thought of exchanging backup files may wrong. developers not need backup client nor deliver database binaries, instead deliver deployment scripts. sql-server database-restore

c# 4.0 - Editing Google Drive Documents Directly -

c# 4.0 - Editing Google Drive Documents Directly - i want find out if next possible do: have webpage lists google drive files have access to, of these standard microsoft office files (.docx, .xlsx). what when click on 1 of these link, rather have download first open, open straight in standard editor filetype... when click on docx file, should open in microsoft word, or when click on xlsx file, should open in microsoft excel... can edit document , when click save, saves updates straight in google drive document. might not microsoft office, ... if log site using mac, when click link, expect open in openoffice... is possible? (if not, other provider can utilize this.) box has capability edit file straight web page (and lock other user's updates). when save it, saved straight box cloud without having mess around local folders. nice. imo, huge miss google drive. - want convert office docs format, in corp. america, won't fly. of course of study google go...

tfs - How can I manipulate pending changes window programatically? -

tfs - How can I manipulate pending changes window programatically? - i creating clone of merge wizard of tfs add together new features. i merged workspakce.merge api. need way programatically show pending changes - conflict window. i have ivswindowframe pendingchangesext like: getstatus status = sourceexplorer.workspace.merge(sourcepath, targetpath, versionfrom, versionto, locklevel.none, recursiontype.full, mergeoptionsex.none); ivswindowframe frame = pendingchanges.vswindowframe; frame.show(); when phone call show(), pending changes window refresh checkout files, need select lastly button in screen (conflicts), show conflicts of merge. how programatically click on conflict button on screen through ivswindowframe ? i found solution help of republic of chad boles: public void refreshpendingchanges() { object customin = null; object customout = null; //show tfspendingchanges m_applicationobject.executecommand("view.tfspendingchange...

SqlCacheDependency via Service Broker Notification in a WebEdition of SqlServer 2008 R2 -

SqlCacheDependency via Service Broker Notification in a WebEdition of SqlServer 2008 R2 - i appreciate help: we planing purchase sql server 2008 r2 web edition (we must version), utilize functionality of service broker sqlcachedependency - notification mode (not polling mode). http://msdn.microsoft.com/en-us/library/cc645993%28v=sql.105%29.aspx said web edition back upwards service broker (messaging) : "client only" - kind of short version. our server-environment is: one http server 2 web-application one database server single instance of sql server 2008 r2 web edition. the thought that: when new record added database table, sql server should notify both web-apllications , reset caches (so have 2 integral caches). not planing create distributed cache (memcache or sth) is there way combine these 2 demands (sqlcachedependency via service broker notification in webedition of sqlserver 2008 r2) ? purchase module, or server architecture tricks. ides ? ...

BlackBerry 10 Cascades - Running app on the simulator -

BlackBerry 10 Cascades - Running app on the simulator - i new blackberry development , ran problem several times , cannot find solution. when seek run empty cascades project simple helloworld label next error deployment failed: info: sending request: install , launch info: action: install , launch info: debug native: on info: file size: 190910 info: installing com.example.helloworld.testdev__helloworld7d1bfe91... info: processing 190910 bytes i'm using momentics, vmware running bb10 dev alpha sim , followed instructions here. http://developer.blackberry.com/cascades/documentation/getting_started/setting_up.html i made sure build config set simulator-debug , not illustration projects able run on simulator. edit: not sure if bit of info helps when seek run application, progress hangs @ 91% before error dialog appears. may not setting development mode (like current development mode simulator or device) . getting issue project compile not able run on virtual...

oracle - Procedure with looping and execute immediate -

oracle - Procedure with looping and execute immediate - recently have started preparing datamarts regular reporting process, , tried create utilize of procedures parameters. so read this guideline , tried replicate confused error in compiling. here code: create or replace procedure mig_rate @rep_date date create or replace table mig_temp1( report_date date, portfolio string, bucket integer, q integer); begin j in 1..7 loop t in 0..32 loop -- execute immediate 'bla-bla-bla insert statement mig_temp1 end loop; end loop; end this results in pls-00103 saying @ symbol unexpected. what's wrong syntax, how should set parameters procedure?? the main thing wrong you're trying utilize sql server syntax in oracle database. firstly, oracle object names have start letter (unless utilize quoted identifiers, please don't) and... well, here relevant parts: nonquoted identifiers must begin al...

c# - Is there a way to pass an array of type parameters to a generic method? -

c# - Is there a way to pass an array of type parameters to a generic method? - working on openxml, i've came across article: how to: merge 2 adjacent cells in spreadsheet document (open xml sdk). there code sample there, wanted refactor. here part: // insert mergecells object specified position. if (worksheet.elements<customsheetview>().count() > 0) { worksheet.insertafter(mergecells, worksheet.elements<customsheetview>().first()); } else if (worksheet.elements<dataconsolidate>().count() > 0) { worksheet.insertafter(mergecells, worksheet.elements<dataconsolidate>().first()); } else if (worksheet.elements<sortstate>().count() > 0) { worksheet.insertafter(mergecells, worksheet.elements<sortstate>().first()); } //...and 5 more the best thing managed extension method: public static bool insertelementafter<t>(this workshee...

How to export an Eclipse Database (JDBC) project and make it executable on user's pc? -

How to export an Eclipse Database (JDBC) project and make it executable on user's pc? - i have created dental registry application on eclipse connected oracle 11 g database using jdbc. complete. now want export project , create runnable on else' computer. i planning distribute many people possible. users don't have access net if involves it. have no thought how create maintain running without user not needing install oracle on computer. installing programme on someone's computer (like creating .exe file). please give me suggestion. first time me doing kind of thing. no need install oracle client if jdbc lean driver used. if eclipse project eclipse rcp application, there export menu. if 'ordinal' java swing application - pack code in jar + add together file containing java -cp jar1;jar2 mainclass. automate it, @ ant or maven. if need user friendly installation, find product that... database eclipse oracle jdbc executable

android - Keep getting 404's for apple-touch-icon.png -

android - Keep getting 404's for apple-touch-icon.png - we maintain getting 404's next 2 files: /apple-touch-icon-precomposed.png: 685 time(s) /apple-touch-icon.png: 523 time(s) i have been scouring mobile website archive culprit 404, , there no place in code directing apple-touch-icon.png . performing find in folder... in sublime text 2 provides 0 results apple-touch-icon : searching 100 files "apple-touch-icon" 0 matches across 0 files we using apple meta tags webapps: <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> will usage of these meta tags cause iphone search apple-touch-icon default? not providing icon, should be? remove 404. browsing apple's developer documentation provided no hints reinforce theory. the plot thickens farther when discovered happening on ios , android, regardless of browser...

angularjs - What's the difference between $locationChangeSuccess and $locationChangeStart? -

angularjs - What's the difference between $locationChangeSuccess and $locationChangeStart? - what's difference between $locationchangesuccess , $locationchangestart ? they both undocumented events related window.location . the $locationchangestart fired when angularjs starts update browser's location based on mutations done via $location service ( $location.path() , $location.search() ). it might happen application hear $locationchangestart event , phone call preventdefault() on it. in case sec event ( $locationchangesuccess ) won't broadcasting. in short: $locationchangestart fires when location gets updated. followed $locationchangesuccess if first action wasn't prevented. relevant bits of source code here: https://github.com/angular/angular.js/blob/2508b47c1a34dfc834f8fde858574f81af4d287e/src/ng/location.js#l598 angularjs window.location

c++11 - C++ Supply initializer-list constructor for class template -

c++11 - C++ Supply initializer-list constructor for class template - i have class template templ template parameter t, , templ class has info fellow member of type t, called obj. wrote variadic constructor template forwards arguments obj's constructor: template <class t> class templ { public: template <class... args> explicit templ (args&&... args) : obj (std::forward<args>(args)...) { } private: t obj; }; now realized type t may class init-list constructor, , want accessible via templ. checked std::list::emplace , std::make_shared do. have variadic function mine, don't have overrides taking init-list. reason. so first question: why? mean, if utilize class t init-list ctor, , utilize std::list<t> ? why list::emplace not have version takes initializer_list? maybe there's reason should either... want know. also, regardless of stl - should supply init-list ctor design? mean, it's variadic ctor, ...

java - Log4j - STMPAppender NoSuchProviderException stmp -

java - Log4j - STMPAppender NoSuchProviderException stmp - i'm trying send errors of gwt project log4j i'm having problem. i've added log4j.xml file: <appender name="email" class="org.apache.log4j.net.smtpappender"> <param name="buffersize" value="512" /> <param name="smtphost" value="localhost" /> <param name="from" value="myemail@teste.com" /> <param name="to" value="myemail@teste.com" /> <param name="subject" value="[smtpappender] application message" /> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%p %d (%c{1}) %m%n" /> </layout> <filter class="org.apache.log4j.varia.levelrangefilter"> <param name="levelmin" value="error" /> <param name="levelmax" value=...

How to make a Slideshow that is both clickable and automatic? -

How to make a Slideshow that is both clickable and automatic? - i create slideshow rotates between images automatically , can activated clicking.examples of want accomplish can found on runescape.com,mmohut.com,and yankees.com,please give me html/css/javascript code this.thank :d here says how create slidshow said http://www.javascriptkit.com/howto/show.shtml if want start on click, utilize onclick="myfunction() , set code slideshow (the 1 in body) function this. assign onclick whatever want clicked start slideshow. <script> function functionname() { code goes in here (not <script> tags } </script> slideshow

Using not equal symbol in hive query -

Using not equal symbol in hive query - i need utilize '!=' symbol in hive query partitions. tried like from sample_table insert overwrite table sample1 partition (src='a') select * act=10 insert overwrite table sample1 partition (src!='a') select * act=20 but showing error @ '!=' symbol. how can replace != try utilize rlike/regex function in hive specify condition. i think can utilize not operator <> not != hive

c++ - Adding statusbar in Win32 application -

c++ - Adding statusbar in Win32 application - i want add together statusbar win32 application. found out can utilize createstatuswindow function. works fine until re-size window. see part of block of code: bool initinstance(hinstance hinstance, int ncmdshow) { hwnd hwnd; hinst = hinstance; // store instance handle in our global variable hwnd = createwindow(szwindowclass, sztitle, ws_overlappedwindow, cw_usedefault, 0, cw_usedefault, 0, null, null, hinstance, null); if (!hwnd) { homecoming false; } createstatuswindow(ws_child | ws_visible, _t("welcome spywindows"), hwnd, 9000); showwindow(hwnd, ncmdshow); updatewindow(hwnd); homecoming true; } here 2 printscreens of application main window: what can have status bar? (i want split in more areas) the documentation mentions status bar recompute appropriate position , size when receives wm_size message: the window procedure automatically adjusts size of st...

Marklogic : Query response time is very high -

Marklogic : Query response time is very high - i have around 15000 records in xml format in uri, say:" documents/products/specs/*.xml ". each xml of around 25 kilo bytes in size. connected marklogic server uisng remote apache tomcat server has xcc client (java), tries execute adhocquery resembles this: let $a := cts:uri-match('documents/products/specs/*.xml') $xml in $a homecoming fn:doc($a) (for loop implemented in java). this works fine. records larger count, 15000 record, takes 60 minutes, when server , net speed good. (total size of document in uri around 20 mb should not take more 20 minutes). is there workaround ? what doing requesting total body of documents. not typical query, rather db dump. query show buffer data, send through tomcat 1 time again buffers info , send you. big dataset sending in 1 request. what intent of query ? if want documents should either dump them out using programme mlcp or fetch...

Simple example of jquery plugin with update method -

Simple example of jquery plugin with update method - can give me very simple illustration of jquery (not jquery ui) plugin, implemented update method? want create plugin according "plugins/authoring" article (http://docs.jquery.com/plugins/authoring#plugin_methods) update method, gives me possibility alter deffault setting after initialisation. jquery jquery-plugins attributes settings

performance - PlayN WebGL perfomance for canvas -

performance - PlayN WebGL perfomance for canvas - webgl slow. 100 sprites per frame - ok, 1000 sprites per frame - need optimization, 10000 sprites, fps drop downwards 40 20fps. i not need 3d @ all. not need filters, shaders, lights , other 3d stuff. need fast 2d canvas (without pixel smoothing) ability render png's , render shapes debug (lines, bars, circles). there possibility exclude webgl playn engine , switch html5 canvas? (i suppose much more faster webgl.) this has nil webgl. webgl fast. nor have playn. asking race indy 500 using suv. suv never going comparable specialized race cars. however, if have drive on unknown terrain, , take kids soccer game, , pick groceries on way home, suv going much improve choice. in case describe, slowness neither webgl calls nor canvas.drawimage calls, it's fact playn total affine transform multiplication compute current transform every sprite on every frame. want 99% of time, because games have many fewer 1000 s...

sql server 2008 r2 - How to get UserID from Entity Framework/Wcf Service in Delete trigger in DB? -

sql server 2008 r2 - How to get UserID from Entity Framework/Wcf Service in Delete trigger in DB? - suppose have table mytab(id, ..., userid) info like (id=1, ..., userid =123) then sl app + wcf ria service + ef, user userid = 456 run app , seek delete above 1 row data. did remove entity instance entityset wcf ria service, submitchanges. code like: mytab.userid = 456; context.mytabs.remove(mytab); context.submitchanges(....); but in delete trigger, can't info userid = 456 because delete, not update. how userid =456 in delete trigger case? entity-framework sql-server-2008-r2 entity-framework-4.1 wcf-ria-services silverlight-5.0

geometry - How to find the locus of common points of two segments that belong to the same line -

geometry - How to find the locus of common points of two segments that belong to the same line - i read various related answers. in particular here (how observe 2 line segments intersect?) explained how find intersection between 2 segments , check parallelism , if belong same line. wrote fortran programme next great idea. problem consists of finding union segment when 2 segments belong same line. here found c++ code (detecting coincident subset of 2 coincident line segments) not explained , cant read c++ fortran (here useful image depiction problem, posted in question no useful reply http://judark.myweb.hinet.net/parallel.jpg ). best language-agnostic algorithm find locus of mutual points (i.e. union segment, i.e. 2 points defining union) of 2 segments belonging same line? have managed planty of "if" computing manhattan distances between points (http://en.wikipedia.org/wiki/taxicab_geometry) wondering if there improve way it. a. if 2 segments on same line...

mysql - PHP: view unsuccessful emails -

mysql - PHP: view unsuccessful emails - i'm trying figure out how display list of unsuccessful emails sent , way test out. can display list of emails sent, i'm unsure on how retrieve list of emails unsuccessfully sent out. here i'm using retrieve mysqldb: //get email address list $query = "select email users id in (select participant_id roster ur ur.roster_id=".$roster['roster_id'].")"; $result = mysql_query($query); $emailstring2 = ""; $email2 = $result; while ($row = mysql_fetch_object($email2)){ $emailstring2 .= $row->email. "\n "; } in message section, retrieve via: $message .="successful emails: \n".$emailstring2." \r\n"; how accomplish this? one keyword ones not sent: not where id not in mysql php

django - How to give current time has default -

django - How to give current time has default - in models have datetime field. in template have separate date , time user enter. how give current time default. models.py datetime_reading=models.datetimefield() truepower_reading=models.decimalfield(verbose_name="true powerfulness reading(kwh)",max_digits=6,decimal_places=2,blank=false,null=false) apparentpower_reading=models.decimalfield(verbose_name="apparent powerfulness reading(kvah)",max_digits=6,decimal_places=2,blank=false,null=false) truepower_consumed=models.decimalfield(max_digits=6,decimal_places=2,blank=false,null=false) voltage_reading=models.integerfield(blank=false,null=false) powerfactor=models.decimalfield(max_digits=3,decimal_places=2) forms.py date=forms.datefield() time=forms.timefield() fields = ('date', 'time', 'truepower_reading', 'apparentpower_reading',"voltage_reading") class meta: model=kebreading exclude=("truepower_c...

osx - Know currently logged in user's language in mac via shell script -

osx - Know currently logged in user's language in mac via shell script - what terminal command know user's language setting (language name enough) in mac? can provide shell script? you can list of user's language preferences defaults read nsglobaldomain applelanguages . os x utilize languages in decreasing order of preference (if first 1 not available in particular app). on machine: $ defaults read nsglobaldomain applelanguages ( en, ja, fr, de, es, it, pt, "pt-pt", nl, sv, nb, da, fi, ru, pl, "zh-hans", "zh-hant", ko, ar, cs, hu, tr ) in bash , first 1 (the primary ui language), can piece off first 1 (admittedly messy) script: langs=(`defaults read nsglobaldomain applelanguages`) echo ${langs[1]/,/} # langs[0] open bracket osx shell user

TypeScript: imported module classes are not visible -

TypeScript: imported module classes are not visible - i testing typescript compiler multiple modules compiled amd modules. i have module "test" , separate file utilize it test.ts: export module test { 'use strict'; export class person { age:number = 0; sin:number = 1; } var pp = new person(); } test.ts declares module "test" , exports it. file compiles , js out set expected: test.js: define(["require", "exports"], function(require, exports) { (function (test) { 'use strict'; var person = (function () { function person() { this.age = 0; this.sin = 1; } homecoming person; })(); test.person = person; var pp = new person(); })(exports.test || (exports.test = {})); var test = exports.test; }) now in same folder there test2.ts using module "test" test2.ts: ///<reference path="test.ts"/...

SOAP web services using python. Would like to change the Envelope Document using Plugin before sending it using suds -

SOAP web services using python. Would like to change the Envelope Document using Plugin before sending it using suds - my current soap request sent via suds.client looks this: <soap-env:envelope (some name space uris)> <soap-env:header /> <soap-env:body> <ns5:savemodule> <request xsi:type="ns3:savemodule"> <module xsi:type="ns4:module"> <modulename xsi:type="ns1:string">test</modulename> </module> </request> </ns5:savemodule> </soap-env:body> </soap-env:envelope> this request fails on server. if take same xml request , massage , send visa soapui, works fine. did was <soapenv:envelope (some name space uris)> <soapenv:header /> <soapenv:body> <savemodule> <request> <module> <modulename>test</modulename> ...

cron - Compress log file in a shell script -

cron - Compress log file in a shell script - i have application deployed in jboss 7.1. need compress rotated files in gz format. thinking of create shell script in order that. any thought how? shell script sounds good. basically, if want rotate files older x an find -mtime $time -exec mv "{}" "$tmp_dir/" {}\; compress files in $tmp_dir, remove $tmp_dir, maintain archive. :) when rotate script called next time can list created archives sorted creation info , remove oldest 1 if more n .gz archives exist shell cron gzip jboss7.x

mysql - How to I grab the alternate object than the one I am searching with this inner join -

mysql - How to I grab the alternate object than the one I am searching with this inner join - i have 2 tables, users table , messages table. users: id (int) username (varchar) messages: id(int) send_id(int) receive_id(int) i using query gets me of messages specific user sent: select users.id, users.username users inner bring together messages on messages.send_id = users.id , users.id = someuserid how go grabbing receiving user's id , username instead of sending users information? select rec.id, rec.username users send bring together messages on (messages.send_id = send.id) bring together users rec on (messages.receive_id = rec.id) send.id = someuserid mysql sql join

decorator - What's the difference to use @staticmethod and global function in Python? -

decorator - What's the difference to use @staticmethod and global function in Python? - i have read what difference between @staticmethod , @classmethod in python? python @classmethod , @staticmethod beginner? as staticmethod can't access instance of class, don't know what's difference betweent , global function ? and when should utilize staticmethod ? can give example? like global function, static method cannot access instance of containing class. conceptually belongs containing class. other benefit can avoid name confliction. when function designed serve given class, it's advisable create static method of class. called cohesion. besides, if function not used outside, can add together underscore before mark "private", called information hiding(despite python doesn't back upwards private methods). rule of thumb, exposing little interfaces possible create code more clean , less subject change. even if function supposed ser...

iOS Autolayout and UIToolbar/UIBarButtonItems -

iOS Autolayout and UIToolbar/UIBarButtonItems - i have ios view autolayout enabled , have uitoolbar uisearchbar , uisegmentcontrol contained toolbar. want uisearchbar have flexible width need add together constraint forcefulness this, can tell cannot add together constraints items in uitoolbar in interface builder. options disabled. before autolayout accomplish autoresizingmasks . are constraints not allowed within uitoolbars/uinavigationbars ? how else can accomplished when using autolayout? autolayout constraints work uiviews , subclasses. while uitoolbar allows uiview based items (such uisearchbar , uisegmentedcontrol ) may have coexist uibarbuttonitems not inherit uiview . until autolayout can work uibarbuttonitems , have done. your alternative roll own toolbar widgets based on uiviews . ios uibarbuttonitem uitoolbar autolayout autoresizingmask

python - Increase the font size and style of a string -

python - Increase the font size and style of a string - i want increment font size of string 36 , style italic through python code. when ever run code in command line should show string in font size 36 , style italic. value = "hello world !!!!" is there way this? thanks in advance... http://en.wikipedia.org/wiki/ansi_escape_code mechanism controlling output formats in many kinds of terminal not offer command on fonts or sizes. if target particular kind of terminal might able find 1 does, it's not going solution you're happy with. info have supplied, short , simple reply "no, speaking, it's not possible". target gui instead of terminal if want command aspects if gui presentation. python font-size

jquery - Passing values - all in the same file - not working -

jquery - Passing values - all in the same file - not working - i need advise. i'm new ajax , jquery. i'm using postgresql 9.1 /postgis 2.0 /openlayers/geoserver , apache. i managed getting feature's id when clicked on map (openlayers), using javascript. using ajax m trying pass value php value , perform query. openlayers, jquery, javascript , ajax work fine php never gets value. here code snippets. //this within openlayers init function function selected_feature(event){ //getting id var sf = event.feature.fid; var sfs = sf.split("."); var sff = sfs[1] //ajax $(document).ready(function() { $.post("map.php", { jas: 'sff'}); }); //the php code snippet, after openlayers $_session['blah'] = $_post['jas']; $blah= $_session['blah']; echo $blah; $queryd=' select pins.p_name pins pins.p_id='.$blah; //fetching fill array $resultd=pg_query($conn, $queryd); $nord=pg_num_rows($resultd); ...