Posts

Showing posts from June, 2012

java - How can I add .jar files to my classpath to run JUnit tests using cygwin? -

java - How can I add .jar files to my classpath to run JUnit tests using cygwin? - i new running junit tests , working .jar files. have been instructed download junit.jar , hamcrest-core.jar "and place them somewhere in classpath". can explain novice these instructions mean , how should execute them? before raising queries seek tutorials, please refer foolowing link juint tutorial,which more useful beginners. http://www.tutorialspoint.com/junit/junit_environment_setup.htm http://www.mkyong.com/tutorials/junit-tutorials/ java junit jar cygwin

erp - What is the best way using BQL to select non-duplicate items from BQL? -

erp - What is the best way using BQL to select non-duplicate items from BQL? - what best way using bql select non-duplicate items bql? search<prtaxcode.prgovtrefnbr, where<prtaxcode.prgovtrefnbr, isnotnull>, and<prtaxcode.prgovtrefnbr, ***not in results***>>? current results: 52-55555555555 52-55555555555 <-- remove duplicate 52-12345678 52-144550099 results should : 52-55555555555 52-12345678 52-144550099 using aggregate , groupby constructs gave desired results. found own answer: search4<prtaxcode.prgovtrefnbr, where<prtaxcode.prgovtrefnbr, isnotnull>, aggregate<groupby<prtaxcode.prgovtrefnbr>>> erp acumatica

html - How to hide the file name and location in address bar -

html - How to hide the file name and location in address bar - i have html form localhost/exam/ee2d.html action taken localhost/exam/e2d.php. address bar shows name , location of files using. there way hide others cant guess it. html

android - network provider of location manager is unavailable -

android - network provider of location manager is unavailable - the next code print false this.locationmanager = (locationmanager) getsystemservice(context.location_service); log.d(tag, "network provider enabled: " + locationmanager.isproviderenabled(locationmanager.network_provider)); the permissions have been required include: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> in settings , location switches has been turned allowed. then, why network provider unavailable? update: same code prints true on samsung galaxy device, google nexus device(nexus 4) , lenovo device, false on motorola droid device(droid boinic cm11) , sony device. in "settings", location switches have been turned allowed on devices. seems device or os issue.

java - Development with Apache Spark -

java - Development with Apache Spark - i new spark , wanted inquire mutual guidelines developing , testing code apache spark framework what mutual setup test code locally? there built vm raise (ready box etc.)? have setup locally spark? there test library test code? when going in cluster mode notice there ways setup cluster; production wise, mutual way setup cluster run spark? 3 options here standalone cluster setup with yarn with mesos thank you 1) mutual setup: download spark version on local machine. unzip , follow these steps set locally. 2) launching cluster production: spark cluster mode overview available here explains key concepts when running spark cluster. spark can run both in standalone way , on several existing cluster managers. currently, several deployments options available: amazon ec2 standalone mode apache mesos hadoop yarn ec2 scripts allow launch cluster in 5 minutes. in fact, if using ec2, best way go using script provided

ios - Can UIScreenEdgePanGestureRecognizer be added on a subview that is not near screen edge? -

ios - Can UIScreenEdgePanGestureRecognizer be added on a subview that is not near screen edge? - i downloaded illustration github: https://github.com/paulsolt/uiscreenedgepangesturedemo seems work fine. however, if alter greenview left frame 30 points superview in storyboard (not same superview in example), , alter code [self.view addgesturerecognizer:leftedgegesture]; to [_edgeview addgesturerecognizer:leftedgegesture]; the gesture not respond. guess can not add together uiscreenedgepangesturerecognizer subview unless subview border near screen edge, need know if doing wrong. thanks yes, correct.. works views touches edge. ios objective-c

regex - php preg_match_all: How to get aparat video id from URL? -

regex - php preg_match_all: How to get aparat video id from URL? - i want video id aparat's url php preg_match_all; example aparat url formats: http://www.aparat.com/v/3fjn0 i want "3fjn0" ? you can utilize next code. <?php $url = 'http://www.aparat.com/v/3fjn0'; $path = parse_url($url, php_url_path); $matches = preg_split("/\/v/", $path); print_r($matches[1]); php regex

vba - How to create multiple SUB by using for loop? -

vba - How to create multiple SUB by using for loop? - everyone. created form contain textbox.i created event(selected multiple textbox , set on key event).but now,i have problem. want events same function(judge keyup value.if it's not in range, bounce msgbox) sub call_msgbox(column) dim b integer b = cint(column.text) if b > 500 msgbox "higer 500" elseif b < 330 , b > 100 msgbox "lower 330" end if end sub private sub a1_z1_keyup(keycode integer, shift integer) if keycode > 95 , keycode < 106 call_msgbox a1_z1 elseif keycode > 47 , keycode < 58 call_msgbox a1_z1 end if end sub private sub a1_z2_keyup(keycode integer, shift integer) if keycode > 95 , keycode < 106 call_msgbox a1_z2 elseif keycode > 47 , keycode < 58 call_msgbox a1_z2 end if end sub private sub a1_z3_keyup(keycode integer, shift integer) if keycode > 95 , keycode < 106

PHP convert JSON data using CakePHP -

PHP convert JSON data using CakePHP - i have json object generated through cakephp looks this: [ {"student":{"id":"1","name":"pov phearom","gender":"male","address":"btb","phone":"0986865898","country_id":"1"},"country":{"id":"1","name":"cambodia"},"course":[]}, {"student":{"id":"2","name":"met mok","gender":"male","address":"btb","phone":"09938273","country_id":"1"},"country":{"id":"1","name":"cambodia"},"course":[]}, {"student":{"id":"3","name":"ovb vannak","gender":"male","address":"bt","phone":"09

ios - Movement of Box2d Body in cocos2d-x -

ios - Movement of Box2d Body in cocos2d-x - i need move box2d body according position received form game center server. after receiving position update body position using: - carbody->settransform(b2vec2(serverposition.x,serverposition.y),0); but moving body inapprotiate manner (for example. body showing somewere lese in screen). @ same time sprite image not moving (attached body). what did solve positioning problem taken normal sprite image , alter position in update box2d body position. eg:- your carbody motion based on server position. move invisibly. b2body without userdata(image) carmainbody->settransform(b2vec2(serverposition,carmainbody->getposition().y), 0.0f); here normal sprite image. attch sprite image this car->setposition(ccp(carmainbody->getposition().x*ptm_ratio,carmainbody->getposition().y*ptm_ratio)); this method worked fine me. ios cocos2d-x box2d box2d-iphone

javascript - SVG donut-shape with access of both circles -

javascript - SVG donut-shape with access of both circles - i want create svg donut shape (circle empty circle inside). want able access & resize both circles, eg via id attributes. allow animation. i have considered 3 approaches none great: complex path: not allow access of inner circle via #id outline stroke: possible complicated purpose (would have reposition increment stroke) clippath/mask: doesn't work compound path, outer box is there way of doing this? probably easiest way masks. if working set of discrete donut sizes, utilize css , mask each size: <svg width="500" height="500"> <defs> <mask id="bigmask"> <rect width="100%" height="100%" fill="white"/> <circle cx="250" cy="250" r="50"/> </mask> <mask id="smallmask"> <circle cx="250"

node.js - Nodejs passport authentication hanging -

node.js - Nodejs passport authentication hanging - i'm next nodejs book here: https://www.packtpub.com/web-development/mean-web-development all going smoothly until seek , log in using passport module. hangs no errors. have tried other solutions i've found on such re-ordering middleware, think might different versions of express, of syntax looks different (and doesn't work). here relevant parts. help appreciated! package.json: { "name": "mean", "version": "0.0.3", "description": "first mean app", "dependencies": { "express": "~4.8.8", "morgan": "~1.3.0", "compression": "~1.0.11", "body-parser": "~1.8.0", "method-override": "~2.2.0", "express-session": "~1.7.6", "ejs": "~1.0.0", &qu

.net - Storing JSON object in CASSANDRA -

.net - Storing JSON object in CASSANDRA - i want store json in cassandra db. each fields of json should mapped respective column. is possible ? if possible how can accomplish it?. please help me guys.. the reply same given in other post - cassandra no more schema-less there no out-of-the-box solution (unless have pre-defined json structure). create first-level json construction map<text, text> (if, think, need select entry key) { "keya": { "keyb": 5, "keyc": "somestring" }, "keyd": 3; } this mapped next map entries <keya, '{ "keyb": 5, "keyc": "somestring" }'> <keyd, '3'> in way can content first-level key in json have search subsequent entries. "flatten" keys map this: <keya, '{ "keyb": 5, "keyc": "somestring" }'> <keya.keyb, '5'> <keya.keyc": &

java - Which Place to write connection.close() and preparedstatement.close() -

java - Which Place to write connection.close() and preparedstatement.close() - i new in jdbc ... student class has methods constructor, add(),update() , delete() etc ... open connection in constructor. place write conn.close() , pstmt.close() in below code help me class pupil { connection conn; preparedstatement pstmt; resultset rs; public student() { seek { class.forname("com.mysql.jdbc.driver"); conn=drivermanager.getconnection("jdbc:mysql://localhost:3306/test","root","root"); } catch(exception e) { system.out.println("error :"+e.getmessage()); } } public void add(int rollno,string name) { seek { pstmt = conn.preparestatement("insert pupil values (?, ?)"); pstmt.setint(1,rollno); pstmt.setstring(2, name); int = pstmt.e

How do I get Anaconda3 to see Python 2.7 after installing it? -

How do I get Anaconda3 to see Python 2.7 after installing it? - so, set anaconda(3) on windows 8 computer, worked without problems. now, need installation of python 2, created appropriate additional environment. sadly, after activating environment, python interpreter sees stays same. doing wrong? (shortened) console output: c:\users\me\appdata\local\continuum\anaconda3>conda create -n py27 python=2.7 anaconda fetching bundle metadata: .. solving bundle specifications: . bundle plan installation in environment c:\users\me\appdata\local\continuum\anaconda3\envs\py27: <snip> next new packages installed: _license: 1.1-py27_0 anaconda: 2.1.0-np19py27_0 <snip> python: 2.7.8-0 <snip> proceed ([y]/n)? y menuinst-1.0.4 100% |###############################| time: 0:00:00 239.25 kb/s fetching packages ... _license-1.1-p 100% |###############################| time: 0:00:00 432.62 kb/s anaconda-2.1.0 100% |############

jinja2 - Including variables from a child template -

jinja2 - Including variables from a child template - i have several templates: parent.jinja2 {# header #} {% block content %} {% block title_header %} <h1>{{ the_title }}</h1> {% endblock %} {% block child_content %} {% endblock %} {% include 'extra.jinja2' %} {% endblock %} {# footer #} extra.jinja2 {% block %} <p>the title {{ the_title }}.</p> {% endblock %} child.jinja2 {% extends 'parent.jinja2' %} {% set the_title = "title of doom" %} {% block child_content %} <p>some stuff.</p> {% endblock %} when render child.jinja2 , value of the_title in extra.jinja2 empty. how can access value of the_title defined in child.jinja2 ? the problem seems go away if remove title_header block, looks first reading the_title within block. jinja2

node.js - what is the best way to integrate node_acl with sails -

node.js - what is the best way to integrate node_acl with sails - i'd utilize https://github.com/optimalbits/node_acl module http://sailsjs.org framework. configured sails utilize mongodb : in /config/connection.js mongodb: { adapter: 'sails-mongo', host: 'localhost', port: 27017, user: '', password: '', database: 'acl' } and in /config/models.js { connection: 'mongodb', migrate: 'safe' } now have configure acl module, in /api/controllers/aclcontroller.js have : var acl = require('acl'); acl = new acl(new acl.mongodbbackend(dbinstance, 'acl_')); module.exports = { adduserroles : function(req, res) { acl.adduserroles('joed', 'guest', function(err,data){ homecoming res.json({err:err, data:data}); }); } now how can value of dbinstance instanciate acl? note : installed acl , sails-mongo dependencies... give thanks help node_acl seems depend

Inserting a character in a string in c++ -

Inserting a character in a string in c++ - my task is:::: delete vowels, insert character "." after each consonant. so programme made inserts "." @ begining ......... help me http://ideone.com/y8doxt #include <iostream> #include <string> using namespace std; bool isvowel(char ch); int main() { string orwr; int j = 0; getline(cin, orwr); (j=0; j<6; j++) { if(isvowel(orwr[j])==1) {orwr.erase(j, 1);j--;} else {orwr.insert(j, 1, '.');j++;} } cout<<orwr; homecoming 0; } bool isvowel(char ch) { switch(ch) {case 'a': case 'a': case 'e': case 'e': case 'i': case 'i': case 'o': case 'o': case 'u': case 'u': homecoming true; default: homecoming false;}} your loop shoul : (j=0; j<orwr.length(); j++) and not: (j=0;

export result into excel sheet from teradata sql assistant -

export result into excel sheet from teradata sql assistant - i want export results excel sheet running query in teradata sql assistant. used re-create paste didnt work in advance. if homecoming answers sql assistant should able select save answerset file menu. have alternative save proper excel file format. if export answers flat file straight delimited text file can in turn opened ease in excel , saved proper excel file format (xls, xlsx, etc.) teradata

vb.net - Why are balloon tip position and stem orientation buggy? -

vb.net - Why are balloon tip position and stem orientation buggy? - my problem: i'm using balloon tip on text box indicate non-numeric entry (real-time). 1 time sec non-numeric character inputted, balloon tip position , stem orientation changes (inverts , undesirably to reproduce: in visual studio, in design mode, drag text box , tooltip onto fresh form. use next is: code: public class form1 private sub textbox1_textchanged(byval sender system.object, byval e system.eventargs) handles textbox1.textchanged if (not isnumeric(textbox1.text) , textbox1.text.length > 0) tooltip1.tooltiptitle = "input must numeric!" tooltip1.active = true tooltip1.isballoon = true tooltip1.show(vbnewline, textbox1, 45, -40) else tooltip1.active = false tooltip1.hide(textbox1) end if end sub end class you can check if tooltip visible before showing it: private

c++ - Linked list with queue LNK2005 error -

c++ - Linked list with queue LNK2005 error - hello wrote next programme (queue linkedlist) have error can not figure out how prepare happy if help me prepare it. this code problem , 3 errors: error 1 error lnk2005: "struct node * rear" (?rear@@3paunode@@a) defined in main.obj error 2 error lnk2005: "struct node * front" (?front@@3paunode@@a) defined in main.obj error 3 error lnk1169: 1 or more multiply defined symbols found code - queue.h #ifndef _myqueue_h #define _myqueue_h #include <iostream> struct node { int data; node* next; } *rear, *front; void enqueue(int element); void dequeue(); #endif main #include <iostream> #include "myqueue.h" int main() { node *rear; node *front; enqueue(7); enqueue(4); enqueue(9); dequeue(); dequeue(); dequeue(); system("pause"); homecoming 0; } queue.cpp #include "myqueue.h" void e

c# - MVC Foreach distinct value from database -

c# - MVC Foreach distinct value from database - i have table in database looks bit this: links linksid tvid(foreign key) season episode link now i'm trying have foreach statement in view on page. season 1 episode 1 episode 2 episode 3 season 2 episode 1 episode 2 episode 3 however can season 1 episode 1 season 1 episode 2 season 1 episode 3 season 2 episode 1 season 2 episode 2 season 2 episode 3 so after googling have got foreach display first episode not i'm after. @foreach (var item in model.links.groupby(x => x.season).select(s => s.first())) { <p>season @html.displayfor(modelitem => item.season) @html.displayfor(modelitem => item.episode)</p> } what doing wrong? you want this: @{ var mylist = model.links .groupby(x => x.season) .select(x => new { season = x.key, episodes = x });

oracle10g - Convert Oracle query to Access -

oracle10g - Convert Oracle query to Access - select mrno,createddate (select hmisakhsp.mrrh_antenatalcare.*, row_number() on (partition mrno order createddate desc) rn hmisakhsp.mrrh_antenatalcare) rn = 1 , deliverybooked = 'b' order mrno this oracle query working fine when tried run query on access got error syntax error missing operator . unfortunately every database management scheme has own dialect of sql. there changes version version of 1 dbms well. so basic sql statements like select * mytable are supported, specialities window functions select row_number() on (...) mytable are not. additional want utilize msaccess imho far away sql possibilities of oracle, sqlserver, postgresql, mysql , on. you should definitly using 1 of these large dbms. i don't think msacess has back upwards window functions. oracle oracle10g ms-access-2010

javascript - How to auto inject class text angular -

javascript - How to auto inject class text angular - there way auto generate class when user pick illustration list in text editor, want auto inject class ul tag before saving db? yes, can utilize ng-class . need set ng-model directive select box , utilize ngclass activate class name when look met. the documentation at: https://docs.angularjs.org/api/ng/directive/ngclass. javascript angularjs textbox

More problems with the "easy to learn" angularjs framework -

More problems with the "easy to learn" angularjs framework - i trying simplest thing angularjs makes incredibly difficult. this code here works: .factory('itemservice', [function() { var items = [ {id: 1, label: 'item 0'}, {id: 2, label: 'item 1'} ]; homecoming { list: function() { homecoming items; }, add: function(item) { items.push(item); } }; the variable items declared @ top of mill , accessible in homecoming statement. so why doesn't work: .factory('itemservice', ['$http', function($http) { var self = this; self.items = []; $http.get('/api_job_inspections/1/edit').then(function(response) { //self.items = response.data; self.items = [ {id: 1, label: 'item 0'}, {id: 2, label: 'item 1'} ]; }, function(errresponse) { console.error('error while fetching notes'); }); homecoming { list: function() { homecoming se

multithreading - Why does this sleeping barber solution not cause a deadlock? -

multithreading - Why does this sleeping barber solution not cause a deadlock? - considering sleeping barber problem, have next solution have 2 status variables customer_available , barber_available in monitor: get_haircut if num_free_chairs > 0 num_free_chairs := num_free_chairs - 1 customer_available.signal barber_available.wait do_haircut if num_free_chairs = n customer_available.wait barber_available.signal num_free_chairs := num_free_chairs + 1 now, assume first client goes in , calls customer_available_signal , wakes barber up; assume barber thread starts , executes finish function , starts wait on customer_available 1 time again (assume thread calling do_haircut method 1 time again , again). , context switches , client thread stucks on barber_available status causing deadlock. so, solution seemed wrong me, same in several different sources. is because methods in monitor atomic , client gua

c# - Resfresh twice picturebox show Errorimage -

c# - Resfresh twice picturebox show Errorimage - i write videobox class show images capture video file or webcam using opencv code in c++, need fixed size box override minimum , maximum public ref class videobox : public system::windows::forms::picturebox { public: videobox(); ~videobox(); bool capture() { cv::mat cur_frame; bool r = maintracker.capture(cur_frame); if(!r) homecoming r; imshow("debug window", cur_frame); this->image = gcnew system::drawing::bitmap(cur_frame.cols, cur_frame.rows, cur_frame.step, system::drawing::imaging::pixelformat::format24bpprgb, (system::intptr)cur_frame.ptr()); this->refresh(); homecoming true; } .... virtual property system::drawing::size minimumsize { system::drawing::size get() override { homecoming m_desiredsize; } void set(system::drawing::size) override { } } virtual property system::drawing::size maxi

arraylist - Java list default implementation? -

arraylist - Java list default implementation? - if declare new list this: list<string> listexample = somefunction(); what list interface implementation used? edit: answers far. considered clean way this, should declare list new? as eran commented totally depends on somefunction(); returns .both arraylist<e> , linkedlist implements list interface . you can seek , system.out.println("" + listexample.getclass()); to find out has been implemented. docs , public final class<?> getclass() returns runtime class of object. returned class object object locked static synchronized methods of represented class. java arraylist

objective c - iOS: animate UICollectionView vertical expansion with constraints? -

objective c - iOS: animate UICollectionView vertical expansion with constraints? - i've view controller uicollectionview on top (using default grid layout) followed other controls below it. add together / remove cells / collection view, want expand / contract in vertical direction (so has plenty rows show of cells , no more), , controls below move downwards / screen accordingly. if imagine how email app uis work when add together / remove addresses, that's effect i'm trying implement. achieving effect using constraints, though, eluding me. help greatly, appreciated! what did: removed constraints in ib added height constraint on collection view , connected iboutlet had ib add together missing constraints add observer collection view's contentsize property now, when add together cell collection view , tell reload, i'm notified when contentsize changes , can set constant height constraint contentsize height. result: collection view resizes fill i

spring mvc - How to compare two variables of the model with Thymeleaf Standard Expression Syntax? -

spring mvc - How to compare two variables of the model with Thymeleaf Standard Expression Syntax? - i'm trying set selected option's attribute thymeleaf + springmvc shown below: ( item.coditem , defaultcoditem long) <select id="selitems"> <th:block th:each="item : ${myitems}"> <option value="564" th:value="${item.coditem}" th:selected="(${item.coditem} eq ${defaultcoditem})? 'selected' : '' " th:text="${item.coditem} + ' || ' + ${defaultcoditem}"> 564 || ? </option> </th:block> </select> but result is... <select id="selitems"> <option selected="selected" value="455">11/2014 - 455 || 450</option> <option selected="selected" value="450">450 || 450</option> <option selected="selected" value="452">452 || 450</

Asynchronous PHP calls to C# -

Asynchronous PHP calls to C# - $fp = fsockopen($this->_xmlhost, 443, $errno, $errstr, 10); if (!$fp) { //echo "$errstr ($errno)<br />\n"; } else { $result = $this->curlspost($this->_xmlurl, $sendxml ,10); $result = str_replace('getlicinfoold','getlicinfo', $result); $xml = new simplexmlelement($result, libxml_nocdata); fclose($fp); homecoming $xml; } above php code need convert c#. my question purpose of using fsockopen , necessary convert c# side? can't send curl via webrequest in c# , done it? just send request using webclient class. abstracted bit more using webrequest. http://msdn.microsoft.com/en-us/library/debx8sh9%28vs.80%29.aspx c# php asynchronous

r - hosting and setting up own shiny apps without shiny server -

r - hosting and setting up own shiny apps without shiny server - i'm trying create shiny apps available coworkers without them having run or have r installed. so read wegpage http://shiny.rstudio.com/tutorial/lesson7/ , found sentence: 'if familiar web hosting or have access department, can host shiny apps yourself.' under 'share web page'-section. i wondering if can point me help regarding topic? minimal requirements (or tutorial). problem company bound restrictions regarding web hosting , security , on, , not (for now) pay shiny-server-pro. but sentence above gives me hope set ourselves convince them. can help? if pc , coworkers pcs belong same lan, pretty easy achieve. run app through: runapp(host="0.0.0.0",port=5050) the value set through host argument says take connection (not localhost). port argument can assume value want (just assure avoid select ports used other services ssh or http ). then, take note of local ip (

tsql - Procedure from Firebird to SQL Server -

tsql - Procedure from Firebird to SQL Server - i need create stored-procedure returns 1 row every week between 2 dates. create procedure in firebird, can't accomplish same thing in sql server 2012. i seek utilize stored-procedure, cannot called select statement (i need utilize result in union query) i seek utilize function, homecoming 1 (last) value (week). how can rewrite stored procedure sql server 2012? begin tydent = startdate; while (tydent < enddate) begin select first 1 extract(year cast(ib_datetostring(:tydent, 'dd.mm.yyyy') date)), extract(week cast(ib_datetostring(:tydent, 'dd.mm.yyyy') date)) securityusers :rok, :tyden begin suspend; end tydent = tydent + 7; end end startdate , enddate input parameters. rok , tyden output paramaters , tydent variable. edit. if utilize (41952 , 41975 date in float) select * storedprocedure(41952, 41975) then w

java - How to use a sharedPrefs.getString into a Runnable -

java - How to use a sharedPrefs.getString into a Runnable - how can utilize sharedprefs.getstring runnable ? private runnable updatecounterthread = new runnable() { public void run() { timeinmilliseconds = systemclock.uptimemillis() - starttime; updatedtime = timeswapbuff + timeinmilliseconds; string tauxhoraire = sharedprefs.getstring("taux_horaire", "null"); double taux=double.parsedouble(tauxhoraire) * 100; int centimes = (int) (updatedtime / 1000 * (taux / 60 / 60)) ; int euros = centimes / 100; centimes = centimes % 100; counterval.settext("" + euros + "," + string.format("%02d", centimes) + " €"); customhandler.postdelayed(this, 0); } }; since when it's error "sharedprefs cannot resolved" can't import in loop. when add together loop sharedpreferences sharedprefs = preference

c# - XMPP library for Windows Phone 8.1 -

c# - XMPP library for Windows Phone 8.1 - i looking open source xmpp library windows phone 8.1. have tried agsxmpp having problem using it, guess doesn't back upwards wp8.1. i guess can find more libraries here: http://xmpp.org/xmpp-software/libraries/ c# windows-phone-8.1

c - custom malloc implementation using a char array as the memory -

c - custom malloc implementation using a char array as the memory - i'm bad in c programming. i'm asked next task implement malloc memory allocation library. declare array of 20000 bytes. you must implement function malloc(). phone call mymalloc(). signature similar malloc(). should implement myfree() has signature , functionality similar free(). mymalloc() allocates memory mentioned array of 20000 bytes. all info structures required manage memory must reside within same array. mymalloc() , myfree() must in file called mymalloc.c. should provide suitable header file mymalloc.h. can tell me how approach problem. i'm clueless. give thanks in advance. ok - here starting point - implementation of actual mymalloc / myfree functions left do... file: mymalloc.h #include <stdlib.h> void * mymalloc(size_t size); void myfree(void * ptr); file: mymalloc.c #include "mymalloc.h" #define pool_size 20000 static char pool[pool_size]

How to move a submenu and all items under it to another parent menu in Ektron? -

How to move a submenu and all items under it to another parent menu in Ektron? - i utilize menu tab under content. current menu construction below mainmenu sub menu level 2 submenu level 3 (1) item 1 item 2 item 3 submenu level 3 (2) item 41 item 5 item 6 what want below mainmenu submenu level 1 sub menu level 2 submenu level 3 (1) item 1 item 2 item 3 submenu level 3 (2) item 41 item 5 item 6 please note want add together new submenu under mainmenu , want added submenu , every thing under come under new one. there not appear way through ui interface, relatively simple via database. there 2 key tables menus: menu_tbl , menu_to_item_tbl . in menu_tbl , find row item you'd move. note mnu_id item. you'll want export whole menu_tbl excel, , refer later create changes. to

javascript - get url parameter query via injector -

javascript - get url parameter query via injector - need direct access object can reveal info query parameter passed. would prefer way hold of object injector $http object var $http = angular.injector(["ng"]).get("$http"); what's direct/short/concise/eloquent way query variables without going through controller. alternatively other options please. here illustration query parameter in app.js illustration .when('/catagory/:catagoryid/:catagoryname', { templateurl:'partials/bookofparticularcatagory.html', controller:'bookofparticularcatagorycontroller' }) in controller app.controller("bookofparticularcatagorycontroller",function($routeparams,$scope,$http){ $scope.catagoryid= $routeparams.catagoryid; $scope.catagoryname= $routeparams.catagoryname; javascript angularjs

java - JXTA on internet -

java - JXTA on internet - i developping jxta based application in java jxse. work locally, seek work on internet. for exemple, have 2 computers on local network. find each other immediatly, , application work. no problem. now, have these 2 computers, , 2 others computers on other local network. understand it, need, minimum requierement, 2 public rendezvous peer (one on each local network) connected. can't find how deal it. in application, utilize setautostart method, that's mean peer promoted rendezvous peer automatically if needed. so think, it's impossible 2 distant peer find each other without give public adresse. need retrieve valid tcp adress on peer , give others. if know how that, happy ! edit: config //network setup seek { manager = new networkmanager(networkmanager.configmode.edge, peer_name, conf.touri()); } grab (ioexception e) { //chemin wrong ? e.printstacktrace(); system.exit(-1); } see

javascript - Preventing resize of button in contenteditable div in IE -

javascript - Preventing resize of button in contenteditable div in IE - we have styled disabled input, of type button, we're using placeholder other content in content editable area. issue ie (we're targeting ie10) appears ignore resizestart event altogether when click on element, you're allowed resize it. want prevent that, still allow element selected , dragged. seem work image. the story behind selection of element here long winded, assume can't alter element. update: here's jsfiddle demonstrating issue , relevant sample code here: <div contenteditable="true"> <input type="button" value="test" disabled="disabled" onresizestart="return false;" onresize="return false;" id="test" /> </div> this far ideal, works. can capture "mouseup" event of container , reset width , height of command there: $('#container').mouseup(function(e){

uiapplication - How to call completionHandler for performFetchWithCompletionHandler in Swift -

uiapplication - How to call completionHandler for performFetchWithCompletionHandler in Swift - how can phone call completion handler background fetch in swift. following: func application(application: uiapplication, performfetchwithcompletionhandler completionhandler: (uibackgroundfetchresult) -> void) { // completionhandler (uibackgroundfetchresultnodata) // not work :( homecoming } can please help me? thanks, tobi the enum case uibackgroundfetchresult.nodata , right way is: completionhandler (uibackgroundfetchresult.nodata) or even: completionhandler (.nodata) because type can inferred closure signature hint: when unsure function signature, or enum cases, etc., in xcode write type, in case uibackgroundfetchresult , , cmd+click go definition, or option+click popup declaration. helps lot. swift uiapplication

java - Error message doesn't display correctly -

java - Error message doesn't display correctly - i'm trying create dialog display error message whenever create wrong move in scrabble game. in problem.java, create this class problem { problem(string s) { message = s; } } so write code display warning : void displayproblem(problem p) { joptionpane.showmessagedialog(this,p, "warning!",joptionpane.warning_message); } i expect error message when don't set tile : "no tiles placed" what's in code ended : what's wrong code anyway? you either need pass p.message dialog or override problem's tostring() method , homecoming message there. you're seeing output of standard tostring() , i.e. class name + instance id. btw, posted lot of irrelevant code, might create lot of people want either close question or prevent them trying answer. when asking questions should seek , boil downwards relevant parts, in case how display dia

tfs - Visual Studio Online, 403 forbidden, you do not have licensing rights to access this feature, Overnight lost majority of rights? -

tfs - Visual Studio Online, 403 forbidden, you do not have licensing rights to access this feature, Overnight lost majority of rights? - last night bunch of windows updates occurred work pc. now when login visual studio online , effort access code or receive error. 403 forbidden. tf400409: not have licensing rights access feature: administer account we utilize free visual studio online , have 4 users. other users can still navigate business relationship , view code , user settings. still nowadays user , able login have access 2 tabs (overview , load test). i noticed msdn license had lapsed before month, unsure if issue. hoping else has run issue can't code. i have entered ticket microsoft , post findings here if able prepare account. got reply microsoft. visual studio online membership desciptions basically, need @ to the lowest degree basic membership perform admin functions or msdn subscription. i had had subscription had never seen issue

javascript - Escape $ in regex replacement string -

javascript - Escape $ in regex replacement string - i want turn string dkfj-dkfj-sflj dkfj-woop$dkfj-sflj . here's i've tried: var my_string = "dkfj-dkfj-sflj"; var regex = new regexp("(\\w+)-(\\w+)-(\\w+)", "g"); console.log(my_string.replace(regex, "$1$woop[\$$2]$3"); and result is: dkfj-woop$2-sflj . because "$" in front end of "$2" capture group, messes capture group. assuming want construction of regex , capture grouping string remain same, what's right way escape "$" works? that isn't how escape $ replace . backslash escaping works @ parser level, functions replace cannot give special meaning new escape sequences \$ because don't see \$ . string "\$" equivalent string "$" , both produce same string. if wanted pass backslash , dollar sign function, it's backslash requires escaping: "\\$" . regardless, replace expects escape $

javascript - Why is everything NOT prime? -

javascript - Why is everything NOT prime? - i'm trying write programme find prime numbers. have basics of down, except no matter number set in, returns not prime. i've been messing way long , cannot figure out is. in "if" statement or isprime function? please help, , give thanks you! var number = 0; function main() { number = parseint(prompt("please come in number determine whether or not prime:", "enter number")); while(isnan(number) === true) { alert("you entered invalid number. please reenter"); number = parseint(prompt("please come in number determine whether or not prime:", "enter number")); } isprime(number); if(prime = false) { alert("the number " + number + " prime number!"); } else { alert("the number " + number + " not prime number!"); } } /*-------------------------------------------

c++ - Why can't I define these macro names? -

c++ - Why can't I define these macro names? - if create define @ command -dfirst , -dsecond bunch of errors: in file included main.cpp:1: in file included /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/iostream:39: in file included /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/ostream:38: in file included /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/ios:40: in file included /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/char_traits.h:39: in file included /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/stl_algobase.h:64: /usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/stl_pair.h:101:11: error: expected fellow member name or ';' after declaration specifiers _t1 first; /// @c first re-create

sql - VB.Net DataGridView update query results -

sql - VB.Net DataGridView update query results - i working in converting out of date access application in .net application. in access have query on form contains list of customers , vehicles users can edit info required. i followed next guide populate info grid http://msdn.microsoft.com/en-us/library/fbk67b6z(v=vs.90).aspx as expect need replicate functionality in .net, have been able populate datagridview results of query joining 2 tables have not been able work out how handle update of tables through datagridview. understand datagridview contains results of query need manually code updatecommand of dataadapter , stuck. in short need update 2 tables though single info grid view. kind regards what add together hidden column(s) unique key(s) bring together 2 tables , write 2 update queries (one each table) , utilize hidden column(s) parameters where clause in each query. sql vb.net datagridview

How to change images after it compare on button next in android? -

How to change images after it compare on button next in android? - i have next , previous button. want alter images after comparing images comes previous activity using next button click. got image value using bundle object. there 26 alphabets images alter on next button event on previous button event. below source code performing alter images on button event(next, previous). private drawingview mdrawingview; bundle extras = getintent().getextras(); int imageres1 = extras.getint("picture1"); int imageres2 = extras.getint("picture2"); mdrawingview = (drawingview) findviewbyid(r.id.drawing_view); mdrawingview.setshape(imageres1, imageres2); btn_next = (button) findviewbyid(r.id.btn_next); // btn_next.setonclicklistener(this); btn_next.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub

css - Google Maps infobox close button -

css - Google Maps infobox close button - i have problem infobox on google maps. have stiled wanted close button disapired :/... know how solve problem? my code: <!doctype html> <html> <head> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script> <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js"></script> <script type="text/javascript"> function initialize() { var loc, map, marker, infobox; loc = new google.maps.latlng(-33.890542, 151.274856); map = new google.maps.map(document.getelementbyid("map"), { zoom: 12, center: loc, maptypeid: google.maps.maptypeid.roadmap }); marker = new google.maps.marker({ map: map, position: loc, visible: true }); infobox = new infobox({ content: document.getelementbyid("infobox")

javascript - If function doesn't return false? -

javascript - If function doesn't return false? - i have next click event: $('#planung').click(function(){ if($current != $('#planungtext')){ console.log($current); console.log($('#planungtext')); $($current).removeclass('active'); settimeout(function(){$('#planungtext').addclass('active')}, 1000); $current = $('#planungtext'); } }); i used log see contents of variable , '#planungtext' element. same, if function doesn't work desired, still going it. $current not set before first time element clicked. am doing wrong here? the 2 jquery objects point @ same dom elements, different arrays (jquery objects arrays behind scenes with stuff). use jquery is http://api.jquery.com/is/ test if same selector match them: if(!$current.is('#planungtext')){ the fastest way check "manually" is: if ($current[0].id !== '#planungtex

How to toggle keyboard on iOS 8 simulator using calabash-ios -

How to toggle keyboard on iOS 8 simulator using calabash-ios - when text field touched using touch() function keyboard on ios 8 simulator not pop anymore. there way toggle keyboard using calabash api? if update run-loop 1.0.9, calabash automatically. https://github.com/calabash/run_loop/blob/master/changelog.md#109 https://github.com/calabash/calabash-ios/wiki/b2-updating-your-run-loop-version if, after updating run-loop 1.0.9, still experiencing keyboard problems, please file bug here: https://github.com/calabash/calabash-ios/issues ios calabash calabash-ios

RIGHT ARROW not appearing in the PDF file produced using JasperReports -

RIGHT ARROW not appearing in the PDF file produced using JasperReports - i have text field has right arrow included in text field have set text appearing in resulting pdf file has no right arrow it. <textelement textalignment="center" verticalalignment="middle" markup="html"> <font fontname="calibri" size="8" isbold="true"/> </textelement> <textfieldexpression><![cdata[$f{generalmanager} + " \u2192 " + $f{manager} + " \u2192 " + $f{teamleader} + " - ee count: " + $f{totalemployeecount}]]></textfieldexpression> note: when alter font dejavusans, right arrow appears. is there work around calibri? have searched calibri, along dejavusans, supports right arrow, problem here? pdf

java - how to do Apache2 hosting for Jenkins Server -

java - how to do Apache2 hosting for Jenkins Server - i running jenkins on ubuntu server. have installed apt-get install. have install apache web server well. whenever opening mydomain.com opening apache home page , when opening mydomain.com:8080 open jenkins page. how can set virtual hosting open jenkins on mydomain.com confused, have 000.default.conf file @ /etc/apache2/sites-available/. please help resolve this. i think situation documented , explained in wiki link below running jenkins behind apache provide comment if helped. help out farther if not plenty you java apache jenkins

homebrew - Running ddd on Mac OS X 10.7.5 -

homebrew - Running ddd on Mac OS X 10.7.5 - i tried install , run ddd using next commands: brew install libtool brew link lesstif brew install ddd and received next error message when trying run ddd: cd@new-host:~$ ddd dyld: library not loaded: /opt/x11/lib/libsm.6.dylib referenced from: /usr/local/lib/libxm.2.dylib reason: image not found trace/bpt trap: 5 the next output brew config: homebrew_version: 0.9.5 origin: https://github.com/homebrew/homebrew head: 7a427a6528c0aa123a43d3adf1c5944ab622c27e lastly commit: 2 hours ago homebrew_prefix: /usr/local homebrew_cellar: /usr/local/cellar cpu: dual-core 64-bit penryn os x: 10.7.5-i386 xcode: 4.6.3 clt: 4.6.0.0.1.1365549073 llvm-gcc: build 2336 clang: 4.2 build 425 x11: 2.6.5 => /usr/x11 scheme ruby: 1.8.7-358 perl: /usr/bin/perl python: /usr/bin/python ruby: /usr/bin/ruby => /system/library/frameworks/ruby.framework/versions/1.8/usr/bin/ruby and below output brew doctor: warning: directories in /usr

android - Custom BaseAdapter or CursorAdapter or CursorLoader? -

android - Custom BaseAdapter or CursorAdapter or CursorLoader? - i have 2 fragment: fragment a: here user enters info , stored in database. fragment b: here entered info loaded database in listview in onresume lifecycle method. now, problem having every time info added , fragment b opened, entire listview reloaded. want load row added listview . using custom baseapadter . no cursoradapter or cursorloader ! to avoid don't utilize setadapter() everytime info changes. i.e: create method refresh info in adapter class sampleadapter extends baseadapter { public void refreshdata(string[] arraydata) { this.arraydata = arraydata; notifydatasetchanged(); } } check if adapter set in activity if (listview.getadapter() == null) { adapter = new sampleadapter(getactivity(), data); listview.setadapter(adapter); } else adapter.refreshdata(data); android

process - how to get PID of my app at runtime using C# -

process - how to get PID of my app at runtime using C# - my app checks @ startup if other instance of same running already, if yes close other instances. tried using process.getprocessbyname("appname") function , store process appname in processes[] array. want find pid of current instance can close other instances of app (which have same name different pids). unable find after lot of googling. how can find pid of instance of app have created process.start("appname.exe") function called within appname.exe ok, given problems other solution, see following in order hook in between processes, need form of ipc. utilize simplicty of shared handles between eventwaithandles, create each programme hear cancellation flag. public static eventwaithandle cancellationevent = new eventwaithandle( false, eventresetmode.autoreset, "myappcancel"); private object lockobject = new object(); and later... task.run(() =>

php - Weird behavior with multipages jquery mobile -

php - Weird behavior with multipages jquery mobile - finally made alter in code , went ok found unusual behaviour. below code: <!doctype html> <html> <head> <title>bugs administration</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" /> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script> <script> var content; $(document).bind('pageinit',function (event) { $.ajax({ url: 'inc/getbugs.php', data: "", datatype: 'json', success: function(data) { (var = 0; < data.length; i++) { content = "<div data-rol

charts - F# Live Charting Parallel -

charts - F# Live Charting Parallel - i learning utilize f# live charting , having difficulty making code go parallel. i have code wrote help examples google searches. module livechartdata = allow sampleddata (tuple) (t:int) = allow name = tuple |> fst allow stat = tuple |> snd allow x = [for in all.getcolumn<float>((name,stat)).keys -> i.toshortdatestring()] allow y = all.getcolumn<float>((name,stat)) |> series.fillmissingwith 0. |> series.values allow obs = seq { in (seq.zip x y) thread.sleep t yield (i) } |> seq.cache |> seq.observe "" + name + "-" + stat + "",obs allow datasort (id:string) = allow name = all.columnkeys |> seq.map fst |> seq.distinct |> seq.tolist allow stat = all.columnkeys |> seq.map snd |> seq.distinct |> seq.tolist [|for in name j in stat -> (i,

business rules - setup drools Kie execution server credentials -

business rules - setup drools Kie execution server credentials - i'm trying setup kie execution service (kie-server-services-6.2.0) beingness provisioned kie-drools-wb-webapp-6.2.0, when seek access next webapp url of execution server shows basic authentication, , don't know how proceed getting access execution server, , endpoint url, provisioning build-in rules examples of kie-wb , rest or wsdl working. kie-wb has username role "admin" , can build correctly rules. many thanks!! trying reply question decided create howto origin did drool rules executed on remote server. my task integrate kie workbench , execution server, business users able create drools rules , deploy them repo, while developers utilize these rules via calling rest services of standalone drools execution server. you should follow these steps: before using drools execution server allow me utilize such terminology: kie drools workbench - ui creating , deploying model , rule