problem
stringlengths 26
131k
| labels
class label 2
classes |
|---|---|
static uint8_t eepro100_read1(EEPRO100State * s, uint32_t addr)
{
uint8_t val;
if (addr <= sizeof(s->mem) - sizeof(val)) {
memcpy(&val, &s->mem[addr], sizeof(val));
}
switch (addr) {
case SCBStatus:
case SCBAck:
TRACE(OTHER, logout("addr=%s val=0x%02x\n", regname(addr), val));
break;
case SCBCmd:
TRACE(OTHER, logout("addr=%s val=0x%02x\n", regname(addr), val));
#if 0
val = eepro100_read_command(s);
#endif
break;
case SCBIntmask:
TRACE(OTHER, logout("addr=%s val=0x%02x\n", regname(addr), val));
break;
case SCBPort + 3:
TRACE(OTHER, logout("addr=%s val=0x%02x\n", regname(addr), val));
break;
case SCBeeprom:
val = eepro100_read_eeprom(s);
break;
case SCBpmdr:
val = 0;
TRACE(OTHER, logout("addr=%s val=0x%02x\n", regname(addr), val));
break;
case SCBgstat:
val = 0x07;
TRACE(OTHER, logout("addr=General Status val=%02x\n", val));
break;
default:
logout("addr=%s val=0x%02x\n", regname(addr), val);
missing("unknown byte read");
}
return val;
}
| 1threat
|
static int alsa_run_in (HWVoiceIn *hw)
{
ALSAVoiceIn *alsa = (ALSAVoiceIn *) hw;
int hwshift = hw->info.shift;
int i;
int live = audio_pcm_hw_get_live_in (hw);
int dead = hw->samples - live;
int decr;
struct {
int add;
int len;
} bufs[2] = {
{ hw->wpos, 0 },
{ 0, 0 }
};
snd_pcm_sframes_t avail;
snd_pcm_uframes_t read_samples = 0;
if (!dead) {
return 0;
}
avail = alsa_get_avail (alsa->handle);
if (avail < 0) {
dolog ("Could not get number of captured frames\n");
return 0;
}
if (!avail && (snd_pcm_state (alsa->handle) == SND_PCM_STATE_PREPARED)) {
avail = hw->samples;
}
decr = audio_MIN (dead, avail);
if (!decr) {
return 0;
}
if (hw->wpos + decr > hw->samples) {
bufs[0].len = (hw->samples - hw->wpos);
bufs[1].len = (decr - (hw->samples - hw->wpos));
}
else {
bufs[0].len = decr;
}
for (i = 0; i < 2; ++i) {
void *src;
st_sample_t *dst;
snd_pcm_sframes_t nread;
snd_pcm_uframes_t len;
len = bufs[i].len;
src = advance (alsa->pcm_buf, bufs[i].add << hwshift);
dst = hw->conv_buf + bufs[i].add;
while (len) {
nread = snd_pcm_readi (alsa->handle, src, len);
if (nread <= 0) {
switch (nread) {
case 0:
if (conf.verbose) {
dolog ("Failed to read %ld frames (read zero)\n", len);
}
goto exit;
case -EPIPE:
if (alsa_recover (alsa->handle)) {
alsa_logerr (nread, "Failed to read %ld frames\n", len);
goto exit;
}
if (conf.verbose) {
dolog ("Recovering from capture xrun\n");
}
continue;
case -EAGAIN:
goto exit;
default:
alsa_logerr (
nread,
"Failed to read %ld frames from %p\n",
len,
src
);
goto exit;
}
}
hw->conv (dst, src, nread, &nominal_volume);
src = advance (src, nread << hwshift);
dst += nread;
read_samples += nread;
len -= nread;
}
}
exit:
hw->wpos = (hw->wpos + read_samples) % hw->samples;
return read_samples;
}
| 1threat
|
static int xen_9pfs_free(struct XenDevice *xendev)
{
return -1;
}
| 1threat
|
PDO equivalents of old mysql functions like fetch assoc : <p>I have some old code I want to be able to begin using again but it's in mysql and I'm not sure how to change the equivalent of this into PDO.</p>
<pre><code>if(mysql_num_rows($result) > 0) {
while($row = mysql_fetch_assoc($result)) {
trackstart($row['ID']);
}
}
</code></pre>
<p>How can I reach the same outcome with PDO? Or use while row = result for that matter</p>
| 0debug
|
Angular2 Routing redirect with routeParams : <p>Is there a way to access the routerParams in the redirecTo-Statement?</p>
<p>I want to pass the orderId of the 'Order' route to the 'OrderDashboard' route but I can't figure out what to write instead of <code>???</code></p>
<p>If I replace <code>???</code> with <code>3</code> all works fine (in case the user only is intrested in order number 3 ;-) )</p>
<p><code>{path: '/:orderId', name: 'Order', redirectTo: ['OrderDashboard', {orderId:???}]}
{path: '/:orderId/dashboard', name: 'OrderDashboard'}</code></p>
| 0debug
|
Cant run liquibase with command line : <p>I want to use liquibase but when I want to let it run with command line this happens:</p>
<pre><code>PS C:\Users\Ferid\Downloads\liquibase-3.6.0-bin> .\liquibase
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/filter/Filter
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetMethodRecursive(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.filter.Filter
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
</code></pre>
<p>I have tried liquibase-3.6.1 and now liquibase-3.6.0</p>
| 0debug
|
Hightlight the words present in only particular div class if any word is present in array using javascript : Hi friends am trying to highlight the words in a particular div class if any word is present in array
example
var cars = ["hello", "when", "why"];
<p class="highlighed">How are you when</p>
<p>How are you</p>
I want to highlight only words present in highlighted if any word is present in array can anyone please help me
| 0debug
|
import re
def match(text):
pattern = '[A-Z]+[a-z]+$'
if re.search(pattern, text):
return('Yes')
else:
return('No')
| 0debug
|
Is it good learning rate for Adam method? : <p>I am training my method. I got the result as below. Is it a good learning rate? If not, is it high or low?
This is my result</p>
<p><a href="https://i.stack.imgur.com/ihfKv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ihfKv.png" alt="enter image description here"></a></p>
<pre><code>lr_policy: "step"
gamma: 0.1
stepsize: 10000
power: 0.75
# lr for unnormalized softmax
base_lr: 0.001
# high momentum
momentum: 0.99
# no gradient accumulation
iter_size: 1
max_iter: 100000
weight_decay: 0.0005
snapshot: 4000
snapshot_prefix: "snapshot/train"
type:"Adam"
</code></pre>
<p>This is reference</p>
<blockquote>
<blockquote>
<p>With low learning rates the improvements will be linear. With high learning rates they will start to look more exponential. Higher learning rates will decay the loss faster, but they get stuck at worse values of loss
<a href="https://i.stack.imgur.com/iMASu.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/iMASu.jpg" alt="enter image description here"></a></p>
</blockquote>
</blockquote>
| 0debug
|
static inline int ucf64_exceptbits_from_host(int host_bits)
{
int target_bits = 0;
if (host_bits & float_flag_invalid) {
target_bits |= UCF64_FPSCR_FLAG_INVALID;
}
if (host_bits & float_flag_divbyzero) {
target_bits |= UCF64_FPSCR_FLAG_DIVZERO;
}
if (host_bits & float_flag_overflow) {
target_bits |= UCF64_FPSCR_FLAG_OVERFLOW;
}
if (host_bits & float_flag_underflow) {
target_bits |= UCF64_FPSCR_FLAG_UNDERFLOW;
}
if (host_bits & float_flag_inexact) {
target_bits |= UCF64_FPSCR_FLAG_INEXACT;
}
return target_bits;
}
| 1threat
|
What's the prob with it? : I am getting error "use of unassigned variable ch" at while(ch != 'n').
I am using visual studio 2015
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
char ch;
do
{
Console.WriteLine("Enter any number");
int i = Convert.ToInt32(Console.ReadLine());
for (int j = 1; j <= 200; j++)
{
int c = i * j;
Console.Write(" " + c);
if (j % 10 == 0)
{
Console.WriteLine();
}
Console.WriteLine("again? " + "(y//n)");
ch = Convert.ToChar(Console.ReadLine());
if (ch == 'y' || ch == 'n')
continue;
else
{
Console.WriteLine("invalid choice");
break;
}
}
}while (ch != 'n');
}
}
}
| 0debug
|
MS SQL SERVER - DEPARTMENT WISE SALARY WITHOUT USING GROUP BY : CREATE TABLE #Dept
(
DeptName VARCHAR(30),
Salary INT
)
INSERT INTO #Dept VALUES ('A',100),('A',90),('A',80),('A',70),('A',60),('B',80),('B',20),('B',40)
EXPECTED OUTPUT:
DeptName Salary
A 400
B 140
| 0debug
|
Lombok causing "Actual and formal arguments lists differ in length error" : <p>I have the following class:</p>
<pre><code>@Builder @NoArgsConstructor
public class ConsultationPointOfContact {
private String fullName;
private String phoneNumber;
private String userLogin;
}
</code></pre>
<p>When the <code>@Builder</code> annotation exists, it is causing problems with the <code>@NoArgsConstructor</code>.</p>
<p>I am getting the error:</p>
<pre><code>Error:(11, 1) java: constructor ConsultationPointOfContact in class models.ConsultationPointOfContact cannot be applied to given types;
required: no arguments
found: java.lang.String,java.lang.String,java.lang.String
reason: actual and formal argument lists differ in length
</code></pre>
| 0debug
|
int cpu_m68k_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
int mmu_idx, int is_softmmu)
{
int prot;
address &= TARGET_PAGE_MASK;
prot = PAGE_READ | PAGE_WRITE;
return tlb_set_page(env, address, address, prot, mmu_idx, is_softmmu);
}
| 1threat
|
static inline int RENAME(yuv420_rgb16)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
int y, h_size;
if(c->srcFormat == PIX_FMT_YUV422P){
srcStride[1] *= 2;
srcStride[2] *= 2;
}
h_size= (c->dstW+7)&~7;
if(h_size*2 > dstStride[0]) h_size-=8;
__asm__ __volatile__ ("pxor %mm4, %mm4;" );
for (y= 0; y<srcSliceH; y++ ) {
uint8_t *_image = dst[0] + (y+srcSliceY)*dstStride[0];
uint8_t *_py = src[0] + y*srcStride[0];
uint8_t *_pu = src[1] + (y>>1)*srcStride[1];
uint8_t *_pv = src[2] + (y>>1)*srcStride[2];
long index= -h_size/2;
b5Dither= dither8[y&1];
g6Dither= dither4[y&1];
g5Dither= dither8[y&1];
r5Dither= dither8[(y+1)&1];
__asm__ __volatile__ (
"movd (%2, %0), %%mm0;"
"movd (%3, %0), %%mm1;"
"movq (%5, %0, 2), %%mm6;"
"1: \n\t"
YUV2RGB
#ifdef DITHER1XBPP
"paddusb "MANGLE(b5Dither)", %%mm0;"
"paddusb "MANGLE(g6Dither)", %%mm2;"
"paddusb "MANGLE(r5Dither)", %%mm1;"
#endif
"pand "MANGLE(mmx_redmask)", %%mm0;"
"pand "MANGLE(mmx_grnmask)", %%mm2;"
"pand "MANGLE(mmx_redmask)", %%mm1;"
"psrlw $3,%%mm0;"
"pxor %%mm4, %%mm4;"
"movq %%mm0, %%mm5;"
"movq %%mm2, %%mm7;"
"punpcklbw %%mm4, %%mm2;"
"punpcklbw %%mm1, %%mm0;"
"psllw $3, %%mm2;"
"por %%mm2, %%mm0;"
"movq 8 (%5, %0, 2), %%mm6;"
MOVNTQ " %%mm0, (%1);"
"punpckhbw %%mm4, %%mm7;"
"punpckhbw %%mm1, %%mm5;"
"psllw $3, %%mm7;"
"movd 4 (%2, %0), %%mm0;"
"por %%mm7, %%mm5;"
"movd 4 (%3, %0), %%mm1;"
MOVNTQ " %%mm5, 8 (%1);"
"add $16, %1 \n\t"
"add $4, %0 \n\t"
" js 1b \n\t"
: "+r" (index), "+r" (_image)
: "r" (_pu - index), "r" (_pv - index), "r"(&c->redDither), "r" (_py - 2*index)
);
}
__asm__ __volatile__ (EMMS);
return srcSliceH;
}
| 1threat
|
Check if Logged in - React Router App ES6 : <p>I am writing a <strong>React</strong>.js application (v15.3) using <strong>react-router</strong> (v2.8.1) and <strong>ES6 syntax</strong>. I cannot get the router code to intercept all transitions between pages to check if the user needs to login first.</p>
<p>My top level render method is very simple (the app is trivial as well):</p>
<pre><code> render()
{
return (
<Router history={hashHistory}>
<Route path="/" component={AppMain}>
<Route path="login" component={Login}/>
<Route path="logout" component={Logout}/>
<Route path="subject" component={SubjectPanel}/>
<Route path="all" component={NotesPanel}/>
</Route>
</Router>
);
}
</code></pre>
<p>All the samples on the web use ES5 code or older versions of react-router (older than version 2), and my various attempts with mixins (deprecated) and willTransitionTo (never gets called) have failed.</p>
<p>How can I set up a global 'interceptor function' to force users to authenticate before landing on the page they request?</p>
| 0debug
|
How to restore state in an event based, message driven microservice architecture on failure scenario : <p>In the context of a microservice architecture, a message driven, asynchronous, event based design seems to be gaining popularity (see <a href="http://blog.christianposta.com/microservices/why-microservices-should-be-event-driven-autonomy-vs-authority/" rel="noreferrer">here</a> and <a href="https://www.nginx.com/blog/event-driven-data-management-microservices/" rel="noreferrer">here</a> for some examples, as well as the <a href="http://www.reactivemanifesto.org/#message-driven" rel="noreferrer">Reactive Manifesto - Message Driven trait</a>) as opposed to a synchronous (possibly REST based) mechanism.</p>
<p>Taking that context and imagining an overly simplified ordering system, as depicted below:</p>
<p><a href="https://i.stack.imgur.com/Xtttg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Xtttg.png" alt="ordering system"></a></p>
<p>and the following message flow:</p>
<ul>
<li>Order is placed from some source (web/mobile etc.)</li>
<li>Order service accepts order and publishes a <code>CreateOrderEvent</code></li>
<li>The InventoryService reacts on the <code>CreateOrderEvent</code>, does some inventory stuff and publishes a <code>InventoryUpdatedEvent</code> when it's done</li>
<li>The Invoice service then reacts to the <code>InventoryUpdatedEvent</code>, sends an invoice and publishes a <code>EmailInvoiceEvent</code></li>
</ul>
<p>All services are up and we happily process orders... Everyone is happy.
Then, the Inventory service goes down for some reason 😬</p>
<p>Assuming that the events on the event bus are flowing in a "non blocking" manor. I.e. the messages are being published to a central topic and do not pile up on a queue if no service is reading from it (what I'm trying to convey is an event bus where, if the event is published on the bus, it would flow "straight through" and not queue up - ignore what messaging platform/technology is used at this point). That would mean that if the Inventory service were down for 5 minutes, the <code>CreateOrderEvent</code>'s passing through the event bus during that time are now "gone" or not seen by the Inventory service because in our overly simplified system, no other system is interested in those events.</p>
<p>My question then is: How does the Inventory service (and the system as a whole) restore state in a way that no orders are missed/not processed?</p>
| 0debug
|
am i using @font face incorrectly? : <p>can anyone tell me why i cant seem to get a font to work on my site</p>
<p>css</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>@fontface {
font-family: Summer;
src: url(/font/CodePredators-Regular.ttf);
}
p {
color: #000000;
font-size: 1em;
font-family: Summer, Tahoma, "Tungsten Bold", Arial, sans-serif;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code><p>this is a test</p> </code></pre>
</div>
</div>
</p>
<p>ive actually tried a couple other "methods" but nothing seems to work
ive even tried to upload the font into the root folder in an attempt to make the url path easier</p>
<p>nothing gives</p>
<p>maybe if i see some different code it will help</p>
| 0debug
|
How to push print to bluetooth thermal printer from android webview? : <p>We configured Odoo POS application in a cloud server and from the desktop, if we click print receipt it will automatically pop up the print dialogue in chrome and can print from the connected device! The same application we developed in android simply putting in <code>webView</code>! </p>
<p>Now I need to print this using connected Bluetooth thermal printer paired to the Android device! I searched a lot but still didn't get any solution! ANy links or suggestions will be great help</p>
| 0debug
|
check current url PHP : How I can identify in PHP if my current URL contain this text **special_offer=12**.
for example if my domain URL is http://www.example.com/newproducts.html?special_offer=12 then echo something;
or the domain can be http://example.com/all-products.html?cat=93&special_offer=12
Always this text will be same "special_offer=12"
thank you
| 0debug
|
how to create an instance of "Serialization" without the implementaiton class on the classpath? : I'm writing a tool that need to get an instance of `java.io.Serializable` from a byte array.
The difficulty is that the "real" class is not (and cannot be...) on the classpath (I will not explain why here..).
The code below fails on `is.readObject()` with a `ClassNotFoundException` because the implementation class is not on the classpath
Q:
Is is possible to achieve this? by reflection? by using `Unsafe`? by using a sub class of `ClassLoader`? or...?
byte[] data = ...
try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));) {
Object o = ois.readObject();
Serializable s = (Serializable)o;
}
| 0debug
|
Ionic Android build: java.lang.IllegalStateException: buildToolsVersion is not specified : <p>Since today, somehow my ionic project is not longer able to build for some reason. I already tried to remove the platform and add it again, but it didn't work. I now almost spent three ours with upgrading, downgrading and reinstalling cordova and ionic but for some reason I always get the following error when I try to build the Android version: </p>
<pre><code>Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configuration failure takes precedence.
java.lang.IllegalStateException: buildToolsVersion is not specified.
at com.google.common.base.Preconditions.checkState(Preconditions.java:176)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:599)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:566)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:563)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:562)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:559)
at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:109)
at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:98)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:79)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:65)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:504)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:83)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:129)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:47)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:46)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
FAILURE: Build failed with an exception.
</code></pre>
<p>I already tried to set the buildToolsVersion in the config.xml but without any success. Did anyone have the same problem before?</p>
| 0debug
|
static int coroutine_fn bdrv_co_do_copy_on_readv(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, QEMUIOVector *qiov)
{
void *bounce_buffer;
BlockDriver *drv = bs->drv;
struct iovec iov;
QEMUIOVector bounce_qiov;
int64_t cluster_sector_num;
int cluster_nb_sectors;
size_t skip_bytes;
int ret;
bdrv_round_to_clusters(bs, sector_num, nb_sectors,
&cluster_sector_num, &cluster_nb_sectors);
trace_bdrv_co_do_copy_on_readv(bs, sector_num, nb_sectors,
cluster_sector_num, cluster_nb_sectors);
iov.iov_len = cluster_nb_sectors * BDRV_SECTOR_SIZE;
iov.iov_base = bounce_buffer = qemu_blockalign(bs, iov.iov_len);
qemu_iovec_init_external(&bounce_qiov, &iov, 1);
ret = drv->bdrv_co_readv(bs, cluster_sector_num, cluster_nb_sectors,
&bounce_qiov);
if (ret < 0) {
goto err;
}
if (drv->bdrv_co_write_zeroes &&
buffer_is_zero(bounce_buffer, iov.iov_len)) {
ret = bdrv_co_do_write_zeroes(bs, cluster_sector_num,
cluster_nb_sectors, 0);
} else {
ret = drv->bdrv_co_writev(bs, cluster_sector_num, cluster_nb_sectors,
&bounce_qiov);
}
if (ret < 0) {
goto err;
}
skip_bytes = (sector_num - cluster_sector_num) * BDRV_SECTOR_SIZE;
qemu_iovec_from_buf(qiov, 0, bounce_buffer + skip_bytes,
nb_sectors * BDRV_SECTOR_SIZE);
err:
qemu_vfree(bounce_buffer);
return ret;
}
| 1threat
|
static int gen_set_psr(DisasContext *s, uint32_t mask, int spsr, TCGv t0)
{
TCGv tmp;
if (spsr) {
if (IS_USER(s))
return 1;
tmp = load_cpu_field(spsr);
tcg_gen_andi_i32(tmp, tmp, ~mask);
tcg_gen_andi_i32(t0, t0, mask);
tcg_gen_or_i32(tmp, tmp, t0);
store_cpu_field(tmp, spsr);
} else {
gen_set_cpsr(t0, mask);
}
dead_tmp(t0);
gen_lookup_tb(s);
return 0;
}
| 1threat
|
Separate C# Project for Reporting - Best Practice? : <p>I have a few reports in an MVC C# Web project and they work fine. But I noticed that on the live site people tend to select large report date ranges and other search criteria which would return a fairly large data set.</p>
<p>As the whole site is on one IIS site in one project, this causes the rest of the site to hang until the report has finished execution.</p>
<p>I'm just wondering whats the best practice to handle this scenario?</p>
<p>Is it to move the reports to their own project with their own IIS site and somehow point to it from my main site?</p>
<p>Is it to make the reports async?</p>
<p>I could use view/stored procedures but I wanted to stay away from them.</p>
| 0debug
|
void kvm_remove_all_breakpoints(CPUState *cpu)
{
struct kvm_sw_breakpoint *bp, *next;
KVMState *s = cpu->kvm_state;
QTAILQ_FOREACH_SAFE(bp, &s->kvm_sw_breakpoints, entry, next) {
if (kvm_arch_remove_sw_breakpoint(cpu, bp) != 0) {
CPU_FOREACH(cpu) {
if (kvm_arch_remove_sw_breakpoint(cpu, bp) == 0) {
break;
}
}
}
QTAILQ_REMOVE(&s->kvm_sw_breakpoints, bp, entry);
g_free(bp);
}
kvm_arch_remove_all_hw_breakpoints();
CPU_FOREACH(cpu) {
kvm_update_guest_debug(cpu, 0);
}
}
| 1threat
|
void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list)
{
RAMBlock *block;
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
create_new_memory_mapping(list, block->offset, 0, block->length);
}
}
| 1threat
|
Argument error, options.body in node.js? : <p>what is the problem i don't know please help to solve this. when i post data then below error shows on terminal. Attach is the code also.</p>
<pre><code>Error: Argument error, options.body.
at Request.init (/usr/lib/nodejs/request/index.js:351:13)
at new Request (/usr/lib/nodejs/request/index.js:124:8)
at Object.request (/usr/lib/nodejs/request/index.js:1279:11)
at Request._callback (/var/www/html/nodeproject/helloworld/controllers/login.js:68:11)
at Request.self.callback (/usr/lib/nodejs/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:98:17)
at Request.<anonymous> (/usr/lib/nodejs/request/index.js:896:14)
at Request.EventEmitter.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/index.js:847:12)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
</code></pre>
<p>below is my code here am posting data using json.</p>
<pre><code>module.exports.controller = function(BASE) {
var token_array = new Array();
BASE.APP.get('/login', function(req, res)
{
res.render('pages/login');
//res.sendFile(__dirname + '/login.html');
});
BASE.APP.post("/login", BASE.urlEncodedParser, function(req, response)
{
var devicetoken = req.usersession.devicetoken;
var body = req.body;
req.usersession.username = body.username;
console.log(req.body);
var userData={
"deviceToken" : devicetoken,
"password" : body.pwd,
"username" : body.username
};
var digest = BASE.utils.hmac("sha1", "A12AA418-1F28-4464-8B67-29CBD02BC45C-F048B14F-F3E3-4F97-A522-F2275A364A0E", JSON.stringify(userData));
var postData = {
"deviceToken" : devicetoken,
"password" : body.pwd,
"username" : body.username,
"digest" : digest
};
var sPostData = BASE.utils.base64encode(BASE.utils.base64encode(JSON.stringify(postData)));
BASE.request({
url: "http://example.com/authenticate/",
method: "POST",
headers: {
"content-type": "application/json",
},
body: sPostData
},
function(err,result,body){
//console.log(JSON.stringify(postData));
var body = JSON.parse(body);
req.usersession.token = body.token;
/*********************************has login permission***************************************/
var loginData={
"permission" : '08008749-F3A5-480B-A2B2-C21CEFED70F4',
"token" : req.usersession.token
};
var logindigest = BASE.utils.hmac("sha1", "A12AA418-1F28-4464-8B67-29CBD02BC45C-F048B14F-F3E3-4F97-A522-F2275A364A0E", JSON.stringify(loginData));
var loginpostData = {
"permission" : '08008749-F3A5-480B-A2B2-C21CEFED70F4',
"token" : req.usersession.token,
"digest" : logindigest
};
BASE.request({
url : "http://example.com/hasPermission/",
method :"POST",
headers : {
"content-type": "application/json",
},
body :loginpostData
},
function (err,result1,body) {
console.log(body);
});
//response.redirect(301, '/contacts');
});
});
}
</code></pre>
<p>i am using same type code of another file what it should not give any error but this file show me </p>
| 0debug
|
Identify alternating Uppercase and lower case characters in python : <p>I am having data as follows,</p>
<pre><code>data['word']
1 Word1
2 WoRdqwertf point
3 lengthy word
4 AbCdEasc
5 Not to be filtered
6 GiBeRrIsH
7 zSxDcFvGnnn
</code></pre>
<p>I want to find out alternating capital and small letters in the string and remove those rows containing words like these. For ex., if we see here, <code>WoRdqwertf , AbCdEasc, GiBeRrIsH,zSxDcFvGnnn</code> has alternating characters and I need these to be removed.</p>
<p>The point here is, the first row which contains <code>Word1</code> shouldn't be removed because it has only one caps followed by one small. I want to remove the rows only when it has a caps, small, caps arrangement or small, caps, small arrangement. My output here should be,</p>
<pre><code>data['word']
1 Word1
3 lengthy word
5 Not to be filtered
</code></pre>
<p>Can any body help me or give some idea how to approach this problem?</p>
| 0debug
|
static void slice_thread_park_workers(ThreadContext *c)
{
pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
pthread_mutex_unlock(&c->current_job_lock);
}
| 1threat
|
Excel VBA add a value to column : im really new in excel vba programming and i have got a question.
I've got a excel table that looks like this:
t t1 t2
1 4 5
2 3 6
3 5 8
How can i skip the first row with the header (t,t1,t2) and then add the number 3 to the values in every row?
Thank you for your help!
| 0debug
|
static int check_directory_consistency(BDRVVVFATState *s,
int cluster_num, const char* path)
{
int ret = 0;
unsigned char* cluster = g_malloc(s->cluster_size);
direntry_t* direntries = (direntry_t*)cluster;
mapping_t* mapping = find_mapping_for_cluster(s, cluster_num);
long_file_name lfn;
int path_len = strlen(path);
char path2[PATH_MAX];
assert(path_len < PATH_MAX);
pstrcpy(path2, sizeof(path2), path);
path2[path_len] = '/';
path2[path_len + 1] = '\0';
if (mapping) {
const char* basename = get_basename(mapping->path);
const char* basename2 = get_basename(path);
assert(mapping->mode & MODE_DIRECTORY);
assert(mapping->mode & MODE_DELETED);
mapping->mode &= ~MODE_DELETED;
if (strcmp(basename, basename2))
schedule_rename(s, cluster_num, g_strdup(path));
} else
schedule_mkdir(s, cluster_num, g_strdup(path));
lfn_init(&lfn);
do {
int i;
int subret = 0;
ret++;
if (s->used_clusters[cluster_num] & USED_ANY) {
fprintf(stderr, "cluster %d used more than once\n", (int)cluster_num);
return 0;
}
s->used_clusters[cluster_num] = USED_DIRECTORY;
DLOG(fprintf(stderr, "read cluster %d (sector %d)\n", (int)cluster_num, (int)cluster2sector(s, cluster_num)));
subret = vvfat_read(s->bs, cluster2sector(s, cluster_num), cluster,
s->sectors_per_cluster);
if (subret) {
fprintf(stderr, "Error fetching direntries\n");
fail:
free(cluster);
return 0;
}
for (i = 0; i < 0x10 * s->sectors_per_cluster; i++) {
int cluster_count = 0;
DLOG(fprintf(stderr, "check direntry %d: \n", i); print_direntry(direntries + i));
if (is_volume_label(direntries + i) || is_dot(direntries + i) ||
is_free(direntries + i))
continue;
subret = parse_long_name(&lfn, direntries + i);
if (subret < 0) {
fprintf(stderr, "Error in long name\n");
goto fail;
}
if (subret == 0 || is_free(direntries + i))
continue;
if (fat_chksum(direntries+i) != lfn.checksum) {
subret = parse_short_name(s, &lfn, direntries + i);
if (subret < 0) {
fprintf(stderr, "Error in short name (%d)\n", subret);
goto fail;
}
if (subret > 0 || !strcmp((char*)lfn.name, ".")
|| !strcmp((char*)lfn.name, ".."))
continue;
}
lfn.checksum = 0x100;
if (path_len + 1 + lfn.len >= PATH_MAX) {
fprintf(stderr, "Name too long: %s/%s\n", path, lfn.name);
goto fail;
}
pstrcpy(path2 + path_len + 1, sizeof(path2) - path_len - 1,
(char*)lfn.name);
if (is_directory(direntries + i)) {
if (begin_of_direntry(direntries + i) == 0) {
DLOG(fprintf(stderr, "invalid begin for directory: %s\n", path2); print_direntry(direntries + i));
goto fail;
}
cluster_count = check_directory_consistency(s,
begin_of_direntry(direntries + i), path2);
if (cluster_count == 0) {
DLOG(fprintf(stderr, "problem in directory %s:\n", path2); print_direntry(direntries + i));
goto fail;
}
} else if (is_file(direntries + i)) {
cluster_count = get_cluster_count_for_direntry(s, direntries + i, path2);
if (cluster_count !=
(le32_to_cpu(direntries[i].size) + s->cluster_size
- 1) / s->cluster_size) {
DLOG(fprintf(stderr, "Cluster count mismatch\n"));
goto fail;
}
} else
abort();
ret += cluster_count;
}
cluster_num = modified_fat_get(s, cluster_num);
} while(!fat_eof(s, cluster_num));
free(cluster);
return ret;
}
| 1threat
|
Regex, match when there is dash with spaces before and after : Hy guys. I would need a help with writting a regex.
I need it to match only when there is a dash detected with spaces before and after. For example:
"first - place"
I would also need an separate example when there is dash detected with just one space and no space after, for example:
"first -place"
| 0debug
|
static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, int is4tap)
{
LOAD_PIXELS
int a, f1, f2;
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
a = 3*(q0 - p0);
if (is4tap)
a += clip_int8(p1 - q1);
a = clip_int8(a);
f1 = FFMIN(a+4, 127) >> 3;
f2 = FFMIN(a+3, 127) >> 3;
p[-1*stride] = cm[p0 + f2];
p[ 0*stride] = cm[q0 - f1];
if (!is4tap) {
a = (f1+1)>>1;
p[-2*stride] = cm[p1 + a];
p[ 1*stride] = cm[q1 - a];
}
}
| 1threat
|
static void tss_load_seg(CPUX86State *env, int seg_reg, int selector)
{
uint32_t e1, e2;
int rpl, dpl, cpl;
if ((selector & 0xfffc) != 0) {
if (load_segment(env, &e1, &e2, selector) != 0) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
if (!(e2 & DESC_S_MASK)) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
rpl = selector & 3;
dpl = (e2 >> DESC_DPL_SHIFT) & 3;
cpl = env->hflags & HF_CPL_MASK;
if (seg_reg == R_CS) {
if (!(e2 & DESC_CS_MASK)) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
if (dpl != rpl) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
if ((e2 & DESC_C_MASK) && dpl > rpl) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
} else if (seg_reg == R_SS) {
if ((e2 & DESC_CS_MASK) || !(e2 & DESC_W_MASK)) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
if (dpl != cpl || dpl != rpl) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
} else {
if ((e2 & DESC_CS_MASK) && !(e2 & DESC_R_MASK)) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
if (((e2 >> DESC_TYPE_SHIFT) & 0xf) < 12) {
if (dpl < cpl || dpl < rpl) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
}
}
if (!(e2 & DESC_P_MASK)) {
raise_exception_err(env, EXCP0B_NOSEG, selector & 0xfffc);
}
cpu_x86_load_seg_cache(env, seg_reg, selector,
get_seg_base(e1, e2),
get_seg_limit(e1, e2),
e2);
} else {
if (seg_reg == R_SS || seg_reg == R_CS) {
raise_exception_err(env, EXCP0A_TSS, selector & 0xfffc);
}
}
}
| 1threat
|
Run a form from a project to another project : I have 2 projects, User and Driver side. I have a hard time figuring out what type of connection or code, should I do in order to pop out the the needed for from User side whenever i click the Accept request.
The logic will be if i click the accept request button the form in the UserSide should pop out and run in the user side and send the information of the driver who clicked the accept request.
Hope you can help me.. I badly need this for my re-defense
Thank You...
private void _btnAccept_Click(object sender, EventArgs e)
{
LogInForm._pnlUserOntrip _pnl = new LogInForm._pnlUserOntrip();
_pnl.Show();
//System.Diagnostics.Process.Start(Application.StartupPath.ToString() + @"\_pnlUserOnTrip.exe");
LogInForm.LoadingScreen _load = new LogInForm.LoadingScreen();
_load.Hide();
}
}
| 0debug
|
void migrate_decompress_threads_create(void)
{
int i, thread_count;
thread_count = migrate_decompress_threads();
decompress_threads = g_new0(QemuThread, thread_count);
decomp_param = g_new0(DecompressParam, thread_count);
quit_decomp_thread = false;
qemu_mutex_init(&decomp_done_lock);
qemu_cond_init(&decomp_done_cond);
for (i = 0; i < thread_count; i++) {
qemu_mutex_init(&decomp_param[i].mutex);
qemu_cond_init(&decomp_param[i].cond);
decomp_param[i].compbuf = g_malloc0(compressBound(TARGET_PAGE_SIZE));
decomp_param[i].done = true;
qemu_thread_create(decompress_threads + i, "decompress",
do_data_decompress, decomp_param + i,
QEMU_THREAD_JOINABLE);
}
}
| 1threat
|
CS50 Credit Bug : I am working on the credit problem of CS50. However, I am only printing INVALID no matter what card number I put in. May I ask what is the problem with my code? It seems that there is something wrong with the part to calculate the total sum.
#include <cs50.h>
#include <stdio.h>
#include <math.h>
int main(void)
{
// Get the card number
long num;
do
{
num = get_long("What is the card number?\n");
} while (num < 0);
long sum = 0, sum2 = 0, count = 0;
//Get the sum
for (long i = num; i > 0; i = i / 10)
{
sum += i % 10;
count++;
}
for (long i = num / 10; i > 0; i = i / 100)
{
sum2 += i % 10;
}
if ((sum + sum2) % 10 != 0)
{
printf("INVALID");
}
else
{
long digits = num / (10 * (count - 2));
if (count == 15 &&
(digits == 34 || digits == 37))
{
printf("AMERICAN EXPRESS");
}
else if (count == 16 && 51 <= digits <=55)
{
printf("MASTERCARD");
}
else if ((count == 16 || count == 13) && (digits / 10) == 4)
{
printf("VISA");
}
else
{
printf("INVALID");
}
}
}
| 0debug
|
What should I do to make low loss average? : I'm an student in hydraulic engineering, working on a neural network in my internship so it's something new for me.
I created my neural network but it gives me a high loss and I don't know what is the problem ... you can see the code :
def create_model():
model = Sequential()
# Adding the input layer
model.add(Dense(26,activation='relu',input_shape=(n_cols,)))
# Adding the hidden layer
model.add(Dense(60,activation='relu'))
model.add(Dense(60,activation='relu'))
model.add(Dense(60,activation='relu'))
# Adding the output layer
model.add(Dense(2))
# Compiling the RNN
model.compile(optimizer='adam', loss='mean_squared_error', metrics=['accuracy'])
return model
kf = KFold(n_splits = 5, shuffle = True)
model = create_model()
scores = []
for i in range(5):
result = next(kf.split(data_input), None)
input_train = data_input[result[0]]
input_test = data_input[result[1]]
output_train = data_output[result[0]]
output_test = data_output[result[1]]
# Fitting the RNN to the Training set
model.fit(input_train, output_train, epochs=5000, batch_size=200 ,verbose=2)
predictions = model.predict(input_test)
scores.append(model.evaluate(input_test, output_test))
print('Scores from each Iteration: ', scores)
print('Average K-Fold Score :' , np.mean(scores))
And whene I execute my code, the result is like :
Scores from each Iteration: [[93.90406122928908, 0.8907562990148529], [89.5892979597845, 0.8907563030218878], [81.26530176050522, 0.9327731132507324], [56.46526102659081, 0.9495798339362905], [54.314151876112994, 0.9579831877676379]]
Average K-Fold Score : 38.0159922589274
Can anyone help me please ? how could I do to make the loss low ?
| 0debug
|
'adb' is not recognized as internal or external command : <p>When trying to build a react native project I'm getting this error on the command <code>react-native run-android</code>. But when I searched this ,found a solution that to set the <code>system_variables</code> but after trying it I'm still getting the same error I can't do further because of this error.Please help me to figure this out.</p>
<p><a href="https://i.stack.imgur.com/vGXUU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vGXUU.png" alt="adb command error"></a></p>
| 0debug
|
static uint64_t bonito_cop_readl(void *opaque, target_phys_addr_t addr,
unsigned size)
{
uint32_t val;
PCIBonitoState *s = opaque;
val = ((uint32_t *)(&s->boncop))[addr/sizeof(uint32_t)];
return val;
}
| 1threat
|
notepad++ syntax highlighter - What does TreatAsSymbol mean? : I'm trying to make a Notepad++ Syntax Highlighter --> Ace Editor Syntax Highlighter converter. It seems pretty simple to do and hopefully will help others out also.
Im just looking through the syntax highlighter xml at the moment and I can't figure out what the attributes of`NodepadPlus.UserLang.Settings.TreatAsSumbol` do...? In most syntax highlighters I have seen `comment="no"` and `commentLine="yes"`. But does anyone know what these settings actually do?
| 0debug
|
How to pragmatically access the device is rooted to implement auto install the local apk file using android java code? : I have written code to download and open the installation screen where if user can allow to install it install but i required auto install the app.So if anyone have any trick to implement auto install the local apk file using java code please share.
| 0debug
|
iOS 11. What the KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED is mean? : <p>In the new iOS11, I get some strange exceptions. I do not understand why this is happening. In the previous iOS, there was no such exception. Log attached:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x180a5e7e8 object_isClass + 16
1 Foundation 0x181f013e8 KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 68
2 Foundation 0x181eff8ec NSKeyValueWillChangeWithPerThreadPendingNotifications + 300
3 QuartzCore 0x18555a6dc CAAnimation_setter(CAAnimation*, unsigned int, _CAValueType, void const*) + 156
4 QuartzCore 0x18555d388 -[CAPropertyAnimation setKeyPath:] + 32
5 UIKit 0x18a9b1a08 -[UIImageView startAnimating] + 876
6 UIKit 0x18a9b0e78 -[UIActivityIndicatorView startAnimating] + 48
7 UIKit 0x18a9b0174 -[UIActivityIndicatorView _didMoveFromWindow:toWindow:] + 212
8 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
9 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
10 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
11 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
12 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
13 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
14 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
15 UIKit 0x18a95845c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 712
16 UIKit 0x18a957918 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 156
17 Foundation 0x181e7c59c -[NSISEngine withBehaviors:performModifications:] + 168
18 UIKit 0x18a95778c -[UIView(Hierarchy) _postMovedFromSuperview:] + 824
19 UIKit 0x18a96339c -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1728
20 UIKit 0x18abb3158 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke_2 + 1660
21 UIKit 0x18a969a84 +[UIView(Animation) performWithoutAnimation:] + 104
22 UIKit 0x18ab23864 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke + 264
23 UIKit 0x18ac418a4 +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:] + 220
24 UIKit 0x18ab2321c -[_UINavigationParallaxTransition animateTransition:] + 1112
25 UIKit 0x18aae1720 -[UINavigationController _startCustomTransition:] + 3444
26 UIKit 0x18aa02e04 -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
27 UIKit 0x18aa02a34 -[UINavigationController __viewWillLayoutSubviews] + 124
28 UIKit 0x18aa0295c -[UILayoutContainerView layoutSubviews] + 188
29 UIKit 0x18a959000 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1256
30 QuartzCore 0x1855290b4 -[CALayer layoutSublayers] + 184
31 QuartzCore 0x18552d194 CA::Layer::layout_if_needed(CA::Transaction*) + 332
32 QuartzCore 0x18549bf24 CA::Context::commit_transaction(CA::Transaction*) + 336
33 QuartzCore 0x1854c2340 CA::Transaction::commit() + 540
34 QuartzCore 0x1854c3180 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
35 CoreFoundation 0x1814f38b8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
36 CoreFoundation 0x1814f1270 __CFRunLoopDoObservers + 412
37 CoreFoundation 0x1814f182c __CFRunLoopRun + 1292
38 CoreFoundation 0x1814122d8 CFRunLoopRunSpecific + 436
39 GraphicsServices 0x1832a3f84 GSEventRunModal + 100
40 UIKit 0x18a9bf880 UIApplicationMain + 208</code></pre>
</div>
</div>
</p>
<p>Who ever encountered this? What is it and how to defeat it?</p>
| 0debug
|
Compare Two Strings in Excel and Return The Remainder : I would like to subtract certain words from a title and output the remainder. Is there a formula or macro that would accomplish this task?
Thank you for any assistance.
**Main Title:**
Apple Inc Iphone 7 Case
**Subtract These Words:**
Apple Iphone 7
**Ouput Remainder:**
Inc Case
[1]: https://i.stack.imgur.com/Qrfeh.png
| 0debug
|
How to Convert octal to hexadecimal? : <p>How to convert octal numbers to hexadecimal and hexadecimal to octal in C language ?</p>
| 0debug
|
How can I count how many unicode letters there are in an input, and how many special characters? : This is what I have so far:
a=0
b=0
c=0
d=0
e=0
num = input("type something ")
for i in num:
if(i.isupper()):
a=a+1
elif(i.islower()):
b=b+1
elif(i.isdigit()):
c=c+1
print("uppercase letters: ",a)
print("lowercase letters: ",b)
print("numbers: ",c)
print("korean letters: ",d)
As you can see, I want to be able to count how many korean letters there are in the input, like I am with the english letters and numbers. But I have no idea how I should do this, do I have to incorporate ord() somehow?
| 0debug
|
static int nppscale_resize(AVFilterContext *ctx, NPPScaleStageContext *stage,
AVFrame *out, AVFrame *in)
{
NPPScaleContext *s = ctx->priv;
NppStatus err;
int i;
for (i = 0; i < FF_ARRAY_ELEMS(in->data) && in->data[i]; i++) {
int iw = stage->planes_in[i].width;
int ih = stage->planes_in[i].height;
int ow = stage->planes_out[i].width;
int oh = stage->planes_out[i].height;
err = nppiResizeSqrPixel_8u_C1R(in->data[i], (NppiSize){ iw, ih },
in->linesize[i], (NppiRect){ 0, 0, iw, ih },
out->data[i], out->linesize[i],
(NppiRect){ 0, 0, ow, oh },
(double)ow / iw, (double)oh / ih,
0.0, 0.0, s->interp_algo);
if (err != NPP_SUCCESS) {
av_log(ctx, AV_LOG_ERROR, "NPP resize error: %d\n", err);
return AVERROR_UNKNOWN;
}
}
return 0;
}
| 1threat
|
Angular 6: How can we add a function to the global namespace? : <p>My requirement is that I need to add a function to the global namespace in an Angular 6 project. This function should then be able to be called from the browser console.</p>
| 0debug
|
void qmp_nbd_server_add(const char *device, bool has_writable, bool writable,
Error **errp)
{
BlockDriverState *bs;
NBDExport *exp;
NBDCloseNotifier *n;
if (server_fd == -1) {
error_setg(errp, "NBD server not running");
return;
}
if (nbd_export_find(device)) {
error_setg(errp, "NBD server already exporting device '%s'", device);
return;
}
bs = bdrv_find(device);
if (!bs) {
error_set(errp, QERR_DEVICE_NOT_FOUND, device);
return;
}
if (!bdrv_is_inserted(bs)) {
error_set(errp, QERR_DEVICE_HAS_NO_MEDIUM, device);
return;
}
if (!has_writable) {
writable = false;
}
if (bdrv_is_read_only(bs)) {
writable = false;
}
exp = nbd_export_new(bs, 0, -1, writable ? 0 : NBD_FLAG_READ_ONLY, NULL);
nbd_export_set_name(exp, device);
n = g_malloc0(sizeof(NBDCloseNotifier));
n->n.notify = nbd_close_notifier;
n->exp = exp;
bdrv_add_close_notifier(bs, &n->n);
QTAILQ_INSERT_TAIL(&close_notifiers, n, next);
}
| 1threat
|
import re
def text_match_wordz_middle(text):
patterns = '\Bz\B'
if re.search(patterns, text):
return 'Found a match!'
else:
return('Not matched!')
| 0debug
|
How do you tell which category the property belongs to? : <pre><code>typealias Names = String
typealias Works = String
let a: Names = Names()
let b: Works = Works()
if a is Names {// a is not Works
}
</code></pre>
<p>How do I know if "a" belongs to "Names" instead of "Works"?</p>
<p>Thanks!</p>
| 0debug
|
what is the regular expression to check if a string has no more than 2 repetitive character? : <p>Hi i have a requirement to check on passwords . the password should not contain no more than 2 repetitive character.</p>
<p>my password must contain atleast upper case, lower case, number and special characters #?!@$%^&*-</p>
<p>so if i have a password like for example</p>
<p>Password123$ it is valid
Passsword123$ it is invalid
Passssword123$ it is invalid
PPaassword123$$ valid
PPaassword123$$$ it is invalid</p>
<p>please help me
thank you </p>
| 0debug
|
void qmp_block_set_io_throttle(const char *device, int64_t bps, int64_t bps_rd,
int64_t bps_wr, int64_t iops, int64_t iops_rd,
int64_t iops_wr, Error **errp)
{
BlockIOLimit io_limits;
BlockDriverState *bs;
bs = bdrv_find(device);
if (!bs) {
error_set(errp, QERR_DEVICE_NOT_FOUND, device);
return;
}
io_limits.bps[BLOCK_IO_LIMIT_TOTAL] = bps;
io_limits.bps[BLOCK_IO_LIMIT_READ] = bps_rd;
io_limits.bps[BLOCK_IO_LIMIT_WRITE] = bps_wr;
io_limits.iops[BLOCK_IO_LIMIT_TOTAL]= iops;
io_limits.iops[BLOCK_IO_LIMIT_READ] = iops_rd;
io_limits.iops[BLOCK_IO_LIMIT_WRITE]= iops_wr;
if (!do_check_io_limits(&io_limits)) {
error_set(errp, QERR_INVALID_PARAMETER_COMBINATION);
return;
}
bs->io_limits = io_limits;
bs->slice_time = BLOCK_IO_SLICE_TIME;
if (!bs->io_limits_enabled && bdrv_io_limits_enabled(bs)) {
bdrv_io_limits_enable(bs);
} else if (bs->io_limits_enabled && !bdrv_io_limits_enabled(bs)) {
bdrv_io_limits_disable(bs);
} else {
if (bs->block_timer) {
qemu_mod_timer(bs->block_timer, qemu_get_clock_ns(vm_clock));
}
}
}
| 1threat
|
Using typescript in react,stateless component not assignable to type 'React.SFC' : <p>TypeScript: 2.8.3<br>
@types/react: 16.3.14</p>
<hr>
<p>The type of return in function component is <code>JSX.Element</code>, when I declare the component to <code>React.SFC</code>(alias of <code>React.StatelessComponent</code>).</p>
<p>There are three errors occured: </p>
<ol>
<li><p><code>TS2322: Type 'Element' is not assignable to type 'StatelessComponent<{}>', Type 'Element' provides no match for the signature '(props: { children?: ReactNode; }, context?: any): ReactElement<any>'</code></p></li>
<li><p><code>TS2339: Property 'propTypes' does not exist on type '(props: LayoutProps) => StatelessComponent<{}>'</code></p></li>
<li><p><code>TS2339: Property 'defaultProps' does not exist on type '(props: LayoutProps) => StatelessComponent<{}>'</code></p></li>
</ol>
<hr>
<pre><code>interface ItemInterface {
name: string,
href: string,
i18n?: string[]
}
interface LayoutHeaderItemProps extends ItemInterface{
lang: string,
activeHref: string,
}
function LayoutHeaderItem (props: LayoutHeaderItemProps): React.SFC{
const {name, href, lang, activeHref, i18n} = props
const hrefLang = /\//.test(href) ? `/${lang}` : ''
if (!i18n.includes(lang)) return null
return (
<a
className={`item${href === activeHref ? ' active' : ''}`}
key={href}
href={hrefLang + href}
><span>{name}</span></a>
)
}
LayoutHeaderItem.propTypes = {
lang: string,
activeHref: string,
name: string,
href: string,
i18n: array
}
LayoutHeaderItem.defaultProps = {i18n: ['cn', 'en']}
</code></pre>
| 0debug
|
how to display multi-phase raster using ArcGIS Javascript API ? : I have a set of raster layers(the same place,different years).I want to display it on my website using the [timeslider][1] so that i can clearly view the changes from these rasters over different years. but this example given by ESRI site is based on featurelayer,i want to display raster layer.So how can i make the rasterlayer time-aware or should i try another way to achieve this?
[1]: https://developers.arcgis.com/javascript/3/jssamples/time_sliderwithdynamiclayer.html
| 0debug
|
def is_num_decagonal(n):
return 4 * n * n - 3 * n
| 0debug
|
Got a list of strings and need to get the nth char of each string : Let's they I have the list ['abc', 'def', 'gh') I know need to get a string with the contents of the first char of the first string, the first of the second and so on.
So the result would look like this: "adgbehcf" But the problem is that the last string in the array could have two or one char.
I already tried to nested for loop but that didn't work.
| 0debug
|
String .replace() does not work with '$' symbol : <p>So, I cannot figure out what is wrong? I know that <code>.replace()</code> returns a new string, without mutable existing. It's really ridiculous, but I'm stuck on this. I need to replace '$' on '2', but it just concat string, not replace the value...</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var answer_form = '$0';
var question_num = 2;
answer_form = answer_form.replace(/$/g, question_num);
console.log(answer_form);</code></pre>
</div>
</div>
</p>
| 0debug
|
Python Count the number of periods (.) there are in the file : <p>Count the number of periods (.) there are in the file.</p>
<p>Use the built-in function <code>count()</code> on the file after you have converted it
to a string.</p>
<p>Answer with the result as an integer.</p>
<p>I've no idea to do this..please help!</p>
| 0debug
|
Laravel UUID generation : <p>I am trying to generate a UUID (not as primary key, just generate one) with the <a href="https://github.com/webpatser/laravel-uuid" rel="noreferrer">laravel-uuid</a> package. The docs are pretty straightforward, so according to the readme file a UUID should be generated just by calling <code>$uuid = Uuid::generate();</code>, but it returns an empty object. (I also tried <code>$uuid = Uuid::generate(1);</code>)</p>
<p>I followed the installation instructions as provided there (nothing out of the ordinary), the app doesn't throw any errors, so I guess everything is right.</p>
<p>Alternative packages for this are also welcome.</p>
| 0debug
|
from collections import defaultdict
def most_occurrences(test_list):
temp = defaultdict(int)
for sub in test_list:
for wrd in sub.split():
temp[wrd] += 1
res = max(temp, key=temp.get)
return (str(res))
| 0debug
|
static void spapr_alloc_htab(sPAPRMachineState *spapr)
{
long shift;
int index;
shift = kvmppc_reset_htab(spapr->htab_shift);
if (shift > 0) {
if (shift != spapr->htab_shift) {
error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem");
}
spapr->htab_shift = shift;
kvmppc_kern_htab = true;
} else {
spapr->htab = qemu_memalign(HTAB_SIZE(spapr), HTAB_SIZE(spapr));
memset(spapr->htab, 0, HTAB_SIZE(spapr));
for (index = 0; index < HTAB_SIZE(spapr) / HASH_PTE_SIZE_64; index++) {
DIRTY_HPTE(HPTE(spapr->htab, index));
}
}
}
| 1threat
|
Calculate Distance traveled android using location manager : <p>I am currently working on a simple fitness app that allows user to track his/her performance (running,walking). I have been using location manager to get the moving speed which works very fine. However I need to get the distance traveled, how can use location manager (long and lat) to get the distance ?</p>
<p>Thanks</p>
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_track);
start = (Button) findViewById(R.id.btnStart);
speed = (TextView) findViewById(R.id.txtSpeed);
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
//initialize location listener
locationListener = new LocationListener() {
@Override
public void onLocationChanged(Location location) {
getSpeed(location);
double lat2 = location.getLatitude();
double lng2 = location.getLongitude();
}
@Override
public void onStatusChanged(String s, int i, Bundle bundle) {
}
@Override
public void onProviderEnabled(String s) {
}
@Override
public void onProviderDisabled(String s) {
}
//get the speed from the given location updates
public void getSpeed(Location location) {
currentSpeed = (location.getSpeed() * 3600 / 1000);
String convertedSpeed = String.format("%.2f", currentSpeed);
speed.setText(convertedSpeed + "Km/h");
}
};
</code></pre>
| 0debug
|
static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor)
{
int code, value, ofs = 0;
char layout[16] = {0};
do {
code = avio_r8(pb);
value = avio_r8(pb);
av_dlog(NULL, "pixel layout: code %#x\n", code);
if (ofs <= 14) {
layout[ofs++] = code;
layout[ofs++] = value;
}
} while (code != 0);
ff_mxf_decode_pixel_layout(layout, &descriptor->pix_fmt);
}
| 1threat
|
static void tgen_branch(TCGContext *s, int cc, int labelno)
{
TCGLabel* l = &s->labels[labelno];
if (l->has_value) {
tgen_gotoi(s, cc, l->u.value_ptr);
} else if (USE_LONG_BRANCHES) {
tcg_out16(s, RIL_BRCL | (cc << 4));
tcg_out_reloc(s, s->code_ptr, R_390_PC32DBL, labelno, -2);
s->code_ptr += 2;
} else {
tcg_out16(s, RI_BRC | (cc << 4));
tcg_out_reloc(s, s->code_ptr, R_390_PC16DBL, labelno, -2);
s->code_ptr += 1;
}
}
| 1threat
|
static struct omap_32khz_timer_s *omap_os_timer_init(MemoryRegion *memory,
hwaddr base,
qemu_irq irq, omap_clk clk)
{
struct omap_32khz_timer_s *s = (struct omap_32khz_timer_s *)
g_malloc0(sizeof(struct omap_32khz_timer_s));
s->timer.irq = irq;
s->timer.clk = clk;
s->timer.timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, omap_timer_tick, &s->timer);
omap_os_timer_reset(s);
omap_timer_clk_setup(&s->timer);
memory_region_init_io(&s->iomem, NULL, &omap_os_timer_ops, s,
"omap-os-timer", 0x800);
memory_region_add_subregion(memory, base, &s->iomem);
return s;
}
| 1threat
|
Many Error displays in netbeans with codename one : <p>I can compile a simple app fine using codename one and netbeans. but my editor displays many errors all over making my code ugly and unreadable. See attached screenshot</p>
<p><img src="https://i.imgur.com/3ojl6BP.png" alt="netbeans"></p>
<p>Its very buggy. The first string displays no error but all the other ones do, but the code compiles and works fine. What the hell ?</p>
<p>also autocomplete dosent seem to work. but works fine with real java.</p>
| 0debug
|
$(this).parent().remove() not working : <blockquote>
<p>Even though this is a duplicate question of "<a href="https://stackoverflow.com/questions/15090942/event-handler-not-working-on-dynamic-content">Event handler not working on dynamic content</a>" , I am stuck with the same problem even after following the answers given there. Please help ....</p>
</blockquote>
<pre><code> userinfo.topics.forEach(ele=>{
$("#topics_subscribed").append(`<li class="list-group-item col-4">${ele} &nbsp;<i style="color:red;font-size:.7em;" class="removeitem fa fa-times"/></li>`) ;
});
$(document).on('click', '.removeitem', ()=> {
console.log('clicked') ;
$(this).parent().remove() ;
});
</code></pre>
<p>Please answer why its happening before marking this as duplicate . How to fix this ? (I will remove the question as soon as its answered please....)</p>
| 0debug
|
void avformat_free_context(AVFormatContext *s)
{
int i;
AVStream *st;
av_opt_free(s);
if (s->iformat && s->iformat->priv_class && s->priv_data)
av_opt_free(s->priv_data);
for(i=0;i<s->nb_streams;i++) {
st = s->streams[i];
if (st->parser) {
av_parser_close(st->parser);
av_free_packet(&st->cur_pkt);
}
if (st->attached_pic.data)
av_free_packet(&st->attached_pic);
av_dict_free(&st->metadata);
av_free(st->index_entries);
av_free(st->codec->extradata);
av_free(st->codec->subtitle_header);
av_free(st->codec);
av_free(st->priv_data);
av_free(st->info);
av_free(st);
}
for(i=s->nb_programs-1; i>=0; i--) {
av_dict_free(&s->programs[i]->metadata);
av_freep(&s->programs[i]->stream_index);
av_freep(&s->programs[i]);
}
av_freep(&s->programs);
av_freep(&s->priv_data);
while(s->nb_chapters--) {
av_dict_free(&s->chapters[s->nb_chapters]->metadata);
av_free(s->chapters[s->nb_chapters]);
}
av_freep(&s->chapters);
av_dict_free(&s->metadata);
av_freep(&s->streams);
av_free(s);
}
| 1threat
|
azure mobile app authentication external redirect url : <p>I have created <strong>Azure Mobile App</strong> and I am following official docs for this. During <strong>Authentication</strong> part of the docs following is stated</p>
<blockquote>
<p>In the Allowed External Redirect URLs, enter <strong>url_scheme_of_your_app://easyauth.callback</strong>. The url_scheme_of_your_app in this string is the URL Scheme for your mobile application. It should follow normal URL specification for a protocol (use letters and numbers only, and start with a letter). You should make a note of the string that you choose as you will need to adjust your mobile application code with the URL Scheme in several places.</p>
</blockquote>
<p>My <strong>Question</strong> is that they havent provided any valid example for <strong>redirect url</strong> so I pasted <strong>url_scheme_of_your_app://easyauth.callback</strong> in my redirect url in the portal and it gives error because it isnt a valid format, so can anyone please give me a valid example for this url?</p>
<p><strong>Thanks in advance</strong></p>
| 0debug
|
static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s)
{
register_ioport_write(GPE_BASE, GPE_LEN, 1, gpe_writeb, s);
register_ioport_read(GPE_BASE, GPE_LEN, 1, gpe_readb, s);
acpi_gpe_blk(&s->ar, GPE_BASE);
register_ioport_read(PCI_UP_BASE, 4, 4, pci_up_read, s);
register_ioport_read(PCI_DOWN_BASE, 4, 4, pci_down_read, s);
register_ioport_write(PCI_EJ_BASE, 4, 4, pciej_write, bus);
register_ioport_read(PCI_EJ_BASE, 4, 4, pciej_read, bus);
register_ioport_write(PCI_RMV_BASE, 4, 4, pcirmv_write, s);
register_ioport_read(PCI_RMV_BASE, 4, 4, pcirmv_read, s);
pci_bus_hotplug(bus, piix4_device_hotplug, &s->dev.qdev);
}
| 1threat
|
Calculating median based on segments in r : <p>Hi I want to calculate the median of certain values based on the segment they fall into which we get by another column. The initial data structure is like given below:</p>
<pre><code>Column A Column B
559 1
559 1
322 1
661 2
661 2
662 2
661 2
753 3
752 3
752 3
752 3
752 3
328 4
328 4
328 4
</code></pre>
<p>The calculated medians would be based on column A and the output would look like this:</p>
<pre><code>Column A Column B Median
559 1 559
559 1 559
322 1 559
661 2 661
661 2 661
662 2 661
661 2 661
753 3 752
752 3 752
752 3 752
752 3 752
752 3 752
328 4 328
328 4 328
328 4 328
</code></pre>
<p>Median is calculated based on column A and for the set of values of column B which are same. For example we should calculate medians of all values of column A where column B values are same and paste them in the column <strong>Median</strong>.</p>
<p>I need to do this operation in r but haven'e been able to crack it. Is there a way to do this through dplyr or any other package?</p>
<p>Thanks</p>
| 0debug
|
static void vnc_dpy_resize(DisplayState *ds)
{
int size_changed;
VncDisplay *vd = ds->opaque;
VncState *vs;
if (!vd->server)
vd->server = qemu_mallocz(sizeof(*vd->server));
if (vd->server->data)
qemu_free(vd->server->data);
*(vd->server) = *(ds->surface);
vd->server->data = qemu_mallocz(vd->server->linesize *
vd->server->height);
if (!vd->guest.ds)
vd->guest.ds = qemu_mallocz(sizeof(*vd->guest.ds));
if (ds_get_bytes_per_pixel(ds) != vd->guest.ds->pf.bytes_per_pixel)
console_color_init(ds);
size_changed = ds_get_width(ds) != vd->guest.ds->width ||
ds_get_height(ds) != vd->guest.ds->height;
*(vd->guest.ds) = *(ds->surface);
memset(vd->guest.dirty, 0xFF, sizeof(vd->guest.dirty));
QTAILQ_FOREACH(vs, &vd->clients, next) {
vnc_colordepth(vs);
if (size_changed) {
vnc_desktop_resize(vs);
}
if (vs->vd->cursor) {
vnc_cursor_define(vs);
}
memset(vs->dirty, 0xFF, sizeof(vs->dirty));
}
}
| 1threat
|
Expandable block when clicked : Recently, I start working on my project and faced with small problem.
I hava a list of notes, notes are the div blocks with code:
<div id="note" class="well">
<p id="caption" class="text-center">%Caption</p>
<hr id="devider">
<p id="content">%Content</p>
</div>
View on page:
[image][1]
Now, when I click on this note, nothing happens. I whant to make the next feature: in the ordinary state note has only a brief part of content, but when I click on certain note it increases in size and shows all content of note. How can I realize this feature?
[1]: https://i.stack.imgur.com/aIgWf.png
| 0debug
|
C++ Classes without class body declared outside of the namespace : <p>I'm really new to C++ Programming and I'm trying to teach it myself. While I was having a look at some code I noticed the following:</p>
<pre><code>#ifndef _someclass_h_
#define _someclass_h_
class A;
class B;
class C;
namespace somenamespace{
class SomeClass
{
public:
...
};
}
</code></pre>
<p>I'm confused about the classes A, B and C being declared outside of the namespace while not having any class body. What is done here?
Does it have something to do with templates? </p>
<p>Thanks in advance!</p>
| 0debug
|
matplotlib Axes.plot() vs pyplot.plot() : <p>What is the difference between the <code>Axes.plot()</code> and <code>pyplot.plot()</code> methods? Does one use another as a subroutine? </p>
<p>It seems that my options for plotting are</p>
<pre><code>line = plt.plot(data)
</code></pre>
<p>or </p>
<pre><code>ax = plt.axes()
line = ax.plot(data)
</code></pre>
<p>or even</p>
<pre><code>fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
line = ax.plot(data)
</code></pre>
<p>Are there situations where it is preferable to use one over the other? </p>
| 0debug
|
Can a get() ever be null after a containsKey() check in a Hashtable? : <p>I've implemented a Hashtable in an android application which is initially populated in the following way:</p>
<pre><code>if(table.containsKey(key)){
table.get(key).add(item);
}else{
table.put(key, new ArrayList<Items>());
table.get(key).add(item);
}
</code></pre>
<p>(variable names changed slightly)</p>
<p>Android Studio gives a <code>Method invocation 'add' may produce NullPointerException</code> warning on on both add methods. My previous (and only) experience of dict-type structures comes from Python and this was never an issue, but for safety's sake I'd like to check: is it actually possible for this to ever throw a NPE?</p>
<p>Cheers</p>
| 0debug
|
Comparing Cassandra structure with Relational Databases : <p>A few days ago I read about wide-column stored type of NoSql and
exclusively Apache-Cassandra.
What I understand is that Cassandra consist of :</p>
<p>A keyspace(like database in relational databases) and supporting many column families or tables (Same as table in relational databases) and unlimited rows.</p>
<p>From Stackoverflow tags :</p>
<blockquote>
<p>A wide column store is a type of key-value database. It uses tables, rows, and columns, but unlike a relational database, the names and format of the columns can vary from row to row in the same table.</p>
</blockquote>
<p>In Cassandra all of the rows (in a table) should have a row key then each row key can have multiple columns.
I read about differences in implementation and storing data of Relational database and NoSql (Cassandra) .</p>
<p>But I don't understand the difference between structure :</p>
<p>Imagine a scenario which I have a table (or column family in Cassandra) : </p>
<p>When I execute a query (Cql) like this :</p>
<pre><code>Select * from users;
</code></pre>
<p>It gives me the result as you can see :</p>
<pre><code>lastname | age | city | email
----------+------+---------------+----------------------
Doe | 36 | Beverly Hills | janedoe@email.com
Jones | 35 | Austin | bob@example.com
Byrne | 24 | San Diego | robbyrne@email.com
Smith | 46 | Sacramento | null
Jones2 | null | Austin | bob@example.com
</code></pre>
<p>So I perform the above scenario in relational database (MsSql) with the blow query :</p>
<pre><code>select * from [users]
</code></pre>
<p>And the result is :</p>
<pre><code>lastname age city email
Doe 36 Beverly Hills janedoe@email.com
Jones 35 Austin bob@example.com
Byrne 24 San Diego robbyrne@email.com
Smith 46 Sacramento NULL
Jones2 NULL Austin bob@example.com
</code></pre>
<p>I know that Cassandra supports dynamic column and I can perform this by using sth like :</p>
<pre><code>ALTER TABLE users ADD website varchar;
</code></pre>
<p>But it is available in relational model for example in mssql the above code can be implemented too.
Sth like :</p>
<pre><code>ALTER TABLE users
ADD website varchar(MAX)
</code></pre>
<p>What I see is that the first select and second select result is the same.
In Cassandra , they just give a row key (lastname) as a standalone objet but it is same as a unique field (like ID or a text) in mssql (and all relational databases) and I see the type of column in Cassandra is static (in my example <code>varchar</code>) unlike what it describes in Stackoverflow tag.</p>
<p>So my questions is :</p>
<ol>
<li><p>Is there any misunderstanding in my imagination about Cassandra?!</p></li>
<li><p>So what is different between two structure ?! I show you the result is same.</p></li>
<li><p>Is there any special scenarios (Json like) that cannot be implemented in relational databases but Cassandra supports ?( For example I know that nested column doesn't support in Cassandra.)</p></li>
</ol>
<p>Thank you for reading.</p>
| 0debug
|
SwiftUI NavigationLink loads destination view immediately, without clicking : <p>With following code: </p>
<pre><code>struct HomeView: View {
var body: some View {
NavigationView {
List(dataTypes) { dataType in
NavigationLink(destination: AnotherView()) {
HomeViewRow(dataType: dataType)
}
}
}
}
}
</code></pre>
<p>What's weird, when <code>HomeView</code> appears, <code>NavigationLink</code> immediately loads the <code>AnotherView</code>. As a result, all <code>AnotherView</code> dependencies are loaded as well, even though it's not visible on the screen yet. The user has to click on the row to make it appear.
My <code>AnotherView</code> contains a <code>DataSource</code>, where various things happen. The issue is that whole <code>DataSource</code> is loaded at this point, including some timers etc.</p>
<p>Am I doing something wrong..? How to handle it in such way, that <code>AnotherView</code> gets loaded once the user presses on that <code>HomeViewRow</code>?</p>
| 0debug
|
How to fully pass a List? : <p>I use a list to contain data parsed from an XML file, using strings as its members:</p>
<pre><code>public class ServerList
{
public string ServerName { set; get; }
public string ServerReboot { set; get; }
public string ServerShutdown { set; get; }
public ServerList()
{
ServerName = "";
ServerReboot = "";
ServerShutdown = "";
}
}
</code></pre>
<p>From the main form I launch an editor form and pass the list into it. On this editor form the user is able to add or remove entry entries form the list, as well as make changes to parts of the list. If they click the OK button I want to be able to pull the list form the editor form back into the main form, but if they click Cancel I want these changes to get dropped. This is the way the editor form is pulled up:</p>
<pre><code> private void mnuEdit_Click(object sender, EventArgs e)
{
frmEditor theEditor = new frmEditor();
theEditor.updatedServerList = theServerList;
DialogResult res = theEditor.ShowDialog();
if (res == DialogResult.OK)
{
theServerList = theEditor.updatedServerList.ToList();
SetupFilters(GroupOrBatch.Group);
// other processing to update the main form from the updated list
}
}
</code></pre>
<p>And on the Edit form this is how it is received:</p>
<pre><code>public partial class frmEditor : Form
{
private List<ServerList> myServerList = new List<ServerList>();
public List<ServerList> updatedServerList
{
get { return myServerList; }
set { myServerList = value.ToList(); }
}
....
</code></pre>
<p>What I am finding is that while the list structure appears to be copied to the new variable, the actual data is still linked to the original list. Even if the user clicks Cancel, and the modified list is not copied back to the original, the original has already been changed.</p>
<p>This leaves me with one of two options - either I can find some way to do a full deep clone of the list to a new one (which can be dropped upon an Cancel), or I remove the Cancel button entirely and have all edits be live. </p>
| 0debug
|
google-bigquery format date as mm/dd/yyyy in query results : <p>I am using Bigquery SQL to generate a report. The standard Bigquery date format is yyyy-mm-dd, but I want it to be formatted as mm/dd/yyyy.</p>
<p>Is there a way via Bigquery SQL to convert the date format on SELECT?</p>
<p>Thanks in advance,</p>
| 0debug
|
How to handle error for response Type blob in HttpRequest : <p>I am calling an http request using httpClient and using response Type as 'blob' but the problem is when it goes in error block the response type remains 'blob'.This is causing problem with my error handling.</p>
<pre><code>this.httpClient.get('http://m502126:3000/reports/perdate', {
observe: 'body',
responseType: 'blob',
params: new HttpParams().set('START_DATE', startDate)
.set('END_DATE', endDate)
.set('MIXER', mixer)
.set('ATTACH', 'true')
}).subscribe(data => {
console.log(data);
},
error => {
console.log(error);
}
)
</code></pre>
<p>the problem is i am setting request type as'blob' and type of error is any . So when error comes and goes in error block the response type remains 'blob'.
How to handle this ?</p>
| 0debug
|
Can Somebody Help me? (Im a total noob in Programming btw. ^^) Xcode : So im trying to build an app for School but I keep getting Error messages... It's probably a rly obvious mistake I made ^^
So basically I am trying to build a View that displays a UIWebView and changes to a 2nd View if a Segment Controller Switch is pressed...
My Code is:
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var myWebView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let url = URL(string: "http://google.de")
myWebView.loadRequest(URLRequest(url: url!))
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func Heute(_ sender: UISegmentedControl) {
performSegue(withIdentifier: "Switch", sender: self)
}
//Vertretung2
class Vertretung2: UIViewController {
@IBOutlet weak var UIWebView1: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let url = URL(string: "http://google.de")
UIWebView1.loadRequest(URLRequest(url: url!))
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func Morgen(_ sender: UISegmentedControl) {
performSegue(withIdentifier: "Switch", sender: self)
}
}
}
My App keeps Crashing when I switch from 1st View to 2nd View.
Thx 4 helping ^^
| 0debug
|
building a calendar using javascript where you can add and modify events : <p>I want to build a calendar with javasCript that allow users to enter their shift manually and have 2 option when a date is clicked on( swap or give away)? any thought on how to do it? im I going to need an API? building the calendar will I have to build it using table or which is most efficient way?
I am a rookie coder who started less than a month so pardon if I am not too specific.</p>
| 0debug
|
How to use explode method in php : I changed the split() function( deprecated) with explode() and still got error.Any help?
function createTimestamp($time) {
list($day, $month, $year, $hour, $minute) = explode(':', $time); // error is here
return mktime($hour, $minute, -1, $month, $day, $year) + 1492640000000;
}
| 0debug
|
static int rtp_mpegts_write_header(AVFormatContext *s)
{
struct MuxChain *chain = s->priv_data;
AVFormatContext *mpegts_ctx = NULL, *rtp_ctx = NULL;
AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL);
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
int i, ret = AVERROR(ENOMEM);
AVStream *st;
if (!mpegts_format || !rtp_format)
return AVERROR(ENOSYS);
mpegts_ctx = avformat_alloc_context();
if (!mpegts_ctx)
return AVERROR(ENOMEM);
mpegts_ctx->oformat = mpegts_format;
mpegts_ctx->max_delay = s->max_delay;
for (i = 0; i < s->nb_streams; i++) {
AVStream* st = avformat_new_stream(mpegts_ctx, NULL);
if (!st)
st->time_base = s->streams[i]->time_base;
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
avcodec_parameters_copy(st->codecpar, s->streams[i]->codecpar);
if ((ret = avio_open_dyn_buf(&mpegts_ctx->pb)) < 0)
if ((ret = avformat_write_header(mpegts_ctx, NULL)) < 0)
for (i = 0; i < s->nb_streams; i++)
s->streams[i]->time_base = mpegts_ctx->streams[i]->time_base;
chain->mpegts_ctx = mpegts_ctx;
mpegts_ctx = NULL;
rtp_ctx = avformat_alloc_context();
if (!rtp_ctx) {
rtp_ctx->oformat = rtp_format;
st = avformat_new_stream(rtp_ctx, NULL);
st->time_base.num = 1;
st->time_base.den = 90000;
st->codecpar->codec_id = AV_CODEC_ID_MPEG2TS;
rtp_ctx->pb = s->pb;
if ((ret = avformat_write_header(rtp_ctx, NULL)) < 0)
chain->rtp_ctx = rtp_ctx;
return 0;
fail:
if (mpegts_ctx) {
ffio_free_dyn_buf(&mpegts_ctx->pb);
avformat_free_context(mpegts_ctx);
if (rtp_ctx)
avformat_free_context(rtp_ctx);
rtp_mpegts_write_close(s);
return ret;
| 1threat
|
static av_cold int split_init(AVFilterContext *ctx)
{
SplitContext *s = ctx->priv;
int i;
for (i = 0; i < s->nb_outputs; i++) {
char name[32];
AVFilterPad pad = { 0 };
snprintf(name, sizeof(name), "output%d", i);
pad.type = ctx->filter->inputs[0].type;
pad.name = av_strdup(name);
if (!pad.name)
return AVERROR(ENOMEM);
ff_insert_outpad(ctx, i, &pad);
}
return 0;
}
| 1threat
|
void usb_ep_reset(USBDevice *dev)
{
int ep;
dev->ep_ctl.nr = 0;
dev->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL;
dev->ep_ctl.ifnum = 0;
dev->ep_ctl.dev = dev;
dev->ep_ctl.pipeline = false;
for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) {
dev->ep_in[ep].nr = ep + 1;
dev->ep_out[ep].nr = ep + 1;
dev->ep_in[ep].pid = USB_TOKEN_IN;
dev->ep_out[ep].pid = USB_TOKEN_OUT;
dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;
dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;
dev->ep_in[ep].ifnum = 0;
dev->ep_out[ep].ifnum = 0;
dev->ep_in[ep].dev = dev;
dev->ep_out[ep].dev = dev;
dev->ep_in[ep].pipeline = false;
dev->ep_out[ep].pipeline = false;
}
}
| 1threat
|
Why is assertEquals(Object[], Object[]) from JUnit 4 deprecated? : <p>Eclipse is giving me a warning that says that the method <code>assertEquals(Object[], Object[])</code> from the type <code>Assert</code> is deprecated. I am using JUnit 4.</p>
<p>I wrote the following code in Eclipse:</p>
<pre><code>import org.junit.Test;
import org.junit.Assert;
public class Generics {
public <T> T[] genericArraySwap(T[] list, int pos1, int pos2) throws IndexOutOfBoundsException {
...
}
@Test
public void genericArraySwapTest() {
Integer[] IntegerList = {0, 1, 2, 3, 4};
Assert.assertEquals(new Integer[] {0, 1, 2, 4, 3}, genericArraySwap(IntegerList, 3, 4));
}
}
</code></pre>
<p>Can someone tell me why this method is deprecated or what method I should use instead?</p>
| 0debug
|
jax-rs vs HttpServlet in jee : <p>I'm so confused.
I worked servlet.</p>
<p>which one is newest?</p>
<p>which one is better for implementing <strong>restful</strong> architecture?</p>
<p>jax-rs example :</p>
<pre><code>// This method is called if XML is request
@GET
@Produces(MediaType.TEXT_XML)
public String sayXMLHello() {
return "<?xml version=\"1.0\"?>" + "<hello> Hello Jersey" + "</hello>";
}
</code></pre>
<p>servlet example :</p>
<pre><code>/** Servlet implementation class FetchTest */
@WebServlet( urlPatterns = {"/users", "/Users/"})
public class Users extends HttpServlet
{
/** @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */
protected void doGet( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException
{
m_showUsers( response);
}
/** @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */
protected void doPost( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException
{
m_updateUser(request , response);
}
@Override
protected void doDelete( HttpServletRequest req , HttpServletResponse resp ) throws ServletException , IOException
{
m_deleteUser(req , resp);
}
@Override
protected void doPut( HttpServletRequest req , HttpServletResponse resp ) throws ServletException , IOException
{
m_insertUser(req , resp);
}
</code></pre>
| 0debug
|
Using Room's @ForeignKey as @Entity parameter in Kotlin : <p>I came across a Room <a href="https://android.jlelse.eu/android-architecture-components-room-relationships-bf473510c14a" rel="noreferrer">tutorial</a> that makes use of the <code>@PrimaryKey</code> annotation on the class definition:</p>
<pre><code>@Entity(foreignKeys = @ForeignKey(entity = User.class,
parentColumns = "id",
childColumns = "userId",
onDelete = CASCADE))
public class Repo {
...
}
</code></pre>
<p>Now, I have the following data class that want to use a primary key on:</p>
<pre><code>@Parcel(Parcel.Serialization.BEAN)
data class Foo @ParcelConstructor constructor(var stringOne: String,
var stringTwo: String,
var stringThree: String): BaseFoo() {
...
}
</code></pre>
<p>So, I just added the <code>@Entity(tableName = "Foo", foreignKeys = @ForeignKey(entity = Bar::class, parentColumns = "someCol", childColumns = "someOtherCol", onDelete = CASCADE))</code> snippet on the top as well, but I can't compile:</p>
<blockquote>
<p>An annotation can't be used as the annotations argument.</p>
</blockquote>
<p>I wonder: how come <em>(what I think is)</em> the same concept working in Java but not in Kotlin? Also, is there a way to go around this?</p>
<p>All input is welcome.</p>
| 0debug
|
Python string variable as object : <p>I am trying to pass the name of one of my objects as a variable within a function, however when executing the function it is only being recognised as a string, returning the following error:</p>
<pre><code>AttributeError: 'str' object has no attribute 'method'
</code></pre>
<p>my code is as follows:</p>
<pre><code>def addTask(arg1, arg2):
arg1.method('arg2')
addTask('object-type','foo')
</code></pre>
<p>So object-type is being passed as a string, but i need it to be converted to an object. I have tried eval, but that doesn't work, wondering if anyone can help me please.</p>
<p>Thanks.</p>
| 0debug
|
What is CompositeDefinitionSource in Android Studio : <p>Recently after upgrading Gradle Android Studio automatically added this to my <code>.idea/gradle.xml</code> :</p>
<pre><code> <compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
</code></pre>
<p>What is the purpose of this change?</p>
| 0debug
|
I cannot run jquery in visual studio 2017 : [cannto run any jquery or javascript in my code editor, i googled many time but couldnt find any answer, please someone help me ][1]
[1]: https://i.stack.imgur.com/THR8i.png
| 0debug
|
Facebook login in laravel 5.2 can't hold the session after redirect : <p>I am using Facebook PHP SDK to log my user.</p>
<p>I created a guard called login for this</p>
<p><strong>Here is my config file of auth.php</strong></p>
<pre><code>'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
'admin'=>[
'driver'=>'session',
'provider'=>'adminusers',
],
'verify'=>[
'driver'=>'session',
'provider'=>'verify',
],
'login'=>[
'driver'=>'session',
'provider'=>'users'
]
],
</code></pre>
<p>to access Facebook api i created a class in App\services namespace called it Facebook </p>
<p><strong>App\Services\Facbook.php</strong></p>
<pre><code><?php
namespace App\Services;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Config;
use App\Extensions\Facebook\FacebookLaravelPersistentDataHandler;
use Facebook\Facebook as FB;
use App;
class Facebook{
protected $fb;
protected $helper;
protected $permission;
protected $log;
protected $canvashelper;
protected $persistentDataHandler;
function __construct()
{
$this->fb = new FB([
'app_id'=>Config::get('facebook.app_id'),
'app_secret'=>Config::get('facebook.app_secret'),
'default_graph_version' => Config::get('facebook.default_graph_version'),
'persistent_data_handler' => new FacebookLaravelPersistentDataHandler(),
]);
$this->helper = $this->fb->getRedirectLoginHelper();
$this->permission = Config::get('facebook.permission');
$this->log = new Logging(Config::get('facebook.logfile'),'Facebook Log');
$this->canvashelper = $this->fb->getCanvasHelper();
$this->persistentDataHandler = new FacebookLaravelPersistentDataHandler();
}
public function FBAuthUrl()
{
if($this->isFBAuth())
{
return $this->helper->getLogoutUrl($this->persistentDataHandler->get('facebook_access_token'),route('facebook.logout'));
}
else
{
return $this->helper->getLoginUrl(route('facebook.callback'),$this->permission);
}
}
public function LoginCallback()
{
$accessToken = $this->helper->getAccessToken();
if(isset($accessToken))
{
$this->persistentDataHandler->set('facebook_access_token',(string) $accessToken);
}
}
public function isFBAuth()
{
return $this->persistentDataHandler->has('facebook_access_token');
}
public function getFBUser()
{
if($this->isFBAuth())
{
$this->fb->setDefaultAccessToken($this->persistentDataHandler->get('facebook_access_token'));
/*,user_birthday,user_tagged_places*/
$response = $this->fb->get("/me?fields=id,name,first_name,last_name,age_range,link,gender,locale,picture,timezone,updated_time,verified,email");
return $response->getGraphUser();
}
else
{
return false;
}
}
public function logout()
{
$this->persistentDataHandler->delete('facebook_access_token');
$this->persistentDataHandler->delete('state');
}
}
</code></pre>
<p>And Here is my UserController Where i write my login logic</p>
<pre><code> class UserController extends Controller
{
.....
/*
* Facebook login callback function
* @param Object App\services\Facebook
* return redirect
*/
public function fbLogin(Facebook $facebook)
{
$facebook->LoginCallback();
/*
* get the usergraphnode from facebook
*/
$fbUser = $facebook->getFBUser();
/*
* Convert UserGraphNode User To Eloquent User
*/
$user = $this->getFBLoggedUser($fbUser);
/*
* Here Log the user in laravel System
*/
Auth::guard('login')->login($user);
//dump(Auth::guard($this->guard)->user());
dump(session()->all());
return reidrect('/');
}
public function getFBLoggedUser($fbUser)
{
if(User::where('email','=',$fbUser->getField('email'))->count())
{
$user = User::where('email','=',$fbUser->getField('email'))->first();
if($user->fb_app_id){
$user->fb_app_id = $fbUser->getField('id');
$user->save();
}
}
else
{
$user = $this->FBregister($fbUser);
}
return $user;
}
/**
* Register The user logged in from Facebook
*
* @param \Facebook\GraphNodes\GraphUser;
*
* return \App\Models\User
*/
public function FBregister($fbUser)
{
$user = new User();
$user->fname = $fbUser->getField('first_name');
$user->lname = $fbUser->getField('last_name');
$user->gender = $fbUser->getField('gender');
$user->email = $fbUser->getField('email');
$user->fb_app_id = $fbUser->getField('id');
$picture = $fbUser->getField('picture');
if($picture->isSilhouette()){
$user->profile_image = $picture->getUrl();
}
$user->save();
return $user;
}
.........
}
</code></pre>
<p>On Successful Facebook login redirect i am calling UserController@fbLogin
after calling <code>Auth::guard()->login()</code> i dump session it successfully show a <code>login_login_randomstring=>UserId</code> i session . but When i redirect it all session data lost.</p>
<p>But the weird thing is that it only happen when it calling through facebook redirect. If i use this function like normal login routes it works perfactaly like this </p>
<p><strong>in route.php</strong> </p>
<pre><code>Route::get('/login','UserController@login');
</code></pre>
<p><strong>and in UserController</strong></p>
<pre><code>function login(){
$user = User::find(12);
Auth::guard('login')->login($user);
return redirect('/');
}
</code></pre>
<p>Using this method i can easily access Session data after redirecting from here but in facebook case it doesn't happening.</p>
<p>I stuck here for two days please anyone can help me</p>
<p><strong><em>[Note: Please don't mention in your answer that i should grouped my routes in web middleware. ]</em></strong></p>
| 0debug
|
Screen tracking support - Firebase 9.8 : <p>According <em>Firebase Android SDK Release Notes</em> with <a href="https://firebase.google.com/support/release-notes/android#9.8">9.8 update</a> we have <em>screen tracking support</em> with android screens and activities... The documentation says that <a href="https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics#setCurrentScreen(android.app.Activity,%20java.lang.String,%20java.lang.String)">this event</a> works like that:</p>
<pre><code>mFirebaseAnalytics.setCurrentScreen(activity,class_name,class_override_name);
</code></pre>
<p>In my case, I don't need overrides class name and I send null value... But i'm waiting 48h and my firebase analytics console doesn't show info about this event, any ideas? </p>
<p>Thanks in advance!</p>
| 0debug
|
After upgrade to iOS13 beta 6/Xcode 11 beta 5: issue "dyld: Symbol not found: _$s7SwiftUI7BindingVyxGAA0C11ConvertibleAAMc" : <p>After upgrading to iOS13 beta 6 using Xcode 11 beta 5 I receive this message when running on an iPhone SE device.</p>
<pre><code>dyld: Symbol not found: _$s7SwiftUI7BindingVyxGAA0C11ConvertibleAAMc
Referenced from: /var/containers/Bundle/Application/3B128240-B05E-4C1C-A0E1-55D22683B49E/BleAdvApp.app/BleAdvApp
Expected in: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
in /var/containers/Bundle/Application/3B128240-B05E-4C1C-A0E1-55D22683B49E/BleAdvApp.app/BleAdvApp
</code></pre>
<p>Using the simulator there's no such message, and it has been ok with iOS13 beta 5 on the device, tool
Compiling is fine, the message is shown at startup of the application on the iPhone with an </p>
<blockquote>
<p>Thread 1: signal SIGABRT</p>
</blockquote>
<p>Since there is no Xcode 11 beta 6, the Xcode is still running on beta 5 on MacOS Mojave 10.14.5 (18F132).</p>
<p>I created a simple SwiftUI example from scratch, that's working without any issue on the actual phone and the simulator.</p>
<p>What me also wonders is that there's no path /var/containers on my Mac at all?</p>
<p>Any idea on how to proceed?</p>
| 0debug
|
HTML how to fix <td> width after rotaing? : Need to make box size for text
[CodeImage][1]
[Problem image][2]
[1]: https://i.stack.imgur.com/SVxzU.png
[2]: https://i.stack.imgur.com/6vQsu.png
| 0debug
|
Deserialize json into model : <p>I have a json like this:</p>
<pre><code>[
{
\"childNodes\":null,
\"children\":null,
\"key\":\"\",
\"subKey\":{
\"buffer\":\"\",
\"offset\":0,
\"length\":0,
\"value\":\"\",
\"hasValue\":true
},
\"isContainerNode\":false,
\"rawValue\":null,
\"attemptedValue\":null,
\"errors\":[
{
\"exception\":null,
\"errorMessage\":\"Incorrect password.\"
}
],
\"validationState\":1
}
]
</code></pre>
<p>So I want to deserialize it into model, so I create model like:</p>
<pre><code> public class JsonDeserializeModel
{
public class SubKey
{
public string buffer { get; set; }
public int offset { get; set; }
public int length { get; set; }
public string value { get; set; }
public bool hasValue { get; set; }
}
public class Error
{
public object exception { get; set; }
public string errorMessage { get; set; }
}
public class RootObject
{
public object childNodes { get; set; }
public object children { get; set; }
public string key { get; set; }
public SubKey subKey { get; set; }
public bool isContainerNode { get; set; }
public object rawValue { get; set; }
public object attemptedValue { get; set; }
public List<Error> errors { get; set; }
public int validationState { get; set; }
}
}
</code></pre>
<p>Then I try to deserialize as:</p>
<pre><code> JsonDeserializeModel completeObject = JsonConvert.DeserializeObject<JsonDeserializeModel>(response.content);
</code></pre>
<p>But it throws exception:</p>
<blockquote>
<p>Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the
current JSON array (e.g. [1,2,3]) into type
'Project.Models.JsonDeserializeModel' because the type requires a
JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix
this error either change the JSON to a JSON object (e.g.
{"name":"value"}) or change the deserialized type to an array or a
type that implements a collection interface (e.g. ICollection, IList)
like List that can be deserialized from a JSON array.
JsonArrayAttribute can also be added to the type to force it to
deserialize from a JSON array. Path '', line 1, position 1.'</p>
</blockquote>
<p>I didn't understand where the error is. Can someone knows or have more experience to know what is wrong? Regards</p>
| 0debug
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.