id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_31400 | My Problem is, that i create objects, save them in an array and check them for collision.
unfortunately the logic is only applied to the FIRST object... i have no idea why :(
(by tracing it i see, it actually saves all objects)
trace message: ,[object item_collider],[object item_collider],[object item_collider],[objec... | |
doc_31401 | Here in Akka Streams I was wondering if something like that exists:
@Test def defer(): Unit = {
var range = 0 to 10
val graphs = Source(range)
.to(Sink.foreach(println))
range = 10 to 20
graphs.run()
Thread.sleep(2000)
}
Having this code, even before we execute run(), changing the value of... | |
doc_31402 | the name 'Instance' does not exist in the current context
when i run this code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnEnemys : MonoBehaviour
{
public GameObject enemy;
float randX;
float randY;
Vector2 whereToSpawn;
public float spawnRate =... | |
doc_31403 | <script src="<?php bloginfo('template_directory'); ?>/scripts/swfobject.js" type="text/javascript"></script>
<!-- JavaScript function - called by the animation -->
<script type="text/javascript">
function MyFunction(p1){
alert("You have clicked on: " + p1);
}
</script>
Everything is where it should be includi... | |
doc_31404 | const https = require("https");
const url =
"http://localhost:9001/products";
https.get(url, res => {
res.setEncoding("utf8");
let body = ""
res.on("data", data => {
body += data;
});
res.on("end", () => {
console.log(
body
);
});
});
The console shows all the dat... | |
doc_31405 | tectures Software Developer’s Manual, I found a strange phenomenon:
The manual says about ineaxct-result exception in 8.5.6, that
"If an inexact result occurs in conjunction with numeric overflow or underflow, the x87 FPU carries out one of the following operations:
*
*If an inexact result occurs in conjunction with ... | |
doc_31406 | Action<Action<VerifylocalResult>> docollectprint = (vl) =>
{
vl = (vlocres) =>
{
//DoStuff
};
//This returns false, indicating the action has been set:
Console.WriteLine((vl == null).ToString());
};
//Hookups
docollectprint(vlocobj.Action_N... | |
doc_31407 | I have a base Resource Controller and another nested controller
This is in my Routes.php
Route::resource('profile','ProfileController');
Route::resource('profile.bands','BandsController');
I don't think I have to display the profile's code here, I'll show you the BandsController
public function create($profileId)
{
... | |
doc_31408 | The script so far:
function touched(Hit)
print(Hit)
if Hit.Name == "Rocket" then
print("Money")
print(Hit.creator.Value)
local Creator = Hit.creator.Value
local plr = game.Players:FindFirstChild(Hit.creator.Value)
if plr then
... | |
doc_31409 | [post_id]/comments?fields=message,from{name,picture}
I am using the page_access_token for the page and it has been working since a couple of days ago then I notice that I am suddenly not getting results from the from field. I tried switching to lower versions of the API (currently 2.12, tried up until 2.9) and tried ... | |
doc_31410 | speechRecognizer = new Microsoft.CognitiveServices.Speech.SpeechRecognizer(config);
Inner exception : InnerException = {"Unable to load DLL
'Microsoft.CognitiveServices.Speech.csharp.bindings.dll': The
specified module could not be found. (Exception from HRESULT:
0x8007007E)"}
Microsoft.CognitiveServices.Speech... | |
doc_31411 |
A: SPARC v8 (32-bit) and earlier lack CAS, but v9 (64-bit) does have CAS.
For a spin-lock v7 and v8 provide LDSTUB which is an atomic-read-modify-write of an unsigned byte, which writes 0xFF. That does the lock phase of a spin-lock. An ordinary write of 0 (or anything not 0xFF) will unlock, when using TSO -- for PSO... | |
doc_31412 | while IFS=';' read -r task_id date name action; do
sed -e "s/\$date/$date/; s/\$name/$name/" >> $TASKSFILE.tmp
done < $FILE
Input file would look like:
1;20190423;Name1;print $date $name
2;20190424;Name2;print $date $name
Expected output:
1;20190423;Name1;print 20190423 Name1
2;20190424;Name2;print 20190424 Name2... | |
doc_31413 | How can new client get last message from RabbitMQ?
For example:
*
*9:00 - 1 seller online (Server sends "1")
*9:03 - 2 sellers online (Server sends "2")
*9:04 - 1st client connented
*9:04 - 2nd client connented
*9:05 - 3 sellers online (Server sends "3")
*9:06 - 3rd client connected
So, if I use direct or fan... | |
doc_31414 | My application only uses REST API and FQL (through fql.query method).
Do I also have to convert my app to be OAuth 2 by Oct 1st?
A: yes, you need to convert to OAuth 2.0.
| |
doc_31415 | What does buffer size mean, and how does it effect speed and performance when writing text out to a file?
Surprisingly, I could not find the answer with a simple Google search.
A: Writing to a file requires using the WriteFile() winapi function. Note the function signature, the 2nd argument is lpBuffer, a buffer that... | |
doc_31416 | # SELECT PostGIS_full_version();
ERROR: could not access file "$libdir/postgis-2.5": No such file or directory
CONTEXT: SQL statement "SELECT public.postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 26 at SQL statement
I found other answers which suggested running ALTER EXTENSION postgis UPDATE;, ... | |
doc_31417 | 1 15 10 ? * *ssddddfd
When I do:
String cronExpression = "1 15 10 ? * *ssdddfd";
boolean checkCronExpression = CronExpression.isValidExpression(cronExpression);
checkCronExpression is true. However when I look at the expression it is obviously wrong. Has anyone else also faced similar issue?
Note:
The package is: pac... | |
doc_31418 | request A sent
request B sent
request B processed (quick)
response B sent
response B received (*)
...
request A processed (slow)
response A sent
response A received
With naive matching I would get at point (*) a match request A--response B.
So how to synchronize them? I.e. I would like to end request A with response ... | |
doc_31419 | import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class event exte... | |
doc_31420 | https://docs.jboss.org/jbpm/v3/userguide/thejbpmdatabase.html
https://manthapavankumar.wordpress.com/2013/08/04/configure-jbpm-with-mysql/
http://www.mastertheboss.com/jboss-jbpm/jbpm6/configuring-jbpm-6-to-use-a-non-default-database
But still I am not getting my data being stored in MySql.
We have used STS and MySQL w... | |
doc_31421 | <Router>
<Switch>
<Route exact path="/articles" component={Articles}>
</Route>
<Route path="/article/:id" component={Article}/>
</Switch>
</Router>
I've made link to "article/:id" in Articles component. If I click on the link in articles page, it work... | |
doc_31422 | ERROR: type should be string, got "https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf\nI am attempting to create my own string-printing function.\nProblem:\n; Question 4\n; Put together all of the ideas in this section to make a self-contained function for printing\n; null-terminated strings, that can be used as follows:\n;\n; A boot sector that prints a string using our function.\n;\n[org 0x7c00] ; Tell the assembler where this code will be loaded\nmov bx, HELLO_MSG ; Use BX as a parameter to our function , so\ncall print_string ; we can specify the address of a string.\nmov bx, GOODBYE_MSG\ncall print_string\njmp $ ; Hang\n%include \"print_string.asm\"\n; Data\nHELLO_MSG:\ndb ’Hello , World!’, 0 ; <-- The zero on the end tells our routine\n; when to stop printing characters.\nGOODBYE_MSG:\ndb ’Goodbye!’, 0\n; Padding and magic number.\ntimes 510-($-$$) db 0\ndw 0xaa55\n; For good marks, make sure the function is careful when modifying registers and that\n; you fully comment the code to demonstrate your understanding.\n\nMy code:\nbootsect.asm\n org 0x7c00 ; Start at boot sector. Allows us to add offset for labels efficiently\n\n\n mov bx, loading_sys_msg\n calltest:\n call str_out\n ;jmp calltest\n\n jmp $ ; Jump forever. Because end of program lol\n\n; Includes\n %include \"str_out.asm\"\n\n; Database Resources\n\n loading_sys_msg:\n db 'Loading OIK v0.0.1', 0\n\n; Padding and magic BIOS number.\n\ntimes 510-($-$$) db 0\ndw 0xaa55\n`\n\nstr_out.asm\n;\n; String-printing function\n;\nstr_out:\npusha\npop bx\n;add bx, 0x7c00 ; Adds current address if boot sect and no org called (not used)\nmov ah, 0x0e ; BIOS teletyping for 0x10 interrupt\nmov ax, 0x00 ;prep counter\nmov al, [bx] ; character to print placed in al (bx address contents)\nprnt: ; printing loop\nint 0x10 ; interrupt print\nadd ax, 0x01 ; add to counter for removal afterwards\nadd bx, 0x01 ; move bx address forward by 1\nmov al, [bx] ; character to print placed in al (bx address contents)\ncmp al, 0 ; Compare [al -?- 0]\njg prnt ; If greater, jump to print\nsub bx, ax ;remove the counter amount\n;sub bx, 0x7c00 ;remove address addition if used earlier (not used)\npush bx\npopa\n\nBochs config:\n# Tell bochs to use our boot sector code as though it were\n# a floppy disk inserted into a computer at boot time.\nfloppya: 1_44=boot_sect.bin, status=inserted\nboot: a\n\nWhen Bochs boots, the screen clears and nothing happens. What am I doing wrong?\n(Thanks to Jester for telling me I didn't state the problem. I am still new to Stack Overflow.)\n\nA: str_out is missing a RET instruction, but the lack of display is because you trash AH\nmov ah, 0x0e ; BIOS teletyping for 0x10 interrupt\nmov ax, 0x00 ;prep counter\n\nUsually I don't give an example to exercises, but in this case, you've made a reasonable effort and one can sort of get your logic.\n org 0x7c00\n\n mov bx, Msg\n call str_out\n hlt\n jmp $ - 1\n\nstr_out: mov ah, 0x0e\nprnt: mov al, [bx]\n int 0x10\n add bx, 0x01\n cmp al, 0\n jg prnt\n ret\n\n Msg: db 'Loading OIK v0.0.1', 0\n\n times 510-($-$$) db 0\n dw 0xaa55\n\nNot exactly sure what is meant by make sure the function is careful when modifying registers, but this example does work. As this is essentially a carbon copy of your code, all you need to do is document it, but there are two idiosyncrasies that you might be asked about. Why did you use the instruction(s) and why are they in that order. \n" | |
doc_31423 | C:\Users\Administrator\AppData\Local\Apps\OpenCover\OpenCover.Console.exe "-target:C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" "-targetargs:C:\TravelInsurance\BTS\src\Fortius.Services.TravelGuard.Tests\bin\Debug\WorldVentures.Fortius.Services.TravelGuard.Tests.dll" -register:Administrator
My tes... | |
doc_31424 | http://www.example.com/word-of-the-day
to be taken to
http://www.example.com/index.php?page=word-of-the-day
But I want
http://www.example.com/word-of-the-day
to be shown in the URL for the user.
What should I do in my .htaccess? I tried but the regular expression
and the syntax of RewriteRule is way too complicated... | |
doc_31425 | It should appear in Control Panel->Administrative tools->Services and also automatically run when the computer starts.
I am not considering the solution of using third party/licensed tools here.
A: a simple free solution is JavaExe.
| |
doc_31426 | Basically i want to see how child process receives message from main process and both work parallel.
I'm trying with wx.CallAfter and wx.PostEvent and i'm confused with the threading concept here. Please someone help me.
Thanks in advance
A: Multithreading in wxpython is not different than in python. wx.CallAfter and ... | |
doc_31427 | I installed oozie by following this steps
http://hadooptutorial.info/apache-oozie-installation-on-ubuntu-14-04/ Can anyone please help me to remove oozie completely from my laptop?
I am using ubuntu latest version ..with hadoop 2.6.0 ..
Earlier I removed /usr/lib/oozie folder but it did not worked out for me after i... | |
doc_31428 | I am getting the follwing error:
searchd error (status: 1): per-query max_matches=25000 out of bounds (per-server max_matches=1000)
A: In your case I suggest to set max_matches to 100000 on the server side.
Even if you need more you can always use limit N,M to fetch slice of result set without going out of bounds.
I... | |
doc_31429 | I´ve set up a new project with a navigation controller. For the table view of the project I´ve added a new class for it, called "TableViewController.h" and "TableViewController.m".
In this class I´ve declared in .h a property for a NSString to access it from other classes, like this:
@property (strong, nonatomic) N... | |
doc_31430 | r = redis.Redis(connection_pool=pool)
vs.
r = redis.Redis(host='10.0.0.1', port=6379, db=0)
Those two works fine.
Whats the idea behind using connection pool? When would you use it?
A: From the redis-py docs:
Behind the scenes, redis-py uses a connection pool to manage connections to a Redis server. By default, eac... | |
doc_31431 | This is my controller code
[HttpPost]
public ActionResult JsonNewsfeed(int id)
{
var db = new dekhosaleEntities1();
sale s = db.sales.First(m => m.sale_id == id);
List<sale> sale1 = db.sales.ToList();
saleviewmodel model = new saleviewmodel
{
currentsale = s,
Sales = sale1
};
... | |
doc_31432 | I want to populate check boxes in a different manner depending on if the form (_form.html.erb) is being rendered in update or in create so:
<% if @foo.new_record? %>
<% query = "association_id == nil" %>
<% else %>
<% query = "" %>
<% end %>
and then I pass the query string to my check boxes
collection_c... | |
doc_31433 | here is related flow:
<ws:consumer config-ref="Web_Service_Consumer" operation="Login" doc:name="Web Service Consumer"/>
<mulexml:xml-to-dom-transformer doc:name="XML to DOM" returnClass="java.lang.String"/>
and my result:
........<?xml version="1.0" encoding="UTF-8"?><LoginResponse xm... | |
doc_31434 |
var input = document.getElementById("userinput");
var button = document.getElementById("button");
var ul = document.querySelector("ul");
button.addEventListener("click", function() {
var li = document.createElement('li');
li.textContent = input.value;
ul.appendChild(li);
input.value = "";
... | |
doc_31435 | Should I go with Java program or can I achieve it in PL/SQL itself?
A: If I correctly understood the question, you need to set the value of a column with a value extracted from another table of another DB. The two DBs have different structure.
In this case you can do it with just SQL and a database link.
Here's how to... | |
doc_31436 | id_a | id_b
-----------
01 | 011
01 | 012
02 | 021
02 | 022
and
id_b | cl | ds
------------------
011 | F9.00 | G
012 | F3.00 | G
021 | F9.00 | P
022 | G7.50 | G
the tables are joined on id_b.
Now I want to know every Id_a where there is no combination of F9.00 | G. So in this case, my desired result i... | |
doc_31437 | I want the latest trunk revision to be used to resolve each conflict. Is there a command I can run that will resolve all conflicts under a working copy in one direction automatically (merge-right should be used for all conflicts)?
EDIT:
As indicated in the comments, I tried reverting and then running svn merge with the... | |
doc_31438 |
A: While the optimize is running, you can run the top command, type M to sort by memory usage, and watch the RES and SHR columns increase for the SOLR java process. Also keep and eye on Mem: free at the top of the screen. As long as RES and SHR are increasing, optimize is working. In fact the only thing that will stop... | |
doc_31439 | let's say we have something like this:
Class A{}
Class B{}
Class C{
public void method1{}
System.out.print("Class A or B called me");
}
let's say an instance of Class A calls an instance of class C and the same for class B. When class A calls class C method1 method, I want it to print something like "Class A called me... | |
doc_31440 | <input name="Update" onclick="var req = new Ajax.Request('/agent/reports/update_chart', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form), onComplete:function(transport) {alert("TEST");}}); return false;" type="button" value="Update" />
But, if I remove the onComplete, like so, it will make the... | |
doc_31441 | Attempting to run this curl_easy_init - Start a libcurl easy session in my C++ program. The curl library has a large selection of APIs including simple post and many others for, but I'm stuck on getting my compiling and linking step configured correctly. I looked to the curl websites tutorial for guidance on compiling ... | |
doc_31442 | JumpTask signOutTask = new JumpTask
{
ApplicationPath = System.Reflection.Assembly.GetEntryAssembly().Location,
Title = XXX.Properties.Resources.AccountContextMenu_SignOutText,
Description = "Sign out of your account",
CustomCategory = "Actions",
Arguments = "/signout",
IconResourcePath = System... | |
doc_31443 | NSURL *url = [NSURL URLWithString:@"tweetie:///post?message=안녕 모두"];
[[UIApplication sharedApplication] openURL:url];
but it doesn't perform correctly. How would you construct such a URL with non-English elements?
A: Apparently you may only send US-ASCII characters in URI strings. Try adding percent escapes to your... | |
doc_31444 | if($('#myDiv').hover() == false) {
myFunction();
}
Not getting much in the way of errors in Chrome or Firebug consoles. I've had a look at some other posts, and there was an answer that used something like:
if($('#myDiv').is(':hover') == false) {
myFunction();
}
However this also doesn't work.
Here's a jsfiddle ... | |
doc_31445 | Using JSOUP, I've been doing this by going through product listing pages, scraping all the links and filtering out the appropriate links. For some websites my code works completely fine but for others, some or even no links are scraped by my code.
Working example:
*
*https://www.bhphotovideo.com/c/buy/Graphic-Cards/c... | |
doc_31446 | public class YTContext:DbContext
{
public YTContext(DbContextOptions<YTContext> options) : base(options) { }
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
//{
// optionsBuilder.UseMySql(@"Server=localhost;Database=kariyer_portal;Uid=root;Pwd=1234... | |
doc_31447 | class SimpleIOLoopTests(tornado.testing.AsyncTestCase):
def setUp(self):
super(SimpleIOLoopTests, self).setUp()
def test_executor_future(self):
self.executor = ThreadPoolExecutor(2)
@run_on_executor
def wait_and_return_a_value():
time.sleep(2)
return 20
... | |
doc_31448 | =IIf(Fields!TRREQUEST_BK_STATUS_CD.Value.ToString() <> "DELETE", True, False)
This isn't where the problem is happening though. Above this section, there are two sets of textboxes. One that uses the TRREQUEST_BK_STATUS_CD and displays either DELETE or APPRVD, and another set that displays a book ID. The weird thing th... | |
doc_31449 | This is my database csfile where I try to create an image to my database (it is working, but I am not sure if I should send it as a byte [] as my database wants it as a file)
static public async Task<bool> createInfo (byte[] thePicture) // should I send it as byte??
The page where I "create" the data that I send to my... | |
doc_31450 | I am creating an env file like this:
heroku config -s > .env
and then running this script to try to listen
#! /usr/bin/env bash
set -e
source .env
kafkacat -C -t ${KAFKA_PREFIX}test-topic -b $KAFKA_URL \
-X security.protocol=ssl \
-X ssl.key.location=<(echo $KAFKA_CLIENT_CERT_KEY) \
-X ssl.ca.location=<(echo $KAFKA... | |
doc_31451 | namespace {
typedef boost::tuple<double, double, double> Point;
double nL1(const Point& p1, const Point& p2) { //L1 norm, example
double dx = p1.get<0>() - p2.get<0>();
double dy = p1.get<1>() - p2.get<1>();
double dz = p1.get<2>() - p2.get<2>();
return abs(dx) + abs(dy) + abs(dz... | |
doc_31452 | The labels section in the Nginx container in the docker-compose.yml file take care of accessing the local website from localhost via Traefik:
labels:
- 'traefik.backend=nginx'
- 'traefik.port=80'
- 'traefik.frontend.rule=Host:local.developedwebsite.com'
- 'traefik.frontend.entryPoints=http,https'
The etc/hosts... | |
doc_31453 |
Error: invalid constant name.
I read in this topic that one solution could be adding a # pylint: disable-msg=C0103 to the source code, but this solution isn't enough for me because I have a lot of variable definitions and I don't want to polute my code with calls to Pylint. I need to disable error message C0103 for g... | |
doc_31454 |
A: An alternative and simple way is as follows:
String _email = prefs.email;
String _password = prefs.password;
prefs.clear();
prefs.email = _email;
prefs.password = _password;
Depending on how much information you have in SharedPreferences, this is probably a more efficient function than iterating ea... | |
doc_31455 | this is what i have at the moment. but all that happens is a cmd window flashes for a second but no file gets created
Dim cmd1 As String
Dim cmd2 As String
cmd1 = "cd " & FolderFromFileName(imagename)
cmd2 = "copy /B " & NameOnlyFromFullPath(imagename) & "+" & "TEMP.txt" & " " & TextBox1.Text
Shell("cmd /... | |
doc_31456 |
A: I don't think there is an event that triggered when people select the button to show the programs that are running on the mobile and dragging up or down in Xamarin.forms.
In Xamarin.forms, the Application class contains three virtual methods that can be overridden to handle lifecycle methods:
*
*OnStart - Called... | |
doc_31457 | with open('log1.txt') as logFile:
for line in logFile:
i = i+1
content_list = line.split("-")
#ipList[i] = content_list[1] # I want it to be split into this list
break
print(content_list[1])
Here is also an example of what my list looks like
172.16.121.64 - - [03/Sep/2018:09:46:19] GET /index.html H... | |
doc_31458 | It works well enough, even with a couple quirks from the limitations of Google Apps Script (the files have to be in the Google Drive, and all files in the Google Drive with whichever name is appropriate are taken from all folders in the drive).
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSheet();
va... | |
doc_31459 | public class myClass : myClassIF {
public myClass() { }
private void doSomething_A() {
//...
}
private void doSomething_B() {
//...
}
public void DecideAndCall(string identifier) {
string methodName = "doSomething_" + identifier;
MethodInfo mi = this.GetType()... | |
doc_31460 | So, the problem is that I need h4 text to be truncated and the link to not be truncated but displayed on the same line.
CSS:
.thread-title {
width: 100px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
h4 {
display: inline;
}
HTML:
<td class="thread-title thread-column">
<h4>S... | |
doc_31461 | class BitStream
{
void StoreBits( unsigned int data, unsigned int numBits );
public:
template<typename T>
void WriteType( T value ) { StoreBits( value, sizeof(T) * 8 ) );
template<>
void WriteType( float value ) { StoreBits( *(unsigned int*)&value, sizeof(float) * 8 ) );
};
Someone has th... | |
doc_31462 |
ax + by = c
Range: x >= -32768 , y <= 32767
Input: a,b,c.
Output: Values of x,y that solve the equation, otherwise zero.
I'm trying to create an algorithm which solves this, but no luck at the moment. Any help is highly appreciated.
A: there's 2 ways to solve this
first one:
iterate all (x) from -32768 to 32768
... | |
doc_31463 | I have built a docker image in my local which is laradock/workspace.
I can use the npm and node inside the docker image in my local.
I uploaded the same image at AWS EC2 Container and use it at AWS CodeBuild.
Problem:
But when I do the node -v inside the buildspec.yml it is not working and always return a status 127.... | |
doc_31464 | using (ZipFile zipFile = File.Exists(zipFilePath) ? ZipFile.Read(zipFilePath) : new ZipFile(zipFilePath))
{
zipFile.UpdateEntry(zipEntryName, content);
zipFile.Save();
}
with:
System.IO.IOException : Cannot create a file when that file already exists.
at System.IO.__Err... | |
doc_31465 | I dont know how to process after I Pre_processed the text.
A: You can download datasets which are available in Matlab format.
All of them are divided into train and test datasets.
check my GitHub
| |
doc_31466 | My CSS
<style>
.lp_claims, .gap_claims, .home_claims, .motor_claims{ display:none;}
</style>
HTML
<select name="claimsform">
<option value="lp_claims"> Loan Protection </option>
<option value="gap_claims"> GAP or Cash Assist </option>
<option value="home_claims"> Home </option>
<option value="land_claims"> Landlo... | |
doc_31467 | The logic downloads user data from server, updates state, and shows current information.
The problem is - only parts of information changes, like user score, but not his his position (index) from array (index is currentPosition in DOM structure)
It looks like this - logic file:
const [usersScoreList, setUsersScor... | |
doc_31468 | struct User {
id: &str // or String?
name: &str // or String?
//......
}
So is it better to use &str or String in general and in this particular case?
A: In Rust everything related to a decision whether to use a reference or not stems from the basic concepts of ownership and borrowing and their applications. Wh... | |
doc_31469 |
keeps giving me file/directory not found
I also tried this in my app.yaml :
- url: /test.((pdf)|(PDF))
static_files: pages/pdf/test.PDF
upload: pages/pdf/test.PDF
File structure
-app.yaml
pages
-index.html
-page1.html
pdf
-test.PDF
entities
-booking.py (file that im writing the above code)
... | |
doc_31470 | answer = (x**3)-3(x**2)-5(x)-7
return answer
print(f(-1))
print(f(0))
print(f(1))
print(f(2))
print(f(3))
print(f(4))
print(f(5))
A: Provide a * for multiplication
answer = (x**3)-3*(x**2)-5*(x)-7
return answer
| |
doc_31471 | The documentation does not appear to be correct for local builds with the Azure 2.3 SDK. Apparently, since SDK 1.8, the physicalDirectory attribute is not relative to the Azure cloud service project folder, but its output folder. Also see this question. By changing the path to ../../../Project.Name the service can be b... | |
doc_31472 | AA1 TextAA1
AA2 TextAA2
AA3 TextAA3
AB1 TextAB1
AC1 TextAC1
BA1 TextBA1
BA2 TextBA2
BA3 TextBA3
BB1 TextBB1
BC1 TextBC1
CA1 TextCA1
CA2 TextCA2
CA3 TextCA3
CB1 TextCB1
CC1 TextCC1
I need to make a table that is like this for outp... | |
doc_31473 | Picture for reference:
A: p1 = [2 3]; % First Point
p2 = [9 3]; % Second Point
dp = p2-p1; % Difference
figure(1)
quiver(p1(1),p1(2),dp(1),dp(2),0)
grid
axis([0 10 0 10])
text(p1(1),p1(2), sprintf('(%.0f,%.0f)',p1))
text(p2(1),p2(2), sprintf... | |
doc_31474 | <ul class="a">
<li class="b">
<a class="c">
<span class="d">
<strong>text</strong>
</span>
</a>
</li>
</ul>
I'm trying to get the "text" from the span.
When I try:
puts browser.ul( :class =>'a').li( :class =>'b').link(:class =>'c').span(:class =>'d')
I get the span element back. #<Wati... | |
doc_31475 | I am provided with the following files to authenticate against a thrift endpoint:
*
*cacert.pem
*local.crt
*local.key
I am having the hardest time trying to create a keystore that has the client cert in it. The endpoint application has its own CA to authenticate they client certs. I honestly am not sure what... | |
doc_31476 | D:\myApp\android\app\src\debug\AndroidManifest.xml:22:18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml... | |
doc_31477 | [dcc32 Error] Unit1.pas(61): E2010 Incompatible types: 'Cardinal' and 'Pointer'
I have marked where the error is in the code.
Unit 1 is the executable.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uADStanIntf, uADStanOption, uADStanDef, uADPhysInt... | |
doc_31478 | #include <fcntl.h>
int main(){
int pid;
printf("In parent process, creating child now...\n");
pid = fork();
if (pid==0){
printf("Now in child process...\n");
execl("/bin/ls","ls","-l",(char*)0);
}
wait(pid);
printf("ls child process complete\n");
printf("in parent process\n");
printf("Creating another child process\... | |
doc_31479 |
#Wrapper {
display: grid;
grid-template-columns: 20% 60% 20%;
grid-template-rows: 10% 80% 10%;
min-height: 20em;
grid-template-areas:
"header header header"
"main main main"
"footer footer footer"
}
header {
background-color: #59... | |
doc_31480 | {
// Your own code
});
Here above I am showing some sample code in C#. I want similar functionality in C++/CLI but I don't know how to use this expression: "delegate(int < your variable Name>)".
A: If you are using c++cli, then you should be able to use the same Parallel.For that you use in C# since System.Threa... | |
doc_31481 | This issue has only recently started occurring. I've been using DB 1 for quite a while with no issues. The server in the example below is the master of a set of three servers being managed with Sentinel.
redisprod01:6379> set testkey "test"
OK
redisprod01:6379> get testkey
"test"
redisprod01:6379> keys testkey
1) "test... | |
doc_31482 | if map.contains(key):
do_thing(map[key])
else:
do_other_thing(map, key)
However it seems like g++ is unable to optimize successive lookups into a std::unordered_map with the same key; the methods
int f(std::unordered_map<int, int> & map, int key, int defaultValue)
{
if(map.find(key) == map.end()) { return defaul... | |
doc_31483 | I know it's possible to change the font size in all panels at
Tools > Global > Options > Appearance , but it doesn't change the font size in the help tab.
EDIT: I understand the answer will be OS specific. I'm personally using Windows but I'm sure others using a different OS would appreciate answers that address th... | |
doc_31484 |
A: Use WMI to monitor for a process closing event. There's some example code here.
A: You can use the Process class to do this, specifically, its Exited event:
var process = Process.GetProcessesByName("notepad").Single();
// or Process.GetProcessById() if you have the ID
process.EnableRaisingEvents = true;
process.Ex... | |
doc_31485 | File.fnmatch('**.rb', 'main.rb') #=> true
File.fnmatch('**.rb', './main.rb') #=> false
As far as being explained in the the Ruby reference, ** will:
Matches directories recursively or files expansively.
So why doesn't it expands and matches ./main.rb?
A: This behavior is actually... | |
doc_31486 | To do that I found 2 ways:
*
*Use Java API Webservices.
*Use alfresco CMIS.
I don't understand the difference between the two methods.
Can anyone please tell me what is the difference between these?
A: Well, first of all you should take a look to this Overview of Alfresco APIs from which you will discover there ... | |
doc_31487 | How does that system work?
I think there some solutions here,
-Solution1: we program so that each active page will check the message every 5 minutes. This is not too smart since if there's no message, the server still receives the call every 5 min. Imagine there is a million users & if each user opens the page & lives... | |
doc_31488 |
*
*Change unique key attribute to false
*Delete dataset and add it again
I am getting duplicate values for ID so it's intended but how can I stop this annoying error ?
If i preview the data there is no nulls being returned so it's just duplicate value i think..
A: Found it, right clicked on the column and then... | |
doc_31489 | I got a code for a similar thing but it doesn't work on this form since the second field is hidden and it's filled by the page, so the form isn't blank when submitted.
So I want the form not do anything if when submitted what's typed on the first field is under 5 characters.
This is the form:
<form class="questionform"... | |
doc_31490 | library(corrgram)
corrgram(mtcars[2:6], order=TRUE, upper.panel=NULL,
lower.panel=panel.pie,
text.panel=panel.txt,
labels=rep('A very long variable name',4))
This produces
Is there any way to break the variable labels such that they're better readable and not partially covered by the pie... | |
doc_31491 | For class, I cannot use Math.floorMod(), and I have written this after researching the topic:
/**
* Computes {@code a} mod {@code b} as % should have been defined to work.
*
* @param a
* the number being reduced
* @param b
* the modulus
* @return the result of a mod b, which satisfies 0 <... | |
doc_31492 | ||
doc_31493 | My question is based on another existing question here
https://jsfiddle.net/ThinkingStiff/Hcx6H/
in the jsfiddle as you can see if text is Arabic, then direction will be changed accordingly. but it will select only text between `
<div>hello</div>
<div>ظغعظ</div>
How to use that java script to select all texts inside... | |
doc_31494 |
Test class
----------
package com.gaian.adwize.swagger;
import com.gaian.adwize.ssp.main.SSPStarter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.auto... | |
doc_31495 | $data['url_keyword'] = url_title($keyword, '_');
$config['base_url'] = base_url().'image/'.$data['url_keyword'].'/';
$config['per_page'] = 1;
$config['uri_segment']=3;
my urls are: mysite/image/keyword/1 (page2), mysite/image/keyword/2 (page3), mysite/image/keyword/3 (page4), mysite/image/keyword/4 (page5)
When I’m o... | |
doc_31496 | I'm trying to calculate the number of bytes needed for BCD. The formula is rather simple: number of digits, divided by two, rounded up.
So I tried this
int halfRoundedUp = isOddNumberOfDigits ? (numberOfDigitsInParameter/2) : (numberOfDigitsInParameter/2 + 1);
or
int halfRoundedUp = isOddNumberOfDigits ? (numberOfDigi... | |
doc_31497 |
'not defined error' for describe_restaurant().
Here is my code:
class Restaurant():
def __init__(self, r_name, c_type):
self.r_name = r_name
self.c_type = c_type
def describe_restaurant():
print(self.r_name.title())
print(self.c_type.title())
def open_restaurant():
... | |
doc_31498 |
Call to a member function where() on a non-object in C:\xampp\htdocs\CodeIg\application\models\user.php on line 13
I am uncertain as to where to begin debugging this, suggestions would be appreciated.
My code for the model is as follows:
<?php
class User extends CI_model{
function __construct()
{
pa... | |
doc_31499 | i have 4 item to show and want to split like
Is that possible ? if so : how ?
EDIT: I found the solution here : How to make Bottom AppBar like Google Home App?
A: you need to add bottombar with fab as below in your xml
<com.google.android.material.bottomappbar.BottomAppBar
android:id="@+id/bar"
android:l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.