id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23516900 | import h5py # HDF5 support
import numpy
fileName = "C:/.../file.h5"
f = h5py.File(fileName, "r")
for item in f.attrs.keys():
print item + ":", f.attrs[item]
mr = f['/entry/mr_scan/mr']
i00 = f['/entry/mr_scan/I00']
print "%s\t%s\t%s" % ("#", "mr", "I00")
for i in range(len(mr)):
print "%d\t%g\t%d" % (i, mr... | |
doc_23516901 | I moved folder Content, and select copy items if needed, and create a group for them.
I am running on Virtual machine, macOS sierra 10.12.6, XCode version 9.0 (9A235)
Code Snippet
func loadImages() -> Void{
let fm = FileManager.default
let path = Bundle.main.resourcePath!
let items = try! fm.contentsOfDire... | |
doc_23516902 | Here is their example code:
var stateByUser = {};
var podcastURL = "https://feeds.soundcloud.com/stream/309340878-user-652822799-episode-010-building-an-alexa-skill-with-flask-ask-with-john-wheeler.mp3";
// Entry-point for the Lambda
exports.handler = function(event, context) {
var player = new SimplePlayer(event,... | |
doc_23516903 | Our application uses Spring Cloud, Spring Oauth2 and Spring Boot 1.5.9. The entry point is an API-Gateway service using Zuul to redirect calls to the other microservices. There is an Authorization-server to handle the Oauth2 authorization, not accessible from the outside but through the API-Gateway.
It is configured t... | |
doc_23516904 | The UDTF is registered, but doesn't run and fails with a function not found exception.
Now, what is strange is that after this failed attempt of running the UDTF, nothing runs on thriftserver, even the basic SELECT queries. Every query fails with the following exception:
Error: org.apache.spark.SparkException: Job abor... | |
doc_23516905 | Here's the contents of my .npmrc file:
registry=https://pkgs.dev.azure.com/<private-path>/registry/
always-auth=true
//pkgs.dev.azure.com/<private-path>/registry/:username=${NPM_USER}
//pkgs.dev.azure.com/<private-path>/registry/:_password=${NPM_TOKEN}
The documentation for .yarnrc.yml only mentions how to deal with ... | |
doc_23516906 | Using google i found 2 ways to make it:
1)by placing
"-fx-background-image: url(...);"
into the
TextArea.setStyle();
2) just to make transparent background using
"-fxbackground-color: transparent;"
Make an image as another object, paste both objects at same location and add text area after image into the group.
B... | |
doc_23516907 | public class DataSendActivity extends Activity {
private static final String TAG = RegisterActivity.class.getSimpleName();
private Button button;
private Button btnLinkToLogin;
private EditText editText;
private EditText inputEmail;
private EditText inputPassword;
private ProgressDialog pD... | |
doc_23516908 |
A: Ejabberd does not necessarily save chat history by default, since that can be a potentially very expensive task. Nor is it built into the core part of the server. There are modules available such as mod_archive that can installed/enabled that would allow you to save some chat history, but as chat history is not par... | |
doc_23516909 | I want to automate heavy ajax sites.
I'm trying this:
from ghost import Ghost
ghost = Ghost(plugins_enabled=True,plugin_path=['C:\Documents and Settings\my\Desktop\addons\addon-3863-latest.xpi'],)
A: Within Ghost.py you would find the code snippet:
if plugin_path:
for p in plugin_path:
Ghost._app.addLibraryPat... | |
doc_23516910 | This also makes all my project pages map to the same new domain, eg. donskifarrell.github.com/calex -> donalfarrell.com/calex.
While this is quite nice to have, it is proving to be troublesome for one of my projects.
Is there any way to modify my setup so that certain project pages do not use my own custom domain and ... | |
doc_23516911 |
$ComputerName =Get-ADComputer -Filter {(Name -like "*")} -SearchBase "OU=AsiaPacific,OU=Sales,OU=UserAccounts,DC=FABRIKAM,DC=COM" | Select-Object -ExpandProperty Name
$results = @{}
ForEach ($computer in $ComputerName) {
$Results += Get-NetAdapter -CimSession $ComputerName | Select-Object PsComputerName, Interfac... | |
doc_23516912 | <div class="container">
<div id="loginbox" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<div class="panel panel-info" >
<div class="panel-heading">
<div class="panel... | |
doc_23516913 | |----|------|------|
| id | lat | long |
|----|------|------|
when i used this code:
public function near($lat ,$lng)
{
$cities = map::select(DB::raw('*, ( 6367 * acos( cos( radians('.$lat.') ) * cos( radians( lat ) ) * cos( radians( long ) - radians('.$lng.') ) + sin( radians('.$lat.') ) * sin( radians( lat ) )... | |
doc_23516914 | What is the best way to do it?
A: This is a general design issue -- not so much related to forge. Like MDG said, you'll need to use streaming to avoid keeping the whole file and encrypted file in memory.
Forge's cipher objects (see: AES) will allow you to consume chunks of data from a stream. You can do cipher.update(... | |
doc_23516915 | Consider a simple example:
sequence = ['a', 'b', 'c']
list((el, ord(el)) for el in sequence)
This yields [('a', 97), ('b', 98), ('c', 99)] as expected.
Now, just swap the ord(el) out for an expression that takes the first value out of some generator using (...).next() — forgive the contrived example:
def odd_integers_... | |
doc_23516916 |
A: The "flexibility" is achieved using the <splitter> element. For example:
<hbox>
<iframe id="sidebar" type="content" width="300"/>
<splitter id="splitter" collapse="before" state="open"/>
<iframe id="browser" type="content" flex="1"/>
</hbox>
You have to remember to hide the splitter as well if you hide the s... | |
doc_23516917 | I did firebase init then firebase deploy but my hosted website looks like this:
I think you also this kind of error while hosting.
A: Answering my own question as I didn't find an answer that helped me out. So I found a way out.
After doing firebase init and selecting a few options as per you choice, firebase creates... | |
doc_23516918 | When I copy and paste it my using statements don't seem to be being used when they should be in the example? I've tried adding the using statements it suggest but I don't think that is required. I have errors on [BotAuthentication] and Activity "Type or namespace name 'Activity' could not be found' etc
I have the nugge... | |
doc_23516919 | Help/advise would be highly appreciated.
Thanx a lot!!
A: Front-end A should call Microservice B directly. As in your solution 2.
Simplifying, microservice architectures are supposed to be composed of small services that provide single functions in a self contained and self manage way.
By having your solution 1, you ... | |
doc_23516920 | Is there any way to pass the password also in the same command line like below:
$ pssh -h pssh-host.txt -l root -A "pswd" echo "hi"
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password:
Tried following solution:
sshpass -pabc pssh -h pssh-host.txt -l root -A e... | |
doc_23516921 | popup = _id => {
confirmAlert({
title: "Delete user",
message: "Are you sure?",
buttons: [
{
label: "Ja",
onClick: () => this.deleteUserHandler(_id)
},
{
label: "Nej",
}
],
closeOnEscape: true,
closeOnClickOutside: ... | |
doc_23516922 | We have a source structure that is mixed in various directories (like said above, below is just an example)
SRCS = ../a/b/source1.c \
b/source2.c \
../c/source3.c
But I would like all of the object files to output to the directory ./objs (same directory level as 'b')
To do this I was trying the following... | |
doc_23516923 | Problem: write a set of rules to define family relations like:
(brother ?x ?y) (i.e. "x is a brother of y")
(sister ?x ?y) (i.e. "x is a sister of y")
(son ?x ?y) (i.e. "x is a son of y")
(daughter ?x ?y) (i.e. "x is a daughter of y")
The constraint in this task is that the rules can be constructed only from the follo... | |
doc_23516924 | df['diff'] = pd.to_datetime( df['date']) - pd.datetime.now().date()
However, it produces the following error:
TypeError: unsupported operand type(s) for -: 'DatetimeIndex' and
'datetime.date'
The date column in the pandas table looks like this:
0 2018-12-18
1 2018-12-18
2 2018-12-18
3 2018-... | |
doc_23516925 | plt.pyplot.pie(res3,shadow=True,labels=lab,autopct='%1.1f%%')
I get the following in front of my pie chart:
([<matplotlib.patches.Wedge at 0x10cd78610>,
<matplotlib.patches.Wedge at 0x10cd74910>,
<matplotlib.patches.Wedge at 0x10cd72c10>,
<matplotlib.patches.Wedge at 0x10cd6ff10>,
<matplotlib.patches.Wedge at ... | |
doc_23516926 |
A: I know it's a bit late to answer this but you can use ngx-cookie-service node package for it.
1. Install
npm install ngx-cookie-service --save
2. Then add the cookie service to your app.module.ts as a provider:
@NgModule({
...,
providers: [ CookieService ]
})
3. Then, import and inject it into a component:
i... | |
doc_23516927 | For example an instance of Class<ArrayList<String>> without instantiating an instance of ArrayList<String>.
@SuppressWarnings("unchecked")
public static <T> T castToGeneric(Object objectToCast, T typeInferrenceClass) {
return (T)objectToCast;
}
// usage
Object someObject = null /* initialised elsewhere */;
List... | |
doc_23516928 |
Uncaught SyntaxError: Unexpected end of input
error. I am still learning JavaScript DOM and would appreciate any help.
data = getdata(); //retreive my data
var mtable = document.createElement("table"); //create table element via javascript
mtable.innerHTML += "<tr><th>Name</th><th>Modify</th></tr>";
for (i = 0; i < ... | |
doc_23516929 | getInitialState() {
return {
user: {age: 0, id: 0, weight: 0, size: 0, ...},
};
},
componentWillReceiveProps: function (nextProps) {
this.setState({
user: nextProps.user
});
},
editUserAge(age) {
this.state.user.age = age;
this.setState({
user: this.state.user
... | |
doc_23516930 | inventory
==========================================
inventory_id | city_id | title |is_enabled
==========================================
1 | 1 | abc | 1
2 | 1 | bcd | 1
cities
====================================
city_id | city | title
===================================
... | |
doc_23516931 | In their documentation, page.js says, "By default when a route is not matched, page.js will invoke page.stop() to unbind itself, and proceed with redirecting to the location requested. This means you may use page.js with a multi-page application without explicitly binding to certain links." But, I cannot get it to wor... | |
doc_23516932 | However feels like proc cannot see this variable if it is trying to create this object, however, if which check if object exists can see this variable feels like it treats it as a column from the table. Any idea how to work around it? I was trying to use declare inside else statement but it doesn't work :(
ERROR: col... | |
doc_23516933 |
Obviously the problem is that the time, battery power, etc, are hard to see because the graphic is black. How do people normally deal with this kind of thing? If I made it white, I'd run the risk of it being less visible if the time etc on a particular phone is white. Should I just put padding at the top of the screen... | |
doc_23516934 | This is error in Compile Output section
11:27:17: Running steps for project untitled20...
11:27:17: Configuration unchanged, skipping qmake step.
11:27:17: Starting: "C:\Qt\Qt5.4.1\Tools\QtCreator\bin\jom.exe"
C:\Qt\Qt5.4.1\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSY... | |
doc_23516935 |
A: Remap Caps Lock to Control
You can remap the caps lock key to the control key in the keyboard settings (click on the Modifier Keys button).
In vim, an alias for esc is control-[, which is much more accessible than reaching for the esc key.
Remap Caps Lock to Escape in Vim
Navigate to the Library/Preferences/ByHost... | |
doc_23516936 | And I changed the transaction log for db property also, it's not working pls suggest me.
| |
doc_23516937 | try:
prize = row.find_element(By.XPATH, './div[contains(@class, "divCell")][3]').text
except:
prize = ''
try:
field = row.find_element(By.XPATH, './div[contains(@class, "divCell")][4]').text
except:
field = ''
try:
country = row.find_element(By.XPATH, './div[contains(@class, "divCell")][5]/span[1]/a').get_att... | |
doc_23516938 | Is there a way to add Jwt in the router?
I now use
urlpatterns = [
path('token/', TokenObtainPairView.as_view(), name='my_jwt_token'),
path('refresh/', TokenRefreshView.as_view(), name='token_refresh'),
]
I want to do something like this.
router = DefaultRouter()
router.register(r'token', TokenObtainPairView... | |
doc_23516939 | authcookie = Office365(config["sp_base_path"], username=config["sp_user"], password=config["sp_password"]).GetCookies()
site = Site(config["sp_base_path"] + "/sites/portal/", version=Version.v365, authcookie=authcookie)
folder = site.Folder('Shared Documents/tickets/' + ticketid)
data = folder.get_file(... | |
doc_23516940 | Here is the sample code.
public class TestMatrix{
private Vector<Vector<Integer>> matrix = new Vector<Vector<Integer>>();
public void matrixUpdate(){
int n = 9;
Vector<Integer> tmpMatrix = new Vector<Integer>();
for(int i = 0;i < n;i++) tmpMatrix.addElement(-1); // initialize
... | |
doc_23516941 | domainname.com/storecontroller/storeaction/storename
I want to rewrite like
domainname.com/storecontroller/storename
Actually, I need to skip storeaction from the url, I don't want to do it with querystring with "?" Is there anyway to do it by registering rout config path or any another way?
A: Yes. You can define a... | |
doc_23516942 | I've noticed that the working prefabs puts the cursor right at the bottom when in placing mode, while the "broken" ones put the cursor in the middle. Here is an example of how it looks in Unity:
Working:
Not working:
What is that circle there? it looks like the cursor, because everytime that I tap the object, the cur... | |
doc_23516943 | $regPath = "HKLM:\SOFTWARE\Microsoft\Enrollments\" + $idString
$regPath
Invoke-Command -ComputerName $ComputerName {Remove-Item -Path $regPath -Force -Verbose}
I am essentially trying to remove a registry entry under a particular path. When I output $regPath and copy & paste it manually into the path parameter, it a... | |
doc_23516944 | My requirement is,
hide the output div before the form submit and after user enter data and submit, I have to make output div visible to display form output using PHP echo.
Here is my HTML code:
<div class="main">
<form id="main" name="main" action="#text" method="post">
<div class="input">
<d... | |
doc_23516945 | I have developed a web application in VS2010- I was under the impression that it will be the home page of the site.But the client now wants it deployed to a sub directory of existing web site.So I chose an FTPpublish to the sub directory from VS2010. The publish works well but problems arise when I try to access it usi... | |
doc_23516946 | private queryStringParams : { [key:string] : string } = {
"x":"y",
"foo":"bar"
};
and then implode\join\flatmap\zip it into a string such that each key\value pair is joined by a delimiter, and then all the pairs are joined by a delimiter.
For example the previous dictionary would turn into this with '&' as 1st le... | |
doc_23516947 | My code(html):
<div class="poductoneimg">
<img src="IphonePic1.jpg" alt="iPhone" style="height: 300px; width: 200px">
</div>
<div class="imgonethumbnail">
<img src="IphonePic1.jpg" alt="iPhone" style="height: 70px; width: 40px">
</div>
<d... | |
doc_23516948 | <filters defaultAction='Log'>
<when condition="equals('${event-context:item=EventId}','Microsoft.EntityFrameworkCore.Model.Validation.DecimalTypeKeyWarning')" action="Ignore" />
</filters>
With this I can filter log messages based on the actual LogMessage or EventId etc. (see
Official nLog doku: https://github... | |
doc_23516949 | const pStyle = {
marginTop: '40px'
};
nothing happens when I apply it in the div and I think I missed something please advice
import React, { Component } from "react";
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
/* Import Components */
import Input from "../comp... | |
doc_23516950 | //students.clear();
//modules.clear();
Model m = new Model();
m=Model.readModule("out.ser");
m.findStudent();
Like I said this created a new instance of Model, but I would rather have it replace the current instance but I'm unsure on how to do that.
A: If you have students and modules array lists th... | |
doc_23516951 |
print df1
userid reg_date
1 2015-07-21
2 2015-07-11
3 2015-07-14
print df2
userid date status amount
1 2015-07-22 CHARGED 11.68
1 2015-07-29 CHARGED 21.4
2 2015-07-13 CHARGED 18.98
2 ... | |
doc_23516952 | in view, you have an instance of VM but in VM you don't have the instance of the view.
so the solution is using live data and observes in view, right?
but how about time I don't want to use live data? how can I show a dialog when I don't have access to view?
A: Using some version of the observer pattern is the only wa... | |
doc_23516953 | Based in code either JdbcDataSource or JdbcConnectionPool implement javax.sql.DataSource.
My mains question is: When should I use one or other?
I have created an JNDI entry in jetty like:
<New id="h2ds" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg><Ref refid="itracker" /></Arg>
<Arg>jdbc/itracker_ds</Arg>
... | |
doc_23516954 | I have a config.development.json file that is loaded by my development build script. It contains
{
"primary1Color": "pink"
}
It's loaded in the Webpack script as follows
externals: {
configuration: JSON.stringify(require("./config.development.json"))
}
There's a similar set up for production builds.
I reference... | |
doc_23516955 | ERROR: type should be string, got "\nhttps://binarysearch.com/problems/Unix-Path-Resolution\nGiven a Unix path, represented as a list of strings, return its resolved version.\nIn Unix, \"..\" means to go to the previous directory and \".\" means to stay on the current directory. By resolving, we mean to evaluate the two symbols so that we get the final directory we're currently in.\nConstraints\n\n*\n\n*n ≤ 100,000 where n is the length of path\nExample 1\nInput\npath = [\"usr\", \"..\", \"usr\", \".\", \"local\", \"bin\", \"docker\"]\n\nOutput\n[\"usr\", \"local\", \"bin\", \"docker\"]\n\nExplanation\nThe input represents \"/usr/../usr/./local/bin\" which resolves to \"/usr/local/bin/docker\"\n\nExample 2\nInput\npath = [\"bin\", \"..\", \"..\"]\n\nOutput\n[]\n\nExplanation\nThe input represents \"/bin/../..\" which resolves to \"/\"\n\n\nmy correct solution:\nclass Solution:\n def solve(self, path):\n \n stack = []\n\n for s in path:\n if s == \"..\":\n if len(stack)> 0:\n stack.pop()\n elif s == \".\": #if \"elif\" is replaced with \"if\" - it gives error\n continue\n else:\n stack.append(s)\n print(stack)\n return stack\n\non this test case - [\"..\",\"..\",\"..\",\"..\",\"..\",\"..\",\".\"], the below code\nclass Solution:\n def solve(self, path):\n \n stack = []\n\n for s in path:\n if s == \"..\":\n if len(stack)> 0:\n stack.pop()\n if s == \".\": # \"elif\" is replaced with if and gives error\n continue\n else:\n stack.append(s)\n print(stack)\n return stack\n\nthe expected result is [], but my code gives [\"..\"] - wrong result.\nThe input is not a string where a for loop can mistake \"..\" vs \".\" - 1dot and 2dot.\nThe input is a list and it should clearly distinguish btw \"..\" and \".\" -\nso i assumed if/elif is not critical.\nwhy does simple replacing elif with \"if\" gives wrong result?\n\nA: There is actually differences between if-elif-else and if-if-else.\nIn simple terms, if-elif-else is regarded as \"one body\" while if-if-else is in fact two conditional blocks: if and if-else.\nFirst we look at the if-elif-else version. If s is \"..\", it will never reach the code inside -elif or -else. Sensible.\nHowever for the if-if-else version of code, as we said it actually goes through two blocks of if-else logic. If s is \"..\", it first goes through the first if statement. Then it proceed to the next if-else block. Since s does not equal \".\", so it proceeeds to the code in the else block, which is I believe not what you want.\n" | |
doc_23516956 | // start synchronization
if (rankedPlayersWaitingForMatch.get(rankedType).size() >= 2) {
Player player1 = rankedPlayersWaitingForMatch.get(rankedType).remove();
Player player2 = rankedPlayersWaitingForMatch.get(rankedType).remove();
// end synchronization
// ... I don't want this all to be synchronized, just af... | |
doc_23516957 | double a = 1.05;
double b = 0.000056;
double c = 0.7812;
double d = 1.2;
What I want to do is first find how many place values there are.
in this case
int inta = 2;
int intb = 6;
int intc = 4;
int intd = 1;
Then I want to create a string with "0" representing those digits. this is for a ToString()
string stra = ".00... | |
doc_23516958 | My issue is that when I open the app the list is shown, but after I open the detail and create a new Item, going back the the first (ItemListViewModel) the list is not updated.
@HiltViewModel
class ItemListViewModel
@Inject
constructor(private val itemRepository: ItemRepository) : ViewModel() {
var uiState by muta... | |
doc_23516959 | One thing I miss from bash:
mkdir some-very-long-dir-name
cd (hit ESC then hit _ on the keyboard)
Escape underscore is bash for 'last item on the previous command'. It's super useful - in this chase I didn't have to type out the very long directory name.
Is it possible to add keyboard shortcuts to powershell? How?
I'm... | |
doc_23516960 | Is there another way of checking or maybe anyone here sees why it is so slow?
A: Open up the client's Shopify Admin, and examine the theme. Does it have any strange slow code in it? Examine the Apps installed that directly affect theme. Are any of them crap, old, broken junk?
The best way to debug a slow theme is to j... | |
doc_23516961 | Early in the applet's init() method I call
logger = Logger.getAnonymousLogger();
This call has been running since Java 1.4.2 without a problem. Now, with Java 1.7.0_25 (on Windows 7 at least; I've no Mac or Linux machine to test with here), the first time the applet is loaded, it works just fine. However if the apple... | |
doc_23516962 | float number = 3.0f;
int bits = Float.floatToIntBits(number);
System.out.println(Integer.toBinaryString(bits));
I get :
1000000010000000000000000000000
But the correct binary format for 3 should be (according to this converter):
01000000010000000000000000000000
Why isn’t the sign bit (0) displayed by println here?... | |
doc_23516963 | Here is the code:
$('.carousel[data-type="multi"] .item').each(function(){
var next = $(this).next();
if (!next.length) {
next = $(this).siblings(':first');
}
next.children(':first-child').clone().appendTo($(this));
for (var i=0;i<1;i++) {
// next=next.next();
if (!next.len... | |
doc_23516964 | using (var _db = new DB())
{
var isemirleri = _db.IsEmris.AsQueryable();
var oalist = _db.OperasyonAksakliks.AsQueryable();
gcIsEmirleri.DataSource =
(from i in isemirleri
select new {
ID = i.isEmriId,
İşEmriNo = i.isEmriNo,
Aksaklık = string.Join(",",
... | |
doc_23516965 |
var chart = AmCharts.makeChart( "chartdiv", {
"type": "serial",
"theme": "light",
"dataProvider": [],
"type": "serial",
"theme": "light",
"categoryField": "name",
"rotate": true,
"startDuration": 1,
"startEffect":"easeOutSine",
... | |
doc_23516966 | For instance, this is the product permissions dataTable jsp code:
<sf:form action="${action}" class="form-horizontal" method="post" modelAttribute="permisosList" enctype="multipart/form-data" >
...
<table class="table table-striped table-bordered table-hover" id="tabla_permisos6">
<thead>
<tr>
<... | |
doc_23516967 | i've tried it on nexus 7 tab with this: changed the sensorDelay_Normal to 1.000.000 but nothing changed.
Thank You!
here is the code:
mAccelerometer.registerListener(listener,mAccelerometer.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),SensorManager.1000000);
A: This is how I get 1Hz acceleration:
static int ACCE_FILT... | |
doc_23516968 | I want this behaviour from my app. At first I got simple navigationBar with ButtonBarItems.
And after search button is clicked i want this behaviour:
How to achieve this behaviour?
I got up only with one idea - to create new view and place it , but it seems not like the best practice.
A: u want t hide and show the ... | |
doc_23516969 |
*
*Running my application on my phone
*Using it for awhile
*Pressing the "Dump HPROF file" button in DDMS in eclipse (The resulting file shows up in eclipse)
*I then try to save the file as something but I get the following error:
"Save could not be completed. Some characters cannot be mapped using "Cp1252" cha... | |
doc_23516970 | interface Group {
id: string,
name: string
}
interface User {
id: string,
name: string,
age: number,
contact:number
}
Now, when at some place when I try to filter out a list on the basis of instance type as
// rows is an array of mixed objects(Group & User), I want to filter out Group objects
... | |
doc_23516971 | tar xvf test.tar -O | grep "exynos7870"
but this just checks it. What I want to do is:
if Binary file (standard input) matches do something
A: You can use the -a flag to directly read through the binary file.
if grep -qa -m1 "exynos7870" test.tar
then
echo yes;
else
echo no;
fi
| |
doc_23516972 | import ftplib
ftp = ftplib.FTP('http://192.168.0.00', 'username', 'password')
files = ftp.dir('/')
ftp.cwd("/")
filematch = '*.csv'
target_dir = '/path/to/csv/file'
import os
for filename in ftp.nlst(filematch):
target_file_name = os.path.join(target_dir,os.path.basename(filename))
with open(target_file_name... | |
doc_23516973 | However the result from each test is something like below.
Searching has led me to believe that an error like this appears when some of the dashboards have been changed, but that is not my issue, as I have a new JIRA install with no dashboard changes.
Has anyone successfully gotten this suite of tests to work?
3/14/1... | |
doc_23516974 | This is how i have to create it from this link please check this
http://s23.postimg.org/btie12dvv/Login_Page2.jpg
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#5F04B4"
android:orientat... | |
doc_23516975 | <filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<f... | |
doc_23516976 |
Send / SendRaw / SendInput / SendPlay / SendEvent
Sends simulated keystrokes and mouse clicks to the active window.
ControlSend / ControlSendRaw
Sends simulated keystrokes to a window or control.
*
*What's the difference between Send and ControlSend?
*Is there a reason to use one over the other?
A: Send/Sen... | |
doc_23516977 | The application is running fine..but when i run that application is my Samsung Galaxy S which is having android 2.1, the application is behaving differently.
I have even tried adding
<uses-sdk minSdkVersion="7" /> in the manifest file..But still i am getting the warning message..
So how can i change the mini SDK of my... | |
doc_23516978 | var loader = new THREE.JSONLoader(),
callbackKey = function(geometry,materials) {createScene(geometry,materials,0, 0, 0, 25)};
loader.load("3dmodel/Converse_obj/converse_obj.js", callbackKey);
window.addEventListener('resize', onWindowResize, false);
}
function createScene(geometry,materials, x, y, z, ... | |
doc_23516979 | //@version=5
strategy('Renko', overlay=true, currency=currency.USD, initial_capital=500,
process_orders_on_close=false, default_qty_type=strategy.percent_of_equity,
default_qty_value=200, margin_long=1, margin_short=1)
entry_atr = float(0.0) //set float
entry_price = float(0.0) //set float
entry_atr := strategy.po... | |
doc_23516980 | I tried to set the variables with arguments in my docker-compose.yml:
version: "3.4"
services:
ata-mysql:
restart: unless-stopped
image: mysql:5.7.22
command:
- "mysqld"
- "--innodb_buffer_pool_size=400M"
- "--innodb_buffer_pool_instances=1"
- "--ft_min_word_len=1"
- "--ft_st... | |
doc_23516981 | instead of showing me the html views, this string is shown on the page:
<function render at 0x0000023B61F4F160>
after few minutes this message appears on the terminal:
[13/Nov/2020 08:39:05] "GET /socketcluster/ HTTP/1.1" 404 2129
A: wrong sintax
solution:
from django.shortcuts import render
from django.http import Ht... | |
doc_23516982 | Now let’s say that I want to add some kind of C#-based scripting (it’s not quite "scripting" but I’ll call it that). Each level gets its own class inherited from a base class (we’ll call it LevelController).
These are the important constraints for these scripts:
*
*They need to be real, compiled C# code
*They shoul... | |
doc_23516983 | describe('SERVICE -> EditServiceProcedureAuthorizationService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientModule],
providers: [
EditServiceProcedureAuthorizationService,
{ provide: Store, useClass: MockStore },
... | |
doc_23516984 | and I am trying to deploy the database rules through this Command: firebase deploy --only database but when I am running this command it is giving this error :
Error: There was an error loading firebase.json:
Parse Error: functions/index.js is not of a supported config file type
This is my firebase.json file which i... | |
doc_23516985 | constructor(props) {
super(props);
this.state = {
num: 100,
};
}
handleChange(event) {
this.setState({ num: event.target.value });
}
render() {
return (
<div className="App">
<input
autofocus="tru... | |
doc_23516986 | This is the code, it's using the DOM Selector in the Ionic & Angular Framework. I'm unsure why the console.log of "placing order" does not display when the button is clicked. I tried to use many alternatives like ngClick, ng-click, ngclick or changing the syntax of the function to this.placeOrder(), placeOrder = () => ... | |
doc_23516987 | I saw the jQuery solution already, but believe this has to be done differently in AngularJS by using a directive.
A: Please remember that not everything needs an Angular solution. You see this a lot with the jQuery crowd; they like to use expensive jQuery functions to do things that are simpler or easier to do with pu... | |
doc_23516988 | I have a list generated from laravel. The badge icon contains a count of the number of tracks. When hovering over the badge I want to see a popover with a list containing the titles of those tracks (at most 5).
Example
To put it into context this is similar to Facebook's 'like' link. When a user hovers over the link, ... | |
doc_23516989 | Thanks
A: Hip-Hop is compiled PHP modules/C. PHP Opcode cache saves the interpreted PHP so it can be used next time, without the overhead. So they are not exactly the same.
I have yet to use Hip-Hop, but its sheer existence and the fact that it doesn't have the overhead of a caching layer, could make it faster.
| |
doc_23516990 | javax.servlet.ServletException: java.lang.NoSuchMethodError: hudson.model.Hudson.getAuthentication()Lorg/springframework/security/Authentication;
org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:607)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:650)
org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.j... | |
doc_23516991 | it('AddContact returns contact with type = ADD_CONTACT', function () {
function hi() {return {
type: 'ADD_CONTACT',
data: {
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '1/2/89',
phone: '123-456-7890',
email: 'jdoe@gmail.com',
notes: 'Most original n... | |
doc_23516992 | Sometime, in the main thread cause a SIGSEGV fault.
(gdb) backtrace full
#0 0x0000000000000000 in ?? ()
No symbol table info available.
#1 0x0000000000000000 in ?? ()
No symbol table info available.
(gdb) info registers
rax 0x1 1
rbx 0x0 0
rcx 0x0 0
rdx 0x2 ... | |
doc_23516993 | An example:
CoInductive stream A : Type :=
| SCons : A -> stream A -> stream A
.
Arguments SCons [A] _ _.
CoInductive sEq A : stream A -> stream A -> Prop :=
| StreamEq x s0 s1 : sEq A s0 s1 -> sEq A (SCons x s0) (SCons x s1)
.
Arguments sEq [A].
Arguments StreamEq [A].
Theorem sEq_refl {A} (s : stream A) : sEq s s.
... | |
doc_23516994 | I put together a simple XML file to describe the projects and the latest success of each of their workflows:
<projects>
<project>
<title>Project A</title>
<workflows>
<workflow>
<title>Build 1.0</title>
<status>success</status>
</workflow>
<workflow>
<title>Build 2.0<... | |
doc_23516995 | import psycopg2
import pandas as pd
V_ID=111
conn = psycopg2.connect(host="xxxx", port = 5432, database="xxxx", user="xxxxx", password="xxx")
df= pd.read_sql_query
("""SELECT u.user_name, sum(s.sales_amount)
FROM public.users u left join public.sales s on u.id=s.user_id
WHERE USER_ID = v_ID
Group by u.user_name""",... | |
doc_23516996 | I was wondering if there is a way to add two more constrains to the following equation?
For example, how can we add x>0 , and y>0 to the following equation(3x+4y=7 and 5x+6y=8)to get a positive output?
from sympy import *
x, y = symbols(['x', 'y'])
system = [Eq(3*x + 4*y, 7), Eq(5*x + 6*y, 8)]
soln = solve(system, [x, ... | |
doc_23516997 | <div>
<span>a</span>
</div>
<div>
<span>c</span>
</div>
<div>
<span>b</span>
</div>
<div>
<span>a</span>
</div>
<div>
<span>b</span>
</div>
How to remove duplicated element above? I thought of foreach, text() and remove() but I don't know how to do the comparison.
$('div').foreach(function(){
// ho... | |
doc_23516998 | But I keep getting 0 either it overflows or not. Here's my code with an example which should overflow and print 1. Any help is appreciated.
.section .data
x:
.int 4100000000
y:
.int 400000000
.section .text
.global _start
_start:
movl y, %eax #moves the value y to... | |
doc_23516999 | def NewLoss(y_true,y_pred):
p=0
for i in range(3074):
if (y_pred[i+1]-y_pred[i])<0:
p+=(y_true[i]-y_pred[i])**2
elif (y_pred[i+1]-y_pred[i])>0:
p+=(y_true[i]-y_pred[i])**2+(y_true[i]-y_pred[i])*(y_pred[i+1]-y_pred[i])**2
else:
p+=(y_true[i]-y_pred[i])**2+... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.