problem stringlengths 26 131k | labels class label 2 classes |
|---|---|
Retrieve hash fragment from url with Angular2 : <p>Given this url structure (over which I have no control), how can I retrieve the hash fragment using Angular2? </p>
<p><code>http://your-redirect-uri#access_token=ACCESS-TOKEN</code></p>
<p>My router does route to the correct component, but everything after <code>oauth</code> get scrapped and I can't find the hash fragment in request.params or location.path. Doomed??</p>
<p>Router config:</p>
<pre><code>@RouteConfig([
{path: '/welcome', name: 'Welcome', component: WelcomeComponent, useAsDefault: true},
{path: '/landing/oauth', name: 'Landing', component: LandingComponent} // this one
</code></pre>
<p>])</p>
| 0debug |
static void empty_slot_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
DPRINTF("write 0x%x to " TARGET_FMT_plx "\n", (unsigned)val, addr);
}
| 1threat |
static int asink_query_formats(AVFilterContext *ctx)
{
BufferSinkContext *buf = ctx->priv;
AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts = NULL;
unsigned i;
int ret;
CHECK_LIST_SIZE(sample_fmts)
CHECK_LIST_SIZE(sample_rates)
CHECK_LIST_SIZE(channel_layouts)
CHECK_LIST_SIZE(channel_counts)
if (buf->sample_fmts_size) {
for (i = 0; i < NB_ITEMS(buf->sample_fmts); i++)
if ((ret = ff_add_format(&formats, buf->sample_fmts[i])) < 0)
return ret;
ff_set_common_formats(ctx, formats);
}
if (buf->channel_layouts_size || buf->channel_counts_size ||
buf->all_channel_counts) {
for (i = 0; i < NB_ITEMS(buf->channel_layouts); i++)
if ((ret = ff_add_channel_layout(&layouts, buf->channel_layouts[i])) < 0)
return ret;
for (i = 0; i < NB_ITEMS(buf->channel_counts); i++)
if ((ret = ff_add_channel_layout(&layouts, FF_COUNT2LAYOUT(buf->channel_counts[i]))) < 0)
return ret;
if (buf->all_channel_counts) {
if (layouts)
av_log(ctx, AV_LOG_WARNING,
"Conflicting all_channel_counts and list in options\n");
else if (!(layouts = ff_all_channel_counts()))
return AVERROR(ENOMEM);
}
ff_set_common_channel_layouts(ctx, layouts);
}
if (buf->sample_rates_size) {
formats = NULL;
for (i = 0; i < NB_ITEMS(buf->sample_rates); i++)
if ((ret = ff_add_format(&formats, buf->sample_rates[i])) < 0)
return ret;
ff_set_common_samplerates(ctx, formats);
}
return 0;
}
| 1threat |
Difference between SimpleChange and SimpleChanges : <p>There are two terms in angular 5 <a href="https://angular.io/api/core/SimpleChange" rel="noreferrer">SimpleChange</a>
and <a href="https://angular.io/api/core/SimpleChanges" rel="noreferrer">SimpleChanges</a>, I didn't understand clearly from the official document could someone please explain me ??/</p>
| 0debug |
static void client_close(NBDClient *client)
{
if (client->closing) {
return;
}
client->closing = true;
qio_channel_shutdown(client->ioc, QIO_CHANNEL_SHUTDOWN_BOTH,
NULL);
if (client->close) {
client->close(client);
}
}
| 1threat |
How to update Google Play Developer API to version 3 on Xamarin Forms App? : <p><a href="https://i.stack.imgur.com/ejivj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ejivj.png" alt="enter image description here"></a></p>
<p>While uploading new APK to GooglePlay of a very simple APP which using only webview using Visual Studio 2019 Xamarin.Forms i am getting the following error on Google Play console:</p>
<blockquote>
<p>"We’ve detected that your app is using an old version of the Google
Play Developer API. From December 1 2019, versions 1 and 2 of this API
will no longer be available. Update to version 3 before this date.
Learn more"</p>
</blockquote>
<p><a href="https://i.stack.imgur.com/VnwZ2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VnwZ2.png" alt=""></a> </p>
<p><a href="https://i.stack.imgur.com/qKd9I.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qKd9I.png" alt="enter image description here"></a></p>
<p>Nuget Packages:</p>
<blockquote>
<p>Id Versions ProjectName<br>
-- -------- -----------<br>
Microsoft.AppCenter.Analytics {2.1.1} xamarin<br>
Xamarin.Essentials {1.1.0} xamarin<br>
Microsoft.AppCenter.Push {2.1.1} xamarin<br>
NETStandard.Library {2.0.3} xamarin<br>
Microsoft.AppCenter.Crashes {2.1.1} xamarin<br>
Xamarin.Forms {4.0.0.540366} xamarin<br>
Microsoft.AppCenter {2.1.1} xamarin<br>
Microsoft.AppCenter {2.1.1} fms_xamarin.Android<br>
Microsoft.AppCenter.Analytics {2.1.1} fms_xamarin.Android<br>
Microsoft.AppCenter.Crashes {2.1.1} fms_xamarin.Android<br>
Microsoft.AppCenter.Push {2.1.1} fms_xamarin.Android<br>
Xamarin.Forms {4.0.0.540366} fms_xamarin.Android<br>
Xamarin.Android.Support.Design {28.0.0.1} fms_xamarin.Android<br>
Xamarin.Android.Support.v7.AppCo... {28.0.0.1} fms_xamarin.Android<br>
Xamarin.Android.Support.v4 {28.0.0.1} fms_xamarin.Android<br>
Xamarin.Android.Support.v7.CardView {28.0.0.1} fms_xamarin.Android<br>
Xamarin.Android.Support.v7.Media... {28.0.0.1} fms_xamarin.Android<br>
Xamarin.Android.Support.Core.Utils {28.0.0.1} fms_xamarin.Android<br>
Xamarin.Android.Support.CustomTabs {28.0.0.1} fms_xamarin.Android<br>
Xamarin.Essentials {1.1.0} fms_xamarin.Android<br>
Xamarin.GooglePlayServices.Base {60.1142.1} fms_xamarin.Android<br>
Xamarin.GooglePlayServices.Basement {60.1142.1} fms_xamarin.Android </p>
</blockquote>
<p>How can i update the SDK as google asking for?</p>
| 0debug |
Unexpected token '}' in expression or statement PowerShell : <p>Hi I'm using a script for power shell this is part of it where the error is happening: it was working fine until i added the auto file naming by date so I guess the issue is here. any help is appreciated.</p>
<pre><code> foreach ($web in $site.AllWebs)
{
#Write the Header to "Tab Separated Text File"
"$($web.title) `t $($web.URL) `t `t `t `t " | out-file "c:\users_PermisionReport + (date -f yyyy-MM-dd) + "-DSR.csv" -append
#Get all Groups and Iterate through
foreach ($group in $Web.groups)
{
"`t `t $($Group.Name) `t `t `t " | out-file "c:\users_PermisionReport + (date -f yyyy-MM-dd) + "-DSR.csv" -append
#Iterate through Each User in the group
foreach ($user in $group.users)
{
#Exclude Built-in User Accounts
if(($User.LoginName.ToLower() -ne "nt authority\authenticated users") -and ($User.LoginName.ToLower() -ne "sharepoint\system") -and ($User.LoginName.ToLower() -ne "nt authority\local service"))
{
"`t `t `t $($user.LoginName) `t $($user.name) `t $($user.Email)" | out-file "c:\users_PermisionReport" + (date -f yyyy-MM-dd) + "-DSR.csv" -append
}
}
}
}//Error is here.
</code></pre>
<p>#error message:</p>
<pre><code> Unexpected token '}' in expression or statement.
CategoryInfo : ParserError: (:) [], ParseException
FullyQualifiedErrorId : UnexpectedToken
</code></pre>
| 0debug |
Convert HTML File to PDF Using Java : <p>I am looking for a way to convert an HTML file to PDF using a Java library that is preferably free. I have done some searching online to look for tools to use, but haven't found a solution that sticks out (I have seen some mention of iText, but it looked like that would have a charge to use it). Is there an existing library that I can utilize to accomplish the conversion of HTML to PDF?</p>
| 0debug |
VB.NET How to make visual basic hold a key? : Could you please tell me the code to make the shift key be held for a while and then released? I tried to use Sendkeys.Send ("+"), but it only pushes it once, and I'd like it to hold for about 3 seconds and then release. Thank you in advance for your help.[enter image description here][1]
[1]: https://i.stack.imgur.com/blRMx.png | 0debug |
Please explain this compare method : <pre><code>public int compareTo(Name other) {
int result = this.familyName.compareTo(other.familyName);
if (result == 0) {
result = this.firstName.compareTo(other.firstName);
}
return result;
}
</code></pre>
<p>I can't comprehend the meat of the code, how it is used to compare names.</p>
| 0debug |
void cpu_x86_dump_state(CPUX86State *env, FILE *f, int flags)
{
int eflags, i;
char cc_op_name[32];
static const char *seg_name[6] = { "ES", "CS", "SS", "DS", "FS", "GS" };
eflags = env->eflags;
fprintf(f, "EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n"
"ESI=%08x EDI=%08x EBP=%08x ESP=%08x\n"
"EIP=%08x EFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d\n",
env->regs[R_EAX], env->regs[R_EBX], env->regs[R_ECX], env->regs[R_EDX],
env->regs[R_ESI], env->regs[R_EDI], env->regs[R_EBP], env->regs[R_ESP],
env->eip, eflags,
eflags & DF_MASK ? 'D' : '-',
eflags & CC_O ? 'O' : '-',
eflags & CC_S ? 'S' : '-',
eflags & CC_Z ? 'Z' : '-',
eflags & CC_A ? 'A' : '-',
eflags & CC_P ? 'P' : '-',
eflags & CC_C ? 'C' : '-',
env->hflags & HF_CPL_MASK,
(env->hflags >> HF_INHIBIT_IRQ_SHIFT) & 1,
(env->a20_mask >> 20) & 1);
for(i = 0; i < 6; i++) {
SegmentCache *sc = &env->segs[i];
fprintf(f, "%s =%04x %08x %08x %08x\n",
seg_name[i],
sc->selector,
(int)sc->base,
sc->limit,
sc->flags);
}
fprintf(f, "LDT=%04x %08x %08x %08x\n",
env->ldt.selector,
(int)env->ldt.base,
env->ldt.limit,
env->ldt.flags);
fprintf(f, "TR =%04x %08x %08x %08x\n",
env->tr.selector,
(int)env->tr.base,
env->tr.limit,
env->tr.flags);
fprintf(f, "GDT= %08x %08x\n",
(int)env->gdt.base, env->gdt.limit);
fprintf(f, "IDT= %08x %08x\n",
(int)env->idt.base, env->idt.limit);
fprintf(f, "CR0=%08x CR2=%08x CR3=%08x CR4=%08x\n",
env->cr[0], env->cr[2], env->cr[3], env->cr[4]);
if (flags & X86_DUMP_CCOP) {
if ((unsigned)env->cc_op < CC_OP_NB)
strcpy(cc_op_name, cc_op_str[env->cc_op]);
else
snprintf(cc_op_name, sizeof(cc_op_name), "[%d]", env->cc_op);
fprintf(f, "CCS=%08x CCD=%08x CCO=%-8s\n",
env->cc_src, env->cc_dst, cc_op_name);
}
if (flags & X86_DUMP_FPU) {
fprintf(f, "ST0=%f ST1=%f ST2=%f ST3=%f\n",
(double)env->fpregs[0],
(double)env->fpregs[1],
(double)env->fpregs[2],
(double)env->fpregs[3]);
fprintf(f, "ST4=%f ST5=%f ST6=%f ST7=%f\n",
(double)env->fpregs[4],
(double)env->fpregs[5],
(double)env->fpregs[7],
(double)env->fpregs[8]);
}
}
| 1threat |
void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d)
{
qemu_irq *irq;
if (bus->dma == &bm->dma) {
return;
}
bm->dma.ops = &bmdma_ops;
bus->dma = &bm->dma;
bm->irq = bus->irq;
irq = qemu_allocate_irqs(bmdma_irq, bm, 1);
bus->irq = *irq;
bm->pci_dev = d;
}
| 1threat |
static int decode_pivot(MSS1Context *ctx, ArithCoder *acoder, int base)
{
int val, inv;
inv = arith_get_model_sym(acoder, &ctx->edge_mode);
val = arith_get_model_sym(acoder, &ctx->pivot) + 1;
if (val > 2) {
if ((base + 1) / 2 - 2 <= 0) {
ctx->corrupted = 1;
return 0;
}
val = arith_get_number(acoder, (base + 1) / 2 - 2) + 3;
}
if (val == base) {
ctx->corrupted = 1;
return 0;
}
return inv ? base - val : val;
}
| 1threat |
int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res)
{
if (bs->drv->bdrv_check == NULL) {
return -ENOTSUP;
}
memset(res, 0, sizeof(*res));
res->corruptions = bs->drv->bdrv_check(bs);
return res->corruptions < 0 ? res->corruptions : 0;
}
| 1threat |
Configure sublime text 3 folder node_modules for node.js : <p>I need node_modules in the sidebar but not when searching files, "go to files".</p>
<p>If I use</p>
<pre><code>{
"folder_exclude_patterns": [ "node_modules"]
}
</code></pre>
<p>It works ok except for the sidebar. </p>
| 0debug |
Difference between Kubernetes and Service Fabric : <p>I have worked on Kubernetes and currently reading about Service Fabric, I know Service Fabric provides microservices framework models like stateful, stateless and actor but other than that it also provides <code>GuestExecutables</code> or <code>Containers</code> as well which is what Kubernetes also does manage/orchestrate containers. Can anyone explain a detailed difference between the two? </p>
| 0debug |
Stop a blocking goroutine : <p>How can I kill a goroutine which is blocking. An idea is that returning from the host function would be a solution but I'm not sure if this kills the goroutine or not.</p>
<pre><code>func myFunc() int {
c := make(<-chan int)
go func(){
for i := range c {
// do stuff
}
}()
return 0 // does this kills the inner goroutine?
}
</code></pre>
<p>Is there a more nice solution? For example it would be nice that something like this work but because of the blocking for it doesn't:</p>
<pre><code>func myFunc() int {
c := make(<-chan int)
closeChan := make(chan int)
go func() {
select {
case close := <-closeChan:
return 0
default:
for i := range c {
// do stuff
}
}
}()
closeChan<-0
// other stuff
}
</code></pre>
| 0debug |
Fragment doesn't show up on activity : I can't get to work my fragment, it just won't show up when item on navigation bar is selected as it should do when selecting R.id.nav_gallery. I think there is a problem somewhere on onNavigationItemSelected(MenuItem item), but I couldn't localize it. Any thoughts?
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
(...)
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
}
public static class PlaceholderFragment extends Fragment{
private static final String ARG_SECTION_NUMBER = "section_number";
public PlaceholderFragment() {
}
public static PlaceholderFragment newInstance() {
PlaceholderFragment fragment = new PlaceholderFragment();
Bundle args = new Bundle();
args.putInt(ARG_SECTION_NUMBER, 0);
fragment.setArguments(args);
Log.d("frag", "6");
return fragment;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
return rootView;
}
}
@Override
public boolean onNavigationItemSelected(MenuItem item) {
int id = item.getItemId();
FragmentManager fragmentManager = getFragmentManager();
PlaceholderFragment fragment;
if (id == R.id.nav_camera) {
// Handle the camera action
} else if (id == R.id.nav_gallery) {
fragment = new PlaceholderFragment();
fragmentManager.beginTransaction()
.replace(R.id.container, fragment)
.commit();
PlaceholderFragment.newInstance();
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
}
| 0debug |
static int tta_decode_init(AVCodecContext * avctx)
{
TTAContext *s = avctx->priv_data;
int i;
s->avctx = avctx;
if (avctx->extradata_size < 30)
init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size);
if (show_bits_long(&s->gb, 32) == bswap_32(ff_get_fourcc("TTA1")))
{
skip_bits(&s->gb, 32);
s->flags = get_le16(&s->gb);
if (s->flags != 1 && s->flags != 3)
{
av_log(s->avctx, AV_LOG_ERROR, "Invalid flags\n");
s->is_float = (s->flags == FORMAT_FLOAT);
avctx->channels = s->channels = get_le16(&s->gb);
avctx->bits_per_sample = get_le16(&s->gb);
s->bps = (avctx->bits_per_sample + 7) / 8;
avctx->sample_rate = get_le32(&s->gb);
if(avctx->sample_rate > 1000000){
av_log(avctx, AV_LOG_ERROR, "sample_rate too large\n");
s->data_length = get_le32(&s->gb);
skip_bits(&s->gb, 32);
if (s->is_float)
{
avctx->sample_fmt = SAMPLE_FMT_FLT;
av_log(s->avctx, AV_LOG_ERROR, "Unsupported sample format. Please contact the developers.\n");
else switch(s->bps) {
case 2: avctx->sample_fmt = SAMPLE_FMT_S16; break;
case 4: avctx->sample_fmt = SAMPLE_FMT_S32; break;
default:
av_log(s->avctx, AV_LOG_ERROR, "Invalid/unsupported sample format. Please contact the developers.\n");
#define FRAME_TIME 1.04489795918367346939
s->frame_length = (int)(FRAME_TIME * avctx->sample_rate);
s->last_frame_length = s->data_length % s->frame_length;
s->total_frames = s->data_length / s->frame_length +
(s->last_frame_length ? 1 : 0);
av_log(s->avctx, AV_LOG_DEBUG, "flags: %x chans: %d bps: %d rate: %d block: %d\n",
s->flags, avctx->channels, avctx->bits_per_sample, avctx->sample_rate,
avctx->block_align);
av_log(s->avctx, AV_LOG_DEBUG, "data_length: %d frame_length: %d last: %d total: %d\n",
s->data_length, s->frame_length, s->last_frame_length, s->total_frames);
for (i = 0; i < s->total_frames; i++)
skip_bits(&s->gb, 32);
skip_bits(&s->gb, 32);
s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels);
} else {
av_log(avctx, AV_LOG_ERROR, "Wrong extradata present\n");
return 0; | 1threat |
css to properly align header image? : I need to align the lifestyle furniture ad image in the header for http://test.wizs.com/. I need it to be flush against the right side. See how it is vertically aligned to the top? I want it to be in line with the logo.
Everything that I have tried is not working. Some of the css that I have tried makes the image go halfway off the page... :/
currently, the css is:
#header .widget {
left: 50%;
padding-top: 0;
position: absolute;
top: 0;
z-index: 999;
}
Any advice on this would be greatly appreciated! :) | 0debug |
slideDown is not working : <p>why this is not working:</p>
<pre><code>window.setTimeout(function() {
if($(".alert").is(":hidden")) {
$(".alert").slideDown(500, function() {
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function() {
$(this).remove();
});
}, 4000);
});
}
}, 1000);
</code></pre>
<p>HTML:</p>
<pre><code><div id="login-error" class="container alert alert-danger" role="alert" hidden>
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong>Error!</strong> Invalid login or password!
</div>
</code></pre>
<p>It is not sliding down, and the element is deleted after 4 seconds.</p>
<p>How to fix, help, please. Thank You!</p>
| 0debug |
I am buildin an E-commerce websit using spring,hibernate and h2 in JavaEE. I'm getting this error ...Please help ..Thanks in advance : WARNING: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 43 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 56 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 58 more
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:343)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 68 more
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
... 71 more
Dec 12, 2019 10:27:35 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4685)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5146)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:344)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:475)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.Onlinemusicstore.dao.impl.ProductDaoImpl com.Onlinemusicstore.controller.HomeController.productDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 43 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'productDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 45 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory com.Onlinemusicstore.dao.impl.ProductDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 56 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 58 more
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:343)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 68 more
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
... 71 more
| 0debug |
Checking if permissions have been granted already by user in Android : <p>I have defined all the dangerous permissions in a String array as below:</p>
<pre><code>String[] perms = {Manifest.permission.READ_CONTACTS,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.CALL_PHONE,
Manifest.permission.MODIFY_PHONE_STATE};
</code></pre>
<p>Then to check if they have been granted I run this:</p>
<pre><code>for (int i = 0; i < perms.length; i++) {
if(ContextCompat.checkSelfPermission(this,perms[i])!=PackageManager.PERMISSION_GRANTED)
{
ActivityCompat.requestPermissions(this,perms, permsRequestCode);
break;
}
}
</code></pre>
<p>For some reason this does not work. It asks for permission once, and then if I manually disable it from settings, it brings up the dialog box more than once.</p>
<p>How do I fix this?</p>
| 0debug |
Factorial question without function stuck : <p>So I have a question that goes find the factorial of 25! and I am not allowed to use the math.facorial function.</p>
<p>So far I did</p>
<p>}} input()</p>
<p>}}}}25</p>
<p>and I was wondering is there anyway I can manipulate that to give me the factorial. Any help is appreciated.</p>
| 0debug |
Lambda Expression with foreach loop : var coupon=" ";
foreach(var p in products)
{
var query = products.Where(b => b.getId() == p.getId()).ToList();
if (query != null)
{
foreach(var q in query)
{
coupon = q.getName();
Console.WriteLine(coupon);
}
}
}
Can anyone tell me what will be the lambda expression of this code-chunk | 0debug |
static void vmgenid_set_guid_test(void)
{
QemuUUID expected, measured;
gchar *cmd;
g_assert(qemu_uuid_parse(VGID_GUID, &expected) == 0);
cmd = g_strdup_printf("-machine accel=tcg -device vmgenid,id=testvgid,"
"guid=%s", VGID_GUID);
qtest_start(cmd);
read_guid_from_memory(&measured);
g_assert(memcmp(measured.data, expected.data, sizeof(measured.data)) == 0);
qtest_quit(global_qtest);
g_free(cmd);
}
| 1threat |
How do I see the ENV vars in a Rails app? : <p>I am taking over an old Rails app. No one has touched it in a year. The last developer left in April of 2015 and I have no way to contact him. I do have ssh access to the server, and I have access to the Github repo. </p>
<p>I don't know any of the usernames/passwords. </p>
<p>If I ssh to the server and I cat the database.yml file, I see stuff like: </p>
<pre><code> staging:
adapter: mysql2
encoding: utf8
pool: 5
socket: /var/lib/mysql/mysql.sock
database: o_wawa_stage
username: wawa_stage
password: <%= ENV['STAGE_DATABASE_PASSWORD'] %>
host: access.dmedia.com
</code></pre>
<p>If I run the "printenv" command then I don't see any of these vars. I assume they are only loaded by the Rails environment. </p>
<p>I guess I can edit the templates to spit out the values with a bunch of "put" statements, but I'm thinking there must be a more obvious way to do this, other than printing the data where the public could see it? </p>
<p>If I try to run "rails console" I get: </p>
<pre><code> Rails Error: Unable to access log file. Please ensure that /var/www/haha/production/releases/20150118213616/log/development.log exists and is writable (ie, make it writable for user and group: chmod 0664 /var/www/haha/production/releases/20150118213616/log/development.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
</code></pre>
<p>I don't have sudo on this box, so I can not address the error. </p>
| 0debug |
What does it mean for a gradle property to be "experimental and unsupported"? : <p>Several times, to solve an issue or update dependencies, I had to enable a given <strong>gradle option setting</strong>.</p>
<ul>
<li><p>For example, <a href="http://robolectric.org/migrating/" rel="noreferrer">Robolectric 4.0 Migration guide</a> states:</p>
<blockquote>
<p>Put this in your gradle.properties:</p>
<p><code>android.enableUnitTestBinaryResources=true</code></p>
</blockquote></li>
<li><p>Likewise, to debug a databinding compile error I followed the advice printed in Gradle's build log:</p>
<blockquote>
<p>Gradle may disable incremental compilation [...].<br>
<strong>Consider setting the experimental feature flag <code>android.enableSeparateAnnotationProcessing=true</code></strong> in the gradle.properties file to run annotation processing in a separate task and make compilation incremental.</p>
</blockquote></li>
</ul>
<hr>
<p>From both examples, I get that the authors (Robolectric/gradle maintainers) are confident that enabling this option will have a positive impact on each situation.<br>
However, in both cases I get this warning in my build output:</p>
<blockquote>
<p>WARNING: The option setting 'android.enableUnitTestBinaryResources=true' is <strong>experimental and unsupported</strong>.
The current default is 'false'.</p>
<p>WARNING: The option setting 'android.enableSeparateAnnotationProcessing=true' is <strong>experimental and unsupported</strong>.
The current default is 'false'.</p>
</blockquote>
<p>I had in my <code>gradle.properties</code> since a few months the flag <code>android.databinding.enableV2=true</code>. To see how it's handled, I tried to put it to <code>false</code>, which brought the same <code>The option setting 'android.databinding.enableV2=false' is experimental and unsupported.</code> warning (which seems to suggest an <code>unsupported</code> setting is ignored).</p>
<ul>
<li><h3>I understand these are <em>experimental</em> feature flags. But what about <em>unsupported</em>? Does this mean I should <em>not expect support</em> if anything goes wrong, or does it mean they will be <em>ignored</em>?</h3></li>
<li><h3>If it means they are ignored, how are those properties meant to be used?</h3></li>
</ul>
| 0debug |
static void vhost_log_start(MemoryListener *listener,
MemoryRegionSection *section)
{
}
| 1threat |
Bootstrap 4 border utilities : <p>I feel like this should be obvious to find but I have not come up with anything. Bootstrap 4 has utility class for adding and removing a border, but is there support for defining the border width or style like solid or dashed?</p>
<pre><code><span class="border"></span>
<span class="border-top"></span>
<span class="border-right"></span>
<span class="border-bottom"></span>
<span class="border-left"></span>
</code></pre>
<p>There are some classes that changes the margins and padding such as <code>mr-3</code> and <code>pt-2</code>.</p>
<p>Maybe I just need to define them myself?</p>
| 0debug |
static inline void tcg_out_tlb_load(TCGContext *s, TCGReg addrlo, TCGReg addrhi,
int mem_index, TCGMemOp s_bits,
tcg_insn_unit **label_ptr, int which)
{
const TCGReg r0 = TCG_REG_L0;
const TCGReg r1 = TCG_REG_L1;
TCGType ttype = TCG_TYPE_I32;
TCGType htype = TCG_TYPE_I32;
int trexw = 0, hrexw = 0;
if (TCG_TARGET_REG_BITS == 64) {
if (TARGET_LONG_BITS == 64) {
ttype = TCG_TYPE_I64;
trexw = P_REXW;
}
if (TCG_TYPE_PTR == TCG_TYPE_I64) {
htype = TCG_TYPE_I64;
hrexw = P_REXW;
}
}
tcg_out_mov(s, htype, r0, addrlo);
tcg_out_mov(s, ttype, r1, addrlo);
tcg_out_shifti(s, SHIFT_SHR + hrexw, r0,
TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS);
tgen_arithi(s, ARITH_AND + trexw, r1,
TARGET_PAGE_MASK | ((1 << s_bits) - 1), 0);
tgen_arithi(s, ARITH_AND + hrexw, r0,
(CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS, 0);
tcg_out_modrm_sib_offset(s, OPC_LEA + hrexw, r0, TCG_AREG0, r0, 0,
offsetof(CPUArchState, tlb_table[mem_index][0])
+ which);
tcg_out_modrm_offset(s, OPC_CMP_GvEv + trexw, r1, r0, 0);
tcg_out_mov(s, ttype, r1, addrlo);
tcg_out_opc(s, OPC_JCC_long + JCC_JNE, 0, 0, 0);
label_ptr[0] = s->code_ptr;
s->code_ptr += 4;
if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
tcg_out_modrm_offset(s, OPC_CMP_GvEv, addrhi, r0, 4);
tcg_out_opc(s, OPC_JCC_long + JCC_JNE, 0, 0, 0);
label_ptr[1] = s->code_ptr;
s->code_ptr += 4;
}
tcg_out_modrm_offset(s, OPC_ADD_GvEv + hrexw, r1, r0,
offsetof(CPUTLBEntry, addend) - which);
}
| 1threat |
How to get random number generator to work properly : <p>My code deals with two dice (a 10 sided "fair" dice and a 20 sided "fair" dice) and using classes, arrays and a random number generator to generate random rolls of the two dice and their summation, but all my code spits out is "You rolled: 18". That is not very random. </p>
<pre><code>
#include <iostream>
#include <stdlib.h>
using namespace std;
class Dice
{
private:
int rollDice[2] = {};
public:
void setval1(int x)
{
rollDice[0] = x;
}
void setval2(int y)
{
rollDice[1] = y;
}
double getVal1()
{
return rollDice[0];
}
double getVal2()
{
return rollDice[1];
}
};
int main()
{
Dice a;
a.setval1(rand()%9+1);
a.setval2(rand()%19+1);
cout << "You rolled: " << a.getVal1() + a.getVal2();
}
</code></pre>
| 0debug |
Why i can't import Snackbar class : I can't import this: android.support.design.widget.Snackbar;
The result is: The import android.support.design canot ne resolved | 0debug |
Try to initialize a Dimensional Array Index : <p>Hello i tried to compile my Code but this error Code appears:
Bughunt04.Java:28: error: variable index might not have been initialized a[index] = index;</p>
<p>This is my Code </p>
<pre><code>if (args.length != 2){
System.out.println("ERROR");
return;
}
System.out.println("Eindimensionaler Fall");
int z = Integer.parseInt(args[0]);
int a[] = new int[z];
// Initialisieren des Arrays (die genauen Werte sind nicht wichtig)
int index;
for (z = 0; z < z; z++){
a[index] = index;
}
index = 1;
while (index < z/2){
// swap tauscht in a die Elemente an den beiden uebergebenen Stellen
a = swap(a, index, z-index);
index++;
}
</code></pre>
| 0debug |
What's wrong with my Java code about HashMap? : <p>This is the error notification:</p>
<blockquote>
<p>Library.java:13: error: cannot find symbol
for (String book : library.KeySet()) {
^ symbol: method KeySet() location: variable library of type HashMap 1 error</p>
</blockquote>
<p>And this is the code:</p>
<pre><code>import java.util.HashMap;
public class Library{
public Library(){
}
public void getFinishedBooks (HashMap<String, Boolean> library){
if(library.size() < 1){
System.out.println("Bye");
}
else {
for (String book : library.KeySet()) {
if (library.get(book) == true) {
System.out.println(book);
}
}
}
}
public static void main(String[] args) {
HashMap<String,Boolean> myBooks=new HashMap<String, Boolean>();
myBooks.put("Road Down The Funnel",true);
myBooks.put("Rat: A Biology",false);
myBooks.put("TimeIn",true);
myBooks.put("3D Food Printing",false);
Library myLibrary = new Library();
myLibrary.getFinishedBooks(myBooks);
}
}
</code></pre>
<p> I would like to know what's wrong with this piece of code? especially line 13? Thanks.</p>
| 0debug |
How remove spacebar in string in Oracle? : <pre><code>SELECT '17, 18' STRING_
FROM DUAL;
</code></pre>
<p>remove spacebar</p>
| 0debug |
static inline uint64_t do_fri(uint64_t arg, int rounding_mode)
{
CPU_DoubleU farg;
farg.ll = arg;
if (unlikely(float64_is_signaling_nan(farg.d))) {
farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN | POWERPC_EXCP_FP_VXCVI);
} else if (unlikely(float64_is_nan(farg.d) || float64_is_infinity(farg.d))) {
farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXCVI);
} else {
set_float_rounding_mode(rounding_mode, &env->fp_status);
farg.ll = float64_round_to_int(farg.d, &env->fp_status);
fpscr_set_rounding_mode();
}
return farg.ll;
}
| 1threat |
void kvm_s390_crw_mchk(void)
{
struct kvm_s390_irq irq = {
.type = KVM_S390_MCHK,
.u.mchk.cr14 = 1 << 28,
.u.mchk.mcic = build_channel_report_mcic(),
};
kvm_s390_floating_interrupt(&irq);
}
| 1threat |
how to create a landing page for the first time visitors only in PHP : <p>I'm creating a website which I realized is lacking a permanent option to choose the city, so I want index.php to check if a cookie is available and if it is show the normal index with the defined cookie variable, if not show the page where you choose the city and store it in the cookie, the question is, how to set that switch that shows one of two pages?</p>
| 0debug |
int ff_h263_resync(MpegEncContext *s){
int left, ret;
if(s->codec_id==CODEC_ID_MPEG4)
skip_bits1(&s->gb);
align_get_bits(&s->gb);
if(show_bits(&s->gb, 16)==0){
if(s->codec_id==CODEC_ID_MPEG4)
ret= mpeg4_decode_video_packet_header(s);
else
ret= h263_decode_gob_header(s);
if(ret>=0)
return 0;
}
s->gb= s->last_resync_gb;
align_get_bits(&s->gb);
left= s->gb.size*8 - get_bits_count(&s->gb);
for(;left>16+1+5+5; left-=8){
if(show_bits(&s->gb, 16)==0){
GetBitContext bak= s->gb;
if(s->codec_id==CODEC_ID_MPEG4)
ret= mpeg4_decode_video_packet_header(s);
else
ret= h263_decode_gob_header(s);
if(ret>=0)
return 0;
s->gb= bak;
}
skip_bits(&s->gb, 8);
}
return -1;
}
| 1threat |
javamail getcontent() dosn't work : this makes me crazy.
I can't see the contents of the message.
The application exploits in the getcontent() method.
Please, tell me what's wrong with my code ??
sorry my english. TIA
here is the code
@Override
protected Void doInBackground(Void... params) {
try {
//create properties field
Properties properties = new Properties();
properties.put("mail.pop3.host", "255.255.255.255");
properties.put("mail.pop3.port", "110");
properties.put("mail.pop3.starttls.enable", "false");
Session emailSession = Session.getDefaultInstance(properties);
//create the POP3 store object and connect with the pop server
Store store = emailSession.getStore("pop3");
store.connect("255.255.255.255", "popo@midominio.com", "ok");
//create the folder object and open it
Folder emailFolder = store.getFolder("INBOX");
emailFolder.open(Folder.READ_WRITE);
Message[] messages = emailFolder.getMessages();
for (int i = 0, n = messages.length; i < n; i++) {
Message message = messages[i];
//here is the killer line
Multipart mp = (Multipart) message.getContent();
}
emailFolder.close(false);
store.close();
} catch (NoSuchProviderException e) {
} catch (MessagingException e) {
} catch (Exception e) {
}
return null;
} | 0debug |
Data frame to wide with data compression : <p>A data set similar to this...</p>
<pre><code> ID <- c(rep(10,4),rep(20,4),rep(30,4),rep(40,4),rep(50,4))
Activity <- rep(c("In","Start","Finish","Out"),5)
Rsn <- c(rep("Rsn1",4),rep("Rsn11",4),rep("Rsn111",4),rep("Rsn11",4),rep("Rsn111",4))
Inst <- seq(1,20,1)
Loc <- c(rep("Here",4),rep("There",4),rep("Anywhere",4),rep("Somewhere",4),rep("SomewhereElse",4))
dc <- data.frame(ID,Activity,Rsn,Inst,Loc)
ID Activity Rsn Inst Loc
10 In Rsn1 1 Here
10 Start Rsn1 2 Here
10 Finish Rsn1 3 Here
10 Out Rsn1 4 Here
20 In Rsn11 5 There
20 Start Rsn11 6 There
20 Finish Rsn11 7 There
20 Out Rsn11 8 There
30 In Rsn111 9 Anywhere
30 Start Rsn111 10 Anywhere
30 Finish Rsn111 11 Anywhere
30 Out Rsn111 12 Anywhere
40 In Rsn11 13 Somewhere
40 Start Rsn11 14 Somewhere
40 Finish Rsn11 15 Somewhere
40 Out Rsn11 16 Somewhere
50 In Rsn111 17 SomewhereElse
50 Start Rsn111 18 SomewhereElse
50 Finish Rsn111 19 SomewhereElse
50 Out Rsn111 20 SomewhereElse
</code></pre>
<p>the end result that I would like to end up with is this...</p>
<pre><code>ID2 <- c(10,20,30,40,50)
In2 <- seq(1,20,4)
Start2 <- seq(2,20,4)
Finish2 <- seq(3,20,4)
Out2 <- seq(4,20,4)
Rsn2 <- c("Rsn1","Rsn11","Rsn111","Rsn11","Rsn111")
Loc2 <- c("Here","There","Anywhere","Somewhere","SomewhereElse")
dw <- data.frame(ID2, In2, Start2, Finish2, Out2, Rsn2,Loc2)
ID In2 Start2 Finish2 Out2 Rsn2 Loc2
10 1 2 3 4 Rsn1 Here
20 5 6 7 8 Rsn11 There
30 9 10 11 12 Rsn111 Anywhere
40 13 14 15 16 Rsn11 Somewhere
50 17 18 19 20 Rsn111 SomewhereElse
</code></pre>
<p>I have used tidyr, reshape and can't seem to get it right.</p>
<p>The data set has 816K lines and takes forever with loops and conditionals.</p>
<p>I have broken the dataset down by the locations, but it is still slow.</p>
<p>Thanks in advance.</p>
| 0debug |
LINQ - Sort items in one collection by a value in another collection : I have 2 IEnumerable collections of objects in memory.
Collection1 is a list containing:
Id, Name, Category etc.
Collection2 is a list containing
Id, SortOrder
Id in each collection will have corresponding values.
I need to sort Collection1 by the value of SortOrder from Collection2
Anyone know how to do this?
| 0debug |
Items keep leaving their desired place (Flex-box) : As the title says, the item keeps leaving their place what I've set them to.
The issue results in the website not being responsive, when the screen zooms to 125%
You may see this website for the result - http://joshuacote.xyz/
Do you think, you can help out what's been the issue?
I'm pretty sure its the usage of flex-box, but I've tried most things I could.
This is what issue is being caused -
https://i.gyazo.com/2db36c2f2c219968b48bc7ddb6c075b2.png | 0debug |
void stq_le_phys(target_phys_addr_t addr, uint64_t val)
{
val = cpu_to_le64(val);
cpu_physical_memory_write(addr, &val, 8);
}
| 1threat |
How to convert time to " time ago " in android : <p>My server. It return time : </p>
<pre><code>"2016-01-24T16:00:00.000Z"
</code></pre>
<p>I want </p>
<p>1 : convert to String.</p>
<p>2 : I want it show " time ago " when load it from server.</p>
<p>Please. Help me!</p>
| 0debug |
int ff_img_read_header(AVFormatContext *s1)
{
VideoDemuxData *s = s1->priv_data;
int first_index, last_index;
AVStream *st;
enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
s1->ctx_flags |= AVFMTCTX_NOHEADER;
st = avformat_new_stream(s1, NULL);
if (!st) {
return AVERROR(ENOMEM);
}
if (s->pixel_format &&
(pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n",
s->pixel_format);
return AVERROR(EINVAL);
}
av_strlcpy(s->path, s1->filename, sizeof(s->path));
s->img_number = 0;
s->img_count = 0;
if (s1->iformat->flags & AVFMT_NOFILE)
s->is_pipe = 0;
else {
s->is_pipe = 1;
st->need_parsing = AVSTREAM_PARSE_FULL;
}
if (s->ts_from_file == 2) {
#if !HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
av_log(s1, AV_LOG_ERROR, "POSIX.1-2008 not supported, nanosecond file timestamps unavailable\n");
return AVERROR(ENOSYS);
#endif
avpriv_set_pts_info(st, 64, 1, 1000000000);
} else if (s->ts_from_file)
avpriv_set_pts_info(st, 64, 1, 1);
else
avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
if (s->width && s->height) {
st->codec->width = s->width;
st->codec->height = s->height;
}
if (!s->is_pipe) {
if (s->pattern_type == PT_GLOB_SEQUENCE) {
s->use_glob = is_glob(s->path);
if (s->use_glob) {
#if HAVE_GLOB
char *p = s->path, *q, *dup;
int gerr;
#endif
av_log(s1, AV_LOG_WARNING, "Pattern type 'glob_sequence' is deprecated: "
"use pattern_type 'glob' instead\n");
#if HAVE_GLOB
dup = q = av_strdup(p);
while (*q) {
if ((p - s->path) >= (sizeof(s->path) - 2))
break;
if (*q == '%' && strspn(q + 1, "%*?[]{}"))
++q;
else if (strspn(q, "\\*?[]{}"))
*p++ = '\\';
*p++ = *q++;
}
*p = 0;
av_free(dup);
gerr = glob(s->path, GLOB_NOCHECK|GLOB_BRACE|GLOB_NOMAGIC, NULL, &s->globstate);
if (gerr != 0) {
return AVERROR(ENOENT);
}
first_index = 0;
last_index = s->globstate.gl_pathc - 1;
#endif
}
}
if ((s->pattern_type == PT_GLOB_SEQUENCE && !s->use_glob) || s->pattern_type == PT_SEQUENCE) {
if (find_image_range(&first_index, &last_index, s->path,
s->start_number, s->start_number_range) < 0) {
av_log(s1, AV_LOG_ERROR,
"Could find no file with path '%s' and index in the range %d-%d\n",
s->path, s->start_number, s->start_number + s->start_number_range - 1);
return AVERROR(ENOENT);
}
} else if (s->pattern_type == PT_GLOB) {
#if HAVE_GLOB
int gerr;
gerr = glob(s->path, GLOB_NOCHECK|GLOB_BRACE|GLOB_NOMAGIC, NULL, &s->globstate);
if (gerr != 0) {
return AVERROR(ENOENT);
}
first_index = 0;
last_index = s->globstate.gl_pathc - 1;
s->use_glob = 1;
#else
av_log(s1, AV_LOG_ERROR,
"Pattern type 'glob' was selected but globbing "
"is not supported by this libavformat build\n");
return AVERROR(ENOSYS);
#endif
} else if (s->pattern_type != PT_GLOB_SEQUENCE) {
av_log(s1, AV_LOG_ERROR,
"Unknown value '%d' for pattern_type option\n", s->pattern_type);
return AVERROR(EINVAL);
}
s->img_first = first_index;
s->img_last = last_index;
s->img_number = first_index;
if (!s->ts_from_file) {
st->start_time = 0;
st->duration = last_index - first_index + 1;
}
}
if (s1->video_codec_id) {
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = s1->video_codec_id;
} else if (s1->audio_codec_id) {
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = s1->audio_codec_id;
} else if (s1->iformat->raw_codec_id) {
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = s1->iformat->raw_codec_id;
} else {
const char *str = strrchr(s->path, '.');
s->split_planes = str && !av_strcasecmp(str + 1, "y");
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
if (s1->pb) {
int probe_buffer_size = 2048;
uint8_t *probe_buffer = av_realloc(NULL, probe_buffer_size + AVPROBE_PADDING_SIZE);
AVInputFormat *fmt = NULL;
AVProbeData pd = { 0 };
if (!probe_buffer)
return AVERROR(ENOMEM);
probe_buffer_size = avio_read(s1->pb, probe_buffer, probe_buffer_size);
if (probe_buffer_size < 0) {
av_free(probe_buffer);
return probe_buffer_size;
}
memset(probe_buffer + probe_buffer_size, 0, AVPROBE_PADDING_SIZE);
pd.buf = probe_buffer;
pd.buf_size = probe_buffer_size;
pd.filename = s1->filename;
while ((fmt = av_iformat_next(fmt))) {
if (fmt->read_header != ff_img_read_header ||
!fmt->read_probe ||
(fmt->flags & AVFMT_NOFILE) ||
!fmt->raw_codec_id)
continue;
if (fmt->read_probe(&pd) > 0) {
st->codec->codec_id = fmt->raw_codec_id;
break;
}
}
ffio_rewind_with_probe_data(s1->pb, &probe_buffer, probe_buffer_size);
}
if (st->codec->codec_id == AV_CODEC_ID_NONE)
st->codec->codec_id = ff_guess_image2_codec(s->path);
if (st->codec->codec_id == AV_CODEC_ID_LJPEG)
st->codec->codec_id = AV_CODEC_ID_MJPEG;
if (st->codec->codec_id == AV_CODEC_ID_ALIAS_PIX)
st->codec->codec_id = AV_CODEC_ID_NONE;
}
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
pix_fmt != AV_PIX_FMT_NONE)
st->codec->pix_fmt = pix_fmt;
return 0;
}
| 1threat |
query = 'SELECT * FROM customers WHERE email = ' + email_input | 1threat |
C# - Whats wrong with my SELECT Statement - SqlCommand nameCommand = new SqlCommand("SELECT * FROM GradesTable1 WHERE Id=" + idText + " AND : this SELECT Statement does't work for me -
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
SqlCommand nameCommand = new SqlCommand("SELECT * FROM GradesTable1 WHERE Id=" + idText + " AND Name='" + nameText + "/';", sqlConnection1);
<!-- end snippet -->
(after the "SqlCommand nameCommand = "), before it, it did send the parameters, maybe I changed something quickly by mistake and haven't noticed (i'm new about this) but, I can't see the difference.
I debuged it, but can't understand why it is null here -
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
SqlDataReader data3 = nameCommand.ExecuteReader();
if(data3.Read()) //as NULL! and jump to else.
{
}
<!-- end snippet -->
Can you notice my mistake? | 0debug |
Conditional Styling of an Angular component : <p>I am trying to style a component on basis of a condition in following way.</p>
<pre><code><div class="col-md-3 d-flex justify-content-center align-items-center" ng-style ="{ ' background-color' : (vars.state=='Signup')? '#73c7af' : '#ffffff' }">
</code></pre>
<p>and my vars.state=Signup. So it according to this background of this div should be #73c7af but it still white. Can anybody tell me where I am making mistake?</p>
| 0debug |
def maximum_value(test_list):
res = [(key, max(lst)) for key, lst in test_list]
return (res) | 0debug |
static void tcg_out_modrm_sib_offset(TCGContext *s, int opc, int r, int rm,
int index, int shift, intptr_t offset)
{
int mod, len;
if (index < 0 && rm < 0) {
if (TCG_TARGET_REG_BITS == 64) {
intptr_t pc = (intptr_t)s->code_ptr + 5 + ~rm;
intptr_t disp = offset - pc;
if (disp == (int32_t)disp) {
tcg_out_opc(s, opc, r, 0, 0);
tcg_out8(s, (LOWREGMASK(r) << 3) | 5);
tcg_out32(s, disp);
return;
}
if (offset == (int32_t)offset) {
tcg_out_opc(s, opc, r, 0, 0);
tcg_out8(s, (LOWREGMASK(r) << 3) | 4);
tcg_out8(s, (4 << 3) | 5);
tcg_out32(s, offset);
return;
}
tcg_abort();
} else {
tcg_out_opc(s, opc, r, 0, 0);
tcg_out8(s, (r << 3) | 5);
tcg_out32(s, offset);
return;
}
}
if (rm < 0) {
mod = 0, len = 4, rm = 5;
} else if (offset == 0 && LOWREGMASK(rm) != TCG_REG_EBP) {
mod = 0, len = 0;
} else if (offset == (int8_t)offset) {
mod = 0x40, len = 1;
} else {
mod = 0x80, len = 4;
}
if (index < 0 && LOWREGMASK(rm) != TCG_REG_ESP) {
tcg_out_opc(s, opc, r, rm, 0);
tcg_out8(s, mod | (LOWREGMASK(r) << 3) | LOWREGMASK(rm));
} else {
if (index < 0) {
index = 4;
} else {
assert(index != TCG_REG_ESP);
}
tcg_out_opc(s, opc, r, rm, index);
tcg_out8(s, mod | (LOWREGMASK(r) << 3) | 4);
tcg_out8(s, (shift << 6) | (LOWREGMASK(index) << 3) | LOWREGMASK(rm));
}
if (len == 1) {
tcg_out8(s, offset);
} else if (len == 4) {
tcg_out32(s, offset);
}
}
| 1threat |
static int cirrus_bitblt_videotovideo_copy(CirrusVGAState * s)
{
if (blit_is_unsafe(s))
return 0;
return cirrus_do_copy(s, s->cirrus_blt_dstaddr - s->vga.start_addr,
s->cirrus_blt_srcaddr - s->vga.start_addr,
s->cirrus_blt_width, s->cirrus_blt_height);
}
| 1threat |
Invalid CSRF token. Send the form again. Adminer : <p>I am getting this error on export of my database in adminer.
Error: <strong>Invalid CSRF token. Send the form again. If you did not send this request from Adminer then close this page.</strong> Need Help </p>
| 0debug |
static int channelmap_config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
ChannelMapContext *s = ctx->priv;
int i, err = 0;
const char *channel_name;
char layout_name[256];
if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {
for (i = 0; i < s->nch; i++) {
s->map[i].in_channel_idx = av_get_channel_layout_channel_index(
inlink->channel_layout, s->map[i].in_channel);
if (s->map[i].in_channel_idx < 0) {
channel_name = av_get_channel_name(s->map[i].in_channel);
av_get_channel_layout_string(layout_name, sizeof(layout_name),
0, inlink->channel_layout);
av_log(ctx, AV_LOG_ERROR,
"input channel '%s' not available from input layout '%s'\n",
channel_name, layout_name);
err = AVERROR(EINVAL);
}
}
}
return err;
}
| 1threat |
data paramter showing nil and its crashing : - (IBAction)loginAction:(id)sender {
// [self.eMail resignFirstResponder];
// [self.password resignFirstResponder];
NSString *post =[NSString stringWithFormat:@"Email=%@&Password=%@",self.eMail.text,self.password.text];
NSString * loginURL = @"http://75.101.159.160:8222/api/mobileappapi/user/login"; // Login URL
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSHTTPURLResponse * response;
NSError * error;
NSMutableURLRequest * request;
request = [[NSMutableURLRequest alloc]initWithURL:nil cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:60.0];
[request setHTTPMethod:@"POST"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[request setHTTPBody:postData];
request.URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@",loginURL]];
error = nil;
response = nil;
NSData* jsonUpdateDate = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
// jsonUpdateDate = [NSURLConnection sendSynchronousRequest:request returningResponse:response error:&error];
NSDictionary* resultsDictionary = [NSJSONSerialization JSONObjectWithData:jsonUpdateDate options:0 error:&error];
NSLog(@"%@",resultsDictionary);
NSString *userRole = [resultsDictionary objectForKey:@"UserRole"];
if (userRole != (NSString*)[NSNull null]) {
if ([userRole isEqualToString:@"Passenger"]) {
// SuccessuserRole
HomeScreen *obj=[self.storyboard instantiateViewControllerWithIdentifier:@"HomeScreen"];
[self presentViewController:obj animated:NO completion:nil];
}
else if ([userRole isEqualToString:@"Driver"]){
SelectVehicle *obj=[self.storyboard instantiateViewControllerWithIdentifier:@"SelectVehicle"];
[self presentViewController:obj animated:NO completion:nil];
}
}
}**strong text** | 0debug |
casting an object to an interface benifits : If i have an object with like 50 methods .
And on another class , i needed to store this object and use 2 of these 50 methods .
Does creating an interface with 2 methods and casting the original methods to it saves space ?
I mean in this case , will the interface reference contains 50 methods , or will it delete all the methods that are not in the interface and use the needed ones ?
The same with abstract classes .
I am a little confused about the refrences , if i used a reference of a small interface with 2 methods to store a class with 50 methods , does that have any benifits .
Here is why i am asking , i see this example in android studio many times :
@Override
public void onAttach(Context context) {
super.onAttach(context);
try {
CreatedInterface object = (CreatedInterface) context;
}
catch (ClassCastException e){
Log.i(TAG , "on attach failed ");
}
}
They always don't store the entire context refrence , they create an interface with a subset of it . | 0debug |
VBA to create Table with working days and the date for every month depending on the year : I would like to make a VBA to do to do the following:
*fill two columns in a table : first column for Days and second column for
Dates and it has only to be with working days(Mon-Fri) for the whole Month
*This is depending on two inputs in two cells (Year, Month)
*When and cell contains Fri as a day and starts again from Mon then the Frame between the two cells has to be Bold.
Would you please help me write the code? | 0debug |
static int iscsi_refresh_limits(BlockDriverState *bs)
{
IscsiLun *iscsilun = bs->opaque;
if (iscsilun->lbp.lbpu || iscsilun->lbp.lbpws) {
if (iscsilun->bl.max_unmap < 0xffffffff) {
bs->bl.max_discard = sector_lun2qemu(iscsilun->bl.max_unmap,
iscsilun);
}
bs->bl.discard_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
iscsilun);
if (iscsilun->bl.max_ws_len < 0xffffffff) {
bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len,
iscsilun);
}
bs->bl.write_zeroes_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
iscsilun);
bs->bl.opt_transfer_length = sector_lun2qemu(iscsilun->bl.opt_xfer_len,
iscsilun);
}
return 0;
}
| 1threat |
Is it possible to specify a static function in a Kotlin interface? : <p>I want to do something like this:</p>
<pre><code>interface Serializable<FromType, ToType> {
fun serialize(): ToType
companion object {
abstract fun deserialize(serialized: ToType): FromType
}
}
</code></pre>
<p>or even this would work for me:</p>
<pre><code>interface Serializable<ToType> {
fun serialize(): ToType
constructor(serialized: ToType)
}
</code></pre>
<p>but neither compiles. <strong>Is there a syntax for this, or will I be forced to use make this an interface for a factory?</strong> <sub>Or is there another answer? 😮 That'd be neat!</sub></p>
| 0debug |
PHP Json to variables : Hi Sorry to ask the question that so many people have before me but i obviously dont understand, so im sending my json via c# and my php on my mysql server is catching it but where i usually catch with post I now see i should catch it using json_decode but even through i can see the data and print it out i can not seem to get it in to a usable format to insert into my database, hopefully you can help so:
Array print out using print_r ($data); looks like this
/Array
(
[widget1] => 54
[widget2] => tttt
[widget3] => tttttttt
[widget4] => 100
[widget5] => 3
[imageobject] => /9j/4QPqRXhpZgAATU0AKgAAAAgADAEbAAUAAAABAAAAngEaAAUAAAABAAAApgEAAAQAAAABAAAFUwEQAAIAAAAJAAAArgExAAIAAAAOAAAAtwEPAAIAAAAIAAAAxQEBAAQAAAABAAAD8wITAAMAAAABAAEAAIdpAAQAAAABAAAA4QESAAMAAAABAAAAAAEoAAMAAAABAAIAAAEyAAIAAAAUAAAAzQAAA3gAAABIAAAAAQAAAEgAAAABU00tRzk1NUYARzk1NUZYWFUyQ1JGNwBzYW1zdW5nADIwMTg6MDc6MTkgMTY6NDc6MjEAACCSAgAFAAAAAQAAAmeQAAAHAAAABDAyMjCSBAAKAAAAAQAAAm+IIgADAAAAAQACAACkIAACAAAAGQAAAnegAQADAAAAAQABAACSBQAFAAAAAQAAApCgAwADAAAAAQH5AACSAwAKAAAAAQAAApiQAwACAAAAFAAAAqCgAAAHAAAABDAxMDCSfAAHAAAAYgAAArSSkQACAAAABQAAAxakAwADAAAAAQAAAACgBQAEAAAAAQAAA2akAgADAAAAAQAAAACCmgAFAAAAAQAAAxuSCQADAAAAAQAAAACSkAACAAAABQAAAyOCnQAFAAAAAQAAAyiIJwADAAAA)
and im trying to access the data into variables like below which is obviously wrong
<?php
header('Content-Type: application/json;charset=utf-8');
require "connect.php";
//Make sure that it is a POST request.
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
throw new Exception('Request method must be POST!');
}
//Make sure that the content type of the POST request has been set to application/json
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';
if(strcasecmp($contentType, 'application/json; charset=utf-8') != 0){
throw new Exception('Content type must be: application/json '.$contentType);
}
//Receive the RAW post data.
$content = trim(file_get_contents("php://input"));
//Attempt to decode the incoming RAW post data from JSON.
$data = json_decode($content, true);
//If json_decode failed, the JSON is invalid.
if(!is_array($data)){
throw new Exception('Received content contained invalid JSON!');
}
print_r ($data);
$Widget1= $data[0]->widget1;
$Widget2= $data[0]->widget2;
$Widget3= $data[0]->widget3;
$Widget4= $data[0]->widget4;
$Widget5= $data[0]->widget5;
$Widget6= $data[0]->imageobject;
| 0debug |
static int dnxhd_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
DNXHDContext *ctx = avctx->priv_data;
ThreadFrame frame = { .f = data };
AVFrame *picture = data;
int first_field = 1;
int ret, i;
ff_dlog(avctx, "frame size %d\n", buf_size);
decode_coding_unit:
if ((ret = dnxhd_decode_header(ctx, picture, buf, buf_size, first_field)) < 0)
return ret;
if ((avctx->width || avctx->height) &&
(ctx->width != avctx->width || ctx->height != avctx->height)) {
av_log(avctx, AV_LOG_WARNING, "frame size changed: %dx%d -> %dx%d\n",
avctx->width, avctx->height, ctx->width, ctx->height);
first_field = 1;
}
if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) {
av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n",
av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt));
first_field = 1;
}
avctx->pix_fmt = ctx->pix_fmt;
ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
if (ret < 0)
return ret;
if (first_field) {
if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
return ret;
picture->pict_type = AV_PICTURE_TYPE_I;
picture->key_frame = 1;
}
ctx->buf_size = buf_size - 0x280;
ctx->buf = buf + 0x280;
avctx->execute2(avctx, dnxhd_decode_row, picture, NULL, ctx->mb_height);
if (first_field && picture->interlaced_frame) {
buf += ctx->cid_table->coding_unit_size;
buf_size -= ctx->cid_table->coding_unit_size;
first_field = 0;
goto decode_coding_unit;
}
ret = 0;
for (i = 0; i < avctx->thread_count; i++) {
ret += ctx->rows[i].errors;
ctx->rows[i].errors = 0;
}
if (ret) {
av_log(ctx->avctx, AV_LOG_ERROR, "%d lines with errors\n", ret);
return AVERROR_INVALIDDATA;
}
*got_frame = 1;
return avpkt->size;
}
| 1threat |
static void dump_iterate(DumpState *s, Error **errp)
{
GuestPhysBlock *block;
int64_t size;
int ret;
Error *local_err = NULL;
while (1) {
block = s->next_block;
size = block->target_end - block->target_start;
if (s->has_filter) {
size -= s->start;
if (s->begin + s->length < block->target_end) {
size -= block->target_end - (s->begin + s->length);
}
}
write_memory(s, block, s->start, size, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
ret = get_next_block(s, block);
if (ret == 1) {
dump_completed(s);
}
}
}
| 1threat |
Object reference not set to an instance of an object Unity : <p>The script is attached to a coin that when picked does that issue.
There is nothing to attach in the inspector.</p>
<p>The <code>CoinMagnet state</code> is assigned to another object (as a magnet).</p>
<pre><code>public void Start()
{
Player = GameObject.FindGameObjectWithTag("Player");
pu = Player.GetComponent<PowerUps>();
}
private void Update()
{
if (pu.CurrentPowerState == PowerUps.State.CoinMagnet) //issue here
{
if (Vector3.Distance(Player.transform.position, transform.position) < CoinMagnetRadius)
...
...
}
}
</code></pre>
<p>Here is the Powerups class</p>
<pre><code>public State CurrentPowerState;
public enum State
{
None,
Invincible,
CoinMagnet,
};
</code></pre>
| 0debug |
iOS Development - Executing Code After Leaving a tab in a tabbed application : <p>I want to execute some code whenever a user leaves one of the tabs in my tabbed application. What should I do?</p>
| 0debug |
void sparc64_set_context(CPUSPARCState *env)
{
abi_ulong ucp_addr;
struct target_ucontext *ucp;
target_mc_gregset_t *grp;
abi_ulong pc, npc, tstate;
abi_ulong fp, i7, w_addr;
int err;
unsigned int i;
ucp_addr = env->regwptr[UREG_I0];
if (!lock_user_struct(VERIFY_READ, ucp, ucp_addr, 1))
goto do_sigsegv;
grp = &ucp->tuc_mcontext.mc_gregs;
err = __get_user(pc, &((*grp)[MC_PC]));
err |= __get_user(npc, &((*grp)[MC_NPC]));
if (err || ((pc | npc) & 3))
goto do_sigsegv;
if (env->regwptr[UREG_I1]) {
target_sigset_t target_set;
sigset_t set;
if (TARGET_NSIG_WORDS == 1) {
if (__get_user(target_set.sig[0], &ucp->tuc_sigmask.sig[0]))
goto do_sigsegv;
} else {
abi_ulong *src, *dst;
src = ucp->tuc_sigmask.sig;
dst = target_set.sig;
for (i = 0; i < TARGET_NSIG_WORDS; i++, dst++, src++) {
err |= __get_user(*dst, src);
}
if (err)
goto do_sigsegv;
}
target_to_host_sigset_internal(&set, &target_set);
sigprocmask(SIG_SETMASK, &set, NULL);
}
env->pc = pc;
env->npc = npc;
err |= __get_user(env->y, &((*grp)[MC_Y]));
err |= __get_user(tstate, &((*grp)[MC_TSTATE]));
env->asi = (tstate >> 24) & 0xff;
cpu_put_ccr(env, tstate >> 32);
cpu_put_cwp64(env, tstate & 0x1f);
err |= __get_user(env->gregs[1], (&(*grp)[MC_G1]));
err |= __get_user(env->gregs[2], (&(*grp)[MC_G2]));
err |= __get_user(env->gregs[3], (&(*grp)[MC_G3]));
err |= __get_user(env->gregs[4], (&(*grp)[MC_G4]));
err |= __get_user(env->gregs[5], (&(*grp)[MC_G5]));
err |= __get_user(env->gregs[6], (&(*grp)[MC_G6]));
err |= __get_user(env->gregs[7], (&(*grp)[MC_G7]));
err |= __get_user(env->regwptr[UREG_I0], (&(*grp)[MC_O0]));
err |= __get_user(env->regwptr[UREG_I1], (&(*grp)[MC_O1]));
err |= __get_user(env->regwptr[UREG_I2], (&(*grp)[MC_O2]));
err |= __get_user(env->regwptr[UREG_I3], (&(*grp)[MC_O3]));
err |= __get_user(env->regwptr[UREG_I4], (&(*grp)[MC_O4]));
err |= __get_user(env->regwptr[UREG_I5], (&(*grp)[MC_O5]));
err |= __get_user(env->regwptr[UREG_I6], (&(*grp)[MC_O6]));
err |= __get_user(env->regwptr[UREG_I7], (&(*grp)[MC_O7]));
err |= __get_user(fp, &(ucp->tuc_mcontext.mc_fp));
err |= __get_user(i7, &(ucp->tuc_mcontext.mc_i7));
w_addr = TARGET_STACK_BIAS+env->regwptr[UREG_I6];
if (put_user(fp, w_addr + offsetof(struct target_reg_window, ins[6]),
abi_ulong) != 0)
goto do_sigsegv;
if (put_user(i7, w_addr + offsetof(struct target_reg_window, ins[7]),
abi_ulong) != 0)
goto do_sigsegv;
err |= __get_user(env->fprs, &(ucp->tuc_mcontext.mc_fpregs.mcfpu_fprs));
{
uint32_t *src = ucp->tuc_mcontext.mc_fpregs.mcfpu_fregs.sregs;
for (i = 0; i < 64; i++, src++) {
if (i & 1) {
err |= __get_user(env->fpr[i/2].l.lower, src);
} else {
err |= __get_user(env->fpr[i/2].l.upper, src);
}
}
}
err |= __get_user(env->fsr,
&(ucp->tuc_mcontext.mc_fpregs.mcfpu_fsr));
err |= __get_user(env->gsr,
&(ucp->tuc_mcontext.mc_fpregs.mcfpu_gsr));
if (err)
goto do_sigsegv;
unlock_user_struct(ucp, ucp_addr, 0);
return;
do_sigsegv:
unlock_user_struct(ucp, ucp_addr, 0);
force_sig(TARGET_SIGSEGV);
}
| 1threat |
cursor.execute('SELECT * FROM users WHERE username = ' + user_input) | 1threat |
python cassandra will not create a keyspace : OMG
How does what create a keyspace in cassandra using python?
from cassandra.cluster import Cluster
cluster = Cluster(['cassandra.sucks.com'])
session = cluster.connect()
session.execute('CREATE KEYSPACE IF NOT EXISTS kong')
File "cassandra/cluster.py", line 1998, in cassandra.cluster.Session.execute (cassandra/cluster.c:34869)
File "cassandra/cluster.py", line 3781, in cassandra.cluster.ResponseFuture.result (cassandra/cluster.c:73073)
cassandra.protocol.SyntaxException: <Error from server: code=2000 [Syntax error in CQL query] message="line 0:-1 mismatched input '<EOF>' expecting K_WITH">
| 0debug |
Android Studio not committing to GitHub : <p>I am trying to use git in Android Studio. If I choose commit changes, it says that it has successfully committed the changed files but those changes do not appear on the GitHub. Instead, if I delete the repository from GitHub and choose Share Project on GitHub, it successfully creates a new repository and uploads the files into it. This means that the connection is fine. Also, I have checked the gitignore file, the java files are not in that list. What could be the problem? </p>
| 0debug |
How to authenticate users for AWS API Gateway? : <p>I am creating a server less REST API using AWS API Gateway and AWS Lambda. While the end points have been created and linked with the corresponding Lambda functions, next step is to add authentication layer to authenticate users via email and password. From what I could understand from the documentation, API Gateway methods can support either API Key based access or IAM based access. But I could not understand how to securely implement the authentication using API keys. </p>
<p>Will I have to create a server for doing the authentication and managing the users ? Is there any way this can be a complete server less end to end application ? Any resources for pointing in the right direction will be highly appreciated. I am looking at <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html" rel="noreferrer">this document</a> at the moment</p>
| 0debug |
NullPointerException on setVisibility function in FrameLayout : <p>I have developed android project and published to a google playstore.
In this app, for tab use, at one activity, calling frameLayout.setVisibility(View.INVISIBLE) for showing other layouts.
It is working perfectly on my android devices.</p>
<p>But when i check crashlytics, i can see applications crashed on that function.</p>
<p>I tried many google searches but i did not found the solution and did not fix yet.</p>
<p>Please help me on this issue.</p>
| 0debug |
PHP Variable variables and array key veriables : I try to create code with out IF:
if($lvl==0)
{
$OutPutArray[0]['follow'][]=$infoArr;
}
elseif($lvl==1)
{
$OutPutArray[0]['follow'][0]['follow'][]=$infoArr;
}
elseif($lvl==2)
{
$OutPutArray[0]['follow'][0]['follow'][0]['follow'][]=$infoArr;
}
...
And i whant it to be unlimited)) So i need something like:
$prefix="[some_key]...[some_key]";
${$prefix}[]=$Array;
Can someone helps or it imposoble? | 0debug |
int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr,
int rw, int mmu_idx)
{
S390CPU *cpu = S390_CPU(cs);
CPUS390XState *env = &cpu->env;
target_ulong vaddr, raddr;
uint64_t asc;
int prot;
DPRINTF("%s: address 0x%" VADDR_PRIx " rw %d mmu_idx %d\n",
__func__, orig_vaddr, rw, mmu_idx);
orig_vaddr &= TARGET_PAGE_MASK;
vaddr = orig_vaddr;
if (mmu_idx < MMU_REAL_IDX) {
asc = cpu_mmu_idx_to_asc(mmu_idx);
if (!(env->psw.mask & PSW_MASK_64)) {
vaddr &= 0x7fffffff;
}
if (mmu_translate(env, vaddr, rw, asc, &raddr, &prot, true)) {
return 1;
}
} else if (mmu_idx == MMU_REAL_IDX) {
if (mmu_translate_real(env, vaddr, rw, &raddr, &prot)) {
return 1;
}
} else {
abort();
}
if (!address_space_access_valid(&address_space_memory, raddr,
TARGET_PAGE_SIZE, rw)) {
DPRINTF("%s: raddr %" PRIx64 " > ram_size %" PRIx64 "\n", __func__,
(uint64_t)raddr, (uint64_t)ram_size);
trigger_pgm_exception(env, PGM_ADDRESSING, ILEN_AUTO);
return 1;
}
qemu_log_mask(CPU_LOG_MMU, "%s: set tlb %" PRIx64 " -> %" PRIx64 " (%x)\n",
__func__, (uint64_t)vaddr, (uint64_t)raddr, prot);
tlb_set_page(cs, orig_vaddr, raddr, prot,
mmu_idx, TARGET_PAGE_SIZE);
return 0;
}
| 1threat |
Java - Generate 2 Number In Specific Numbers : I want generate 2 numbers in specified numbers, I wrote this code and not work, can anybody suggest a better solution ?
==========================================
public class l{
public static void main(String[] args) {
int[] lottery = new int[2];
int randomNum;
for (int i = 0; i < 3; i++) {
randomNum = (int) (Math.random() * (3,9,25,41,43,50,68)); // Random number created here.
for (int x = 0; x < i; x++) {
if (lottery[x] == randomNum) // Here, code checks if same random number generated before.
{
randomNum = (int) (Math.random() * (3,9,25,41,43,50,68));// If random number is same, another number generated.
x = -1; // restart the loop
}
}
lottery[i] = randomNum;
}
for (int i = 0; i < lottery.length; i++)
System.out.print(lottery[i] + " ");
}
}
Thanks | 0debug |
How to make an allert when element is clicked : I have really simple problem. I want to make an script what appears alert when i I click on image. My html is:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css" \>
<script src="jquery-3.2.1.min.js" type="text/javascript"></script>
<script src="lightbox.js" type="text/javascript" \>
</script>
</head>
<body>
<img class="img" src="http://lorempixel.com/400/200/"></img>
</body>
</html>
and js:
$("img").click(function() {
allert("dadadad");
});
im new to javascript so all tips will be helpful | 0debug |
react-navigation Screen that conceals TabBar from nested StackNavigator : <p>I'm new to <code>react-navigation</code> and trying to wrap my head around how to do the following:</p>
<p>Given this navigation structure:</p>
<pre><code>RootTabNavigator
LoggedOut_StackNavigator
...
LoggedIn_StackNavigator
LoggedIn_TabNavigator <-- TabBar rendered by this Navigator
TabA_StackNavigator
ScreenA
ScreenB
</code></pre>
<p>I would like to be able to navigate from <code>ScreenA</code> to <code>ScreenB</code> using the typical "slide in from right" transition, in such a way that the <code>TabBar</code> <strong>is</strong> visible on <code>ScreenA</code>, but is <strong>not</strong> visible on <code>ScreenB</code>. In other words, when I navigate to <code>ScreenB</code>, I want it to take up the entire window. </p>
<p>Once the user transitions from <code>ScreenA</code> to <code>ScreenB</code>, they can either press the back button to return back to <code>ScreenA</code>, or navigate to new routes using the same transition with the <code>TabBar</code> still <strong>not</strong> visible.</p>
<p><strong>What I've tried:</strong></p>
<ul>
<li><p><code>navigationOptions.tabBarVisible</code>: this property only seems to work when applied to <code>TabA_StackNavigator</code> itself, which means that <strong>all</strong> of the screens in its stack also conceal the <code>TabBar</code>. Adding it to the screens inside the StackNavigator has no effect.</p></li>
<li><p>Adding a new <code>AllScreens_StackNavigator</code> as a sibling of <code>LoggedIn_TabNavigator</code> and navigating to routes inside this navigator, I get the error: <code>Expect nav state to have routes and index, {"routeName":"ScreenB", "params": {}, "key": "init-id-1516..."}</code>. The navigation action I dispatched to try to do this:</p>
<pre><code>{
"action": Object {
"params": Object {},
"routeName": "ScreenB",
"type": "Navigation/NAVIGATE",
},
"params": Object {},
"routeName": "AllScreens_StackNavigator",
"type": "Navigation/NAVIGATE",
}
</code></pre></li>
</ul>
<p>Any help is greatly appreciated!</p>
| 0debug |
How to pass data from Hashmap Listview to next Activity : I wish to pass data from one Listview activity to the next activity ie when an item is clicked in the list, data such as the title or thumb_url (an image from a remote database) can be passed to a detail Activity.
In the example below, these items are set out in an Hashmap.
What code will pass the above data to another activity, using an intent??
I'm puzzled because these data items are laid out in an hashmap.
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import com.pskovcreative.hullguide.R;
import com.pskovcreative.hullguide.SingleListItem_Attractions;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
public class CustomizedListView extends Activity {
// All static variables
static final String URL = "http://padihamcars.com/music.xml";
// XML node keys
static final String KEY_SONG = "song"; // parent node
static final String KEY_ID = "id";
static final String KEY_TITLE = "title";
static final String KEY_ARTIST = "artist";
static final String KEY_DURATION = "duration";
static final String KEY_THUMB_URL = "thumb_url";
ListView list;
LazyAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();
XMLParser parser = new XMLParser();
String xml = parser.getXmlFromUrl(URL); // getting XML from URL
Document doc = parser.getDomElement(xml); // getting DOM element
NodeList nl = doc.getElementsByTagName(KEY_SONG);
// looping through all song nodes <song>
for (int i = 0; i < nl.getLength(); i++) {
// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();
Element e = (Element) nl.item(i);
// adding each child node to HashMap key => value
map.put(KEY_ID, parser.getValue(e, KEY_ID));
map.put(KEY_TITLE, parser.getValue(e, KEY_TITLE));
map.put(KEY_ARTIST, parser.getValue(e, KEY_ARTIST));
map.put(KEY_DURATION, parser.getValue(e, KEY_DURATION));
map.put(KEY_THUMB_URL, parser.getValue(e, KEY_THUMB_URL));
// adding HashList to ArrayList
songsList.add(map);
}
list=(ListView)findViewById(R.id.list);
// Getting adapter by passing xml data ArrayList
adapter=new LazyAdapter(this, songsList);
list.setAdapter(adapter);
// Click event for single list row
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
} | 0debug |
How to merge sort string array with using pointer in c? : <p>I'm learning merge sort in the string array. Here is my code :</p>
<pre><code>#include <stdio.h>
#include <string.h>
#define SIZE 10
int num = 0;
// Merges two subarrays of arr[].
// First subarray is arr[l..m]
// Second subarray is arr[m+1..r]
void merge(char str[SIZE][10], int l, int m, int r) {
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
/* create temp arrays */
char L[n1][10], R[n2][10];
/* Copy data to temp arrays L[] and R[] */
for (i = 0; i < n1; i++)
strcpy(L[i], str[l+i]);
for (j = 0; j < n2; j++)
strcpy(R[j], str[m+1+j]);
/* Merge the temp arrays back into arr[l..r]*/
i = 0; // Initial index of first subarray
j = 0; // Initial index of second subarray
k = l; // Initial index of merged subarray
while (i < n1 && j < n2) {
num++;
switch (strcmp(L[i], R[j])) {
case -1 :
strcpy(str[k], L[i]);
i++;
break;
case 1 :
strcpy(str[k], R[j]);
j++;
break;
}
k++;
}
/* Copy the remaining elements of L[], if there
are any */
while (i < n1) {
strcpy(str[k], L[i]);
i++;
k++;
}
/* Copy the remaining elements of R[], if there
are any */
while (j < n2) {
strcpy(str[k], R[j]);
j++;
k++;
}
}
/* l is for left index and r is right index of the
sub-array of arr to be sorted */
void mergeSort(char str[SIZE][10], int l, int r) {
if (l < r) {
// Same as (l+r)/2, but avoids overflow for
// large l and h
int m = l+(r-l)/2;
// Sort first and second halves
mergeSort(str, l, m);
mergeSort(str, m+1, r);
merge(str, l, m, r);
}
}
/* UTILITY FUNCTIONS */
/* Function to print an array */
void printArray(char A[SIZE][10], int size)
{
int i;
for (i=0; i < size; i++)
printf("%s ", A[i]);
printf("\n");
}
int main(void) {
int i, n;
char str[SIZE][10] = {"korea", "aaa", "computer", "seoul", "algorithm", "bbb", "ccc", "ddd", "game", "java"};
char max[10];
printf("Given array is \n");
printArray(str, SIZE);
mergeSort(str, 0, SIZE - 1);
printf("\nSorted array is \n");
printArray(str, SIZE);
printf("횟수 : %d", num);
return 0;
}
</code></pre>
<p>The code above is working good. But I want to change <code>merge(char str[SIZE][10], int l, int m, int r)</code> and <code>mergeSort(char str[SIZE][10], int l, int r)</code>, <code>printArray(char A[SIZE][10], int size)</code> code to using double pointer like not <code>char str[SIZE][10]</code> but <code>char **str</code>. How do I change in this code?? I tried to change like that, but some error occurred... I have to change the code in <code>merge()</code> members that <code>char L[n1][10]</code> and <code>char R[n2][10]</code>.</p>
| 0debug |
how to read excel file using libxls library using c programming : I am trying to create an application that needs to read excel file. Now i have downloaded libxls library but i do not know how to use it. Can anyone help me with simple basic program. | 0debug |
c language homework... not solved : I'm homeworking now. Then one problem about increase/decrease operator err when I upload my explanation..
I tried while code to my problem then increase operator solved, but the decrease operator not solved..
the problem =
input variable x, and output x~x+5.After, output x~x-5. Use Increase / decrease operator to solve problem.
int x;
x = 10;
scanf("%d", &x);
int y = x + 6;
while (x < y)
{
printf("%d ", x);
++x;
}
output x~x+5 and after output x~x-5
[enter image description here][1]
[1]: https://i.stack.imgur.com/TFFNk.png | 0debug |
node how to run concurrent infinite jobs : I have multiple jobs (functions) that process data in my DB.
They should be run indefinitely and concurrently. I was wondering about the
best way to run them. Should I write a bash file that starts ```node somejob.js``` for each job or should I use node workers from a js file, or some other method altogether? | 0debug |
Mocha not exiting after test : <p>I'm starting with tests in Node. Using mocha, chai and nock (to intercept external HTTP api calls).</p>
<p>I have written 3 tests, all of them are a pass, however, when I added the 3rd test, mocha stopped exiting after running the tests, with no error or indication of anything wrong.</p>
<p>If I comment the 3rd test, mocha exits just fine.</p>
<p>This is the test causing the 'issue':</p>
<pre><code>describe('tokenizer.processFile(req, \'tokenize\')', () => {
it('should tokenize a file', async () => {
req = {
file: {
originalname: 'randomcards.txt',
buffer: cardsFile_buffer
},
user: {
displayName: user
}
};
expect(Buffer.from(await tokenizer.processFile(req, 'tokenize'))).to.deep.equal(tokensFile_buffer);
});
});
</code></pre>
<p>Again, that test is a pass, which baffles me.</p>
<p>Here's the code of tokenizer.processFile:</p>
<pre><code>processFile: function(req, whatTo){
combinedLogger.info(`Request to ${whatTo} ${req.file.originalname} received. Made by: ${req.user.displayName}`);
return new Promise(function(resolve, reject){
const lines = [], responses = [];
const lineReader = require('readline').createInterface({
input: require('streamifier').createReadStream(req.file.buffer)
});
lineReader.on('line', line => {
lines.push(line);
});
lineReader.on('close', async () => {
//process every line sequentially
try {
//ensure DB connected to mass insert
await db_instance.get_pool();
for(const line of lines) {
var response;
req.current_value = line;
if (whatTo == 'tokenize'){
response = await Tokenize(line);
db_instance.insertAction(req, 'tokenize', response);
}
else if (whatTo == 'detokenize'){
combinedLogger.info(`Request to detokenize ${line} received. Made by: ${req.user.displayName}`);
response = await Detokenize(line);
db_instance.insertAction(req, 'detokenize', line);
}
responses.push(response);
}
resolve(responses.join("\r\n"));
}
catch(error){
reject(error);
}
});
});
}
</code></pre>
<p>Functions Tokenize(value) and Detokenize(value) are also called in the other 2 tests, which when run, mocha exits just fine.</p>
<p>Any idea what's causing this?</p>
<p>Mocha version: 5.1.1</p>
| 0debug |
static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd,
const QDict *params)
{
QObject *data = NULL;
cmd->mhandler.cmd_new(mon, params, &data);
if (is_async_return(data)) {
if (monitor_ctrl_mode(mon) && monitor_has_error(mon)) {
monitor_protocol_emitter(mon, NULL);
}
} else if (monitor_ctrl_mode(mon)) {
monitor_protocol_emitter(mon, data);
} else {
if (data)
cmd->user_print(mon, data);
}
qobject_decref(data);
}
| 1threat |
How to randomly print a word in an iOS app - swift : I have been trying to create an app that randomly prints a new word after a certain amount of time, i.e five seconds.
@IBOutlet weak var InspireLabel: UILabel!
func randomText() -> String {
if theValue > 5 {
let words = ["Place", "Cat", "House"]
return words[Int(arc4random_uniform(UInt32(words.count)))]
}
}
this is all the code I have right now. InspireLabel is the label which needs to change to the word. 'theValue' is the time passed. I keep getting a 'Missing return in a function expected to return 'String' error which stops me from running the code. | 0debug |
Aml *aml_or(Aml *arg1, Aml *arg2)
{
Aml *var = aml_opcode(0x7D );
aml_append(var, arg1);
aml_append(var, arg2);
build_append_byte(var->buf, 0x00 );
return var;
}
| 1threat |
int qcrypto_cipher_decrypt(QCryptoCipher *cipher,
const void *in,
void *out,
size_t len,
Error **errp)
{
QCryptoCipherBuiltin *ctxt = cipher->opaque;
return ctxt->decrypt(cipher, in, out, len, errp); | 1threat |
void vga_common_init(VGAState *s, DisplayState *ds, uint8_t *vga_ram_base,
ram_addr_t vga_ram_offset, int vga_ram_size)
{
int i, j, v, b;
for(i = 0;i < 256; i++) {
v = 0;
for(j = 0; j < 8; j++) {
v |= ((i >> j) & 1) << (j * 4);
}
expand4[i] = v;
v = 0;
for(j = 0; j < 4; j++) {
v |= ((i >> (2 * j)) & 3) << (j * 4);
}
expand2[i] = v;
}
for(i = 0; i < 16; i++) {
v = 0;
for(j = 0; j < 4; j++) {
b = ((i >> j) & 1);
v |= b << (2 * j);
v |= b << (2 * j + 1);
}
expand4to8[i] = v;
}
s->vram_ptr = vga_ram_base;
s->vram_offset = vga_ram_offset;
s->vram_size = vga_ram_size;
s->ds = ds;
s->get_bpp = vga_get_bpp;
s->get_offsets = vga_get_offsets;
s->get_resolution = vga_get_resolution;
s->update = vga_update_display;
s->invalidate = vga_invalidate_display;
s->screen_dump = vga_screen_dump;
s->text_update = vga_update_text;
switch (vga_retrace_method) {
case VGA_RETRACE_DUMB:
s->retrace = vga_dumb_retrace;
s->update_retrace_info = vga_dumb_update_retrace_info;
break;
case VGA_RETRACE_PRECISE:
s->retrace = vga_precise_retrace;
s->update_retrace_info = vga_precise_update_retrace_info;
break;
}
qemu_register_reset(vga_reset, s);
vga_reset(s);
}
| 1threat |
iOS 13 Set UISearchTextField placeholder color : <p>How do you set the placeholder color of iOS 13's <code>UISearchTextField</code>?</p>
<p>I tried the following with no success:</p>
<pre><code>searchField.attributedPlaceholder = NSAttributedString(string: "Some placeholder", attributes: [NSAttributedString.Key.foregroundColor: UIColor.red])
</code></pre>
<p>Is this a bug in the current beta or do I miss something? I am using Xcode 11, beta 7.</p>
| 0debug |
static ssize_t dump_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
{
DumpState *s = vc->opaque;
struct pcap_sf_pkthdr hdr;
int64_t ts;
int caplen;
if (s->fd < 0) {
return size;
}
ts = muldiv64(qemu_get_clock(vm_clock), 1000000, get_ticks_per_sec());
caplen = size > s->pcap_caplen ? s->pcap_caplen : size;
hdr.ts.tv_sec = ts / 1000000;
hdr.ts.tv_usec = ts % 1000000;
hdr.caplen = caplen;
hdr.len = size;
if (write(s->fd, &hdr, sizeof(hdr)) != sizeof(hdr) ||
write(s->fd, buf, caplen) != caplen) {
qemu_log("-net dump write error - stop dump\n");
close(s->fd);
s->fd = -1;
}
return size;
}
| 1threat |
SKPaymentQueue updatedTransactions not being called : <p>I am getting "this in app purchase has already been bought it will be restored for free" but the delegate updatedTransactions is not being called and nothing happens, the IAP doesn't execute.</p>
<p>I have implemented Restore Purchase which is working fine but how do i prevent a user from making purchase for a non-consumable item again?And why is the delegate updatedTransactions(SKPaymentTransactionState.Restored) not being called? </p>
<p>Even making purchase after deleting and reinstalling the app shows this pop up.</p>
<p>Here is my code.Please let me know if i am doing anything wrong.Thanks</p>
<pre><code>func makePaymentForProduct(product:SKProduct){
let payment = SKPayment.init(product: product)
SKPaymentQueue.defaultQueue().addPayment(payment)
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
}
func restorePurchases(){
SKPaymentQueue.defaultQueue().restoreCompletedTransactions()
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
}
//MARK: SKProductsRequestDelegate
func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {
self.delegate?.didGetProducts(response.products)
}
func request(request: SKRequest, didFailWithError error: NSError) {
self.delegate?.purchaseFailed(error.localizedDescription)
}
//MARK: SKPaymentTransactionObserver
func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for (_, transaction) in transactions.enumerate() {
switch (transaction.transactionState) {
case SKPaymentTransactionState.Purchased:
self.completeTransaction(transaction)
break
case SKPaymentTransactionState.Restored:
self.restoreTransaction(transaction)
break
case SKPaymentTransactionState.Failed:
self.failedTransaction(transaction)
break
default:
break
}
}
}
func completeTransaction(transaction:SKPaymentTransaction){
self.delegate?.purchaseSuccessful()
SKPaymentQueue.defaultQueue().finishTransaction(transaction)
}
func restoreTransaction(transaction:SKPaymentTransaction){
self.delegate?.purchaseSuccessful()
SKPaymentQueue.defaultQueue().finishTransaction(transaction)
}
func failedTransaction(transaction:SKPaymentTransaction){
self.delegate?.purchaseFailed("")
SKPaymentQueue.defaultQueue().finishTransaction(transaction)
}
//Restore Purchase
func paymentQueueRestoreCompletedTransactionsFinished(queue: SKPaymentQueue) {
self.delegate?.purchaseRestored()
}
func paymentQueue(queue: SKPaymentQueue, restoreCompletedTransactionsFailedWithError error: NSError) {
self.delegate?.purchaseFailed(error.localizedDescription)
}
</code></pre>
| 0debug |
IntelliJ: find code path between two methods : <p>I have two methods in my code base. I would like to figure out, if there exists a path in which one will be called from the other. Is there some way to achieve this easily in IntelliJ without digging manually through call hierarchies?</p>
| 0debug |
Python groupby delete row with condition : <p>I'm new on python and I have an issue.</p>
<p>My original dataset is like this one:
<a href="https://i.stack.imgur.com/1cxXN.png" rel="nofollow noreferrer">Original dataset</a></p>
<p>and I would like to get: <a href="https://i.stack.imgur.com/tqOsa.png" rel="nofollow noreferrer">final dataset</a></p>
<p>So the idea is to delete:</p>
<ul>
<li>single demand, and</li>
<li>rows where there is only one different id_user per demand. </li>
</ul>
<p>I manage to delete single demand with a Counter() but I'm stuck there:
<a href="https://i.stack.imgur.com/jOozJ.png" rel="nofollow noreferrer">probleme here</a></p>
<p>I don't want to do it manually with index because my proper dataset has more than 30000lines.</p>
<p>Can someone help me with this problem ?</p>
| 0debug |
What is the most recent correct syntax to initialize the Google Mobile Ads SDK in the App Delegate file? : <p>All of a sudden, I get a warning on the code used to initialize the Google Mobile Ads SDK. (It had been working for weeks before with no warning, but now it seems there's a new way to write the code.)</p>
<p>This is the code I have:</p>
<pre><code>GADMobileAds.configure(withApplicationID: "ca-app-pub-################~##########")
</code></pre>
<p>But it gives me this warning: 'configure(withApplicationID:)' is deprecated: Use [GADMobileAds.sharedInstance startWithCompletionHandler:]</p>
<p>I've tried to rewrite it like this (with and without the square brackets):</p>
<pre><code>GADMobileAds.sharedInstance startWithCompletionHandler: "ca-app-pub-################~##########"
</code></pre>
<p>But it just gives me an error that it expected a ;.</p>
<p>How should I write this? Thank you!</p>
<p><img src="https://i.imgur.com/YLTqdPc.png" alt="files from Pods folder in Xcode show a modified status"></p>
| 0debug |
Google OAuth consent screen not showing app Logo and Name : <p>Recently we noticed that our app OAuth consent screen does not show Logo and Name of application. Instead, it shows the redirect URL.
And there is no Terms and Privacy that we provided in developers console. </p>
<hr>
<p><a href="https://i.stack.imgur.com/x61qD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/x61qD.png" alt="enter image description here"></a></p>
<hr>
<p>This is how our OAuth consent screen is setup:</p>
<hr>
<p><a href="https://i.stack.imgur.com/41UZn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/41UZn.png" alt="enter image description here"></a></p>
<p>Can some one please tell what we are doing wrong?</p>
| 0debug |
Opening port 80 on Oracle Cloud Infrastructure Compute node : <p>This is an elementary question however one I cannot seem to resolve by perusing the Oracle documentation. I've created an Ubuntu-based compute node, and it's attached to a subnet. In that subnet I've created a stateful rule with source 0.0.0.0/0, IP protocol: TCP, Source Port Range: All, Destination Port Range: 80.</p>
<p>There is no firewall configured on the server.</p>
<p>Despite this configuration I can't access the compute node's public IP. Any ideas?</p>
| 0debug |
creating a foriegn key contstraint on non primary or unique key : how to use foreign key constraint on non primary key for example ihave two tables account and transactions i want to check the acname in transactions is one of the acname in account
table account (acno,acname,bal,type)
table transactions (tid,acno,acname,bal,credit/debit,datetime)
here transactions .acname should be equal to account.acname.... | 0debug |
static inline void gen_intermediate_code_internal(TranslationBlock * tb,
int spc, CPUSPARCState *env)
{
target_ulong pc_start, last_pc;
uint16_t *gen_opc_end;
DisasContext dc1, *dc = &dc1;
CPUBreakpoint *bp;
int j, lj = -1;
int num_insns;
int max_insns;
memset(dc, 0, sizeof(DisasContext));
dc->tb = tb;
pc_start = tb->pc;
dc->pc = pc_start;
last_pc = dc->pc;
dc->npc = (target_ulong) tb->cs_base;
dc->cc_op = CC_OP_DYNAMIC;
dc->mem_idx = cpu_mmu_index(env);
dc->def = env->def;
if ((dc->def->features & CPU_FEATURE_FLOAT))
dc->fpu_enabled = cpu_fpu_enabled(env);
else
dc->fpu_enabled = 0;
#ifdef TARGET_SPARC64
dc->address_mask_32bit = env->pstate & PS_AM;
#endif
gen_opc_end = gen_opc_buf + OPC_MAX_SIZE;
cpu_tmp0 = tcg_temp_new();
cpu_tmp32 = tcg_temp_new_i32();
cpu_tmp64 = tcg_temp_new_i64();
cpu_dst = tcg_temp_local_new();
cpu_val = tcg_temp_local_new();
cpu_addr = tcg_temp_local_new();
num_insns = 0;
max_insns = tb->cflags & CF_COUNT_MASK;
if (max_insns == 0)
max_insns = CF_COUNT_MASK;
gen_icount_start();
do {
if (unlikely(!TAILQ_EMPTY(&env->breakpoints))) {
TAILQ_FOREACH(bp, &env->breakpoints, entry) {
if (bp->pc == dc->pc) {
if (dc->pc != pc_start)
save_state(dc, cpu_cond);
gen_helper_debug();
tcg_gen_exit_tb(0);
dc->is_br = 1;
goto exit_gen_loop;
}
}
}
if (spc) {
qemu_log("Search PC...\n");
j = gen_opc_ptr - gen_opc_buf;
if (lj < j) {
lj++;
while (lj < j)
gen_opc_instr_start[lj++] = 0;
gen_opc_pc[lj] = dc->pc;
gen_opc_npc[lj] = dc->npc;
gen_opc_instr_start[lj] = 1;
gen_opc_icount[lj] = num_insns;
}
}
if (num_insns + 1 == max_insns && (tb->cflags & CF_LAST_IO))
gen_io_start();
last_pc = dc->pc;
disas_sparc_insn(dc);
num_insns++;
if (dc->is_br)
break;
if (dc->pc != (last_pc + 4))
break;
if ((dc->pc & (TARGET_PAGE_SIZE - 1)) == 0)
break;
if (env->singlestep_enabled || singlestep) {
tcg_gen_movi_tl(cpu_pc, dc->pc);
tcg_gen_exit_tb(0);
break;
}
} while ((gen_opc_ptr < gen_opc_end) &&
(dc->pc - pc_start) < (TARGET_PAGE_SIZE - 32) &&
num_insns < max_insns);
exit_gen_loop:
tcg_temp_free(cpu_addr);
tcg_temp_free(cpu_val);
tcg_temp_free(cpu_dst);
tcg_temp_free_i64(cpu_tmp64);
tcg_temp_free_i32(cpu_tmp32);
tcg_temp_free(cpu_tmp0);
if (tb->cflags & CF_LAST_IO)
gen_io_end();
if (!dc->is_br) {
if (dc->pc != DYNAMIC_PC &&
(dc->npc != DYNAMIC_PC && dc->npc != JUMP_PC)) {
gen_goto_tb(dc, 0, dc->pc, dc->npc);
} else {
if (dc->pc != DYNAMIC_PC)
tcg_gen_movi_tl(cpu_pc, dc->pc);
save_npc(dc, cpu_cond);
tcg_gen_exit_tb(0);
}
}
gen_icount_end(tb, num_insns);
*gen_opc_ptr = INDEX_op_end;
if (spc) {
j = gen_opc_ptr - gen_opc_buf;
lj++;
while (lj <= j)
gen_opc_instr_start[lj++] = 0;
#if 0
log_page_dump();
#endif
gen_opc_jump_pc[0] = dc->jump_pc[0];
gen_opc_jump_pc[1] = dc->jump_pc[1];
} else {
tb->size = last_pc + 4 - pc_start;
tb->icount = num_insns;
}
#ifdef DEBUG_DISAS
if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
qemu_log("--------------\n");
qemu_log("IN: %s\n", lookup_symbol(pc_start));
log_target_disas(pc_start, last_pc + 4 - pc_start, 0);
qemu_log("\n");
}
#endif
}
| 1threat |
Is fastclick js still needed? : <p>I mean this:</p>
<p><a href="https://github.com/ftlabs/fastclick" rel="noreferrer">https://github.com/ftlabs/fastclick</a></p>
<p>Is it still needed and important?</p>
<p>I know there are things related to viewport declarations concerning certain browsers. But It seems they are old things, and what about the other browsers nowadays?</p>
<pre><code><meta name="viewport" content="width=device-width, initial-scale=1">
</code></pre>
| 0debug |
Can I check if Environment variable exist or not in Jenkinsfile : <p>I am running Multibranch pipeline for my project.</p>
<p>The behaviour of Jenkinsfile should change according to the trigger.
There are two events that triggeres the pipeline 1. Push event 2. Pull Request.</p>
<p>I am trying to check Environment variable 'CHANGE_ID' ('CHANGE_ID' will be available for Pull Request only).<a href="https://jenkins.io/doc/book/pipeline/multibranch/#additional-environment-variables" rel="noreferrer">Reference</a> .</p>
<p>So if pipeline is triggred by Push event and If check the 'CHANGE_ID' variable it throws exception (code works fine if pipeline gets triggered by Pull Request).</p>
<p><strong>Code:</strong></p>
<pre><code>stage('groovyTest'){
node('mynode1') {
if (CHANGE_ID!=NULL){
echo "This is Pull request"
}else{
echo "This is Push request"
}
}
}
</code></pre>
<p><strong>Error:</strong></p>
<pre><code>groovy.lang.MissingPropertyException: No such property: CHANGE_ID for class: groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:63)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:224)
at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:28)
at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
at WorkflowScript.run(WorkflowScript:5)
at ___cps.transform___(Native Method)
</code></pre>
<p>How can I check the 'CHANGE_ID' variable exist or not in Jenkinsfile?</p>
| 0debug |
static int is_dup_page(uint8_t *page)
{
VECTYPE *p = (VECTYPE *)page;
VECTYPE val = SPLAT(page);
int i;
for (i = 0; i < TARGET_PAGE_SIZE / sizeof(VECTYPE); i++) {
if (!ALL_EQ(val, p[i])) {
return 0;
}
}
return 1;
}
| 1threat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.