id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23528200 | How is that possible?
A: The factorial operation is only defined for non-negative integers. The Java way to handle this would be to simply throw an IllegalArgumentException on a negative input:
public static int factorial (int n) {
if (n < 0) {
throw new IllegalArgumentException ("n must be non-negative");... | |
doc_23528201 | It's inconveniencing my workflow, and unfortunately I don't see any extensions in the marketplace for exactly this. I am quite happy to find out how to make extensions (specifically Beautify and Emmet) run on other weird file formats.
A: You can add this on your settings.json.
"emmet.syntaxProfiles": {
"smarty": "... | |
doc_23528202 | Here are some commands:
kubectl get events
60m Normal SuccessfulCreate replicaset/frontend-r0ktmgn9-dcc95dfd8 Created pod: frontend-r0ktmgn9-dcc95dfd8-8wn9j
36m Normal ScalingReplicaSet deployment/frontend-r0ktmgn9 Scaled down replica set frontend-r0ktmgn9-6d57cb8698 to 0
36m ... | |
doc_23528203 | Here is an implementation of an the inner loop that bubbles the value to the top:
def pass(xs:List[Int]):List[Int] = xs match {
case Nil => Nil
case x::Nil => x::Nil
case l::r::xs if(l>r) => r::pass(l::xs)
case l::r::xs => l::pass(r::xs)
}
My issue is with case Nil => Nil. I understand that I need this is b... | |
doc_23528204 | Now, I want to write a separate backend in Django Rest framework in order for the users to be able upload the house pictures for their houses.
Will it be possible to do that? To be more specific, my thought is to connect to that SQLAlchemy database and whenever the user types a url (.../user34/house55/) my code trigger... | |
doc_23528205 | Since the referential integrity of my legacy database is kinda crappy, I'd like to know if there's a workaround or if there's an alternative mapping I can use.
Example:
//no query when loading the entity
References<User>(x => x.User, "UserId").LazyLoad().Nullable();
//performs a hundred queries when I load my entities... | |
doc_23528206 |
A: If you want to share properties between projects use property sheets (.props files). In those you can set the include directories and library locations (and additional properties if necessary).
If you want to use the libraries in another project you only have to add the property sheet to it.
You can find a detaile... | |
doc_23528207 | Question: is there a way to dynamically have the pivot update its target range to the active worksheet and not the last sheet you copied it from?
my goal is to get something like
=activesheet!$a$1:$b:$2
why I'm asking this question: I never really liked pivot tables, always thought they were a waste of time, but since... | |
doc_23528208 | <a4j:commandButton id="editAlarm" immediate="false" execute="@this" actionListener="#{cfsBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}"
action="#{addFeaturePopUpBean.updateCfsGroupFeature(itemsComp,tableIndex.index)}" >
and Bean have this code
public Stri... | |
doc_23528209 | HTML
<div id="yourcontroller" ng-app="" data-ng-controller="mainController" data-module="yourcontroller">
</div>
And inside my run I'm trying to call the controller function like below
angular.module('modulename', [])
.controller('myCtrl', ['$scope', '$window', function ($scope, $window ) {
$scope.yourContro... | |
doc_23528210 | the base table:
ID COLUMN_NAME VALUE ROW_INDEX
017QZ Course Completion Confirmed? Yes 1
017QZ Course Completion Confirmed? Yes 2
017QZ Course Type A&S 1
017QZ Course Expiry Date 04/30/2021 1
017QZ Co... | |
doc_23528211 | for file in *.info; do
gz_file="${file:(-4)}" # wrong... what is right?
# gz_file=`echo "$file" | sed -e 's/.info//'` # easy alternative I'm trying to avoid
if [[ ! -f "${gz_file}" ]]; then
rm "${file}"
fi
done
I realize this can easily be done with sed, as shown in the commented-out... | |
doc_23528212 | 1. Open popup on homepage load.
2. Popup should be in center for all browsers.
3. Popup should be fade in.
4. Should open only one time for one user.
this is my test website http://popuptest.mybigcommerce.com/
So far Popup opening, For me popup in center and looks fade in working. but session not working .
Below is the... | |
doc_23528213 | NOTE: I am on a shared hosting plus no frameworks.
| |
doc_23528214 | for(int i=0; i<[mutableTempArray count]; i++){
//...
[tempInfoDictionary setValue:i forKey:@"tag"];
//...
}
The warning is:
passing argument 1 of 'setValue:forKey:' makes pointer from integer without a cast
What am I doing wrong here?
A: Collections in Objective-C can only hold objects, so you'll need to wra... | |
doc_23528215 | def post(self):
while True:
try:
data = pickle.loads(self.sock.recv(1024))
print data[0] % tuple(data[1])
except (socket.error, EOFError):
break
I then have a GUI that redirects stdout to a textctrl like so:
import wx
import sys
import threading
class Redirect... | |
doc_23528216 | Here is what I have so far:
function flyToLocation() {
var place = autocomplete.getPlace();
var geometry = place.geometry;
var location = geometry.location;
var viewport = geometry.viewport; // {fa: {b: 70, d: 40}, la: {b: 27, d: 179}}
var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_G... | |
doc_23528217 | void CRestoreSettingsDlg::OnSize(UINT nType, int cx, int cy)
{
CResizingDialog::OnSize(nType, cx, cy);
m_gridBackupLog.ExpandLastColumn();
}
Why is it being flagged?
C26434 Function 'CRestoreSettingsDlg::OnSize' hides a non-virtual function 'CRestoreDialogDlg::OnSize'.
As you can see, I call the base class... | |
doc_23528218 | I have tried lots of solutions on the net and lots more but no luck so far. Can anyone help me ?
Why doesn't this script show anything ? How do i display the custom field "prijs" ?
<?php
function showdetails_shortcode( $attr, $content = null ) {
return <?php $key="prijs"; echo get_post_meta($post->ID, $key, true); ... | |
doc_23528219 | What is the question asking for? The topic is discrete mathematics.
A: The notation f : A → B means "f is a function whose domain is A and whose codomain is B." Intuitively, this means that f takes as input an element of A and produces an output that's an element of B.
In C, for example, this would be like the functio... | |
doc_23528220 | I try to retrieve data from local SQL Server. The connection is right, and so is the stored procedure. But when I read rows from the SqlDataReader, it is empty. But when I watch the SqlDataReader, there is something with ? inside, but is not the result.
The SQL query works fine in SQL Server Management Studio.
Here is ... | |
doc_23528221 | I didn't find any resource on youtube about this, they just let the user do the normal login and use the current_user.is_authenticated to access the admin page
any tips from flask_security to let that happen
| |
doc_23528222 | in the documentation: https://wiki.duraspace.org/display/DSDOC18/XMLUI+Configuration+and+Customization#XMLUIConfigurationandCustomization-AdditionalXMLUILearningResources
IT is not clear how the order of the aspect is determined, hence how they are actually chained.
I red in a doc of 2005 that Manakin Developer Guide,... | |
doc_23528223 | this list will upload to Zabbix item by string or (you suggest), and I want to ask can Zabbix read this list and generate problems according the list.
For example, list[1] -> problem 1, list[2] -> problem 2
A: It seems like you might want to create a custom LLD rule. This will require formatting your list in JSON acc... | |
doc_23528224 | methods: {
renderAnswers() {
let answers = this.question;
let newAnswers = answers.map((isAnswer) => ({
answers: isAnswer,
}))
console.log(newAnswers);
},
async createQuiz(quiz, question) {
try {
let add = await axios.post("http://localhost:3000/v1... | |
doc_23528225 | The response the API Server is supposed to give me should look something like below:
{
"email": "example email",
"euid": "example euid",
"leid": "example leid"
}
However, I don't get any response or error message from the server. I do get false when I use var_dump.
Here is my code:
$api_url_str = "https:/... | |
doc_23528226 | On click on logout button I call
siteminder.xxx.it/siteminderagent/xxx-logout.fcc/
and the first logout makes these calls
302 HTTP siteminder.xxx.it /siteminderagent/xxx-logout.fcc/ 313 no-store text/html; charset=iso-8859-1 iexplore:40080
302 HTTP xxx.yyy.it /client-web 461 no-store text/html; ... | |
doc_23528227 | i did come across Membership.GetUser but i can't figure out how to use it.
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult AccountInfo([Bind(Include = "UserName, Address, Region, Email, Phone")]UserProfile UserProfile)
{
if (ModelState.IsValid)
{
... | |
doc_23528228 | Below is the assets part of my pubspec.yaml file
assets:
- assets/
- assets/images/
Using VSCode and it shows any images I reference or if I mouse over the reference it shows the images.
@protected
Future<ui.Codec> _loadAsync(AssetBundleImageKey key, DecoderCallback decode) async {
ByteData data;
/... | |
doc_23528229 | Possible Duplicates:
Adding rows to a table with jQuery
Jquery and adding row to table.
I currently have a table that has one row and with this table row, I have five cells where a user can place in required information.
What I would like to achieve is a means of having an "Add Row" button using jQuery, by where the ... | |
doc_23528230 | <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>signing</id>
<goals>
<goal>sign</goal>
</goals>
<phase>package</phase>
... | |
doc_23528231 |
A:
About Objective-C Command Line Syntax
The basic command line syntax for translating a single file is
sourceanalyzer -b -clean
sourceanalyzer -b xcodebuild [compiler options]
where:
[compiler options] are options passed to xcode.
Can you please test it on Mac device.
A: You need to run it on a Mac, becau... | |
doc_23528232 | And write it into destination folder.
Is there anyway I can do it parallel via pyspark?
I am using below code, but it is only picking header from first file, which is producing wrong output.
Df.read.option(“header”, “true”).parquet(directory/*.parquet)
Df.write.option(“header”,”true”).csv(directory)
Please help me i... | |
doc_23528233 | I have this code to draw tabs with border:
private func drawBorder(selectedTab: UIButton) {
// The Tab frame (below one)
guard let tabContainerFrame = vTabContainer?.frame else { return }
let borderColor = selectedTab.titleColor(for: .selected)
let tabFrame = selectedTab.convert(select... | |
doc_23528234 | x = 0
Name = [None]*1000
Score = [0]*100
text_file = open("txt.Scores.txt","a")
def write_in_file():
global text_file
text_file.write(Name[x])
text_file.write("\n")
text_file.write(Score[x])
text_file.write("\n")
text_file.write("\n")
text_file.close()
text_file = open("txt.Scores.tx... | |
doc_23528235 | It seems to me that I should be able to simplify this using a custom tag and passing the field that I want but I can't seem to get it to work.
customtags.py:
from django import template
register = template.Library()
@register.simple_tag
def get_latest_record(issue, field):
record = issue.history.filter(field = 1)... | |
doc_23528236 | Thanks for your help.
[Updates]:
We are stuck with 0.98.6, so ConnectionFactory is not available.
I found the bellow jira suggesting to create an "unmanaged" connection and use a single ExecuteService to create HTable. Why can't we simply use the getTable method of the unmanaged connection to get HTable? Is that beca... | |
doc_23528237 | but is it a good idea to create language model of whole vocabulary? (Language model of english language is 125 MB in size)
How can I implement "speech to text" for many languages. Should I create language model for each language? and what about my build size if I import 10 language model in my app?
Thanks in advance.
... | |
doc_23528238 |
This is my Xaml code:
<DataTemplate>
<Border BorderBrush="#cbc6c0"
BorderThickness="3"
CornerRadius="3"
Background="#FFF9F6F4">
<Grid Margin="5">
... | |
doc_23528239 | Example:
I would like to define a class (class A) which hold and controls some resources. There will be another class (class B) which has some data/state information and that would need to use resources hold by class A. So user API would be to define only one class A and then multiple class B instances which they can a... | |
doc_23528240 | But when i try to create a sublevel ( without any reference at this time ) Lets say , i want to have a new sublevel where users can not be assigned just yet. It does not work.
Current Scheme:
model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
email String @unique
passw... | |
doc_23528241 | If I want pressing key X to execute my listener and no other, is there any way to carry that out in javascript, short of modifying all external js on the page that might add a handler?
A: DOM2 (addEventListener) handlers are called in the order in which they were registered. So as long as you register yours first, it ... | |
doc_23528242 | Declare @JSON varchar(max)
SELECT @JSON=BulkColumn
FROM OPENROWSET (BULK 'C:\Users\amartinez\US.json', SINGLE_CLOB) j
SELECT * FROM OPENJSON (@JSON)
WITH (
[CTY_CODE] varchar(max) '$.CTY_CODE',
[CTY_NAME] varchar(max) '$.CTY_NAME',
[I_ENDUSE] varchar(max) '$.I_ENDUSE',
[I_ENDUSE_LDESC] varchar(max) '... | |
doc_23528243 | What I need is a way to tell the api to use the last waypoint of my optimized route as a destination.
A: You could make multiple requests to the directions service, one with each possible waypoint as the final destination, pick the shortest resulting distance.
proof of concept fiddle
code snippet:
var map;
var direc... | |
doc_23528244 | <LinearLayout style="@style/ActivityBody"
android:orientation="vertical"
>
<LinearLayout android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dip"
... | |
doc_23528245 | I'm able to create users (PFUser) ,login, and create custom objects just fine. I now would like to implement Roles and the role I have in mind will be called "admin".
The goal of creating this role is to know when a user is an admin so they have more access to things in the app. I read through the documentation but I d... | |
doc_23528246 | I noticed that the the java process had to do multiple rollback of messages back to the queue due to a network timeout issue while processing them on the day I faced the problem
I have attached the Spring MDP configuration below
<!-- WebSphere MQ Connection Factory -->
<bean id="mqConnectionFactory" class="com.ibm.mq.j... | |
doc_23528247 | class RunTest {
public static void main(String a[]) {
try {
String prg = "import sys\nprint int(sys.argv[1])+int(sys.argv[2])\n";
BufferedWriter out = new BufferedWriter(new FileWriter("test1.py"));
out.write(prg);
int number1 = 1;
int number2 = 2;
ProcessBuilder pb ... | |
doc_23528248 | private void makeMP4()
{
Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog();
saveFileDialog.Filter = "Media File (*.mp4)|*.mp4";
saveFileDialog.InitialDirectory = @"D:\temp\mp4output\";
saveFileDialog.FileName = myImageHandler.SuggestedFileName + ".mp4";
// If I re... | |
doc_23528249 | For example - generate a random number from 1,2,4,5 (no 3 allowed).
A: You can create an array with all your predefined set into it, then you fill an integer index with a random number from 0 to the array's length. That should do the trick :)
| |
doc_23528250 | <?php
$query = "SELECT * FROM classics";
$result = mysql_query($query);
$row = mysql_fetch_row($result); //gets the rows refering to the query
echo $row[0]; //returns the data in column 1
?>
In the code above, echo $row[0]; returns the data in the first column in the table, but how does it know which row to take t... | |
doc_23528251 | Spotting a neat father-son opportunity I said "Yes!, no problem". So I dug out my python skills and wrote this..
#!/usr/bin/python
#
# We have to tell python what stuff we're
# going to use. We do this by asking to import
# the code we'll be making use of
#
import curses
import random
import time
#
# We'll be using a... | |
doc_23528252 | In my application I am getting the audio file path from the server. Now when the user clicks on listen button in my app, then I have to play that audio file.
For example: http://traffic.libsyn.com/wpradio/WPRadio_29.mp3
What are the different ways to play the above audio file.
Thanks
A: If I were you I wouldn't do tha... | |
doc_23528253 | Right now I have a solution that is basically getting each frame of output, filtering it, setting that output image to an @Published property and then displaying that in a Metal view, but I don't really understand what's going on with Metal, and I'm sure there's a faster way than doing this through an @Published proper... | |
doc_23528254 | Here is a reproducible example of what I want to achieve:
mat = rbinom(n=1000, size=1, prob=0.8)
dim(mat) = c(200, 5)
umat = unique(mat)
idVec = numeric(nrow(mat))
for(i in seq_len(nrow(umat))){
for(j in seq_len(nrow(mat))){
if(isTRUE(all.equal(mat[j,], umat[i,]))){
idVec[j] = i
}
}
}
cbind(idVec... | |
doc_23528255 | I am using double pointer to do this, here is the code which works fine,
//Example # 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void myalloc( char ** ptr)
{
*ptr = malloc(255);
strcpy( *ptr, "Hello World");
}
int main()
{
char *ptr = 0;
myalloc( &ptr );
printf("String is %s\n", ... | |
doc_23528256 | Used JVM:
java.vm.name=IBM J9 VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=1.8
java.vm.vendor=IBM Corporation
java.vm.version=2.8
stack trace:
java.lang.IllegalStateException: Fail to request https://sonarserver/api/syst... | |
doc_23528257 | My code
$mails = file('blacklist.txt');
$email = "hendrik@anonbox.net";
$fail = false;
foreach($mails as $mail) {
if(strpos($email, $mail) > 0) {
$fail = true;
}
}
if($fail) {
echo "Fail";
} else {
echo "you can use that";
}
The blacklist.txt can be found here http://pastebin.com/aJyVkcNx.
I ... | |
doc_23528258 | class Track{
static belongsTo = [createdBy: User, modifiedBy: User, Course]
}
But its giving me error, Finally i dont want to have course object[course: Course] but only have to specify that it belongs to Course [Course]. How to do this
A: I think you are using the GORM associations a bit too extensively. belon... | |
doc_23528259 |
A: inline fun Context.withNetwork(isToNotify: Boolean = true, block: () -> Unit) {
val connectivityManager = this.getSystemService(Context.CONNECTIVITY_SERVICE) as? ConnectivityManager
connectivityManager?.let {
val netInfo = it.activeNetworkInfo
val isConnected = netInfo != null && netInfo.isC... | |
doc_23528260 | Here's the blue highlighted line from logcat at com.example.chemicalequationbalancer.HelpGuide.onCreate(HelpGuide.java:37)
Here's line 37 navigation.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() { followed by the code of the same activity added below:
The HelpGuide.jav... | |
doc_23528261 |
Expected to decode Double but found a string/data instead.
class MyClass : Codable {
var decimal: Decimal?
}
then trying to parse it
let json = "{\"decimal\":\"0.007\"}"
let data = json.data(using: .utf8)
let decoder = JSONDecoder()
decoder.nonConformingFloatDecodingStrategy = .convertFromString(positiveInfin... | |
doc_23528262 | I am writing an application that makes heavy use of numbers with higher precision than allowed by the ECMAScript native Number type. So I need to use a custom type (currently BigNumber) to represent those values.
I am looking hungrily at the proposed BigInt type, which when implemented as standard will be an improvemen... | |
doc_23528263 | "java.io.FileNotFoundException: dbfs:/df_xl.xlsx"
path= 'abfss://raw@tkm.dfs.core.windows.net/db_folder/'
df1.to_excel('df_xl.xlsx',sheet_name='Sheet1',index=False)
dbutils.fs.cp('dbfs:/df_xl.xlsx', path + 'output')
If i do the same thing with csv it is working perfectly.
Can you please help me with thi?
| |
doc_23528264 | I would like to encrypt the production file with a password and a staging file with an other password to avoid other teams having access to production secrets.
Is it possible to do that ?
I have done something like that. My secrets :
cat /group_vars/all/vault_production.yml (encrypt with password A)
production_password... | |
doc_23528265 | I have created an ubuntu:14.04 docker container and I have installed the Visual C++ for Linux dependencies in the container, namely openssh-server, g++, gdb and gdbserver. I have committed the container, creating an image to work with. I think I now need to run the container opening up a port so that I can connect to t... | |
doc_23528266 |
A: For more efficient way to merge multiple files, you may try it in bash (if you are using Linux / macOS).
cat *.pb name.proto > your_merged_file
For Windows systems, you can do this in cmd:
type *.pb name.proto > your_merged_file
| |
doc_23528267 | ||
doc_23528268 | I am currently using this function:
SELECT ...
case when FLAG1 is null then upper(FLAG2) else FLAG1 END as STATUS,
...;
The UPPER() function however renders all my FLAG2 words to be fully capitalized. Anyone know how to capitalize the first letter of words in Snowflake?
A: Use initcap() function, it returns the i... | |
doc_23528269 | here it is:
http://milosznowicki.ml/seedmed/
I've set it up on a server, now everything looks good in Firefox, but i have problems with chrome.
I'm trying to do a responsive svg with padding hack.
Also, here is fiddle for some of my svg containers (it seems to work fine in those browsers).
https://jsfiddle.net/4egzxsb9... | |
doc_23528270 | time=60
from time import sleep
while (time>0):
print ("you have") (time) ("seconds left")
time-=1
sleep(1)
below is the result:
>>>
you have
Traceback (most recent call last):
File "H:\counter.py", line 4, in <module>
print ("you have") (time) ("seconds left")
TypeError: 'NoneType' object is... | |
doc_23528271 | but I'm using Google Spreadsheet. Even though it's not considered a "programming" topic, regex syntax it be the same.
I need to extract text between two tags. Eg:
START sample text END
When I apply this regex syntax everything works:
"START(.*)END"
But if the sample text contains a new line it does not. Any hints?
... | |
doc_23528272 | How much is this different from ipfs and will it be possible to use them together?
A: The technical spec makes it sound as though it does not compete with IPFS, since everything seems to be done in the usual single-server-over-HTTP regime, which makes me think that it should be able to be used on top of IPFS instead w... | |
doc_23528273 | I don't want to use the Silvelright's screen navigation system.
I tried to programmatically create a PhotoCamera, VideoBrush and UIElementRenderer classes, the problem is that when I make a new UIElementRenderer I get a NullReferenceException error. I do the following:
UIElementRenderer slRender;
Grid element;
element... | |
doc_23528274 | Here is my code:
if (CGRectIsEmpty(self.bounds)) {
return nil;
}
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, [[UIScreen mainScreen] scale]);
[self drawViewHierarchyInRect:self.bounds
afterScreenUpdates:NO];
UIImage *renderImg = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsE... | |
doc_23528275 |
A: you need to upload your excel file to Drive convert it to Sheets and use IMPORTRANGE to extract given range into your spreadsheet.
uploading can be automated via https://www.google.com/drive/download/backup-and-sync/
conversion can be automated via https://stackoverflow.com/a/55645062/5632629
and IMPORTRANGE formul... | |
doc_23528276 | <customErrors mode="On" defaultRedirect="Error.aspx">
<error statusCode="404" redirect="NotFound.aspx" />
</customErrors>
And I have the [HandleError] attribute:
[Authorize]
[HandleError]
public class HomeController : Controller
{ // etc.
Yet when I type in http://localhost:1986/blah, I get the follow... | |
doc_23528277 | http://jsfiddle.net/8t5kc/1/
A: If you change <input type="search" /> to <input type="text" /> it seems to be working - http://jsfiddle.net/8t5kc/2/
"WebKit has big time restrictions on what you can change on a search input. I would guess the idea is consistency." - read more
A: http://www.w3.org/TR/css3-color/
Note.... | |
doc_23528278 | The stored procedure isn't the issue, I transformed the select statement from te stored procedure to a regular select statement which looks like:
DECLARE @contentRootId int = 900589
DECLARE @RealtorIdList varchar(2000) = ';880;884;1000;881;885;'
DECLARE @publishSoldOrRentedSinceDate int = 8
DECLARE @isForSale BIT= 1
DE... | |
doc_23528279 | #include <iostream>
#include <vector>
class FunctionState;
class Function {
public:
virtual FunctionState* NewFunctionState() = 0;
protected:
std::vector<FunctionState*> states;
};
class FunctionState {
public:
FunctionState(Function* func) : mFunc(func) {}
virtual void RunState() = 0;
void Exe... | |
doc_23528280 | export interface Preferences {
theme: Theme;
}
with Theme being defined as an enum:
export enum Theme {
dark = 'dark',
light = 'light'
}
Suppose I have a JSON file as follows:
{
"theme": "light"
}
Suppose also that I want to use it in a service as follows:
import { Injectable } from '@angular/core';
import {... | |
doc_23528281 | d = {'c1':['a', 'a', 'b', 'b', 'c', 'c', 'c', 'd'], 'c2':['False', 'True', 'True', 'True', 'True', 'True', 'False', 'False']}
dd = pd.DataFrame(data=d)
dd.groupby('c1')['c2'].value_counts(normalize=True)
c1 c2
a False 0.500000
True 0.500000
b True 1.000000
c True 0.666667
False 0.33... | |
doc_23528282 | <script type="text/javascript">
$(function() {
$("#dialog").dialog();
});
</script>
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
and firebug say... | |
doc_23528283 | Dim adapter As New eVoteTableAdapters.ballotsTableAdapter
Dim ballot_IDIn As Integer = ballot_ID
Dim name As String
Dim sd As Date
Dim ed As Date
name = CType(adapter.Adapter.SelectCommand.ExecuteScalar(SELECT name FROM ballots WHERE ballod_ID = @ballot_IDIn), String)
sd = CType(adapter.Adapter.SelectCommand.ExecuteSca... | |
doc_23528284 | This applet tries to invoke a phpscript . So I must read the URL when the button is clicked.
I m new beginner in java. Could you explain what is wrong
Error 44: IO exception must be caught or declared to be thrown
URLConnection myURLConnection = myURL.openConnection();
Error 46: IO exception must be caught or declar... | |
doc_23528285 | Golang code:
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/url"
"strings"
http "github.com/useflyent/fhttp"
"github.com/Carcraftz/CycleTLS/cycletls"
)
var client = cycletls.Init()
func main() {
port := flag.String("port", "8082", "A port number (default 8082)")
f... | |
doc_23528286 | I am getting following error message while downloading a file from Web API Controller.
Non-invocable member 'File' cannot be used like a method
This is my database table:
CREATE TABLE [cafe].[t06_03_02_jobAttachments](
[ID] [int] IDENTITY(1,1) NOT NULL,
[jobAttachmentId] [int] NOT NULL,
[jobId] [int] NOT NULL,
[file... | |
doc_23528287 | SM-N900P 4.4.4 19
java.lang.NullPointerException
at android.view.ViewRootImpl.setMultiWindowScale(ViewRootImpl.java:7992)
at android.view.WindowManagerGlobal.setMultiWindowScale(WindowManagerGlobal.java:538)
at com.android.internal.policy.impl.MultiPhoneWindow.adjustScaleFactor(MultiPhoneWindow.java:160... | |
doc_23528288 | The scenario is as follows
*
*I need to access the meta data for a file and I only have the file path (I can't use the /drive/items/{item-id} method)
*When the path gets too big, I am unable to access the metadata.
https://tenant-my.sharepoint.com/personal/some_user_some_domain_elasticadev_com/_api/v2.0/drive/ro... | |
doc_23528289 | //For the rooms
$(document).ready(function () {
var tpropval = $('input[name=Typeofproperty]:checked').val()
if (tpropval != 'Plot' || tpropval != 'Studio Appartment') {
$('#chkroomdetails').show();
}
else {
$('#chkroomdetails').hide();
}
})
<div id="chkroomdetails" c... | |
doc_23528290 | FileInputFormat.addInputPath(job, new Path(args[0]));
FileSystem.get(conf).delete(new Path("file:///tmp/inter/"),true);
FileOutputFormat.setOutputPath(job, new Path("file:///tmp/inter/"));
boolean complete = job.waitForCompletion(true);
Job job2 = Job.getInstance(conf, "Q4a");
job2.setJarByCla... | |
doc_23528291 | int reallocToMinSize(char** friends, int len)
{
int i = 0;
int reallocSuccess = 1;
char* newFriendPtr = 0;
for (i = 0; i < len && reallocSuccess; i++)
{
printf("Reallocating: %s, size: %i", friends[i], (strlen(friends[i]) + 1));
friends[i] = (char*) realloc(friends[i], (strlen(frien... | |
doc_23528292 | Every time there is an outage the logs contain the following entries:
Message: java.util.zip.ZipException: ZIP_Read: error reading zip file ZIP_Read: error reading zip file
Exception type: java.util.zip.ZipException
Failed method: java.util.zip.ZipFile.access$1400
With the following call stack.
java.lang.Illeg... | |
doc_23528293 | Thanks in advance.
A: Use a left join
Select * from tableb left join tablea on tableb.column = tablea.coulmn where tablea.column is null
A: Some databases support except or minus. But not MySQL. I would recommend not exists:
select b.*
from b
where not exists (select 1
from a
... | |
doc_23528294 |
Generating code coverage report, this
may take a
moment./tmp/hudson3472766550808527893.sh:
line 3: 5237 Terminated
/usr/local/bin/phpunit --verbose -d
memory_limit=1024M --log-junit
../../build/logs/phpunit.xml
--coverage-clover ../../build/logs/coverage/clover.xml
--coverage-html ../../build/logs/cov... | |
doc_23528295 | "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in..."
even though the query returns a result in mysql workbench.
This is my code:
<?php
$con=mysqli_connect("localhost","root","","eshkol");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysql... | |
doc_23528296 | I want to use jQuery on my website, but only if it is displayed on a desktop computer. If my site is displayed on a mobile device, I don't want it to load jQuery.
What's the best way to do this?
Should I use Javascript or PHP for detecting the device type?
A: http://jsfiddle.net/fk9kC/
The code above is pretty much se... | |
doc_23528297 | I want to render a texture on my winforms panel and not want to create another SDL window form just for rendering. How can I do that?
| |
doc_23528298 | parent.location='mailto:' + email + '?subject=' + "Test";
But the problem is I have multiple email accounts linked up to my outlook, so when I click on the mailto link it always uses the first email address in the From drop down menu in Outlook. But I want to use the second email address. Is there a way to select whic... | |
doc_23528299 | I have tabbed pages in which I have a Message Tab which consists of a collection view which shows the user messages. When the app starts I download about 5 messages and then wait for the remainingitemthresholdreached to fire so I can go ahead and fetch more data but unfortunately, it doesn't fire and I am stuck with th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.