problem
stringlengths
26
131k
labels
class label
2 classes
what do && and || mean in the following code : <p>Reading highstock source codes, but confused the following codes:</p> <pre><code>textLineHeight = textStyles &amp;&amp; textStyles.lineHeight, wrapper.height = (height || bBox.height || 0) + 2 * padding; cHeight = (old &amp;&amp; chart.oldChartHeight) || chart.chartHeight; </code></pre> <p>Thanks</p>
0debug
target_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length, struct disassemble_info *info) { int i; for(i = 0; i < length; i++) { myaddr[i] = ldub_code(memaddr + i); } return 0; }
1threat
Angular : how can set the Directive's priority order? : <p>How we can set the directive priority in angular4 like priority value settings in angularjs.?</p>
0debug
How should I read this regex pattern of bash? : <p>I want to ask about read the regex pattern. I have a regex pattern </p> <pre><code>"/^[ \t]*\/\*&lt;O$firstline&gt;\*\//,/^[ \t]*\/\*&lt;\/O$firstline&gt;\*\//s/\/\///g" $Path/DebugVersion.c </code></pre> <p>How should I read this pattern? I need an explanation about this regex. If anyone can explain this to me you can reply this questions. I'm thankful if you answer this question.</p> <p>Regard, Gustina M.S</p>
0debug
how to fix constant expression required in C++? : <p>I try to create a table wich contans a number choosen by user but it given me an error :</p> <blockquote> <p>constant expression required</p> </blockquote> <pre><code>#include &lt;iostream.h&gt; #include &lt;conio.h&gt; main(){ clrscr(); int i,k,nval,pos=0,neg=0; cout&lt;&lt;"Entrer Le nombre de valeur que vous voulez saisir nval = "; cin&gt;&gt;nval; int tab[nval]; for (i=0; i&lt;nval; i++){ k=i+1; cout&lt;&lt;"Le nombre la valeur numeros = "&lt;&lt;k&lt;&lt;"= "; cin&gt;&gt;tab[i]; if (tab[i]&gt;0) pos+=1; else if (tab[i]&lt;0) neg+=1; } cout&lt;&lt;"Le nombre des valeurs positives = "&lt;&lt;pos&lt;&lt;endl; cout&lt;&lt;"Le nombre des valeurs negatives = "&lt;&lt;neg; getch(); return 0; } </code></pre> <p><strong>is there any site to try directly the C++ codes ?.</strong></p>
0debug
db.execute('SELECT * FROM products WHERE product_id = ' + product_input)
1threat
Python: Regex mathching strings that exclude and include two strings : Take two strings, for example aaaa and bbbb, I want a to find a regex that mathches every string containing aaaa as a substring but at the same time don't contain bbbb. Any help will be appreciated! thanks
0debug
How to identify where/for what inline assembly can give a higher execution speed? : <p>I know that when writing some (e.g.) real-time applications execution speed is very important. Sometimes it is possible to obtain higher speed executions by writing inline assembly.</p> <p>I would like to know what would be a good way to identify:</p> <p>1) where most of the time is lost executing an algorithm</p> <p>2) whether writing inline assembly will really enhance execution speed</p> <p>Thank you in advance.</p>
0debug
struct vhost_net *vhost_net_init(VhostNetOptions *options) { int r; bool backend_kernel = options->backend_type == VHOST_BACKEND_TYPE_KERNEL; struct vhost_net *net = g_malloc(sizeof *net); if (!options->net_backend) { fprintf(stderr, "vhost-net requires net backend to be setup\n"); goto fail; } if (backend_kernel) { r = vhost_net_get_fd(options->net_backend); if (r < 0) { goto fail; } net->dev.backend_features = qemu_has_vnet_hdr(options->net_backend) ? 0 : (1 << VHOST_NET_F_VIRTIO_NET_HDR); net->backend = r; } else { net->dev.backend_features = 0; net->backend = -1; } net->nc = options->net_backend; net->dev.nvqs = 2; net->dev.vqs = net->vqs; r = vhost_dev_init(&net->dev, options->opaque, options->backend_type, options->force); if (r < 0) { goto fail; } if (!qemu_has_vnet_hdr_len(options->net_backend, sizeof(struct virtio_net_hdr_mrg_rxbuf))) { net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF); } if (backend_kernel) { if (~net->dev.features & net->dev.backend_features) { fprintf(stderr, "vhost lacks feature mask %" PRIu64 " for backend\n", (uint64_t)(~net->dev.features & net->dev.backend_features)); vhost_dev_cleanup(&net->dev); goto fail; } } vhost_net_ack_features(net, 0); return net; fail: g_free(net); return NULL; }
1threat
static void qcow2_cache_table_release(BlockDriverState *bs, Qcow2Cache *c, int i, int num_tables) { #ifdef CONFIG_LINUX BDRVQcow2State *s = bs->opaque; void *t = qcow2_cache_get_table_addr(bs, c, i); int align = getpagesize(); size_t mem_size = (size_t) s->cluster_size * num_tables; size_t offset = QEMU_ALIGN_UP((uintptr_t) t, align) - (uintptr_t) t; size_t length = QEMU_ALIGN_DOWN(mem_size - offset, align); if (length > 0) { madvise((uint8_t *) t + offset, length, MADV_DONTNEED); } #endif }
1threat
How to fix this bug in android studio : [Please help me fix these bugs, I was making a app these errors are coming while running this app, ][1] [1]: https://i.stack.imgur.com/YiyCC.png
0debug
How can I keep undo history after saving on Visual Studio Code : <p>I'm using latest version of VS code (1.9.0).</p> <p>After I undo (ctrl+z) something, and save the file (ctrl+s), then I cannot redo anymore (ctrl+y).</p> <p>I would like to go back and forth during the editor is running same as Sublime or other editor. Can anyone solve this problem? Thank you.</p>
0debug
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component) { AVComponentDescriptor comp= desc->comp[c]; int plane= comp.plane; int depth= comp.depth_minus1+1; int mask = (1<<depth)-1; int shift= comp.shift; int step = comp.step_minus1+1; int flags= desc->flags; if (flags & PIX_FMT_BITSTREAM){ int skip = x*step + comp.offset_plus1-1; const uint8_t *p = data[plane] + y*linesize[plane] + (skip>>3); int shift = 8 - depth - (skip&7); while(w--){ int val = (*p >> shift) & mask; if(read_pal_component) val= data[1][4*val + c]; shift -= step; p -= shift>>3; shift &= 7; *dst++= val; } } else { const uint8_t *p = data[plane]+ y*linesize[plane] + x*step + comp.offset_plus1-1; while(w--){ int val = flags & PIX_FMT_BE ? AV_RB16(p) : AV_RL16(p); val = (val>>shift) & mask; if(read_pal_component) val= data[1][4*val + c]; p+= step; *dst++= val; } } }
1threat
How should I test Kotlin extension functions? : <p>Can somebody tell me how should I unit-test extension functions in Kotlin? Since they are resolved statically should they be tested as static method calls or as non static ? Also since language is fully interoperable with Java, how Java unit test for Kotlin extension functions should be performed ? </p>
0debug
void ahci_uninit(AHCIState *s) { int i, j; for (i = 0; i < s->ports; i++) { AHCIDevice *ad = &s->dev[i]; for (j = 0; j < 2; j++) { IDEState *s = &ad->port.ifs[j]; ide_exit(s); } } g_free(s->dev); }
1threat
void OPPROTO op_addl_ESI_T0(void) { ESI = (uint32_t)(ESI + T0); }
1threat
static int mp_dacl_setxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size, int flags) { char *buffer; int ret; buffer = rpath(ctx, path); ret = lsetxattr(buffer, MAP_ACL_DEFAULT, value, size, flags); g_free(buffer); return ret; }
1threat
Please suggest error in this program for level order tree traversal : <p>Please suggest error in this program for level order tree traversal I am getting an infinite loop all printing 1</p> <p>Algorithm:</p> <p>For each node, first the node is visited and then it’s child nodes are put in a FIFO queue.</p> <p>printLevelorder(tree)</p> <pre><code>1.Create an empty queue q 2.temp_node = root /*start from root*/ 3.Loop while temp_node is not NULL a) print temp_node-&gt;data. b) Enqueue temp_node’s children (first left then right children) to q c) Dequeue a node from q and assign it’s value to temp_node #include&lt;iostream&gt; </code></pre> <p>This is the node for tree</p> <pre><code>struct node { struct node *left; int data; struct node *right; }; </code></pre> <p>This is node for queue to hold the node of tree</p> <pre><code>struct qnode { struct node *node; struct qnode *next; }; struct frontandrear { struct qnode *front; struct qnode *rear; }; struct node* newNode( int data ) { struct node *new_node = (struct node*)malloc( sizeof( struct node ) ); new_node-&gt;data = data; new_node-&gt;left = new_node-&gt;right = NULL; return new_node; } void enQueue( struct frontandrear *fr, struct node* node ) { struct qnode* new_node = (struct qnode*)malloc( sizeof( struct qnode ) ); new_node-&gt;node = node; if (fr-&gt;rear == NULL) { new_node-&gt;next = NULL; fr-&gt;rear = new_node; fr-&gt;front = new_node; } else { new_node-&gt;next = fr-&gt;rear; fr-&gt;rear = new_node; } } struct node* deQueue( struct frontandrear *fr ) { if (fr-&gt;front == NULL) { return NULL; } struct node* num = fr-&gt;front-&gt;node; fr-&gt;front = fr-&gt;front-&gt;next; if (fr-&gt;front == NULL) { fr-&gt;front = fr-&gt;rear = NULL; } return num; } void printLevelOrder( struct node* root ) { struct frontandrear *frontandrear = (struct frontandrear*)malloc( sizeof( struct frontandrear ) ); frontandrear-&gt;front = frontandrear-&gt;rear = NULL; struct node *temp = root; while (temp != NULL) { printf( "%d\t", root-&gt;data ); if (temp-&gt;left) enQueue( frontandrear, root-&gt;left ); if (temp-&gt;right) enQueue( frontandrear, root-&gt;right ); temp = deQueue( frontandrear ); } } int main( ) { struct node *root = newNode( 1 ); root-&gt;left = newNode( 2 ); root-&gt;right = newNode( 3 ); root-&gt;left-&gt;left = newNode( 4 ); root-&gt;left-&gt;right = newNode( 5 ); printf( "Level Order traversal of binary tree is \n" ); printLevelOrder( root ); } </code></pre>
0debug
void rgb16tobgr24(const uint8_t *src, uint8_t *dst, long src_size) { const uint16_t *end; uint8_t *d = (uint8_t *)dst; const uint16_t *s = (const uint16_t *)src; end = s + src_size/2; while(s < end) { register uint16_t bgr; bgr = *s++; *d++ = (bgr&0xF800)>>8; *d++ = (bgr&0x7E0)>>3; *d++ = (bgr&0x1F)<<3; } }
1threat
How do I check if an std::variant can hold a certain type : <p>I have a class with an <code>std::variant</code> in it. This <code>std::variant</code> type is only allowed to hold a specific list of types.</p> <p>I have template functions which allow the user of the class to insert various values into an <code>std::unordered_map</code>, the map holds values of this variant type. I.e., the user is only allowed to insert values if it's type is in the specific list of types. However, I don't want the user to be able to define this list of types themselves.</p> <pre><code>class GLCapabilities { public: using VariantType = std::variant&lt;GLint64&gt;; // in future this would have other types template &lt;typename T&gt; std::enable_if_t&lt;???&gt; AddCapability(const GLenum parameterName) { if(m_capabilities.count(parameterName) == 0) { /*... get correct value of type T ... */ m_capabilities.insert(parameterName,value); } } template&lt;typename T&gt; std::enable_if_t&lt;???,T&gt; GetCapability(const GLenum parameterName) const { auto itr = m_capabilities.find(parameterName); if(std::holds_alternative&lt;T&gt;(*itr)) return std::get&lt;T&gt;(*itr); return T; } private: std::unordered_map&lt;GLenum,VariantType&gt; m_capabilities; }; </code></pre> <p>You'll see in the above where there's the <code>???</code>, how can I check? Some combination of <code>std::disjunction</code> with <code>std::is_same</code>?</p> <p>Like</p> <pre><code>std::enable_if&lt;std::disjunction&lt;std::is_same&lt;T,/*Variant Types???*/&gt;...&gt;&gt; </code></pre> <p>To make it clear, I'd prefer to not have to check against each allowed type manually.</p>
0debug
static int pci_ich9_uninit(PCIDevice *dev) { struct AHCIPCIState *d; d = DO_UPCAST(struct AHCIPCIState, card, dev); if (msi_enabled(dev)) { msi_uninit(dev); } qemu_unregister_reset(ahci_reset, d); ahci_uninit(&d->ahci); return 0; }
1threat
static int estimate_best_b_count(MpegEncContext *s) { AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id); AVCodecContext *c = avcodec_alloc_context3(NULL); AVFrame input[FF_MAX_B_FRAMES + 2]; const int scale = s->avctx->brd_scale; int i, j, out_size, p_lambda, b_lambda, lambda2; int64_t best_rd = INT64_MAX; int best_b_count = -1; assert(scale >= 0 && scale <= 3); p_lambda = s->last_lambda_for[AV_PICTURE_TYPE_P]; b_lambda = s->last_lambda_for[AV_PICTURE_TYPE_B]; if (!b_lambda) b_lambda = p_lambda; lambda2 = (b_lambda * b_lambda + (1 << FF_LAMBDA_SHIFT) / 2) >> FF_LAMBDA_SHIFT; c->width = s->width >> scale; c->height = s->height >> scale; c->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_PSNR | CODEC_FLAG_INPUT_PRESERVED ; c->flags |= s->avctx->flags & CODEC_FLAG_QPEL; c->mb_decision = s->avctx->mb_decision; c->me_cmp = s->avctx->me_cmp; c->mb_cmp = s->avctx->mb_cmp; c->me_sub_cmp = s->avctx->me_sub_cmp; c->pix_fmt = AV_PIX_FMT_YUV420P; c->time_base = s->avctx->time_base; c->max_b_frames = s->max_b_frames; if (avcodec_open2(c, codec, NULL) < 0) return -1; for (i = 0; i < s->max_b_frames + 2; i++) { int ysize = c->width * c->height; int csize = (c->width / 2) * (c->height / 2); Picture pre_input, *pre_input_ptr = i ? s->input_picture[i - 1] : s->next_picture_ptr; avcodec_get_frame_defaults(&input[i]); input[i].data[0] = av_malloc(ysize + 2 * csize); input[i].data[1] = input[i].data[0] + ysize; input[i].data[2] = input[i].data[1] + csize; input[i].linesize[0] = c->width; input[i].linesize[1] = input[i].linesize[2] = c->width / 2; if (pre_input_ptr && (!i || s->input_picture[i - 1])) { pre_input = *pre_input_ptr; if (!pre_input.shared && i) { pre_input.f.data[0] += INPLACE_OFFSET; pre_input.f.data[1] += INPLACE_OFFSET; pre_input.f.data[2] += INPLACE_OFFSET; } s->dsp.shrink[scale](input[i].data[0], input[i].linesize[0], pre_input.f.data[0], pre_input.f.linesize[0], c->width, c->height); s->dsp.shrink[scale](input[i].data[1], input[i].linesize[1], pre_input.f.data[1], pre_input.f.linesize[1], c->width >> 1, c->height >> 1); s->dsp.shrink[scale](input[i].data[2], input[i].linesize[2], pre_input.f.data[2], pre_input.f.linesize[2], c->width >> 1, c->height >> 1); } } for (j = 0; j < s->max_b_frames + 1; j++) { int64_t rd = 0; if (!s->input_picture[j]) break; c->error[0] = c->error[1] = c->error[2] = 0; input[0].pict_type = AV_PICTURE_TYPE_I; input[0].quality = 1 * FF_QP2LAMBDA; out_size = encode_frame(c, &input[0]); for (i = 0; i < s->max_b_frames + 1; i++) { int is_p = i % (j + 1) == j || i == s->max_b_frames; input[i + 1].pict_type = is_p ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_B; input[i + 1].quality = is_p ? p_lambda : b_lambda; out_size = encode_frame(c, &input[i + 1]); rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3); } while (out_size) { out_size = encode_frame(c, NULL); rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3); } rd += c->error[0] + c->error[1] + c->error[2]; if (rd < best_rd) { best_rd = rd; best_b_count = j; } } avcodec_close(c); av_freep(&c); for (i = 0; i < s->max_b_frames + 2; i++) { av_freep(&input[i].data[0]); } return best_b_count; }
1threat
C compiler and arrays : #include <stdio.h> int main(void){ double arr[] = { 1.1, 2.2, 3.3, 4.4 }; int i; for (i=0; i<=4; i++) { printf("%d\n", i); arr[i] = 0; } return 0; } Compiling with gcc(c90) gives an infinite loop(1,2,3,4,1,2,3,4...) while compiling with gcc(c99) produces only (0, 1, 2, 3, 4). What can be attributed to the difference?
0debug
Insert date into phpmyadmin : I have the following php code : <?php require_once ('./db.php'); $conn = mysqli_connect($servername, $username, $password, $db ,$port); $dir = "Files"; $files = array_diff(scandir($dir), array(".","..")) ; //error_log(count($files)); for($i = 2 ; $i < count($files)+2 ; ++$i){ $d = date ("Y-m-d", filemtime("Files/".$files[$i])); //error_log($d); $insertFilesQuery = "INSERT INTO fichier (Name,Modified) VALUES ('".$files[$i]."','".$d."')"; $resultInsert = mysqli_query($conn,$insertFilesQuery); //sleep(2); } ?> I want to get all the files in a directory and add their name and last modified date (yyyy-mm-dd) into mysql db. The table fichier has 4 columns : Id, Name, Modified, OwnerId, with the type of Modified being a DATE. The code runs with no errors but nothing is inserted into the db. Any help would be appreciated.
0debug
You don't have write permissions for the /usr/bin directory. while installing Cocoapods : <p>I'm trying to install Cocoapods using the following command on my Mac:</p> <pre><code>sudo gem install cocoapods </code></pre> <p>But I'm getting the following error:</p> <pre><code>ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory. </code></pre> <p>Really doesn't make sense as I'm doing is via sudo as the root user. Any help will be appreciated!</p> <p>I'm using gem version 2.7.7 (latest as of today).</p>
0debug
How to return server not found for domain but allow sub directory to show normally : <p>Most all are typically find a way to "not" show can't connect to server browser errors, where is I'm interested in showing it.</p> <p>I have a domain example.com for a YOURLS link shortener. The homepage shows a 403 Forbidden Nginx notice. The example.com/admin shows the working admin site. This will not be publicly facing and if someone goes to example.com should show can't connect to server, so people do not know that site exists (yes, they can do a whois or dns lookup but not worried about that).</p> <p>I could change the nginx server root to be a random location and it would show the desired error but then example.com/admin wouldn't work. Is there any easy fix? In the nginx config there is a line: <code>try_files $uri $uri/ /yourls-loader.php$is_args$args;</code></p> <p>Is there a change I can make there to stop example.com from showing anything but allow example.com/admin to still work? Also yes, I could put a blank index.html but that would show a white page where is looking to show the standard browser error you see if you enter a domain that doesn't have a website.</p> <p>There maybe a name for this, but not sure how to describe it thus have beemn unable to find a solution to this presumably easy problem.</p>
0debug
Async library best practice: ConfigureAwait(false) vs. setting the synchronization context : <p>It's well-known that in a general-purpose library, <code>ConfigureAwait(false)</code> should be used on every await call to avoid continuing on the current SynchronizationContext.</p> <p>As an alternative to peppering the entire codebase with <code>ConfigureAwait(false)</code>, one could simply set the SynchronizationContext to null once, at the public surface method, and restore it before returning to the user. In other words:</p> <pre><code>public async Task SomeSurfaceMethod() { var callerSyncCtx = SynchronizationContext.Current; SynchronizationContext.SetSynchronizationContext(null); try { // Do work } finally { SynchronizationContext.SetSynchronizationContext(callerSyncCtx); } } </code></pre> <p>This could also be wrapped in a <code>using</code> for better readability.</p> <p>Is there a disadvantage to this approach, does it not end up producing the same effect?</p> <p>The major advantage is obviously readability - the removal of all <code>ConfigureAwait(false)</code> calls. It may also reduce the likelihood of forgetting a <code>ConfigureAwait(false)</code> somewhere (although analyzers mitigate this, and it could be argued that developers could just as well forget changing the SynchronizationContext).</p> <p>A somewhat exotic advantage is not embedding the choice of capturing the SynchronizationContext or not in all methods. In other words, in one case I may want to run method X with a SynchronizationContext, while in another I may want to run the same method without one. When <code>ConfigureAwait(false)</code> is embedded everywhere that isn't possible. Granted, this is quite a rare requirement, but I bumped into it while working on Npgsql (triggering this question).</p>
0debug
static int vmxnet3_post_load(void *opaque, int version_id) { VMXNET3State *s = opaque; PCIDevice *d = PCI_DEVICE(s); vmxnet_tx_pkt_init(&s->tx_pkt, s->max_tx_frags, s->peer_has_vhdr); vmxnet_rx_pkt_init(&s->rx_pkt, s->peer_has_vhdr); if (s->msix_used) { if (!vmxnet3_use_msix_vectors(s, VMXNET3_MAX_INTRS)) { VMW_WRPRN("Failed to re-use MSI-X vectors"); msix_uninit(d, &s->msix_bar, &s->msix_bar); s->msix_used = false; return -1; } } return 0; }
1threat
Java trying to get values from HashMap : I want to print the object values. I cant get access to it and dont know how to do it. i cant acess it with value() here is my code public class txtdatei { private String pickerName; private String language; private float volumeGain; private long pickerId; private static Map<Long,txtdatei> mapp=new HashMap<Long,txtdatei>(); public txtdatei(String username, String language, float volume){ this.pickerName=username; this.language=language; this.volumeGain=volume; } public static void main(String[] args){ File file=new File("test.txt"); try{ file.createNewFile(); FileWriter writer =new FileWriter(file); writer.write("username\tbenni\tlanguage\tgerman\n"); writer.flush(); writer.close(); FileReader fr =new FileReader("test.txt"); BufferedReader reader= new BufferedReader(fr); String zeile=reader.readLine(); String [] data=zeile.split("\t"); int i=0; for(i=0;i<data.length;i++) { if(data[i].equals("Username")) { mapp.put((long)(1),new txtdatei(data[2],data[4],Float.parseFloat(data[6]))); } } System.out.println(mapp.get(1)); //dont know how to read the }catch(IOException ioe){ioe.printStackTrace();} } hope someone can help me thanks hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
0debug
export PATH="$HOME/.composer/vendor/bin:$PATH" can u please help me how to do this step in windows 8 : Hello i'm trying to execute this command export PATH="$HOME/.composer/vendor/bin:$PATH" in windows.
0debug
In my table view i have no cell only section so, how can i reload tableview in ios objective c : i try to reload method to call in tableview [self.tableview reloadData]; and also try for (int i = 0; i<self->allMessageKey.count; i++) { NSIndexSet *sec = [NSIndexSet indexSetWithIndex:i]; [self->chatTableView beginUpdates]; //NSIndexPath *section = [NSIndexPath indexPathForRow:NSNotFound inSection:i]; [self->chatTableView insertSections:sec withRowAnimation:UITableViewRowAnimationBottom]; if (i == self->allMessageKey.count-1) { [self->chatTableView endUpdates]; NSIndexPath *ip = [NSIndexPath indexPathForRow:NSNotFound inSection:self->allMessageKey.count-1]; [self->chatTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionNone animated:NO]; } } no reload the data show in tableview.
0debug
static void set_frame_distances(MpegEncContext * s){ assert(s->current_picture_ptr->f.pts != AV_NOPTS_VALUE); s->time = s->current_picture_ptr->f.pts * s->avctx->time_base.num; if(s->pict_type==AV_PICTURE_TYPE_B){ s->pb_time= s->pp_time - (s->last_non_b_time - s->time); assert(s->pb_time > 0 && s->pb_time < s->pp_time); }else{ s->pp_time= s->time - s->last_non_b_time; s->last_non_b_time= s->time; assert(s->picture_number==0 || s->pp_time > 0); } }
1threat
Delphi NAS ForceDirectories : I cannot seem to be able to ForceDirectories on a NAS partition with Delphi. I can create a folder on the NAS with Windows explorer fine. Code is: procedure TForm3.Button1Click(Sender: TObject); var tempDir: String; begin tempDir := 'z:\ttt\ttttest'; if NOT DirectoryExists(tempDir) then if System.SysUtils.ForceDirectories(tempDir) then ShowMessage('Dir: ' + tempDir + ' Forced alright') else ShowMessage('Dir: ' + tempDir + ' Force FAILED with error : '+ IntToStr(GetLastError)); end; Z: is the Western Digital Network Attached Storage which works fine in all other respects. The code returns error 3 every time. Same code works alright on local drives. Delphi Seattle, Windows 10 64 bit.
0debug
void qemu_init_vcpu(void *_env) { CPUState *env = _env; int r; env->nr_cores = smp_cores; env->nr_threads = smp_threads; if (kvm_enabled()) { r = kvm_init_vcpu(env); if (r < 0) { fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r)); exit(1); } qemu_kvm_init_cpu_signals(env); } else { qemu_tcg_init_cpu_signals(); } }
1threat
for security purpose i want to encode source code of my html page : <p>i want to design my html page such that; if some body wants to copy my source code from browser it should appear as in encoded format. Is it possible? Thank you.</p>
0debug
How can I use a for loop inside an if condition? The condition is - If user input a value which is less than 10 then a list of 1-10 will be print : <p>The condition is - If user input a value which is less than 10 then a list of 1-10 will be print. </p> <p>I am able to take the input but the condition and loop is not working.</p>
0debug
void helper_fcmpu(CPUPPCState *env, uint64_t arg1, uint64_t arg2, uint32_t crfD) { CPU_DoubleU farg1, farg2; uint32_t ret = 0; farg1.ll = arg1; farg2.ll = arg2; if (unlikely(float64_is_any_nan(farg1.d) || float64_is_any_nan(farg2.d))) { ret = 0x01UL; } else if (float64_lt(farg1.d, farg2.d, &env->fp_status)) { ret = 0x08UL; } else if (!float64_le(farg1.d, farg2.d, &env->fp_status)) { ret = 0x04UL; } else { ret = 0x02UL; } env->fpscr &= ~(0x0F << FPSCR_FPRF); env->fpscr |= ret << FPSCR_FPRF; env->crf[crfD] = ret; if (unlikely(ret == 0x01UL && (float64_is_signaling_nan(farg1.d) || float64_is_signaling_nan(farg2.d)))) { fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN); } }
1threat
Event handler on chosen option : <p>I need to handle alert event on chosen option.</p> <pre><code> &lt;select&gt; &lt;option value="1"&gt;A&lt;/option&gt; &lt;option value="2"&gt;B&lt;/option&gt; &lt;option value="3"&gt;C&lt;/option&gt; &lt;option value="3"&gt;D&lt;/option&gt; &lt;/select&gt; </code></pre> <p>For ex., if I choose "B" option, I want alert like "Chosen option is: B", etc...</p> <p>Thank you!</p>
0debug
html,css hi im having trouble with the box. in my screen it looks good but a soon my friend do he has to scroll to see the box : html,css hi im having trouble with the box. in my screen it looks good but a soon my friend do he has to scroll to see the box. here is the code. what am i doing wrong? btw how can i make it reponsive for moblie. `.three{ border:1px solid black; height:420px; width:280px; margin-top:-390px; margin-left:1100px; background-image:url(https://scontent-atl3-1.xx.fbcdn.net/v/t34.0-12/16112073_395630670772700_1781030081_n.jpg?oh=8c322f4e2cf22c38fa6b20744e28b378&oe=587F0976); box-shadow:10px 10px #000; background-size:cover; background-position:center; -ms-transform: rotate(7deg); -webkit-transform: rotate(7deg); transform: rotate(7deg); }` https://codepen.io/iDarknesskiller/pen/qRavGy
0debug
int qdev_unplug(DeviceState *dev) { if (!dev->parent_bus->allow_hotplug) { qerror_report(QERR_BUS_NO_HOTPLUG, dev->parent_bus->name); return -1; } assert(dev->info->unplug != NULL); if (dev->ref != 0) { qerror_report(QERR_DEVICE_IN_USE, dev->id?:""); return -1; } qdev_hot_removed = true; return dev->info->unplug(dev); }
1threat
static void gen_add16(TCGv t0, TCGv t1) { TCGv tmp = new_tmp(); tcg_gen_xor_i32(tmp, t0, t1); tcg_gen_andi_i32(tmp, tmp, 0x8000); tcg_gen_andi_i32(t0, t0, ~0x8000); tcg_gen_andi_i32(t1, t1, ~0x8000); tcg_gen_add_i32(t0, t0, t1); tcg_gen_xor_i32(t0, t0, tmp); dead_tmp(tmp); dead_tmp(t1); }
1threat
JQuery: sort td values on multiple tables : I'd need to sort the first td elements of a 3 html tables. I must use Jquery to do it. Not pure javascript. Exemple: <table> <tr> <td>cx</td> <td>xx</td> </tr> </table> <table> <tr> <td>bx</td> <td>xx</td> </tr> </table> <table> <tr> <td>ax</td> <td>xx</td> </tr> </table> The result I would like to get is: <table> <tr> <td>ax</td> <td>xx</td> </tr> </table> <table> <tr> <td>cx</td> <td>xx</td> </tr> </table> <table> <tr> <td>ex</td> <td>xx</td> </tr> </table> I have tried to use $.each loop to
0debug
how to use if(math.random == 50)? : <p>So i am trying to make a site that picks a random number and if that number is between for example 50-60 it is going to do something</p> <p>Here is some code:</p> <pre><code>var opengg; window.onload = function() { opengg = function() { console.log(Math.floor(Math.random() * 100)); if (Math.floor(Math.random() * 100) == 50) { console.log("test") } } } </code></pre>
0debug
Is it possible to link directly to Google search results using href? : <p>I would like to link directly to a search results page from a standard link. To give an example of what I'm hoping for, here is some pseudocode:</p> <pre><code>&lt;a href = "https://www.google.com/search?keywords=My+Search+Parameters"&gt;Click here to search Google&lt;/a&gt; </code></pre> <p>Is there any way to do this? I would like to redirect my users directly to a search results page so they can see real results on the web.</p>
0debug
How to find weather array have other elemnt or not : I have any array var myArr = [1,1,1,1,1]; if all the element in array then we return true and else false. eg : myArr[1,1,1,1,1] return true; myArr[1,2,1,1,1] return false; for(var i=0; i<myArr.length; i++){ if(myArr[i] != myArr[i+1]){ flg = false; } } Can anyone help me to design this code.
0debug
How does Observables (Rx.js) compare to ES2015 generators? : <p>As far as I understand, following are the techniques to solve asynchronous programming workflows:</p> <ol> <li>Callbacks (CSP)</li> <li>Promises</li> </ol> <p>Newer approaches:</p> <ol> <li>Rx.js Observables (or mostjs, bacon.js, xstream etc)</li> <li>ES6 generators</li> <li>Async/Await</li> </ol> <p>We are now moving away from callbacks &amp; promises to these newer approaches. What I understand currently is - Async/Await is more like a cleaner abstraction on top of ES2015 generators.</p> <p><strong>What I am not able to understand is the conceptual difference between Observables and Generators.</strong> I have used both extensively and have no trouble in using them.</p> <p>What confuses me is the use case for Observables and Generators. I have come to conclusion that, in the end, they are addressing the same problem - asynchronicity. Only potential difference I see is generators inherently provide imperative semantics to code while Observables using Rxjs seem to provide reactive paradigm. But is that it?</p> <p>Should that be the criteria to choose between Observable and Generator? What are the pros and cons.</p> <p><strong>Am I missing the big picture?</strong></p> <p>Also with Observable eventually making into future Ecmascript, are Promises (with cancelable-token)/Observable/Generators going to compete with each other?</p>
0debug
Run program B from program A only? : <p>I have a program named A, which is responsible for telling the user about the news and updates of my program, then it should run program B which is the main program. How would I make program B openable only from program A??</p>
0debug
How to set Javascript manipulation to all pages in my website but giving it value once : I am building a website in which i have added function to change theme.But issue is that I have many pages in my websites And when i move to next page it resets default value.I want to select theme once and then keep that theme in my whole website
0debug
if_start(void) { struct mbuf *ifm, *ifqt; DEBUG_CALL("if_start"); if (if_queued == 0) return; again: if (!slirp_can_output()) return; if (if_fastq.ifq_next != &if_fastq) { ifm = if_fastq.ifq_next; } else { if (next_m != &if_batchq) ifm = next_m; else ifm = if_batchq.ifq_next; next_m = ifm->ifq_next; } ifqt = ifm->ifq_prev; remque(ifm); --if_queued; if (ifm->ifs_next != ifm) { insque(ifm->ifs_next, ifqt); ifs_remque(ifm); } if (ifm->ifq_so) { if (--ifm->ifq_so->so_queued == 0) ifm->ifq_so->so_nqueued = 0; } if_encap(ifm->m_data, ifm->m_len); if (if_queued) goto again; }
1threat
I am working on the fragments. but I get struct at the point..please help me to solve this : I want to pass the listener parameter to the fragment but I am getting the error at i have declared the editTextAge globally editTextAge.setOnClickListener(new View.OnClickListener() { DlgNumberPickerFragm newFragment = new DlgNumberPickerFragm(); @Override public void onClick(View v) { DlgNumberPickerFragm.dlgAgePicker(R.string.app_name, R.drawable.imgdialogbox, "\t\t\tSelect Age", AdptCardUI.this).show(this.newFragment.getFragmentManager(), "first"); } }); at AdptCardUI.this).show(this.newFragment.getFragmentManager(), "first"); } }); i have tried this).show(this.getFragmentManager(); this).show(this.getChildFragmentManager(); this).show(this.newFragment.getFragmentManager(); AdptCardUI.this).show(this.newFragment.getFragmentManager(); but i didnt got any answer please help me in this
0debug
static void virtio_net_save(QEMUFile *f, void *opaque) { VirtIONet *n = opaque; virtio_save(&n->vdev, f); qemu_put_buffer(f, n->mac, ETH_ALEN); qemu_put_be32(f, n->tx_timer_active); qemu_put_be32(f, n->mergeable_rx_bufs); qemu_put_be16(f, n->status); qemu_put_byte(f, n->promisc); qemu_put_byte(f, n->allmulti); qemu_put_be32(f, n->mac_table.in_use); qemu_put_buffer(f, n->mac_table.macs, n->mac_table.in_use * ETH_ALEN); qemu_put_buffer(f, (uint8_t *)n->vlans, MAX_VLAN >> 3); qemu_put_be32(f, 0); qemu_put_byte(f, n->mac_table.multi_overflow); qemu_put_byte(f, n->mac_table.uni_overflow); qemu_put_byte(f, n->alluni); qemu_put_byte(f, n->nomulti); qemu_put_byte(f, n->nouni); qemu_put_byte(f, n->nobcast); }
1threat
Angular 2 exact RouterLinkActive including fragments? : <p>When using <code>routerLink</code> and <code>routerLinkActive</code> to apply CSS to a navigation bar, I'd like to also include the <code>fragment</code> information so that links are unique for sections within a homepage.</p> <p>I've tried using <code>[routerLinkActiveOptions]="{ exact: true }"</code> wihtout any luck.</p> <p>The relevant part of the navigation bar code is:</p> <pre><code> &lt;li routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }"&gt; &lt;a routerLink="/sitio" fragment="inicio"&gt;Inicio&lt;/a&gt; &lt;/li&gt; &lt;li routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }"&gt; &lt;a routerLink="/sitio" fragment="invierte"&gt;Invierte&lt;/a&gt; &lt;/li&gt; &lt;li routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }"&gt; &lt;a routerLink="/sitio" fragment="contacto"&gt;Contacto&lt;/a&gt; &lt;/li&gt; </code></pre> <p>The three different URLs the above code visits are:</p> <ul> <li><code>/sitio#inicio</code></li> <li><code>/sitio#invierte</code></li> <li><code>/sitio#contacto</code></li> </ul> <p>But when clickin any of them, all of them are marked as being active (because they correspond to the <code>routerLink="/sitio"</code> and the <code>fragment=*</code> information is not included in the check. This results in the navigation bar looking like this when clicking on any of them:</p> <p><a href="https://i.stack.imgur.com/bOWE7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bOWE7.png" alt="enter image description here"></a></p> <p>Any ideas on how to do this?</p>
0debug
'<Branch>' is already checked out at '</other/location>' in git worktrees : <p>I started using git worktrees. It seems to work, but I'm getting this error when attempting to check out a branch in the cloned worktree:</p> <pre><code>fatal: '&lt;branch&gt;' is already checked out at '&lt;/other/location&gt;' </code></pre> <p>How do I get around this without deleting the <code>.git/worktrees</code> directory?</p>
0debug
How to get an Object by name from Datastructure in javascript : <p>I have the following Datastructur in Javascript</p> <pre><code> data: {…} 0_0: {…} file: “xy.jpg” height: 256 width: 256 &lt;prototype&gt;: Object { … } 0_256: {…} file: "xx.jpg" height: 256 width: 256 &lt;prototype&gt;: Object { … } </code></pre> <p>How can I get the data from "0_256"?</p>
0debug
How to convert an Array to Array of Object in Javascript : <p>I want to convert an Array like:</p> <pre><code>[ 'John', 'Jane' ] </code></pre> <p>into an array of object pairs like this:</p> <pre><code> [{'name': 'John'}, {'name':'Jane'}] </code></pre> <p>Please help me to do so..</p>
0debug
C# array include symbol : <p>I have list of items:</p> <pre><code>Apple\3 Orange\8 Kivi\9 </code></pre> <p>I wish to add these items in C # array:</p> <pre><code>string[] fruit={"Apple\3","Orange\8","Kivi\9"}; </code></pre> <p>But it return me error as the backslash not acceptable ("\"), by the way the backslash is a must to include, anyone have ideas?</p>
0debug
Hyper-v screen resolution in Ubuntu VM with RemoteFX video adapter : <p>I am using Hyper-V for the first time on a Windows 10 installation where I am having some issues with screen resolution in my Ubuntu 18.04 desktop VM.</p> <p>Guides propose these actions in order to configuration screen resulution for linux based VMs:</p> <p>Edit grub:</p> <pre><code>sudo nano /etc/default/grub </code></pre> <p>Add video=hyperv_fb:1920x1080:</p> <pre><code>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080" </code></pre> <p>Update grub:</p> <pre><code>sudo update-grub </code></pre> <p>And then reboot.</p> <p>That works just fine until you want to use <strong>RemoteFX 3D Video Adapter</strong> which suddenly changes the screen resolution down to 800x600. Moving windows and browsing the web in the VM seems fine and in Hyper-v Manager under "Physical GPUs" it says "1 virtual machine are currently using this GPU".</p> <p>I have seen suggestion where installing <strong>linux-image-extra-virtual</strong> package will provide a HyperV display driver but that seems to change nothing. Maybe I am missing something here?</p> <p>So I am looking for input for how I can be able to use RemoteFX and have a usable resolution in my Ubuntu VM. Suggestions?</p>
0debug
Open a directory using specific path url : how to open a location of file in local machine using specific path in c++? path as input:(such as D:downloads/sample.txt) output :after executing the automatically the fie location is opened.
0debug
int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) { AVStream *st; enum CodecID id; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); id = s->iformat->value; if (id == CODEC_ID_RAWVIDEO) { st->codec->codec_type = AVMEDIA_TYPE_VIDEO; } else { st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = id; switch(st->codec->codec_type) { case AVMEDIA_TYPE_AUDIO: { RawAudioDemuxerContext *s1 = s->priv_data; st->codec->channels = 1; if (id == CODEC_ID_ADPCM_G722) st->codec->sample_rate = 16000; if (s1 && s1->sample_rate) st->codec->sample_rate = s1->sample_rate; if (s1 && s1->channels) st->codec->channels = s1->channels; st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id); assert(st->codec->bits_per_coded_sample > 0); st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8; av_set_pts_info(st, 64, 1, st->codec->sample_rate); break; case AVMEDIA_TYPE_VIDEO: { FFRawVideoDemuxerContext *s1 = s->priv_data; int width = 0, height = 0, ret = 0; enum PixelFormat pix_fmt; AVRational framerate; if (s1->video_size && (ret = av_parse_video_size(&width, &height, s1->video_size)) < 0) { av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n"); goto fail; if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == PIX_FMT_NONE) { av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", s1->pixel_format); ret = AVERROR(EINVAL); goto fail; if ((ret = av_parse_video_rate(&framerate, s1->framerate)) < 0) { av_log(s, AV_LOG_ERROR, "Could not parse framerate: %s.\n", s1->framerate); goto fail; av_set_pts_info(st, 64, framerate.den, framerate.num); st->codec->width = width; st->codec->height = height; st->codec->pix_fmt = pix_fmt; fail: return ret; default: return -1; return 0;
1threat
static void virtio_blk_set_config(VirtIODevice *vdev, const uint8_t *config) { VirtIOBlock *s = VIRTIO_BLK(vdev); struct virtio_blk_config blkcfg; memcpy(&blkcfg, config, sizeof(blkcfg)); aio_context_acquire(bdrv_get_aio_context(s->bs)); bdrv_set_enable_write_cache(s->bs, blkcfg.wce != 0); aio_context_release(bdrv_get_aio_context(s->bs)); }
1threat
AlphaCPU *cpu_alpha_init(const char *cpu_model) { AlphaCPU *cpu; ObjectClass *cpu_class; cpu_class = alpha_cpu_class_by_name(cpu_model); if (cpu_class == NULL) { cpu_class = object_class_by_name(TYPE("ev67")); } cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class))); object_property_set_bool(OBJECT(cpu), true, "realized", NULL); return cpu; }
1threat
MVVM architectural pattern for a ReactJS application : <p>I'm a semi-senior <code>react</code> and <code>JavaScript</code> developer, I've made several Universal <code>react</code> application.</p> <p>Today our CTO told me: <em>Do you use a software architectural pattern for your application?</em></p> <p>I've no answer, He points to the <code>Android</code> team which use <code>MVVM</code> for their applications.</p> <p>I'm searching greedy but not found a trend methodology or example for this situation. I've used <code>Redux</code>, <code>Redux-Saga</code>, <code>React-Context</code> and etc.</p> <p>I don't know how to explain to our CTO or what is his answer? </p> <p>Hence: <strong>Does a <code>react</code> app really need a software architectural pattern?</strong></p>
0debug
Angular 6 - Switch between two components in main component : <p>I have an app in Angular 6 and bootstrap. I have a main component, I want to be able to switch between two sub components in the main component but stay on the main component route. I have recreated here: </p> <p><a href="https://stackblitz.com/edit/angular-xujgmw" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-xujgmw</a></p> <p>Any ideas? </p>
0debug
I have this Probleme ,please some one help me : Error:com.android.builder.internal.aapt.AaptException: Failed to crunch file C:\Users\SONY\Desktop\Project tango\zip folder Project Tango\tango-examples-java-master\Solution\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.4.0\res\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\SONY\Desktop\Project tango\zip folder Project Tango\tango-examples-java-master\Solution\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png Error:Execution failed for task ':app:mergeDebugResources'. > Error: com.android.builder.internal.aapt.AaptException: Failed to crunch file C:\Users\SONY\Desktop\Project tango\zip folder Project Tango\tango-examples-java-master\Solution\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.4.0\res\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png into C:\Users\SONY\Desktop\Project tango\zip folder Project Tango\tango-examples-java-master\Solution\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_default_mtrl_alpha.9.png
0debug
HTML display links containing CODE-Tag : In HTML I'm trying to display links containing monospaced characters (i. e. for program code): Example: [example for value="`47`"][1] <a href="http://example.com/somewhere.html">example for value="<code>47</code>"</a> On the screen the underline is splitted (very ugly...). How to avoid this? Are there better style recommendations? I. E. in connection with representation of code, like HTML elements or attributes... [1]: http://example.com/somewhere.html
0debug
How to see logs from npm installation? : <p>I am unable to install ionic through npm. Are there any logs that I can check to see what's wrong and if yes, where are they located?</p> <p>What I see is the waiting stick dancing forever. I've waited for an hour or so but nothing changes.</p>
0debug
How to group the elements of my list? : <p>i had a list: </p> <pre><code> list = ['a', 'b', 'c', 'd', 'e', 'f'] </code></pre> <p>how would I go about converting this list to:</p> <pre><code> list = ['ab', 'cd', 'ef'] </code></pre> <p>Thanks in advance!</p>
0debug
int qemu_reset_requested_get(void) { return reset_requested; }
1threat
Hyperlink a HTML file inside another HTML file in Notepad++ : I'm a bit of a noob when it comes to HTML, but I would like to hyperlink a word to open another html file. I have an understanding of linking to another website, just not to another file on my computer. Can someone help? Cheers.
0debug
How can I change the format of the phone number in my example? : I have this sample: [link][1] [1]: http://jsfiddle.net/Xxk3F/2864/ **CODE HTML:** <input class="" type="text" name="primary_phone" id="primary_phone" maxlength="10" placeholder="1234567890"> **CODE CSS:** $( "#primary_phone" ).blur(function() { text = $(this).val().replace(/(\d{3})(\d{3})(\d{4})/, "$1-$2-$3"); $(this).val(text); }); At this time, the format is the next phone 123-123-1123 I want to have the next form: (123)456-7890 How can I change the format to whatever shape that I want? Thanks in advance!
0debug
Duplicating a git repository and its GIT-LFS settings : <p>I've duplicated a repo into a newer repo but when doing a git clone on the new repo it's unable to download the files using the LFS pointers and I get an error when smudge is used... e.g... "Error downloading object. Object not found on server"</p> <p>Steps:</p> <pre><code>git clone --bare https://github.com/myuser/old-repo.git cd old-repository.git git push --mirror https://github.com/myuser/new-repo.git git clone https://github.com/myuser/new-repo.git [error.....git-lfs.exe smudge --- somefile.....Error downloading object] </code></pre> <p>The branches and commit histories look fine but LFS fails to download the required files. Is there another method when using git-lfs?</p>
0debug
Enable Visual Studio Code to generate constructor from Typescript class : <p>I use Visual Studio Code to develop Angular 2 apps in Typescript. Is there any means to save the effort of writing constructors with its parameter list myself?</p> <p>Would be great if the IDE could generate the constructor based on the class members like e.g. Eclipse can do it for Java.</p>
0debug
python - difference between print and return : <p>If I print the result of the <code>for loop</code> in this <code>function</code>:</p> <pre><code>def show_recommendations_for_track(tracks = [], *args): results = sp.recommendations(seed_tracks = tracks, limit=100) tracks = results['tracks'] for track in tracks: print track['name'] </code></pre> <p>It prints one hundred track names.</p> <p>If I swap <code>print</code> for <code>return track['name']</code>,</p> <p>it prints only one track name.</p> <p>why?</p>
0debug
void migrate_fd_connect(MigrationState *s) { s->state = MIG_STATE_ACTIVE; trace_migrate_set_state(MIG_STATE_ACTIVE); s->bytes_xfer = 0; s->expected_downtime = max_downtime/1000000; s->cleanup_bh = qemu_bh_new(migrate_fd_cleanup, s); s->file = qemu_fopen_ops(s, &migration_file_ops); qemu_file_set_rate_limit(s->file, s->bandwidth_limit / XFER_LIMIT_RATIO); qemu_thread_create(&s->thread, migration_thread, s, QEMU_THREAD_JOINABLE); notifier_list_notify(&migration_state_notifiers, s); }
1threat
Changing logo on different background colors : <p>I am making a custom website where each section has a different background colour, on the scroll of each section the logo should change the colour of the logo is purple for eg. if the first section has a carousel and below there is a red background when scrolled the logo should change to white.</p>
0debug
int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf1, int count1) { BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (!drv->bdrv_pread) return bdrv_pread_em(bs, offset, buf1, count1); return drv->bdrv_pread(bs, offset, buf1, count1); }
1threat
static void data_plane_remove_op_blockers(VirtIOBlockDataPlane *s) { if (s->blocker) { blk_op_unblock_all(s->conf->conf.blk, s->blocker); error_free(s->blocker); s->blocker = NULL; } }
1threat
Convert decimal to whole number in java : <p>I need to separate the whole number and decimal value. Representing both values as whole numbers.</p> <p>For example, 1.24 would output:</p> <p>Whole number: 1 Decimal: 24 </p>
0debug
ActiveRecord::NoEnvironmentInSchemaError : <p>I'm trying to perform database related operations on my newly upgraded app(Rails 5) and I'm unable to perform destructive database commands locally.<br> <code>rails db:reset</code> or <code>rails db:drop</code> .</p> <p>The trace results with the following data,</p> <pre><code>rails db:drop --trace ** Invoke db:drop (first_time) ** Invoke db:load_config (first_time) ** Execute db:load_config ** Invoke db:check_protected_environments (first_time) ** Invoke environment (first_time) ** Execute environment ** Invoke db:load_config ** Execute db:check_protected_environments rails aborted! ActiveRecord::NoEnvironmentInSchemaError: Environment data not found in the schema. To resolve this issue, run: bin/rails db:environment:set RAILS_ENV=development </code></pre> <p>What I've tried so far are,</p> <ol> <li>Setting <code>bin/rails db:environment:set RAILS_ENV=development</code>, doesn't change anything still the error occurs.</li> <li>Setting Environment variable manually to development.</li> </ol> <p>None of these helped. I'm Looking for a fix or workaround.</p>
0debug
ReactJS apply multiple inline styles : <p>Let's say I have the following styles:</p> <pre><code>const styles = StyleSheet.create({ padding: { padding: 10 }, margin: { margin: 10 } }); </code></pre> <p>and I want to apply both of them to a react component?</p>
0debug
Append to array inside in statement Swift 3 : I am trying to append to an array inside an in statement, I already declared the array outside of the in statement `var AnArray = [String]()` But when I try to append to the array inside an in statement: `self.AnArray.append("hello")` and then print it outside of the in statement, `print (AnArray)`.However, when I print the array inside the in statement, it is able to append. How can I solve this? Thanks!
0debug
static void gen_addq(DisasContext *s, TCGv_i64 val, int rlow, int rhigh) { TCGv_i64 tmp; TCGv tmpl; TCGv tmph; tmpl = load_reg(s, rlow); tmph = load_reg(s, rhigh); tmp = tcg_temp_new_i64(); tcg_gen_concat_i32_i64(tmp, tmpl, tmph); dead_tmp(tmpl); dead_tmp(tmph); tcg_gen_add_i64(val, val, tmp); tcg_temp_free_i64(tmp); }
1threat
To write a Query to sort in Uppercase in php my admin. : <p>How to execute a query to convert a column in UPPERCASE in php myadmin?</p>
0debug
What is the best practice for adding constants in laravel? (Long List) : <p>I am rather new to laravel. I have a basic question, What is the best way to add constants in laravel. I know the .env method that we use to add the constants. Also I have made one constants file to use them for my project. For example:</p> <pre><code>define('OPTION_ATTACHMENT', 13); define('OPTION_EMAIL', 14); define('OPTION_MONETERY', 15); define('OPTION_RATINGS', 16); define('OPTION_TEXTAREA', 17); </code></pre> <p>And so on. It can reach upto 100 or more records. So What should be the best approach to write the constants. The .env method. Or adding the constant.php file?</p> <p>Thanks </p>
0debug
from itertools import groupby def encode_list(list1): return [[len(list(group)), key] for key, group in groupby(list1)]
0debug
VM error while starting Wildfly (JBoss) server : <p>I have wildfly-10.0.0.Final available with PATH variable set. I am using Ubuntu. Also I have jdk1.7.0_79. I am facing the problem that as when I am trying to start server that is executing standalone.sh then I am getting the error,</p> <p><code>Unrecognized VM option 'MetaspaceSize=96M' </code> <code>Error: Could not create the Java Virtual Machine. </code> <code>Error: A fatal exception has occurred. Program will exit.</code></p>
0debug
How to set the background color of a Row() in Flutter? : <p>I'm trying to set up a background color for a Row() widget, but Row itself has no background color or color attribute. I've been able to set the background color of a container to grey, right before the purple-backgrounded text, but the text itself does not fill the background completely and the following spacer does not take any color at all.</p> <p>So how can I have the Row background set to the "HexColor(COLOR_LIGHT_GREY)" value so it spans over the whole row? </p> <p>Any idea? Thanks a lot!</p> <p><a href="https://i.stack.imgur.com/hCeM3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hCeM3.png" alt="enter image description here"></a></p> <p>Here's the code that I have so far:</p> <pre><code>import 'package:flutter/material.dart'; import '../manager/ShoppingListManager.dart'; import '../model/ShoppingListModel.dart'; import '../hexColor.dart'; import '../Constants.dart'; class ShoppingListWidget extends StatelessWidget { final Color color = Colors.amberAccent; final int shoppingListIndex; ShoppingListWidget({this.shoppingListIndex}); @override Widget build(BuildContext context) { ShoppingListManager slm = new ShoppingListManager(); String shoppingListName = slm.myShoppingLists.shoppingLists[shoppingListIndex].name; int categoryCount = slm.myShoppingLists.shoppingLists[shoppingListIndex].categories.length; return Scaffold( appBar: AppBar( title: Text(shoppingListName), automaticallyImplyLeading: true, ), body: ListView.builder( itemBuilder: (context, index) { Category cat = slm.myShoppingLists.shoppingLists[shoppingListIndex] .categories[index]; return Container( decoration: new BoxDecoration( border: new Border.all(color: Colors.grey[500]), color: Colors.white, ), child: new Column( children: &lt;Widget&gt;[ getCategoryWidget(context, cat), getCategoryItems(context, cat), ], ), ); }, itemCount: categoryCount, ), ); } // Render the category "headline" row where I want to set the background color // to HexColor(COLOR_LIGHT_GREY) Widget getCategoryWidget(BuildContext context, Category cat) { return new Row( children: &lt;Widget&gt;[ new Container(height: 40.0, width: 10.0, color: HexColor(cat.color)), new Container( height: 40.0, width: 15.0, color: HexColor(COLOR_LIGHT_GREY)), new Container( child: new Text("Category", textAlign: TextAlign.start, style: TextStyle( fontFamily: 'Bold', fontSize: 18.0, color: Colors.black), ), decoration: new BoxDecoration( color: Colors.purple, ), height: 40.0, ), Spacer(), CircleAvatar( backgroundImage: new AssetImage('assets/icons/food/food_settings.png'), backgroundColor: HexColor(COLOR_LIGHT_GREY), radius: 15.0, ), new Container(height: 15.0, width: 10.0, color: Colors.transparent), ], ); } // render the category items Widget getCategoryItems(BuildContext context, Category cat) { return ListView.builder( itemBuilder: (context, index) { String itemName = "Subcategory"; return new Row(children: &lt;Widget&gt;[ new Container(height: 40.0, width: 5.0, color: HexColor(cat.color)), new Container(height: 40.0, width: 20.0, color: Colors.white), new Container( child: new Text(itemName), color: Colors.white, ), Spacer() ]); }, itemCount: cat.items.length, shrinkWrap: true, physics: ClampingScrollPhysics(), ); } } </code></pre>
0debug
how to select particular data from a table at my sql? : can anyone help me how to select last data with some condition from my table at mysql ? but, i don't need to LIMIT my data, or search for any MAX or MIN data.
0debug
def power_base_sum(base, power): return sum([int(i) for i in str(pow(base, power))])
0debug
Lock alternatives for async context? : <p>Context: primitive chat bot.</p> <p>I have a simple code:</p> <pre><code>private static bool busy; private async void OnTimedEvent(object sender, ElapsedEventArgs e) { if (!busy) { busy = true; //some logic await SomeAsyncCommand(); busy = false; } else { await Reply("Stuff's busy yo"); // falling thru, no need to process every request } } </code></pre> <p>And it works fine so far, I haven't encountered any "non-atomic precision issues" with <code>bool</code> yet. The issue arises when I start to do more complex stuff in async/await context, for example:</p> <pre><code>public async Task AddEntry(string url, DateTime time, User user) { UpdateUser(user); // We cant fall thru here, all sent requests MUST be processed so we wait while (busy) { await Task.Delay(100); // checking every 100ms if we can enter } busy = true; // working with NON-CONCURRENT collection // can await as well busy = false; } </code></pre> <p>My understanding is - as these threads pile up waiting for the "boolean lock" to be released, there could be a case when two of them will enter at the same time which is kill.</p> <p>I know I cant use lock in the await/async context (and I also read somewhere here that CLR lock is a bad practice in async/await env in general?) and I know that bool isnt good alternative as well. </p> <p>How are these situations usually handled?</p>
0debug
Android studio activity main : <p>When I make a new project from android studio. New blank activity has title bar and floating icon. How to get rid of it when I'm getting a new blank activity. And how i make a real blank activity.</p>
0debug
How I can implement the constructor of the class who is inline explicite? : <p>How I can implement the constructor of this class? The constructor is inline and explicit and call the draw function. I try to implement that's in the file .h and .cpp and that's generate an error. </p> <pre><code>#ifndef DRAW_H #define DRAW_H #include "item.h" #include &lt;set&gt; #include "random/random.hpp" namespace nvs namespace lotto { class Parameter; class Draw : public Item { inline std::set&lt;unsigned&gt; draw(const Parameter &amp; parameter) const; public: /*! * this function call the private function draw() */ inline explicit Draw(const Parameter &amp; parameter); /*! * \brief constructor virtuel by default. */ virtual ~Draw() override = default; }; inline explicit Draw::Draw(const Parameter &amp; parameter) { draw(parameter); } inline std::set&lt;unsigned&gt; Draw::draw(const Parameter &amp; parameter) const { std::set&lt;unsigned&gt; values; unsigned cpt=0; unsigned length = parameter.length(); while (cpt &lt; length) { unsigned temp = random_value(parameter.maximum(), parameter.minimum()); if ((values.find(temp))==values.end()) { values.insert(temp); cpt++; } } return values; } } // namespace lotto } // namespace nvs #endif #endif // DRAW_H </code></pre> <p>Output :</p> <pre><code>C:\Users\George\Documents\TD07\draw.h:86: erreur : 'explicit' outside class declaration inline explicit Draw::Draw(const Parameter &amp; parameter) ^ C:\Users\Mitch\Documents\TD07\draw.h:86: erreur : no matching function for call to 'nvs::lotto::Item::Item()' </code></pre>
0debug
C# - Split an existing indexed array : Im Attempting to read a .txt file that is seperated by commas and two lines, currently i have it setup so that it reads the txt file but having trouble with it .split the existing array into two alternative ones based of the taxArray string[] taxArray = new string[2]; int count = 0; try { if(File.Exists(filePath)) { //read the lines from text file add each line to its own array index. foreach (string line in File.ReadLines(filePath, Encoding.UTF8)) { taxArray[count] = line; txtDisplay.Text += taxArray[count] + "\r\n"; count++; } } else { MessageBox.Show("This file cannot be found"); } } catch(Exception ex) { MessageBox.Show(ex.Message); } This currently outputs exactly as i need.
0debug
Call one of two methods dynamically : <p>Is there a way to convert this if/else statement so that it can be called in a more dynamic way without using reflection?</p> <pre><code>if (left.IsColliding()) directions.Remove(Direction.Left); else directions.Add(Direction.Left); </code></pre> <p>In JavaScript I can do the following and I was wondering if there was something similar in C#.</p> <pre><code>directions[left.IsColliding() ? "Remove" : "Add"](Direction.Left); </code></pre>
0debug
static void compute_status(HTTPContext *c) { HTTPContext *c1; FFStream *stream; char *p; time_t ti; int i, len; AVIOContext *pb; if (avio_open_dyn_buf(&pb) < 0) { c->buffer_ptr = c->buffer; c->buffer_end = c->buffer; return; } avio_printf(pb, "HTTP/1.0 200 OK\r\n"); avio_printf(pb, "Content-type: %s\r\n", "text/html"); avio_printf(pb, "Pragma: no-cache\r\n"); avio_printf(pb, "\r\n"); avio_printf(pb, "<html><head><title>%s Status</title>\n", program_name); if (c->stream->feed_filename[0]) avio_printf(pb, "<link rel=\"shortcut icon\" href=\"%s\">\n", c->stream->feed_filename); avio_printf(pb, "</head>\n<body>"); avio_printf(pb, "<h1>%s Status</h1>\n", program_name); avio_printf(pb, "<h2>Available Streams</h2>\n"); avio_printf(pb, "<table cellspacing=0 cellpadding=4>\n"); avio_printf(pb, "<tr><th valign=top>Path<th align=left>Served<br>Conns<th><br>bytes<th valign=top>Format<th>Bit rate<br>kbits/s<th align=left>Video<br>kbits/s<th><br>Codec<th align=left>Audio<br>kbits/s<th><br>Codec<th align=left valign=top>Feed\n"); stream = first_stream; while (stream != NULL) { char sfilename[1024]; char *eosf; if (stream->feed != stream) { av_strlcpy(sfilename, stream->filename, sizeof(sfilename) - 10); eosf = sfilename + strlen(sfilename); if (eosf - sfilename >= 4) { if (strcmp(eosf - 4, ".asf") == 0) strcpy(eosf - 4, ".asx"); else if (strcmp(eosf - 3, ".rm") == 0) strcpy(eosf - 3, ".ram"); else if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) { eosf = strrchr(sfilename, '.'); if (!eosf) eosf = sfilename + strlen(sfilename); if (stream->is_multicast) strcpy(eosf, ".sdp"); else strcpy(eosf, ".rtsp"); } } avio_printf(pb, "<tr><td><a href=\"/%s\">%s</a> ", sfilename, stream->filename); avio_printf(pb, "<td align=right> %d <td align=right> ", stream->conns_served); fmt_bytecount(pb, stream->bytes_served); switch(stream->stream_type) { case STREAM_TYPE_LIVE: { int audio_bit_rate = 0; int video_bit_rate = 0; const char *audio_codec_name = ""; const char *video_codec_name = ""; const char *audio_codec_name_extra = ""; const char *video_codec_name_extra = ""; for(i=0;i<stream->nb_streams;i++) { AVStream *st = stream->streams[i]; AVCodec *codec = avcodec_find_encoder(st->codec->codec_id); switch(st->codec->codec_type) { case AVMEDIA_TYPE_AUDIO: audio_bit_rate += st->codec->bit_rate; if (codec) { if (*audio_codec_name) audio_codec_name_extra = "..."; audio_codec_name = codec->name; } break; case AVMEDIA_TYPE_VIDEO: video_bit_rate += st->codec->bit_rate; if (codec) { if (*video_codec_name) video_codec_name_extra = "..."; video_codec_name = codec->name; } break; case AVMEDIA_TYPE_DATA: video_bit_rate += st->codec->bit_rate; break; default: abort(); } } avio_printf(pb, "<td align=center> %s <td align=right> %d <td align=right> %d <td> %s %s <td align=right> %d <td> %s %s", stream->fmt->name, stream->bandwidth, video_bit_rate / 1000, video_codec_name, video_codec_name_extra, audio_bit_rate / 1000, audio_codec_name, audio_codec_name_extra); if (stream->feed) avio_printf(pb, "<td>%s", stream->feed->filename); else avio_printf(pb, "<td>%s", stream->feed_filename); avio_printf(pb, "\n"); } break; default: avio_printf(pb, "<td align=center> - <td align=right> - <td align=right> - <td><td align=right> - <td>\n"); break; } } stream = stream->next; } avio_printf(pb, "</table>\n"); stream = first_stream; while (stream != NULL) { if (stream->feed == stream) { avio_printf(pb, "<h2>Feed %s</h2>", stream->filename); if (stream->pid) { avio_printf(pb, "Running as pid %d.\n", stream->pid); #if defined(linux) && !defined(CONFIG_NOCUTILS) { FILE *pid_stat; char ps_cmd[64]; snprintf(ps_cmd, sizeof(ps_cmd), "ps -o \"%%cpu,cputime\" --no-headers %d", stream->pid); pid_stat = popen(ps_cmd, "r"); if (pid_stat) { char cpuperc[10]; char cpuused[64]; if (fscanf(pid_stat, "%10s %64s", cpuperc, cpuused) == 2) { avio_printf(pb, "Currently using %s%% of the cpu. Total time used %s.\n", cpuperc, cpuused); } fclose(pid_stat); } } #endif avio_printf(pb, "<p>"); } avio_printf(pb, "<table cellspacing=0 cellpadding=4><tr><th>Stream<th>type<th>kbits/s<th align=left>codec<th align=left>Parameters\n"); for (i = 0; i < stream->nb_streams; i++) { AVStream *st = stream->streams[i]; AVCodec *codec = avcodec_find_encoder(st->codec->codec_id); const char *type = "unknown"; char parameters[64]; parameters[0] = 0; switch(st->codec->codec_type) { case AVMEDIA_TYPE_AUDIO: type = "audio"; snprintf(parameters, sizeof(parameters), "%d channel(s), %d Hz", st->codec->channels, st->codec->sample_rate); break; case AVMEDIA_TYPE_VIDEO: type = "video"; snprintf(parameters, sizeof(parameters), "%dx%d, q=%d-%d, fps=%d", st->codec->width, st->codec->height, st->codec->qmin, st->codec->qmax, st->codec->time_base.den / st->codec->time_base.num); break; default: abort(); } avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%d<td>%s<td>%s\n", i, type, st->codec->bit_rate/1000, codec ? codec->name : "", parameters); } avio_printf(pb, "</table>\n"); } stream = stream->next; } avio_printf(pb, "<h2>Connection Status</h2>\n"); avio_printf(pb, "Number of connections: %d / %d<br>\n", nb_connections, nb_max_connections); avio_printf(pb, "Bandwidth in use: %"PRIu64"k / %"PRIu64"k<br>\n", current_bandwidth, max_bandwidth); avio_printf(pb, "<table>\n"); avio_printf(pb, "<tr><th>#<th>File<th>IP<th>Proto<th>State<th>Target bits/sec<th>Actual bits/sec<th>Bytes transferred\n"); c1 = first_http_ctx; i = 0; while (c1 != NULL) { int bitrate; int j; bitrate = 0; if (c1->stream) { for (j = 0; j < c1->stream->nb_streams; j++) { if (!c1->stream->feed) bitrate += c1->stream->streams[j]->codec->bit_rate; else if (c1->feed_streams[j] >= 0) bitrate += c1->stream->feed->streams[c1->feed_streams[j]]->codec->bit_rate; } } i++; p = inet_ntoa(c1->from_addr.sin_addr); avio_printf(pb, "<tr><td><b>%d</b><td>%s%s<td>%s<td>%s<td>%s<td align=right>", i, c1->stream ? c1->stream->filename : "", c1->state == HTTPSTATE_RECEIVE_DATA ? "(input)" : "", p, c1->protocol, http_state[c1->state]); fmt_bytecount(pb, bitrate); avio_printf(pb, "<td align=right>"); fmt_bytecount(pb, compute_datarate(&c1->datarate, c1->data_count) * 8); avio_printf(pb, "<td align=right>"); fmt_bytecount(pb, c1->data_count); avio_printf(pb, "\n"); c1 = c1->next; } avio_printf(pb, "</table>\n"); ti = time(NULL); p = ctime(&ti); avio_printf(pb, "<hr size=1 noshade>Generated at %s", p); avio_printf(pb, "</body>\n</html>\n"); len = avio_close_dyn_buf(pb, &c->pb_buffer); c->buffer_ptr = c->pb_buffer; c->buffer_end = c->pb_buffer + len; }
1threat
static inline int vec_reg_offset(int regno, int element, TCGMemOp size) { int offs = offsetof(CPUARMState, vfp.regs[regno * 2]); #ifdef HOST_WORDS_BIGENDIAN offs += (16 - ((element + 1) * (1 << size))); offs ^= 8; #else offs += element * (1 << size); #endif return offs; }
1threat
c# how to update checkbox in database through SQL Query : i am trying to update the checked state of a collom in my database. below is the code i have but i am unsure of how to implement the checkbox. Thank you for any help. con.Open(); OleDbCommand cmd = new OleDbCommand(String.Concat("Select * From ", comboBox1.Text), con); cmd.CommandType = CommandType.Text; string tableName = comboBox1.Text.ToString(); cmd.CommandText = "UPDATE [" + tableName + "] SET People_Call_Status = '" + Status_textBox1.Text + "', Research_Date = '" + Date_textBox.Text + "', Company_Name = '" + company_NameTextBox.Text + "', tblCompanies_Area_Dialling_Code = '" + tblCompanies_Area_Dialling_CodeTextBox.Text + "', Work_Number = '" + work_NumberTextBox.Text + "', building_Address = '" + building_AddressTextBox.Text + "', [Street Address] = '" + street_AddressTextBox.Text + "', suburb = '" + suburbTextBox.Text + "', city = '" + cityTextBox.Text + "', res_Code = '" + res_CodeTextBox.Text + "', industry_Vertical_ID = '" + industry_Vertical_IDTextBox.Text + "', pO_Box = '" + pO_BoxTextBox.Text + "', post_Office = '" + post_OfficeTextBox.Text + "', postal_Code = '" + postal_CodeTextBox.Text + "', country_ID = '" + country_IDTextBox.Text + "', province_ID = '" + province_IDTextBox.Text + "', prospect = '" + prospectCheckBox.Checked //not working + "' WHERE Company_ID = " + company_IDTextBox.Text + ";"; cmd.ExecuteNonQuery(); { MessageBox.Show("Update Success!"); con.Close(); }
0debug
dotnet core : Can not find assembly file Microsoft.CSharp.dll : <p>I have a project that i have not run for some while, build with dotnet core 1.1.2 dependencies.</p> <p>in the meanwhile I have updated visual studio, possible installed some dotnet core stuff for 2.0 and my application do not run anymore.</p> <pre><code>InvalidOperationException: Can not find assembly file Microsoft.CSharp.dll at 'C:\dev\EarthML\EarthML.Mapify\src\EarthML.Mapify.Portal\bin\Debug\net462\win10-x64\refs,C:\dev\EarthML\EarthML.Mapify\src\EarthML.Mapify.Portal\bin\Debug\net462\win10-x64\' Microsoft.Extensions.DependencyModel.Resolution.AppBaseCompilationAssemblyResolver.TryResolveAssemblyPaths(CompilationLibrary library, List&lt;string&gt; assemblies) </code></pre> <p>What would I do to start figuring out why it dont work?</p>
0debug
void os_host_main_loop_wait(int *timeout) { int ret, ret2, i; PollingEntry *pe; ret = 0; for(pe = first_polling_entry; pe != NULL; pe = pe->next) { ret |= pe->func(pe->opaque); } if (ret == 0) { int err; WaitObjects *w = &wait_objects; qemu_mutex_unlock_iothread(); ret = WaitForMultipleObjects(w->num, w->events, FALSE, *timeout); qemu_mutex_lock_iothread(); if (WAIT_OBJECT_0 + 0 <= ret && ret <= WAIT_OBJECT_0 + w->num - 1) { if (w->func[ret - WAIT_OBJECT_0]) w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]); for(i = (ret - WAIT_OBJECT_0 + 1); i < w->num; i++) { ret2 = WaitForSingleObject(w->events[i], 0); if(ret2 == WAIT_OBJECT_0) { if (w->func[i]) w->func[i](w->opaque[i]); } else if (ret2 == WAIT_TIMEOUT) { } else { err = GetLastError(); fprintf(stderr, "WaitForSingleObject error %d %d\n", i, err); } } } else if (ret == WAIT_TIMEOUT) { } else { err = GetLastError(); fprintf(stderr, "WaitForMultipleObjects error %d %d\n", ret, err); } } *timeout = 0; }
1threat
Convert .CSV |-separated file to .xlsx file : <p>I have a .CSV file that is generated every day that opens in an Excel workbook. It is separated by | character like this: </p> <pre><code>0-1-C|COUTEAU À HUITRE RICHARD|||||40|5,99|0|0|0|0|0|0|0|0|0|2,65| 0000|ARTICLEVENTEFINALEdémonstrateur|||||945|9999,99|0|0|0|0|0|0|0|0|0|0||||| 00007|SUPER DÉTACHANT OOPS!|||SUPER DÉTACHANT||100|3,99| </code></pre> <p>Each line of the text above is in the first cell of a line .I'd like to generate a version of this file in another Excel workbook that uses one cell per string between |. The file is about 6200 lines long and since its generated everyday, I need it to juste loop over every line and create a new one in the document. I'm very new to VBA and and this website so p-lease be patient with me, thank you very much !</p>
0debug