Posts

Showing posts from April, 2015

android - Fire iblazr programmatically -

how fire iblazr programmatically? no api can find, they're not responding inquiry. i'm looking solution iphone , android. since have enable flash device media volume @ max, suspected must have volume output triggers it. so, plugged in, started music player, , started flashing music part. turning down volume stopped flashing , turning caused led again start flashing. based on assume have output loud audio clip turn on while media volume set max. update: after experimenting on theory, device have (iblazr compatible 16 led chinese version), frequency of tone key , determines brightness. using windows api beep(frequency, duration) function, light first turns on @ frequency of 6500 , gets brighter frequency increases. seems pretty bright @ 7000!

Jquery .off vs dojo? -

what equivalent of jquery $.off(event) remove event on element passing event name in dojo? i tried : dojo.disconnect(handle) // dont have handle event how handle or there better way to it? there no out of box solution far know of, have implement 1 yourself. however, dangerous feature, if disconnect event handlers of specific type. however, use dojo/aspect module intercept calls dojo/on module, example: aspect.around(arguments, 0, function(original) { on.signals = [ ]; return function(dom, name, handler) { console.log(arguments); on.signals.push({ signal: original.apply(this, arguments), name: name }); }; }, true); i didn't find proper way put aspect around function itself, rather function wrapped inside object. used dirty trick , used arguments array , because on module first argument, put aspect around dojo/on reference. what happens when bind event handler using dojo/on , save inside a

python - pandas: groupby and unstack to create feature vector for classification -

i have pandas dataframe displaying users' performance on test questions. looks this: userid questionid correct ------------------------------- 1 1 1 1 5 1 1 6 0 1 8 0 1 10 1 2 3 1 2 5 1 2 6 0 . . . . . . . . . i want make feature vector each user saying whether or not got each question right, looks this: questionid 1 2 3 4 5 6 ... userid ------------------------------------------------- 1 1 nan nan nan 1 0 ... 2 nan nan 1 nan 1 0 ... . ... . ... . each user gets shown subset of questions, it's sparse matrix. how can make above table in pandas? i wanted below - grouping us

Is there an ABI compatibility issue if part of the code of a C project is rewritten in C++, but with the same API left out? -

for shared library project written in c, if rewrite part of code in c++, same apis kept, have abi compatibility issues? if keep same api (function names , parameter types) should go. what will need wrap header files (copy & pasted here ) : #ifdef __cplusplus extern "c" { #endif // of legacy c code here #ifdef __cplusplus } #endif this makes sure c++ compiler doesn't mangle names, c compiler's extern symbols can still linked against exports.

php - Server side varification after client side done -

suppose have login form 2 form elements i.e username , password. in client side verification not set required option in username. target after make client side verification want varify server side through ajax, username field verified in server side,if username blank php check , response json. want parse data , show validation error , show if login authentication error message different div element in login form. not this. please me issue. $(document).ready(function(){ // initialize validator , add custom form submission logic $("#loginform").validator().submit(function(e) { var form = $(this); // client-side validation passed if (!e.isdefaultprevented()) { $.ajax({ type: "post", url: "process.login.php", data: $('#loginform').serial

Will performance vary depends on 32bit/64 bit IEDriverServer in selenium webdriver -

for ie10,with iedriverserver 2.42.0(64 bit) sendkeys command executed slow(almost taking 3-4seconds type each character).i tried 32 bit iedriverserver 2.42.0.the problem got resolved. wanted know,whether there performance issue if use 32 bit version instead of 64 bit.my machine 64bit windows 7. i use ie9 , there big difference between 32bit , 64bit drivers versions. far remember due javascript handling introduced in 32bit. anyway should ok ie10 not - there performance issue reported here btw:try paste string or use javascriptexecutor set element's value in case longer strings instead of using sendkeys. should faster.

c# - Replace a Word, but Only on a Specific Line -

in application have replace words text appears more 1 line.my text is most at-home desensitizing toothpastes work numbing nerve , masking pain traditional potassium iron-based toothpastes in form of potassium nitrate, potassium citrate. i want replace "potassium" in 3rd line "" only.my code is string text = t.replace("potassium", ""); the problem word removed lines. how replace 1 word paragraph specific line ? let's first @ regex ( demo here ). can change parameters programmatically. this regex targets first potassium on third line: (?<=\a(?:[^\r\n]*\r?\n+){2}[^\r\n]*?)potassium this replaces bromide : replaced = regex.replace(yourstring, @"(?<=\a(?:[^\r\n]*\r?\n+){2}[^\r\n]*?)potassium", "bromide"); to replace potassium on third line, use \g : (?<=\a([^\r\n]*\r?\n+){2}[^\r\n]*?|\g[^\r\n]*?)potassium with parameters: replacing word on line to replace word someword on line

What is the support timeline for Graph apis -

i see there 3 graph api versions - unversioned, v1.0, v2.0. these apis expire @ time , support available previous versions. for example, searching public posts not available in 2.0 unless company becomes partner of facebook available in previous versions. unversioned 2.0 (or newest version, 2.1 after released.) v1.0 can used apps created before 4/30/2014, , stop working on 4/30/2015. v2.0 supported @ least 2 years.

virtualhost - Why are MAMP virtual hosts working on my laptop but not my new iMac? -

i have 2 macs (macbook air & imac) , want use dropbox source local website files , corresponding databases. i setup databases following these instructions ( text version here ), moved website files dropbox , synced contents on both devices. i've ensured correct files in place per virtual host instructions mamp, such as: added domains hosts file @ /etc/hosts uncommented httpd.conf include httpd-vhosts.conf added servername , documentroot i'm supposed (even changing out user name in path) my laptop (the original computer sites developed) works fine migrated databases , site files, but when start mamp , go dev virtual host url on imac, i'm met mamp favicon , blank screen no content whatsoever. how can desktop play nicely , access databases correctly without error? thanks addressing issue. after manually deleting mamp folder applications folder, reinstalled fresh copy of mamp , ensured enough time had passed dropbox sync, in addition removing c

google url shortener - Java, shorten URL using goo.gl API? -

i'm trying in java without using external library. can't use external library because i'm not using maven project. the method i'm using is: public static string shorten(string longurl) { if (longurl == null) { return longurl; } stringbuilder sb = null; string line = null; string urlstr = longurl; try { url url = new url("https://www.googleapis.com/urlshortener/v1/url"); httpurlconnection connection = (httpurlconnection) url.openconnection(); connection.setdooutput(true); connection.setrequestmethod("post"); connection.setrequestproperty("user-agent", "toolbar"); outputstreamwriter writer = new outputstreamwriter(connection.getoutputstream()); writer.write("url=" + urlencoder.encode(urlstr, "utf-8")); writer.close(); bufferedreader rd = new bufferedreader(new inputstreamreader(connection.getinputst

storyboard - ibtool failed with exit code 255 in Xcode 6-Beta -

i getting error message while trying run application in device or simulator. error : command /applications/xcode6-beta.app/contents/developer/platforms/iphonesimulator.platform/developer/usr/bin/ibtool failed exit code 255 i have cleaned project, restart again, removed derived data still getting above error msg. any suggestions or hint highly appreciated. thanks. same issue xcode 7b4. removing translatesautoresizingmaskintoconstraints="no" xib helped in case

c# - Exception handling - Exception within a catch clause? -

i downloading data text files db tables. data in files corrupt @ field level (files comma delimited .csv files) i reading each line object represents data line properties correct datatype. if read object fails due dodgy data, want read line similar object first one, 1 has data types set string read should not fal. the idea being can create collection of valid record objects load in appropriate db table, , collection of exceptions load exceptions table. these can dealt later. so - question: going loop through lines of text file , load these object , add object collection. there try/catch loop around , if object load fails, in catch section load exception object , add collection of exceptions. however, happens if exception object load fails (for whatever reason). put try/catch around , log exceptions - i.e try/catch within try/catch? is there better way of doing this? code within catch block no way different other code. so have protect every critical a

javascript - In Jasmine, can the describe section correspond to a method, or does it typically correspond to a constructor function? -

in jasmine, can describe section correspond method, or typically correspond constructor function? there's no set rule or requirement describe . can have many nested describe functions want can vague describe("myangularcontroller") or specific decribe("mymethod") it functions testing different inputs method example. depends on how want organize test.

c# - How to run cmd command under administrator rights? -

this question has answer here: how start process administrator mode in c# [duplicate] 9 answers how can run below command under administrator approval in visual c#? need hide console windows while running console. thanks. private void button5_click(object sender, eventargs e) { process process = new process(); processstartinfo startinfo = new processstartinfo(); startinfo.filename = "cmd.exe"; startinfo.arguments = "/c netsh wlan set hostednetwork mode=allow ssid=hotspot key=12345678"; startinfo.verb = "runas"; startinfo.useshellexecute = true; startinfo.windowstyle = processwindowstyle.hidden; process.startinfo = startinfo; process.start(); process wifistart = new process(); processstartinfo wifistartinfo = new processstartinfo()

html - Show select option error -

Image
please me solve problem, files spelled correctly, select not working in google browser thank giving link! problem due lato font being applied on body used display dropdown when in dropdown state (and not in closed state since have font applied select itself). once lato font removed line 68 of custom.css, text display appropriately. all encoding checked out. not fonts have symbols , getting you. either find more complete implementation of font or choose 1 contains of needed characters.

c++ - Using Webrtc for streaming video from client to server -

i want use webrtc getting users' webcam/camera data server. see implementations of webrtc peer-to-peer connections. possible use webrtc sending information server on rtp(using c++ native api of webrtc eh?)? i trying wrap head around situation not find clear tutorial or start point task., some link tutorial or code piece appreciated.

Sql server security : User 'SA' -

since few week, there lot of attempt of connection on user 'sa' on database, sql server. login failed user 'sa'. reason: password did not match login provided. [client: xxx.xx.xx.xx] the ip adresses china. think hacker try connect database. what best practices protect user 'sa' against hackers ? i need connect database sql server authentification mode . if disable user 'sa', can still connect sql authentification ? thanks advices. you may disable sa , enable connect internal network. either can put db behind firewall.

pchart - PHP: Split unix timestamp range into 5 chuncks -

i have requirement need extract 5 points unix time stamp or php time stamp range. for example, 2014-06-26 07:53:26 2014-06-27 07:52:46. i need 5 points these 2 dates in exact or approximate intervals, chart using pchart. currently code $diff = $mintime->diff($maxtime); $range = max($timestamps) - min($timestamps); $cnt = count($timestamps); $temp = ceil($range * (20/100)); for($i=0;$i<$cnt;$i++) { if($i%($cnt/5) == 0) $point[$i] = gmdate("y-m-d h:i:s",min($timestamps) + $temp * ($i+1)); else $point[$i] = null; } but code returns erratic values. know problem temp variable. me solve this. thanks try this: $from = '2014-06-26 07:53:26'; $to = '2014-06-27 07:52:46'; $diff_stamp = strtotime($to) - strtotime($from); $range = range(strtotime($from), strtotime($to), $diff_stamp/4); here, $range array of timestamps. convert each date, use array_map : $range = array_map(function($a){return date('y-m-d h:i:s', $a);}, $rang

c# - foreach loop error message -

anyone know why following code: foreach (word.xmlschemareference reference in globals.thisdocument.application.activedocument) { } gives me: error 1 foreach statement cannot operate on variables of type 'microsoft.office.interop.word.document' because 'microsoft.office.interop.word.document' not contain public definition 'getenumerator' c:\program files\microsoft office\templates\projects\project1\project1\actionspanecontrol1.cs 1054 13 project1 i have code in actionpane control in word document level project has been created vs2013 using c# .net 4.0 word 2010. i trying run following code within loop: if (reference.namespaceuri.contains("actionspane")) { reference.delete(); } basically, documents created addin give user message when reopen created document: one or more xml expansion packs available file. choose 1 list below. no xml expansion pack microsoft actions pane 3 so seems need find referen

codeigniter - model and controller error CI -

in codeigniter controller user , user model trying users database , have them table format on view page. i getting 2 errors on model though. trying use sql. database auto loaded. not sure done wrong error 1 a php error encountered severity: notice message: undefined property: ci_db_mysqli_result::$rows filename: user/user_model.php line number: 46 error 2 a php error encountered severity: warning message: invalid argument supplied foreach() filename: user/user.php line number: 75 my user model <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class user_model extends ci_model { public function gettotalusers() { $query = $this->db->query("select count(*) total `" . $this->db->dbprefix . "user`"); return $query->row('total'); } public function getusers($data = array()) { $sql = "select * `" . $this->db->dbprefix . &qu

d3.js - How to display GeoJson data with d3js at a specific extent and zoom by default? -

i benefit regarding aspect. loaded basic geojson file d3js , trying display whole area default. currently, default behavior bit "zoomed-in" , cannot see entire area unless zoom out bit. if use smaller area (like county) "zoomed-out"; what know how can make area containing map show extent like. the following example 1 "zoomed-in": current behavior here: https://lh6.googleusercontent.com/-398lxviqwvg/u6widiwtlti/aaaaaaaaaje/heamhdgrgrs/s1600/wrong.png desired behavoir here: https://lh6.googleusercontent.com/-w3uj6m3uwbi/u6wimurvuii/aaaaaaaaajm/ufcno-gzm30/s1600/good.png my current code following: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>display map</title> <script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script> <style type="text/css"> body { font: 10px sans-

QUERY for JOIN a @JoinTable in a @ManyToMany relationship with the non-owned table, in eclipselink jpa -

the own class @jointable ("commit_reference_issue"), need make join table called "commit_reference_issue" , table "issue" represented non-own class issue. join need show after class issue. @entity @table(name="commit") @namedquery(name="commit.findall", query="select c commit c") public class commit implements serializable { private static final long serialversionuid = 1l; @id @column(name="sha", nullable=false, length=45) private string sha; //code omitted... //bi-directional many-to-many association issue @manytomany @jointable(name="commit_reference_issue", joincolumns = { @joincolumn(name="commit_sha", nullable=false, referencedcolumnname = "sha") }, inversejoincolumns={ @joincolumn(name = "issue_number", referencedcolumnname = "number"), @joincolumn(name = "issue_repository_id_git", referencedcolumnname = &qu

actionscript 3 - Item renderer for dynamic DataGrid -

i have problem dynamic item renderer data grids elements. i'm initialiizng columns in data grid dynamically, this: for each (var item in _collection) { var i:myclass= item myclass; var dgc:datagridcolumn = new datagridcolumn(i.id.tostring()); dgc.headertext = i.name; cols.push(dgc); } _mydatagrid.columns = cols; to every cell want pass integer. when has -1 value, cell should display specific text when it's 0 or 1 should contain checkbox. know how can achieve that? don't ideas now, despite thinking quite long time. can me this? create itemrenderer 2 states. 1 state checkbox text

mysql - Codeigniter: $this->load->database(); return blank page -

i use latest ci version 2.2.0. when put code $this->load->database(); on controller, correspond view page return blank. therefore, can't connect database. p/s: i have right config database , installed mysql, mysqli php extension the same code work fine on local computer, won't work on hosting. actually, problem caused using php version > 5.3. fixed that

apache - HTTP Requests going to wrong VirtualHost apache2 -

hoping can lend me hand here has been bugging me few days now. i have apache config file, both standard http server work reverse proxy pages within network. if create new dns record ip address of apache server automatically send request camera1.domainname.com virtual host , forward me 192.168.2.160. what want to send folder /var/www/bad_url. any suggestions here great im pretty sure im going start loosing hair. namevirtualhost * errorlog ${apache_log_dir}/error_baduri.log customlog ${apache_log_dir}/access_baduri.log combined documentroot /var/www/bad_url proxypreservehost on errorlog ${apache_log_dir}/error_cam1.log customlog ${apache_log_dir}/access_cam1.log combined loglevel debug proxypass / http://192.168.2.160/ proxypassreverse / http://192.168.2.160/ serveralias camera1.domainname.com proxypreservehost on errorlog ${apache_log_dir}/error_mediaserver.log customlog ${apache_log_dir}/access_mediaserver.log combined loglevel debug proxypass / htt

html - Sliding effect its not working in jQuery -

i trying custom navigation, sliding effect not working expected. please @ code , let me know suggestion. demo link html <div style="width:320px;height:320px;border:1px solid red;"> <div id="col1" style="float:left"> <div id="menu">slide div</div> </div> <div id="col2"> <div>this content display on page load. <br/> onclick of "slide" button entire thing move right side , menu div should slide in left displaying without sliding effect. <input type="button" id="slide-btn" value="slide"/> </div> </div> </div> css #menu{display:none} js $(document).ready(function(){ $('#slide-btn').click(function(){ $('#menu').css({'display':'block','width':'170px','border':'1px solid blue','height':'320px'})

asp.net mvc 4 - Html.Partial not rendering partial view -

i have following code in view: @if (sitesession.subpagehelper.displaytype == displaytype.list) { html.partial("_sublandingpage_list"); } else { html.partial("_sublandingpage_grid"); } and within partials have foreach loop this: @foreach (product product in sitesession.subpagehelper.pagedproducts) { html code here } where pagedproducts got doing .take() on cached list of products now above code doesn't display paged products if change partial include @ symbol remove semi-colon: @html.partial("_sublandingpage_grid") it display products properly. can tell me difference between 2 version took me ages figure out why products weren't displaying it razor syntax tell starting write c# code, if don't put @ considered plain text need put @ sign before writing c# code in view , in html helper method don't need put semicolon in front of razor syntax write helpers way. for example: @html.labelfor(x=>m

java - Understanding synchronized blocks -

i have problem understanding why better use synchronized(syncobject) synchronized(this) . example, class: public class pool implements objectpool { private object[] pool; private int initialcapacity; private int available = 0; private int waiting = 0; private final object syncobject = new object(); public pool(int initialcapacity) { this.initialcapacity = initialcapacity; pool = new object[initialcapacity]; } public void releaseobject(object o) throws exception { synchronized (syncobject) { pool[available] = o; available++; } if (waiting > 0) { notify(); } } } because if use this , thread trying execute method have wait, whereas if use object lock, restrict critical section.

windows - Copy a file from one computer to many computers? -

i using windows 7. need write batch file copy file (can extension) 1 computer many computers. how can that? please me. copy c:\tmp\localfile.txt \\computer1\c$\tmp copy c:\tmp\localfile.txt \\computer2\c$\tmp ... , on not elegant, should working

javascript - $routeParams in a controller for index.html -

i have application uses index controller main.js. want content defined url, want use $routeparams in controller. problem turns empty. this in app.js .config(function ($routeprovider) { $routeprovider .when('/:guid', { templateurl: '/index.html', controller: 'mycollectionunitctrl' }) .otherwise({ redirectto: '/' }); }); the controller: .controller('mycollectionunitctrl', function ($scope, $location, $routeparams) { console.log($routeparams.guid); // undefined } i've doubled checked module-names same. the problem none of code controller runs. tested adding console.log @ top. index not template, use no partials. i can't find routing when using 1 view, here's i'm stuck. it doesn't work when define controller ng-controller neither. ideas? i'm missing? stupid question that's explained documentation? appreciate com

java - client upload images store under web root directory -

this question has answer here: in spring mvc how context path in controller 1 answer in spring mvc inside entity class field name file. @column private string photo; @transient private multipartfile file; //whatever method setter/getter want store image in folder , file name in db public void setfile(multipartfile file) { //file.getoriginalfilename() //add timestamp filename //using file.transferto(new file(....)); //finally setphoto(filename_with_timestamp) } here (in entity class) how servlet contextpath real path store images in working directory? please 1 me for security reasons not recommended let user upload in web root directory! the better way store uploaded files in directory outside web root (outside web-server directory).

iis 7 - When changing the Authentication of an app in IIS 7, an app on a different site changes with it -

i having problem auth settings in iis. i have several sites running, forms, , windows auth. both of them have management app (pointing same folder, because that's products core is) for reason cannot have different authentication setting on it. when set app of forms app(site a) forms, windows auth app (site b) enables forms auth setting. , vice versa... i have both of sites running on same app-pool. colleague of mine has same problem , has different app-pools either site. could perhaps explain missing here? authentication mode configured in web.config. when both sites in same physical directory both sites reconfigured. copy directory maintain 2 different web.config or use location tag in parent virtual directory web.config.

asp.net mvc - Stored procedures with output parameters using SqlQuery in the DbContext API -

i coulndt return output parameter query,here codes etentities en = new etentities(); var prm_totalrecords = new sqlparameter { parametername = "totalrow", sqldbtype=system.data.sqldbtype.int ,direction= parameterdirection.output }; var prm_start = new sqlparameter { parametername = "page", value = start, sqldbtype=system.data.sqldbtype.int }; var prm_sort= new sqlparameter { parametername = "msort", sqldbtype = system.data.sqldbtype.nvarchar, value = sort }; var prm_limit = new sqlparameter { parametername = "size", sqldbtype = system.data.sqldbtype.int, value = limit }; string sql = "sp_product_get_pagi

java - Populate ListView From SQLite database in onCreate() in Android -

i created activity 'a' , 'b'.i have inserted data in activity 'a' , want display data in listview in activity 'b' on button click in activity 'a'.but when run application crashes , getting error , nullpointerexception.please me.thanks in advance. here database method code. public cursor employeename(){ arraylist<employee> employeenamelist = new arraylist<employee>(); string selectquery = "select * " + employee_details_table; sqlitedatabase db = this.getwritabledatabase(); cursor cursor = db.rawquery(selectquery, null); if(cursor.movetofirst()) { do{ employee empname = new employee(); empname.setname(cursor.getstring(1)); empname.setdepartment(cursor.getstring(2)); empname.setdesignation(cursor.getstring(3)); employeenamelist.add

objective c - How to call ScrollViewDidScroll delegate method of UITableView in IOS -

i have uitableview in loading photos comments.. i have horizontal scrolling of images in each row , vertical scrolling of users photos horizontally comments.. i want update single cell when ever user commented photo. at scrollviewdidscroll method have code dynamically updated height of uitableviewcell , displaying comments. requirement dynamically increase height of custom cell respect comments of photo scrolled. displaying latest 3 comments in cell. should dynamically updated height based on 0 or 1 or 2 or 3 comments of photo.. so, have tried below code..for updating single row.. [self.photostable beginupdates]; [self.photostable reloadrowsatindexpaths:[self.photostable indexpathsforvisiblerows] withrowanimation:uitableviewrowanimationautomatic]; [self.photostable endupdates]; [self scrollviewdidscroll:self.photostable];//as uitableview sub class of uiscrollview wrote but scrollviewdidscroll not calling. if scroll table calling.. please suggest ideas went wrong.

html - Making a sidebar always 100% height -

i've designed website can see below, has fixed header (white), sub-header, main content, sidebar (red) , footer (grey). i have created wireframe website in html/css, can't sidebar work properly. i sidebar start on sub-header , go way bottom of page end after footer (see image below) no matter how content there in main section, can't work. please help! here current efforts on jsfiddle, can see sidebar doesn't go bottom of page: http://goo.gl/eq7cjh remove position: relative content div , use margin-top position panel, shown: #content { height: 100%; } #sidebar { border: 1px solid skyblue; width: 100px; position: absolute; margin-top:7em; top: 0px; right:0px; bottom: 0px; } updated jsfddle

java - How to create runnable jar with dependencies in extra folder on mutimodule project? -

i have common library shared among different project. library extended (at least now), should picked eclipse workspace during build. i'm trying use maven-dependency-plugin copy dependencies in /lib folder next runnable jar. not work: <dependencies> <!-- jar opened project in workspace, not installed maven repo, , not submodule. should picked , added jar during package. --> <dependency> <groupid>my.domain</groupid> <artifactid>project-commons</artifactid> </dependency> </dependencies> <plugin> <artifactid>maven-dependency-plugin</artifactid> <version>2.8</version> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies<

symfony - How to customize configureDatagridFilters in Sonata Admin to use non related mongodb documents -

in mongodb got passenger document, typical item: { "_id" : objectid("51efdf818d6b408449000002"), "createdat" : 1374674817, "phone" : "222222", .. } i have device document references passenger document, here example: { "_id" : objectid("51efdf818d6b408449000001"), "os" : "android.gcm", "passenger" : objectid("51efdf818d6b408449000002"), .. } so in other words.. there no way can find out device belonging passenger running query on passenger.. must query on device. in passengeradmin.php got configure list field definition: public function configurelistfields(listmapper $listmapper) { $listmapper ->addidentifier('name', 'text', array('label' => 'name')) ->addidentifier('phone', 'text', array('label' => 'phone #')) ->addiden

c# - REST seems to reject JSON POST -

i'm trying post data in json format server rejecting it. works if post in xml , reply in either xml or json. the contract is [servicecontract] public interface iservice { // 1 string data [operationcontract] [webinvoke( bodystyle = webmessagebodystyle.bare, method = "post", responseformat = webmessageformat.xml, uritemplate = "data")] string datapost(hidden param); } // if compilation error, add // system.runtime.serialization references [datacontract(name = "hidden", namespace = "")] public class hidden { [datamember] public string id { get; set; } } the implementation is public class service : iservice { public string datapost(hidden param) { console.writeline("datapost " + param.id); return "datapost said " + param.id; } } on client side, run of mill standard stuff. namespace client { enum httpverb { get, post,

List of arrays in array for google chart in C# MVC -

i have create array contains list of arrays google chart pie. [['status', 'count'],['new',5], ['converted',0],['completed',0]] one method used quickest implement bit dirty: public class dashboardvm { public dashboardvm(ienumerable<lead> leadsfororganisation) { this.leadsbyagent = new list<leadsbyagent>(); this.leads = leadsfororganisation; foreach (var groupedleads in leadsfororganisation.groupby(m=>m.contactid)) { this.leadsbyagent.add(new leadsbyagent(groupedleads)); } string chart = "[['status', 'count'],['new'," + leadsfororganisation.where(m => m.leadstatusid == 1).count() + "], ['converted'," + leadsfororganisation.where(m => m.leadstatusid == 3).count() + "],['completed'," + leadsfororganisation.where(m => m.leadstatusid == 2).count() + "]

jquery - Overwrite and save JavaScript variable values permanently -

i have javascript file object inside. i'm trying change object variable values using javascript file. if change values , close , reopen javascript file object inside, values revert original value. is there way change object values , save them, when close , reopen file has new values instead of old ones. javascript file object: var datax = { temperature: 20, light_intensity: 40, button: 0, max1: 0, counter: 0 }; a second javascript file changes datax object values: //temperature max = max / 655.34; max = math.round(max); datax.max1 = max; //changes datax object max1 value $('#temp').html(datax["max1"] + "&deg;c"); you can use cookies or html5 storage. prefer second option in case. https://github.com/carhartl/jquery-cookie http://amplifyjs.com/api/store/ simple example amplify. // first store object. amplify.store( "yourobject", { foo: "bar" } ); // retrieve it. var retrievedvalue

How to Save records in Database using Grails Services -

i have domain class called classified. class has relation ship(hasmany) media class: class classified{ static hasmany = [ adresponses: adresponse,mediafiles:media ] } class media{ byte[] mediafile } when save classified object classified controller, able save parent child object using below code: def save(){ def med = new media(mediafile: params.mediafile, contenttype:uploadedfile?.contenttype) classifiedinstance.addtomediafiles(med) classifiedinstance.save flush:true } below classifiedservice save data. @transactional class classifiedservice { def addad(classified classifiedinstance) { classifiedinstance.save flush:true } } in above "addad" method passing object of classified instance. save method of classifiedcontroller: def save(){ def med = new media(mediafile: params.mediafile, contenttype:uploadedfile?.contenttype) classifiedinstance.addtomediafiles(med) classifiedservice.addad(classifiedinstanc

javascript - jQuery var undefined after 1 loop(variable) -

i running loop, checks div's it's content(its small 4 pieced puzzle, data taken xml files. have variable makes run trough div #1a #4a. use same variable go div, , see if there image same class parent id has. jquery: //run when want check answer $(document).ready(function() { var correctpositions = 0; function handleform(count) { //build div var console.log("clickdetected"); var div = "#"+ count +"a"; console.log("this counter "+count); console.log("this div im looking into: "+div); //check if div has children if ($(div).children().length > 0){ var childid = $(div + ":first-child").attr("id"); //got html test if there wasn't anything, returns: undefined var childhtml = $(div + ":fir

java - Firebase Crash and Throws Null Pointer exception -

i using firebase client android in project , last 4 days throws random nullpointerexception while connecting firebase. here stacktrace have found on bugsense: java.lang.nullpointerexception 1at com.firebase.tubesock.websockethandshake.verifyserverhandshakeheaders(websockethandshake.java:95) 2at com.firebase.tubesock.websocket.run(websocket.java:147) thanks in advance in regard

android - Activity not foundException, but i can start it from other Activity -

i call settings activity 2 different activities in same way. however, when call second activity, recieve activitynotfoundexception. in both activitiece called from @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { // handle item selection switch (item.getitemid()) { case r.id.action_settings: intent = new intent(this, settings.class); startactivity(i); return true; default: return super.onoptionsitemselected(item); } } the error 06-27 14:42:33.131: e/androidruntime(11763): android.content.activitynotfoundexception: unable find explicit activity class {com.palsoftware.ebmapps/android.provider.settings}; have declared activity in androidmanifest.xml? 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.instrumentation.c

Security: Session Identifier Not Updated in tcl -

i'm working on open-source application "project-open" , during scanning got following vulnerability: [medium] session identifier not updated issue: 13800882 severity: medium url: https://<server_name>/register/ risk(s): possible steal or manipulate customer session , cookies, might used impersonate legitimate user,allowing hacker view or alter user records, , perform transactions user fix: not accept externally created session identifiers though fix mentioned not sufficient me understand completely.please guide me how should remove this.also let me know if further details needed understand question. project source code in tcl i found following code same it's in java. public httpsession changesessionidentifier(httpservletrequest request) throws authenticationexception { // current session httpsession oldsession = request.getsession(); // make copy of session content map<string,object> temp = new concur

How do I get parameter from hash links in PHP ? -

this link: http://projects/timp#?period=2014-6-25 code : $period = $_get['period']; echo $period; does not work . can ? change format of urls don't have # in middle. seem quite weird have ?name=value after # ...

html - Show dropdownlist with JQuery Autocomplete suggestions -

my jquery autocomplete working fine. after inserting "af", if press keydown, correctly "afghanistan". however, can never see dropdownlist countries. missing autocomplete option? my code: @html.textbox("countries", "", new { @class = "countries", @placeholder = "insert country..."}) <script src="https://code.jquery.com/jquery-1.9.1.js"></script> <script> $(function () { var countrieslist = ["afghanistan", "albania", "algeria"] $(".countries").autocomplete({ source: countrieslist }); }); </script> this example jquery site <html lang="en"> <head> <meta charset="utf-8"> <title>jquery ui autocomplete - default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css"> <script

ios - Symbols missing in time profiler xcode 6 beta -

upon discovering performance issues in application of mine, decided start working instruments. or more time profiler. however when run magnificent piece of technology, notice no symbols being loaded app. despite having looked everywhere , tried every setting , piece of advice find on internet, still remain symbol-less. so final resort decided post here in hope point me in right direction. what i've tried far: (cleaned before every change made) profiling in debug mode setting symbol related settings in app configuration include debug symbols, both in release , debug "resymbolicating" (this button absent in instruments version, it's merely called "symbols...") when clicking "locate" , selecting app's dysm file, "the specified path didn't locate dysm of libraries" could issue related beta version of xcode i'm using? i'm using xcode 6 version 6.0 (6a215l) , instruments version 6.0 (56107.10.7. thanks in a

closures - AngularJS nesting promises issues -

i need solve problem , in fact, i'm don'yet understand how retrieve promise result in nesting promise, bellow code // service mainapp.factory('myservice', ['cmismanager', '$q', 'servicecmis', function(cmismanager, $q, servicecmis) { get_detailfold: function(_objectid){ return servicecmis.getdocumentproperties(_objectid) .then(function(data){ var items = [] ; var imgliste = data.succinctproperties['tsi:image_liste'].split(';') ; (function(imgliste){ (var i=0; i<imgliste.length; i++) { (function(index){ var item = {} ; item.id = imgliste[index] ; return servicecmis.getdocumentproperties(imgliste[index])

java - Wildfly Remote EJB Invocation -

i trying invoke stateless ejb, deployed on remote server. can invoke bean local jboss environment when change remote.connection.default.host remote machine's host, client code not work. this jboss-ejb-client.properties : endpoint.name=client-endpoint remote.connectionprovider.create.options.org.xnio.options.ssl_enabled=false remote.connections=default remote.connection.default.host=serverip/hostname remote.connection.default.port=8080 remote.connection.default.connect.options.org.xnio.options.sasl_policy_noanonymous=false remote.connection.default.username=username remote.connection.default.password=password and client code looks this: properties properties = new properties(); properties.put(context.url_pkg_prefixes, "org.jboss.ejb.client.naming"); string jndi = "jndi_name"; context context = new initialcontext(properties); obj = context.lookup(jndi); please help. thanks all. jack. this answer may late faced same problem, none of abo