Posts

Showing posts from March, 2011

amazon ec2 - MySQL error :ERROR 1045 (28000): Access denied for user 'guest'@'localhost' (using password: YES) -

i have linux ec2 instance has mysql server installed on it. i can login mysql root command: mysql -u root -p for reasons created user guest using following commands: create user 'guest'@'%' identified 'passpass'; grant privileges on * . * 'guest'@'%'; flush privileges; then exit root user , try login guest user: mysql -u guest -p entered correct password , got error: error 1045 (28000): access denied user 'guest'@'localhost' (using password: yes) i checked out anonymous user . mysql> select user, host, password mysql.user user=''; empty set (0.00 sec) kindly help. not able connect mysql using guest user credentials try run command grant on . 'guest'@'%' identified 'passpass'; flush privileges; thanks

cmd - Command line to change file extension of all files under a folders and its subfolders -

i looking command line can change file extension of files under folder , subfolders. there way this? i tried ren *.js *.txt changes file extension of files under 1 folder. i assume ms-dos mean command prompt on windows. not many people still use ms-dos. the following run ren command on each folder within hierarchy contains .js files. bit more efficient running ren each file individually. for /r %f in (.) @if exist "%f\*.js" ren "%f\*.js" "*.txt" double percents ( %f becomes %%f ) if run within batch script.

How can I send more information via GET method? in VALENCE -

i need valence portal. i open app direct link here: http://192.168.1.1:7040?display=desktop&app=1001 but need more data on this, pe: 'coduser' if put &coduser=1 doesn't work http://192.168.1.1:7040?display=desktop&app=1001&coduser=1 i extecute alert , result read url: http://192.168.1.1:7040/desktop/examples/p01/index.html?app=1001&key=xxxxxxx&lang=en url doesn't contains "coduser". how can send more information via method? thanks, ivan. i found solution problem. not best solution aceptable solution, if knows other, tell me, please. my solution: created new hook.js. on file can read current url (here read url, 'coduser' included). on new hook: cod=foundparameterurl('coduser');//personal function, include current url (location.href) ext.util.cookies.set("coduser",cod); later on app, read cookie: var cod = ext.util.cookies.get("coduser"); and continue normalit...

Android RelativeLayout : Text getting clipped -

Image
i think image explain far better words. screenshot layout viewer thingy in intellij, happens on device well. want cut off text not displayed @ all. possible? <textview .... android:lines="2" or: <textview .... android:maxlines="2" first option sets exact number of lines text view, second options sets maximum number.

c - Adding characters at the end of a string -

i trying add characters @ end of string using following code. not getting desired output. #include<stdio.h> #include<stdlib.h> #include<string.h> int main() { int l,i; char a[30]; printf("enter \n"); scanf("%s",a); l=strlen(a); for(i=l;i<(29-l);i++) { scanf("%c",&a[i]); a[i+1]='\0'; printf("\n%s",a); } return 0; } i guess, problem whitespace. after enter first string, there still newline \n in input buffer. when read 1 character scanf , newline , not character entered. you can skip whitespace, when prefix format string space scanf(" %c",&a[i]); now append character entered @ end of string. update: from scanf the format string consists of sequence of directives describe how process sequence of input characters. ... • sequence of white-spac...

oracle11g - passing parameters between forms -

hi i'm trying passing parameters between forms have error: frm-92101 there failure in forms server during startup. wanna place button on employee form when pressed, call employee/dependent form , automatically query dependents employee being viewed on employee form. icreated employee form , add button.i assigned trigger when bouton pressed : declare pl_id paramlist; begin pl_id := get_parameter_list('tmpdata'); if not id_null(pl_id) destroy_parameter_list( pl_id ); end if; pl_id := create_parameter_list('tmpdata'); add_parameter(pl_id, 'employeessn', text_parameter, :ssn); run_product(forms, 'empdepn', synchronous, runtime, filesystem, pl_id, null); end; after add parameter employee/dependent created parameter called employeessn code bellow , add parameter employeessn , add when-new-form-instance trigger : declare blk_id block; begin -- obtain block id of employee block. -- master bloc...

python - installing lxml in OSX 10.9 -

i have problem installing lxml in mavericks machine. i tried possibilities installing prebuild binaries using normal pip pip static deps and building current version in normal model current version static deps older version in normal mode older version static deps and end in error. clang: error: unknown argument: '-mno-fused-madd' [-wunused-command-line-argument-hard-error-in-future] clang: note: hard error (cannot downgraded warning) in future error: command 'cc' failed exit status 1 here detailed message copying /users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxslt/xsltutils.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes/libxslt running build_ext building 'lxml.etree' extension cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -denable_dtrace -dmacosx -dndebug -wall -wstrict-prototypes -wshorten-64-to-32 -dndebug -g -fwrap...

selenium - How to use webdriver to randomly click on a button with precondication -

i'm trying write test script flight booking tickets scenario this: randomly click button description contains keyword "tax not included",then results shows; randomly click button not contains keyword, price shows. for instance: go ebay.com , search "iphone",in search result page,randomly click url label contains keyword "buy now"... anybody got clean solution that? in advance. i have no clue handle case... here code: public void flightschedule(){ if (be.istextpresent(locator.getvalue("tax_text"), 1000)){ //if keywords displays arraylist<webelement> lists = (arraylist<webelement>) be.getbrowsercore().findelements(contains(text(),'tax not included')); random random = new random(); int ra = random.nextint(lists.size()); webelement element = (webelement) lists.get(ra); } the page source code is: <div id="itembarxi151" class="avt_column avt_colum...

How to create two same name databases in two different mySQL users ? -

i using mysql 5.5 in ubuntu 12.04. have created 2 different users 'root' , 'abc' , want create 'items' database in both user accounts want 2 databases separate.now problem have created 'items' database in root user 10 tables , when trying create new user 'abc' 'items' database comes automatically in new user 10 tables , don't want do. how can create 2 same name databases in different user accounts different tables in both dbs? you cannot. database names unique per mysql server. (so cannot have 2 databases same name, different users)

sql server - Replace " with &quote from varchar variable in sql -

i'm trying replace " &quot , replace(@variable,'"','&quot;') didn't help, in xml got <tag>&amp quot;test&amp quot;</tag> instead of <tag>&quot;test&quot;</tag> example: declare @text varchar(20) = '"test"' set @text = replace(@text,'"','&quot ;') select @text declare @table table (id int) insert @table (id) values (123) declare @testxml xml = ( select @text @table tag xml auto, elements ) select @testxml thanks in advance if problem in select query, try below sql change the select @testxml to select '<tag>' + @testxml.value('/tag[1]','varchar(max)') + '</tag>' 'word' you below result in select query: word ------------------------------- <tag>&quot;test&quot;</tag> update to keep '&' char need <!...

osx - Set folder background image on Mac with Python -

i change background images of folders in mac os 10.9 based on name. can't seem find way of changing background picture in python or information background picture in general. i believe things such background image , icon positioning stored in .ds_store, possibility modify change image? if not possible in python there suggested language able this? i believe things such background image , icon positioning stored in .ds_store, possibility modify change image? you can explore ds_store settings using xattr command, or ls -@ command if you're using default osx utils. if not possible in python there suggested language able this? there xattr python package lets this. for background images, found that answer though it's dmgs. though, there's graphical recipe change folder's background, still can't find extended attribute property being used there… i did change folder's background, there's no extended attributes setting h...

ruby - When using acts-as-taggable-on gem in Rails, is it possible to delete orphaned tags? -

i deleted posts in app. tags still there. if delete posts tags won't deleted. how can detect , delete tags not linked posts? there configuration setting can add config/application.rb make sure tags deleted when no longer used: actsastaggableon.remove_unused_tags = true you can put in initializer under config/initializers . source: https://github.com/mbleigh/acts-as-taggable-on#configuration

MongoDB windows service install -

i'm trying configure windows 7 (32 bit) service mongodb cmd command: mongod.exe -f mongo.conf --install --servicename mongodb --servicedisplayname "mongodb windows service" --servicedescription "mongodb" -f mongo.conf reference configuration file located in same directory mongod.exe. how mongo.conf looks like: dbpath = c:\program files\mongodb 2.6 standard\data logpath = c:\program files\mongodb 2.6 standard\logs\mongo.log port = 27017 , yet, when i'm trying run command, mongo logs me: --install has used --logpath has idea wrong that? use full path in -f argument: --install -f "c:\program files\mongodb 2.6 standard\mongod.conf" (caveat: haven't tried whitespaces in folder names) services working directory isn't directory install them or exe resides in, %windir%\system32 directory .

Server not sending HTTP 101 response when creating a websocket using CC3000 and socket.io -

i connecting cc3000 node.js server using socket.io. have used following library create websocket https://github.com/chadstachowicz/socket_io_arduino_cc3000 in socketioclient.cpp, creates tcp connection, gets session-id(sid). disconnects , creates tcp connection , uses sid upgrade connection websocket. client(here cc3000) sends following header information: client.print(f("get /socket.io/1/websocket/")); client.print(sid); client.println(f(" http/1.1")); client.print(f("host: ")); client.println(hostname); client.println(f("origin: arduinosocketioclient")); client.println(f("upgrade: websocket")); // must camelcase ?! client.println(f("connection: upgrade\r\n")); after request client waits http 101 response server. server not sending response. logs warning " websocket connection invalid " , ends connection. is protocol creating websocket fine or there missing information in header? also, want know sho...

ios - NSDictionary from json -

how can create nsdictionary json response without manually adding object keys? yes can. nsdictionary *dictionary = [nsjsonserialization jsonobjectwithdata:data options:kniloptions error:&error]; see here

regex - c# check for integers in a textbox -

i trying check if textbox contains number. problem returns contains non-numeric character. i've tried several ways, none of them seems work. one of ways i've tried is: if( regex.ismatch(tb.text.trim(), @"^[0-9]+$")) // tb.text textbox it not matter enter in textbox, returns contains non-numeric character (i tried entering 1-9, 'a', 'b') you parse string specific number type, i.e. double result; if (!double.tryparse(tb.text, out result)) { //text not valid double; throw new exception("not valid number"); } //else value within result variable from regex seems need integer values, should use int.tryparse or long.tryparse instead. quick , dirty test program: void main() { testparse("1"); testparse("a"); testparse("1234"); testparse("1a"); } void testparse(string text) { int result; if (int.tryparse(text, out result)) { console.writeline(text + ...

Laravel: Moving from Apache to nginx -

i'm using digitalocean serve website webuzo cpanel. i have laravel app , changed webserver apache nginx. suddenly routes have stopped working. i have read question nginx configuration laravel 4 but because i'm using webuzo don't know nginx configuration files should editing are. can me? you can edit file located @ /usr/local/apps/nginx/etc/conf.d/common nginx configurations. make sure restart nginx service everytime make changes file changes take effect

c# - How to draw Windows-style folder icons that preview the contents -

Image
i have c#/wpf application displays collections of components. want know how create image styled windows 7 folder icon, 1 or 2 of content thumbnails enclosed yellow leaf folder. (the collections have aren't real windows folders, , contents aren't real windows files) google approach i have spent fair amount of time searching code samples on how this, or remotely similar. can't find single example of doing this, has surprised me. tells me 1 of 2 things: i can't find right keywords search on (combinations of: thumbnail, windows, c#, wpf, icon, folder) nobody else has ever wanted this, , that's because there better way of doing want do. coding approach i can see there might image drawn first, , skew transforms applied each content thumbnail, overlaid, , front image. i've seen code examples show how skew images, etc. there subtle effects being drawn here (shadows), though "canned". i'm not sure how separate example images below front ,...

windows phone 8 - WP8 facebook deeplinking -

is possible make fb app open application when user clicks specific link/post on someones wall ? (post/link should posted fb app of course) i know possible on android/ios, possible on wp8 ? thanks! well, remember, cant posting link, since uses http protocol default , not custom protocol of app default(that used of deeplinking). however can post link page on server, have write redirect javascript code , can put custom protocol url there. let me know if need me elaborate little more. ps: because, fb deosnt have sdk windows phone :(

php - Error: mysqli_fetch_object() expects parameter 1 to be mysqli_result -

i don't know problem line or how fix it, before okay , i'm getting error: mysqli_fetch_object() expects parameter 1 mysqli_result here php code: <?php } if($_get['action']=="user_info") { $userid = $_get['user_id']; $query = "select * user user_id ='{$userid}'"; $result = mysqli_query($link, $query); $user = mysqli_fetch_object($result); $queryt = "select * user_title id='".$user->title."'"; $resultt = mysqli_query($link, $queryt); $rowt = mysqli_fetch_object($resultt); $title = $rowt->name; $sorgu = "select * pub_author user_id='$userid'"; $publications = mysqli_query($link, $sorgu); while($a = mysqli_fetch_object($publications)) { $ids .= $a->pub_id . ','; } $ids = rtrim($ids,","); $sorgu2 = "select count(id) total , year publication id in ($ids) ...

php - full calendar always shows all events -

i have issue full calendar, working when want add events. problem occurs categories. when calendar loads, shows events perfect. however, when change category in category select, still shows every event. don't know why doesn't update because when execute: $this->result = mysqli_query($this->connection, "select * $this->table $this->condition"); and then: var_dump($this->result); i have numbers of events: object(mysqli_result)#3 (5) { ["current_field"]=> int(0) ["field_count"]=> int(9) ["lengths"]=> null ["num_rows"]=> int(3) ["type"]=> int(0) } 3 here, , still shows 8 events. thanks helping. i found how work this. the problem got sql result database , not json array datas. passed calendar object build result json function : /** * function transform mysql results jquery calendar json * returns converted json */ public f...

How can I open Android DatePickerDialog with specific locale like iOS -

i open datepickerdialog in dd/mm/yyyy format while phone locale set english(united stated) has default format "mm/dd/yyyy". i know in ios have datepicker.locale method specify locale particular datepicker don't know how can android. or there anyway can give datepicker our own date format ? help needed! thanks. this may view datepickerdialog datepicker =new datepickerdialog(context, callback, year, monthofyear, dayofmonth) datepickerdialog(this); try { field f[] = datepicker.getclass().getdeclaredfields(); (field field : f) { log.i("field name :",field.getname()) } once have name of both fields want move (probably have guess it). can swap views . convert field view : field.setaccessible(true); object month = new object(); month = field.get(datepicker); // ((view)month) typecast convert view

javascript - Websocket - send something before onclose is triggerd -

hello im realy new websockets, build webchat websockets , php socket server. store userdata use php-sessions. i want unset session when user disconnects. when websocket onclose triggerd im not able send message (server allready closed or in close state) server. is there nice way send client server before onclose happens? thanks lot it depends. you can send right before closing window/tab onbeforeunload event. or if have deterministic close function in app buttons "disconnect", "close", "connect somewhere else"... etc..., have ensure send whatever want before closing. but there nothing "onbeforeclose": https://developer.mozilla.org/en-us/docs/web/api/websocket

How to implement simple counter in WSO2 ESB? -

i'm developing proxy service has count requests , injects number of requests in payload , sends next endpoint. develop counter can use class mediator easy , useful since loads in memory , makes fast, fact of writing java code needs compilation made me think of more agile method. came saving in file in registry, not since there no loading in memory , has i/o overhead. wondering if can implemented in script mediator example jscript. i'm trying find best way that.

javascript - How to use RouteBoxer.js for Google Map on Android -

Image
i have route. now, want find nearby markets, example, around route. on web version, use routebox library successfully. problem can't use in google map on android, because javascript library. what can now? how can use library on android or have workaround way? you can call javascript app in android. need use js evaluator android (jsea). just like: jsevaluator.callfunction(new jscallback() { @override public void onresult(final string result) { // result here } }, "functionname", "parameter 1", "parameter 2", 912, 101.3); to call javascript. so, can access library allow communicate app routeboxer api. check on github jsea . should allow use routeboxer usual. hence, call route app.

CSLA remove child object -

i new csla , still trying head round it. need know how delete child object through parent ? e.g if have project class (parent) has projectresources (child) , need delete project. how do through csla ? e.g project myproject = project.getbyprojectid(projectid); projectresourcelist resources = myproject.projectresources; myproject.delete(); if (myproject.isdeleted) { while (resources.any()) { myproject.projectresources.remove(resources[0].projectresourceid); } } myproject.save(); remove() doesnt remove them database. cant delete parent object because sql server complaint referential integrity. don't want stored proc handle cascade delete. suggestions highly appreciated. thanks. the csla collection in-memory domain object. when remove item collection ite...

c++ - How to mock a QML component -

actually i'm trying run test on qml component embeds c++ objects . unfortunately, i'm getting errors when execute tests. c++ objects aren't recognized qml file. makes sense c++ objects set in main.cpp file. my question is: how can mock context property performing qml tests? or other said, how can unit-test mixing qt/qml code? as understand right, got same problem i. time ago wrote mock: https://bitbucket.org/troyane/qml-cpp-template (you can use code free purposes). take @ main.cpp , there can see 2 ways of doing things: // 1 case: // register type , create object @ qml side qmlregistertype<cppclass>("cppclassmodule", 1, 0, "cppclass"); qqmlapplicationengine engine(qurl("qrc:///qml/main.qml")); qdebug() << "qt version: " << qversion(); // 2 case: // create object here , "move up" qml side // engine.rootcontext()->setcontextproperty("cppclass", new cppclass); good luck! ...

ruby on rails - Devise `find_first_by_auth_conditions` method explanation -

my 2 methods using devise : method1 def self.find_first_by_auth_conditions(warden_conditions) conditions = warden_conditions.dup where(conditions).where(["lower(username) = :value or lower(email) = :value", {:value => signin.downcase }]).first end method2 def self.find_for_database_authentication(warden_conditions) conditions = warden_conditions.dup login = conditions.delete(:signin) where(conditions).where(["lower(username) = :value or lower(email) = :value", {:value => login.strip.downcase }]).first end my questions: what code perform/do? login = conditions.delete(:signin) without above code error undefined local variable or method signin the following answers question 1) —specifically a) , b) below. following code example , not mirror actual methods or arguments generated devise: here: hash contains :signin key-value pair , other valid activerecord 's #where syntax http://api.rubyonrails.org/classes...

Field Change Listener for Custom ListView in Blackberry? -

Image
i working in application have show contacts in list view. have created list view of vertical field manager , label fields. i have email field , phone number field on have call on click listener. i have implemented listener on class failed click event. not show click event. currently, working below code: public class customlistview extends verticalfieldmanager implements fieldchangelistener{ private verticalfieldmanager mvfm=null; private font _allfonts=null; private font _headingfonts=null; /** * @param resultvec */ public customlistview() { super(verticalfieldmanager.vertical_scroll); setmargin(0, 0, 10, 0); int resolutionwidth = display.getwidth(); // planning 3 fixed resolutions 320, 360 , 480 //handle code different devices if(resolutionwidth>=480){ _allfonts = applicationfont.explainationfont_18; _headingfonts = applicationfont.labelfont_18; }else if(resolutionwi...

asp.net mvc - nopcommerce: telerik grid link item cannot find parameter (Id is not defined) -

i have added new menu, new controller , new view in nop.admin project. want bind edit link inside rad grid in nop.admin. code is. @(html.telerik().grid<nop.admin.models.authorizeworkshops.registrationmodel>() .name("productregistration-grid") .columns(columns => { columns.bound(x => x.registeredproducts.make); columns.bound(x => x.registeredproducts.model); columns.bound(x => x.registeredproducts.year); columns.bound(x => x.registeredproducts.cc); columns.bound(x => x.registeredproducts.authorizedworkshop); columns.bound(x => x.registeredproducts.purchasedate); columns.bound(x => x.registeredproducts.inoiceno); columns.bound(x => x.registeredproducts.serialno); columns.bound(x => x.registeredproducts...

asp.net - "NavigateUrlField" attribute in Sharepoint TreeView Not working? -

am doing sample project company in sharpoint designer . while trying create treeview navigation organization chart , getting below error : could not bind 'url' property (specified navigateurlfield) while data binding treeview. please check bindings fields. the odd thing i've tested assigning string navigateurl property directly, putting same string in url field in xml. doing manually works without problem, same string won't work if comes xml. any kind of advice highly appreciable thanks it doesn't matter whether use qualified url or path. should set "nav" property in node tage, , set navigateurlfield "nav". please refer this you: treenodebinding.navigateurlfield property

php - DropDown Menu echo error -

i attempting create drop-down menu within booking system lists events sql database, this code have written: $sql = "select * events"; $exesql = mysql_query($sql); while($arrayevents = mysql_fetch_array($exesql)); { echo"<li><a href=$arrayevents['eventname']</a></li>"; } as new php wondering how can improve , prevent error: parse error: syntax error, unexpected t_encapsed_and_whitespace, expecting t_string or t_variable or t_num_string in /home/unix/student10/w1284519/public_html/stf/dropdown.php on line 26 line 26 echo written edit: error has been fixed code displays 3 bulletpoints, how fix this? thank in advance help! echo"<li><a href=$arrayevents['eventname']</a></li>"; is list not dropdown , change this: echo "<select>"; while($arrayevents = mysql_fetch_array($exesql)) { echo"<option> $arrayevents['eventname']</option...

xml - Current date in email template openerp? -

how add current date in email template current date showed in mail? how can change date format displayed? email_templates use 'jinja' template engine. bad news lazy people jinja doesn't support inline python. have access variables passed template @ render time. one of variable object , represents object attach template, let res_partner . can try extend res_partner , add field calculates current date. this: from openerp.osv import fields, model class res_partner(osv.model): """inherit res.partner add generic field can used in email templates.""" _inherit = 'res.partner' def _get_now(self, cr, uid, ids, field_name, arg, context): datetime import datetime return datetime.now() _columns = { 'current_date_time': fields.function(_get_now, type="char", method=true, store=false) } res_partner() now should ...

c# - Can't solve Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider' -

i have web asp.net site working fine wcf services. now, have class library telerik reports needs call these same web services. keep getting error not load type 'system.data.entity.design.aspnet.entitydesignerbuildprovider'. when try add service reference web service. have searched topic , done people pointed out. in project implement web services , site, config has: compilation debug="true" targetframework="4.5"> <assemblies> <add assembly="system.design, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a" /> <add assembly="system.windows.forms, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" /> <add assembly="system.speech, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" /> <add assembly="system.data.entity.design, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" /...

Coldfusion 10 - Element [n] is undefined in a Java object of type class coldfusion.runtime.Array -

i upgraded system cf8 cf10 , have 1 bug i'm having problems tracking down. has remote api call gets json string , string gets converted query object. that's i'm coming across error: element [n] undefined in java object of type class coldfusion.runtime.array. problem in function converts string query. <cffunction name="cfjsontoquery" access="public" returntype="query" output="no"> <cfargument name="cfdata" required="yes" type="struct"/> <cfset var local = {}/> <cfset local.tmpqry = querynew( arraytolist(arguments.cfdata.data.columns) ) /> <cfloop index = "i" = "1" = "#arraylen(arguments.cfdata.data.data)#"> <cfset local.row = queryaddrow(local.tmpqry) /> <cfloop index="k" from="1" to="#arraylen(arguments.cfdata.data.data[i])#"> <cfset local.colna...

javascript - passing event data dynamically in jquery -

please refer below html <div class="icon"> <span> <img src=""/> </span> </div> i adding class "bootstrap-modal" dynamically above img tag when clicked. $(".icon img").on("click", function (e) { var data="some object"; $(this).addclass("bootstrap-modal"); }); then have 1 more click event bootstrap-modal class below $(document).on('click',"bootstrap-modal" function (e,data) { //here need data object }); how pass data object img click event bootstrap-modal click event? that means need values previous click handler ? how can ? save in data : $('.icon img').on('click', function(e) { var data = 'some object'; $(this).addclass("bootstrap-modal").data('test', data); }); $('.icon').o...

c++ - Why would std::unordered_map::emplace() fail? -

i have std::unordered_map emplace() object via: my_map.emplace(std::piecewise_construct, std::forward_as_tuple(key), std::forward_as_tuple(value1, value2)); this fails @ point during runtime false in second position of returned tuple. there way more information what's going on? top doesn't show trouble memory. a false in .second means "equivalent element present." in such case, iterator in .first points equivalent element. so what's happening have key in map, , can use .first on return value access it.

Synchronization between ios devices -

first of sorry english. have searched didn't see nothing similar. i have problem , don't know how make it. i need sync data between 2 or more ios devices. data json or similar. example: 2 ios devices uses same app, near each other(in same place or room). there form , if change value in 1 of devices change should shown in other device automatically. thank much. i think need use multipeer connectivity framework part of ios 7.0. apple's multipeer docs

css - Put icon next to navigation -

Image
trying put span class in class="dropdown-toggle" icon shows more left , becomes bigger. hos looks now: code: <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-ok"></span> vakt <b class="caret"></b></a> you can try this: demo .dropdown-toggle { background:#eee; color:#000; text-decoration:none; padding:15px 10px 15px 40px; display:inline-block; } .glyphicon-ok{display:inline-block; padding-right:10px;}

hash - How to efficiently implement hashCode() for a singly linked list node in Java? -

eclipse implements hashcode() function singly linked list's node class following way: class node{ int val; node next; public node(int val){ this.val = val; next = null; } @override public int hashcode() { final int prime = 31; int result = 1; result = prime * result + ((next == null) ? 0 : next.hashcode()); result = prime * result + val; return result; } } now hashcode() node dependent on hash code of nodes follow it. so, every call of hashcode() take amortized linear time in length of linked list. using hashset<node> become unfeasible. one way around cache value of hashcode in variable(call hash) computed once. in case, hash become invalid once node's val changed. , again take linear time modify hashcode of nodes follow current node. so ways of implementing hashing such linked list node? my first thought upon reading question was: linkedlist do? digging sour...

c# - ASP.NET MVC drag and drop designer example? -

i'm looking example implementation of asp.net mvc-based, drag&drop designer surface. googling skills failing me, thought maybe has knowledge on example implementation. i'm not looking paint on canvas functionality - i'd rather have dragable , dropable shapes/images. ideas anyone? william malone has awesome tutorial that, int tutorial developed many functionalities , explained. check out: create drawing app html5 canvas , javascript

opencv - How to capture hair wisp structure from an image? -

i want draw cue specified point along gradient direction capture structure of hair wisp. figure2. , figure3. acm paper, linked here: single-view hair modeling portrait manipulation . draw orientation map gradients, results chaotic. code: #include <opencv2\highgui\highgui.hpp> #include <opencv2\imgproc\imgproc.hpp> #include <iostream> using namespace cv; using namespace std; int main(int argv, char* argc[]) { mat image = imread("wavy.jpg", 0); if(!image.data) return -1; mat sobelx1; sobel(image, sobelx1, cv_8u, 1, 0, 3); //imshow("x direction", sobelx); mat sobely1; sobel(image, sobely1, cv_8u, 1, 0, 3); //imshow("y direction", sobely); mat sobelx, sobely; sobelx1.convertto(sobelx, cv_32f, 1./255); sobely1.convertto(sobely, cv_32f, 1./255); double l_max = -10; (int y = 0; y < image.rows; y+=3) // first itera...

web services - Multiple EndPoint in WCF: Json and Soap -

i trying configure wcf service support multiple endpoint(json , soap) json end not working. here web.config. if can me fix config or show me downloadable working sample, appreciated. <system.servicemodel> <behaviors> <endpointbehaviors> <behavior name="jsonbehavior"> <webhttp/> </behavior> </endpointbehaviors> <servicebehaviors> <behavior> <servicemetadata httpgetenabled="true" httpsgetenabled="true"/> <servicedebug includeexceptiondetailinfaults="false"/> </behavior> </servicebehaviors> </behaviors> <bindings> <basichttpbinding> <binding name="config_basichttpbinding" maxbuffersize="1000000" maxreceivedmessagesize="1000000"> <readerquotas maxbytesperread="1000000" maxarraylength="1000000" maxd...

regex - Regular Expressions in Notepad++ starting with text and ending with incremental number -

Image
i'm trying understand i'm reading tutorials , apply i'm doing. i have file lines of text like: line1blahblahblahblah line2blahblahblahblah ... line10blahblahblahblah i want go in , remove line , number after (which incremented 1-1000 each line) , replace new text leaving text after in tact. can explain how , explain regex expression? search ^line\d+ and replace empty string. explanation : ^ matches begining of line, line matches literal character sequence, , \d matches digit character. + after \d makes match 1 or more digits characters. your notepad++ search panel should this:

css applying a percentage to the height? -

in css code how percentage work, 100% of what? .menu-side { background-color:#333; border-right: 1px solid #000; color:#fff; position:fixed; top:0px; left:0px; width:210px; height:100%; }

tfs2010 - How to reset Local Path -

we've been using tfs years, i'm not sure how mapping got state. when @ manage workspaces tool particular team project, there mapping: active $/data_production_system c:_portal but when @ sub-directories within project in source control explorer, of them mapped different directory structure. structure used exist - not anymore. causes problems when trying compare versions, etc. i tried removing root mapping , adding back, made no difference. on whim, tried deleting .suo file main solution team project didn't change either (nor should - paths in question don't coincide the paths used projects in solution). does know references these bad paths held? i'd delete them. i'm considering browsing through tfs , making note of bad mappings, trying override creating specific mappings folders. seems lame.

c - Matrix as function parameter -

why when using matrix parameter of function must specify number of columns don't have indicate number of rows? i assume you're talking function definition like void foo( int matrix[][cols] ) { ... } this requires little background... except when operand of sizeof or unary & operators, or string literal being used initialize array in declaration, expression of type "n-element array of t " converted ("decay") expression of type "pointer t ", , value of expression address of first element of array. so, given declaration int arr[10]; the expression arr have type "10-element array of int "; unless expression operand of sizeof or unary & operators, converted ("decay") expression of type "pointer int ". if pass array function, like blurga( arr ); what blurga receives pointer int , not array of int . can define blurga as void blurga( int *ap ) { // ap[i] } the formal param...

java - Unable to connect via websocket connection -

i'm trying create simple websocket connection in project. java code: @serverendpoint("/echo") public class echoendpoint { @onmessage public void onmessage(session session,string message){ try{ system.out.println(message); } catch(exception e){ system.out.println(e.getmessage()); } } } html , javascript code: <button type="button" onclick="websockettest()">send</button> <script type="text/javascript"> function websockettest() { alert("websocket supported browser!"); // let open web socket var ws = new websocket("ws://localhost:8080/echo"); ws.onopen = function() { // web socket connected, send data using send() ws.send("message send"); alert("message sent..."); }; ws.onmessage = function (evt) { var received_msg = evt.data; alert("message received..."); }; ws.onclose = function() { // websocket...

ruby on rails - Get and add values from JSON -

here hash: {"graph"=>[{"1"=>16, "2"=>44, "3"=>53, "4"=>53, "5"=>80, "6"=>71, "7"=>63, "8"=>54, "9"=>53, "10"=>44, "11"=>76, "12"=>82, "13"=>66, "14"=>59, "15"=>64, "16"=>39, "17"=>19, "18"=>14, "19"=>5, "20"=>6, "21"=>5, "22"=>7, "23"=>6, "24"=>7}]} i'm trying values of each , add them together. long , incorrect way each value , add them so: first_number = json["graph"][0]["1"] second_number = json["graph"][0]["2"] how can simplify total count? if need sum of values... json['graph'][0].values.inject{|sum,val| sum+val} if using rails, have option use sum method instead: json['graph...

java - Does JDesktopPane.getAllFrames() always indicate JInternalFrame z order? -

i not find in documentation, far found out experimental calling getallframes() returns internal frames exactly in z order. does know if observation true or can give reference it? does know if observation true i yes. or can give reference it? look @ source code getallframes() method. iterates through components in container. , since components in zorder when iteration returned array in zorder.

IIS 7 binding for SSL -

i have machine multiple websites. websites not use same domain name. example 1 website test.test1.com test.test2.com. have uc certificate lists of domains doesn't use wildcard * in of domains. when try create bindings each can't add host header binding https. if use appcmd second domain can no longer access first domain. how setup bindings can access test.test1.com default port 443 , test.test2.com when host header? thanks help!! gary in iis 7 can not have ssl bindings based on host headers. if want multiple sites https , don't have wildcard certificate, have use multiple ip addresses, 1 each ssl site. add ip addresses os , set dns entries them, bind sites against ip addresses, not host names.

why isn't rpm release tag redundant? -

from rpm .spec file documentation, version tag intended correspond version of software being packaged. release tag intended increment new build of .rpm . what point of release tag then?? if software has not changed in meantime , version same, definition software , behaves same, , .rpm file before, release should same. suppose original .rpm file lost need recreate it, , there no changes, then, of course recreated file should before - 1 wants in case of no changes software. i don't need release tag, please explain me. added: docs @ http://www.rpm.org/max-rpm/s1-rpm-inside-tags.html say (...)if necessary repackage software @ same version, release should incremented.(...) maybe not mean? maybe intended here is, "repackage software @ same version, there may minor changes not deserve new version, increment release instead". meant here?? there lot of factors go binary rpm file, beyond upstream version of source code. compiler/configure opti...

ubuntu - Apache returning 404 for requests inside /javascript directory -

i have project several sub-directories. works fine, except if try access files inside /root/javascript directory, 404. files in fact exist, , in fact typing path correctly. if rename directory can access files. rename back, , 404 again. vhost file works fine. no .htaccess files involved. apache version: 2.4.9 os: ubuntu 13.10 after searching , trying different things, here's problem came down to: by default, apache 2.4 on ubuntu enables config file called javascript-common, redirects requests files inside /javascript (that is, directory @ root of project called 'javascript') /usr/share/javascript. solution 1 use following command disable javascript-common configuration file: a2disconfig javascript-common solution 2 add javascript files inside /usr/share/javascript directory. way apache find files , no 404 returned. 1 benefit of doing things way won't need multiple copies of same files (jquery.js, etc.js) multiple projects use... solution 3...

ios - Encrypt/Decrypt text using existing key pair -

this has been extremely confusing me. have process generate public/private key pair using php. code that: $config = array( "digest_alg" => "sha512", "private_key_bits" => 4096, "private_key_type" => openssl_keytype_rsa, ); // create private , public key $res = openssl_pkey_new($config); and here example of generated output: -----begin public key----- miicijanbgkqhkig9w0baqefaaocag8amiiccgkcagea1ufdaaadquwpublw8vce wegwdl3khrc/yzgwi8op72bq2zzgxzncxhdmwgfxax4eblwwipbbtsnboi6urieb bpnis/ei/ajgbko/yj2idkfnxmy6xbxwpunqeq2tjeddnxb2y0g896gijfwn8fzk ollspofks5ipaxdylnlwr5stgxweexc2gpaplap00d3xg/qhsm2fubvljhqreis1 mwyajg0ev72u3ypp0ok19z0ylbfrhaubne+mx6tsnb9xqawe4gksbnso06lz4n9j k7sg16dxpuekho8pdzwun2qbig3fgc3ibnmr2u6lux218bgtiggdvoaar1e3cof1 vmli3ads/evejzds3gkg1rxcrbcfajnwe5yl1j+nxeffbedr2flx6chspzfv1x3p dumr1hb/ndslhwnj7qqqqhtgfpdfql4ejgfguvygid1k0u/8b6vqk0k9jku5nrn5 d1e3h7qjm/kbbohnsi/0gbuuyrktipxu5b...

Is there a way to add a mixin into a variable in LESS -

can add mixin variable in less? something this @input-border-radius: .rounded(); or @h1: .font-size(46) // pulls rem calculator mixin. looked @ less docs can't see way it. there way. you can define properties of (possibly immaginary) class , recall properties of class in style of different class. example: .fontstyling { font-weight: bold; color: black; } h1 { font-size: 46px; .fontstyling; } h2 { font-size: 38px; .fontstyling; } (thats not best way format headings - other exemples useful!)