Posts

Showing posts from September, 2011

angularjs - Angular orderby filter in ng repeat do not actually sort underlying data -

to clear misconceptions heading.. items in table appear sorted when orderby filter used in ng-repeat expression. noticed underlying data isn't being sorted @ all. there scenario need data being displayed in filter sorted displayed in table, generating reports. there way achieve this?

jQuery - Append text as a list -

Image
i want append value list.but somehow not able that. when try add it, gets overlapped other list.when add css rid of overlapping, not able take click event.you can see in below picture. here code using append values list: $.getjson('path json', function(data) { $.each( data.markers, function(i, value) { var radlat1 = math.pi * position.coords.latitude/180; var radlat2 = math.pi * value.latitude/180; var radlon1 = math.pi * position.coords.longitude/180; var radlon2 = math.pi * value.longitude/180; var theta = position.coords.longitude-value.longitude; var radtheta = math.pi * theta/180; var dist = math.sin(radlat1) * math.sin(radlat2) + math.cos(radlat1) * math.cos(radlat2) * math.cos(radtheta); dist = math.acos(dist); dist = dist * 180/math.pi; dist = dist * 60 * 1.1515; dist = dist * 1.609344; if(dist<10){

c++ - Difference between following declarations -

recent times confused use of new keyword string data type. can please try clarify it what's difference between following string initialization: 1) string* name = new string("abc") ; .... delete name; 2) string name = "abc"; is advisable use new keyword , values within string how stored in heap internal buffers of std::string . if explains storage location. what's difference between returning string vs string* string* name() { string* name = new string("abc") ; return name; } string name() { string name = "abc"; return name; } there several reasons prefer second approach on first: most important reason: string string , period. string* may point string , or may null / nullptr , or may point random location in memory. therefore, should use plain old string 's on string* 's wherever possible using them less prone errors. declaring string object places on stack, meaning automatical

php - upload images to two different folders in server -

in wamp server have folder call selfie. upload.php located within folder. when upload image image save inside 'uploads' folder inside selfie folder. @ same time have folder call 'admin' inside wamp server. contain folder call 'uploads' what want save same image both 'uploads' folders. used 'copy'. it's not work. here upload.php located inside 'selfie' folder. <?php //this directory images saved $target = "uploads/"; $target = $target . basename( $_files['photo']['name']); $target2="admin/uploads/"; $target2 = $target2 . basename( $_files['photo']['name']); //this gets other information form $cat=$_post['cat']; $desc=$_post['desc']; $pic=($_files['photo']['name']); $loc=$_post['location']; // connects database mysql_connect("localhost", "root", "") or die(mysql_error()) ;

java - Get equal values within a stack -

i'm doing stack on java contains 5 integers have print out values equal. example 1 - 2 - 2 - 3 - 4 same number is: 2 how can determine make same numbers? here code: package e.d_pilas; import java.util.*; public class ed_pilas { private int stck[]; private int tos; ed_pilas(int size){ //new stack stck = new int[size]; tos = -1; } void push(int value) { stck[++tos] = value; } int pop() { if (tos < 0) { return 0; } else return stck[tos--]; } public static void main(string[] args) { int number; scanner read = new scanner (system.in); system.out.print("enter 5 (5) numbers fill stack \n"); ed_pilas stack = new ed_pilas(5); (int = 1; < 6; i++){ system.out.print("enter value "+i+" fill stack \n"); number=read.nextint(); stack.push(number); }

c++ - Unique pointer error in ndk -

hi getting error. error: no type named unique_ptr in namespace std . i have tried discussed in question, ( smart pointers not working android ndk r8 ) error still remains same. unable follow accepted answer says.how follow these steps in accepted answer "be sure standard library include path (like /android-ndk-r8d/sources/cxx-stl/gnu-libstdc++/4.7/include) in target settings."

mod rewrite - Redirecting not working using .htaccess file from to the main domain -

i have 2 domains linked hosting, first 1 main 1 has root: public_html , , second 1 addon domain has root: public_html/lemerge . when user enter www.main-domain.com/lemerge access second website. want redirect user main website instead of accessing second website. if user enter www.main-domain.com/lemerge user should redirected www.main-domain.com i used redirects in cpanel generate code not work. rewritecond %{http_host} ^main-domian\.com$ [or] rewritecond %{http_host} ^www\.main-domian\.com$ rewriterule ^lemerge\/?$ "http\:\/\/main-domian\.com\/" [r=301,l] you can use code in /lemerge/.htaccess file : rewriteengine on rewritecond %{http_host} ^(www\.)?main-domian\.com$ [nc] rewriterule ^ http://%{http_host}/ [r=301,l]

c# - Console.Writeline throws “Not enough storage is available to process this command.” IO exception -

i have application copy 1000 files 1 folder another. after each file copied write copy success/failure information separate file. at time, during writing copy information in file, streamwriter.writeline throws following exception: 10/28/2014 12.21.02.068 message : not enough storage available process command. filename : copying file c:\program files\xyz\samplefile.xml c:\program files\abc\samplefile.xml.xml | inner exception : | type : system.io.ioexception | source : mscorlib not enough storage available process command. @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.__consolestream.write(byte[] buffer, int32 offset, int32 count) @ system.io.streamwriter.flush(boolean flushstream, boolean flushencoder) @ system.io.streamwriter.write(char[] buffer, int32 index, int32 count) @ system.io.textwriter.writeline(string value) @ system.io.textwriter.synctextwriter.writeline(string value) @ system.console.writeline(string value)

javascript - Show/hide script cannot hide again on 2nd click -

i used jquery show/hide in many place in web. every work in case not hide again in 2nd click. here example: http://jsfiddle.net/er9e72ww/ show/hide code $('#uploadmedia').livequery("click",function(){ $('#show_img_upload_div').slidetoggle('slow'); $("#comment").focus(); $('.upfrm').show(); $('#submit').hide(); }); use toggle() in jquery hide , show repeatedly $('#uploadmedia').livequery("click",function(){ $('#show_img_upload_div').slidetoggle('slow'); $("#comment").focus(); $('.upfrm').toggle(); $('#submit').toggle(); }); demo

eclipse - How should I check out a newly added project from git repository? -

i new git hub/git. till now: i using egit i.e eclipse's plugin git.cloned remote repository , existing files available in local. can see incoming changes on existing projects checked out when synchronize in eclipse. problem: now new project has been added in same repository.i can see new project when login in git hub online. there no incoming changes in eclipse. so,what should check out newly added project eclipse's egit ? if new project in same branch working directory uses simple pull should bring new project. if new project added new branch should checkout branch.

pljava - erroer while installing pl/java postgresql -

i trying install pljava in linux system. below command , error root@pega-5-instance:/etc/postgresql/9.1/share/pljava# su postgres -c "/usr/bin/psql -d pegadb -f /etc/postgre sql/9.1/share/pljava/install.sql"<br> create schema<br> grant<br> psql:/etc/postgresql/9.1/share/pljava/install.sql:6: error: not access file "pljava": no such file or directory i have installed java 64bit , pljava 64 bit. please me solve problem.

ios - Saved PDF to Disk; won't Load in WebView Offline -

i can't wrap head around issue here: save pdf disk - load try load pdf on physical device , turn on airplane mode. file doesn't load. can me ? it's issue of saving , retrieving same directory. save location returns: save location : /var/mobile/containers/data/application/a1f1b294-9282-483b-b2e1-76c586a9631e/doc‌​uments/fileurl.pdf loading directory returns : filepath : /var/mobile/containers/data/application/a1f1b294-9282-483b-b2e1-76c586a9631e/doc‌​uments/var/mobile/containers/data/application/a1f1b294-9282-483b-b2e1-76c586a9631‌​e/documents/fileurl.pdf saving pdf: pdfviewcontroller.m - (ibaction)download:(id)sender { nsmanagedobjectcontext *context = [self managedobjectcontext]; nserror *error = nil; nsfetchrequest *request = [nsfetchrequest fetchrequestwithentityname:@"downloads"]; [request setpredicate:[nspredicate predicatewithformat:@"pubnumber = %@", self.title]]; [request setfetchlimit:1]; nsuinteger count = [context countforfet

opengl - Waiting for GLContext to be released -

was passed set of rendering library coded osg library , run on window environment. in program, renderer exists member object in base class in c++. in class initiation function, neccessary steps initialize renderer , use function renderer class provide accordingly. however, have tried delete base class, presumed renderer member object destroyed along it. however, when created instance of class, program crash when try access rendering function within renderer. have enquired opinions on matter , told in windows, upon deleting class, renderer need release glcontext , might indeterminant time in windows environment pending upon hardware setup is so? if so, steps take beside amending rendering source code(if it) resolve issue? thanks actually not deleting / releasing opengl context create memory leak nothing more. leaving opengl context around should not cause crash. in fact crashes yours cause of releasing object, that's still required other part of program, not

Datepicker for Bootstrap on mobile devices changing Format -

i'm using following datepicker: ( http://eternicode.github.io/bootstrap-datepicker/ ) date-field. <input class="datepicker" style="width:100px;border-radius: 4px;" type="text" placeholder="datum" id="startdate".... i'm using 2 diffrent formats 'dd.mm.yyyy' , 'mm/dd/yyyy' , everthing fine. on mobile devices keyboard opens when tap in input-field. because of used native datepicker <input type='date'.... 1 not support different formats. is there anyway disable keyboard on input type=text element? or know other datepicker different formats? thx help check exmaple have readonly not grey input default of bootstrap. i have same fix project. $(function() { var ismobile = navigator.useragent.match(/(ipad)|(iphone)|(ipod)|(android)|(webos)/i); if (ismobile) { $("#datepicker input").addclass('no-grey').prop('readonly', true); } $(&q

cuda - How can I use GPU with Java programming -

i using cudac these days access gpu. guide asked me work java , gpu. searched in internet , found rootbeer best option not able understand how run program using 'rootbeer'. can 1 tell me steps using rootbeer . mark harris nvidia gave nice talk future of cuda @ sc14. can watch here . the main thing may of interest part talks programming languages , java. ibm working on cuda4j , there nice plans java 8 features lambdas used gpu programming. however, not java user , can't answer question regarding rootbeer (besides taste) maybe cuda4j suits you. especially, if know how write cuda c , need solution backed company ibm.

How to change the opacity on an element dynamically using javascript -

i made function change opacity of element, know not working, following code: function _opacity(ele, opacity,addopac , delay ){ ele = document.getelementbyid(ele); var currentopacity = ele.style.opacity, changeinopacity = setinterval(function(){ if (currentopacity > opacity ) { decrease();}; if (currentopacity < opacity) { increase();}; if (currentopacity == opacity) { stopinc();}; }, delay), increase = function(){ ele.style.opacity = currentopacity; currentopacity = currentopacity+addopac; }, decrease =function(){ ele.style.opacity = currentopacity; currentopacity = currentopacity-addopac; }, stopinc = function(){ clearinterval(changeinopacity); }; } one of foremost feature of function is doesn't uses loop. this ideology of using setinterval works in changing width , height of element. her

ios - Loading TableViewDataSource after a method finish -

i want call tableviewdata sources method seeting ui after has been fethced parse . able fetch func loadimages() { var query = pfquery(classname: "testclass") query.orderbydescending("objectid") query.findobjectsinbackgroundwithblock ({(objects:[anyobject]!, error: nserror!) in if(error == nil){ self.getimagedata(objects [pfobject]) } else{ println("error in retrieving \(error)") } })//findobjectsinbackgroundwithblock - end } func getimagedata(objects: [pfobject]) { object in objects { let thumbnail = object["image"] pffile println(thumbnail) thumbnail.getdatainbackgroundwithblock({ (imagedata: nsdata!, error: nserror!) -> void in if (error == nil) { var imagedic = nsmutablearray() self.image1 = uiimage(data:imagedata) //image object implementation

web.xml - Directory Listings Sort Order in Tomcat 8 -

i enabled directory listings web-app using in web.xml <init-param> <param-name>listings</param-name> <param-value>true</param-value> </init-param> this works. sort order seems arbitratry. in folder files only, neither sorted name, size, nor modification date. is there way controll sort order? i added tomcat bugzilla, https://issues.apache.org/bugzilla/show_bug.cgi?id=57287 as wrokaround: defaultservlet can generate listing xml , can apply xslt transformation it. sorting can done within xslt.

java - Why get first parameter from request is wrong? -

i jsp page request jsp page parameters,the code is: url="/hotmoduel/baseinfo/siteinfo/commonplaceandunit/commonplaceandunitstatistics.jsp?keytype=securitykeyother&sid=e13048f7-d253-4d50-acec-2981a5536d48"; $.ajax({ url : url, cache: false, success : function(result) { proccessloginresult(result,function(){ $("#loading").hide(); $("#contentdiv").html(result); setorgselect(); setcrumbs(srcobj); }); } }); in commonplaceandunitstatistics.jsp file,i use request parameter,code is: <% string keytype = request.getparameter("keytype"); string sid= request.getparameter("sid"); %> got keytype's value is securitykeyothersid=e13048f7-d253-4d50-acec-2981a5536d48 the sid's value e13048f7-d253-4d50-acec-2981a5536d48 but parameter in filter: public void dofilter(servletrequest servlet

php - Custom ModRewrite to redirect to controller method -

i using alipay posts responses opencart website url [on success] http://192.168.16.58:8080/index.php?route=api/order/callback . however, 1 condition alipay stops reading url after ? separator, instead of posting data route , instead post s http://192.168.16.58:8080/index.php because of this, interested in using rewriteengine write custom rule when set notify_url http://192.168.16.58:8080/index.php/api/order/callback , redirects http://192.168.16.58:8080/index.php?route=api/order/callback what have following: rewriterule ^index.php/api/order/callback.$ index.php?route=api/order/callback [l] my logic if alipay going index.php/api/order/callback , instead redirected index.php?route=api/order/callback , however, using both , post, instead redirect opencart homepage. rewriterule ^api/order/callback$ index.php?route=api/order/callback [l] this enable: http://192.168.16.58:8080/api/order/callback to: http://192.168.16.58:8080/index.php?route=api/order/callback

javascript - CRM 2013: Strange behavior when refreshing form or navigate back by browser's back-button -

i'm implementing microsoft dynamics crm 2013 our company. at moment have strange behavior. implemented our own contact search , include on dashboard iframe. when open contact search result, shows contact form. if refresh page press "f5" jumps dashboard contact search. expected refresh of contact form. not happen every time. same if navigate contact activity. if press browsers button, goes customer serach. espect goeas contact form. does know why happen? cheers the problem sounds url using open new window/tab. since using new window open results, url should crafted open specific record , use basis actions performed in new window. try this: open existing crm contact record (doesn't matter which) in browser , click "email link" button. in email generated, copy url. this: <crmurl>/main.aspx?etc=2&extraqs=formid%3d<formguid>&id=%7b<contactrecordguid>%7d&pagetype=entityrecord update iframe results link co

Java MySQL Timestamp Saving -

i store lot of application timestamps in mysql db , 1 weird thing observing when store day end time 2014-10-29 23:59:59.999 , when check same in db table rounds timestamp next second , shows 2014-10-30 00:00:00.000 there wrong doing here or issue mysql.i storing timestamps in utc. -regards, willsteel up until mysql 5.6.4 fractional seconds discarded. see http://dev.mysql.com/doc/refman/5.6/en/datetime.html a datetime or timestamp value can include trailing fractional seconds part in microseconds (6 digits) precision. in particular, of mysql 5.6.4, fractional part in value inserted datetime or timestamp column stored rather discarded.

d3.js - dc.js - how to get chart.chartGroup to put the chart in the group -

http://dc-js.github.io/dc.js/ i looking using chartgroup attribute of dc.js dc.redrawall(groupname). i not able find example tried follow chart .chartgroup("group1") .height(ht) .dimension(dim) .group(grp) dc.redrawall("group1") e.g. in following js fiddle http://jsfiddle.net/bra2h/72/ in filter1 funcition if try dc.redrawall("group1"); //dc.redrawall(); it won't work. i got http://jsfiddle.net/bra2h/73/ so have explicitly called dc.registerchart associate group dc.registerchart(hitslinechart,"group1") it did trick.

kendo ui - KendoUI Grid - Bulk import/setting of data very slow -

i ran problem importing data in bulk , setting values of existing rows taking long. usual symptoms browser hanging , "unresponsive script" alert. here's code function import() { var datasource = $("#" + gridid).data("kendogrid").datasource; var data = datasource.data; var importeddata = null; // somewhere..... for(var = 0; < data.length; i++) { data[i].set("column-name-0", importeddata[i][0]); data[i].set("column-name-1", importeddata[i][1]); } } how fix slowness problem? the "set" method mentioned above method of "observableobject", means each time set invoked, in turn triggers refresh of grid. imagine refreshing grid each cell modification in example above. a solution not use set method set new values on model object directly , trigger grid refresh. see below. function import() { var grid = $("#" + gridid); var datasource = grid

jsf - How to drag selected item of p:selectOneListBox and drop into p:inputTextarea? -

here code: <p:selectonelistbox id="columnname" widgetvar="columnname" value="#{datatransformbean.column}"> <f:selectitems id="itemdrop" value="#{datatransformbean.columnlist}" var="item" itemvalue="#{item}" /> <p:ajax update="textarea" /> </p:selectonelistbox> <p:inputtextarea id="textarea" rows="6" cols="33" /> <p:selectonelistbox id="function" widgetvar="function" value="#{datatransformbean.function}"> <f:selectitems value="#{datatransformbean.functionvalnames}" /> </p:selectonelistbox> <p:draggable for="columnname" revert="true" helper="clone"></p:dragga

java - Is it Possible to Check Received fields are Empty or Null Without If -

i receiving list of fields. near 60 fields. from have check 50 fields null or empty, if not ll have add them in db table. right doing manually using if condition. thinking so, not implemented still yet. is there better option ? my code : if(validatedata.checkisnullorempty(command.getsubscriptionstartyear())){ } if(validatedata.checkisnullorempty(command.getsubscriptionperiod())){ } if(validatedata.checkisnullorempty(command.getexpectedarrivaltimeofissues())){ } ..... ..... if(validatedata.checkisnullorempty(command.getmaxnoofclaims())){ } here command class receives data source. here validatedata class : it's method definition : public static boolean checkisnullorempty(integer arg){ if(arg != null) return true; return false; } public static boolean checkisnullorempty(string arg){ if(!arg.trim().equals("") || !arg.trim().equals(" ") || arg.trim() != null) return true; return false; } if guide me or suggest me the

html - How can I retrieve infos from PHP DOMElement? -

i'm working on function gets whole content of style.css file, , returns css rules needed viewed page (it cached too, function runs when page changed). my problem parsing dom (i'm never doing before php dom). have following function, $element->tagname returns null. want check element's "class" attribute, i'm stuck here. function get_rules($html) { $arr = array(); $dom = new domdocument(); $dom->loadhtml($html); foreach($dom->getelementsbytagname('*') $element ){ $arr[sizeof($arr)] = $element->tagname; } return array_unique($arr); } what can do? how can of dom elements tag name, , class html? because tagname should undefined index because supposed tagname (camel cased). function get_rules($html) { $arr = array(); $dom = new domdocument(); $dom->loadhtml($html); foreach($dom->getelementsbytagname('*') $element ){ $e = array(); $e['tagname&

ios - Xcode 6.1 replace greyed out / not available -

Image
i'm trying use find / replace in xcode replace deprecated functions seems greyed out reason. i'm still finding way round xcode may simple, can't find it's unavailable? i'am using xcode 6.1, find&replace working fine me. type replace text , press return key when open, appears greyed out press return key after entering text

websphere "Application not installed" error -

i have strange error. trying install ear in websphere 8. after installation completed console, try start application , throws error. in system out logs, error "application not installed". stranger, when try go installedapps folder server, empty. have installed app many times before never encountered problem. point note here is new installation of websphere server (after previous server had crashed) you're deploying federated environment. deployment done on deployment manager (dmgr) node , saved master repository. have sync node (or wait happen periodicaly) propagate changes actual node on app should run. http://www-01.ibm.com/support/knowledgecenter/ssaw57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/uagt_rnodes.html?cp=ssaw57_8.0.0

ios - Lazy loading optional property that maybe nil later -

in objective-c, lazy init, can set @property nil , re-created when call getter . however, in swift, lazy modifier, doesn't work . tested code: class someclass { lazy var optionalvar: string? = { return "abc" }() func checkvar() { println(optionalvar!) } } let instance = someclass() instance.checkvar() //instance.variable = nil instance.checkvar() when variable set nil , not re-initialized. therefore, next line of code triggers run-time error. how can make swift code works in objective-c ? thanks. ---------------- edit: add more code class someclass { var optionalvar: string? func checkvar() { println(optionalvar!) } func createvar() -> string { if let tempvar = optionalvar { return tempvar } else { println("create optional") return "123" } } } let instance = someclass() instance.optionalvar = instance.cr

javascript - how to use element from pop up window in parent page -

this parent html <html> <script language="javascript"> function openwindow() { window.open("popups.html","_blank","height=200,width=400,status=yes,toolbar=no,menubar=no,location=no") } </script> <body> <form name=frm> <input id=text1 type=text> <input type=button onclick="javascript:openwindow()" value="open window.."> </form> </body> </html> this child html <html> <script language="javascript"> function changeparent() { window.opener.document.getelementbyid('text1').value="value changed.."; } </script> <body> <form> <input type=button onclick="javascript:changeparent()" value="change opener's textbox's value.."> </form> </body> </html> i need access element pop window(i.e child element). code above access element parent

java - ConcurrentModifcationException when adding value to hashmap -

the below code receiving concurrent modificationexception when 2 thread access same. i know whether whether exception can avoided if use concurrent hashmap. if use concurrent hashmap there issue in multithreaded environment. or there other way prevent exception? i donot intend use synchronzed code used during polling. 1 thread may have wait finish exceution. the code is hashmap<integer, mymodel> aservicehash = new hashmap<integer, mymodel>(); hashmap<integer, mymodel> rservicehash = new hashmap<integer, mymodel>(); (mymodel ser : seraccepted){ aservicehash.put(service.getoriginaldate(), ser); } (mymodel ser : serrequested) { if (aservicehash.containskey(service.getdate())) { aservicehash.put(serv.getdate(), serv); } else rservicehash.put(service.getdate(), ser); } referred http://examples.javacodegeeks.com/java-basics/exceptions/java-util-concurrentmodificationexception-how-to-handle-concurrent-modification-

html - Cannot align h2 inside a div container to the right side -

please check wordpress site: http://bit.ly/1fpv4iy i want align titles of articles thumbnail right side, title should stay on thumbnail image. i tried float , textalign h2 class, either didn't work or showed title beneath thumbnail image how can align text right? html code: <h2 class="entry-title" itemprop="headline"><a href="#" rel="bookmark">hatsune miku: project diva f extend</a></h2> css code .entry-title { font-size: 36px; margin-right: 0px; } add right: 0px; in class .postpreview h2.entry-title a

swagger - Display enum property of model definitions -

i trying display enum of model in model description. schema of model defined under definitions , uses enum action property, because 3 types allowed. (see code below) i using swagger version 2.0. in version 1.2 seems work: http://petstore.swagger.wordnik.com/ can find example under store/order. use enum , displayed behind property in model view. how can achieve same result new version? thanks help! "paths": { "/event": { "post": { "tags": [ "event" ], "summary": "add new event.", "description": "test", "operationid": "addevent", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ {

Python Sort a List containing sets -

any idea how sort list contains elements of type set ? code i'm using: sorted_by_second = sorted(result_list, key=lambda set: set[1]) example of how result_list looks like: [['past due', '32.86691794423967'], ['code', '23.24240338748313'], ['why:customer','27.65754595407057']] i sort list descending order according 2nd element in each tupple of list elements. sorted list result should like [['past due', '32.86691794423967'], ['why:customer','27.65754595407057'], ['code', '23.24240338748313']] i suggest use float map second element string number. allow sorted sort numbers. if don't use float , sorted sort second element strings. sorted(result_list, key=lambda x: float(x[1]), reverse=true) result: [['past due', '32.86691794423967'], ['why:customer', '27.65754595407057'], ['code', '23.24240338748313']]

Does it matter if the Disallow path is different from Drupal’s directory? -

i'm looking noindex tag pages i.e. http://example.com/tags/tabs http://example.com/tags/people etc. if add following robots.txt page (see: http://jsfiddle.net/psac2uzy/ ) disallow: /tags/ disallow: /tags/* will stop google indexing tag pages? even though paths aren't same drupal structure (since drupal keeps content in database)? note: can’t disallow indexing robots.txt, can disallow crawling ( related answer ). what matters actual urls users, among them search engines, see. don’t have access backend, don’t know how site works interally. the line disallow: /tags/ (no need other 1 * ) means urls paths start /tags/ should not crawled. so, assuming robots.txt @ http://example.com/robots.txt , block example: http://example.com/tags/ http://example.com/tags/foo http://example.com/tags/foo/bar if tags available under different url (for example, drupal’s default /taxonomy/term/… ), , bot finds these alternative urls, may of course crawl them.

ios - Upload files from dropbox/box account to a public cloud using an iphone app -

i need transfer files drop box account directly public cloud without downloading files , storing in application sandbox. apple allow this? i looking @ same , did not find it. should not due apple allowing or not; dropbox app not have function. e.g. send photo dropbox, sharing function sends link in apple mail. only possible solution exploring using airfile (not sure of other apps afaik now), clicking on sharing allows me open in other app (buggy 4 test nw) or send via email.. send via email sounds ok since can select photos in airfile, see actual pic in apple mail , send via flickr. hope idea helps!

jquery - How do I add a link into an HTML5 Video after a frame? -

i have html5 video wish display link on. when click said link video jump x number of frames further video. possible using javascript library such jquery? yes, possible. essential place javascript code in project: var myvideo = document.createelement('yourvideoid'); var curtime = video.currenttime; this creates 2 variables hold video element , video time. after have done suggest take @ this article dev.opera.com. in case need skip specific time on video. here's have do: var mylinkbt= document.getelementbyid('mylinkid'); mylinkbt.addeventlistener("click", function (event) { event.preventdefault(); myvideo.currenttime = 7 /* time here */; myvideo.play(); }, false);

Child fragment from onListItemClick within viewPager behaves unexpectedly -

i have 3 listfragments being handled viewpager (managed fragmentadapter) - work perfectly. when user clicks item in listfragment #1, new fragment should open details. it's behaving strangely in following manner: only clicking list item twice opens detailfragment, yet debugging shows first click indeed goes detailfragment, doesn't show view (the view still shows current listfragment). after clicking 2nd time, detailfragment show it's layout, not elements within (like textview, etc). if user 'accidently' swipes screen when detailfragment showing, viewpager sets in place of 2nd listfragment! when pressing on detailfragment view 'reset' viewpager it's correct listfragment. of course if user swipes when in detailfragment, next listfragment of viewpager should appear, , detailfragment should removed. thanks tips muddling through android's odd world of fragments , views :) public class planetfragment extends listfragment{ layoutinflater i

c# - How to bind ComboBox from ArrayList Values in asp.net? -

Image
but not fill properly i have mention such table , code image code : datatable dtusertype = new common().getusertype(true); datatable dtusertype 1= new common().getusertypebyuser(true); arraylist lstusertypeid =new arraylist(); lstusertypeid.addrange(dtusertype1.rows[0]["usertypeid"].tostring().split(',')); datatable dtdownlist = new datatable(); dtdownlist.columns.add("usertypeid"); dtdownlist.columns.add("usertype"); datarow dr; foreach (string s in lstusertypeid) { (int = 0; < dtusertype.rows.count; i++) { dr = dtdownlist.newrow(); //list of superior list if(s.tostring() != dtusertype.rows[i]["usertypeid"].tostring()) { dr["usertype"] = dtusertype.rows[i]["usertype"].tostring(); dr["us

Can't checkout new local branch after successfull git svn fetch -

i using git locally svn repository, script "git-svn" makes translation. have no choices since colleagues still using svn , don't plan on switching git. today wanted report commit on new remote branche, used command git svn fetch , got like found possible branch point: http://subversion.mycompany.fr/svn/svnroot/myprog/tags/10.225 => http://subversion.mycompany.fr/svn/svnroot/myprog/branches/br_10.225_prod, 58136 found branch parent: (refs/remotes/branches/br_10.225_prod) 184efd022c6930cb1890a5701b43ddcb1a2972df following parent do_switch followed parent r58137 = 36565c46d9e522268ebceeca30528bee088c3091 (refs/remotes/branches/br_10.225_prod) now wanted switch new branch used command git co br_10.225_prod . got error error: pathspec 'br_10.225_prod' did not match file(s) known git. i don't understand because not first time kind of operation, , used work easily. any hint? fixed old way, according this answer : git checkout -b br_10.2

c# - DbContext.Save on parent with child objects throws "Conflicting changes detected" -

i have parent/child hierarchy of want insert new parent dbcontext , have automatically persist child objects. relationship one-to-many, each parent can @ 0 or more columns. but whenever call dbcontext.save(parent) receive 'conflicting changes detected. may happen when trying insert multiple entities same key.'. when strip parent of child columns saves fines, i'm assuming related child objects not having primary key set. how tell entityframework save hierarchy properly? my classes: public class exceltemplate { public int id { get; set; } public string name { get; set; } public int firstdatarow { get; set; } public virtual icollection<templatecolumn> columns { get; set; } public exceltemplate() { columns = new list<templatecolumn>(); } } public class templatecolumn { public int id { get; set; } public int index { get; set; } public int metrictypeid { get; set; } public virtual metrictype metrictype {

java - Read Json file and Split the Tweet message and analyse -

public class tweets { private string name; private string username; private string time; private long followers; private long following; private int location; private string tweet; private double longitude; private double latitude; public tweets(string name, string username, string time, long followers, long following, int location, string tweet, double longitude, double latitude) { name = name; username = username; time = time; followers = followers; following = following; location = location; tweet = tweet; this.longitude = longitude; this.latitude = latitude; } public double getsentimentvalue() { return sentimentvalue; } public void setsentimentvalue(double sentimentvalue) { this.sentimentvalue = sentimentvalue; } public boolean ishaveisettheentimentvaluecalculateornot() { return haveisetthe

php - Multiplying number from XML gets rounded -

i pulling exchange rate yahoo's xml (euros dollars) think need multiply rate dynamic value. however, rate pulling not multiplying correctly. <?php $xml=simplexml_load_file("http://query.yahooapis.com/v1/public/yql?q=select%20%2a%20from%20yahoo.finance.xchange%20where%20pair%20in%20%28%22eurusd%22%29&env=store://datatables.org/alltableswithkeys") or die(); foreach ($xml->results->rate $item){ $eur2usd = $item->rate; } echo $eur2usd*2; // gives me looks rounded number "2" echo 1.2475*2; // when put in rate hand (1.2475) multiplication works = "2.495" ?> why simple math not working? edit - adding xml <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="1" yahoo:created="2014-11-27t11:45:32z" yahoo:lang="en-us"> <results> <rate id="eurusd"> <name>eur usd</name> <rate>

How do I convert number to words while looping in LESS? -

i exploring way convert numbers in words while looping through less. right have following code .margin(@n, @i:1) when (@i <= @n) { .space-@{i} { margin: 0rem+ @i ; } .space-@{i}-top { margin-top: 0rem + @i ; } .space-@{i}-bottom { margin-top: 0rem + @i ; } .margin(@n, (@i+1)); } .margin(2); which produces: .space-1 { margin: 1rem; } .space-1-top { margin-top: 1rem; } .space-1-bottom { margin-top: 1rem; } .space-2 { margin: 2rem; } .space-2-top { margin-top: 2rem; } .space-2-bottom { margin-top: 2rem; } however, wanted achieve class names space-one instead space-1 , on. how utilize array in less? thanks. see extract function. e.g. @names: one, two, three, four, five; .margin(3); .margin(@i: 1) when (@i > 0) { .margin(@i - 1); @name: extract(@names, @i); .space-@{name} { margin: @i * 1rem; } }

html - Can I add a class to a link -

all want add class link, change color of linked text. possible? isn't working me: <a href="mailto:xyz.co.uk" class="black_link">xyz.co.uk</a> .black_link a:link { color:black;} .black_link a:visited { color:black;} .black_link a:hover { color:pink;} .black_link a:active { color:pink; } thanks if targeting <a> tag globally use a:link { color:blue;} a:visited { color:black;} a:hover { color:pink;} a:active { color:pink;} if using class in <a> tag can in 2 ways. 1st a.black_link:link { color:blue;} a.black_link:visited { color:black;} 2nd .black_link:link{color:blue;} .black_link:visited{color:pink;}

wordpress - qTranslate auto redirection doesn't work for a single post -

default language web site ru. detect browser language turned on when user en language specified browser goes web site front page http://ivangrigoryev.com automaticly redirects him /?lang=en. but when user goes single post, example, via fb or typing url directly e.g http://ivangrigoryev.com/one-plus-one-review/ redirection doesn't occure. i've checked plugin conflicts - nothing @ all. wordpress version 3.5.1 qtranslate version 2.5.34 any suggestions? try re-saving permalinks, if not work install mqtranslate instead, fork of qtranslate (which no longer actively supported) https://wordpress.org/plugins/mqtranslate/ lots of bugs have been fixed , big improvement, best part is compatible qtranslate not loose of settings or translations.

c# - migrate Configuration Management Application Block .net1.1 to system.configuration -

i have migrate large .net 1.1 application .net 3.5. the system used configuration management application block (cmab) load config files starting app.config file as: <configuration> <configsections> <section name="applicationconfigurationmanagement" type="microsoft.applicationblocks.configurationmanagement.configurationmanagersectionhandler,microsoft.applicationblocks.configurationmanagement, version=1.0.0.0,culture=neutral,publickeytoken=e64cb664730084d3" /> <section name="myappsystemsettings" type="microsoft.applicationblocks.configurationmanagement.xmlhashtablesectionhandler,microsoft.applicationblocks.configurationmanagement, version=1.0.0.0,culture=neutral,publickeytoken=e64cb664730084d3" /> </configsections> <appsettings> <!-- key / value pairs --> </appsettings> <!-- ## configuration management settings ## --> <applicationcon

SQL Server, can SQL Server store 10 pieces of information of item in a row? -

i'm wondering if sql server can store 10 pieces of information of item in row? because want make table of date, item_name, quantity but want make in row input 1 date (ex. 21 november 2014) have item name such (chicken, rabbit, cow) have quantity of (2, 4, 3) can sql ?? if not, can recommend me, because want make daily report of items have sold on day , day before , on. can understand meant? cause i'm not english. you should this: table dates: dateid date 1 21/11/2014 2 23/11/2014 table items: dateid name quantity 1 chicken 2 1 rabbit 4 1 cow 3 2 dinosaur 666 dates.dateid should primary key and, depending on logic, perhaps identity (it autogenerates following id), , items.dateid should have foreign key dates.dateid . more info normalization here .

How to get the first occurrence ? regex python -

i have html tag: x=""" <div>ad</div> \n\n <div> correct value </div> <div> wrong value </div> """ i want corret value so search word ad followed </div> thing until <div> values until </div> i use code: re.findall(r'ad</div>.*<div>(.*)</div>',x,re.s) i use falg re.s because want dot match new line also. don't know how lines there between divs. use .* ! i think findall should return correct value , return wrong value . why ? search last div not first 1 ? because have greedy try lazy : re.findall(r'ad</div>.*?<div>(.*?)</div>',x,re.s) in example .* matching towards end , sees <div> , regex tracks , and startes matching again, similar second scenario, demo here : http://regex101.com/r/zy9xa3/1

regex - Regexp javascript and replace -

when test regex online (like http://regex101.com ), works fine. when test in javascript, doesn't. don't understand i'm doing wrong. var input = 'fzef zef zef zef (, ) dezdezfzef ezf ze'; input = input.replace('/\(\,?\s{0,}?\)/g', ''); console.log(input); thank you you need remove quotes around regex: input.replace(/\(\,?\s{0,}?\)/g, '')

php - ParseFloat a string and retain zeroes in decimal part -

i have problem, found javascript parsefloat , thats not solution need. i have f.e. string 48.453150 e , , need float number that, when use (float) , return 48.45315 , need retain zeroes @ end of decimal part. dont know, how many digits in decimal part, can various. is there way, parse float string , retain zeroes? when parse number float, it's not string, concept of trailing digits doesn't make sense. when want display number, use number_format($number, 5) convert string 5 digits after decimal point. include trailing zeroes.

c# - Limit WCF service calls to local clients -

i trying open wcf service local use only. i cant seem find way make listen on localhost (not allow remote connections wcf host) here example code : var baseuri = new uri("http://127.0.0.1:9001"); var webhost = new webservicehost(typeof(myservice), baseuri); webhost.addserviceendpoint(typeof(myservice), new webhttpbinding(), string.empty); webhost.open(); console.writeline("press key exit"); console.readline(); looking on resource monitor shows listen "unspecified ip". how can force listen on localhost ? you can set hostnamecomparisonmode on webhttpbinding exact , includes host name in endpoint matching. the hostnamecomparisonmode value indicates whether hostname used reach service when matching on uri. default value strongwildcard, ignores hostname in match. but using named pipes better in case. more info see msdn .

active directory - C# Error reading domains in different domain -

i have code works fine when logged onto domain: directorycontext context = new directorycontext(directorycontexttype.directoryserver, serverip, username, password); var forest1 = forest.getforest(context); using (var forest = forest.getforest(context)) { foreach (domain domain in forest.domains) { directoryentry dedomain = domain.getdirectoryentry(); messagebox.show(string.format("{0} {1} {2}", domain.name, dedomain.path, dedomain.guid)); } } and works fine when accessing domain not logged onto ie. connection goes through ok , forest.domains populated. the problem have whenever try access property of domain object (eg. domain.domainmode) 'unknown error (0x80005000)' - ideas?