problem
stringlengths
26
131k
labels
class label
2 classes
void visit_type_uint64(Visitor *v, uint64_t *obj, const char *name, Error **errp) { int64_t value; if (v->type_uint64) { v->type_uint64(v, obj, name, errp); } else { value = *obj; v->type_int64(v, &value, name, errp); *obj = value; } }
1threat
In 2016, what is the correct way to create a commercial MS Office Add In? : <p>I've been writing VB6 code for Outlook and Excel for at least 10 years, but it's generally written in the VB Editor and saved as the default project or a worksheet module, therefore not very portable.</p> <p>I'm at the stage now where I want to switch to .net and write proper add-ins, that I can distribute and potentially sell (so would need to be protected and installable).</p> <p>However, there seems to be a lot of conflicting advice out there about how to do this, and what software to use.</p> <p>I'd really like to know the definitive way to do this in 2016;</p> <ul> <li>What software to use (I presume, either the paid or free version of VS)</li> <li>What language to use (I assume a flavour of .net)</li> <li>What I need to do to be able to distribute or sell the addin (do they still need to be signed?)</li> <li>any advice on definitive resources to make the switch from hacker-style projects to stand alone projects</li> </ul> <p>Apologies if this sounds vague, or isn't the correct format for SO; I'm a web developer, mainly open source technologies, so the MS stack (Office aside) has always been a different world for me.</p> <p>Thanks, Dave</p>
0debug
Setting NODE_ENV for firebase function : <p>I am moving some of my <code>firebase-queue</code> workers to Firebase Functions. I have used <code>process.env.NODE_ENV</code> to set some of the configuration for the workers depending on the environment in which I am running them. Is there a way to set the <code>NODE_ENV</code> for the functions while deploying them. I understand that the recommended way to provide such config options is via <code>firebase.config.set</code> which I have verified works as expected but just wanted to check if there is a way to set the <code>NODE_ENV</code> also. When I try to print out the <code>NODE_ENV</code> inside of a function, it is always set to <code>production</code>.</p>
0debug
Could someone explain this code for me please : <p>I found this Caesar cipher encryption code on the web and I'm trying to understand how it works </p> <pre><code>#include&lt;stdio.h&gt; int main() { char message[100], ch; int i, key; printf("Enter a message to encrypt: "); gets(message); printf("Enter key: "); scanf("%d", &amp;key); for(i = 0; message[i] != '\0'; ++i){ ch = message[i]; if(ch &gt;= 'a' &amp;&amp; ch &lt;= 'z'){ ch = ch + key; if(ch &gt; 'z'){ ch = ch - 'z' + 'a' - 1; } message[i] = ch; } else if(ch &gt;= 'A' &amp;&amp; ch &lt;= 'Z'){ ch = ch + key; if(ch &gt; 'Z'){ ch = ch - 'Z' + 'A' - 1; } message[i] = ch; } } printf("Encrypted message: %s", message); return 0; } </code></pre> <ul> <li><p>Meaning of <code>if(ch &gt;= 'a' &amp;&amp; ch &lt;= 'z')</code> Like does c include the alphabet as an array or something or how does it know that the letter is b or others ?</p></li> <li><p>Adding an int to a char in <code>ch = ch + key;</code></p></li> <li><p>this math thing <code>ch = ch - 'Z' + 'A' - 1;</code></p></li> </ul> <p>And thanks very very much </p>
0debug
Calculating trailing zero in javascript : <p>How do i calculate the number of trailing zeros in a factorial of a given number.</p> <pre><code>N! = 1 * 2 * 3 * 4 ... N </code></pre> <p>Any Help on this?</p>
0debug
Error 404 while accessing api method on telegram bot : <p>I just created a bot of telegram to finish a task for the school regarding the integration of ifttt and telegram.</p> <p>My problem is that trying a browser to use a method of Telegram api it returned to me the following string: {"ok": false, "error_code": 404, "description": "Not Found"}</p> <p>I use this link to try to access to my bot: <a href="https://api.telegram.org/botToken/getUpdates" rel="noreferrer">https://api.telegram.org/botToken/getUpdates</a></p> <p>The bot's token is valid</p> <p>You can help you solve the problem?</p>
0debug
What is the "as syntax" pointed out by tslint? : <p>I upgraded tslint and now it complains about:</p> <pre><code>ERROR: src/Metronome/JobFetcher.ts[13, 32]: Type assertion using the '&lt;&gt;' syntax is forbidden. Use the 'as' syntax instead. </code></pre> <p>The offending code looks like:</p> <pre><code>const jobs = &lt;JobConfig[]&gt; &lt;any&gt; await rp(fetchJobsOptions); </code></pre> <p>What is the as syntax though and why should I use it?</p>
0debug
How to close the modal in react native : <p>I am newbie to react native developing. I want to close the modal component on pressing outside the modal in reactnative. Below is my code.</p> <pre><code>state = { visibleModal : false, }; _hideModal(){ this.setState({ visibleModal: true, }) } render(){ return( &lt;View style={ [styles.container, {backgroundColor: this.state.visibleModal ? 'rgba(47, 60, 73, 0.75)': 'white'} ]}&gt; &lt;Text&gt;Text Behind Modal&lt;/Text&gt; { this._renderButton('BUTTON', () =&gt; this.setState({ visibleModal: true}) ) } &lt;TouchableWithoutFeedback onPress={() =&gt; {this._hideModal()}}&gt; &lt;Modal animationType={"slide"} transparent={true} visible={this.state.visibleModal}&gt; &lt;View style={styles.modalContent}&gt; &lt;Row /&gt; &lt;/View&gt; &lt;/Modal&gt; &lt;/TouchableWithoutFeedback&gt; &lt;/View&gt; ); } </code></pre> <p>}</p>
0debug
How to add more orderer nodes to a running hyperledger fabric network : <p>I have setup a hyperledger fabric network with 1 orderer node, but don't know how to add more orderer node to a running production hyperledger network.</p> <p>Any help would be appreciated, thanks.</p>
0debug
static void scsi_disk_emulate_write_same(SCSIDiskReq *r, uint8_t *inbuf) { SCSIRequest *req = &r->req; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); uint32_t nb_sectors = scsi_data_cdb_length(r->req.cmd.buf); WriteSameCBData *data; uint8_t *buf; int i; if (nb_sectors == 0 || (req->cmd.buf[1] & 0x16)) { scsi_check_condition(r, SENSE_CODE(INVALID_FIELD)); return; } if (bdrv_is_read_only(s->qdev.conf.bs)) { scsi_check_condition(r, SENSE_CODE(WRITE_PROTECTED)); return; } if (!check_lba_range(s, r->req.cmd.lba, nb_sectors)) { scsi_check_condition(r, SENSE_CODE(LBA_OUT_OF_RANGE)); return; } if (buffer_is_zero(inbuf, s->qdev.blocksize)) { int flags = (req->cmd.buf[1] & 0x8) ? BDRV_REQ_MAY_UNMAP : 0; scsi_req_ref(&r->req); block_acct_start(bdrv_get_stats(s->qdev.conf.bs), &r->acct, nb_sectors * s->qdev.blocksize, BLOCK_ACCT_WRITE); r->req.aiocb = bdrv_aio_write_zeroes(s->qdev.conf.bs, r->req.cmd.lba * (s->qdev.blocksize / 512), nb_sectors * (s->qdev.blocksize / 512), flags, scsi_aio_complete, r); return; } data = g_new0(WriteSameCBData, 1); data->r = r; data->sector = r->req.cmd.lba * (s->qdev.blocksize / 512); data->nb_sectors = nb_sectors * (s->qdev.blocksize / 512); data->iov.iov_len = MIN(data->nb_sectors * 512, SCSI_WRITE_SAME_MAX); data->iov.iov_base = buf = qemu_blockalign(s->qdev.conf.bs, data->iov.iov_len); qemu_iovec_init_external(&data->qiov, &data->iov, 1); for (i = 0; i < data->iov.iov_len; i += s->qdev.blocksize) { memcpy(&buf[i], inbuf, s->qdev.blocksize); } scsi_req_ref(&r->req); block_acct_start(bdrv_get_stats(s->qdev.conf.bs), &r->acct, data->iov.iov_len, BLOCK_ACCT_WRITE); r->req.aiocb = bdrv_aio_writev(s->qdev.conf.bs, data->sector, &data->qiov, data->iov.iov_len / 512, scsi_write_same_complete, data); }
1threat
What is the point of having resolved URL in package-lock.json? : <p>whenever I generate a package-lock file, there is also "resolved" block that looks like this:</p> <pre><code>"resolved": "http://devel.npm.registry:4873/lodash/-/lodash-4.17.5.tgz" </code></pre> <p>What is the point of this URL? Later, if I try to install dependencies based on this package-lock, do I need to use the same npm registry? Because we use a different npm registry for local development and for production builds. Thus when I develop, I use <code>devel.npm.registry</code>, but the CI tool uses <code>production.npm.registry</code>. According to my tests, the URL doesn't matter (I tried <code>npm@6.4.1</code>). But it is current implementation that's gonna change soon or is the URL intentionally ignored? I have the feeling that some of the previous versions of npm actually checked the resolved URLs. </p> <p>The <a href="https://docs.npmjs.com/files/package-lock.json#resolved" rel="noreferrer">documentation</a> isn't much helpful in this case.</p>
0debug
How to set custom highlighted state of SwiftUI Button : <p>I have a Button. I want to set custom background color for highlighted state. How can I do it in SwiftUI?</p> <p><a href="https://i.stack.imgur.com/9aYkU.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9aYkU.png" alt="enter image description here"></a></p> <pre><code>Button(action: signIn) { Text("Sign In") } .padding(.all) .background(Color.red) .cornerRadius(16) .foregroundColor(.white) .font(Font.body.bold()) </code></pre>
0debug
how do I search string and see if any letters are there? : <p>I need to find out if a string contains letters in it. I think I've tried every thing in the world and they haven't worked. I've tried many examples from here (and other places) but they don't work either</p> <p>I know there are a lot of similar questions. I've read them and they don't work for me, so I'm asking again. </p> <p>Any help is appreciated.</p>
0debug
Get data points from Seaborn distplot : <p>I use </p> <pre><code>sns.distplot </code></pre> <p>to plot a univariate distribution of observations. Still, I need not only the chart, but also the data points. How do I get the data points from matplotlib Axes (returned by distplot)?</p>
0debug
How to grant permissions to android instrumented tests? : <p>I have an application that reads SMSs. The app works fine when debugging but when testing it using android instrumented test it throws the following error</p> <pre><code>java.lang.SecurityException: Permission Denial: reading com.android.providers.telephony.SmsProvider </code></pre> <p>This is my test case</p> <pre><code>@RunWith(AndroidJUnit4.class) public class SmsFetcherTest { @Test public void fetchTenSms() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getContext(); // Fails anyway. // assertTrue(ContextCompat.checkSelfPermission(appContext, // "android.permission.READ_SMS") == PackageManager.PERMISSION_GRANTED); List&lt;Sms&gt; tenSms = new SmsFetcher(appContext) .limit(10) .get(); assertEquals(10, tenSms.size()); } } </code></pre> <p>I'm new to instrumented tests. Is this is proper way to do this?</p> <p>Or am I missing something?</p>
0debug
void qusb_pci_init_one(QPCIBus *pcibus, struct qhc *hc, uint32_t devfn, int bar) { hc->dev = qpci_device_find(pcibus, devfn); g_assert(hc->dev != NULL); qpci_device_enable(hc->dev); hc->base = qpci_iomap(hc->dev, bar, NULL); g_assert(hc->base != NULL); }
1threat
ReadLineState *readline_init(ReadLinePrintfFunc *printf_func, ReadLineFlushFunc *flush_func, void *opaque, ReadLineCompletionFunc *completion_finder) { ReadLineState *rs = g_malloc0(sizeof(*rs)); rs->hist_entry = -1; rs->opaque = opaque; rs->printf_func = printf_func; rs->flush_func = flush_func; rs->completion_finder = completion_finder; return rs; }
1threat
How to center vertically div inside div : <p>First need to tell you that I am using this code:</p> <p><a href="https://jsfiddle.net/hbahar95/27/" rel="nofollow noreferrer">https://jsfiddle.net/hbahar95/27/</a></p> <pre><code> .text.ellipsis { position: relative; font-size: 14px; color: black; font-family: sans-serif; width: 250px; /* Could be anything you like. */ } .text-concat { position: relative; display: inline-block; word-wrap: break-word; overflow: hidden; max-height: 3.6em; /* (Number of lines you want visible) * (line-height) */ line-height: 1.2em; text-align:justify; } .text.ellipsis::after { content: "..."; position: absolute; right: -12px; bottom: 5px; } </code></pre> <p>because I need to have multy-line ellipse for titles. And this part of code works.</p> <p>but now I need to center vertically div inside div, and this part of code works partially.... I really tried everything but still cant fix the problem.</p> <p>you can see here the live example: <a href="http://phpbb32.majordroid.com/index.php" rel="nofollow noreferrer">http://phpbb32.majordroid.com/index.php</a></p> <p>Inside the blue div everything is fine, but below inside white div title for some reason sank, or in other words is not centered.</p> <p>So I hope you can help me to center vertically div inside div, and it needs to work in IE8+</p> <p>Thank you</p>
0debug
QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, const GraphicHwOps *hw_ops, void *opaque) { Error *local_err = NULL; int width = 640; int height = 480; QemuConsole *s; DisplayState *ds; ds = get_alloc_displaystate(); trace_console_gfx_new(); s = new_console(ds, GRAPHIC_CONSOLE); s->hw_ops = hw_ops; s->hw = opaque; if (dev) { object_property_set_link(OBJECT(s), OBJECT(dev), "device", &local_err); object_property_set_int(OBJECT(s), head, "head", &local_err); } s->surface = qemu_create_displaysurface(width, height); return s; }
1threat
Strugglingw with Vigenere! (In C) invalid operands to binary expression ('int *' and 'int') and other things : we are now working with caesar, vigenere. I mannaged to finish caesar but vigenere is not working as good. C gives me back: invalid operands to binary expression ('int *' and 'int'). I'm not sure what the program means exactly and what is wrong with my code. Can somebody help me out or give me advice? I think it's because I can not count with the different types of numbers? I'm not sure! #include <cs50.h> #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> int main(int argc, string argv[]) { if (argc != 2) { printf("You have to input a key, try again!\n"); return 1; } string key = argv[1]; int keylength = strlen(key); for (int i = 0; i < keylength; i++) { if (!isalpha(argv[1][i])) { printf("Please insert letters, nothing else\n"); return 1; } } printf("plaintext: "); string plain = get_string(); int keycipher[keylength]; for(int i = 0; i < keylength; i++) { keycipher[i] = toupper(key[i]) - 65; } if (plain != 0) { printf("ciphertext: "); int i; for (i = 0, keylength = strlen(key); i < keylength; i++) { if (isupper(plain[i])) { printf("%c", (plain[i] - 65 + keycipher) % 26); } else if (islower(plain[i])) { printf("%c", (plain[i] - 97 + keycipher) % 26); } else if (plain[i] == ' ') { printf(" "); } else { printf("%c", plain[i]); } } } return 0; }
0debug
static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap) { dc1394_data* dc1394 = c->priv_data; AVStream* vst; nodeid_t* camera_nodes; int res; struct dc1394_frame_format *fmt; struct dc1394_frame_rate *fps; for (fmt = dc1394_frame_formats; fmt->width; fmt++) if (fmt->pix_fmt == ap->pix_fmt && fmt->width == ap->width && fmt->height == ap->height) break; for (fps = dc1394_frame_rates; fps->frame_rate; fps++) if (fps->frame_rate == av_rescale(1000, ap->time_base.den, ap->time_base.num)) break; vst = av_new_stream(c, 0); if (!vst) return -1; av_set_pts_info(vst, 64, 1, 1000); vst->codec->codec_type = CODEC_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_RAWVIDEO; vst->codec->time_base.den = fps->frame_rate; vst->codec->time_base.num = 1000; vst->codec->width = fmt->width; vst->codec->height = fmt->height; vst->codec->pix_fmt = fmt->pix_fmt; av_init_packet(&dc1394->packet); dc1394->packet.size = avpicture_get_size(fmt->pix_fmt, fmt->width, fmt->height); dc1394->packet.stream_index = vst->index; dc1394->packet.flags |= PKT_FLAG_KEY; dc1394->current_frame = 0; dc1394->fps = fps->frame_rate; vst->codec->bit_rate = av_rescale(dc1394->packet.size * 8, fps->frame_rate, 1000); dc1394->handle = dc1394_create_handle(0); if (!dc1394->handle) { av_log(c, AV_LOG_ERROR, "Can't acquire dc1394 handle on port %d\n", 0 ); goto out; } camera_nodes = dc1394_get_camera_nodes(dc1394->handle, &res, 1); if (!camera_nodes || camera_nodes[ap->channel] == DC1394_NO_CAMERA) { av_log(c, AV_LOG_ERROR, "There's no IIDC camera on the channel %d\n", ap->channel); goto out_handle; } res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[ap->channel], 0, FORMAT_VGA_NONCOMPRESSED, fmt->frame_size_id, SPEED_400, fps->frame_rate_id, 8, 1, c->filename, &dc1394->camera); dc1394_free_camera_nodes(camera_nodes); if (res != DC1394_SUCCESS) { av_log(c, AV_LOG_ERROR, "Can't prepare camera for the DMA capture\n"); goto out_handle; } res = dc1394_start_iso_transmission(dc1394->handle, dc1394->camera.node); if (res != DC1394_SUCCESS) { av_log(c, AV_LOG_ERROR, "Can't start isochronous transmission\n"); goto out_handle_dma; } return 0; out_handle_dma: dc1394_dma_unlisten(dc1394->handle, &dc1394->camera); dc1394_dma_release_camera(dc1394->handle, &dc1394->camera); out_handle: dc1394_destroy_handle(dc1394->handle); out: return -1; }
1threat
Effettuare una connessione alle BDL Granite : Ho la necessita di effettuare una connessione al Database Granite utilizzando le BDL installare sull'application server WebLogic 10.3.6. Il linguaggio di programmazione è Java:
0debug
What does UserA committed with UserB 13 days ago on github mean? : <p>I am interested in knowing which one of the two users made the file changes when github lists both. The git record contains only UserA however.</p>
0debug
Cannot find var in python : <p>At the beginning of my program, I am defining a simple object which sets the configuration for how I am going to call a service. Like so : </p> <pre><code>document_conversion = DocumentConversionV1( username='xxx', password='xxx', version='2016-05-31') </code></pre> <p>I then want to call a service on all files in a directory. I try to do it like so, but I believe the config object cannot be found - it seems to be out of scope, I get this error: </p> <pre><code>NameError: name 'config' is not defined </code></pre> <p>Here is what I have directly after the object creation : </p> <pre><code>yourpath = 'C:\\Users\\Desktop\\working_folder\\' for root, dirs, files in os.walk(yourpath, topdown=False): for name in files: print(os.path.join(root, name)) config['conversion_target'] = DocumentConversionV1.ANSWER_UNITS with open(join(dirname(__file__), os.path.join(root, name)), 'r') as document: print(json.dumps(document_conversion.convert_document(document=document, config=config), indent=2)) </code></pre> <p>I've tried defining the config object within the for loop/within the with clause, but it still seems to not work. Curiously, if I remove the for loop from the above, it does seem to work (if ran on one file, rather than a folder).</p> <p>Any ideas what could be the problem here ?</p> <p>Thanks</p>
0debug
read userinput and pass to get-eventlog function : please suggest the way forward for this, similarly I have to do for enddate, username etc.. sample : $StartDate,$String = "","" $StartDate = Read-Host -Prompt 'Enter the start date of the logs, Ex: 17/07/2017 09:00:00 ' if ( $StartDate -And ( $StartDate -ne " ") -And ($StartDate -ne "")) { $StartDate = $StartDate -replace "`t|`n|`r","" $String += " -After '$StartDate'" } else { 'You did not enter a valid Start date!' } echo "Get-EventLog -LogName Application $String" Get-EventLog -LogName Application $String Output: Get-EventLog -LogName Application -After '19/07/2017' Get-EventLog : Cannot bind parameter 'InstanceId'. Cannot convert value " -After '19/07/2017'" to type "System.Int64". Error: "Input string was not in a correct format." At C:\Users\kumars2\Downloads\Santosh\Powershell scripts\Enhancements\View logs examples\small_test.ps1:17 char:13 + Get-EventLog <<<< -LogName Application $String + CategoryInfo : InvalidArgument: (:) [Get-EventLog], ParameterBindingException + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.GetEventLogCommand
0debug
button [] [] to node -- java : I'll keep it quick. I'm trying to create a standard calculator. I want to use a BorderPane so I can keep my display: TextField display = new TextField(); pane.setTop(display); however I am using an array: I then would want to use an array of buttons as a single object to place in the center of the pane. Button [][] keys = new Button [a][b]; pane.setCenter(keys); however I get an error: Button [][] cannot be converted to Node. I would like to know if there is anyway I can parse the elements to become/assume the value of a Node or if i can create a method to do so. Appreciate the help, thanks!
0debug
Set Class if json Array is 0 : <p>I try to build a User bar like in Facebook "New Friend Requests" ore "New Pms"</p> <p>This is now my HTML Template Code:</p> <pre><code>&lt;li class="icon-element pms"&gt; &lt;div class="icon" ng-include="iconPm"&gt;&lt;/div&gt; &lt;span class="counter"&gt;{{account.newPms}}&lt;/span&gt; &lt;/li&gt; </code></pre> <p>In the span is {{account.newPms}} this can be 0. If it is 0, then i want to set a class in the li namend "is-zero"</p> <p>I found some in other topics like:</p> <pre><code>&lt;li ng-if="account.newPms == '0'&gt;&lt;/li&gt; </code></pre> <p>but how i can set the class in the li if it is 0?</p> <p>best regards!</p>
0debug
START_TEST(qdict_get_try_str_test) { const char *p; const char *key = "key"; const char *str = "string"; qdict_put(tests_dict, key, qstring_from_str(str)); p = qdict_get_try_str(tests_dict, key); fail_unless(p != NULL); fail_unless(strcmp(p, str) == 0); }
1threat
C++ future async equivalent in node.js : <p>I want to write the following C++ code equivalent in Node.js.</p> <pre><code>#include &lt;iostream&gt; #include &lt;future&gt; #include &lt;string&gt; std::mutex mut; void print(const std::string&amp; message, int n) { for (int i = 0; i &lt; n; ++i) { { std::lock_guard&lt;std::mutex&gt; lk(mut); std::cout &lt;&lt; message &lt;&lt; std::endl; } usleep(200000); } std::lock_guard&lt;std::mutex&gt; lk(mut); std::cout &lt;&lt; message &lt;&lt; " finished" &lt;&lt; std::endl;; } int main() { std::future&lt;void&gt; fut_a = std::async(print, "a", 2); std::future&lt;void&gt; fut_b = std::async(print, "b", 8); fut_a.get(); std::future&lt;void&gt; fut_c = std::async(print, "c", 2); std::future&lt;void&gt; fut_d = std::async(print, "d", 2); fut_c.get(); fut_d.get(); fut_b.get(); } </code></pre> <p>The output is: a b a b b c d b d c b b b b</p> <p>In Node.js v8.6.0 the following code starts displaying "c" before displaying "a" is finished.</p> <pre><code>const asyncfunc = (message, n) =&gt; { for (let i = 0; i &lt; n; ++i) { setTimeout(() =&gt; { console.log(message); }, 200 * i); } } async function main() { const a = asyncfunc("a", 2); const b = asyncfunc("b", 8); await a; const c = asyncfunc("c", 2); const d = asyncfunc("d", 2); await c; await d; await b; } main(); </code></pre> <p>The output is: a b c d a b c d b b b b b b</p> <p>Is there any handy ways in Node.js to write the above C++ code equivalent?</p>
0debug
Isolated styled-components with @font-face : <p>I'm using <a href="https://github.com/styled-components/styled-components" rel="noreferrer">https://github.com/styled-components/styled-components</a>. </p> <p>I'm trying to work out the best strategy for components that require <code>@font-face</code>. I want to make sure each component is independent of its context, so I'm defining <code>font-family</code> styles on each them. But if I use <code>injectGlobal</code> in multiple components, I get multiple <code>@font-face</code> rules for the same font.</p> <p>Should I just define the <code>@font-face</code> rules in my <code>ThemeProvider</code> entry-point component and live with the fact that the desired font might not be loaded by the browser?</p>
0debug
The type 'ContentPresenter' does not support direct content : <p>In WPF in XAML page I am getting error .The type 'ContentPresenter' does not support direct content.<a href="https://i.stack.imgur.com/tE21l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tE21l.png" alt="enter image description here"></a></p> <p>the content presenter is inside the Custom Control. As I am new to WPF I might have not provided proper information,Please let me know if need more information. Thanks in Advance for the help!!!!</p>
0debug
inline static void RENAME(hcscale)(uint16_t *dst, long dstWidth, uint8_t *src1, uint8_t *src2, int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hChrFilter, int16_t *hChrFilterPos, int hChrFilterSize, void *funnyUVCode, int srcFormat, uint8_t *formatConvBuffer, int16_t *mmx2Filter, int32_t *mmx2FilterPos, uint8_t *pal) { if(srcFormat==PIX_FMT_YUYV422) { RENAME(yuy2ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_UYVY422) { RENAME(uyvyToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_RGB32) { RENAME(bgr32ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_BGR24) { RENAME(bgr24ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_BGR565) { RENAME(bgr16ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_BGR555) { RENAME(bgr15ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_BGR32) { RENAME(rgb32ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_RGB24) { RENAME(rgb24ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_RGB565) { RENAME(rgb16ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(srcFormat==PIX_FMT_RGB555) { RENAME(rgb15ToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW); src1= formatConvBuffer; src2= formatConvBuffer+2048; } else if(isGray(srcFormat)) { return; } else if(srcFormat==PIX_FMT_RGB8 || srcFormat==PIX_FMT_BGR8 || srcFormat==PIX_FMT_PAL8 || srcFormat==PIX_FMT_BGR4_BYTE || srcFormat==PIX_FMT_RGB4_BYTE) { RENAME(palToUV)(formatConvBuffer, formatConvBuffer+2048, src1, src2, srcW, pal); src1= formatConvBuffer; src2= formatConvBuffer+2048; } #ifdef HAVE_MMX if(!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed)) #else if(!(flags&SWS_FAST_BILINEAR)) #endif { RENAME(hScale)(dst , dstWidth, src1, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize); RENAME(hScale)(dst+2048, dstWidth, src2, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize); } else { #if defined(ARCH_X86) #ifdef HAVE_MMX2 int i; #if defined(PIC) uint64_t ebxsave __attribute__((aligned(8))); #endif if(canMMX2BeUsed) { asm volatile( #if defined(PIC) "mov %%"REG_b", %6 \n\t" #endif "pxor %%mm7, %%mm7 \n\t" "mov %0, %%"REG_c" \n\t" "mov %1, %%"REG_D" \n\t" "mov %2, %%"REG_d" \n\t" "mov %3, %%"REG_b" \n\t" "xor %%"REG_a", %%"REG_a" \n\t" PREFETCH" (%%"REG_c") \n\t" PREFETCH" 32(%%"REG_c") \n\t" PREFETCH" 64(%%"REG_c") \n\t" #ifdef ARCH_X86_64 #define FUNNY_UV_CODE \ "movl (%%"REG_b"), %%esi \n\t"\ "call *%4 \n\t"\ "movl (%%"REG_b", %%"REG_a"), %%esi\n\t"\ "add %%"REG_S", %%"REG_c" \n\t"\ "add %%"REG_a", %%"REG_D" \n\t"\ "xor %%"REG_a", %%"REG_a" \n\t"\ #else #define FUNNY_UV_CODE \ "movl (%%"REG_b"), %%esi \n\t"\ "call *%4 \n\t"\ "addl (%%"REG_b", %%"REG_a"), %%"REG_c"\n\t"\ "add %%"REG_a", %%"REG_D" \n\t"\ "xor %%"REG_a", %%"REG_a" \n\t"\ #endif FUNNY_UV_CODE FUNNY_UV_CODE FUNNY_UV_CODE FUNNY_UV_CODE "xor %%"REG_a", %%"REG_a" \n\t" "mov %5, %%"REG_c" \n\t" "mov %1, %%"REG_D" \n\t" "add $4096, %%"REG_D" \n\t" PREFETCH" (%%"REG_c") \n\t" PREFETCH" 32(%%"REG_c") \n\t" PREFETCH" 64(%%"REG_c") \n\t" FUNNY_UV_CODE FUNNY_UV_CODE FUNNY_UV_CODE FUNNY_UV_CODE #if defined(PIC) "mov %6, %%"REG_b" \n\t" #endif :: "m" (src1), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), "m" (funnyUVCode), "m" (src2) #if defined(PIC) ,"m" (ebxsave) #endif : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D #if !defined(PIC) ,"%"REG_b #endif ); for(i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) { dst[i] = src1[srcW-1]*128; dst[i+2048] = src2[srcW-1]*128; } } else { #endif long xInc_shr16 = (long) (xInc >> 16); uint16_t xInc_mask = xInc & 0xffff; asm volatile( "xor %%"REG_a", %%"REG_a" \n\t" "xor %%"REG_d", %%"REG_d" \n\t" "xorl %%ecx, %%ecx \n\t" ASMALIGN(4) "1: \n\t" "mov %0, %%"REG_S" \n\t" "movzbl (%%"REG_S", %%"REG_d"), %%edi \n\t" "movzbl 1(%%"REG_S", %%"REG_d"), %%esi \n\t" "subl %%edi, %%esi \n\t" - src[xx] "imull %%ecx, %%esi \n\t" "shll $16, %%edi \n\t" "addl %%edi, %%esi \n\t" *2*xalpha + src[xx]*(1-2*xalpha) "mov %1, %%"REG_D" \n\t" "shrl $9, %%esi \n\t" "movw %%si, (%%"REG_D", %%"REG_a", 2)\n\t" "movzbl (%5, %%"REG_d"), %%edi \n\t" "movzbl 1(%5, %%"REG_d"), %%esi \n\t" "subl %%edi, %%esi \n\t" - src[xx] "imull %%ecx, %%esi \n\t" "shll $16, %%edi \n\t" "addl %%edi, %%esi \n\t" *2*xalpha + src[xx]*(1-2*xalpha) "mov %1, %%"REG_D" \n\t" "shrl $9, %%esi \n\t" "movw %%si, 4096(%%"REG_D", %%"REG_a", 2)\n\t" "addw %4, %%cx \n\t" "adc %3, %%"REG_d" \n\t" "add $1, %%"REG_a" \n\t" "cmp %2, %%"REG_a" \n\t" " jb 1b \n\t" #if defined(ARCH_X86_64) && ((__GNUC__ > 3) || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4)) :: "m" (src1), "m" (dst), "g" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask), #else :: "m" (src1), "m" (dst), "m" ((long)dstWidth), "m" (xInc_shr16), "m" (xInc_mask), #endif "r" (src2) : "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi" ); #ifdef HAVE_MMX2 } #endif #else int i; unsigned int xpos=0; for(i=0;i<dstWidth;i++) { register unsigned int xx=xpos>>16; register unsigned int xalpha=(xpos&0xFFFF)>>9; dst[i]=(src1[xx]*(xalpha^127)+src1[xx+1]*xalpha); dst[i+2048]=(src2[xx]*(xalpha^127)+src2[xx+1]*xalpha); xpos+=xInc; } #endif } }
1threat
Docker compose: Invalid interpolation format for "environment" option in service : <p>Hi in docker compose I have:</p> <pre><code> environment: - AWS_ACCESS_KEY_ID=$(aws --profile default configure get aws_access_key_id) - AWS_SECRET_ACCESS_KEY=$(aws --profile default configure get aws_secret_access_key) </code></pre> <p>But it returns me an error like in topic. Anyone knows how to pass those variables ?</p> <p>Thanks</p>
0debug
Swift: create object from primitive value : <p>I'm not entirely sure that what I want to do is possible to implement currently, however I hope that it is.<br> Basically, I would like to have some mechanism for a bit shorter object creation for primitive. Let me explain. Consider we have some kind of wrapper around Int:</p> <pre><code>class Wrapper { var value: Int = 0 init(value: Int) { self.value = value } } </code></pre> <p>And then instead of creating object with init, i.e:</p> <pre><code>let wrapper = Wrapper(value: -1) </code></pre> <p>I would like to do something like this:</p> <pre><code>let wrapper: Wrapper = -1 </code></pre> <p>Or:</p> <pre><code>var array = [Wrapper]() array.append(-1) </code></pre> <p>It would short declarations quite heavily, especially in case with arrays.<br> Interesting note: I've tested code above with CGFloat i.e:</p> <pre><code>let val: CGFloat = 0.0 var array = [CGFloat]() array.append(0.0) </code></pre> <p>and all seems to be working fine. However I'm not entirely sure that there is way in language that allow to create such behaviour for custom object and it's why I'm asking about it basically. I've reviewed sources of CGFloat, but didn't saw anything that seems to be related to functionality that i want to achieve (beside NativeType alias may be, but I didn't understand how it would work).</p>
0debug
static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) { VirtIODevice *vdev; int n, r; if (!(dev->flags & VIRTIO_CCW_FLAG_USE_IOEVENTFD) || dev->ioeventfd_disabled || dev->ioeventfd_started) { return; } vdev = virtio_bus_get_device(&dev->bus); for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { if (!virtio_queue_get_num(vdev, n)) { continue; } r = virtio_ccw_set_guest2host_notifier(dev, n, true, true); if (r < 0) { goto assign_error; } } dev->ioeventfd_started = true; return; assign_error: while (--n >= 0) { if (!virtio_queue_get_num(vdev, n)) { continue; } r = virtio_ccw_set_guest2host_notifier(dev, n, false, false); assert(r >= 0); } dev->ioeventfd_started = false; dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD; error_report("%s: failed. Fallback to userspace (slower).", __func__); }
1threat
call stored procedure with parametes using web api : When I execute this Stored Procedure in MS SQL Server: **use Vcom** **go** **exec abrir_turno @posto = 'pppe', @turno = '3', @data = '2016-06-13'** The SQL return a messagem " **your SP set pppe to open** ". I am trying to implement that using Web Api 2with c#: **public IEnumerable<string> spabrirturno(string posto, string turno, string data, string STATUS_TURNO)** { STATUS_TURNO = null; return obj.abrir_turno(posto, turno, data, STATUS_TURNO).AsEnumerable(); } But that is a error : "cannot implicitly convert type ienumerable to string" message in photo... [enter image description here][1] [1]: http://i.stack.imgur.com/Uhbvb.png
0debug
"Please tell me who you are" problem (mac) : <p>In order i simply wrote on terminal</p> <pre><code>git config --global user.mail "[my mail]" git config --global user.name "[my name]" Hugos-MBP:ProjetOpenSource beelee_the_bee$ git commit -m "Salan" *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got 'beelee_the_bee@Hugos-MBP.(none)') </code></pre> <hr> <p>(beelee_the_bee is my mac name)</p> <p>when i wrote <code>git config -l</code> i have the following answer : user.mail=hugo.vast@gmail.com and user.name=Huugoo147</p> <p>So in fact my name and mail are in, but i already have the message and i cant commit :?</p> <p>I read all questions around my subject and i didnt found any solutions Please help me ^^</p>
0debug
C# reference pointer : <pre><code>using System; public class Class1 { public int A {get;set;} } public class Class2 { public Class1 class1 {get;set;} } public class Test { public static void Main() { Class1 c1 = null; var c2 = new Class2(); c2.class1 = c1; c1 = new Class1(); c1.A = 1; Console.WriteLine(c2.class1.A); //Expect 1 not NULL ref err } } </code></pre> <p>I would expect that the <code>c2</code> object would get its <code>class1</code> reference updated because its passing by reference, so the reference was updated but it remained null.</p> <p>When you set c2.class1 = c1 and c1 is currently null does it keep the the value <code>null</code> and not use a pointer to the empty memory space?</p>
0debug
static AioContext *block_job_get_aio_context(BlockJob *job) { return job->deferred_to_main_loop ? qemu_get_aio_context() : blk_get_aio_context(job->blk); }
1threat
Why are only pointers used for polymorphism? : <p>Why do I only see pointers being used for polymorphism when references work too? I know that references can only be bound once, but is that the only reason? I mean, it is not <em>always</em> that you have to reassign them?</p>
0debug
Please help insertion sort java : int size, i, j, temp; int arr[] = new int[50]; Scanner scan1 = new Scanner(System.in); System.out.print("Enter Array Size : "); size = scan1.nextInt(); System.out.print("Enter Array Elements : "); for(i=0; i<size; i++) { arr[i] = scan1.nextInt(); } System.out.print("Sorting Array using Insertion Sort Technique..\n"); for(i=1; i<size; i++) { temp = arr[i]; j = i - 1; while((temp < arr[j]) && (j >= 0)) { arr[j+1] = arr[j]; j = j - 1; } arr[j+1] = temp; } System.out.print("Array after Sorting is : \n"); for(i=0; i<size; i++) { System.out.print(arr[i] + " "); } } **When i run this an error is displayed Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 50 at ProgramFinals.main(ProgramFinals.java:72)** please help
0debug
static void vnc_client_write_locked(void *opaque) { VncState *vs = opaque; #ifdef CONFIG_VNC_SASL if (vs->sasl.conn && vs->sasl.runSSF && !vs->sasl.waitWriteSSF) { vnc_client_write_sasl(vs); } else #endif { #ifdef CONFIG_VNC_WS if (vs->encode_ws) { vnc_client_write_ws(vs); } else #endif { vnc_client_write_plain(vs); } } }
1threat
Function for matrix in R : <p>I'm new (very new) in R. I'm struggling with making a function that's supposed to take a matrix (old_matrix) and return a new matrix (new_matrix), but in new_matrix all values in old_matrix that is a prime should be multiplied by 2 when it appears in new_matrix. So the new matrix should look the same as the old matrix, but where a prime occurs in old, this element should be multiplied by 2. </p> <p>I'm thinking that I should start out with a for loop, but I'm already struggling with how to make the loop go through all elements of the matrix. I appreciate all the help I can get to get closer to making this function!</p>
0debug
static void mmap_release_buffer(AVPacket *pkt) { struct v4l2_buffer buf; int res, fd; struct buff_data *buf_descriptor = pkt->priv; memset(&buf, 0, sizeof(struct v4l2_buffer)); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; buf.index = buf_descriptor->index; fd = buf_descriptor->fd; av_free(buf_descriptor); res = ioctl (fd, VIDIOC_QBUF, &buf); if (res < 0) { av_log(NULL, AV_LOG_ERROR, "ioctl(VIDIOC_QBUF)\n"); pkt->data = NULL; pkt->size = 0;
1threat
Running bash scripts with npm : <p>I want to try using npm to run my various build tasks for a web application. I know I can do this by adding a <code>scripts</code> field to my <code>package.json</code> like so:</p> <pre><code>"scripts": { "build": "some build command" }, </code></pre> <p>This gets unwieldy when you have more complex commands with a bunch of options. Is it possible to move these commands to a bash script or something along those lines? Something like:</p> <pre><code>"scripts": { "build": "build.sh" }, </code></pre> <p>where <code>npm run build</code> would execute the commands in the <code>build.sh</code> file?</p> <p>Reading through <a href="http://substack.net/task_automation_with_npm_run" rel="noreferrer">this</a> post it seems like it is, but I'm not clear on exactly where I'm supposed to drop my <code>build.sh</code> file or if I'm missing something.</p>
0debug
C function fopen(); error: too many arguements to the function : why cannot I do this ? fopen("%s",stringarray,fpointer); --- says too many arguements to function But this : fopen("file.txt",fpointer); ---works How can I get around this problem? do I have to modify headers code?
0debug
static int mjpeg_decode_app(MJpegDecodeContext *s) { int len, id, i; len = get_bits(&s->gb, 16); if (len < 5) return AVERROR_INVALIDDATA; if (8 * len > get_bits_left(&s->gb)) return AVERROR_INVALIDDATA; id = get_bits_long(&s->gb, 32); id = av_be2ne32(id); len -= 6; if (s->avctx->debug & FF_DEBUG_STARTCODE) av_log(s->avctx, AV_LOG_DEBUG, "APPx %8X\n", id); if (id == AV_RL32("AVI1")) { s->buggy_avid = 1; i = get_bits(&s->gb, 8); len--; av_log(s->avctx, AV_LOG_DEBUG, "polarity %d\n", i); #if 0 skip_bits(&s->gb, 8); skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); len -= 10; #endif goto out; } if (id == AV_RL32("JFIF")) { int t_w, t_h, v1, v2; skip_bits(&s->gb, 8); v1 = get_bits(&s->gb, 8); v2 = get_bits(&s->gb, 8); skip_bits(&s->gb, 8); s->avctx->sample_aspect_ratio.num = get_bits(&s->gb, 16); s->avctx->sample_aspect_ratio.den = get_bits(&s->gb, 16); if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, "mjpeg: JFIF header found (version: %x.%x) SAR=%d/%d\n", v1, v2, s->avctx->sample_aspect_ratio.num, s->avctx->sample_aspect_ratio.den); t_w = get_bits(&s->gb, 8); t_h = get_bits(&s->gb, 8); if (t_w && t_h) { if (len -10 - (t_w * t_h * 3) > 0) len -= t_w * t_h * 3; } len -= 10; goto out; } if (id == AV_RL32("Adob") && (get_bits(&s->gb, 8) == 'e')) { if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found\n"); skip_bits(&s->gb, 16); skip_bits(&s->gb, 16); skip_bits(&s->gb, 16); skip_bits(&s->gb, 8); len -= 7; goto out; } if (id == AV_RL32("LJIF")) { if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, "Pegasus lossless jpeg header found\n"); skip_bits(&s->gb, 16); skip_bits(&s->gb, 16); skip_bits(&s->gb, 16); skip_bits(&s->gb, 16); switch (get_bits(&s->gb, 8)) { case 1: s->rgb = 1; s->pegasus_rct = 0; break; case 2: s->rgb = 1; s->pegasus_rct = 1; break; default: av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace\n"); } len -= 9; goto out; } if ((s->start_code == APP1) && (len > (0x28 - 8))) { id = get_bits_long(&s->gb, 32); id = av_be2ne32(id); len -= 4; if (id == AV_RL32("mjpg")) { #if 0 skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); skip_bits(&s->gb, 32); #endif if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, "mjpeg: Apple MJPEG-A header found\n"); } } out: if (len < 0) av_log(s->avctx, AV_LOG_ERROR, "mjpeg: error, decode_app parser read over the end\n"); while (--len > 0) skip_bits(&s->gb, 8); return 0; }
1threat
How can I import a svg file to a Vue component? : <p>In vue single file component.I import a svg file like this: <code>import A from 'a.svg'</code> And then how can I use A in my component?</p>
0debug
What are some ways to figure out related products/questions/items anything? : <p>What are some ways including machine learning that I can use in my projects to generate things related to another. Like related apps, related websites, related products, etc.</p> <p>I've been brainstorming these are strategies...</p> <p>one way i can think of is show items from same category. But that would be too broad.</p> <p>2nd way improves upon previous step, it's to keep track of what people click next and promote that item. Meanwhile keep bottom list randomized to let other relevant items show up and get clicked. </p> <p>3rd way is to use machine learning and provide training data somehow and use that.</p> <p>I want something simple but smart, as it gets better with time. </p>
0debug
tcp_sockclosed(struct tcpcb *tp) { DEBUG_CALL("tcp_sockclosed"); DEBUG_ARG("tp = %p", tp); switch (tp->t_state) { case TCPS_CLOSED: case TCPS_LISTEN: case TCPS_SYN_SENT: tp->t_state = TCPS_CLOSED; tp = tcp_close(tp); break; case TCPS_SYN_RECEIVED: case TCPS_ESTABLISHED: tp->t_state = TCPS_FIN_WAIT_1; break; case TCPS_CLOSE_WAIT: tp->t_state = TCPS_LAST_ACK; break; } if (tp) tcp_output(tp); }
1threat
What's the difference between uWSGI's socket-timeout/http-timeout/harakiri? : <p>I wrote a simple WSGI application (using Flask) served by uWSGI (i.e. no other HTTP server but uWSGI) which only supports a single PUT route using which clients can upload a file (potentially ~400MB in size), have it processed on the server and then sent back.</p> <p>In the uWSGI logs, I noticed two kinds of timeout errors after some time. Usually it's a timeout when sending the response:</p> <pre><code>Feb 02 20:46:30 myserv uwsgi[18948]: uwsgi_response_sendfile_do() TIMEOUT !!! Feb 02 20:46:30 myserv uwsgi[18948]: OSError: write error Feb 02 20:46:30 myserv uwsgi[18948]: [pid: 18954|app: 0|req: 1795/3935] aa.bb.cc.dd () {32 vars in 455 bytes} [Fri Feb 2 20:46:06 2018] PUT /sample.exe =&gt; generated 0 bytes in 24314 msecs via sendfile() (HTTP/1.1 200) 6 headers in 258 bytes (3353 switches on core 0) </code></pre> <p>Sometimes though, it's also a timeout when receiving a PUT request:</p> <pre><code>Feb 03 20:18:32 signserv uwsgi[18948]: [pid: 18953|app: 0|req: 2975/5670] aa.bb.cc.dd () {32 vars in 455 bytes} [Sat Feb 3 20:18:02 2018] PUT /samplefile.exe =&gt; generated 0 bytes in 29499 msecs via sendfile() (HTTP/1.1 200) 6 headers in 258 bytes (2930 switches on core 0) Feb 03 20:20:30 signserv uwsgi[18948]: [uwsgi-body-read] Timeout reading 16384 bytes. Content-Length: 354414781 consumed: 0 left: 354414781 </code></pre> <p>Some debugging suggests that this typically happens with clients which are very slow (i.e. which have a high load).</p> <p>I'd like to alleviate this by increasing some timeouts, but uWSGI appears to support a plethora of timeouts and it's not clear to me which of them are relevant here. I identified three timeouts which sound like I may want to increase them, but I have trouble finding documentation on how they differ:</p> <ul> <li><code>socket-timeout</code></li> <li><code>http-timeout</code></li> <li><code>harakiri</code></li> </ul> <p>Can anyone shed some light on what these timeouts affect, what their default values are and which (if any) of them should be adjusted to avoid above-mentioned issues?</p>
0debug
bootsrtap button gets sticked together : When i put button on table it gets sticks together [![like this][1]][1] <tbody> <tr> <td>1</td> <td>New York</td> <td>755535</td> <td>The there is no difference:</td> <td> <button type="button" class="btn btn-info btn-xs col-md-12 col-lg-12">Update</button> <br> <button type="button" class="btn btn-danger btn-xs col-md-12 col-lg-12">Delete</button> </td> </tr> </tbody> How can I put a space between this two button . br tag is not working [1]: https://i.stack.imgur.com/ESVxq.jpg
0debug
static int cinepak_decode (CinepakContext *s) { const uint8_t *eod = (s->data + s->size); int i, result, strip_size, frame_flags, num_strips; int y0 = 0; int encoded_buf_size; if (s->size < 10) return -1; frame_flags = s->data[0]; num_strips = AV_RB16 (&s->data[8]); encoded_buf_size = ((s->data[1] << 16) | AV_RB16 (&s->data[2])); if (s->sega_film_skip_bytes == -1) { if (encoded_buf_size != s->size) { if ((s->data[10] == 0xFE) && (s->data[11] == 0x00) && (s->data[12] == 0x00) && (s->data[13] == 0x06) && (s->data[14] == 0x00) && (s->data[15] == 0x00)) s->sega_film_skip_bytes = 6; else s->sega_film_skip_bytes = 2; } else s->sega_film_skip_bytes = 0; } s->data += 10 + s->sega_film_skip_bytes; if (num_strips > MAX_STRIPS) num_strips = MAX_STRIPS; for (i=0; i < num_strips; i++) { if ((s->data + 12) > eod) return -1; s->strips[i].id = s->data[0]; s->strips[i].y1 = y0; s->strips[i].x1 = 0; s->strips[i].y2 = y0 + AV_RB16 (&s->data[8]); s->strips[i].x2 = s->avctx->width; strip_size = AV_RB24 (&s->data[1]) - 12; s->data += 12; strip_size = ((s->data + strip_size) > eod) ? (eod - s->data) : strip_size; if ((i > 0) && !(frame_flags & 0x01)) { memcpy (s->strips[i].v4_codebook, s->strips[i-1].v4_codebook, sizeof(s->strips[i].v4_codebook)); memcpy (s->strips[i].v1_codebook, s->strips[i-1].v1_codebook, sizeof(s->strips[i].v1_codebook)); } result = cinepak_decode_strip (s, &s->strips[i], s->data, strip_size); if (result != 0) return result; s->data += strip_size; y0 = s->strips[i].y2; } return 0; }
1threat
How does sql server system check duplicates? : I definitely know how to check duplicates/remove duplicates using sql server queries. But I am asking a deeper question about the system. How does the system handle duplicates? For example, how does the system remove duplicates from UNION ALL to UNION? I am guessing if the system is using hash code to do so? The employer said the process has something to do with ROWID. But even if two rows are exactly the same, their ROWID should be different, correct? How is that possible?
0debug
Assebly asciiz pcspim : Write a program that reads 10 numbers from the keyboard and store them in memory. Then it prints the numbers in reverse order and print their sum. In addition to indicate a variable which takes as argument a letter of the alphabet and print the ascii number.Can you help ? .data pin:.space 40 .text .globl main main: addi $20, $0, 10 addi $17, $0, 0 addi $6, $0, 0 loop: addi $2, $0, 5 syscall add $7, $0, $2 sw $7, pin($6) addi $17, $17, 1 addi $6, $6, 4 bne $20, $17, loop addi $17, $0, 0 addi $6, $0, 0 loop1:lw $8,pin($6) addi $2,$0,1 add $4,$8,$0 syscall addi $17,$17,1 addi $6,$6,4 bne $17,$20,loop1 j main
0debug
static int headroom(int *la) { int l; if (*la == 0) { return 31; } l = 30 - av_log2(FFABS(*la)); *la <<= l; return l; }
1threat
static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st = c->fc->streams[c->fc->nb_streams-1]; MOVStreamContext *sc = st->priv_data; int j, entries, pseudo_stream_id; get_byte(pb); get_be24(pb); entries = get_be32(pb); for(pseudo_stream_id=0; pseudo_stream_id<entries; pseudo_stream_id++) { enum CodecID id; int dref_id = 1; MOVAtom a = { 0, 0, 0 }; int64_t start_pos = url_ftell(pb); int size = get_be32(pb); uint32_t format = get_le32(pb); if (size >= 16) { get_be32(pb); get_be16(pb); dref_id = get_be16(pb); } if (st->codec->codec_tag && st->codec->codec_tag != format && (c->fc->video_codec_id ? ff_codec_get_id(codec_movvideo_tags, format) != c->fc->video_codec_id : st->codec->codec_tag != MKTAG('j','p','e','g')) ){ av_log(c->fc, AV_LOG_WARNING, "multiple fourcc not supported\n"); url_fskip(pb, size - (url_ftell(pb) - start_pos)); continue; } sc->pseudo_stream_id = st->codec->codec_tag ? -1 : pseudo_stream_id; sc->dref_id= dref_id; st->codec->codec_tag = format; id = ff_codec_get_id(codec_movaudio_tags, format); if (id<=0 && ((format&0xFFFF) == 'm'+('s'<<8) || (format&0xFFFF) == 'T'+('S'<<8))) id = ff_codec_get_id(ff_codec_wav_tags, bswap_32(format)&0xFFFF); if (st->codec->codec_type != CODEC_TYPE_VIDEO && id > 0) { st->codec->codec_type = CODEC_TYPE_AUDIO; } else if (st->codec->codec_type != CODEC_TYPE_AUDIO && format && format != MKTAG('m','p','4','s')) { id = ff_codec_get_id(codec_movvideo_tags, format); if (id <= 0) id = ff_codec_get_id(ff_codec_bmp_tags, format); if (id > 0) st->codec->codec_type = CODEC_TYPE_VIDEO; else if(st->codec->codec_type == CODEC_TYPE_DATA){ id = ff_codec_get_id(ff_codec_movsubtitle_tags, format); if(id > 0) st->codec->codec_type = CODEC_TYPE_SUBTITLE; } } dprintf(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size, (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, (format >> 24) & 0xff, st->codec->codec_type); if(st->codec->codec_type==CODEC_TYPE_VIDEO) { uint8_t codec_name[32]; unsigned int color_depth; int color_greyscale; st->codec->codec_id = id; get_be16(pb); get_be16(pb); get_be32(pb); get_be32(pb); get_be32(pb); st->codec->width = get_be16(pb); st->codec->height = get_be16(pb); get_be32(pb); get_be32(pb); get_be32(pb); get_be16(pb); get_buffer(pb, codec_name, 32); if (codec_name[0] <= 31) { memcpy(st->codec->codec_name, &codec_name[1],codec_name[0]); st->codec->codec_name[codec_name[0]] = 0; } st->codec->bits_per_coded_sample = get_be16(pb); st->codec->color_table_id = get_be16(pb); dprintf(c->fc, "depth %d, ctab id %d\n", st->codec->bits_per_coded_sample, st->codec->color_table_id); color_depth = st->codec->bits_per_coded_sample & 0x1F; color_greyscale = st->codec->bits_per_coded_sample & 0x20; if ((color_depth == 2) || (color_depth == 4) || (color_depth == 8)) { unsigned int color_start, color_count, color_end; unsigned char r, g, b; st->codec->palctrl = av_malloc(sizeof(*st->codec->palctrl)); if (color_greyscale) { int color_index, color_dec; st->codec->bits_per_coded_sample = color_depth; color_count = 1 << color_depth; color_index = 255; color_dec = 256 / (color_count - 1); for (j = 0; j < color_count; j++) { r = g = b = color_index; st->codec->palctrl->palette[j] = (r << 16) | (g << 8) | (b); color_index -= color_dec; if (color_index < 0) color_index = 0; } } else if (st->codec->color_table_id) { const uint8_t *color_table; color_count = 1 << color_depth; if (color_depth == 2) color_table = ff_qt_default_palette_4; else if (color_depth == 4) color_table = ff_qt_default_palette_16; else color_table = ff_qt_default_palette_256; for (j = 0; j < color_count; j++) { r = color_table[j * 3 + 0]; g = color_table[j * 3 + 1]; b = color_table[j * 3 + 2]; st->codec->palctrl->palette[j] = (r << 16) | (g << 8) | (b); } } else { color_start = get_be32(pb); color_count = get_be16(pb); color_end = get_be16(pb); if ((color_start <= 255) && (color_end <= 255)) { for (j = color_start; j <= color_end; j++) { get_byte(pb); get_byte(pb); r = get_byte(pb); get_byte(pb); g = get_byte(pb); get_byte(pb); b = get_byte(pb); get_byte(pb); st->codec->palctrl->palette[j] = (r << 16) | (g << 8) | (b); } } } st->codec->palctrl->palette_changed = 1; } } else if(st->codec->codec_type==CODEC_TYPE_AUDIO) { int bits_per_sample, flags; uint16_t version = get_be16(pb); st->codec->codec_id = id; get_be16(pb); get_be32(pb); st->codec->channels = get_be16(pb); dprintf(c->fc, "audio channels %d\n", st->codec->channels); st->codec->bits_per_coded_sample = get_be16(pb); sc->audio_cid = get_be16(pb); get_be16(pb); st->codec->sample_rate = ((get_be32(pb) >> 16)); dprintf(c->fc, "version =%d, isom =%d\n",version,c->isom); if(!c->isom) { if(version==1) { sc->samples_per_frame = get_be32(pb); get_be32(pb); sc->bytes_per_frame = get_be32(pb); get_be32(pb); } else if(version==2) { get_be32(pb); st->codec->sample_rate = av_int2dbl(get_be64(pb)); st->codec->channels = get_be32(pb); get_be32(pb); st->codec->bits_per_coded_sample = get_be32(pb); flags = get_be32(pb); sc->bytes_per_frame = get_be32(pb); sc->samples_per_frame = get_be32(pb); if (format == MKTAG('l','p','c','m')) st->codec->codec_id = mov_get_lpcm_codec_id(st->codec->bits_per_coded_sample, flags); } } switch (st->codec->codec_id) { case CODEC_ID_PCM_S8: case CODEC_ID_PCM_U8: if (st->codec->bits_per_coded_sample == 16) st->codec->codec_id = CODEC_ID_PCM_S16BE; break; case CODEC_ID_PCM_S16LE: case CODEC_ID_PCM_S16BE: if (st->codec->bits_per_coded_sample == 8) st->codec->codec_id = CODEC_ID_PCM_S8; else if (st->codec->bits_per_coded_sample == 24) st->codec->codec_id = st->codec->codec_id == CODEC_ID_PCM_S16BE ? CODEC_ID_PCM_S24BE : CODEC_ID_PCM_S24LE; break; case CODEC_ID_MACE3: sc->samples_per_frame = 6; sc->bytes_per_frame = 2*st->codec->channels; break; case CODEC_ID_MACE6: sc->samples_per_frame = 6; sc->bytes_per_frame = 1*st->codec->channels; break; case CODEC_ID_ADPCM_IMA_QT: sc->samples_per_frame = 64; sc->bytes_per_frame = 34*st->codec->channels; break; case CODEC_ID_GSM: sc->samples_per_frame = 160; sc->bytes_per_frame = 33; break; default: break; } bits_per_sample = av_get_bits_per_sample(st->codec->codec_id); if (bits_per_sample) { st->codec->bits_per_coded_sample = bits_per_sample; sc->sample_size = (bits_per_sample >> 3) * st->codec->channels; } } else if(st->codec->codec_type==CODEC_TYPE_SUBTITLE){ MOVAtom fake_atom = { .size = size - (url_ftell(pb) - start_pos) }; if (format != AV_RL32("mp4s")) mov_read_glbl(c, pb, fake_atom); st->codec->codec_id= id; st->codec->width = sc->width; st->codec->height = sc->height; } else { url_fskip(pb, size - (url_ftell(pb) - start_pos)); } a.size = size - (url_ftell(pb) - start_pos); if (a.size > 8) { if (mov_read_default(c, pb, a) < 0) return -1; } else if (a.size > 0) url_fskip(pb, a.size); } if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) st->codec->sample_rate= sc->time_scale; switch (st->codec->codec_id) { #if CONFIG_DV_DEMUXER case CODEC_ID_DVAUDIO: c->dv_fctx = avformat_alloc_context(); c->dv_demux = dv_init_demux(c->dv_fctx); if (!c->dv_demux) { av_log(c->fc, AV_LOG_ERROR, "dv demux context init error\n"); return -1; } sc->dv_audio_container = 1; st->codec->codec_id = CODEC_ID_PCM_S16LE; break; #endif case CODEC_ID_QCELP: if (st->codec->codec_tag != MKTAG('Q','c','l','p')) st->codec->sample_rate = 8000; st->codec->frame_size= 160; st->codec->channels= 1; break; case CODEC_ID_AMR_NB: case CODEC_ID_AMR_WB: st->codec->frame_size= sc->samples_per_frame; st->codec->channels= 1; if (st->codec->codec_id == CODEC_ID_AMR_NB) st->codec->sample_rate = 8000; else if (st->codec->codec_id == CODEC_ID_AMR_WB) st->codec->sample_rate = 16000; break; case CODEC_ID_MP2: case CODEC_ID_MP3: st->codec->codec_type = CODEC_TYPE_AUDIO; st->need_parsing = AVSTREAM_PARSE_FULL; break; case CODEC_ID_GSM: case CODEC_ID_ADPCM_MS: case CODEC_ID_ADPCM_IMA_WAV: st->codec->block_align = sc->bytes_per_frame; break; case CODEC_ID_ALAC: if (st->codec->extradata_size == 36) { st->codec->frame_size = AV_RB32(st->codec->extradata+12); st->codec->channels = AV_RB8 (st->codec->extradata+21); } break; default: break; } return 0; }
1threat
Use of colon in variable declaration : <p>I was asked recently what this means in python:</p> <p><code>&gt;&gt;&gt; char : str</code></p> <p>I had no idea. I'd never seen that before. I checked the docs and there isn't anything like that. One person's suggestion was that it is static type declaration, but there is absolutely nothing in the docs about that either. </p> <p>With the above, if I <code>&gt;&gt;&gt; type(char)</code> it fails</p> <p>If I <code>&gt;&gt;&gt; char : str = 'abc'</code> it works, and the results of type(char) is <code>&lt;class: str&gt;</code>. It can't be static declaration though, because I can <code>&gt;&gt;&gt; char : str = 4</code> and type(char) becomes <code>&lt;class: int&gt;</code>.</p> <p>So I come here to collect the wisdom of the many SO overlords. What does that mean?</p>
0debug
ASP.NET Core RC2 Project Reference "The Dependency X could not be resolved" : <h2>Overview</h2> <p>I've got an ASP.NET Core RC2 .NET framework web project, and I'd like to add a project reference to my regular C# class library contained within the same solution.</p> <h2>Steps to repro:</h2> <p>Using Visual Studio 2015 Update 2</p> <p>File -> New Project -> <code>ASP.NET Core Web Application (.NET Framework)</code></p> <p>Right click solution -> New Project -> <code>Class Library</code></p> <p>I'm not making any of these:</p> <ul> <li><code>Class Library (.NET Core)</code></li> <li><code>Class Library (Portable for iOS, Android, and Windows)</code></li> <li><code>Class Library (Portable)</code></li> </ul> <p>Add the following to <code>dependencies</code> in project.json:</p> <pre><code>"ClassLibrary1": { "version": "*", "target": "project" } </code></pre> <h2>Issue</h2> <p>Why can I not add <code>"target":"project"</code> to my dependencies when specifying a project dependency?</p> <p><a href="https://i.stack.imgur.com/1dpdA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1dpdA.png" alt="enter image description here"></a></p> <h2>Expectation</h2> <p>I expect this ASP.NET Core RC2 web application (.NET Framework) to be able to reference a regular class library as a project reference.</p> <p><strong>This works</strong></p> <pre><code>"ClassLibrary1": "*" </code></pre> <p><strong>This does not work</strong></p> <pre><code>"ClassLibrary1": { "version": "*", "target": "project" } </code></pre> <h2>My Question</h2> <p><strong>How do I add a project reference to my regular class library from an ASP.NET Core RC2 web project?</strong></p> <h2>Additional Information</h2> <p>If I run <code>dotnet restore</code> I get a better error message on why this can not be resolved.</p> <pre><code>dotnet : At line:1 char:1 + dotnet restore + ~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Errors in C:\users\joshs\documents\visual studio 2015\Projects\WebApplication4\src\WebApplication4\project.json Unable to resolve 'ClassLibrary1' for '.NETFramework,Version=v4.6.1'. </code></pre> <p>I doubled checked the class library targets .NET Framework 4.6.1</p> <p><a href="https://i.stack.imgur.com/4hZYE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4hZYE.png" alt="enter image description here"></a></p> <p>I've already taken a look at <a href="https://stackoverflow.com/questions/37309368/cannot-add-reference-to-net-core-class-library-asp-net-core-rc2">cannot add reference to .net core Class library asp.net core rc2</a>, but that's for a .NET Core class library.</p> <p>I also looked at <a href="https://stackoverflow.com/questions/37398128/reference-a-full-framework-library-project-from-asp-net-core-mvc-web-application">Reference a Full Framework Library Project from ASP.NET Core MVC Web Application (RC2)?</a>, but that's because the user was trying to create a web project not targeting .NET Framework. My project.json contains:</p> <pre><code> "frameworks": { "net461": { } }, </code></pre> <p>If I right click my web project and 'Add reference' and then proceed to pick my class library, it puts the project dependency in a different part of the project.json, but it still gives me the same error message.</p> <pre><code>"frameworks": { "net461": { "dependencies": { "ClassLibrary1": { "target": "project" } } } }, </code></pre>
0debug
White label fonts in iOS application : <p>My task is to white label iOS application.</p> <p>I've done a lot of things for Assets and for Info.plist, I just left to manage a white-label solution for the <strong>fonts</strong>.</p> <p>For example, Every customer wants to have their fonts for titles. So I got in my mind some solutions.</p> <blockquote> <p>1) There will be some Config files we can write customers fonts in the config file and when Application will run I will read font from that config file and apply them but didn't know how to to that on every screen dynamically.</p> <p>2) Create some base ViewController class and apply here fonts, then every viewController class will be the child of that base class and apply view controllers specific title fonts to my base fonts.</p> </blockquote> <p>I don't know if those solutions are good and the reason for this question is to get some advice and some better solutions. </p> <p>Maybe someone is more experienced than me and maybe someone has a better idea than me. Every single advice and help will be very valuable for me.</p> <p>Thank you.</p>
0debug
How to convert hhmmssfff to hh:mm:ss.fff with perl : please help to to convert hhmmssfff to hh:mm:ss.fff with perl. Ex: 002212212 => 00:22:12.212 Thanks in Advance
0debug
I am just a beginner. How to access outer class method variable without print it in the method and to access it in inner class : how i can access variable int a=89;of Outer class inside my Inner class.Check my code. Help me to solve this. public class TestOuter { private String name="Makky"; int a=1; public void dis() { System.out.println("dis"); int a=89; class TestInner { int a=6; void dis() { int a=12; System.out.println("local inner class="+a); System.out.println("local inner class="+this.a); } } TestLocalInner ob = new TestLocalInner(); ob.dis(); } private class TestInner { int a=2; public void access() { int a=3; System.out.println("a="+a); System.out.println("name="+name); System.out.println("a="+this.a); dis(); } } public static void main(String[] args) { TestOuter.TestInner inner = new TestOuter().new TestInner(); inner.access(); TestOuter outer = new TestOuter(); System.out.println(outer.a); } } **here i want to access variable int i = 89 of dis() method in my Inner Class without print value of a=89 inside that dis method like System.out.println(a); Solve this for me **
0debug
How to strip value from array returned by google sheets : I am using PHP to read and write to goolge sheets using the goolge API. When I use this command $my_variable=$service->spreadsheets_values->get($spreadsheetId,$range); google sheets returns an array that looks like this object(Google_Service_Sheets_ValueRange)#44 (7) { ["collection_key":protected]=> string(6) "values" ["majorDimension"]=> string(4) "ROWS" ["range"]=> string(9) "Sheet1!A4" ["values"]=> array(1) { [0]=> array(1) { [0]=> string(3) "180" } } ["internal_gapi_mappings":protected]=> array(0) { } ["modelData":protected]=> array(0) { } ["processed":protected]=> array(0) { } } The number I want is in the array, it's the answer (output from spreadsheet) which in this case is 180. What PHP command can I use to pluck that value from the array and echo or print it to the screen?
0debug
How to delete/remove PagedListAdapter item : <p>Currently I am using <strong>Android Architecture Components</strong> for App development everything is working along with paging library Now I want to remove recyclerview Item using PagedListAdapter to populate this we required to add a data source and from data source list is updating using LiveData no I want to remove a item from list notifyItemRemoved() is working from PagedList I am getting this exception:</p> <pre><code>java.lang.UnsupportedOperationException java.util.AbstractList.remove(AbstractList.java:638) </code></pre>
0debug
How can i select the locator from span and link text? : Here is the code. Its a send message Button. I tried many ways it's not working. Please help me. <a href="#" class="dt-btn dt-btn-m dt-btn-submit" rel="nofollow" xpath="1"><span>Send message</span> </a>
0debug
Laravel validation : difference between numeric and integer? : <p>in <a href="https://laravel.com/docs/5.3/validation" rel="noreferrer">laravel docs</a> there seems to be an <a href="https://laravel.com/docs/5.3/validation#rule-integer" rel="noreferrer">integer</a> and a <a href="https://laravel.com/docs/5.3/validation#rule-numeric" rel="noreferrer">numeric</a> validation rule. i was wondering what the difference between the both was?</p>
0debug
static void scsi_disk_set_sense(SCSIDiskState *s, uint8_t key) { s->sense.key = key; }
1threat
Get all HTML tags with Beautiful Soup : <p>I am trying to get a list of all html tags from beautiful soup.</p> <p>I see find all but I have to know the name of the tag before I search.</p> <p>If there is text like </p> <pre><code>html = """&lt;div&gt;something&lt;/div&gt; &lt;div&gt;something else&lt;/div&gt; &lt;div class='magical'&gt;hi there&lt;/div&gt; &lt;p&gt;ok&lt;/p&gt;""" </code></pre> <p>How would I get a list like </p> <pre><code>list_of_tags = ["&lt;div&gt;", "&lt;div&gt;", "&lt;div class='magical'&gt;", "&lt;p&gt;"] </code></pre> <p>I know how to do this with regex, but am trying to learn BS4</p>
0debug
Disable "requested without authorization" feature? : <p>Sometimes when debugging locally, I will get a popup similar to this for various resources:</p> <p><a href="https://i.stack.imgur.com/B2pNe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/B2pNe.png" alt="enter image description here"></a></p> <p>How can I completely disable this feature?</p>
0debug
Arithmatic Operation in Java : One of the interview question- Assume that i have one arithmatic function which will add two long variable and the return type also long. If pass Long.MaxValue() as argument it wont give perfect result.what will be the solution for that.Code is below- ` public class ArithmaticExample { public static void main(String[] args) { System.out.println(ArithmaticExample.addLong(Long.MAX_VALUE, Long.MAX_VALUE)); } public static long addLong(long a,long b){ return a+b; } } `
0debug
How to create a programm with linked list that destroys the nth element? : I am creating a programm with linked list which has a function that destroys the n-th element of the list and instead places the element whose number is stored in the nth element. I have created a programm that creates a linked list, but I cant find a way that searches for the nth element. ``` struct elem { int value; elem *next; }; int main() { elem *start=NULL, *last; int a[4]={1,2,3,4}; /// creating for(int i=0;i<4;i++) { elem *p = new elem; /// s1 p->value=a[i]; /// s2 p->next=NULL; /// s3 if(start==NULL) start=p; /// s4a else last->next=p; /// s4b last=p; /// s5 } /// printing elem *p=start; while (p!=NULL) { cout<<p->value<<" "; p=p->next; } /// deleting p = start; /// 1 while (p!=NULL) { start = p->next; /// 2 delete p; /// 3 p=start; /// 4 } } ``` Could I get some help here please? really struggling with linked list, thanks in advance!
0debug
static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr) { AVFormatContext *s = nut->avf; AVIOContext *bc = s->pb; int64_t end; uint64_t tmp; nut->last_syncpoint_pos = avio_tell(bc) - 8; end = get_packetheader(nut, bc, 1, SYNCPOINT_STARTCODE); end += avio_tell(bc); tmp = ffio_read_varlen(bc); *back_ptr = nut->last_syncpoint_pos - 16 * ffio_read_varlen(bc); if (*back_ptr < 0) return -1; ff_nut_reset_ts(nut, nut->time_base[tmp % nut->time_base_count], tmp / nut->time_base_count); if (skip_reserved(bc, end) || ffio_get_checksum(bc)) { av_log(s, AV_LOG_ERROR, "sync point checksum mismatch\n"); return -1; } *ts = tmp / s->nb_streams * av_q2d(nut->time_base[tmp % s->nb_streams]) * AV_TIME_BASE; ff_nut_add_sp(nut, nut->last_syncpoint_pos, *back_ptr, *ts); return 0; }
1threat
Trying to use polymorphism, need some corrections : <p>So I am using the superclass Vehicle and subclass Van. The Van subclass inherits horsepower, weight, and aerodynamics from the superclass. I have also defined a new instance variable in Van called carryweight. When I try to run TestAcceleration.java I get this error:</p> <p><a href="https://i.stack.imgur.com/yEDcg.png" rel="nofollow noreferrer">java error</a></p> <p>Here is the code:</p> <p>VEHICLE SUPERCLASS</p> <pre><code>public class Vehicle { public double horsepower; public double aerodynamics; public double weight; public Vehicle(double hp, double w, double ad) { horsepower = hp; weight = w; aerodynamics = ad; } public double getHorsepower() { return horsepower; } public double getAerodynamics() { return aerodynamics; } public double getWeight() { return weight; } public double acceleration() { double calcAccel = (100/horsepower)*aerodynamics*weight/100; double roundAccel = Math.round(calcAccel * 100.0) / 100.0; return roundAccel; } } </code></pre> <p>VAN SUBCLASS</p> <pre><code>public class Van extends Vehicle { public double carryweight; public Van(double hp, double w, double ad, double cw) { super(hp, w, ad, cw); carryweight = cw; } public double getCarryweight() { return carryweight; } public double acceleration() { double calcAccel = (100/horsepower)*(aerodynamics/2)*weight/100; double roundAccel = Math.round(calcAccel * 100.0) / 100.0; return roundAccel; } } </code></pre> <p>TESTACCELERATION CLASS</p> <pre><code>public class TestAcceleration { public static void main (String[] args) { Vehicle car1 = new Van(100, 3500, 0.9, 160.4); System.out.println(car1.acceleration()); } } </code></pre>
0debug
How to generate numbers upto 18 digits, sum of whose reciprocals is a whole number : <p>I am looking for a way to generate a series of numbers whose sum of reciprocals is a whole number? </p> <p>For eg - 11 (1/1 + 1/1 = 2 is a whole number), 122 (1/1+1/2+1/2 is a whole number), 236 (1/2 + 1/3 + 1/6 is a whole number) and likewise.</p> <p>Also I want to avoid repeat of same combination or permutation of digits. For example, if 122 is printed, I don't want to print 212 and 221.</p> <p>I want to know how to approach this problem </p>
0debug
Why does `switch`, `case` executes the code block even if no match? : <p>Considering below JS snippet. It prints 1 and 2 both even if <code>case: 2</code> is not a match! I know, I can put a <code>break;</code> to prevent this, but I want to understand the real logic behind this. As this doesn't make sense to execute a block when there is no match.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var a = 1 switch(a){ case 1: console.log(1) case 2: console.log(2) }</code></pre> </div> </div> </p>
0debug
"warning: useless storage class specifier in empty declaration" in struct : <pre><code>typedef struct item { char *text; int count; struct item *next; }; </code></pre> <p>So I have this struct with nodes defined as above, but Im getting the error below and Im not able to figure out whats wrong.</p> <blockquote> <p>warning: useless storage class specifier in empty declaration };</p> </blockquote>
0debug
ng command throws error; @angular-devkit/core seems to be missing : <p>I'm a little new to Angular, so apologies if this question has been asked many times. Certainly, I have found MANY github issues with similar symptoms, but no clear solution (or it's a problem that keeps coming back).</p> <h2>PROBLEM:</h2> <p>I installed whatever the latest version of Angular comes from npm:</p> <p><code>npm install -g @angular/cli</code></p> <p>When I run <code>ng</code> (with any options, even if just <code>ng --version</code>), I get the following error:</p> <pre><code>module.js:540 throw err; ^ Error: Cannot find module '@angular-devkit/core' at Function.Module._resolveFilename (module.js:538:15) ... ... </code></pre> <h2>APPARENT SOLUTION:</h2> <p>Installing <code>@angular-devkit/core</code> seems to fix the problem:</p> <p><code>npm install -g @angular-devkit/core</code></p> <p>... well, almost...</p> <p>I then have to make sure I ALSO install the same devkit component <strong>for each application</strong>:</p> <p><code>npm install --save @angular-devkit/core</code></p> <h2>QUESTIONS:</h2> <p>Is there a problem with Angular's packaging?</p> <p>Do they deliberately leave out the devkit/core component, or just an accident with some versions?</p> <p>OR, Could it be that I am doing something wrong?</p> <hr> <p><strong>SOFTWARE VERSIONS:</strong></p> <ul> <li>Angular CLI: 1.6.4</li> <li>Node: 8.9.4</li> <li>OS: linux x64</li> <li>Angular: 5.2.1</li> </ul>
0debug
Sort a vector by specific member C++ : <p>Is it possible to sort a <code>vector</code> by a specific member of it's class? </p> <p>I have a class called <code>Car</code>:</p> <pre><code>class Carro { private: int positionX; int place; public: Carro(string marca, float energiaInicial, float energiaMaxima, int velocMax, string model = "modelo base"); ~Carro(); void setPosition(int posX); void setPlace(int place); int getPositionX() const; int getPlace() const;}; </code></pre> <p>And a vector of cars: <code>vector&lt;Car*&gt; raceTrack;</code></p> <p>What I want to do is sort this vector according to car's position. If the car A is ahead of car B then A takes 1st place and B takes 2nd place, and so on.</p> <p>P.S. Imagine that all the cars have already a place defined (ex: car A has 1, car B has 2, car C has 3...)</p>
0debug
Why do lifetimes differ when a function is called in a closure vs. being called directly in Rust? : <p>In the following code example:</p> <pre><code>fn default_values() -&gt; &amp;'static [u32] { static VALUES: [u32; 3] = [1, 2, 3]; &amp;VALUES } fn main() { let values: [u32; 3] = [4, 5, 6]; let optional_values: Option&lt;&amp;[u32]&gt; = Some(&amp;values); // this compiles and runs fine let _v = optional_values.unwrap_or_else(|| default_values()); // this fails to compile let _v = optional_values.unwrap_or_else(default_values); } </code></pre> <p>the last statement fails to compile with:</p> <pre><code>error[E0597]: `values` does not live long enough --&gt; src/main.rs:8:49 | 8 | let optional_values: Option&lt;&amp;[u32]&gt; = Some(&amp;values); | ^^^^^^ borrowed value does not live long enough ... 12 | } | - borrowed value only lives until here | = note: borrowed value must be valid for the static lifetime... </code></pre> <p>I'm wondering:</p> <ol> <li>what's happening that causes the difference in behaviour between the last two statements</li> <li>whether the first <code>unwrap_or_else(|| default_values())</code> is the correct way of handling this, or whether there's a better pattern</li> </ol>
0debug
CAN NOT INSTALL HOMEBREW : <p>MacBook-Pro:~ Carina$ ruby -e "$(curl -fsSL <a href="https://raw.githubusercontent.com/Homebrew/install/master/install" rel="nofollow noreferrer">https://raw.githubusercontent.com/Homebrew/install/master/install</a>)" -bash: curl: command not found -bash: ruby: command not found How can I fix that, because I am trying to download pygame on my mac, Please help me!! Thank you very much!</p>
0debug
static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h) { const int flags[] = { SWS_FAST_BILINEAR, SWS_BILINEAR, SWS_BICUBIC, SWS_X , SWS_POINT , SWS_AREA, 0 }; const int srcW = w; const int srcH = h; const int dstW[] = { srcW - srcW/3, srcW, srcW + srcW/3, 0 }; const int dstH[] = { srcH - srcH/3, srcH, srcH + srcH/3, 0 }; enum PixelFormat srcFormat, dstFormat; for (srcFormat = 0; srcFormat < PIX_FMT_NB; srcFormat++) { for (dstFormat = 0; dstFormat < PIX_FMT_NB; dstFormat++) { int i, j, k; int res = 0; printf("%s -> %s\n", sws_format_name(srcFormat), sws_format_name(dstFormat)); fflush(stdout); for (i = 0; dstW[i] && !res; i++) for (j = 0; dstH[j] && !res; j++) for (k = 0; flags[k] && !res; k++) res = doTest(ref, refStride, w, h, srcFormat, dstFormat, srcW, srcH, dstW[i], dstH[j], flags[k]); } } }
1threat
void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes, unsigned int *out_bytes) { unsigned int idx; unsigned int total_bufs, in_total, out_total; idx = vq->last_avail_idx; total_bufs = in_total = out_total = 0; while (virtqueue_num_heads(vq, idx)) { unsigned int max, num_bufs, indirect = 0; hwaddr desc_pa; int i; max = vq->vring.num; num_bufs = total_bufs; i = virtqueue_get_head(vq, idx++); desc_pa = vq->vring.desc; if (vring_desc_flags(desc_pa, i) & VRING_DESC_F_INDIRECT) { if (vring_desc_len(desc_pa, i) % sizeof(VRingDesc)) { error_report("Invalid size for indirect buffer table"); exit(1); } if (num_bufs >= max) { error_report("Looped descriptor"); exit(1); } indirect = 1; max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc); num_bufs = i = 0; desc_pa = vring_desc_addr(desc_pa, i); } do { if (++num_bufs > max) { error_report("Looped descriptor"); exit(1); } if (vring_desc_flags(desc_pa, i) & VRING_DESC_F_WRITE) { in_total += vring_desc_len(desc_pa, i); } else { out_total += vring_desc_len(desc_pa, i); } } while ((i = virtqueue_next_desc(desc_pa, i, max)) != max); if (!indirect) total_bufs = num_bufs; else total_bufs++; } if (in_bytes) { *in_bytes = in_total; } if (out_bytes) { *out_bytes = out_total; } }
1threat
void pcie_port_init_reg(PCIDevice *d) { pci_set_word(d->config + PCI_STATUS, 0); pci_set_word(d->config + PCI_SEC_STATUS, 0); #define PCI_BRIDGE_CTL_VGA_16BIT 0x10 pci_set_word(d->wmask + PCI_BRIDGE_CONTROL, PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_ISA | PCI_BRIDGE_CTL_VGA | PCI_BRIDGE_CTL_VGA_16BIT | PCI_BRIDGE_CTL_SERR | PCI_BRIDGE_CTL_BUS_RESET); }
1threat
circular image view like skype in flutter : how to make this circular image like skype in flutter. Iam new to flutter. Anyone help. Thanks alot[![enter image description here][1]][1] [1]: https://i.stack.imgur.com/sLUxN.jpg
0debug
PHP Static objects and methods : <p>I was wondering when I should use static methods and properties instead of 'normal' properties and methods. I know that static methods can be called without creating an instance of an object but I can't seem to find another example when to use static methods or properties.</p> <p>Can somebody explain the static keyword with some examples how and when to use it (or not)?</p>
0debug
read textfile to a 2D verctor in c99 : i have a textfile with some rows of text i want to put the text into a 2D vector because i need to be able to call each character seperatly [x][y] this is what i got: int main() { // Variable declarations fstream file; int i=0; vector<vector<char> > maze(1,vector<char>(1)); ifstream myReadFile; myReadFile.open("input.txt"); while (!myReadFile.eof()) { for (int j=0; maze[i][j] != "\0"; j++){ myReadFile >> maze[i][j]; } i++; } file.close(); for (int i = 0; i < maze.size(); i++) { for (int j = 0; j < maze[i].size(); j++) { cout << maze[i][j]; } } return 0; }
0debug
Exporting data from Google Cloud Storage to Amazon S3 : <p>I would like to transfer data from a table in BigQuery, into another one in Redshift. My planned data flow is as follows:</p> <p>BigQuery -> Google Cloud Storage -> Amazon S3 -> Redshift</p> <p>I know about Google Cloud Storage Transfer Service, but I'm not sure it can help me. From Google Cloud documentation:</p> <blockquote> <p><strong>Cloud Storage Transfer Service</strong></p> <p>This page describes Cloud Storage Transfer Service, which you can use to quickly import online data into Google Cloud Storage.</p> </blockquote> <p>I understand that this service can be used to import data into Google Cloud Storage and not to export from it.</p> <p>Is there a way I can export data from Google Cloud Storage to Amazon S3?</p>
0debug
Strange ArrayIndexOutOfBoundsException in android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback : <p>I received a strange out of bounds exception in the Play Store console relating to the <a href="https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback.html" rel="noreferrer">android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback</a></p> <pre><code>java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.example.MyFragmentActivity.onRequestPermissionsResult(MyFragmentActivity.java:2068) at android.app.Activity.requestPermissions(Activity.java:4163) at android.support.v4.app.ActivityCompatApi23.requestPermissions(ActivityCompat23.java:32) at android.support.v4.app.ActivityCompat.requestPermissions(ActivityCompat.java:316) at com.example.MyFragmentActivity.onConnected(MyFragmentActivity.java:2048) at com.google.android.gms.common.internal.zzk.zzk(Unknown Source) at com.google.android.gms.common.api.internal.zzj.zzi(Unknown Source) at com.google.android.gms.common.api.internal.zzh.zzpx(Unknown Source) at com.google.android.gms.common.api.internal.zzh.onConnected(Unknown Source) at com.google.android.gms.common.api.internal.zzl.onConnected(Unknown Source) at com.google.android.gms.common.api.internal.zzc.onConnected(Unknown Source) at com.google.android.gms.common.internal.zzj$zzg.zzqL(Unknown Source) at com.google.android.gms.common.internal.zzj$zza.zzc(Unknown Source) at com.google.android.gms.common.internal.zzj$zza.zzw(Unknown Source) at com.google.android.gms.common.internal.zzj$zzc.zzqN(Unknown Source) at com.google.android.gms.common.internal.zzj$zzb.handleMessage(Unknown Source) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7229) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) </code></pre> <p>This is my onRequestPermissionsResult implementation</p> <pre><code>@Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { switch (requestCode) { case REQUEST_CODE_ASK_LOCATION_PERMISSIONS: if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { // Permission Granted if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); } startLocationUpdates(); } else { // Permission Denied } break; default: super.onRequestPermissionsResult(requestCode, permissions, grantResults); } } </code></pre> <p>Line 2068 is this:</p> <pre><code>if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { </code></pre> <p>I believe it's claiming <code>grantResults</code> length is zero which is why the java.lang.ArrayIndexOutOfBoundsException is thrown. According to the <a href="https://developer.android.com/reference/android/support/v4/app/ActivityCompat.OnRequestPermissionsResultCallback.html" rel="noreferrer">documentation</a> </p> <blockquote> <p>int: The grant results for the corresponding permissions which is either <strong>PERMISSION_GRANTED or PERMISSION_DENIED. Never null.</strong></p> </blockquote> <p><code>grantResults</code> will not be null, but doesn't say anything about it not containing a value either. Furthermore it seems like the callback will contain at least one value, either <code>PERMISSION_GRANTED</code> or <code>PERMISSION_DENIED</code>. Is this a bug or am I misunderstanding the documentation?</p>
0debug
Sqlite: fetching fisrt char from the word and replace with * based on any condition : I need to fetch first char of contact names (includes all language) and replace chars which doesn't satisfy range of char-set for selected language. For example:- My table will be having English contacts and Chinese contacts, now if I select Chinese language then my query should give me all the first chars from the names but for English contact it should return '*'. Any lead will be appreciated. Thanks in advance.
0debug
query = 'SELECT * FROM customers WHERE email = ' + email_input
1threat
Used stored procedure with c# : I write c# code with use stored procedure, he work and write database, but write error where: while (rdr.Read()) { PrichinatextBox.Text = (string)rdr["Prichina"]; dateEdit.Text = (string.Format("{yyyy-MM-dd}", rdr["data"])); //error format exception } connection.Close(); MessageBox.Show("Ваши данные добавлены"); Write code for realize it.
0debug
How to execute and parse a data from a url in javascript : <p>I have this a link that contains information about what food is being served at a school each day:</p> <p><a href="https://nobilis.nobles.edu/skyworld/castlemenu.php" rel="nofollow noreferrer">https://nobilis.nobles.edu/skyworld/castlemenu.php</a>?</p> <p>How do I execute this url in javascript and parse the result?</p> <p>Please let me know if I need to clarify further. I have been unable to find any information about how to do this and any help would be greatly appreciated!</p>
0debug
How can I flatten an array swiftily in Swift? : <p>I want to turn this:</p> <pre><code>let x = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] </code></pre> <p>into this:</p> <pre><code>[1, 2, 3, 4, 5, 6, 7, 8, 9] </code></pre> <p>very gracefully.</p> <p>The most straightforward way, of course, is</p> <pre><code>var y = [Int]() x.forEach { y.appendContentsOf($0) } </code></pre> <p>But that makes the resulting array mutable, which is unnecessary. I don't like this way.</p> <p>I tried using <code>reduce</code>:</p> <pre><code>let y = x.reduce([Int]()) { (array, ints) -&gt; [Int] in array.appendContentsOf(ints) return array } </code></pre> <p>But the compiler complains that <code>array</code> is immutable, so I can't call the mutating method <code>appendContentsOf</code>. </p> <p>Hence, I added some stuff:</p> <pre><code>let y = x.reduce([Int]()) { (array, ints) -&gt; [Int] in var newArr = array newArr.appendContentsOf(ints) return newArr } </code></pre> <p>This is just <em>plain bad</em>. I have an instinct that this is not swifty.</p> <p>How can I flatten an array more swiftily than the above methods? A one-liner would be good.</p>
0debug
int ff_dirac_golomb_read_16bit(DiracGolombLUT *lut_ctx, const uint8_t *buf, int bytes, uint8_t *_dst, int coeffs) { int i, b, c_idx = 0; int16_t *dst = (int16_t *)_dst; DiracGolombLUT *future[4], *l = &lut_ctx[2*LUT_SIZE + buf[0]]; INIT_RESIDUE(res); for (b = 1; b <= bytes; b++) { future[0] = &lut_ctx[buf[b]]; future[1] = future[0] + 1*LUT_SIZE; future[2] = future[0] + 2*LUT_SIZE; future[3] = future[0] + 3*LUT_SIZE; if ((c_idx + 1) > coeffs) return c_idx; if (res_bits && l->sign) { int32_t coeff = 1; APPEND_RESIDUE(res, l->preamble); for (i = 0; i < (res_bits >> 1) - 1; i++) { coeff <<= 1; coeff |= (res >> (RSIZE_BITS - 2*i - 2)) & 1; } dst[c_idx++] = l->sign * (coeff - 1); SET_RESIDUE(res, 0, 0); } for (i = 0; i < LUT_BITS; i++) dst[c_idx + i] = l->ready[i]; c_idx += l->ready_num; APPEND_RESIDUE(res, l->leftover); l = future[l->need_s ? 3 : !res_bits ? 2 : res_bits & 1]; } return c_idx; }
1threat
static void poll_set_started(AioContext *ctx, bool started) { AioHandler *node; if (started == ctx->poll_started) { return; } ctx->poll_started = started; qemu_lockcnt_inc(&ctx->list_lock); QLIST_FOREACH_RCU(node, &ctx->aio_handlers, node) { IOHandler *fn; if (node->deleted) { continue; } if (started) { fn = node->io_poll_begin; } else { fn = node->io_poll_end; } if (fn) { fn(node->opaque); } } qemu_lockcnt_dec(&ctx->list_lock); }
1threat
c++ employee name search : <pre><code> string name[size] = {"Collins, Bill", "Smith, Bart", "Michalski, Joe", "Griffin, Jim", "Sanchez, Manny", "Rubin, Sarah", "Taylor, Tyrone", "Johnson, Jill", "Allison, Jeff", "Moreno, Juan", "Wolfe, Bill", "Whitman, Jean", "Moretti, Bella", "Wu, Hong", "Patel, Renee", "Harrison, Rose", "Smith, Cathy", "Conroy, Pat", "Kelly, Sean", "Holland, Beth"}; int binarySearchIterative(string name[], int size, string empName) { int low = 0; int high = size - 1; while (low &lt;= high) { int mid = (low + high) / 2; if (empName == name[mid]) { return mid; } else if (empName &lt; name[mid]) { high = mid - 1; } else { low = mid + 1; } } return -1; } </code></pre> <p>So when I type in a name to search for, I have to type it in exactly as listed in the array. For example, if I want to find Bill Collins. I have to type it as Collins, Bill. If I were to type in Bill Collins, it would tell me that the employee is not found. I need to be able to search the name First Last, and also without using the comma. If you need to see more of my code let me know.</p>
0debug
onblur() event stop onclick() event : I have a textbox which have onblur() event and a button with onclick(). But when i type something in text and without losing focus from textbox click on button . only onblur() event fire it will stop the onclick event of button
0debug
add subquery to cte : declare @nodeid int = '1'; with cte as ( select cust_ID, name,null lnode, null rnode from user_detail where cust_ID = @nodeid union all select t.cust_ID,t.name, ISNULL(cte.lnode, CASE WHEN t.joinside = 0 THEN 1 ELSE 0 END) lnode, ISNULL(cte.rnode, CASE WHEN t.joinside = 1 THEN 1 ELSE 0 END) rnode from user_detail t inner join cte on cte.cust_ID = t.parentid ) select cust_ID,name from cte where rnode='0' option (maxrecursion 0) **Current Scenario:** [screenshot of above query results][1] **What i want is:** [screenshot of what i want][2] ***now i will explain what i want:*** the above query is getting results only from user_detail table. now i want to modify the query in such a way that it will also search in "installments" table for the "status" column of the respective cust_id (which the above query is returning). The modified query will get the value of status from installments table based on cust_id. And query will show the results in the third column as showing in 2nd screenshot. i am not much familiar with cte and nested queries. I hope you guys will understand my problem. [1]: https://i.stack.imgur.com/RsPRj.png [2]: https://i.stack.imgur.com/e5OxK.png
0debug
MySQL: SyntaxError: Unexpected identifier : <p>I just installed MySQL on my computer and when I try to create a database from the MySQL shell, I get this error:</p> <pre><code>MySQL JS &gt; CREATE DATABASE databasename; SyntaxError: Unexpected identifier </code></pre> <p>Does anyone know why this is happening? Maybe there is a problem with the insallation of MySQL?</p>
0debug
How to change content type of Amazon S3 Objects : <p>The objects in my Amazon S3 bucket are all of the content type <code>application/octet-stream</code>. Some of these objects are PDFs, sometimes images like <code>JPG</code>, <code>GIF</code>, <code>PNG</code>. How can I change the content type of these objects to <code>images/jpeg</code>, <code>application/pdf</code> etc.?</p> <p>Can it be done in batch through the Amazon Console?</p> <p>Can I use the command line?</p> <p>Or maybe through PHP?</p>
0debug