Posts

Showing posts from August, 2010

matlab - Neural network doesn't return values below 0.5 with logsig -

i want classify 2 classes neural network. since outputs 0 or 1, using (or trying t use) 'logsig' output function. problem when that, simulations end being between 0.5 , 1. if entering logsig function positive. ps: training set , testing set composed of normalized values. here do: t = [0.8*ones(1,50) 0.2*ones(1,50)]; %define net net = newff(trainset,t,n,{'tansig','logsig'},'trainscg'); net.trainparam.epochs = 100; net.trainparam.goal = 0; %train net net = train(net,trainset,t); %test net %%on testing set outputs = sim(net,testset)

javascript - what's the use of having plus sign infront of an expression -

eq: function( ) { var len = this.length, j = +i + ( < 0 ? len : 0 ); return this.pushstack( j >= 0 && j < len ? [ this[j] ] : [] ); }, i'm new programming in general, purpose of having single + sign infront of expression, i've seen these in jquery library lot. +(expression) these i'd understand, negative: -(1);// -1 it converts string number actual number in expression. console.log(typeof +"1"); // number console.log("1" + "1"); // 11 console.log(+"1" + +"1"); // 2 console.log("1.3" + "1.546"); // 1.31.546 console.log(+"1.3" + +"1.546"); // 2.846 quoting ecma 5.1 standard specifications + operator , the unary + operator converts operand number type. internally, javascript string converted number based on these rules specified in ecma 5.1 standards. edit: per number specifications, internal

jquery - javascript : image is not loading in internet explorer -

i trying load simple image using javascript, using following code function loadimage(src) { var image = new image; image.onload = function() { document.body.appendchild(image); }; image.onerror = function() { document.body.appendchild(document.createtextnode('\nerror loading image: ' + this.src)); }; image.src = src; } loadimage('http://www.linkedin.com/favicon.ico'); loadimage('http://www.facebook.com/favicon.ico'); fiddle link the problem facing whole thing working in chrome , firefox not working in internet explorer. not used javascript. any solutions ? ie not load ico image browser unless contenttype image/x-icon . i can confirm looking @ network tab in firefox contenttype linkedin image application/octet-stream explain why ie not show while facebook image has content type of image/x-icon ie likes. there nothing can browser other don't request image has type set on server. i'm quite

ios - Can I click tableview cell show picker? -

i establish tableview , want click direct cell show picker select. then selected value show in cell label component. but had try labelname.text = picker . or call picker in didselectrowatindexpath . it's not showing picker. my code below -(uitableviewcell*) tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"motdetetableviewcell"; cell = (motdetetableviewcell*)[tableview dequeuereusablecellwithidentifier:cellidentifier]; if( cell == nil ) { cell = [[motdetetableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; } cell.mottabletitlelabel.text = [tabledatasary objectatindex:indexpath.row]; if( indexpath.row == 0) { } else if ( indexpath.row == 1) { mylb = [ [uilabel alloc ] initwithframe:cgrectmake(_mottableview.frame.size.width -50

uiviewcontroller - iOS State restoration and UINavigationController modal views -

i trying incorporate state restoration in app. have working fine part, presenting navigation controller modal view on top of navigation controller seems challenging. for testing, created new split-view app on ipad, navigation controllers both sides of split view, , master , detail view controller each side, roots of respective navcontrollers. in master view, can click on button push new testviewcontroller onto navcontroller stack programatically. hook splitview in storyboard, add restorationids everything, opt-in delegate, provide restoration class , adhere uiviewcontrollerrestoration protocol testviewcontroller (since it's created programmatically) , works fine. if close app , retort it, start testviewcontroller pushed onto master's navcontroller. far good. i change button handler present testviewcontroller inside new uinavigationcontroller, present onto master's navigation controller, show modal view (instead of pushing on nav stack). now, when relaunch app, there

iphone - How to upgrade your project for ios 3.0 to ios 6.0 onwords -

Image
right working on non-arc project ios3.0. haven't designed interface builder. coded both landscape view , portrait view separately. problem when try add same image background of screen, appears cropped. enabling auto resize subviews gives me error. when try set views portrait , landscape view, doesn't work. one more thing, project developed ipad. if want done iphones, should have start scratch separately iphone because of above mentioned problems ? please suggest me if upgraded app support 64 bit ipad retina. thanx in advance make project universal changing setting shown in image below. better drop support ios 3 nobody uses anymore , support ios 6 , above. give more options , flexibility regarding frameworks , layouts. to support 64-bit devices have build ios 5 or higher minimum supported ios version. best practice support 2 latest releases (ios 6 , 7 @ moment) ios users update devices fast after each os release.

javascript - going to first div after scroll going to top of the last div -

i have problem scrolling. when clicking on <a href="#" id="display" class="display">next</a> tag, page scrolls next div . when scrolling top of last div , clicking "next", must go top of first div , doesn't. demo modified code: if (t === 'next' ) { if($('.current').next('.section').length==0) var $next = $('#one'); else var $next = $('.current').next('.section'); } working demo

javascript - How to use create event on a jQuery dialog in following scenario? -

i've have following dialog pop-up html hidden when page loads(look line style="display:none;" in div ): <div id="searchpopcontent" class="c-popup" style="display:none;"> <div id="pop-up"> <div class="error_msg" id="report_error" style="text-align:center; margin-top:5px;"> </div> <div class="clear"></div> <form name="question_issue_form" id="question_issue_form" class="login_box" method="post" action="question_issue.php"> <input type="hidden" name="form_submitted" id="form_submitted" value="yes"/> <input type="hidden" name="post_url" id="post_url" value="question_issue.php"/> <input type="hidden" name="op" id="op&

I am having a Trouble to check if that param is empty or not on ruby on rails -

i trying check if user_avatar present or not form(submitted user).if select different image update need go cropping otherwise redirect edit page. but if run bellow code on controller directly redirecting edit page if select , send image also. controller if @user.update(user_params) if((@user.user_avatar.present?) && (!params[:user_avatar].blank?) ) format.html { render :action => 'crop'} else format.html { redirect_to edit_user_path, notice: 'user updated.' } format.json { head :no_content } end else format.html { render action: 'edit' } format.json { render json: @user.errors, status: :unprocessable_entity } end def user_params params.require(:user).permit(:user, :crop_x, :crop_y, :crop_w, :crop_h, :user_avatar, :fname, :lname, :city_id, :location_id, :email, :password, :course, :phone_no) end in rails can use has_key? method returns true or false , rewriting above if conditio

Extending a struct in C -

i came across colleague's code looked this: typedef struct { int x; }a; typedef struct b { a; int d; }b; void fn(){ b *b; ((a*)b)->x = 10; } his explanation since struct a first member of struct b , b->x same b->a.x , provides better readability. makes sense, considered practice? , work across platforms? runs fine on gcc. yes, work cross-platform, doesn't necessarily make idea. as per iso c standard (all citations below c11), 6.7.2.1 structure , union specifiers /15 , there not allowed padding before first element of structure in addition, 6.2.7 compatible type , composite type states that: two types have compatible type if types same and undisputed a , a-within-b types identical. this means memory accesses a fields same in both a , b types, more sensible b->a.x should using if have concerns maintainability in future. and, though have worry strict type aliasing, don't believe applies here. is illegal al

r - Label on X-axis for each group of points -

Image
i'm creating script allows me data database, , visualises in graph. as can see, there 8 groups of data, indicated on x-axis. each group contains 90 values. right now, place of labels hard-coded this: axis(1, @ = c(31.25, 93.75, 156.25, 218.75, 281.25, 343.75, 406.25, 468.75), labels = c("ss oligo 1", "ss oligo 2", "ss oligo 3", "ss oligo 4", "ss oligo 4", "ss oligo 5", "ss oligo 6", "ss oligo 7")) it works fine, wondering if there way more dynamically, telling r assign label each set of 90 values. example: # generate data ################################################################################### x <- vector() y <- vector() # y[length(y)+1] <- sample(10:12, 1, replace = true) oligo_1 <- runif(62, 10.5, 11.5) oligo_2 <- runif(62, 14, 15) oligo_3 <- runif(62, 17, 18) oligo_4a <- runif(64, 20.5, 22) oligo_4b <- runif(64, 20.5, 22) olig

ios - SpriteKit texture not visible -

i'm developing game there characters number of animations, play when user uses game controls moving, fighting, etc. there normal state, i.e. when user not touching control, player's character's texture has been assigned normal state or resting state texture. if user exercises these controls quickly, player's character's texture disappears when goes normal state. if of controls used however, animations visible. can me issue? appreciated. i have displayed of basic programming structure have used below. //------------------------------------------------------------------------- *// 'normal or resting' state texture.* skaction *normalstateaction = [skaction settexture:normalstatetexture]; *// play character animation walk, fight, jump, etc.* [playercharacter.sprite runaction:[skaction sequence:@[charanimaction,normalstateaction]]]; *// in 'touchesended' method game control.* -(void)touchesended { // remove previous actions.

collecting images from website in python 2.7 -

i'm not geting why syntax error here on line 17: parsed[2] = image["src"] then on line 18 : outpath = os.path.join(out_folder, filename) then 19 also: urlretrieve(urlparse.urlunparse(parsed), outpath) this : filename = image["src".spilit("/")[-1] should : filename = image["src"].split("/")[-1] ## spell corrected , square bracket added.

ruby on rails - undefined local variable or method `has_paper_trail' -

i having trouble paper_trail gem. love using , has nice features. works fine when run server in development , test environments, displays " undefined local variable or method `has_paper_trail' " error when start run server in production environment. couldn't able figure out. please? check configuration : if defined in /config/application.rb bundler.require(*rails.groups(:assets => %w(development test))) change : bundler.require(:default, rails.env)

algorithm - How do I get the row and column of a table with indices. -

i have table has x columns indexes ordered horizontally: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 and table x rows indexes ordered vertically: 0 5 10 15 1 6 11 16 2 7 12 3 8 13 4 9 14 with formulas row , column number of index in these 2 cases? for first table, row = num / x , col = num % x . for second table, indices swapped: row = num % x , col = num / x . here, / stands integer division (rounded down) , % taking remainder of division.

Checkpoints not restarted after the point of failure in SSIS -

i have package 1 execute sql task , 1 dft. inside dft loading data text file emp table. my text file data has 9 records 1, india 2, pakistan 3, afgha 4, asia 5, 6,europe 7, australia structure of table id int not null, name varchar not null i have set required checkpoint properties dft checkpoint filename -- given checkpoint usage--ifexists save checkpoints -- true failpackage on failure-- true now issue when run package data gets loaded table first 4 records , package fails, , checkpoint file created. next time when restart package, after making changes text file, replacing null value data. 5, england instead of loading data 5th record, records gets loaded table. actually, since had failure after 4th record, after restarting package , want data 5th record instead starting. set dft transaction option required

node.js - Continuous Deployment using Codeship -

Image
i'm using code ship deploy node.js project in heroku .i'm dong using this tutorial.i have setup git repository node js project in bitbucket . in 1 step ask hook codeship bitbucket.i have done it.but message keeps on coming , out going next step.please me out this. when push new commit bitbucket repository, trigger first build , message disappear.

Locking on SQL Server -

we have table on have implemented queuing system using locks selct top 1 ... (with (updlock, readpast)). it's been working until when added column table has fk relationship first table. must add in query uses locks, join on second table. now after adding column, seem getting frequent locks , timeouts when query run. is possible related new column? can done resolve? we using telerik orm run stored procedure. if you're joining on table you'll want table hints on 1 too. there other transactions hitting other table? if increases chance of deadlock. for implementing queue in sql server table i've found this answer reference, suggests with (rowlock, readpast, updlock) . it's possible you're getting lock escalation beyond row, cause issues you're seeing. try adding hint , see if resolves things. ensure have row locking on other queries hitting table or referenced table.

c# - Passing method with list of base type in return type as a parameter causes wrong method signature error -

i'm trying create generic method filter results several method returning lists of types deriving same base type. prepared simplified version of problem: using system; using system.collections.generic; using system.linq; public class animal { public string name { get; set; } } public class cat : animal { } public class dog : animal { } public class program { public static void main() { console.writeline(getfilteredanimals("pe", getcats)); } private static list<cat> getcats() { return new list<cat>() { new cat { name = "sphinx" }, new cat { name = "persian" } }; } private static list<dog> getdogs() { return new list<dog>() { new dog { name = "bulldog"}, new dog { name = "dalmatian" } }; } private static list<animal> getfilteredanimals(string f, func<list<animal>> method) { var animals = method();

git - Work with multiple branches locally but pushing once -

is there way work locally on different branches, commiting, merging, checkout, etc. without pushing? work in different branches in project, push @ once , correct branches. for example: merge branch1 branch2 checkout branch3 few commits in branch3 checkout branch2 few commits in branch2 now push correct branches done thank you. there's nothing forcing push before want (assuming have solution remote backup). so yes, can work in various branches , push when you're ready publish work other users.

c - How do I access a function variable from main() -

i'm attempting use character compare function in main() while ignoring case sensitivity. there way call toupper(ch1) , toupper(ch2) main if -i (for case insensitivity) raised can reuse code. int charactercompare( file *file1, file *file2, char file1name[], char file2name[] ) { int ch1, ch2; int differ = 0; { ch1 = fgetc( file1 ); ch2 = fgetc( file2 ); differ++; if ( feof( file1 ) && !feof( file2 ) ) { printf( "eof on %s\n", file1name ); return 1; } else if ( feof( file2 ) && !feof( file1) ) { printf( "eof on %s\n", file2name ); return 1; } if (ch1 != ch2) { printf( "files differ: char %d\n", differ ); return 1; } } while( ( !feof( file1 ) ) && ( !feof( file2 ) ) && (ch1 == ch2) ); printf( "files equal\n" ); return 0; } long answ

How to change the default recipient address while scheduling a report in business objects? -

i working sap businessobjects web intelligence xi version:12.5.0 build:1190. in scenario want send report many receipients. dont know edit default recipient settings. can me this. from infoview can set recipients particular scheduling run. click on "formats , destinations" tab, select format , destination (inbox, file location, ftp, or email), click on "destinations options , settings" choose recipients. to set default recipients (or other scheduling options), must use cmc. report's properties, there default settings tab. set default scheduling settings here (this action not create schedule). now, when schedule report (either cmc or infoview), reflect default settings have chosen. note set default settings apply anyone schedules report, not you.

cql3 - Spark + Cassandra. Compound key with clustering order problems -

i have c* column family store events-like data. column family created in cql3 in way: create table event ( hour text, stamp timeuuid, values map<text, text>, primary key (hour, stamp) ) clustering order (stamp desc) partitioner murmur3 partitioner. tried build spark query data through calliope library. in results receive 2 problems: in case there more 1000 records clustering key ('hour' field), response contains first 1000 records per key. can increase page size in query receive more data, far understand must task of paginator go through data , slice it. i receive each record more once. about first problem answer calliope author cql3 driver must paginate data. recommends me read datastax article . can't find answer how build query right instructions driver. about second problem found issue hadoop connector in cassandra < 1.2.11. use c* 2.0.3 , rebuild spark required version of libraries. use calliope version 0.9.0-c2-ea. could point me d

javascript - User interest Search based on Profile -

i have user login page profile page search page (keywords entered here,results fetched , published using google) i use javascript performing search , profile, login page created based on php have profile page user interests listed, doubt ,i need perform search based on user interest stored in profile page. for example ,if search in google ex: "sun" ,the results related sun ,solar system ,planets .. for instance in user interest ,there category "favorite news paper :" , answer "sun news report" ..so whenever user searches "sun" ..it should give high priority user interest rather general google search results how can ,if there kind of code snippet there ,please me regarding concept. its trick works fine @ myside. there 1 input text can take value db also..its choice. have call 1 function redirect google..this search on google watever have type in input text.. if want can append more string in want add category (news pape

google cast - Mirroring Android screen on Chromecast -

is possible mirror android device screen chromecast device? if so, can refer me code samples? thanks. i realize old post, chromecast mirrors android 4.2+ now. use displaymanager , presentation apis detect display , display different content onto mirrored display.

javascript - Increase size of DropDownList in IE? -

i have dropdownlist being populated database on asp.net webform. items of dropdownlist expand according length of items in chrome , mozilla. in ie items of dropdownlist cut off. i tried ... var el; $("select") .each(function() { el = $(this); el.data("origwidth", el.outerwidth()) // ie 8 can haz padding }) .mouseenter(function(){ $(this).css("width", "auto"); }) .bind("blur change", function(){ el = $(this); el.css("width", el.data("origwidth")); }); which found http://css-tricks.com/select-cuts-off-options-in-ie-fix/ but doesnt seem working. help!

c++ - Program File (x86) when checked for dwfileattributes Returns a value 73745. I need help to know what combination adds up to this value? -

win32_find_data findfiledata; . . . . if(findfiledata.dwfileattributes == file_attribute_directory) { . } this failed program files , found online combination of file_attribute_directory + file_attribute_readonly , not file_attribute_directory . need program files (x86)? use if((findfiledata.dwfileattributes & file_attribute_directory) == file_attribute_directory) { } that way check if file_attribute_directory 1 of flags, instead of if flag .

angularjs - changing the list and detail view templates ng-view -

i want load template in main page, list , detail view example, can stateprovider or have use routeprovider ? how can import template there not changing link? app.config(function config( $stateprovider ) { $stateprovider.state('inventory',{ url:'/inventory', views: { "main": { controller: 'inventoryctrl', templateurl: 'inventory/main.tpl.html' } }, data:{ pagetitle: 'inventory' } } ).state('add',{ url:'/inventory/list', views: { "main": { controller: 'inventoryctrl', templateurl: 'inventory/add.tpl.html' } }, data:{ pagetitle: 'list field' } }); }); template <li data-ng-class="{active: listviewenabled}" class="toolbaritem"><a href="#/inventory/list"><span class

c# - How to CRUD Application Users in ASP.NET MVC 5 with Scaffolding? -

from experience, can generate controllers , views crud using entityframework(mvc 5 controllers views, using entityframework) job , other classes not derived identityuser. want have feature in application user of role admin able delete other users in same user table. how can generate controllers , views using ef ? appreciated. thank you! public class user : identityuser { public string firstname { get; set; } public string lastname { get; set; } public icollection<job> jobs { get; set; } } public class job { public int id jobid {get; set;} public string jobdetails {get; set;} public bool isdone {get; set;} public virtual user user {get; set;} } public class applicationdbcontext : identitydbcontext<user> { public applicationdbcontext() : base("defaultconnection") { } public dbset<job> jobs { get; set; } } } there pretty blog posts around, talking specific topic. i'll give quick headsup

java - Classloader loading wrong log.properties file -

i have ear contains multiple jars out of 2 of jar contains "log.properties" for eg: in abc.jar, "log.properties" in com.abc.test , in xyz.jar, "log.properties" in com.xyz.test in both package have logger implementation load "log.properties" this.getclass().getclassloader().getresourceasstream("log.properties"); due classloader loads other jar first pickup "log.properties" i want avoid problem suggestions ? use classloader.getresources(string name) , write code filter out urls not in same package class. place code in utility or resource manager class , use everywhere in project.

c++ - incompatible pointer type warning in c? -

uint32 measurements [32]; xcp_addr_t xcpapp_convertaddress( uint32 address, uint8 extension ) { return &measurements[address]; //return incompatible pointer type } address value recieving client (example : 0,1,2.....). above function return address of measurement other internal function. getting warning below : return incompatible pointer type could tell me how solve ? it depends on type of xcp_addr_t . expression is: &measurements[address] . type of expression convertible uint32* . if return type uint32 in disguise, remove & operator. if return type different, rethink doing. so typedef is: typedef uint8* xcp_addr_t; as can see uint8* (of return type) , uint32* (the returned value's type) don't match. can either change return type or type of array measurements to: uint8 measurements[32]; ok, want ensure xcpapp_convertaddress returns valid pointer (without going out of bounds). have 2 choices: assert it throw except

asp.net - need to remove HTML tag from string in C# -

i having this(sample) html stored in database string <div> test </div> <ul> <li> link1 </li> </ul> now, contain <link rel="canonical" href="http://sample.com/somelink"> i check if string contains link rel tag replace href else. , if not have link rel tag add new one. also, when load string in cms, see if exits, extract href string, , display somewhere on page separate stirng. please help. have googled did not find helpful solution hence no code in question. not familiar regex. note: sorry, forgot mention can not add external lib project because of pci implication . you should use html agility pack, http://htmlagilitypack.codeplex.com , in combination xpath selection of elements , attributes htmlagilitypack.htmldocument doc = new htmlagilitypack.htmldocument(); doc.loadhtml(htmlstring); foreach(htmlnode link in doc.documentelement.selectnodes("//a[@href , @rel]") {

textbox - Insert a numeric input for each row - R Shiny -

i have complex code generates big matrix, here attach simple, reproducible example in order explain want: here's code: # ui.r library(shiny) shinyui( mainpanel("table output", (tableoutput("my_table"))) ) # server.r library(shiny) shinyserver(function(input, output, session) { my_table = matrix( c(1:100), nrow=20, ncol=5) output$my_table <- rendertable(my_table) }) my goal put on left , right sides of table small textbox, one each row of table. in idea need able write number inside left textbox, on right textbox , calculations on row, based on number manually inserted. of course length of table vary therefore need use dim(my_table) in order put 1 small textbox each row, 1 on left side , 1 on right. thought use r shiny's numericinput function can't clue on how apply in scenario. can r shiny functions or forced use html ui.r ? any appreciated, thanks. you can bind matrix 2 vectors

spring web application jboss as 7.1.1 performance optimization -

i deploying spring mvc 3.2.3 web application in jboss 7.1.1 in standalone mode. communicating jboss server hosting webservices. interestingly if call jax-ws webservice soap amount of data returs in 0.6 seconds. but code same data in 3 seconds. there nothing in between service call @ least coding point of view causing time. apart that, after retriving data , show them in webpage taking more time. have included following line in java_opts in standalone.conf.bat file set "java_opts=-xms512m -xmx1024m -xx:maxpermsize=512m -xx:maxheapsize=1024m" it great know should done increase speed. my machine has 3gb of ram. core 2 duo machine, 32 bit windows 7 os. recently felt need optimize our jboss performance. researched alot , found following info if out: the default memory page size in linux 4kb. when you’re allocating lot of memory application, results in many different pages being managed – , thus, performance loss in managing many different pages. i did be

matlab - play an segments of audio file and synchronise with moving line on graph -

i m having audio wav.i plot graph of audio wav vs time of audio wav. have points ex: 4 points .i plotted vertical line on graph @ 4 points. 4 points on graph made 5 segment.audio file start time 1,and end time 10; a=[1 4 7 9]; s= start-time end-time s1 1 4 s2 4 7 s3 7 9 s4 9 10 now want play segment @ same time line should move synchronously start-time of segment , stop @ end-point of segment.

android - Wake up waiting thread on touch event from activity? -

i have thread wating ontouchevent() private runnable disconnectcallback = new runnable() { @override public void run() { // perform required operation on disconnect runonuithread(new runnable() { @override public void run() { // todo auto-generated method stub toast.maketext(getbasecontext(),"your session expired please login again",toast.length_short).show(); try { wait(); } catch (interruptedexception e) { e.printstacktrace(); } final logout l=new logout(); l.setcontext(ac2.this);// passing context of ac3.java logout.java l.execute(sessid,uname); } }); } }; what want notify waiting thread when user touches mobile screen.. private runnable disconnectcallback = new runnable() { @override public void run() {

Excel VBA Can you set DataObject as text from File? -

is there way contents of text file , add clip board? i thinking along lines of setting contents of dataobject contents file , adding dataobject clipboard. is can excel vba? this code using data txt file in correct format. however, require in clipboard can paste it. with ws2 open "c:\users\peter.carr\documents\new action plan\copytest.txt" append #1 lastrow = .cells(.rows.count, 1).end(xlup).row lastcol = .cells(1, .columns.count).end(xltoleft).column = lastrow 2 step -1 str1 = "" print #1, ws2.cells(i, 1).value & ") " & ws2.cells(i, 2).value print #1, each cell in .range(.cells(i, 6), .cells(i, lastcol)) g = - 1 if cell.column <> 4 , cell.column <> 5 , cell.value <> "" , cell.value <> "new action" print #1, cell.value print #1, "(" & cell.offset(-g, 0).value

regex - remove whitespaces and blank spaces in next line -

i've below piece of code. <sup><a name="f31" href="#ftn.31" class="tr_ftn"> 31</a></sup> here want replace space between closing tag , number, output should below. <sup><a name="f31" href="#ftn.31" class="tr_ftn">31</a></sup> the regex i'm using class="tr_ftn">\n* but taking full next line. please let me know how fix it. thanks i forgot how different visual studio 2010 expressions are . can use: class="tr_ftn"\>:wh*:cc*:wh* that match class="tr_ftn">, followed number of spaces, number of newlines, , spaces. if match want replace with: class="tr_ftn"> for visual studio 2012 use match: class="tr_ftn">[\r\n\s]*

MYSQL - UPDATE first char of string in COLUMN -

i update first char of column in mysql where format of string '1-%' change first char '0'. i have created example , think on right tracks... update products set has_roundel = replace(has_roundel, substring(has_roundel, 0, 1),'0') has_roundel '1-%'; mysql substring isnt starting 0. you can use: update products set has_roundel = replace(has_roundel, substring(has_roundel, 1, 1),'0') has_roundel '1-%'; or: update products set has_roundel = replace(has_roundel, substring(has_roundel, 1),'0') has_roundel '1-%';

rdf - Geonames API add new name -

i started integrate geonames in rdf. use web services search informations places, browsers gui add new names. there way send lat,lng coordinates , create new name automatically? edit: have kml files. want use coordinates value create new elements in geonames ( http://www.geonames.org ). have "manually", going on map , giving "insert new name here" command. read information geonames there web services ( http://www.geonames.org/export/web-services.html ), didn't found nothing insert new elements.

How to compile a dart polymer project -

i written website using dart , polymer, runs in chromium, cannot compiled js. the directory layout like: my_proj/ pubspec.yaml (contents below) lib/ some_code.dart ... (used index.dart, app.dart , custom_elem_x.dart) asset/ 3rd-party codes ... (css, js lib, etc.) web/ index.html (traditional html, no polymer stuff) app.html (use lots of custom elements written in polymer) script/ index.dart (pure dart, nothing fancy, has main()) app.dart (has main(), in initpolymer() called) polymer/ custom_elem_1.html (imported app.html via \ custom_elem_1.dart <link rel="import" href="polymer/custom_elem_1.html">) ... custom_elem_n.html custom_elem_n.dart pubspec.yaml: name: blah dependencies: browser: polymer: ... transformers: - polymer: entry_points: web/app.html - $dart2js: minify: true if run pub build unde

jquery - Zurb Foundation Mobile Menu Does Not Work with Wordpress -

i tried lot, can't figure out, why wordpress not let menu work. in static version works fine. implemented in wordpress, reason, files loaded not executed. without error message. i uploaded local theme , static version here: wordpresstest <-- not working dynamic wordpress version wordpresstest2 <-- working static version i read somewhere, wordpress, loads jquery in noconflict mode, , should modify foundation.js in way, compatible wordpress. have no idea, right now. add js jquery(".has-dropdown").hover(function(){ jquery(".top-bar-section .dropdown").css("display","block"); });

Execute maven plugin goal on specific modules -

i have following situation: masterpom.xml: ... <modules> <module>sample-module</module> </modules> ... <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>versions-maven-plugin</artifactid> <version>2.1</version> <inherited>true</inherited> <executions> <execution> <id>update-parent</id> <phase>pre-clean</phase> <goals> <goal>update-parent</goal> </goals> <configuration> <parentversion>4.4.2.1</parentversion> </configuration> </execution> </executions> </plugin> ... i execute versions-maven-plugin 's update-parent goal on every module listed between <modules> , </modules> . how can that? configuration tried doesn't work, becaus

wpf - How to change Dateformat -

how change date format of viewmodel's datetime type property using clture. using below code change culture. cultureinfo newculture = null; newculture = (cultureinfo)thread.currentthread.currentculture.clone(); newculture.datetimeformat.shortdatepattern = "dd/mm/yyyy"; newculture.datetimeformat.dateseparator = "/"; if (newculture != null) { thread.currentthread.currentculture = newculture; thread.currentthread.currentuiculture = newculture; } view's datetimepicker format has been changed in viewmodel's property format not reflect. appreciated. below property. private datetime _fromdate = datetime.now; public datetime fromdate { { return _fromdate; } set { _fromdate = value; onpropertychanged("fromdate"); } } if check value of fromdate in backgroundworker use same format of

iphone - SDWebImageManager issue -

sdwebimagemanager *manager = [sdwebimagemanager sharedmanager]; [manager downloadwithurl:imageurl delegate:self options:0 success:^(uiimage *image, bool cached) { _newsimage.alpha = 0.0; [uiview transitionwithview:_newsimage duration:3.0 options:uiviewanimationoptiontransitioncrossdissolve animations:^{ [_newsimage setimage:image]; _newsimage.alpha = 1.0; } completion:null]; }failure:nil]; i using code download images through sdwebimage library , geting error no visible @interface 'sdwebimagemanager' declares selector 'downloadwithurl:delegate:options:success:failure:' may not use proper sdwebimage. download sdwebimage , check . add " sdwebimage " folder project , check. you can code download image: [imageviewname setimagewithurl:[nsurl urlwithstring:strimageurl] placeholderimage:[uiimage im

php - Date format should be in cst -

i have date in our database "2014-03-06 16:23:33". wanted display "mar 06, 2014 04:23:33 pm cst". using cakephp. eg: $this -> html -> cdate ($courselog['courselog']['completed_time'],'datetimes'); thanks in adv. plz answer asap. update while stated wasn't sure if cakephp had specific helper this, i'm sure not . own documentation mentions datetime class, , link php docs , github search called cdate shows empty , cdata entirely different anyway... as follow comment, i'll delete, completeness add here: i don't know if cakephp has specific helper this, $date = new datetime($yourdatestring); $date->format(date_rfc820); should close. compose own format according need, or check the predefined constants readily available. ok, date_rfc850 constant isn't exact match of format looking for, , string manipulations (as in series of substr , explode - implode calls) tedious , messy , a

java - How to change the font of textview when it is a part of listview using SimpleAdapter -

following code : and wanna change font of textview id 'name12'. need help. thank in advance. string rid = jobj.getstring(tag_rid); string name = jobj.getstring(tag_name); hashmap<string, string> map = new hashmap<string, string>(); map.put(tag_rid, rid); map.put(tag_name, name); oslist.add(map); listadapter adapter = new simpleadapter(mainactivity.this, oslist, r.layout.list_v, new string[] { tag_name }, new int[] { r.id.name12}); l1.setadapter(adapter); you can extend textview class , set font inside. after can use textview in r.layout.list_v public class textviewwithfont extends textview { public textviewwithfont(context c) { this(c, null); } public textviewwithfont(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); settypeface(typeface.createfromasset(context.getassets(), "fontname.ttf")); } public textviewwithfont(context context, attributeset attrs

unity3d - D'Fusion AR SDK for Unity -

anyone happens know download d'fusion's plugion unity3d? i know once supported can't find on webpage, asked around on forums , got no replies. points no longer supported platform still have unity3d forum open, despite having little no feedback.

HttpGet in Android/Java with GZip encoding -

i running mvc 4 on server , save bit of data users figured enable gzip encoding, used: (c#) response.addheader("content-encoding", "gzip"); response.filter = new gzipstream(response.filter, compressionmode.compress); in android application use: (java) string response = ""; defaulthttpclient client = new defaulthttpclient(); httpget httpget = new httpget(url); try { httpresponse execute = client.execute(httpget); inputstream content = execute.getentity().getcontent(); bufferedreader buffer = new bufferedreader( new inputstreamreader(content)); string s = ""; while ((s = buffer.readline()) != null) { response += s; } } catch (exception e) { e.printstacktrace(); } return response; when use gzip java code nuts out , causes gc run, never patient enough wait return. when took off gzip server ran fine. function response returns straight away no problem. i tried adding java code: httpget.

ms access - List a row of data in a listbox / combobox -

i have listbox displays result of query. how database has been designed information in rows there magnitude of possible controls 1 product. i.e productname | control 1 | control 2 | control 3 | control 4 | control 5 ........ | control 14 product 1 | 010101010 | 101010101 | .......... i list box show column heads on left rather top, or combo box list part no's. is property issue or done through vba? so, combobox on 1 of projects' main screens, utilize table row source. (technically it's query suppose it's 2 fields table) i have table looks this: +--------------+----------------+ | quickentryid | quickentryname | +-------------------------------+ | 1 | add part | | 2 | add control | | 3 | add product | +--------------+----------------+ ( all of can done behind scenes making few selections in wizard .) i use select statement populate combobox table. when right clicking on combobox, in data tab,

multithreading - join() threads without holding the main thread in python -

i have code calls threads on loop, this: def submitdata(data): # creating relevant command execute command = createcommand(data) subprocess.call(command) def main(): while(true): # generating data data = getdata() mythread = threading.thread(target=submitdata,args=(data,)) mythread.start() obviously, don't use join() on threads . question how join() threads without making main thread wait them? need join() them? happend if won't join() them? some important points: the while loop suppose long time (couple of days) the command not long (few seconds) i'm using threading performance if have better idea instead, try out. popen() doesn't block. unless createcommand() blocks, call submitdata() in main thread: from subprocess import popen processes = [] while true: processes = [p p in processes if p.poll() none] # leave running processes.append(popen(createcommand(getdata()))) # sta

tsql - Code is executed although condition is false -

i have view v. selecting data view takes ten seconds execute because of referencing many many other views , tables. there's no way change this. furthermore, there changelog table ( cl ) holds information whether datasets of v ( , / or other tables / views have reloaded, e.g.: id, refid, table 1, 1, v 2, 2, v 3, 3, 4, 1, b id pk, auto-increment. refid refers id-column of each referring table / view. table holds name of referring table / view now, there query checks if there datasets in cl referring view v. q1: select v.* cl inner join v on v."id" = cl."refid" , cl."table" = 'v' in above example, 2 records cl affected ( id 1 , 2 ). if no record affected @ ( no record "table" = 'v' in cl ) expect instant result of 0 executing second query q1 ( thought optimizer determine join-condition returns 0 results in cl , therefore there no need execute select on view v bottleneck, does. ) what have tri

entity framework - EF 6 and Web Api. How return custom data on GET? -

i need return web api controller specific data not exist in standard action. let's standard controller action is: // api/xtourist/5 [responsetype(typeof(xtourist))] public ihttpactionresult getxtourist(int id) { xtourist xtourist = db.xtourist.find(id); if (xtourist == null) { return notfound(); } return ok(xtourist); but need return more data, let's hotel name. hotel name got using function: public string findhotelname (int id) { int? hotelid = db.xtourist.find(id).КодИ; string hotelname = db.xadres.find(hotelid).namec; return hotelname; } but how should joind these data , return in controller answer? so want 2 results returned? why not create new object holds both values need? public class touristreturndto { public xtourist tourist { get; set; } public string hotelname { get; set; } } public i

c# 4.0 - Need a method for searching all of C drive for a directory in C# -

i need find folder called "gamedata", in filesystem, stored in program files, if not, able find it, wherever in c drive. currently, i'm using: ienumerable<string> list = directory.getdirectories(root, "gamedata", searchoption.alldirectories); but throws unauthorizedaccessexception expected, trying navigate through protected directories. is there perhaps can add stop attempting access protected directories? try/catch block allow search continue after exception? edit note: i'm not looking specific file, folder called gamedata, can use location output .zip extraction, or read names of folders within. you need use recursive method instead of alldirectories . skip directories cause exception. msdn: iterate through directory tree (c# programming guide) "the weakness in using searchoption.alldirectories if 1 of subdirectories under specified root causes directorynotfoundexception or unauthorizedaccessexception , whole me

request URL with parameters in curl php -

i want request web page content particular option selected drop down list. in example, want content web page community , level 2 drop down lists. , want web page option community='softwarefactory/cloude' , level='v6r2015x' . my code <?php // init resource $ch = curl_init('http://e4allds/'); // set single option... $postdata = array( 'community' => 'softwarefactory/cloud', 'level' => 'v6r2015x' ); curl_setopt_array( $ch, array( curlopt_url => 'http://e4allds/', curlopt_postfields => $postdata, //option1=> 'community=softwarefactory/cloud', //option2=> 'level=v6r2015x', curlopt_returntransfer => true )); $output = curl_exec($ch); echo $output; but giving result default selection. please me how can pass these parameters url? you need enable curl post parameter true . curl_setopt_array( $ch, array( curlopt_post => tr

ios - Make relationship in CoreData -

i have player entity , game entity. one player many games relationships. so player has position attribute offense defense when create player , add player team set position offense or defense. but different game player can have offense position or defense position , position can't overwritten player in team. if created player number 10 position offense can't modified, because each player in team have appropriated position. game can set new position player if want. suppose game id = 10 have player id = 7 has position = offense, want player player id = 7 have position defense game id = 12. for game id 10 have position offense player game id = 10 player.id = 7 player.position = offense for game id 12 have position defense same player game id = 12 player.id = 7 player.position = defense so can see use different game use same player , if set new parameter player.position override previous value that's no because store latest position , when fetch player

java - (#200) The user hasn't authorized the application to perform this action android facebook SDK -

i posting on wall in facebook sdk android getting i'll post code below {response: responsecode: 403, graphobject: null, error: {httpstatus: 403, errorcode: 200, errortype: oauthexception, errormessage: (#200) user hasn't authorized application perform action}, isfromcache:false} private void poststatusupdate(final string fbpost) { log.d("poststatusupdate",fbpost); session.openactivesession(this, true, new session.statuscallback() { // callback when session changes state @suppresswarnings("deprecation") @override public void call(final session session, sessionstate state, exception exception) { if(session.isclosed()){ log.i("poststatusupdate session.isclosed", "message not posted session closed"); } if (session.isopened()) { log.i("session.isopened", "session.isopened")