id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23497900 | public class MyClass implements Serializable {
private long longValue = 9;
private String stringValue = "my string";
// .......
}
I'm using Gson to convert an Object of MyClass to Json
Gson gson = new Gson();
MyClass obj = new MyClass();
String jsonStr = gson.toJson(obj);
println jsonStr;
Intermi... | |
doc_23497901 | Here is some sample code to better illustrate what I'm attempting to do:
#include <memory>
#include <iostream>
static void close(int p)
{
std::cout << p << " has been deleted!" << std::endl;
}
struct handle_deleter
{
typedef int pointer;
void operator()(pointer p) { close(p); }
};
typedef std::unique_ptr... | |
doc_23497902 | public static void main(String[] args) {
double a=300.0;
double b=24.08;
System.out.println(a*b);
}
The result is 7223.999999999999.
But the actual result should have been 7224.
But why?
| |
doc_23497903 | Thanks
A: I have achieved this.How i have done this is i have created a custom layout that holds my image and buttons and when i zoom I re-layout the custom layout .During the layout process i re-size the image and position the buttons accordingly.
Incase anyone has a better solution kindly let me know.
Thanks.
| |
doc_23497904 | a = {(u'A', 4): [u'alpha', u'beta', u'gamma'],
(u'B', 2): [28, 29, 28],
(u'C', 5): [u'Yes',u'Yes', u'Yes'],
(u'E', 1): [u'delta', u'omega', u'eta'],
(u'F', 3): [u'No', u'Yes', u'No']}
I would like to sort it and get:
a = {(u'E', 1) : [u'delta', u'omega', u'eta'],
(u'B', 2) : [28, 29, 28],
... | |
doc_23497905 | This is my attempt but the code gets kind of long. I'm wondering if there is a built-in function for it already or could be done in a smarter way. In this case, I'd like to know the number of elements having true in $arr['key'][uniquekeyname]['check'].
$arr = array();
$arr['keys'] = array(
'a' => array('check' => t... | |
doc_23497906 | www.mysite.com/archives/123qwe/index.php
but not
www.mysite.com/123qwe/index.php
I believe this regex should work: (?<!\/archives\/.*)\.php$
However, I'm not able to use the < character, because I need to submit the regex into a web form that sanitizes <'s from the input. And using < breaks the regex. So is ther... | |
doc_23497907 | It seems to work fine except that the video freezes up while saving frames, which makes it really difficult to figure out when to stop saving frames. I'm wondering if anyone has an idea of how to avoid this problem.
This is the program as is:
#include "stdafx.h"
#include <cv.h>
#include <highgui.h>
#include <iostream>
... | |
doc_23497908 | public string GetFullPath(string path)
{
Ensure.Argument.NotNullOrEmpty(path, "path");
if (path[0] == '~') // a virtual path e.g. ~/assets/style.less
{
return path;
}
if (VirtualPathUtility.IsAbsolute(path)) // an absolute path e.g. /assets/style.less
{
return VirtualPathUtilit... | |
doc_23497909 |
*
*On the first sheet is a table of our workers hours.
*On the second
sheet is a sum function which displays the result on the first
sheet(it just sums up the hours).
I need to add the sum function for only couple of cells in the rest of the 90 sheets. This is the function, all the cells are always the same only o... | |
doc_23497910 | Currently my app is using UICollectionView as a way to display objects list. UIViewController, that contains UICollectionView as subview, implements UICollectionViewDelegate protocol and acts as delegate and datasource. Datasource uses NSFetchedResultsController to provide data;
In my opinion this is not the best way t... | |
doc_23497911 | The general question seems incredibly hard to solve. Here is a significantly restricted version of this question.
How do I determine equality of functions?
lets say we have
function f() {
// black box code.
}
function g() {
// black box code.
}
We take a mathematical definition of a function. So
if for all ... | |
doc_23497912 | This worked fine, because Dreamweaver was always able to render basic PHP stuff that was not really "Server-side", like the includes. But now, I am trying to switch to using Adobe Edge Code, because it is truly lightweight and I don't have to load up a big application on slower computers to do work. It is also really n... | |
doc_23497913 | The final product would just have 3 long columns with col[4] below col[1], col[5] below col[2], etc.
All the solutions I see depend on ID columns that are non existent in my data. I looked at gather(),stack(), melt(). I just want to simply cut the last 3 columns and paste them below the first 3 columns,
A: If the co... | |
doc_23497914 | But the else statement to create a new account never runs. This error occurs when I create a new account with an untaken email and username.
Unhandled rejection TypeError: Cannot read property 'username' of undefined
at null. (/home/ubuntu/workspace/Authentication.1/config/passport/passport.js:59:21)
at tryCat... | |
doc_23497915 | function Welcome() {
var styles = {
backgroundColor: "#eee"
};
const [isLoaded, setIsLoaded] = useState(false);
const [cats, setCats] = useState([]);
if(!isLoaded) {
setIsLoaded(true);
fetch('http://localhost:3001/api/categoryList')
.then((response) => respo... | |
doc_23497916 | The code I have isn't hiding the appropriate divs from the onclick
I've looked around, but every solution seems overly complex or seems to involve jquery - which I would really prefer not to use, because I have to work with an old jquery library on a site where I shouldn't be updating that stuff.
<button class="butto... | |
doc_23497917 | like :
$var1 = '4';
$var2 = '5,7,4,9';
if ($var1 Inside $var2)
{
// remove 4
}
//output
$var2 = '5,7,9';
Thank you ...
A: Since it is a string, I think the easiest is to first convert it to an array, remove the value, and put it back together again:
$values = explode(',', $var2);
if (($key = array_search($var1, $v... | |
doc_23497918 | Imports System
Console.SetCursorPosition(Console.WindowWidth-1, Console.WindowHeight-1)
Console.Write("x")
This is not working like I would like it to. Any suggestions or alternatives? I've tested that SetCursorPosition does use a 0,0 coordinate system, already. Using the WindowWidth-1/Height-1 should put me in the lo... | |
doc_23497919 | As I know, Xpressive is a great user of the stack. But are there Xpressive regex approaches that are more stack efficient?
E.g. a regex to match a string representing a 32-bit integer may need to test if digit number six is less than or equal to 6.
Xpressive (and other regex engines too, I know) allows numerous approa... | |
doc_23497920 | I wanted to keep everything but the empty strings so naturally I did something like
WHERE my_row <> ''
However I discovered that this also removed my nulls. :(
I did a little poking around and found
SELECT NULL = '' -- Returns False. No surprise here
But
SELECT NULL <> '' -- Also returns False. Huh?
Can someone ... | |
doc_23497921 | BigInteger sum = BigInteger.ZERO;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(reader.readLine());
int arr[] = new int[n];
for(int i=0; i<n; i++){
arr[i] = Integer.parseInt(reader.readLine());
sum = sum... | |
doc_23497922 | I'm fairly new to python so this could be way off but I wasn't sure if this would be a good use case for a lambda expression.
class BarsRequestSample(CELEnvironment.CELSinkBase):
def __init__(self):
self.symbols = ['CLES12Z', 'HOE']
self.continuation=['ClES12Z', 'CLES6M']
def Start(self): ... | |
doc_23497923 | using pycharm, python 3.7
I have properly written the code and i know it exists(the attribute) in the imported module.
the code is this:
def make_pizza(size, *toppings):
"""Summarize the pizza we are about to make."""
print(f"\nMaking a {size}-inch pizza with the following toppings:")
for topping in toppings:
... | |
doc_23497924 | func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
var reuseId = ""
if annotation.isKindOfClass(FBAnnotationCluster) {
var reuseId = "Annonation"
reuseId = "Cluster"
var clusterView = mapView.dequeueReusableAnnotationViewWithIdentifier(r... | |
doc_23497925 | So, normally a reverse proxy should stand before web servers (i.e. expressjs).
But most Azure Web App Service examples don't consider reverse proxy.
So, are there some functions in Azure Web Service that act as a reverse proxy?
Or do we still have to add a reverse proxy? If so, could you point out a good example?
Azure... | |
doc_23497926 | Even if user with inputed login does not exist
public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException {
log.info(s);
UserDetails result = usersRepository.findByUsername(s).orElseThrow(() -> new UsernameNotFoundException("User not found"));
log.info(result.toString()... | |
doc_23497927 | import time
time.sleep(2)
import MySQLdb
temperature = 60.0
humidity = 30.0
IP_Add = "123.456.78.9"
location = "basement"
name = "home"
while True:
humidity = humidity
temperature = temperature
fTemperature = (temperature * 9 / 5) + 32
name = 'home'
if humidity is not None and temperature is not No... | |
doc_23497928 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template name="ident" match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="tr... | |
doc_23497929 |
In this image the red bar is the content and the orange bar is the centre section of the header that should be in line with the content.
These are both aligned using this css:
.center-content {
width: 100%;
max-width: 800px;
margin: 0 auto;
}
What is the best approach for this?
I was thinking of just addi... | |
doc_23497930 | Doesn't work in Windows, Linux, MacOS with Java 1.6.x
A: This is the code I used to see if this worked. Try running this on your machine.
import java.awt.*;
import javax.swing.*;
public class TestUnderscore
{
// Test routine.
public static void main(String[] args)
{
JFrame frame = new JFrame();
frame.... | |
doc_23497931 | Like for example, I have the following set of documents in the collection "people"
Alex
Abhishek
Nandini
Nancy
and in my Android activity, I have a TextView which will show each of the collection name randomly, whenever I invoke that activity, like when I open the activity, it will show "Nancy" on the textview and agai... | |
doc_23497932 | Function
def stats_players(stat,player_id):
a = {}
b = {}
if stat != "Start" and stat != "FormationChange" :
print(stat)
for js in data_events[str(stat)]:
icdType = js["playerId"]
if icdType in a:
a[icdType].append(js)
else:
a[icdType] = [js]
data = j... | |
doc_23497933 | export const getCustomers = (customers) => (dispatch, getState) => {
const activeCustomers = produce(customers, (draft) => {
for (let i = 0; i < customers.length; i += 1) {
draft.customers[i].position= i;
}
});
//I keep getting that error that draft.customers[i] is undefined
What am I doing wrong.... | |
doc_23497934 | def blurb = Blurb.findByName("custom_${event.id}" )
if (!blurb){
blurb = new Blurb(name:"custom_${event.id}" , content:"" ).save()
}
When I do this I receive the same error in the IDE and the run output
'unable to resolve class Blurb' and I am directed specifically to this line blurb = new Blurb(name:"custom_${eve... | |
doc_23497935 | Is it possible to migrate users who have the cookie set, so that not every session will show up as a new brand new user?
A: It's certainly possible, the trick is to let the Google Analytics script extract the client id from the cookie for you when you can't find an id stored in local storage.
/* Google Analytics initi... | |
doc_23497936 | #[macro_use] extern crate log;
extern crate ansi_term;
extern crate fern;
extern crate time;
extern crate threadpool;
extern crate id3;
mod logging;
use std::process::{exit, };
use ansi_term::Colour::{Yellow, Green};
use threadpool::ThreadPool;
use std::sync::mpsc::channel;
use std::path::{Path};
use id3::Tag;
fn ma... | |
doc_23497937 | If you enter "21" it would generate a list with the elements:
list[0] = "21"
list[1] = "22"
list[2] = "11"
list[3] = "12"
(Not nessesarily in that order)
I understand you can use range to do things like:
List<char> letterRange = Enumerable.Range('a', 'z' - 'a' + 1).Select(i => (Char)i).ToList(); //97 - 122 + 1 = 26 le... | |
doc_23497938 | {
};
class Herbivore:Animal
{
void eat();
};
class Carnivore:Animal
{
void eat();
};
class Food
{
bool bMeat;
bool bVegeable;
};
I start out this class and all of a sudden I don't know what to do to with the class Food, as I would like to print out the correct food type each "kind" of animal favors m... | |
doc_23497939 | I created the table to take in boolean values and default to false
.createTable('proj', tbl => {
tbl.increments('proj_id')
tbl.string('name', 64).notNullable()
tbl.string('description', 64)
tbl.boolean('project_complete').defaultTo(false);
})
and return all data from this table u... | |
doc_23497940 | Here's a screenshots.
Also i need to add a scrolldown on the top purple part to show its other texts is the screen is short?
Im using this jscrpt
<script>
function toggleDiv(divNum) {
$("#close").hide();
$("#center-content").removeClass("width-400px"... | |
doc_23497941 | I get JSON from API and show "parent" value. I do this with ng-repat and this is ok, but when user clicks on this value from ng-repeat, I need to show collapsable data bellow, but I can't access in the second level from my JSON.
<div class="logBox" style="overflow-y: auto; height: 250px;">
<div class="list" ng-repea... | |
doc_23497942 | It would look so much better if that if statement could be condensed. Any advice or solutions are greatly appreciated.
geolocation.watchPosition(function(position) {
var headingDir;
var headingDeg;
headingDeg = position.coords.heading ? position.coords.heading.toFixed(2) : 0
//This long boi
if (headingDeg >= 22.5 & h... | |
doc_23497943 | $appid = $chk[$i];
include "dbconnect.php";
$selectquery = mysql_query("SELECT * FROM regform_admin WHERE tid = '$appid'");
$fetch = mysql_fetch_array($selectquery);
$tid = $fetch['tid']; $username = $fetch['username']; $c_month = $fetch['month']; $c_day =$fetch['day']; $c_year = $fetch['year'];
... | |
doc_23497944 | but substitute a set of values from a range with another lateral set of values.
I have this:
Public Function SubstituteRange(RangeWithText As Range, TwoColumnMatrix As Range) As String
Dim Text As String
Text = "/" & RangeWithText.Value & "/"
'as example st like this: "/" & "1/2/3/4/5/6/7/8" & "/" = "/1/2/3/4/5/6/7/8/"... | |
doc_23497945 |
*
*Windows Server 2012 x64 (Virtual Machine running on a blade system)
*.NET 4.0 Framework (installed 4.5)
*our application is .NET x86 application (not AnyCPU; not ASP.NET)
*Third Party native modules used SQL CE 3.5, and others
The error report from windows event log looks something like this (application and... | |
doc_23497946 | Thanks,
Abhi.
================
I am reading Microsoft .NET Framework Application Development Foundation 2nd edition to prepare for MCTS. In the first chapter, there was a question as below:-
Which of the following are examples of built-in generic types? (Choose all that
apply.)
A. Nullable
B. Boolean
C. EventHandler
D.... | |
doc_23497947 | <tr class="x-boundlist-item selectorCls">
<td class="x-boundlist-item-td selectorTdCls" width="70%">64Columns</td>
<td class="x-boundlist-item-td" align="right" style="padding-right:4px;">
<a href="#" style="color:#15428B;"></a>
</td>
</tr>
I want to find a TR element by css clas... | |
doc_23497948 | It's displaying like this
?PNG IHDR???? IDATx???{\Uu????A$DD?dfDhD"5???c?9f?y?j3k??3?~?1+???2?8f??8ffffddFHj^????r???????b??~>z????f?6?|?Z??]???/? "?v "r?X"??v ??'X??kG???????1X?a??????v?'N??Oj??|i%RC ,??y3k?????4l?}?y?M?HK#!???????5?6l??e?Z?1?W?$%?z?Qÿ?i??C??P?????dgs???????#^J.????-YY?^?fy@??DG?d ?^???dg???z???(??|... | |
doc_23497949 | I have a virtual machine registered to a private IP address that I'm wanting to reverse proxy to from the host environment.
Note that for the current iteration of trying to work through this, I'm trying to reverseproxy from foo.bar.baz:* to foo.bar.com:6284
The relevant host entry is foo.bar.com
(assume that bar.com ... | |
doc_23497950 | Here's my the code for the linear spectrum:
#For example: LEQN
#L:113 E:129 Q:128 N:114
peptide = [113,129,128,114]
for a in peptide:
for i in peptide[b:]:
s+= i
spectrum.append(s)
s=0
b += 1
spectrum.sort()
print spectrum
Outputs: [113, ... | |
doc_23497951 | My code:
from tkinter import *
# windows, canvas, and frames
root = Tk()
WatchRun = Canvas(root, bg="green", width=600, height=500)
WatchRun.grid(row=0, column=0, rowspan=25)
Upgrade = Frame(root, bg="yellow", width=600, height=500)
Upgrade.grid_forget()
# button functions
def show_upgrade(widget, widget2):
globa... | |
doc_23497952 | I am setting up socket.io to work with a node/express server. Here is a simplified version of the test I am trying to do.
Server:
var http = require('http');
var express = require('express');
var app = express();
var server = http.createServer(app);
var io = require('socket.io')(server);
/* socket.io test */
io.on('co... | |
doc_23497953 | SELECT field1
FROM table1
WHERE tdate > '2018-6-01' OR (tdate BETWEEN '2015-4-07' AND 2016-6-07);
What would improve the query performance more, an index on tdate or a covering index on (tdate, field1) ?
A: You could create index with included columns:
Redesign nonclustered indexes with a large index key size so tha... | |
doc_23497954 | User selects MIDI device -> User selects file -> File is sent via MIDI.
These steps are implemented in separate screens. The file is read in the update_select widget and passed into the updater widget. There's a LinearProgressIndicator to display feedback to the user.
My problem is, that the progress indicator of the u... | |
doc_23497955 | What I would really like is for this transparent and click thru-able form to receive drag and drop events, but I suspect that using TransparencyKey means that all mouse events are click thru-able including drag and drop?
So far i haven't been able to google myself out of it, so wondered if anyone here would know better... | |
doc_23497956 | First off, I am absolutely unable to create a working VM on my machine at home. I attempted to Enable virtualization in my machine's BIOS so I could use the 64-bit version of Ubuntu, and I can't find the option in the menus. The 32-bit option throws a fatal "kernel panic" error at installation.
I installed the new Bash... | |
doc_23497957 | Option 1:
state: () => ({
user: {},
}),
Option 2:
state: () => {
return {
user: {},
};
},
Option 3: Maybe something else?
A: They are the same. Option 1 and 2 are functions that returns an object. In arrow functions, the { stands for the content of the function (like function x () {). So if... | |
doc_23497958 | The problem is that this old version's ID does not show up anywhere in the Versions tab. When attempting to delete/stop it via the command line the following message shows up "WARNING: No matching versions found", and it keeps on pushing to our logs.
Any advice on how to stop/delete this version? It seems quite sketchy... | |
doc_23497959 | Both div has separate buttons. I want to see one div at a time. I can give different css (style)to them so that they will look different.
Which one will be more useful jQuery hide() and show()
Or display none and block?
#showMyList, #showMyName{
height: 100px;
width: 500px;
text-al... | |
doc_23497960 | Instead of returning only the partitions of a given length, as in the Python version, it is currently returning all of the partitions up to and including that length.
In the below example, the desired output is arrays of length 3 to be returned only.
Have I misunderstood some aspect of the generator function?
const k... | |
doc_23497961 | My HTML:
<!-- Iframe Section -->
<div class="rmpView" id="ContentPlaceHolder1">
<iframe src="/Tabs/tabOne.aspx?ID=0" height="500" width="100%">
<html>
<head></head>
<body>
<div id="wrapper-iframe">
... | |
doc_23497962 | I need to find the records that are on one table but not on the other given three of the fields. The first two are returning what i would expect but when i add the third field which is a date field then none of the records match. Wen i look into the tables i see that the two dates are identical but somehow SAS does not... | |
doc_23497963 |
If a primitive type or a string is defined as a constant and the value
is known at compile time, the compiler replaces the constant name
everywhere in the code with its value. This is called a compile-time
constant.
My understanding is if we have a piece of code:
private final int x = 10;
Then, the compiler wi... | |
doc_23497964 | SQLiteDatabase db = this.getWritableDatabase();
//db.execSQL("delete from " + TABLE_BOOKMARKS + " where " + KEY_ID + " not in (select " + KEY_ID + " from " + TABLE_BOOKMARKS + " order by " + KEY_ID + " limit 10)" );
//db.execSQL("DELETE FROM " + TABLE_BOOKMARKS + " WHERE " + KEY_ID + " NOT IN (SE... | |
doc_23497965 | I've tried the following:
const robot = require("robotjs");
...
//Simulate an "enter" keypress
robot.keyTap("enter");
console.log("enter simulate");
..
//Move the mouse a certain distance
robot.moveMouse(10,10);
console.log("mouse move simulate");
..
//Simulate a mouse left click
robot.mouseClick();
console.log("mouse... | |
doc_23497966 | Here is my route and exception code, looks like. Can anyone suggest best way to handle these scenarios ?
onException(HttpOperationFailedException.class)
.handled(true)
.redeliveryDelay(100)
.maximumRedeliveries(2)
.log("${exception} Http Communication Exception while making API reques... | |
doc_23497967 | Our goals are:
*
*Use WebAPI2 to create a Angular.js application
*use parent application for user login
*link to new application from existing application.
A: Have you tried the location attribute at the web.config? Further details here.
I mean, you can put a web.config within your new Application folder and ove... | |
doc_23497968 | routes/web.php
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a ... | |
doc_23497969 | I'm testing WAVL, AVL & Red-black tree performance in Java and need realistic test data. What should I use?
For reference, the implementations are here:
https://github.com/dmcmanam/bbst-showdown
| |
doc_23497970 | While minifying app code:
packages/minifyStdJS/plugin/minify-js.js:96:26: Babili minification error
within packages/modules.js:
node_modules/angular-tree-component/dist/angular-tree-component.js
`TreeModel` has already been exported. Exported identifiers must be unique.:
export { TreeModel, TreeNode, TreeDraggedEleme... | |
doc_23497971 | Possible Duplicate:
How to count Matching values in Array of Javascript
I have array with elements as,
array_elements = ["2","1","2","2","3","4","3","3","3","5"];
i want to count array elements like following manner,
Answer:
2 comes --> 3 times
1 comes --> 1 times
3 comes --> 4 times
4 comes --> 1 times
5 comes -... | |
doc_23497972 | Table A:
Stud_ID | Name | Address
but i wanted to load in this order in Table B:
Name | Stud_ID | Address.
How should i write in control .CTL file under Fields Terminated By","(...)?
Please advise. Thank you. :)
A: The simplest way is to put columns in ctl file in the order used in data.
APPEND INTO TABLE TableB
FI... | |
doc_23497973 | Below is the structure of the table clicklog_20:
user_id bigint(20)
timecl time
action text
destination text
hotel text
I have written the query to give me the 10 most searched destinations with the following query:
select destination,count(*)
from clicklog_20
where destination is not ... | |
doc_23497974 | public void postData() {
// Create a new HttpClient and Post Header
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.yoursite.com/script.php");
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
... | |
doc_23497975 |
A: You can set the mix and max range after the initial load inside the chart.events.load callback and do a yAxis update with those values.
Demo: https://jsfiddle.net/BlackLabel/5c6fxsam/
chart: {
events: {
load() {
let chart = this;
chart.yAxis[0].update({
min: chart.yAxis[0... | |
doc_23497976 | When I change the screen orientation the language rests to default language and all views resets too.
public String setLocale(String lang) {
Locale myLocale = new Locale(lang);
Resources res = getResources();
DisplayMetrics dm = res.getDisplayMetrics();
Configuration conf = res.getConfiguration();
... | |
doc_23497977 | for i in range(69,96,1):
loztreeid = "loztree_" + str(i) + "_check"
driver.find_element_by_id(loztreeid).click()
time.sleep(0.5)
I need to click on the ID named loztree_69_check to loztree_95_check. While I'm trying with above code it gives me below error:
File "gpsdemo.py", line 41
driver.find_element_... | |
doc_23497978 | library(ggplot2)
library(modeest)
set.seed(9)
d1=as.data.frame(rnorm(1000,mean=0.33,sd=0.138))
names(d1)=c("value")
mean_d1=mean(d1$value) #Mean=0.33081
mode_d1=mlv(d1$value,method="shorth")[1] #Mode=0.35191
gg=ggplot(d1,aes(value))
gg +
geom_density()
This makes a graph like this:
Is there a wa... | |
doc_23497979 |
A: register.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>registion</title>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script>
$(function () {
$('#btn').click(function () {
$.post(
'checkU... | |
doc_23497980 | The hex String I have is "#9B9B9B" but it somehow needs to become the Int representation of the same color because in the project UIColor has an extension (see below) that requires (hexInt: Int) and the given hex codes in the project have a format such as 0x212120.
How can I convert any given hex string into an Int for... | |
doc_23497981 | I am trying to make a form which can validate and also display a default value at the start.
The problems I am facing:
*
*Once I add in the line "formControlName"=price, "formControlName"=description, "formControlName"=name, the value is no longer displayed on the screen.
Before adding the line "formControlName" Val... | |
doc_23497982 | Now I can't decide between Ant and Maven ore maybe there is a better tool?!
The tool should be easy to set up, and should run JUnit and SWTBot Tests.
Can you help me?
A: Tycho is a good way to build Eclipse plug-ins / applications :
Tycho is focused on a Maven-centric, manifest-first approach to building Eclipse plug... | |
doc_23497983 | I´m trying to aim something like <xsl:number level="multiple" format="1.1." count="someNode | document(@href)/someOtherNode"> but within the 'count' function it´s not possible to use the 'document()' function. Therefore there must be another way to access elements stored in other '.xml' - documents.
EDIT
For what I und... | |
doc_23497984 | So, here is a very simple data frame example:
df <- data.frame( id <- c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2),
p <-c(5,7,9,11,13,15,17,19,21,23,20,18,16,14,12,10,8,6,4,2 ),
q <-c(3,5,7,13,19,31,37,53,61,67,6,18,20,24,40,46,66,70,76,78))
colnames(df) <- c("id","price","quantity")
s... | |
doc_23497985 | Basically, it says to add a php file to the folder, then the hook will do an http request to execute the script.
My problem is that I am updating python scripts that are not in the /var/www folder, but rather in the /usr folder.
I don't want these files accessible via the web, so is there a way to execute a git pull re... | |
doc_23497986 | Put simply (and minimally), the problem I'm facing is the following:
private static IList<IDictionary<int, string>> exampleFunc()
{
//The following produces a compile error of:
// Cannot implicitly convert type 'System.Collections.Generic.List<System.Collections.Generic.Dictionary<int,string>>' to
// 'Sy... | |
doc_23497987 | CENPVP2 441495 9606 NR_033773.1 None NC_000023.11 None
CENPVP2 441495 9606 NR_033773.1 None NT_011630.15 None
CENPVP2 441495 9606 None None NG_022599.1 None
CT47A11 255313 9606 NM_173571.2 NP_775842.2 NC_000023.11 12477932
CT47A11 255313 9606 NM_173571.2 NP_775842.2 NC_000023.11... | |
doc_23497988 | Instead of putting all logic in the action itself, I'm thinking of abstracting it in an object, for the sake of extensibility. Example.
class Payment < ActiveRecord::Base; end
class VisaPayment < Payment
def process
...
end
end
class PaypalPayment < Payment
def process(controller)
...
controller.redi... | |
doc_23497989 | Plaintext: 0101001101010101010
Key: 01010010101010010101 //the longer the key, the longer unique sequence
XOR or smth: //result
Is this at least a bit how it works or am I missing something?
A: Cipher systems are generally a lot more sophisticated than the XOR system you have described. In fact, XORing o... | |
doc_23497990 | first_line
second_line
third_line
I want to copy text first_line to replace second_line and third_line. So after copy and replace, new content should be:
first_line
first_line
first_line
I do by: press viw for selecting first_line text. Then go to second line, press vi for selecting second_line text, then press p for... | |
doc_23497991 | <div class="four columns">
<h4>
<a id="OpenDialog" href="#" >Open dialog 1</a>
</h4>
<img src="one.jpg" />
<div id="dialog" title="Dialog Title 1">dialog text 1</div>
</div>
<div class="four columns">
<h4>
<a id="OpenDialog" href="#" >Open dialog 2</a>
</h4>
<img src="two.jpg" />
<div id="dialog... | |
doc_23497992 | HTML:
<div data-role="page" id="review-note" data-title="Review Note">
<div data-role="content" id="content">
</div>
Javascript:
$("<select name=\"slider\" id=\"flipMe\" data-role=\"slider\"><option value=\"off\">Off</option><option value=\"on\">On</option></select>").appendTo($("#content"));
A: Add .slider... | |
doc_23497993 | [Edit]: It seems like I can only use GL_TEXTURE0/texture unit 0 by some reason.
What I want is to draw a 2d texture and a 3d texture, but only the texture with texture unit 0(GL_TEXTURE_0) will work. And I use both of them at the same time in the shader I can't see anything using that shader.
This is the fragment shade... | |
doc_23497994 | int __cdecl sum(int a, int b)
{
return a + b;
}
I get the following disassembly listing:
int __cdecl sum(int a, int b)
{
004113B0 push ebp
004113B1 mov ebp,esp
004113B3 sub esp,0C0h
004113B9 push ebx
004113BA push esi
004113BB push edi
004113BC lea ... | |
doc_23497995 | For the older versions you will need to include the printer driver, is that correct? or there is a generic driver that works on most printers for older versions of android?
| |
doc_23497996 | socket.emit('ping'); gets called every 2 seconds in the client side but the server never responds to it before the next call (see screenshot below).
In the same screenshot we can see that pong was only received 24 seconds later (12x) after the first ping call. It says 1094 which is in relation the last ping call but it... | |
doc_23497997 | CREATE TABLE ALLTRX2 (
ORDER_CODE nvarchar(20) NOT NULL PRIMARY KEY,
CREATEDTS datetime NULL,
trx_date nvarchar(11) NULL,
trx_month nvarchar(8) NULL,
payment_provider nvarchar(255) NULL,
payment_method nvarchar(100) NULL,
general_payment_method nvarchar(100) NULL,
amount_initial NUMERIC(30,2) NULL,
eur_amount NUME... | |
doc_23497998 | page.open(address, function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit();
} else {
window.setTimeout(function () {
page.evaluate(function() {
document.getElementById('custom_filters').style.visibility = "hid... | |
doc_23497999 | I am computing the power spectral density(PSD) of two signals by taking the FFT of the autocorrelation, and I want to compare the the results. Since the signals are of different lengths, I am worried if I don't fix nfft, it would make the comparison really hard!
A: There is no inherent reason to use a power-of-two (it... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.