problem
stringlengths
26
131k
labels
class label
2 classes
C# HTTP Reader get values from JSON format : <p>I have a C# application getting a string from an HTTP listener. The data is sent to my application in the JSON format, and I am trying to get the specific values.</p> <p>Right now, I read the data sent to me using: </p> <pre><code> HttpListenerContext context...
0debug
void parse_numa_opts(MachineState *ms) { int i; const CPUArchIdList *possible_cpus; MachineClass *mc = MACHINE_GET_CLASS(ms); for (i = 0; i < MAX_NODES; i++) { numa_info[i].node_cpu = bitmap_new(max_cpus); } if (qemu_opts_foreach(qemu_find_opts("numa"), parse_numa, ms, NULL))...
1threat
static void test_validate_struct_nested(TestInputVisitorData *data, const void *unused) { UserDefTwo *udp = NULL; Visitor *v; v = validate_test_init(data, "{ 'string0': 'string0', " "'dict1': { 'string1': 'string1', " ...
1threat
What is the easiest way to grab product description in WooCommerce programmatically? : I saw this, https://stackoverflow.com/questions/19763915/woocommerce-get-the-product-description-by-product-id But I was hoping there's a shorter way to grab the product description? Any idea? I'm using WooCommerce 3.0 and above.
0debug
uint32_t virtio_config_readl(VirtIODevice *vdev, uint32_t addr) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint32_t val; k->get_config(vdev, vdev->config); if (addr > (vdev->config_len - sizeof(val))) return (uint32_t)-1; val = ldl_p(vdev->config + addr); retur...
1threat
static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt) { DiracContext *s = avctx->priv_data; DiracFrame *picture = data; uint8_t *buf = pkt->data; int buf_size = pkt->size; int i, data_unit_size, buf_idx = 0; for (i = 0; i...
1threat
Composer: how to know a package by what other package is required : <p>I've found <code>nesbo/carbon</code> in my <code>vendor</code> folder. It is a really useful library and I'm curious to know which other package I installed requires it.</p> <p>How can I know this?</p>
0debug
Cakephp3: How can I return json data? : <p>I am having a ajax post call to a cakePhp Controller:</p> <pre><code>$.ajax({ type: "POST", url: 'locations/add', data: { abbreviation: $(jqInputs[0]).val(), description: $(jqInputs[1]).val() ...
0debug
static void mcf_fec_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { mcf_fec_state *s = (mcf_fec_state *)opaque; switch (addr & 0x3ff) { case 0x004: s->eir &= ~value; break; case 0x008: s->eimr = value; brea...
1threat
static void pxa2xx_screen_dump(void *opaque, const char *filename) { }
1threat
Here are some codes in keras. I don't understand what "(x)" means : output_tensor = layers.Dense(10, activation='softmax')(x) Here are some codes in keras. I don't understand what "(x)" means, can anybody help me ? Thanks a lot.
0debug
What is "e" in onChange(e)? : <p>I've been using it for quite some time but i still don't know - what is the <code>e</code> object you have access to when passing it over to <code>onChange</code> or <code>onSubmit</code>?</p>
0debug
static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size) { int h, w; uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V; int ret; if (src_size < avctx->width * avctx->height * 9L / 8) { av_log(avctx, AV_LOG_ERROR, "packet too...
1threat
Kendo UI datepicker incompatible with Chrome 56 : <p>After updating Chrome to its last version 56.0.2924.76 (64-bit), our Kendo datepickers started not to work properly.</p> <p>All datepickers were binded using ViewModels, and now they don't show their values. If we inspect them we see the value is set, but it's not b...
0debug
Getting full tweet text from "user_timeline" with tweepy : <p>I am using tweepy to fetch tweets from a user's timeline using the script included <a href="https://gist.github.com/yanofsky/5436496" rel="noreferrer">here</a>. However, the tweets are coming in truncated:</p> <pre><code>auth = tweepy.OAuthHandler(consumer_...
0debug
How to initialize public Spinner array in Android : Why can't I initialize this Spinner array in this way? I need to access the content inside the array in another method not included here, that is why the array is declared public. public class AnotherActivity extends AppCompatActivity{ public Spinner [...
0debug
C# library for connecting different RDBMS : <p>I'm currently working on one project. I want to analyze a few things in the database, to see which is faster, more reliable, less resource-consuming.</p> <p>I would like to create one program in C# and connect five databases. From that program, I will call the procedures ...
0debug
I cant update composer.json in laravel 5.3 : I had issue when i add code "laravelcollective/html": "5.3.*" in composer.json, and then i try to update composer via command line in windows and show this in my command line. PLEASE HELP ME GUYS, THANKS :)) https://i.stack.imgur.com/n4265.png
0debug
ReactJS - Lifting state up vs keeping a local state : <p>At my company we're migrating the front-end of a web application to ReactJS. We are working with create-react-app (updated to v16), without Redux. Now I'm stuck on a page which structure can be simplified by the following image:</p> <p><a href="https://i.stack.i...
0debug
How to fix a css navigation flashing issue : <p>I have a react app using reactstrap(bootstrap4). I created a simple layout using react-router for the navigation. I cannot figure out why the navbar items flash when you click on one. I am using a built-in NavLink from react-router-dom that keeps the selected NavItem high...
0debug
The difference between (a -> Bool) and (a -> a -> Bool) in Haskell? : <p>I am currently learning Haskell and came across a type signature that confused me. </p> <p>I know that:</p> <pre><code>(a -&gt; Bool) </code></pre> <p>Is how a predicate is assigned in the type signature when using (Ord a) but I came across a t...
0debug
cursor.execute('SELECT * FROM users WHERE username = ' + user_input)
1threat
Why does Enum.ToString not support precisision specifiers like "X2"? : Is there a specific reason, that `Enum.ToString(string)` does not support precision specifiers like `X2` or `D5`? I don't see why I have to explicitely cast it to `int` before being able to convert it to string. public enum Number { ...
0debug
Response MIME type for Spring Boot actuator endpoints : <p>I have updated a Spring Boot application from 1.4.x to 1.5.1 and the Spring Actuator endpoints return a different MIME type now:</p> <p>For example, <code>/health</code> is now <code>application/vnd.spring-boot.actuator.v1+json</code> instead simply <code>appl...
0debug
how to add a new c# file to a project using dotnet-cli : <p>I'm learning how to use dotnet-cli with VSCode. I've seen many commands on how to create solution, projects, add reference to projects... but I don't see anywhere in the documentation how to add a file. If remember, in RubyOnRails it was possible to add file f...
0debug
React Native: "Auto" width for text node : <p>I have a text element inside a view:</p> <p><code>&lt;View&gt;&lt;Text&gt;hello world foo bar&lt;/Text&gt;&lt;/View&gt;</code></p> <p>as part of a flex grid.</p> <p>I want this view to have an auto width based on the content i.e. length of the text.</p> <p>How do I achi...
0debug
I am trying to open a file that is a json. and store it as an json object. : <p>I am trying to open a file that has a json extension and store it as an object. However, keep getting an error message that the file name was not declared in the scope. I'm new to working with json files. do you treat them differently t...
0debug
What Port Does AWS S3 Use? : <p>I have a question because of error which I Faced due to configs some other person made in aws :</p> <p>Short Question is what port Does <strong>AWS S3</strong> use to communicate to ec2-instance ? </p>
0debug
int gdbserver_start(int port) { gdbserver_fd = gdbserver_open(port); if (gdbserver_fd < 0) return -1; gdb_accept (NULL); return 0; }
1threat
Could not find method ndk() for arguments : <p>I'm following <a href="https://codelabs.developers.google.com/codelabs/android-studio-jni/index.html?index=..%2F..%2Findex#3" rel="noreferrer">Create Hello-JNI With Android Studio</a>.</p> <p>MAC OX 10.11.5</p> <p>Android Studio 2.2 stable</p> <p>java version: 1.7.0_79<...
0debug
Using limit in group by (SQL) : This is my table. Financials: Date CountryID ProductID Revenue Cost I need to find the top 5 products by revenue for each country. Some products will be listed more than once, so I need to sum the revenue for each product. ...
0debug
static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int len) { AVDictionaryEntry *t = NULL; uint8_t num; if (!(t = av_dict_get(s->metadata, tag, NULL, 0))) return 0; ...
1threat
Android M FingerprintManager.isHardwareDetected() returns false on a Samsung Galaxy S5 : <p>I have just updated a Verizion Samsung Galaxy S5 (SM-G900V) to the G900VVRU2DPD1 version via the manual instructions listed at <a href="http://www.androidofficer.com/2016/06/g900vvru2dpd1-android-601-marshmallow.html">http://www...
0debug
jQuery 3.x child selector : <p>In jQuery 1.10.2 you could do <a href="http://api.jquery.com/child-selector/" rel="nofollow noreferrer">this.</a> </p> <pre><code>$("parent &gt; child") </code></pre> <p>Now in jQuery 3.1.1 this doesn't work...</p> <p>Get this error: </p> <pre><code>$("button[tooltip] ^ span") jquery-...
0debug
JS - document.createElement does not work : <p>I have the following code:</p> <pre><code>function icon(link) { var iccon = document.createElement('div'); var iccons = document.createElement('td'); iccon.setAttribute('id', 'icon'); icons.appendChild(iccons); iccon.setAttribute('onclick', 'window.open("' + link + '");')...
0debug
how to set or get value from cache in symfony2.8? : in my service.yml cache: class: Doctrine\Common\Cache\PhpFileCache arguments: [%kernel.cache_dir%] //////////////////// and in my controller $cache = $this->get('cache'); if ($cache->fetch($cache_key) != NULL) { ///...
0debug
How to make a part of HTML file not updated under a certain condition : <p>I have a HTML file which is updated every 30 seconds. It is rendered by Jinja2 from a certain python file to pass variables. Is there any way to omit updating of some elements?</p> <p>The code looks like that:</p> <pre><code>&lt;html&gt; &lt;h...
0debug
How to enable .NET Core 3 preview SDK in VS2019? : <p>I wanted to try out Blazor. I've installed .NET Core 3.0 preview 5 SDK, Blazor VS extension to enable project templates. I can create Blazor project, but I can't run it - I constantly get this notification. <a href="https://i.stack.imgur.com/d3eBN.png" rel="noreferr...
0debug
Explicit default constructors in C++17 : <p>In C++17, empty tag types in the standard library now have default constructors which are marked <code>explicit</code>, and are also <code>= default</code>. For example, <a href="http://en.cppreference.com/w/cpp/utility/piecewise_construct_t" rel="noreferrer"><code>std::piece...
0debug
Html File Input on Android 5.1.1 doesn't show gallery : <p>This is what I'we tried:</p> <pre><code>&lt;input id="capture" name="capture" type="file" accept="image/*" capture="camera"&gt; &lt;input id="capture" name="capture" type="file" accept="image/*" capture&gt; &lt;input id="capture" name="capture" type="file" acc...
0debug
How to reduce the size of RHEL/Centos/Fedora Docker image : <p>The base image from Red Hat is quite small, on the order of 196M for RHEL 7.4. However it tends to be missing a lot of the bits and pieces that are required by the products I want to build new images for.</p> <p>The moment I do a "yum install Xxx" on top o...
0debug
Best framework to design cross-plat library : <p>I need to build a library(not an app) which can be used in iOS apps, Android apps, Web pages(and probably Windows apps later). The library exposes a function which accepts a few parameters, like for example, a <code>string topic</code>. The function accesses few device i...
0debug
I am getting a class, interface, or enum epected error in blue jay : I am using Blue Jay and want to just create a simple rectangle. I tried adding a class to use the method Canvas but it does not seem to work. java.lang.Object; java.awt.Component; java.awt.Canvas; /** * Write a descripti...
0debug
Android. Is WorkManager running when app is closed? : <p>I want to schedule nightly database updates. So I use new Android WorkManager. My understanding is that once scheduled it will always run in the background independently from the app's lifecycle. Is that right? My first tests show that Work is only being perform...
0debug
LIKE operator not working in SQL (MS-Access) : <pre><code>SELECT FirstName, LastName FROM Customers WHERE FirstName LIKE 'A%'; </code></pre> <p>I am trying to extract all the customers whose name starts with A, but when I run this code, I get an empty query, although there are people whose name starts with A. </p>
0debug
How to removed pined marker and set it new location google javascript api : How to i clear the old pined `marker` location and place it on new location? Am using google javascript api map with autocomplete search. When i search for a location the marker will pin on the location in map, if i type new location it will ad...
0debug
static void usb_msd_command_complete(SCSIBus *bus, int reason, uint32_t tag, uint32_t arg) { MSDState *s = DO_UPCAST(MSDState, dev.qdev, bus->qbus.parent); USBPacket *p = s->packet; if (tag != s->tag) { fprintf(stderr, "usb-msd: Unexpected SCSI Tag 0x%x\n...
1threat
static int qemu_rdma_write_flush(QEMUFile *f, RDMAContext *rdma) { int ret; if (!rdma->current_length) { return 0; } ret = qemu_rdma_write_one(f, rdma, rdma->current_index, rdma->current_addr, rdma->current_length); if (ret < 0) { return ret; } ...
1threat
Random like order with mysql and PHP : <p>I use PHP and Mysql. I have a table that looks kind of like this:</p> <pre><code>id title ---------- 1 my title 2 another title 3 The last title </code></pre> <p>Now I want to select them with a random like order.</p> <ul> <li>I will need to use LIMIT because of t...
0debug
static void handle_port_status_write(EHCIState *s, int port, uint32_t val) { uint32_t *portsc = &s->portsc[port]; USBDevice *dev = s->ports[port].dev; *portsc &= ~(val & PORTSC_RWC_MASK); *portsc &= val | ~PORTSC_PED; handle_port_owner_write(s, port, val); val &=...
1threat
matroska_ebmlnum_uint (uint8_t *data, uint32_t size, uint64_t *num) { int len_mask = 0x80, read = 1, n = 1, num_ffs = 0; uint64_t total; if (size <= 0) return AVERROR_INVALIDDATA; total = data[0]; while (read <= 8 && !(total & len_...
1threat
Modify Last item in list : <p>I have a <code>List&lt;string, int&gt;</code> and I want to modify the int of the last Item.</p> <p>How do I do this?</p> <p>I've found the method <code>.Last&lt;T&gt;</code> But I cant see how to use it.</p>
0debug
static int adb_mouse_poll(ADBDevice *d, uint8_t *obuf) { MouseState *s = ADB_MOUSE(d); int dx, dy; if (s->last_buttons_state == s->buttons_state && s->dx == 0 && s->dy == 0) return 0; dx = s->dx; if (dx < -63) dx = -63; else if (dx > 63) dx = 63; ...
1threat
ASAuthorizationAppleIDRequest with name and mail scope returns nil values : <p>I'm implementing Sign in with Apple and noticed that the <code>email</code> and <code>fullName</code> properties of the returned <code>ASAuthorizationAppleIDCredential</code> are only filled on the very first Sign-In for this Apple ID. On al...
0debug
static void hda_audio_exit(HDACodecDevice *hda) { HDAAudioState *a = HDA_AUDIO(hda); HDAAudioStream *st; int i; dprint(a, 1, "%s\n", __FUNCTION__); for (i = 0; i < ARRAY_SIZE(a->st); i++) { st = a->st + i; if (st->node == NULL) { continue; } i...
1threat
static int postcopy_start(MigrationState *ms, bool *old_vm_running) { int ret; QIOChannelBuffer *bioc; QEMUFile *fb; int64_t time_at_stop = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); bool restart_block = false; int cur_state = MIGRATION_STATUS_ACTIVE; if (!migrate_pause_before_switchove...
1threat
Create a heavy CSV line by line with R : <p>I'm working with Terabytes of memory and I have to create a CSV from another CSV of 15 GB but without some lines. What I do to read the CSV is: line &lt;- readLines(con, n = 1) each time I execute that function I get the next line but when I write them with writeLines(line, c...
0debug
R filtering table and inserting information : <p>I currently have following table structure</p> <p><strong>Table1</strong></p> <pre><code>id a 11 4 11 3 22 1 22 3 22 5 33 2 33 1 44 6 44 8 66 5 66 7 77 6 </code></pre> <p><strong>Table2</strong></p> <pre><code>id score 11 12 33 22 44 20 </code></pre...
0debug
static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c) { GetBitContext *gb = &ctx->gb; ALSChannelData *current = cd; unsigned int channels = ctx->avctx->channels; int entries = 0; while (entries < channels && !(current->stop_flag = get_bits1(gb))) { ...
1threat
bool hbitmap_get(const HBitmap *hb, uint64_t item) { uint64_t pos = item >> hb->granularity; unsigned long bit = 1UL << (pos & (BITS_PER_LONG - 1)); return (hb->levels[HBITMAP_LEVELS - 1][pos >> BITS_PER_LEVEL] & bit) != 0; }
1threat
How to convert this code from vb6 to delphi : <pre><code>Private Sub acak ( ) Dim random As New Random ( ) Dim a, c, m, i, y As Byte Dim x( ) As Byte = {0,1,2,3,4,5,6,7,8,9,10} a = 5 c = 7 m = 8 x (0) = random.Next (1, 16) For i = 1 To 16 x(i) = (a*x(i-1)+c) Mod m If x(i) = 0 Then y = i ...
0debug
static int mirror_do_read(MirrorBlockJob *s, int64_t sector_num, int nb_sectors) { BlockBackend *source = s->common.blk; int sectors_per_chunk, nb_chunks; int ret = nb_sectors; MirrorOp *op; sectors_per_chunk = s->granularity >> BDRV_SECTOR_BITS; nb_se...
1threat
Should Comparable ever compare to another type? : <p>I'm wondering if there's ever a valid use case for the following:</p> <pre><code>class Base {} class A implements Comparable&lt;Base&gt; { //... } </code></pre> <p>It seems to be a common pattern (see <a href="https://docs.oracle.com/javase/8/docs/api/java/uti...
0debug
alert('Hello ' + user_input);
1threat
must call Vue.use(Vuex) before creating a store instance : <p>I cant't figure out why I am getting this error. Everything looks properly. Import store to the component like this.</p> <pre><code>import store from './store'; new Vue({ components: { SomeComponent }, store }); </code></pre> <p>My stor...
0debug
class Node: def __init__(self, data): self.data = data self.left = None self.right = None def max_height(node): if node is None: return 0 ; else : left_height = max_height(node.left) right_height = max_height(node.right) if (left_height > right_height): return left_height+1 ...
0debug
static void ibm_40p_init(MachineState *machine) { CPUPPCState *env = NULL; uint16_t cmos_checksum; PowerPCCPU *cpu; DeviceState *dev; SysBusDevice *pcihost; Nvram *m48t59 = NULL; PCIBus *pci_bus; ISABus *isa_bus; void *fw_cfg; int i; uint32_t kernel_base = 0, init...
1threat
Placing the equal sign (=) when merging the data frame and final writing the file writeLines or write.table : <p>I have a data frame given below. there 29 variables and its values. I want to write it with <code>write.table</code> or <code>writeLine</code>, but I want to place the equal sign <code>(=)</code> between the...
0debug
swift "Backslash" how to use it : there are some code: let noteNamesWithSharps = ["C", "C♯", "D", "D♯", "E", "F", "F♯", "G", "G♯", "A", "A♯", "B"] let randomIndex = Int(arc4random_uniform(UInt32(noteNamesWithSharps.count))) lhsinterval.text = "Backslash(noteNamesWithSharps[randomIndex])" i am a beginner t...
0debug
convert associate array to normal array : <p>This is my array </p> <pre><code>$array = array( 1 =&gt; 'A', 2 =&gt; 'B', 3 =&gt; 'C', 4 =&gt; 'D', 5 =&gt; 'E', ); </code></pre> <p>I want to Convert it like this </p> <pre><code>array('A','B','C','D','E'); </code></pre>
0debug
How to concatenate a table resulting from a query into another temporary table on a procedure stored on mysql ? : I have a temporary query, e.g : CREATE TEMPORARY TABLE IF NOT EXISTS table4 AS (select * from table1) and then, i have a another table resulting from a query, like: select column from table2 w...
0debug
populate with mongoose pagination : <p>i tried to fetch data using <code>npm</code> <code>mongoose-paginate</code> but populate is not working </p> <p>here is my <code>UsersSchema.js</code></p> <pre><code>var mongoose = require('mongoose'); var Schema = mongoose.Schema; var usersSchema = new Schema({ name : Strin...
0debug
ImageMagick path error on Sierra (beta) : <p>I'm trying to put watermark on iOS app's appIcon. For that I'm following <a href="https://www.raywenderlich.com/105641/change-app-icon-build-time">Ray's</a> blog and I installed ImageMagick using binary release from <a href="http://www.imagemagick.org/script/binary-releases....
0debug
static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) { ARMCPU *cpu = s->cpu; uint32_t val; switch (offset) { case 4: return ((s->num_irq - NVIC_FIRST_IRQ) / 32) - 1; case 0xd00: return cpu->midr; case 0xd04: val = cpu->env.v...
1threat
ImageIO.read() works in Eclipse runtime but not as runnable jar file : <p>I've got a problem with loading images implemented in a jar file. Here's my file tree:</p> <pre><code> -graphics -ImageFiles -animation -image.jpg -mathspace -META-INF </code></pre> <p>Now I wanna load this...
0debug
need help on my code (im not that good at coding) : I am currently working on this code: import time import webbrowser while True: user_inputq3 = raw_input("Which model of phone is it? ") import csv words=user_inputq3.split(" ") reader=csv.reader(open("task3worksheet.csv")) probl...
0debug
int cpu_load(QEMUFile *f, void *opaque, int version_id) { CPUState *env = opaque; int i; uint32_t tmp; if (version_id != 5) return -EINVAL; for(i = 0; i < 8; i++) qemu_get_betls(f, &env->gregs[i]); qemu_get_be32s(f, &env->nwindows); for(i = 0; i < env->nwindows * ...
1threat
How do I use the native JUnit 5 support in Gradle with the Kotlin DSL? : <p>I want to use the built-in JUnit 5 with the Gradle Kotlin DSL, because during build I get this warning:</p> <pre><code>WARNING: The junit-platform-gradle-plugin is deprecated and will be discontinued in JUnit Platform 1.3. Please use Gradle's ...
0debug
static uint64_t e1000_io_read(void *opaque, target_phys_addr_t addr, unsigned size) { E1000State *s = opaque; (void)s; return 0; }
1threat
When would you use Storyboard vs Nib/Xib vs Coding from scratch? : <p>what are the pro's and con's of each, and what would be the proper way to responde to a question like this in an interview :</p> <p>When would you use Storyboard vs Nib/Xib vs Coding from scratch?</p>
0debug
Add a function to a button made with userscript : <p>I know how to create a button with userscript, but I don't know how to attach a function to the button with userscript. How do I attach a function to the button with userscript? I would also like to add an "id" to the button with userscript. How do I do that? Thanks....
0debug
go version command shows old version number after update to 1.8 : <p>Pretty much the title. I downloaded/installed Go 1.8 for OS X, but when I go</p> <pre><code>$ go version go version go1.7.5 darwin/amd64 </code></pre> <p>My .bashrc look like the following</p> <pre><code># some exports omitted NPM_PACKAGES=/Users/...
0debug
Scanf is not taking input.I am using the following code and scanf is not taking input . I am taking double as scanf input : this is the code i am running #include <stdio.h> #include <math.h> void main() { int i=0; double kl,x0,x1,xk; printf("enter kl"); scanf("%...
0debug
void *mcf_uart_init(qemu_irq irq, CharDriverState *chr) { mcf_uart_state *s; s = g_malloc0(sizeof(mcf_uart_state)); s->chr = chr; s->irq = irq; if (chr) { qemu_chr_add_handlers(chr, mcf_uart_can_receive, mcf_uart_receive, mcf_uart_event, s); } ...
1threat
Extra bottom space/padding on iPhone X? : <p>On the iPhone X in portrait mode, if you set a bottom constraint to safe area to 0, you will end up with an extra space at the bottom of the screen. How do you get programmatically the height of this extra padding ?</p> <p>I managed to manually determine the height of this ...
0debug
gdb_handlesig(CPUState *cpu, int sig) { GDBState *s; char buf[256]; int n; s = gdbserver_state; if (gdbserver_fd < 0 || s->fd < 0) { return sig; } cpu_single_step(cpu, 0); tb_flush(cpu); if (sig != 0) { snprintf(buf, sizeof(buf), "S%02x", targe...
1threat
Rename a TeamCity Build Agent : <p>I have inherited a TeamCity server and I am reviewing the configuration. To make it a little easier, I would like to rename a build agent from a long random name to something a little more easily identifiable. </p> <p>However, I cannot find any options to change the name in the Agent...
0debug
Mysqli query and close within a foreach loop : <p>Within a foreach loop I have a SQL query insert. This query should run two times because I am looping through my session that contains two elements, keys or whatever you prefer to call it. It works fine and it makes a new query for every new iteration. But when I put in...
0debug
def concatenate_elements(list): ans = ' ' for i in list: ans = ans+ ' '+i return (ans)
0debug
int inet_listen_opts(QemuOpts *opts, int port_offset) { struct addrinfo ai,*res,*e; const char *addr; char port[33]; char uaddr[INET6_ADDRSTRLEN+1]; char uport[33]; int slisten,rc,to,try_next; memset(&ai,0, sizeof(ai)); ai.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; ai.ai_fami...
1threat
static void mpeg_decode_extension(AVCodecContext *avctx, UINT8 *buf, int buf_size) { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; int ext_type; init_get_bits(&s->gb, buf, buf_size); ext_type = get_bits(&s->gb, 4); ...
1threat
Database model for car-service : <p>I am working on a project for car-service(denting, painting). In this app user will select their location and then select car brand,model and fuel type.After this he will see a list of services and add them to cart . Then he can make order for services. So, How to design database for...
0debug
Sanitize JSON with php : <p>I always use filter_var($var, FILTER, FLAG); when I get data from $_GET, $_POST and so on, but now this data is a JSON string but I didn't find any filter to sanitize JSON. Anyone know how to implement this filter?</p> <p>PHP filter_var(): <a href="http://php.net/manual/en/function.filter-v...
0debug
Associate a color palette with ggplot2 theme : <p>I want my ggplot2 theme to use a specific set of colors, but don't see how to avoid a separate line outside of the theme.</p> <p>I have this data:</p> <pre><code>library(ggplot2) mycars &lt;- mtcars mycars$cyl &lt;- as.factor(mycars$cyl) </code></pre> <p>And here's a...
0debug
Trouble in R with abline : it's my first time using R - I've only used SPSS before and this is all very confusing for me. I'm having trouble plotting 2 ablines on a graph of the log10 Brain mass and log10 body mass. I'm following someone else's script but it just doesn't work for me. This is what I have: [Click me][...
0debug
first time asking, need a little help here on java loop : Can anyone please tell me which part output the number in front of the * signs? is it the methods or the output? import java.util.*; public class PrintTriangle3 { public static void main(String [] args) { Scanner sc = new Scanner(System.in); S...
0debug
I can't even remotely figure out how to do this : I have to make a method to print out the elements in an array, separated by ‘‘|’’ @param values, an array of integers. Essentially its suppose to take user input, and then from there separate it with |. This is what I have so far. Any help chaps? ...
0debug
static inline int onenand_load_spare(OneNANDState *s, int sec, int secn, void *dest) { uint8_t buf[512]; if (s->blk_cur) { if (blk_read(s->blk_cur, s->secs_cur + (sec >> 5), buf, 1) < 0) { return 1; } memcpy(dest, buf + ((sec & 31) << 4), secn << 4);...
1threat
static void gd_connect_signals(GtkDisplayState *s) { g_signal_connect(s->show_tabs_item, "activate", G_CALLBACK(gd_menu_show_tabs), s); g_signal_connect(s->window, "key-press-event", G_CALLBACK(gd_window_key_event), s); g_signal_connect(s->window, "delete-ev...
1threat
Checking a string for punctuation using loops : <p>How do you check if a string has punctuation by using a loop. I was told to use the in operator </p> <pre><code>string = input("Enter a string") for char in string: if char in "'.,;:?!": print("that string contains punctuation") break else: ...
0debug