problem
stringlengths 26
131k
| labels
class label 2
classes |
|---|---|
static int init_directories(BDRVVVFATState* s,
const char *dirname, int heads, int secs,
Error **errp)
{
bootsector_t* bootsector;
mapping_t* mapping;
unsigned int i;
unsigned int cluster;
memset(&(s->first_sectors[0]),0,0x40*0x200);
s->cluster_size=s->sectors_per_cluster*0x200;
s->cluster_buffer=g_malloc(s->cluster_size);
i = 1+s->sectors_per_cluster*0x200*8/s->fat_type;
s->sectors_per_fat=(s->sector_count+i)/i;
array_init(&(s->mapping),sizeof(mapping_t));
array_init(&(s->directory),sizeof(direntry_t));
{
direntry_t* entry=array_get_next(&(s->directory));
entry->attributes=0x28;
memcpy(entry->name, "QEMU VVFAT ", sizeof(entry->name));
}
init_fat(s);
s->faked_sectors=s->first_sectors_number+s->sectors_per_fat*2;
s->cluster_count=sector2cluster(s, s->sector_count);
mapping = array_get_next(&(s->mapping));
mapping->begin = 0;
mapping->dir_index = 0;
mapping->info.dir.parent_mapping_index = -1;
mapping->first_mapping_index = -1;
mapping->path = g_strdup(dirname);
i = strlen(mapping->path);
if (i > 0 && mapping->path[i - 1] == '/')
mapping->path[i - 1] = '\0';
mapping->mode = MODE_DIRECTORY;
mapping->read_only = 0;
s->path = mapping->path;
for (i = 0, cluster = 0; i < s->mapping.next; i++) {
int fix_fat = (i != 0);
mapping = array_get(&(s->mapping), i);
if (mapping->mode & MODE_DIRECTORY) {
mapping->begin = cluster;
if(read_directory(s, i)) {
error_setg(errp, "Could not read directory %s",
mapping->path);
return -1;
}
mapping = array_get(&(s->mapping), i);
} else {
assert(mapping->mode == MODE_UNDEFINED);
mapping->mode=MODE_NORMAL;
mapping->begin = cluster;
if (mapping->end > 0) {
direntry_t* direntry = array_get(&(s->directory),
mapping->dir_index);
mapping->end = cluster + 1 + (mapping->end-1)/s->cluster_size;
set_begin_of_direntry(direntry, mapping->begin);
} else {
mapping->end = cluster + 1;
fix_fat = 0;
}
}
assert(mapping->begin < mapping->end);
cluster = mapping->end;
if(cluster > s->cluster_count) {
error_setg(errp,
"Directory does not fit in FAT%d (capacity %.2f MB)",
s->fat_type, s->sector_count / 2000.0);
return -1;
}
if (fix_fat) {
int j;
for(j = mapping->begin; j < mapping->end - 1; j++)
fat_set(s, j, j+1);
fat_set(s, mapping->end - 1, s->max_fat_value);
}
}
mapping = array_get(&(s->mapping), 0);
s->sectors_of_root_directory = mapping->end * s->sectors_per_cluster;
s->last_cluster_of_root_directory = mapping->end;
fat_set(s,0,s->max_fat_value);
fat_set(s,1,s->max_fat_value);
s->current_mapping = NULL;
bootsector=(bootsector_t*)(s->first_sectors+(s->first_sectors_number-1)*0x200);
bootsector->jump[0]=0xeb;
bootsector->jump[1]=0x3e;
bootsector->jump[2]=0x90;
memcpy(bootsector->name,"QEMU ",8);
bootsector->sector_size=cpu_to_le16(0x200);
bootsector->sectors_per_cluster=s->sectors_per_cluster;
bootsector->reserved_sectors=cpu_to_le16(1);
bootsector->number_of_fats=0x2;
bootsector->root_entries=cpu_to_le16(s->sectors_of_root_directory*0x10);
bootsector->total_sectors16=s->sector_count>0xffff?0:cpu_to_le16(s->sector_count);
bootsector->media_type=(s->first_sectors_number>1?0xf8:0xf0);
s->fat.pointer[0] = bootsector->media_type;
bootsector->sectors_per_fat=cpu_to_le16(s->sectors_per_fat);
bootsector->sectors_per_track = cpu_to_le16(secs);
bootsector->number_of_heads = cpu_to_le16(heads);
bootsector->hidden_sectors=cpu_to_le32(s->first_sectors_number==1?0:0x3f);
bootsector->total_sectors=cpu_to_le32(s->sector_count>0xffff?s->sector_count:0);
bootsector->u.fat16.drive_number=s->first_sectors_number==1?0:0x80;
bootsector->u.fat16.current_head=0;
bootsector->u.fat16.signature=0x29;
bootsector->u.fat16.id=cpu_to_le32(0xfabe1afd);
memcpy(bootsector->u.fat16.volume_label,"QEMU VVFAT ",11);
memcpy(bootsector->fat_type,(s->fat_type==12?"FAT12 ":s->fat_type==16?"FAT16 ":"FAT32 "),8);
bootsector->magic[0]=0x55; bootsector->magic[1]=0xaa;
return 0;
}
| 1threat
|
static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilterInOut *in)
{
AVFilterContext *last_filter;
const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
InputStream *ist = ifilter->ist;
InputFile *f = input_files[ist->file_index];
AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
ist->st->time_base;
AVRational sar;
char args[255], name[255];
int ret, pad_idx = 0;
sar = ist->st->sample_aspect_ratio.num ?
ist->st->sample_aspect_ratio :
ist->st->codec->sample_aspect_ratio;
snprintf(args, sizeof(args), "%d:%d:%d:%d:%d:%d:%d", ist->st->codec->width,
ist->st->codec->height, ist->st->codec->pix_fmt,
tb.num, tb.den, sar.num, sar.den);
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
ist->file_index, ist->st->index);
if ((ret = avfilter_graph_create_filter(&ifilter->filter, buffer_filt, name,
args, NULL, fg->graph)) < 0)
return ret;
last_filter = ifilter->filter;
if (ist->framerate.num) {
AVFilterContext *setpts;
snprintf(name, sizeof(name), "force CFR for input from stream %d:%d",
ist->file_index, ist->st->index);
if ((ret = avfilter_graph_create_filter(&setpts,
avfilter_get_by_name("setpts"),
name, "N", NULL,
fg->graph)) < 0)
return ret;
if ((ret = avfilter_link(last_filter, 0, setpts, 0)) < 0)
return ret;
last_filter = setpts;
}
snprintf(name, sizeof(name), "trim for input stream %d:%d",
ist->file_index, ist->st->index);
ret = insert_trim(((f->start_time == AV_NOPTS_VALUE) || !f->accurate_seek) ?
AV_NOPTS_VALUE : 0, INT64_MAX, &last_filter, &pad_idx, name);
if (ret < 0)
return ret;
if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
return ret;
return 0;
}
| 1threat
|
Quick Pandas Exercise : <p>I have a dataset like this:</p>
<pre><code>ID Type Value
01 A $10
01 B $12
01 C $14
02 B $20
02 C $21
03 B $11
</code></pre>
<p>I want to convert this into:</p>
<pre><code>ID TypeA TypeB TypeC
01 $10 $12 $14
02 $0 $20 $21
03 $0 $11 $0
</code></pre>
<p>The only solution that I have is bunch of if-loops but don't have a few-liner. Can anyone help me with this python (pandas) problem?</p>
<p>Thanks</p>
| 0debug
|
How to delete a ToDo Item onClick in React? : <p>I'm doing a simple todo app with React, just to practise. How can I delete a list item, when clicking on it? </p>
<p>Here is my todos.js</p>
<pre><code>export default class Todos extends Component {
constructor(props) {
super(props);
this.state = { todos: [], text: '' };
}
addTodo(e) {
e.preventDefault();
this.setState({ todos: [ this.state.text, ...this.state.todos ] });
this.setState({ text: ''});
}
updateValue(e) {
this.setState({ text: [e.target.value]})
}
render() {
return(
<div>
<form onSubmit = {(e) => this.addTodo(e)}>
<input
placeholder="Add Todo"
value={this.state.text}
onChange={(e) => {this.updateValue(e)}}
/>
<button type="submit">Add Todo</button>
</form>
<TodoList todos={this.state.todos}/>
</div>
);
}
}
</code></pre>
<p>And here is the TodoList.js, where I'm trying to remove a list item from. </p>
<pre><code>import React, { Component } from 'react';
import { connect } from 'react-redux';
export default class TodoList extends Component {
removeItem(e) {
// splice this.props.todos??
}
render() {
return(
<ul>
{ this.props.todos.map((todo) => {
return <li onClick={(e) => { this.removeItem(e)}} key={todo}>{ todo }</li>
})}
</ul>
);
}
}
</code></pre>
| 0debug
|
static int clv_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
CLVContext *c = avctx->priv_data;
GetByteContext gb;
uint32_t frame_type;
int i, j;
int ret;
int mb_ret = 0;
bytestream2_init(&gb, buf, buf_size);
if (avctx->codec_tag == MKTAG('C','L','V','1')) {
int skip = bytestream2_get_byte(&gb);
bytestream2_skip(&gb, (skip + 1) * 8);
frame_type = bytestream2_get_byte(&gb);
if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
return ret;
c->pic->key_frame = frame_type & 0x20 ? 1 : 0;
c->pic->pict_type = frame_type & 0x20 ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
if (frame_type & 0x2) {
bytestream2_get_be32(&gb);
c->ac_quant = bytestream2_get_byte(&gb);
c->luma_dc_quant = 32;
c->chroma_dc_quant = 32;
if ((ret = init_get_bits8(&c->gb, buf + bytestream2_tell(&gb),
(buf_size - bytestream2_tell(&gb)))) < 0)
return ret;
for (i = 0; i < 3; i++)
c->top_dc[i] = 32;
for (i = 0; i < 4; i++)
c->left_dc[i] = 32;
for (j = 0; j < c->mb_height; j++) {
for (i = 0; i < c->mb_width; i++) {
ret = decode_mb(c, i, j);
if (ret < 0)
mb_ret = ret;
} else {
if ((ret = av_frame_ref(data, c->pic)) < 0)
return ret;
*got_frame = 1;
return mb_ret < 0 ? mb_ret : buf_size;
| 1threat
|
slideup a div when showing which is initially on hide in Jquery? : i am new to jQuery .i had a requirement to show the div based on id , while showing it i need to slideup. but the div is initially on hide.
i tried it but it is not sliding up , it is showing bottom of page i need to scroll down to view that div.
html
----
<ul>
<li >
<a class="page-scroll" href="#registerDiv" id="register">Redeem</a>
</li>
</ul>
<section id="registerDiv" ng-controller="registerCtrl">
//something to show this section when clicked
</section>
js
---
<script>
$(document).ready(function(){
$("#registerDiv").hide();
$("#register").click(function(){
$("#registerDiv").slideUp().show("slow"); //need to slideUp here
});
});
</script>
please help any out there. Thanks in advance
| 0debug
|
int64_t qdict_get_int(const QDict *qdict, const char *key)
{
QObject *obj = qdict_get_obj(qdict, key, QTYPE_QINT);
return qint_get_int(qobject_to_qint(obj));
}
| 1threat
|
void hmp_info_spice(Monitor *mon, const QDict *qdict)
{
SpiceChannelList *chan;
SpiceInfo *info;
const char *channel_name;
const char * const channel_names[] = {
[SPICE_CHANNEL_MAIN] = "main",
[SPICE_CHANNEL_DISPLAY] = "display",
[SPICE_CHANNEL_INPUTS] = "inputs",
[SPICE_CHANNEL_CURSOR] = "cursor",
[SPICE_CHANNEL_PLAYBACK] = "playback",
[SPICE_CHANNEL_RECORD] = "record",
[SPICE_CHANNEL_TUNNEL] = "tunnel",
[SPICE_CHANNEL_SMARTCARD] = "smartcard",
[SPICE_CHANNEL_USBREDIR] = "usbredir",
[SPICE_CHANNEL_PORT] = "port",
#if 0
[SPICE_CHANNEL_WEBDAV] = "webdav",
#endif
};
info = qmp_query_spice(NULL);
if (!info->enabled) {
monitor_printf(mon, "Server: disabled\n");
goto out;
}
monitor_printf(mon, "Server:\n");
if (info->has_port) {
monitor_printf(mon, " address: %s:%" PRId64 "\n",
info->host, info->port);
}
if (info->has_tls_port) {
monitor_printf(mon, " address: %s:%" PRId64 " [tls]\n",
info->host, info->tls_port);
}
monitor_printf(mon, " migrated: %s\n",
info->migrated ? "true" : "false");
monitor_printf(mon, " auth: %s\n", info->auth);
monitor_printf(mon, " compiled: %s\n", info->compiled_version);
monitor_printf(mon, " mouse-mode: %s\n",
SpiceQueryMouseMode_lookup[info->mouse_mode]);
if (!info->has_channels || info->channels == NULL) {
monitor_printf(mon, "Channels: none\n");
} else {
for (chan = info->channels; chan; chan = chan->next) {
monitor_printf(mon, "Channel:\n");
monitor_printf(mon, " address: %s:%s%s\n",
chan->value->base->host, chan->value->base->port,
chan->value->tls ? " [tls]" : "");
monitor_printf(mon, " session: %" PRId64 "\n",
chan->value->connection_id);
monitor_printf(mon, " channel: %" PRId64 ":%" PRId64 "\n",
chan->value->channel_type, chan->value->channel_id);
channel_name = "unknown";
if (chan->value->channel_type > 0 &&
chan->value->channel_type < ARRAY_SIZE(channel_names) &&
channel_names[chan->value->channel_type]) {
channel_name = channel_names[chan->value->channel_type];
}
monitor_printf(mon, " channel name: %s\n", channel_name);
}
}
out:
qapi_free_SpiceInfo(info);
}
| 1threat
|
Is there a way to enforce method return types on Typescript classes via a tslint rule? : <p>I've read the tslint rules <a href="https://palantir.github.io/tslint/rules" rel="noreferrer">here</a> and while it <em>looks</em> like <a href="https://palantir.github.io/tslint/rules/typedef" rel="noreferrer">the typedef rule</a>'s <code>call-signature</code> option is what I want, it doesn't complain about the lack of a return type.</p>
<p>Anyone know the rule (f one exists) to enforce return types on class methods?</p>
| 0debug
|
javax.xml.bind.JAXBException Implementation of JAXB-API has not been found on module path or classpath : <p>I'm trying to run my Spring Boot application on Java 9, and I've faced with JAXB problem, which described in the guides, but didn't work for me. I've added dependency on JAXB api, and application started working.
If you get the following exception, as a result of missing JAXB missing implementation using Java version >=9:</p>
<pre><code>javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:177) ~[jaxb-api-2.3.0.jar:2.3.0]
at javax.xml.bind.ContextFinder.find(ContextFinder.java:364) ~[jaxb-api-2.3.0.jar:2.3.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:508) ~[jaxb-api-2.3.0.jar:2.3.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:465) ~[jaxb-api-2.3.0.jar:2.3.0]
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:366) ~[jaxb-api-2.3.0.jar:2.3.0]
at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:107) ~[jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:100) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:106) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193) [jersey-core-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790) [jersey-server-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509) [jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339) [jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605) [jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207) [jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394) [jersey-servlet-1.19.1.jar:1.19.1]
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:744) [jersey-servlet-1.19.1.jar:1.19.1]
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:106) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4491) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) [tomcat-embed-core-9.0.10.jar:9.0.10]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [na:na]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.10.jar:9.0.10]
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140) [na:na]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) [tomcat-embed-core-9.0.10.jar:9.0.10]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [na:na]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) [tomcat-embed-core-9.0.10.jar:9.0.10]
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140) [na:na]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:371) [tomcat-embed-core-9.0.10.jar:9.0.10]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:107) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:86) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:413) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:174) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:152) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) [spring-context-5.1.0.RC1.jar:5.1.0.RC1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:769) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1252) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1240) [spring-boot-2.1.0.M1.jar:2.1.0.M1]
at io.eureka.server.EurekaServerApp.main(EurekaServerApp.java:21) [classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.1.0.M1.jar:2.1.0.M1]
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:70) ~[spring-boot-2.1.0.M1.jar:2.1.0.M1]
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1138) ~[tomcat-embed-core-9.0.10.jar:9.0.10]
at javax.xml.bind.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:122) ~[jaxb-api-2.3.0.jar:2.3.0]
at javax.xml.bind.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:155) ~[jaxb-api-2.3.0.jar:2.3.0]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:174) ~[jaxb-api-2.3.0.jar:2.3.0]
... 66 common frames omitted
</code></pre>
| 0debug
|
static void do_drive_backup(DriveBackup *backup, BlockJobTxn *txn, Error **errp)
{
BlockDriverState *bs;
BlockDriverState *target_bs;
BlockDriverState *source = NULL;
BdrvDirtyBitmap *bmap = NULL;
AioContext *aio_context;
QDict *options = NULL;
Error *local_err = NULL;
int flags;
int64_t size;
if (!backup->has_speed) {
backup->speed = 0;
}
if (!backup->has_on_source_error) {
backup->on_source_error = BLOCKDEV_ON_ERROR_REPORT;
}
if (!backup->has_on_target_error) {
backup->on_target_error = BLOCKDEV_ON_ERROR_REPORT;
}
if (!backup->has_mode) {
backup->mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
}
if (!backup->has_job_id) {
backup->job_id = NULL;
}
if (!backup->has_compress) {
backup->compress = false;
}
bs = qmp_get_root_bs(backup->device, errp);
if (!bs) {
return;
}
aio_context = bdrv_get_aio_context(bs);
aio_context_acquire(aio_context);
if (!backup->has_format) {
backup->format = backup->mode == NEW_IMAGE_MODE_EXISTING ?
NULL : (char*) bs->drv->format_name;
}
if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_BACKUP_SOURCE, errp)) {
goto out;
}
flags = bs->open_flags | BDRV_O_RDWR;
if (backup->sync == MIRROR_SYNC_MODE_TOP) {
source = backing_bs(bs);
if (!source) {
backup->sync = MIRROR_SYNC_MODE_FULL;
}
}
if (backup->sync == MIRROR_SYNC_MODE_NONE) {
source = bs;
}
size = bdrv_getlength(bs);
if (size < 0) {
error_setg_errno(errp, -size, "bdrv_getlength failed");
goto out;
}
if (backup->mode != NEW_IMAGE_MODE_EXISTING) {
assert(backup->format);
if (source) {
bdrv_img_create(backup->target, backup->format, source->filename,
source->drv->format_name, NULL,
size, flags, &local_err, false);
} else {
bdrv_img_create(backup->target, backup->format, NULL, NULL, NULL,
size, flags, &local_err, false);
}
}
if (local_err) {
error_propagate(errp, local_err);
goto out;
}
if (backup->format) {
options = qdict_new();
qdict_put(options, "driver", qstring_from_str(backup->format));
}
target_bs = bdrv_open(backup->target, NULL, options, flags, errp);
if (!target_bs) {
goto out;
}
bdrv_set_aio_context(target_bs, aio_context);
if (backup->has_bitmap) {
bmap = bdrv_find_dirty_bitmap(bs, backup->bitmap);
if (!bmap) {
error_setg(errp, "Bitmap '%s' could not be found", backup->bitmap);
bdrv_unref(target_bs);
goto out;
}
}
backup_start(backup->job_id, bs, target_bs, backup->speed, backup->sync,
bmap, backup->compress, backup->on_source_error,
backup->on_target_error, BLOCK_JOB_DEFAULT,
NULL, NULL, txn, &local_err);
bdrv_unref(target_bs);
if (local_err != NULL) {
error_propagate(errp, local_err);
goto out;
}
out:
aio_context_release(aio_context);
}
| 1threat
|
Laravel 5.5 set size of integer fields in migration file : <p>I am new to laravel.</p>
<p>Now i am using the migrate command to make a table, but the length of the filed is not applicable. Laravel does not provide this option. ?</p>
<p>Below is my codes:</p>
<pre><code>$table->increments('id')->length(11);
$table->dateTime('created_time');
$table->integer('bank_id')->length(11);
$table->tinyInteger('is_black')->length(1);
</code></pre>
<p>The length of the field <code>is_black</code> should be 1, but it is actually being generated as 4.
How can I solve this problem ?</p>
<p>Any suggestion or advice would be appreciated.</p>
<p>Thank you in advance</p>
| 0debug
|
void ppc_hash64_store_hpte(PowerPCCPU *cpu,
target_ulong pte_index,
target_ulong pte0, target_ulong pte1)
{
CPUPPCState *env = &cpu->env;
if (env->external_htab == MMU_HASH64_KVM_MANAGED_HPT) {
kvmppc_hash64_write_pte(env, pte_index, pte0, pte1);
return;
}
pte_index *= HASH_PTE_SIZE_64;
if (env->external_htab) {
stq_p(env->external_htab + pte_index, pte0);
stq_p(env->external_htab + pte_index + HASH_PTE_SIZE_64 / 2, pte1);
} else {
stq_phys(CPU(cpu)->as, env->htab_base + pte_index, pte0);
stq_phys(CPU(cpu)->as,
env->htab_base + pte_index + HASH_PTE_SIZE_64 / 2, pte1);
}
}
| 1threat
|
Redefining a #define in c++ on run time : <p>Right now I'm merging two codes with the same core, but they differentiate with the #defines, what I need is to make a way around it an choose wicth configuration I need on run time, the code uses if ENABLE(defined) to verify the configurations to load, how can I modify the code to make it work?
Thanks</p>
| 0debug
|
matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
int64_t pos, uint64_t cluster_time,
int is_keyframe, int is_bframe,
int *ptrack, AVPacket **ppkt)
{
int res = 0;
int track;
AVPacket *pkt;
uint8_t *origdata = data;
int16_t block_time;
uint32_t *lace_size = NULL;
int n, flags, laces = 0;
uint64_t num;
if ((n = matroska_ebmlnum_uint(data, size, &num)) < 0) {
av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n");
av_free(origdata);
return res;
}
data += n;
size -= n;
track = matroska_find_track_by_num(matroska, num);
if (ptrack) *ptrack = track;
if (size <= 3 || track < 0 || track >= matroska->num_tracks) {
av_log(matroska->ctx, AV_LOG_INFO,
"Invalid stream %d or size %u\n", track, size);
av_free(origdata);
return res;
}
if(matroska->ctx->streams[ matroska->tracks[track]->stream_index ]->discard >= AVDISCARD_ALL){
av_free(origdata);
return res;
}
block_time = (data[0] << 8) | data[1];
data += 2;
size -= 2;
flags = *data;
data += 1;
size -= 1;
if (is_keyframe == -1)
is_keyframe = flags & 1 ? PKT_FLAG_KEY : 0;
switch ((flags & 0x06) >> 1) {
case 0x0:
laces = 1;
lace_size = av_mallocz(sizeof(int));
lace_size[0] = size;
break;
case 0x1:
case 0x2:
case 0x3:
if (size == 0) {
res = -1;
break;
}
laces = (*data) + 1;
data += 1;
size -= 1;
lace_size = av_mallocz(laces * sizeof(int));
switch ((flags & 0x06) >> 1) {
case 0x1: {
uint8_t temp;
uint32_t total = 0;
for (n = 0; res == 0 && n < laces - 1; n++) {
while (1) {
if (size == 0) {
res = -1;
break;
}
temp = *data;
lace_size[n] += temp;
data += 1;
size -= 1;
if (temp != 0xff)
break;
}
total += lace_size[n];
}
lace_size[n] = size - total;
break;
}
case 0x2:
for (n = 0; n < laces; n++)
lace_size[n] = size / laces;
break;
case 0x3: {
uint32_t total;
n = matroska_ebmlnum_uint(data, size, &num);
if (n < 0) {
av_log(matroska->ctx, AV_LOG_INFO,
"EBML block data error\n");
break;
}
data += n;
size -= n;
total = lace_size[0] = num;
for (n = 1; res == 0 && n < laces - 1; n++) {
int64_t snum;
int r;
r = matroska_ebmlnum_sint (data, size, &snum);
if (r < 0) {
av_log(matroska->ctx, AV_LOG_INFO,
"EBML block data error\n");
break;
}
data += r;
size -= r;
lace_size[n] = lace_size[n - 1] + snum;
total += lace_size[n];
}
lace_size[n] = size - total;
break;
}
}
break;
}
if (res == 0) {
int real_v = matroska->tracks[track]->flags & MATROSKA_TRACK_REAL_V;
for (n = 0; n < laces; n++) {
uint64_t timecode = AV_NOPTS_VALUE;
int slice, slices = 1;
if (real_v) {
slices = *data++ + 1;
lace_size[n]--;
}
if (cluster_time != (uint64_t)-1 && n == 0) {
if (cluster_time + block_time >= 0)
timecode = cluster_time + block_time;
}
for (slice=0; slice<slices; slice++) {
int slice_size, slice_offset = 0;
if (real_v)
slice_offset = rv_offset(data, slice, slices);
if (slice+1 == slices)
slice_size = lace_size[n] - slice_offset;
else
slice_size = rv_offset(data, slice+1, slices) - slice_offset;
pkt = av_mallocz(sizeof(AVPacket));
if (ppkt) *ppkt = pkt;
if (av_new_packet(pkt, slice_size) < 0) {
res = AVERROR_NOMEM;
n = laces-1;
break;
}
memcpy (pkt->data, data+slice_offset, slice_size);
if (n == 0)
pkt->flags = is_keyframe;
pkt->stream_index = matroska->tracks[track]->stream_index;
pkt->pts = timecode;
pkt->pos = pos;
if (matroska->tracks[track]->flags & MATROSKA_TRACK_REORDER)
matroska_queue_packet_reordered(matroska, pkt, is_bframe);
else
matroska_queue_packet(matroska, pkt);
}
data += lace_size[n];
}
}
av_free(lace_size);
av_free(origdata);
return res;
}
| 1threat
|
Transparent Background in iOS App : I am first time posting question on Stackoverflow , I want to create app in which iPhone home screen use as a background.For more detail please find attached screenshot.[User Interface that i want][1]
Thanks in Advance
[1]: https://i.stack.imgur.com/q0OBw.png
| 0debug
|
C for linux not returing if value is negative : <p>have this small sample of code:</p>
<pre><code>size_t value;
value = (size_t) strtol(argv[1], NULL, 10);
if (value <= 0) {
fprintf(stderr, "Value cant be 0 or a negative value\n");
return 1;
}
</code></pre>
<p>When I run <code>./prog -1</code>, it doesn't fail with <code>Value cant be 0 or a negative value</code> which doesn't make sense to me. Am I missing something?</p>
<p>If I run <code>./prog 0</code>, it does fail, but not if the argument is with <code>-</code>.</p>
| 0debug
|
static void ppc_prep_init (ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model)
{
CPUState *env = NULL, *envs[MAX_CPUS];
char *filename;
nvram_t nvram;
m48t59_t *m48t59;
int PPC_io_memory;
int linux_boot, i, nb_nics1, bios_size;
ram_addr_t ram_offset, bios_offset;
uint32_t kernel_base, kernel_size, initrd_base, initrd_size;
PCIBus *pci_bus;
qemu_irq *i8259;
int ppc_boot_device;
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
DriveInfo *fd[MAX_FD];
sysctrl = qemu_mallocz(sizeof(sysctrl_t));
linux_boot = (kernel_filename != NULL);
if (cpu_model == NULL)
cpu_model = "602";
for (i = 0; i < smp_cpus; i++) {
env = cpu_init(cpu_model);
if (!env) {
fprintf(stderr, "Unable to find PowerPC CPU definition\n");
exit(1);
}
if (env->flags & POWERPC_FLAG_RTC_CLK) {
cpu_ppc_tb_init(env, 7812500UL);
} else {
cpu_ppc_tb_init(env, 100UL * 1000UL * 1000UL);
}
qemu_register_reset(&cpu_ppc_reset, env);
envs[i] = env;
}
ram_offset = qemu_ram_alloc(ram_size);
cpu_register_physical_memory(0, ram_size, ram_offset);
bios_offset = qemu_ram_alloc(BIOS_SIZE);
if (bios_name == NULL)
bios_name = BIOS_FILENAME;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
if (filename) {
bios_size = get_image_size(filename);
} else {
bios_size = -1;
}
if (bios_size > 0 && bios_size <= BIOS_SIZE) {
target_phys_addr_t bios_addr;
bios_size = (bios_size + 0xfff) & ~0xfff;
bios_addr = (uint32_t)(-bios_size);
cpu_register_physical_memory(bios_addr, bios_size,
bios_offset | IO_MEM_ROM);
bios_size = load_image_targphys(filename, bios_addr, bios_size);
}
if (bios_size < 0 || bios_size > BIOS_SIZE) {
hw_error("qemu: could not load PPC PREP bios '%s'\n", bios_name);
}
if (filename) {
qemu_free(filename);
}
if (env->nip < 0xFFF80000 && bios_size < 0x00100000) {
hw_error("PowerPC 601 / 620 / 970 need a 1MB BIOS\n");
}
if (linux_boot) {
kernel_base = KERNEL_LOAD_ADDR;
kernel_size = load_image_targphys(kernel_filename, kernel_base,
ram_size - kernel_base);
if (kernel_size < 0) {
hw_error("qemu: could not load kernel '%s'\n", kernel_filename);
exit(1);
}
if (initrd_filename) {
initrd_base = INITRD_LOAD_ADDR;
initrd_size = load_image_targphys(initrd_filename, initrd_base,
ram_size - initrd_base);
if (initrd_size < 0) {
hw_error("qemu: could not load initial ram disk '%s'\n",
initrd_filename);
}
} else {
initrd_base = 0;
initrd_size = 0;
}
ppc_boot_device = 'm';
} else {
kernel_base = 0;
kernel_size = 0;
initrd_base = 0;
initrd_size = 0;
ppc_boot_device = '\0';
for (i = 0; boot_device[i] != '\0'; i++) {
if (boot_device[i] >= 'a' && boot_device[i] <= 'f') {
ppc_boot_device = boot_device[i];
break;
}
}
if (ppc_boot_device == '\0') {
fprintf(stderr, "No valid boot device for Mac99 machine\n");
exit(1);
}
}
isa_mem_base = 0xc0000000;
if (PPC_INPUT(env) != PPC_FLAGS_INPUT_6xx) {
hw_error("Only 6xx bus is supported on PREP machine\n");
}
i8259 = i8259_init(first_cpu->irq_inputs[PPC6xx_INPUT_INT]);
pci_bus = pci_prep_init(i8259);
isa_bus_new(NULL);
isa_bus_irqs(i8259);
PPC_io_memory = cpu_register_io_memory(PPC_prep_io_read,
PPC_prep_io_write, sysctrl);
cpu_register_physical_memory(0x80000000, 0x00800000, PPC_io_memory);
pci_vga_init(pci_bus, 0, 0);
rtc_init(2000);
if (serial_hds[0])
serial_isa_init(0, serial_hds[0]);
nb_nics1 = nb_nics;
if (nb_nics1 > NE2000_NB_MAX)
nb_nics1 = NE2000_NB_MAX;
for(i = 0; i < nb_nics1; i++) {
if (nd_table[i].model == NULL) {
nd_table[i].model = "ne2k_isa";
}
if (strcmp(nd_table[i].model, "ne2k_isa") == 0) {
isa_ne2000_init(ne2000_io[i], ne2000_irq[i], &nd_table[i]);
} else {
pci_nic_init(&nd_table[i], "ne2k_pci", NULL);
}
}
if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) {
fprintf(stderr, "qemu: too many IDE bus\n");
exit(1);
}
for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) {
hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS);
}
for(i = 0; i < MAX_IDE_BUS; i++) {
isa_ide_init(ide_iobase[i], ide_iobase2[i], ide_irq[i],
hd[2 * i],
hd[2 * i + 1]);
}
isa_create_simple("i8042");
DMA_init(1);
for(i = 0; i < MAX_FD; i++) {
fd[i] = drive_get(IF_FLOPPY, 0, i);
}
fdctrl_init_isa(fd);
register_ioport_read(0x61, 1, 1, speaker_ioport_read, NULL);
register_ioport_write(0x61, 1, 1, speaker_ioport_write, NULL);
sysctrl->reset_irq = first_cpu->irq_inputs[PPC6xx_INPUT_HRESET];
register_ioport_read(0x398, 2, 1, &PREP_io_read, sysctrl);
register_ioport_write(0x398, 2, 1, &PREP_io_write, sysctrl);
register_ioport_read(0x0092, 0x01, 1, &PREP_io_800_readb, sysctrl);
register_ioport_write(0x0092, 0x01, 1, &PREP_io_800_writeb, sysctrl);
register_ioport_read(0x0800, 0x52, 1, &PREP_io_800_readb, sysctrl);
register_ioport_write(0x0800, 0x52, 1, &PREP_io_800_writeb, sysctrl);
PPC_io_memory = cpu_register_io_memory(PPC_intack_read,
PPC_intack_write, NULL);
cpu_register_physical_memory(0xBFFFFFF0, 0x4, PPC_io_memory);
#if 0
PPC_io_memory = cpu_register_io_memory(PPC_XCSR_read, PPC_XCSR_write,
NULL);
cpu_register_physical_memory(0xFEFF0000, 0x1000, PPC_io_memory);
#endif
if (usb_enabled) {
usb_ohci_init_pci(pci_bus, -1);
}
m48t59 = m48t59_init(i8259[8], 0, 0x0074, NVRAM_SIZE, 59);
if (m48t59 == NULL)
return;
sysctrl->nvram = m48t59;
nvram.opaque = m48t59;
nvram.read_fn = &m48t59_read;
nvram.write_fn = &m48t59_write;
PPC_NVRAM_set_params(&nvram, NVRAM_SIZE, "PREP", ram_size, ppc_boot_device,
kernel_base, kernel_size,
kernel_cmdline,
initrd_base, initrd_size,
0,
graphic_width, graphic_height, graphic_depth);
register_ioport_write(0x0F00, 4, 1, &PPC_debug_write, NULL);
}
| 1threat
|
Please help me on troubleshoot below code? : **Add sum of two integer values and sum of two double values and concatenate two char array values.**
1. Declare variables: one of type int, one of type double, and one of type String.
2. Read lines of input from stdin (according to the sequence given in the Input Format section below) and initialize your variables.
3. Use the operator to perform the following operations:
a.Print the sum of plus your int variable on a new line.
b.Print the sum of plus your double variable to a scale of one decimal place on a new line.
c.Concatenate with the string you read as input and print the result on a new line.
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
int i = 4;
double d = 4.0;
char s[] = "HackerRank ";
// Declare second integer, double, and String variables.
int j = 5;
double f = 5.0;
char a[] = "BestPlace" ;
// Read and save an integer, double, and String to your variables.
scanf("%d%d%1f%1f%c%c", &i, &j, &d, &f, &s, &a);
// Print the sum of the integer variables on a new line.
int sum;
sum = i+j
printf("sum of %d", sum);
// Print the sum of the double variables on a new line.
double s2 = d + f;
printf("sum of %1f", s2);
// Concatenate and print the String variables on a new line
strcat(s, a);
printf(s + strlen(s) , a + strlen(a) , "%c", "%c");
// The 's' variable above should be printed first.
printf("%c" , s);
| 0debug
|
Change element class on ViewChild in Angular 2 : <p>I am using ViewChild in Angular 2 to isolate an element. I can directly manipulate the styles but I cannot find documentation on if it is possible to change the elements style class.</p>
<p>This is sample code:</p>
<pre><code> export class HomeComponent implements OnInit {
@ViewChild('slideBg') el:ElementRef;
ngAfterViewInit {
// style can be changed
this.el.nativeElement.style.background = 'red';
// does not work:
this.el.nativeElement.class = 'myCSSclass';
}
…
}
</code></pre>
<p>Looking to see if this is possible and how. Any help appreciated.</p>
| 0debug
|
static int hap_encode(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
HapContext *ctx = avctx->priv_data;
int header_length = hap_header_length(ctx);
int final_data_size, ret;
int pktsize = FFMAX(ctx->tex_size, ctx->max_snappy * ctx->chunk_count) + header_length;
ret = ff_alloc_packet2(avctx, pkt, pktsize, header_length);
if (ret < 0)
return ret;
ret = compress_texture(avctx, ctx->tex_buf, ctx->tex_size, frame);
if (ret < 0)
return ret;
final_data_size = hap_compress_frame(avctx, pkt->data + header_length);
if (final_data_size < 0)
return final_data_size;
hap_write_frame_header(ctx, pkt->data, final_data_size + header_length);
av_shrink_packet(pkt, final_data_size + header_length);
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
return 0;
}
| 1threat
|
why is the output of this c program is like this? : This is the program:-
#include<stdio.h>
int main()
{
int a[8]={1,2,3,4,5,6,7,8,9},i;
char* p;
p=(char*)a;
printf("%d",*p);
for( i=0;i<32;i++)
{
p=p+1;
printf("%d",*p);
}
return 0;
}
Output:-
$ ./a.out
100020003000400050006000700080000
why is the output like this.
why there is three zero followed by value of the array.
| 0debug
|
static void put_no_rnd_pixels_x2_mmx( UINT8 *block, const UINT8 *pixels, int line_size, int h)
{
UINT8 *p;
const UINT8 *pix;
p = block;
pix = pixels;
MOVQ_ZERO(mm7);
do {
__asm __volatile(
"movq %1, %%mm0\n\t"
"movq 1%1, %%mm1\n\t"
"movq %%mm0, %%mm2\n\t"
"movq %%mm1, %%mm3\n\t"
"punpcklbw %%mm7, %%mm0\n\t"
"punpcklbw %%mm7, %%mm1\n\t"
"punpckhbw %%mm7, %%mm2\n\t"
"punpckhbw %%mm7, %%mm3\n\t"
"paddusw %%mm1, %%mm0\n\t"
"paddusw %%mm3, %%mm2\n\t"
"psrlw $1, %%mm0\n\t"
"psrlw $1, %%mm2\n\t"
"packuswb %%mm2, %%mm0\n\t"
"movq %%mm0, %0\n\t"
:"=m"(*p)
:"m"(*pix)
:"memory");
pix += line_size;
p += line_size;
} while (--h);
}
| 1threat
|
How to get JWT using POSTMAN? : <p>I would like the instructions of getting JWT from postman. What are the fields should i add under header and body? It will be nice if there is an example of end to end execution of JWT in postman. Thanks much!</p>
| 0debug
|
moving variable(columns) to column name (vertical to horizontal) in R : <p>I have a matrix like following table (the matrix is big consists of 16 years suppose for GPA of 100 students A,B,C,D...)</p>
<pre><code> `Year GPA Student
1 1996 3.2 A
2 1997 3.3 A
3 1998 3.5 A
4 1999 4 A
5 1996 3 B
6 1997 3 B
7 1998 4 B
8 1999 3.5 B
9 1996 4 C
10 1997 3 C
11 1998 2 C
12 1999 3 C
</code></pre>
<p>I want to use BICC function in R so I need to change my matrix to something like this :</p>
<pre><code> `A B C
`1996 3.2 3 4
1997 3.2 3 3
1998 3.3 4 2
1999 3.5 3.5 3
</code></pre>
<p>in this table "Year" variable goes as row (row name ?) and students names go to colname in R .
Thank you . </p>
| 0debug
|
What is wrong with this code because when i click Buy Now button a next page appears but it is not showing the contents which want it to show? : This is HTML Code
=================
```
<div class="card-body" style="height:260px;">
<p class="card-text"> Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible</p>
</div>
<div class="card-footer" style="height:56px;">
<center><a href="BuyCourse.html"><button type="submit" id="javabtn" onclick="BuyJava()" value="Java" class="btn btn-primary">Buy Now</Button></a></center>
</div>
```
This is second page code which opens after clicking Buy Now Button
==================================================================
```
<div class="container" id="containerJava">
<div>
<div>
<label style="font-size: 20; margin-top:50px; margin-left: 5px;">Course Name :-</label>
<p id="lblcourse"></p>
</div>
<div>
<label style="font-size: 20; margin-left: 5px;">Course Duration :-</label>
<p id="lblduration"></p>
</div>
<div>
<label style="font-size: 20; margin-left: 5px;">Course Price :-</label>
<p id="lblprice"></p>
</div>
```
And This is JavaScript code
========================
```
function BuyJava() {
document.getElementById("lblcourse").innerHTML = "Java";
document.getElementById("lblduration").innerHTML = "6 Months";
document.getElementById("lblprice").innerHTML = "6000/-";
}
```
| 0debug
|
Moving Files In Google Drive Using Google Script : <p>I'm trying to create documents using information posted through Google forms, then once the document is created I would like to move the document into a shared folder for people to view.</p>
<p>At the moment I have the script taking all of the information from the Google Forms linked spreadsheet. </p>
<p>Using that information I'm using the following code to create the document:</p>
<pre><code> var targetFolder = DriveApp.getFolderById(TARGET_FOLDER_ID);
var newDoc = DocumentApp.create(requestID + " - " + requestSummary);
</code></pre>
<p>This is creating the document successfully in my Google Drive root folder, but I can't seem to move it where I want to move it to. </p>
<p>I've seen a lot of posts suggesting use stuff like targetFolder.addFile(newDoc) but that doesn't work, similarly I've seen examples like newDoc.addToFolder(targetFolder) but again this isn't working for me.</p>
<p>It seems that all the online questions people have already asked about this are using the previous API versions that are no longer applicable and these methods do not apply to the new DriveApp functionality. </p>
<p>What I would like, if possible, is to create the new document as above so that I can edit the contents using the script, then be able to move that file to a shared folder. (From what I understand there is no 'move' function at present, so making a copy and deleting the old one will suffice).</p>
| 0debug
|
static void ogg_write_pages(AVFormatContext *s, int flush)
{
OGGContext *ogg = s->priv_data;
OGGPageList *next, *p;
if (!ogg->page_list)
return;
for (p = ogg->page_list; p; ) {
OGGStreamContext *oggstream =
s->streams[p->page.stream_index]->priv_data;
if (oggstream->page_count < 2 && !flush)
break;
ogg_write_page(s, &p->page,
flush && oggstream->page_count == 1 ? 4 : 0);
next = p->next;
av_freep(&p);
p = next;
}
ogg->page_list = p;
}
| 1threat
|
Making stackoverflow deliberately : <p>The following code make a stackoverflow error: </p>
<pre><code>int f(){
return f();
}
</code></pre>
<p>But are there any other ways to make a stackoverflow error?<br>
(Thanks in advance)</p>
| 0debug
|
How do I run PHPUnit in Laravel from my Windows Command prompt : <p>I have a Laravel app installed in my directory f:\lara_app. I use PHP artisan serve to run the app. I have Laravel version 5.4.36 (via Composer Install)</p>
<p>I am not trying my hand in using the PHP Unit to do testing. Inside f:/lara_app/tests/Unit/ExampleTest.php, I have the following codes:</p>
<pre><code>namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
public function myFirstTest()
{
$value = 'Hello World';
$this->assertTrue( 'Hello' === $value, 'Value should be Hello World');
}
}
</code></pre>
<p>I now try to run the test from my command prompt:</p>
<pre><code>f:\lara_app> .vendor/phpunit/phpuni/phpunit
</code></pre>
<p>But I'm getting the message below:</p>
<p>'.vendor' is not recognized as an internal or external command, operable program or batch file</p>
<p>How do I run the PHPUnit test?</p>
<p>Thanks in advance</p>
| 0debug
|
static void gen_write_xer(TCGv src)
{
tcg_gen_andi_tl(cpu_xer, src,
~((1u << XER_SO) | (1u << XER_OV) | (1u << XER_CA)));
tcg_gen_extract_tl(cpu_so, src, XER_SO, 1);
tcg_gen_extract_tl(cpu_ov, src, XER_OV, 1);
tcg_gen_extract_tl(cpu_ca, src, XER_CA, 1);
}
| 1threat
|
Splitting Strings in JS : <p>I know how to split strings in Python using square brackets ( <code>[3:]</code> ) / whatever number you want, but I cannot find how to do that in JS. Nothing seems to match what I am looking for. I am not very experienced in JS so I apologise if this has a very obvious answer.</p>
| 0debug
|
static void core_begin(MemoryListener *listener)
{
destroy_all_mappings();
phys_sections_clear();
phys_map.ptr = PHYS_MAP_NODE_NIL;
phys_section_unassigned = dummy_section(&io_mem_unassigned);
phys_section_notdirty = dummy_section(&io_mem_notdirty);
phys_section_rom = dummy_section(&io_mem_rom);
phys_section_watch = dummy_section(&io_mem_watch);
}
| 1threat
|
Databinding annotation processor kapt warning : <p>In my app module's build.gradle, I have added </p>
<pre><code>dependencies {
kapt('com.android.databinding:compiler:3.1.2')
...
}
</code></pre>
<p>but I'm still receiving the compiler warning for </p>
<pre><code>app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.2'.
</code></pre>
<p>Everything functions, I just hate having warnings hanging around.</p>
<p>Any help is much appreciated!</p>
| 0debug
|
Haskell Taylor exponential sequence : I tried to implement the Taylor function for the exponential sequence and I get a huge load of errors, which I don't fully understand, as all the code segments in themselves work... Could someone explain the error and a workaroudn please:
top x = map (x^) [0..]
bottom = foldr (*) 1 [1..]
whole x = zipWith (/) (top x) bottom
Thanks in advance!
| 0debug
|
What do the > < signs in numpy dtype mean? : <p>What is the difference between <code>dtype='f'</code>, <code>dtype='f4'</code>, <code>dtype='>f4'</code>, <code>dtype'<f4'</code>?
The syntax is not explained in <a href="https://docs.scipy.org/doc/numpy/user/basics.types.html" rel="noreferrer">docs on types</a> (except that 'f' is a shorthand for 'float32'); it is extensively used in the page on <a href="https://docs.scipy.org/doc/numpy/user/basics.rec.html" rel="noreferrer">records</a> but the meaning of <code>></code>/<code><</code> is also left unexplained in there.</p>
<p>After some experimentation I found out that</p>
<pre><code> In [13]: a = np.array([1.0], dtype='f')
In [15]: print(a.dtype)
float32
</code></pre>
<p>and</p>
<pre><code> In [16]: a = np.array([1.0], dtype='<f4')
In [17]: print(a.dtype)
float32
</code></pre>
<p>but</p>
<pre><code> In [18]: a = np.array([1.0], dtype='>f4')
In [19]: print(a.dtype)
>f4
</code></pre>
<p>It makes me believe those are not equivalent, which may be the explanation for issues I am facing with an external library.</p>
| 0debug
|
How to handle error states with LiveData? : <p>The new <a href="https://developer.android.com/topic/libraries/architecture/livedata.html" rel="noreferrer"><code>LiveData</code></a> can be used as a replacement for RxJava's observables in some scenarios. However, unlike <code>Observable</code>, <code>LiveData</code> has no callback for errors.</p>
<p>My question is: How should I handle errors in <code>LiveData</code>, e.g. when it's backed by some network resource that can fail to be retrieved due to an <code>IOException</code>?</p>
| 0debug
|
def find_platform(arr, dep, n):
arr.sort()
dep.sort()
plat_needed = 1
result = 1
i = 1
j = 0
while (i < n and j < n):
if (arr[i] <= dep[j]):
plat_needed+= 1
i+= 1
elif (arr[i] > dep[j]):
plat_needed-= 1
j+= 1
if (plat_needed > result):
result = plat_needed
return result
| 0debug
|
static void cirrus_linear_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
CirrusVGAState *s = opaque;
unsigned mode;
addr &= s->cirrus_addr_mask;
if (((s->vga.sr[0x17] & 0x44) == 0x44) &&
((addr & s->linear_mmio_mask) == s->linear_mmio_mask)) {
cirrus_mmio_blt_write(s, addr & 0xff, val);
} else if (s->cirrus_srcptr != s->cirrus_srcptr_end) {
*s->cirrus_srcptr++ = (uint8_t) val;
if (s->cirrus_srcptr >= s->cirrus_srcptr_end) {
cirrus_bitblt_cputovideo_next(s);
}
} else {
if ((s->vga.gr[0x0B] & 0x14) == 0x14) {
addr <<= 4;
} else if (s->vga.gr[0x0B] & 0x02) {
addr <<= 3;
}
addr &= s->cirrus_addr_mask;
mode = s->vga.gr[0x05] & 0x7;
if (mode < 4 || mode > 5 || ((s->vga.gr[0x0B] & 0x4) == 0)) {
*(s->vga.vram_ptr + addr) = (uint8_t) val;
memory_region_set_dirty(&s->vga.vram, addr, 1);
} else {
if ((s->vga.gr[0x0B] & 0x14) != 0x14) {
cirrus_mem_writeb_mode4and5_8bpp(s, mode, addr, val);
} else {
cirrus_mem_writeb_mode4and5_16bpp(s, mode, addr, val);
}
}
}
}
| 1threat
|
<?php ?> syntax error : <p>I hope you are doing great
I have been faced with a strange syntax error. when I write the syntax
it says: unexpected end of file or reached end while parsing. If you know for this error. that's a general question. not for the project</p>
<p>code smaple:</p>
<pre><code><?php
include 'Footer.php';
?>
</code></pre>
<p>I wonder if you could help me with that.
thanks in advance. cheers,</p>
| 0debug
|
target_ulong helper_rdhwr_performance(CPUMIPSState *env)
{
check_hwrena(env, 4);
return env->CP0_Performance0;
}
| 1threat
|
rotate gmaps web api v3 with 2 fingers : Thats the question, just I can't find in google documentation any info of how to rotate map `<div>` with 2 fingers when is loaded into a mobile or tactile device...
| 0debug
|
Variable/Path in VB script : VB script syntax pains me greatly compared to Powershell, but I have to use it for this.
How to insert my Script Path Variable into powershell script path path. Also anyone know any Visual Studio Like tool I can write those? I think visual studio uses different .net vbs.
Here is the Code
SCRIPT_PATH = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) - (Len(WScript.ScriptName)))
msgbox SCRIPT_PATH
Set objShell = CreateObject("WScript.Shell")
objShell.Run "RUNAS /user:Domain\User ""powershell SCRIPT_PATH & Delete_App_Script.ps1"""
Set objShell = Nothing
How do I do SCRIPT_PATH = SCRIPT_PATH + Delete_App_Script.ps1 ?
It gives no errors, so I am not sure what is the problem.
Am I missing some "" or some ,, ?
I seen some .Run ,,, syntax for Admin running and This one. Doesn't explain what goes into "".
Not looking forward creating interface for this.
Thank for your help
| 0debug
|
Execute oracle stored procedure dynamically based on input values : I am using Oracle 12c and have a stored procedure that accepts 6 input fields, queries database using the same and return result set. However, these 6 input fields are user input values from front-end so user may or may not enter all 6 input fields. I would need to execute stored procedure with whatever values it receives and ignore the rest.
Example: if i pass only 3 input values, it has to query database using only those 3 and ignore rest 3.
I couldnt do it as i am not able to use if/else condition(to pass non-null values only) to prepare the executable SQL inside the stored procedure. Is there a way to handle this? pls suggest.
| 0debug
|
how we add array values to another array in php :
**below is my $array1 and $array2.
And I want to add $array2 values in the first indexes of the $array1**
$array1 = Array
(
[0] => Array
(
[0] => 2
[1] => 6
[2] => 15
[3] => 6
)
[1] => Array
(
[0] => 5
[1] => 8
[2] => 6
[3] => 12
)
[2] => Array
(
[0] => 2
[1] => 5
[2] => 5
[3] => 5
)
)
**below is $array2.
i want to pick this array values and put this values to above $array1**
$array2 = Array
(
[0] => Outlook
[1] => Temp
[2] => Humidity
)
**Aspect-ed output is below where added value i show in single quotes**
$array1 = Array
(
[0] => Array
(
[0] => 'Outlook'
[1] => 2
[2] => 6
[3] => 15
[4] => 6
)
[1] => Array
(
[0] => 'Temp'
[1] => 5
[2] => 8
[3] => 6
[4] => 12
)
[2] => Array
(
[0] => 'Humidity'
[1] => 2
[2] => 5
[3] => 5
[4] => 5
)
)
| 0debug
|
void *etraxfs_dmac_init(CPUState *env,
target_phys_addr_t base, int nr_channels)
{
struct fs_dma_ctrl *ctrl = NULL;
int i;
ctrl = qemu_mallocz(sizeof *ctrl);
if (!ctrl)
return NULL;
ctrl->base = base;
ctrl->env = env;
ctrl->nr_channels = nr_channels;
ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels);
if (!ctrl->channels)
goto err;
for (i = 0; i < nr_channels; i++)
{
ctrl->channels[i].regmap = cpu_register_io_memory(0,
dma_read,
dma_write,
ctrl);
cpu_register_physical_memory (base + i * 0x2000,
sizeof ctrl->channels[i].regs,
ctrl->channels[i].regmap);
}
etraxfs_dmac = ctrl;
return ctrl;
err:
qemu_free(ctrl->channels);
qemu_free(ctrl);
return NULL;
}
| 1threat
|
static int mirror_cow_align(MirrorBlockJob *s, int64_t *offset,
uint64_t *bytes)
{
bool need_cow;
int ret = 0;
int64_t align_offset = *offset;
unsigned int align_bytes = *bytes;
int max_bytes = s->granularity * s->max_iov;
assert(*bytes < INT_MAX);
need_cow = !test_bit(*offset / s->granularity, s->cow_bitmap);
need_cow |= !test_bit((*offset + *bytes - 1) / s->granularity,
s->cow_bitmap);
if (need_cow) {
bdrv_round_to_clusters(blk_bs(s->target), *offset, *bytes,
&align_offset, &align_bytes);
}
if (align_bytes > max_bytes) {
align_bytes = max_bytes;
if (need_cow) {
align_bytes = QEMU_ALIGN_DOWN(align_bytes, s->target_cluster_size);
}
}
align_bytes = mirror_clip_bytes(s, align_offset, align_bytes);
ret = align_offset + align_bytes - (*offset + *bytes);
*offset = align_offset;
*bytes = align_bytes;
assert(ret >= 0);
return ret;
}
| 1threat
|
font size will change during focus using css : when i am focusing on link a elements then the only font size is not changing bt i want to change the font size whenever i focus on link a elements of html code...
//css code is there
a:focus
{
outline-color: ;
background-color: aqua;
font-size: 27px;
}
//and html code also below`
<ul>
<li><a href="">home</a></li>
<li><a href="">h</a></li>
<li><a href="">m</a></li>
</ul>
| 0debug
|
Unit testing a method that takes a ResultSet as parameter : <p>How does one go about unit testing an object that can't be instantiated? Because currently I have a method that converts a ResultSet to an object but I'm unsure if this violates any programming principles.</p>
<pre><code>public CItem convert(ResultSet rs) {
CItem ci = new CItem ();
try {
ci.setHinumber(rs.getString("id"));
ci.setHostname(rs.getString("sysname"));
ci.setOs(rs.getString("zos"));
ci.setTenant(rs.getString("customer_name"));
//ci.setInstallation(rs.getField("installation_name"));
} catch (SQLException e) {
e.printStackTrace();
}
return ci;
}
</code></pre>
<p>Do I need to look for a different way to approach this solely because it can't be unit tested? Or can I somehow fake a ResultSet object.</p>
<p>Any help would be appreciated.</p>
| 0debug
|
Gitlab-runner + Docker + Windows - Invalid volume specification : <p>I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues!</p>
<p>Unfortunately I have no choice but to use windows (I've had success in the past on Linux).</p>
<p>Every time I run a job in powershell:</p>
<p><code>C:/Gitlab-runner/gitlab-runner exec docker npm</code></p>
<p>I get an error:</p>
<p><code>Job failed (system failure): Error response from daemon: invalid volume specification: '/host_mnt/c/builds/project-0/Users/Lewsmith/api:C:/Users/Lewsmith/api:ro' (executor_docker.go:921:0s)</code></p>
<p>I've tried setting docker volumes (nemerous combinations) and builds-dir:</p>
<p><code>C:/Gitlab-runner/gitlab-runner exec docker --builds-dir /builds --docker-privileged --docker-volumes "/builds:C:/Gitlab-runner/builds" npm</code></p>
<p>That fails with <code>Error response from daemon: invalid mode: /Gitlab-runner/builds</code> because of the colon after the C..</p>
<p>Can anyone point me in the right direction as I'm stumped? </p>
<p>Using gitlab-runner version 11.5.0</p>
| 0debug
|
How to do yoyo animation in flutter? : <p>I know there is <code>repeat()</code> method on <code>AnimationController</code> but it always starts from the start.</p>
<p>Is there a built-in way to do one forward and one reverse animation, and to repeat that?</p>
<p>Thank you</p>
| 0debug
|
Use of unresolved identifier 'GGLContext' : <p>I am integrating Google Sign-In in my ios Swift app. I am following the official instructions on the google developer page here(<a href="https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift" rel="noreferrer">https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift</a> )</p>
<p>Here is my Bridging Header: </p>
<pre><code>#ifndef Header_h
#define Header_h
#endif /* Header_h */
#import <CommonCrypto/CommonCrypto.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <GoogleSignIn/GoogleSignIn.h>
</code></pre>
<p>When I call the line in my <code>AppDelegate.swift</code> function that has </p>
<pre><code> GGLContext.sharedInstance().configureWithError(&configureError)
</code></pre>
<p>in it. It says </p>
<pre><code> Use of unresolved identifier 'GGLContext'
</code></pre>
<p>Any help is appreciated. </p>
| 0debug
|
what is reason behind segmentation fault in this program :
*
**/*simple program to know behavior of pointers */
/* I tried this program to know what is behavior of pointer ,it gives segmentation fault but the reason for this ,I want know */
#include<stdio.h>
int main()
{**strong text**
int x =9;
/* what is meaning of this line when & operator is not used*/
int *pts = x;
printf("%d",*pts);
return 0;
}**
*
> why segmentation fault is occurs what is reason
>I tried to know behavior of the program
| 0debug
|
window.postMessage not working from iframe to parent document : <p>I'm trying to send a simple message from a child document (an iframe) back to its direct parent using the window.postMessage API.</p>
<p>Within the parent document I have the following:</p>
<pre><code>window.addEventListener("message", receiveMessage, true);
var receiveMessage = function(event) {
console.log("Recieved event " + JSON.stringify(event));
}
</code></pre>
<p>Then, in the iframe I have the following:</p>
<pre><code>window.parent.postMessage('message', '*');
</code></pre>
<p>Based on everything I've read, this should work and my log message should be written to the console. Except it's not working.</p>
<p>I'm aware that using the * as the targetOrigin is not always secure, but at this point I just want to sort out the linkage.</p>
<p>Any ideas or anything obvious that I'm missing?</p>
| 0debug
|
Do API calls create goroutines? : <p>I was testing things out and noticed that when I made Google API calls, my program would create 2 extra goroutines (went from 1 to 3 goroutines). I feel like this would lead to a problem where too many goroutines are created.</p>
| 0debug
|
Android calandar view not showing month and year starting from lollipop 5.0 : Android calandarview not showing month and year from lollipop
**I have used this code for below lollipop versions and it worked but from lollipop it is not working**
try
{
Class<?> cvClass = calender.getClass();
Field field = cvClass.getDeclaredField("mMonthName");
field.setAccessible(true);
try
{
TextView tv = (TextView) field.get(calender);
tv.setTextColor(Color.BLACK);
}
catch (IllegalArgumentException e)
{
e.printStackTrace();
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
}
catch (NoSuchFieldException e)
{
e.printStackTrace();
}
| 0debug
|
Transform union type to intersection type : <p>Is there a way to transform a union type into an intersection type :</p>
<pre><code>type FunctionUnion = () => void | (p: string) => void
type FunctionIntersection = () => void & (p: string) => void
</code></pre>
<p>I would like to apply a transformation to <code>FunctionUnion</code> to get <code>FunctionIntersection</code></p>
| 0debug
|
Github unable to access SSL connect error : <p>I have been using git lots for the last few months. git push worked 12 hours ago now all attempts generate errors, with verbose it produces this:</p>
<pre><code>GIT_CURL_VERBOSE=1 git push
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 192.30.253.112... * Connected to github.com (192.30.253.112) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* NSS error -12190
* Expire cleared
* Closing connection #0
fatal: unable to access 'https://github.com/waveney/wmff/': SSL connect error
</code></pre>
<p>Any bright ideas? No changes to server from when it worked to now, restart made no difference</p>
| 0debug
|
Пропадают разделители пути : Пытаюсь реализовать выбор локального файла и отправить его путь в js.
_mainWindow.Browser.ExecuteScriptAsync("document.getElementById('location').value=" + '\'' + openFileDialog.FileName + '\'');
такой вариант возвращает путь без разделителей - "ПутьДоФайла", хотя сам путь записывается в файл так, как нужно - "Путь\До\Файла". подскажите, пожалуйста, что я делаю не так?
| 0debug
|
static int coroutine_fn bdrv_co_do_write_zeroes(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, BdrvRequestFlags flags)
{
BlockDriver *drv = bs->drv;
QEMUIOVector qiov;
struct iovec iov = {0};
int ret = 0;
int max_write_zeroes = bs->bl.max_write_zeroes ?
bs->bl.max_write_zeroes : MAX_WRITE_ZEROES_DEFAULT;
while (nb_sectors > 0 && !ret) {
int num = nb_sectors;
if (bs->bl.write_zeroes_alignment
&& num > bs->bl.write_zeroes_alignment) {
if (sector_num % bs->bl.write_zeroes_alignment != 0) {
num = bs->bl.write_zeroes_alignment;
num -= sector_num % bs->bl.write_zeroes_alignment;
} else if ((sector_num + num) % bs->bl.write_zeroes_alignment != 0) {
num -= (sector_num + num) % bs->bl.write_zeroes_alignment;
}
}
if (num > max_write_zeroes) {
num = max_write_zeroes;
}
ret = -ENOTSUP;
if (drv->bdrv_co_write_zeroes) {
ret = drv->bdrv_co_write_zeroes(bs, sector_num, num, flags);
}
if (ret == -ENOTSUP) {
iov.iov_len = num * BDRV_SECTOR_SIZE;
if (iov.iov_base == NULL) {
iov.iov_base = qemu_blockalign(bs, num * BDRV_SECTOR_SIZE);
memset(iov.iov_base, 0, num * BDRV_SECTOR_SIZE);
}
qemu_iovec_init_external(&qiov, &iov, 1);
ret = drv->bdrv_co_writev(bs, sector_num, num, &qiov);
if (num < max_write_zeroes) {
qemu_vfree(iov.iov_base);
iov.iov_base = NULL;
}
}
sector_num += num;
nb_sectors -= num;
}
qemu_vfree(iov.iov_base);
return ret;
}
| 1threat
|
int32 float32_to_int32_round_to_zero( float32 a STATUS_PARAM )
{
flag aSign;
int16 aExp, shiftCount;
uint32_t aSig;
int32 z;
a = float32_squash_input_denormal(a STATUS_VAR);
aSig = extractFloat32Frac( a );
aExp = extractFloat32Exp( a );
aSign = extractFloat32Sign( a );
shiftCount = aExp - 0x9E;
if ( 0 <= shiftCount ) {
if ( float32_val(a) != 0xCF000000 ) {
float_raise( float_flag_invalid STATUS_VAR);
if ( ! aSign || ( ( aExp == 0xFF ) && aSig ) ) return 0x7FFFFFFF;
}
return (int32_t) 0x80000000;
}
else if ( aExp <= 0x7E ) {
if ( aExp | aSig ) STATUS(float_exception_flags) |= float_flag_inexact;
return 0;
}
aSig = ( aSig | 0x00800000 )<<8;
z = aSig>>( - shiftCount );
if ( (uint32_t) ( aSig<<( shiftCount & 31 ) ) ) {
STATUS(float_exception_flags) |= float_flag_inexact;
}
if ( aSign ) z = - z;
return z;
}
| 1threat
|
its about meta tag and description in php website : I have a single header called on different pages through PHP. But in order to be detected for SEO, I have to include separate meta tags and description for each page.
I am using PHP code for this
<?php $cur_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if($cur_url == "https://www.example.com/" || $cur_url == "https://example.com/"){
?>
<body id="main-homepage" class="homepage-travels">
<meta >
<?php
}
else if($cur_url == "https://example.com/one-travel-packages" || $cur_url == "https://example.com/one-travel"){
}
else{
?>
<body id="main-homepage">
<?php
}
?>
| 0debug
|
java scipt isnt workin : I'm trying to get this to work with my html. I'm doing external js and css into my html. I have all connected into my html file. for some reason the function isn't working correctly, here's my coding, note: alert for order submitted at the bottom works
| 0debug
|
Spring Cache with collection of items/entities : <p>I am using Spring Cache, where I pass in a collection of keys, and the return is a list of entities. I would like to have the caching framework understand that each element in the return list is to be cached with the corresponding code. At the moment, it seems that the key is the whole list, and if I am missing a key in the subsequent call, it'll try to reload the whole collection again. </p>
<pre><code>@Override
@Cacheable(value = "countries")
public List<Country> getAll(List<String>codes) {
return countryDao.findAllInCodes(codes);
}
</code></pre>
<p>another possibility is that the return is a map, similarly I would like the cache to be intelligent enough to only query for items that were never queried before, also to cache them each item with its key. </p>
<pre><code>@Override
@Cacheable(value = "countries")
public Map<String,Country> getAllByCode(List<String>codes) {
return countryDao.findAllInCodes(codes);
}
</code></pre>
<p>Suppose the country class looks like this: </p>
<pre><code>class Country{
String code;
String fullName;
long id;
... // getters setters constructurs etc..
}
</code></pre>
<p>Is this possible with Spring Cache?</p>
| 0debug
|
static void release_drive(Object *obj, const char *name, void *opaque)
{
DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
BlockBackend **ptr = qdev_get_prop_ptr(dev, prop);
if (*ptr) {
blk_detach_dev(*ptr, dev);
blockdev_auto_del(*ptr);
}
}
| 1threat
|
static void pm_reset(void *opaque)
{
ICH9LPCPMRegs *pm = opaque;
ich9_pm_iospace_update(pm, 0);
acpi_pm1_evt_reset(&pm->acpi_regs);
acpi_pm1_cnt_reset(&pm->acpi_regs);
acpi_pm_tmr_reset(&pm->acpi_regs);
acpi_gpe_reset(&pm->acpi_regs);
if (kvm_enabled()) {
pm->smi_en |= ICH9_PMIO_SMI_EN_APMC_EN;
}
pm->smi_en_wmask = ~0;
acpi_update_sci(&pm->acpi_regs, pm->irq);
}
| 1threat
|
Find all possible latitudes/longitudes in 500 meter circle radius : <p>I have a google map in my android application. and I have drawn a circle on specific latitude and longitude on the map, and the circle's radius is 500 meters. I want to find the maximum and minimum latitudes and longitudes in that circle, how to do this?</p>
<p>to explain my idea further, see the picture below:</p>
<p><a href="http://i.stack.imgur.com/uE6fR.jpg" rel="nofollow">The picture</a></p>
<p>I want to calculate all of the possible latitudes and longitudes on that red circle, can someone please tell me how to do it?</p>
| 0debug
|
Write a dictionary to a .py file : I have a dictionary in "albums_data.py" and "album.py" as main program.
I need to update the "add_one()" function in main program to write the actual state of dictionary in to "albums_data.py" and save it after some data is added to dictionary (using the "add_one()" function).
Here is the source code:
albums_data.py
albums= {}
albums["Adele"]="21"
albums["Michael Jackson"]="Thriler"
albums["Lady Gaga"]="The Fame"
album.py
import tkinter
from albums_data import *
root=tkinter.Tk()
root.title("DICT example")
#Functions
def show_all():
#clear the listbox
lb_music.delete(0,"end")
#iterate throught the keys and add to the listbox
for artist in albums:
lb_music.insert("end",artist)
def show_one():
artist=lb_music.get("active") #active is clicked field
album=albums[artist]
msg=artist+" - "+album
lbl_output["text"]=msg #Ready is replaced with msg
def add_one():
info=txt_input.get()
split_info=info.split(",") #list is created after is separated with ","
artist=split_info[0]
album=split_info[1]
albums[artist]=album
show_all()
txt_input.delete(0,"end")
#write to .py file (not worked to txt also) ->permission denied
f = open("albums_data.py","w")
f.write( str(albums) )
f.close()
#GUI
lbl_output=tkinter.Label(root,text="Ready")
lbl_output.pack()
txt_input=tkinter.Entry(root)
txt_input.pack()
lb_music=tkinter.Listbox(root)
lb_music.pack()
btn_show_all=tkinter.Button(root,text="Show all",command=show_all)
btn_show_all.pack()
btn_show_one=tkinter.Button(root,text="Show one",command=show_one)
btn_show_one.pack()
btn_add_one=tkinter.Button(root,text="Add one",command=add_one)
btn_add_one.pack()
root.mainloop()
| 0debug
|
GitLab CI - Cache not working : <p>I'm currently using GitLab in combination with CI runners to run unit tests of my project, to speed up the process of bootstrapping the tests I'm using the built-in cache functionality, however this doesn't seem to work.</p>
<p>Each time someone commits to master, my runner does a <code>git fetch</code> and proceeds to <strong>remove all cached files</strong>, which means I have to stare at my screen for around 10 minutes to wait for a test to complete while the runner re-downloads <strong>all</strong> dependencies (NPM and PIP being the biggest time killers).</p>
<p>Output of the CI runner:</p>
<pre><code>Fetching changes...
Removing bower_modules/jquery/ --+-- Shouldn't happen!
Removing bower_modules/tether/ |
Removing node_modules/ |
Removing vendor/ --'
HEAD is now at 7c513dd Update .gitlab-ci.yml
</code></pre>
<p>Currently my <em>.gitlab-ci.yml</em></p>
<pre><code>image: python:latest
services:
- redis:latest
- node:latest
cache:
key: "$CI_BUILD_REF_NAME"
untracked: true
paths:
- ~/.cache/pip/
- vendor/
- node_modules/
- bower_components/
before_script:
- python -V
# Still gets executed even though node is listed as a service??
- '(which nodejs && which npm) || (apt-get update -q && apt-get -o dir::cache::archives="vendor/apt/" install nodejs npm -yqq)'
- npm install -g bower gulp
# Following statements ignore cache!
- pip install -r requirements.txt
- npm install --only=dev
- bower install --allow-root
- gulp build
test:
variables:
DEBUG: "1"
script:
- python -m unittest myproject
</code></pre>
<p>I've tried reading the following articles for help however none of them seem to fix my problem:</p>
<ul>
<li><a href="http://docs.gitlab.com/ce/ci/yaml/README.html#cache" rel="noreferrer">http://docs.gitlab.com/ce/ci/yaml/README.html#cache</a></li>
<li><a href="https://fleschenberg.net/gitlab-pip-cache/" rel="noreferrer">https://fleschenberg.net/gitlab-pip-cache/</a></li>
<li><a href="https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/336" rel="noreferrer">https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/336</a></li>
</ul>
| 0debug
|
static int vtd_page_walk_level(dma_addr_t addr, uint64_t start,
uint64_t end, vtd_page_walk_hook hook_fn,
void *private, uint32_t level,
bool read, bool write, bool notify_unmap)
{
bool read_cur, write_cur, entry_valid;
uint32_t offset;
uint64_t slpte;
uint64_t subpage_size, subpage_mask;
IOMMUTLBEntry entry;
uint64_t iova = start;
uint64_t iova_next;
int ret = 0;
trace_vtd_page_walk_level(addr, level, start, end);
subpage_size = 1ULL << vtd_slpt_level_shift(level);
subpage_mask = vtd_slpt_level_page_mask(level);
while (iova < end) {
iova_next = (iova & subpage_mask) + subpage_size;
offset = vtd_iova_level_offset(iova, level);
slpte = vtd_get_slpte(addr, offset);
if (slpte == (uint64_t)-1) {
trace_vtd_page_walk_skip_read(iova, iova_next);
goto next;
}
if (vtd_slpte_nonzero_rsvd(slpte, level)) {
trace_vtd_page_walk_skip_reserve(iova, iova_next);
goto next;
}
read_cur = read && (slpte & VTD_SL_R);
write_cur = write && (slpte & VTD_SL_W);
entry_valid = read_cur | write_cur;
if (vtd_is_last_slpte(slpte, level)) {
entry.target_as = &address_space_memory;
entry.iova = iova & subpage_mask;
entry.translated_addr = vtd_get_slpte_addr(slpte);
entry.addr_mask = ~subpage_mask;
entry.perm = IOMMU_ACCESS_FLAG(read_cur, write_cur);
if (!entry_valid && !notify_unmap) {
trace_vtd_page_walk_skip_perm(iova, iova_next);
goto next;
}
trace_vtd_page_walk_one(level, entry.iova, entry.translated_addr,
entry.addr_mask, entry.perm);
if (hook_fn) {
ret = hook_fn(&entry, private);
if (ret < 0) {
return ret;
}
}
} else {
if (!entry_valid) {
trace_vtd_page_walk_skip_perm(iova, iova_next);
goto next;
}
ret = vtd_page_walk_level(vtd_get_slpte_addr(slpte), iova,
MIN(iova_next, end), hook_fn, private,
level - 1, read_cur, write_cur,
notify_unmap);
if (ret < 0) {
return ret;
}
}
next:
iova = iova_next;
}
return 0;
}
| 1threat
|
static bool pmsav7_use_background_region(ARMCPU *cpu,
ARMMMUIdx mmu_idx, bool is_user)
{
CPUARMState *env = &cpu->env;
if (is_user) {
return false;
}
if (arm_feature(env, ARM_FEATURE_M)) {
return env->v7m.mpu_ctrl & R_V7M_MPU_CTRL_PRIVDEFENA_MASK;
} else {
return regime_sctlr(env, mmu_idx) & SCTLR_BR;
}
}
| 1threat
|
Rails application using Postgres adapter can't activate pg : <p>In a Rails application, with a bare <code>pg</code> requirement in your Gemfile:</p>
<pre><code>gem 'pg'
</code></pre>
<p>You'll get the following error:</p>
<pre><code>Gem::LoadError can't activate pg (~> 0.18), already activated pg-1.0.0. Make sure all dependencies are added to Gemfile.
</code></pre>
| 0debug
|
Python List Adding With Sum : hi I have got a program and I am trying to add all the numbers in the list together using sum but I don't think the format can anyone help?
list1 = ['01', '05', '07', '08', '10']
str1 = ','.join(list1)
print(str1)
total =(sum(str1))
print (total)
| 0debug
|
numpy.savetxt resulting a formatting mismatch error in python 3.5 : <p>I'm trying to save a numpy matrix (Nx3, float64) into a txt file using numpy.savetxt:</p>
<pre><code>np.savetxt(f, mat, fmt='%.5f', delimiter=' ')
</code></pre>
<p>This line worked in python 2.7, but in python 3.5, I'm getting the following error:</p>
<blockquote>
<p>TypeError: Mismatch between array dtype ('float64') and format
specifier ('%.5f %.5f %.5f')</p>
</blockquote>
<p>When I'm stepping into the savetxt code, the print the error (traceback.format_exc()) in the catch block (numpy.lib.npyio, line 1158), the error is completely different:</p>
<blockquote>
<p>TypeError: write() argument must be str, not bytes</p>
</blockquote>
<p>The line of code resulting the exception is the following:</p>
<pre><code>fh.write(asbytes(format % tuple(row) + newline))
</code></pre>
<p>I tried to remove the asbytes, and it seems to fix this error. Is it a bug in numpy? </p>
| 0debug
|
Can I generate pdf reports using Fpdf, php and data from a csv file : <p>I have been trying to generate reports using Fpdf, php and mysql. There are many example on internet for that.
Now I want to generate pdf reports using Fpdf and php, but my data is in excel file, csv. Any clue how to generate report using csv file data, or if someone can guide me any tutorial for that, i will really appreciate it.
Thank you. </p>
| 0debug
|
Disable @Schedule on Spring Boot IntegrationTest : <p>How can I disable the schedule auto-start on Spring Boot IntegrationTest?</p>
<p>Thanks.</p>
| 0debug
|
void aio_set_fd_handler(AioContext *ctx,
int fd,
IOHandler *io_read,
IOHandler *io_write,
void *opaque)
{
AioHandler *node;
QLIST_FOREACH(node, &ctx->aio_handlers, node) {
if (node->pfd.fd == fd && !node->deleted) {
break;
}
}
if (!io_read && !io_write) {
if (node) {
if (ctx->walking_handlers) {
node->deleted = 1;
node->pfd.revents = 0;
} else {
QLIST_REMOVE(node, node);
g_free(node);
}
}
} else {
HANDLE event;
if (node == NULL) {
node = g_malloc0(sizeof(AioHandler));
node->pfd.fd = fd;
QLIST_INSERT_HEAD(&ctx->aio_handlers, node, node);
}
node->pfd.events = 0;
if (node->io_read) {
node->pfd.events |= G_IO_IN;
}
if (node->io_write) {
node->pfd.events |= G_IO_OUT;
}
node->e = &ctx->notifier;
node->opaque = opaque;
node->io_read = io_read;
node->io_write = io_write;
event = event_notifier_get_handle(&ctx->notifier);
WSAEventSelect(node->pfd.fd, event,
FD_READ | FD_ACCEPT | FD_CLOSE |
FD_CONNECT | FD_WRITE | FD_OOB);
}
aio_notify(ctx);
}
| 1threat
|
How to implement a simple notification system in Rails? : <p>I would like to implement a simple notification system in Rails(no gem). Let's say I have a blog app using Devise for auth, and on a post posted by user A(logined) there is a "Like" button, if another user, user B clicks on that button, I would like to notify user A with a simple notification like: "User B liked your post!".</p>
<p>I'm new to Rails.</p>
| 0debug
|
(Webpack) Using the url-loader or file-loader, do I really have to include a require() in my .js for every static image I want to include? : <p>I'm still learning webpack, and I was having trouble getting images to show up in my production build until I stumbled upon some code which had a <code>require('path/to/image.png')</code> at the top of a .js file. So I tried it, and lo and behold it works.</p>
<p>This seems wonky to me. Do I really have to include one of these for every static image I need to serve? Is there a better way to do this? This is going to be messy if not.</p>
| 0debug
|
static void ppc6xx_set_irq (void *opaque, int pin, int level)
{
CPUState *env = opaque;
int cur_level;
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: env %p pin %d level %d\n", __func__,
env, pin, level);
}
#endif
cur_level = (env->irq_input_state >> pin) & 1;
if ((cur_level == 1 && level == 0) || (cur_level == 0 && level != 0)) {
switch (pin) {
case PPC6xx_INPUT_TBEN:
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: %s the time base\n",
__func__, level ? "start" : "stop");
}
#endif
if (level) {
cpu_ppc_tb_start(env);
} else {
cpu_ppc_tb_stop(env);
}
case PPC6xx_INPUT_INT:
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: set the external IRQ state to %d\n",
__func__, level);
}
#endif
ppc_set_irq(env, PPC_INTERRUPT_EXT, level);
break;
case PPC6xx_INPUT_SMI:
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: set the SMI IRQ state to %d\n",
__func__, level);
}
#endif
ppc_set_irq(env, PPC_INTERRUPT_SMI, level);
break;
case PPC6xx_INPUT_MCP:
if (cur_level == 1 && level == 0) {
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: raise machine check state\n",
__func__);
}
#endif
ppc_set_irq(env, PPC_INTERRUPT_MCK, 1);
}
break;
case PPC6xx_INPUT_CKSTP_IN:
if (level) {
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: stop the CPU\n", __func__);
}
#endif
env->halted = 1;
}
break;
case PPC6xx_INPUT_HRESET:
if (level) {
#if 0
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: reset the CPU\n", __func__);
}
#endif
cpu_reset(env);
#endif
}
break;
case PPC6xx_INPUT_SRESET:
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: set the RESET IRQ state to %d\n",
__func__, level);
}
#endif
ppc_set_irq(env, PPC_INTERRUPT_RESET, level);
break;
default:
#if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: unknown IRQ pin %d\n", __func__, pin);
}
#endif
return;
}
if (level)
env->irq_input_state |= 1 << pin;
else
env->irq_input_state &= ~(1 << pin);
}
}
| 1threat
|
Docker build from Dockerfile with more memory : <p><strong>How to <code>docker build</code> from Dockerfile with more memory?</strong></p>
<p>This is a different question from this <a href="https://stackoverflow.com/questions/26913110/allow-more-memory-when-docker-build-a-dockerfile">Allow more memory when docker build a Dockerfile</a> </p>
<p>When installing the software natively, there is enough memory to successfully build and install the <a href="https://github.com/marian-nmt/marian" rel="noreferrer"><code>marian</code> tool</a></p>
<p>But when building the Docker image using the <code>Dockerfile</code>
<a href="https://github.com/marian-nmt/marian/blob/master/scripts/docker/Dockerfile.cpu" rel="noreferrer">https://github.com/marian-nmt/marian/blob/master/scripts/docker/Dockerfile.cpu</a> , it fails with multiple memory exhausted errors </p>
<pre><code>virtual memory exhausted: Cannot allocate memory
</code></pre>
<p>[out]:</p>
<pre><code>Step : RUN cmake $MARIANPATH && make -j
---> Running in 4867d166d17a
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Cannot find CUDA libraries. Compiling without them.
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- program_options
-- timer
-- iostreams
-- python
-- thread
-- chrono
-- regex
-- date_time
-- atomic
-- Found Python
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.7")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Found Git: /usr/bin/git (found version "2.7.4")
-- Git version: 5abc774
-- Found SparseHash: /usr/include
-- Configuring done
-- Generating done
-- Build files have been written to: /marian/build
Scanning dependencies of target fast_align
Scanning dependencies of target extract_lex
Scanning dependencies of target libcnpy
Scanning dependencies of target atools
Scanning dependencies of target libyaml-cpp-amun
[ 2%] Building CXX object src/amun/3rd_party/extract_lex/CMakeFiles/extract_lex.dir/exception.cpp.o
[ 2%] Building CXX object src/amun/3rd_party/extract_lex/CMakeFiles/extract_lex.dir/utils.cpp.o
[ 3%] Building CXX object src/amun/3rd_party/fast_align/CMakeFiles/fast_align.dir/src/ttables.cc.o
[ 6%] Building CXX object src/amun/3rd_party/fast_align/CMakeFiles/fast_align.dir/src/fast_align.cc.o
[ 7%] Building CXX object src/amun/3rd_party/extract_lex/CMakeFiles/extract_lex.dir/extract-lex-main.cpp.o
[ 10%] Building CXX object src/amun/3rd_party/CMakeFiles/libcnpy.dir/cnpy/cnpy.cpp.o
[ 10%] Building CXX object src/amun/3rd_party/fast_align/CMakeFiles/atools.dir/src/atools.cc.o
[ 10%] Building CXX object src/amun/3rd_party/fast_align/CMakeFiles/atools.dir/src/alignment_io.cc.o
[ 11%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/regex_yaml.cpp.o
[ 12%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/scanner.cpp.o
[ 14%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/convert.cpp.o
[ 15%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/stream.cpp.o
[ 16%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/memory.cpp.o
[ 17%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/node.cpp.o
[ 19%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/directives.cpp.o
[ 20%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/null.cpp.o
[ 21%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/emitfromevents.cpp.o
[ 23%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/singledocparser.cpp.o
[ 24%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/emitterstate.cpp.o
[ 25%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/scantag.cpp.o
[ 26%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/simplekey.cpp.o
[ 28%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/binary.cpp.o
[ 29%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/parser.cpp.o
[ 30%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/nodeevents.cpp.o
[ 32%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/emit.cpp.o
[ 33%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/exp.cpp.o
[ 35%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/nodebuilder.cpp.o
[ 38%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/scanscalar.cpp.o
[ 39%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/emitter.cpp.o
[ 41%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/tag.cpp.o
[ 42%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/scantoken.cpp.o
[ 43%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/ostream_wrapper.cpp.o
Scanning dependencies of target libcommon
[ 37%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/node_data.cpp.o
[ 44%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/contrib/graphbuilder.cpp.o
[ 46%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/emitterutils.cpp.o
[ 34%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/contrib/graphbuilderadapter.cpp.o
[ 47%] Building CXX object src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/parse.cpp.o
[ 48%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/scorer.cpp.o
[ 50%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/git_version.cpp.o
[ 51%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/base_matrix.cpp.o
[ 52%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/sentence.cpp.o
[ 53%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/config.cpp.o
[ 55%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/utils.cpp.o
[ 56%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/vocab.cpp.o
[ 65%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/filter.cpp.o
[ 66%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/god.cpp.o
[ 67%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/exception.cpp.o
[ 69%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/search.cpp.o
[ 69%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/hypothesis.cpp.o
[ 70%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/translation_task.cpp.o
[ 70%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/printer.cpp.o
[ 70%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/sentences.cpp.o
[ 70%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/history.cpp.o
[ 70%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/logging.cpp.o
[ 70%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/processor/bpe.cpp.o
[ 71%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/output_collector.cpp.o
[ 73%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/types.cpp.o
[ 74%] Building CXX object src/amun/CMakeFiles/libcommon.dir/common/loader.cpp.o
virtual memory exhausted: Cannot allocate memory
virtual memory exhausted: Cannot allocate memory
virtual memory exhausted: Cannot allocate memory
</code></pre>
<p>And eventually it leads to:</p>
<pre><code>src/amun/CMakeFiles/libcommon.dir/build.make:254: recipe for target 'src/amun/CMakeFiles/libcommon.dir/common/loader.cpp.o' failed
virtual memory exhausted: Cannot allocate memory
make[2]: *** [src/amun/CMakeFiles/cpumode.dir/cpu/decoder/encoder_decoder.cpp.o] Error 1
src/amun/CMakeFiles/cpumode.dir/build.make:110: recipe for target 'src/amun/CMakeFiles/cpumode.dir/cpu/decoder/encoder_decoder.cpp.o' failed
[ 79%] Built target libcnpy
virtual memory exhausted: Cannot allocate memory
src/amun/CMakeFiles/libcommon.dir/build.make:326: recipe for target 'src/amun/CMakeFiles/libcommon.dir/common/printer.cpp.o' failed
make[2]: *** [src/amun/CMakeFiles/libcommon.dir/common/printer.cpp.o] Error 1
CMakeFiles/Makefile2:340: recipe for target 'src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/all' failed
make[1]: *** [src/amun/3rd_party/yaml-cpp/CMakeFiles/libyaml-cpp-amun.dir/all] Error 2
CMakeFiles/Makefile2:182: recipe for target 'src/amun/CMakeFiles/libcommon.dir/all' failed
make[1]: *** [src/amun/CMakeFiles/libcommon.dir/all] Error 2
make[1]: *** [src/amun/CMakeFiles/cpumode.dir/all] Error 2
CMakeFiles/Makefile2:110: recipe for target 'src/amun/CMakeFiles/cpumode.dir/all' failed
make: *** [all] Error 2
</code></pre>
<p>Looking at the <code>docker build --help</code>, there are options to control memory usage:</p>
<pre><code>$ docker build --help
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
Options:
--build-arg list Set build-time variables (default [])
--cache-from stringSlice Images to consider as cache sources
--cgroup-parent string Optional parent cgroup for the container
--compress Compress the build context using gzip
--cpu-period int Limit the CPU CFS (Completely Fair Scheduler) period
--cpu-quota int Limit the CPU CFS (Completely Fair Scheduler) quota
-c, --cpu-shares int CPU shares (relative weight)
--cpuset-cpus string CPUs in which to allow execution (0-3, 0,1)
--cpuset-mems string MEMs in which to allow execution (0-3, 0,1)
--disable-content-trust Skip image verification (default true)
-f, --file string Name of the Dockerfile (Default is 'PATH/Dockerfile')
--force-rm Always remove intermediate containers
--help Print usage
--isolation string Container isolation technology
--label list Set metadata for an image (default [])
-m, --memory string Memory limit
--memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap
--network string Set the networking mode for the RUN instructions during build (default "default")
--no-cache Do not use cache when building the image
--pull Always attempt to pull a newer version of the image
-q, --quiet Suppress the build output and print image ID on success
--rm Remove intermediate containers after a successful build (default true)
--security-opt stringSlice Security options
--shm-size string Size of /dev/shm, default value is 64MB
-t, --tag list Name and optionally a tag in the 'name:tag' format (default [])
--ulimit ulimit Ulimit options (default [])
</code></pre>
<p>But I couldn't figure out the correct syntax of where exactly to put the <code>-m</code> option -_-|||</p>
<p>It isn't before the Dockerfile:</p>
<pre><code># Before Docker file.
$ docker build -m 4g Dockerfile.cpu -t ibot-cpu .
"docker build" requires exactly 1 argument(s).
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
</code></pre>
<p>It isn't after Dockerfile before -t</p>
<pre><code># Before -t
$ docker build Dockerfile.cpu -m 4g -t ibot-cpu .
"docker build" requires exactly 1 argument(s).
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
</code></pre>
<p>It isn't after -t before the local path </p>
<pre><code># Before local path
$ docker build Dockerfile.cpu -t ibot-cpu -m 4g .
"docker build" requires exactly 1 argument(s).
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
</code></pre>
<p>It isn't after the local path at the end too...</p>
<pre><code># At the end...
$ docker build Dockerfile.cpu -t ibot-cpu . -m 4g
"docker build" requires exactly 1 argument(s).
See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
</code></pre>
<p><strong>How to <code>docker build</code> from Dockerfile with more memory?</strong></p>
<p>My docker version:</p>
<pre><code>docker version
Client:
Version: 17.03.1-ce
API version: 1.27
Go version: go1.7.5
Git commit: c6d412e
Built: Tue Mar 28 00:40:02 2017
OS/Arch: darwin/amd64
Server:
Version: 17.04.0-ce
API version: 1.28 (minimum version 1.12)
Go version: go1.7.5
Git commit: 4845c56
Built: Wed Apr 5 18:45:47 2017
OS/Arch: linux/amd64
Experimental: false
</code></pre>
| 0debug
|
parsing value from JSON using python..Noob here ..Need assistance : This is my JSON.
{"recipes":{"58788":{"name”:”test1”,”status":"SUCCESSFUL","kitchen":"us-east","active":"YES","created_at":1514699619,"interval":5,"use_legacy_notifications":false},"40888":{"name":"Projects_1”,”status":"SUCCESSFUL","kitchen":"us-east","active":"YES","created_at":1493123978,"interval":10,"use_legacy_notifications":false},"40882":{"name":"Departments_2”,”status":"SUCCESSFUL","kitchen":"us-east","active":"YES","created_at":1493117601,"interval":10,"use_legacy_notifications":false},"59634":{"name”:”4synthetic","status":"SUCCESSFUL","kitchen":"us-east","active":"YES","created_at":1516071598,"interval":10,"use_legacy_notifications":false},"47635":{"name”:”Desitnation Search","status":"SUCCESSFUL","kitchen":"eu","active":"YES","created_at":1501672231,"interval":5,"use_legacy_notifications":false},"47437":{"name":"Gateway_5”,”status":"SUCCESSFUL","kitchen":"us-west","active":"YES","created_at":1501411588,"interval":10,"use_legacy_notifications":false},"65568":{"name":"Validation","status":"SUCCESSFUL","kitchen":"us-west","active":"YES","created_at":1522583593,"interval":5,"use_legacy_notifications":false}},"counts":{"total":7,"limited":7,"filtered":7}}
I need to extract only name and Status from the above ..any gurus here to help me ?
| 0debug
|
Java == != && || operator? : <p>I have a problem with my code. This code should check login and password. The problem is the else if statement showing a wrong output. Example, when i enter username == admin and password == 1234, it display username is incorrect.</p>
<pre><code>import java.io.*;
public class login
{
public static void main(String [] args) throws IOException
{
String username = "admin";
String password = "123";
BufferedReader inData = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter username : ");
username = inData.readLine();
System.out.print("Enter password : ");
password = inData.readLine();
if((username == "admin") && (password == "123"))
{
System.out.println("Welcome " + username + "\n*** Login Sucessfully ***" + "\n*** Access Granted ***");
}
else if((username != "admin") && (password == "123"))
{
System.out.println("Sorry, username is incorrect!\n*** Access Denied ***");
}
else if((username == "admin") && (password != "123"))
{
System.out.println("Sorry, password is incorrect!\n*** Access Denied ***");
}
else if((username != "admin") && (password != "123"))
{
System.out.println("Sorry, username and password is incorrect!\n*** Access Denied ***");
}
}
}
</code></pre>
| 0debug
|
int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
QemuOpts *opts;
int res;
opts = qemu_opts_from_qdict(&qemu_netdev_opts, qdict);
if (!opts) {
return -1;
res = net_client_init(mon, opts, 1);
return res;
| 1threat
|
Can somebody please tell we Why we use Matrix and canvas in android studio? : I am new to android, so can somebody please help me what this code is actually doing as I am unable to get its purpose, and I am unable to get why we are using matrix and CANVAS IN THIS
**My Java Code**
float ratioX = actualWidth / (float) options.outWidth;
float ratioY = actualHeight / (float) options.outHeight;
float middleX = actualWidth / 2.0f;
float mieX));
Log.d("middleY",String.valueOf(middleY));
Matrix scaleMatrix = new Matrix();
scaleMatrix.setScale(ratioX, ratioY, middleX, middleY);
Canvas canvas = new Canvas(scaledBitmap);
canvas.setMatrix(scaleMatrix);
canvas.drawBitmap(bmp, middleX - bmp.getWidth() / 2, middleY - bmp.getHeight() / 2, new Paint(Paint.FILTER_BITMAP_FLAG));
| 0debug
|
How to get all values of Specific index (for example: name) with out loop from json? : I want to fetch all the names and label from JSON without loop. is there a way to fetch with any filter method?
```
"sections": [
{
"id": "62ee1779",
"name": "Drinks",
"items": [
{
"id": "1902b625",
"name": "Cold Brew",
"optionSets": [
{
"id": "45f2a845-c83b-49c2-90ae-a227dfb7c513",
"label": "Choose a size",
},
{
"id": "af171c34-4ca8-4374-82bf-a418396e375c",
"label": "Additional Toppings",
},
],
},
]
}
```
| 0debug
|
How can I take care that the -> is after the text : <p>I have this page : <a href="https://ticketee-wissel.c9users.io/projects/new" rel="nofollow">https://ticketee-wissel.c9users.io/projects/new</a>
So you can see the arrow is now under the text. </p>
<p>How can I make it work that the arrow is after the text and still see the arrow move on hover ? </p>
| 0debug
|
onLocationChanged not being called android java : Three months ago my code works fine, but now it didn't work. Exactly onLocationChenged not being called and I don't know why. I haven't chnged anything for this 3 months. Also when I want to show marker on the map, it doesn't exist. I have every permission which I need. Below there is a code in java (android):
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map_demo_activity);
new DecimalFormat("#.#", new DecimalFormatSymbols(Locale.US));
OnClickListener();
mapFragment = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map));
if (mapFragment != null) {
mapFragment.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap map) {
loadMap(map);
}
});
} else {
Toast.makeText(this, "Error - Map Fragment was null!!", Toast.LENGTH_SHORT).show();
}
Marker("50.06465", "19.94498", "Example");
}
.
public void onLocationChanged(Location location) {
mLAT = Double.toString(location.getLatitude());
mLON = Double.toString(location.getLongitude());
new DoIt().execute();
}
public void Marker(String LAT, String LON, String tit) {
double dLAT = Double.parseDouble(LAT);
double dLON = Double.parseDouble(LON);
LatLng pos = new LatLng(dLAT, dLON);
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
return;
}
map.setMyLocationEnabled(true);
singleMarker = map.addMarker(new MarkerOptions()
.title(tit)
.position(pos)
.icon(BitmapDescriptorFactory.fromResource(R.mipmap.icon));
}
| 0debug
|
Running validations when using `update_all` : <p>According to the Rails docs <a href="http://guides.rubyonrails.org/active_record_validations.html#skipping-validations" rel="noreferrer">here</a> and <a href="http://apidock.com/rails/ActiveRecord/Relation/update_all" rel="noreferrer">here</a>, using <code>update_all</code> does not do the following -</p>
<ul>
<li>It skips validations</li>
<li>It does not update the <code>updated_at</code> field</li>
<li>It silently ignores the <code>:limit</code> and <code>:order</code> methods</li>
</ul>
<p>I'm trying to go through my code base and remove instances of <code>update_all</code>, particularly because of the first point.</p>
<p>Is there a way to still have the convenience of <code>update_all</code> and still run validations? I understand that I can loop through each record and save it, but that's not only messier visually but also more more inefficient because it executes N SQL statements instead of 1</p>
<pre><code># before
User.where(status: "active").update_all(status: "inactive")
# after
User.where(status: "active").each { |u| u.update(status: "inactive") }
</code></pre>
<p>Thanks!</p>
<p><strong>Edit:</strong> I'm using Rails 4.2</p>
| 0debug
|
static av_always_inline void RENAME(decode_line)(FFV1Context *s, int w,
TYPE *sample[2],
int plane_index, int bits)
{
PlaneContext *const p = &s->plane[plane_index];
RangeCoder *const c = &s->c;
int x;
int run_count = 0;
int run_mode = 0;
int run_index = s->run_index;
if (s->slice_coding_mode == 1) {
int i;
for (x = 0; x < w; x++) {
int v = 0;
for (i=0; i<bits; i++) {
uint8_t state = 128;
v += v + get_rac(c, &state);
}
sample[1][x] = v;
}
return;
}
for (x = 0; x < w; x++) {
int diff, context, sign;
context = RENAME(get_context)(p, sample[1] + x, sample[0] + x, sample[1] + x);
if (context < 0) {
context = -context;
sign = 1;
} else
sign = 0;
av_assert2(context < p->context_count);
if (s->ac != AC_GOLOMB_RICE) {
diff = get_symbol_inline(c, p->state[context], 1);
} else {
if (context == 0 && run_mode == 0)
run_mode = 1;
if (run_mode) {
if (run_count == 0 && run_mode == 1) {
if (get_bits1(&s->gb)) {
run_count = 1 << ff_log2_run[run_index];
if (x + run_count <= w)
run_index++;
} else {
if (ff_log2_run[run_index])
run_count = get_bits(&s->gb, ff_log2_run[run_index]);
else
run_count = 0;
if (run_index)
run_index--;
run_mode = 2;
}
}
run_count--;
if (run_count < 0) {
run_mode = 0;
run_count = 0;
diff = get_vlc_symbol(&s->gb, &p->vlc_state[context],
bits);
if (diff >= 0)
diff++;
} else
diff = 0;
} else
diff = get_vlc_symbol(&s->gb, &p->vlc_state[context], bits);
ff_dlog(s->avctx, "count:%d index:%d, mode:%d, x:%d pos:%d\n",
run_count, run_index, run_mode, x, get_bits_count(&s->gb));
}
if (sign)
diff = -diff;
sample[1][x] = av_mod_uintp2(RENAME(predict)(sample[1] + x, sample[0] + x) + (SUINT)diff, bits);
}
s->run_index = run_index;
}
| 1threat
|
static int cpu_common_load(QEMUFile *f, void *opaque, int version_id)
{
CPUState *env = opaque;
if (version_id != CPU_COMMON_SAVE_VERSION)
return -EINVAL;
qemu_get_be32s(f, &env->halted);
qemu_get_be32s(f, &env->interrupt_request);
env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
tlb_flush(env, 1);
return 0;
}
| 1threat
|
How to join 3 column in sql server management studio? : I need [help][1]help for the script in how to join 3 columns in one using SQL. i want to join column adress_1 , address_2, address_3 in result window.
[1]: https://i.stack.imgur.com/lBmsB.jpg
| 0debug
|
Taking sinus of each row for a specific column python : I have a dataset with continuous values. The values for last two column is for regression prediction and I want to calculate sinus of each row for these two columns and put this new dataset to another file. How can I create this new dataset?
Thanks.
| 0debug
|
LIMIT CELLS PER ROW IN JSP : <p>please i want to display some products from database in a jsp page , i used a table to display them , and it display all the products in a single row , i want to limit the number of cells ( td ) per row , for example 5 per row ..
here is the reuslt i get <a href="https://i.stack.imgur.com/mbwIw.png" rel="nofollow noreferrer">enter image description here</a></p>
<p>and here is the code i used
<a href="https://i.stack.imgur.com/a46mA.png" rel="nofollow noreferrer">enter image description here</a></p>
<p>THANK U </p>
| 0debug
|
how to select random dropdown in angularjs application in selenium using java : I'm learning automation using Selenium. I'm testing angularjs application. How do I write a java code to select random options from a dropdown
<select ng-model="attribute" ng-disabled="disabled" ng-required="draftstatus !== 'Incomplete' && isrequired" ng-show="isrequired" ng-change="change" class="ng-pristine ng-invalid ng-invalid-required ng-touched" required="required" xpath="1" style=""><option value="">Please Select</option><!-- ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Apple">Apple</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Mayo">Mayo</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Orange">Orange</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Colorado">Colorado</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Utah">Utah</option><!-- end ngRepeat: option in collection --><option ng-repeat="option in collection" ng-selected="option === attribute" class="ng-binding ng-scope" value="Mt.Titlis">Mt. Titlis</option><!-- end ngRepeat: option in collection --></select>
| 0debug
|
Unable to Compile MIT Appinventor App to APK : When I try to compile my App Inventor 2 app to APK, I get the following message:
[This is the error message:][1]
Also here is my code:
[This is my code:][2]
What should I do?
Please help as soon as possible.
Please do not steal my code. :)
[1]: https://i.stack.imgur.com/m2WSj.jpg
[2]: https://i.stack.imgur.com/DEemp.jpg
| 0debug
|
Want to Add Auto Links Variables : <pre><code>var links1 = link2 = link3 = link4 = link5 = ["a.html","b.html","c.html","d.html","e.html","f.html","g.html"]
function myLinkJS(){
document.write( '<a href=\"'+link1+'\" ></a>\n' );
document.write( '<a href=\"'+link2+'\" ></a>\n' );
document.write( '<a href=\"'+link3+'\" ></a>\n' );
document.write( '<a href=\"'+link4+'\" ></a>\n' );
}
</code></pre>
<p>The series of Link variables are more than 150 means <strong>var Links1 to Links150</strong> and the same I have to add in href as URL. if there is any solution to add these 150 links easily with any code.</p>
| 0debug
|
How to follow many users at ones on twitter : I want to follow many users at ones on twitter accounts with only one click due to reaching my limit? I tried this code but it doesn't follow any all:
> `$('.button-text.follow-text').trigger('click’);`
I have been doing this via the javascript console, but it doesn't work
Thanks
| 0debug
|
HTML/PHP FORM VALIDATION :
i am new to php and i learnt about it via tutorials . (thanks to youtube).
my only doubt is this ..
i have a textbox in form,which i want to validate as follows:
**TextField name= enrollment Id**
Enrollment id is 10 in length and is of pattern like TCA1409032 (starting three index are characters,Can be TCA,TEN and many more) and the rest 7 are digits.
**How do i perform this validation in my form?**
| 0debug
|
scope and use of super kewyword in java :
class Feline
{ public String type = "f ";
public Feline()
{ System.out.print("feline ");
}
}
public class Cougar extends Feline
{
public Cougar()
{ System.out.print("cougar ");
}
void go()
{ type = "c ";
System.out.print( this.type + super.type);
}
public static void main(String[] args)
{
new Cougar().go();
}
}
//here the output is feline cougar c c
why I cant accese the parent class variable from the super keyword .
| 0debug
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.