Posts

Showing posts from March, 2014

Delphi: Retrieve city from public ip address -

how city name http://whatismyipaddress.com/ website? this attempt: var sl: tstringlist; a: integer; s: string; begin sl := tstringlist.create; try httpgettext('http://whatismyipaddress.com/', sl); := pos('your ip address is', sl.text); if > 0 begin s := copy(sl.text, a, 40); := pos('</', s); s := copy(s, 19, - 19); ip := s; end else ip := 'unknow ip'; freeandnil(sl); end; is way without use synapse library changing (httpgettext) (idhttp1.get) ? thanks me! you have download html content whatismyipaddress.com generates, , parse html needed. can use http client (indy, ics, synapse, curl, wininet/winhttp, raw winsock calls, etc) download html. city appears once in html, inside table, eg: <tr><th style="font-weight:bold;color:#676769;">city:</th><td style="font-size:14px;">name here</td></tr> so s

java - Is it possible to set an Android Notification or a later date and time that will fire when the app is not running? -

from have read seems code require app running in thread until notification fires. need notification fire @ later date , time user sees notification other notification , clicks , opens of activity, passing in data app knows do. how can make notification fire days later without app running whole time? do use wait accomplish this? long millis = 60000; mynotification.wait(millis); here code fires immediately notificationcompat.builder mbuilder = new notificationcompat.builder(getactivity()) .setsmallicon(r.drawable.star) .setcontenttitle("how " + me.getstring("eventtitle") + "?") .setcontenttext("click here leave review"); intent resultintent = new intent(getactivity(), setupactivity.class); pendingintent resultpendingintent = pendingintent.getactivity( getactivity(), 0, resultintent, pendingintent.flag_update_current ); mbuilder.setcontentintent(resultpendingintent); int mnotificationid = me.getint("eventid");

C# Adding images to a list -

i'm trying add images used imagelist named "images1". i'm not in coding programs know rest of program working except fact "images1" not exist 2 last voids. searched resolve problem have difficulty find answer specific case. how can make image list "images1" available private voids? this code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using system.collections; using system.globalization; using system.resources; using system.reflection; namespace booster_pack_2 { public partial class form3 : form { public form3() { initializecomponent(); } private void textbox1_textchanged(object sender, eventargs e) { list<image> images1 = new list<image>(); resourcemanager rm = booster_pack

ruby on rails - Model custom validation passing true even though it is not -

i'm confused this. model has following custom validation: def custom_validation errors[:base] << "please select @ least 1 item" if @transactionparams.blank? end basically it's checking make sure parameters belonging different model not blank. def request_params @requestparams = params.require(:request).permit(:detail, :startdate, :enddate) @transactionparams = params["transaction"] @transactionparams = @transactionparams.first.reject { |k, v| (v == "0") || (v == "")} end if it's not blank, happens record saved, , kinds of other things happen. def create request_params @request = @user.requests.create(@requestparams) if @request.save ... else render 'new' end end if record not saved, re-rendered new view shows errors stopped @request being created. problem whether or not @transactionparams.blank? true or false, record fails save, , checked puts in lo

android - R.drawable.icon - cannot find symbol -

i have on code: notification notification = new notification.builder(extension.maincontext) .setcontenttitle(title).setsmallicon(r.drawable.icon) .setcontenttext(message) .setcontentintent(pintent).build(); when try compile it, happens: [javac] /.../mainapp.java:42: cannot find symbol [javac] symbol : variable icon [javac] location: class android.r.drawable [javac] .setcontenttitle(title).setsmallicon(r.drawable.icon) everywhere on google says should put icon.png on res/drawable folder. i'm using haxe/openfl generates folders resolutions: drawable-hdpi, drawable-ldpi, drawable-mdpi, drawable-xhdpi, , file in of them. thought lack of actual "drawable" folder, i've manually created , didn't help. does think of else impacting this? thanks. what import statement r says in class? looks you're importing android.r when want import yourpackage.r, or not import r @ (should default package)

javascript - Having trouble with createElement and appendChild -

i have reasonably simple idea implement. i have array of objects 2 properties: "id" , "name" list these in series of "p" tags within "div". so here html: <body> <div id="listview"></div> </body> and here javascript in tag: sessionstorage.eventid = 2; var playerlist = []; playerlist[0].id = 0; playerlist[0].name = "add new player"; playerlist.push({ id: 5, name: "asako" }); playerlist.push({ id: 6, name: "james" }); playerlist.push({ id: 7, name: "brian" }); playerlist.push({ id: 8, name: "helmut spargle" }); function listall() { var element = document.getelementbyid("listview"); var div; var node; (var = 0; < playerlist.length; i++) { div = document.createelement("div"); div.setattribute("onclick", "javascript: formover(" + playerlist[i].i

scala - updating Json object -

i have json object need update. original object list looks this: [ { "firstname":"jane", "lastname":"smith" }, { "firstname":"jack", "lastname":"brown" } ] for each element in list, have field, "age", needs added @ run-time, result should following: [ { "firstname":"jane", "lastname":"smith", "age": "21" }, { "firstname":"jack", "lastname":"brown", "age": "34" } ] any suggestions how result still json? thanks. i recommended deserializing json array receive list of case classes, having function fill in missing attributes based on current attributes of case class, , serializing them json , serving response. let's make person case class fields missing option : import play.api.libs.json.json cas

javascript - Website does not work when moving the files to another server? -

![enter image description here][1]i'm trying troubleshoot problem. created basic asp page javascript in 1 server works fine @ moment when move asp page , related files new server not work. asp page ask last or first name in text box , has button after press returns matches contact info. microsoft access database . html : <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <!-- jquery library used phone_dir.js can use jquery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <title>corporate phone directory</title> </head> <body bgcolor="#ffffff" link="#003399"> <br> <br> <div style="font-size: 16px; font-family: arial; color:#d6d6d6;"> <table width="745" height="81" border="0" ali

html - Smarty.class.php error -

i'm setting smarty, , seems work fine, new html generated there 1 error message follows: "notice: undefined property: smarty::$complie_dir in /applications/xampp/xamppfiles/smarty-3.1.18/libs/smarty.class.php on line 705". it seems there problem in smarty.class.php contents. any ideas, please. you want access smarty::$complie_dir property named compile_dir not complie_dir . however seems won't work anyway because use smarty 3.1.18 and: as of smarty 3.1 attribute $compile_dir no longer accessible directly. use getcompiledir() , setcompiledir() instead. so should use 2 methods or change compile directory

python - Selecting all items individually in a list -

i wondering if possible re-select each , every item in rslist? citing simple example below looking @ hundreds of items in scene , hence below simplest form of coding able come base on limited knowledge of python rslist = cmds.ls(type='resshdrsrf') # output: [u'pcube1_genshdr', u'pplane1_genshdr', u'psphere1_genshdr'] i tried using following cmds.select taking last selection (in memory) - psphere1_genshdr account while forgetting other 2 though 3 items seen selected in ui. tried using list , append, not seems working , selection remains same... list = [] item in rslist: list.append(item) cmds.select(items) #cmds.select(list) as such, possible me perform cmds.select on each of item individually? if trying select each item: import pymel.core pm in pm.ls(sl=true): i.select() but should have no effect in rendering

asp.net - Object reference not set to an instance of an object. on my string -

hi have error" object reference not set instance of object." in string constr. mean? answering =) private void bindgrid() { string constr = configurationmanager .connectionstrings["constring"].connectionstring; //error here sql = "select * logdetails"; sqlconnection con = new sqlconnection(constr); sqldataadapter sda = new sqldataadapter(sql, con); datatable t = new datatable(); sda.fill(t); gridview1.datasource = t; gridview1.databind(); } you need add connection string in web.config file. <connectionstrings> <add name="constring" connectionstring="data source=servername;initial catalog=northwind;persist security info=true;userid=username;password=password" providername="system.data.sqlclient" /> </connectionstrings>

acrobat - Filemaker or applescript calculation to identify and add proper file extensions when exporting containers -

i have variety of mixed media stored in container fields trying export , open (primarily adobe acrobat) running problem when exporting these documents because many either not have file extensions or when rename them upon export , add extension .pdf incompatible actual file type creating error message acrobat when trying open... there function, plugin or calculation can use on export identify file type , add extension on end of file name? to set name extension of images not have file extension: you can use unix command "file" type of image (work on pdf's document). here example: set myfolder (path desktop folder text) & "print:" set myfiles list folder myfolder without invisibles repeat f in myfiles set tfile myfolder & f set na_ext name extension of (info file tfile) if na_ext missing value -- no name extension set r shell script "/usr/bin/file " & quoted form of posix path of tfile -- type of image

java - find amazon categories using python -

i categories of amazon ,i planning scrap not use api. have scrapped http://www.amazon.com .i have scraped categories , sub-categories under shop department drop down .i have created web service code here @route('/hello') def hello(): text=list(); link=list(); req = urllib2.request("http://www.amazon.com", headers={"content-type": "application/json"}) html=urllib2.urlopen(req).read() soup = beautifulsoup(html) last_page = soup.find('div', id="nav_subcats") elm in last_page.findall('a'): texts = elm.text links = elm.get('href') links = links.partition("&node=")[2] text.append(texts) link.append(links) alltext=list(); i,j in zip(text,link): alltext.append({"name":i,"id":j}) response.content_type = 'application/json' print(alltext) return dumps(alltext) run(

c++ - libao compiling in window -

i downloaded source of libao. need compile library/dll windows or use source is. has done before? libao audio library, found here: http://www.xiph.org/ao/ like plenty of open source projets, need compile first before using it, unless want keep every required source codes along project , compile them each time. can mess since can (and more will) alterate in library 1 day or another. reason, should compile link it.

Visual Studio 2013 Settings Manager GetReadOnlySettingsStore throws Exception -

i'm writing visual studio extension , need list of property pages given category. given "texteditor" following list returned. general alllanguages basic csharp etc. the vs environment object dte makes easy page properties, provides no easy method pages. vsenvironment.get_properties("texteditor", pagename); the values i'm after stored in registry visual studio provides settings store hoping me list. i've set following: var settingsmanager = new shellsettingsmanager(this); //serviceprovider.globalprovider var usersettingsstore = settingsmanager.getreadonlysettingsstore(settingsscope.usersettings); however getreadonlysettingsstore throws following exception. the type 'microsoft.visualstudio.settings.settingsscope' exists in both 'microsoft.visualstudio.shell.12.0.dll' , 'microsoft.visualstudio.shell.11.0.dll' it looks mads kristensen has used successfully still can't tell what's wrong. i a

ms office - MS WORD - line joining bullets -

i working in ms word , need bullets. i trying make line, joining 1 bullet other in word document. can please tell me how draw line vertically joining 2 bullets. thanks in advance draw line >right click,select format shape>line style>arrow settings>begin type , end type

java - How to sum data from specific record? -

___worker_id___|_______occur________ 20 | 1 20 | 2 21 | 3 22 | 5 20 | 1 according table, need know each worker how many occur? such worker_id=20 has occur 4 worker_id=21 has occur 8 i can 2 value worker table code string sql = "select table.worker_id,table.occur keyword_pages table" + " keyword_id=" + puid; conn = getconnection(); stm = conn.createstatement(); rs = stm.executequery(sql); while (rs.next()) { int kwd_id = rs.getint(1); /**worker_id 20,20,21,22,20*/ int occur = rs.getint(2); /**worker_id 1,2,3,5,1*/ } how amount of occur each worker? this coding. use hashmap store each record. , store hashmap linklist. haven't idea result. conn = getconnection(); stm = conn.createstateme

Object-Oriented C Finite State Machine -

i have software state machine works using via event driven function calls. namely, have state machine handle struct contains function pointer representing current state: typedef struct phandle_t phandle_t; typedef void(*pstate_f)(phandle_t *phandle, pevent_t pevent); struct phandle_t { pstate_f curstate; void *contextptr; // needed? }; each state represented function takes handle , event input: static void sm_init(phandle_t *phandle, pevent_t pevent); within each function there switch/case on pevent produces action changing curstate function pointer change function representing state. of code works while using global variables determine when state changes done. (this type of approach not work function instantiated variables try , know when stop). however, in interest of reducing global variables , functions, implement more object oriented approach, globals , instruction memory go away once state machine has reached complete state. know there several examples

html - A link refer of data from PHP -

i have create list can show account. here php,i have show login account name.and how href file . example account name call "admin",and show on table .now need create link on "admin" word.so when kick "admin" , can see profile in new page. , how ? (((((echo account 's php))))) $con1 = mysql_connect("127.0.0.1","root","password"); mysql_select_db("babytradeapps"); $sql1 = "select loginid , permission loginacc permission = 2 "; $results = mysql_query($sql1,$con1); echo "<table border=5 cellpadding=10>"; echo "<tr><th>members</th></tr>"; while($row = mysql_fetch_array($results)) { echo "<td>$row[0]</td>"; } echo "</table>"; put link in echo statement: echo "<td><a href='profile.php?id={$row['loginid']}'>$row['loginid

ios - Urban Airship Not Requesting Access For Push Notifications -

after following extensive start-up guide on urban airship's website, finished. upon completion ran app on phone , ran normally, console filled urban airship stuff , going accord plan noticed request use push notifications never came up. i'm running following code in appdelegate.m : - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. //[[uinavigationbar appearance] setbartintcolor:[uicolor colorwithred:0.22 green:0.24 blue:0.75 alpha:1]]; [[uinavigationbar appearance] settintcolor:[uicolor whitecolor]]; [[uiapplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent]; [[uinavigationbar appearance] setbackgroundimage:[uiimage imagenamed:@"color"] forbarmetrics:uibarmetricsdefault]; //nsshadow *shadow = [[nsshadow alloc] init]; //shadow.shadowcolor = [uicolor colorwithred:0.0 green:0.0 blue:0.0 alpha:0.

angularjs - angular checkbox using ng-click to reset the ng-model that is binded to the checkbox, thus prevent the checkbox from being unchecked -

i have logic on senario, want first check box alway checked. if user tries uncheck it, want use ng-click change ng-model binded checkbox 'true'. checkbox still being unchecked.... how achieve keep checkbox remains checked based on ng-model's value, without using angular.element(elem).attr("checked", true) <input type = 'checkbox' ng-model = 'checkboxvalue' ng-click = "handler"/> in controller $scope.checkboxvalue = false; $scope.handler = function(){ $scope.checkboxvalue = true; } i want checkbox remain checked since ng-model checkboxvalue true...but apparently missed here here's plunker: http://plnkr.co/edit/wbjzilfldfbp3mq4omgx?p=preview i stepped call stack, looks set ng-model true, during $digest, ng-model set based on checkbox's status : checked or unchecked. more 1 way binding: bindding ng-model based on checkbox status? simply use ng-change instead of ng-click here demo

apache pig - Pig one row to multiple row -

can please provide pig script below query? here's input format. input id, label 122,a|b 215,q|b|c 214,z|b|c 218,w|b|c 211,r|b|c 219,u|b expected output 122,a 122,b 215,q 215,b 215,c 214,z 214,b 214,c 218,w 218,b 218,c ........... thanks, abhi tokenize label, give bag , flatten it, give many rows tuples in bag. sample code inpt = load '....' using pigstorage(',') (id: chararray, label : chararray); result = foreach inpt generate id, flatten(tokenize(lable, '|')); dump result;

NSDate differs with different timezones in iOS -

i have calendar app, in highlight current date, i have followed following steps, @ present device time 11:59 am, indian time zone, change first 9.am, change time zone san jose , i time 25th june 9.34 pm, in device calendar shows 25th june, in app still shows 26th june. i getting current date way -(void)initialize { nscalendar *gregorian = [[nscalendar alloc] initwithcalendaridentifier:nsgregoriancalendar]; [gregorian settimezone:[nstimezone timezonewithabbreviation:@"utc"]]; nsdatecomponents *weekdaycomponents = [gregorian components:(nsdaycalendarunit | nsyearcalendarunit | nsmonthcalendarunit | nsminutecalendarunit)fromdate:[nsdate date]]; nsinteger day = [weekdaycomponents day]; nsinteger month = [weekdaycomponents month]; nsinteger year = [weekdaycomponents year]; [m_dateformatter settimezone:[nstimezone timezonewithabbreviation:@"utc"]]; m_dateformatter.dateformat = @"dd/mm/yyyy"; nsdatecom

Mysql Column constraint as "not empty" / "required" -

can specify column in mysql "not empty" / "required". requirement ensure field never remains blank on record insertion. i assume don't want blank (empty string, opposed null ) values allowed in table either. normally, that's check constraint for. like create table mytable ( myfield not null varchar(200), check(myfield > '') ) however, mysql parses constraint not enforce it. still allowed insert empty values. to work around that, create before insert trigger , raise signal on attempt insert blank value: create trigger tr_mytable_bi before insert on mytable each row begin if new.myfield = '' signal sqlstate '45001' set message_text = 'blank value on mytable.myfield'; end if; end; do same on before update if want forbid updates blank value well.

android - Is onStart called when the screen is already visible or becoming visible? -

i looked on thread on stack overflow (src: difference between oncreate() , onstart()? ) thread described onstart() method "called when activity becoming visible user". in same answer , in many overrides of oncreate method, see setcontentview called in oncreate. wont make screen visible then? therefore in situation(where setcontentview called in oncreate), onstart() called after screen becomes visible user before user can interact it? the chances of onstart() can called multiple times. oncreate() : called when activity first created. onstart() : called when activity becoming visible user. now graph given difference between oncreate() , onstart()? post. onstart() can called multiple times, in case if process not killed (if activity has been called again.) so if set view @ onstart() , need initialize view onstart() or later (i.e. onresume() ). repetitive process. not bad practice initialize view again , again? hope clear here.

ruby - Remove element from array unless has a certain value in Rails -

i have array of "names" , display current user's name if there name in array. if there other names in array, don't want show current user's name. currently, listing names , excluding current user's name, don't want exclude current user's name if 1 in array. hope explained okay. my code now: module conversationshelper def other_user_names(conversation) users = [] conversation.messages.map(&:receipts).each |receipts| users << receipts.select |receipt| receipt.receiver != current_user end.map(&:receiver) end users.flatten.uniq.map(&:name).join ', ' end end this should work: def other_user_names(conversation) # users (no duplicates) users = conversation.messages.map(&:receipts).map(&:receiver).uniq # remove current user if there more 1 users users.delete(current_user) if users.many? # return names users.map(&:name).join(', ') end

wcf - How to add control the cache of a restful service operation by operation? -

i've written rest service using wcf. service contains several operations. based ( [webget] ), others post based ( [webinvoke] ). the service working expected. however, based operations put in client cache, not desirable operations. after bit search, i've found how prevent browser caching wcf json responses . working, found it's not reusable. my platform not allows me update web.config. actually, service part of sharepoint project. , updating web.config file hard implement properly. forbid me use [webcache] attribute. so implemented custom messageinspector fix proper headers: public class cacheattribute : attribute, iservicebehavior { public void applydispatchbehavior(servicedescription servicedescription, servicehostbase host) { foreach (channeldispatcher cdispatcher in host.channeldispatchers) { foreach (endpointdispatcher edispatcher in cdispatcher.endpoints) { edispatcher.dispatchruntime.mess

android - Is it possible to create custom Viber stickers? -

i have been thinking developing own custom viber sticker can't source give me information this. does know how this? or possible @ all? if yes, please let me know need so. thanks. when send/recieve sticker, doesnt send it, opens image local store phone. did on android download stickers set dont like. connect phone computer , open vyber folder, , search folder containing set downloaded. uploaded custom stickers folder using same names overwrite files. since vyber doesnt send stickers, when send custom sticker people dont see stikers, see original files on phones. repeat process on phones of boyfriend , sister. i can use stickers them, better nothing. can have folder in gallery , send them image files not same, works.

c++ - Explaining a string trimming function -

i came across code below need understanding code. assume string s has spaces either side. string trim(string const& s){ auto front = find_if_not(begin(s), end(s), isspace); auto = find_if_not(rbegin(s), rend(s), isspace); return string { front, back.base() }; } the author stated points end of last space whereas front points first non-white space character. back.base() called don't understand why. also curly braces, following string in return statement, represent? the braces new c++11 initialisation. .base() , reverse iterators the .base() the underlying iterator ( back reverse_iterator ), construct new string valid range. a picture. normal iterator positions of string (it little more complex regarding how rend() works, conceptually anyway...) begin end v v ------------------------------------- | sp | sp | | b | c | d | sp | sp |

symfony - Method return value as service parameter -

i'm trying use method-return-value di-parameter. concrete use-case have service has logic of calculating users-country-code like: $user->getcountrycode(); on other hand have many services depend on country like: $foo = new foo('uk'); $bar = new bar('usa'); i know can inject user service foo / bar, creates odd dependency these services don't need user need country-code. is there way me write service-description along lines of: my_services.foo: class: foo arguments: - @user.getcountrycode edit: i'm using symfony 2.4 yml configuration. service factory method (compatible symfony2 versions) service definitions: # services.yml foofactory: class: foo\foobundle\service\foofactory arguments: [@user_country_code_calc_service] fooservice: class: foo\foobundle\service\fooservice factory_service: foofactory factory_method: create and factory: // foofactory.php class foofactory { private $countrycodeca

php - Username Validation Not Working -

i want validate username in database or not not working . add username on database when validate show username available . put code thats dbconnector.php <?php class dbconnector { var $thequery; var $link; function dbconnector(){ // main settings array loaded $host = 'host'; $db = 'cms'; $user = 'root'; $pass = ''; // connect database $this->link = mysql_connect($host, $user, $pass); mysql_select_db($db); register_shutdown_function(array(&$this, 'close')); } //*** function: query, purpose: execute database query *** function query($query) { $this->thequery = $query; return mysql_query($query, $this->link); } //*** function: fetcharray, purpose: array of query results *** function fetcharray($result) { return mysql

hadoop - How to give equations in Apache pig -

i trying value equation --counted gives total row count in file samplecount = counted*(10/100); how sample data according this --load data examples = load '/home/sreeveni/myfiles/pe/uscensus1990new.csv' ; --group data groupedbyuser = group examples all; --count no of lines in file counted = foreach groupedbyuser generate count(examples) ; --sampling sampled = sample examples counted*(10/100); store sampled '/home/sreeveni/myfiles/out/samplesout'; showing error in above line invalid scalar projection: counted : column needs projected relation used scalar please advice. am doing wrong. i guess sample works number between [0,1]. in case, exceeding required value. if want 10% of data, pass 0.1 directly , in code, find percentage in foreach statement only.

javascript - Get the current page in PDF Java Web -

i need read current page number web application. have: <iframe id="mypdf" src="c:\test.pdf#page=5" style="width: 650px; height: 550px;" /> that open pdf on page = 5, , user can navigate page. then, when user click on button/link, need current index of page in pdf. my users use acrobat reader, , cannot use plugins aren't adobe. can use javascript/java code. thanks tami i found out can use itext (free software) inject javascript pdf file , js in pdf send message container in html . message contain current page , , passed container each time page changed. i use pdfobject.js pdfobject.min.js create pdfjs object catch message . the code in java inject js pdf : public string maddjs() { inputstream vbreaderfile = null; try { vbreaderfile = new fileinputstream("c:\\test.pdf"); pdfreader myreader = new pdfreader( vbreaderfile ); // throws ioexception pdfstamper mystamper = new p

javascript - How to add some extra data to an existing file using node js -

i have file this <?xml version="1.0" encoding="utf-8"?> <quiz> <title>matching</title> /* rewrite */ <questions> <question>can passed on environment individual. can person, insects or physical environment. </question> <answer>communicable</answer> </questions> /* rewrite end */ </quiz> now want add data before </quiz> tag this: <?xml version="1.0" encoding="utf-8"?> <quiz> <title>matching</title> <questions> <question>can passed on environment individual. can person, insects or physical environment. </question> <answer>communicable</answer> </questions> <questions> <question>some txt</question> <answer>some txt</answer> </questions> </quiz> i using fs.writefile("templatexml.xml", data["message"] , function(err) { if(err) { co

Cygwin Installation Hangs - man-db -

i trying install cygwin 64 bit on windows 2012r2 (64 bit). downloading , initial setup went through when reached man-db (/etc/postinstall/man-db) setup hangs , remains forever. waited more 1.5 hours still no progress. checked log file in /var/log/setup.log has following contents. updating index cache path `/usr/share/man/man1'. wait... processing manual pages under /usr/share/man... /usr/bin/mandb: warning: /usr/share/man/man1/col.1.gz: whatis parse col(1) failed /usr/bin/mandb: warning: /usr/share/man/man1/imv.1 dangling symlink /usr/bin/mandb: iconv_open ("utf-8//ignore", "utf8"): invalid argument /usr/bin/mandb: warning: /usr/share/man/man1/mc.1.gz: whatis parse mc(1) failed i not sure if should cancel , start again. setup come out of stage @ least error? did install 64 bit cygwin , got error ? please help happens me often. setting 8 servers week , happened 3 of them. waited many hours , still not finish. re-installation works, not. have res

ios - How to delete a polygon on map -

i implemented map using apple's native f/w , have implemented functionality add polygons on map. now, want have "close" button @ edge of each polygon , when click on button, need delete polygon (one polygon @ time). have tried creating button on polygon edge, unable make action on clicking button. have tried annotations well. in case, unable create close button on polygons; able have close button (annotation) on last polygon created when click on button, polygon created first getting deleted. kindly suggest me solution have close button on each polygon, , delete polygon(one one) on clicking button.

submit - Redirect to an external website JavaScript with POST method -

with javascript linker.js: want open new window , redirect webpage outside current website, here code: deps = ['jquery']; define (deps, function($) { var linker = { 'link' : function(ortholog,link) { $form = $('<form>'); $form.attr("method","post"); $form.attr("action",link); $form.attr("target","_blank"); $input = $("<input>"); $input.attr("type","hidden"); $input.attr("value",ortholog); $form.appendchild($input); $form.submit(); } //return linker(); } return linker; }); i facing problem similar url.action open link in new window on asp.net mvc page how can move out of current website?

cocoa - Custom NSTextFieldCell and background drawing -

Image
i created custom nstextfieldcell , overwrote - (void)drawinteriorwithframe: (nsrect)cellframe inview: (nsview *)controlview own drawing here. however, have trouble background drawing. without calling super background not cleared , subsequent drawings create smear effect. not happen when drawsbackground set, in case can fill cellframe background color. - (void)drawinteriorwithframe: (nsrect)cellframe inview: (nsview *)controlview { if (self.drawsbackground) { [self.backgroundcolor set]; } else { [nscolor.clearcolor set]; } nsrectfill(cellframe); [self.attributedstringvalue drawinrect: cellframe]; } but have clear background in case background drawing disabled? want let other content under text view shine through of course (so, erasing superview's background color no solution). if try fill cell [nscolor clearcolor] draw black. try avoid fill when not needed. , able remove super call. example: - (void)drawinteriorwithfram

jQuery/Javascript - perform an action while element is focused -

my goal automatically refresh entries every x seconds while textarea has focus on it. when user leaves automatic refresh removed. i tried jquery on event not work expect. what doing wrong? $('#content_section').on('focus', '.reply-form textarea', function () { setinterval(refresh_data(this), 1000 * 1); }); var refresh_data = function (element) { if ($(this).attr('data-parent')) { $.ajax({ // create ajax call... data: {}, // form data type: "post", // or post url: "/e/comments/" + $(this).attr('data-parent') + "/", // file call datatype: 'json', success: function (response) { // on success.. if (response.parent) { $('article .comments[data-comment-list="' + response.parent + '"]').html(response.html);

sql - Query to search multiple columns -

i have similar table below: name city state country ---- ---- ----- ------- sree mm ap ind sree redmond ny rahul hyd ap ind xxx mm ap ind abcd mm tn ind wer dd ap ind if search mm,ap need these. name city state country ---- ---- ----- ------- sree mm ap ind xxx mm ap ind abcd mm tn ind wer dd ap ind if 2 words match should come first if contains in city second state , third country. please me this. declare @city nvarchar(50) = 'mm', @state nvarchar(50) = 'ap' select * (select * yourtable city = @city or state = @state )z order case when city = @city , state = @state 1 when city = @city 2 else 3 end

ios - Host multiple mobile apps on one node server? -

i have been configuring centos vps host various services mobile apps using node.js. with research, i'm sure can manage deploy node.js server 1 application, how go separating services on server go through port 80? i thought using different port each app, port 3000 mobileapp1, port 30001 mobileapp2, after reading several posts came conclusion bad idea. because firewalls configured allow connections port 80 , may want create sites utilize same web services mobile clients. i found site recommended using proxy so: var http = require('http') , httpproxy = require('http-proxy'); httpproxy.createserver({ hostnameonly: true, router: { //web-development.cc 'www.my-domain.com': '127.0.0.1:3001', 'www.my-other-domain.de' : '127.0.0.1:3002' } }).listen(80); how can support various web services may called either mobile apps or 1 of web pages , have go through port 80? yes, can use node proxy , have run

jquery - how with phonegap to retrieve data from remote php/mysql server -

i trying build ios app using phonegap i want data remote server display in phonegap. on server have php/mysql, on client side have phonegap , developing app in jquery mobile. i know need use jsonp have problem. on server side developed simple app. i have two php pages . first php page - list.php , display list of navigation (home, us, gallery). second php page - text.php display info list.php. example page display "about us" information, gallery display images , text information... on client side have 2 html pages. list.html - page successfuly connect list.php using jsonp. on list.html - pull data remote server , display navigation (home, us, gallery). page display navigation list, nothing special. listtext.html - problematic html page, don't know how solve. when user open list.html in browser, can click on home button or on button (i make link in format: listtext.html?id=1) but don't know how parse on listtext.html . suppose need have get

javascript - WP menu is not working as expected -

super newb question here, brian not working tonight. i'm using provided js script on wordpress site make single-page website menu scroll relevant section. i have menu options 'home' 'people' 'info' 'contact' these links structured so: " http://sample.com/#home " <!-- navigation menu --> <div class="collapse navbar-collapse" id="navigation"> <ul id="menu-menu-1" class="nav navbar-nav navbar-right"><li id="menu-item-15" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-15"> <a href="http://sample.com/#home">home</a></li> <li id="menu-item-51" class="menu-item menu-item-type-custom menu-item-object-custom menu- item-51"> <a href="http://sample.com/#people">people</a></li> <li id="menu-item-14" class="menu-item menu-item

javascript - Converting AS3 to HTML5 Canvas -

i'm struggling convert javascript in flash cc. need in html5 canvas. but flash comment out script: stop(); function findframe(event:event):void{ var frame:int = math.floor((stage.mousex/stage.stagewidth) * 900) + 1; gotoandstop(frame); }; addeventlistener("enterframe",findframe); what move movieclip frame 1 frame 900, depending on mouseposition in x (horizontal direction). i tried convert it: this.stop(); function findframe(event:event):void{ var frame:int = math.floor((stage.mousex/stage.stagewidth) * 900) + 1; gotoandstop(frame); }; addeventlistener("enterframe",findframe); but no luck, warning: warnings: frame numbers in easeljs start @ 0 instead of 1. example, affects gotoandstop , gotoandplay calls. any expert can me on this? :-) did check console output? expect syntax error dropped in line: var frame:int = math.floor((stage.mousex/stage.stagewidth) * 900) + 1; :int type definition - , don't exist in javascript.

ios - How do I link to a WWDC sessions in S.O. answers? -

i'd provide relevant links specific apple's wwdc session videos in stack overflow questions & answers. how can obtain url link directly specific wwdc video? ideally open page session description , begin playing. the videos use following link format ( tested 2014 & 2013 ): https://developer.apple.com/videos/wwdc/<the-year-here>/?id=<the-session-number-here> for example: https://developer.apple.com/videos/wwdc/2013/?id=228 transcripts an archive of session transcripts exists @ http://asciiwwdc.com . format is: http://asciiwwdc.com/<the-year-here>/sessions/<the-session-number-here> for example: http://asciiwwdc.com/2014/sessions/302 they thin on ground yet, big ones there (keynotes). it's worth throwing in placeholder in hope of more content arriving. linking pleasure if use lot of links, , doesn't love jolly scamps, take @ so's own guide markdown linking . can cool stuff might not know about.

mysql - Retrieving related values in database from listbox PHP -

good day! new in php , trying develop website can retrieve , display stored information database. catch is, information retrieve based on selected value list box (the list box can create in html). i have 1 list box contains names of users , display related information user on specific table in database. to honest, have no idea how this. can retrieve values specific table in database , that's know. hoping patient enough teach me how or guide me if possible in php. thank in advance. you need read on doing database operations using php pdo . once you've done that, rest pretty easy, have learn how work forms php, can here .

php - Extract text between 2 strings? -

this question has answer here: how parse , process html/xml in php? 27 answers i have huge html page contains multiple data this <td style="font-size:24px;" bgcolor="#f0f0f0" width="60%"> <strong>id:full name:email@email.com:mobile:country</strong> </td> i want extract data between tags id:full name:email@email.com:mobile:country so regex or custom php function? ps: above code being repeated multiple times in page , want data stored in array. as of others has said, can use domdocument , domxpath . this: $html = '<td style="font-size:24px;" bgcolor="#f0f0f0" width="60%"> <strong>id:full name:email@email.com:mobile:country</strong></td>'; $dom = new domdocument(); $dom->loadhtml($html); $xpath = new domxpath($dom); $text = $xpat

Two dimensional array to calculate amount in a form,javascript -

i have order form user selects quality of image(from dropdownlist),type of item(from radio button),glossy finish(checkbox checked $1) , quantity(textbox),based on selection of user when clicks on calculate button cost of selected items textbox should populate total amount. (qualityofimage) hard-copy poster coffee mug t-shirt (type of item) good 8.99 9.99 10.99 11.99 9.99 10.99 11.99 12.99 excellent 10.99 11.99 12.99 13.99 for example: if quality of image good,type of item hard-copy,glossy finish checked , quantity 1: total amount=(8.99+1)*1. i new javascript , tried using 2 dimensional array calculate amount not getting correct result.any appreciated. html code: <form id="orderform" name="orderform"> <!--order form--> <div id="items"> types of items <input type="radio" id="items"

git merge subdirectory with another repository -

i have git repository (named x) develop larger project. want use code git repository (named y) , include in repo x under x/a/b. i want make changes x/a/b , commit own repository (x). possible copying code repo y x/a/b. want merge changes y x/a/b. how that? finally, achieved desired result git subtree. can commit changes of x/a/b repository x, pull y. this blog entry explains steps quick.

vb.net - This version of Visual Studio does not have the following project types installed -

i try open solution in vs v2012+ , error unsupported version of visual studio not have following project types installed or not support them. can still open these projects in version of visual studio in created. - setupdoktersadministratie, "c:\users\sta_it\desktop\jonas\dokadmin\backup \setupdoktersadministratie\setupdoktersadministratie\setupdoktersadministratie.vdproj" no changes required these projects can opened in version of visual studio without changing them. continue open in visual studio 2010 sp1 , in version of visual studio. - setupdoktersadministratie, "c:\users\sta_it\desktop\jonas\dokadmin\backup \setupdoktersadministratie\setupdoktersadministratie.sln" will i'm able open these files in vb2010? looking @ problem, have incompatibility issues. note: 2 files listed there different. first 1 cannot opened .vbproj file contains entire project . second 1 (which can opened) .sln file contains solution . try reading article see i