Posts

Showing posts from July, 2011

ios - Unable to transfer app to another developer account -

Image
i'm looking transfer app button on itunes connect. after looking @ documentation , tearing hair out still can't see button says transfer app on app summary page. has ability been lost after apple hacked recently? apple undergoing massive update developer website. during update there several services cannot accessed including program enrollment , renewals , member center. checkout link see services online: apple developer system status i waiting website up-to-date can transfer app.

highcharts - Highstock area type comparison chart needs to display area fully -

i have comparison chart of "area" type. want 1 of series area , others line this ![intended comparison chart][1] https://docs.google.com/file/d/0b9cp3yk--vzsrdvruffhevhdqzq/edit?usp=sharing but using highstock i'm getting chart is there anyway draw area on chart. thanks in advance. edit:- have used following code $(function() { var seriesoptions = [], yaxisoptions = [], seriescounter = 0, names = ['msft', 'aapl', 'goog'], colors = highcharts.getoptions().colors; $.each(names, function(i, name) { $.getjson('http://www.highcharts.com/samples/data/jsonp.php?filename='+ name.tolowercase() +'-c.json&callback=?', function(data) { if(name == 'aapl'){ seriesoptions[i] = { name: name, data: data, type : "area" }; }else{ seriesoptions[i] = { name: name, data: data, ...

mysql - To get only first record from the group of employee -

Image
i have follwing data: emp_no emp_name login level hod_name assigend_ip loggedin_ip attendece_location shift_timing e31446 amit singh 09:39 direct p00212 172.29.23.53 172.29.23.53 cso-ackruti star-6f 09:30-18:30 e31446 amit singh 09:39 direct p00212 172.29.23.53 172.29.23.53 cso-ackruti star-6f 09:30-18:30 e39787 anita haridas shenoy 09:41 indirect e31446 172.29.24.38 172.29.23.55 cso-ackruti star-6f 09:30-18:30 e39787 anita haridas shenoy 09:41 indirect e31446 172.29.24.38 172.29.24.38 cso-ackruti star-6f 09:30-18:30 e39787 anita haridas shenoy 09:41 indirect e31446 172.29.24.38 172.29.23.55 cso-ackruti star-6f 09:30-18:30 e39787 anita haridas shenoy 09:41 indirect e31446 172.29.24.38 172.29.24.38 cso-ackruti star-6f 09:30-18:30 e37731 ramesh shukla 09:40 indirect e31446 172.29.23.43 172.29.23.43 cso-ackruti star-6f 09:30-18:30 e37731 ramesh shukla 09:40 indirec...

html5 - Sencha touch splash screen issue -

i'm working sencha touch application. in starting of application there 3 parts, 1.splash screen of iphone 2.white screen (that comes body tag of index.html) 3.application first page now, have issue splash screen , white screen. want remove white screen, display 1 single splash screen application first page. also, there slight white blink between splash screen , white screen. is there solution 2 issues ? i have tried different solution follow, 1. there solution remove iphone splash screen ? then, instead of white screen displayed splash screen of application. 2. or remove white screen , display directly application first page after splash screen. any appreciated. in advance. phonegap allows delay hiding of "native" splash screen moment application ready show something. check docs on splashscreen : for ios: the config.xml file's autohidesplashscreen setting must false. delay hiding splash screen 2 seconds, add timer such fo...

python - Exiting a function using only basic programming -

i working on assignment, , need exit function if value returns true. it's go fish game (you have been great far!) , i'm trying figure out how exit function. def targetplayer(player_number, phands,sdeck): """user inputs player choosing target player, returns target players number""" gameoverhands = gameoverhands(phands) if gameoverhands == true: **missing code here** return gameoverhands else: showmessage("turn: player " + str(player_number) + ", it's turn. ") if player_number == 0: ask = raw_input("who want ask? (1-3) ") while not ask.isdigit() or ask not in "123": etc .... return other_values i guess thing ask can have different return statements return value if if statement executed? gameoverhands saying have no cards in hand , game over, need somehow jump directly final function in game, whereas else stateme...

iphone - Not getting reachability Call back after coming from airplane mode -

brief: have ios app marked voip app in properties , have marked input , output streams voip. voip sockets connected on 3g, if go airplane mode , off, network unreachable call , not reachable call back. [it works fine in wifi] detailed: voip app pushed background , when airplane mode switched on [was in 3g], socket error , shortly network unreachable call back. when airplane mode switched off , expect reachability call indicate app network never comes. scenario works fine wifi or wifi , 3g. any suggestions?. this trips many developers. if application monitoring reachability changes, handler invoked when reachability change takes place if voip socket connected when application pushed background . question goes more detail issue.

ruby -- string interpolation from file\pattern -

i using ruby 1.9.3 , trying achieve string interpolation follows: declare , assign variable string value. read file has string interpolation "pattern". do string interpolation. for instance: params.txt "#{str}" test.rb str = "my string" content = file.open("params.txt", "r").read() puts("#{content}") #result in "#{str}" , not "my string", returns content of file how can achieve string interpolation? update example of tyring achieve: str = "my string" pat = '#{str}' puts(pat) # returns nil puts("#{pat}") # returns nil eval(pat) # returns nil eval("#{pat}") # returns nil this easier if use erb instead. params.txt : <%= str %> test.rb should like: str = "my string" erb.new("params.txt").result(binding) erb docs here .

search - searching an item in a multidimensional array in python -

i have multidimensional array in python. hello = [(['b', 'y', 'e'], 3), (['h', 'e', 'l', 'l', 'o'], 5), (['w', 'o', 'r', 'l', 'd'], 5)] and wanted find index of number 3, tried using hello.index(3) won't work. solutions? >>> [x[0] x in hello if x[1] == 3][0] ['b', 'y', 'e'] if need index of item, try >>> [i i, x in enumerate(hello) if x[1] == 3][0] 0 for multiple results remove [0] @ end: >>> hello.append((list("spam"), 3)) >>> hello [(['b', 'y', 'e'], 3), (['h', 'e', 'l', 'l', 'o'], 5), (['w', 'o', 'r', 'l', 'd'], 5), (['s', 'p', 'a', 'm'], 3)] >>> [x[0] x in hello if x[1] == 3] [['b', 'y', 'e'], ['s', 'p...

grails - Application wide map -

i want quartz job populate map (from web services call) on regular intervals , access map web layer (to display user). i thinking doing service (given service singleton), bit worried the recommendation not store state in service . class mapservice { def map = [:] } what best way this? if not worrying keeping data in memory while app running, can use concurrenthashmap in service , store data need. @ cache not reliable storage though. as said, services singleton only 1 instance of service ever exists , concurrentmap a hash table supporting full concurrency of retrievals , adjustable expected concurrency updates. ex: calss myservice() { concurrenthashmap cachemap = [:] def retrievecache(string key) { cachemap[(key)] } def resetcache(){ cachemap = [:] } def dosomething(){ .. cachemap.put(key,value) } } similar post

ruby on rails 3 - sphinxql: syntax error, unexpected IDENT -

getting error sphinx 2 sphinxql: syntax error, unexpected ident, expecting const_int or const_float or '-' near 'wi , published = 1 , sphinx_deleted = 0 limit 0, 10; show meta' index.html.erb error being thrown in template @ line of partial collection: @posts_by_state, 2 other instances of same partial working great. state sort throwing off. posts_controller.rb @posts_by_state = post.search(params[:search], with: { state: current_user.state, published: true }, :page => params[:page], :per_page => 10) post_index.rb thinkingsphinx::index.define :post, :with => :active_record indexes :title, as: :post_title indexes :desc, as: :description indexes tags(:name), as: :tag_name #indexes happening_on, sortable: true #has author_id, published_at has published_at has last_touched has state has published set_property:field_weights => { :post_title => 5, :description => 1, :tag_name => 10 } end string...

jsp - How to fix "Can not find the tag library descriptor" in eclipse 4.3 for my custom EL function -

setup: eclipse 4.3 tomcat7 (running on localhost port 8080) configured test server. my el class ( folder structure: http://i.imgur.com/ogosczm.jpg ) created using new => java project in eclipse package org.flinders.mycustomutilities; //import java.lang.stringbuilder; public class mycustomutilities { public static string hello(string name) { return "heya " + name; } } the class exported jar file , imported maven repository. it imported spring mvc project using entry in pom.xml : <dependency> <groupid>org.flinders.mycustomutilities</groupid> <artifactid>mycustomutilities</artifactid> <version>0.0.1</version> </dependency> i'm not getting errors in eclipse's maven pom editor. my tld file (stored in d:\work\eclipse\java.metadata.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\root\web-inf seems working folder tomcat) <?xml version="1.0" encoding=...

Android - switching intents, app crashes unexpectedly -

i'm beginner in android developing app has 2 screens , when try switch 1 app crashes can tell me why happening,is because of declarations on second class? i've added second class in manifest file , not seems problem here. main class goes this: public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final databaseh dh =new databaseh(this); final edittext ed1=(edittext)findviewbyid(r.id.edittext1); button b1=(button)findviewbyid(r.id.button1); button b2=(button)findviewbyid(r.id.button2); final string[] itemsn = new string[]{"cat","dog","mouse","fish"}; final listview listview = (listview) findviewbyid(r.id.listview1); final textview tv1 = (textview)findviewbyid(r.id.textview1); final arrayadapter<string> adapter = new...

rest - How to change Content-Type of GET-Request via firefox addon RESTClient -

Image
i want send get-requests shall answered rest-api. java programm supports text/plain , text/html , text/xml , application/json using jax-rs reference implementation jersey. to test different media types i'm using firefox addon restclient . change media type shall adjust header name=content-type , e.g. value=text/xml . but restclient returns text/html no matter content-type choose. way right modify returned result type is, uncomment html-section in code. text/plain returned media type, still content-type argument of restclient stays ignored. i'm using resent version of restclient, right 2.0.3. can please me? here java-code: import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.produces; import javax.ws.rs.core.mediatype; //sets path base url + /hello @path("/hello") public class restprovider { // method called if text_plain request @get @produces(mediatype.text_plain) public string sayplaintexthello() { return "hel...

php - Jquery UI Multi datepicker issue on retrieving dates -

Image
i using http://multidatespickr.sourceforge.net/#method-adddates enable multiple date select. works fine wondering how selected dates php. below html code. <input type="text" name="outgoing_call_dates" value="" id="outgoing_call_dates_id" class="hasdatepicker"> as can see value tag empty when add, appending end not value tag doing same. please check image. original source : http://multidatespickr.sourceforge.net/#method-adddates (example : input) please me find way html <input id="datepick" type="text"/> <input id="get" type="button" value="get" /> js $('#datepick').multidatespicker(); $('#get').on("click",function(){ var dates = $('#datepick').val(); if(dates !=''){ datastring = 'dates='+dates; $.ajax({ type:"post", u...

compiler construction - Is there a limit in the amount of temporary generated symbols during a project build using dmd 2.063? -

is there limit in amount of temporary generated symbols during project build using dmd 2.063? the limit in backend: it's possible instantiate 99999 temporaries right now. if need more, can raise 'name' declaration in symbol_generate function in symbol.c, , recompile dmd. i'm having same issue 2.063.2 right now!

Unable to send the total playtime while streaming an mp3 audio file using ASP.NET WEB API -

we have web service http://lullaby.shoresandbox.com/api/recordedsongs/stream/28 streams mp3 song. setting following headers. response.content.headers.add("content-disposition", filename); response.content.headers.add("content-length", fileinfo.length.tostring()); a sample url web http://source.adminprotools.net/partybangaz/pbang019tk15.mp3 when opened in firefox, song played , see total duration of song. unable see total duration when open our own song. appreciated. followed link stream song. i trying support streaming writing code. later realized same can achieved giving control iis. return url of static .mp3 file , leave rest iis server how stream it. working fine now.

css - Is a table layout appropriate for full-screen single-page HTML applications? -

there's a general consensus using tables layout in html should avoided . there exceptions every rule. designing spa ( single page application )—with pages resemble layout used desktop application. obviously html isn't equipped these types of pages, have little other choice. implementing these layouts divs pure hell, requiring mix of css tricks, hard-coded values , js calculations on resize events. i've asked this question implementing these layouts using grid framework. but stopped reconsider whether table-based layout might appropriate. typical criticisms don't seem apply unique case of spa: separation of content layout —since spa not content (it's skeleton ajax filled data), argument doesn't apply. interface; don't expect google index it. tables less maintainable —not in case. css hell have go through implement divs has higher maintenance cost. tables slower render —of course, complex layout creating using alternatives require more calculatio...

java - Android 4.3 jelly Bean Time format issue -

my date format "yyyy-mm-dd" , when month using function return me wrong format of month. example instead of "july" return me "j" here function: public static string getmonthname(string date) { date mdate = utils.parsedate(date); simpledateformat sdf = new simpledateformat("mmmmm"); string time = sdf.format(mdate); return time; } andy idea do? edit: , here parsedate(string date) function public static date parsedate(string date) { simpledateformat formatter = new simpledateformat("yyyy-mm-dd"); try { return formatter.parse(date); } catch (parseexception e) { e.printstacktrace(); return new date(); } } i think have 1 m m:1 mm:01 mmm:jan mmmm:january mmmmm:j

In netty what progress and total represents in progresive listener -

please explain one, progress , total variables represents in operationprogressed method of channelprogressivefuturelistener iterface, represents total no bytes transfered, following code , output results: channelfuture future = channel.writeandflush(bodyrequestencoder, channel.newprogressivepromise()); future.addlistener(new channelprogressivefuturelistener() { @override public void operationcomplete(channelprogressivefuture future) throws exception { // todo auto-generated method stub } @override public void operationprogressed(channelprogressivefuture future, long progress, long total) throws exception { system.out.println("progress : " + progress + " of total: " + total); } }); and console output: progress : 1 of total: -1 progress : 2 of total: -1 progress : 3 of total: -1 progress : 4 of t...

ios - Fields to be set in HTTP header -

i calling web service in ios. this, need set header in nsmutableurlrequest object. service takes 2 string parameters , returns data in json format. the fields need set in header (both while using get , post ) using setvalue:forhttpheaderfield: . we not need use sethttpbody: while using get .. right??? i had same question , resolved (using code iducool , ankit mehta) this... nsurl *theurl = [nsurl urlwithstring:@"yoururl"]; nsmutableurlrequest *therequest = [nsmutableurlrequest requestwithurl:theurl cachepolicy:nsurlrequestreloadignoringcachedata timeoutinterval:20.0f]; //specify method of request(get or post) [therequest sethttpmethod:@"get"]; //pass default parameter(like content-type etc.) [therequest setvalue:@"application/json" forhttpheaderfield:@"accept"]; [therequest setvalue:@"application/json; charset=utf-8" forhttpheaderfield:@"content-type"]; //now pass own parameter [therequest setvalue...

c# - Treeview adding duplicate nodes -

i have tree of depth of 2 follows. module 1 form 1 tab 1 form 2 tab 2 tab 3 form 2 tab 2 tab 3 module 2 form 4 tab 2 form 5 tab 4 tab 5 tab 6 form 5 tab 4 tab 5 tab 6 form 5 tab 4 tab 5 tab 6 as shown above, problem that, forms displayed many times tabs have. example, if form 5 has three tabs , displayed thrice. need them displayed once since tabs same. this code: private void loadtreeview() { string sql = "select module, form, tab, helptext " + "from pagehelp " + "where module not null"; datatable dt = public_methods.get_datatable(sql); dataview dvmodules = new dataview(dt, "module not null", "module asc", dataviewrowstate.unchanged); datatable dtmodules = dvmodules.totable(t...

android - How to keep widget configuration after phone restart? -

i want make widget app able dial number , user can set number when first drag , drop widget home screen using widget configuration.but when phone restarts widget uses default number again. decide save entered phonenumber shared preferences save , load user's phone number eclipse says using getsharedpreferences not allowed in onupdate.is there way perform it? what should do? my code: public class main extends appwidgetprovider { @override public void onupdate(context context, appwidgetmanager appwidgetmanager, int[] appwidgetids) { // todo auto-generated method stub super.onupdate(context, appwidgetmanager, appwidgetids); for(int i=0 ; i<appwidgetids.length ; i++) { sharedpreferences details = getsharedpreferences("operator", 0); int appwidgetid = appwidgetids[i]; string phnumber = "5554574"; intent intent = new intent(intent.action_call); ...

c# - how to make cell or column readonly using spreadsheetgear -

i using spreadsheet gear component , need select particular cells or columns in worksheet can apply read property . how do? example : if there 3 columns in excel sheet in 1 column should read rest of them editable ... try: protectcontents property of iworksheet + locked property of irange link spreadsheetgear reference

node.js - can I have different websockets input in the same server - output in different clients -

let me clarify title of question. on client side have 2 different html files, client1.html , client2.html . send data via websockets same server.js file, in node.js. on server side, if data came client1.html want perform query , send outcome client1.html . on same server, if data came client2.html want perform query , send client2.html message "data saved". i guess, have create 2 different functios in server.js . ok. but, problem is, on server side, how tell, data came client? also, how server can send right message right client? thanks in advance you have register clients. example if user on page client1.html send message (via websockets) example json (or other format like): { "user": "a", "page": "client1.html" } now on server side mark user/connection came client1.html . can add example custom property: conn.source = "client1.html"; or other way (depending example on framework). you m...

Draw over google map v2 android -

i created android app draw free shapes on google map v2. idea of app combines 2 apps, 1 draw free shapes , other normal google map v2 app. this link last question app , contains code the app works me have new problem. problem when draw line on specific location on map , convert control map , drag it, found line keep in place in view , map moves under line , leads line in location not location want. is there way make line steady in location draw in , when drag map line dragged location? hope got mean. for example if drawing line on mapview using canvas need x,y points of start , end point. then following code can change x,y points latitude , longitude. public boolean ontouchevent(motionevent event) { int x = (int)event.getx(); int y = (int)event.gety(); geopoint geopoint = mapview.getprojection().frompixels(x, y); } then resgister listener on mapvierw this. map.setoncamerachangelistener(new oncamerachangelistener() { @override ...

slf4j - Why is a Maven plugin failing with error messages about 'API incompatibility', 'foreign imports' and the 'maven.api Class realm'? -

i have spent better part of afternoon trying solve maven problem jetty plugin telling me wouldn't run because slf4j dependencies had incompatible api messageformatter.arrayformat(ljava/lang/string;[ljava/lang/object;)lorg/slf4j/helpers/formattingtuple [info] --- jetty-maven-plugin:9.0.4.v20130625:run (start-jetty-before-integration-tests) @ scala-spring-hibernate-maven-webapp --- [info] ------------------------------------------------------------------------ [info] build failure [info] ------------------------------------------------------------------------ [info] total time: 27.167s [info] finished at: wed jul 31 16:23:57 est 2013 [info] final memory: 12m/30m [info] ------------------------------------------------------------------------ [error] failed execute goal org.eclipse.jetty:jetty-maven-plugin:9.0.4.v20130625:run (start-jetty-before-integration-tests) on project scala-spring-hibernate-maven-webapp: execution start-jetty-before-integration-tests of goal org.eclipse.je...

What is web context in the following context (java ee tutorials) -

i reading java ee 6 tutorials pdf document official site. reading part related servlets, says: associating objects session can associate object-valued attributes session name. such attributes accessible web component belongs same web context , handling request part of same session. i wonder web context , how can different? the same web context means servletcontext, please refer seciton 7.4 binding attributes session of servlet 3.0 specification: a servlet can bind object attribute httpsession implementation name. object bound session available other servlet belongs same servletcontext , handles request identified being part of same session.

dynamics crm 2011 - Reference entity field name is empty in primary entity view CRM2011 -

Image
i have created many 1 relationship b/w location , appointment entities. creating view in appointment show appointments location names when this, location columns showed empty values. this view out of box. here add location name field in appointment view: any ideas why location name appearing empty in appointment view? thanks. you don't need special if want name. if location primary entity selected in specific lookup field on appointment record, called "location", add field appointment in view. you don't have explicitly fetch location record because although lookup stores guid of target record, crm interprets view mean want see primary field (name) of primary entity, not actual guid. see in lookup field on form same see in view. if want field other name, need choose primary entity in list, not via "regarding" relationship, whatever actual custom relationship called - "location"

Javascript Arrays - Find Duplicates -

this question has answer here: easiest way find duplicate values in javascript array 53 answers here question... given array populated numbers function parameter, produce resulting array contains duplicates number array. example, given array [ 1, 2, 4, 4, 3, 3, 1, 5, 3 ] should return [1, 4, 3]. bonus points return sorted array. i starting out javascript - know language however, using in correct way ( 1 should ) i'm still getting grips with. my pseudo code to: create array numbers above var numbers = [1, 2, 4, 4, 3, 3, 1, 5, 3]; then create empty array named "result" var result = []; create loop goes through var numbers check duplicates populate empty array "result" duplicates for (var = 0;i < numbers.length; i++) { //this i'm stuck... } i'm not sure within loop populate var result , throw in mix... given array has...

javascript - Issue with jquery select all option -

i have code here need in order make possible multiple selection. now, @ moment optionally, chose single selection or multiple selection, code below: <span>selection mode: </span> <select onchange="$('#dg').datagrid({singleselect:(this.value==1)})"> <option value="0">single row</option> <option value="1">multiple rows</option> </select><br/> selectoncheck: <input type="checkbox" checked onchange="$('#dg').datagrid({selectoncheck:$(this).is(':checked')})"><br/> checkonselect: <input type="checkbox" checked onchange="$('#dg').datagrid({checkonselect:$(this).is(':checked')})"> what can in order make multiple selectable? thanks.. remove that. in page's javascript file, or in embeded <script> block write: $('#dg').datagrid({singleselect:false});

objective c - GPUImage memory usage -

i noticed more use gpuimage, more memory app takes on time (using instruments monitor memory use). as example, use each filter in different methods: (uiimage*)toonfilter:(uiimage*)theimage { gpuimagesmoothtoonfilter *smoothtoonfilter = [[gpuimagesmoothtoonfilter alloc] init]; [smoothtoonfilter settexelheight:0.0025]; [smoothtoonfilter settexelwidth:0.0025]; return [smoothtoonfilter imagebyfilteringimage:theimage]; } (uiimage*)sketchfilter:(uiimage*)theimage { gpuimagesketchfilter *sketchfilter = [[gpuimagesketchfilter alloc] init]; [sketchfilter settexelheight:0.003]; [sketchfilter settexelwidth:0.003]; return [sketchfilter imagebyfilteringimage:theimage]; } (uiimage*)pixellatefilter:(uiimage*)theimage { gpuimagepixellatefilter *pixellatefilter = [[gpuimagepixellatefilter alloc] init]; [pixellatefilter setfractionalwidthofapixel:0.01; return [pixellatefilter imagebyfilteringimage:theimage]; } and h...

javascript - Can't remove cookies, which are generated by PHP -

here how create cookie in php , javascript php, before loading page, first create cookie via php . setcookie('my_key', $value, 0,admin_cookie_path); javascript. i'm using jquery cookie plugin. when dropdown changed, change cookie value. jquery.cookie("my_key", selected); in google chrome, works expected. the value of my_key cookie altered when dropdown changed. in firefox, generates identical cookie. yes, identical my_key cookie generated php: same name, same expire(browser session), same domain, same path, same httponly(blank), same security(blank) the difference new cookie set new value. i try jquery.removecookie('my_key') can delete new cookie. i'm not sure if bug of firefox, or did wrong. but, truly, annoying issue. update 1: it's true didn't specific path in javascript , right can change cookie generated php when set path. still not able delete cookie via js. fyi, i'm able delete cookies in php...

iscroll4 - Why does iScroll is bouncing back to initial position? -

i using iscroll , works until 1 point @ point scrolling area bouncing back. settimeout(function () { var gridscroll = new iscroll('iscroll-wrapper-grid'); }, 100); http://jsfiddle.net/hjakw/ ul { margin:0; } fixes problem. not sure why iscroll doesn't take margin account. maybe says in docs that.

python - Creating Period for Multi Quarter Timespan in Pandas -

many companies release quarterly financial data maps nicely pandas period: p = period('2012q1', freq='q-dec') which in filings labeled "three months ended march 31, 2012". however financial data released in form: "nine months ended september 30, 2005". how create period object "nine months ended september 30, 2005"? another way of expressing period "2005(q1-q3)". i asked: extract quarterly data multi quarter periods

Creating javascript regex tp replace characters using whitelist -

i'm trying create regex replace characters not in specified white list (letters,digits,whitespaces, brackets, question mark , explanation mark) code : var regex = /^[^(\s|\w|\d|()|?|!|<br>)]*?$/; qstr += tempstr.replace(regex, ''); what wrong ? thank you the anchors wrong - allow regex match entire string the lazy quantifier wrong - wouldn't want regex match 0 characters (if have removed anchors) the parentheses , pipe characters wrong - don't need them in character class . the <br> wrong - can't match specific substrings in character class. the \d superfluous since it's contained in \w (thanks alex k.!) you're missing global modifier make sure can more 1 replace. you should using + instead of * in order not replace lots of empty strings themselves. try var regex = /[^\s\w()?!]+/g; and handle <br> s independently (before regex applied, or brackets removed).

database - Will "where `id` in (...)" be comparable in performance with common "where" statement? -

the title tells all. let's say, have separate class, serves query processor in dsl. is, feed query in dsl, , runs query. this query processor talk whatever database connector library use , extract only ids of records matching criteria. this... let's "sets", of ids fed class actual orm on database , constructs domain objects records having ids. this way not need include query parsing abilities orm mechanics , have totally dumb method fetch records ids. as addition, let's suppose have types of caching imaginable, starting web page cache down dbms query cache. will scheme have bad performance compared traditional building of (sql or, maybe, mongodb-style) queries , running them on database directly? i understand require 2 queries per fetch operation, instead of one. question magnitude of difference. my overall goal separate interface queries interface of actual objects gotten queries. example, yii's cactiverecord s fail @ it, being combinatio...

c# - Difficulty in understanding class Property declaration -

this question has answer here: what bool? return type mean? 3 answers a curious c# syntax question mark 3 answers i going through class library in 1 of our projects. i came across statements public int? variablename what mean..i going create classes new application refering current application . so ,i know , in scenarios can use , not possible avoid it int? means "nullable". being nullable allows have null values in int. check out link if need understand bit more, http://msdn.microsoft.com/en-us/library/2cf62fcy%28vs.80%29.aspx how nullable types work in c#?

apache - redirect based on directory in path via .htaccess -

via .htaccess, how redirect this http://www.somedomain.com/de/foo to this: http://www.de-domain.com/foo the redirection should depend on second parameter, in example above "de". depending on server configuration should able on .htaccess somedomain.com . if works appropriately might try [r=301,l] make redirection permanent: rewriteengine on rewritecond %{http_host} ^(www\.)?somedomain.com$ rewriterule ^([a-z]{2})/(.*) http://www.$1-domain.com/$2 [r,l]

extjs4 - ExtJS 4.2.1 - Cannot get View instance from the controller -

in app have viewport 1 item, main view, simple class extending ext.container.container. i have main controller too, , i'm trying view instance, dynamically can push corresponding items if user logged or not. i've tried using views: ['mainview'], refs[ { selector: 'thextype' }], etc no luck. i using reference (ref) in sencha touch kind of things, can me extjs v4.2 ? just clarification, i'm not trying dom element, i'm trying view instance associated methods. thanks in advance, define xtype of view: xtype: 'mainview' and in controller: requires: ['...'] // view class // ... refs: [{ ref: 'mainview', selector: 'mainview' // xtype }] and can instance of view in controller this.getmainview()

ruby on rails - Send multiple files to a webservice -

i'm trying send multiple files webservice (and proceed, depending on response afterwards, that's not @ yet). following code sends 1 file: def show ... conn = faraday.new(:url => 'webservice.abc' ) |faraday| faraday.request :multipart faraday.adapter :net_http end payload = { :files => faraday::uploadio.new("#{rails.root}/fileone.xml", 'application/xml') } conn.post 'http://webservice.abc', payload @output = response.body end and i'm stuck, trying find way send 2 (or more) files @ once, necessary purpose of webservice compare these. seems when put them array, can't handled with. i'm looking way "bundle" files in order post them afterwards (as said before- works 1 file) tyia time thanks deepak, gave me hint right direction. should :files[i], though- payload line question reads: payload = { :files[0] => faraday::uploadio.new("#{rails.root}/fileone.xml", ...

c# - Toggle EF5 Connections During Runtime -

i've got project in ui have radio button list consists of 2 elements: development , production. in project i'm using ef5 model sprocs accomplish database ops. want create way use radio buttons toggle between development , production database servers during runtime cannot find way of doing this. need replace database server portion in connection string located in app.config. using transforms not appear option here. is there way can accomplish without having reconstruct ef connectionstring? you use dependency injection , have 2 dbcontext classes. based on radio button value, can determine dbcontext use. or in dbcontext constructor, pass in connection string use: public class mydbcontext : dbcontext { public mydbcontext(string connstringname) : base("name=" + connstringname) { } }

ssh - Reading netCDF files stored on a remote filesystem in R? -

i need read netcdf file r stored on remote filesystem. have ssh access filesystem, files big store onto local computer. i have tried advice here: can r read file through ssh connection? tried following: library(ncdf) d = open.ncdf(pipe('ssh hostname "path/to/file/foo.nc"')) however, keep getting error bash: path/to/file/foo.nc: permission denied any ideas on how fix this? it not possible open file directly within r using ssh, there few options available you. 1. mount remote server local filesystem on ssh. there packages let mount remote machines local filesystems on ssh; on linux, example, might use sshfs whereas on windows might use win-sshfs . once you've mounted remote file system, able access netcdf files r other file, although i'm not sure performance implications may be. ssh(sftp) filesystem windows: http://code.google.com/p/win-sshfs/ ssh filesystem: http://fuse.sourceforge.net/sshfs.html 2. break larger files down sm...

sql - How can I stop the delete on a parent if a child entity that references that parent exists? -

i have following ddl using sql server 2012: create table subject ( [subjectid] int identity (1, 1) not null, [name] nvarchar (50) not null, constraint [pk_subject] primary key clustered ([subjectid] asc) ) create table topic ( [topicid] int identity (1, 1) not null, [name] nvarchar (50) not null, [subjectid] int not null, constraint [pk_topic] primary key clustered ([topicid] asc) ) alter table [topic] check add constraint [fk_topicsubject] foreign key([subjectid]) references [subject] ([subjectid]) on delete cascade create table subtopic ( [subtopicid] int identity (1, 1) not null, [topicid] int not null, [name] nvarchar (4000) not null, constraint [pk_subtopic] primary key clustered ([subtopicid] asc) ) alter table [subtopic] check add constraint [fk_subtopictopic] foreign key([topicid]) references [topic] ([topicid]) on delete cascade when try run scripts following message: {"introducing foreign key cons...

iis express - How do I bypass the 'ports, protocols and domains must match' CORS issue whilst in development? -

i have local site running asp.net mvc 3 on http , https through iis express. the http url http://localhost:4000 , https https://localhost:44301 . i'm trying hook stripe payments api not port, protocol , domain mismatch. i've tried using cors tell trust stripe.com seems due port mismatch , cannot figure out how tell ignore that. adding following header not product difference. access-control-allow-origin:* when accessing payment page via http, following: blocked frame origin " https://checkout.stripe.com " accessing frame origin " http://localhost:4000 ". frame requesting access has protocol of "https", frame being accessed has protocol of "http". protocols must match. it gets worse when using ssl local ssl port not 443. how tell cors ignore port mismatch whilst in development? you can disable same origin policy while in development. load chrome following argument: --disable-web-security https...

asp.net mvc 4 - How to configure multiple sitemaps using MVCSiteMapProvider v4 with StructureMap DI -

the problem, essentially, can't sitemap config support multiple sitemaps. it's looking "default" when name instances , request another. background. i've been pouring on docs new implementation of mvcsitemapprovider. using dependency injection configure sitemapprovider. have existing structuremap di implementation, followed instructions , added, in our case objectfactory.configure(x => { ... x.addregistry<mvcsitemapproviderregistry>(); ... }); then started tweaking mvcsitemapproviderregistry.cs file implement multiple sitemap scenario. have multiple site map files, either work long it's called "default". if remove "default" item breaks , complains "default" missing. assume because can't find instance. here's how have them defined. suspect problem somewhere in here... loader says have configure in global.asax looking isitemaploader i'm adding multiple configuration sitemapbuilderset... anyway...

javascript - Replace d3.js symbols with images -

referring fiddle example : i need replace symbols images...or possibly single image @ first..like instance, image: https://github.com/favicon.ico what trying in code follows: vis.selectall("path") .data(nodes) .enter().append("path") .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) .append("image") .attr("xlink:href", "https://github.com/favicon.ico") .attr("x", -8) .attr("y", -8) .attr("width", 16) .attr("height", 16) .style("stroke", "black") .style("stroke-width", "1px") .call(force.drag); it appending image tag each of path tags, not showing image itself. hints? you're appending each image child of each path. want append group contains both path , image (which think asking in first com...

iis 7 - CA Certificate request failure - The RPC server is unavailable - DCOM was unable to communicate with the computer -

This summary is not available. Please click here to view the post.

asp.net - Unable to attach to application WebDev.WebServer40.exe Visual Studio has insufficient privileges -

unable attach application webdev.webserver40.exe visual studio has insufficient priveleges debug process. i getting following error when trying debug simple new asp.net web application. thanks help. i closed visual studio , killed visual studio processes. after restarted visual studio , worked me.

c# - Does the SQL Server CE engine have to be told the commandtype is text if that should be obvious? -

i've got code: using (sqlceconnection sqlconn = new sqlceconnection(@"data source=\my documents\\platypusdb.sdf")) { sqlconn.open(); string dmlstr = "insert platypus_settings (setting_name, setting_value) values(?, ?)"; sqlcecommand cmd = new sqlcecommand(dmlstr, sqlconn); cmd.commandtype = commandtype.text; //<-- necessary? cmd.parameters[0].value = settingname; cmd.parameters[1].value = settingval; try { cmd.executenonquery(); } catch (exception ex) { platypus.exceptionhandler(ex, "writesettingsval"); } } ...but don't know if commented line needed, bloatcode, or doesn't matter either way? ... don't know if commented line needed no. not because it's obvious because happens default. from msdn : property value 1 of commandtype values. default text. having said that, not bloat-code , might include it, make code little less ambigious read...