id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_21000 | For example:
V = [12.3 .004 3 4.222];
Desired cell array:
array = {'A = 12.30' 'B = 0.004' 'C = 3' 'D = 4'};
Is there an easier way than calling sprintf for each and every cell?
array = {sprintf('A = %.2f',V(1)) sprintf('B = %.3f',V(2)) ... }
A: There's no vectorized form of sprintf that supports different formats,... | |
doc_21001 | If windows phone had style triggers this would be trivial, but as it doesn't, I have to create a special purpose converter for each scenario like this:
public class StatusToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
va... | |
doc_21002 | I am importing the contents of another large workbook with formatting on the cells but with no formulas (~3mb Excel file) into the problematic Excel workbook. On the first attempt - when the contents have not been imported yet - the import succeeds. I am importing the content via VBA similar to the following code:
App... | |
doc_21003 | However, when I just double-click the file, Windows will pass it to py.exe instead and the start-up time will be around 34 to 37 seconds, which I think is abyssmal. Especially when using a .pyw file instead, which doesn't display a command line window, so you don't even really see that any work is being done in the bac... | |
doc_21004 | I am setting _webView.JaveScriptEnabled = true;
When I load the page using LoadUrl the javascript runs, but the ASP.NET_SessionId that is sent is not the same session id that my other HttpWebRequests send, and I haven't been able to set the CookieContainer:
_webView.LoadUrl(apiBase + "/App/Index");
When I retrieve th... | |
doc_21005 | I am trying to integrate Shippo to our application and wish to obtain a specific value out of a Json response.
I am getting the following Json response:
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"object_created": "2019-08-28T12:58:57.064Z",
"object_id": "16b602e0ajdsk87c431392... | |
doc_21006 | @Component
public class MyClock {
@Autowired
Clock clock;
public long getMilliseconds(LocalDateTime time) {
ZonedDateTime zdt = ZonedDateTime.of(time, clock.getZone());
return time.toInstant(zdt.getOffset()).toEpochMilli();
}
}
So you need an Offset for time.toInstant(). The only way I... | |
doc_21007 | By default Xcode "steps" into the property declaration in the .h file, which is frankly completely useless and a waste of time. If a particular method call takes several properties as parameters and all I want to do is step into the method, I have to step in, step out, step in, step out, step in, step out and step in a... | |
doc_21008 | I am confused about necessity of file system in boat loaders. Is it really required? Why can't we just read enough disk sectors in memory so that we don't need FAT or any file system for that matter?
What happens if we follow below steps:
*
*BIOS loads stage 1 boot loader at 0x7C00.
*Using BIOS interrupt, stage 1 b... | |
doc_21009 | The user configures reminders using the web interface so that other users can be notified when something has to be done, in the future.
I am in the process to develop the scheduler now.
In the past I've used windows-services applications for that purpose but I've realized that I've got too many services now that, basic... | |
doc_21010 | OleDbDataAdapter oleDA = new OleDbDataAdapter();
DataTable dt = new DataTable();
oleDA.Fill(dt, Dts.Variables["My_Result_Set"].Value);
I get the error -
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Object is not an ADODB.... | |
doc_21011 | How can I make a functional query so that i can have the products with product_rating and merchant_rating maximum and doc has a deal price?
How can I put a score field to all these fields?
A: You can sort by a function query using the max value of product_rating and merchant_rating, while using a filter query to limit... | |
doc_21012 | By the way, loaded this as text file using LOAD DATA INFILE.
| |
doc_21013 | * fifteen.c
*
* Computer Science 50
* Problem Set 3
*
* Implements Game of Fifteen (generalized to d x d).
*
* Usage: fifteen d
*
* whereby the board's dimensions are to be d x d,
* where d must be in [DIM_MIN,DIM_MAX]
*
* Note that usleep is obsolete, but it offers more granularity than
* sleep and is si... | |
doc_21014 | my idsample is contained in the table name, so first, I query and substring to get the idsample that I store into an array. Then, I loop for each idsample to get the Lastname and First name.
Here what I have done:
<?php
ob_start();
//Connect to MySQL database
require_once 'configphp';
require_once dirname(__FILE__).'/... | |
doc_21015 | I take the code pull from git.
After that i opened my solution in visual studio.
I cleaned the solution - now it is fine.
then i trying to build the solution it is showing the error.
>Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on th... | |
doc_21016 | or if it's expected git behavior so I can really understand the situation.
So I merged a feature branch and force merged it into my bitbucket repo.
However I'm noticing that some of the commit history is lost when I check it in bitbucket for a certain file.
Let's say it's "File A". In the "feature branch" I made severa... | |
doc_21017 | Is there any way to fix this problem for IE 8??
Thanks in advance.
| |
doc_21018 |
With all the code
Here is the link to my JSFiddle
No matter what I try I can't get the triangle to line up, nor can I get the transparent toolbar area to stretch across the div. Additional, and I have tried changing the z-index the arrow appears under the white sub-nav bar, and the white border doesn't seem to wrap ar... | |
doc_21019 | CREATE TABLE IF NOT EXISTS `test` (
`gid` INT NOT NULL,
`x` INT NOT NULL,
`y` INT NOT NULL,
`z` INT NOT NULL,
`type` INT NOT NULL,
...
PRIMARY KEY ( `gid`, `x`, `y`, `z` ),
UNIQUE INDEX `type_index` ( `gid`, ( CASE WHEN `type` = 1 THEN `type` END ) ),
UNIQUE INDEX `tp_index` ( `gid`, ( CASE WHEN `type... | |
doc_21020 | Below are some information that might be helpful.
Playbook:
---
- name: Checkpoint Hosts Management
hosts: firewalls_checkpoint
tasks:
- name: Add a new Host
check_point.mgmt.cp_mgmt_host:
ip_address: 192.0.2.1
name: New Host 1
state: present
auto_publish_session: yes
Inve... | |
doc_21021 |
*
*The condition should be an environment variable instead of build type (Debug, Release) or architecture.
*If the static library is not used (not imported, not used in the code), then the final binary shouldn't contain any references to it at all.
The code should look like:
#ifdef CRASH_LOGGING
[Crittercism enab... | |
doc_21022 | Can anyone please guide me on this?
My configuration:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
<xmlOutput>true</xmlOutput>
<findbugsXmlOutputDirectory>${project... | |
doc_21023 | Surprisingly I couldn't find arch/x86/kernel/syscall_table_32.S. After some googling I found this. He says syscall_table_32.S is REMOVED, because now syscall table is generated by the script arch/x86/syscalls/syscalltbl.sh, based on arch/x86/syscalls/syscall_{32,64}.tbl.
Now, How do I add my own system call ??
A: O... | |
doc_21024 | [Error] org.testng.TestNGException:
Data Provider public static java.lang.Object[][] mytestpackage.DataProvi.CustomerCreation() throws java.lang.Exception must return either Object[][] or Iterator<Object>[], not class [[Ljava.lang.Object;
at org.testng.internal.MethodInvocationHelper.invokeDataProvider(Metho... | |
doc_21025 | Suppose that we have a standard starting with A and ending with Z, the field delimiter is a pipe | and each field consist of components delimited by a hat ^.
*
*Input1: A|1|1^^3^4^5|loongText|Z
*Input2: A|13|^2^|loongText|Z
The regex should give below output
*
*Output1 : captured groups 1,,3,4,5
*Output2 : captu... | |
doc_21026 | However, combineLatest fires two times which causes a new trip added to the array twice.
private initialTripsSubject = new BehaviorSubject<Trip[]>([]);
initialTrips$ = this.initialTripsSubject.asObservable();
private newTripSubject = new BehaviorSubject<Trip>(null);
addedTrip$ = this.newTripSubject.asObservable()... | |
doc_21027 |
In this figure, I've already changed the coordinate to OpenGL's right-handed coordinate system.
In our real-world scenario,
given the angle FOV/2 and the camera height h then I can get nearest visible point P(0,0,-n).
Given the angle B and the camera height h then I can get a point Q(0,0,-m) between nearest visible... | |
doc_21028 | #!/bin/bash
echo "good"
if [ $? -ne 0 ];then
echo "$? not equal 0"
else
echo "$? equal 0"
fi
echo "good"
ret=$?
if [ $ret -ne 0 ];then
echo "$ret not equal 0"
else
echo "$ret equal 0"
fi
I know,"$?" is used to save the return value of the last function or command, but why is the output as below?
good
1 equal... | |
doc_21029 | dotnet new angular -o my-new-app
My app is working fine. But now I want to add areas in the controller. My sample code is given bellow:
Program.cs file:
app.MapControllerRoute("areas", "{areas:exist}/{controller}/{action=Index}/{id?}");
proxy.conf.js file
const PROXY_CONFIG = [
{
context: [
"/Sys/airport... | |
doc_21030 | I have multiple(1000+) *.gz files in a remote server. I have to read these files and check for certain strings. If the strings matches, I have to return the file name. I have tried the following code. The following program is working but doesnot seem efficient as there is a huge IO involved. Can you please suggest an e... | |
doc_21031 | struct ABC:XYZ {int num;}
where XYZ is also a struct. This does not seem to be a bitfield. What does ':' mean here?
A: The code:
struct ABC:XYZ {int num;}
means "define a struct ABC which inherits from XYZ and has a num member of type int. Specifically the : means "inherits from".
That code is equivalent to:
struct ... | |
doc_21032 | I've added an aspx page UserUpdate.aspx
Also added a web api controller SynchronisePersonnelXmlFromAwsServiceController.cs
Using postman on a POST call if I enter
http://localhost/Workflow/RefreshPersonnel.aspx
I get the correct response the page is displayed in html.
However If I try to call the function TestCall() i... | |
doc_21033 | Book
- Genre
- Author
- Hometown
- Country
I've found that when writing queries using Hasql (or Hasql-TH to be more precise), I end up with this enormous function which takes a huge tuple and constructs my record by effectively consuming this tuple tail-first and constructing these nested record types, b... | |
doc_21034 | Here is what I used to do (which works fine):
conn_drm = pyodbc.connect(
)
query_drm = '''
SELECT *
FROM
WHERE base_file_date = '2022-04-25'
'''
DF = pd.read_sql_query(query_drm, conn_drm)
Now, I would like do to somethig like this:
Yesterday = date.today() - timedelta(days=1)
Yesterday = str(Yesterday)
conn_dr... | |
doc_21035 | For example, use bash to control 10 videos convert by ffmpeg process, bash code needs to watch each ffmpeg process's stdout then decides if send the stdin command [+]/[-]/[c]/[q] or others command to control ffmpeg
the covert job would be something like
ffmpeg -i INPUT_n -c copy -f flv out_n.flv 2>&1 | grep "[MY_PATTER... | |
doc_21036 | location ~ /-/pubsub/subscribe/(.*)$ {
# subscribe to websocket
}
location ~ /-/pubsub/publish/(.*)$ {
# websocket publish endpoint
}
location / {
# reverse proxy to the application server
}
But instead I can do something like this, to "hide" the regexes?
location /-/pubsu... | |
doc_21037 | Everything works, but the listing process... It only return the very first mp3 file in the directory, not the other ones...
This is my code
JAVA:
import java.applet.Applet;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
public class Main extends Applet {
private static final long ... | |
doc_21038 | Docker image: php:5.6-Apache
Apache Version: 2.4
I boosted the logging to trace4 and it appears to figure out the right file - here's the last line of the mod_rewrite debug output
[Thu Mar 16 09:08:15.459987 2017] [rewrite:trace1] [pid 17] mod_rewrite.c(475): [client 192.168.99.1:63990] 192.168.99.1 - - [rs.dev/sid#7f5... | |
doc_21039 | [423.99115959756097, 113.56845980228232, 429.4810943320526, 105.55707869260885, 411.09109879247507, 105.04387943256503, 444.51020250865184, 111.46554256405251, 395.02871954830175, 110.45595140768442, 455.7746649948708, 153.06139303597925, 392.6237135301358, 151.58618644012543, 496.1948133052633, 198.7240759060008, 388.... | |
doc_21040 | You can download the file by clicking on the icon to the right of the rows count dropdown at the top of the table. Recording the network activity (and copying the cURL request) I find that the headers that I need to set, as well as the form data (to get all of the columns in the table):
HEADERS = {
'Connection': 'k... | |
doc_21041 | I have tried adding -Wno-unused-function to both HOST_CFLAGS, HOST_CPPFLAGS, TARGET_CPPFLAGS and TARGET_CFLAGS in the Makefile. I even tried deleting that function whilst make was running!
Unfortunately the error remains.
A: Have you seen this?
The latest flex makes the GRUB-2.00 build fail. I can work around the iss... | |
doc_21042 | I've got the following code for the serve.R:
library(shiny)
df <-read.csv('./CSV/data.csv')
shinyServer(function(input, output) {
output$scatterPlot <- renderHighchart({
hchart(df, "scatter",
hcaes(x=df$revenue,y=df$users,group=df$name_group))
})
})
And for the ui I got:
library(shiny)
library(shinyda... | |
doc_21043 | <a onClick="alert(you are going to tweeter);"href="http://twitter.com" class="tweetbutton" >I Like Twitter</a>
so what happens is it conflicts and two alerts shows up, what I was needing is when the tweetbutton button is click the onclick alert will the one to appear then get redirected to twitter.com without the fun... | |
doc_21044 | please help me to build the query.
Sample Data
Expected Output:
UID
U_Name
role_id
role_name
1
user1
50,60,70
DEV,TEST,QC
2
user2
60,70
TEST,QC
3
user3
60,70
QC
A: select Uid, user_name,
LISTAGG(role_id,',')
WITHIN GROUP(ORDER BY role_id) AS role_id,
LISTAGG(role_name,',')
WITHIN GROUP(ORDER BY role_n... | |
doc_21045 |
A: command : netsh wlan add profile filename="C:\Users\m\Documents\wi-fi-wifiname.xml" Interface="WI-FI" user=current (enter)
command : netsh wlan connect ssid=YOUR_WIFI_NAME name=PROFILE_NAME (enter)
| |
doc_21046 | ├── server
│ ├── Cargo.toml
│ └── src
│ └── main.rs
├── client
│ ├── Cargo.toml
│ └── src
│ └── main.rs
How can i share between them some functions like:
pub fn todo() -> i32 {
2
}
Variables that will be different based on build arguments.
And how to make it work if server and client will be b... | |
doc_21047 | If I do so I am getting following error:
[xjc] Compiling file:/sources/resources/cXML.dtd
[xjc] [ERROR] Property "Name" is already defined. Use <jaxb:property> to resolve this conflict.
[xjc] line 706 of file:/sources/resources/cXML.dtd
The above can be solved by introducing jaxb bindings. Following binding... | |
doc_21048 | It seems that ZK is mainly used for front end purposes while JBoss is for the real server stuff.
Please could someone advise me on which is better and why OR whether the two belong to different realms and therefore should not be compared
A: ZK is a RIA framework so that is covering the frontend. JBoss Seam is a framew... | |
doc_21049 | void cleanup_module(void)
{
/*
* Unregister the device
*/
if(unregister_chrdev(Major, DEVICE_NAME)<0)
printk(KERN_ALERT "Error in unregister_chrdev:\n");
}
and error:
/home/student/kernel/hello.c: In function ‘cleanup_module’:
/home/student/kernel/hello.c:39:2: error: void value not ignore... | |
doc_21050 |
|id - int auto inc PK
|uid - int indexed
|fid - int indexed
Besides disk/memory usage, is there a way to know approximately how many friends/rows per user before it starts affecting performance?
I'm looking for a algorithm, rule of thumb, etc. ? The only thing I can think of is load testing it with X rows but I'm ho... | |
doc_21051 | 'user.socialaccount_set.all.0.get_avatar_url '
However, what I want to do is extract all user's avatar from User model but above code only gives me one user's avatar.
I guess I have to link user's avatar with django's User model or store it somewhere.
Could anyone teach me how to do that?
Ref:
http://django-allauth.re... | |
doc_21052 | void
LocationDb::setServingRouter(string sensor, string oAp, string nAp) {
m_conn.update("location_db.ldb",
BSON("id" << sensor << "name" << "/temp/s/1" << "ap" << BSON("name" << oAp)),
BSON("id" << sensor << "name" << "/temp/s/1" << "ap" << BSON("name" << nAp)));
}
This update... | |
doc_21053 | <Wrapper apiKey="My-API-key-comes-here" render={render}>
<GoogleMap />
</Wrapper>
Whilst I managed to hide the key from the API calls themselves (I also use the Geocoding API) by calling them from a backend, I don't know how to hide the API key when it is a prop.
I tried:
<Wrapper apiKey={process.env.GOOGLE_API_KE... | |
doc_21054 | Here's my basic situation:
I have a ScreenManager similar to the one outlined in this tutorial. Using the screen manager, I switch between several FXML screens using basic action handling on the screen buttons.
The problem is that one of these is a game screen with a map. I'll be drawing a tile-based map onto this game... | |
doc_21055 | When I run commenad Get-AzVM I have error message: et-AzVM: Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up your Azure credentials.
Any tips and help please?
A: There could be possibility that your account is associated with the more than one tenant. In one of the te... | |
doc_21056 | 11/28 11:14:32: Launching 'app' on Unknown Device.
Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
APK signature verification failed.
Retry
I tried searching google as to why this might happen, but I only found things concerning the generation of a signed apk ... | |
doc_21057 | http_send_content_disposition($filename,true);
http_send_content_type('video/mp4');
http_send_file($file);
And so I am attempting to convert this to the 2.0 Pecl HTTP code and it is not working. Here's what I have so far:
$res = new http\Env\Response;
$res->setContentType('video/mp4');
$res->setContentDisposition(["f... | |
doc_21058 | create table sample
(
column1 AS (SELECT COUNT(*) FROM table2) PERSISTED
)
A: For SQL Server you could potentially do this with an Indexed View.
Those present a host of other restrictions, though, so be sure the value is enough to justify the increased effort in maintenance.
One of the handier aspects of indexed ... | |
doc_21059 | How can I do it?
so far my code is:
caffe.reset_all(); % reset caffe
caffe.set_mode_gpu();
gpu_id = 0; % we will use the first gpu in this demo
caffe.set_device(gpu_id);
net_model = [model_dir, 'train_images.prototxt'];
net = caffe.Net(net_model, 'train');
net.blobs('conv1').set_data([1,1,0]);
A: The following wor... | |
doc_21060 | but i have tried with AVMutableVideoComposition.
MainInstruction.layerInstructions = [NSArray arrayWithObjects:FirstlayerInstruction,nil];
AVMutableVideoComposition *MainCompositionInst = [AVMutableVideoComposition videoComposition];
MainCompositionInst.instructions = [NSArray arrayWithObject:MainInstruction]... | |
doc_21061 | My code uses a MATLAB Exchange function which optimize a numerical value that is important to be with 32 digits after the dot such as
0.59329669191989231613604260928696
The optimization function can be found here and it is called fminsearchbnd
The optimization function calculate this and store the value in a variable ... | |
doc_21062 | Who is responsible to free the allocated memory?
My method look like this:
char* inet_aton_(unsigned int atonIp){
in_addr sin_addr;
sin_addr.s_addr = atonIp;
return inet_ntoa(sin_addr);
}
A: Quoting manpage:
The string is returned in a statically allocated buffer, which subsequent calls will overwrite.
... | |
doc_21063 | "Couldn't get batched bridge, make sure your package is bundled correctly"
Please help me to fix it- Am using windows machine
A: I had the same problem in a Windows machine when following the Getting Started tutorial, and using Visual Studio Emulator for Android.
In my case, I found out that it was failing because it... | |
doc_21064 | I pass as argh[1] the input text file, and as argh[2] the output binary file
This is the code
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
#include <Windows.h>
#include <tchar.h>
#include <stdio.h>
#define MAX_CHAR 100
typedef struct asd{
DWORD id;
DWORDLONG regnum;
TCH... | |
doc_21065 | Route::domain('{shop_seo_code}.shops.domain.com')->group(function () {
Route::any('/', [
'as' => 'shops_view',
'uses' => 'Shops@view'
]);
});
How can I generate the full URL using "route" function? as I also need, to somehow, provide "shop_seo_code".
Example: route('shops_view', ['shop_seo_code... | |
doc_21066 | Thanks.
from numpy.polynomial import Polynomial as poly
import numpy as np
import matplotlib.pyplot as plt
import pymongo
import json
import pandas as pd
df = pd.read_csv(r'D:\polynomial\points.csv')
print(df)
x= np.array(df['Wavelength(A)'].tolist())
x= np.divide([299792.458], x)
y= np.array(df['Level(A)'].tolist... | |
doc_21067 | public class AddItemActivity extends AppCompatActivity {
private EditText mItemName;
private String mItemNameString;
private EditText mItemDescription;
private String mItemDescriptionString;
private EditText mItemPrice;
private String mItemPriceString;
private Button mAddItemButton;
pri... | |
doc_21068 | tibble(x = rep(1:3, 2),
y = list(1:5, 1:10, 10:20, 20:40, 1:50, 5:10)) -> df
df
#> # A tibble: 6 × 2
#> x y
#> <int> <list>
#> 1 1 <int [5]>
#> 2 2 <int [10]>
#> 3 3 <int [11]>
#> 4 1 <int [21]>
#> 5 2 <int [50]>
#> 6 3 <int [6]>
I want to group_by 'x' and summmari... | |
doc_21069 | We have a model ticket that has an ID and a QR code, both of which are always unique.
To query the status of a ticket, I'm sure this should look obviously like this:
GET /tickets/:id
But what should the design of the QR code API look like?
By also using GET /tickets/:id it would be unclear to the user which locator is... | |
doc_21070 | <?php
ob_start();
session_start();
include_once 'dbconnect.php';
// if session is not set this will redirect to login page
if( !isset($_SESSION['user']) ) {
header("Location: index.php");
exit;
}
$res=mysql_query("SELECT * FROM users WHERE userId=".$_SESSION['user']);
... | |
doc_21071 | The argument type 'List<Slots?>?' can't be assigned to the parameter type 'List?' at lib/responsemodels/appointment/calendar/calendar_response.g.dart:17:5
Highlighted the error throwing line below
calendar_response.dart
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'calendar_response.dart';
// *****************... | |
doc_21072 | it seems like it did not show the required dates (daily) in the x-axis. How can I fix this chart?
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.style.use(['ggplot'])
import seaborn as sns
sns.set_style("whitegrid")
fig, g = plt.subplots(figsize = (20,6))
g = sns.lineplot(x="photosim_d... | |
doc_21073 | Currently my table is like this,
CREATE TABLE `work_shift` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`shift_name` varchar(100) DEFAULT NULL,
`time_from` time NOT NULL,
`time_to` time NOT NULL
KEY `biz_company_id` (`tbl_school_system_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8
Sample Data is:... | |
doc_21074 | Can i use something like this?
select
a as abc
b as xyz
from ( CASE when @type = 1 then tblSales
when @type = 2 then tblTransfer
end
)
A: I'd probably do something like:
SELECT a AS abc, b AS xyz FROM tblSales WHERE @type=1
UNION ALL
SELECT a AS abc, b AS xyz FROM tblTransfer WHERE @type=2
A: Is... | |
doc_21075 | I am looking to create a string for both facebook and twitter
So if the user typed koodoocreative for the Twitter string, I would convert it to...
http://www.twitter.com/koodoocreative
Same with Facebook, I would essentially create the URL
http://www.facebook.com/koodoocreative
Can I also check if the http:// has b... | |
doc_21076 | Labyrinth labyrinth = new Labyrinth();
labyrinth.setManual(labyrinth.getLabyrinth[x][y]);
A: As mentionned by saka1029 in his comment, you can create a method inside your labyrinth class that will set manual[x][y] to the value you want.
public class Labyrinth {
private boolean[][] manual = new boolean[21][21];
... | |
doc_21077 | it prints "begin download" and then exits,why the delegates method does not be executed?
what's wrong in the example code?
thanks
main.m
#import <Foundation/Foundation.h>
#import "Test.h"
int main(int argc, const char * argv[])
{
@autoreleasepool {
Test * test = [[Test alloc]init];
[test downloa... | |
doc_21078 | Basically I have a string e.g
1) "/0/bar"
2) "/build/0/foo/1"
and need to convert this into a multidimensional array
1) $result[0][bar]
2) $result[build][0][foo][1]
So far I've tried:
$query = "/build/0/foo/1";
$queryAr = [];
$current = &$queryAr;
$keys = explode("/", $query);
foreach($keys as $key) {
@$curren... | |
doc_21079 | How would one avoid the use of unwrap in a closure, like in this example?
// todo is VecDeque<PathBuf>
let dir = fs::read_dir(&filename).unwrap();
todo.extend(dir.map(|dirent| dirent.unwrap().path()));
The first unwrap can be easily changed to ?, as long as the containing function returns Result<(), io::Error> or simi... | |
doc_21080 | I use for this function Replace, this is my code:
sObserved = Replace(sObserved, "&", "&")
sObserved = Replace(sObserved, ";", ";")
But this can't work good, because when it will replace "&" on "&", the ";" will appear and next operation will change it to "&;"
If I'll change an orde... | |
doc_21081 | "a:3:{
i:0;
a:1:{s:10:"Adult Name";s:11:"Mohamed";}
i:1;
a:1:{s:10:"Adult Name";s:11:"Mathew";}
i:2;
a:1:{s:10:"Adult Name";s:11:"Paul";
i:3;
a:1:{s:10:"Adult Name";s:11:"John";}
}"
I want to extract the names into seprate fields like:
A B
*
*Adult 1: Mohamed
*Adult 2: Mathew
*Adult 3: Paul
*Adult... | |
doc_21082 | Is there a way to convert it?
Sample code:
string radioType = "Unknown";
switch (wifiNetwork.PhyKind)
{
case WiFiPhyKind.Ofdm:
radioType = "?????";
break;
case WiFiPhyKind.Erp:
radioType = "?????";
break;
case WiFiPhyKind.HT:
radioType = "?????";
break;
... | |
doc_21083 | Why am i after such utilities, primarily so i can integrate them into the groovy shell.
A: Some (mostly text-processing related) unix commands are implemented here: http://www.unix4j.org
A: I am unaware of a pre-cooked, drop in jar, and this same question on superuser indicates there isnt one. However, libraries suc... | |
doc_21084 | My problem is, 10 seconds gc pause two much, i use GC setting like below. Is there any suggestion?
java -Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=9010 \
-Dcom.sun.management.jmxremote.local.only=false \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote... | |
doc_21085 | <xsd:element name="ServiceResponse">
<xsd:sequence>
<xsd:element ref="s:ServiceResponseHeader" />
<xsd:element ref="s:ServiceResponseBody" />
</xsd:sequence>
</xsd:element>
<xsd:element name="ServiceResponseHeader" type="s:HeaderType" />
<xsd:element name="ServiceResponseBody" type="xsd:anyType" />
<xsd:c... | |
doc_21086 | get ':foo(/:bar)/:baz(/:qux)/:slug', to: 'application#show', constraints: { baz: /.+?\-\d+/ }, as: test
With this configuration, it works fine if I omit :bar in my path :
foo/baz-123/qux-quux/test
The controller returns the following parameters : {foo: 'foo', baz: 'baz-123', qux: 'qux-quux', slug: 'test'}
Now, the spe... | |
doc_21087 | Looks like it's convertion problem. Is there a way to fix this?
I, [2017-10-28T14:02:19.923386 #56398] INFO -- : [49eba256-de7f-48df-8d00-05148a6495d3] Completed 500 Internal Server Error in 286ms (ActiveRecord: 9.5ms)
F, [2017-10-28T14:02:19.925305 #56398] FATAL -- : [49eba256-de7f-48df-8d00-05148a6495d3]
F, [2017... | |
doc_21088 | /Date(1320120000000-0400)/
How do I convert it to a readable format (e.g. 11/31/2011) using Javascript?
A: This is the number of milliseconds since epoch:
new Date(1320120000000) //Tue Nov 01 2011 05:00:00 GMT+0100 (CET)
However, -0400 seems to be a GMT offset which you also have to apply. I guess it has a format of ... | |
doc_21089 | What is the use of Home?=, isn't it the LogIn.aspx is the name of the page how come it's still redirecting if it has Home?=. Can someone answer this question of mine please, and explain it very well.
String url = "LogIn.aspx?Home?=" + Username;
Response.Redirect(url);
A: Update
Working from all your comments, the ans... | |
doc_21090 | How I can do it with perfect vertical centering?
I tried this method without optimal results:
1) "Margin-top:auto" and "margin-bottom: auto" method:
div {position:relative}
input {padding: 1em}
.currency {
position:absolute;
right:0.4em;
height:50%;
top:0;
bottom:0;
margin-top:auto;
margin-bottom:auto
}
<div... | |
doc_21091 |
A: Also, same thing as 'Print Description' is to type po variableName in the debugger console.
A: You should be able to see at least an abbreviated string in the variables pane when you expand a NSMutableArray. If you can't, that suggest you don't actually have strings as elements.
In the variables pane, control-cli... | |
doc_21092 | Knockout data-bind is created some html codes with foreach , when I want to reach input in this html, my code does not work correct. My app.mako file code :
.....
<div data-bind="foreach: submissionVariables" style="margin-bottom: 20px">
<div class="row-fluid">
<span data-bind="text: name" class="span3"></span>
... | |
doc_21093 | These are the steps I have followed so far. Please suggest how to get a dataframe in such a case. Thanks.
df3 = read_xml("E:\\IIMU\\Databases\\USPTO\\2020-2022-pairbulk-full-20220613-xml\\2022.XML") %>% as_list()
df3a = tibble::as_tibble(df3) %>% unnest_longer('PatentBulkData')
The output obtained is as below.
Output... | |
doc_21094 | main()
{ int x=10; // extra line added...
char *p=x;
printf("%d", &p)
printf("%d", &p[0]);
printf("%d" , &p[1]);
}
This code gives output
Address of 10..
10
11
how are the last two outputs are coming.. Can anyone explain it to me ..?
Code changed.....
A: This is Undefined Behavior.
The pointer needs ... | |
doc_21095 | Then I created a custom control called "TextField", that inherits from Field, that should put a TextBox into the Content.
Here are the styles in Generic.xaml :
<Style TargetType="{x:Type controls:Field}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:F... | |
doc_21096 | Rendering loop:
while (!done)
{
/* --------------------------------------------------------------------- */
/* 1. Peel the first layer */
/* --------------------------------------------------------------------- */
glBindFramebuffer(GL_FRAMEBUFFER, frontColo... | |
doc_21097 | Is there a way to implement this using a map or a similar structure somehow combining a map and a queue in C++11?
UPDATE: I wanted to this with a std::unsorted_map. Unfortunately I'm heavily missing std::map functions which would help. The unordered list seems neither to support rbegin() nor does its iterator support t... | |
doc_21098 | class School {
constructor(name, level, numberOfStudents) {
this._name = name;
this._level = level;
this._numberOfStudents = numberOfStudents;
}
static pickSubstituteTeacher(substituteTeachers) {
let ranNum = Math.floor(Math.random()*substituteTeachers.length);
return substituteTeachers[ranNu... | |
doc_21099 | I am getting a 200(success) instead of a 302(re-direct) for the http response, I am getting 2 instead of 3 cookie headers as a response.
How do I allow re-directs ? Any input would be nice.
My code is:
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
try {
httppost.set... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.