input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
Using array in the onCreate returns null <p>I am getting some JSON data and parsing it into my object. Which I am trying to use to get all the fields I need. However I am getting a null on my arraylist and I am not sure why for example. </p>
<pre><code>private List<MovieDetail> mMovieDetails;
@Override
protecte... | <p>The solution the problem is to move the list to onPostExecute which was mentioned by @M.WaqasPervez </p>
<p>Here is the code fix</p>
<pre><code> public class ProcessMovieSearchImdbIDString extends JsonParse {
public ProcessMovieSearchImdbIDString(String id) {
super(id);
}
public void execut... |
get value inside input for autocomplete <p>I am workind with a MVC framework cakephp , I need to recover each value written in the input even if when I add character or delete one (you know the purpose of autocpmlete), I have to recover this value in input to send it to the action for generate a json file who contains ... | <p>This is the code for getting the value of the input every time the user types something. And then send it to the controller.</p>
<pre><code> $(document).ready(function(){
$("#input").keyup(function(){
console.log($(this).val());
$.ajax({
url: "controller",
type: "get",
data... |
Removing watermark from pdf generated from MS-WORD <p>I have looking for a solution to remove <strong>watermark</strong> from <strong>PDF</strong> generated from <strong><em>MS-WORD</em></strong>,
i have used solution from following <a href="http://stackoverflow.com/questions/35526822/removing-watermark-from-pdf-itexts... | <p>Here's an Apache PDFBox solution for your file only. It is very likely that it won't work for other word files, but it is worth a try. To understand what I did, open the old and the new files with the PDFBox PDFDebugger command line application (or with itext RUPS) and look at the "Contents" entry.</p>
<p>The part ... |
Grails version upgrade from 2.4.4 to 2.5.3 <p>I created a simple project in grails 1.3.7..Now I am doing the task of version change.At first I took my 1.3.7 project to 2.4.4.It ran perfectly.
The changes I have made in my files BuildConfig.groovy file ,urlmapping,index.gsp,applicationcontext.xml,application.proââp... | <p>You might want to list the steps you performed in the upgrade. What files did you change, what dependencies did you change, etc.</p>
<p>Furthermore, there are some blogs out there about upgrading. Not all apps use the same pieces of Grails, so not all upgrades are the same. Here are a couple:
<a href="http://tot... |
how can i get Get date text .Not able to get any text on the whole page.Attached Image <p><a href="http://i.stack.imgur.com/yF9vE.png" rel="nofollow">enter image description here</a></p>
<pre><code> List<WebElement> getAllTextOnPage = driver.findElements(By.id("com.condecosoftware.deskbooking:id/actio... | <p>FOR GETTING VALUE OF SINGLE ELEMENT :</p>
<p>You are finding multiple elements with findElement<strong>s</strong>, instead it should be findElement</p>
<p>Try the below code :</p>
<pre><code>String textValue=driver.findElement(By.id("com.condecosoftware.deskbooking:id/action_bar_root")).getText();
</code></pre>
... |
NULL fields during import CSV to Mysql <p>I have to import a CSV file in a table of MySql db using a PHP script.
The CSV file is the following:</p>
<pre><code>"giorno","lmedollton","changedolleuro","euroton","lmesterton","delnotiz","girm","sgm"
"2016-09-02", "100.01", "4005.09", "5000", "1.09", "120.09", "100.5", "200... | <p>I see three major problems with your import attempt. First, if the file path is wrong, nothing is going to move. Second, you should be using <code>IGNORE 1 LINES</code> at the end of the command to tell MySQL that your CSV file has a one line header at the beginning. Third, I think you should be using <code>LOAD ... |
Why can't I access React state within Tracker.Autorun? <p>This one has me stumped, I'm using a Tracker.autorun function to listen for when my Mongo subscription is ready for querying (per suggestion on this previous <a href="http://stackoverflow.com/questions/28621132/meteor-subscribe-callback">Meteor subscribe callbac... | <p>I am accessing my states in Meteor Tracker with the arrow function like this:</p>
<pre><code>Tracker.autorun(() => {
if (subscription.ready()) {
console.log("the subscription is ready");
console.log(this.state) //this is undefined
}
});
</code></pre>
<p>Besides this I initialize my st... |
How to start and stop glow each button at specific time according to AM and PM using java script or jquery <p>I am working on appointment time management and want to glow the button by matching the system current time to the button value.</p>
<p>For Example:
there is a button with value 3:00 PM. I want to glow this b... | <p>First let's create css class for active button:</p>
<pre><code>.active{
-webkit-animation-name: pulse;
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
}
</code></pre>
<p>Calculate which button should be active:</p>
<pre><code>var timeformat = hours + ":" + minutes + " " + dd.toUpperCa... |
BindMemory migration Swfit 3 <p>How to migrate this code to Swift 3? </p>
<pre><code>let keyBytes = keyData.bytes.bindMemory(to: Void.self, capacity: keyData.count)
</code></pre>
<p>I'm getting below error</p>
<blockquote>
<p>'bytes' is unavailable: use withUnsafeBytes instead</p>
</blockquote>
| <p><code>keyData</code> is type of <code>Data</code> object and that doesn't have property <code>bytes</code>, convert <code>keyData</code> to <code>NSData</code> and then access <code>bytes</code>.</p>
<pre><code>let keyBytes = NSData(data: keyData).bytes.bindMemory(to: Void.self, capacity: keyData.count)
</code></pr... |
Scrollview no horizontal scrollbar <p>I have been several hours fighting with this. It is killing me alreayd and I feel shame for myself :(</p>
<p>I can not make the horizontal scrollbar to appear here. Can anybody point me why?</p>
<pre><code><Grid>
<Grid.RowDefinitions>
<RowDefinition Hei... | <p>I already find my self an answer. It was positng it and find the correct aproach in google :(</p>
<p>I was not using the scrollview correctly</p>
<pre><code><ScrollViewer Grid.Row="0" Grid.Column="0" x:Name="Panel_SFP_SerialIDInfo" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
... |
Create a radial pie menu in Android <p>Hello I want to ask how can i create something that looks like(aircommand) this:</p>
<p><a href="http://i.stack.imgur.com/HW6Eq.png" rel="nofollow"><img src="http://i.stack.imgur.com/HW6Eq.png" alt="enter image description here"></a></p>
<p>I have made some search on radial pie ... | <p>You can check this:</p>
<p><a href="https://github.com/strider2023/Radial-Menu-Widget-Android" rel="nofollow">Radial-Menu-Widget-Android strider2023</a></p>
<p>And this</p>
<p><a href="http://code.google.com/p/radial-menu-widget/" rel="nofollow">radial-menu-widget</a></p>
|
Laravel get users that are not in a team <p>I have a users table and a salesTeams table.</p>
<p>a user can be a leader to only one salesteam. a salesteam can only have one leader.</p>
<p>on the salesTeams i have a leader_id (users.id).
on the users table i also have a role_id column (role id 3 is for the leader)
On t... | <p>Try like this:</p>
<pre><code>public function scopeOnlyLeaders($query) {
$query->with(['users' => function ($query) {
$query->select('users.*')
$query->leftJoin('salesteam', 'salesteam.id', '=', 'users.leader_id')
->whereNull('leader_id');
}]);
return $query;... |
XPath 3.0: select nodes by condition (find max child nodes by date) <p>Given XML:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<root>
<c cid="c0" v="100">
<d did="c00" v="0" dt="2016-01-01" />
<d did="c01" v="0" dt="2016-02-03" />
<d did="c02" v="0"... | <p>In XQuery the query is quite straight-forward and can be written to only calculate the maximum date once per <code>c</code> node:</p>
<pre><code>for $c in /root/c
let $max := max($c/d/@dt/xs:date(.))
where $c/d[@dt = $max]/@v = '0'
return $c
</code></pre>
<p>In XPath you can write the query to (at least conceptual... |
How to rename a Child in Firebase Database? <p>I am developing an Android chat application using Firebase as its back end. When a user updates his/her details after somedays, I want to update the name of the child in <code>Message</code> node according to the updated name.</p>
<p><a href="http://i.stack.imgur.com/CLzD... | <pre><code>Firebase ref = Firebase(url: "https://<YOUR-FIREBASE-APP>.firebaseio.com");
Firebase userRef = ref.child(YOUR_NODE);
Map newUserData = new HashMap();
newUserData.put(YOUR_NEW_DATA);
userRef.updateChildren(newUserData);
</code></pre>
|
Create Two or More Mongos Connection Objects in Node JS <p>We can configure two more mongos server ip in to nodejs application.If we are configured 3 Mongos Ip means Which ip will be used whether it is based on Round Robin or any concern, how its works.</p>
<p>Its Mainly help full for what <strong>automatic fail over<... | <p><strong>Replication</strong> is the process of synchronizing data across multiple servers. Replication provides redundancy and increases data availability with multiple copies of data on different database servers, replication protects a database from the loss of a single server. Replication also allows you to recov... |
Abstract state with template in ionic <p>I am working with ui-router AngularJS in Ionic Project. I have an abstract state where I nest my children's templates via <code><ion-nav-view></code> tag. The question is can I display some default data in the template of the abstract state that will be shown for all the c... | <p>You can define a controller for your abstract state and there setear default values that can be displayed in various other views. You can also do this in the function </p>
<pre><code>.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppCtrl'
})
.controlle... |
How render Input fields dynamically based on position set in database with EJS <p>I have a input fields types stored in the database with their position set by user. So eg FirstName, textbox 1, lastname textbox 2. This position can be change. I want to render a view showing the input elements on their position in the d... | <p>I fixed my problem by modifying the the above structure like this</p>
<pre><code><% for(var i=0; i< templateData.formular.length; i++){ %>
<div class="form-group">
<label for="inputEmail3"><%=templateData.formular[i].FormLabel %></label>
<input type="<%... |
Unclear error message on sending a notification to iOS <p>I'm trying to send a notification via C# SDK. I'm sending notifications for iOS.</p>
<pre><code>string payload = "{\"aps\" : { \"alert\" : \"Message received from Bob\" }}";
var outcome = hub.SendAppleNativeNotificationAsync(payload, new[] { "b6a5d9c3-4297-422f... | <p>you may have open port 2135 and also add APN certificate</p>
|
SQL Natural Join <p>Okay. So the question that I got asked by the teacher was this:</p>
<blockquote>
<ol start="5">
<li>(5 marks) Construct a SQL query on the dvdrental database that uses a natural join of two or more tables and an additional where condition. (E.g. find the titles of films rented by a particular c... | <p>Well, it seems that you would like to join two tables that have no direct relation with each other, there's your issue:</p>
<pre><code>where film.film_id = customer.customer_id
</code></pre>
<p>To find which films are rented by which customer you would have to join customer table with rental, then with inventory a... |
synthesizable constructs in systemverilog <p>I am designing a R3000 MIPS processor, and for the instruction decoder, want to give a casez such that for cases involving immediate instructions eg ADDI, ANDI, I provide the bits 6:0 as z. I just wanted to know is that a synthesizable construct?</p>
<pre><code>module Instr... | <p>Anything you can compile and execute on a simulator is potentially synthesizable. It comes down to whether or not the tool you are using has an algorithm to recognize the code and map it to a hardware implementation. </p>
<p>BTW, one typically uses the <code>?</code> character instead of <code>z</code> in a Verilog... |
replace quotes using javascript <p>We are building JSON data through user input. It works fine unit unless user input <code>quotes</code> as first letter.</p>
<p>My output look like after stringify.</p>
<pre><code>{"text":""'><img src=x onerror=alert('1')>"}
</code></pre>
<p>JSON data if use did not input q... | <p>Try this below:</p>
<pre><code>var obj = {"text": "&quot;&#x27;&gt;&lt;img src=x onerror=alert(&#x27;1&#x27;)&gt;"}
var x = JSON.stringify(obj)
document.getElementById('test').innerHTML = x.toString().replace(/["]/g, "");
</code></pre>
|
jQuery, HTTPS and WooCommerce API: Error 401 <p>I am trying to use Basic Auth over HTTPS to invoke the WooCommerce API, from same-origin (localhost), with jQuery. The server is XAMPP on Windows. I am using a self-signed certificate (with CN=localhost). The certificate issues no warnings when I visit the rest of the web... | <p>I had the same issue. Also noticed that it worked in Edge, but not in Chrome. After I tried stripping the config down to the minimum, it suddenly started working for some reason. After digging some more, it seems like this happens whenever youre <em>logged in</em> to the same site. </p>
<pre><code>$.ajax({
url: "... |
AWS Application Load Balancer transforms all headers to lower case <p>I've a REST API application running in two EC2 instance and was using AWS Classic Load Balancer for a long time. The clients of REST API rely on the response headers (e.g. such as <code>Location</code>). </p>
<p>I know that HTTP headers are case-ins... | <p>It is an expected function of the ALB because <a href="https://evertpot.com/http-2-finalized/" rel="nofollow">HTTP/2 lowercases all headers</a> and ALBs <a href="https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/" rel="nofollow">support HTTP/2</a>. Unfortunately you can't modify how the headers are ... |
Random value from database column but only one time in Laravel <p>My database query return random row from database. Is there any way when page load and return this random string when user refresh the page to not change the string? </p>
<p>So this is my controller</p>
<pre><code>public function view() {
$view = ... | <p><strike>Option #1 - save the data you got from the <code>View::make</code> to a session and return it</strike>:</p>
<pre><code>public function view() {
$rand_view = Session::get('rand_view');
if (!$rand_view) {
$view = View::orderByRaw("RAND()")->limit('1')->get();
$rand_view = View::... |
Filter in django with or condition <p>I want to use filter with <code>OR</code> condition in django while filtering the object data.</p>
<p>I have an object of a class and I have 3 or 4 fields on which basis I want to filter the data with <code>OR</code> condition in Django.</p>
<p>For example.</p>
<pre><code>Obj = ... | <pre><code>from django.db.models import Q
Obj = Books.objects.filter(Q(title=title) | Q(price=price) | Q(description=description) | Q(author=author))
</code></pre>
<p>Docs: <a href="http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects" rel="nofollow">http://docs.djangoproject.com/en/... |
Verify calls to dependency in unit test? <p>For this following class I want to write a unit test:</p>
<pre><code>public class SomeClass {
private Dependency dependency;
public SomeClass(Dependency dep){
this.dependency = dep;
}
private String processString(String s){
/*
edit ... | <p>Testing <code>Dependency</code> shouldn't be part of your unit tests of class <code>SomeClass</code> i.e. don't test method calls of <code>Dependency</code> for correctness and accuracy.</p>
<p>You can check parameter values passed to methods of <code>Dependency</code> if those values are local to class <code>SomeC... |
Google Maps - Show adress instead geocodes <p>I have link with geo-coordinates (below), when I reach by this URL to the google maps page, in Input I see my geo-coordinates.
Is it possible to get there Human-readable Address instead of geocodes, without changing URL format (should be used geo-coordinates) ?</p>
<pre><c... | <p>If I understood question correctly, you need to use Reverse Geocoding. I found some links. It aren't solutions of your problem but (I hope) these examples help you to find solution.</p>
<ol>
<li><p><a href="https://developers.google.com/maps/documentation/javascript/examples/geocoding-reverse" rel="nofollow" title=... |
How to send a push notification in unificationengine <p>How to send a push notification to a channel in unificationengine?</p>
<p>If a user is already created the channel via UE.</p>
| <p>Example for pushing messages to UE</p>
<p>curl -XPOST <a href="https://apiv2.unificationengine.com/v2/push/notification" rel="nofollow">https://apiv2.unificationengine.com/v2/push/notification</a> -u CONNECTOR_KEY:CONNECTOR_SECRET âdata â{ \"channel\â: \â6d2d2111-d3b6-4ac9-8e67-55980a141fdd_sms\â, \âdat... |
Can't access to class from .php file (PhpStorm) <p>Sorry for stupid question, but I really don't understand what's wrong.</p>
<p>I have a separate class <code>User</code> and want to make its object in .php file. I went to <code>Settings/Directories</code> and marked folder users like Source also added a prefix(PSR-4)... | <p>You should change test.php</p>
<pre><code><?php
require_once('user.php');
use Users\User;
$user1 = new User;
</code></pre>
|
C# Change value of local variable - stack representation <p>I have a question about variables on stack in C#, look at example below:</p>
<pre><code>static void Main(string[] args)
{
int a = 1; //this element goes to the stack as the first one
int b = 2; //second element in the stack
a = 4;
a++;
}
... | <p>The memory construct that .NET uses to hold value types is indeed called 'the stack', but it doesn't mean that each and every variable is held in a LIFO structure, where you can only access the last one.</p>
<p>So to answer your question - when you need to access the variable <code>a</code> - CLR does that exactly ... |
Schedule task for specific time from spring 4 web mvc <p>I am building a Spring 4 Rest API for a trade automation site.</p>
<p>An http request will contain some info along with a date-time. After inserting these info into database (using hibernate), I need to <strong>dynamically create a new cron job which will access... | <p>I think you may use something like this: <a href="https://ha-jdbc.github.io/apidocs/net/sf/hajdbc/util/concurrent/cron/CronThreadPoolExecutor.html" rel="nofollow">https://ha-jdbc.github.io/apidocs/net/sf/hajdbc/util/concurrent/cron/CronThreadPoolExecutor.html</a></p>
|
Check variables existence in Typescript <p>I am updating an older <code>.ts</code> file, using TSlint (v3.15.1) and an updated version of typescript (2.0.3). I am getting some errors that I'd liketo solve.</p>
<p>The code is a simple existence test for some class properties:</p>
<pre><code>export class myClass {
... | <p>I found this workaround, which does not report any error. However, this is verbose and not very elegant... Any better idea ? :) </p>
<pre><code>public isReady(): boolean {
for (const property in ['pUserName', 'pUserPass', 'pHost', 'pPort']) {
if (typeof(property) !== 'string') {
return false... |
Get PHP object property, but do not be able to change original object property <pre><code>class Slider {
private $slides;
private $dublicate;
public function get_slide($id) {
foreach ( $this->slides as $slide ) {
if ( $slide->id === $id ) {
$this->dublicate = ... | <p>If i understand you correctly you are looking for <a href="http://php.net/clone" rel="nofollow">clone</a>:</p>
<pre><code>$editable = clone $slider->get_slide(5);
$editable->id = 6;
$editable->name = 'new_name';
</code></pre>
|
How to get azure virtual machine CPU utilization and memory uses? <p>I am working in a program where I need to calculate virtual machine CPU utilization and memory uses.</p>
<p>For that I have used azure insight matrix, but I am not getting CPU utilization kind of thing. Is there any API exists where I can find CPU ki... | <p>To get the CPU Utilization and Memory Usage you should go to your VM on the portal and enable Diagnostics then you'll be able to retrieve those data. </p>
<p><a href="http://i.stack.imgur.com/9pIUL.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/9pIUL.jpg" alt="enter image description here"></a></p>
<p>Afte... |
generate the seo friendly url using htaccess <p>I am using simple php.
I want to access this url (<a href="http://localhost/url/test.php?id=10" rel="nofollow">http://localhost/url/test.php?id=10</a>) like this</p>
<p><a href="http://localhost/url/test.php/id/10" rel="nofollow">http://localhost/url/test.php/id/10</a> <... | <p>Mate </p>
<p>Try This </p>
<pre><code>RewriteEngine On
RewriteRule ^url/test\.php/id/([^/]*)$ /url/test.php?id=$1 [L]
</code></pre>
|
Revert all the changes through the Git verson control <p>let say i have made some files and commited them in git modified it and then again commited it. but now someone has acess to the files and done total distruction like deleting some files renamed some files and then commited to git. Now i want to get to my old fil... | <p>If you want to roll back your repository to specific commit</p>
<pre><code>git reset --hard commit_hash
</code></pre>
|
Initial Values for an array-type attribute in Yii2 Model <p>If an attribute in a Model holds array data, say Dates, that are populated in a form with multiple rows for this attribute, how may I assign initial values to the array elements so that they display initially in the form when it appears. </p>
<p>In my example... | <p>You can do in the controllerAction before render </p>
<pre><code>public function actionCreate()
{
$model = new MyModel();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
$model... |
Error on azure web app deployment <p>I am new in azure application development. As per the requirements given to me, I had developed an application on azure and successfully deployed it on azure cloud.Blob storage was also being used in that application. Everything was working fine. </p>
<p>When I was deploying it on ... | <p>I suspect you have not defined the "FileStorageAccount" Setting in the CSCFG file. Try using the <a href="https://msdn.microsoft.com/en-us/library/azure/mt634649.aspx" rel="nofollow">CloudConfigurationManager.GetSetting</a> method. It will read configuration values from the web.config or service configuration file... |
List comprehension variable not defined? (Python) <p>I have a list of dicts sortd, i want to add the first three dicts in the list to a new list. </p>
<p>I tried using a list comp for the first time but when doing:</p>
<pre><code>new_dict = [pair for pair[0:3] in sortd]
</code></pre>
<p>i get the error "pair is not ... | <p>You just need to do <code>pair[:3]</code> to get the first three elements from <code>list</code>. List comprehension is not needed in this case.</p>
<p>List comprehension is alternate and cleaner way to iterate over the list (or dict/tuple) and perform some action. For example, lets say you are having a loop in you... |
How do I add an image to a lightswitch silverPDF Document? <p>Within my Lightswitch desktop app (Silverlight client), I use silverPDF to create an invoice. All works well until I try to add an image (company logo).</p>
<p>My image is one that is saved to the database as image type (byte arrray) via the lightswitch ima... | <p>After the comment from <a href="http://stackoverflow.com/users/162529/pdfsharp-expert">PDFsharp Expert</a> I found that the image I was using was a .png file. I re saved the image as .jpg and the code worked. I now have an image on my invoice (although size constraints need to be played with to ensure correct fit). ... |
How to get url from Google Spreadsheet cell with Google Apps Script? <p>I've got a google spreadsheet copied from excel ANd I have some problem with that.
This is my document <a href="https://docs.google.com/spreadsheets/d/1Ok_phu5OXtvKHLj3MLa7N3WV2qBdMWRz8dLHnTqjHrc/edit?usp=sharing" rel="nofollow">https://docs.google... | <p>At this time the Spreadsheet Service of Google Apps Script is not able to get the properties of cells rich text content, just the plain text by using getValue() method. Other methods like getFormula(), getNote() are able to get the corresponding cell property, but none of the them includes the URL of the link.</p>
... |
Generic way to use XSLT to generate text from one "template" XML and another "arguments" XML <p>I have a solution to my question below but I need it to be more generic so I need help.</p>
<p>The question:</p>
<p>We have a "template.xml" which is composed of a mixture of <code><verbatim></code> elements and <cod... | <p>I hope this solution is already generic enough. Have a look in the below lines:</p>
<p><strong><em>expanded</strong> template.xml:</em></p>
<pre><code><template_root>
<verbatim>Title</verbatim>
<argument id="key">ARGKEY0</argument>
<part id="part001">
<ver... |
java8 dates in grails 2.5.5 unit testing <p>I am using grails 2.5.5 with java 8. To get this working with the new dates, I defined a mapping between the java 8 dates (ZonedDateTime) and the database/hibernate dates. This works fine, no problem at all</p>
<p>here's where the problem starts: <strong>Unit Testing</strong... | <p>Each date has a different format so you must check that the Date are of the same type and format. Your Java 8 probably using <strong>java.util.Date</strong> and <strong>SimpleDateFormatter</strong>.</p>
<p>Please check your unit testing framework date format, it might be <strong>DateTime</strong> format so it cause... |
"while" loop - Re-execution of the program <p>For starters I'll just say that I'm fresh Python programmer.
I started writing database client and I have problem.
Perhaps this question for many will seem silly, but for me as a rookie is it a problem. </p>
<p>I write main_module that adds data to the database
I would l... | <p>You have to put your input procedure inside an infinite loop that will be broken only if the user input something else than "y" or "Y":</p>
<pre><code>while True:
accept = input("Do you wanna create new record in DB? (Y/N)")
if accept.lower() == "y": <-- checks if accept =="y" or accept == "Y"
cr... |
Hibernate good practice, lazy/eager loading and saving/deleting children (help me Hibernate sensei) <p>So, I have found myself in quite a pickle regarding Hibernate. When I started developing my web application, I used "eager" loading everywhere so I could easily access children, parents etc. </p>
<p>After a while, I ... | <p>If I understood the question correctly it's all about cascading through simple <code>1:N</code> relations. In that case Hibernate can do the job rather well:</p>
<pre><code>@Entity
public class Post {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@OneToMany(cascade = CascadeT... |
how I can specify the things I write on the EditText....! <p>I want to type on EditText with custom keyboard. Lets say I want to write number 1, is there any way so that I can disable number 1 after I wrote it. Even the user tries to press number 1 from the keyboard it won't write but if he delete any number using back... | <p>pike is correct using textwatcher would help you however, to achieve this, you can use a condition that would stop the app from displaying the number that is already inside the edittext.</p>
<p>EDIT: </p>
<pre><code>String textContainer = "";
int length = 0;
int prevLength = 0;
editText.addTextChangedListener(... |
How to refresh image in Oracle-maf? <p>I have an image with some source, it shows correctly, but what should I do if I need to change this image, but leave path as it was. I mean how can I refresh the image by replacing the picture in image's path.</p>
<pre><code><amx:image id="i3" source="#{some path}" inlineStyle... | <p>generate <code>get()</code> and <code>set()</code> method for your path ,and tick <code>propertyChangeSupport</code> tick box. </p>
<p>Try these and let me know if you have any doubts.</p>
|
How to add Items to the property of class type <p>Following is my class with aliases List property of class type (MeetingAliases). How to add multiple items to aliases and pass as a parameter along with other TSGetRootObject property data to some method. for eg. </p>
<pre><code>TSGetRootObject ts = new TSGetRootObject... | <pre><code>ts.aliases = new List<MeetingAliases>();
ts.aliases.Add(new MeetingAliases
{
alias = "Some text",
conference = "Other text"
});
</code></pre>
<p>I'd recommend that you have a look at <a href="https://msdn.microsoft.com/en-us/library/bb397680.aspx" rel="nofollow">Object Initializer</a></p>
<p... |
XCode 8 app building ultraslow <p>Problem is that when building a Swift app in XCode 8, the <em>source files are compiled quickly</em>, but <strong>Copying Swift standard libraries</strong> takes the cake - the phase could run for several minutes (usually the whole build is around 4-5 minutes, worst cases have been gen... | <p>Go to project settings, then Editor > Add Build Setting > Add User-Defined Setting, and add the following:</p>
<pre><code>SWIFT_WHOLE_MODULE_OPTIMIZATION = YES
</code></pre>
<p>Adding this flag dropped our clean-build compile times from 7 mins to 65s for a 40KLOC swift project, miraculously. Also can confirm 2 fri... |
Exist is always coming TRUE in UFT when using index to identify Browser <p>I've to get the number of opened browsers having some title. The approach that I used was using the index. But the problem is, whatever index I pass, Exist function is always returning true.</p>
<pre><code>Browser("openurl:=.*something.*", "ind... | <p>The <code>index</code> (or any ordinal identifier like <code>CreationTime</code>) are used only if the description matches multiple <code>Browser</code>s, if the description you supply only matches one object it will be ignored.</p>
<p>I tried with two open tabs and got the following results:</p>
<pre><code>Print ... |
Uploading ".xlsx" file using DropBox API making file corrupted <pre><code>DropboxClient dbx = new DropboxClient("************************");
var file = "/Excel/FileName.xlsx";
byte[] bytes = null;
FileStream fs = new FileStream("C:\\Users\\Admin\\Desktop\\Test.xlsx", FileMode.Open, FileAccess.Read);
BinaryReader br = n... | <p>I think you're thinking too complex here. <code>UploadAsync</code> expects a <code>Stream</code>. <code>MemoryStream</code> is indeed a <code>Stream</code>, but so is <code>FileStream</code>. Getting rid of the extra reader will result in:</p>
<pre><code>var source = "C:\\Users\\Admin\\Desktop\\Test.xlsx";
var targ... |
Issue in multi select filter <p>I need to filter using multiselct ,data attribute . it is working but not as expected </p>
<p>here is my code </p>
<pre><code><ul>
<li>
<div class="sts">
<h1>filter 1</h1>
<div class="checkbox">
<label>
<i... | <p>I'm struggling with this same problem as <strong>durai</strong>. I updated <a href="https://jsfiddle.net/jaripp/qnv5zqfu/" rel="nofollow">the fiddle</a>, please make selections as instructed at the top of the page and you'll see the problematic case.</p>
<pre><code><ul class="list">
<li data-at="foo" data-... |
How to do select and delete operation in hibernate relation <p>Below is my code have one-to-many relation that is between parent and student.
My requirement is:</p>
<ol>
<li>When I give a student's <code>class_name</code> then respective parents <em>information should be display</em> </li>
<li>If I enter reference <co... | <p>Try to read examples on this link to have an idea about how to use HQL:
<a href="http://www.tutorialspoint.com/hibernate/hibernate_query_language.htm" rel="nofollow">Hibernate - Query Language</a> & <a href="https://www.mkyong.com/hibernate/hibernate-query-examples-hql/" rel="nofollow">Hibernate Query examples (... |
localhost:8000 keeps on loading without any error or proper output <p>I am only learning laravel, and i am unable to load my laravel homepage on localhost:8000, from i long time it was going fine, but today i updated my composer and updated entry of :
config/app.php
in aliases::</p>
<pre><code>'Form' => Collective... | <p>create .env file(copy from .env.example) and set </p>
<pre><code>APP_DEBUG=true
APP_LOG_LEVEL=debug
</code></pre>
|
How to import nested objects in ES6 <p>Simple question, I'm trying to use electron and I need to get the <code>remote</code> object on the client.</p>
<p>Doing </p>
<pre><code>const {BrowserWindow} = require('electron').remote; // Works
</code></pre>
<p>But</p>
<pre><code>import {BrowserWindow} from 'electron/remot... | <p>I think you're supposed to use it like this:</p>
<pre><code>import {remote} from 'electron'
// do something with remote.BrowserWindow
</code></pre>
|
Changing div opacity one by one to make animation <p>I am trying to create a animation with the help of four boxes, each of the square should change opacity one by one to make a loading type animation, I tried with CSS, but not able to achieve, can anyone help with this <code>CSS</code> animation? </p>
<p>Here is the... | <p>This is after fixing your code:</p>
<pre><code>@-webkit-keyframes dance {
from {
opacity: 1
}
to {
opacity: 0.1
}
}
li.block-1 {
animation: dance 1s infinite;
animation-delay: 222ms;
animation-direction: alternate;
}
</code></pre>
<p><a href="https://j... |
Error in response while using SAML oneLogin code to connect to ADFS as iDP <p>We are able to login to the ADFS iDP through the saml OneLogin java application.
we have followed below steps to Edit the Claim rules of Relying Party(ADFS) to: </p>
<ul>
<li>enable return of email address in response.</li>
<li>Right-click o... | <p>I have resolved this exception. It required to add email address in the properties of Active Directory Users and Computers on ADFS server. Also, the NameID format property should be set as "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
Thanks everyone for your support. Hopefully, this might help someone.</... |
Remove button appearing under? <p>I want the remove button to appear in the right hand side of browse button. Currently what is happening that is remove button is appearing under. </p>
<p>Please see my code below:</p>
<p><img src="http://i.stack.imgur.com/Wd1FR.png" alt="Image of remove button appearing under"></p>
... | <p>You have 3 CSS options:</p>
<ol>
<li>Make the <strong>Browse</strong> and <strong>Remove</strong> buttons <code>display:inline-block</code> </li>
<li>Make for <strong>Remove</strong> button <code>float:right</code>. And add <code><div style='clear:both'></div></code> after.</li>
<li>Create a table <code... |
Symfony2: ondelete cascade for inverse relations <p>I have an address entity, which is used in various other entities, there are users with an address, there are shops and companies. </p>
<p>Now what I try to do is make sure an address is automatically deleted when a shop is deleted, so I tried this: </p>
<pre><code>... | <p>You just need to add the cascade <code>remove</code> option</p>
<pre><code>/**
* Shop
*
* @ORM\Table(name="shop")
* @ORM\Entity
*/
class Shop {
/**
* @ORM\ManyToOne(targetEntity="Address", cascade={"persist, remove"})
* @ORM\JoinColumn(name="address", referencedColumnName="id")
*/
privat... |
For loop prints only last value array in javascript <pre><code>for (var i = 0; i < featureSet.features.length; i++) {
for (var f = 0, f1 = featureTracts.length; f < f1; f++) {
rows["Sensor"] = featureTracts[f].attributes.Sensor;
rows["Resolution"] = feat... | <pre><code>for (var i = 0; i < featureSet.features.length; i++) {
var rowAaaray = [];
for (var f = 0, f1 = featureTracts.length; f < f1; f++) {
var rows = {};
rows["Sensor"] = featureTracts[f].attributes.Sensor;
rows["Resolution"] = feat... |
Float Range with Regex in Jquery <p>Can someone help me to filter input in range 0.00 - 4.00</p>
<pre><code><input id="test" name="test" type="text" maxlength="4" required>
<script>
$('#test').on('change keyup', function() {
var test = $(this).val().replace(/[^0-4\.]/g, '');
$(this).val(test);
})... | <p>Regular expression is over complicating the task. You can achieve the same result by simply parsing the value of the text field with <code>String.prototype.parseFloat</code></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="... |
discover snmp oid with low-level discovery in Zabbix <p>I have 10 Cisco Switches (model 3750) with different updates of IOs. I want to know is there a way to use low-level discovery to automatically add my desired MIBs to zabbbix? for example to monitor the traffic of port1 I need to get the value of IF-MIB::ifHCInOcte... | <p>Sure, that's exactly what the <a href="https://www.zabbix.com/documentation/3.0/manual/discovery/low_level_discovery#discovery_of_snmp_oids" rel="nofollow">SNMP LLD</a> is for.
Even more, there's a default template "Template SNMP Interfaces", which will do that for you out of the box. If you have lost it somehow, yo... |
quartz.net 2.0 job do not execute parallel <p>We have 3 quartz.net (version 2.3.3) job configured via xml file</p>
<p>IInterruptableJob Job1Class is marked with DisallowConcurrentExecution and being used by both Job1 & Job2 (of course with different job data) in xml file.</p>
<p>IInterruptableJob Job3Class is use... | <p><code>Job1</code> and <code>Job2</code> can't run parallel, because you told Quartz that <code>Job1Class</code> has the <code>DisallowConcurrentExecution</code> attribute. This attribute works on classes, not on objects. Quartz won't run more than one instance of Job1Class. To fix this behavior, remove the <code>Dis... |
Updating multiple rows with different values through foreach - Laravel Eloquent <p>I'm trying to retrieve multiple rows, loop with foreach, and update each of those rows with a specific value (based on switch)</p>
<p>I get the <code>Method save does not exist</code> error. Not sure what should be the syntax for this u... | <p>Do like this</p>
<pre><code>$appointmentreminders = Appointmentreminder::where('appointment_id', '=', $id)->get();
foreach ( $appointmentreminders as $appointmentreminder)
{
$appointmentreminder = Appointmentreminder::find($appointmentreminder->id);
switch ($appointmentreminder->timeunit) {
case... |
Metro UI Dialog close button doesn't work <p>I started to make a little website with Metro UI to educate myself.</p>
<p>I wanted to make a picture that show's a little information when I hover over it with the mouse and as soon as I press it a dialog pops up.</p>
<p>But somehow the close button isn't doin anything. <... | <p>I've changed the code since my last time a bit but it is still nearly the same. I found my problem with trial and error and help with my CO. I had to make the div from my dialog outside the div from my tile-big but inside the app-bar.</p>
<pre><code><!DOCTYPE html>
<html lang="de">
<html>
<... |
Cocoapods : no such module <p>I am using Xcode 7.3 and have just updated my code to swift 2.3 (not sure if it is realted).
My project includes many pods, like Google, Alamofire, FBSDK ...</p>
<p>When I try to build my project, it fails with this error on "Import Google":
"No such module Google"</p>
<p>Obviously, if I... | <p>In your app's <em>project</em>-Bridging-Header.h file, import the Google Sign-In SDK headers like this:</p>
<pre><code>#import <Google/SignIn.h>
</code></pre>
<p><a href="https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift" rel="nofollow">as described here</a>.</p>
<p>No need to do "<code>#... |
cURL request in Java with XGET argument <p>I like to execute a cURL command like</p>
<pre><code>curl -s -XGET 'http://localhost:xxx/h*/_count?q=*&pretty'
</code></pre>
<p>in my java application (which is running of course on a linux-machine) and save the result in a String.
How to do this properly? <a href="http:... | <p>Finally I got a solution on my own.</p>
<p>First I shrinked the command: <code>curl 'http://localhost:xxxx/h*/_count'</code>. In this case it has the same result.</p>
<p>With the following java-code I was able to read the content of the "webpage":</p>
<pre><code>URL oracle = new URL("http://localhost:9200/h*/_cou... |
How to retrieve content in Nexus 3.0 with script API? <p>How can I retrieve the content of the requested artifact for Nexus 3 like
<strong>/service/local/artifact/maven/content</strong> in Nexus 2 ? </p>
<p>I didn't see any script API in Intellij IDEA.</p>
<p>Which API can I use for that maven artifact operations l... | <p>There is no API for getting artifacts, listing artifact names, version numbers etc. The REST API will probably include these features when it is implemented.</p>
|
How to set text into a DOM element <p>I'm trying to set text into a DOM element. I create the element.</p>
<pre><code>svg_doc = minidom.parse('PATH_TO_SVG_FILE.svg')
category = svg_doc.createElement('category')
</code></pre>
<p>Then I try to set the <code>nodeValue</code>:</p>
<pre><code>category.nodeValue = 'Design... | <p>I think this should work:</p>
<pre><code>category.createTextNode('Design')
</code></pre>
<p>See: <a href="https://docs.python.org/2/library/xml.dom.minidom.html" rel="nofollow">https://docs.python.org/2/library/xml.dom.minidom.html</a></p>
|
Pass command line arguments to nose via "python setup.py test" <h1>Package Settings</h1>
<p>I have built a Python package which uses <a href="http://nose.readthedocs.io/en/latest/" rel="nofollow">nose</a> for testing. Therefore, <a class='doc-link' href="http://stackoverflow.com/documentation/python/1381/creating-pyth... | <p>Nose provides its own setuptools command (<code>nosetests</code>) which accepts command line arguments:</p>
<pre><code>python setup.py nosetests --with-xunit
</code></pre>
<p>More information can be found here:
<a href="http://nose.readthedocs.io/en/latest/setuptools_integration.html" rel="nofollow">http://nose.re... |
Array field always stores the last value of the field into database <p>Help me working with array inputs on my project.
This is the form field: </p>
<pre><code><form action="" method="">
<input type="text" class="form-control" name="scores[]">
<input type="hidden" name="lesson_id[]" value="">... | <p>Only the last value is stored because you stored the data after foreach loop.
If you want to store the <code>socres[]</code> and <code>lesson_id[]</code> as an array in the same table, you can use <code>serialize()</code></p>
<pre><code> $scr = new Assestment;
$scr->year_id = $request->year_id;
$scr->gra... |
How to convert two rows value in a single row? <p>I have below sql server query data</p>
<p><a href="http://i.stack.imgur.com/YnNnd.png" rel="nofollow"><img src="http://i.stack.imgur.com/YnNnd.png" alt="Sample data"></a></p>
<p>Looking for solution.</p>
<p>SQL Query:</p>
<pre><code>SELECT
p.ProjectName,
i.... | <p>I think you just want conditional aggregation:</p>
<pre><code>SELECT p.ProjectName, i.ItemName,
SUM(CASE WHEN inv.TransactionDirection = 'IN' THEN inv.TransactionQty ELSE 0 END) as IN_Quantity,
SUM(CASE WHEN inv.TransactionDirection = 'OUT' THEN inv.TransactionQty ELSE 0 END) as OUT_Quantity,
S... |
Where to place pre loaded db file in Ionic 2 RC0 <p>I am using the sqlite cordova ext plugin to work with a pre-filled sqlite database.</p>
<p>With the new RC0 of Ionic 2 the www folder is completely rebuilt on every build.
Previously you would leave your db file in the www directory as this is the plugins default loc... | <p>1) I installed the cordova-sqlite-ext plugin</p>
<p>2) In app.component.ts I imported <code>import { SQLite } from 'ionic-native';</code></p>
<p>3) In the platform.ready() I inserted:</p>
<pre><code>let db = new SQLite();
db.openDatabase({
name: "data.db",
location: "default",
create... |
How to use MSSQL Select in Groovy <p>I'm trying to access the table from a database. First I checked the connection of the database and it worked. Then I checked the close db and it worked. After I try to select couple of items from the table and print them using eachraw command. </p>
<p>I'm getting below error:</p... | <p>The method is eachRow, no eachrow, and if you specify a row variable name inside the closure, you have to use 'row' instead of 'it'.
So you code should look like this:</p>
<pre><code>db.eachRow(q1){row ->
log.info "${row.description}"
}
</code></pre>
|
Local issuer certificate error <p>I am using <strong>socialite</strong> and using google for OAuth. When I authorize the application which results in the following error.</p>
<p><a href="http://i.stack.imgur.com/qyqHk.png" rel="nofollow"><img src="http://i.stack.imgur.com/qyqHk.png" alt="enter image description here">... | <p><strong>The reason</strong> you're seeing this is with socialite is that, underlying socialite use <code>guzzlehttp</code>, if you look at <code>composer.json</code> for socialite package.</p>
<pre><code>"require": {
"php": ">=5.4.0",
"illuminate/contracts": "~5.0",
"illuminate/http": "~5.0",
"il... |
Calling a function on grid action coumn click <p>I have a grid in yii that has an action column with a custom button I would like to call function when the grid button is clicked but i get an error</p>
<p>This is my code:</p>
<pre><code>[
'class' => 'kartik\grid\ActionColumn',
'template' => '{a... | <p>It seems you have to use below code for register js </p>
<pre><code><?php
$this->registerJs('
function reject(id) {
alert(id);
}', \yii\web\VIEW::POS_HEAD);
?>
</code></pre>
<p>that will add the js in head part and it may get the function which you defined</p>
|
DataGridView Value to a textbox on an already Active Form <p>Form1 has a text box with a button that brings up Form2 that is a filters screen for Form3 which has the DataGridView. When I doubleclick on a DataGridView Row, I need it to pass a value to the TextBox on Form1 (which will stay open and Active) I can get the ... | <p>Try this:</p>
<pre><code>public void rowClick()
{
// ...
((Employee_Maintenance)this.Owner).txtDepartment.Text = departmentCode;
// ...
}
</code></pre>
|
TFS build modifying website folder structure <p>In my solution I have a basic ASP.NET MVC website and a Wix Project. To identify the files that need installed I'm using Heat (a Wix component) to index the build output. This is part of a post-build event. It works perfectly on my local machine when building in Visual St... | <p>Adding a <strong>Copy Files</strong> task to copy bin folder to <code>$(build.artifactstagingdirectory)\_PublishedWebsites</code>, check the screenshot below:</p>
<p><a href="http://i.stack.imgur.com/6xjPU.png" rel="nofollow"><img src="http://i.stack.imgur.com/6xjPU.png" alt="enter image description here"></a></p>
|
What is best option for dealing with date types in Android? <p>What is at the moment best option for dealing with date in time in Android development, since Android studio doesn't yet support Java 8 (and new java.time package) (if I am correct)?</p>
| <ol>
<li>Support for Java 8 language features requires a new compiler called
Jack. Jack is supported only on Android Studio 2.1 and higher. So if
you want to use Java 8 language features, you need to use Android
Studio 2.1 to build your app. Source: developer.android.com/guide/platform/j8-jack.html</li>
<li>For date's ... |
No SSL caused by mixed content in ruby app <p>I have an APP written in Ruby. The authentication is made through Facebook-Graph_API.</p>
<p>I am using an SSL certificate which is validated through Globe SSL.</p>
<p>The connection is encrypted and almost everything is working fine. BUT!</p>
<p>The connection is insecu... | <p>When you're requesting the data from Facebook that contains the images you're going to display, append <code>return_ssl_resource=true</code> as a query parameter to the request you make.</p>
<pre><code>https://graph.facebook.com/<UID>/picture?return_ssl_resources=true
</code></pre>
|
Javascript: declare global variable in a script and use it in another <p>I've been trying to create a connection to an sqlite3 database with a script (main idea came from a stackoverflow answer) which is as follows. In the file "checkbook.js" I have the connection function and below the fuction that is supposed to use ... | <p>This code:</p>
<pre><code>xhr.onload = function(e) {
var uInt8Array = new Uint8Array(this.response);
db = new SQL.Database(uInt8Array);
};
</code></pre>
<p>is run as a callback of the onload event. Hence, due to the asynchronous nature of the latter, the initialization of <code>window.db</code> is not done whe... |
Javahelp relative URL between master helpset and subhelpsets <p>I am using Javahelp and dynamically merging multiple helpsets. Does anyone know what the relative URL would be if I want to create a link from a page in a subhelpset to a page in the master helpset?</p>
| <p>I found the answer to my question and I'll post it here in case someone else has the same problem. In my case, the master helpset was in a jar file and the subhelpset I was dynamically adding was in a separate jar file. I thought that dynamically merging them would somehow move them both into the same location and... |
django paginated sitemap url pattern <p>The short question is: what is the url pattern for the paginated sitemap?</p>
<p>So, I have in urls.py:</p>
<pre><code>url(r'^sitemap\.xml$', sitemaps_views.index, {'sitemap_url_name': sitemaps}),
url(r'^sitemap-(?P<section>.+)\.xml$', sitemaps_views.sitemap, {'sitemaps':... | <p>Adding <code>?p=2</code> to the end of the URL gives me what I want.</p>
|
Change item Row color in gridview ? <p>hellow evreybody please can you help me to change the color of row in gridview
in getView(),for example i try to change the backround by row
forexample if position ==4 the 4 row will be in black .
but when i scrool all row changed background. </p>
| <p>Your model classes of your gridItems for your adapter should have an attribute 'color' . </p>
<p>In your getView method - when the 'position' is 3,7,11...etc change the gridview layout color and use the setColor attribute of your item to set the color to that particular item.</p>
<p>Along with this at the start of... |
How to write regex in php for changing content? <p>I have a .h file which contains hundred of lines code. I want to get back the strings from the variable. </p>
<pre><code>string PackageToRun[][] = { {"M16.1","M16.1EP1","M16.2","M17"},
{"Tv16.2","Tv17","Ta17","Ta16.2 MOpenTAS","Tv17.1","Ta17.1","T16.2","T1... | <p>Hey that sort of looks like JSON!</p>
<pre><code><?php
$file = '
string PackageToRun[][] = { {"M16.1","M16.1EP1","M16.2","M17"},
{"Tv16.2","Tv17","Ta17","Ta16.2 MOpenTAS","Tv17.1","Ta17.1","T16.2","T16.2c"} };
';
if( preg_match('#string PackageToRun\[\]\[\] = ({.*});#is', $file, $matches)) {
$da... |
Multiple arguments for "face" in element_text <p>I am adding aesthetics to a plot in R using themes in ggplot2. I would like to make the x axis text both bold and italic.</p>
<p>I know I can use:</p>
<pre><code>theme(axis.text.x = element_text(face ="bold"))
</code></pre>
<p>to make the axis text bold and:</p>
<pr... | <p><code>?element_text</code> says the following are the options (have you tried <code>face ="bold.italic"</code>?) :</p>
<blockquote>
<p><strong>face</strong> font face ("plain", "italic", "bold", "bold.italic")</p>
</blockquote>
|
Run timer in app and when app is in background <p>I need to run a timer when the user is in app and also when the app is in background. </p>
<p>The context is: if he is on a specific view controller, after 5 min will be redirected to main view controller. The timer should redirect him if the app stays in background an... | <p>You can't do this with a normal <code>NSTimer</code> as there is no support for backgrounding. It is however achievable very easily using another method.</p>
<p>In your AppDelegate you have two methods. <code>applicationWillResignActive</code> and <code>applicationDidBecomeActive</code>. In the resign method you si... |
Couldn't find record without an ID, Rails 4 and ActiveAdmin <p>I am implementing ActiveAdmin to CRUD my app's content. So far so good.
But I am receiving error: Couldn't find Girl without and ID when I am accessing action 'New' in my admin panel.</p>
<p><a href="http://i.stack.imgur.com/cVcUL.jpg" rel="nofollow"><img ... | <p>instead of </p>
<pre><code>format.html { render :action => "new" }
</code></pre>
<p>try using</p>
<pre><code>format.html { redirect_to new_admin_girl_path }
</code></pre>
|
jQuery Datatables Button CSS Positioning <p>I'm working on a Sharepoint web part that is utilizing JQuery datatables to format some reporting results, here's what the report looks like:</p>
<p><a href="http://i.stack.imgur.com/jXaiN.png" rel="nofollow"><img src="http://i.stack.imgur.com/jXaiN.png" alt="enter image des... | <p>The wrong way:</p>
<pre><code>.FSexportButton
{
position: absolute !important;
right: -7px;
bottom: -20px;
}
</code></pre>
<p>the right way: give it an id, lets say: 'excelbutton' and do</p>
<pre><code>#excelbutton
{
position: absolute;
}
</code></pre>
<p>, or figure out the class that gives it relative and do ... |
ExtJS is not using my grid filter override <p>I have a project in which I needed to make a custom grid date filter.</p>
<p>Everything work fine until the stateful save. I need to add a custom value to the state. I overrode the <code>getState</code> method from a class that extends <code>Ext.util.Filter</code> : </p>
... | <p>I believe in your case you dont need this.callParent(); part in your overriden method, here is a nice explanation about different ways to override a method <a href="https://sencha.guru/2015/01/20/overriding-methods-safely/" rel="nofollow">https://sencha.guru/2015/01/20/overriding-methods-safely/</a> </p>
|
Resize Highcharts chart in Angular UI Modal <p><a href="http://plnkr.co/edit/NbZ1nCEnXXlOO7Ky0wSx" rel="nofollow">In this plunk</a> I have a Highcharts chart within an Angular UI Modal. The modal can be resized (implemented with jQuery UI resize).</p>
<p>The objective is to resize the chart to 100% width and height of... | <p>Change the definition of the resizable plugin as follows by adding a listener to the resize event, for a more smooth end immediate effect set the <code>doAnimation = false</code>:</p>
<pre><code>$('.modal-content').resizable({
handles: "all",
resize: function(event, ui) {
$('#container').highcharts(... |
How can i insert the json data into different mysql tables? <p>I have the json file like below, i want the states to be entered first in state table, and the corresponding name that is the city should enter in another table and should take the id of the concerned state as the state id there are more than 1700 data. the... | <p>Do the following </p>
<pre><code>foreach($array as $row){
$query = "INSERT INTO Cities values('".$row['id']."','".$row['city']."','".$row['state']."' )" ;
$res = mysql_query($query);
}
</code></pre>
|
getting exact cell from output of windows command <p>I run <strong>netsh interface ipv4 show inter</strong> command on win 2k12 server, it give me output like </p>
<pre><code>Idx Met MTU State Name
--- ---------- ---------- ------------ ---------------------------
1 5... | <p>You can do something like that :</p>
<pre class="lang-dos prettyprint-override"><code>@echo off
For /f "tokens=1 delims= " %%a in ('netsh interface ipv4 show inter ^|find /I "1500"') do (
set "Idx_Var=%%a"
)
echo Idx_Var=%Idx_Var%
pause & exit
</code></pre>
|
XSL predicates in location path? <p>I have this list of users and want to filter it so it only shows users that are same age and have the same last name - desired out put is</p>
<p>25, Smith, Harry</p>
<p>25, Smith, Charlie</p>
<p>36, Jones, Thomas</p>
<p>36, Jones, Henry</p>
<pre><code><?xml version="1.0" enco... | <p>You just need an inner <code>xsl:for-each</code> to get all of items in the group, rather than just picking the "second" one....</p>
<pre><code><xsl:for-each select="//user[generate-id(.)=generate-id(key('duplo', concat(age, '+', name/lastName))[2])]">
<xsl:sort select="age"/>
<xsl:sort sele... |
For loop in R that calculates for the group and then the components <p>I have a set of data and a loop containing numerous calculations for the data set, where the individual components of the set are split into a subset and cycled through one by one. However I need to be able to execute the same calculations across t... | <p>It seems like <a href="https://cran.rstudio.com/web/packages/dplyr/vignettes/introduction.html" rel="nofollow">dplyr</a> would solve this elegantly, among the other options</p>
<p>For the whole data:</p>
<pre><code>library(dplyr)
masterdata %>%
summarise(result = your_function(arg1 = X1, arg2 = X2, ...))
</... |
How to prevent a particular string from being printed in find_all()? <p>How to exclude a substring from being printed in object <code>obj</code></p>
<pre><code>obj = soup.find_all('tag')
if "string" not in obj.text:
print obj.text
</code></pre>
<p>But due to the use of find_all() method for object obj nothing is ... | <p>You need to loop through the list returned by <code>find_all()</code>:</p>
<pre><code>for i in soup.find_all('tag'):
txt = i.text
if 'string' not in txt:
print txt
</code></pre>
<p>Alternatively, you could create another list where the unwanted tags are filtered out:</p>
<pre><code>filtered_lst = ... |
How to make kendoui angular2 chartcomponent as donutchart <p>Can any one please help me to make the chart component of kendoui angular2</p>
<p>as donut chart</p>
<p>i'm able to gt the chart by following the example in this page <a href="http://www.telerik.com/kendo-angular-ui/components/charts/" rel="nofollow">http:... | <p>Here is a sample template for a Donut Chart</p>
<pre><code> <kendo-chart>
<kendo-chart-title text="Donut Chart"></kendo-chart-title>
<kendo-chart-series-defaults type="donut">
</kendo-chart-series-defaults>
<kendo-chart-series>
<kendo-chart-s... |
Why the canvas size in this code is not as expected? <p><a href="https://jsfiddle.net/awguo/uw1x8m3y/" rel="nofollow">https://jsfiddle.net/awguo/uw1x8m3y/</a></p>
<p>here is the detailed demo.</p>
<p>I put an img in a div#wrapper and then put a canvas overlap on this img inside that wrapper. I set the width and heigh... | <p>Make the image's display <code>inline-block</code> or <code>block</code>. By default it is <code>inline</code> and gets <code>vertical-align</code>ed to <code>baseline</code>, so it gets the crazy <code>0.5em</code> height extra.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-... |
Duplicate NULL Values on SQL LEFT JOIN <p>I was trying to JOIN two tables based on their columns using LEFT JOIN</p>
<pre><code>SELECT DISTINCT ic.document_num, wps.file_name
FROM web_pub_subfile wps
LEFT JOIN infocard_1 ic ON ic.info_card_id = wps.info_card_id
AND lower(ic.vault_name) LIKE N'... | <p>Something like this should meet the expectation, I hope ...</p>
<pre><code>SELECT DISTINCT
ic.document_num,
wps.file_name
FROM web_pub_subfile wps
LEFT JOIN infocard_1 ic ON ic.info_card_id = wps.info_card_id
WHERE ic.vault_name LIKE N'%su-spec-release%'
AND ic.document_... |
heroku: no default language could be detected for this app <p>First time using Heroku. Trying to push. I have run the command:</p>
<p><code>heroku create --buildpack heroku/pyhon</code> and it displayed</p>
<p><code>$ heroku create --buildpack heroku/python
Creating app... done, glacial-reef-7599
Setting buildpack to... | <p>You need to create a runtime.txt file. On the command line, in the same folder as your requirements.txt file, enter <code>echo "python-3.5.1" > runtime.txt</code>. Of course, make sure to switch the 3.5.1 with whichever version of Python you are using.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.