input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Missing debug symbols in linked ELF file <p>I compiled my AVR C source-code to object files. These objects contain debug symbols:</p>
<p><code>~ avr-nm code.c.o:
00000000 T ClockInit32MhzXtal
00000000 T CopyDataToSensors
00000000 T FindSensors
U I2CInitMaster
00000000 T PC_UsartInit
00000000 T ReadFromSensor... | <p><code>-Wl,-search_paths_first</code> flag was added by CLion. It is however no valid avr-gcc flag but a typical OS X flag. The compiler tried to find the first existing match which was <code>-Wl,-s</code>. I.e. Strip symbols. </p>
|
Android Passing data to intents <p>I have three activities in my android application, and i am trying to get user input data from the first activity and pass it to the third activity while at the same time I launch the second activity which also gets the user input data and will also pass the data to the third activity... | <p>The Way of passing data from Intent is shown below, try passing data same way from <code>ActivityOne -> ActvityTwo -> ActivityThree.</code></p>
<pre><code>Intent intent = new Intent(ActivityOne.this, ActivityTwo.class);
intent.putExtra("some_key_from_one", some_value_from_one);
startActivity(intent);
</code><... |
Rethinkdb remove string from array <p>Given an array and data structure as below, I want to remove any values that match from the <em>removeVals</em> from the table field <em>tags</em>. I've found a solution for changing, and tried with the <em>deleteAt</em>, but got an <em>indexesOf is not a function</em> error.</p>
... | <p>Nevermind, I've found the answer and it was far easier than I thought, I was over complicating things too much!</p>
<pre><code>var removeTags = ['val1', 'val2'];
r.db('test').table('data').get('test1')
.update({tags: r.row('tags').difference(removeTags)});
</code></pre>
<p>Anyway, hope this helps others</p>
|
How to add parameters to a URL without reload <p>How to append and addparameters to a URL without reload allready containing other parameters
Ex.</p>
<blockquote>
<p>localhost:5147/website/paytm?sort=deals</p>
<p>localhost:5147/website/paytm?sort=deals&cat=171</p>
<p>localhost:5147/website/paytm?sort=d... | <p>You can use <code>history.pushState</code></p>
<pre><code>var stateObj = { foo: "bar" };
history.pushState(stateObj, "page 2", "bar.html");
</code></pre>
<p>doc: <a href="https://developer.mozilla.org/en-US/docs/Web/API/History_API" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/History_API</a></p... |
Not able to write on ApplicationData folder <p>I wrote a little Logger class that help me to create a log file with all application exception, actually I though to save this log inside the ApplicationData, so I've created a simple class:</p>
<pre><code>public class Logger
{
private static string _appDataPath =
... | <p>Your code creates a <strong>folder</strong> named</p>
<p>%APPDATA%\MyApp\Log</p>
<p>Of course, being this a folder and not a file, the StreamWriter cannot write to a folder</p>
<p>Change your code to add a filename to the folder</p>
<pre><code>if (!Directory.Exists(_logPath))
{
Directory.CreateDirectory(_lo... |
Push notifications instant message receiving like on Whatsapp or Viber <p>When Whatsapp (or Viber) iOS application is completely turned off (removed from the background) message receiving is handled via push notifications as expected. <br/>
When you wake up Whatsapp (or Viber) from push notification, it instantly shows... | <p>You should probably use <strong>PushKit</strong>, along with the <strong>Voice over IP background mode</strong> enabled in your Xcode Project > Capabilities pane. That way VoIP push notification can wake up your application, so you can process the received data and display it. Also VoIP pushes have several advantage... |
Not able to send mail from localhost using mail() in php <p>Trying to send mail from localhost using mail(), no mail is received. I am using XAMPP. It's showing that the mail is send but i cannot see any mail. I am new to PHP.</p>
<p>HTML:</p>
<pre><code><form name='form' ng-app="" role="form" method="post" action... | <p>Use <code>PHPMailer</code>. That is pretty easy and almost all time working and mail sent by it will not be categorized under Spam or Promotions in Gmail or Yahoo etc.</p>
<p>PHPMailer is just SMTP class which sends mail by your mail server which is live on internet. This will give you record of emails sent by your... |
org.openqa.selenium.WebDriverException: disconnected: Unable to receive message from renderer <p>I am testing one application in which my requirement is as below:</p>
<ol>
<li>Login and create a webform through my application under test. It will generate one webform URL.</li>
<li>I am caturing the URL and opening a ne... | <p>would you mind using <strong>Google Chrome Driver 2.23</strong> instead? Even if exception occurs, if you try to catch the exception, ignore it, can you get further? </p>
|
NHibernate: map collection of enums using string and store as nvarchar <p>I have an enum type:</p>
<pre><code>public enum CommunicationType
{
[Description("Callback to client")]
Callback
}
</code></pre>
<p>Which one use as a property of <code>IList<CommunicationType></code> in class <code>Partner</code>... | <p>This is the answer: <a href="http://stackoverflow.com/questions/19597088/fluent-nhibernate-how-map-an-ilistenum-as-list-of-strings">Fluent NHibernate - How map an IList<Enum> as list of strings</a></p>
<p>You have to use <code>NHibernate.Type.EnumStringType<T></code> with your type as generic:</p>
<pre... |
Can i use SIGNAL/SLOT on QPolygon? <p>disclaimer, i only just downloaded Qt today and have NO experience with it. so i'm sorry if this is a bit stupid. gotta start somewhere :).</p>
<p>i'll use [thing1] and [thing2], 1 being a qpolygon in a GraphicsWidget , 2 being a Widget.</p>
<pre><code>[thing1] = scene->addPol... | <p>NO!!</p>
<p>FYI:Signals and slots can be used by any qt objects, which a QPolygon is!</p>
<pre><code>bool QObject::connect(const QObject * sender, const char * signal, const QObject * receiver, const char * method, Qt::ConnectionType type = Qt::AutoConnection)
</code></pre>
<p>the connect we use is actually QObje... |
Azure Web App URL Rewrite not working <p>I'm trying to get a basic URL rewrite to work for my Azure web App</p>
<pre><code><system.webServer>
<rewrite>
<rules>
<rule name="SalesCloudGmail" stopProcessing="true">
<match url="/SalesCloudGmail.aspx" />... | <p>Please try below rewrite rule:</p>
<pre class="lang-html prettyprint-override"><code><rewrite>
<rules>
<rule name="SalesCloudGmail" stopProcessing="true">
<match url="^\/SalesCloudGmail\.aspx$" />
<action type="Redirect" url="/SalesCloudGmail" />
... |
Operand data type varchar is invalid for sum operator <p>I try this query </p>
<pre><code>Select
S.Name,S.No,
SUM(Case when s.Model='Cultus' then total else 0 end) as Cultus,
SUM(Case when s.Model ='vigo' then total else 0 end) as vigo,
SUM(total) total_v ,
s.MA,MAX(S.Speed) Speed
from (
Select
RVU.Name,RVU.No,VV.... | <p>Seems that one of your MA column value is type of varchar, please check your data</p>
<p>If your data type varchar then <strong>cast to INT</strong>:</p>
<pre><code>SUM(CASE ISNULL(MA,'') WHEN '' THEN 0 ELSE CAST(MA AS INT) END)
DECLARE @tblTest as Table(
Name VARCHAR(10),
No INT,
Cultus INT,
vig... |
How can I go back to the previous state when back button is clicked <p>I am using the <code>history.pushState</code> to change the content of a page with <code>ajax</code> request. </p>
<p>And its very certain that after a <code>history.pushState</code>, the forward button is disabled in the browser so definitely any ... | <pre><code>var mainState = 3;
-mainState; //-3
--mainState; //2
</code></pre>
<p>Your code should look like this</p>
<pre><code>window.onpopstate(function(){
if(pushed){
history.go(--mainState); //FIXED
}
})
</code></pre>
|
How can I copy settings between IDE (WebStorm) projects? <p>I've got a WebStorm project (NodeJS) that I've configured to be as I want. But then I've created another project (JavaScript) that doesn't have any of the customizations I want, for example using ESLint to show code errors. How can I transfer all the settings ... | <p>IDE settings are stored in the dedicated directories under PhpStorm home directory. The PhpStorm directory name is composed of the product name and version.</p>
<p>For example:</p>
<p>Windows</p>
<p><code><User home>\.PhpStormXX\config</code> that contains user-specific settings. </p>
<p><code><User hom... |
Looking for good Billing Platforms to integrate with my Web Application(MVC) <p>I am looking for a billing platform that I can integrate into my Web Application(MVC).</p>
<p><strong>Tried</strong>: <code>PayPal</code> and <code>Braintree</code></p>
<p><code>PayPal</code>: They dont seem to support South Africa.</p>
... | <p>I have found a billing platform that seems will work : PayGate. </p>
<p>Regarding stack overflow, I have been very disappointed with how this forum operates and will no longer make use of it. Posting questions gets more negative comments than people actually helping, which is very unfortunate. I have asked some que... |
Ireport to CSV is appending an à to all currency cells <p>It seems when I run my report and export it to <code>Excel</code> <code>.CSV</code> all my currency values seem to append an <code>Ã</code> at the beginning.</p>
<p>My <code>XML</code> is as follows:</p>
<pre><code></textField>
<textField isStretchW... | <p>This is not an issue originating from Jasper but from Excel. </p>
<p>If you take a look into the file with a program able to interpret UTF-8 (like Notepad++), this should not happen at all.</p>
<p>CSV files exported from Jasper should not be opened directly. Instead, Excel should be opened and in the data tab the ... |
iOS enterprise APNs certificate expiry <p>We have a production APNs certificate due to expire shortly for an enterprise app. </p>
<p>Is it just a case of creating a new production APNs certificate for our app ID and replacing the certificate that's due to expire with our push notifications provider?</p>
<p>Will I nee... | <p>According to these links:</p>
<ul>
<li><a href="https://developer.apple.com/support/certificates/" rel="nofollow">https://developer.apple.com/support/certificates/</a></li>
<li><a href="https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/Maintaining... |
Make object expire given a state change in Rust <p>Is it possible in Rust to explicitly provide context on when an object expires? For instance, imagine a graph manipulation code that does something like this:</p>
<pre><code>// borrow an edge from the graph
let edge : &Edge = graph.findEdge( ... );
// modify the e... | <p>If you match your code to your comments, you will get an compiler error, although not at the position you want. Your current code is basically <a href="https://play.rust-lang.org/?gist=b1f26cccd66962c6fb0145e545275c89&version=stable&backtrace=0" rel="nofollow">this</a>. In this case <code>split_edge</code> l... |
ACF repeater field not opening modal when inserting counter <p>Tried several approaches but none of them work and can´t figure out what else to do. As part of a team page I have a repeater field with 4 subfields âimage, title(caption),link(to trigger modal) and details(modal text content)â where some should open a... | <p>Check this out:</p>
<pre><code><a href="#modal1">Modal â1</a>
<a href="#modal2">Modal â2</a>
<a href="#modal3">Modal â3</a>
<div class="remodal team-member-details" data-remodal-id="modal1">
<button data-remodal-action="close" class="remodal-close"></butt... |
Realtime Content and Database Replication for Alfresco <p>I'm currently researching on how to replicate physical files (store contents) and the meta data (database) of Alfresco. This is of course a safety measure in case of server failure or whatsoever. </p>
<p>Currently i am running Alfresco's Database on PostgreSQL ... | <p>The replication service can be used to replicate objects from one Alfresco server to another at the object level, not the file system and database level. So, of course there are files and database records that are created when an object is replicated, but the those are by-products of the object being created in the ... |
Serialize from ul li with child using jqueryui sortable <p>I would like to know how to create a JSON or serialize (both is fine) from a ul including </p>
<pre><code><ul class="menu send ui-sortable">
<li id="pageid_1" class="ui-sortable-handle">Inscription
<ul class="menu send ui-sortable">
... | <p>This code will produce the output required</p>
<pre><code>var result = [].map.call(document.querySelectorAll('ul.menu.send.ui-sortable li.ui-sortable-handle'), function(li) {
var parent = '';
if (li.parentNode && li.parentNode.parentNode && li.parentNode.parentNode.nodeName == 'LI' &&... |
update url.action dynamically with razor variable <pre><code>@{
Layout = null;
string something = "";
}
<head>
<script type="text/javascript">
function VName(vwname) {
if (vwname == "Dialog") {
@ViewBag.viewname="Dialog";
... | <p>Why not you <strong>update iframe src</strong> attribute instead only action:</p>
<p>Give id="myIframe" or any to iframe and then</p>
<pre><code>var newSrc='@Url.Action(something, "Treeview")';
$("#myIframe").attr("src",newSrc);
</code></pre>
|
Inject urls into Apache Nutch from mysql instead of seed.txt <p>I am new to Apache Nutch and I want to inject urls dynamically from a mysql database. Does Apache Nutch offer such possiblity? If not, is there any similar experiment that i can learn from? Or any suggestions?</p>
| <p>As Julien said you should modify INJECTOR code to achieve this. However, I can suggest a workaround for this. You can use NUTCH in server mode using command <em>bin/nutch startserver</em> and then load your seed urls from database. Then you can use Nutch REST API to create a seed list using urls loaded from database... |
How do I change the primary key in a rethinkdb document? <p>Based on <a href="https://www.rethinkdb.com/api/javascript/replace/" rel="nofollow">the RethinkDB replace() docs</a> I am trying to change the primary key of a document. In this case, the primary key is <code>email</code>:</p>
<pre><code>var renamePerson = fu... | <p>Doing some research, I found <a href="https://github.com/rethinkdb/rethinkdb/issues/1570" rel="nofollow">this quote from the developers</a>: </p>
<blockquote>
<p>'We don't let people change pkeys, they have to delete and reinsert the document instead.'</p>
</blockquote>
<p>Based on that: </p>
<pre><code>var re... |
Spring uses "transactionManager" although another one was specified <p>I get following error when trying to use Spring transactions:</p>
<pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined: No matching PlatformTransactionManager bean found for quali... | <p>I think you should mark your <code>PlatformTransactionManager</code> with <code>@Bean</code> too. </p>
<p>And add <code>@Transactional(transactionManager="jpaTransactionManager")</code> on your repository. Implementation uses by default @Transactional without parameterers, so that's why it is searching for default... |
Access objects of a service from a controller in Angularjs <p>Here is a hard one:</p>
<p>I have a local JSON declared in my service and I want to access part of it from my controller. Right now I can manage to access it but only to a specific section (I can't parametrize it).
My intention is to access part of my JSON ... | <p>please make this line </p>
<pre><code>$scope.asignaturaJson=subjectRequest.asignatura;
</code></pre>
<p>as</p>
<pre><code>$scope.asignaturaJson=subjectRequest.asignatura();
</code></pre>
<p>as your service return the function which return a response too.</p>
<p>I hope this will help you out!</p>
|
Access variable in another method from static method in same class <p>I am looking for the best/correct way to do the following:</p>
<pre><code>myClass::getSomething('stuff');
class myClass
{
public static function getSomething($var) {
$obj = new static();
$obj->var = $var;
$obj->... | <p><code>$obj</code> is an instance of <code>myClass</code>: It has - among others - a method <code>somethingElse()</code> and you just added a property <code>$var</code>.</p>
<p>So in your method you can access the property directly:</p>
<pre><code>public function somethingElse() {
$the_contents_of_var = $this-... |
Php sessions boolean always true <p>Im creating a session in the index which is where the login process happens, i then save "username, IsAdmin, logged, first_name,last_name" to the session.</p>
<pre><code> session_start();
$_SESSION["logged"] = FALSE;
$logged = TRUE;
$_SESSION["username"] = $username;
$... | <p>You forgot to add <code>$</code> before variable name. So it should look something like this,</p>
<pre><code> <?php if($logged == TRUE) :?>
</code></pre>
<p>When you use logged without <strong>$</strong> like this <code>logged == TRUE</code>, it takes logged as constant variable. And as it would not be defin... |
How to match individual substring to a String in Sql? <p>I am Calling a named query using Entity Manager in my main class as below</p>
<pre><code>this.list = em.createNamedQuery(MyClass.Check_Name).setParameter("name", NAMES).getResultList();
</code></pre>
<p>And the Named query is as below</p>
<pre><code>@NamedQuer... | <p>JDBC has an <a href="https://docs.oracle.com/javase/tutorial/jdbc/basics/array.html" rel="nofollow"><strong>Array</strong></a> class for the SQL ARRAY, for some usages, like <a href="https://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html#createArrayOf(java.lang.String,%20java.lang.Object[])" rel="nofollo... |
How do I format a formula's number with EPPlus? <p>I use the EPPlus library to create an Excel file.</p>
<p>I have two code pieces:</p>
<p>1.</p>
<pre><code>sheet.Cells[lineNo, 5].Value = line.IncompletesPercent;
sheet.Cells[lineNo, 5].Style.Numberformat.Format = "0.0";
</code></pre>
<p>This first code piece format... | <p>Forget my question, I was stupid. The above code works perfectly, I just overwrite this format a bit later with a <code>.StyleName()</code> :-(</p>
|
Wordpress - AMP validator FAIL - NextGen Gallery <p>Iâm using Google AMP for my press site.</p>
<p>But I had many validation errorâ¦
I found on the internet, itâs maybe one plugin which can cause this error, so I had checked all my plugins and finally I discovered that itâs NextGen gallery which break my valida... | <p>I fix the problem with this line to add to your functions.php</p>
<pre><code>add_filter( 'run_ngg_resource_manager', '__return_false' );
</code></pre>
|
Define Variables in SAS using Arrays and do loop <p>I would like some help with SAS Arrays and do loops</p>
<p>I have some code which nearly works and would like an explanation why it doesn't work as expected. If I can understand why it doesn't work then that will help with part B which doesn't work at all.
Part A)
I ... | <p>Regarding Part A, when you define an array without explicitly naming the variables, SAS will default to a numbered range, from 1 to n - in this case 14.</p>
<p>The below would achieve your desired result :</p>
<pre>
array fin_own{14} fin_own01 fin_own02 /* etc */ fin_own13 fin_own14 ;
</pre>
<p>You can address yo... |
CursorAdapter - List beheivour <p>I use a CursorAdapter with one single customized layout for my list, depending on the value of a field (true or false) of my table, the color of one of the textviews in the list item will be different.</p>
<pre><code>public class CustomAdapter extends CursorAdapter {
DatabaseHelpe... | <p>You need to remember the following things
1. The views in the ListView are limited.
2. Whenever you scroll the View whose visibility is gone will be updated with the later items and then it will come back to the view</p>
<p>So now you are setting the color based on some criteria. and whenever you are binding the v... |
How to Filter Two ng-module Values in a Table using Angularjs Filter? <p>I am using MEAN stack in my application with AngularJS as my front-end. How can I filter two <code>ng-module</code> values in a table.<a href="http://plnkr.co/edit/9FvtRYW4CVKRFm6NSEwt?p=preview" rel="nofollow">My Plunker without filter</a> and <a... | <p>You can write your own filter for this like so:</p>
<pre><code><tr ng-repeat="data in srdebitnote | filter: raised">
//Controller
$scope.raised = function(item){
if (raised.raised && raised.raised_two){
return true;
}
return false;
};
</code></pre>
<p>If you want to do an <cod... |
Flask-socketio misses events while copying file in background thread <p>(Complete test app on github: <a href="https://github.com/olingerc/socketio-copy-large-file" rel="nofollow">https://github.com/olingerc/socketio-copy-large-file</a>)</p>
<p>I am using Flask together with the Flask-SocketIO plugin. My clients can a... | <p>You are asking two separate questions.</p>
<p>First, let's discuss the actual copying of the file.</p>
<p>It looks like you are using eventlet for your server. While this framework provides asynchronous replacements for network I/O functions, disk I/O is much more complicated to do in a non-blocking fashion, in pa... |
better way of changing iframe url through DOM in Angular 2 <p>I'm trying to replace a <code>URL</code> using <code>(<HTMLInputElement>document.getElementById("workflow")).src</code> however I don't think this is the right way of doing it.</p>
<p>Also tried the code below but its giving me <code>getElementById</c... | <pre><code><iframe [src]="iframeSrc">
</code></pre>
<pre><code>constructor(private sanitizer:DomSanitizer) {
}
get iframeSrc() {
this.sanitizer.bypassSecurityTrustUrl('./javascript/workfloweditor.html?title='+workFlowTitle);
// or
this.sanitizer.bypassSecurityTrustResourceUrl('./javascript/workflowedito... |
Get the soap message header using jaxb Unmarshaller <p>I am consuming a web-service which has the soap message header as follows.</p>
<pre><code><SOAP-ENV:Header>
<MessageHeader xmlns:cnr="http://testservice.com/Namespaces/Types/Public/DataModel.xsd" xmlns="http://testservice.com/Namespaces/Types/Public... | <p>Something like this maybe can help you:</p>
<pre><code>JAXBContext jaxbContext = JAXBContext.newInstance(YourClass.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
JAXBElement<YourClass> root = jaxbUnmarshaller.unmarshal(new StreamSource(
header), YourClass.class);
YourClass ... |
How use react components from npm in rails <p>I am new in react and I follow this article <a href="https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers" rel="nofollow">https://www.airpair.com/reactjs/posts/reactjs-a-guide-for-rails-developers</a>
to use react in rails app and everything was fine.... | <p>Some things worth checking;</p>
<p>I'm assuming your node packages are being installed to <code>/node_modules/*</code>. Make sure those packages are being added to your asset pipeline. I've used <a href="https://github.com/browserify-rails/browserify-rails" rel="nofollow">browserify</a> to accomplish this.</p>
<... |
c++ threads race condition simulation <p>Here is a c++ program that runs <code>10</code> times with <code>5</code> different threads and each thread increments the <code>value</code> of <code>counter</code> so the final output should be <code>500</code>, which is exactly what the program is giving output. But i cant un... | <p>You're just lucky :)</p>
<p>Compiling with clang++ my output is not always 500:</p>
<pre><code>500
425
470
500
500
500
500
500
432
440
</code></pre>
|
All columns that refer to a column as foreign key <p>How can I have a list of all columns in other tables/schemas that refer to a certain column A as foreign key ?</p>
| <p>Something like this?</p>
<pre><code>SELECT
fk.Name,
'Referenced table' = refTbl.Name,
'Parent table' = parentTbl.Name,
'Parent column' = c.name
FROM
-- FK constraint
sys.foreign_keys fk
INNER JOIN
-- Referenced table (where the PK resides)
sys.tables refTbl ON fk.referenced_object_... |
Android Http request with Client Certificate <p>I'm trying to make a request to a server with a client certificate authentication with this code:</p>
<pre><code>try {
/*** CA Certificate ***/
CertificateFactory cf = CertificateFactory.getInstance("X.509");
InputStream caInput = getResources().openRawResou... | <p>I don't know why input stream unable to read certificate from <code>Assets</code> folder. I had the same problem. To overcome , i have put certificate in <code>raw</code> folder and access it through </p>
<pre><code>InputStream caInput = getResources().openRawResource(R.raw.mycertificate);
</code></pre>
<p>and wor... |
Which language(s) have the most complete SDK(s) for interacting with AWS? <p>There are <a href="https://aws.amazon.com/tools/#sdk" rel="nofollow">AWS SDKs for several different languages</a>: C++, Go, Java, .NET, Node.js, PHP, Python and Ruby.</p>
<p>It appears that some of these SDKs support more features of AWS than... | <p>You pointed out CloudFront is only supported by these: Java, .NET, PHP, Python and Ruby.</p>
<p>From my reading of developer guides, those seem to be the most common languages with examples present. I would say that Java, PHP, and Python are the most commonly shown and have the strongest community.</p>
<p>Addition... |
Good patterns for rounding UIViews? <p>With the recent updates of XCode 8, Swift 3 and iOS10 my old pattern for rounding UIViews became obsolete. What I used to do was:</p>
<pre><code>@IBOutlet weak var pointsView: UIView! {
didSet {
pointsView.setRound()
}
}
</code></pre>
<p>Where setRound is defined... | <p>call <code>setRound</code> function from <code>viewDidLayoutSubviews</code> or after layout have done inshort. Or you should take outlet of your <code>width constraint</code> of your view and set corner radius as half of <code>constant</code> of constrain's outlet!</p>
|
With more explanatory variables than observations in LR, how does SPSS exclude variables <p>I'm using SPSS to do several linear regressions and applying different filters each time in order to compare different groups. For a number of filters, I am fitting regressions with only 13 observations, but 15 or 24 explanatory... | <p>You are very unlikely to get useful results with so many variables and so few observations when the model can be fit at all. Look at the coefficient standard errors. You might be better off using a technique like partial least squares (PLS), which can accommodate more variables than cases. PLS in Statistics is av... |
How to enable/disable the video of participants(not our own) in kurento many-to-many call(group call) .? <p>I am working on the Kurento and I am using many-to-many tutorial(group call) Now i want to mute(disable) only the video of the participants(not my own) in the room but their audio should remain enabled.Also I sho... | <p>You can do this from javascript by using </p>
<pre><code>participants[name].rtcPeer.videoEnabled = false;
</code></pre>
<p>You can do this by using following java code</p>
<pre><code>user1OutgoingMedia.disconnect(user2IncomingMedia, MediaType.VIDEO);
</code></pre>
|
gcloud deploy php application <p>I want to upload and run my php application on google cloud with the following folder structure:</p>
<p><a href="http://i.stack.imgur.com/skZb6.png" rel="nofollow"><img src="http://i.stack.imgur.com/skZb6.png" alt="enter image description here"></a></p>
<p>The yaml file looks like bel... | <p>Try this (the order of handlers is important)</p>
<pre><code>application: <your-app-id-goes-here>
runtime: php55
api_version: 1
handlers:
- url: /css
static_dir: css
- url: /js
static_dir: js
- url: /images
static_dir: images
- url: .*
script: index.php
</code></pre>
|
String Array only calling method once <p>Hello I have an console application where I am attempting to create the game Morris but I have an issue drawing the map after setting a point in the hashmap. I've already confirmed that the value of my point is changing but for some reason the method v is not being called again.... | <p>The problem is that you only put a value into LAYOUT once and that value is fixed. You need to recalculate LAYOUT every time before you draw the map otherwise it will stay the same value(map)</p>
|
is there a way to get source code with macro expanded using Clang API <p>For example, I got following code. </p>
<pre><code>#define ADD(x, y) (x) + (y)
int func(int i, int j)
{
return ADD(i, j);
}
</code></pre>
<p>The clang SourceManager can be used to get source code of the function func. and what I got is ... | <p>An easy way is to use the 'print' function inside of Decl, the pretty printer will expand all macros.</p>
<p>You can also print statements, so if you want that specific statement that is being returned you should be able to do something similar.</p>
<p>Decl::print also refers to "DeclPrinter" which allows you to p... |
Group by error while executing query <pre><code>Select To_char(x.Fld004, 'dd/mm/yyyy hh24'),
max(decode(fld008,1,count(1),null)) as aa,
max(decode(fld008,2,count(1),null)) as bb
From Pti020 x, Pti042 y
Where x.Fld008 = y.Fld001
And x.fld004 < trunc(sysdate-1)
and x.fld004 > trunc(sysdate-2)... | <p>You normally don't nest aggregation functions. Perhaps you intend a query more like this:</p>
<pre><code>select To_char(x.Fld004, 'dd/mm/yyyy hh24'),
sum(case when fld008 = 1 then 1 else 0 end) as aa,
sum(case when fld008 = 2 then 1 else 0 end) as bb
from Pti020 x join
Pti042 y
on x.Fld008 ... |
How to use only the scheduler of kendo ui by importing ONLY kendo.scheduler.min <p>I am trying to create a custom scheduler using kendo ui scheduler but I am having some performance issues (render time of over 10s). To resolve this, I tried only to import (using <strong>requirejs</strong>) the <strong>kendo.scheduler.m... | <p>For kendo-UI schduler only "kendo.scheduler.min" is not enough because to change the date you have to add "kendo.datepicker.js" and to open insert/Update window you have to add "kendo.window.js" into the page.</p>
<p>Please check <a href="http://docs.telerik.com/kendo-ui/intro/supporting/scripts-scheduling" rel="no... |
how make url string complicated <p>Creating an android app to receive data in json format from web server <br>
in my app I should have url as string and use it to fetch data like below <br></p>
<pre><code>private static final String my_url = "http://example.com/folder/showJsonData.php";
jsonObjectRequest = new JsonObj... | <p>URL encoding is done in the same way on android as in Java SE;</p>
<pre><code>try {
String url = "http://www.example.com/?id=123&art=abc";
String encodedurl = URLEncoder.encode(url,"UTF-8");
Log.d("TEST", encodedurl);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
</code></pr... |
Python/Tkinter: Remove titlebar without overrideredirect() <p>I'm currently working with Tkinter and Python 2.7 on Linux and I was wondering if there was a way to remove the <code>TK()</code> window border frame and title bar without using <code>overrideredirect(1)</code>.</p>
<p>I have my own close button and <code>o... | <p>The window decoration is all handled by the window manager so what you are trying to do is find a way to tell the window manager to decorate your window differently from a standard application window. Tk provides <code>overrideredirect</code> to have the window manager completely ignore this window but we can also u... |
PHP auto assign IP <p>I'm creating a little module for my web application and I need something that automatically assign an IP from a pool I implemented.</p>
<p>I tried to add the database as:</p>
<pre><code>pool = 172.16.0.0
mask = 20
</code></pre>
<p>I want to add users and assign automatically 1 ip from this pool... | <p>Ok,</p>
<p>I got it with the help of ip2long</p>
<p>I save in the database the first IP from the pool and the last one.</p>
<p>Then I convert it to decimal with ip2long </p>
<p>When I want to use I check the last pool ip and the last_used_ip and just do last_used_ip+1.</p>
<pre><code>if($checkCliente == 0){
... |
Unable to push docker image on local private registry <p>I'am struggling with this problem. I have to push a docker image (which work rigthly with docker-compose up) to my local registry which was setup with the following command:</p>
<p><code>docker run -d -p 5000:5000 --restart=always --name registry registry:2</cod... | <p>Does your registry work correctly with an official image? Like this:</p>
<pre><code>docker pull alpine
docker tag alpine localhost:5000/my-alpine
docker push localhost:5000/my-alpine
</code></pre>
|
MSSQL - Invalid object name when attempting an update <p>I have a table in SQL that I can query easily when running <code>SELECT * FROM Scheme.Table1</code></p>
<p>There are no Intellisense errors and I can see the table in the list of tables under the database</p>
<p>If I attempt to run an <code>UPDATE</code> agains... | <p>Thanks to the comments, it was a trigger on the table that was referencing itself without the <code>SCHEMA</code> (I was logged in using Windows Authentication)</p>
|
Cascaded Filter in spotfire <p>I am using cascaded filters in my reports and I have my expression like below -</p>
<pre><code>if ([Region] = "${whichRegion}",[State],null)
</code></pre>
<p>along with the above expression, I would like to preselect one of the values of [state] column.</p>
<p>i would need some thing l... | <p>Just place your default state value in your false clause.</p>
<pre><code>if([Region] = "${whichRegion}",[State],"DefaultStateValue")
</code></pre>
<p>BTW, where are you using this expression at?</p>
|
Knockout.JS foreach nested JSON array <pre><code>I have a json such as
{
"Questionaires": [
"QuestionaireId": 295,
"QuestionaireName": "Test",
"Questions": [
{
"QuestionId": 21,
"QuestionName": "QuestionName",
"QuestionOptions": "Option1 O... | <p>Have a look at the mapping plugin. It works very well mapping JSON into a view model. </p>
<p><a href="http://knockoutjs.com/documentation/plugins-mapping.html" rel="nofollow">http://knockoutjs.com/documentation/plugins-mapping.html</a></p>
|
JavaFX setFitHeight()/setFitWidth() for an image used within a scrollPane disables panning <p>So I am creating a map in JavaFX and I would like to have the whole map visible at times. However, the issue is that after I set the imageView to fit the screen size then adding it to the scrollPane my zoom function works fine... | <p>You're scaling the <code>ScrollPane</code> instead of the content. Furthermore even if you scale the <code>ImageView</code>, <code>scaleX</code> and <code>scaleY</code> are not taken into account when it comes to calculating the content's size. Therefore the <code>ImageView</code> should also be wrapped in a <code>G... |
Java logically concatenate arrays <p>I have several 2D-arrays which appear in different combinations, i.e. one of them defines the center and eight others are logically (not physically) placed to the left, right, top, top-right, etc. The 'new array' is accessed like this:
if the x and y indices are within the boundarie... | <p>You can map the coordinates by some simple (and therefore quick) arithmetic operations. No ifs required for anything other that bounds-checking.</p>
<p>To begin with the simple case, 9 arrays, squares of the same dimension:</p>
<p>Make an [a x a] array of your arrays. You can select the array by the coordinates by... |
if(process.env.NODE_ENV === 'production') always false <p>When trying to build an angular-webpack application by running the build command from this scripts list on the package.json:</p>
<pre><code>"scripts": {
"test": "NODE_ENV=test karma start",
"build": "if exist dist rd /s /q dist && mkdir dist &a... | <p>The problem is that you're storing the single quotes in <code>NODE_ENV</code>, so the value of <code>NODE_ENV</code> is actually <code>"'production'"</code> instead of just <code>"production"</code>. This is evident in your debug output.</p>
<p>Change <code>set NODE_ENV='production'</code> to <code>set NODE_ENV=pro... |
Can we check multiple variables against same expression in python <p>I know we can check a variable against multiple conditions as </p>
<pre><code>if all(x >= 2 for x in (A, B, C, D)):
print A, B, C, D
</code></pre>
<p>My question is , can we do the reverse?
can we check me or two variables against same condi... | <p>You can put the variables in a <code>list</code> or <code>tuple</code>, then use the same idea using <code>all</code> to check that none of them are in your <code>tuple</code>.</p>
<pre><code>if all(var not in null_check for var in (variable1, variable2)):
print (variable1, variable2)
</code></pre>
|
Recycleview wrap_content issue <p>I am facing this weird issue where my Recycleview is wrap_content in height but it is taking full height of screen whereas my content is only occupying half the screen space.
I read it that this was a bug and it is fixed in 23.2.1. I am using :-</p>
<pre><code>compile 'com.android.sup... | <p>I recently faced the same issue true it's a bug ;
i solved it with simple hack :
place any linear layout or any view just below recyclerview and set it to invisible this will help recycler to adapt to wrapping height measurement.</p>
<p>Second solution to it is making custom linear layout and using this in recycler... |
Switching to design from source in .aspx page not working in visual studio 2015 <p>I donât know well the reason behind it, it was working perfectly days ago and starts showing this issue these days. Fine, Iâm using visual studio 2015 community, installed in windows 7 service pack 1. Please provide solutions to solv... | <p>The easy way to solve the issue is repair the application. For me it took half hour to complete the process and now its works good. Thanks for your help and support.</p>
<hr>
|
Cannot load font files, 404 error <p>I am using two font icons in a project. Font Awesome and a customize SVG font. All font files are in same folder. Here is the file structure:</p>
<pre><code>-assets
-css
-font-awesome.min.css
-themefy.css
-fonts
-font-awesome.eot
-font-awesom... | <p>Please remove the suffix (?-fvbane) from fonts CSS may be this can be caused for 404.</p>
|
How to create a TFS alert for changes to the items' Stack Rank field <p>How can I create an alert when any team member makes changes to the Stack Rank field (only) of any work item in TFS?</p>
| <p>You can add a alter filter in a work item team alter just including <strong>Stack Rank</strong> changes</p>
<p>Sample:</p>
<p><a href="http://i.stack.imgur.com/wWX3Z.png" rel="nofollow"><img src="http://i.stack.imgur.com/wWX3Z.png" alt="enter image description here"></a></p>
<hr>
<p>Update</p>
<p>You can also ... |
how to use condition in linq while reading node from xml file <p>how to add value of address and HomeAddress based on condition for Rule1 and Rule2.</p>
<p><strong>Xml File :</strong> </p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<File>
<Data>
<id></id>
<name>... | <p>You can make in-line conditions with the <a href="https://msdn.microsoft.com/en-us/library/ty67wk28.aspx" rel="nofollow">conditional operator</a>. Something like this:</p>
<pre><code> Address = someCondition ? Data.Element("address").Value : string.Empty,
HomeAddress = anotherCondition ? Data.Element("HomeAddress... |
Camera calibration for Structure from Motion with OpenCV (Python) <p>I want to calibrate a car video recorder and use it for 3D reconstruction with Structure from Motion (SfM). The original size of the pictures I have took with this camera is 1920x1080. Basically, I have been using the source code from the <a href="htt... | <p><strong>Question #2:</strong></p>
<p>With <code>cv::getOptimalNewCameraMatrix(...)</code> you can compute a new camera matrix according to the free scaling parameter <code>alpha</code>.</p>
<p>If <code>alpha</code> is set to <code>1</code> then all the source image pixels are retained in the undistorted image that... |
Can an HTML element be both displayed and ignored? <p>I am trying to draw SVG lines over HTML elements, while:</p>
<ol>
<li>The lines should be above the elements.</li>
<li>The elements should be clickable and selectable, meaning, the SVG does not cover the elements in terms of being able to click or select them.</li>... | <p>You can add following css to SVG lines.</p>
<pre><code>pointer-events: none;
</code></pre>
|
Test Case to call function on Document.ready <p>My JS code is mentioned below:</p>
<pre><code>if (typeof IPL === "undefined") {
IPL = {};
}
/// <summary>Declare Namespace IPL.Register</summary>
if (typeof IPL.Register === "undefined") {
IPL.Register = {};
}
$(document).ready(function () {
IPL... | <p>The best way to do this is by not testing the load event at all. Just put the event handler into a named function and then test the behaviour of that function. </p>
<pre><code>/// <summary>Declare Namespace IPL.Register.Print</summary>
IPL.Register.Print = {
/// <summary>Function to call on init... |
STR_TO_DATE from CONCAT <p>I have one date-field <code>ref_event_times</code>.<code>end_date</code> and one time-field <code>ref_event_times</code>.<code>end_time</code> in my table "ref_event_times"...</p>
<p>I try to union that as a one datetime field "end_date_time"...
Use follow</p>
<pre><code>STR_TO_DATE('CONCAT... | <p>MYSQL doesn't support your given datetime format <code>'%m/%d/%Y %H:%i'</code></p>
<p>The mysql date format should be like this <code>'%Y-%m-%d %H:%i:%s'</code> <a href="http://dev.mysql.com/doc/refman/5.7/en/date-and-time-types.html" rel="nofollow">Datetime format in mysql</a></p>
<pre><code> Data Type âZe... |
Error while reading with feather package <p>I am reading the scv file of ~50Mb with <strong>read_feather</strong> of feather package.</p>
<p>While reading the error is generated as follows: </p>
<pre><code>Error in .Call("feather_coldataFeather", PACKAGE = "feather", feather, :
negative length vectors are not allo... | <p>The answer is that this error message indicates corruption of the .feather file. The error message goes away if you don't overwrite the file with data in a new format. Use a new file, or delete the existing one, before saving data in a different format.</p>
<p>I ran into the same problem. Unfortunately the error me... |
Image magick create img with specific pixel width <p>I am creating this image:</p>
<p><a href="http://i.stack.imgur.com/g5sz0.png" rel="nofollow"><img src="http://i.stack.imgur.com/g5sz0.png" alt="enter image description here"></a></p>
<p>using this command:</p>
<pre><code>convert -size 720x480 xc:black -strokewidth... | <p>Try this:</p>
<pre><code>magick convert \
-size 720x480 xc:black \
-strokewidth 4 \
-stroke lime \
-draw "line 103,467 273,467" \
-stroke #0030ff \
-draw "line 103,471 273,471" \
-strokewidth 9 \
-draw "path 'M 108,159 h 171 v 111 h -171 v -115 Z'" \
-draw "path 'M 290,159 h 171 v 111 h -171 v -115 Z'" \
-draw "pat... |
ubuntu user is missing when creating an image with diskimage-builder (xenial cloud image as base) <p>I have tried to create a ubuntu new image using diskimage-builder v1.19.0 but I fail to log into this image using ssh with keys.
This only happens when I take the base image from: <a href="https://cloud-images.ubuntu.co... | <p>Adding the ubuntu user and the .ssh directory including a key solved the issue.</p>
|
Hide markers on embed google map on clicking in asp.net MVC <p>As shown in the picture bellow <a href="http://i.stack.imgur.com/04cw5.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/04cw5.jpg" alt="picture"></a>
Whenever i select any serial number i want to only show the marker which is for the selected serial n... | <h2>What are you doing?</h2>
<p>You are showing a static image with the URL </p>
<p><a href="https://www.google.com/maps/d/u/0/embed?mid=1-VlXsvMWMr8EotfMcIwYKt-1SrI" rel="nofollow">https://www.google.com/maps/d/u/0/embed?mid=1-VlXsvMWMr8EotfMcIwYKt-1SrI</a></p>
<p>in the code</p>
<pre><code><td style="text-alig... |
Defining php code as a variable - what is the simplest way? <p>I have some PHP code that will set an HTML code as variable like this:</p>
<pre><code>public function get_code() {
$code = '<h1>Title</h1>';
$code .= '<p>Text</p>';
return $code;
}
</code></pre>
<p>Now what if the HTML ... | <p>you can use single quotation inside double quotation and vice versa. so you can say like this.</p>
<pre><code>public function get_code() {
$code = "
if (in_array('custom_less', $options)) {
$style = '@import assets/css/style.less';
}
";
return $code;... |
KnockoutJS: bind values from array <p>I'm trying to bind translations to my view. My code gets the translations from Sharepoint 2013 as an array. Example:</p>
<p><code>[ {de: "Titel", key: "pageTitle"}, {de: "Stichwortsuche...", key: "searchPlaceholder"}, {...} ]</code></p>
<p>How can I use knockout to bind this to m... | <p>Just found an easy solution myself:</p>
<pre><code>var browserLang = navigator.language.substr(0, 2);
var translations = {};
$.each(translationArray, function (i, obj) {
translations[obj.key] = obj[browserLang];
});
</code></pre>
<p>Bindings are KO as usual (<code>data-bind="text: pageTitle"</code> and so on).... |
Adding a drawableLeft to an EditText shifts the hint towards right, if edittext is inside TextInputlayout <p><a href="http://i.stack.imgur.com/Qrk1H.png" rel="nofollow"><img src="http://i.stack.imgur.com/Qrk1H.png" alt="enter image description here"></a>I have make an EditText inside TextInputLayout. I am setting a dra... | <p><code>TextInputLayout</code> uses a helper class - <code>CollapsingTextHelper</code> - to manipulate its hint text. The instance of this helper is private, and none of the attributes associated with its layout are exposed, so we'll need to use a little reflection to get access to it. Furthermore, its properties are ... |
Entity Framework eager loading nested object graph, errors out to invalid column name <p>Guess, I am missing to notify a navigation property to EF while eager loading nested graph. Please let me know what am I missing ?.</p>
<p><strong>My simplified Object graph</strong> </p>
<pre><code>Product (ProductId, IEnumerabl... | <p>This should Work</p>
<pre><code> _yourContext.Product
.Include(p => p.ProductStatus)
.Include(p => p.Tasks.Select(t => t.TaskStatus))
</code></pre>
<p>You will not need </p>
<pre><code> .Include(p => p.Tasks)
</code></pre>
<p>Because ".Include(p => p.Tasks.Select(t => t.TaskStatus))" will ge... |
Notice: Undefined property: MongoDB\Driver\Manager::$mydb in [Path] in wamp server <p>I want to run <code>mongo</code> from <code>php</code> I am using <code>MongoDB 64 bit</code>, <code>WampServer 64 bit</code>, <code>Apache Version:
2.4.18</code> and <code>PHP Version: 5.6.19</code>. I also added <code>mongodb.dll</... | <p>Try </p>
<pre><code>new MongoClient()
</code></pre>
<p>If you still get the error then it Looks like it can't load the Mongo Module.</p>
<p>First You have to download the stable dll zip file. <a href="http://pecl.php.net/package/mongo" rel="nofollow">PHP-MONGO</a> </p>
<p>Download the Threaded-version of the mod... |
How do I avoid initializing an already initialized variable? <pre><code>namespace text_test
{
public class txt_program
{
public class txt
{
/* 0 */
int[] M_array_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
/* 1 */
int[] M_array_1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... | <p>One way is to write a static method that returns the array that you want, and use that to assign the field:</p>
<pre><code>public class txt
{
private int[][] M = createArray();
private static int[][] createArray()
{
/* 0 */
int[] M_array_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };... |
Keno number parser <p>Trying to make a script that will process Keno numbers in order to perform various pattern finding operations.</p>
<p>Each line of data looks like this:</p>
<blockquote>
<p>576186 15/9/2016 21:50 8 9 12 15 22 26 32 37 39 46 49 54 57 58 59 61 67 68 70 71</p>
</blockq... | <p>try this:</p>
<pre><code>@echo off
for /f "usebackq tokens=1* delims=:" %%a in ("keno.txt") do (
rem echo %%b
set "flag="
for %%# in (%%b) do (
if defined flag (
echo|set/p"=%%# "
) else (
set "flag=1"
)
)
)
</code></pre>
<p><strong>EDIT:</stro... |
Angular 2: defer component loading <p>I am trying to load a configuration file from a server in an Angular 2 app, and as you can imagine it contains initialization parameters needed for the entire app, so it must be loaded first.</p>
<p>The problem is that JS is async by design, and so there is no way to make the app ... | <p>In Angular2 Dart I use a <code>Future</code> to make it work; then whatever requires that property just has to <code>await</code> that value.
See: <a href="https://www.dartlang.org/tutorials/language/futures" rel="nofollow">https://www.dartlang.org/tutorials/language/futures</a></p>
<pre><code>Future gatherNewsRepo... |
Loading message while loading javascript iframe <p>I have a code like this:</p>
<pre><code><div class=scrbbl-embed data-src=/event/1234/5678></div>
<script>(function(d, s, id) {
var js,ijs=d.getElementsByTagName(s)[0];
if(d.getElementById(id))return;
js=d.creat... | <p>you can use iframe load function which is triggered when iframe is loaded and before that you can show loading message.</p>
<p>$('iframe').load(function(){});</p>
|
chart.js v2.0.0 redrawing the chart <p>I am using <strong>chart.js v2</strong> in my application because when I try to use bower to get the latest version it doesn't pull in the dist folder, but that is another issue.</p>
<p>I have created an angular wrapper for this plugin to get it onto my application.
The wrapper l... | <p>I found that if I modified the data, the chart redrew itself.
So with that in mind, I changed my init method to this:</p>
<pre><code>// Create our chart
self.init = function (ctx, data, options, type) {
// Create our config
var config = { type: type || 'bar', data: angular.copy(data), options: options || {... |
Change color of shape dynamically <p>Before marking this as a duplicate, please read my question first.</p>
<p>I have a shape with the id "rectangle" which looks like this:</p>
<pre><code><shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rectangle">
<padding android:left=... | <p>Try the below code: </p>
<pre><code> GradientDrawable drawable = (GradientDrawable) myrectangle.getBackground();
drawable.setColor(ContextCompat.getColor(context,stundenplandata.getJSONObject(i).getString("color")));
myrectangle.setBackground(drawable);
</code></pre>
|
Logged in user state <p>How can we programmatically access the user state in active directory? Especially
state such as active/away/lockedout etc. This is to build a web snapshot to view all logged in users and their individual state.</p>
<p>So far, I could search all users under a specific domain but no luck in findi... | <p>"Away" isn't something you're going to get out of Active Directory.</p>
<p>You <em>can</em> look at the following properties to get some of the info you want:
<a href="https://support.microsoft.com/en-us/kb/305144" rel="nofollow">userAccountControl</a> is the main property you want to look at.</p>
<p>using <code>... |
Django : reverse is not resolving url for inbuilt password reset <p>I want to use inbuilt password reset from Django.
My urls.py is as follows.</p>
<pre><code>app_name = 'recruiter'
urlpatterns= [
#urls
]
urlpatterns += [
url(r'^password_reset_done/$', password_reset_done, name='password_reset_done'),
url(r'^passwor... | <p>Use the namespace in the call to reverse.</p>
<pre><code>reverse('app_name:password_reset')
</code></pre>
<p>Or move your password reset URLs to a separate urls.py without a namespace.</p>
|
property not updated when I update UI using a converter <p>I'm using a Converter to display a property into a XAML MVVM view.</p>
<pre><code> <xctk:DoubleUpDown Value="{Binding CurrentIndex, Converter={StaticResource IndexToNumberConverter}} />
</code></pre>
<p>When the code updates the property, the IndexTo... | <p>If you want your changes on the UI to reflect back on your ViewModel you'll need a twoway binding. I don't know what your control does, but I'll show it with a TextBox.</p>
<pre><code><TextBox Text="{Binding Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged }" />
</code></pre>
<p>The <code>Mode=TwoWay<... |
angular.js:13920 TypeError: Cannot read property 'push' of null <p>This program is meant to send data in JSON from factory which will be used later, to localhost but instead i get the error. When one selects an order the order is sent to another orders. When i click select button is when the error occurs in the console... | <p>It seems that what is returned by <code>JSON.parse($window.localStorage.getItem("orderedfoods"))</code> is not an array. maybe there is nothing in localstorage? When you address a nonexistant item in localstorage it returns <code>null</code>.
You can try to fix it like this:</p>
<pre><code>var orderedfood = JSON.pa... |
Error handling on a Foreach-Object <p>I want to do something like:</p>
<pre><code>Get-ChildItem "somepath" | where {$_.PSIsContainer} | ForEach-Object{
#do something if Get-ChildItem didn't receive an error
#else do something else if did get an error
}
</code></pre>
<p>How do I go about this?</p>
<p>EDIT:
I ... | <p>You can use a combination of <code>-ErrorAction</code> and <code>-ErrorVariable</code>. It seems that using -Recurse in this way just ignores the directory with the error so I wrote a little recursive function instead.</p>
<pre><code>gci -Attributes Directory | Foreach {
foo $_.FullName
}
function foo
{
Pa... |
How to get Image with exif data while using DKImagePickerController? <p>I am using <code>DKImagePickerController</code> and i want to upload image to server with <code>exif</code> data. But this picker removes <code>exif</code> data from image.</p>
| <pre><code>if let originalAsset = asset.originalAsset {
let location = originalAsset.location
debugPrint("lat:\(location?.coordinate.latitude),lng:\(location?.coordinate.longitude)")
let createTime = originalAsset.creationDate
}
</code></pre>
|
opencv 3.1 installation and BaseFilter class <p>I tried compiling and installing opencv 3.1 on my Ubuntu box. After the installation I was trying to create a custom filter using the <code>cv::BaseFilter</code> class. But I cannot find the necessary include file for that. Right now I'm including <code><opencv2/imgpro... | <p>The filtering classes were made private in OpenCV 3.1. As a workaround one can add <code>CV_EXPORTS</code> to class definitions in <code>modules/imgproc/src/filterengine.hpp</code> (e.g., <code>class CV_EXPORTS BaseRowFilter</code>) then compile/install openCV from scratch again. After that, copy the same <code>fil... |
Slideshow using JavaScript <p>I am new in javascript, so here is my question. I am making a slideshow of three images using html css and javaScript. But it starts always with the second image. </p>
<p>Here my code:</p>
<pre><code>var slideIndex=0;
window.onload=showSlides;
showSlides();
function showSlides() {
v... | <p>1) you have incorrect usage of function. you use it twice:</p>
<pre><code>window.onload=showSlides;
showSlides();
</code></pre>
<p>instead, use one of them.</p>
<p>2) whenever function is executed, it may jump to second image. If so, simply start from <code>-1</code> start index, instead of <code>0</code>.</p>
|
Escaping $ variable in sed over ssh command? <p>I have a command like this:</p>
<pre><code>ssh user@hostname 'sed -e "s|foo|${bar}|" /home/data/base_out.sql > /home/data/out.sql'
</code></pre>
<p>The sed command is working in local shell. But it is not expanding the variable over ssh command. Thanks!</p>
| <p>The rule is that within single quotes, parameters are not expanded. You have single quotes around the entire command.</p>
<p>Try this:</p>
<pre><code>ssh user@hostname "sed -e 's|foo|$bar|' /home/data/base_out.sql > /home/data/out.sql"
</code></pre>
<p>Now <code>$bar</code> is expanded before the command strin... |
APK Update from different keystore <p>Reading <a href="http://stackoverflow.com/questions/4843212/the-apk-must-be-signed-with-the-same-certificates-as-the-previous-version">The apk must be signed with the same certificates as the previous version</a></p>
<p>I see the problem described as</p>
<blockquote>
<p>Upload ... | <p>Read the documentation: <a href="https://developer.android.com/distribute/tools/launch-checklist.html#marketupgrade" rel="nofollow">Launch Checklist & Publishing Updates on Android Market</a></p>
<blockquote>
<p>Before uploading the updated application, be sure that you have
incremented the android:version... |
Java: Can I Inject a runtime exception into an arbitrary class method at runtime? <p>For testing purposes, at times I'd like to see how my code handles having an unexpected runtime exception thrown, from various parts of the code.</p>
<p>For example, say I have a method like so:</p>
<pre><code>public int getSum(int x... | <p>For simple purpose you could try using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationHandler.html" rel="nofollow">Invocation Handler</a> : wrap class method calls and throw exception if needed. </p>
<p>For more sophisticated manipulation you can use <a href="https://docs.oracle.com/j... |
three.js how to map a texture on mtl,obj file <p>i'm trying to map a png file on mtl,obj file</p>
<p><strong>Before mapping</strong></p>
<p><img src="http://i.stack.imgur.com/4qSiK.png" alt=""></p>
<p>but after mapping, the mtl texture just disappear.</p>
<p><strong>After mapping</strong></p>
<p><img src="http://i... | <p>You've applied the same 'ang.png' texture to all child meshes. I think you need a conditional in the traverse function to apply the texture only to the part of the mesh that needs the texture. </p>
<p>The mtl should have applied a name to the material when it first loaded. For example, here I am pretending the mate... |
Swift: UIButton touch event not getting called inside the custom view <p>I have created a custom view from xib(freeform) in which there are two button (Login and cancel) and i have present it at a view according to some condition. Custom view get present on another view nicely but the button(Login an cancel) not gettin... | <p>You can also do like this way.</p>
<pre><code>import UIKit
class customAlertView: UIView {
@IBOutlet weak var messageLabel: UILabel!
@IBOutlet weak var loginButton : UIButton!
@IBOutlet weak var cancelButton: UIButton!
var view : UIView!
override init(frame: CGRect) {
super.init(frame: frame)
... |
How to place my email validation script into a php function <p>Struggling to create a function to validate any email address using the script below</p>
<pre><code>if (!preg_match('/^(?=^.{6,64}$)[a-zA-Z0-9][a-zA-Z0-9\._\-&!?=#]*@/', $user_mail)) {
$error_mail = empty_mail;
$display_f... | <p><strong>Server-side validation:</strong></p>
<p>It is a good idea to always validate data server-side.
Of course you need to do this client site with JavaScript but you can never trust client validation because you can easily pass that.</p>
<p><strong>That said, hereby the simple PHP server-side e-mail address val... |
How to run scripts automatically after doing vagrant ssh? <p>I am new to Vagrant but good in Docker.</p>
<p>In Vagrant I am aware of the fact that
<code>config.vm.provision :shell,path: "bootstrap.sh", run: 'always'</code>
in the Vagrantfile will provision vagrant box while doing <code>vagrant up</code>. With this, ... | <p>You can look at <a href="https://github.com/emyl/vagrant-triggers" rel="nofollow">vagrant trigger</a> plugin. You can run dedicated script/command after each specific vagrant command (<code>up</code>, <code>destroy</code> ...)</p>
<p>For example</p>
<pre><code>Vagrant.configure("2") do |config|
# Your existing V... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.