problem
stringlengths 26
131k
| labels
class label 2
classes |
|---|---|
static int query_formats(AVFilterGraph *graph, AVClass *log_ctx)
{
int i, j, ret;
int scaler_count = 0, resampler_count = 0;
int count_queried = 0;
int count_merged = 0;
int count_already_merged = 0;
int count_delayed = 0;
for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *f = graph->filters[i];
if (formats_declared(f))
continue;
if (f->filter->query_formats)
ret = filter_query_formats(f);
else
ret = ff_default_query_formats(f);
if (ret < 0 && ret != AVERROR(EAGAIN))
return ret;
count_queried += ret >= 0;
}
for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph->filters[i];
for (j = 0; j < filter->nb_inputs; j++) {
AVFilterLink *link = filter->inputs[j];
int convert_needed = 0;
if (!link)
continue;
if (link->in_formats != link->out_formats
&& link->in_formats && link->out_formats)
if (!can_merge_formats(link->in_formats, link->out_formats,
link->type, 0))
convert_needed = 1;
if (link->type == AVMEDIA_TYPE_AUDIO) {
if (link->in_samplerates != link->out_samplerates
&& link->in_samplerates && link->out_samplerates)
if (!can_merge_formats(link->in_samplerates,
link->out_samplerates,
0, 1))
convert_needed = 1;
}
#define MERGE_DISPATCH(field, statement) \
if (!(link->in_ ## field && link->out_ ## field)) { \
count_delayed++; \
} else if (link->in_ ## field == link->out_ ## field) { \
count_already_merged++; \
} else if (!convert_needed) { \
count_merged++; \
statement \
}
if (link->type == AVMEDIA_TYPE_AUDIO) {
MERGE_DISPATCH(channel_layouts,
if (!ff_merge_channel_layouts(link->in_channel_layouts,
link->out_channel_layouts))
convert_needed = 1;
)
MERGE_DISPATCH(samplerates,
if (!ff_merge_samplerates(link->in_samplerates,
link->out_samplerates))
convert_needed = 1;
)
}
MERGE_DISPATCH(formats,
if (!ff_merge_formats(link->in_formats, link->out_formats,
link->type))
convert_needed = 1;
)
#undef MERGE_DISPATCH
if (convert_needed) {
AVFilterContext *convert;
AVFilter *filter;
AVFilterLink *inlink, *outlink;
char scale_args[256];
char inst_name[30];
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
if (!(filter = avfilter_get_by_name("scale"))) {
av_log(log_ctx, AV_LOG_ERROR, "'scale' filter "
"not present, cannot convert pixel formats.\n");
return AVERROR(EINVAL);
}
snprintf(inst_name, sizeof(inst_name), "auto-inserted scaler %d",
scaler_count++);
if ((ret = avfilter_graph_create_filter(&convert, filter,
inst_name, graph->scale_sws_opts, NULL,
graph)) < 0)
return ret;
break;
case AVMEDIA_TYPE_AUDIO:
if (!(filter = avfilter_get_by_name("aresample"))) {
av_log(log_ctx, AV_LOG_ERROR, "'aresample' filter "
"not present, cannot convert audio formats.\n");
return AVERROR(EINVAL);
}
snprintf(inst_name, sizeof(inst_name), "auto-inserted resampler %d",
resampler_count++);
scale_args[0] = '\0';
if (graph->aresample_swr_opts)
snprintf(scale_args, sizeof(scale_args), "%s",
graph->aresample_swr_opts);
if ((ret = avfilter_graph_create_filter(&convert, filter,
inst_name, graph->aresample_swr_opts,
NULL, graph)) < 0)
return ret;
break;
default:
return AVERROR(EINVAL);
}
if ((ret = avfilter_insert_filter(link, convert, 0, 0)) < 0)
return ret;
filter_query_formats(convert);
inlink = convert->inputs[0];
outlink = convert->outputs[0];
av_assert0( inlink-> in_formats->refcount > 0);
av_assert0( inlink->out_formats->refcount > 0);
av_assert0(outlink-> in_formats->refcount > 0);
av_assert0(outlink->out_formats->refcount > 0);
if (outlink->type == AVMEDIA_TYPE_AUDIO) {
av_assert0( inlink-> in_samplerates->refcount > 0);
av_assert0( inlink->out_samplerates->refcount > 0);
av_assert0(outlink-> in_samplerates->refcount > 0);
av_assert0(outlink->out_samplerates->refcount > 0);
av_assert0( inlink-> in_channel_layouts->refcount > 0);
av_assert0( inlink->out_channel_layouts->refcount > 0);
av_assert0(outlink-> in_channel_layouts->refcount > 0);
av_assert0(outlink->out_channel_layouts->refcount > 0);
}
if (!ff_merge_formats( inlink->in_formats, inlink->out_formats, inlink->type) ||
!ff_merge_formats(outlink->in_formats, outlink->out_formats, outlink->type))
ret = AVERROR(ENOSYS);
if (inlink->type == AVMEDIA_TYPE_AUDIO &&
(!ff_merge_samplerates(inlink->in_samplerates,
inlink->out_samplerates) ||
!ff_merge_channel_layouts(inlink->in_channel_layouts,
inlink->out_channel_layouts)))
ret = AVERROR(ENOSYS);
if (outlink->type == AVMEDIA_TYPE_AUDIO &&
(!ff_merge_samplerates(outlink->in_samplerates,
outlink->out_samplerates) ||
!ff_merge_channel_layouts(outlink->in_channel_layouts,
outlink->out_channel_layouts)))
ret = AVERROR(ENOSYS);
if (ret < 0) {
av_log(log_ctx, AV_LOG_ERROR,
"Impossible to convert between the formats supported by the filter "
"'%s' and the filter '%s'\n", link->src->name, link->dst->name);
return ret;
}
}
}
}
av_log(graph, AV_LOG_DEBUG, "query_formats: "
"%d queried, %d merged, %d already done, %d delayed\n",
count_queried, count_merged, count_already_merged, count_delayed);
if (count_delayed) {
AVBPrint bp;
if (count_queried || count_merged)
return AVERROR(EAGAIN);
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
for (i = 0; i < graph->nb_filters; i++)
if (!formats_declared(graph->filters[i]))
av_bprintf(&bp, "%s%s", bp.len ? ", " : "",
graph->filters[i]->name);
av_log(graph, AV_LOG_ERROR,
"The following filters could not choose their formats: %s\n"
"Consider inserting the (a)format filter near their input or "
"output.\n", bp.str);
return AVERROR(EIO);
}
return 0;
}
| 1threat
|
GH pages deploy via admin interface : <p>The video on
<a href="https://www.getlektor.com/docs/deployment/travisci/" rel="nofollow">https://www.getlektor.com/docs/deployment/travisci/</a></p>
<p>describes the set-up nicely.</p>
<p>Is there an option to make run the whole local git committing & pushing via the publish link in the admin interface?</p>
| 0debug
|
Don't understand the output of the given code : <p>Just jumped into C++ and tried to run the following code:</p>
<pre><code>#include <iostream>
using namespace std;
class BST_Node{
private:
int val;
BST_Node* left;
BST_Node* right;
public:
void setVal(int);
int getVal();
void setLeft(BST_Node*);
BST_Node* getLeft();
void setRight(BST_Node*);
BST_Node* getRight();
BST_Node(int val){this->val=val;this->left=nullptr;this->right=nullptr;}
};
class BST{
private:
BST_Node* root;
public:
void setBSTRoot(BST_Node* node){root=node;}
BST_Node* getBSTRoot(){return this->root;}
};
BST createBST(int*, int);
void placeNode(BST_Node*, int);
void BST_Node::setVal(int val){
this->val = val;
cout<<"11: "<< val << endl;
}
int BST_Node::getVal(){
return this->val;
}
void BST_Node::setLeft(BST_Node* left){
this->left = left;
}
void BST_Node::setRight(BST_Node* right){
this->right = right;
}
BST_Node* BST_Node::getLeft(){
return this->left;
}
BST_Node* BST_Node::getRight(){
return this->right;
}
void print_inorder(BST_Node root){
cout<<"working"<<endl;
if(root.getLeft()!=nullptr){
print_inorder(*(root.getLeft()));
}
cout<<"*"<<root.getLeft()->getVal() <<"*" << endl;
cout<<"*"<<root.getVal() <<"*" << endl;
cout<<"*"<<root.getRight()->getVal() <<"*" << endl;
}
BST createBST(int* arr, int arr_size){
BST obj_bst;
BST_Node* root;
cout<<"0 "<<endl;
root = obj_bst.getBSTRoot();
cout<<"1: "<< (*arr) << endl;
//cout<<"create BST " << root->getVal() <<endl;
root->setVal(*arr);
cout<<"2 "<<endl;
cout<<"create BST " << root->getVal() <<endl;
for(int i=1;i<arr_size;i++){
cout<<"create BST " << root->getVal() <<endl;
int curr_val = *(arr+i);
placeNode(root,curr_val);
}
cout<<"create BST " << root->getVal() <<endl;
return obj_bst;
}
void placeNode(BST_Node* root, int curr_val){
int root_val = root->getVal();
if((curr_val>root_val) && (root->getRight()!=nullptr) ){
placeNode(root->getRight(), curr_val);
}else if((curr_val<=root_val) && (root->getLeft()!=nullptr)){
placeNode(root->getLeft(), curr_val);
}else if((curr_val>root_val) && (root->getRight()==nullptr)){
BST_Node node(curr_val);
root->setRight(&node);
}else if((curr_val<=root_val) && (root->getLeft()==nullptr)){
BST_Node node(curr_val);
root->setLeft(&node);
}else{
cout<< "Placement denied" << endl;
}
}
//void createBST(int* arr, int arr_size);
int main(){
int arr[10] = {23,23,34,1,2,343,343,23,4343};
cout<<"working"<<endl;
BST obj_bst = createBST(arr, 10);//sizeof(arr)/sizeof(int)
cout<<"working"<<endl;
BST_Node root = *(obj_bst.getBSTRoot());
cout<<"working"<<endl;
print_inorder(root);
cout<<"working"<<endl;
return 0;
}
</code></pre>
<p>The output I got is:
"
working
0
1: 23
"
The execution stops after "root->setVal(*arr);" line in the "createBST" method. Any explanation would be highly appreciated. Thanks!</p>
<p>Sorry about too much code. I did not know what else could have been done here to post the question.</p>
| 0debug
|
Using Try and Catch but can't retry ... JAVA : [enter image description here][1]
THE PIC OF THE CODE IS IN THE LINK ABOVE
[1]: https://i.stack.imgur.com/d78UP.png
hello , I have a problem ... I'm using try n catch in order to avoid the error and to show a message and ask the user to retry .... but actually the error still there it just shows the message but don't give us the chance to retry ...i don't understand why , Hope someone can help .Thanks anyway.
| 0debug
|
Rails 5.1 Routes: dynamic :action parameters : <p>Rails 5.0.0.beta4 introduced a deprecation warning on routes containing dynamic :action and :controller segments: </p>
<pre><code>DEPRECATION WARNING: Using a dynamic :action segment in a route is deprecated and will be removed in Rails 5.1.
</code></pre>
<p><a href="https://github.com/rails/rails/pull/23980">The commit message from this PR</a> states: </p>
<blockquote>
<p>Allowing :controller and :action values to be specified via the path
in config/routes.rb has been an underlying cause of a number of issues
in Rails that have resulted in security releases. In light of this
it's better that controllers and actions are explicitly whitelisted
rather than trying to blacklist or sanitize 'bad' values.</p>
</blockquote>
<p>How would you go about "whitelisting" a set of action parameters? I have the following in my routes file, which are raising the deprecation warning: </p>
<pre><code>namespace :integrations do
get 'stripe(/:action)', controller: 'stripe', as: "stripe"
post 'stripe/deactivate', controller: 'stripe', action: 'deactivate'
end
</code></pre>
| 0debug
|
Cannot find module 'eslint-config-defaults/configurations/eslint' : <p>I am new to working with the light version of Visual Studio Code and for the life of me I cannot figure out how to resolve this error.</p>
<p>I've tried to pull in any type of file the even closely resembles the terms .eslint but i always get this error. I am sure it is a config error but I do not know how to work with the config just yet.</p>
<p>Any suggestions?</p>
<p>I am taking a Node.js course and they are using this light version and i would like to use it as well because it is somewhat faster for taking classes and so on.</p>
<p><strong>Error</strong></p>
<pre><code>Cannot find module 'eslint-config-defaults/configurations/eslint'
</code></pre>
<p><a href="https://i.stack.imgur.com/7fnxp.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/7fnxp.jpg" alt="eslint Error - Look at the very top of the enviroment"></a></p>
| 0debug
|
Android studio url plus string : How can i convert
String firebase = ("http// blah blah.com");
The users will input there account from eedittex.
String account = string.valueof(AAcount.gettext.tostring);
String url = fribase + account;
Into url?
Is it possible?.
Can someone please help me with this.
Tnx in advance !
| 0debug
|
Use Hex color in SwiftUI : <p>in UIKit we could use an Extension to set hex color to almost everything.
<a href="https://www.hackingwithswift.com/example-code/uicolor/how-to-convert-a-hex-color-to-a-uicolor" rel="noreferrer">https://www.hackingwithswift.com/example-code/uicolor/how-to-convert-a-hex-color-to-a-uicolor</a></p>
<p>but when I'm trying to do it on SwiftUI, it's not possible, it looks like the SwiftUI does not get the UIColor as parameter.</p>
<pre><code> Text(text)
.color(UIColor.init(hex: "FFF"))
</code></pre>
<p>error message: </p>
<pre><code>Cannot convert value of type 'UIColor' to expected argument type 'Color?'
</code></pre>
<p>I even tried to make an extension for <code>Color</code>, instead of <code>UIColor</code>, but I haven't any luck</p>
<p>my extension for Color:</p>
<p>import SwiftUI</p>
<pre><code>extension Color {
init(hex: String) {
let scanner = Scanner(string: hex)
scanner.scanLocation = 0
var rgbValue: UInt64 = 0
scanner.scanHexInt64(&rgbValue)
let r = (rgbValue & 0xff0000) >> 16
let g = (rgbValue & 0xff00) >> 8
let b = rgbValue & 0xff
self.init(
red: CGFloat(r) / 0xff,
green: CGFloat(g) / 0xff,
blue: CGFloat(b) / 0xff, alpha: 1
)
}
}
</code></pre>
<p>error message:</p>
<pre><code>Incorrect argument labels in call (have 'red:green:blue:alpha:', expected '_:red:green:blue:opacity:')
</code></pre>
| 0debug
|
bool memory_region_is_logging(MemoryRegion *mr)
{
return mr->dirty_log_mask;
}
| 1threat
|
Open current editing file in explorer tree : <p>I'm wondering if there is a <strong>shortcut</strong> for VS Code that <strong>highlights</strong> in solution explorer tree current opened file. Like we have in Visual Studio:</p>
<pre><code>Alt + Shift + L
</code></pre>
| 0debug
|
angular: HttpClient map response : <p>Currently I'm switching from http (@angular/http) to HttpClient (@angular/common/http) and have problems mapping my response to objects.</p>
<p>Old code (was working before)</p>
<pre><code>this.http.get(environment.baseUrl + '/api/timeslots')
.map((response: Response) => {
const data = response.json();
const timeslots = Array.of<Timeslot>();
for (const item of data) {...}
</code></pre>
<p>New code, but compilation error:</p>
<pre><code>this.httpClient.get(environment.baseUrl + '/api/timeslots')
.map((response: Response) => {
const data = <Timeslot[]> response;
const timeslots = Array.of<Timeslot>();
for (const item of data) {...}
</code></pre>
<p>Do I miss a cast? The response is an array of Timeslots. </p>
| 0debug
|
How to write xpath? : What should be the XPath for this ?? To do MovetoElement, I need to inspect this element, I tried using //a[@class='product-name'] but multiple nodes get selected.
<a class="product-name" itemprop="url" title="Faded Short Sleeve T-shirts" href="http://automationpractice.com/index.php?id_product=1&controller=product"> Faded Short Sleeve T-shirts </a>
| 0debug
|
How to sort an array of objects in Swift : <p>I have the following Java code below that I am trying to convert to Swift. I would really appreciate if somebody can help me on this issue.</p>
<p>Thanks</p>
<pre><code>private static class CarComparator implements Comparator<Car>{
public int compare(Car o1, Car o2)
{
return o1.name.compareTo(o2.name);
}
}
List<Car> cars = new ArrayList<Car>();
Collections.sort(cars, new CarComparator());
</code></pre>
| 0debug
|
rdt_free_context (PayloadContext *rdt)
{
int i;
for (i = 0; i < MAX_STREAMS; i++)
if (rdt->rmst[i]) {
ff_rm_free_rmstream(rdt->rmst[i]);
av_freep(&rdt->rmst[i]);
}
if (rdt->rmctx)
av_close_input_stream(rdt->rmctx);
av_freep(&rdt->mlti_data);
av_free(rdt);
}
| 1threat
|
How to configure axios to use SSL certificate? : <p>I'm trying to make a request with axios to an api endpoint and I'm getting the following error: <code>Error: unable to verify the first certificate</code></p>
<p>It seems the https module, which axios uses, is unable to verify the SSL certificate used on the server.</p>
<p>When visiting the server with my browser, the certificate is valid and I can see/download it. I can also make requests to the api on my browser through https.</p>
<p>I can work around it by turning off verification. This code works.</p>
<pre><code>const result = await axios.post(
`https://${url}/login`,
body,
{
httpsAgent: new https.Agent({
rejectUnauthorized: false
})
}
)
</code></pre>
<p>Problem is, this doesn't verify the SSL certificate and therefore opens up security holes.</p>
<p>How can I configure axios to trust the certificate and correctly verify it?</p>
| 0debug
|
static void do_info_balloon(Monitor *mon, QObject **ret_data)
{
ram_addr_t actual;
actual = qemu_balloon_status();
if (kvm_enabled() && !kvm_has_sync_mmu())
qemu_error_new(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon");
else if (actual == 0)
qemu_error_new(QERR_DEVICE_NOT_ACTIVE, "balloon");
else
*ret_data = qobject_from_jsonf("{ 'balloon': %" PRId64 "}",
(int64_t) actual);
}
| 1threat
|
What for the new keyword is used in C# before attribute class name? : What for the new keyword is used in C# before attribute class name?
I am using Rider and it suggests to place a new keyword before attribute names pretty often.
public class MyClass{
new AttributeClass attribute;
...
}
| 0debug
|
SQL : find words that repeat in differents rows of a table : For exemple, I have that table
id title
1 abcd apple
2 adqsdd google
3 adzdaz android
4 gdfgdfg apple
5 yuiyu windows
so, we can see that the word **"apple"** is repeated in différents rows.
How can I do a SQL Query, that will display who is the words repeat in differents rows , so it will display me : **"apple"**
| 0debug
|
PHP | Get Collection Size : <p>I have the following php array:</p>
<pre><code>{
"Like New": [
{
"id": 1,
"title": "Computer",
}
],
"New": [
{
"id": 2,
"title": "Refrigerator",
},
{
"id": 3,
"title": "Car",
}
]
}
</code></pre>
<p>I need to print following table in the HTML page. How can I do so:</p>
<pre><code>Condition | Count
-----------|--------
Like New | 1
New | 2
</code></pre>
| 0debug
|
Vbscript email attachment : I'm writing a vbscript to send email notification when file arrives in Test folder
I want to attach that file to my email.please help
The file name is not constant,each time a file arrives with different name.
Below is my code
Const PATH = "F:\Test"
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
dim folder: set folder = fso.getFolder(PATH)
if folder.files.Count <> 0 then
strSMTPFrom = "errorfile@test.com"
strSMTPTo = "test@test.com"
strSMTPRelay = "127.0.0.1"
strTextBody = "The attached file arrived in Test folder"
strSubject = "File arrived in Test folder"
strAttachment =
Set oMessage = CreateObject("CDO.Message")
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPRelay
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMessage.Configuration.Fields.Update
oMessage.Subject = strSubject
oMessage.From = strSMTPFrom
oMessage.To = strSMTPTo
oMessage.TextBody = strTextBody
oMessage.AddAttachment strAttachment
oMessage.Send
end if
| 0debug
|
How to make function "onChange(e) " more specific? : I want this function to be triggered only when there is a change in specific column and not in the whole spread-sheet.
also, there is any way to get the value of the cell-index which the change was made from?
Thanx!
| 0debug
|
Trouble parsing Divvy bike data with json Swift 3.0 : Im trying to parse some data from the following link: https://feeds.divvybikes.com/stations/stations.json.
I would like to grab the longitude and latitude from the link above and plot them on a mapview embedded in swift but I cant seem to get even the longitude and latitude to print out or store properly. Any help would be much appreciated.
[![enter image description here][1]][1]
i do call the getData function on load()
and nothing shows up in the debugger when I run the application.
[1]: https://i.stack.imgur.com/RHcTR.jpg
| 0debug
|
How to create Java standalone application which having confidential certificate and confidential data : I have created one java project having confidential certificate and information, I want to wrap this project and one secure jar.
Could you please suggest some thing useful ?
Thanks in advance
| 0debug
|
What is the best way to delete a component with CLI : <p>I tried using "ng destroy component foo" and it tells me "The destroy command is not supported by Angular-CLI"</p>
<p>How do we properly delete components with Angular CLI?</p>
| 0debug
|
how to access variable jquery from ajax : i have following code :
$('#postTrx').click(function(){
var hargaBrg = $("tbody").find("tr").eq(i).find("td").eq(3).text();
var id = $("tbody").find("tr").eq(i).find("td").eq(0).text();
var jumlah = $("tbody").find("tr").eq(i).find("td").eq(4).text();
$.ajax({
type : "post",
url : "input_pembelian.php",
data: "{'idBeliBarang':" + id + ",'harga':'" + hargaBrg + "','jumlah':'" + jumlah + "}",
});
});
How to access jquery variable from ajax?
| 0debug
|
determine what namespace to use in C# during run time. : I have 4 machines in my project. Each one of them does
1-Dispense
2-Deposit
I have one project that talks to these 4 machines (A , B , C ,D).
each machine has a folder in my project and in this folder I have a Dispense class and a Deposit class.
The bigger the code gets,the problem of very long namespaces and switch statements/if statements becomes annoying.
My question is:
Is there a way I can tell the compiler to use the specific namespace during the run-time? Or Maybe by using a config variable or a string that has namespace path.
So instead of saying MyProject.A.bla.bla.bla.Deposit(), I just call Deposit() and the compiler, based on my predefined value, knows what namespace.
Hopefully my question makes sense.
| 0debug
|
static int input_init(struct XenDevice *xendev)
{
struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
if (!in->c.ds) {
xen_be_printf(xendev, 1, "ds not set (yet)\n");
return -1;
}
xenstore_write_be_int(xendev, "feature-abs-pointer", 1);
return 0;
}
| 1threat
|
Angular 2 change image src attribute : <p>Assuming I have the following code:</p>
<pre><code><img [src]="JwtService.characterImage(enemy)"
class="{{enemy.status}}"
(click)="sidenav.toggle();" style="cursor:pointer">
</code></pre>
<p>How I can change this img <code>src</code> asttribute from my components <code>.ts</code> file?</p>
| 0debug
|
Want to get all clic with jQuery : So here's my problem : I have 3 rows of div with 3 div inside.
<div class="arbre-decisionnel">
<div class="entree-un">
<h3>Vous êtes...</h3>
<div class="premier-choix-entree-un choix" id="femme">
<p>Une femme ?</p>
</div>
<div class="deuxieme-choix-entree-un choix" id="homme">
<p>Un homme ?</p>
</div>
</div>
<div class="deuxieme-entree">
<h3>Vous souhaitez...</h3>
<div class="premier-choix-entree-deux choix" id="sport">
<p>Améliorer vos perfomances dans le sport</p>
</div>
<div class="deuxieme-choix-entree-deux choix" id="travail">
<p>Améliorer vos performances <br> au travail</p>
</div>
<div class="troisieme-choix-entree-deux choix" id="general">
<p>Améliorer votre santé <br> en général</p>
</div>
</div>
<div class="troisieme-entree">
<h3>Votre expérience avec le sport...</h3>
<div class="premier-choix-entree-trois choix" id="debutant">
<p>Débutant</p>
</div>
<div class="deuxieme-choix-entree-trois choix" id="confirmé">
<p>Confirmé</p>
</div>
<div class="troisieme-choix-entree-trois choix" id="expert">
<p>Expert</p>
</div>
</div>
<div class="quatrieme-entree">
<h3>Votre box personnalisée...</h3>
<div class="premier-choix-entree-quatre choix">
<a href="">Box 1</a>
</div>
<div class="deuxieme-choix-entree-quatre choix">
<a href="">Box 2</a>
</div>
<div class="troisieme-choix-entree-quatre choix">
<a href="">Box 3</a>
</div>
</div>
</div>
What I want to do : if I click on the id `#femme`, then on the id `#travail` and then on the id `#debutant` I want to see `.premier-choix-entree-quatre` and not the other choices.
For sum up, I want to record clicks one by one to target an answer.
Hope it's clear and thanks for helping me ! :-)
| 0debug
|
How to find the absolute value of a complex function? : <p>I want to find the absolute value of something like 'i' but when I type 'abs(1)' it says 'i' is not defined. What do I do?</p>
| 0debug
|
How can I let users upload videos to website? : <p>I am trying to let users upload videos to my site. I am using ruby on rails with windows. I am also using devise for user authentication. What do I need to do to let them upload videos? Someone told me I can use paperclip, but I'm not exactly sure how to.</p>
| 0debug
|
Mysql databses need to copy across the servers in linux. : <p>I have two servers each having mysql version 5.1 on it, in both the server has different databases. Now i am in need of copy one database from one server to another. What is the possible way to transfer mysql databases from one to another</p>
<p>NOTE: i am able to perform scp copy operation in both the nodes.</p>
| 0debug
|
sql server 2012-fetch SO# from a string : I am trying to fetch SO# from a string of character in SQL server without using UDF. below are the example :
this is the SO#12345 55
this is the SO12345 55
this is the SO 12345 55
this is the SO#12345/55
I want to fetch only 12345 irrespective of special character and spaces. I VBA i was able to do it but not in SQL SERVER,kindly help with the solution
| 0debug
|
A simple drawing program : <p>I need to draw circle and rectangular on a picture on webpage,</p>
<p>For this, I found out some programs and open source projects, like <a href="http://zwibbler.com" rel="nofollow">Zwibbler</a>, <a href="http://literallycanvas.com" rel="nofollow">Literally Canvas</a></p>
<p>However, they are lack of some features</p>
<p>I need to take the coordinates of the drawn circles and rectangulars</p>
<p>I couldn't find any application for this operation.</p>
<p>If you know some and comment I would be glad</p>
<p>Thanks in Advance</p>
| 0debug
|
Angular 2. Http service not working : **It`s my HttpService.ts**
import { Injectable } from "@angular/core";
import { Http, Response } from "@angular/http";
import 'rxjs/add/operator/map';
@Injectable()
export class HttpService {
constructor (private http: Http) {}
getData() {
return this.http.get('http://blog_api.org/v1/posts')
.map((response: Response) => response.json());
}
}
**It`s my app.component.ts**
import { Component } from '@angular/core';
import { HttpService } from '../app/services/HttpService'
@Component({
selector: 'my-app',
template: `Hello`,
})
export class AppComponent {
constructor (private httpService: HttpService) {};
ngOnInit() {
this.httpService.getData()
.subscribe(
data => console.log(data)
)
}
}
**When I running app, I get error:**
EXCEPTION: No provider for HttpService!
Help me please?
| 0debug
|
how i can fix the undefined variable : <p>I get this error
Notice: Undefined index: pharmacy.Name in C:\xampp\htdocs\RAU\courses.php on line 17 Notice: Undefined index: delivery.Phone in C:\xampp\htdocs\RAU\courses.php on line 19 Notice: Undefined index: delivery.Address in C:\xampp\htdocs\RAU\courses.php on line 21</p>
<pre><code> <link rel="stylesheet" href="style1.css">
<?php
$servername = "localhost";
$userrname = "root";
$password = "";
$dbname = "bless";
$conn = new mysqli($servername, $userrname, $password ,$dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sqlq="SELECT pharmacy.name,delivery.phone,delivery.address FROM delivery INNER JOIN pharmacy ON delivery.Pharmacy_id = pharmacy._id";
$rslt=$conn->query($sqlq) ;
$roww = $rslt->fetch_assoc();
echo "<br>";
echo "<br>";
echo "<td>" . $roww['pharmacy.name'] ;
echo "<br>";
echo"<td>". $roww['delivery.phone'];
echo "<br>";
echo"<td>". $roww['delivery.address'];
echo "<br>";
?>
</code></pre>
| 0debug
|
Mysql selected set to multiple array : <pre><code>$info = array
(
while($row = mysqli_fetch_array($retval, MYSQL_ASSOC))
{
array($row["id"],$row["name"],$row["mname"],$row["sdate"],$row["fdate"],$row["bphoto"],$row["sphoto"],
$row["text"],$row["one"],$row["two"],$row["three"],$row["four"],$row["five"],$row["six"],$row["seven"],
$row["eight"],$row["nine"],$row["imdb"],$row["sztrailer"],$row["etrailer"]),
}
);
</code></pre>
<p>Its Didn't worked. Please help me guys no i have more idea. (Sorry i have very bad english skill)</p>
<pre><code>Parse error: syntax error, unexpected 'while' (T_WHILE), expecting ')' in .../Themes/default/sorozat.template.php on line 21
</code></pre>
<p>Thanks.</p>
| 0debug
|
static BlockDriverState *bdrv_open_inherit(const char *filename,
const char *reference,
QDict *options, int flags,
BlockDriverState *parent,
const BdrvChildRole *child_role,
Error **errp)
{
int ret;
BlockBackend *file = NULL;
BlockDriverState *bs;
BlockDriver *drv = NULL;
const char *drvname;
const char *backing;
Error *local_err = NULL;
QDict *snapshot_options = NULL;
int snapshot_flags = 0;
assert(!child_role || !flags);
assert(!child_role == !parent);
if (reference) {
bool options_non_empty = options ? qdict_size(options) : false;
QDECREF(options);
if (filename || options_non_empty) {
error_setg(errp, "Cannot reference an existing block device with "
"additional options or a new filename");
return NULL;
}
bs = bdrv_lookup_bs(reference, reference, errp);
if (!bs) {
return NULL;
}
bdrv_ref(bs);
return bs;
}
bs = bdrv_new();
if (options == NULL) {
options = qdict_new();
}
parse_json_protocol(options, &filename, &local_err);
if (local_err) {
goto fail;
}
bs->explicit_options = qdict_clone_shallow(options);
if (child_role) {
bs->inherits_from = parent;
child_role->inherit_options(&flags, options,
parent->open_flags, parent->options);
}
ret = bdrv_fill_options(&options, filename, &flags, &local_err);
if (local_err) {
goto fail;
}
if (g_strcmp0(qdict_get_try_str(options, BDRV_OPT_READ_ONLY), "on") &&
!qdict_get_try_bool(options, BDRV_OPT_READ_ONLY, false)) {
flags |= (BDRV_O_RDWR | BDRV_O_ALLOW_RDWR);
} else {
flags &= ~BDRV_O_RDWR;
}
if (flags & BDRV_O_SNAPSHOT) {
snapshot_options = qdict_new();
bdrv_temp_snapshot_options(&snapshot_flags, snapshot_options,
flags, options);
qdict_del(options, BDRV_OPT_READ_ONLY);
bdrv_backing_options(&flags, options, flags, options);
}
bs->open_flags = flags;
bs->options = options;
options = qdict_clone_shallow(options);
drvname = qdict_get_try_str(options, "driver");
if (drvname) {
drv = bdrv_find_format(drvname);
if (!drv) {
error_setg(errp, "Unknown driver: '%s'", drvname);
goto fail;
}
}
assert(drvname || !(flags & BDRV_O_PROTOCOL));
backing = qdict_get_try_str(options, "backing");
if (backing && *backing == '\0') {
flags |= BDRV_O_NO_BACKING;
qdict_del(options, "backing");
}
if ((flags & BDRV_O_PROTOCOL) == 0) {
BlockDriverState *file_bs;
file_bs = bdrv_open_child_bs(filename, options, "file", bs,
&child_file, true, &local_err);
if (local_err) {
goto fail;
}
if (file_bs != NULL) {
file = blk_new(BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL);
blk_insert_bs(file, file_bs, &local_err);
bdrv_unref(file_bs);
if (local_err) {
goto fail;
}
qdict_put_str(options, "file", bdrv_get_node_name(file_bs));
}
}
bs->probed = !drv;
if (!drv && file) {
ret = find_image_format(file, filename, &drv, &local_err);
if (ret < 0) {
goto fail;
}
qdict_put_str(bs->options, "driver", drv->format_name);
qdict_put_str(options, "driver", drv->format_name);
} else if (!drv) {
error_setg(errp, "Must specify either driver or file");
goto fail;
}
assert(!!(flags & BDRV_O_PROTOCOL) == !!drv->bdrv_file_open);
assert(!(flags & BDRV_O_PROTOCOL) || !file);
ret = bdrv_open_common(bs, file, options, &local_err);
if (ret < 0) {
goto fail;
}
if (file) {
blk_unref(file);
file = NULL;
}
if ((flags & BDRV_O_NO_BACKING) == 0) {
ret = bdrv_open_backing_file(bs, options, "backing", &local_err);
if (ret < 0) {
goto close_and_fail;
}
}
bdrv_refresh_filename(bs);
if (qdict_size(options) != 0) {
const QDictEntry *entry = qdict_first(options);
if (flags & BDRV_O_PROTOCOL) {
error_setg(errp, "Block protocol '%s' doesn't support the option "
"'%s'", drv->format_name, entry->key);
} else {
error_setg(errp,
"Block format '%s' does not support the option '%s'",
drv->format_name, entry->key);
}
goto close_and_fail;
}
bdrv_parent_cb_change_media(bs, true);
QDECREF(options);
if (snapshot_flags) {
BlockDriverState *snapshot_bs;
snapshot_bs = bdrv_append_temp_snapshot(bs, snapshot_flags,
snapshot_options, &local_err);
snapshot_options = NULL;
if (local_err) {
goto close_and_fail;
}
bdrv_unref(bs);
bs = snapshot_bs;
}
return bs;
fail:
blk_unref(file);
if (bs->file != NULL) {
bdrv_unref_child(bs, bs->file);
}
QDECREF(snapshot_options);
QDECREF(bs->explicit_options);
QDECREF(bs->options);
QDECREF(options);
bs->options = NULL;
bs->explicit_options = NULL;
bdrv_unref(bs);
error_propagate(errp, local_err);
return NULL;
close_and_fail:
bdrv_unref(bs);
QDECREF(snapshot_options);
QDECREF(options);
error_propagate(errp, local_err);
return NULL;
}
| 1threat
|
Grid/table in crystal reports? : I need to be able to display data in a basic grid. Like excel. With borders, column headers, etc...
Without having to draw every damn line? Is CR really just a total piece of crap? I think it's creators might have been slightly retarded.
I've tried a lot of different things. But it is all so sloppy and time consuming. Isn't there an easy way to just display a table of data in a grid?
Thanks :)
.............................................
.....................
| 0debug
|
Synchronise Dygraph and DateRangeInput in Shiny : <p>I would like to synchronise a dygraph and a DateRangeInput inside a Shiny App.
The code bellow works fine : I can simultaneously use the zoom option And the daterange but I can't use the dyRangeSelector because of a "ping pong" Effect :</p>
<pre><code>library(xts)
library(shiny)
library(dygraphs)
library(lubridate)
data("co2")
data <- as.vector(coredata(as.xts(co2)))
serie <- xts(x = data,order.by = seq(from=today(),by=1,length.out = length(data)))
ui <- fluidPage(
titlePanel("Dygraph & date range input"),
sidebarLayout(
sidebarPanel(
dateRangeInput('plage', label = "Selectionnez la période :",
start = start(serie), end = end(serie),
# min = start(serie), max = end(serie),
separator = " - ",
format = "dd mm yyyy", #"yyyy-mm-dd",
language = 'fr', weekstart = 1
)
),
mainPanel(
dygraphOutput("dessin")
)
)
)
server <- function(input, output,session) {
observeEvent(input$dessin_date_window,{
start <- as.Date(ymd_hms(input$dessin_date_window[[1]]))
stop <- as.Date(ymd_hms(input$dessin_date_window[[2]]))
updateDateRangeInput(session = session,
inputId = "plage",
start = start,end = stop
)
})
output$dessin <- renderDygraph({
dygraph(serie) %>%
dyRangeSelector(
dateWindow = input$plage+1) # +1 parce que voila...
})
}
# Run the application
shinyApp(ui = ui, server = server)
</code></pre>
<p>Any idea how to control that ?
(there is no update function for dygraph... :( )</p>
| 0debug
|
Accessing parent state in child in React : <p>I have (e.g.) two components in React. The first, <code>app.js</code>, is the root component. It imports some <code>JSON</code> data and puts it in its <code>state</code>. This works fine (I can see it in the React devtools).</p>
<pre><code>import data from '../data/docs.json';
class App extends Component {
constructor() {
super();
this.state = {
docs: {}
};
}
componentWillMount() {
this.setState({
docs: data
});
}
render() {
return (
<Router history={hashHistory}>
<Route path="/" component={Wrapper}>
<IndexRoute component={Home} />
<Route path="/home" component={Home} />
<Route path="/docs" component={Docs} />
</Route>
</Router>
);
}
}
</code></pre>
<p>The second, <code>docs.js</code>, is meant to show this <code>JSON</code> data. To do that it needs to access the <code>state</code> of <code>app.js</code>. At the moment it errors, and I know why (<code>this</code> does not include <code>app.js</code>). But how then can I pass the <code>state</code> from <code>app.js</code> to <code>docs.js</code>?</p>
<pre><code>class Docs extends React.Component {
render() {
return(
<div>
{this.state.docs.map(function(study, key) {
return <p>Random text here</p>;
})}
</div>
)
}
}
</code></pre>
| 0debug
|
C++ error: redefinition of class : <p><strong>Note:</strong> I have searched thoroughly on SO and the solutions posted for other's with similar questions are not working for me here.</p>
<p>I am writing my own custom 'string-like' class in C++, and am encoutering the following errors when compiling:</p>
<blockquote>
<p>./PyString.h:8:11: error: out-of-line declaration of 'PyString' does
not match any declaration in 'PyString' PyString::PyString (char*);
^</p>
<p>./PyString.h:9:11: error: definition of implicitly declared destructor PyString::~PyString (void);</p>
<p>pystring.cpp:4:7: error: redefinition of 'PyString' class PyString {</p>
</blockquote>
<p>As for the first and second errors, moving around the destructor into the class definition itself in the <code>cpp</code> file did not work.</p>
<p>As for the third error, I can't seem to fix it - I'm not redefining the class!</p>
<p>Here is <code>pystring.h</code>:</p>
<pre><code>#ifndef PYSTRING_INCLUDED
#define PYSTRING_INCLUDED
class PyString {
char* string;
};
PyString::PyString (char*);
PyString::~PyString (void);
#endif
</code></pre>
<p>Here is <code>pystring.cpp</code>:</p>
<pre><code>#include "PyString.h"
#define NULL 0
class PyString {
char* string = NULL;
public:
PyString(char inString) {
string = new char[inString];
};
~PyString(void) {
delete string;
};
};
</code></pre>
<p>For reference, here is the compile output as a screenshot:
<a href="https://i.stack.imgur.com/hPrq8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hPrq8.png" alt="Compiler output screenshot"></a></p>
<p>Any help is greatly appreciated.</p>
| 0debug
|
angularJS click won't work on my div : We're developing an angularJS site. I can't get the event to work on a div:
<div style="width: 100%; height: 30px;" (click)="alert('Hello!')"></div>
This works when I switch (click) to onclick:
<div style="width: 100%; height: 30px;" onclick="alert('Hello!')"></div>
Why do I get the alert with onclick but not (click)?
| 0debug
|
Why does calling a generic local function with a dynamic parameter produce a BadImageFormatException? : <p>Playing around with C# 7's Local Functions, I ended up with some interesting behavior. Consider the following program:</p>
<pre><code>public void Main()
{
Console.WriteLine("Entered Main");
DoSomething("");
}
private void DoSomething(object obj)
{
Console.WriteLine("Entered DoSomething");
Generic((dynamic)obj);
GenericLocal(obj);
GenericLocal((dynamic)obj); // This breaks the program
void GenericLocal<T>(T val) => Console.WriteLine("GenericLocal");
}
private void Generic<T>(T val) => Console.WriteLine("Generic");
</code></pre>
<p>This produces:</p>
<blockquote>
<p>Entered Main</p>
</blockquote>
<p>... and then throws a <code>BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)</code>. Stack trace:</p>
<pre><code> at UserQuery.DoSomething(Object obj)
at UserQuery.Main()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
</code></pre>
<p>(I'm running this in LINQPad, but I get similar results from dotnetfiddle.)</p>
<p>Removing the indicated line in the code yields the output you'd expect:</p>
<blockquote>
<p>Entered Main<br>
Entered DoSomething<br>
Generic<br>
GenericLocal</p>
</blockquote>
<p>Can anyone explain why?</p>
| 0debug
|
SSRS 2016 - cannot see parameter : <p>I am self-learning SSRS via Microsoft SQL Server Data Tools, VS 2015. I am using tutorial from <a href="https://www.youtube.com/watch?v=nBYn1DU3VMQ&index=5&list=PL7A29088C98E92D5F" rel="noreferrer">here</a></p>
<p>I cannot see the parameter I created in preview. The visible has been selected in parameter properties. What have I missed out? Thanks in advance if anyone can help me.</p>
<p>. Microsoft SQL Server Data Tools, VS 2015</p>
<p>. Microsoft SQL Server management studio 2016</p>
<p>Design
<a href="https://i.stack.imgur.com/YmnpO.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/YmnpO.jpg" alt="enter image description here"></a></p>
<p>Preview
<a href="https://i.stack.imgur.com/IaTX0.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/IaTX0.jpg" alt="enter image description here"></a></p>
<p>Parameter Properties
<a href="https://i.stack.imgur.com/vzHC6.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/vzHC6.jpg" alt="enter image description here"></a> </p>
| 0debug
|
Ignore long lines in silversearcher : <p>Right now I am using:</p>
<pre><code> ag sessions --color|cut -b1-130
</code></pre>
<p>But this will cause color artifacts if the search match is cut bu the <code>cut</code> command.</p>
<p>Silversearcher has this in the docs:</p>
<pre><code> --print-long-lines
Print matches on very long lines (> 2k characters by default).
</code></pre>
<p>Can I change <strong>2k</strong> to something else? (120 for me, because honestly never in any of the code I work with the real code is longer than that).</p>
| 0debug
|
static void qpi_mem_writew(void *opaque, target_phys_addr_t addr, uint32_t val)
{
}
| 1threat
|
static void external_snapshot_prepare(BlkTransactionState *common,
Error **errp)
{
BlockDriver *drv;
int flags, ret;
QDict *options = NULL;
Error *local_err = NULL;
bool has_device = false;
const char *device;
bool has_node_name = false;
const char *node_name;
bool has_snapshot_node_name = false;
const char *snapshot_node_name;
const char *new_image_file;
const char *format = "qcow2";
enum NewImageMode mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
ExternalSnapshotState *state =
DO_UPCAST(ExternalSnapshotState, common, common);
TransactionAction *action = common->action;
g_assert(action->kind == TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC);
has_device = action->blockdev_snapshot_sync->has_device;
device = action->blockdev_snapshot_sync->device;
has_node_name = action->blockdev_snapshot_sync->has_node_name;
node_name = action->blockdev_snapshot_sync->node_name;
has_snapshot_node_name =
action->blockdev_snapshot_sync->has_snapshot_node_name;
snapshot_node_name = action->blockdev_snapshot_sync->snapshot_node_name;
new_image_file = action->blockdev_snapshot_sync->snapshot_file;
if (action->blockdev_snapshot_sync->has_format) {
format = action->blockdev_snapshot_sync->format;
}
if (action->blockdev_snapshot_sync->has_mode) {
mode = action->blockdev_snapshot_sync->mode;
}
drv = bdrv_find_format(format);
if (!drv) {
error_set(errp, QERR_INVALID_BLOCK_FORMAT, format);
return;
}
state->old_bs = bdrv_lookup_bs(has_device ? device : NULL,
has_node_name ? node_name : NULL,
&local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
if (has_node_name && !has_snapshot_node_name) {
error_setg(errp, "New snapshot node name missing");
return;
}
if (has_snapshot_node_name && bdrv_find_node(snapshot_node_name)) {
error_setg(errp, "New snapshot node name already existing");
return;
}
if (!bdrv_is_inserted(state->old_bs)) {
error_set(errp, QERR_DEVICE_HAS_NO_MEDIUM, device);
return;
}
if (bdrv_in_use(state->old_bs)) {
error_set(errp, QERR_DEVICE_IN_USE, device);
return;
}
if (!bdrv_is_read_only(state->old_bs)) {
if (bdrv_flush(state->old_bs)) {
error_set(errp, QERR_IO_ERROR);
return;
}
}
if (!bdrv_is_first_non_filter(state->old_bs)) {
error_set(errp, QERR_FEATURE_DISABLED, "snapshot");
return;
}
flags = state->old_bs->open_flags;
if (mode != NEW_IMAGE_MODE_EXISTING) {
bdrv_img_create(new_image_file, format,
state->old_bs->filename,
state->old_bs->drv->format_name,
NULL, -1, flags, &local_err, false);
if (local_err) {
error_propagate(errp, local_err);
return;
}
}
if (has_snapshot_node_name) {
options = qdict_new();
qdict_put(options, "node-name",
qstring_from_str(snapshot_node_name));
}
assert(state->new_bs == NULL);
ret = bdrv_open(&state->new_bs, new_image_file, NULL, options,
flags | BDRV_O_NO_BACKING, drv, &local_err);
if (ret != 0) {
error_propagate(errp, local_err);
}
}
| 1threat
|
int av_dict_set(AVDictionary **pm, const char *key, const char *value,
int flags)
{
AVDictionary *m = *pm;
AVDictionaryEntry *tag = av_dict_get(m, key, NULL, flags);
char *oldval = NULL;
if (!m)
m = *pm = av_mallocz(sizeof(*m));
if (tag) {
if (flags & AV_DICT_DONT_OVERWRITE)
return 0;
if (flags & AV_DICT_APPEND)
oldval = tag->value;
else
av_free(tag->value);
av_free(tag->key);
*tag = m->elems[--m->count];
} else {
AVDictionaryEntry *tmp = av_realloc(m->elems,
(m->count + 1) * sizeof(*m->elems));
if (tmp)
m->elems = tmp;
else
return AVERROR(ENOMEM);
}
if (value) {
if (flags & AV_DICT_DONT_STRDUP_KEY)
m->elems[m->count].key = key;
else
m->elems[m->count].key = av_strdup(key);
if (flags & AV_DICT_DONT_STRDUP_VAL) {
m->elems[m->count].value = value;
} else if (oldval && flags & AV_DICT_APPEND) {
int len = strlen(oldval) + strlen(value) + 1;
if (!(oldval = av_realloc(oldval, len)))
return AVERROR(ENOMEM);
av_strlcat(oldval, value, len);
m->elems[m->count].value = oldval;
} else
m->elems[m->count].value = av_strdup(value);
m->count++;
}
if (!m->count) {
av_free(m->elems);
av_freep(pm);
}
return 0;
}
| 1threat
|
How Can I This Webview Bar? - Android Stdiuo : How can I make a bar like the one in the picture? I'd appreciate it if you told me.
Name of the application in the picture: Google Mail
[image][1]
[1]: https://i.stack.imgur.com/FXwmF.jpg
| 0debug
|
static int local_mknod(FsContext *fs_ctx, V9fsPath *dir_path,
const char *name, FsCred *credp)
{
int err = -1;
int dirfd;
if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE &&
local_is_mapped_file_metadata(fs_ctx, name)) {
errno = EINVAL;
return -1;
}
dirfd = local_opendir_nofollow(fs_ctx, dir_path->data);
if (dirfd == -1) {
return -1;
}
if (fs_ctx->export_flags & V9FS_SM_MAPPED ||
fs_ctx->export_flags & V9FS_SM_MAPPED_FILE) {
err = mknodat(dirfd, name, SM_LOCAL_MODE_BITS | S_IFREG, 0);
if (err == -1) {
goto out;
}
if (fs_ctx->export_flags & V9FS_SM_MAPPED) {
err = local_set_xattrat(dirfd, name, credp);
} else {
err = local_set_mapped_file_attrat(dirfd, name, credp);
}
if (err == -1) {
goto err_end;
}
} else if (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH ||
fs_ctx->export_flags & V9FS_SM_NONE) {
err = mknodat(dirfd, name, credp->fc_mode, credp->fc_rdev);
if (err == -1) {
goto out;
}
err = local_set_cred_passthrough(fs_ctx, dirfd, name, credp);
if (err == -1) {
goto err_end;
}
}
goto out;
err_end:
unlinkat_preserve_errno(dirfd, name, 0);
out:
close_preserve_errno(dirfd);
return err;
}
| 1threat
|
Not able to use per BackgroundWorker filled model data with MVVM pattern : <p>I have WPF application with MVVM implementation and do successful fill model data (ObservableCollection) with BackgroundWorker.</p>
<p>By trying to show Dialog with this model data, I get error "<em>XamlParseException: Must create DependencySource on same Thread as the DependencyObject</em>".</p>
<p>How can I fix thread save implementation of MVVM-Pattern?</p>
| 0debug
|
Scatterplot in matplotlib : <p>I am trying to plot strings vs integers using matplotlib scatterplot. </p>
<p>My dataset looks like this:</p>
<pre><code> Name Utilisation
manhit 10
movers 9
mayer 9
fabcom 8
freshimp 7
</code></pre>
<p>I tried with the following code (referred from one of the previous posts) but for some reason it does not work:</p>
<pre><code> import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter, MultipleLocator
import numpy as np
x_data = np.array(dftail.Utilisation)
print x_data
y_data = np.array(dftail.Name)
print y_data
def ord_to_char(v, p=None):
return chr(int(v))
fig, ax = plt.subplots()
ax.plot(x_data, y_data, 'x')
ax.xaxis.set_major_formatter(FuncFormatter(ord_to_char))
ax.xaxis.set_major_locator(MultipleLocator(1))
plt.show()
</code></pre>
<p>I would appreciate any advice. Thanks very much.</p>
| 0debug
|
HOW TO WRITE ORACLE PLSQL PROCEDURE TO GET THIS OUTPUT? : table A:Present data
A VALID_FROM VALID_TO
------------ ---------------- ----------------
ARN-1 01-APR-2015 31-DEC-9999
ARN-1 01-MAY-2015 31-DEC-9999
ARN-1 01-JUN-2015 31-DEC-9999
table B:Required output after insertion
A VALID_FROM VALID_TO
------------ ---------------- ----------------
ARN-1 01-APR-2015 30-APR-2015
ARN-1 01-MAY-2015 31-MAY-2015
ARN-1 01-JUN-2015 31-DEC-9999
HOW TO WRITE ORACLE PLSQL PROCEDURE TO GET THIS OUTPUT??
| 0debug
|
React Native Open settings through Linking.openURL in IOS : <p>I want to open ios setting app from my app. the settings destination is [ settings => notification => myapp ]. to turn on & turn off push notification. </p>
<p>There are some documents about how to link to settings, but I don't know how to open deep link. (notification => myapp). </p>
<p>How can I do this? </p>
| 0debug
|
How to check string values in javascript : <p>I'm trying to compare the value of a string and if the first two values = @@ then call a div</p>
<p>This is my code example but doesn't seem to work. Is this the correct approach or am I off mark. Be gentle, I'm new to javascript.</p>
<pre><code><script type = "text/javascript">
var str = "@@this is the line for the test";
if (str.substring(0,2) == "@@" {
document.write(str.substring(0,2));
} else {
document.write("found nothing");
}
</script>
</code></pre>
| 0debug
|
how to properly specify database schema in spring boot? : <p>in my spring boot / hibernate application, I need to connect to a Postgres database "ax2012_1", which belong to the "dbo" schema.</p>
<p>I have the following application.properties:</p>
<pre><code># Database
db.driver: org.postgresql.Driver
db.url: jdbc:postgresql://localhost:5432/ax2012_1
db.username: my_user_name
db.password: my_password
spring.datasource.url= jdbc:postgresql://localhost:5432/ax2012_1
spring.datasource.username=my_user_name
spring.datasource.password=my_password
spring.datasource.schema=dbo
spring.jpa.hibernate.ddl-auto=validate
# Hibernate
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql: true
hibernate.hbm2ddl.auto: update
entitymanager.packagesToScan: com.mycompany.myproduct.data
</code></pre>
<p>my DatabaseConfig.java looks like this:</p>
<pre><code>package com.uptake.symphony.data.configs;
import java.util.Properties;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableTransactionManagement
public class DatabaseConfig {
// ------------------------
// PUBLIC METHODS
// ------------------------
/**
* DataSource definition for database connection. Settings are read from
* the application.properties file (using the env object).
*/
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName(env.getProperty("db.driver"));
dataSource.setUrl(env.getProperty("db.url"));
dataSource.setUsername(env.getProperty("db.username"));
dataSource.setPassword(env.getProperty("db.password"));
return dataSource;
}
/**
* Declare the JPA entity manager factory.
*/
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean entityManagerFactory =
new LocalContainerEntityManagerFactoryBean();
entityManagerFactory.setDataSource(dataSource);
// Classpath scanning of @Component, @Service, etc annotated class
entityManagerFactory.setPackagesToScan(
env.getProperty("entitymanager.packagesToScan"));
// Vendor adapter
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
entityManagerFactory.setJpaVendorAdapter(vendorAdapter);
// Hibernate properties
Properties additionalProperties = new Properties();
additionalProperties.put(
"hibernate.dialect",
env.getProperty("hibernate.dialect"));
additionalProperties.put(
"hibernate.show_sql",
env.getProperty("hibernate.show_sql"));
additionalProperties.put(
"hibernate.hbm2ddl.auto",
env.getProperty("hibernate.hbm2ddl.auto"));
entityManagerFactory.setJpaProperties(additionalProperties);
additionalProperties.put("hibernate.default_schema", "dbo");
return entityManagerFactory;
}
/**
* Declare the transaction manager.
*/
@Bean
public JpaTransactionManager transactionManager() {
JpaTransactionManager transactionManager =
new JpaTransactionManager();
transactionManager.setEntityManagerFactory(
entityManagerFactory.getObject());
return transactionManager;
}
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
return new PersistenceExceptionTranslationPostProcessor();
}
@Autowired
private Environment env;
@Autowired
private DataSource dataSource;
@Autowired
private LocalContainerEntityManagerFactoryBean entityManagerFactory;
}
</code></pre>
<p>From the startup log, I can tell, that hibernate is, in fact, discovering my table "custtable":</p>
<pre><code>Hibernate Core {4.3.8.Final}
2016-09-10 15:27:15.866 INFO 69384 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2016-09-10 15:27:15.867 INFO 69384 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2016-09-10 15:27:16.096 INFO 69384 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
2016-09-10 15:27:18.367 INFO 69384 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2016-09-10 15:27:18.378 INFO 69384 --- [ main] o.h.e.jdbc.internal.LobCreatorBuilder : HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2016-09-10 15:27:18.499 WARN 69384 --- [ main] org.hibernate.mapping.RootClass : HHH000038: Composite-id class does not override equals(): com.myconpany.myproduct.data.CusttableCompositeKey
2016-09-10 15:27:18.499 WARN 69384 --- [ main] org.hibernate.mapping.RootClass : HHH000039: Composite-id class does not override hashCode(): com.myconpany.myproduct.data.CusttableCompositeKey
2016-09-10 15:27:18.508 INFO 69384 --- [ main] o.h.h.i.ast.ASTQueryTranslatorFactory : HHH000397: Using ASTQueryTranslatorFactory
2016-09-10 15:27:18.932 INFO 69384 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update
2016-09-10 15:27:18.933 INFO 69384 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000102: Fetching database metadata
2016-09-10 15:27:18.943 INFO 69384 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000396: Updating schema
2016-09-10 15:27:18.993 INFO 69384 --- [ main] o.hibernate.tool.hbm2ddl.TableMetadata : HHH000261: Table found: dbo.custtable
2016-09-10 15:27:18.993 INFO 69384 --- [ main] o.hibernate.tool.hbm2ddl.TableMetadata : HHH000037: Columns: [custexcludecollectionfee, interestcode_br, servicecodeondlvaddress_br, stateinscription_mx, insscei_br, memo, inventprofiletype_ru, rfidcasetagging, irs1099cindicator, agencylocationcode, enterprisecode, issueownentrycertificate_w, invoicepostingtype_ru, affiliated_ru, contactpersonid, creditcardaddressverification, taxgstreliefgroupheading_my, rfidpallettagging, ccmnum_br, custfinaluser_br, orderentrydeadlinegroupid, accountnum, subsegmentid, entrycertificaterequired_w, salesgroup, bankcentralbankpurposetext, suppitemgroupid, curp_mx, pdscustrebategroupid, commercialregisterinsetnumber, mandatoryvatdate_pl, usecashdisc, inventsiteid, custitemgroupid, defaultdirectdebitmandate, taxwithholdcalculate_th, mcrmergedroot, exportsales_pl, cashdisc, syncversion, federalcomments, girotypeprojinvoice, syncentityid, intercompanyautocreateorders, icmscontributor_br, finecode_br, del_modifiedtime, rfiditemtagging, companynafcode, ienum_br, dataareaid, inventlocation, consday_jp, unitedvatinvoice_lt, foreignerid_br, partition, blocked, vatnum, markupgroup, incltax, custwhtcontributiontype_br, salesdistrictid, girotypefreetextinvoice, currency, maincontactworker, taxgroup, authorityoffice_it, pdsrebatetmagroup, salespoolid, intercompanydirectdelivery, presencetype_br, paymentreference_ee, mcrmergedparent, linedisc, partycountry, commercialregister, multilinedisc, isresident_lv, numbersequencegroup, rfc_mx, paymspec, suframapiscofins_br, fednonfedindicator, invoiceaddress, ouraccountnum, shipcarrierfuelsurcharge, segmentid, defaultdimension, vendaccount, dlvmode, identificationnumber, suframa_br, fiscalcode, taxlicensenum, shipcarrieraccount, destinationcodeid, einvoice, nit_br, cnae_br, paymmode, paymsched, companychainid, girotypeinterestnote, cashdiscbasedays, freightzone, birthcountycode_it, daxintegrationid, packmaterialfeelicensenum, girotypeaccountstatement, defaultinventstatusid, pdsfreightaccrued, shipcarrierid, modifieddatetime, custtradingpartnercode, lvpaymtranscodes, birthplace_it, clearingperiod, enterprisenumber, mandatorycreditlimit, companytype_mx, salescalendarid, einvoiceeannum, websalesorderdisplay, custgroup, dlvreason, factoringaccount, orgid, commercialregistersection, creditcardaddressverificationvoid, paymidtype, dlvterm, residenceforeigncountryregionid_it, paymtermid, statisticsgroup, packagedepositexcempt_pl, forecastdmpinclude, companyidsiret, modifiedby, girotype, birthdate_it, createddatetime, party, taxwithholdgroup_th, shipcarrierblindshipment, onetimecustomer, accountstatement, del_createdtime, lineofbusinessid, taxbordernumber_fi, partystate, expressbilloflading, bankaccount, regnum_w, enddisc, commissiongroup, intercompanyallowindirectcreation, paymdayid, passportno_hu, creditrating, custclassificationid, generateincomingfiscaldocument_br, pbacustgroupid, shipcarrieraccountcode, recid, einvoiceregister_it, intbank_lv, bankcentralbankpurposecode, taxwithholdcalculate_in, usepurchrequest, fiscaldoctype_pl, girotypecollectionletter, pricegroup, invoiceaccount, creditcardaddressverificationlevel, recversion, foreignresident_ru, creditcardcvc, bankcustpaymidtable, cnpjcpfnum_br, inventprofileid_ru, taxperiodpaymentcode_pl, custexcludeinterestcharges, issuercountry_hu, creditmax, suframanumber_br]
2016-09-10 15:27:18.994 INFO 69384 --- [ main] o.hibernate.tool.hbm2ddl.TableMetadata : HHH000108: Foreign keys: []
</code></pre>
<p>However, when I run "findById" from my DAO:</p>
<pre><code>public Custtable getById(Class<Custtable> class1, CusttableCompositeKey custtableCompositeKey) {
Custtable ct = entityManager.find(Custtable.class, custtableCompositeKey);
LOG.debug("customer.ct.accountNum: " + ct.getAccountnum());
return entityManager.find(Custtable.class, custtableCompositeKey);
}
</code></pre>
<p>I get this error:</p>
<pre><code>Hibernate: select custtable0_.accountnum as accountn1_0_0_, custtable0_.dataareaid as dataarea2_0_0_, custtable0_.partition as partitio3_0_0_, custtable0_.accountstatement as accounts4_0_0_, custtable0_.affiliated_ru as affiliat5_0_0_, custtable0_.agencylocationcode as agencylo6_0_0_, custtable0_.authorityoffice_it as authorit7_0_0_, custtable0_.bankaccount as bankacco8_0_0_, custtable0_.bankcentralbankpurposecode as bankcent9_0_0_, custtable0_.bankcentralbankpurposetext as bankcen10_0_0_, custtable0_.bankcustpaymidtable as bankcus11_0_0_, custtable0_.birthcountycode_it as birthco12_0_0_, custtable0_.birthdate_it as birthda13_0_0_, custtable0_.birthplace_it as birthpl14_0_0_, custtable0_.blocked as blocked15_0_0_, custtable0_.cashdisc as cashdis16_0_0_, custtable0_.cashdiscbasedays as cashdis17_0_0_, custtable0_.ccmnum_br as ccmnum_18_0_0_, custtable0_.clearingperiod as clearin19_0_0_, custtable0_.cnae_br as cnae_br20_0_0_, custtable0_.cnpjcpfnum_br as cnpjcpf21_0_0_, custtable0_.commercialregister as commerc22_0_0_, custtable0_.commercialregisterinsetnumber as commerc23_0_0_, custtable0_.commercialregistersection as commerc24_0_0_, custtable0_.commissiongroup as commiss25_0_0_, custtable0_.companychainid as company26_0_0_, custtable0_.companyidsiret as company27_0_0_, custtable0_.companynafcode as company28_0_0_, custtable0_.companytype_mx as company29_0_0_, custtable0_.consday_jp as consday30_0_0_, custtable0_.contactpersonid as contact31_0_0_, custtable0_.createddatetime as created32_0_0_, custtable0_.creditcardaddressverification as creditc33_0_0_, custtable0_.creditcardaddressverificationlevel as creditc34_0_0_, custtable0_.creditcardaddressverificationvoid as creditc35_0_0_, custtable0_.creditcardcvc as creditc36_0_0_, custtable0_.creditmax as creditm37_0_0_, custtable0_.creditrating as creditr38_0_0_, custtable0_.curp_mx as curp_mx39_0_0_, custtable0_.currency as currenc40_0_0_, custtable0_.custclassificationid as custcla41_0_0_, custtable0_.custexcludecollectionfee as custexc42_0_0_, custtable0_.custexcludeinterestcharges as custexc43_0_0_, custtable0_.custfinaluser_br as custfin44_0_0_, custtable0_.custgroup as custgro45_0_0_, custtable0_.custitemgroupid as custite46_0_0_, custtable0_.custtradingpartnercode as custtra47_0_0_, custtable0_.custwhtcontributiontype_br as custwht48_0_0_, custtable0_.daxintegrationid as daxinte49_0_0_, custtable0_.defaultdimension as default50_0_0_, custtable0_.defaultdirectdebitmandate as default51_0_0_, custtable0_.defaultinventstatusid as default52_0_0_, custtable0_.del_createdtime as del_cre53_0_0_, custtable0_.del_modifiedtime as del_mod54_0_0_, custtable0_.destinationcodeid as destina55_0_0_, custtable0_.dlvmode as dlvmode56_0_0_, custtable0_.dlvreason as dlvreas57_0_0_, custtable0_.dlvterm as dlvterm58_0_0_, custtable0_.einvoice as einvoic59_0_0_, custtable0_.einvoiceeannum as einvoic60_0_0_, custtable0_.einvoiceregister_it as einvoic61_0_0_, custtable0_.enddisc as enddisc62_0_0_, custtable0_.enterprisecode as enterpr63_0_0_, custtable0_.enterprisenumber as enterpr64_0_0_, custtable0_.entrycertificaterequired_w as entryce65_0_0_, custtable0_.exportsales_pl as exports66_0_0_, custtable0_.expressbilloflading as express67_0_0_, custtable0_.factoringaccount as factori68_0_0_, custtable0_.federalcomments as federal69_0_0_, custtable0_.fednonfedindicator as fednonf70_0_0_, custtable0_.finecode_br as finecod71_0_0_, custtable0_.fiscalcode as fiscalc72_0_0_, custtable0_.fiscaldoctype_pl as fiscald73_0_0_, custtable0_.forecastdmpinclude as forecas74_0_0_, custtable0_.foreignerid_br as foreign75_0_0_, custtable0_.foreignresident_ru as foreign76_0_0_, custtable0_.freightzone as freight77_0_0_, custtable0_.generateincomingfiscaldocument_br as generat78_0_0_, custtable0_.girotype as girotyp79_0_0_, custtable0_.girotypeaccountstatement as girotyp80_0_0_, custtable0_.girotypecollectionletter as girotyp81_0_0_, custtable0_.girotypefreetextinvoice as girotyp82_0_0_, custtable0_.girotypeinterestnote as girotyp83_0_0_, custtable0_.girotypeprojinvoice as girotyp84_0_0_, custtable0_.icmscontributor_br as icmscon85_0_0_, custtable0_.identificationnumber as identif86_0_0_, custtable0_.ienum_br as ienum_b87_0_0_, custtable0_.incltax as incltax88_0_0_, custtable0_.insscei_br as insscei89_0_0_, custtable0_.intbank_lv as intbank90_0_0_, custtable0_.intercompanyallowindirectcreation as interco91_0_0_, custtable0_.intercompanyautocreateorders as interco92_0_0_, custtable0_.intercompanydirectdelivery as interco93_0_0_, custtable0_.interestcode_br as interes94_0_0_, custtable0_.inventlocation as inventl95_0_0_, custtable0_.inventprofileid_ru as inventp96_0_0_, custtable0_.inventprofiletype_ru as inventp97_0_0_, custtable0_.inventsiteid as invents98_0_0_, custtable0_.invoiceaccount as invoice99_0_0_, custtable0_.invoiceaddress as invoic100_0_0_, custtable0_.invoicepostingtype_ru as invoic101_0_0_, custtable0_.irs1099cindicator as irs102_0_0_, custtable0_.isresident_lv as isresi103_0_0_, custtable0_.issueownentrycertificate_w as issueo104_0_0_, custtable0_.issuercountry_hu as issuer105_0_0_, custtable0_.linedisc as linedi106_0_0_, custtable0_.lineofbusinessid as lineof107_0_0_, custtable0_.lvpaymtranscodes as lvpaym108_0_0_, custtable0_.maincontactworker as mainco109_0_0_, custtable0_.mandatorycreditlimit as mandat110_0_0_, custtable0_.mandatoryvatdate_pl as mandat111_0_0_, custtable0_.markupgroup as markup112_0_0_, custtable0_.mcrmergedparent as mcrmer113_0_0_, custtable0_.mcrmergedroot as mcrmer114_0_0_, custtable0_.memo as memo115_0_0_, custtable0_.modifiedby as modifi116_0_0_, custtable0_.modifieddatetime as modifi117_0_0_, custtable0_.multilinedisc as multil118_0_0_, custtable0_.nit_br as nit_br119_0_0_, custtable0_.numbersequencegroup as number120_0_0_, custtable0_.onetimecustomer as onetim121_0_0_, custtable0_.orderentrydeadlinegroupid as ordere122_0_0_, custtable0_.orgid as orgid123_0_0_, custtable0_.ouraccountnum as ouracc124_0_0_, custtable0_.packagedepositexcempt_pl as packag125_0_0_, custtable0_.packmaterialfeelicensenum as packma126_0_0_, custtable0_.party as party127_0_0_, custtable0_.partycountry as partyc128_0_0_, custtable0_.partystate as partys129_0_0_, custtable0_.passportno_hu as passpo130_0_0_, custtable0_.paymdayid as paymda131_0_0_, custtable0_.paymentreference_ee as paymen132_0_0_, custtable0_.paymidtype as paymid133_0_0_, custtable0_.paymmode as paymmo134_0_0_, custtable0_.paymsched as paymsc135_0_0_, custtable0_.paymspec as paymsp136_0_0_, custtable0_.paymtermid as paymte137_0_0_, custtable0_.pbacustgroupid as pbacus138_0_0_, custtable0_.pdscustrebategroupid as pdscus139_0_0_, custtable0_.pdsfreightaccrued as pdsfre140_0_0_, custtable0_.pdsrebatetmagroup as pdsreb141_0_0_, custtable0_.presencetype_br as presen142_0_0_, custtable0_.pricegroup as priceg143_0_0_, custtable0_.recid as recid144_0_0_, custtable0_.recversion as recver145_0_0_, custtable0_.regnum_w as regnum146_0_0_, custtable0_.residenceforeigncountryregionid_it as reside147_0_0_, custtable0_.rfc_mx as rfc_mx148_0_0_, custtable0_.rfidcasetagging as rfidca149_0_0_, custtable0_.rfiditemtagging as rfidit150_0_0_, custtable0_.rfidpallettagging as rfidpa151_0_0_, custtable0_.salescalendarid as salesc152_0_0_, custtable0_.salesdistrictid as salesd153_0_0_, custtable0_.salesgroup as salesg154_0_0_, custtable0_.salespoolid as salesp155_0_0_, custtable0_.segmentid as segmen156_0_0_, custtable0_.servicecodeondlvaddress_br as servic157_0_0_, custtable0_.shipcarrieraccount as shipca158_0_0_, custtable0_.shipcarrieraccountcode as shipca159_0_0_, custtable0_.shipcarrierblindshipment as shipca160_0_0_, custtable0_.shipcarrierfuelsurcharge as shipca161_0_0_, custtable0_.shipcarrierid as shipca162_0_0_, custtable0_.stateinscription_mx as statei163_0_0_, custtable0_.statisticsgroup as statis164_0_0_, custtable0_.subsegmentid as subseg165_0_0_, custtable0_.suframa_br as sufram166_0_0_, custtable0_.suframanumber_br as sufram167_0_0_, custtable0_.suframapiscofins_br as sufram168_0_0_, custtable0_.suppitemgroupid as suppit169_0_0_, custtable0_.syncentityid as syncen170_0_0_, custtable0_.syncversion as syncve171_0_0_, custtable0_.taxbordernumber_fi as taxbor172_0_0_, custtable0_.taxgroup as taxgro173_0_0_, custtable0_.taxgstreliefgroupheading_my as taxgst174_0_0_, custtable0_.taxlicensenum as taxlic175_0_0_, custtable0_.taxperiodpaymentcode_pl as taxper176_0_0_, custtable0_.taxwithholdcalculate_in as taxwit177_0_0_, custtable0_.taxwithholdcalculate_th as taxwit178_0_0_, custtable0_.taxwithholdgroup_th as taxwit179_0_0_, custtable0_.unitedvatinvoice_lt as united180_0_0_, custtable0_.usecashdisc as usecas181_0_0_, custtable0_.usepurchrequest as usepur182_0_0_, custtable0_.vatnum as vatnum183_0_0_, custtable0_.vendaccount as vendac184_0_0_, custtable0_.websalesorderdisplay as websal185_0_0_ from Custtable custtable0_ where custtable0_.accountnum=? and custtable0_.dataareaid=? and custtable0_.partition=?
2016-09-10 15:28:54.967 WARN 69384 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 42P01
2016-09-10 15:28:54.967 ERROR 69384 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: relation "custtable" does not exist
</code></pre>
<p>What can I do to fix this?</p>
| 0debug
|
Combine multiple text inputs and copy into another using javascript : I have several text boxes, all with the same class.
What I am wanting to do is combine all inputs together, and then output it to another text field, separate to the existing ones
For example. I have 4 inputs, each with a number.
Input 1 is "1"
2 is "2" etc,
I want the fifth box to contain "1, 2, 3, 4" (the contents from the 4 boxes above).
I have the following code for the html:
<input type='text' id='txtFirst' class='copyText' /><br/>
<input type='text' id='txtSecond' class='copyText' /><br/>
<input type='text' id='txtThird' class='copyText' /><br/>
<input type='text' id='final' />
But I am struggling with the javascript.
Ideally the fourth box with id final would update as any of the previous boxes are edited.
Also, I would want to do it using the classes, as the amount of inputs can vary, so its not possible to assume it will always be four.
Many thanks!
| 0debug
|
How to get top 10 rankings in vb.net : I'm creating a rankings in vb.net wherein I have students which have their Grade Ave. The problem is I need to get the first 10 students who excells the most but what if their average is the same? For example if 2 students has the same average the list will become 11 since there is a tie and so on. I'm sorry I dont have any source code since i cant figure it out.
THanks. SO.
| 0debug
|
static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
uint64_t val, unsigned size)
{
if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) {
tb_invalidate_phys_page_fast(ram_addr, size);
}
switch (size) {
case 1:
stb_p(qemu_get_ram_ptr(ram_addr), val);
break;
case 2:
stw_p(qemu_get_ram_ptr(ram_addr), val);
break;
case 4:
stl_p(qemu_get_ram_ptr(ram_addr), val);
break;
default:
abort();
}
cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_MIGRATION);
cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_VGA);
if (!cpu_physical_memory_is_clean(ram_addr)) {
CPUArchState *env = current_cpu->env_ptr;
tlb_set_dirty(env, current_cpu->mem_io_vaddr);
}
}
| 1threat
|
RegEx match specific pattern in a text "[d-n]" : <p>What would be a regex for matching "[d-n]", where n is any number?</p>
<p>i.e.
Test_4_[d-123] - returns ideally only 123</p>
<p>or, if I can return [d-123] I could make some string formatting.</p>
| 0debug
|
Checking array in Athena : <p>I have a table in Athena where one of the columns is of type <code>array<string></code>. However, when I run</p>
<pre><code>select * from mytable
where array_contains(myarr,'foobar')
limit 10
</code></pre>
<p>it seems Athena doesn't have the <code>array_contains</code> function:</p>
<pre><code>SYNTAX_ERROR: line 2:7: Function array_contains not registered
</code></pre>
<p>Is there an alternative way to check if the array contains a particular string? </p>
| 0debug
|
How to do rounding in Android : I want to calculate the bill where need to do some rounding in android.
What i expect is:
it should be nearest 10 cents. e.g:
10.17 -> 10.20 (round up)
10.11 -> 10.10 (round down)
I have tried to use:
grandTotal = Double.valueOf(String.format(Locale.ENGLISH, "%.2f", grandTotal));
but it will occur error when the total look like 12.15, 14.65, 19.85.
By right, it should round up, but my result shows it round down.
Can anyone advise me to solve this problem? Thanks a lot!
| 0debug
|
How to provide login credentials to an automated android test? : <p>I'm looking for a way to "provide a login" to my app so an automated test "is logged in" and can test the entire app. Currently it's of course blocked by the login-screen.</p>
<p>Because I'm using SmartLock for Passwords, this might be a chance to provide some credentials for the test - but I don't know how.</p>
<hr>
<p>Is there some best-practice to provide credentials to / skip the login during a test? I could think of a special buildType / -flavor which is mocking the login but this way it can't be used to test a release build.</p>
<p>It would be great when I could test a final release build which can be uploaded to the store when the test succeeds. This way, I could use the embedded pre-launch-reports in the PlayStore as well (which would be really nice).</p>
| 0debug
|
TypeError: can only concatenate str (not "tuple") to str : def main():
chatbot = ChatBot('Bot',
storage_adapter ='chatterbot.storage.SQLStorageAdapter',
trainer = 'chatterbot.trainers.ListTrainer')
for files in os.listdir('hector/'):
convData = open(r'hector/' + files, encoding='latin-1').readlines()
#convData = open('hector/' + files, 'r').readlines()
chatbot.set_trainer(ListTrainer)
chatbot.train(convData)
main()
on this hector folder have trainnig text folders,when use os.listdir it's showing this error
IsADirectoryError: [Errno 21] Is a directory: 'hector/french'
| 0debug
|
Delete entities without loading them into memory : <p>In Entity Framework Core I have the following Entity:</p>
<pre><code>public class File {
public Int32 Id { get; set; }
public Byte[] Content { get; set; }
public String Name { get; set; }
}
</code></pre>
<p>And I have a list of files ids which I need to delete:</p>
<pre><code>List<Int32> ids = new List<Int32> { 4, 6, 8 }; // Ids example
</code></pre>
<p>How can I delete the 3 files without loading each file Content property?</p>
<pre><code>_context.Files.Remove(??);
</code></pre>
<p>I do not want to load each file Content property as it is big in size.</p>
| 0debug
|
array reverse based on index javascript : How to Reverse an javascript array based on passing of index value.
similar like array.reverse(5);
input: array=[0,1,2,3,4,5,6];
for 5:
output:array[4,3,2,1,6,5];
| 0debug
|
static int ass_get_duration(const uint8_t *p)
{
int sh, sm, ss, sc, eh, em, es, ec;
uint64_t start, end;
if (sscanf(p, "%*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d",
&sh, &sm, &ss, &sc, &eh, &em, &es, &ec) != 8)
return 0;
start = 3600000*sh + 60000*sm + 1000*ss + 10*sc;
end = 3600000*eh + 60000*em + 1000*es + 10*ec;
return end - start;
}
| 1threat
|
Add graphQL fragment to schema, and have available for all queries : <p>The following executes correctly in graphiQL</p>
<pre><code>fragment BookGridFields on Book {
_id
title
}
{
allBooks {
...BookGridFields
}
}
</code></pre>
<hr>
<p>My question is, it possible to specify the fragment right in my schema, right below where my Book type is defined, like so</p>
<pre><code>type Book {
_id: String
title: String
pages: Int
weight: Float
authors: [Author]
}
fragment BookGridFields on Book {
_id
title
}
</code></pre>
<p>So that I could just run queries like this</p>
<pre><code>{
allBooks {
...BookGridFields
}
}
</code></pre>
<p>without needing to define the fragment as part of my query.</p>
<p>Currently the above errors with</p>
<blockquote>
<p>Unknown fragment \"BookGridFields\"</p>
</blockquote>
| 0debug
|
Laravel 5.3 - htmlspecialchars() expects parameter 1 to be string : <p>I am new to laravel and I am enjoying it. While working on a social media project I got this error: <code>htmlspecialchars() expects parameter 1 to be string, object given (View: C:\wamp64\www\histoirevraie\resources\views\user\profile.blade.php)</code></p>
<p>I have checked some questions on this site but I have not found a question that solves my problem.</p>
<p>this is what my <code>profile.blade.php</code> is made of:</p>
<pre><code><ul class="profile-rows">
<li>
<span class="the-label">Last visit: </span>
<span class="the-value mark green">{{ \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $user->lastVisit)->diffForHumans(\Carbon\Carbon::now())}}</span>
</li>
<li>
<span class="the-label">Member since: </span>
<span class="the-value mark light-gray">{{ $user->created_at->format('F Y') }}</span>
</li>
<li>
<span class="the-label">Profile views: </span>
<span class="the-value mark light-gray">5146</span>
</li>
<li>
<span class="the-label">Living In: </span>
<span class="the-value">{{ $user->town }}</span>
</li>
<li>
<span class="the-label">Website: </span>
<span class="the-value"><a href="{{ url($user->website) }}">{{ $user->website }}</a></span>
</li>
</ul>
</code></pre>
<p>All the information about the user are given by a controller:</p>
<pre><code>public function index($username){
$user = User::where('username', $username)->first();
return view('user.profile', compact('user'));
}
</code></pre>
<p>Kindly help me solve this problem!</p>
| 0debug
|
How to use annotation style used on The Atlantic's article, "The Host" by David Foster Wallace : <p><a href="https://38.media.tumblr.com/e35167d2556a8a6416ae68f9b6c2b514/tumblr_inline_notlshs8W31qz6f4b_540.gif" rel="nofollow">This is what I want</a> to replicate on my website for students. I am new to coding and I have tried to copy, paste a chunk of the source code, but nothing seems to work. </p>
<p><a href="http://www.theatlantic.com/magazine/archive/2005/04/host/303812/#annotation1" rel="nofollow">Here is a link to the article itself</a>. </p>
<p>Any help is appreciated. If this is considered spam, my apologies. </p>
| 0debug
|
What is .stCommitMsg in git global configuration file? : <p>I found this in my git global configuration file <code>~/.gitconfig</code></p>
<pre><code>...
[commit]
template = {my user root folder}/.stCommitMsg
</code></pre>
<p>I have no idea what is the usage, and also there was no file in this name in my user root folder!</p>
<p>Does any one knows how it works? and is it possible to have a template for git commits?!</p>
| 0debug
|
Generating the IPA file of my Xamarin App without an iOS device : <p>I have created a Xamarin Forms App for both Android and iOS devices from Visual Studio 2017 and Windows. To test and build the iOS app, I have used a Mac with Xamarin Mac Agent.</p>
<p>Now I have to build an IPA file for internal testing, however I'm unable to do it because when I build my project for the iOS simulator, it's not generated the IPA file. I have also tried to use both Ad-hoc and AppStore build options.</p>
<p>I know that with XCode 7+ you can create an IPA file for internal testing without an Apple Developer Account, but do I need to have a physical iOS device in order to get the IPA file?</p>
<p>I hope you can help me.</p>
| 0debug
|
Always run cmd via ConEmu as administrator : <p>I'm using <strong>ConEmu</strong> and I want to <strong>always</strong> have my cmds run as <strong>administrator</strong>.</p>
<p>I've <strong>changed</strong> the settings that forces all my cmds to run through ConEmu, so typing 'cmd' in the Windows Run will open ConEmu (Settings -> Integration -> Default term -> Force ConEmu as default terminal)</p>
<p>I've <strong>tried</strong> changing the (Settings -> Startup -> Command line) to <code>cmd.exe -new_console:a</code> which works for shortcuts but doesn't change the default (running cmd from Run or opening a new tab inside ConEmu)</p>
<p>Thanks</p>
| 0debug
|
How to give border to table through javascript? : i want to give border to my table through javascript so when i am using
var table=document.createElement("table").style.border="1px solid";
and try to append the row to this table like this
table.appendChild(newRow);
above line throwing exception as follows:
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
and if i try to execute the same code without giving border it executes properly
please help me with this.
| 0debug
|
I am making a password system thing, how can I make the first IF statement run again without making it into a function? : <pre><code>if userInput != userPassword:
print("I'm sorry, that is wrong please try again. Try to remember capitals!")
elif userInput == userPassword:
print("That is correct you may now find out your mobile phone costs!")
mobile_phone()
</code></pre>
<p>When that runs and I enter the wrong password it just repeats the first print statement (I'm sorry, that is wrong please try again. Try to remember capitals!) how can I make it just run it again ONCE and if it is wrong then maybe another time until it is answered with the right password. Debut Post</p>
| 0debug
|
Use of string literal for Objective-C selectors is deprecated, use '#selector' instead : <p>I have the following code:</p>
<pre><code>func setupShortcutItems(launchOptions: [NSObject: AnyObject]?) -> Bool {
var shouldPerformAdditionalDelegateHandling: Bool = false
if (UIApplicationShortcutItem.respondsToSelector("new")) {
self.configDynamicShortcutItems()
// If a shortcut was launched, display its information and take the appropriate action
if let shortcutItem: UIApplicationShortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem {
// When the app launched at the first time, this block can not called.
self.handleShortCutItem(shortcutItem)
// This will block "performActionForShortcutItem:completionHandler" from being called.
shouldPerformAdditionalDelegateHandling = false
} else {
// normal app launch process without quick action
self.launchWithoutQuickAction()
}
} else {
// Less than iOS9 or later
self.launchWithoutQuickAction()
}
return shouldPerformAdditionalDelegateHandling
}
</code></pre>
<p>I get the following "warning" on <code>UIApplicationShortcutItem.respondsToSelector("new")</code>, which says:</p>
<blockquote>
<p>Use of string literal for Objective-c selectors is deprecated, use '#selector' instead</p>
</blockquote>
<p>The warning replaces the code automatically with:</p>
<p><code>UIApplicationShortcutItem.respondsToSelector(#selector(FBSDKAccessToken.new))</code></p>
<p>However this doesn't compile because <code>new()</code> is unavailabe.
What am I supposed to use in this case?</p>
| 0debug
|
Null pointer Exception on TabLayout : <pre><code>Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.design.widget.TabLayout.addOnTabSelectedListener(android.support.design.widget.TabLayout$OnTabSelectedListener)' on a null object reference
</code></pre>
<p>Declared this before onCreate():</p>
<pre><code>TabLayout.OnTabSelectedListener listener;
</code></pre>
<p>and this in onCreate():</p>
<pre><code>TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);
listener = new TabLayout.OnTabSelectedListener(){
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
@Override
public void onTabReselected(TabLayout.Tab tab) {
}
};
tabLayout.addOnTabSelectedListener(listener);
</code></pre>
<p>I'm having trouble seeing how listener is null. I have other NullPointerExceptions that even claim null object on primitives including ints defined by drawable pngs?</p>
| 0debug
|
Disable check of camel case rule in eslint : <p>I have a large JavaScript file with multiple eslint rule violations. I am trying to disable them and address them one at a time. The code below shows that I can disable them all with no trouble, but not the rule about camelcase and perhaps other individual rules. The approaches I have used should work according to the eslint documentation, but there must be a flaw in my interpretation.</p>
<p>The code is short and it does not eliminate the error concerning camel case. </p>
<pre><code>/* eslint-disable /* eslint-disable// works but gets everything.
`/* eslint (camelcase) : 0 */
/* eslint camelcase : ["error", {ignoreDestructuring:true}] */
</code></pre>
<p><code>const Lesson_1 = {title:'The Home Row Keys.'},'lesson': 'jjj fff jjj fff'}</code></p>
<p>Just get the same camelcase error without any change. The eslint documentation says just disable the entire rule but does not specify a method other than listed above.</p>
| 0debug
|
Initializers are not allowed in ambient contexts error when installing Blueprint : <p>I'm trying to use the <code>@blueprintjs/core</code> library in my project. However, when I compile my code, I'm getting many errors like this:</p>
<pre><code>node_modules/@blueprintjs/core/dist/common/classes.d.ts(4,30):
error TS1039: Initializers are not allowed in ambient contexts.
</code></pre>
<p>What's going on? What am I doing wrong?</p>
| 0debug
|
void bdrv_flush_io_queue(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
if (drv && drv->bdrv_flush_io_queue) {
drv->bdrv_flush_io_queue(bs);
} else if (bs->file) {
bdrv_flush_io_queue(bs->file);
}
}
| 1threat
|
WebClient DownloadString UTF-8 not displaying international characters : <p>I attempt to save the html of a website in a string. The website has international characters (ę, ś, ć, ...) and they are not being saved to the string even though I set the encoding to be UTF-8 which corresponds to the websites charset.</p>
<p>Here is my code:</p>
<pre><code>using (WebClient client = new WebClient())
{
client.Encoding = Encoding.UTF8;
string htmlCode = client.DownloadString(http://www.filmweb.pl/Mroczne.Widmo);
}
</code></pre>
<p>When I print "htmlCode" to the console, the international characters are not shown correctly even though in the original HTML they are shown correctly. </p>
<p>Any help is appreciated. </p>
| 0debug
|
KeyVaultErrorException: Operation returned an invalid status code 'Forbidden' : <p>I'm trying to set up my web app, hosted in Azure to read settings from Azure KeyVault.</p>
<p>I've been following this guide: <a href="https://anthonychu.ca/post/secrets-aspnet-core-key-vault-msi/" rel="noreferrer">https://anthonychu.ca/post/secrets-aspnet-core-key-vault-msi/</a></p>
<p>The example shows how to access app settings from KeyVault with the configuration:</p>
<pre><code>public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((ctx, builder) =>
{
var keyVaultEndpoint = Environment.GetEnvironmentVariable("KEYVAULT_ENDPOINT");
if (!string.IsNullOrEmpty(keyVaultEndpoint))
{
var azureServiceTokenProvider = new AzureServiceTokenProvider();
var keyVaultClient = new KeyVaultClient(
new KeyVaultClient.AuthenticationCallback(
azureServiceTokenProvider.KeyVaultTokenCallback));
builder.AddAzureKeyVault(
keyVaultEndpoint, keyVaultClient, new DefaultKeyVaultSecretManager());
}
})
.UseApplicationInsights()
.UseStartup<Startup>()
.Build();
</code></pre>
<p>I've added the KEYVAULT_ENDPOINT environment variable to the application settings. I've enabled MSI on the app service, and I've authorized my Azure User, and my application, from the Key Vault Access Policies:</p>
<p><a href="https://i.stack.imgur.com/iUv3x.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iUv3x.png" alt="enter image description here"></a></p>
<p>With Get and List Operations:</p>
<p><a href="https://i.stack.imgur.com/47a1K.png" rel="noreferrer"><img src="https://i.stack.imgur.com/47a1K.png" alt="enter image description here"></a> </p>
<p>And I've added the secret to key vault. Running locally, I can access the secret.</p>
<p>But my ASP .NET Core site fails on startup with this in the stdout logs:</p>
<pre><code>Unhandled Exception: Microsoft.Azure.KeyVault.Models.KeyVaultErrorException: Operation returned an invalid status code 'Forbidden'
at Microsoft.Azure.KeyVault.KeyVaultClient.GetSecretsWithHttpMessagesAsync(String vaultBaseUrl, Nullable`1 maxresults, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.KeyVault.KeyVaultClientExtensions.GetSecretsAsync(IKeyVaultClient operations, String vaultBaseUrl, Nullable`1 maxresults, CancellationToken cancellationToken)
at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationProvider.LoadAsync()
at Microsoft.Extensions.Configuration.AzureKeyVault.AzureKeyVaultConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at Blog.Program.BuildWebHost(String[] args) in D:\a\1\s\[csproj name]\Program.cs:line 22
at [csproj name].Program.Main(String[] args) in D:\a\1\s\[csproj name]\Program.cs:line 16
</code></pre>
<p>I've checked that MSI_ENDPOINT and MSI_SECRET environment variables exist by calling SET from the debug console. <a href="https://i.stack.imgur.com/km5B6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/km5B6.png" alt="enter image description here"></a> </p>
<p>I can also see the KEYVAULT_ENDPOINT variable.</p>
<p>Any suggestions what could be going wrong or on what to try next? Since it works locally it must be an authentication issue, but I believe it's authenticating locally with my azure User that I've authorized in key vault, rather than as the Azure App Service. </p>
| 0debug
|
virtio_crypto_check_cryptodev_is_used(Object *obj, const char *name,
Object *val, Error **errp)
{
if (cryptodev_backend_is_used(CRYPTODEV_BACKEND(val))) {
char *path = object_get_canonical_path_component(val);
error_setg(errp,
"can't use already used cryptodev backend: %s", path);
g_free(path);
} else {
qdev_prop_allow_set_link_before_realize(obj, name, val, errp);
}
}
| 1threat
|
static int virtio_balloon_init_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
VirtIODevice *vdev;
vdev = virtio_balloon_init(&pci_dev->qdev);
virtio_init_pci(proxy, vdev,
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRTIO_BALLOON,
PCI_CLASS_MEMORY_RAM,
0x00);
return 0;
}
| 1threat
|
Visual Studio 2017 HRESULT: 0x80070005 / E_ACCESSDENIED on project creation : <p>I'm running Visual Studio 2017, version 15.0.0+26228.9</p>
<p><a href="https://i.stack.imgur.com/y07y0.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/y07y0.jpg" alt="enter image description here"></a></p>
<p>When I'm trying to create a new project via <em>File > New > Project...</em> in Visual Studio 2017, I'm receiving the following error message and the project is not created:</p>
<blockquote>
<p>Access denied (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))</p>
</blockquote>
<p>Don't mind the german message text in the screenshot:
<a href="https://i.stack.imgur.com/SJtfA.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/SJtfA.jpg" alt="Exception message on project creation"></a></p>
<p>This happens for every project template I use (e.g. C# WPF, VB WPF, C# Console App...).</p>
<p>If I try to create a project via the quick search box on the starting page of visual studio, VS just crashes instantly with no exception message at all:</p>
<p><a href="https://i.stack.imgur.com/hOBi8.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/hOBi8.jpg" alt="Quick search project template box"></a></p>
<p>Has anybody else ran into this issue and might know how to fix it?</p>
| 0debug
|
Why does casting this double to an int give me 0? : <p>Sorry this has been confusing me for hours and nothing comes up on google about this. I'm programming in C, trying to convert decimal to binary, and I'm confused as to why this keeps giving me the right amount as input but the integer value is always 0.</p>
<p>even if I properly cast input as an int, it doesn't work (ie: int integer = (int) input;</p>
<pre><code>main() {
double input;
scanf("%d", &input);
printf("input: %d \n", input); // this will print fine
int integer = input; // stores nums before decimal
printf("integer:%i\n", integer); // this always prints 0
</code></pre>
| 0debug
|
Array - Loop - Generate random number in Java : <p>I have to write a program that generate random integers from 0 to 9 for 1000 times and count repeated numbers. So output should be like:</p>
<p>0 used 123 times,
1 used 89 times,
2 301 times,
.
.
9 used 23 times</p>
<p>I must use math.random for this. I can generate numbers but how can I use array and loop for this?</p>
<p>Thanks.</p>
| 0debug
|
R and Leaflet: How to arrange label text across multiple lines : <p>Suppose you have the following data frame:</p>
<pre><code>cities = data.frame( name = c('Madrid','Barcelona','Sevilla'),
country = c('Spain','Spain','Spain'),
region = c('Comunidad de Madrid','Cataluña','Andalucia'),
data = c(100, 200, 300),
lng = c(-3.683333,2.166667,-6.083333),
lat = c(40.433333,41.383333,37.446667))
</code></pre>
<p>My idea is to have a map of these cities and labels that could display some relevant information when hovering the corresponding city circles. I'd like to have the label text arranged in several lines. The very first approach below failed:</p>
<pre><code>library( leaflet )
map = leaflet( cities ) %>%
addTiles() %>%
addCircles( lng = ~lng, lat = ~lat, fillColor = 'darkBlue', radius = 10000,
stroke = FALSE, fillOpacity = 0.8, label = paste0( cities$name,'\n', cities$region, '\n', cities$country, '\n', cities$data ) )
</code></pre>
<p>as well as other similar attempts. After googling a while, I found a possible solution by involving the <em>htmltools</em> package:</p>
<pre><code>library( htmltools )
map2 = leaflet( cities ) %>%
addTiles() %>%
addCircles( lng = ~lng, lat = ~lat, fillColor = 'darkBlue', radius = 10000,
stroke = FALSE, fillOpacity = 0.8,
label = HTML( paste0( '<p>', cities$name, '<p></p>', cities$region, ', ', cities$country,'</p><p>', cities$data, '</p>' ) ) )
</code></pre>
<p>In this case, the information is displayed as I'd like but, within the same label, there is an entry for each city of the dataset. How could I do to have the text of a single city arranged in multiple lines? Any help would be really appreciated</p>
| 0debug
|
void pci_device_save(PCIDevice *s, QEMUFile *f)
{
int i;
qemu_put_be32(f, s->version_id);
qemu_put_buffer(f, s->config, 256);
for (i = 0; i < 4; i++)
qemu_put_be32(f, s->irq_state[i]);
}
| 1threat
|
Best way to abstract wrapping C error handling with exceptions : <p>It is not uncommon for a useful C library to not provide C++ bindings. It's easy to call C from C++, but among other issues, a C++ project probably wants exceptions, rather than numerical error return values.</p>
<p>Is there any particular convention or trick for converting to exceptions without including an <code>if</code> and <code>throw</code> with each function call?</p>
<p>I wrote this solution for wrapping gphoto2 calls. Having to wrap the templated function in a macro is awkward (but the function name is kind of important for error messages; the logic here is similar to <code>perror</code>). </p>
<p>Is there a better technique, or any open source project that does this particularly well?</p>
<pre class="lang-cpp prettyprint-override"><code>#include <gphoto2/gphoto2.h>
#include <string>
class Gphoto2Error : public std::exception {
private:
std::string message;
public:
Gphoto2Error(std::string func, int err) {
message = func + ": " + std::string(gp_result_as_string(err));
}
const char *what() const throw() {
return message.c_str();
}
};
template <typename F, typename... Args>
void _gpCall(const char *name, F f, Args... args) {
int ret = f(args...);
if (ret != GP_OK) {
throw Gphoto2Error(name, ret);
}
}
#define gpCall(f, ...) ((_gpCall(#f, ((f)), __VA_ARGS__)))
int main() {
GPContext *ctx = gp_context_new();
Camera *camera;
gpCall(gp_camera_new, &camera);
gpCall(gp_camera_init, camera, ctx);
}
</code></pre>
| 0debug
|
static void openpic_reset(DeviceState *d)
{
OpenPICState *opp = FROM_SYSBUS(typeof (*opp), sysbus_from_qdev(d));
int i;
opp->glbc = GLBC_RESET;
opp->frep = ((opp->nb_irqs - 1) << FREP_NIRQ_SHIFT) |
((opp->nb_cpus - 1) << FREP_NCPU_SHIFT) |
(opp->vid << FREP_VID_SHIFT);
opp->pint = 0;
opp->spve = -1 & opp->vector_mask;
opp->tifr = opp->tifr_reset;
for (i = 0; i < opp->max_irq; i++) {
opp->src[i].ipvp = opp->ipvp_reset;
opp->src[i].ide = opp->ide_reset;
}
for (i = 0; i < MAX_CPU; i++) {
opp->dst[i].pctp = 15;
memset(&opp->dst[i].raised, 0, sizeof(IRQ_queue_t));
opp->dst[i].raised.next = -1;
memset(&opp->dst[i].servicing, 0, sizeof(IRQ_queue_t));
opp->dst[i].servicing.next = -1;
}
for (i = 0; i < MAX_TMR; i++) {
opp->timers[i].ticc = 0;
opp->timers[i].tibc = TIBC_CI;
}
opp->glbc = 0;
}
| 1threat
|
Nothing displaying in console when using console.log with if statements in for loops : <p>I have two objects:</p>
<pre><code>var obj = { first: "Romeo", last: "Montague" };
var search = { last: "Montague" };
</code></pre>
<p>My goal is to find if the second object (<code>search</code>) is present in the first one, and <code>console.log</code> it if it is.</p>
<p>First, I get the keys of both objects:</p>
<pre><code>var objKeys = Object.keys(obj);
var searchKeys = Object.keys(search);
</code></pre>
<p>Then I am trying to iterate trough both keys and compare them, and if they match, <code>console.log</code> the value from the first obj (<code>obj</code>).</p>
<pre><code>//for every key in object
for(var x = 0; x < objKeys.lenght; x++) {
//for every key in search
for(var y = 0; y < searchKeys.length; y++) {
//see if a key matches
if(searchKeys[y] == objKeys[x]) {
//see if the value matches
if(obj[objKeys[x]] == search[searchKeys[y]]) {
console.log(obj[objKeys[x]]);
}
else {
console.log("value not found");
}
}
else {
console.log("key not found");
}
}
}
</code></pre>
<p>Now when I run this code, nothing displays in the console. No errors or messages. Can anybody point out what I'm doing wrong?</p>
<p>I've create a <a href="https://jsfiddle.net/gdbw58r8/2/" rel="nofollow">jsFiddle</a> of this code, if you want to tinker.</p>
| 0debug
|
Is var str: String mutable or immutable? : <p>I have declared a String variable in Kotlin as like.</p>
<p><code>var str: String</code></p>
<p>The Kotlin document contradict for mutability concept.
As per document...
var is mutable.
<img src="https://i.stack.imgur.com/jRttP.png" alt="var is mutable"></p>
<p>But for String it define as immutable.
<img src="https://i.stack.imgur.com/W6ssW.png" alt="String is immutable"></p>
<p>So please clarify contradiction...</p>
| 0debug
|
For every CreateProcess, call my function first : <p>My idea is, to make a pop up window for every new process that will be created so I can be sure, that there are only processes with my permission.</p>
<p>The question is, how I link my function in before Windows is creating the new process. </p>
<p>I tried some dll injections but it does not work.</p>
<p>Has anyone a solution for this problem or is it even not possible?</p>
<p>Thanks!</p>
| 0debug
|
static int ftp_get_file_handle(URLContext *h)
{
FTPContext *s = h->priv_data;
av_dlog(h, "ftp protocol get_file_handle\n");
if (s->conn_data)
return ffurl_get_file_handle(s->conn_data);
return AVERROR(EIO);
}
| 1threat
|
"Computed" property in Typescript : <p>Folks, I'm in the middle of "learning by doing" in Angular 6 & 7, and I came across this issue a number of times.</p>
<p>Imagine I have a class/interface/type - e.g. <code>Person</code> - with a few properties, that are returned by a Web API call - something like this:</p>
<pre><code>export interface Person {
FirstName: string;
LastName: string;
JobTitle: string;
// so other properties - not relevant to this question
}
</code></pre>
<p>What I'd like to be able to is show the <strong>full name</strong> (e.g. "FirstName + [Space] + LastName") in e.g. an Angular grid (AG-Grid) or someplace else - where I <strong>cannot</strong> use a concat expression or anything, but I need to refer to a single property on the class/interface/type.</p>
<p>In C#, I would just create a property</p>
<pre><code>string FullName { get { return $"{FirstName} {LastName}"; } }
</code></pre>
<p>and be done with it - but how can I do this in Typescript?? From what I've been reading and researching, this seems to be <strong>unsupported</strong> - really?!?!!? How can that be??? Seems like such a simple and often-used operation - what's the reason this doesn't exist in Typescript?? Or does it exist - and I just haven't found the way to do this in TS? </p>
| 0debug
|
static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size, int keyframe){
unsigned int *state= bsfc->priv_data;
int amount= args ? atoi(args) : (*state % 10001+1);
int i;
*poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
for(i=0; i<buf_size; i++){
(*state) += (*poutbuf)[i] + 1;
if(*state % amount == 0)
(*poutbuf)[i] = *state;
}
return 1;
}
| 1threat
|
How to create a executable file that (once click) will copy and paste file to a drive : How to create a executable file that (once click the exe file) will copy and paste file to a drive.
I would like to automate the process of copying manually of e.g
File.pdf to C:\folderA
Is there anyway to do it?
Many thanks
| 0debug
|
Error: SELECT bookedseat from bookings where sdate=2018-04-26 and stime=5PM Unknown column '5PM' in 'where clause' : <p><a href="https://i.stack.imgur.com/Rkpo4.jpg" rel="nofollow noreferrer">This is the html form code</a></p>
<p><a href="https://i.stack.imgur.com/OiYlQ.jpg" rel="nofollow noreferrer">And this is the php for the above form.After executing this,I get an error saying " Error: SELECT bookedseat from bookings where sdate=2018-04-26 and stime=5PM
Unknown column '5PM' in 'where clause' "</a></p>
<p>Why is it?</p>
| 0debug
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.