Posts

Showing posts from April, 2015

How can I modify my existing app to support an earlier version of the Android OS? -

i upgraded app android 2.1 2.2, didn't realize of users still running android 2.1. can't update anymore. can downgrade app 2.1? thanks you need set minsdkversion(api 7 is 2.1 compatible believe) approriate api in manifest , make sure code compliant. can find information in android documentation

tagging in Rails 3 -

what solution tagging in rails 3? i looked @ both solutions, prefer https://github.com/mbleigh/acts-as-taggable-on on https://github.com/jviney/acts_as_taggable_on_steroids better documentation , me seems more flexible.

url - Change Tomcat Address on my localhost -

on tomcat, have html page. i need type following address make run: http://127.0.0.1:8080/biddingsystem/biddingsystem.html but want accessed using address: www.moribiz.com is possible changing setting on tomcat? i have eclipse ee , tomcat7, , need run servlets not @ localhost:8080 , on pretty domain :) i have made way: in file %windows%\system32\drivers\etc\hosts add: 127.0.0.10 tomcat in file %workspace%\servers\tomcat 7 @ localhost-config\server.xml <connector port="80" address="127.0.0.10" connectiontimeout="20000" protocol="http/1.1" redirectport="8443" uriencoding="utf-8" /> <engine defaulthost="tomcat" name="catalina"> <host name="tomcat" appbase="webapps" autodeploy="true" unpackwars="true"> ... </host> </engine> now apache tomcat works fine (i h...

Spring - web pages using XSLT -

i'm new in xslt , know best solution integrate xslt spring web application. found quick example here , in had troubles proper character encoding , switching saxon processor (i refer former questions here , here ). in book: 'spring in action' described solution extending abstractxsltview. better way abstractxsltview let me choose saxon processor? better way execute transformation .jsp files? there's old ibm developerworks jstl primer on doing transformations through jsp using <x:transform> tag of jstl. simpler approach, may not allow saxon.

What happens (exactly) if you leave out the copy-constructor in a C++ class? -

what happens (exactly) if leave out copy-constructor in c++ class? is class memcpy'd or copied member wise? the class copied member-wise. this means copy constructors of members called.

ruby on rails 3 - rake db:migrate returns "rake: Is a directory"? -

i've been searching answer question week, haven't found one. i'm running mac os 10.5.8 if that's relevant. i'm trying peepcode tutorial "meet rails 3" when run command line user$ rake db:migrate following error message: /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake: directory - /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake (errno::eisdir) /usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19 i found exact same error @ ruby.pastebin.com no answer. willing out aspiring developer. thanks. it looks using default install of ruby interpreter came mac os x. suggestion use rvm install/manage gem locations. haven't read/watched "meet rails 3" stuff, not sure advocating, can speak experience rvm makes these types of issues go away.

git - Multiple commits before pushing -

i'm new git, excuse naivety. if i'm working on project offline, , multiple commits push changes once i'm online, commits show in repository, or last 1 did before going online? git distributed version control system. repository entirely own, , contains absolutely need. committing takes place within repository; has nothing whether or not you're online. the things need online pushing (publishing commits repository) , pulling (fetching , merging commits repository). when push, push told - of commits on branch. doesn't matter when made them or if network cable plugged in @ time.

ASP.NET RadioButtonList layout not working -

no matter set on radiobuttonlist, still renders unordered verticle list. <asp:radiobuttonlist runat="server" id="myctrl" repeatdirection="horizontal" repeatlayout="flow" style="margin-bottom: 0px" > < asp:listitem text="add it!" selected="false" /> < asp:listitem text="no, thank you." selected="false" /> < /asp:radiobuttonlist > if happen using sitefinity (as am) may due sitefinity-implemented-adapter... http://www.sitefinity.com/devnet/forums/sitefinity-3-x/general-discussions/add-another-workaround-to-problem.aspx http://www.sitefinity.com/devnet/kb/sitefinity-3-x/rendering-radiobuttonlist.aspx

GCC debug information -

i'm using gcc arm cross-compiler ( arm-none-eabi-* ) , using proprietary debugger. debugger can highlight resultant assembly selected source line. using nm , objdump, can see binary has more 1 .debug_* sections. it's obvious conclude debugger using information contained in these sections map source lines disassembly (and vice versa). i'd how. i'd know information these sections contain, how they're related, , how make sense out of them. in short, how read sections , make use of them, if write debugger (or @ least, tool can display these mappings: source disassembly, , back, number of disassembly lines per source line). assume 0 compilation optimization. presumably there's doc describes format of these sections? the .debug_* sections contain data in format described dwarf debugging standard. standard has web site can download standard specification: http://www.dwarfstd.org/ there libraries available parsing stored format (which highly condensed...

c# - Text File Storing Data -

i have text file read in (which not problem), file divided 3 sections each different heading i.e. block{a}, block{b} , block{c}. after each block lines of text, each line contains word after "#" need capture. the tricky bit words in block have second meaning or weighting. words in block have weighting of 1, whilst block b weighting 2 , block c weighting 3. these weight values not present in text file , text file cannot edited include them. so need method read data (not problem), check block in (look 'block{*}') store away word after '#' weighting (1 or 2 or 3). i need suggestions best mechanism store data can compared text box updated character character. the text box string compared (after each key press) words in text file or data extracted , if match, weighting value associated word used code. first off, can create simple class store data public class words { public string word{get;set;} public int weigth{get;set;} } then pr...

scrollable picturebox c# .net stop flickering using doublebufferring -

i create scrollable picturebox referring link . it works fine. image flickering when scrolling. windows forms has doublebuffered property. picturebox haven't. think if can use doublebuffered on picturebox might problem solved. please overcome problem thank yohan picturebox double-buffered check flicker-free painting also how avoid flickering of forms

python - Django internationalization (i18n) lint checker? Tell me what hasn't been _()'ed or {% trans %}'ed -

i have internationalize (i18n) django project. it's combined of many in house django apps. partially i18n'ed already, i.e. of strings _(), bare. of templates use {% blocktrans %} or {% trans %} , english text in there direct. take lot of manual work me change this. oh well. is there way see strings in python code , text in html templates hasn't been passed through _()/{% trans %}? 'i18n lint' checker? command that'll print out line & filename of strings haven't been _()'ed yet, or aren't in {% trans %} i'm ok throwing false positives (& false negatives), want way make sure haven't missed anything. i couldn't find this, had make own. a plugin pylint finds strings aren't in _()/ugettext() a script find non-translated/i18n'ed strings in django templates

python - Matplotlib and Numpy Math -

i'm trying traction matplotlib , numpy not easy. i'm doing mini project start dealing matplotlib , numpy i'm stuck... here code: # modules import datetime import numpy np import matplotlib.finance finance import matplotlib.mlab mlab import matplotlib.pyplot plot # define quote startdate = datetime.date(2010,10,1) today = enddate = datetime.date.today() ticker = 'uso' # catch csv fh = finance.fetch_historical_yahoo(ticker, startdate, enddate) # csv reacarray r = mlab.csv2rec(fh); fh.close() # order desc r.sort() ### methods begin def moving_average(x, n, type='simple'): """ compute n period moving average. type 'simple' | 'exponential' """ x = np.asarray(x) if type=='simple': weights = np.ones(n) else: weights = np.exp(np.linspace(-1., 0., n)) weights /= weights.sum() = np.convolve(x, weights, mode='full')[:len(x)] a[:n] =...

vba - Hit-Testing and Resolving Occlusion of AutoShapes in Excel -

i using code draw number of autoshapes in excel based on user input using vba. however, of these shapes may occlude each other, run second pass hit-test shapes occlude , nudge them until no longer occlude. so basic pseudocode outline be: do foreach shape s in shapes if (s.hittest(shapes)) s.nudgeup(1) until (!s.hittest(shapes)) endif next until (!shapes.hittest(shapes)) can of think of way of doing (or working around doesn't have done)? i've taken @ rangefrom function, doesn't seem use (only returns one shape @ specific screen coordinate, not intersecting shapes). many help. you below: sub moveshapes() dim wb workbook set wb = activeworkbook dim sh worksheet set sh = wb.activesheet dim s1 shape dim s2 shape = 1 sh.shapes.count if < sh.shapes.count set s1 = sh.shapes(i) set s2 = sh.shapes(i + 1) if s2.left < ...

ruby on rails - How to manage code comments using NetBeans? -

i using ruby on rails 3 , ide netbeans v6.9.1. since in files have lot of comment lines describe code, , these comments repeated in multiple files, there way manage in way ? should work feature " auto-versioning "... how make these in netbeans? if find repeating in comments, repeating in code. perhaps should consider refactoring code make more dry (don't repeat yourself). pull out common functionality, behavior, , data structures central places don't have same code (and comments) in multiple locations.

Django Inheritance Issues -

okay, have been reading other django inheritance questions , can't find help. may have understanding issue how inheritance works. here issue. start, have 2 base models i'd of other models inherit from. base model contains useful methods of models. second start of account specific object. class basemodel(models.model): # couple of methods models need have. no fields. class accountmodel(models.model): ''' base model items related specific account''' account = models.foreignkey(account) def save(self, request, *args, **kwargs): self.account = request.session['account'] super(accountmodel, self).save(*args, **kwargs) then have 3 models: class keyword(accountmodel) : keyword = models.charfield(max_length=300) #other fields, none required... class project(accountmodel) : project_name = models.charfield(max_length=200,verbose_name="project name") #other fields.. class keywordtarget(b...

python - How to grab a chunk of data from a file? -

i want grab chunk of data file. know start line , end line. wrote code incomplete , don't know how solve further. file = open(filename,'r') end_line='### leave comment!' star_line = 'kill master' line in file: if star_line in line: ?? startmarker = "ohai" endmarker = "meheer?" marking = false result = [] open("somefile") f: line in f: if line.startswith(startmarker): marking = true elif line.startswith(endmarker): marking = false if marking: result.append(line) if len(result) > 1: print "".join(result[1:]) explanation: with block nice way use files -- makes sure don't forget close() later. for walks each line and: starts outputting when sees line starts 'ohai' (including line) stops outputting when sees line starts 'meheer?' (without outputting line). after loop, result contains part of file needed, plus initial mark...

Android appwidget does not start service when ran -

the problem having when debug widget, changes layout, when run it, doesn't work. according debug messages, sets setonclickpendingintent not start service. in short, widget works when debugging. here widget code: public class widget extends appwidgetprovider { public static string switch_screen1 = "1"; public static string switch_screen2 = "2"; public static final string add_note = "addnote"; public static final string manage_reminders = "managereminders"; public static string take_picture = "takepicture"; private static int layoutid = r.layout.widget_screen1; /** * method called when widget added home screen. * sets listeners on items , updates screen info database */ @override public void onenabled(context context) { super.onenabled(context); setlisteners(context); updatescreenfromdatabase(context, appwidgetmanager.getinstance(context), ap...

c# - DataGridView handle column reordering event -

i set datagridview object allowusertoordercolumns = true; how can detect columns reordering ? does handling event need? http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.columndisplayindexchanged.aspx

plot - R + ggplot2: how to hide missing dates from x-axis? -

Image
say have following simple data-frame of date-value pairs, dates missing in sequence (i.e. jan 12 thru jan 14). when plot points, shows these missing dates on x-axis, there no points corresponding dates. want prevent these missing dates showing in x-axis, point sequence has no breaks. suggestions on how this? thanks! dts <- c(as.date( c('2011-01-10', '2011-01-11', '2011-01-15', '2011-01-16'))) df <- data.frame(dt = dts, val = seq_along(dts)) ggplot(df, aes(dt,val)) + geom_point() + scale_x_date(format = '%d%b', major='days') turn date data factor then. @ moment, ggplot interpreting data in sense have told data in - continuous date scale. don't want scale, want categorical scale: require(ggplot2) dts <- as.date( c('2011-01-10', '2011-01-11', '2011-01-15', '2011-01-16')) df <- data.frame(dt = dts, val = seq_along(dts)) ggplot(df, aes(dt,val)) + geom_point() + ...

Returning an instance of a node itself in a php tree class -

so i'm trying create tree structure in php. don't know if that's possible , i'm not great php difficult me. the code have far (important stuff only, code has been cut out): abstract class tree_node { protected $_child_refs = array(); abstract public function add_child($arg); public function count() { return count($this->_child_refs); } public function get_deepest_children() { if ($this->count() === 0) { return $this; } else { foreach ($this->_child_refs $child_ref) { $deepest[] = $child_ref->get_deepest_children(); } } } abstract public function __construct(); } class data_node extends tree_node { private $_data = ""; public function add_child($data) { $new_child = new data_node($data); $this->_child_refs[] = $new_child; } public function __construct($data) { $this->_data = $dat...

r - Memory management / cannot allocate vector of size n Mb -

i running issues trying use large objects in r. example: > memory.limit(4000) > = matrix(na, 1500000, 60) > = matrix(na, 2500000, 60) > = matrix(na, 3500000, 60) error: cannot allocate vector of size 801.1 mb > = matrix(na, 2500000, 60) error: cannot allocate vector of size 572.2 mb # can't go smaller anymore > rm(list=ls(all=true)) > = matrix(na, 3500000, 60) # works > b = matrix(na, 3500000, 60) error: cannot allocate vector of size 801.1 mb # there room i understand related difficulty of obtaining contiguous blocks of memory (from here ): error messages beginning cannot allocate vector of size indicate failure obtain memory, either because size exceeded address-space limit process or, more likely, because system unable provide memory. note on 32-bit build there may enough free memory available, not large enough contiguous block of address space map it. how can around this? main difficulty point in script , r can't a...

jquery - Create a simple drawing tool in HTML5? -

i'm working on project i'd give user possibility draw simple floor plan rooms, , stock maybe metadata (like room names). i see that: - click on "add new room" - draw rectangle on screen (or maybe simple shape) - give name i'd new what's best (and simplest) language use create kind of tool. html5+jquery? flash? there existing tool/plugin trick? thanks help! the simplest way in html5 canvas tag. use jquery mouse events. if have access , experience flash though, best bet users more have flash html5. if use html5, heres great documents https://developer.mozilla.org/en/drawing_graphics_with_canvas http://api.jquery.com/category/events/mouse-events/

mysql - Is "FLUSH TABLES, PRIVILEGES;" the same as "FLUSH TABLES; FLUSH PRIVILEGES;"? -

in mysql, executing flush tables, privileges; have same effect executing flush tables; , executing flush privileges; ? also, hold true of flush options ( flush logs; etc.)? taken http://dev.mysql.com/doc/refman/5.1/en/flush.html syntax flush [no_write_to_binlog | local] flush_option [, flush_option] ... which means upon executing command flush tables, privileges; flush tables followed privileges. yes should same as flush tables; flush privileges;

perl - A CPAN module to parse google-style search query terms? -

i want turn query string of style: my $query = q{recipe "with sauce" +eggs -pastrami}; into programmatic, sql::abstract query, used in dbix::class . $where = { -and=>[ 'ingredients' =>[ { -like=>'%recipe%' }, { -like=>'%with sauce%' } ], 'ingredients' =>{ -like=>'%eggs%' }, -not => { 'ingredients => { -like => '%pastrami%' } } ]}; the above representation approximate. it's written ear, untested , no means syntactically nor conceptually correct. what i'm looking prior art on subject, basic stuff. cpan module perhaps, or c library turned cpan module. there standard such thing? the basic query parser in kinosearch (though default query boolean join parts or, can set and). have few ways approach stemming, token types, , wildcarding possible not built-in. has learning curve , docs bit thin highly recommend package. besides being done , terribly fast auth...

menuitem - Simple CSS Menu Adjustment -

i having minor issue ie7 (whats new)... i trying create simple, "button" has basic effects when mouse-over show small menu. such "actions". perhaps select multiple items on page , want apply actions them. so code, , seems work fine, except in ie7. displays menu @ 100% width, , don't want that.... want display width or button-text. if have ideas on tweaking this, appreciated. <style> * { margin: 0; padding: 0; } body { font-family:arial, helvetica, sans-serif; } /* overall button layout */ .dropbutton { display: block; position: relative; background-color: #0073ea; color: #fff; list-style: none; margin: 0; padding: 0; z-index: 100; } /* head button visual */ .dropbutton li { padding: 3px 10px; color: #fff; text-decoration: none; display: inline-block; } /* sub-menu display */ .dropbutton ul { position: absolute; left: -99999px; list-style: none; background: #fff; border: solid 1px #d2d...

Django: related_name attribute (DatabaseError) -

i have problem models. class message(models.model): user = models.foreignkey(userprofile) text = models.textfield(max_length=160) voting_users = models.manytomanyfield(userprofile) def __unicode__(self): return self.text and class userprofile(models.model): user = models.foreignkey(user, unique=true) def __unicode__(self): return self.user.username i error when try call message.voting_users: message: accessor m2m field 'voting_users' clashes related field 'userprofile.message_set'. add related_name argument definition 'voting_users'. i'm new django , don't how should use related_name attribute. as says, voting_users , needs related_name argument because clashes defined related field, message_set (an automagic property created django first foreignkey , message.user ) http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.foreignkey.related_name you must supply relate...

Easy way to change SVN URL in a large collection of TeamCity VCS roots at once? -

does know of way change svn url on large number of vcs roots @ once? our svn server changing it's base url , there's way many vcs roots change manually through tc interface. we using sql server database teamcity i'm going poke around schema. doesn't seem idea tho. all current vcs settings in teamcity stored in file vcs-roots.xml in teamcity configuration directory. can shutdown server, make change, , start server again. (actually, can make change without shutdown phase, teamcity should pick changes on fly) don't forget backup file first.

version control - Merge multiple SVN repositories with a twist -

i'm trying merge multiple source repositories together, maintaining version history during process. i've been doing lot of reading on svnadmin dump/load process, there's 1 piece i'm still missing. each source repository setup standard "trunk" , "branches" setup. that's good. problem want massage paths when merge things together. instance... many of approaches i've seen allow create structure this: /project1 /project1/trunk /project1/trunk/html /project1/branches /project2 /project2/trunk /project2/trunk/html /project2/branches however, want our final structure instead: /trunk /trunk/project1 /trunk/project1/html /trunk/project2 /trunk/project2/html /branches reason being: of projects intertwined. project1 might our backend software, project2 our front-end software, project3 our cron jobs, etc. basically, it's 1 combined system, , project specific branching seems make our life more difficult. that said, problem aris...

Add spell check into a telerik mvc editor -

i want use telerik editor in mvc 3 application building. possible add spell check editor? thank you i know question bit old, ran same problem (in mvc2), , solved using jquery spellchecker , found asp version there , adapted work in mvc2. the trick make work telerik editor call spell checker on "good" jquery object, i.e. if editor named "contenteditor", need call spellchecker on $('#contenteditor-value') hope helps.

forms authentication - Which is the best way to implement a logoff button in Asp.Net -

which best way implement logoff button in asp.net? i using forms authentication. thanks i use forms auth: private void lbsignoff_click(object sender, eventargs e) { profile profile = session["profile"] profile; logger.loginfomessage("logging off user: " + profile.username); session.abandon(); formsauthentication.signout(); response.redirect(constants.defaultpage); }

silverlight 4.0 - How to set SelectedItem for a ColumnSeries chart from the ViewModel -

Image
i have columnseries chart want control selected item view model. binding the selecteditem of chart object on view model. <chartingtoolkit:chart grid.row="2" verticalalignment="stretch" horizontalalignment="stretch" borderthickness="0" minheight="200" margin="0" x:name="ratingschart" style="{staticresource chartwithoutlegendstyle}"> <chartingtoolkit:chart.series> <chartingtoolkit:columnseries x:name="chartratingcolseries" isselectionenabled="true" selecteditem="{binding selectedratingdistribution, mode=twoway}" itemssource="{binding ratingslist}" independentvaluebinding="{binding ratingname}" dependentvaluebinding="{binding numberofgoodies}...

objective c - What is wrong with this ParseKit BNF? -

i'm using parsekit objective-c takes bnf-like syntax specifying grammers: @start = command+; command = new; new = 'new' object ';'; object = 'house' | other; inclusion of last line causes error. want object can house or else. non-terminal element "other" supposed catch whatever word there wasn't house. am going "anything-here" idea wrong way? thanks! as suggested in comments, should either replace other word or add new rule: other = word; since 'house' word , can directly replace object rule with: object = word; a word in parsekit contiguous sequence of characters ( [a-za-z] ), numbers ( [0-9] ), , symbols - , _ , , ' , starts character. can find more information parsekit tokens in documentation .

jquery - Accessing the data used in .load() -

when using .load() method load external php/html, how access data in external file? say first file 'index.php' , contains like; $('#contentcontainer').load('productcontent.php',{param1:'data.xml'}); inside 'productcontent.php' want able parse different xml files passing xml filename shown. however, don't know how access 'param1' within 'productcontent.php' it there under $_request['param1']; edit: on server need file called productcontent.php this: <?php echo $_request['param1']; ?> edit2: if writing javascript in php file (which think bad idea, javascript files should kept away generated html) you'd this: $(this).ready(function () { var d = <?php echo $_request['param1']; ?>; }); but pretty messy.

Reading config files with C++ -

possible duplicates: c++ read lines file file based configuration handling in c ( unix ) using c++ how can extract data int id; string name; char mac[6]; configuration file: config.txt. contents of example: id 34 name buzinga mac 0x67:0x45:0x4d:0x5d:0xcc:0x13 first, search web , stack overflow keywords "parsing" , "file". narrow search, add keywords "mac address c++". next, prefer read data memory process memory. in other words, read line of text string , use methods of std::string finding items in text. research std::stringstream ways convert textual representations of numbers internal representations. try on own. if have issues, post smallest amount of code recreate issue along compiler output expect program produce.

iphone - Know the download progress for update an UIprogressView -

my app downloads video internet , saves in iphone. i'm using code nsmutableurlrequest *request = [[[nsmutableurlrequest alloc] init] autorelease]; [request sethttpmethod:@"get"]; nserror *error; nsurlresponse *response; nsstring *documentfolderpath = [nshomedirectory() stringbyappendingpathcomponent:@"documents"]; nsfilemanager *filemanager = [nsfilemanager defaultmanager]; nsstring *videosfolderpath = [documentfolderpath stringbyappendingpathcomponent:@"videos"]; //check if videos folder exists, if not, create it!!! bool isdir; if (([filemanager fileexistsatpath:videosfolderpath isdirectory:&isdir] && isdir) == false) { [[nsfilemanager defaultmanager] createdirectoryatpath:videosfolderpath withintermediatedirectories:yes attributes:nil error:nil]; } nsstring *filepath = [videosfolderpath stringbyappendingpathcomponent:@"name.mp4"]; if ([filemanager fileexistsatpath:filepath ] == yes) { nslog (@"file ex...

css - z-index bad behaviour over some HTML elements -

Image
i've seen behavior years. checkboxes , radios buttons can not covered div elements. no matter z-index use.is there solution? besides, using simpletip (can't use qtip). if know jquery tooltip ready use work around this... have wallet open. thx ok, can work. first off: has nothing problem, can lead other problems: html riddled errors: http://validator.w3.org/check?verbose=1&uri=http%3a%2f%2fnomikos.info%2fprivate%2fwp%2foptions-general.php.html most importantly span may not contain block element such div . of errors because using html syntax instead of xhtml syntax. maybe easier use html doctype, fixing xhtml errors. your actual problem z-index applies elements positioned (absolute, relative, fixed) , since "tooltip" isn't z-index has no effect. you'll need explain want do. until can give general suggestions: you make sure "tooltip" doesn't become wider surrounding span . it's 300px wide , since span s flex...

ipad - Why is [UIViewController presentModalViewController:animated:] transitioning the modal view in from the left? -

i'm building application supports landscape orientation on ipad under ios 4.3, though bug present under ios 4.2 well. several places in application, showing uiviewcontroller s modal views. of them shown using pattern: viewcontroller.modalpresentationstyle = uimodalpresentationformsheet; viewcontroller.modaltransitionstyle = uimodaltransitionstylecoververtical; [self presentmodalviewcontroller:viewcontroller animated:yes]; in places, work expected - modal form sheet slides in bottom of screen upward. however, in 2 cases, modal form sheet slides in bottom left of screen. form sheet slides way right bottom of form sheet out of view. if focus text field , show onscreen keyboard, form sheet moves top center of screen expect be. i don't think simulated metrics of xibs affect behaviour, have set orientation of them (both calling uiviewcontroller self , modal view controller viewcontroller ) landscape. any ideas why these 2 modal form sheets behaving differently ot...

editor - browser based IDE's? -

can recommend browser based ide or programming editor ? i feel i've seen lots of these things drift past when @ bookmarks can find 2 : http://cloud9ide.com/ , http://jsfiddle.net/ all languages of interest (although non-js particularly so). i'd wide survey don't include tools collaborative text editing - must sort of programming support built in (even if it's bare bones syntax colouring) thanks also recommend read article: http://eclipse.dzone.com/news/who-needs-online-ide it links , describes lot of them, more mentioned others here. edit: of ones describe in article dead. instead check out: full fledge ides: shiftedit cloud9 phpanywhere and can run on own server: ace actually, looks online full fledged ides find uses ace @ core, , add nicer gui on , cloud support.

javascript - How to use event.stopPropagation() in delegate() -

my code following in html: <li class="arrow"> <div> <a href="javascript:void(0);" class="anchor">remove</a> </div> </li> and bind elements using deligate() jquery method (because elements appear dynamically) $obj.delegate(".arrow", "click", function() { alert("clicked on arrow"); }); $obj.delegate(".anchor", "click", function(event) { event.stoppropagation(); alert("anchor clicked"); }); my problem is, when click on ".anchor" both events occurs. can tell me how use event.stoppropagation() in context? tried above not working. there other way this? edit: tried calling event.ispropagationstopped(), , returns true. still both events called. there limitations when delegate or live used , stoppropagation . you return false in handler prevent both eventpropagation , defaul...

optimization - MATLAB Speed Difference in Identical Code -

i have matlab code i've been working with. there 3 sections, a, b, , c. , c can change, b stays same regardless. what did separate a, b, , c separate .m files (not functions, scripts). creates set of variables, b contains logic, , c contains plotting results. i'll call d file i've done linearly copy/paste entire contents of a, b, , c right after each other. if run a, b, c, iteration within b goes slowly, 15 seconds per iteration. if run d (just b c pasted in) goes fast, 2 seconds per iteration. given matlab running exact same code in exact same order, why 2 have such drastically different execution times? i believe have memory issues. matlab functions input variables pointers, if change data, becomes copy. if a,b,c have large input , output, , each 1 of them modifies small part of data, lot of memory allocations. for example: function main() x = imread('peppers.png'); i=1:size(x,1) j=1:size(x,2) x = changepixel(x,i,j); en...

How to replace text with regex on PHP? -

i have text "master_lecture.name" want replace *master_lecture* space or string. how on regex php? *i'm newbie regex. thanks you can regular expression or simple string function $string = 'master_lecture.name'; $string_replace = 'master_lecture'; // regular expression preg_replace('/'.preg_quote($string_replace).'/is', '', $string); // string function $string = str_replace($string_replace, '', $string); http://php.net/manual/en/function.preg-replace.php http://php.net/manual/en/function.str-replace.php

osx - Copying an image in Mac OS X 1000 times -

when simple copy or duplicate finder duplicate of, "1.jpg" renamed "1 copy.jpg" there simple way, using scripting language, take "1.jpg" , make 1000 copies, each named 1.jpg, 2.jpg, 3.jpg...1000.jpg? thanks in terminal, run (or save .sh script , run that): for in {2..1000}; cp 1.jpg $i.jpg; done

php - button to dynamically load $body data into <textarea> -

<form id="form1" name="form1" method="post"> <textarea name="list" id="emails" rows="10" value="send to" ondblclick="select_all('emails');" onfocus="if (this.value == 'send to' || this.value == 'send to: separate emails comma , space') {this.value = '';}" onblur="if (this.value == '') {this.value = 'send to: separate emails comma , space';}" cols="40">send to</textarea><br/> <input name="subject" id="subject" value="subject" onfocus="if (this.value == 'subject') {this.value = '';}" onblur="if (this.value == '') {this.value = 'your jagex account';}" size="17"/> <select name="template" id="template" onchange="load();"> <option value="none...

windows - Using functions in a dll in c++? -

i have created dll in c++ using __declspec(dllexport) before class name. when try use in c++ program crashes in between. when debugged found function pointer not initialized @ all. me plz. using namespace std; typedef void (*func)(); int main() { func funcpointer; hinstance xyz = loadlibrary(text("c:\\extra\\dll\\dlls\\debug\\random.dll")); funcpointer = (func)getprocaddress(xyz,"get it"); funcpointer(); return 0; } thanks in advance. first of use dumpbin /exports yourdll.dll see if function expect exported exported , exact name. if find name "mangled" need declare function extern "c" . once have determined name way go correct. check hinstance xyz became not null after loading library. if null robably don't reach dll ( not in search path ) or reason can't load example because dependencies missing.

c# 4.0 - Shortening url using bit.ly -

i creating short urls have done tiny url, based on link: http://www.emadibrahim.com/2009/05/07/shortening-urls-with-bitlys-api-in-net/ but getting error: the remote server returned error: (407) proxy authentication required. how can resolve issue? i'm using c#. <system.net> <defaultproxy usedefaultcredentials="true"> <proxy usesystemdefault="false" proxyaddress="http://127.0.0.1:8888" bypassonlocal="true" /> </defaultproxy> </system.net> by using usedefaultcredentials="true" can ride of problems.

http - How to expire cached pages when only the CSS url changes -

scenario: make update css file, push cdn, , need change version number in query string make sure users' browsers download latest copy here's problem: of pages behind varnish, , absolute url of css file being pulled memcached. do need expire entire page trigger update? you need expire pages refer 'old' versions of css. if worried expiring 'whole' pages expensive, can divide pages in esi processable fragments , expire css-containing html fragment. another (bit exotic) option use javascript. if have lot of cached pages, , include javascript resource that's updated more cached web pages, have javascript add latest css url dom.

filepath - Path of Images inside a component in Joomla -

i have simple problem re file paths, , yet have been trying solve problem no avail. appreciated. i'm new joomla , here problem. i show image located in images folder of component. example path: /joomlabasedir/components/com_mycomponent/images/image1.png how can correctly set path image, inside view of component. i've tried following in code: <img src="./images/images1.png"> but when page gets loaded, src gets prefixed sef formatted link of page being displayed. example. while viewing 'view' called event, instead of image path pointing : localhost/joomla/components/com_mycomponent/images/image1.png, points sef formatted link show below, localhost/joomla/index.php/component-alias/event/images/image1.png which wrong path , results 404 error. i have tried using jpath_root, jpath_component, , failed since these paths giving filesystem path of file, considered local resource can't loaded. i hope can me on seemingly trivial prob...

iphone - iPad : Problem with Orientation while dismissing the urban airships Rich Push notification -

Image
i have implemented urbanairships rich push notification in app. while press done button(dismiss urban-airship's view), screen destructed below. what problem? the problem screenlocks might have or have not added in xibs . try applying stretch in horizontal , vertical mode in xib.

C - dynamic arrays -

i don't quite understand how pointers work c arrays. here's code got: int arrayone[] = {1, 2, 3}; int arraytwo[] = {4, 5, 6, 7}; int **arraythree = (int **)malloc(2 * sizeof(int)); arraythree[0] = arrayone; arraythree[1] = arraytwo; (int = 0; < 2; i++) { int *array = arraythree[i]; int length = sizeof(array) / sizeof(int); (int j = 0; j < length; j++) printf("arraythree[%d][%d] = %d\n", i, j, array[j]); } i have expected output following: arraythree[0][0] = 1 arraythree[0][1] = 2 arraythree[0][2] = 3 arraythree[1][0] = 4 arraythree[1][1] = 5 arraythree[1][2] = 6 arraythree[1][3] = 7 what prints out is: arraythree[0][0] = 1 arraythree[0][1] = 2 arraythree[1][0] = 4 arraythree[1][1] = 5 why?! sizeof(array) size of pointer, happens twice size of int on platform. there's no way length of array in c. have remember yourself.

linux - Convert string to hexadecimal on command line -

i'm trying convert "hello" 48 65 6c 6c 6f in hexadecimal efficiently possible using command line. i've tried looking @ printf , google, can't anywhere. any appreciated. many in advance, echo -n "hello" | od -a n -t x1 explanation: the echo program provide string next command. the -n flag tells echo not generate new line @ end of "hello". the od program "octal dump" program. (we provide flag tell dump in hexadecimal instead of octal.) the -a n flag short --address-radix=n , n being short "none". without part, command output ugly numerical address prefix on left side. useful large dumps, short string unnecessary. the -t x1 flag short --format=x1 , x being short "hexidecimal" , 1 meaning 1 byte.

c++ - MingW Netbeans 6.9.1 problem -

Image
i have 1 problem mingw(mingw-get-inst-20110211) , netbeans 6.9.1. installed mingw , add netbeans without problem, when try run 1 simple cpp app, throws error mkdir -p build/debug/mingw-windows make[2]: mkdir: command not found make[2]: [build/debug/mingw-windows/main.o] error 127 make[1]: [.build-conf] error 2 make: [.build-impl] error 2 make[2]: leaving directory '/c/documents , settings/marco/my documents/netbeansprojects/cppapplication_1' make[1]: leaving directory '/c/documents , settings/marco/my documents/netbeansprojects/cppapplication_1' build failed (exit value 2, total time: 1s) i write "path", mingw it's installed on "c:\mingw". hope can tell what's wrong or forgot do. thanks it's kind of messy way. 1° install mingw (c/c++ en particular case) 2° install msys (answer 2 or 3 question @ end of installation, refering mingw installed) 3° add netbeans(tools>options>c/c++) ...

visual studio 2010 - While publishing a release version through web-deploy I get an error -

i had odd happening. use web.config transformation files, , when trying publish local iis web-deployment, following error: error 1160 "parameterizetransformxml" task failed unexpectedly. system.uriformatexception: invalid uri: uri empty. @ system.uri.createthis(string uri, boolean dontescape, urikind urikind) @ system.uri..ctor(string uristring) @ microsoft.web.publishing.tasks.parameterizetransformxml.execute() @ microsoft.build.backend.taskexecutionhost.microsoft.build.backend.itaskexecutionhost.execute() @ microsoft.build.backend.taskbuilder.executeinstantiatedtask(itaskexecutionhost taskexecutionhost, taskloggingcontext taskloggingcontext, taskhost taskhost, itembucket bucket, taskexecutionmode howtoexecutetask, boolean& taskresult) it did work before added image files project, , work in debug mode when transformation files still identical. did encounter , know might causing this? this under visual studio 2010 , framewor...

vba string assignment. WHy am I getting 1004 run time error? -

on below line in code getting 1004 run time error: application-defined or object-defined error. think might problem on right side of statement. however, i've changed way written few times no avail. can see have tried inserting many character codes. want inserted cell b1, b1 active cell ="'"&a1&"'," spaces clarity: = " ' " &a1& " ' , " this supposed reference cell a1, take value , put inside single quotes, comma @ end. formatted sql statement. any appreciated. know common error, error message not helping. activecell.formula = chr(61) & "'" & chr(34) & chr(38) & "a1" & chr(38) & chr(34) & "'," to escape quotes need double them up: activecell.formula = "=""'"" & a1 & ""',"""

jquery - Converting form_remote_tag to form_for for Rails 3 UJS -

i'm trying convert rails 3 <%= form_remote_tag :url => feedback_url, :update => 'flash_message', :before => "dosomething()", :condition => "condition()", :complete => "dosomethingelse();" -%> here's have far <%= form_tag feedback_url, :remote => true, :id => 'form' %> <%# gather data %> <% end -%> <script> $(function() { $("#form").bind("ajax:beforesend", function() { dosomething(); }).bind("ajax:success", function() { dosmomethingelse(); }); }); }); </script> i found post you. sure solve http://www.alfajango.com/blog/rails-3-remote-links-and-forms/

javascript - How to implement a client registration form providing additional dynamically-generated fields using jQuery and Asp.Net MVC 3? -

i want create registration form sport competition using asp.net mvc 3 (razor view engine). each school can have 1 team consisting of @ 20 members plus 1 team leader. the team leader has register members filling in registration form provide. rather displaying 20 sets of member fields, idea if can provide button add 1 more member render additional set of member fields. mechanism behaves add file when want attach 1 more file in yahoo mail. shortly speaking, have no idea: is there mature implementation of jquery available implement form providing additional dynamically-generated form fields? how implement scenario in asp.net mvc 3? how manage unknown number of posted form fields? edit each member has 4 fields: firstname (string) lastname (string) birthdate (datetime) photograph (image file) use form collection in controller if don't know names: public actionresult(formcollection formfields) { return view(); } or if have bunch of team m...

linux - Why was wget.exe detected as a virus? -

i installed cygwin on windows 7 , installed properly. selected various packages; including curl , wget. yet, anti-virus (avg 2011) detected malware, 4 red bars , put virus vault! i sent suspected file kaspersky's filescanner online came clean online scan i proceeded uninstall cygwin , restart windows; it's left me bit wary of using on windows 7 again fear of virus. is wget detected virus, , should cautious cygwin? is there difference between windows versions of wget , linux/unix ones? sources read suggested download older wget versions reduce risk of virus; wget version in question detected virus latest one. what's best way deal issue? if downloaded wget official cygwin repository, there's no chance of virus. i think avg little bit overzealous, , since wget used download data internet, recognized malware. nothing afraid about, can ignore problem think. you should maybe contact avg team make them aware of situation.

open source - Hunch.com Style Questions Database. Any F/OSS datasets available? -

anyone know of www.hunch.com style questions database helps users "taste" graph. preferably free & open-source. if there none in existence, community interested in creating crowd-sourced project? we used amazon mechnical turk crowdsource this.

php - Change CSS values with jQuery -

Image
there. so, i'm using masonry jquery plugin make image gallery mosaic. ok, script works "fine", when load page images css alignment wrong, or not working. see: however, if press ctrl+scroll, or ctrl++/ctrl+-, script works: why? how can fix it? my js: $(function(){ var $container = $("#galeria"); $container.masonry({ itemselector : 'li', columnwidth : 200 }); }); my css: .organizar-galeria{ width: 100%; } .organizar-galeria ul li{ width: 200px; } .organizar-galeria ul li img{ float: left; width: 100%; } #galeria{ width: 100%; float: left; padding: 5px 0px 10px 0px; } my html: <div id="galeria"> <div class="organizar-galeria"> <?php if($gallerydao->countfetch['qntfotos'] == 0 , $userdao->getuid() == $_session['uid']) { ?> <p>parece que você ainda não tem nenhuma foto. se ...

iphone - How to get decimal value from text field -

in iphone app need user able enter decimal amount in textfield , need convert float. i use following code: cgfloat amount = [amounttextfield.text floatvalue]; it works fine when user , use point decimal values, european users use comma instead doesn't value. should replace , . before using floatvalue or there better way? a better way use nsdecimalnumber, floats ugly anyway. because 2.2 should 2.2 , not 2.2000000477 nsdecimalnumber *amount = [nsdecimalnumber decimalnumberwithstring:amounttextfield.text locale:[nslocale currentlocale]]; if don't want use nsdecimalnumber have nsnumberformatter , nsnumber. convert cgfloat (which name float) too. when comes localization want use built-in functionality. when use string editing doing wrong.

codeigniter - Repetitive task entering key/values in to languages files -

i have code igniter application in 3 languages. when have new key/value pair language entry, following: define key/value in english go google translate other 2 languages add key/value other files this takes 2-3 minutes per key. have suggestions on how speed up? apis google translate? http://code.google.com/apis/language/translate/v1/using_rest_translate.html this docs current iteration of translate rest api in theory write application take english lang file , generate specified language. seems useful/popular.

poco - Entity Framework 4 - One-To-Many Relationship with a view with CTP5 (code first) -

i'm attempting map 1-m relationship between 2 entities first 1 mapped table , second 1 taken view. the involved entities are: public class institute { public int id { get; set; } public string name { get; set; } //... public virtual icollection<text> texts { get; set; } } public class text { public int instituteid { get; set; } public int textid { get; set; } public string name { get; set; } public string value { get; set; } public bool isrequired { get; set; } public int? maxlength { get; set; } } the relevant mapping code is: private void mapinstitutetext(entitytypeconfiguration<institutetext> text) { //from view text.haskey(i => i.instituteid) .totable("vwinstitutetexts"); text.property(i => i.instituteid) .hascolumnname("fkinstituteid") .isrequired(); text.property(i => i.textpropertyid) .hascolumnname("fktextpropertyid") ...

android bitmap gradient in android 2.1 -

Image
is there way put gradient bitmap object in android 2.1? image must this: i need gradient on top of bitmap. drawablegradient or lineargradient android 2.2 these objects doesn't me @ all. thanks do need xml or code? in code, try this: /* create 200 x 200 bitmap , fill black. */ bitmap b = bitmap.createbitmap(200, 200, config.argb_8888); canvas c = new canvas(b); c.drawcolor(color.black); /* create gradient. */ lineargradient grad = new lineargradient(0, 0, 0, 50, color.gray, color.black, tilemode.clamp); /* draw gradient top of bitmap. */ paint p = new paint(); p.setstyle(style.fill); p.setshader(grad); c.drawrect(0, 0, 200, 50, p); in xml, make 2 separate views in vertical linear layout. top view should have gradient drawable background, bottom, taller view should have solid background.

sql - Inner join on an insert to assure integrity -

i'm copying data table other one. i'm wondering better maintain data integrity , performance. steps : copy data older x days log archive remove data log if exist in archive from insert archive select * logs datediff(day, logs.timestamp, getdate()) > @day delete logsf logs logsf inner join archive archivef on logsf.uuid = archivef.uuid datediff(day, logsf.timestamp, getdate()) > @jour to insert archive select * logs datediff(day, logs.timestamp, getdate()) > @day , not exists ( select * archive datediff(day, logs.timestamp, getdate()) > @day ) delete logsf logs logsf inner join archive archivef on logsf.uuid = archivef.uuid datediff(day, logsf.timestamp, getdate()) > @jour is thing ensure not trying insert existing data in table? if 2 original query within transaction, 2nd option pointless (and adding useless processing time)? which 1 use : insert if not e...