Posts

Showing posts from April, 2012

XAMPP and MySQL error on startup -

i getting error when try starting mysql service through xampp control panel: 2014-08-17 14:53:44 6028 [error] tcp/ip, --shared-memory, or --named-pipe should configured on nt os 2014-08-17 14:53:44 6028 [error] aborting anyone ran issue before , have configuration change may used running? for reference, these settings within my.ini: [client] port = 3306 socket = "g:/dev/xampp/mysql/mysql.sock" # mysql server [mysqld] port= 3306 socket = "g:/dev/xampp/mysql/mysql.sock" basedir = "g:/dev/xampp/mysql" tmpdir = "g:/dev/xampp/tmp" datadir = "g:/dev/xampp/mysql/data" pid_file = "mysql.pid" # enable-named-pipe key_buffer = 16m max_allowed_packet = 1m sort_buffer_size = 512k net_buffer_length = 8k read_buffer_size = 256k read_rnd_buffer_size = 512k myisam_sort_buffer_size = 8m log_error = "mysql_error.log" # security changes skip-networking local-infile=0 plugin_dir = "g:/dev/xampp/m

AngularJS authentication service + watcher -

i making authentication app , i've been struggling getting service work properly. have simplified code. the service: app.factory('authenticationservice', function() { var isloggedin = false; return { isloggedin : function() { return isloggedin; } } }); maincontroller: app.controller('maincontroller', [ '$scope', 'authenticationservice', function( $scope, authenticationservice ) { $scope.isloggedin = authenticationservice.isloggedin(); $scope.$watch('authenticationservice.isloggedin()', function (newval, oldval) { console.log("detected change in service."); if( newval !== oldval ) { $scope.isloggedin = newval; } }); }]); logincontroller: // login http request successful, returns positive answer // want change variable in service true authenticationservice.isloggedin = true; main pro

html - email input field is not remembering last emails -

i have input field type email . <input name="email" type="email" autocomplete /> and not inside <form> , the issue is, field not remembering , not offering former email entries. how can activate this? using chrome.

javascript - AngularJS fire function on-click anchor links -

i'm hoping can me achieve clean , effective way of firing function when anchor links, specific css class, clicked. i using ng-click feel bit of messy , unmaintainable solution: mean adding ng-click each of anchor links want track. my navigation links this: <li id="item1" class="foo"><a href="#/item1">click me</a></li> i'd emulate functionality of ng-click in similar manner following jquery stubb (which doesn't seem work in configuration): $('.foo a').on('click', function(){ //do code }); tl;dr i'd angularjs way execute function when element specific css class clicked. please let me know if haven't described enough. thanks in advance, johnd you write directive , apply root element. demo <div ng-app="app" foo-dir> <li id="item1" class="foo"><a href="#/item1">click me 1</a> </li>

javascript - Yammer JSON SDK authenticates through ADFS in Chrome and FF, but Access Denied in IE -

we've started testing out json api using javascript sdk. have adfs set authenticate in ie , if open browser window , go our network on yammer works embedding yammer feed using embed code. however getting issue json feed - browsers ie we'll login prompt if not logged in , take through , we'll see feed, in ie pop of access denied. we've added assets.yammer.com/assets/platform_js_sdk.js adfs recognized source has else had problem ie , authentication through adfs? thanks in advance! rich we have taken code yammer api reference , using follows: $scope.yammerrequest = function(){ yam.platform.request({ url: "messages/in_group/1312007.json?threaded=true", //url: "messages.json?threaded=true", //url: "messages.json?threaded=true", //this 1 of many rest endpoints available method: "get", success: function (data) { //angulars $scope getting lost when inside externa

html - Rails Show Age in View based Born Date -

i have problem show age in view rails i think solve: show.html.slim `=@people.date_born - date.today / 365,25` `end` what need do? it's order of operations thing, syntax displayed funny. ignoring unnecessary quotes: = ((date.today - @person.date_born) / 365).to_i first, since today greater date date of birth, want first avoid negative number. need wrap in parens subtraction first, , divide, , legibility, change integer.

spring - Form POST submit "The request sent by the client was syntactically incorrect." -

i have no idea i've made mistake. i've been trying solve problem hours can't figure out... i'm getting http status 400 request sent client syntactically incorrect. while submiting form list of objects checkboxes each of objects. heres of code: controller: @requestmapping(value = "/admin/panel", method = requestmethod.get) public string adminpanel(locale locale, model model, form form, httpservletrequest request) { formwrapper wrapper = getformwrapper(); model.addattribute("listofobjects", wrapper); model.addattribute("allcategories", dao.getcatslist()); return "web-inf/views/index/admin/home"; } @requestmapping(value = "/admin/saveadmin", method = requestmethod.post) public string save(model model, @modelattribute(value="listofobjects") formwrapper listofobjects) { return "redirect:../index.html"; } jsp: <%@ taglib prefix="form" uri="http:

c++ - Why do templates not implicitly instantiate to const or reference types? -

consider following function template explicit specializations. template<typename t> void f(t); template<> void f<int>(int i) { std::cout << "f() chose int\n"; ++i; } template<> void f<const int&>(const int&) { std::cout << "f() chose const int&\n"; } the first specialization can implicitly instantiated. second cannot, even if first specialization absent . unlike rules function overloading function taking int or const int& works fine ( g() in linked examples). example specialization int available. works. http://coliru.stacked-crooked.com/a/1680748749f36631 example specialization const int& available. compiles fails link. http://coliru.stacked-crooked.com/a/ab8b068d3f807837 why template type deduction work way , why chosen work way? alternative template type deduction behave function overloading. my understanding overloaded functions, compiler knows available options templates com

javascript - Toggle div on div click horizontally -

i made div has background image of face, have designed div contains paragraph, 2 buttons , input box. i know question has been asked quite situation different, i'd div background image of face clickable div containing else slides out left. what best method this? html <div id="image"></div> <div id="container"> <p>i nutella , croissants</p> <input id="message" placeholder="type...." required="required" autofocus> <button type="button" id="send">send</button> <button type="button" id="close">close</button> </div> css div#image { background: url(http://i.imgur.com/pf2qpyl.png) no-repeat; } jquery $(document).ready(function(){ $( "#image" ).click(function() { jquery(this).find("#container").toggle(); }); }); using article link posted raimov (which came across in google

javascript - WebSQL update isn't working -

today helping friend solution , in runtime update in pc works , in pc doesn't . we've checked databases , okay, tried upload code raspberry pi , doesn't work. we've tried debug code, , went straight callback function (it didn't gave error). databese based in websql , code one: $('#save').click(function(){ var db=opendatabase('ats_db2', '1.0', 'base de dados ats', 2*2048*2048); db.transaction(function (tx){ var nome =$('#alteranome').val(); var bi =$('#alterabi').val(); var nif =$('#alteranif').val(); var morada=$('#alteramorada').val(); var contatos = $('#alteracontatos').val(); var id = $('#id_cliente').val(); tx.executesql('update cliente set nome=? ,bi=? ,nif=? ,morada=? ,contatos=? id_cliente = ?;',[nome,bi,nif,morada,contatos,id],function(tx,results){ alert("cliente alterado com sucesso&quo

regex - regular expression find strings with certain pattern in R -

i have strings here , are: 12abc3, 2abc45, abc 56, uhyabc, regexp ... the objective long there 'abc' in string (not 'bca' or 'bac') should return true when using 'grepl' so output should be true, true, true, true, false can me this? thanks in advance you want use fixed = true in call grepl . > x <- c("12abc3", "2abc45", "abc 56", "uhyabc", "regexp", "bca", "cab") > grepl("abc", x, fixed = true) # [1] true true true true false false false the fixed argument definition is logical. if true, pattern string matched is. overrides conflicting arguments.

How to get to the file explorer in android studio -

okay don't know how file explorer in android studio. tried searching stack overflow , found same question asking solution there didn't work. screen shots tell me how file explorer? for android studio 0.8.6, go tools > android > android device monitor in main menu, bring android device monitor in separate window. there find amounts set of eclipse perspectives, notably ddms perspective, has file explorer view.

c++ - How do I find missing elements in an integer list? -

i want use template find missing numbers, this: using type = find_arg_not_in_pack<range<1, 5>, 1, 2, 4, 5>; and result should pack holding numbers aren't in arguments provided after range. in case should pack<3> . pack tuple non-type parameters, particularly integers. how can 1 this? define type-list machinery result, pack , , specialize find_arg_not_in_pack case start of range identical first argument, result definition recursing on rest of argument list.

css - Show div on only on mobile/tablet/desktop using weebly.com -

i want show specific div on mobile can't me seen on desktop , vice versa. code should work can't seem code work using weebly.com <style> @media , (max-width: 959px) { .content .one{display:block;} .content .two{display:none;} .content .three{display:none;} } @media , (max-width: 720px) { .content .one{display:none;} .content .two{display:block;} .content .three{display:none;} } @media , (max-width: 479px) { .content .one{display:none;} .content .two{display:none;} .content .three{display:block;} } </style> <div class="content"> <div class="one">this content desktop</div> <div class="two">this content tablet</div> <div class="three">this content mobile</div> </div> your code totally fine. tried same on jsfiddle. it works resize window , test various resolutions. @media , (max-width: 959px) { .

java - Debugging Program with Comparator -

i unable debug below. have created object called person , however, comparator not working: //here object comparator referring public class person { string firstname; string lastname; int z; public person(string l, string m, int e) { firstname=l; lastname=m; z=e; } } // comparator begins here public class customcomparator implements comparator<person> { public int compare(person object1, person object2) { @override return object1.firstname.compareto(object2.firstname); } }

windows phone 8 - Parse detect ParseClient is not initialized -

i using parse.com in app. see if parse.parseclient.initialize() method fails, parseanalytics.trackappopens still run , crash app. so how can detect if parseclient failed initialize? in app constructor: this.startup += async (sender, args) => { //crash if parseclient not initialized //parse.parseanalytics.trackappopens(rootframe); }; one way make test call parse db , wrap around try catch block before use parseanalytics . something like.. parseclient.initialize(); try { client.getobject("sometestordummyobject"); } catch(exception ex) { //indicates initialize failed.. } parseanalytics.trackappopens(rootframe);

elisp - Possible to make bzg-big-fringe mode in emacs work with linum or other line numbers? -

is possible make bzg-big-fringe mode in emacs work linum ? this seems require modicum of hacking skills; playing around settings in linum yields strange results. , if use linum without adjustments line numbers turn far away text can't use them great precision. ps. alternative distraction free modes work linum accepted answers. making other line number mode work bzg-big-fringe mode accepted. i suggest try (setq fringes-outside-margins t)

php - Database transaction not working in controller codeigniter -

i calling multiple models in controllers , models database query. did this public function insertsale() { $this->db->trans_start(true); // logic part , models calling insert/update/delete $this->db->trans_complete(); } above code not working if fails after queries dont rollback. having true in $this->db->trans_start(true); put transaction in test mode means regardless of happens query rolled back. if wanted see if query work use: $this->db->trans_status(); which return either true/false depending on outcome. (i realise old question, however, thought should put answer in here incase else came looking.) hope helps!

c# - What Design Pattern can I use to accomplish the following -

in code able "build" object this.. // build person instance , add types person person person = new person(); person = new leader(person); person = new secretary(person); person = new parent(person); the goal of code above build base object has multiple types added - leader, secretary, , parent. specifically, goal able build base object (person) , make object able take on multiple types simultaneously such following condition return true: ((person leader) && (person secretary) && (person parent)) <<<-- returns true is there design pattern can use accomplish this? the problem above examples person object can 1 sub-type @ time , previous instantiations are, apparently, overwritten. in other words, condition return true (person parent) since last in line. note: thought decorator pattern sounded needed, read, decorator pattern seems more adding behavior object apposed extending type. update for clarity - suppose should have mentione

node.js - stub a function in Nodejs -

i have model stores data db calls store method passing id created //db.poll.store method store: function (opt, db, callback) { var polldata = { question: opt.data.question }; db.poll.create(polldata).success(function (poll) { opt.data.pollid = poll.id; models.polloption.store(opt, db, callback); }).error(function(error) { callback(error, null); }); } i want have unit test make sure valid opt.data.pollid passed models.polloption.store() method , don't want check if models.polloption.store() behaviour correctly or not, mocked/overwritten models.polloption.store method. unit test below describe('method store', function () { it('should able create poll , pass poll.id polloption.store', function (done) { var opt = { data: { question: "do love nodejs?" } };

how to work on button controls in mvc asp.net -

in mvc application ,i have 3 button control on view page.i new mvc.so dont know how navigate through button control in mvc. want write 3 different methods on these 3 controls in controller. in asp.net had control event , cn write code on these events . how can achieve in mvc. there many ways depending on trying achieve. first use standard hyperlink pointing corresponding controller action: @html.actionlink("action 1", "actionname1", "controllername") @html.actionlink("action 2", "actionname2", "controllername") ... which invoke respective controller actions: public actionresult actionname1() { ... } public actionresult actionname2() { ... } another possibility use html forms: @using (html.beginform("actionname1", "controllername")) { <button type="submit">action 1</button> } @using (html.beginform("actionname2", "controllername")

smsmanager - SMS verification from application for android -

i have developed application want sms verification of user using application same number registering. right have released application india. need know whether need put country code if want go other countries. right able send sms users phone without country code. need country code send sms phone. have used following code send sms. smsmanager sms = smsmanager.getdefault(); string smstxt = "please enter " + string + " myapp verification."; sms.sendtextmessage(phno2, null, smstxt, null, null); for above code haven't put country code. need country code.

php - I want to play audio video files of all formats on my website -

i want play audio video files on website.plz me make possible. u can suggest me player name or piece of code. i using code onlny supporting mp3 , mp4 format. <div class="content-top"> <div class="wrap"> <div class="section group"> <?php echo $typehtml;?> </div> <video width="640" height="360" controls> <source src="admin/audiovideo/<?php echo $videoname;?>" type="video/mp4" /> <source src="__video__.ogv" type="video/ogg" /> <object width="640" height="360" type="application/x-shockwave-flash" data="__flash__.swf"> <param name="movie" value="__flash__.swf" /> <param name="flashvars" value="controlbar=over&amp;image=__poster__.jpg&amp;file=__video__.mp4" /> <param name="movie" value="__flash__.swf&q

sharpdevelop - Cannot implicitly convert type 'string' to 'string[]', when converting CType to C# -

i doing automatic conversion of code written in vb.net c# sharpdevelop's v4.4 converting tool. vb.net code drag/drop on form this: private sub me_dragdrop(byval sender object, byval e system.windows.forms.drageventargs) handles me.dragdrop if e.data.getdatapresent(dataformats.filedrop) dim myfiles() string = ctype(e.data.getdata(dataformats.filedrop), string()) if myfiles.length > 0 then... converted c# code such: private void me_dragdrop(object sender, system.windows.forms.drageventargs e) { if (e.data.getdatapresent(dataformats.filedrop)) { string[] myfiles = convert.tostring(e.data.getdata(dataformats.filedrop)); if (myfiles.length > 0) {... in c# ide line convert.tostring(e.data.getdata(dataformats.filedrop)) underlined red , error cannot implicitly convert type 'string' 'string[] reported. telerik tool converting net languages makes here same translation. what point here, how working in c# , better: how

How does SMF calculate the attachment hash? -

i struggling smf database collapse. see files 57657_91d53e636a4a5cf62f2be632136fb1caba7f6be7 in attachment directory. used source hash? sha1sum of file doesn't match. you can attachments file name (hash) using function getattachmentfilename(). smf function library provides arguments http://support.simplemachines.org/function_db/index.php?action=view_function;id=238

r - Creating a function to extract n groups from a dataset -

i searching way extract first n groups of rows dataset. set.seed(1) data <- data.frame(personid= sample(1:10, 25,replace=true), value=rnorm(25)) if want extract first 4 groups, ie. rows personid=3,4,6,10 personid value 1 3 -0.2894616 2 4 -0.2992151 3 6 -0.4115108 4 10 0.2522234 5 3 -0.8919211 ---------------------- i used unique: data[data$personid %in% unique(data$personid)[1:4],] personid value 1 3 -0.2894616 2 4 -0.2992151 3 6 -0.4115108 4 10 0.2522234 5 3 -0.8919211 7 10 -1.2375384 11 3 0.8041895 14 4 1.0857694 18 10 -0.2357066 19 4 -0.5428883 21 10 -0.6494716 22 3 0.7267507 25 3 -0.4295131

android - Using another app as a content provider for tasks? -

i'm working on agenda display meetings , tasks. i've got meetings portion working , trying figure out how tasks. some other apps i've seen using tasks team tasks or dato gtasks pull list. idea can start in order start doing way?

actionscript 3 - ActionScript3. The screen auto change after a time -

i'm newbie in as3 , have stuck while coding pause , un-pause. @ frame 20 stage.framerate=0; stage.addeventlistener(keyboardevent.key_up, wait); function wait(event:keyboardevent) { if(event.keycode == 40) { //resume pause return framerate = 20 stage.framerate = 20; event.currenttarget.removeeventlistener(keyboardevent.key_up,wait); } } i dont' know why after wait 10 second, screen contain code automatic change frame 21 framerate's value adobe mentions 0 can't framerate's value : valid range frame rate 0.01 1000 frames per second. that means framerate's value of 0.01, flash movie play 100 seconds later. gotoandstop() the stage framerate's property not intended stop movie @ frame, , set frame rate of stage. if want stop flash movie , wait frame 20: gotoandstop(20); if want play : play();

Java package error in eclipse -

Image
i error in project imported backup. before run project without issue in eclipse. formatted machine , when try run application error. be.. i not using maven , tried remove jars , adding them back.... 1 thing differs previous setting using java sdk 1.6.22 version before using java 1.8 you missing reference jar file after formatted pc. you put jar file again in classpath, , error go off.

javascript - lang option does not work in wordpress -

instead of using full calendar plugin, managed use javascript , jquery display event data calendar (i created own post type not know how use wp-calendar plugin). works fine , other options works fine except lang option! as fullcalendar displays in english, wanted configure korean example did this: jquery(document).ready(function(){ jquery('#calendar').fullcalendar({ theme: true, lang: 'ko', header: { left: 'prev, next today', center: 'title', right: 'month,agendaweek,agendaday' }, events: themeforce.events }); }); it worked fine separate php (not functions.php each theme) in wordpress not. have idea why might cause problem? plugin website: https://wordpress.org/plugins/wp-calendar/ i haven't found any lang parameter inside fullcalendar.js . these option

java - Birt reports not working in Internet Explorer 9 (IE 9) -

i have created , running birt reports in java application using birt 3.7.2, called jsp page followingl birt:viewer id="birtviewer" reportdesign="reportname" pattern="frameset" showtitle="false" height="450" width="1058" format="html" scrolling="no" showparameterpage="false"> </birt:viewer> these reports working fine in browsers except in ie 9. (working in ie 8 well). i have use birt in ie9 without adding meta compatible tag, we're using metro ui, following : <meta http-equiv="x-ua-compatible" content="ie=emulateie7" >. we can not use meta tag because using metro ui there not compatible ie 8. check http requests confirm have percent encoded characters in http requests. ie9 has problem percent encoded characters in url. kb article explaining design. blog post explaining how uri mechanism work @ older windows platform. i wasn'

c# - Error comparing guid to guid in linq -

the first if condition runs fine, second fails 'cannot cast guid string' error. compiler tells me both ids guids. so, why failing on 2nd 'if'? l.p.id guid, testp.id guid. don't see how there's failure here. if (context.getset<pbm>().firstordefault(l=>l.p.id == testp.id) != null) { context.getset<pbm>() .remove(context.getset<pbm>() .firstordefault(l => l.p.id == testp.id)); context.savechanges(); } if (context.getset<moah>().firstordefault(l=>l.p.id == testp.id) != null) { context.getset<moah>() .remove(context.getset<moah>() .firstordefault(l => l.p.id == testp.id)); context.savechanges(); } after using .any(l=>l.p.id == testp.id) suggested, unit tests fail exception system.invalidcastexception : invalid cast 'system.string' 'system.guid'. error stack trace requested: system.invalidcastexception : invalid cast 'syste

python - Synology DS114 : install getmail with ipkg -

i installed getmail ipkg on synology ds114 using commands: ipkg update ipkg install python ipkg install py25-getmail when executing getmail command, stacktrace: nas> getmail traceback (most recent call last): file "/opt/bin/getmail", line 13, in <module> import imaplib file "/opt/lib/python2.5/imaplib.py", line 25, in <module> import binascii, os, random, re, socket, sys, time file "/opt/lib/python2.5/random.py", line 58, in <module> sg_magicconst = 1.0 + _log(4.5) overflowerror: math range error is getmail package broken? how fix please? thanks problem 1: calculation random.py trying on sudden amount of digits, , that's causing overflow. if seems take long period of time complete, delay in finding fully-qualified hostname of system. fix ensure have valid mapping of address-to-hostname addresses in system. can in /etc/hosts file, in authoritative content dns server, or in sy

excel - How To Calculate The Average Of Unique Values In One Column Using DAX Query? -

i want calculate average of distinct values in 1 column. have column having sales values . 2 2 3 3 4 4 5 5 want distinct value average ((2+3+4+5)/8 ) . distinct values divided total number of values . result should 1.8 . in advance . you have "excel" tag, want in excel? if data in a1:a10 can use array formula =sum(if(match(a1:a10,a1:a10,0)=row(a1:a10)-min(row(a1:a10))+1,a1:a10))/count(a1:a10) confirmed ctrl + shift + enter

c# - How to override method of base class that haven't override in signature -

today discovered interesting thing. tried define type dynamically using typebuilder , tried 'override' (i.e. replace) method defined in base class: public class test { public void method() { console.writeline("test test"); } } public void bind(string methodtoreplace, action expr) { @object = activator.createinstance<t>(); type objecttype = @object.gettype(); assemblybuilder asmbuilder = appdomain.currentdomain.definedynamicassembly(new assemblyname("mock"), assemblybuilderaccess.run); modulebuilder modbuilder = asmbuilder.definedynamicmodule("mock"); typebuilder tb = modbuilder.definetype(objecttype.name, typeattributes.public | typeattributes.class, objecttype); var mb = tb.definemethod(methodtoreplace, methodattributes.public); ilgenerator ilgen = mb.getilgenerator(); ilgen.emitcall(opcodes.call, expr.gettype().getmethod("invoke"), null); ilgen.emit(opcodes.ret);

sql - Accessing oracle type attributes from system tables -

is possible access oracle type attribute information of system tables? example given type: create or replace type custom_type object ( id number, name varchar2, ... ) i able access information of form type_name,attribute_name,positon,data_type custom_type,id,1,number custom_type,name,2,varchar2 this sort of functionality available function , procedure arguments in user_arguments table, have been unable find similar type attributes. any appreciated. thanks, matt. this query list type objects owned current user. select * user_types; check this link available system tables , brief on contained information.

angularjs - Access parent data model in directive -

i wrote directive check double values in data column: the markup <table> <tr data-ng-repeat-start="rowitem in vm.model.data" ...> <td> <input type="text" data-ng-model="rowitem.id" data-unique-column="vm.model.data" /> </td> ... </tr> </table> and directive (function () { 'use strict'; angular.module('app').directive('uniquecolumn', function () { return { restrict: 'a', require: 'ngmodel', link: function (scope, element, attrs, ngmodel) { element.on('keyup blur', function () { scope.$eval(attrs.uniquecolumn).foreach(function (item) { // validation logic }); }); } }; }); })(); everything works fine asked myself if there solution access data o

Variable in Path to .htpasswd file in .htaccess -

would possible have {http_host} variable in path? because htaccess used multiple domains , want use different passwords each domain! authuserfile /usr/test/{http_host}/.htpasswd authtype basic authname "my files" require valid-user update: tested above code , gives 500 internal server error (off course authuserfile points directory exist on server)

casting - cast access text to numeric -

i'm working in access 2007. have couples of tables i've imported excel in link mode, access makes copy of them , can use them in read mode. i'm in trouble cast. primary key text in first table , integer in other one. want make first 1 numeric field. i assume left table "lansweeper_jacopobelloni" , right table "pc_carelhq_modificato". have 3 queries, 1 inner join because there must (1,1) relation beetween 2 tables. right join check there in left table there in right one. have left join find in right table in left one. how can cast string integer in order apply comparison? like operator not best use, specially wit text field. suggest 2 alternatives. first : create new column in table number type , update numeric value of text field, change pk new field , delete old field. (most ideal). second : create query join 2 tables. better alternative operator. like; select table1.id, table2.someotherfield table1 inner join table2 on clng(t

cypher - Neo4j Index not available -

i try create index in neo4j, seems not working. insert data following codes snippet. create index on :`person`(`name`) create (_0:`person` {`name`:"andres"}) create (_1:`person` {`name`:"mark"}) create _0-[:`knows`]->_1 the code here works fine. when try fetch data cypher command start n=node:name(name= 'bob') return n i've got error index `name` not exist neo.clienterror.schema.nosuchindex but can see above, declare index name. query wrong? either must use automatic index - http://docs.neo4j.org/chunked/milestone/auto-indexing.html - first specify in neo4j config file parameters indexed (than start/restart server) or when using manual indexing - http://docs.neo4j.org/chunked/milestone/indexing-add.html - must include each new node index manualy this: match (n:person) using index n:person(name) n.name = 'bob' return n view neo4j cypher : unable create , use index

android - XMLPullParser getName() returns null -

i trying parse openweathermap api http://api.openweathermap.org/data/2.5/weather?q=london&mode=xml . using kxmlparser via xmlpullparserfactory.newpullparser() xmlpullparser.getname() returning null. might silly mistake seems might need see it. here's code read api via httpurlconnection . url url = new url(urlstring); urlconnection urlconnection = url.openconnection(); httpurlconnection httpconnection = (httpurlconnection) urlconnection; httpconnection.setrequestmethod("get"); httpconnection.connect(); if(httpconnection.getresponsecode() == httpurlconnection.http_ok){ inputstream = httpconnection.getinputstream(); } i used bufferedreader buffer = new bufferedreader( new inputstreamreader(inputstream)); string s=""; while ((s=buffer.readline())!=null){

php - Call a function within a function display both within array -

how call function within function? function tt($data,$s,$t){ $data=$data; echo '[['; print_r($data); echo ']]'; if($t==0){ $data[]=$s; tt($data,'two',1); }else{ $data[]=$s; } return $data; } print_r(tt('','one',0)); i want 'two' shown within array like $o[]='one'; $o[]='two'; print_r($o); function tt($s, $t, array $data = array()) { $data[] = $s; if ($t == 0) { $data = tt('two', 1, $data); } return $data; } print_r(tt('one', 0)); this that's needed. put array last argument , make optional, because don't need on initial call. when calling tt recursively, need "catch" return data, otherwise recursive call nothing of lasting value. no need else , since you're going append entry array no matter , don't need write twice.

c - zlib writing raw encoded stream -

i'm trying write generic function write both uncompressed , compressed file (depending on user input). according zlib, have set gzopen mode "w0" (no compression), still zlib header! in zlib manual mentions possible write raw data (no header/trailer) doesn't how. how can write plain (raw encoded) file zlib? thanks, open file using transparent mode "t" : #include <zlib.h> int main() { gzfile file = gzopen("/tmp/a.dat", "wt"); (void) gzwrite(file, "test", 4); (void) gzclose(file); }

java - How to add close button in GWT -

i've code: ... menubar options = new menubar(true); options.additem("first label", new scheduledcommand() { @override public void execute() { popuppanel popupproperties = new popuppanel(); tabpanel tabpanel = new tabpanel(); flowpanel flowpanel = new flowpanel(); ... flowpanel.add(...); scroll = new scrollpanel(flowpanel); tabpanel.add(scroll, "first tab"); popupproperties.add(tabpanel); rootpanel.get().add(popupproperties); popupproperties.center(); popupproperties.show(); } } ... if add simplepanel button (close) popupproperties, doesn't work. how can it? lot. use verticalpanel , add popup-panel. add tabpanel , button verticalpanel. and don't add popup-panel panel. use center() show it.

Elixir mix compilation priority -

is possible specify compilation priority modules? lets have 2 files a.ex , b.ex , want compile b.ex first while using mix compile. possible? the require special form need.

java - Spring 4 - MVC - URL param and static resource path -

i have spring mvc application, in page list "group" details in table, fetched database. url of every group set "/viewgroup/410", 410 groupid loaded database , displayed in viewgroup.jsp page. <td><a href="viewgroup/${group.groupid}">${group.name}</a></td> so, controller method has @requestmapping("/viewgroup/{groupid}") public string viewgroup() { ... } like this. jsp pages not load static resources have in directory structure +webapp +resources +css +js +images +views +login.jsp the jsp pages has below path image/js/css. <link href="resources/css/bootstrap.css" rel="stylesheet" media="screen"> i tried adding @controller @requestmapping("/viewgroup/**") public class viewgroupcontroller { ... } and in jsp <link href="viewgroup/resources/css/bootstrap.css" rel="stylesheet" media="screen">

udp - Is it possible for Java third-party program to read data transfer between server and client? -

if think of server client pair . server , client b. thirdparty program c reads data transfer between , b. <-> c <-> b (= sends data b , c reads data. if b sends data a, c reads it.) know ip , port server using , think it's using udp. also, use java, not other applications (like wireshark).. :) if other data needed, let me know.

How do I set favicon in Odoo / OpenERP? -

how set favicon web/e-commerce frontend of odoo 8? ideally without changing odoo core files, i.e. not want overwrite addons/web/static/src/img/favicon.ico . (this odoo 8, august 2014. it's easier change favicon in future versions.) you have override web module own module. can add line like 'data': [ 'views/website_templates.xml' ] in __openerp__.py . put favicon @ static/src/img/favicon.ico , add template views/website_templates : <template id="mysite_layout" inherit_id="website.layout" name="mysite layout" priority="17"> <xpath expr="//head//link" position="after"> <link rel="shortcut icon" href="/mysite_web/static/src/img/favicon.ico" type="image/x-icon"/> </xpath> </template>

c# - post form data to another page without __VIEWSTATE variable in query string -

currently working on payment gateway integration asp.net application, in have post few form variables payment gateway page using method. when using simple html page using form controls hold values , post external payment gateway page working fine. when trying inside of asp.net c# application, getting error "validation of viewstate mac failed. if application hosted web farm or cluster, ensure configuration specifies same validationkey , validation algorithm. autogenerate cannot used in cluster.". on checking query string getting posted external payment gateway page asp.net c# page there additional __viewstate variable appended desired query string holds variable values want post payment gateway page. i have made enableviewstate="false" enableeventvalidation="false" enableviewstatemac="false" <%page%> directives in aspx page , added "this.enableviewstate = false" in overridden onload method in code behind. for reference

rest - What happens if a communication partner changes his IP within a tcp connection -

i'm thinking of mobile client based on phonegap communicates via rest , soap interface server. communication stateless , happens on tcp. client makes request , gets response server directly via http. have 2 questions situation: what happens if mobile client switches networks e.g. wlan gprs , thereby ip changes while request/answer being transmitted? tcp handle this? are there other problems i'm not thinking can problem? if ip address changes, existing tcp connection(s) must closed , re-connected. since http typically state-less , not tied particular connection, has own mechanisms (cookies, sessions) persisting data/state information across multiple requests needed, not uncommon http clients drop connections between requests same server.

java - Jackson Deserialization: How to map specific properties to getters and setters as well as loading all the properties into map of a same POJO? -

i need deserialize json string pojo class following scenario: some basic json properties should mapped getters , setters fields in pojo class. and again json properties should loaded map filed of same pojo class. for example have following json string: "entry":[ { "id": "1", "name": "type", "type": "general", "updated": "tue, 12 aug 2014 05:24:01.397z", "summary": { "lang": "en", "value": "testing content" } }, { "id": "1", "name": "type", "type": "general", "updated": "tue, 12 aug 2014 05:24:01.397z", "summary": { "lang": "en", "value": "testing content" }

Sencha touch native android app not loading Malayalam fonts -

i facing issue in rendering malayalam fonts in sencha application build android platform. of devices in found issues sony ericsson xperia & micromax canvas a110 . we have tried adding custom fonts sencha app using font face, when app converted android native app, fonts not applied. any helps appreciated. thanks in advance

php - Detecting beginning of line and end of line in preg_replace -

$data = $_post['data']; echo '<form method="post"><textarea name="data"></textarea><input type="submit">'; echo preg_replace( "#/*[?+]/n#", "[h1]$1[/h1]",$str ); is possible preg_replace detect beginning of line , apply html code entire line based on few characters @ beginning of it? here, based on * if data were: *this row 1 //output <h1>this row one</h1> **this row 2 //output <h2>this row two</h2> ***this row 3 //output <h3>this row three</h3> ***this row * 3 //output <h3>this row * three</h3> row * 3 //output row * 3 i'm having troble detecting begining of line , end of line , wrapping tags around text in line. i don't need * in between line matched. failed effors included. can help? see http://www.regular-expressions.info/anchors.html full details // replace *** h3 $str = preg_replace('/^\*{3}([^\*].*

sql - having case block in where clause -

in procedure trying incorporate case block perform conditional check in clause. please here. below procedure body working fine.. from table_a name = p_name , address = p_address , state = p_state , ((p_county null , default_zone = 'y') or (county = p_county)) ; now split last segment. county column, standard way, below block work , must have in code(this logic) where name = p_name , address = p_address , state = p_state , county = p_county now suppose, county got during procedure call not available, in case db not return data,, "no_data_found" error come. if error come, have execute below block.. where name = p_name , address = p_address , state = p_state , default_zone = 'y' simplest way, should use procedure twice , make call of second block on exception may procedure bulky , not also..is there way can written in simpler way.. i trying use case block have code not working me.. pls advice not sure why you'd want rewrite

java - JMS: Can we get multiple messages from queue in OnMessage() withtout commit or rollback -

i using jms client receives jms messages remote server. listening jms message in onmessage() method of client. the issue facing that, messages getting accumulated on server side while consuming messages on client side @ regular interval. i send rollback() or commit() depending upon processing doing on client's end. i have query while processing jms message , have not sent commit() queue, can message server. please note processing, doing wait processing of message received in synchronized block. new message while still processing , have not sent commit queue? messagelistener#onmessage() executed part of session thread, not receive next message until return onmessage(). in general, should not process messages in onmessage(), if expected take more time. enqueue message separate data structure , have other thread process it. you not have call commit() after every message, can continue receive message. no. of message received without calling commit/rollback d

c# - Migrations.cs is not created successfully -

i creating new module called "sms" in orchard cms using webmatrix. create when generate "migrateions.cs", doesn't generated successfully. my sms.cs class in model given below using system.collections.generic; using system.web; using system.componentmodel.dataannotations; using system.componentmodel; using orchard.contentmanagement; using orchard.contentmanagement.records; namespace smss.model{ public class smsrecord:contentpartrecord { public virtual int id{get;set;} public virtual string name{get;set;} public virtual char is_deleted{get;set;} } public class smspart:contentpart<smsrecord> { [required] public int id { get{return id=record.id;} set{record.id=value;} } public string name { get{return name=record.name;} set{record.name=value;} } public char is_deleted { get{return is_deleted=record.is_deleted;} set{record.is_deleted=value;} } } an

Get values from string using jquery or javascript -

i have string this:- var src=url("http://localhost:200/assets/images/eyecatcher/6/black6.png)" and want image name i.e black6.png , folder name 6 . know there substr function can use file name , folder name dynamic orange12.png , 12 etc. how can these values? please me. thanks if base url same do var url = "http://localhost:200/assets/images/eyecatcher/6/black6.png"; var bits = url.replace("http://localhost:200/assets/images/eyecatcher/", "").split("/"); var folder = bits[0], // 6 file = bits[1]; // black6.png

Express '\' in SQL without breaking Netbeans syntax highlighting -

Image
i'm writing pl/sql function uses string literal '\' . breaks sql syntax highlighting in netbeans, so: looks backslash erroneously being interpreted escape character. '\\' highlights correctly of course not same string. how can express '\' in way not break buggy highlighter? oh, clue's in picture. since highlighter's interpreting comment part of string, can put ' in comment "end string" , fix highlighting.

Opencart - load only some categories? -

can me? have module. need load 10 categories (for example id 2,5,10,14 etc..). here's code: //categories $this->load->model("catalog/category"); $allcategories = $this->model_catalog_category->getcategories(array()); $categoria_shop = array(); foreach ($allcategories $key => $value) { $categoria_shop[$value['name']] = $value['category_id']; } $categoria_shop_nezaradene = 69; how can add id's of categories in catalog/model/catalog/category.php file, can see function getcategories() has optional parent_id parameter , must int , try this: // not tested $category_ids = array(2, 5, 10, 14); $categoria_shop = array(array()); foreach($category_ids $category_id) { $categories = $this->model_catalog_category->getcategories($category_id); foreach ($categories $key => $value) { $categoria_shop[][$value['name']] = $

javascript - angular.identity is undefined -

i'm trying use following... .withhttpconfig({transformrequest: angular.identity}) but undefined not function not seems know angular.identity is. can help? full code: angular.module('app.controllers.project', [ "app.factories.storage", "app.factories.http", "app.directives.typeahead", "app.directives.projectdisplay", "toaster" ]) .controller("projectcontroller", ['$scope', '$rootscope', "$location", "httpfactory", "filterservice", "$stateparams", "toaster", function ($scope, $rootscope, $location, httpfactory, filterservice, $stateparams, toaster) { var createproject = function () { var resource = httpfactory .withhttpconfig({transformrequest: angular.identity}) .post("project", data, {}, {'content-type':