id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_10500 | How many files : 9
Ip range : 100
I want to divide the ip range 100.0.0.0 - 100.255.0.0 to 9 files 1.txt , 2.txt ... etc
and write the result into those files ... and for the remainder i want to write them in the last file
Result :-
File1:
100.0.0.0
100.1.0.0
100.2.0.0
100.3.0.0
...
100.27.0.0
File2:
100.28.0.0
...
1... | |
doc_10501 | public AccountController()
: this(Startup.UserManagerFactory(), Startup.OAuthOptions.AccessTokenFormat)
{
}
In Startup.Auth.cs I see
UserManagerFactory = () =>
new UserManager<IdentityUser>(new UserStore<IdentityUser>());
Seems like the implementation of UserStore comes fro... | |
doc_10502 | Controller:
class TagLibTestController {
def dateTest() {
def Date date=new Date()
date.setTime(1379874600000)
render date
}
}
TagLib:
class DateTagLib {
def dateFromNow = { attrs,body ->
def date = attrs.date1
println "DateTagLib"
def niceDate = getNiceDate(date)
out << niceDate
}
Stri... | |
doc_10503 | now the measurements I use to construct the model is in Kilometers (1000 meters).
my question is: what is the best approach to construct the vertices:
A- using the Kilometers such as (1000,1500,0).
B- using the standard scale such as (1,1.5,0).
Thanks
A: I use the approach A because you will be using floats. If you us... | |
doc_10504 |
*
*Domain models (Model)
*Database entities (Entity)
*Repository: that accepts the model and converts it to the database entity (using automapper) and saves it to the database. In some cases returns back a Model object.
Example:
public class BaseRepository<T, U> : IRepository<T, U>
{
public void Insert(... | |
doc_10505 | private String username = "root";
private String password = "root";
private String classname = "org.postgresql.Driver";
private String url = "jdbc:postgresql://localhost:5432/bd";
To be clear, I want to obtain user and password from user input, not to hardcode them.
A: If you only need a connection for some given use... | |
doc_10506 | {"ClientID":"xxxx.xxxxxxxx.xxxx","ClientSecret":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx","RedirectURL":"","GrantToken":"GRANT token","RefreshToken":null,"AccessToken":null,"ExpiresIn":null,"UserMail":null,"Id":null}
When I retrieve the blob, it appears I am only getting the meta-data and the Content element is blank. Here is ... | |
doc_10507 | I have an old app from dev that now isn't working in our company. I need to start this app but don't have enough experience in NodeJS (I don't have it at all, TBH).
The problem is: I can build a docker image, start it, and use the app, but when I make something that requires to make a request to MQSQL server, the app c... | |
doc_10508 | But now, no matter what I change, there's no way to change the font. It just loads with Times New Roman.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900" rel=... | |
doc_10509 | Here's how the screen looks with the selection under a particular menu :
And here's the selection again after opting a different menu :
I tried, accessing the store and clearValue() and setValue('') which is not right solution and I was not able to access the selecitonModel to perform clearSelections() here.
How do I... | |
doc_10510 | This my servlet:
@WebServlet("/UpdateDetails")
public class updateDetails extends HttpServlet
{
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
<br/>
String name=request.getParameter("appName");<br/>
... | |
doc_10511 | Here's my code
#include <stdio.h>
#include <string.h>
#define maxname 40
#define maxlength 70
int acceptSize()
{
int sizeOf;
printf("How many students?");
scanf("%d",&sizeOf);
return sizeOf;
}
void acceptNames(char names[maxname][maxlength],int size)
{
int ctr;
for(ctr=0; ctr<size;... | |
doc_10512 |
A: Why it fails?
It turns out that with default express settings:
*
*call to /?x[20]=20 results in req.query.x = [ '20' ], while
*call to /?x[21]=21 results in req.query.x = { '21': '21' }.
The second request wasn't passing the validation because we were expecting an array instead of an object.
The reason behin... | |
doc_10513 | g++ -W -Wall -Wpointer-arith -pipe -O3 -g -Wno-uninitialized -fno-implicit-templates -DACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_REENTRANT -I/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers -DACE_HAS_EXCEPTIONS -L/home/vwickram/Ubuntu_Release/tmp/ACE_wrappers/ace -L./... | |
doc_10514 | svyby(~V34c,~V4, design = data, svymean, na.rm=T,vartype=c("ci","se"))
yields the expected output in general form:
[Country, Neither agree nor disagree, V34cNo data, V34cOverall Agree, ...]
AU-Australia, 0.31459269, 0.0425825851, 0.2935771 ...
BE-Belgium, 0.31884528, 0.0895231917, 0.2024003 ...
BG-Bulgaria, 0.2923715... | |
doc_10515 | <img src="{% static 'images/{{i.sideid.sidepic}}' %}"/>
But this doesn't load the picture...
However, if I change the {{i.sideid.sidepic}} to the picture name "republic.png" it works tho. So, yeah, {{i.sideid.sidepic}} is actually the exact same name ("republic.png"), because I do a print in django views and shows it ... | |
doc_10516 | I'm getting the following errors on run:
Build command failed.
Error while executing process /home/anubhav/Android/Sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/home/anubhav/AndroidStudioProjects/template/app/src/main/jni/Android.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEB... | |
doc_10517 | Two web App/API application was register on azure AD. When i try to use 'Settings->RequiredPermissions->Add->Select an API' i not see my created application in list.
Same problem for old azure portal described on Granting native application access to web application
But new portal not fixed with previous solution.
Coul... | |
doc_10518 | Tried !important but not working, the text is still yellow.
<!DOCTYPE html>
<html>
<head>
<style>
.myclass {
background-color: yellow ;
}
</style>
</head>
<body>
<p class="myclass" background-color="red !important">This is some text in a paragraph.</p>
</body>
</html>
A: if you want use inline styles (not good... | |
doc_10519 |
A: It's enough to store only one list of boundaries. You can use bisect_right find the index of left boundary of the interval and then index + 1 is the right boundary:
import bisect
def find(num, boundaries):
if boundaries[0] < num < boundaries[-1]:
index = bisect.bisect_right(boundaries, num)
ret... | |
doc_10520 | class EditUserForm(forms.Form):
password1 = forms.CharField(max_length=45, label='', required=False,
widget=forms.PasswordInput(attrs={'placeholder': 'Пароль',
'class': 'form-control', }))
password2 = forms.CharField(max_length=45, label='', required=False,
widget=forms.PasswordInpu... | |
doc_10521 | script/generate scaffold car name:string
I'm looking to create an application which will connect to this using REST and AJAX to create new car names. However, I want this application to be separate from the application which I created in Rails to actually hold the car names, and I don't want to write it in Rails. I ju... | |
doc_10522 | dataForTree = "var data=" + sb.ToString() + ";";
Then I pass this to my tree by using RegisterClientScriptBlock, like this:
if (!Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "allData"))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "allData", dataForTree, true);
}
And on my clie... | |
doc_10523 | library(dplyr)
## data
dat <- data.frame(grp = c(1, 1),
day = c("M", "F"))
## this doesn't work
dat %>%
filter(grp != 1 & day != "M")
## solution but ugly
dat %>%
filter(paste0(grp, day) != "1M")
A: Using setdiff
dat %>%
setdiff(dat %>% filter(grp == 1, day == 'M'))
| |
doc_10524 | Config akkaConf = ConfigFactory.load();
ActorSystem actorSystem = ActorSystem.create("myApp", akkaConf);
TypedProps<Actor1Impl> actor1TypedProps = new TypedProps<Actor1Impl>(Actor1Interface.class, new Creator<Actor1Impl>(
public Actor1Impl create() {
return new Actor1Impl(nonDefault, constructor, scalaIsSo... | |
doc_10525 | You must restart adb and Eclipse.
Please ensure that adb is correctly located at '/home/ASDK/platform-tools/adb' and can be executed
WHAT SHOULD I DO?
A: this question was raised by me and here I am explaining my experience.
Actually this question was raised when one of my friend was trying to setup android on his lap... | |
doc_10526 | When a class is full then you can see "Waitlist Only" content. Previously Book Button is shown for "Waitlist Only". So When the document is ready, I wrote code to hide the button and instead append anchor tag with Wishlist as content. But the problem is that sometimes only after Force page refresh the wishlist button i... | |
doc_10527 |
A: Alex's answer is correct. You can use
<item name="android:windowTranslucentNavigation">true</item>
Another option is to use
<item name="android:windowBackground">@android:color/transparent</item>
A: In your theme add the following line:
<item name="android:windowTranslucentNavigation">true</item>
Romain Guy ha... | |
doc_10528 | I tried to run it on 127.0.0.1:5000 but it gave me a Internal Error.
Then I checked the error_log, which telled,
File "/var/www/html/flaskr/flaskr.py", line 66, in show_entries (model,sn,user,status))
OperationalError: no such table: entries "
Here are my codes:
app = Flask(__name__)
app.config.from_object(__name__)
a... | |
doc_10529 | async getAllDrives(token) {
let nextPageToken = ""
let resultArray = []
const config= {
headers: {
Authorization: `Bearer ${token}`
}
};
const bodyParams = {
pageSize: 2,
fields: 'nextPageToke... | |
doc_10530 | from abc import ABCMeta, abstractproperty
class abstract(object):
__metaclass__ = ABCMeta
def __init__(self, value1):
self.v1 = value1
@abstractproperty
def v1(self):
pass
class concrete(abstract):
def __init__(self, value1):
super(concrete, self).__init__(value1)
@p... | |
doc_10531 | $.ajax({
type: "POST",
datatype: "json",
url: "processdraw.php",
data: {
json: pDrawnTeams
},
contentType: "application/json; charset=utf-8",
success: alert('worked')
})
A: If you are not getting any error in your javascript, make sure that you are getting that parameter like this ... | |
doc_10532 | https://github.com/tensorflow/models/blob/master/tutorials/rnn/ptb/ptb_word_lm.py
def _build_rnn_graph_cudnn(self, inputs, config, is_training):
"""Build the inference graph using CUDNN cell."""
inputs = tf.transpose(inputs, [1, 0, 2])
self._cell = tf.contrib.cudnn_rnn.CudnnLSTM(
num_layers=config.num_layers,
... | |
doc_10533 | struct A { ... }
struct B : A { int more; }
void Method(A a) { ... }
It works like this: You pass an instance of B into Method, then in the body cannot access the more field anymore?
I tried to remember the name of this, but I can't. Doing a search on Google just gives me nothing else.
Can anyone please give me the n... | |
doc_10534 | > Task :assembleArtifact
> Task :application-jar:compileJava UP-TO-DATE
> Task :application-jar:processResources UP-TO-DATE
> Task :application-jar:classes UP-TO-DATE
> Task :application-jar:jar SKIPPED
> Task :generateMetadataFileForMavenJavaPublication FAILED
FAILURE: Build failed with an exception.
* What went wro... | |
doc_10535 | FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(Environment.getExternalStorageDirectory().getPath()+ "/MyApp/Media/test-ffmep.mp4", w, h);
public void offerEncoder(Bitmap input)
{
recorder.record(opencv_highgui.cvLoadImage(input));
//recorder.record(opencv_highgui.cvLoadImage("/sdcard/MyApp/Media/" + i... | |
doc_10536 | So in here,if user enters show me computer engineering,user directed to the ShowComp class.
But using if-else makes code really unreadable.I thought that I can put these keywords to dictionary
But this time context.Call gives an error about the value type.What should I put dictionary value type.I couldn't figure it out... | |
doc_10537 | OS: updated Linux Mint 19 and 4.17.2-ext73-57.2 kernel.
I have tried to compile a few sources (e.g. official LineageOS source) and everytime I got that:
WARNING: vmlinux.o(.data+0x10f40): Section mismatch in reference from the
variable gdsc_driver to the (unknown reference) .init.data:(unknown)
The variable gdsc_drive... | |
doc_10538 | However, when I create an instance of MyClass in the test, I need to specify what T is supposed to be.
I can do it like that:
var sut = new MyClass<Object>();
It works of course, however, I don't like to put Object specifically, because it suggests to someone reading this test that maybe Object type is somehow signif... | |
doc_10539 | here is my code,
views.py:
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from .models import Item, Tender
from django.urls import reverse
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import login, logout, authenticate
from dja... | |
doc_10540 | I need to find somthing inside the pages alle links there have a kind of match and after that the hole url to return.
My link can look link this href="http://example.com/page/subpage/unik-id-12345" and i have trying to wirte a small regex to get a sample out.
href\=\"(.*)\">
The problem is its taken everything inside,... | |
doc_10541 | I am using telnet to open the socket and send data to the server. However, the server only displays that it's listening, but doesn't echo any of the data I type through telnet or signify that there is an incoming connection. I shut off Windows firewall for private networks and still...nothing.
Also tried seeing if th... | |
doc_10542 | Upon selection of the load demo data checkbox it give a internal server error. The console fails on some demo file in sale..
ParseError: "decoder jpeg not available" while parsing /home/username/odoo/openerp/addons/base/base_demo.xml:38, near
<record id="user_demo" model="res.users">
<field name="partner_id... | |
doc_10543 | uuid|some_data
"A" |"ABC"
"B" |"DEF"
I need to convert this into a nested JSON of below format,
{"data":[{"attributes":[{"uuid":"A","some_data":"ABC"}]}]}
{"data":[{"attributes":[{"uuid":"B","some_data":"DEF"}]}]}
I tried the below code to achieve this,
val jsonDF= dataFrame.select(
to_json(struct(dataFrame.columns... | |
doc_10544 |
But my first column in excel is dates, and gets formatted to numbers in the word template. Any advice for a newbie in Jinja on how to format only a particular column to dates?
I haven't really tried anything else as I'm uncertain on how to proceed.
| |
doc_10545 | the code is :
const Attendance = () => {
// Declare state variables
const [students, setStudents] = useState([]);
const [numStudents, setNumStudents] = useState(0);
// Function to add a student to the attendance list
const addStudent = (rollNumber, name) => {
setStudents(
students.concat({
... | |
doc_10546 | .element1,
.element2,
.element3,
.element4,
.element5,
.element6 {
font-weight:bold;
}
is there anything similar in jQuery or would I have to set each separately.
$('.element1').css('font-weight', 'bold');
$('.element2').css('font-weight', 'bold');
$('.element3').css('font-weight', 'bold');
etc
I suppose I imagine s... | |
doc_10547 | My question is how I can redirect automatically to auth0 login if I'm not logged in yet (without using the Login button from their example)?
I have tried to inject auth service in app.module and verify if I'm logged in, but it fails because I've entered into an infinite loop.
I think that I have to wait somehow for aut... | |
doc_10548 |
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/20151012/php_pdo_mysql.dll' -
/usr/lib/php/20151012/php_pdo_mysql.dll: cannot open shared object
file: No such file or directory in Unknown on line 0 PHP Warning:
require(/home/fabio/Documentos/Digital_Dreams/appintervalo/bootstrap/../vendo... | |
doc_10549 | So, I have a class LiveOrderBook extends Observable and two methods inside that update the price:
public void setDailyLow(double price){
low = price;
setChanged();
notifyObservers(low);
}
public void setDailyHigh(double price){
high = price;
setChanged();
notifyObservers(high);
}
I need to obs... | |
doc_10550 | <pe:documentViewer id="documentViewer" height="380"
value="#{myBean.fileContent}" />
and in Bean:
byte[] downloadedFile =handleFileDownload(id);
fileContent = new DefaultStreamedContent(new ByteArrayInputStream(
downloadedFile));
Using this code I am able to view the PDF files, but how do... | |
doc_10551 | One of the answer suggested to use shared_ptr to guarantee the lifetime when multiple static objects access the singleton object. I noticed that shared_ptr here is constructed using new and is returned by value.
Is using new for shared_ptr construction atomic/thread_safe?
My second confusion is regarding RVO. I tried ... | |
doc_10552 | I write code below, however ContextMenu.IsOpen is not changed:
<ToggleButton x:Name="btnRegularButton"
Content="Regular Button">
<ToggleButton.Style>
<Style TargetType="ToggleButton">
<Style.Triggers>
<Trigger Pr... | |
doc_10553 | The flow seems really straight forward for me except one section of it.
A player (lets call him James) wants to invite another player (lets call her Tina), James' request generates a unique link that Tina can click (put aside the sharing method for a moment) and when Tina clicks it she is referred to the app store to d... | |
doc_10554 | Note: holesPlayed is an instance variable assigned the value of 0
Here is what i have:
public boolean recordStrokes(int holeNumber, int strokes) {
if ((holeNumber >= 1) && (holeNumber <= Course.NUM_OF_HOLES)
&& (holeNumber == holesPlayed + 1)) {
scores[holeNumber -1] = strokes;
holesPlayed... | |
doc_10555 | If the user has made any changes, without submitting them, pressing the "Ok" button should generate a MessageBox to guide the user into submitting his/her changes. This is where my problem occurs.
I made the "Ok" button trigger an event buttonOk_Click that checks for changes. The issue here is that since the "Ok" butto... | |
doc_10556 | I am unsure if I can have CourseRegistration and ClassRegistration table like that. The reason why I made it like that is, a student can register for a course but doesnt register to a class directly. so they can wait few days and then only register. So I have to make sure the course registration is saved in the databas... | |
doc_10557 | function scan(params, total, callback) {
dynamo.scan(params, function(err, data) {
if (err) {
callback(err, data);
} else {
if (((!params.Limit || (params.Limit && total.length < params.Limit)))
&& data.Items && data.LastEvaluatedKey) {
par... | |
doc_10558 | var express = require('express');
var mysql = require("mysql");
var app = express();
var connection = mysql.createPool({
connectionLimit: 50,
host: "localhost",
user: "root",
password: "",
database: "sakila"
});
app.get('/', function(req, res){
connection.query('SELECT * FROM actor', function(err, rows) ... | |
doc_10559 | import numpy as np
import random
def rand_data(integ):
'''
Function that generates 'integ' random values between [0.,1.)
'''
rand_dat = [random.random() for _ in range(integ)]
return rand_dat
def weighted_dist(indx, x_coo, y_coo):
'''
Function that calculates *weighted* euclidean distance... | |
doc_10560 | my_name = "Melanie"
puts "My name is #{my_name}."
Outputs:
"My name is Melanie."
However, I don't understand why I can't just use a variable as above. I must be very much misunderstanding the usage of the format() function. (I'm a novice, please be gentle.)
So what does format() actually do?
A: You can definitely use... | |
doc_10561 | I'm trying to use the csv-stream library and can get the datas in console, but how to do an import to postgresql no idea.
var csvStream = csv.createStream(options);
fs.createReadStream(process.argv[2]).pipe(csvStream)
.on('error', function (err) {
console.error(err);
})
.on('data', function (data) {
// outputs an... | |
doc_10562 |
In iOS 4 and later, apps can use the data protection feature to add a
level of security to their on-disk data. Data protection uses the
built-in encryption hardware present on specific devices (such as the
iPhone 3GS and iPhone 4) to store files in an encrypted format on
disk. While the user’s device is locked... | |
doc_10563 |
module Custom
class Item
attr_accessor :name
def initialize(name)
self.name = name
end
end
end
custom_item = Custom::Item.new("Bill")
User.where(:name => custom_item)
is there anything I can define in custom_item, so it would understand that Arel wants name from it?
Currently I workaround with... | |
doc_10564 |
A: It seems that Spring 4.1 will add this support: https://spring.io/blog/2014/07/28/spring-framework-4-1-spring-mvc-improvements
| |
doc_10565 | Here is a simplified version of the code that demonstrates this bug.
#include <iostream>
#include <vector>
class foo{
public:
foo(std::string n);
std::string getName();
void bar(std::vector<foo> &a);
private:
std::string name;
};
foo::foo(std::string n){
name = n;
}
std::string foo::getName(){
... | |
doc_10566 | lbu $t0, 0($t1)
sw $t0, 0($t2)
Assume that the register $t1 contains the address 0x1000 0000 and the register
$t2 contains the address 0x1000 0010. Note the MIPS architecture utilizes
big-endian addressing. Assume that the data (in hexadecimal) at address 0x1000
0000 is: 0x11223344. What value is stored at the addres... | |
doc_10567 | He wants 3 types of payments
*
*Individual course - one simple payment
*Subscription each year
*2 payments of x euros on first month and then on second month
How can I cancel/stop after 2 months the third subscription?
A: The best option is to use SubscriptionSchedules. They allow control of multiple "phases" on ... | |
doc_10568 |
An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll
Additional information: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.
Any help is immensely appreciated.
A: I got the same problem.
I think the default value h... | |
doc_10569 | Maybe someone has articles where this is described or can someone suggest with an example?
A: Here is a list of similar tools you could try:
*
*MeSema relies on IDA Pro to disassemble a binary file and produce a control flow graph. Then it can convert the control flow graph into LLVM IR.
*llvm-mctoll is easy to use... | |
doc_10570 | Traceback (most recent call last): line 161, in <module> main()
line 28, in main print(tama.__dict__)
AttributeError: 'list' object has no attribute '__dict__'
This is part of my code:
import pickle
class Tamagotchi:
def __init__(self, size, color, previous_actions):
self.size = size
self.color... | |
doc_10571 | I have a question related monitoring system for container.
Below picture has my thinking for monitoring.
I'd like to run monitoring combination(Grafana,Heapster,InfluxDB,cAdvisor) on baremetal as a daemon process instead of running in containers.
When i configure those 4 units...i got the error below.
It might be come... | |
doc_10572 | The SVG interface is a family tree design. The size of the text in the tree has to be 11px due to the amount of names needed to be shown. So the text is very small. However it is created using the SVG element. Therefore it should scale without issue.
My first attempt was at using a WebView to display the SVG. I later ... | |
doc_10573 | See bottom of question for printscreen.
I searched a lot for some information on this change of behavior, if that's by design now, in case we'd have to handle this in code, but can't seem to find anything regarding this. What would be the API way to deal with this ?
A: Looks like it's partly been fixed in the weekly ... | |
doc_10574 | class GenerateClicked(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Generated BOM")
self.set_border_width(10)
self.set_default_size(900, 1000)
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
# box_pass = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL... | |
doc_10575 |
public static Connection getConnection(){
Connection con=null;
String db_source="databasesource";
String db_username="username";
String db_password="password";
if(con==null)
{
try {
Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();... | |
doc_10576 | For inserts/updates this works fine, but the deletes are problematic:
When something, like a customer gets deleted, the customer is removed from the customer table and moved into a customer_deleted table.
So I thought: I can listen on both tables to get the inserts, updates and deletes.
Then I would write a Kafka strea... | |
doc_10577 | The code:
<%= select_tag "Choice", options_for_select(["Yes","No"]), :include_blank => true %>
In my model project.rb I define a attribute called flag like this.
attr_accessor :flag
attr_accessible :flag
Coulde anyone tell me how to get the selected value "Yes" or "No" and set the value to flag?
Thanks in advance!
A... | |
doc_10578 | something like:
begin
{ idle time detection code goes here}
showmessage('you have not browsed any websites or downloaded/uploaded
for over xyz seconds');
end;
thanks in advance
A: Internet idle time, or network idle time? For network you can periodically check outgoing packets and reset the idle time variable.
A: ... | |
doc_10579 |
A: Regular expressions
"Hello world".match(/world$/)
A: I had no luck with the match approach, but this worked:
If you have the string, "This is my string." and wanted to see if it ends with a period, do this:
var myString = "This is my string.";
var stringCheck = ".";
var foundIt = (myString.lastIndexOf(stringCheck... | |
doc_10580 | class TimestampField(Field):
def to_representation(self, value):
if not value:
return ''
return value.timestamp()
And I use it like this in my serializer:
class ArticlePhotobookSerializer(ModelSerializer):
delivery_date_from = TimestampField()
delivery_date_to = TimestampFiel... | |
doc_10581 | And there is the problem: Since the approvals take place within the Docs document, the authorization for the script must take place again for each new file. Without it e.g. no eMails are sent.
Is there a way to e.g. copy the permissions of the original template file or to do this in a different way?
Since in our compan... | |
doc_10582 | I probably didn't include enough code, as I am very new to MVC Authentication and have a poor understanding of how all the pieces fit together. if I need to include more code please let me know which pieces would be useful. Thank you!
public static AdminAppUserManager Create(IdentityFactoryOptions<AdminAppUserManager>... | |
doc_10583 | I changed the code a little bit to get a placeholder.
This is my code:
<select id="provider" name="provider" required="">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<script>
$( function() {
$.widget( "custom.combobox", {
_create: function() {... | |
doc_10584 | Php page
<?php
mysql_connect("127.0.0.1","android_project","mypassword");
mysql_select_db("android_project");
mysql_query("SET NAMES 'utf8_turkish_ci'");
$q=mysql_query("SELECT * FROM product");
while($e=mysql_fetch_assoc($q))
{
$output[]= $e;
}
header("Content-type: application/json; charset=utf8_turkish_ci");
pr... | |
doc_10585 | e.g.:
User.createCriteria().list{
or{
eq('username',user.username)
eq('name',user.name)
}
}
But, i need this to be configurable in my use case so, i try this code snippet.
def criteriaCondition= grailsApplication.config.criteriaCondition?:{user->
or{
eq('username',user.us... | |
doc_10586 | var btn = $("#btn");
btn.attr("disabled","disabled");
$("#table tbody").on("click",".clickable-row", function (e) {
if (e.target.type !== 'checkbox') {
$(':checkbox', this).trigger('click');
if($(':checkbox', this).is(":checked") == true){
btn.removeAttr('disabled');
... | |
doc_10587 | So I need help in creating a Treeview Menu with Dynamic Tabs based on the Tree Node Selected. Please Help
| |
doc_10588 | This is the simple code:
// Define the date I want to check
var targetDate = "2015-02-04T13:30:00Z";
// Parse the string into a date object
var target = new Date.parse(targetDate);
// Compare the target date againt a new date object set to 18:00:00
if(target < new Date().setHours(18 , 0, 0)){
... | |
doc_10589 | ||
doc_10590 | Basically I just need the code to
*
*Step through all h3s on the page and get the ID and the text.
*Create links to each of the h3s using the ID and text <a href="#id">Text</a>
Here's the code I've tried:
$(document).ready(function() {
setTimeout(() => {
// Get ToC div
toc = document.getElementById("ToC");... | |
doc_10591 | What I did is (all in Java):
*
*Generate the charts using JFreeChart
*Convert the chart into a JPG image using: ChartUtilities.saveChartAsJPEG
*Then I retrieve theimage bytes:
The code:
InputStream is = null;
try {
is = new FileInputStream(image);
}catch (FileNotFoundException e) {
e.printStackTrace();
}
b... | |
doc_10592 | I get EOF always at the same position (usually 4096) in the files I want to copy (even though the end of the file is clearly not reached yet when I compare the EOF position with the file size).
Here is the program I made:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
int main(int argc... | |
doc_10593 | <head>
</head>
<body>
<form action="" method="POST">
<input type="submit" name="submit">
</form>
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_er... | |
doc_10594 | #include <iostream>
#include <cstdlib>
#include <vector>
using namespace std;
int main()
{
vector<int> fib;
vector<int> sum;
int n = 0;
int total = 0;
cout << "Enter a number." << endl;
cin >> n;
total = n;
fib.push_back(1);
fib.push_back(1);
for(int i = 2; i <= n; i++)
{
fib[i] = fib[i-1]... | |
doc_10595 | const animalSchema = new Schema({
name: String,
type: String,
tags: { type: [String], index: true } // field level
});
animalSchema.index({ name: 1, type: -1 }); // schema level
A: When developing your indexing strategy you should have a deep understanding of your application’s queries. Before you ... | |
doc_10596 | I can't find anything online around how to do this, and even FileReader doesn't seem to support it.
I have tried to download using solutions that work consistently in Chrome on iOS and Safari on iOS.
Edit: Edge on iOS uses Safari's rendering engine, so any IE11 or Edge on Desktop focused solutions will not work here.
... | |
doc_10597 |
*
*one of the numbers
*the size of my array
*the min and max values possible for the numbers
I’m working with a music app and have an algo problem:
When mixing different rhythms (each with a different number of steps), I need to compute the resulting number of steps for the result to loop. This is done easily wi... | |
doc_10598 | while a==True:
b=b+1.5
print("Something: "+str(b))
time.sleep(5)
clear() #I defined a clear function to clear the screen
while a==True:
print("Something!") #here is the nonoperating part and I tested it doesn't gets cleared by clear function
A: I assume you want both loops to run concurrently. ... | |
doc_10599 | client_api = boto3.client(service_name='apigatewaymanagementapi')
After a lot of research, I found that local boto3 version is 1.9.119 and AWS boto3 version is 1.9.42. I am not too sure if this is the root cause for the issue.
I have tried installing boto3 in venv target and used that reference. No matter what, code ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.