pid
int64 2.28k
41.1M
| label
int64 0
1
| text
stringlengths 1
28.3k
|
---|---|---|
22,802,377 | 0 | <p>You can checkout branch B and do a git rebase.</p> <p><code>git checkout B</code></p> <p><code>git rebase M4</code></p> <p>Where M4 is the SHA of the commit M4.</p> <p>That should move your branch to a new base. Although if branch B has been pushed, and you still do a rebase, be prepared for some work if you are only contributor or some curses if you are a team worker.</p> |
12,135,396 | 0 | <p>Since you're on a mac, you can just use the subprocess module to call <code>open http://link1 http://link2 http://link3</code>. For example:</p> <pre><code>from subprocess import call call(["open","http://www.google.com", "http://www.stackoverflow.com"]) </code></pre> <p>Note that this will just open your default browser; however, you could simply replace the <code>open</code> command with the specific browser's command to choose your browser.</p> <p>Here's a full example for files of the general format</p> <pre><code>alink http://anotherlink </code></pre> <p>(etc.)</p> <pre><code>from subprocess import call import re import sys links = [] filename = 'test' try: with open(filename) as linkListFile: for line in linkListFile: link = line.strip() if link != '': if re.match('http://.+|https://.+|ftp://.+|file://.+',link.lower()): links.append(link) else: links.append('http://' + link) except IOError: print 'Failed to open the file "%s".\nExiting.' sys.exit() print links call(["open"]+links) </code></pre> |
2,750,176 | 0 | <p>To do this in gedit, try the <a href="http://www.stambouliote.de/projects/gedit_plugins_old.html" rel="nofollow noreferrer">Tab Converter</a> plugin.</p> <p>(Don't think there's a way to do it directly in Rails.)</p> |
571,881 | 0 | <p>Like this.</p> <pre><code>def threeGens( i, j, k ): for x in range(i): yield x for x in range(j): yield x for x in range(k): yield x </code></pre> <p>Works well. </p> |
20,723,602 | 0 | Bind event handler to "console.log" JavaScript event <p>My script sends text to the console output from several places in Javascript (see examples), how do I bind an event handler function to the log function itself so that a function is executed each time the event is triggered?</p> <pre><code>try { //some code } catch(e) { console.log("error: "+e) } function x(n) { //some code console.log(str) } </code></pre> |
21,817,327 | 0 | <p>Move <code>gem 'haml-rails'</code> out of <code>group :assets</code>. It should do the trick.</p> |
8,188,991 | 0 | <p>I am assuming you are doing this in PHP. It may not be elegant, but it gets it in one query. I think you want to display the table columns as well as the data in one query.</p> <pre><code><?php $sql = "SELECT * FROM $tablename"; $res = mysql_query($sql); $firstpass = TRUE; while($row = mysql_fetch_assoc($res)){ if($firstpass){ foreach($row as $key => $value) { //store all the column names here ($key) $firstpass = FALSE; } } //Collect all the column information down here. } ?> </code></pre> |
15,516,409 | 0 | <p>Like this</p> <pre><code>if @user.profile.prefecture.blank? 'not selected' else @user.profile.prefecture.name end </code></pre> |
21,612,719 | 0 | <p><code>strip_tags()</code> does not return anything. It strips off the tags in-place.</p> <p>The <a href="http://lxml.de/api/lxml.etree-module.html#strip_tags" rel="nofollow">documentation</a> says: "<em>Note that this will not delete the element (or ElementTree root element) that you passed even if it matches. It will only treat its descendants.</em>".</p> <p>Demo code:</p> <pre><code>from lxml import etree XML = """ <root> <entry-details>ABC</entry-details> </root>""" root = etree.fromstring(XML) ed = root.xpath("//entry-details")[0] print ed print etree.strip_tags(ed, "entry-details") # Has no effect print etree.tostring(root) print etree.strip_tags(root, "entry-details") print etree.tostring(root) </code></pre> <p>Output:</p> <pre><code><Element entry-details at 0x2123b98> <root> <entry-details>ABC</entry-details> </root> <root> ABC </root> </code></pre> |
21,570,318 | 0 | Understand Arraylist IndexOutOfBoundsException in Android <p>I get a lot of <code>IndexOutOfBoundsException</code> from the any <code>Arraylist</code> I use. Most of the times it works fine but sometimes I get this annoying error on <code>Arraylists</code> i use on my project.</p> <p>The main cause is always either</p> <pre><code>java.util.ArrayList.throwIndexOutOfBoundsException: Invalid index 3, size is 3 </code></pre> <p>or</p> <pre><code>java.util.ArrayList.throwIndexOutOfBoundsException: Invalid index 0, size is 0 </code></pre> <p>Help me understand the main cause of this error as no matter how many answers I've searched they don't completely help me.</p> |
16,025,543 | 0 | <p>Got it working with just a few changes.</p> <ul> <li>Each entry in <code>App.Transaction.FIXTURES</code> should specify an <code>account</code> property instead of <code>account_id</code></li> <li>unless you have some <code>{{date}}</code> helper defined elsewhere, <code>{{date transaction.date}}</code> won't work. Replaced with just <code>{{transaction.date}}</code></li> <li>Instead of <code>{{#linkTo 'transaction' this}}</code> it should be <code>{{#linkTo 'transaction' transaction}}</code> - because <code>this</code> is a reference to the <code>account.index controller</code></li> </ul> <p>Posted working copy of the code here: <a href="http://jsfiddle.net/mgrassotti/bfwhu/2/">http://jsfiddle.net/mgrassotti/bfwhu/2/</a></p> <pre><code><script type="text/x-handlebars" id="account/index"> <h2>Transactions</h2> <table> <thead> <tr> <th>Date</th> <th>Item</th> <th>Amount</th> </tr> </thead> <tbody> {{#each model}} {{#each transaction in transactions}} <tr> <td>{{transaction.date}}</td> <td>{{#linkTo 'transaction' transaction}}{{transaction.name}}{{/linkTo}}</td> <td>&pound;{{transaction.amount}}</td> </tr> {{/each}} {{/each}} </tbody> </table> </script> App = Ember.Application.create({}); App.Router.map(function() { this.resource('account', function() { this.resource('transaction', { path: '/transaction/:transaction_id' }); }); }); App.IndexRoute = Ember.Route.extend({ redirect: function() { this.transitionTo('account'); } }); App.AccountIndexRoute = Ember.Route.extend({ model: function() { return App.Account.find(); } }); App.TransactionRoute = Ember.Route.extend({ model: function() { return App.Transaction.find(); } }); App.Store = DS.Store.extend({ revision: 12, adapter: 'DS.FixtureAdapter' }); App.Account = DS.Model.extend({ title: DS.attr('string'), transactions: DS.hasMany('App.Transaction') }); App.Account.FIXTURES = [ { id: 1, title: 'Your account', transactions: [1, 2, 3] }]; App.Transaction = DS.Model.extend({ date: DS.attr('date'), name: DS.attr('string'), amount: DS.attr('number'), paidWith: DS.attr('string'), account: DS.belongsTo('App.Account') }); App.Transaction.FIXTURES = [ { id: 1, date: new Date(2012, 04, 17), name: 'Item 1', amount: 10, paidWith: 'credit card', account: 1 }, { id: 2, date: new Date(2012, 04, 01), name: 'Item 2', amount: 50, paidWith: 'cash', account: 1 }, { id: 3, date: new Date(2012, 03, 28), name: 'Item 3', amount: 100, paidWith: 'bank transfer', account: 1 } ]; </code></pre> |
5,433,560 | 0 | <p>If 2 variables have the same name in the same scope they will clash, the latter definition will overwrite the former.</p> <p>If for some reason you cannot edit the variable names, you could wrap the entire blocks of code in separate, anonymous functions:</p> <pre><code>$(function(){.....}); </code></pre> <p>This will put the 2 vars in separate scopes as long as you define them with <code>var</code>, so they will not clash. This may cause issues if parts of your scripts need the vars from the other. </p> |
36,129,082 | 0 | Android: Calling method from thread <p>I have a handler for a thread in my <code>MainActivity</code> that calls a method named <code>UpdateGUI</code>.</p> <p>Both the handler/thread declaration and the method are within the <code>MainActivity</code>.</p> <p>This is the handler Declaration:</p> <pre><code>Handler handlerData = new Handler(); private Runnable runnableCode2 = new Runnable() { @Override public void run() { Log.d("Handlers","GET TOTAL RX BYTES: "+Long.toString(res) ); //Some code here that doesn't matter/ UpdateGUI(); } handlerData.postDelayed(runnableCode2, 1*6000); } }; </code></pre> <p>And <code>UpdateGUI</code> is as follows:</p> <p><code>public void UpdateGUI(){ Log.d("Updater", "STARTING UPDATE"); //Code that doesn't matter here} }</code></p> <p>From the logger I can see that <code>UpdateGUI()</code> is not being called from the thread. Can you explain why this is happening and how it can be fixed?</p> <p>Just to clarify. The thread is running,but for some reason it doesn't make the call to UpdateGUI().</p> |
36,406,507 | 0 | <p>we are using the following options when calling .getPicture:</p> <pre><code>quality: 50, destinationType: Camera.DestinationType.DATA_URL, encodingType: Camera.EncodingType.JPEG, sourceType: Camera.PictureSourceType.CAMERA, targetWidth: 800, correctOrientation: true </code></pre> <p>The quality parameter doesn't seem to have too much implication on file size, though. targetWidth and, for some odd reason, correctOrientation do. The resultung picture size with these settings is around 24kB depending on the device's camera resolution.</p> |
23,328,258 | 0 | <p>It sounds like your VBA script is in an Excel spreadsheet, and you want it to automatically execute when you invoke the .xls(x) from Firefox.</p> <p>If so, you can try this:</p> <p>1) Write your VBA as an "Auto_Open macro" or use the "Open" event on your worksheet:</p> <p><a href="http://office.microsoft.com/en-us/excel-help/running-a-macro-when-excel-starts-HA001034628.aspx" rel="nofollow">http://office.microsoft.com/en-us/excel-help/running-a-macro-when-excel-starts-HA001034628.aspx</a></p> <p>2) Make sure your Windows file associations are set so that Firefox will open your .xls(x) file or link with MS Excel </p> <p>3) You can use a <a href="http://www.cs.tut.fi/~jkorpela/fileurl.html" rel="nofollow">file URL</a>, format <code>file://host/path</code> to link to the document</p> |
29,625,739 | 0 | Spring security additional rights on some entity <p>we have implemented a web application and use spring's pre-post-annotations to secure the access to some rights.</p> <p>At the moment it is quite simple. We have companies. You can have read/write/admin permission on a company.</p> <pre><code>public class Company { @Id private Long id; private String name; } </code></pre> <p>So we have the database tables user, company and of course the spring security tables acl_class, acl_entry, acl_object_identity and acl_sid.</p> <p>Now there are special entities underlying a company, let's say this is the employee.</p> <pre><code>public class Employee { @Id private Long id; private String name; private Company company; } </code></pre> <p>One company can have many employees and a employee can only be employed at one company.</p> <p>Now not every user may have read/right access onto a employee. The user must have a read/write/admin right to a company AND has to have a special right to read/write/admin the employee. So it is possible a user can have a write permission to company X but not even read access to company X's employees. A user may have only read access to company Y and write access to all employees of company Y.</p> <p>There shall be no further limitations on specific employees. Just all employees of one company.</p> <p>I actually don't want to manage dynamically all acl objects for every employee but be a little more dynamic. I'm thinking of something like a "permission flag", extending a base permission on a company-permission. Do you have an idea how I could solve this most elegant and easy?</p> <p>I didn't find a good example in the spring security documentation. Is this a bad practice?</p> <p>Thanks a lot for help :-)</p> |
36,247,450 | 0 | How get number from argument line? <p>I have this code </p> <pre><code>#include<stdio.h> int main(int argc, char * argv[]){ printf("%i\n", (int) *argv[1]) } </code></pre> <p>when I execute compiled code with command <em>./a.out 6</em> it prints number 54, but I need exactly 6.</p> |
11,792,933 | 0 | Can We show the string value as a measure on mondrian olap <p>I want to show the string value as one of the measure value. When a fact table has a integer value and string value respectively and also has some foreign table's keys. Then I could show the integer value as a measure value, but I couldn't show the string value as a measure. Because <a href="http://mondrian.pentaho.com/documentation/xml_schema.php#Measure" rel="nofollow">Measure element</a> in schema of cube (written in XML) doesn't allow that a measure value doesn't have 'aggregator'(It specify the aggregate function of measure values). Of course I understood that we can't aggregate some string values. But I want to show the string value of the latest level in hierarchy.</p> <p>I read following article. <a href="http://type-exit.org/adventures-with-open-source-bi/wp-content/uploads/2010/07/display_props.png" rel="nofollow">A figure</a> (around middle of this page) shows a cube that contains string value as a measure value. But this is an example of Property value of Dimension table, so this string value isn't contain in fact table. I want to show the string value that contains in fact table.</p> <p><a href="http://type-exit.org/adventures-with-open-source-bi/2010/07/a-simple-date-dimension-for-mondrian-cubes/" rel="nofollow">A Simple Date Dimension for Mondrian Cubes</a></p> <p>Anyone have some idea that can be shown the string value as a measure value? Or I have to edit Mondrian's source code?</p> |
10,953,442 | 0 | <p>Here is one way to achieve this by folding within the <code>Iteratee</code> and an appropriate (kind-of) State accumulator (a tuple here)</p> <p>I go read the <code>routes</code> file, the first byte will be read as a <code>Char</code> and the other will be appended to a <code>String</code> as UTF-8 bytestrings.</p> <pre><code> def index = Action { /*let's do everything asyncly*/ Async { /*for comprehension for read-friendly*/ for ( i <- read; /*read the file */ (r:(Option[Char], String)) <- i.run /*"create" the related Promise and run it*/ ) yield Ok("first : " + r._1.get + "\n" + "rest" + r._2) /* map the Promised result in a correct Request's Result*/ } } def read = { //get the routes file in an Enumerator val file: Enumerator[Array[Byte]] = Enumerator.fromFile(Play.getFile("/conf/routes")) //apply the enumerator with an Iteratee that folds the data as wished file(Iteratee.fold((None, ""):(Option[Char], String)) { (acc, b) => acc._1 match { /*on the first chunk*/ case None => (Some(b(0).toChar), acc._2 + new String(b.tail, Charset.forName("utf-8"))) /*on other chunks*/ case x => (x, acc._2 + new String(b, Charset.forName("utf-8"))) } }) } </code></pre> <p><strong>EDIT</strong></p> <p>I found yet another way using <code>Enumeratee</code> but it needs to create 2 <code>Enumerator</code> s (one short lived). However is it a bit more elegant. We use a "kind-of" Enumeratee but the <code>Traversal</code> one which works at a finer level than Enumeratee (chunck level). We use <code>take</code> 1 that will take only 1 byte and then close the stream. On the other one, we use <code>drop</code> that simply drops the first byte (because we're using a Enumerator[Array[Byte]])</p> <p>Furthermore, now <code>read2</code> has a signature much more closer than what you wished, because it returns 2 enumerators (not so far from Promise, Enumerator)</p> <pre><code>def index = Action { Async { val (first, rest) = read2 val enee = Enumeratee.map[Array[Byte]] {bs => new String(bs, Charset.forName("utf-8"))} def useEnee(enumor:Enumerator[Array[Byte]]) = Iteratee.flatten(enumor &> enee |>> Iteratee.consume[String]()).run.asInstanceOf[Promise[String]] for { f <- useEnee(first); r <- useEnee(rest) } yield Ok("first : " + f + "\n" + "rest" + r) } } def read2 = { def create = Enumerator.fromFile(Play.getFile("/conf/routes")) val file: Enumerator[Array[Byte]] = create val file2: Enumerator[Array[Byte]] = create (file &> Traversable.take[Array[Byte]](1), file2 &> Traversable.drop[Array[Byte]](1)) } </code></pre> |
5,243,226 | 0 | <blockquote> <p>The following code</p> </blockquote> <p>is missing. </p> <p>Anyway when I was using WatiN + Nunit + MSVS, I had this configuration in my testing project:</p> <pre><code><?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="NUnit"> <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/> </sectionGroup> </configSections> <NUnit> <TestRunner> <!-- Valid values are STA,MTA. Others ignored. --> <add key="ApartmentState" value="STA" /> </TestRunner> </NUnit> </configuration> </code></pre> |
24,266,101 | 0 | Keep Empty Factor Levels During Aggregation <p>I'm using data.table to aggregate values, but I'm finding that when the "by" variable has a level not present in the aggregation, it is omitted, even if it is specified in the factor levels.</p> <p>The code below generates a data.table with 6 rows, the last two of which only have one of the two possible levels for f2 nested within f1. During aggregation, the {3,1} combination is dropped.</p> <pre><code>set.seed(1987) dt <- data.table(f1 = factor(rep(1:3, each = 2)), f2 = factor(sample(1:2, 6, replace = TRUE)), val = runif(6)) str(dt) Classes ‘data.table’ and 'data.frame': 6 obs. of 3 variables: $ f1 : Factor w/ 3 levels "1","2","3": 1 1 2 2 3 3 $ f2 : Factor w/ 2 levels "1","2": 1 2 2 1 2 2 $ val: num 0.383 0.233 0.597 0.346 0.606 ... - attr(*, ".internal.selfref")=<externalptr> dt f1 f2 val 1: 1 1 0.3829077 2: 1 2 0.2327311 3: 2 2 0.5965087 4: 2 1 0.3456710 5: 3 2 0.6058819 6: 3 2 0.7437177 dt[, sum(val), by = list(f1, f2)] # output is missing a row f1 f2 V1 1: 1 1 0.3829077 2: 1 2 0.2327311 3: 2 2 0.5965087 4: 2 1 0.3456710 5: 3 2 1.3495996 # this is the output I'm looking for: f1 f2 V1 1: 1 1 0.3829077 2: 1 2 0.2327311 3: 2 2 0.5965087 4: 2 1 0.3456710 5: 3 1 0.0000000 # <- the missing row from above 6: 3 2 1.3495996 </code></pre> <p>Is there a way to achieve this behavior?</p> |
10,441,943 | 0 | php undefined index error with if/else shortcode <p>I am trying to clean up my error log. This error is still generated:</p> <pre><code>[Tue Apr 24 06:09:32 2012] [error] [client 44.444.69.28] PHP Notice: Undefined index: current_id in /srv/www/virtual/website.com/htdocs/wp-content/themes/mimbo/sidebar.php on line 12 </code></pre> <p>from this code:</p> <pre><code>$posts = get_posts('numberposts=4&exclude=' . isset($GLOBALS['current_id']) ? $GLOBALS['current_id'] : '' . '&category='. $category->term_id); </code></pre> <p>and I have also tried this:</p> <pre><code>$posts = get_posts('numberposts=4&exclude=' . array_key_exists('current_id',$GLOBALS) ? $GLOBALS['current_id'] : '' . '&category='. $category->term_id); </code></pre> <p>I added the if/else shortcode to check the current id which I thought would eliminate the error, but it still has not gone away.</p> |
16,207,308 | 0 | <p>You could try and have a hook on the server, triggered when receiving (like, for instance, this <a href="https://github.com/kwangchin/GitHubHook" rel="nofollow"><strong>GitHubHook</strong>: a GitHub Post-Receive Deployment Hook</a>), which would:</p> <ul> <li>modify the local <code>.git/config</code> file</li> <li>adding a user.name and user.email in said config file</li> </ul> <p>That would presume the deploys commits are done <em>before</em> the next push from GitHub to the server, otherwise, the wrong credential would be used.</p> <p>If the previous point is a concern, then you can improve that by:</p> <ul> <li>storing those credentials elsewhere, in order of the deployments, </li> <li>and make sure the deploy commits are done with a <code>git commit --author='AUserName <[email protected]></code>, with name and email extracted from the separate file, based on the recorded order.</li> </ul> <p>In that last case, no need to modifying a local config: you build your <code>git commit</code> command with the right parameters, instead of relying on a local config file content.</p> |
8,512,536 | 0 | Using RVM gemsets inside of Vim <p>I have set up a <code>.rvmrc</code> file for my project, which simply looks like this</p> <pre><code>rvm use 1.9.3@myproj </code></pre> <p>My Vim workflow is to <code>:cd</code> into the project's directory and then use CommandT to navigate between files and execute specs via <code>:!bundle exec rspec %</code>.</p> <p>The problem is, that when I add something to my Gemfile and run <code>bundle install</code> from terminal and then go back to MacVim, it tells me to run <code>bundle install</code> again.</p> <p>When I do <code>:!rvm gemset gemdir</code>, it shows me that it's not using the desired gemset, meaning it returns only </p> <pre><code>/Users/darth/.rvm/gems/ruby-1.9.3-p0 </code></pre> <p>instead of </p> <pre><code>/Users/darth/.rvm/gems/ruby-1.9.3-p0@myproj </code></pre> <p>I tried doing <code>:!rvm gemset use myproj</code> but it doesn't seem to work.</p> <pre><code>:!rvm gemset use myproj /Users/darth/.rvm/bin/rvm: line 44: typeset: -g: invalid option typeset: usage: typeset [-afFirtx] [-p] name[=value] ... RVM is not a function, selecting rubies with 'rvm use ...' will not work. Using /Users/darth/.rvm/gems/ruby-1.9.3-p0 with gemset myproj </code></pre> <p>because if I do <code>:!rvm gemset gemdir</code> right after that, it still returns the default path, not the <code>@myproj</code> gemset.</p> <p>I'm using MacVim on OS X Lion, but I'm having the same problem in terminal Vim too.</p> |
2,555,747 | 0 | <p>Another approach is to use <a href="http://www.amfphp.org/" rel="nofollow noreferrer">amfphp library</a> and thus send/receive data in Flash native AMF format which Flash can fast way faster.</p> |
16,309,424 | 0 | force-skip the Stripe connect account application form <p>The Stripe <a href="https://stripe.com/docs/connect/getting-started" rel="nofollow">getting started guide</a> suggests that you can force-skip the bank information form when testing your oAuth flow in development. How do I do this?</p> |
6,317,867 | 0 | <p><strong>Update 2013/2014</strong>: as <a href="http://stackoverflow.com/a/16166803/6309">mentioned below</a> by <a href="http://stackoverflow.com/users/541412/abbafei">Abbafei</a>, there is a <strong>beta version</strong> (as of Oct. 2014) for Windows.</p> <blockquote> <p>version 5.20140221</p> <p>The Windows port of the assistant and webapp is now considered to be beta quality. There are important missing features (notably Jabber), documented on windows support, but the webapp is broadly usable on Windows now.</p> </blockquote> <p>The most recent update for Windows (<a href="http://git-annex.branchable.com/devblog/day_219__catching_up_and_looking_back/" rel="nofollow">day 219, Sept. 13th, 2014</a>), mentions:</p> <blockquote> <p>Windows support improved more than I guessed in my wildest dreams.</p> <p><code>git-annex</code> went from working not too well on the command line to being pretty solid there, as well as having a working and almost polished webapp on Windows.<br> There are still warts -- it's Windows after all!</p> </blockquote> <p>So the situation is improving, but that remains a work in progress.</p> <hr> <p>Original answer (June 2011)</p> <p>That <a href="http://www.mail-archive.com/[email protected]/msg00233.html" rel="nofollow">recent thread</a> (March 2011) doesn't leave much hope:</p> <blockquote> <p>Well, I can tell you that it assumes a POSIX system, both in available utilities and system calls, So you'd need to use cygwin or something like that. (Perhaps you already are for git, I think git also assumes a POSIX system.) So you need a Haskell that can target that.<br> What this page refers to as "<a href="http://www.haskell.org/ghc/docs/6.6/html/building/platforms.html" rel="nofollow">GHC-Cygwin</a>": I don't know where to get one.<br> Did find <a href="http://copilotco.com/mail-archives/haskell-cafe.2007/msg00824.html" rel="nofollow">this thread</a>.<br> (There are probably also still some places where it assumes / as a path separator, although I fixed some.) FWIW, git-annex works fine on OS X and other fine proprietary unixen. ;P</p> </blockquote> <p>You also find that coment in this <a href="http://git-annex.branchable.com/bugs/git-annex_directory_hashing_problems_on_osx/" rel="nofollow">bug report</a> (March 2011):</p> <blockquote> <p>Currently the hashed directories in <code>.git-annex</code> allow for upper and lower case directory names... on linux (or any case sensitive filesystem) the directory names such as '<code>Gg</code>' and '<code>GG</code>' are different and unique.<br> However on systems like OSX (<strong>and probably windows if it is ever supported</strong>) the directory names '<code>Gg</code>' is the same as '<code>GG</code>'</p> </blockquote> |
20,150,737 | 0 | <p>Give this a try.</p> <pre><code><script> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-4XXXXXXX-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </code></pre> <p>If you just set this up, you should be able to see analytics in the "Realtime" panel. Many of the other panels can take over a day before analytics are visible.</p> <p>If you're using Google Chrome, you might also try the tag debugger plugin by <a href="https://chrome.google.com/webstore/detail/observepoint-tag-debugger/daejfbkjipkgidckemjjafiomfeabemo?hl=en-US">ObservePoint</a> or the <a href="https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk?hl=en">Official Tag assistant plugin by Google</a></p> |
326,650 | 0 | Vertically align text within input field of fixed-height without display: table or padding? <p>The line-height property usually takes care of vertical alignment, but not with inputs. Is there a way to automatically center text without playing around with padding?</p> |
7,504,465 | 0 | K2 is a Windows Server platform that allows the creation and management of business workflows that consume data from a variety of data sources; on top of the .Net platform. |
9,836,915 | 0 | how windows media player call third-party Decoder MFT? <p>According the decoder sample in Windows SDK, I realize myself decoder MFT, but there is one question about third-party MFT. I register a amr codec MFT, debug with windows sample code), connect the topology manually, it can play normally. But if I run windows media player, it doesn't play the file include amr codec.</p> <p>What should I do? Windows media player can call my codec MFT automatically.</p> <p>Other question is about MERIT like directshow.</p> |
31,686,204 | 0 | Displaying a legend in a line chart using Telerik UI for Xamarin <p>How can I display a legend in a line chart using Telerik's UI for Xamarin?</p> <p>Is it possible to accomplish this without creating a customer renderer?</p> <p>Thanks for the help,</p> <p>Anthony</p> |
11,869,768 | 0 | <p>If I'd had to do that I would try it the following way:</p> <p>add some <code>Uri</code> that when you insert or delete using that <code>Uri</code> triggers database deletion inside your <code>ContentProvider</code>. When deleting also clear all references to the <code>SQLiteDatabase</code> since it is possible that you can still access the old database file through that (If you delete a file in Linux and you have that file open you can still use it - it's just no longer accessible via the path).</p> <p>By putting the deletion inside the <code>ContentProvider</code> you should be able to close the database connection and track the deletion state in a way that you know that you need to recreate the database file.</p> <p><code>ContentProviders</code> don't quit unless you kill your app so you probably have the same instance running and probably references to the old file as mentioned above</p> |
40,381,603 | 0 | Is there an appropriate way to inject a service into singleton? <h2>Update</h2> <p>I will leave this question for now since there may or may not be a valid use case for something like this. For my case this was a design problem and instead of using a Singleton, I found a natural location to create an instance of a plain object and pass a reference to it were ever it is needed. Since it's now a plain object I can use constructor injection again. </p> <hr> <h2>Original question</h2> <p>I have what I think is an appropriate use of a Singleton. It's an object that will lazily load the images for folders and filetypes for use in a <a href="http://jruby.org" rel="nofollow noreferrer">JRuby</a>, <a href="https://www.eclipse.org/swt" rel="nofollow noreferrer">SWT</a> application.</p> <p>The class will look something like below. The methods need an instance of Display to create the images.</p> <p>The question is, what's the appropriate to inject the Display object and why? I was thinking of using a <code>begin ... rescue</code> block to set the value of @display to nil if the Display is not available and then providing a setter for unit testing. </p> <p>I always wonder if I am doing something wrong when I think I need a Singleton, even more so when I need to do something unusual with a Singleton, so I would not rule other other options.</p> <pre><code>require "singleton" class FileSystemIcons include Singleton attr_accessor :display, :cached_folder_image, :cached_file_images def initialize @display = Display.display @cached_folder_image = nil @cached_file_images = {} end def folder_image unless cached_folder_image ... self.cached_folder_image = converted_image end cached_folder_image end def file_image file_name ... unless cached_file_images[ext] ... cached_file_images[ext] end end end </code></pre> |
5,229,744 | 0 | <p>You have to use iTune to run a .ipa file. But iTunes can be used to run .ipa files on devices only. </p> |
13,321,307 | 0 | <p>Are you sure <code>$s</code> is a string and not an array? If it is an array, <code>$s.Length</code> will be the number of elements in the array and you could get the error that you are getting.</p> <p>For example:</p> <pre><code>PS > $str = @("this", "is", "a") PS > $str.SubString($str.Length - 1) Exception calling "Substring" with "1" argument(s): "startIndex cannot be larger than length of string. Parameter name: startIndex" At line:1 char:1 + $str.SubString($str.Length - 1) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ArgumentOutOfRangeException </code></pre> |
36,773,463 | 0 | reactjs radio group setting checked attribute based on state <p>Clicking on the second radio button changes the state which triggers the render event. However, it renders the first radio button as the checked one again even though state.type got changed.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var MyComponent = React.createClass({ getInitialState: function() { return { type: 1 }; }, render: function() { console.log('->> type: ' + this.state.type);//prints the expected value return (<div className="my-component"> <label>type 1</label> <input ref="type1Selector" type="radio" name="type" id="type1" onChange={this.changeHandler} checked={this.state.type === 1}/><br/> <label>type 2</label> <input ref="type2Selector" type="radio" name="type" id="type2" onChange={this.changeHandler} checked={this.state.type === 2}/><br/> </div>); }, changeHandler: function(e) { e.preventDefault(); var t = e.currentTarget; if(t.id === 'type1') { this.setState({type: 1}); } else { this.setState({type: 2}); } } }); ReactDOM.render(<MyComponent />, document.getElementById('container'));</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react-with-addons.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.0.1/react-dom.min.js"></script> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> </head> <body> <div id="container"></div> </body> </html></code></pre> </div> </div> </p> <p>Can someone tell how to get this to work and why react is behaving like this?</p> |
26,989,848 | 0 | How to get Host of other flow in Mule? <p>I have 2 APIs: </p> <ul> <li>API A with endpoint: <code>http://hostnameA/pathA</code></li> <li>API B with endpoint: <code>http://hostnameB/pathB</code></li> </ul> <p>API A call API B, that mean: Client send request -> API A -> API B. Now I want to get hostname of API A at API B (Note: API B is created by me, API A is create by other, I can not touch API A). </p> <p>Please let me know how to get hostname of API A?</p> |
5,734,304 | 0 | c++ boost split string <p>I am using the <code>boost::split</code> method to split a string as this:</p> <p>I first make sure to include the correct header to have access to <code>boost::split</code>:</p> <pre><code>#include <boost/algorithm/string.hpp> </code></pre> <p>then:</p> <pre><code>vector<string> strs; boost::split(strs,line,boost::is_any_of("\t")); </code></pre> <p>and the line is like</p> <pre><code> "test test2 test3" </code></pre> <p>This is how I consume the result string vector:</p> <pre><code>void printstrs(vector<string> strs){ for(vector<string>::iterator it = strs.begin();it!=strs.end();++it){ cout<<*it<< "-------"; } cout<<endl; } </code></pre> <p>But why in the result <code>strs</code> I only get <code>"test2"</code> and <code>"test3"</code>, shouldn't be <code>"test"</code>, <code>"test2"</code> and <code>"test3"</code>, there are <code>\t</code> (tab) in the string.</p> <p><strong>Updated Apr 24th, 2011:</strong> It seemed after I changed one line of code at <code>printstrs</code> I can see the first string. I changed </p> <pre><code>cout<<*it<< "-------"; </code></pre> <p>to </p> <pre><code>cout<<*it<<endl; </code></pre> <p>And it seemed <code>"-------"</code> covered the first string somehow.</p> |
32,229,591 | 0 | Why does the case statement doesn't take variables? <p>I know that this is a silly question,but I wanted to know why the case label doesn't take variables. The code is-</p> <pre><code>public class Hello { public static void main(String[] args) { final int y=9; int a=1,b=2,c=3; switch(9) { case y: { System.out.println("Hello User"); break; } case a: { System.out.println("Hello World"); break; } case b: { System.out.println("Buff"); break; } default: { System.out.println("Yo bitch"); break; } } } } </code></pre> <p>Although, I have initialized a,b and c,yet it is showing errors.Why?</p> |
11,078,616 | 0 | <p>Under Linux (and maybe some other unix-based operating systems), you can mount a formatted image file using the <code>-o loop</code> option of the mount command:</p> <pre><code>mount -o loop /path/to/image_file mount_point </code></pre> |
38,923,431 | 0 | <p>You should use reflection to get into relative path:</p> <pre><code>public static string PredictAbsoluteFilePath(string fileName) { return Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), fileName); } </code></pre> <p>You can use it like this:</p> <pre><code>string path = Utils.PredictAbsoluteFilePath("relativeFile.xml"); //assuming that currect executing file is in D:\Programs\MyApp directory //path is now 'D:\Programs\MyApp\relativeFile.xml' </code></pre> |
15,660,385 | 0 | <p>I can't speak to the first question directly, but assuming that @korefn and @om-nom-nom are correct; that the block is a closure and is interpreting the return as a void.</p> <p>In response to your update, I would try:</p> <pre><code>@for(i <- 1 to 10) { <option value="@i">@i</option> } </code></pre> <p>which is how I've used it in the past. I've also found it helpful to use a nested @if block to handle the selected option differently so that it is selected on loading the document.</p> |
7,696,001 | 0 | How to create a incomming call broad receiver programatically <p>I have managed to put a broadcast receiver from the manifest file, it looks like this:</p> <pre><code> <receiver android:name=".BReceivers.CallBReciever"> <intent-filter> <action android:name="android.intent.action.PHONE_STATE" /> </intent-filter> </receiver> </code></pre> <p>Now what i am trying to do is to take it out of the manifest and start it only when the user presses a certain button, which should look somethings like this:</p> <pre><code> Button start = (Button) findViewById(R.id.Button_Start); start.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { @Override public void onReceive(Context context, Intent arg1) { Log.d("aaa", "bbb"); switch (getResultCode()) { } } }, new IntentFilter(Intent.ACTION_CALL)); } } }); </code></pre> <p>But i don't get into the receiver, any idea why? what IntentFilter String param should i use?</p> |
1,308,566 | 0 | <pre><code>elem.nextSibling.nodeValue.replace('\n', '') </code></pre> <p>The replace is to get rid of the newline (may be different on different OSes, I am running Windows) character which is there for some reason.</p> |
12,072,825 | 0 | <p>I think converting the switch expression to unsigned type will do the trick.</p> <pre><code>switch((unsigned char)ent->d_name[i]) { ... } </code></pre> |
27,095,846 | 0 | While loop for converting Celsius to Fahrenheit Java <pre><code>import java.util.*; public class lab1 { public static void main(String args []) { double Fahrenheit; int celsius = 0; while (celsius <= 15); Fahrenheit= (9.0/5.0 * celsius) + 32; System.out.println( "Fahrenheit:" + Fahrenheit + "celsius:" + celsius); celsius++; } } </code></pre> <p>I have a problem with this program. I get no compile errors, but when I run it it doesn't display the results. Celsius temperature is given and I need to add 1 every time I find the Fahrenheit. Also: how do I show the results in two columns, like in the example below (instead of math and English I want to put Fahrenheit and Celsius)</p> <pre><code>Math scores English scores 0 0 2 2 3 7 4 10 2 0 2 1 </code></pre> |
23,160,927 | 0 | <p>You have to pass the delegate into the method with out the "Cattle Wars" parameter</p> <pre><code> testDel(p.handler); </code></pre> <p>Then you method should look like the following.</p> <pre><code> public void testDel(Del d) { d.Invoke("L"); } </code></pre> <p>I will have to say that delegates still seem strange to me. I know that they are just variables that are type safe and thread safe. You can use the variable just like calling the method name.</p> <pre><code> public delegate void Del(string e); Del handler = DelegateMethod; </code></pre> <p>In your example here your delegate can be set to any method that has a return type of <strong>void</strong> and takes one argument that is a string. </p> <pre><code> Del handler = DelegateMethod; </code></pre> <p>The above is where you declare you delegate but you also can declare the delegate to any methods that excepts void and one parameter as a string.</p> <pre><code> handler = BaseBall; public void BaseBall(string a) { //code here } </code></pre> <p>I would just keep reading you will learn as you go.</p> |
10,025,091 | 0 | The present of FileOutputStream cause the InputStream.read error <p>I have some problem with Java IO, this code below is not working, the variable count return -1 directly.</p> <pre><code>public void putFile(String name, InputStream is) { try { OutputStream output = new FileOutputStream("D:\\TEMP\\" + name); byte[] buf = new byte[1024]; int count = is.read(buf); while( count >0) { output.write(buf, 0, count); count = is.read(buf); } } catch (FileNotFoundException e) { } catch (IOException e) { } } </code></pre> <p>But if I commented the OutputStream such as</p> <pre><code> public void putFile(String name, InputStream is) { try { //OutputStream output = new FileOutputStream("D:\\TEMP\\" + name); byte[] buf = new byte[1024]; int count = is.read(buf); while( count >0) { //output.write(buf, 0, count); count = is.read(buf); } } catch (FileNotFoundException e) { } catch (IOException e) { } } </code></pre> <p>The count will return the right value (>-1). How is this possible ? Is it a bug ?</p> <p>I'm using Jetty in Eclipse with Google plugins and Java 6.21 in Windows 7. PS :I change the original code, but it doesn't affect the question</p> |
21,813,359 | 0 | <p>The first 5 constructor calls are clear. Then there 3 destructor calls. The first <code>c</code> array was declared inside a block:</p> <pre><code>{ C c[2] //... } // objects in c are destroyed </code></pre> <p>When the block is left then all objects that were created non-dynamically inside the block are destroyed by calling their destructor. So there is the first destructor call from your <code>delete p2</code> and then two other destructor calls for destroying the two objects contained in the array. The same holds for the last four destructor calls at the end: the first destructor call os from your <code>delete p1</code> and the other three destructor calls are for the <code>C c[2]</code> that was declared outside the block and for destroying the <code>c1</code> object.</p> |
22,458,849 | 0 | No armeabi folder <p>I´m trying to integrate SQLCipher with my android application. I´m getting the following error when running the app:</p> <p><strong>java.lang.Unsatisfiedlinkerror Couln´t load stlport_shared: find library returned NULL</strong></p> <p>The thing is i have already add to my classpath the following JARS</p> <p>commons-codec.jar</p> <p>guava-r09.jar</p> <p>sqlcipher.jar</p> <p><strong>In the instructions it says, u have to add 3 .os files into armeabi folder inside libs, but in my libs folder I only have android-suppor-v4.jar</strong></p> <p>What do I have to do? Any ideas?</p> <p>Regards!</p> |
14,331,978 | 0 | <p>I'm thinking all you are really looking for is where <a href="http://en.wikipedia.org/wiki/Line_segment_intersection" rel="nofollow">line segment intersections</a>. This can be done in O((N+k) log N), where N is the number of line segments (roughly the number of vertices) and k is the number of intersections. Using the Bentley-Ottmann algorithm. This would probably be best done using ALL of the polygons, instead of simply considering only two at a time. </p> <p>The trouble is keeping track of which line segments belong to which polygon. There is also the matter that considering all line segments may be worst than simply considering only two polygons, in which case you stop as soon as you get one valid intersection (some intersections may not meet your requirements to be count as an overlap). This method is probably faster, although it may require that you try different combinations of polygons. In which case, it's probably better to simply consider all line segments.</p> |
16,172,907 | 0 | <p>You can use the <a href="http://www.codeproject.com/Articles/168662/Time-Period-Library-for-NET" rel="nofollow">Time Period Library for .NET</a> to calculate overlapping and intersecting time periods.</p> |
15,324,248 | 0 | Delete selected/all rows from gridview with javascript <p>As the title says, I have a simple 5column/5rows GridView which represents a shopping cart in asp.net. I need to use javascript to delete selected row and all the rows on button click. How could that be done? Total price should change too when an item is removed. Thx in advance.</p> <p>This is sample aspx code:</p> <pre><code> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Kosarica.aspx.cs" Inherits="Spletna_kosarica_2.Kosarica" EnableSessionState="True" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <h2>Kosarica:</h2> <p> <asp:GridView ID="GridView1" runat="server" Width="440px" AutoGenerateSelectButton="True"> </asp:GridView> </p></div> &nbsp;<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Dodaj artikel" Width="143px" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Button ID="Button3" runat="server" Text="Remove" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:Label ID="Label1" runat="server" Text="Total price:"></asp:Label> &nbsp;<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> </form> </body> </html> </code></pre> |
20,865,945 | 0 | <p>You may have to do this with the beforeRender() function.</p> <p>These links may help.</p> <p><a href="http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/" rel="nofollow">http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/</a></p> <p><a href="http://www.yiiframework.com/wiki/54/" rel="nofollow">http://www.yiiframework.com/wiki/54/</a></p> |
39,716,494 | 0 | <p>You should have to understand the concept to use of volley library and image uploads. Here are some other useful links for image upload and use of volley library.</p> <p><a href="http://www.androidhive.info/2014/05/android-working-with-volley-library-1/" rel="nofollow">volley library</a></p> <p><a href="http://www.androidhive.info/2014/12/android-uploading-camera-image-video-to-server-with-progress-bar/" rel="nofollow">Image upload using multipart</a></p> <p>Note: I have also tested your tutorial.code are ok. Plz check your image path properly. If possible then use their php code on any hosted web server. and check their json response and coross check ur parameter which U have passed with server script's parameters..</p> |
11,929,291 | 0 | <p>You said "... when I send the same mail for outlook client ..."; did you mean <strong>from</strong> Outlook client?</p> <p>It's not required that attachments include a filename; perhaps Outlook isn't setting a filename for a .msg attachment. You can use the msgshow.java demo program that comes with JavaMail to dump out the entire structure and content of the message. You also might want to examine the raw MIME content of the message to see exactly what Outlook is sending you.</p> <p>Also, you might want to look at the "isMimeType" method to simplify your code. A message attachment should have a MIME type of message/rfc822.</p> |
15,146,877 | 0 | <p>Your program <em>does</em> have a visible error, precisely where it's failing:</p> <pre><code>optionlist.addActionListener((ActionListener) this); </code></pre> <p><code>this</code> is a reference to an instance of <code>hello</code>. The <code>hello</code> class doesn't implement <code>ActionListener</code> - so how would you expect that cast to succeed?</p> <p>The only implementation of <code>ActionListener</code> you've given is <code>OptionButtonHandler</code>. Perhaps you meant:</p> <pre><code>optionlist.addActionListener(new OptionButtonHandler()); </code></pre> <p>?</p> |
11,562,791 | 0 | How to Override target="_blank" in the kml popup <p>I'm loading a kml in a map from google using a code like this:</p> <pre class="lang-js prettyprint-override"><code>var myOptions = { mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); var kmlLayer = new google.maps.KmlLayer('https://maps.google.com/maps/ms?authuser=0&vps=2&ie=UTF8&msa=0&output=kml&msid=209879288832578501414.0004c52d678cf88f70685'); kmlLayer.setMap(map); </code></pre> <p>The problem is the link into the popup, <a href="https://developers.google.com/kml/documentation/kmlreference#description" rel="nofollow">kml adds</a> <code>target="_blank"</code> and I don't want it.</p> <p>How I can remove it using javascript? I found <a href="http://stackoverflow.com/a/1185271/842697">this answer</a> but it doesn't work in the API 3. I prefer not to use jQuery.</p> |
12,989,085 | 0 | <p>I've solved the problem setting a ScrollView as parent layout.</p> |
9,452,116 | 0 | <p>Some characters in Url are reserved characters and have special meaning. To use them in Url parameters they must be properly <a href="http://en.wikipedia.org/wiki/Percent-encoding" rel="nofollow">URL encoded</a>.</p> <pre><code>/?link=http://a-link.com </code></pre> <p>is not a proper URL. It should be:</p> <pre><code>/?link=http%3A%2F%2Fa-link.com </code></pre> |
12,317,266 | 0 | <p>Niether, use <code>MatcherAssert</code> and <code>Hamcrest</code> with <code>assertThat</code> instead of <code>assertTrue</code> / <code>assertFalse</code></p> <p><a href="http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/MatcherAssert.html" rel="nofollow">MatcherAssert</a></p> |
22,918,592 | 0 | ∞ not displaying inside span tag <p>I am currently having an issue with getting any HTML entity to display while inside a span. I am currently trying to get <code>&infin;</code> to show up if my object has no destroy date. If I move the entity outside the span it will appear. Below is the code before it is rendered:</p> <pre><code><tr> <th> Deactivate Date </th> <td> <span edit> <%= text_field_tag 'destroy_date', @account_type.destroy_date %> </span> <span show> <%= @account_type.destroy_date.present? ? @account_type.destroy_date : '&infin;'.html_safe %> </span> </td> </tr> </code></pre> <p>Here is how the code is rendered if @account_types.destroy_date is not present.</p> <pre><code><tr> <th> Deactivate Date </th> <td class="clickable"> <span edit="" style="display: none;"> <input id="destroy_date" name="destroy_date" type="text" last-value="" class="hasDatepicker"> </span> <span show="" style="display: inline-block;">&nbsp;</span> </td> </tr> </code></pre> |
20,456,794 | 0 | <p>I found the followin exsample on ibm sites:</p> <pre><code>select t1.timeid, t1.storeid, t1.sales from time, store, table (cvsample.salesfunc(time.timeid, store.storeid)) as t1 where time.timeid = t1.timeid and store.storeid = t1.storeid; </code></pre> <p>notice the syntax: <strong>table (cvsample.salesfunc(time.timeid, store.storeid)) as t1</strong></p> <p>so you prob dont need fields and 'as' you still need '*' and the 'FROM'</p> <p>so </p> <pre><code>INSERT INTO STUDENT_TMP SELECT * FROM Table (MyDB.fn_getStudent()) </code></pre> |
4,675,924 | 0 | <p>The first thing I notice is that you've got a lot of functions that do basically the same thing (with some numbers different). I would investigate adding a couple of parameters to that function, so that you can describe the direction you're going. So for example, instead of calling <code>right()</code> you might call <code>traverse(1, 0)</code> and <code>traverse(0, -1)</code> instead of <code>up()</code>.</p> <p>Your <code>traverse()</code> function declaration might look like:</p> <pre><code>int traverse(int dx, int dy) </code></pre> <p>with the appropriate changes inside to adapt its behaviour for different values of <code>dx</code> and <code>dy</code>.</p> |
31,399,101 | 0 | Black Screen after splash screen iOS, Swift, Xcode 6.4 <p>I'm using Xcode 6.4 my apps stimulator build successfully then splash screen then a black screen appear and it was stack. I tried different project same things appears black screen again but no errors.</p> |
23,101,595 | 0 | Memory management with changing rootViewController of window <p>I am changing rootViewController of window dynamically in my application in Non - ARC application.</p> <p>My question is do i need to release previously assigned rootViewController? How memory is management is done with previously allocated rootViewController?</p> <p>My Second question is about newrootViewController. how i can manage memory for new rootViewController for window.</p> <p>Any help will be appreciated.... </p> |
39,245,132 | 0 | DOM4J xpath-select colon node with namespace <p>Given the xml content is as below;</p> <pre><code><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><CreateResponse xmlns="http://gtestserver/"><CustomerId>8124138</CustomerId><InternalResponseCode>Success</InternalResponseCode><ResponseCode>0</ResponseCode><ResponseDate>2016-08-31T07:57:22.7760577Z</ResponseDate><ResponseDescription>Success</ResponseDescription><UserId>7424876375</UserId></CreateResponse></s:Body></s:Envelope> </code></pre> <p>I need to pickup the node :<strong>CustomerId</strong> ,but i cannot get it correctly ,the code i used here:</p> <pre><code> Document document = new SAXReader().read(new ByteArrayInputStream(xmlfile.getBytes("UTF-8"))); Node foundnode = null; Element rootElement = document.getRootElement(); String namespace = rootElement.getNamespaceURI(); if (namespace != null) { DefaultXPath defaultXPath = new DefaultXPath(xpath); Map<String, String> namespaces = new TreeMap<String, String>(); namespaces.put("ns", namespace); defaultXPath.setNamespaceURIs(namespaces); } foundnode = document.selectSingleNode("/ns:s:Envelope/ns:s:Body/ns:CreateResponse/ns:CustomerId"); </code></pre> <p>Then it throws below exception :</p> <pre><code>org.dom4j.InvalidXPathException: Invalid XPath expression: /ns:s:Envelope/ns:s:Body/ns:CreateResponse/ns:CustomerId Unexpected ':' at org.dom4j.xpath.DefaultXPath.parse(DefaultXPath.java:360) at org.dom4j.xpath.DefaultXPath.<init>(DefaultXPath.java:59) at com.github.becauseQA.xml.DOM4JUtils.getNodes(DOM4JUtils.java:152) at </code></pre> <p>I know it caused by the xpath used here ,but i don't know which xpath should i pickup here, you can see the node has : ,so when use the namespace with ns: for each node ,it cannot parse it . Anyone know how to pickup the node with namespace and special character in the node name ? thanks .</p> |
20,915,608 | 0 | How to pass error object to socket.io callback <p>I am using callbacks with socket.io </p> <p>Client code :</p> <pre><code>socket.emit('someEvent', {data:1}, function(err, result) { console.log(err.message); }); </code></pre> <p>Server code :</p> <pre><code>socket.on('someEvent', function(data, callback) { callback(new Error('testing error')); }); </code></pre> <p>With the above code the client side always prints out <code>undefined</code>. If I change the server side code to the following I can see the error message.</p> <pre><code>socket.on('someEvent', function(data, callback) { callback({message:'testing error'}); }); </code></pre> <p>I can pass my own custom objects to the client just fine, just not the error object. Any ideas?</p> |
38,570,475 | 0 | Copying from non-filtered rows to filtered-rows in excel <p>I have a number of rows in one worksheet which doesn't have any filtered data all the data is visible. I have another worksheet containing rows with filtered applied on it.</p> <p>When I am trying to copy from non-filtered worksheet to filtered worksheet, the data is also pasted to non-visible cells in the filtered worksheet.</p> <p>I have tried using goto special and then visible cells only but no success.</p> |
13,601,300 | 0 | <p>Right click on the root of your project and select <code>Refresh</code>. Maybe the files are out of sync with the file system.</p> |
39,054,962 | 0 | <p>I have solved the problem. It turned out I had to add one line in my NotificationHub class:</p> <pre><code>[HubName("notificationHub")] </code></pre> <p>Now it looks following and this solved my problem.</p> <pre><code>[HubName("notificationHub")] public class NotificationHub : Hub { //public void Hello() //{ // Clients.All.hello(); //} } </code></pre> |
26,907,803 | 0 | replace log4j with slf4j in hybris <p>I am wandering if there is an elegant way to change logging in hybris from log4j to slf4j or something else?</p> <p>Right now I am using slf4j when writing java code, but hybris itself is using log4j for any generated code. That is causing to use mixed logging frameworks in one hybris extension. Actually it is still log4j underneath the slf4j, but what if I want to change log4j to some other logging mechanism?</p> <p>Maybe it can be done in some configuration file. Has anybody done that already?</p> |
39,054,908 | 0 | <p><strong>What is the purpose of the second tag, <code><context:component-scan></code>?</strong> Well, you need a bit of background information to understand the purpose of this tag. Basically,say the <code>@Controller</code> annotation indicates that a particular class located at <code>base-package="yyy.xxx"</code> serves the role of a <strong>controller</strong>. Another example the <code>@RequestMapping</code> annotated methods to serve a web request. So, <code>component-scan base-package="yyy.xxx"</code> will tell the spring container via the dispatcher servlet to locate such annotated classes and methods for mapping. <em>But, There are plenty of more detailed explanation if you google it.</em> </p> |
37,333,935 | 0 | .val() not assigning return to new variable <p>After this zip will remain at 0 no matter what the value of "input" is. I suspect it has something to do with apiAddress not updating zip after the new value is assigned to zip. Can any one explain what is happening?</p> <pre><code>$(document).ready(function() { zip = 0; apiAddress = "api.openweathermap.org/data/2.5/weather?zip=" + zip; $("#submit").on("click", function() { zip = $("input").val(); $("#temperature").html(apiAddress); }); }); </code></pre> |
1,731,097 | 0 | <p>Decide which formats you want to recognize, then create a regular expression matching each one grouping the different parts of the number (like area code, prefix etc). Finally use a substitution to generate the canonical output you desire.</p> <p>Example:</p> <p>to match</p> <pre><code>xxx-xxx-xxxx -> \d{3}-\d{3}-\d{4} (xxx) xxx-xxxx -> \(\d{3}\) \d{3}-\d{4} 1-xxx-xxx-xxx -> 1-\d{3}-\d{3}-\d{4} </code></pre> <p>This ignores rules that restrict prefix and area code (the US doesn't allow area codes or prefixes that being with 0 or 1). You could try and be super smart and create one regular expression that matches everything but you will end up with a jumbled mess that is impossible to modify instead you should OR the patterns together to make them easier to modify in the future. </p> <p>basic idea: </p> <pre><code>pattern = re.compile(r'\d{3}-\d{3}-\d{4}|\(\d{3}\) \d{3}-\d{4}|1-\d{3}-\d{3}-\d{4}') </code></pre> <p>with grouping added for canonical output </p> <pre><code>pattern = re.compile(r'(\d{3})-(\d{3})-(\d{4})|\((\d{3})\) (\d{3})-(\d{4})|1-(\d{3})-(\d{3})-(\d{4})') </code></pre> <p>then just run that against your inputs and for each phone number input you will have 3 matching groups, one for the area code, one for the prefix, and one for the suffix which you can output however you want. You need a basic understanding of regular expressions, but it shouldn't be too hard.</p> |
36,869,244 | 0 | <p>In this related answer: <a href="http://stackoverflow.com/questions/8268710/transition-to-doesnt-work-within-a-function-and-with-a-runtimeaddeventliste">transition.to( ) doesn't work within a function and with a Runtime:addEventListener( "enterFrame", method) listener in Corona / Lua</a> you can see a similar issue as I stated above. You are creating an animation right as one is starting - making it seem as though it is not moving. As I suggested above, if it suits your game, begin the transition when you spawn the object; not every gameloop.</p> |
35,467,263 | 0 | <p>You can solve it either by putting a padding-bottom on either:</p> <pre><code>.menu ul </code></pre> <p>or</p> <pre><code>.menu ul li:last-child </code></pre> |
9,691,123 | 0 | HTTPBuilder is a wrapper for Apache's HttpClient, with some (actually, a lot of) Groovy syntactical sugar thrown on top. The request/response model is also inspired by Prototype.js' Ajax.Request. |
27,631,087 | 0 | Conditional/Occasional Logging with Boost Log Library <p>Is there a way to do Conditional/Occasional logging with Boost Log Library? For example, log a message at every Nth passing the logging statement.</p> <p>P.S. <a href="https://google-glog.googlecode.com/svn/trunk/doc/glog.html" rel="nofollow">Google Logging Library</a> has those functions/macros: <code>LOG_EVERY_N</code>, <code>LOG_IF</code>, <code>LOG_FIRST_N</code>. But I need a library that works in Mingw-w64 (Google Logging Library is not).</p> |
969,152 | 0 | <p>See <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.createcdatasection.aspx" rel="nofollow noreferrer">XmlDocument::CreateCDataSection Method </a> for information and examples how to create CDATA nodes in an XML Document</p> |
22,339,042 | 0 | Unable to fully change Eclipse ADT theme color scheme <p>I am trying to change my ADT (Eclipse) IDE color scheme to a dark one. As instructed on many threads (for example <a href="http://stackoverflow.com/questions/6937825/how-can-i-change-eclipse-theme">How can i change Eclipse theme?</a>) -</p> <ol> <li>I've installed DARK JUNO (as instructed on the link) </li> <li>I've installed Eclipse Color Theme plugin from eclipsecolorthemes.org (as instructed on the link) </li> </ol> <p>And still, the results are partly dark, partly light color scheme with strage font sizes and very strange (and ugly look).</p> <p>If I only use Eclipse Color Theme plugin, without choosing the DARK JUNO theme, only the compiler (center "code area") receives the right look.</p> <p>This is how my IDE looks right now (with JUNO on and a color scheme from Eclipse Color Theme plugin) - <a href="http://tinyurl.com/o5bdl4e" rel="nofollow">http://tinyurl.com/o5bdl4e</a>. I've marked a few annoying parts.</p> <p>What am I doing wrong? Thanks.</p> |
7,069,178 | 0 | <p>A better way there is not, only a single lined one (which makes use of the iterator, too but implicitly):</p> <pre><code>new ArrayList(names).get(0) </code></pre> |
27,803,489 | 0 | <p>Try This </p> <pre><code>$('#tabledata').on('click', '.move', function(e) { ... }); </code></pre> |
26,157,165 | 0 | How does this code optimize minification? <p>I saw some code <a href="https://gist.github.com/rma4ok/3371337">here</a> that had these variable declarations:</p> <pre><code>var equestAnimationFrame = 'equestAnimationFrame', requestAnimationFrame = 'r' + equestAnimationFrame, ancelAnimationFrame = 'ancelAnimationFrame', cancelAnimationFrame = 'c' + ancelAnimationFrame </code></pre> <p>According to a comment on the page, this is to improve minification, but I couldn't figure out how. Can someone tell me? Thanks.</p> |
8,345,622 | 0 | <p>You need to use <code>%2.6f</code> instead of <code>%f</code> in your printf statement</p> |
26,010,679 | 0 | Not able to load all the youtube iframe players on same page. Always loads the last one <p>My base Html </p> <pre><code> <div class="ytplayer" id="player1" data-videoid="xxxxxxx" data-playerheight="390" data-playerwidth="640"></div> <div class="ytplayer" id="player2" data-videoid="xxxxxxx" data-playerheight="390" data-playerwidth="640"></div> <div class="ytplayer" id="player3" data-videoid="xxxxxxx" data-playerheight="390" data-playerwidth="640"></div> </code></pre> <p>My script initialization is </p> <pre><code> $(document).ready(function(){ $(".ytplayer")._loadIFramePlayer(); }); </code></pre> <p>my functions look like </p> <pre><code> _loadIFramePlayer: function(){ $("<script>") .attr("src", "//www.youtube.com/iframe_api") .insertBefore($("body").find("script").first()); var _youtubePlayer = null; if (typeof (YT) === 'undefined' || typeof (YT.Player) === 'undefined') { window.onYouTubeIframeAPIReady = function () { _youtubePlayer = new YT.Player("player", { height: "390", width: "640", videoId: "xxxxxx", events: { // i didn't mention the below functions since I am not doing any thing there, just calling stopVideo and playVideo native functions of youtube api. 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); }; $.getScript('//www.youtube.com/iframe_api'); } else { _youtubePlayer = new YT.Player("player", { height: "390", width: "640", videoId: "xxxxxx", events: { // i didn't mention the below functions since I am not doing any thing there, just calling stopVideo and playVideo native functions of youtube api. 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); } } </code></pre> <p>Ideally we should get three instances of iframe player but in our case we are getting only one player that too the last one in all cases. Please let me know if any work around for this ..</p> |
31,443,332 | 0 | How do I join 2 tables and search for 2 conditions including a SUM <p>I have two tables, and two conditions that I am trying to write a query for.</p> <p>I need to join the two following tables:</p> <ol> <li>trans</li> <li>transunit</li> </ol> <p>They are joined by the <em>accountID</em> field which is in both tables, I also want the <em>clientID</em> which is in the trans table.</p> <p>Secondly I also need for the field <em>allocated</em> in trans table to be '%Y', and I need the sum of the <em>units</em> field for each accountID in transunit to be greater than 0. </p> <p>I can join the two tables, but i'm struggling with using the two conditions to filter the data.</p> <p>The only columns I would like to return from the 2 tables is:</p> <ol> <li>accountID</li> <li>clientID</li> <li>SUM(units)</li> </ol> <p>Here's what I have so far...</p> <pre><code>select trans.accountID,trans.clientID from inner join transUnit on trans.AccountID = transUnit.accountID where trans.IsAllocated like '%Y%' </code></pre> <p>This joins the two tables, and uses 1 condition.</p> <p>I have the 2nd query which sums all records in transunits table by accountID. 1 account ID can have multiple units records. I am just looking for accountID which have SUM greater than 0. </p> <pre><code>select count(*), sum(units) as Sumunits,accountid from transunit group by accountid </code></pre> <p>Now the tricky part, how do I join these two queries together, and filter so that I only display when SUM is greater than 0.</p> <p>Any help would be much appreciated, thanks.</p> |
32,447,897 | 0 | Threejs make a displaced mesh (terrain model) <p>So I have around 59k data points that I'm visualizing. Currently I'm making them into a texture, and then applying them to a plane geometry. </p> <p><a href="https://i.stack.imgur.com/frnA4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/frnA4.png" alt="enter image description here"></a></p> <p>Now the issue is that I need to show a heightmap, each datapoint has a height value, and I need to apply that to the mesh. </p> <p>How is the best way to go about doing this? Previously I was displaying this data using a ton of cube geometries, which I could then change the height on. But this made performance suffer, so it wasn't really an option.</p> |
29,185,771 | 0 | <p>Found a way:</p> <pre><code>/** * @param Organization $organization * @param User $user * @return \Doctrine\ORM\QueryBuilder */ public function getFindByOrganizationQueryBuilder(Organization $organization, User $user) { $nots = $this->_em ->createQueryBuilder() ->select('u.id') ->from('AppBundle:User\User', 'u', 'u.id') ->leftJoin('u.roles', 'r') ->where('r.role = ?1') ->orWhere('r.role = ?2') ->setParameter(1, 'ROLE_ADMIN') ->setParameter(2, 'ROLE_SUPER_ADMIN') ->getQuery() ->getResult() ; $nots = array_keys($nots); $builder = $this ->createQueryBuilder('u') ->leftJoin('u.roles', 'r') ->leftJoin('u.associates', 'a') ->leftJoin('a.organization', 'o') ->where('o = ?1') ->andWhere('u <> ?2') ->setParameter(1, $organization) ->setParameter(2, $user) ; if (!empty($nots)) { $builder = $builder ->andWhere($this->createQueryBuilder('u')->expr()->notIn('u.id', $nots)); } return $builder; } </code></pre> |
1,357,490 | 0 | <p>I believe you are looking for <code>]]</code> which jumps to the next <code>{</code> char on the first column.</p> <p>There are similar options, just try <code>:help ]]</code> for more information.</p> |
34,949,630 | 1 | ATOmac - waitForWindowToAppear returns False everytime <p>I am using Atomac (<a href="https://pypi.python.org/pypi/atomac/1.1.0" rel="nofollow">https://pypi.python.org/pypi/atomac/1.1.0</a>) to automate a Mac application. I want to wait for a window to be appear(or disappear) and I saw in the documentations that are functions for this:(<a href="https://github.com/ldtp/pyatom/blob/master/atomac/AXClasses.py" rel="nofollow">https://github.com/ldtp/pyatom/blob/master/atomac/AXClasses.py</a>)</p> <p>However, when I am testing waitForWindowToAppear function, it always returns False, for example:</p> <pre><code>import atomac atomac.launchAppByBundleId("com.apple.Safari") app = atomac.getAppRefByBundleId("com.apple.Safari") window = app.waitForWindowToAppear("Safari", 10) print window #False </code></pre> |
8,417,053 | 0 | Is it possible to use GPU acceleration on compiling multiple programs on a gcc compiler? <p>Is there any way or tool to apply GPU acceleration on compiling programs with GCC compiler? Right now I have created a program to compile the given list of programs iteratively. It takes a few minutes. I know of a few programs like Pyrit which helps to apply GPU acceleration for precomputing hashes.</p> <p>If there are no such tools available, Please advice on whether to use OpenCL or anything else to reprogram my code.</p> <p>Your Help will be highly appreciated. Thank you.</p> |
40,962,792 | 0 | <p>Let's try to understand this whole process point-wise</p> <p><strong>Instance variables defined in the controller action are shared with the rendered views.</strong></p> <p>In your case I'm assuming that there's a <code>new</code> action something like</p> <pre><code>def new @movie = Movie.new end </code></pre> <p>And you have a corresponding view <code>new.html.erb</code> where you have created a form like this</p> <pre><code>= form_for @movie do |f| </code></pre> <p>Now, as you know the <code>@movie</code> object that you are passing in <code>form_for</code> method is defined in <code>new</code> action. Most of the times we don't pass any parameters to the <code>new</code> method in <code>new</code> action. The form fields are blank when you load the form because the attributes of the object(in your case <code>@movie</code>) are by default blank because we just initialize an empty object(<code>Movie.new</code>). </p> <p>Let's assume your <code>Movie</code> model has a <code>name</code> attribute, Try doing this in your <code>new</code> action</p> <pre><code>def new @movie = Movie.new(name: 'Hello World!') end </code></pre> <p>Now when you will load the new action, you will see <code>Hello World!</code> populated in your <code>name</code> text field because your <code>@movie</code> object is initialized with this value. </p> <p>Also, keep in mind that Rails Convention-Over-Configuration automatically generates the form URL in this case, by default it points to the <code>create</code> action. When you submit the <code>form</code> the request is made to the create action. This takes me to the next point.</p> <p><strong>When we submit the form all the filled in form values are sent to the action whose route matches with the form URL(in your case URL points to the <code>create</code> action)</strong></p> <p>In <code>create</code> action you are receiving parameters in the form of a hash with model attributes(<code>Movie</code> attributes) as keys and the filled in information as their values. The first line in your <code>create</code> action is</p> <pre><code>@movie = Movie.new(movie_params) </code></pre> <p>This is a very important line of code, try to understand this. Let's assume your form had only one text field, i.e., <code>name</code>. Now <code>movie_params</code> is a method that looks like this</p> <pre><code>def movie_params params.require(:movie).permit(:name) end </code></pre> <p>Now, the <code>movie_params</code> method will return a hash something like <code>{ 'name' => 'Hello World!' }</code>, now you are passing this hash as a parameter to <code>Movie.new</code> method.</p> <p>So now, after breaking up the code, the first line of your create action looks like</p> <pre><code>@movie = Movie.new({ name: 'Hello World!' }) </code></pre> <p>That means your <code>@movie</code> instance variable contains an object of <code>Movie</code> class with <code>name</code> attribute set to <code>Hello World!</code>. Here, when after initialization, if you do <code>@movie.name</code> it will return <code>Hello World!</code>.</p> <p>Now, in the second line you are calling <code>@movie.save</code> that returned <code>false</code> due to failed validation in your case as you have already mentioned in the question. As it returned <code>false</code> the execution will go to the <code>else</code> part. Now this takes me to the next point.</p> <p><strong>Calling <code>render :action</code>(in your case <code>render :new</code>) in the controller renders only the view that belongs to that action and does not execute that action code.</strong></p> <p>In your case, you called <code>render :new</code>, so there you are actually rendering the <code>new.html.erb</code> view in create action. In other words, you are just using the code in <code>new.html.erb</code> and not in <code>new</code> action. Here, <code>render :new</code> does not actually invoke the new action, it's still in the create action but rendering the <code>new.html.erb</code> view.</p> <p>Now, in <code>new.html.erb</code> you have created a form that looks like</p> <pre><code>= form_for @movie do |f| </code></pre> <p>Now as my explained under my first point, the instance variables that are declared in the action are shared by the rendered view, in this case <code>@movie</code> object that you have defined in <code>create</code> action is shared by the rendered <code>new.html.erb</code> in create action. In our case, in <code>create</code> action the <code>@movie</code> object was initialized with some values that were received in the parameters(<code>movie_params</code>), now when <code>new.html.erb</code> is rendered in the <code>else</code>, the same <code>@movie</code> object is used in the form by default. You got the point right, you see the magic here?</p> <p>This is how Rails works and that's why its awesome when we follow the convention! :)</p> <p>These blogs will help you understand the code better,</p> <p><a href="http://blog.markusproject.org/?p=3313" rel="nofollow noreferrer">http://blog.markusproject.org/?p=3313</a></p> <p>And this gist is great,</p> <p><a href="https://gist.github.com/jcasimir/1210155" rel="nofollow noreferrer">https://gist.github.com/jcasimir/1210155</a></p> <p>And last but not least, the official Rails Guides on Layouts and Rendering</p> <p><a href="http://guides.rubyonrails.org/v4.2/layouts_and_rendering.html" rel="nofollow noreferrer">http://guides.rubyonrails.org/v4.2/layouts_and_rendering.html</a></p> <p>Hope the above examples cleared your doubts, if not, feel free to drop your queries in the comment box below. :) </p> |
37,657,269 | 0 | <p>you can use the <code>series</code> <a href="https://developers.google.com/chart/interactive/docs/gallery/linechart#configuration-options" rel="nofollow">configuration option</a> to change the <code>targetAxisIndex</code> </p> <p>the documentation says... </p> <blockquote> <p><code>targetAxisIndex</code>: Which axis to assign this series to, where 0 is the default axis, and 1 is the opposite axis. Default value is 0; set to 1 to define a chart where different series are rendered against different axes. At least one series much be allocated to the default axis. You can define a different scale for different axes. </p> </blockquote> <p>but seems to work without assigning anything to the <em>default</em> axis... </p> <p>see following example...</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>google.charts.load('current', { callback: function () { var data = new google.visualization.DataTable(); data.addColumn('string', 'Label'); data.addColumn('number', 'Amount'); data.addRows([ ['Label 1', 10], ['Label 2', 20], ['Label 3', 30], ['Label 4', 40] ]); new google.visualization.LineChart(document.getElementById('chart_div')).draw(data, { series: { 0: { targetAxisIndex: 1 } } }); }, packages:['corechart'] });</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://www.gstatic.com/charts/loader.js"></script> <div id="chart_div"></div></code></pre> </div> </div> </p> |
33,806,520 | 0 | <p><code><?AdlibExpress...?></code> is a <a href="https://en.wikipedia.org/wiki/Processing_Instruction" rel="nofollow">processing instruction</a>.</p> <p>You can create it with </p> <pre><code>doc.appendChild( doc.createProcessingInstruction("AdlibExpress", "applanguage=\"USA\" appversion=\"5.0.0\" dtdversion=\"2.6.3\"")); </code></pre> |
4,310,369 | 0 | I have URL rewriting in my asp.net web solution how can I set startup url for non existent URL in VS2010? <p>I have URL rewriting in my asp.net web solution defined how can I set startup url for non existent page URL in VS2010.</p> |
27,295,238 | 0 | <p>Use <code>GoogleMap#getCameraPosition().bearing</code></p> |
11,279,578 | 0 | <p>if you changed your package name you have also to change it in the AndroidManifest.xml</p> <p>You can copy paste your project on your disk and on your project on eclipse right click on your package and go to refactor --> rename</p> |
34,874,781 | 0 | <p>Another shorthand is to use the following code directly in the pattern in the template:</p> <pre><code><? return str_replace(".","","{base_price_incl_tax product}"); ?> </code></pre> <p>In this way you don't have to create a custom attribute.</p> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.