Posts

Showing posts from September, 2012

mysql - matching groupmembers against another group and add its name to the first -

i need take members of each group in table_a , in table_b if there 1 or more groups exact same members if ad resulting groupnames result. table_a holds groupmembers: +-------+----------+--------+-------+ |uniqeid|objectname|property|value | +-------+----------+--------+-------+ |0 |thing1 |color |grey | +-------+----------+--------+-------+ |1 |thing1 |hardness|100 | +-------+----------+--------+-------+ |2 |thingy |sofness |80 | +-------+----------+--------+-------+ |3 |thingy |color |brown | +-------+----------+--------+-------+ |4 |thingy |emits |gas | +-------+----------+--------+-------+ |5 |item |exists |1 | +-------+----------+--------+-------+ continues endless data kinds of propertys , objectnames. table_b basicaly same holds objecttypes groups in table_a +-------+----------+---------+ |uniqeid|objecttype|property | +-------+----------+---------+ |0 |stone |color | +-------

Partial match search every key's value in a document with MongoDB -

i'm working on project client wants store information trucks, trailers, , other types of equipment in database. after comparing , contrasting relational databases solutions mongodb, i've found flexibility of schema-less type of database combined way data going accessed application makes mongo better choice (see schema below). there's 1 issue i'm having, , how implement autocomplete search. salesmen want able search key (model, year, price, odometer reading) , list of documents match result. example, salesman might search "freightliner" , expect example document attached below. { "_id": "e-123456", "created_by": "2", "status": "available", "properties": [ { "active": true, "version": 1, "last_modified": "2014-06-10 00:51:02", "category": "heavy duty truck", "subcategory": &quo

c++ - Custom compile error message when undefined subtype is accessed -

i have types have sub-types same name each: struct typea { typedef int subtype; }; struct typeb { typedef float subtype; }; and types don't have sub-type used in same context: struct typec { // (no subtype defined) }; how can add dummy sub-type gives custom compile error message? my (so far unsuccessful) attempt is: struct typec { struct subtype { static_assert(false, "attempt access non-existent subtype of typec."); }; }; but static_assert(false, ...) can't work, compiler throws error if type never accessed. how can delay evaluation of static_assert time when type being accessed? a failed attempt introduce dummy enum , construct expression out of it: enum { x }; static_assert(x != x, "..."); concrete use case: have class-template list defined sub-types head , tail if non-empty, , should give error if these sub-types used if empty: template<typename...> struct list; // empty list: template

c# - How to create a separate STA thread for a WPF form that is inside of a dll and not a WPF application? -

i have dll contains wpf form. dll called wpf application, unfortunately can't touch it. problem there no main method in wpf form place [stathread] static void main() { //... } the exception thrown right on constructor of class. how can around sta problem in case. again, not wpf application, wpf form places inside of dll. namespace visualscannertest { /// <summary> /// interaction logic visualscanner.xaml /// </summary> public partial class visualscanner :window,iperipheral<visualscanner.visualscannersettings> { private visualscannersettings _settings; private readonly ieventmanager _eventmanager; public visualscanner(ieventmanager eventmanager):base() { initializecomponent(); _eventmanager = eventmanager; } private void submitbutton_click(object sender, routedeventargs e) { string input = inputextbox.text; inputextbox.text

HTML 5 collision detection platformer game -

i working on platform game , having issues collision detection. game set many blocks next each other or spaced out player jumps 1 block next. right player able jump on top of blocks, run side of blocks , stopped if jumping bottom of blocks. issues having right if in rare scenario player falls on top of part of block, game recognizes side of block block next , player falls through block. if jumping onto edge of blocks[3] , blocks[4] right next it, game recognizes player has jumped side of blocks[4]. idea how can go fixing this? below code collision detection. function checkblockcollisions() { // if player collides block, motion should stopped. for(var = 0; < blocks.length; ++) { var angle = blocks[i].angleto(player); var thistop = blocks[i].y - blocks[i].height / 2; var thisbottom = blocks[i].y + blocks[i].height / 2; var playertop = player.y - player.height / 2; var playerbottom = player.y + player.height /

ruby on rails - Heroku on Ubuntu 14.04 -

i following 'ruby on rails tutorial' michael hartl. on chapter 3 when try deploy working sample app heroku rejected, , though understand error message not know how correct it. here gemfile: source 'https://rubygems.org' ruby '2.0.0' #ruby-gemset=railstutorial_rails_4_0 gem 'rails', '4.0.5' group :development, :test gem 'sqlite3', '1.3.8' gem 'rspec-rails', '2.13.1' end group :test gem 'selenium-webdriver', '2.35.1' gem 'capybara', '2.1.0' end gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' group :doc gem 'sdoc', '0.3.20', require: false end group :production gem 'pg', '0.15.1' gem 'rails_12factor', '0.0.2' end

repository - Can I migrate a Mercurial repo from Bitbucket to a VPS? -

i've been using shared host , bitbucket + hg several years. @ end of year plan migrate site vps , want host private mercurial instance on same vps. possible migrate repo , entire history bitbucket new vps mercurial instance or must big push default trunk , lose old branches , not? i see lot of posts migrating bitbucket none migrating out! the thing have whole history of changes (not entirely true, in cases). it means can push whole repository (which includes history) other repository. that's it: create empty repository anywhere , push it.

Json_encode user input (php code) without eval? -

i want return json_encoded string form input this <input name="test" value="array(1,2,3)"> php should return: [1,2,3] i can achieve eval doing : eval("\$str=json_encode($test);"); but running eval on user input sounds asking trouble. any other options? here approach run php code string without using eval function fakeeval($phpcode) { $tmpfname = tempnam("/tmp", "fakeeval"); $handle = fopen($tmpfname, "w+"); fwrite($handle, "<?php\n" . $phpcode); fclose($handle); include $tmpfname; unlink($tmpfname); return get_defined_vars(); } extract(fakeeval('$test='. $_post['test'].';')); $json = json_encode($test); source

c - TicTacToe print winner -

i trying make tic tac toe game 2 players. pretty far , works part. can't figure out how print out string stored in array. have seen lots of loops examples. please let me know whats goin on. enter code here int main() { time_t t; char player1 [23]; char player2 [23]; int let; int turns = 0; printf("\n welcome galactic tic tac toe:\n"); printf("\n please enter player 1's name"); fgets(player1, 22, stdin); printf("\nplayer 2's name?\n"); fgets(player2, 22, stdin); void winner (char board [][9], char player1 [][23], char player2 [][23]){ if (board [0][0] && board [0][1] && board [0][2] == 'x'){printf("\nplayer 1 has won\n congratulations : %s ", player1);} if (board [0][3] && board [0][4] && board [0][5] == 'x'){printf("\nplayer 1 has won\n congratulations : %s ", player1);} if (board [0][6] && board [0][7] && board [0][8] == 

What is wrong with this Ruby code 2? -

what wrong code? class person def initialize(name) @name = name end def greet(other_name) "hi #{other_name}, name #{name}" end end write code class person def initialize(name) @name = name end def greet(other_name) "hi #{other_name}, name #{@name}" # <~~ missed `@` before name. end end if write name (instead of @name ), ruby try local var named name , didn't define any. try check if method have defined name or not, not present. undefined local variable or method `name' here example after fix : #!/usr/bin/env ruby class person def initialize(name) @name = name end def greet(other_name) "hi #{other_name}, name #{@name}" end end person.new("raju").greet('welcome!') # => "hi welcome!, name raju"

python - string index out of range list iteration -

i new python, not sure on how fix index string out of range. happens right after while loop when want send mylist[i][0] formatting function. pointer on code in general awesome! def formatting(str1): if str1 == '?': return true else: return false while(i <= len(mylist)): val = formatting(mylist[i][0]) if val == true: str1 = mylist[i] str2 = mylist[i+1] = + 2 format_set(str1, str2) else: if format == true: if (margin + count + len(mylist[i])) <= width: if (i == (len(mylist)-1)): list2.append(mylist[i]) print(" " * margin + " ".join(list2)) break list2.append(mylist[i]) count += len(mylist[i]) += 1 else: print(" " * margin + " ".join(list2)) list2 = [] count = 0 else

Making groovy @Log annotation safeguard calls inside closures -

edit : groovy-6932 logged , has been closed - problem marked fixed in groovy v2.4.8. i use @slf4j annotation add logging groovy classes. i because of ast transformation wraps log calls inside "enablement" check, documented here what i've found though, guard clause doesn't work if log method called within closure. running on groovy 2.2.0, code logs 1 message, prints "called" twice. @grapes([ @grab(group='org.slf4j', module='slf4j-api', version='1.7+'), @grab(group='ch.qos.logback', module='logback-classic', version='1.+')]) import groovy.util.logging.slf4j new testcode().dosomethingthatlogs() @slf4j class testcode { void dosomethingthatlogs(){ log.info createlogstring(1) log.trace createlogstring(2) closure c = { log.trace createlogstring(3) } c() } string createlogstring(int p){ println "called $p" return "blah: $p" } } i've tried a

php - Something weird about the download script -

Image
good day, just having trouble [again] download script. right now, issue whenever tried download file, download.php has been fetching , not ms excel file itself. though in process of downloading, shows icon , application file trying download in excel format. not understand downloaded it, become empty download.php here codes calling download: <?php $up = mysql_query("select * upload"); $countrow=0; while($cr = mysql_fetch_array($up)) { echo "<div style='float:left; '>"; echo "<p style='padding:5px; margin:5px; border:1px solid #ccc; '>"; echo "<a href='rental/download.php?id=".$cr['upload_id']."'><img src='images/icon.png'> </a>"." "."<a href='download.php?id=".$cr['upload_id']."'>".$cr['file_name

java - Installing Maven Plugins -

Image
i have instruction manual following picture. i figured required following plugin after searching maven plugin. have installed maven http://maven.apache.org/plugins/maven-ear-plugin/ so think above ear/wat settings in eclipse->pfreferences after install maven plugin. how install plugin maven? above website not how install plugin. searches leading me maven eclipse plugin installation instead of particular installation. i installing first time , have not worked maven before.

excel vba - Entering number in B column then finding number in A column -

sorry if title confusing. i working on excel file bit complicated. basically need put number in column b , have macro find same number in column copy (including number) above it. i have tried using find button cant seem make automatically find number listed in column b in relation column a. this code have tried far: range("d1").select cells.find(what:="12", after:=activecell, lookin:=xlformulas, lookat:= _ xlpart, searchorder:=xlbyrows, searchdirection:=xlnext, matchcase:=false _ , searchformat:=false).activate range("a58").select range(selection, cells(1)).select selection.copy okay, figured out in own way. column has pattern changing part number so: tim car 1 tim car 2 and on. in column b made formula =if(a3=c1,"copy","") c1 have number input user. made macro finding "copy" in column b offsetting left , made copy way top of column. it looked this: sub copy_1() application.screenupdat

javascript - Why is the 'label' tag not working in ie8 -

Image
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> <input type="checkbox" name="check" style="display:none;" value="check1" id="ch1"> <label for="ch1">check1</label> <input type="checkbox" name="check" style="display:none;" value="check2" id="ch2"> <label for="ch2">check2</label> </body> </html> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script> function showvalues() { alert(this.value); } $( "input[type='checkbox']" ).on( "click", showvalues ); </script> it work below picture in ie10 when click "check1" text but not working in ie8 move <script> tags inside <body> . i think want register clic

actionscript 3 - Action Script 3, Grid and GridRow in Action Script -

i want create 1 table in flex contains sub sections,colspans , rowsans. build <mx:grid> , <mx:gridrow> hardcoded in flex, want build dynamically action script. i not sure how build it. sample code need convert action script <mx:grid id="metricsgrid" stylename="grid" backgroundcolor="blue" horizontalalign="center" width="100%" height="100%"> <mx:gridrow id="cashmetricsgridheaderrow" > <mx:griditem colspan="3" stylename="griditem" verticalalign="middle" horizontalalign="center" > <mx:label text="{ gettodaysdatewithtitle() }" stylename="boldfontweight"></mx:label> </mx:griditem> </mx:gridrow> <mx:gridrow id="metricsgridrow1" bordercolor="black"> <mx:griditem rowspan="3" stylename="griditem" verticalalign

javascript - Three js merging Geometries and Mesh -

three js ver67 current code - var materials = []; var totalgeom = new three.geometry(); var cubemat; (var = 0; < datasetarray.length; i++) { var ptcolor = datasetarray[i].color; var value = datasetarray[i].value; var position = latlongtovector3(datasetarray[i].y, datasetarray[i].x, 600, 1); var cubegeom = new three.boxgeometry(5, 5, 1 + value / 20); cubemat = new three.meshlambertmaterial({ color: new three.color(ptcolor), opacity: 0.6 }); materials.push(cubemat); // cubegeom.updatematrix(); var cubemesh = new three.mesh(cubegeom, cubemat); cubemesh.position = position; cubemesh.lookat(scene.position); // totalgeom.merge(cubemesh.geometry, cubemesh.geometry.matrix); //three.geometryutils.setmaterialindex(cubemesh.geometry, i); three.geometryutils.merge(totalgeom, cubemesh); } var total = new three.mesh(totalgeo

php - Zend 2 Form Issue -

Image
i have updated framework 2.3.1. form classes showing following error in phpstrom. class must declared abstract or implement method 'setoption' what should ? you extending class not \zend\form\form there no errors default zend form class. try check instance of form extends. check use statements , check modules \zend\form\form overloads.

user interface - JavaFX textarea doesn't display changed value -

hello guys i'm using jdk 1.8 netbeans version 8 , scenebuilder 2.2. have files main.fxml , maincontroller have 2 tabs , textarea @ bottom supposed print out status info. login.fxml tab attached main.fxml first tab through include in scenebuilder. has own controllers , button need print info textarea in maincontroller. can access textarea fxmlloader , change value doesn't update in ui. let's @fxml logid textarea in maincontroller , code in logincontroller: @fxml private button btn; @override public void initialize(url url, resourcebundle rb) { btn.setonaction(new eventhandler<actionevent>() { @override public void handle(actionevent event) { try { fxmlloader fxmlloader = new fxmlloader(); fxmlloader.setlocation(getclass().getresource("main.fxml")); anchorpane pane = fxmlloader.load(); maincontroller control = (maincontroller) fxmlloader.getcontroll

jsp - How to get client public ip address in servlet java -

this question has answer here: get real client ip in servlet [duplicate] 3 answers i using tomcat server java web application. need client public ip address request. unable that, used request.getheader("x-forwarded-for") request.getremoteaddr() methods client machine local ip address. you running server in local network. if in wild request.getremoteaddr() should job. if need in local network public ip same in local network since behind router or uses nat dosen't make sense in eyes. though if want public ip use service ipecho: http://ipecho.net/plain

osx - How to disable white drop shadow in label? -

Image
i have label want set foreground color. however, there white shadow/outline: i've set foreground color (blue): // gtk# in monodevelop on mac os x var fg = new gdk.color (); gdk.color.parse ("#0000ff", ref fg); lbl.modifyfg (statetype.normal, fg); lbl.modifyfg (statetype.active, fg); lbl.modifyfg (statetype.prelight, fg); but can't seem find option shadow/outline. does know setting i'm missing? (answers gtk+ in c/c++ okay, need know i'm looking for) if using gtk+3 (as should) can disable text shadows on every gtklabel using following css fragment: gtklabel { text-shadow: none; } that css can put in main gtk+3 file (usually $xdg_config_home/gtk-3.0/gtk.css ) affect applications or can dynamically loaded application using along lines of following (untested) c code: const gchar *css = "...your custom css here..."; gtkcssprovider *provider = gtk_css_provider_new(); if (gtk_css_provider_load_from_data(provider, css, -1, n

ruby - ssh remote server login script -

currently trying write ruby script logging-in ssh remote server using "pty" & "expect" ruby library. , try create new rails app inside remote system using script. anyone can tell me. how logging-in remote server using ruby library ? you should @ of examples net::ssh , opens connection , gives block execute whatever command like, e.g.: #!/usr/bin/env ruby require 'rubygems' require 'net/ssh' host = '192.168.1.113' user = 'username' pass = 'password' net::ssh.start( host, user, :password => pass ) do|ssh| output = ssh.exec!('ls') puts output end (taken here ) i haven't done it, idea. given construct can run whatever program on remote server , parse output. interested in public key authorization should have @ answer this question , show how specify key-file.

jsf - Can I declare a Composite-Component using only xhtml file and still be able to use the component in a JAVA code -

i trying create composite-component using jsf simple tags without taking advantages of uicomponent. mean not want implement component inheriting uicomponentbase,uicomponentbase,etc. however, after implementation, want able use component in java code. example, consider composite component below(lets call mycompositecomponent): <html xmlns="http://www.w3.org/1999/xhtml" //... xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute name="anything" /> </composite:interface> <composite:implementation> #{cc.attrs.anything} </composite:implementation> </html> then want use component in java class below: public class javaclass { private mycompositecomponent mycompositecomponent; // .... } there have been similar answers question. omnifaces has utility method called components.includecomposi

mysql - How to use String variable value in 'create table' statement? -

this question has answer here: mysql create table dynamically 1 answer i have stored procedure in create new tables table_name being variable. though select table_name; returns variable value create table table_name(some_columns); creates table name table_name , not value. you need execute prepared statement: set @sql = concat('create table ', table_name, ' (some_columns);'; prepare stmt @sql; execute stmt;

vb.net - update the column specifed in the text box from the server -

i want update column of table column name entered in textbox while executing. following code not performing action. textbox14 contains column name , textbox12 consists value updated. dim squery string = "select name,days definedleave" dim cmd6 sqlcommand = new sqlcommand(squery, con) dim dr6 sqldatareader = cmd6.executereader() dim integer = 0 while dr6.read() try s = dr6(i).tostring textbox14.text = s = dr6(i + 1).tostring textbox12.text = dim sql = "update empleave set " & textbox14.text.trim & "=@na epid='" + txtcode.text + "'" using com7 = new sqlcommand(sql, con) com

service - Android how to trace that the user visited the page in a browser, -

i want create service, check web-sites user visited. so, have url of site or web-page, service should catch when user comes page , remember page visited. so, service should same, browser person uses. possible? no, it's not possible. want third-party app able track browse on phone?

c# - What is the purpose of using myevent(this,EventArgs.Empty)? -

i learning delegates , events in csharp.i have following set of codes: using system; using system.collections.generic; using system.text; public delegate void mydel(object sender, eventargs e); class event1 { public event mydel myevent; public void onfive() { console.writeline("i onfive event"); console.readkey(); if (myevent != null) { myevent(this,eventargs.empty); } } } public class test { public static void main() { event1 e1 = new event1(); e1.myevent += new mydel(fun1); random ran = new random(); (int = 0; < 10; i++) { int rn = ran.next(6); console.writeline(rn); console.readkey(); if (rn == 5) { e1.onfive(); } } } public static void fun1(object sender, eventargs e) { console.writeline(" surplus function called due us

php - iconv(): Detected an illegal character in input string -

Image
i using iconv function convert string requested character encoding. on below code $sms_text = 'a:'f3*'f'; // output received smpp $result = iconv('utf-16be' ,'utf-8//ignore' , $sms_text); echo 'ignore: ' .$result; echo $sms_text = iconv('utf-16be' ,'utf-8' , $sms_text); $result1 = iconv('utf-16be' ,'utf-8//translit' , $sms_text); //line no (53) echo 'transilt: '.$result1; and received below output if have string of dari , pashto language, showing first word , dont return remaining string after blank space. //ignore gives same output. should replace these blank spaces of other character can complete string? note: passing string received smpp(receiver). sms sent smpp : افغانستان کابل outpur received smpp : 'a:'f3*'f string converted iconv : افغانستان english string working well. thanks in advance. you converting string utf-8 charset on line: echo $sms_text = ico

ios - Incorrect ViewController Orientation After Segue IOS7 -

i have 2 viewcontrollers , main 1 shouldautorotate-no , second 1 shouldautorotate-yes . i'm presenting second viewcontroller function presentviewcontroller: , using uimodalpresentationcurrentcontext because have transparent background on second 1 still view first 1 on back. the problem when in first viewcontroller in "landscape" (appearing in portrait because of shouldautorote-no ) , present second viewcontroller , second 1 appears right in landscape, if rotate iphone portrait not rotate, unless rotate phone landscape makes orientations start working again normal. the behaviour of status bar correct one, problem viewcontrollers . any suggestions? - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { // return yes supported orientations return uiinterfaceorientationislandscape(interfaceorientation); } -(nsuinteger)supportedinterfaceorientations { return uiinterfaceorientationmaskall; } y

java - Returning String using REST Endpoint -

before minus question, should know searched solution , didn't find it. i want return string rest endpoint: @get @path("/getmystring") @produces({ mediatype.application_json }) public response getid() { string s = "this string"; (...) return response.ok(s).build(); } but in view receive char array (result in firebug): resource { 0="t", 1="h", 2="i", more...} in front use angular resource like: blablaresources.factory('angularapp', [ '$resource', function($resource) { return $resource(contextpath + '/.rest/v1/someservice', {}, { (... other methods ...) getstring : { method : 'get', url : contextpath + '/.rest/v1/someservice/getmystring' } }); } ]); is there wrapper class string or annotation send like: resource { value = "this string" } or normal "this string" tha

mysql - How To Update a Sql Table On Regular Interval -

i have data table in sql database , want update entries in table on 1 day(regular) interval. how can it you can try event scheduler in sql create event myevent on schedule @ current_timestamp + interval 1 hour update myschema.mytable set mycol = mycol + 1; i hope may useful you... since dont know scenario..

Facebook api multiple request -

i creating facebook application generator. , need check if user has added application on facebook page or not. in order that, first request facebook api give list of pages. loop through pages. , request apps on each of these pages. lastly compare appid 1 user created , displays display warning accordingly. the problem , when loop through each of pageid , request fbapi subpages, request response delayed , each loop completes cycle before results fetched facebook. here code, quite complex... ideas fix issue highly appreciated. fb.login(function (response) { fb.api('/me/accounts', function (apiresponse) { var totalpages = apiresponse.data.length; var pageindex = 0; $.each(apiresponse.data, function (pagenumber, pagedata) { var pageaccesstoken = pagedata.access_token; var tabpagename = pagedata.name; var tabpageid = pagedata.id; fb.api("/" + tabpageid + "/tabs", functio

Is it possible to use single XSLT 1.0 file for different ASP.NET pages? -

i've tried find on internet clear answer question if it's possible use single xslt 1.0 file different asp.net pages, didn't find it. i'm not sure how should work. have use parameters , kind of sections in xslt file? the example more welcome. yes can use same xslt multiple pages setting xml.transformsource code behind quote msdn the transformsource property used specify path xsl transformation style sheet file (representing xsl transformation style sheet) used format xml document before written output stream. can use relative or absolute path. relative path relates location of file location of web forms page or user control, without specifying complete path on server. path relative location of web page. makes easier move entire site directory on server without updating path file in code. absolute path provides complete path, moving site directory requires updating code. it's possible define source , transform file code

wpf - Custom button style is not working? -

i'm trying style button, ends not showing when apply custom style, content (the button's text) visible. how declare style: <color x:key="normalcolor" a="255" r="60" g ="158" b="184"/> <color x:key="hovercolor" a="255" r="74" g ="177" b="204"/> <color x:key="pressedcolor" a="255" r="26" g ="115" b="138"/> <solidcolorbrush x:key="normalbrush" color="{staticresource normalcolor}" /> <solidcolorbrush x:key="hoverbrush" color="{staticresource hovercolor}" /> <solidcolorbrush x:key="pressedbrush" color="{staticresource pressedcolor}" /> <style x:key="flatbutton" targettype="button"> <setter property="overridesdefaultstyle" value="true"/>

web services - WebService in Lotus Domino in Java getting the IP Address of the Client -

we have written webservice provider in java in lotus domino. obtain ip address of webservice consument, unfortunately not easy. my first try : mc = messagecontext.getcurrentcontext(); string remoteaddr = "remote_addr?" + mc.getproperty("remote_addr"); second try: string remoteip = mc.getstrprop(constants.mc_remote_addr); not working well. so have tried properties available in messagecontext iterator x = mc.getpropertynames(); while (x.hasnext()) { string strx = x.next().tostring(); // output of strx } and output was: rpc transport.url well, nothing helpfull. has found working solution? according blog http://www.unimatrix-0.de/index.php?option=com_content&view=article&id=50:messagecontext-im-domino-webservice&catid=35:webservices&itemid=55 in old version there few properties, distributed axis. thanx lot idea. webservicebase.getagentsession().getagentcontext().getdocumentcontext().getite

vb.net - Class ' cannot be indexed because it has no default property -

i following error class 'propgenie_webservice.branch' cannot indexed because has no default property. , not sure why. have googled don't proper explanation or fix. c# welcome. my code in branch.vb class: public function update() branch return update(me, path) 'error @ update. end function and in base class (resources.vb) have: public shared function update(of t {resources, new})(resource t, path string) t dim request = createrequest(path & "/{id}", method.patch) request.addurlsegment("id", resource.id.tostring(cultureinfo.invariantculture)) request.addbody(resource) dim client = createclient() dim responce = client.execute(of t)(request) if responce.statuscode <> httpstatuscode.ok throw new invalidoperationexception("update failed" & convert.tostring(responce.statuscode)) end if return responce.data end function you need s

ios - How to control object from another view controller - Objective-C -

let's have uiview object in viewcontroller a, @ point switched viewcontroller b. there way change uiview object in viewcontroller if example button pressed in viewcontroller b, when go viewcontroller uiview object in new position. i tried doesn't seem anything. -(void)viewwillappear:(bool)animated { if (returning) { self.aview.frame = cgrectmake(newx, newy, newwidth, newheight); } many thanks. i'd suggest following given current starting point: -(void)viewwillappear:(bool)animated { [super viewwillappear:animated]; if (returning) { self.aview.frame = cgrectmake(newx, newy, newwidth, newheight); [self.aview setneedslayout]; [self.aview layoutifneeded]; } } i assume have found way setting returning from view controller b. (if not, there relevant information in other comments.)

Wordpress author page, change menu parent -

i have author page on wordpress site (author.php). problem though when im visiting author page, wordpress highlights blog menu item. want have menu item parent. how go it? dont want use no js/jquery this. thanks it's not clear how author page url looks like. in general site url/author/"author name". if site has single author can add author page link custom menu item . or can use jquery function search "author" in url , add active class in desired menu item <script type="text/javascript"> $(document).ready(function () { if(if(window.location.href.indexof("author") > -1)) { $("#author_menu").addclass('active'); } }); </script> not cleanest solution, use few instances of current page menu highlighting pages aren't child/parent related in way: <?php if (is_author()) { ?> <script type="text/javascript"> jquery(function($) { $(document).ready(function

java - Can we override the intersection method of Guava to compare objects? -

i have tried compare sets of type string using sets.intersection method() in guava. works fine. want know method should implement compare 2 objects? have overridden compareto() method sets.intersection treat similar objects different. can advice please? thanks. given implementation of sets.intersection() : public static <e> setview<e> intersection(final set<e> set1, final set<?> set2) { //... return new setview<e>() { //... @override public boolean contains(object object) { return set1.contains(object) && set2.contains(object); } @override public boolean containsall(collection<?> collection) { return set1.containsall(collection) && set2.containsall(collection); } }; } i'd have implement whatever methods needed make contains() , containsall() work set s pass in, because work delegated set s pass in. so hashset s equals() , hashcode() , ,

svn - Is there a feature in tortoisesvn where inserted spaces are not shown to me as changes -

Image
i use tortoisesvn 1.6.5 apache subversion client. sometimes, when change in source code, perform not change, - inserting spaces in other lines - bring commands of block in line. after this, when want check changes "show differences unified diff", nice have feature "do not show, when spaces have been inserted". is there this? this possible hide if use option show changes code comparison rather show differences unified diff . this bring tortoisemerge (unless of course have reconfigured programs use editor). in tortoisemerge have option of selecting ignore whitespace changes .

c# - Generic with T of value type -

is possible define generic class t can belong value type (such int, double , on)? yes, need struct constraint: class onlystructs<t> t : struct { } but should aware of allows user-defined structs, not int , double etc.. unfortunately there no built-in way restrict t specific types where t : int,double,float .

jquery - Implementing highcharts in OOP Javascript -

i want implement highcharts in full object oriented way , configurable. can call object , pass in values options chart should display. so started creating function like: highchartclass , please @ code below: $(function () { var highchartclass = { create: function (toid, type) { return new highcharts.chart({ chart: { renderto: toid, type: type, backgroundcolor: 'transparent' }, legend: {}, subtitle: { text: '' }, xaxis: {}, yaxis: [], tooltip: {}, plotoptions: {}, series: [] }); } }; var chartobj = highchartclass.create('container', 'area'); chartobj.settitle({ text: 'cpm imps spend time' }); var chartoptions = highcharts.getoptio

java - Time Complexity of keySet() for encapsulated Map<> values -

i need hashmap signature hashmap<integer, double> map; but encapsulated 2 values like: class customkv { integer key; double value; } hence, map<> becomes set<customkv> custommap; if use map , when wanted iterate on keys, map.keyset() sufficient. however, if use second, have iterate on objects of customkv , add key s, add them in set, return it. my question is: java have optimization this? or each time call keyset() , going iterate on objects? edit: here, write difference of 2 iterations: for(integer : map.keyset()) for(customkv kv : custommap()) it seems identical. ask is, if keep calling for(customkv kv : custommap) int key = kv.getkey(); would slow me down, or java recognize , treat custommap map? if you're asking java's implementation, hashmap cache set after first call keyset() . first call doesn't require iteration, because returns view, or wrapper, of underlying entry set. so, yes, java opti

javascript - How can I show all visible tooltips when using jQuery UI with tabs and accordion? -

i'm working on web-application , use jquery ui tabs , accordions , qtip2 (with tooltips). i'm trying create "help" function toggle display of visible tooltips - , when user change tab or accordion, tooltips should update based on tooltips should visible. i've created simple js-fiddle example illustrates problem pretty well. http://jsfiddle.net/z3my2/8/ html: <div id="maindiv"> <div id="mapcontainer"> <div id="simple_map" style="display: inline-block"> <p title='maptitle' data-qtip2enabled>place map here</p> </div> </div> <button type="button" id="showhelp">show messages</button> <div id="tabs"> <ul> <li><a href="#querytab">search</a> </li> <li><a href="#parameterstab"&g

php - Error in SQL syntax DATATIME option -

i started new php script, , used first time datatime option in mysql. think makes problem. my sql table : id int(6) auto_increment, name varchar(40) not null, pseudo varchar(40) not null, email varchar(40) not null, password varchar(40) not null, plan varchar(40) not null, date datetime default current_timestamp, points int(6) not null, primary key(id,name,pseudo,email,password,date,points,plan) when try execute query: insert users(null,"name","pseudo","email@email.com","pass1919",null, "100"); this error displays : error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax use near 'null, "name","pseudo","email@email.com","pass1919",null,"100")' @ line 1 as others have said, and insert users(name,pseudo,email,password,paln,date,poits) values("name","pseudo","email@email.co

javascript - JQuery and Ajax calls on newly created elements -

i new ajax , jquery , have been doing ton of reading , cannot find solution work me. i have jquery on.click trigger calling function via ajax update page without reloading entirely. however, these new elements being created cannot have function triggered on well. the function below adds <tr> end of table . new <tr> 's <a> elements added cannot trigger same function after has been added. $("a.add-department").on( "click", function(e) { e.preventdefault(); bootbox.dialog({ message: '<form class="form-horizontal row-border"><div class="form-group"><label class="col-md-2 control-label">name:</label><div class="col-md-10"><input type="text" id="department-name-add" value="" class="form-control"></div></div></form>', title: "add department", buttons:

php - Using session to return message only returns one message -

so have sign form. 1 register.php , actual form. , other r.php , process it. use sessions send error message r.php register.php . issue reason can figure out how display one if($name === ''){ $_session['name_req'] = 'make sure enter name'; header('location: register.php'); exit(); } elseif($name > 255){ $_session['name_len'] = 'enter shorter name'; header('location: register.php'); exit() } this code sends message register.php display error <?php echo isset($_session['name_req']) ? $_session['name_req'] : '';?> the issue if it'll display 1 error @ time , want display of them @ once. ideas? with code supply, page redirects if 1 error found, try instead: if(isset($_post['submitbuttonname']) && $_post['submitbuttonname'] == "submitbuttonvalue") { if($name === ''){ $_session['name_req'] =

node.js - Express JS 4: exported routes and session -

i'm quite new node , i've been working through issue hours failing @ finding solution :/ perhaps u can me :) i have exported routes out of app.'s routes.js. there having post login-process. when loged in, want pass userid databank session later use (e.g. socket io). how have construct this? have tried several setups don't seem it. app.js var cookieparser = require('cookie-parser'); var session = require('express-session'); var sessionstore = new session.memorystore(); app.use(cookieparser('lts session')); app.use(session({ secret: 'lts session', cookie: { maxage: 600000 }, store : sessionstore})); var router = require('./modules/routes.js'); app.use(router); routes.js router.post('/', function(req, res) { .... req.session.name = admins[id].name; req.session.userid = id; ... }; later on control session logging sessionstore. if u manipulate session-vars, use: req.session.save() t

javascript - AngularJS select2 not showing any values -

i using select2 way specified in https://github.com/angular-ui/ui-select2 <div ng-controller="samplecontroller> <select ui-select2 ng-model="select2" data-placeholder="pick number"> <option value=""></option> <option ng-repeat="number in range" value="{{number.value}}">{{number.text}}</option> </select> </div> but not working me. see dropdown there no values select. if change have static list follow works fine. <div ng-controller="samplecontroller"> <select ui-select2 ng-model="select2" data-placeholder="pick number"> <option value="">value1</option> <option value="">value2</option> <option value="">value3</option> </select> </div> what missing here? my model follow function samplecontroller($s

eclipse - Best way to organize java code... multiple projects or separate by packages? -

i embark on personal java project in eclipse myself , friend create game server, game engine, , game based on existing card game. game server come last, i'd concentrate on building card game engine followed game itself. in school, create packages gameengine.whatever , different games in packages game.gamename.whatever . thinking of making game engine own separate project , have game individual project well, instead of having them in 1 project , separating them based on packages, i've done in school. in internships, have multiple projects working together, have not touched on in classes @ all. is there difference in doing 1 way versus other? or equivalent? thanks! i'd should make separate project "x" if "x" can used on own or there (or be) @ least 2 different projects use "x". otherwise, package fine.