input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Save iteration values from list to single object <p>I'm trying to store in one object many values from list using for loop. All are of FloatField type. My function gives me many objects with one result. I need just one object with all values in one row.</p>
<p>views.py</p>
<pre><code>namesOfModelFields = [f.name for ... | <p>I still don't understand anything that you're doing. But if you just want to create a single model instance, then do that, and don't muck about with forms or loops.</p>
<pre><code>values = dict(zip(resultsOfNames, resultsOfValues))
new_item = ModelName.objects.create(**values))
</code></pre>
|
Why does `typeof false || undefined` returns "boolean" <p>I've just executed the following in console:</p>
<pre><code>typeof false || undefined // "boolean"
</code></pre>
<p>While I expected it to return "undefined", since</p>
<pre><code>typeof undefined // "undefined"
</code></pre>
<p>Why did it return "boolean"? ... | <p>You're not observing <strong>operator precedence!</strong></p>
<pre><code>> typeof false || boolean // (typeof false) || boolean
"boolean"
> typeof (false || boolean)
"undefined"
</code></pre>
|
for loop assigns same functon everytime in Livescript <p>I would expect "x's" results, "y's" results and "z's" results be the same: </p>
<p>In Livescript: </p>
<pre><code>x =
a: -> 3
b: -> 4
y = {}
for k, v of x
console.log "key: ", k, "val: ", v
y[k] = -> v.call this
console.log "y is: ", y... | <p>Root of the problem was Livescript's <code>fn$</code> optimization. Following code works well: </p>
<p>Livescript: </p>
<pre><code>x =
a: -> 3
b: -> 4
y = {}
for k, v of x
console.log "key: ", k, "val: ", v
y[k] = ``function (){return v.call(this)}``
console.log "y is: ", y
console.log "x's:... |
How to prevent overlapping of labels in JavaScript <p>I am trying add labels on sphere, but I am unable to do it only one label is attaching to the sphere and the
rest of labels are overlapping to the corner of the screen. I have also uploaded the image where you can see
the problem. Maybe its css problem,but I dont kn... | <p>Look at how things are set up</p>
<pre><code>for(var i = 0; i< spritearray.length;i++)
{
var Ncardinal = spritearray[i];
sprite = new labelBox(Ncardinal, radius, document.body);
var marker = new THREE.Mesh(new THREE.SphereGeometry(0.05, 30, 30));
marker.po... |
GET ALL VALUES INNER JOIN MYSQL <p>I have a simple question, I wonder how do you do this....</p>
<p>Let's say </p>
<pre><code>Table 1 I have userId and name (1000 records)
Table 2 I have carId and name (90 records)
Table 3 I have userId, carId and value (820 records)
</code></pre>
<p>There's simple join that would l... | <p>Try this: The key is using left outer join, instead of inner join. Inner join requires there to be a row in both the joined tables. left join only requires a row in the first (left-hand) table specified. Then you can use a "coalesce" statement to display 0 instead of null for the empty rows.</p>
<pre><code>select
... |
FCM Token is not generating in some android devices <p>I was having issues in GCM, so i migrates to FCM but I am still getting issues related to token.</p>
<p>I launched my updated app and I checked that there is 300 new users,
200 of them are getting tokens and 100 are not getting any token, it's a very critical issu... | <p>You get your FCM token from MyInstanceIDListenerService class onTokenRefresh() method on every fresh installation.</p>
<p>Or you can also get FCM token with this line of code:</p>
<pre><code>FirebaseInstanceId.getInstance().getToken();
</code></pre>
|
Indicate AM/PM on LCD Display for RTC <p>So I have this Arduino program wherein the goal is to display the real time (based on my computer) on the LCD display. I have properly configured the time and date but the only remaining issue is I am not sure how to let the program properly indicate if it's PM or AM. Here's the... | <p>You know exactly when it's AM and when it's PM. So just keep it to later:</p>
<pre><code> bool pm = false;
if (tm.Hour>12)
{
tm.Hour = tm.Hour - 12;
print2digits(tm.Hour);
pm = true;
}
else
{
print2digits(tm.Hour);
}
</code></pre>
<p>and later:</p>
<pre><code>lcd.print(pm ? " PM" : " AM"); //... |
Alter style bits of initialized controls <p>Is it possible to alter the <a href="https://wiki.eclipse.org/SWT_Widget_Style_Bits" rel="nofollow">style bits</a> of SWT controls after initialization? I know I can pass them to the constructor, but I wonder if I can also change them after having called the constructor. I kn... | <p>No, the style bits are fixed and cannot be changed.</p>
<p>One reason for this is that the SWT implementation for a platform may actually create completely different native controls depending on the style. </p>
<p>For example on macOS the read only <code>Combo</code> uses <code>NSPopUpButton</code> whereas the rea... |
Display blank space if data is not present for a particular date <p>I want to display blank space if data is not present for those dates in Highstock. If data is not present for the month of November, then blank space should be displayed on Highstock for that month. For October and December, data should be displayed.</... | <p>I think you need to play around with <a href="http://api.highcharts.com/highstock/series%3Cspline%3E.gapSize" rel="nofollow"><code>gapSize</code></a>:</p>
<blockquote>
<p>Defines when to display a gap in the graph. A gap size of 5 means that if the distance between two points is greater than five times that of th... |
How to pass value from <asp:textbox> to javascript function <p>I am trying to call a <code>javascript</code> function from <code><asp:textbox></code>. My <code>javascript</code> function needs to add value from two <code><asp:textbox></code>, add them and then pass the value to another <code><asp:textbox... | <p>Try with parsing value in float like below code.</p>
<pre><code> parseFloat("10");
</code></pre>
<p>Now multiply both value, also check your id get changed or not in browser doing inspect element.</p>
|
avoiding redundant code in boost::variant visitors <p>I am facing the following problem:
I have some visitors on for boost::variant, which all doing the same for a specific type, here foo, so the method </p>
<pre><code>void operator()(const foo& ast)
{
//allways the same
}
</code></pre>
<p>is allways the same... | <p>Something like this?</p>
<pre><code>template<typename Derived>
struct VisitorBase {
void operator()(const foo& ast) {
for(auto&& item : ast.members) {
boost::apply_visitor(*static_cast<Derived*>(this), item);
}
}
};
struct VisitorA : VisitorBase<Visito... |
How to Sort Amount Number Negative and Positive Number In SQL server <p>I have working SQL Server.I have More than 20000 Lines Using SQL server.I have column Filed Name Amount. in Amount Filed Inserted negative and Positive Number .Now I want Sort Amount Field Negative and Positive Number </p>
<p>Example Like :</p... | <p>Use <strong>ABS Function in sorting</strong>:</p>
<p><strong>ABS() :</strong> It will convert your negative value to positive</p>
<pre><code>SELECT
*
FROM TableName
Order BY ABS(Amount)
</code></pre>
<p>If you wants if <strong>negative and positive value same</strong> and order should <strong>consider positi... |
Caching in python using *args and lambda functions <p>I recently attempted Googles <a href="http://www.ibtimes.co.uk/google-foobar-how-searching-web-earned-software-graduate-job-google-1517284" rel="nofollow"> foo.bar challenge</a>. After my time was up I decided to try find a solution to the problem I couldn't do and ... | <p>The notation <a href="https://docs.python.org/3/tutorial/controlflow.html#arbitrary-argument-lists" rel="nofollow"><code>*args</code></a> stands for a variable number of positional arguments. For example, <code>print</code> can be used as <code>print(1)</code>, <code>print(1, 2)</code>, <code>print(1, 2, 3)</code> a... |
How to collect trace in oracle 11g and 12c? <p>Hi i am using Oracle <code>11g</code> and <code>12c</code>. We are trying to achieve scenario navigation and want to collect background oracle queries. Let's say i am doing activity like login to the application and now i wanted to know what queries are getting used during... | <p>There are various ways to generate trace files but since you want to capture everything you can turn it on at the database level:-</p>
<pre><code>ALTER SYSTEM SET sql_trace = true SCOPE=MEMORY;
</code></pre>
<p>once you've completed your testing turn it off (really as soon as you can)</p>
<pre><code>ALTER SYSTEM ... |
How to create folder in mvc4 <p>I am developing one MVC4 application and hosting in IIS web server. </p>
<p>I want to upload and save few files in folder called <code>UploadedFile</code> inside <code>F</code> drive.
I wrote below piece of code to create folder however it does not work</p>
<pre><code>if (!System.IO.D... | <p>There is nothing wrong with keeping your files outside of the web folder, as long as you take care of setting up security and ACL's properly. This stuff is not trivial to do and you may end with security issues if you don't configure it correctly.</p>
<p>In your case I think you are getting a wrong path when trying... |
Tracking the progress of a drag event while running. JavaFX <p>Is there a way to track the value to the position of the mouse while the drag event is still running and if the value is so and so then execute some code code?</p>
<p>Edit: Since this confuses people. I am looking for a way to get real time data of the pos... | <blockquote>
<p>You can use <code>setOnMouseDragged();</code>:</p>
</blockquote>
<pre><code>source.setOnMouseDragged(m->{
System.out.println("MouseScreenX:"+m.getScreenX()+", MouseScreenY:"+m.getScreenY());
System.out.println("MouseSceneX:"+m.getSceneX()+", MouseSceneY:"+m.getSceneY());
... |
How do I load Models in Child controller class & use in Parent class? <p>I'm trying to organize my Controllers & models, and moving common code to Parent classes. I've managed to organize my models, but am now stuck on organizing the controllers.</p>
<p>My Parent controller is:</p>
<pre><code><?php if ( ! defi... | <p>in MY_Controller:</p>
<pre><code>...
public function set_model($object)
{
$this->model = $object;
}
...
</code></pre>
<p>in Hospital:</p>
<pre><code>...
public function __construct(){
parent::__construct();
$this->load->model('hospital_model');
parent::set_model($this->hospital_model);
}
... |
Parallels mounter is unable to open the virtual hard disk <p>I installed parallel 9 with Windows 10 images installed on mac. </p>
<p>When I try to share mac folders to windows 10 manually I encounter following error
"Parallels mounter is unable to open the virtual hard disk".
Following document : <a href="http://kb.p... | <p>It fails because Parallel 9 does not support Windows 10. After upgrade to Parallel 12 and re-install Win 10. Everything goes fine.</p>
|
LongListSelector Data Binding Issue <p>I am a beginner in windows Windows phone programming.
i am trying to implement LongListSelector to display group by products.</p>
<p>here are my classes :</p>
<pre><code>public class ProductMaster {
public string Name { get; set; }
public List<ProductSubMaster> Mod... | <p>i have added listbox in itemtemplate solved my issue </p>
<p>here is my updated code </p>
<pre><code><phone:LongListSelector.ItemTemplate>
<DataTemplate>
<ListBox x:Name="LstFeaturesData" Visibility="Visible" ItemsSource="{Binding Path=Models}"... |
how to make textview of the listview clickable <p>I have a customized <code>listview</code> contains of some <code>Textviews</code>. I set the list view to the <code>adapter</code> as follows:</p>
<pre><code>BestandTypAdapter bestandTypAdapter = new BestandTypAdapter(getActivity(), R.layout.bestand_type_liste, dataLis... | <p>Just try to add this attribute for the TextView:</p>
<pre><code>android:focusable="false"
</code></pre>
|
Accessing variables from IIFE <p>I have the following closure:</p>
<pre><code>var Container = (function () {
var variable;
var changeVariable = function () {
variable = 5;
};
return {
variable: variable,
changeVariable: changeVariable
};
})();
Container.changeVariable();
console.lo... | <p>Use a getter:</p>
<pre><code>return {
get variable() { return variable; },
changeVariable: changeVariable
};
</code></pre>
|
WebAPI 2 Authentication Confusion <p>After dooing some research i understood there are many ways to implement authentication and authorization in WebAPI 2 ...
I'm looking specifically at Token based authentication</p>
<ol>
<li>implementing a custom OAuth Provider and injecting it to OWING pipline </li>
<li>implementi... | <p>You can use the Microsoft Wilson library which will do the token authentication and validation for you. The latest release of the Wilson library can be found here <a href="https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet" rel="nofollow">https://github.com/AzureAD/azure-activedirec... |
Error:Execution failed for task ':app:transformJackWithJackForDebug' <p>I am facing following issue while running application.</p>
<blockquote>
<p>Error:Execution failed for task ':app:transformJackWithJackForDebug'.
com.android.sched.scheduler.RunnerProcessException: Error during
'MethodIdMerger' runner on '':... | <p>I am able to solve above problem by increasing memory size of Gradle Daemon VM to 2GB. To do that , You need to modify <strong>gradle.properties</strong></p>
<p>Add following line in your properties file.</p>
<p><code>org.gradle.jvmargs=-Xmx2048m</code></p>
|
How can I get an auto-generated string name suggestion when extracting a string resource? <p>How can I get an auto-generated string name suggestion when extracting a string resource? I distinctly remember that in one of my configurations, whenever I pressed Alt-Enter, it would provide actual suggestions for my extracte... | <p><a href="http://i.stack.imgur.com/NQzhB.png" rel="nofollow"><img src="http://i.stack.imgur.com/NQzhB.png" alt="enter image description here"></a>The strings can be extracted to <code>strings.xml</code> file by simply selecting/highlighting the string and pressing <code>Alt + Enter</code>, then click Extract string r... |
Conditional jump or move depends on unitialised values(s) even though my variable is initialised? <p>According to Valgrind, the variable "holder" is uninitialized in my function spaceMove(). Noticeably, it says that whenever I try to manipulate that variable. I tried initializing it to NULL before getting into the loop... | <p>You can not use <code>strcat</code> with a non <code>'\0'</code> terminated string</p>
<pre><code>holder = malloc(strlen(str)+1);
holder[0] = '\0'; /* Add this line */
</code></pre>
<p>Or use <code>calloc</code> instead of <code>malloc</code></p>
|
I am trying to upgrading pip from 8.1.1 to 8.1.2 . but it showing following 'PermissionError: [WinError 5] Access is denied:.how to upgrade pip? <blockquote>
<p>C:>python -m pip install --upgrade pip
Collecting pip
Using cached pip-8.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existi... | <p>open your cmd with admin priviliges. for that right click in icon and select open with administrator.</p>
|
Can we create database in SAP HANA? <p>I am new to SAP HANA and I created a new user in SAP HANA hdbsql(command line) by </p>
<pre><code>hdbsql=>create user username password password
</code></pre>
<p>Now I am trying to create a database with the query,</p>
<pre><code>hdbsql=>CREATE DATABASE dbname
</code></pr... | <p>The SAP HANA database does not have the concept of different databases, but of schemas instead. So if you want to create a "container" for your tables, you have to create your own schema. The definition of the CREATE SCHEMA statement can be found here:
<a href="https://help.sap.com/saphelp_hanaplatform/helpdata/en/2... |
how to make the following jquery slider code slide automatically <pre><code>jQuery(function($) {'use strict',
//#main-slider
$(function(){
$('#main-slider.carousel').carousel({
interval: 3000
});
});
});
</code></pre>
<p>Following is the html code where it is used:</p>
| <p>Try out following :</p>
<pre><code>$(function(){
$('#main-slider.carousel').carousel({
interval: 3000,
autoplay:true
});
});
</code></pre>
|
Connecting C++ program with Java API <p>I have a C++ AES alogirthm program, which I am using to encrypt text files, that are present on the same machine.
Now I am increasing its functionality by uploading new files on that machine from different machines, by making use of a web app.</p>
<p>My web app is made of java,... | <p>Correct me - your Java program downloads the file and puts it into some known location? so why don't you just create JNI wrapper (a jar lib) for your c++ application and then, after success download, you just tell your lib /path/to/file and encrypt it? </p>
<p>Maybe you can also encrypt the byte stream you receivin... |
Apache Flink (How to uniquely tag Jobs) <p>Is it possible to tag jobs with a unique name so I can stop them at a later date?. I don't really want to grep and persist Job IDs. </p>
<p>In a nutshell I want to stop a job as part of my deployment and deploy the new one.</p>
| <p>You can name jobs when you start them in the <code>execute(name: String)</code> call, e.g.,</p>
<pre><code>val env: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment()
val result: DataStream[] = ??? // your job logic
result.addSink(new YourSinkFunction) // add a sink
env.execut... |
Access Selenium IDE output in Selenium WebDriver <p>I'm having this requirement in which i need to access an element on my page and want to get all the properties of the element. I have already written a webdriver script to get the id,name,css,linktext but i'm not getting the idea how to get the xpath and css selector ... | <p>You can generate absolute xpath. Please take a look at this: <a href="https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/5520" rel="nofollow">https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/5520</a> </p>
|
How to pass json data with keys containing dot(.) character in jquery datatable <p>I want to pass extra parameters like u.first_name, u.last_name in the datatable ajax so that I can directly take this key as the mysql column names in query. Here it is not getting properly since the dot(.) exists in keys. Is there any w... | <p><code>"u.first_name" : ...</code> will just add a property with the name <code>u.first_name</code> to <code>extra_param</code>, so you end up with <code>d.extra_param.u.first_name</code>. Perfectly legal but not a nested object. You can do the following instead :</p>
<pre><code>d.extra_param = {}
d.extra_param.u = ... |
Binding outputs of transformers in FeatureUnion <p>New to python and sklearn so apologies in advance. I have two transformers and I would like to gather the results in a `FeatureUnion (for a final modelling step at the end). This should be quite simple but FeatureUnion is stacking the outputs rather than providing an n... | <p>The transformers in the <code>FeatureUnion</code> need to return 2-dimensional matrices, however in your code by selecting a column, you are returning a 1-dimensional vector. You could fix this by selecting the column with <code>X[[self.col_name]]</code>.</p>
|
How to return multiple values using mulitple criteria in Excel <p>I am trying to return multiple values using multiple criteria...below is the code I have tried (but using the special brackets) but it keeps coming back as though I am trying to create a sum and have an error...</p>
<pre><code>=IFERROR(INDEX(Sheet2!$C$4... | <p>There are several errors in the first formula you give, i.e.:</p>
<p><code>=IFERROR(INDEX(Sheet2!$C$4:$C$25,SMALL((IF(Sheet2!$D$4:$D$41=Sheet3!G2)*(Sheet2!$E$4:$E$67=Sheet3!$L$3),ROW(Sheet2!C4:C24)),ROW(1:1))),"")</code></p>
<p>For one, the ranges passed should be <strong>of an identical size</strong>; in your cas... |
Animated text funtion only working for certain strings <p>I am attempting to make a function that displays animated text in Python</p>
<pre><code>import sys
def anitext(str):
for char in str:
sys.stdout.write(char)
time.sleep(textspeed)
print ("")
</code></pre>
<p>This function is work... | <p>You just need to use argument unpacking. See <a href="https://docs.python.org/3/tutorial/controlflow.html#arbitrary-argument-lists" rel="nofollow">Arbitrary Argument Lists</a> in the official Python tutorial.</p>
<pre><code>import sys
import time
textspeed = 0.2
def anitext(*args):
for s in args:
for ... |
draw animation which will draw skull in objective c <p>I want to RUN animation in Objective c</p>
<p>I am capturing user photo using <code>AVCaptureSession</code>, and showing the image over the UIImageView.
Once the image is shown, I have to RUN animation starting from Top of the head to end of chin.
There are total ... | <p>Create bezier paths with the points you want to animate like so:</p>
<pre><code>UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(0.0, 0.0)];
[path addLineToPoint:CGPointMake(200.0, 200.0)];
[path addLineToPoint:CGPointMake(200.0, 200.0)];
..... add all your points .....
</code></pre>
... |
angularjs Why dropdown not binding values in it <p>Here I'm fetching data from DataBase using where condition here every textbox showing value but why dropdown not showing values </p>
<pre><code><select ng-options="I.CountryID as I.CountryName for I in CountryList" ng-model="CountryID">
<option value="{... | <p>Post here what you get in console on inspect element</p>
<p>Anyway, here's a simple example of what you are trying to do, this snippet was taken from angularjs site, hope it will help you.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code... |
EON Chart not visible on page load <p>I have a working EON chart that is not displaying on initial page load resulting in a blank page. If I switch to another browser tab, and then straight back to the graph tab, the graph then shows. </p>
<p>Here is the HTML / JavaScript and the CSS.</p>
<p>Your help is appreciated.... | <p>Couple things going on here:</p>
<ul>
<li>move your library references to inside the <code><head></code> tags</li>
<li>but the real issue: your EON code is referencing <code>#charttemp</code> but it is not rendered yet because the that <code><div></code> is below the EON script and that is why it requir... |
Open phone settings when button is clicked in my app - iOS 10 Swift 3 issue <p>I recently upgraded to xcode 8 and converted my code to Swift 3. I am making a custom keyboard (extension) which worked perfectly fine till iOS 9, but i am facing a couple of issues in iOS 10. </p>
<ol>
<li>The container app of the custom ... | <p>@persianBlue: This is working on Xcode8 + iOS10.</p>
<pre><code>UIApplication.shared.openURL(URL(string:UIApplicationOpenSettingsURLString)!)
</code></pre>
|
Reverse Owl Carousel on last slide <p>By default owl carousel display slides in order like this, for example if I have 3 slides:</p>
<pre><code>[1] [2] [3] [1] [2] [3] [1] [2] [3] ...
</code></pre>
<p>I want to achieve this:</p>
<pre><code>[1] [2] [3] [2] [1] [2] [3] [2] [1] ...
</code></pre>
| <p>You can imitate a reversal by cloning of items. </p>
<ol>
<li>Clone items that are in the middle:<br>
<code>[1] [2] [3] [4]</code> -> <code>[1] [2] [3] [4] [3] [2]</code>.</li>
<li>Start <a href="http://www.owlcarousel.owlgraphic.com/docs/api-options.html" rel="nofollow">Owl Carousel 2</a> in <code>loop</code> mode... |
Focus is not working in IE even after adding much delay <p>This question has a reference to the solution posted here. <a href="http://stackoverflow.com/a/2600261/5086633">http://stackoverflow.com/a/2600261/5086633</a></p>
<p>I am facing similar issue in IE but even after adding much delay <code>200</code> this is not ... | <p>Very odd. It works for me... which isn't much of an answer (win7, IE11, jquery 2.2.4). What specific IE/OS/Jquery version are you using?</p>
<p>Does the "run code snippet" button below your code above work/not work?</p>
<p>What about this jsfiddle: <a href="https://jsfiddle.net/u68gmzyc/" rel="nofollow">https://js... |
Angular JS Folder Upload <p>I know that Chrome has api for folder upload. But I have found that the feature is marked as deprecated and will be removed soon. Does someone know other way to do folder upload? </p>
| <p>Uploading folder is not possible. You may upload single file, multiple files or zip files.</p>
<p>For this you may use ng-file-upload</p>
|
Google Analytics with Firebase <p>I am trying to integrate Google Analytics in my iOS app. On <a href="https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download" rel="nofollow">Analytics page</a>, Google is recommending to download (this <a href="https://developers.google.com/analytics/devguides/... | <p>Here I am showing you how you can add Analytics to your iOS app to measure user activity to named screens. If you don't have an application yet and just want to see how Analytics works, take a look at our sample application.</p>
<p>Note: Beginning with version 3.16 of the Google Analytics for iOS SDK, Xcode 7.3 or ... |
Python, scipy.optimize.curve_fit do not fit to a linear equation where the slope is known <p>I think I have a relatively simple problem but I have been trying now for a few hours without luck. I am trying to fit a linear function (linearf) or power-law function (plaw) where I already known the slope of these functions ... | <p>I just discover an error in the functions:</p>
<p>It should be : </p>
<pre><code>def plaw(x,a):
b=-0.1677 # known slope
y = a*(x**b)
return y
</code></pre>
<p>and not</p>
<pre><code>def plaw(a,x):
b=-0.1677 # known slope
y = a*(x**b)
return y
</code></pre>
<p>Stupid mistake.</p>
|
C programming - how to use a While loop for save user's values in an array <p>I'm trying to create an array from user's input and then I'll analyze it and say if it is a symmetric array or not.</p>
<p>But I've already a problem in my while loop and I can't understand where is the problem.</p>
<pre><code>#include <... | <p>The problem is </p>
<pre><code>int array[] = {};
</code></pre>
<p>which is a basically a zero-sized array and in C, arrays cannot be <em>re-sized</em>. </p>
<p>For this very reason, every access to <code>array[i]</code> in your code is an invalid memory access which invokes <a href="https://en.wikipedia.o... |
If a table is dropped from pg_class accidentally then how to restore it from backup? <p>I accidentally dropped a table from <code>pg_class</code> and I have the same table present in a different server inside a schema. How do I restore it? </p>
<p>I have tried this </p>
<pre><code>psql -U {user-name} -d {desintation_... | <p>That's what you get from messing with system catalogs.</p>
<p>The simple and correct answer is “restore from a backup”, but something tells me that that's not the answer you were looking for.</p>
<p>You could drop the type that belongs to the table, all indexes on the table, all constraints, toast tabl... |
Jenkins task for remote hosts <p>In deploy scenario i need to create and run jenkins task on list of hosts, i.e. create something like parametrized task (where ip address is a parameter) or a task on <a href="https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin">Multijob Plugin</a> with HOST axis, but run by onl... | <p>Assume that the hosts have been configured as Jenkins slaves already.
Assume that hosts are provided in pipeline job parameter
<code>HOSTS</code> as whitespace separated list. Following example should get you started:</p>
<pre><code>def hosts_pairs = HOSTS.split().collate(2)
for (pair in host_pairs) {
def branch... |
How do I load QBytesArray containing a zip file to QuaZip? <p>I'm using Qt Creator in a new project, so I don't know many things about this... :(
I want to download a zip file, containing a json file, read this file and use that information. I can download the zip, save it in my disk and open it again to read json and ... | <p>You can use <a href="http://doc.qt.io/qt-5/qbuffer.html" rel="nofollow">QBuffer</a>. It provides a QIODevice interface for a QByteArray. </p>
<p><strong>Example:</strong></p>
<pre><code>QByteArray byteArray("abc");
QBuffer buffer(&byteArray);
buffer.open(QIODevice::WriteOnly);
buffer.seek(3);
buffer.write("def... |
Doubts with Keras RNN formats and layers <p>Ok, I know this has been asked before but I'm afraid I have not fully grasped the comments/solutions, so let me write here my own problem:</p>
<p>It's a very basic problem. I have an array <code>X_train</code> of shape <code>(35584,)</code> that represents measures each hour... | <p>Ok, I'm going to self answer this question in case it can be useful for someone. How to do a regression with a RNN in Keras it is very well explained here. The blog, besides, has a lot of resources for machine learning and the explanations are superb. Strongly recommended. Link with the explanations of formats, laye... |
How to add multiple data tags to BufferedWriter? <p>my Android application uploads string data to a PHP webservice. This usually works if I restrict myself to one single datum. However, I'm in a situation where I need to identify different datasets in my PHP script.</p>
<p>This is what I try:</p>
<pre><code>URL url =... | <p>Try this,</p>
<pre><code>String datum1 = URLEncoder.encode(datum1json.toString(), "UTF-8");
String datum2 = URLEncoder.encode(datum2json.toString(), "UTF-8");
String params = "datum1=" + datum1 + "&" + "datum2=" + datum2;
BufferedWriter writer = new BufferedWriter( new OutputSteramWriter(outputStream, "UTF-8"... |
Correct the word "urgent" with repeated letters using regular expression in Java <p>I want to change "Hitttt Urrggeennnttt Rrare" with "Hitttt Urgent Rrare" using regex, or "Uupppp Uuurrggeent Upp!! Barrkk" with "Uupppp Urgent Upp!! Barrkk". (All words are in camel case.)</p>
<p>I mean I just want to correct the 'urge... | <p>This should work for you:</p>
<pre><code>public static void main(String[] args) {
String s = "hitttt Urrggeennnttt rrare";
s = s.replaceAll("(?i)u+r+g+e+n+t+", "Urgent"); // ?i ==> case insensitive
System.out.println(s);
}
</code></pre>
<blockquote>
<p>hitttt Urgent rrare</p>
</blockquote>
|
Android M & Lollipop - Mark missed call as read <p>I use below code to clear missed calls after I launch my app. In this I get rows affeted is 1. But when i get next missed call, at that time android's stock phone app adds a new notification as "2 new missed calls". Means they are not counting my clear. Am I missing so... | <p>I'm facing the same problem. There is a similar question here:
<a href="http://stackoverflow.com/a/26564121/6433463">http://stackoverflow.com/a/26564121/6433463</a></p>
<p>I'm starting to think (as stated in that thread) that the only way to achieve that is by opening the stock call log (I hope I'm wrong, but could... |
How to update an existing SQLite db table data with new android app update? <p>I recently launched an app on the android app store that contained a SQLite database.</p>
<p>I am now attempting to release an update of the app, and want to add more data into the existing database, however have come a bit unstuck. I have ... | <p>SQLiteOpenHelper onCreate() and onUpgrade() callbacks are invoked when the database is actually opened, for example by a call to getWritableDatabase().onCreate() is only run when the database file did not exist and was just created. onUpgrade() is only called when the database file exists but the stored version numb... |
Regex to match hyphen between two specific words <p>Given the below sample, how would I match each hyphen found between the words "CAST" and "DATETIME"? (<code>CAST(N'2013-11-26 10:52:47.957' AS DateTime)</code>)</p>
<p>The pattern occurs multiple times per row.
There could be hyphens anywhere else in the string that ... | <p>If you can use Notepad++, you may use a regex based on a <code>\G</code> operator that helps find consecutive matches after an initial match.</p>
<p>Use</p>
<pre><code>(?:\bCAST\b|(?!^)\G)(?:(?!\b(?:DATETIME|CAST)\b)[^-])*\K-
</code></pre>
<p>and replace with any symbol(s) you want (remember that parentheses must... |
jQuery File Upload Plugin single-file-uploads removed cancel button option <p>Hi I'm working with <a href="https://blueimp.github.io/jQuery-File-Upload/" rel="nofollow">JQuery File Upload plugin</a>. </p>
<p>It works well and I already implemented some functionality with it. However, I required uploading all files in ... | <p>You can try below script:</p>
<pre><code>$('#fileupload').fileupload('option', {
maxChunkSize: 10000,
resizeMaxWidth: 1920,
resizeMaxHeight: 1200,
maxNumberOfFiles: 1,
limitConcurrentUploads: 1,
sequentialUploads: true,
singleFileUp... |
easy way to merge rows in 2D array <p>I have a 2D array[,], and I want to set the array[0] row to be equal to the array[1] row.</p>
<p>Originally I thought array[0] = array[1] would set all row 0 variables to be equal to row 1 variables. But it didn't work.</p>
<p>so I tried this,</p>
<pre><code>for (int i = 0; i &l... | <p>Obviously, the loop will go out of bounds. </p>
<p>For a 2D array, <code>itemList.Length = number of rows * number of columns</code></p>
<p>You can try out the following:</p>
<pre><code>int rowLength = itemList.GetLength(0);
int colLength = itemList.GetLength(1);
for (int j = 0; j < colLength; j++)
{
itemL... |
Printing large WPF User Controls <p>I have a huge data which I want to print using WPF. I found that WPF provides a <code>PrintDialog.PrintVisual</code> method for printing any WPF control derived from the <code>Visual</code> class. </p>
<p><code>PrintVisual</code>will only print a single page so I need to scale the c... | <p>I'm assuming your report is displayed in a <code>DataGrid</code> or something else that is scrollable?</p>
<p>I believe <code>FlowDocument</code> is definitely your best choice here if you want to print something that looks, for lack of a better word, professional. But if you want something quick and dirty, you cou... |
Using inline javascript correctly <p>I'm using a service called OneSignal to deliver push notifications to desktop and mobile devices. I'm trying to use a button element to trigger some inline javascript which is an option directly available for this element as the button allows an inline onclick javascript event to be... | <pre><code>OneSignal.on('subscriptionChange', function(isSubscribed)
</code></pre>
<p>Usually the <code>subscriptionChange</code> refers to either an ID of an element or a Class.</p>
<p>try <strong>#subscriptionChange</strong> which means it's an ID usually otherwise try <strong>.subscriptionChange</strong> since the... |
Kotlin,Java,multidex,Dagger 2,Butterknife and Realm: transformClassesWithJarMergingForDebug: duplicate entry: org/jetbrains/annotations/NotNull.class <p>We have existing Java Android code. We want to painlessly slowly start moving to Kotlin. We use Dagger 2, Butterknife and Realm. We use Java 8 compiler (but our <code>... | <p>Try to delete: <code>compile 'org.jetbrains:annotations-java5:15.0'</code>. If it won't work, follow these steps:</p>
<p>Go to your <code>app/build.gradle</code> file and add:</p>
<pre><code>configurations {
cleanedAnnotations
compile.exclude group: 'org.jetbrains' , module:'annotations'
}
</code></pre>
... |
Macro define for type is not working <p>why is the following code not working?</p>
<pre><code>// Template function definition
template <typename T>
void apply(const T& input);
// Helper macro definition
#define APPLY_FUNCTION(PIXELTYPE) \
apply<##PIXELTYPE>(input);
// Use macro to call function
APP... | <p><code>##</code> is for pasting tokens together. You don't need that, so just:</p>
<pre><code>#define APPLY_FUNCTION(PIXELTYPE) apply<PIXELTYPE>(input);
</code></pre>
<p>That said, two guidelines:</p>
<ol>
<li>Don't end your macro with a <code>;</code> Requiring the user to add it will save you from some bug... |
How can I protect my DOM content from other tabs/extensions in browser? <p>I'm developing the secure application using WPF (Desktop app) with obfuscating it and preventing from spying its process.</p>
<p>All is fine, but WPF is a desktop application and Windows only. It's 2016 year and many apps are already transferre... | <p>If you're using a normal http/https page in a webapp then you can't prevent other extensions from accessing DOM.</p>
<p>If you'll make a browser extension (for example, using WebExtensions API to make it work in Chromium, Firefox, Edge) instead of a web app and show the UI in an internal extension page with <code>c... |
How to install an existing Symfony project in local? <p>I have a project in a web server and I am trying to run it in local</p>
<p>What are the procedures?</p>
<p>Should I download all the files (including vendor, app, bin, cache...)?</p>
<p>Or it is better to install by composer?</p>
<p>There any configuration cha... | <h1>- if you have versioned code on bitbucket, github...</h1>
<p>1) export your database from the web server</p>
<p>2) locally import database from 1)</p>
<p>3) checkout/clone your code from remote repository</p>
<p>4) composer install (enter new database credentials and other stuff)</p>
<h1>- if your code is not ... |
Reduce Service Fabric backup size <p>I'm trying to use Service Fabric backups with Actors:</p>
<pre><code>var backupDescription = new BackupDescription(BackupOption.Full, BackupCallbackAsync);
await BackupAsync(backupDescription, TimeSpan.FromHours(1), cancellationToken);
</code></pre>
<p>But I've noticed that one b... | <p>Instead of doing full backups every hour, you can also use incremental backups, which will result in a smaller size. (For example, do a full backup every day, and incrementals every hour for instance)</p>
<p>The log files are transaction logs, they are not optional for restore. More info <a href="https://azure.micr... |
Calculation in lotusscript <p>(I am not sure it is appropriate to ask my question here because maybe the solution is simple but I don't know how to solve it)</p>
<p>We have an lotusscript agent and I was assigned to improve that agent's function. But the problem is I only have a piece of code and the code is like this... | <p>You just want to count the number of Yes and No results? Do this:</p>
<pre><code>dim nYes as Integer
dim nNo as Integer
nYes = 0
nNo = 0
</code></pre>
<p>Then add <code>nYes = nYes + 1</code> and <code>nNo = nNo + 1</code> at the appropriate places.</p>
<p>When the loops are completed, the variables nYes and nNo ... |
When I do a git pull origin master from Pantheon, it doesn't seem to pull the database <p>I'm new to this workflow using Git, and I feel like I'm missing one piece of information that's just not obvious to me. I setup a sandbox on Pantheon and did a Drupal install thru Pantheon. Works fine on dev. Then I cloned it to m... | <p>You are correct, the database does not pull down with git, only code.</p>
<p>You will either need to manually download the database from their UI or use their command line tool named <code>Terminus</code>. If you're comfortable with the command line, Terminus is the most convenient.</p>
<p>Another option would be ... |
How memory protection is done without virtual memory? <p>I was reading OS from Galvin and just had a doubt, how to implement memory protection if the system does not supports virtual memory ? I mean how processes can be given protected address spaces ?</p>
<p>Any new concept or explaination would be awesome... </p>
| <p><a href="https://en.wikipedia.org/wiki/Memory_protection" rel="nofollow">Memory protection on Wikipedia</a> shows different methods of memory protection, you should go through that.</p>
<p>If there is no support of virtual-memory, the concept of <a href="https://en.wikipedia.org/wiki/Memory_protection#Protection_ke... |
Type UiViewController does not conform to protocol xxx <p>I have a delegate method in Objective-C code which need to implement in my project which was earlier in swift 2.3 and worked fine but after upgrading to swift 3.0 it shows error...</p>
<blockquote>
<p>Type UiViewController does not conform to protocol xxx</p>... | <p>function in protocol from Objective-C like UITableViewDataSouce has changed to a more swift style
eg:</p>
<blockquote>
<p>func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell</p>
</blockquote>
<p>has change to</p>
<blockquote>
<p>func tableView(_ tableView: U... |
Wrap a row in DataGridView <p>I am trying to create a chatbot. I will be very honest, UI is not my forte. I am working on the backend of the chatbot as in the logic part, but for testing I need a proper working UI. So, I opted for easier to use winforms. I created a single column DataGridView and all the text written i... | <p><code>DataGridViewTextBox</code> performs wrapping using word-break. It means if you have a long text, the break will just apply at the end of words. Based on your requirement, you need character-break when word wrapping. To do so, you need to create a custom cell and perform character-break wrapping this way:</p>
... |
JASIG CAS how to diagnose/monitor performance problems <p>Users have been complaining about 30s+ delays in CAS authentication and our weblogs seem to support this.</p>
<p>I suspect it is one of our AuthenticationHandlers but I can't see an easy way to test this.</p>
<p>Any "out of the box" performance logging/warning... | <p>You have statistics, status and audit logs in CAS. Check out: <a href="https://apereo.github.io/cas/4.0.x/installation/Monitoring-Statistics.html" rel="nofollow">https://apereo.github.io/cas/4.0.x/installation/Monitoring-Statistics.html</a> and <a href="https://apereo.github.io/cas/4.0.x/installation/Logging.html" r... |
custom unfold returning the accumulator <p>I'm trying to create a custom unfold function that returns its last accumulator value like:</p>
<pre><code>val unfold' : generator:('State -> ('T * 'State) option) -> state:'State -> 'T list * 'State
</code></pre>
<p>I managed to make the following:</p>
<pre><code>... | <p>The way to do without a <code>List.rev</code> is to pass a function instead of the <code>resultList</code> parameter. Let's call that function <code>buildResultList</code>. At each step, this function would take the already-built tail of the list, prepend the current item, and then pass this to the function from the... |
How to make docker-compose load the context from GIT to a specific directory? <p>Here is my docker-compose file:</p>
<pre><code>version: '2'
services:
web:
build:
context: git@git.example.com:/abc/abc-backend
volumes:
- ./.data/app:/app
</code></pre>
<p>The git repository has a Dockerfile in it su... | <p>Your Dockerfile never copies any files into the image. You need to add a <code>COPY . /app/</code> instruction before the <code>RUN pip ...</code> instruction, just as if you were building from a local context instead of a Git repository.</p>
|
Bring Focus to Modeless Userform without Clicking (Excel 2010 VBA) <p>I am beginning to code a project that will open, login to and retrieve values from the Internet Explorer document. The procedure pastes a value from an Excel spreadsheet into a proprietary automobile VIN decoding site, scrapes the resulting page for... | <p>You can use <code>AppActivate</code> <em>before</em> you show your form, with something like:</p>
<pre><code>VBA.AppActivate(thisworkbook.Windows(1).Caption)
</code></pre>
|
laravel 5.2 many to many relation retrieve data with intermediate table <p>I have tables :</p>
<blockquote>
<p>products</p>
<ul>
<li>id</li>
</ul>
<p>categories</p>
<ul>
<li>id </li>
</ul>
<p>product_category</p>
<ul>
<li>product_id</li>
<li>category_id</li>
</ul>
</blockquote>... | <p>Assuming that you defined relationships on your models, you can try this:</p>
<pre><code>$productName = 'Some product';
$category = Category::findOrFail($categoryId);
$product = $category->products->where('product_name', '=', $productName)->get();
</code></pre>
|
How to properly configure berks to avoid certificate issues? <p>I'm using chefDK with the following versions:</p>
<pre><code>Chef Development Kit Version: 0.17.17
chef-client version: 12.13.37
delivery version: master (f68e5c5804cd7d8a76c69b926fbb261e1070751b)
berks version: 4.3.5
kitchen version: 1.11.1
</code></pre>... | <p>Unfortunately Berkshelf uses its own HTTP client layers so it doesn't (yet?) support Chef's <code>trusted_certs/</code> folder. This means you have to do things the old-school OpenSSL way with <code>$SSL_CERT_FILE</code> or <code>$SSL_CERT_DIR</code>. As Tensibai mentioned, you would need to build a new trust DB for... |
Laravel 5.3, Eloqent models and Namespace Issues <p>I am confused. I am following the laravel document to the T and something isn't being configured properly maybe?</p>
<p>The Short: I can't use my Eloquent models like the documentation shows.</p>
<p>The Long:</p>
<p>I followed these steps from the Laravel docs.</p... | <p>change </p>
<pre><code>$flights = App\SavedService::all();
</code></pre>
<p>to </p>
<pre><code>$flights = SavedService::all();
</code></pre>
|
Is it possible to use OR condition/operator in replace function? <p>I have simple String program in Java. I need to use replace() function. In which, I have to replace few words with the help of OR condition if they occur in the given String.</p>
<pre><code>e.g. String s = "I am a boy";
s = s.replace("I", "something")... | <p>Use <code>replaceAll</code>/<code>replaceFirst</code> which allows you to use regex statements to match the fragments you want to replace.</p>
<pre><code>String result "I am I am a boy".replaceAll("I|am", "something");
// result = "something something something something a boy"
</code></pre>
<p>or</p>
<pre><code>... |
a light Database for html 5 storage and gdrive <p>Hi my problem is this,</p>
<p>I'm developing an angular 2 app, and I have some data to save.
I prefer to save all data in json format.
the scenario is the following:</p>
<p>I have something like todo list, well you can add or delete some todos, but I like to save into... | <p>You might want to see <a href="https://www.npmjs.com/package/angular-2-local-storage" rel="nofollow">angular-2-local-storage</a> for storing data in the browser's Application Storage.</p>
<p>From the NPM registry:</p>
<blockquote>
<p>In your app:</p>
<p>First you need to configure the service:</p>
</blockqu... |
How to get user input in a textbox from another form? <p>I'd like to display the value from a textbox to a textbox in a different form. I entered this code into the second form (the first form being the one with the textbox I'm getting the value from):</p>
<pre><code>private void Form2_Load (object sender, EventArgs e... | <p>This creates a <em>new instance</em> of <code>Form1</code>:</p>
<pre><code>Form1 frm = new Form1();
</code></pre>
<p>Nothing was entered into any input in <em>that</em> instance, so there's no value in <code>frm.textBox1.Text</code>. What you need is a reference to the <em>existing</em> instance.</p>
<p>Presumab... |
Exception when recieving notification <p>when i receive a notification, my app crashes, here is my code to handle the notification :</p>
<p>Firebase message Service:</p>
<pre><code>public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "FCM Service";
@Over... | <p>Just to let you know, i have found the problem after many hours, </p>
<p>as you can see in my gradle file, i have added this :</p>
<p>compile 'com.android.support:recyclerview-v7'</p>
<p>when what i should of added was this:</p>
<p>compile 'com.android.support:recyclerview-v7:21.0.+'</p>
<p>gradle added automat... |
Sessions not working as expected PHP <p>I have multiple sites on same server with small changes. Issue is that when User login into A site and from url if he enter B site, he is allow to view content. How I can restrict user to view B site content.</p>
<p>Below if my authenication code</p>
<pre><code>function validat... | <p>You could add an extra level to your session to store the 2 sites uniquely</p>
<pre><code><?php
session_start();
if(!isset($_SESSION['siteA']['user'])) {
$url = $_config['site_url'].'login.php';
header("Location: ".$url);
}
?>
</code></pre>
<p>Know all you need to do is make sure... |
Showing FragmentA when back button is pressed on FragmentC in a TabLayout <p>Imagine Instagram, when the camera button/add photo button is pressed on the <code>TabLayout</code>,pressing the back button will take me back to the feed fragment. </p>
<p>I am having problem of returning to the <code>HomeFragment</code> fro... | <p>In your MediaActivity.class override the onBackPressed method or onKeyDown to finish the activity.</p>
<pre><code>@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
</code></pre>
<p>or</p>
<pre><code>public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent... |
How to create a Salesforce app like Mailchimp <p>I am looking to create a Salesforce app like mailChimp (<a href="https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B3byfEAB" rel="nofollow">https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B3byfEAB</a>) have. I want to create an int... | <p>After asking question, I also work on this to get the answers for my question. I am sharing my RND below, So it may help someone and can save their time.</p>
<p>Here is the <a href="http://resources.docs.salesforce.com/202/9/en-us/sfdc/pdf/salesforce_packaging_guide.pdf" rel="nofollow">complete document link</a> fo... |
Querying document property using struct as find parameter <h1>Problem description</h1>
<p>I try to find documents stored in MongoDB using GO</p>
<h1>Current state</h1>
<p>For testing purposes I created a small test program that inserts data into MongoDB and immediately tries to query:</p>
<pre><code>package main
i... | <p>I think you can open a issue.
I compared output of <strong><em>bson.Marshal</em></strong> for <em>bson.M</em> and your struct.</p>
<p><img src="https://pp.vk.me/c637227/v637227236/10208/ErPi-Yiu9OU.jpg" alt="output"></p>
<p>1 is <strong><em>fmt.Printf("%v\n", in)</em></strong> for your 36 row.</p>
<p>2 is <strong... |
How to get area coordinate in google map api <p>I have a address and i need to area coordinate(longitude and latitude) of that place in Google (recommended) or any map in JavaScript or PHP</p>
<p><a href="http://i.stack.imgur.com/8RpO4.png" rel="nofollow"><img src="http://i.stack.imgur.com/8RpO4.png" alt="enter image ... | <p>One option would be to right click on the map, choose "What's here", take the coordinates from the box that appears</p>
<p><a href="http://i.stack.imgur.com/4uCVx.png" rel="nofollow"><img src="http://i.stack.imgur.com/4uCVx.png" alt="right click"></a>
<a href="http://i.stack.imgur.com/K8rYv.png" rel="nofollow"><img... |
access httpcontext.session in GrantResourceOwnerCredentials <p>I need to get <code>HttpContext.Session</code> in <code>GrantResourceOwnerCredentials</code> method. However I get <code>null</code> when I try to access <code>Httpcontext.Session</code>.</p>
<p>Below is my code:</p>
<pre><code>public void ConfigureAuth(I... | <blockquote>
<p>...I need to re-check that Session value again [in] my GrantResourceOwnerCredentials method.</p>
</blockquote>
<p>Checking the session value in the <code>GrantResourceOwnerCredential</code> method is not a good idea. The session is stored in the cookie that comes with the request. Since the request c... |
Angular 2 - formControlName inside component <p>I want to create a custom input component that I can use with the FormBuilder API. How do I add <code>formControlName</code> inside a component?</p>
<p>Template: </p>
<pre><code><label class="custom-input__label"
*ngIf="label">
{{ label }}
<... | <p>The main idea here is that you have to link the FormControl to the FormGroup, this can be done be passing the FormGroup to each input component... </p>
<p>So your input template might look something like the following:</p>
<pre><code><div [formGroup]="form">
<label *ngIf="label">{{ label }}</lab... |
React Native: Cant find variable 'require' (at bundle) <p>I made a new react native project. Just react-native init myProject. I run react-native start to start the packager. I set up my phone and after i ran react-native run-android the app is installed in my phone.
When i launch the app it communicates with the packa... | <p>Your phone tries to connect to the debug server but it have not the address of your local server. You can try:</p>
<ul>
<li><p>Find you local ip address by executing ifconfig on Linux/Mac, for example: inet addr:192.168.0.3</p></li>
<li><p>Shake the device to see menu options while app is running (if you don't have... |
How to change dojodatetimetextbox icon in XPages <p>I tried to replace Dojo DateTimeBox icon with a new One. The CSS does not work.
I use that CSS code But It does not work :( </p>
<p><a href="http://i.stack.imgur.com/9bMVM.png" rel="nofollow"><img src="http://i.stack.imgur.com/9bMVM.png" alt="When I replace ıt looks... | <p>If you set the background image on the <code>dijitArrowButton</code> class you might get a better result.</p>
<p>Your CSS code would be:</p>
<pre><code> .dijitDateTextBox .dijitArrowButton .dijitArrowButtonInner
{
background-image: none !important;
}
.dijitDateTextBox .dijitArrowButton {
bac... |
Convert double foreach to LinQ <pre><code>foreach (var lg in basket)
{
foreach (var acc in lg.Accomodations)
{
if (acc.HotelID == h.ID)
{
hotel.SelectedInPreviousLeg = true;
}
}
}
</code></pre>
<p>I try to convert this double foreach to linq. Any suggestions?
So far i tr... | <p>or, assuming classes are defined equivalently to </p>
<pre><code>public class Hotel
{
public int ID { get; set; }
public List<Accomodation> Accomodations { get; set; }
public bool SelectedInPreviousLeg { get set; }
}
public class Accomodation
{
public int HotelID { get; set; }
}
</code></pre... |
Camel-SQL route ServiceUnavailableException when using header value as parameter <p>In ApacheServiceMix 7.0.0 I have defined the following routes using Blueprint:</p>
<pre><code> <reference id="dataSource" interface="javax.sql.DataSource" filter="(dataSourceName=connectuserdata)" />
<bean id="sql" class="org... | <p>Can you send us an example of rest request?</p>
|
PyGobject error <pre><code>#!/usr/bin/python
# -*- coding: utf-8 -*-
from gi.repository import Gtk
class ourwindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="My Hello World Program")
Gtk.Window.set_default_size(self, 400,325)
Gtk.Window.set_position(self, Gtk.WindowPosition.CENTER)
button1 = Gtk.... | <p>This is most likely how it should be formatted:</p>
<pre><code>#!/usr/bin/python
# -*- coding: utf-8 -*-
from gi.repository import Gtk
class ourwindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="My Hello World Program")
Gtk.Window.set_default_size(self, 400,325)
Gt... |
Java Comparable interface: compareTo int attributes <p>Two objects of the same type each have int attributes called intValue. How can the Comparable interface be used to compare these two objects on the basis of their intValue int values?</p>
<pre><code> public int compareTo(myObject other) {
return (this.intValu... | <p>First make sure that your <code>myObject</code> class implements the <code>Comparable</code> interface:</p>
<pre><code>public class myObject implements Comparable<myObject>
</code></pre>
<p>If you're deducing the value returned by <code>compareTo</code> using primitive <code>int</code> values, you could use ... |
Execute configuration bash script during docker build <p>During docker build I need to run a bash script, which sets up some environment variables.</p>
<p>The script looks something like this:</p>
<pre><code>#!/bin/bash
export ENVVAR=TEST
export HOST=local
export PORT=port
</code></pre>
<p>I try to call this script... | <p>You're simply not sourcing the shell that is specified in your ENTRYPOINT. Just add your myscript.sh to your image (use COPY instead of ADD).</p>
<pre><code>COPY myscript.sh /usr/local/bin
</code></pre>
<p>Then source it on the shell that is actually started by your entrypoint.</p>
<pre><code>docker run myimage s... |
OBIEE 11g: How do you navigate to a value of another report in the same analysis? <p>I have one analyse with two tables. The first table is a master and the second table has all childs. Is there an option to make a action link in the first table that redirects to the value of in the second table of that master while it... | <p>You can enable master-detail between different views of the same (or different) analysis. </p>
<p>In the first table you need to add an action on the column that you want to become the master column. In criteria tab go to properties of that column, and on the Interaction tab select the "Send Master-Detail events". ... |
Set excact alarm repeating for API19 + <p>I've been doing a research about exact repeat alarm for API 19 and above and I've found that all alarm repeating are inexact from API 19. I'd like to know how to handle alarm repeating part for API 19 and above.</p>
<p>I found this: </p>
<blockquote>
<p>you'll need to handl... | <p>Use this:</p>
<pre><code>public void scheduleAlarm() {
Long time = new GregorianCalendar().getTimeInMillis()+1000 * 60 * 60 * 24;// current time + 24 Hrs
Intent intent = new Intent(this, AlarmReceiver.class);
PendingIntent intentAlarm = PendingIntent.getBroadcast(this, 0, intent, 0);
... |
query that compare prices from 2 tables and execute a message <p>I am stuck for days i am trying to build a <code>sql query</code> that check if my products need to be order.... so that i want is one query that make the check</p>
<p>i have one table <code>Priority_lvl</code> with <code>columns</code> <code>Prio_leve... | <pre><code>String query ="SELECT * FROM Priority_lvl INNER JOIN Products ON
Products.Pro_Capa_level= Priority_lvl.Prio_level WHERE Pro_Capa_level = Prio_level
AND Pro_Quantity<=Prio_Number ";
</code></pre>
|
How to prevent font falling out of button <p>I have a button for my page that I'm also styling it</p>
<pre><code><button id="logButton" >Iniciar sesión</button>
</code></pre>
<p>And then the css code</p>
<pre><code>#logButton
{
width:119px;
margin-bottom: 5px;
padding-top: 3px;
margin-le... | <pre><code>#logButton
{
/* Removed height & width*/
padding: 10px 20px; /* Added */
margin-bottom: 5px;
margin-left:35%;
font-weight: bold;
font-size: 31px;
font-family: helvetica, arial, sans-serif;
}
</code></pre>
|
Accessing local google datastore via shell when running datastore emulator <p>Im using Google Datastore Emulator (which is using gRPC). And am able to do datastore operations via a node.js application.</p>
<p>Is there a way to access local datastore using shell or browser. I am looking for something similar to mongod ... | <p>No, the gRPC emulator doesn't have an interface outside of the API.</p>
<p>The Cloud Datastore emulator that ships as part of App Engine's local emulator does have a HTTP console.</p>
|
Many to Many Self Referencing Query_builder <p>I have an entity called Status that has a self referencing many to many relationship to define what each statuses next available status is:</p>
<pre><code>class Status
{
private $id;
//...
/**
* @ORM\ManyToMany(targetEntity="Status", mappedBy="nextStatu... | <p>the <code>previousStatuses</code> association is a <code>ArrayCollection</code> so for Doctrine this statement is wrong:</p>
<pre><code>->where('s.previousStatuses = :status')
</code></pre>
<p>Use the <code>ps</code> alias in <code>where</code> clausule, something like this:</p>
<pre><code>//...
return $er->... |
What use is QRegExp::pos() without a corresponding QRegExp::len() of sorts? <p>In a project I'm working on, I need to make a <a href="http://doc.qt.io/qt-4.8/qstringlist.html" rel="nofollow"><code>QStringList</code></a> out of all <a href="http://doc.qt.io/qt-4.8/qregexp.html" rel="nofollow"><code>QRegExp</code></a> ca... | <p>It's an API bug. That's all. I wish there was some magic trick to it - there isn't, as far as I know. I wouldn't worry too much about allocating the <code>capturedTexts</code> return value unless this is a parser that is invoked on lots and lots of text. Use what you've got - probably any time you spend on tweaking ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.