problem
stringlengths
26
131k
labels
class label
2 classes
Airbnb API key not unique per user : <p>I have been researching the Airbnb API and have started working with it and making some requests. Some API calls such as calendar_months require an API key: <a href="https://www.airbnb.com/api/v2/calendar_months?key=your_api_key&amp;listing_id=17794278&amp;_format=with_price" rel="noreferrer">https://www.airbnb.com/api/v2/calendar_months?key=your_api_key&amp;listing_id=17794278&amp;_format=with_price</a></p> <p>I know that your API key can be found in the meta tags, or by inspecting requests in the browser (<a href="https://stackoverflow.com/questions/38243819/how-to-acquire-api-key-for-airbnb">How to acquire API key for Airbnb</a>). This is fine, and I've successfully located my API key. </p> <p>My concern is that this key does not appear to be unique. I've retrieved the API key from multiple computers on multiple networks with separate IP addresses -- even from a server in another country with no association to my previous Airbnb activity. I always find the same API key: d306zoyjsyarp7ifhu67rjxn52tv0t20</p> <p>I'd normally never post the key for my account somewhere (obviously), but it's clear that this API key is not unique to me. A quick google search shows that many people are already using it: <a href="https://www.google.com/search?q=d306zoyjsyarp7ifhu67rjxn52tv0t20" rel="noreferrer">https://www.google.com/search?q=d306zoyjsyarp7ifhu67rjxn52tv0t20</a></p> <p>You can find the same situation with API key 3092nxybyb0otqw18e8nh5nty. This one I initially found in the old unofficial airbnb api docs (<a href="https://stackoverflow.com/questions/44107282/does-you-have-a-copy-of-a-documentation-of-unofficial-airbnb-api">Does you have a copy of a documentation of unofficial AirBnb API?</a>) so it's understandable that some people might have found it there and started using it. </p> <p>I've searched extensively to find some discussion on this, but I can't find anything and I have a number of questions about this: </p> <ul> <li>Look up your own API key and do a google search for it -- is anyone else sharing your key? </li> <li>Do you receive different keys on separate computers / networks? </li> <li>Why would Airbnb require a key for certain requests, if the key does not to uniquely identify the user? </li> <li>Is there something I'm overlooking which would allow them to identify me even though many people are sharing this key? </li> <li>How can I acquire a truly unique API key? </li> <li>Why is no one talking about this?</li> </ul> <p>Thanks!</p>
0debug
static void vapic_map_rom_writable(VAPICROMState *s) { target_phys_addr_t rom_paddr = s->rom_state_paddr & ROM_BLOCK_MASK; MemoryRegionSection section; MemoryRegion *as; size_t rom_size; uint8_t *ram; as = sysbus_address_space(&s->busdev); if (s->rom_mapped_writable) { memory_region_del_subregion(as, &s->rom); memory_region_destroy(&s->rom); } section = memory_region_find(as, 0, 1); ram = memory_region_get_ram_ptr(section.mr); rom_size = ram[rom_paddr + 2] * ROM_BLOCK_SIZE; s->rom_size = rom_size; rom_size += rom_paddr & ~TARGET_PAGE_MASK; rom_paddr &= TARGET_PAGE_MASK; rom_size = TARGET_PAGE_ALIGN(rom_size); memory_region_init_alias(&s->rom, "kvmvapic-rom", section.mr, rom_paddr, rom_size); memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000); s->rom_mapped_writable = true; }
1threat
how to use the same theme that you bought? : im new in wordpress and i bought a theme from tavern and i want to use the same theme pictures and everything but when i install the theme i dont see the same pictures. [this is the theme that i bought][1] [this how it looks like when i install it][2] [1]: http://i.stack.imgur.com/TOhHf.jpg [2]: http://i.stack.imgur.com/t4hgC.png thank you guys
0debug
static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) { NumaOptions *object = NULL; Error *err = NULL; { OptsVisitor *ov = opts_visitor_new(opts); visit_type_NumaOptions(opts_get_visitor(ov), NULL, &object, &err); opts_visitor_cleanup(ov); } if (err) { goto error; } switch (object->type) { case NUMA_OPTIONS_KIND_NODE: numa_node_parse(object->u.node, opts, &err); if (err) { goto error; } nb_numa_nodes++; break; default: abort(); } return 0; error: error_report_err(err); qapi_free_NumaOptions(object); return -1; }
1threat
What 3d simulation software does deepmind use? : <p>I am looking for the name of simulation software used by Deepmind in <a href="https://www.youtube.com/watch?v=gn4nRCC9TwQ" rel="nofollow noreferrer">this video</a>? and what alternative softwares are available?</p>
0debug
why i am getting this error in Spring mvc (Invalid mime type "json": does not contain '/')? : Getting Below error : EVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping': Invocation of init method failed; nested exception is org.springframework.http.InvalidMediaTypeException: Invalid mime type "json": does not contain '/' ``` <%@page import="org.json.JSONObject"%> <%@ page language="java" contentType="application/json charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <h1>Welcome</h1> <a href="./getRegister">Register</a> <a href="./delete?id=1">Delete</a> <% JSONObject obj = new JSONObject(); obj.put("id", "1"); obj.put("name", "ABC"); %> <form action="./jsonreq" method="post"> <input type="hidden" name="obj" id="obj" value="<%=obj%>"> <input type="submit" value="Submit"/> </form> </body> </html> ``` 2)Controller: ``` import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.springhibernate.bean.Employee; import com.springhibernate.service.EmployeeService; @Controller public class RegistrationController { @RequestMapping(path="/jsonreq", method=RequestMethod.POST, consumes="json") public @ResponseBody Employee json(@RequestBody Employee obj) { return obj; } } ``` EVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping': Invocation of init method failed; nested exception is org.springframework.http.InvalidMediaTypeException: Invalid mime type "json": does not contain '/'
0debug
static int do_qmp_capabilities(Monitor *mon, const QDict *params, QObject **ret_data) { if (monitor_ctrl_mode(mon)) { mon->qmp.command_mode = 1; } return 0; }
1threat
Flutter BottomNavigationBar not working with more than three items : <p>I´ve a problem with the <strong>BottomNavigationBar</strong> in Flutter (0.6). As soon as I add <strong>more then three BottomNavigationBarItems</strong> as children, the buttons in the bar have <strong>white icons and they are messed up</strong>. When I use only three or less items, everything´s fine.</p> <p>Here´s the widget code I use and which breaks the bar:</p> <pre><code>bottomNavigationBar: BottomNavigationBar( currentIndex: 0, iconSize: 20.0, items: [ BottomNavigationBarItem( title: Text('Home'), icon: Icon(Icons.accessibility)), BottomNavigationBarItem( title: Text('Preise'), icon: Icon(Icons.account_box)), BottomNavigationBarItem( title: Text('Test'), icon: Icon(Icons.adb)), BottomNavigationBarItem( title: Text('Mehr'), icon: Icon(Icons.menu)) ]) </code></pre> <p>Has anybody an idea what´s wrong here?</p> <p>Thanks in advance for any hint, Michael</p>
0debug
How can i split this string format to array for in javascript? : <p><p>Dear all, Currently am trying to split this string format: <code>x:10/08/2018,10/08/2018,10/08/2018~y:10,20,12</code> to array format like this:<p></p> <pre> [ { x:10/08/2018, y: 10 }, { x:10/08/2018, y: 20 }, { x:10/08/2018, y: 12 } ] </pre> <p>Who have experience with this split by using javascript could you please tell me now. Thanks in advance.</p>
0debug
whats the advantages to use react js in asp.net core project? : <p>I want to build an accounting application by asp.net core and I want to know is that better to use react js for my app UI or there is no difference? Is that makes my work easier? (I am new in both asp.net core and react js.) thanks for answering :)</p>
0debug
DISAS_INSN(wdebug) { if (IS_USER(s)) { gen_exception(s, s->pc - 2, EXCP_PRIVILEGE); return; } qemu_assert(0, "WDEBUG not implemented"); }
1threat
static void writer_print_ts(WriterContext *wctx, const char *key, int64_t ts, int is_duration) { if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0)) { writer_print_string(wctx, key, "N/A", 1); } else { writer_print_integer(wctx, key, ts); } }
1threat
How should make an unlimited unique username in SQL? : <p>How do I make an infinite number of lines unique? The system I'm using is currently <code>BIGINT(20)</code> but it also has a maximum limit. What approach should be taken? How do I make an unlimited number of rows unique?</p>
0debug
static void pcie_pci_bridge_realize(PCIDevice *d, Error **errp) { PCIBridge *br = PCI_BRIDGE(d); PCIEPCIBridge *pcie_br = PCIE_PCI_BRIDGE_DEV(d); int rc, pos; pci_bridge_initfn(d, TYPE_PCI_BUS); d->config[PCI_INTERRUPT_PIN] = 0x1; memory_region_init(&pcie_br->shpc_bar, OBJECT(d), "shpc-bar", shpc_bar_size(d)); rc = shpc_init(d, &br->sec_bus, &pcie_br->shpc_bar, 0, errp); if (rc) { goto error; } rc = pcie_cap_init(d, 0, PCI_EXP_TYPE_PCI_BRIDGE, 0, errp); if (rc < 0) { goto cap_error; } pos = pci_add_capability(d, PCI_CAP_ID_PM, 0, PCI_PM_SIZEOF, errp); if (pos < 0) { goto pm_error; } d->exp.pm_cap = pos; pci_set_word(d->config + pos + PCI_PM_PMC, 0x3); pcie_cap_arifwd_init(d); pcie_cap_deverr_init(d); rc = pcie_aer_init(d, PCI_ERR_VER, 0x100, PCI_ERR_SIZEOF, errp); if (rc < 0) { goto aer_error; } if (pcie_br->msi != ON_OFF_AUTO_OFF) { rc = msi_init(d, 0, 1, true, true, errp); if (rc < 0) { goto msi_error; } } pci_register_bar(d, 0, PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64, &pcie_br->shpc_bar); return; msi_error: pcie_aer_exit(d); aer_error: pm_error: pcie_cap_exit(d); cap_error: shpc_free(d); error: pci_bridge_exitfn(d); }
1threat
Getting different results for getStackTrace()[2].getMethodName() : <p>For logging purposes, I created a method logTitle() that prints out the calling method name for our TestNG tests. Sample code is below.</p> <pre><code>@Test public void test1() throws Exception { method1(); } public static void method1() throws Exception { Utils.logTitle(2); } </code></pre> <p>...</p> <pre><code>public static void logTitle(Integer level) throws Exception { // Gets calling method name String method = Thread.currentThread().getStackTrace()[2].getMethodName(); // This would get current method name switch (level) { case 1: logger.info("======================================================="); logger.info(method); logger.info("======================================================="); break; case 2: logger.info("------------------------------------"); logger.info(method); logger.info("------------------------------------"); break; case 3: logger.info("---------------------"); logger.info(method); logger.info("---------------------"); break; case 4: logger.info("--------- " + method + " ------------"); break; default: logger.info(method); } } </code></pre> <p>The problem is I am getting different results for logTitle() on two different machines.</p> <p>Everyone's laptop returns correctly:</p> <pre><code>2016-06-20 14:22:06 INFO - ------------------------------------ 2016-06-20 14:22:06 INFO - method1 2016-06-20 14:22:06 INFO - ------------------------------------ </code></pre> <p>Our dev unix box returns differently:</p> <pre><code>2016-06-20 14:42:26 INFO - ------------------------------------ 2016-06-20 14:42:26 INFO - logTitle 2016-06-20 14:42:26 INFO - ------------------------------------ </code></pre> <p>This works correctly on everyone else's laptop, just not the dev unix box. I think the dev unix box is using IBM's version of Java, while everyone else is using Oracle's version of Java, but not sure if that is the culprit or not.</p> <p>Any ideas?</p>
0debug
How to get specific part of url between two strings in jQuery : <p>I am trying to extract a specific ID from the url I have.</p> <p><a href="https://myhost.com/ReferredSummary.aspx?PolicyId=4807307&amp;EndorsementId=5941939&amp;EditExisting=true&amp;NewClient=true&amp;Adjustment=True" rel="nofollow noreferrer">https://myhost.com/ReferredSummary.aspx?PolicyId=4807307&amp;EndorsementId=5941939&amp;EditExisting=true&amp;NewClient=true&amp;Adjustment=True</a></p> <p>the ID I need is = 4807307 It always have the strings PolicyId= before and &amp;EndorsementId= after.</p> <p>How Can I extract the the from the url.</p>
0debug
How to use client side printer and scanner in ASP.Net c#? : <p>using client side printer and scanner in ASP.Net c#</p> <p>I m developing a web application in asp.net c# 4.0 , It will be hosted on shared server hosting. but i want to use client side printer. without out prompting print window to user.</p>
0debug
PHP to convert longitude and latitude : I have loop that gives me a longitude and latitude for each client , I am looking for a function where I can pass these variables into and it will out northing and easting value. I have tried gPoint class but no joy. Foreach ($clients as $client) { $client[lat] $client[long] Function convert($lat,$long) }
0debug
Cannot fix date and month method - Android Studio : I have been fiddling around with this method that I created and cannot manage get it to work. I either get string cannot be converted to int or require return, but then I cannot enter the monthString variable in the return statement as it is out of scope and cannot find the variable. mDateSetListener = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker datePicker, int year, int month, int day) { month = month + 1; Log.w(TAG, "Date of Birth: " + day + "/" + month + "/" + year); String date = day + "/" + month + "/" + year; mDisplayDate.setText(date); Toast.makeText(ProfileSettings.this, date, Toast.LENGTH_LONG).show(); ordinal(day, month, year); } String ordinal(int day, int month, int year) { String[] day1 = new String[]{"th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"}; switch (day % 100) { case 11: case 12: case 13: Log.w(TAG, day + "th"); String monthString; switch (month) { case 1: monthString = "January"; break; case 2: monthString = "February"; break; case 3: monthString = "March"; break; case 4: monthString = "April"; break; case 5: monthString = "May"; break; case 6: monthString = "June"; break; case 7: monthString = "July"; break; case 8: monthString = "August"; break; case 9: monthString = "September"; break; case 10: monthString = "October"; break; case 11: monthString = "November"; break; case 12: monthString = "December"; break; Log.w(TAG, day + "" + day1[day % 10] + " " + monthString + " " + year); return day + monthString; } } return day + monthString; } At the moment I am getting cannot resolve symbol monthString in the last return statement at the bottom Thanks
0debug
How to remove the defult comma from the start of an Array in Javascript : I have a variable pushing a word into an array. When I print this array onto a website the word starts with a comma in front! var bar = [""]; function myFunction2() { bar.push('pubs'); document.getElementById("demo").innerHTML = bar; //Prints on website } And the result printed on the website is: ,pubs Thanks for any help!
0debug
Fastest way to get a distributed spark cluster to parallelize a massive compressed local directory? : How can I get a distributed spark cluster to parallelize a massive compressed directory (1 terabyte uncompressed) of small text files, if that file is on one local machine? Ideally, this entire document would already be on a shared file system like HDFS or Hive, but it's currently on a local machine. sanitizing and placing each file in this directory onto a distributed data store will take on the order of days if done locally. is there any way for remote spark workers to partition this zipped file, and just start batch processing their chunks and dumping their results in a distributed store? if so, what is the fastest store i should be using?
0debug
git diff --name-status : What does R100 mean? : <p>When I do e.g. <code>git diff master --name-status</code> I see some lines with the <code>R100</code> prefix on them. </p> <p>What does <strong><code>R100</code></strong> exactly mean?</p> <hr> <p>I would assume <code>R</code> means "moved". I am posting below <a href="https://git-scm.com/docs/git-diff" rel="noreferrer">what I found in the documentation</a>, but nothing in this text says anything about <code>100</code> or numbers per se.</p> <blockquote> <p><code>--name-status</code> Show only names and status of changed files. See the description of the --diff-filter option on what the status letters mean.</p> </blockquote> <p>and then</p> <blockquote> <p><code>--diff-filter=[(A|C|D|M|R|T|U|X|B)…​[*]]</code> Select only files that are Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), have their type (i.e. regular file, symlink, submodule, …​) changed (T), are Unmerged (U), are Unknown (X), or have had their pairing Broken (B). Any combination of the filter characters (including none) can be used. When * (All-or-none) is added to the combination, all paths are selected if there is any file that matches other criteria in the comparison; if there is no file that matches other criteria, nothing is selected.</p> <p>Also, these upper-case letters can be downcased to exclude. E.g. --diff-filter=ad excludes added and deleted paths.</p> <p>Note that not all diffs can feature all types. For instance, diffs from the index to the working tree can never have Added entries (because the set of paths included in the diff is limited by what is in the index). Similarly, copied and renamed entries cannot appear if detection for those types is disabled.</p> </blockquote>
0debug
Select from one table where not in another mssql : hi i have `mssql` `server` db on my computer and there is tow `tables` this is the first one [Participant]SELECT [ParticipantID] ,[ParticipantName] ,[ParticipantNumber] ,[PhoneNumber] ,[Mobile] ,[Email] ,[Address] ,[Notes] ,[IsDeleted] ,[Gender] ,[DOB] FROM [Gym].[dbo].[Participant] and this is the second one SELECT [ParticipationID] ,[ParticipationNumber] ,[ParticpationTypeID] ,[AddedByEmployeeID] ,[AddDate] ,[ParticipantID] ,[TrainerID] ,[ParticipationDate] ,[EndDate] ,[Fees] ,[PaidFees] ,[RemainingFees] ,[IsPeriodParticipation] ,[NoOfVisits] ,[Notes] ,[IsDeleted] FROM [Gym].[dbo].[Participation] now i need to wright mssql query thats can give me select Participant.ParticipantNumber,Participation.ParticipationDate,Participation.EndDate from Participation where Participant.ParticipantID=Participation.ParticipantID and im gonna be thankful
0debug
delete spevfic line from file [java] : i have a file that contains some data I want to delete some line from this file that contains specific substrings example for my file : {1:F21FIEGEGCXAXXX4781478239}{4:{177:1603150825}{451:0}} {1:F01FIEGEGCXAXXX4781478239} {2:O1030924160315RJHISARIAXXX83068856911603150825N} {4::20:PO/180797059/767 :23B:CRED :32A:160315USD1405,19 :50K:/213000010006082015619 M A A H TABOUK 71411 PO BOX 000001 :53B:/152700 :57A:FIEGEGCXMIN :59:/3829 ESAM ABDELALIM ABDELRAHMAN HABIB EGYPT :70:Family Expenses :71A:SHA-} {5:{MAC:00000000}{CHK:C04D5471B9E9}}{S:{SAC:}{COP:P}} I want to delete every line ends with `{451:0}}` like the first line and `{COP:P}}` like the last line ? any help ?
0debug
uint32_t helper_efdctsi (uint64_t val) { CPU_DoubleU u; u.ll = val; if (unlikely(float64_is_nan(u.d))) return 0; return float64_to_int32(u.d, &env->vec_status); }
1threat
Is there a site or app where you can get examples of code assignments? : <p>Okey, so here I'm learning coding (mostly PHP, and frontend dev). And I would like to know if there is a site where I can get an assignment like "make a calculator" or similar. </p> <p>So I can get inspiration for small projects while I'm learning. Learning by doing so to speak. I don't want big projects. Something that I can make in one evening.</p> <p>I have googled around but with no luck.</p> <p>TL;DR, is there a site were I can find inspiration for small coding projects (PHP).</p>
0debug
Creating a code to perform hundreds of google searches and extract publication date : <p>Using python, how can I create a script to performing hundreds of google searches to gather the publication dates of the first link.</p>
0debug
Error:Could not find com.android.tools.build:gradle:3.3. Issue raise after upgrading gradle version for splunk:mint-android-sdk : <p>My App was working fine, then i add com.splunk:mint-android-sdk, which required upper version of gradle, so i upgrade the gradle to from 2.1 to 3.3. after that i am facing issues. Please review my gradle file and help me out and please guide me how it work.( This is my first app but i want sure make its should be working fine in all scenario )</p> <pre><code>Error:Could not find com.android.tools.build:gradle:3.3. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.3/gradle-3.3.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.3/gradle-3.3.jar https://plugins.gradle.org/m2/com/android/tools/build/gradle/3.3/gradle-3.3.pom https://plugins.gradle.org/m2/com/android/tools/build/gradle/3.3/gradle-3.3.jar https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.3/gradle-3.3.jar Required by: :MyApp:unspecified </code></pre> <p>My gradleare </p> <pre><code>apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 23 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.example.abc.myApp" minSdkVersion 19 targetSdkVersion 23 versionCode 1 versionName "1.0" multiDexEnabled= true manifestPlaceholders = [onesignal_app_id: "hjaadsffsddd8-2e6hgf-4fdsasdfgb63-8dad5-1111111", onesignal_google_project_number: "REMOTE"] } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:cardview-v7:+' compile 'com.getbase:floatingactionbutton:1.10.1' compile 'com.android.support:recyclerview-v7:23.0.0' compile 'com.android.support:support-v4:23.0.0' compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' compile 'com.onesignal:OneSignal:[3.6.1,3.99.99]' compile 'com.google.firebase:firebase-core:9.2.0' compile 'com.google.firebase:firebase-messaging:9.2.0' compile 'com.splunk:mint-android-sdk:5.2.1' } </code></pre> <p>and </p> <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.3' classpath 'com.google.gms:google-services:3.0.0' classpath 'com.splunk:mint-gradle-android-plugin:5.2.1' } } allprojects { repositories { jcenter() maven { url "https://maven.google.com" // Google's Maven repository } } } task clean(type: Delete) { delete rootProject.buildDir } </code></pre>
0debug
static int read_header(AVFormatContext *s, AVFormatParameters *ap) { BinkDemuxContext *bink = s->priv_data; AVIOContext *pb = s->pb; uint32_t fps_num, fps_den; AVStream *vst, *ast; unsigned int i; uint32_t pos, next_pos; uint16_t flags; int keyframe; vst = av_new_stream(s, 0); if (!vst) return AVERROR(ENOMEM); vst->codec->codec_tag = avio_rl32(pb); bink->file_size = avio_rl32(pb) + 8; vst->duration = avio_rl32(pb); if (vst->duration > 1000000) { av_log(s, AV_LOG_ERROR, "invalid header: more than 1000000 frames\n"); return AVERROR(EIO); } if (avio_rl32(pb) > bink->file_size) { av_log(s, AV_LOG_ERROR, "invalid header: largest frame size greater than file size\n"); return AVERROR(EIO); } avio_skip(pb, 4); vst->codec->width = avio_rl32(pb); vst->codec->height = avio_rl32(pb); fps_num = avio_rl32(pb); fps_den = avio_rl32(pb); if (fps_num == 0 || fps_den == 0) { av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den); return AVERROR(EIO); } av_set_pts_info(vst, 64, fps_den, fps_num); vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_BINKVIDEO; vst->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); vst->codec->extradata_size = 4; avio_read(pb, vst->codec->extradata, 4); bink->num_audio_tracks = avio_rl32(pb); if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) { av_log(s, AV_LOG_ERROR, "invalid header: more than "AV_STRINGIFY(BINK_MAX_AUDIO_TRACKS)" audio tracks (%d)\n", bink->num_audio_tracks); return AVERROR(EIO); } if (bink->num_audio_tracks) { avio_skip(pb, 4 * bink->num_audio_tracks); for (i = 0; i < bink->num_audio_tracks; i++) { ast = av_new_stream(s, 1); if (!ast) return AVERROR(ENOMEM); ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_tag = vst->codec->codec_tag; ast->codec->sample_rate = avio_rl16(pb); av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); flags = avio_rl16(pb); ast->codec->codec_id = flags & BINK_AUD_USEDCT ? CODEC_ID_BINKAUDIO_DCT : CODEC_ID_BINKAUDIO_RDFT; ast->codec->channels = flags & BINK_AUD_STEREO ? 2 : 1; } for (i = 0; i < bink->num_audio_tracks; i++) s->streams[i + 1]->id = avio_rl32(pb); } next_pos = avio_rl32(pb); for (i = 0; i < vst->duration; i++) { pos = next_pos; if (i == vst->duration - 1) { next_pos = bink->file_size; keyframe = 0; } else { next_pos = avio_rl32(pb); keyframe = pos & 1; } pos &= ~1; next_pos &= ~1; if (next_pos <= pos) { av_log(s, AV_LOG_ERROR, "invalid frame index table\n"); return AVERROR(EIO); } av_add_index_entry(vst, pos, i, next_pos - pos, 0, keyframe ? AVINDEX_KEYFRAME : 0); } avio_skip(pb, 4); bink->current_track = -1; return 0; }
1threat
Need Help printing five random numbers (like dice throws) for computer and player. I need to use ( randomeValue= ) statement seen in code. : My code is only producing two random numbers and not five for player and computer like I need it to. Can anybody see the problem? <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> import java.util.Random; public class Die{ private static int HIGHEST_DIE_VALUE=6; private static int LOWEST_DIE_VALUE=1; private int randomValue; public Die(){ randomValue = ((int)(Math.random() * 100) % HIGHEST_DIE_VALUE + LOWEST_DIE_VALUE); } private void generateRandom(){ randomValue = ((int)(Math.random() * 100) % HIGHEST_DIE_VALUE + LOWEST_DIE_VALUE); } public int getValue(){ return randomValue; } } public class FiveDice { public static void main(String[] args){ Die computer = new Die(); Die player = new Die(); System.out.println("Computer five random die values:"); System.out.println("\tDie 1 rolled a " + computer.getValue() + " value"); System.out.println("\tDie 2 rolled a " + computer.getValue() + " value"); System.out.println("\tDie 3 rolled a " + computer.getValue() + " value"); System.out.println("\tDie 4 rolled a " + computer.getValue() + " value"); System.out.println("\tDie 5 rolled a " + computer.getValue() + " value"); System.out.println("\nPlayer five random die values"); System.out.println("\t\tDie 1 rolled a " + player.getValue() + " value"); System.out.println("\t\tDie 2 rolled a " + player.getValue() + " value"); System.out.println("\t\tDie 3 rolled a " + player.getValue() + " value"); System.out.println("\t\tDie 4 rolled a " + player.getValue() + " value"); System.out.println("\t\tDie 5 rolled a " + player.getValue() + " value"); } } <!-- end snippet --> This is what the output: Computer five random die values: Die 1 rolled a 5 value Die 2 rolled a 5 value Die 3 rolled a 5 value Die 4 rolled a 5 value Die 5 rolled a 5 value Player five random die values Die 1 rolled a 4 value Die 2 rolled a 4 value Die 3 rolled a 4 value Die 4 rolled a 4 value Die 5 rolled a 4 value I need each die for each player to be random numbers. Any help?
0debug
What does <None Remove="..." /> mean in csproj? : <p>I'm working with a dotnet core csproj and I've added a new file. It doesn't initially get added to the csproj at all because of convention over configuration. But as soon as I change its Build Action from None to Embedded resource, two entries are written to the csproj file:</p> <pre><code>&lt;None Remove="MyFile.sql" /&gt; </code></pre> <p>and</p> <pre><code>&lt;EmbeddedResource Include="MyFile.sql" /&gt; </code></pre> <p>What does that first entry mean? It seems superfluous to me.</p>
0debug
vue: Uncaught TypeError: Cannot read property ... of undefined : <p>I'm using vue@2.1.3 and the <a href="https://github.com/vuejs-templates/webpack" rel="noreferrer">vue official webpack template</a> to build an app.</p> <p>When developing locally, I often see the warning <code>Uncaught TypeError: Cannot read property ... of undefined</code>, but the HTML can be rendered successfully. However, the HTML can't be rendered when it's deployed to Netlify with <code>npm run build</code> command. So I have to treat this warning seriously.</p> <p>I learned from <a href="https://forum-archive.vuejs.org/topic/3953/cannot-read-property-warning/2" rel="noreferrer">here</a> that it's because "the data is not complete when the component is rendered, but e.g. loaded from an API." and the solution is to "use <code>v-if</code> to render that part of the template only once the data has been loaded."</p> <p>There are two questions:</p> <ol> <li>I tried wrap <code>v-if</code> around multiple statements that's generating the warning but personal I think this solution is verbose. Is there a neat approach?</li> <li>"warnings" in local development turn into "fatal errors"(HTML can't be rendered) in production. How to make them the same? e.g. both of them issue warnings or errors?</li> </ol>
0debug
C++ : Size of structure? : <p><strong>My c++ code</strong> </p> <pre><code>#include &lt;iostream&gt; using namespace std ; struct Node { int data ; struct Node *next; }; int main(){ struct Node *head = NULL; struct Node *second = NULL; cout &lt;&lt; sizeof(struct Node); } </code></pre> <p><strong>output to terminal</strong></p> <pre><code>16 </code></pre> <p>How is the size 16 ? Size of int is 4bytes. How come it's multiplied by 4 ? Please can anyone give detailed calculation ? Thanks !</p>
0debug
Enterprise Distribution Provisioning Profile Expiration : <p>Our company enterprise provisioning profile is set to expire in a month, <strong>but our distribution certificate is set to expire in a few more years.</strong> What are our options?</p> <p>Do I need to regenerate a new provisioning profile and create a new build that I have to redistribute?</p> <p>Or is there a simpler option like just sending out the new provisioning profile I generate? or better yet I don't have to do anything?</p> <p>Thanks</p>
0debug
Reverse columns of a 2D : In python if my list is TheTextImage = [["111000"],["222999"]] How would one loop through this list creating a new one of NewTextImage = [["000111"],["999222"]] Can use [:] but not [::-1], and cannot use reverse()
0debug
static int decode_lowdelay(DiracContext *s) { AVCodecContext *avctx = s->avctx; int slice_x, slice_y, bufsize; int64_t coef_buf_size, bytes = 0; const uint8_t *buf; DiracSlice *slices; SliceCoeffs tmp[MAX_DWT_LEVELS]; int slice_num = 0; if (s->slice_params_num_buf != (s->num_x * s->num_y)) { s->slice_params_buf = av_realloc_f(s->slice_params_buf, s->num_x * s->num_y, sizeof(DiracSlice)); if (!s->slice_params_buf) { av_log(s->avctx, AV_LOG_ERROR, "slice params buffer allocation failure\n"); return AVERROR(ENOMEM); } s->slice_params_num_buf = s->num_x * s->num_y; } slices = s->slice_params_buf; coef_buf_size = subband_coeffs(s, s->num_x - 1, s->num_y - 1, 0, tmp) + 8; coef_buf_size = (coef_buf_size << (1 + s->pshift)) + 512; if (s->threads_num_buf != avctx->thread_count || s->thread_buf_size != coef_buf_size) { s->threads_num_buf = avctx->thread_count; s->thread_buf_size = coef_buf_size; s->thread_buf = av_realloc_f(s->thread_buf, avctx->thread_count, s->thread_buf_size); if (!s->thread_buf) { av_log(s->avctx, AV_LOG_ERROR, "thread buffer allocation failure\n"); return AVERROR(ENOMEM); } } align_get_bits(&s->gb); buf = s->gb.buffer + get_bits_count(&s->gb)/8; bufsize = get_bits_left(&s->gb); if (s->hq_picture) { int i; for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) { for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) { bytes = s->highquality.prefix_bytes + 1; for (i = 0; i < 3; i++) { if (bytes <= bufsize/8) bytes += buf[bytes] * s->highquality.size_scaler + 1; } if (bytes >= INT_MAX || bytes*8 > bufsize) { av_log(s->avctx, AV_LOG_ERROR, "too many bytes\n"); return AVERROR_INVALIDDATA; } slices[slice_num].bytes = bytes; slices[slice_num].slice_x = slice_x; slices[slice_num].slice_y = slice_y; init_get_bits(&slices[slice_num].gb, buf, bufsize); slice_num++; buf += bytes; if (bufsize/8 >= bytes) bufsize -= bytes*8; else bufsize = 0; } } if (s->num_x*s->num_y != slice_num) { av_log(s->avctx, AV_LOG_ERROR, "too few slices\n"); return AVERROR_INVALIDDATA; } avctx->execute2(avctx, decode_hq_slice_row, slices, NULL, s->num_y); } else { for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) { for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) { bytes = (slice_num+1) * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den - slice_num * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den; slices[slice_num].bytes = bytes; slices[slice_num].slice_x = slice_x; slices[slice_num].slice_y = slice_y; init_get_bits(&slices[slice_num].gb, buf, bufsize); slice_num++; buf += bytes; if (bufsize/8 >= bytes) bufsize -= bytes*8; else bufsize = 0; } } avctx->execute(avctx, decode_lowdelay_slice, slices, NULL, slice_num, sizeof(DiracSlice)); } if (s->dc_prediction) { if (s->pshift) { intra_dc_prediction_10(&s->plane[0].band[0][0]); intra_dc_prediction_10(&s->plane[1].band[0][0]); intra_dc_prediction_10(&s->plane[2].band[0][0]); } else { intra_dc_prediction_8(&s->plane[0].band[0][0]); intra_dc_prediction_8(&s->plane[1].band[0][0]); intra_dc_prediction_8(&s->plane[2].band[0][0]); } } return 0; }
1threat
Get list of images from FIrebase Store : I want to get **list of images** which I uploaded manually in web Firebase console. Is there any way I can get list of all files without using FirebaseRecyclerAdapter?
0debug
Why does my function return a 0 or 1 at the end? : <p>I wrote a program to determine if a student passes for exams. So it calculates the average and compares it with a limit and return it to the main.</p> <p>It works (Which is great) but i keep getting a 0 or a 1 after each output. Im guessing this has to do with the boolean function. But im honestly not sure. At this point it feels like ive dug a rabbithole and see no exit.</p> <p>Any help would be appreciated.</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; #include &lt;sstream&gt; using namespace std; bool heeftToegang(float lab1, float lab2, float lab3, float toets1, float toets2) { const int kleinste = 0; const int hoogste = 10; const int toetsWeging = 3; int grens = 6; int gemiddelde = (lab1 + lab2 + lab3 + toets1 * toetsWeging + toets2 * toetsWeging) / 9; string geen = " geen deelname"; string oke = " =&gt; deelname oke"; cout &lt;&lt; "Lab: " &lt;&lt; lab1 &lt;&lt; " ; " &lt;&lt; lab2 &lt;&lt; " ; " &lt;&lt; lab3 &lt;&lt; " Toets: " &lt;&lt; toets1 &lt;&lt; " ; " &lt;&lt; toets2; // if else statement om de cijfers te checken if (lab1 &gt; 8) { grens -= 0.5; } else if (lab2 &gt; 8) { grens -= 0.5; } else if (lab3 &gt; 8) { grens -= 0.5; } // check if var invalid if (lab1 == kleinste || lab2 == kleinste || lab3 == kleinste || lab1 &gt; hoogste || lab2 &gt; hoogste || lab3 &gt; hoogste) { cout &lt;&lt; geen &lt;&lt; " (Sprake van fraude)"; return false; } // hier wordt er gekeken of het cijfer kleiner is dan 4 else if (toets1 &lt; 4 || toets2 &lt; 4) { cout &lt;&lt; geen; return false; } // check gemiddelde &lt; 6 else if (gemiddelde &lt; grens) { cout &lt;&lt; geen; return false; } else { cout &lt;&lt; oke; return true; } } int main() { cout &lt;&lt; heeftToegang(5, 5, 5, 6, 6) &lt;&lt; endl; cout &lt;&lt; heeftToegang(5, 5, 6, 6, 6) &lt;&lt; endl; cout &lt;&lt; heeftToegang(5, 6, 6, 6, 6) &lt;&lt; endl; cout &lt;&lt; heeftToegang(6, 6, 6, 6, 6) &lt;&lt; endl; cout &lt;&lt; heeftToegang(6, 6, 6, 5, 6) &lt;&lt; endl; cout &lt;&lt; heeftToegang(6, 6, 6, 6, 5) &lt;&lt; endl; cout &lt;&lt; heeftToegang(6, 6, 6, 7, 7) &lt;&lt; endl; cout &lt;&lt; heeftToegang(8, 8, 6, 5, 6) &lt;&lt; endl; cout &lt;&lt; heeftToegang(8, 8, 0, 7, 8) &lt;&lt; endl; cout &lt;&lt; heeftToegang(9, 9, 9, 3.9, 9) &lt;&lt; endl; return 0; } </code></pre>
0debug
VBA CODE to track the changes : I Need a VBA code which can track the changes with OLD sheet & NEW sheet with the values not by Cells,we have a Unique value which will be same in both sheets is in "Z"column.If any new no.will be found, it should Highlight as a new Order No.[This is the sheet screenshot in that Z column contains the Unique no.with which i tried to compare with old sheet,but i failed.][1] [1]: https://i.stack.imgur.com/wdXvA.png Please Help me with this.I will be very thankful for this.....
0debug
void *iommu_dma_memory_map(DMAContext *dma, dma_addr_t addr, dma_addr_t *len, DMADirection dir) { int err; target_phys_addr_t paddr, plen; void *buf; if (dma->map) { return dma->map(dma, addr, len, dir); } plen = *len; err = dma->translate(dma, addr, &paddr, &plen, dir); if (err) { return NULL; } if (plen < *len) { *len = plen; } buf = address_space_map(dma->as, paddr, &plen, dir == DMA_DIRECTION_FROM_DEVICE); *len = plen; return buf; }
1threat
WordPress - How much of your sites content should be generated dynamically? : <p>I've been playing around with theme development in WordPress for a couple months now. I often find myself wondering how much of the sites content should be customizable by the client. Is it ok to have fixed html in your theme or should everything be generated dynamically?</p> <p>If so, which WordPress features would you utilize in achieving a completely customizable web site for a client?</p> <p>Ex: - all buttons registered as widgets? - all headings and subheadings brought in dynamically? etc.</p> <p>Any thoughts on this topic are welcomed. Thank you,</p>
0debug
static av_always_inline void vc1_apply_p_v_loop_filter(VC1Context *v, int block_num) { MpegEncContext *s = &v->s; int mb_cbp = v->cbp[s->mb_x - s->mb_stride], block_cbp = mb_cbp >> (block_num * 4), bottom_cbp, mb_is_intra = v->is_intra[s->mb_x - s->mb_stride], block_is_intra = mb_is_intra >> (block_num * 4), bottom_is_intra; int idx, linesize = block_num > 3 ? s->uvlinesize : s->linesize, ttblk; uint8_t *dst; if (block_num > 3) { dst = s->dest[block_num - 3]; } else { dst = s->dest[0] + (block_num & 1) * 8 + ((block_num & 2) * 4 - 8) * linesize; } if (s->mb_y != s->end_mb_y || block_num < 2) { int16_t (*mv)[2]; int mv_stride; if (block_num > 3) { bottom_cbp = v->cbp[s->mb_x] >> (block_num * 4); bottom_is_intra = v->is_intra[s->mb_x] >> (block_num * 4); mv = &v->luma_mv[s->mb_x - s->mb_stride]; mv_stride = s->mb_stride; } else { bottom_cbp = (block_num < 2) ? (mb_cbp >> ((block_num + 2) * 4)) : (v->cbp[s->mb_x] >> ((block_num - 2) * 4)); bottom_is_intra = (block_num < 2) ? (mb_is_intra >> ((block_num + 2) * 4)) : (v->is_intra[s->mb_x] >> ((block_num - 2) * 4)); mv_stride = s->b8_stride; mv = &s->current_picture.motion_val[0][s->block_index[block_num] - 2 * mv_stride]; } if (bottom_is_intra & 1 || block_is_intra & 1 || mv[0][0] != mv[mv_stride][0] || mv[0][1] != mv[mv_stride][1]) { v->vc1dsp.vc1_v_loop_filter8(dst, linesize, v->pq); } else { idx = ((bottom_cbp >> 2) | block_cbp) & 3; if (idx == 3) { v->vc1dsp.vc1_v_loop_filter8(dst, linesize, v->pq); } else if (idx) { if (idx == 1) v->vc1dsp.vc1_v_loop_filter4(dst + 4, linesize, v->pq); else v->vc1dsp.vc1_v_loop_filter4(dst, linesize, v->pq); } } } dst -= 4 * linesize; ttblk = (v->ttblk[s->mb_x - s->mb_stride] >> (block_num * 4)) & 0xF; if (ttblk == TT_4X4 || ttblk == TT_8X4) { idx = (block_cbp | (block_cbp >> 2)) & 3; if (idx == 3) { v->vc1dsp.vc1_v_loop_filter8(dst, linesize, v->pq); } else if (idx) { if (idx == 1) v->vc1dsp.vc1_v_loop_filter4(dst + 4, linesize, v->pq); else v->vc1dsp.vc1_v_loop_filter4(dst, linesize, v->pq); } } }
1threat
linq query for unique i'd collection based on one another coloumn value : i have collection ( data table contain three columns A,B & C WHICH has different values... i need a unique collection based on distinct column 'A' AND VALUE OF 'C' column AS Priority [Input Collection][1] [Required Collection][2] [1]: https://i.stack.imgur.com/8fNDZ.png [2]: https://i.stack.imgur.com/8r0nO.png
0debug
Can an object belong to two classes? : <p>Just started learning Java, through the "hello world" app, k learned about the object System.out.</p> <p>Out is an object, but to use it, we have to write system in front of it. It's obvious and my book says that out belongs to system class.</p> <p>But later in the book, my book says out also belongs to PrintStream class. That is what enable us to use println methods because they both belong to PrintStream class. </p> <p>I am confused what class does out belong to?</p> <p>Also, is it just a convention that for objects like out, we have to write the class as well whenever we use it. For something like;</p> <blockquote> <p>String greeting = "Hello, World!"; If we want to use .length() method which I guess also belongs to string class, we DONT write: int n=String.greeting.length()</p> </blockquote> <p>Instead, it's just: int n=greeting.();</p>
0debug
Detecting a system window overlaying an iframe : <p>After looking at <a href="https://www.youtube.com/watch?v=TzPq5_kCfow" rel="noreferrer">this youtube video</a> I was curious how some of the features shown, can be implemented with JS.</p> <p>One of my major questions is how can one detect another system window (like the word window, shown in the video) on the iframe.</p> <p>On <a href="https://www.youtube.com/watch?v=RSWhvNdjAAE&amp;feature=youtu.be" rel="noreferrer">another video</a> there is a hint suggesting that the technic is based on the fact that browsers optimize rendering for elements that are out of the view. </p> <p>I couldn't tap into what are the exact methods/properties that are used.</p> <p>What are your thoughts? </p>
0debug
PPC_OP(set_T1) { T1 = PARAM(1); RETURN(); }
1threat
Null reference exception entity framewwork binding to WPF window : <p>I can't seem to figure out what I should/should not be doing with my binding. I have a WPF window that uses two way binding for a nested object. Primary object is Client the client object has Residential and Mailing addresses which are of type Address objects. I can save the client object without issue but when it attempts to save the address objects they are either null or I have to create them by "newing" them up before the save. I assumed with using databinding that the nested object would be populated without having to do anything "special" aka not have to new them up just allow the binding do the work? Am I doing something wrong or am I expecting it to do too much for me?</p> <p>In summary the object looks like this </p> <pre><code>public class Client : People { public int ClientID { get; set; } public int? ResidentialAddressID { get; set; } [ForeignKey("ResidentialAddressID")] public virtual Address ResidentialAddress { get; set; } public int? MailingAddressID { get; set; } [ForeignKey("MailingAddressID")] public virtual Address MailingAddress { get; set; } } [Table("bhs.Addresses")] public class Address { public int AddressID { get; set; } public string Line1 { get; set; } public string Line2 { get; set; } public string City { get; set; } public int? StateID { get; set; } public State State { get; set; } public string ZipCode { get; set; } } </code></pre> <p>Tables looks like this </p> <pre><code>People -&gt; PeopleID FirstName MiddleName LastName DateOfBirth SocialSecurityNumber Gender Client -&gt; ClientID PeopleID ResidentialAddressID MailingAddressID Addresses-&gt; AddressID Line1 Line2 City StateID ZipCode </code></pre> <p>And the binding looks like so.</p> <pre><code> &lt;Label Content="First Name:" Grid.Column="0" Margin="0,1,0,0" Grid.Row="0" Foreground="White" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/&gt; &lt;TextBox Grid.Column="1" Text="{Binding FirstName}" x:Name="txtFirstName" Margin="5,5,5,5" Grid.Row="0" TextWrapping="Wrap" /&gt; &lt;Label Content="Middle Name:" Grid.Column="0" Margin="0,1,0,0" Grid.Row="1" Foreground="White" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/&gt; &lt;TextBox Grid.Column="1" x:Name="txtMiddleName" Margin="5,5,5,5" Grid.Row="1" TextWrapping="Wrap" Text="{Binding MiddleName}" /&gt; &lt;Label Content="Last Name:" Grid.Column="0" Grid.Row="2" Foreground="White" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/&gt; &lt;TextBox Grid.Column="1" x:Name="txtLastName" Margin="5,5,5,5" Grid.Row="2" TextWrapping="Wrap" Text="{Binding LastName}" /&gt; &lt;Label Content="Date Of Birth:" Grid.Column="0" Grid.Row="3" Foreground="White" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/&gt; &lt;DatePicker Grid.Column="1" x:Name="datDateOfBirth" Margin="5,5,5,5" Grid.Row="3" SelectedDate="{Binding DateOfBirth}"/&gt; &lt;Label Content="Social Security Number:" Grid.Column="0" Grid.Row="4" Foreground="White" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/&gt; &lt;xctk:MaskedTextBox x:Name="txtSocialSecurityNumber" Text="{Binding SocialSecurityNumber}" Margin="5,5,5,5" Grid.Column="1" Grid.Row="4" TextWrapping="Wrap" ClipboardMaskFormat="ExcludePromptAndLiterals" IncludeLiteralsInValue="False" Mask="000-00-0000"/&gt; &lt;Label Content="Gender:" Grid.Column="0" Grid.Row="5" Foreground="White" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/&gt; &lt;ComboBox Grid.Column="1" x:Name="cboGender" Grid.Row="5" Margin="5,5,5,5" SelectedValue="{Binding Gender}" /&gt; &lt;Label Content="Residential Address:" Grid.Column="2" Margin="0,1,0,0" Grid.Row="2" Foreground="White" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/&gt; &lt;TextBox Grid.Column="3" Text="{Binding ResidentialAddress.Line1}" Margin="5,5,5,5" Grid.Row="0" TextWrapping="Wrap"/&gt; &lt;TextBox Grid.Column="3" Text="{Binding ResidentialAddress.Line2}" Margin="5,5,5,5" Grid.Row="1" TextWrapping="Wrap" /&gt; &lt;TextBox Grid.Column="3" Text="{Binding ResidentialAddress.City}" Margin="5,5,5,5" Grid.Row="2" TextWrapping="Wrap" /&gt; &lt;ComboBox Grid.Column="3" SelectedValue="{Binding ResidentialAddress.State}" Margin="5,5,5,5" Grid.Row="3"/&gt; &lt;TextBox Grid.Column="3" Text="{Binding ResidentialAddress.Zip}" Margin="5,5,5,5" Grid.Row="4" TextWrapping="Wrap" /&gt; </code></pre> <p>Any help is extremely appreciated.</p>
0debug
static void reclaim_ramblock(RAMBlock *block) { if (block->flags & RAM_PREALLOC) { ; } else if (xen_enabled()) { xen_invalidate_map_cache_entry(block->host); #ifndef _WIN32 } else if (block->fd >= 0) { munmap(block->host, block->max_length); close(block->fd); #endif } else { qemu_anon_ram_free(block->host, block->max_length); } g_free(block); }
1threat
def sum_positivenum(nums): sum_positivenum = list(filter(lambda nums:nums>0,nums)) return sum(sum_positivenum)
0debug
I have the exact same file directory but jupyter notebook is saying there is no such file or directory found : Here is the error: FileNotFoundError: [Errno 2] No such file or directory: 'Macintosh HD/Users/kishanpatel/Documents/Machine Learning Data/train.zip'
0debug
Laravel 5.4 validation rules - optional, but validated if present; : <p>I'm trying to create a user update validation through form, where I pass, for example 'password'=>NULL, or 'password'=>'newone';</p> <p>I'm trying to make it validate ONLY if it's passed as not null, and nothing, not even 'sometimes' works :/</p> <p>I'm trying to validate as :</p> <pre><code>Validator::make(array('test'=&gt;NULL), array('test'=&gt; 'sometimes|required|min:6'))-&gt;validate(); </code></pre> <p>But it fails to validate... :/ ANy help would be appreciated.</p>
0debug
void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict) { struct in_addr host_addr = { .s_addr = INADDR_ANY }; int host_port; char buf[256] = ""; const char *src_str, *p; SlirpState *s; int is_udp = 0; int err; const char *arg1 = qdict_get_str(qdict, "arg1"); const char *arg2 = qdict_get_try_str(qdict, "arg2"); const char *arg3 = qdict_get_try_str(qdict, "arg3"); if (arg2) { s = slirp_lookup(mon, arg1, arg2); src_str = arg3; } else { s = slirp_lookup(mon, NULL, NULL); src_str = arg1; } if (!s) { return; } if (!src_str || !src_str[0]) goto fail_syntax; p = src_str; get_str_sep(buf, sizeof(buf), &p, ':'); if (!strcmp(buf, "tcp") || buf[0] == '\0') { is_udp = 0; } else if (!strcmp(buf, "udp")) { is_udp = 1; } else { goto fail_syntax; } if (get_str_sep(buf, sizeof(buf), &p, ':') < 0) { goto fail_syntax; } if (buf[0] != '\0' && !inet_aton(buf, &host_addr)) { goto fail_syntax; } host_port = atoi(p); err = slirp_remove_hostfwd(TAILQ_FIRST(&slirp_stacks)->slirp, is_udp, host_addr, host_port); monitor_printf(mon, "host forwarding rule for %s %s\n", src_str, err ? "removed" : "not found"); return; fail_syntax: monitor_printf(mon, "invalid format\n"); }
1threat
extracting string and add value to it : I have string like 1001.2001.3001.5001.6001 or 1001-2001-3001-5001-6001. In this how to extract 4th string i.e., 5001, add value like 121 to it and put it back in the same string. The output should be like 1001.2001.3001.5122.6001 or 1001-2001-3001-5122-6001. I have to achieve this in linux bash scripting thanks
0debug
static void inline xan_wc3_copy_pixel_run(XanContext *s, int x, int y, int pixel_count, int motion_x, int motion_y) { int stride; int line_inc; int curframe_index, prevframe_index; int curframe_x, prevframe_x; int width = s->avctx->width; unsigned char *palette_plane, *prev_palette_plane; unsigned char *y_plane, *u_plane, *v_plane; unsigned char *prev_y_plane, *prev_u_plane, *prev_v_plane; unsigned char *rgb_plane, *prev_rgb_plane; unsigned short *rgb16_plane, *prev_rgb16_plane; unsigned int *rgb32_plane, *prev_rgb32_plane; switch (s->avctx->pix_fmt) { case PIX_FMT_PAL8: palette_plane = s->current_frame.data[0]; prev_palette_plane = s->last_frame.data[0]; stride = s->current_frame.linesize[0]; line_inc = stride - width; curframe_index = y * stride + x; curframe_x = x; prevframe_index = (y + motion_y) * stride + x + motion_x; prevframe_x = x + motion_x; while(pixel_count--) { palette_plane[curframe_index++] = prev_palette_plane[prevframe_index++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_RGB555: case PIX_FMT_RGB565: rgb16_plane = (unsigned short *)s->current_frame.data[0]; prev_rgb16_plane = (unsigned short *)s->last_frame.data[0]; stride = s->current_frame.linesize[0] / 2; line_inc = stride - width; curframe_index = y * stride + x; curframe_x = x; prevframe_index = (y + motion_y) * stride + x + motion_x; prevframe_x = x + motion_x; while(pixel_count--) { rgb16_plane[curframe_index++] = prev_rgb16_plane[prevframe_index++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_RGB24: case PIX_FMT_BGR24: rgb_plane = s->current_frame.data[0]; prev_rgb_plane = s->last_frame.data[0]; stride = s->current_frame.linesize[0]; line_inc = stride - width * 3; curframe_index = y * stride + x * 3; curframe_x = x; prevframe_index = (y + motion_y) * stride + (3 * (x + motion_x)); prevframe_x = x + motion_x; while(pixel_count--) { rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++]; rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++]; rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_RGBA32: rgb32_plane = (unsigned int *)s->current_frame.data[0]; prev_rgb32_plane = (unsigned int *)s->last_frame.data[0]; stride = s->current_frame.linesize[0] / 4; line_inc = stride - width; curframe_index = y * stride + x; curframe_x = x; prevframe_index = (y + motion_y) * stride + x + motion_x; prevframe_x = x + motion_x; while(pixel_count--) { rgb32_plane[curframe_index++] = prev_rgb32_plane[prevframe_index++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_YUV444P: y_plane = s->current_frame.data[0]; u_plane = s->current_frame.data[1]; v_plane = s->current_frame.data[2]; prev_y_plane = s->last_frame.data[0]; prev_u_plane = s->last_frame.data[1]; prev_v_plane = s->last_frame.data[2]; stride = s->current_frame.linesize[0]; line_inc = stride - width; curframe_index = y * stride + x; curframe_x = x; prevframe_index = (y + motion_y) * stride + x + motion_x; prevframe_x = x + motion_x; while(pixel_count--) { y_plane[curframe_index] = prev_y_plane[prevframe_index]; u_plane[curframe_index] = prev_u_plane[prevframe_index]; v_plane[curframe_index] = prev_v_plane[prevframe_index]; curframe_index++; ADVANCE_CURFRAME_X(); prevframe_index++; ADVANCE_PREVFRAME_X(); } break; default: av_log(s->avctx, AV_LOG_ERROR, " Xan WC3: Unhandled colorspace\n"); break; } }
1threat
How to query list of objects with array as an argument in GraphQL : <p>I'm trying to query a list of objects having array of IDs. Something similar to following SQL query:</p> <pre><code>SELECT name FROM events WHERE id IN(1,2,3,...); </code></pre> <p>How do I achieve this in GraphQL?</p>
0debug
static void gen_sllq(DisasContext *ctx) { int l1 = gen_new_label(); int l2 = gen_new_label(); TCGv t0 = tcg_temp_local_new(); TCGv t1 = tcg_temp_local_new(); TCGv t2 = tcg_temp_local_new(); tcg_gen_andi_tl(t2, cpu_gpr[rB(ctx->opcode)], 0x1F); tcg_gen_movi_tl(t1, 0xFFFFFFFF); tcg_gen_shl_tl(t1, t1, t2); tcg_gen_andi_tl(t0, cpu_gpr[rB(ctx->opcode)], 0x20); tcg_gen_brcondi_tl(TCG_COND_EQ, t0, 0, l1); gen_load_spr(t0, SPR_MQ); tcg_gen_and_tl(cpu_gpr[rA(ctx->opcode)], t0, t1); tcg_gen_br(l2); gen_set_label(l1); tcg_gen_shl_tl(t0, cpu_gpr[rS(ctx->opcode)], t2); gen_load_spr(t2, SPR_MQ); tcg_gen_andc_tl(t1, t2, t1); tcg_gen_or_tl(cpu_gpr[rA(ctx->opcode)], t0, t1); gen_set_label(l2); tcg_temp_free(t0); tcg_temp_free(t1); tcg_temp_free(t2); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx, cpu_gpr[rA(ctx->opcode)]); }
1threat
static int init(AVFilterContext *ctx) { EvalContext *eval = ctx->priv; char *args1 = av_strdup(eval->exprs); char *expr, *buf; int ret, i; if (!args1) { av_log(ctx, AV_LOG_ERROR, "Channels expressions list is empty\n"); ret = eval->exprs ? AVERROR(ENOMEM) : AVERROR(EINVAL); goto end; } buf = args1; i = 0; while (i < FF_ARRAY_ELEMS(eval->expr) && (expr = av_strtok(buf, "|", &buf))) { ret = av_expr_parse(&eval->expr[i], expr, var_names, NULL, NULL, NULL, NULL, 0, ctx); if (ret < 0) goto end; i++; } eval->nb_channels = i; if (eval->chlayout_str) { int n; ret = ff_parse_channel_layout(&eval->chlayout, eval->chlayout_str, ctx); if (ret < 0) goto end; n = av_get_channel_layout_nb_channels(eval->chlayout); if (n != eval->nb_channels) { av_log(ctx, AV_LOG_ERROR, "Mismatch between the specified number of channels '%d' " "and the number of channels '%d' in the specified channel layout '%s'\n", eval->nb_channels, n, eval->chlayout_str); ret = AVERROR(EINVAL); goto end; } } else { eval->chlayout = av_get_default_channel_layout(eval->nb_channels); if (!eval->chlayout) { av_log(ctx, AV_LOG_ERROR, "Invalid number of channels '%d' provided\n", eval->nb_channels); ret = AVERROR(EINVAL); goto end; } } if ((ret = ff_parse_sample_rate(&eval->sample_rate, eval->sample_rate_str, ctx))) goto end; eval->n = 0; end: av_free(args1); return ret; }
1threat
void ff_cavs_init_top_lines(AVSContext *h) { h->top_qp = av_malloc( h->mb_width); h->top_mv[0] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); h->top_mv[1] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector)); h->top_pred_Y = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y)); h->top_border_y = av_malloc((h->mb_width+1)*16); h->top_border_u = av_malloc( h->mb_width * 10); h->top_border_v = av_malloc( h->mb_width * 10); h->col_mv = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); h->col_type_base = av_malloc(h->mb_width*h->mb_height); h->block = av_mallocz(64*sizeof(DCTELEM)); }
1threat
I need to split code in C for gausse elimination method : Hello I have to split code below on 4 four files (i'm working in visual studio). I really don't know how to do it, so I'm asking You guys for help. Thanks in advance. Header.H (which I have) main.c data.c solve.c #include<stdio.h> #include<conio.h> void main(void) { int i,j,k,n; float A[20][20],c,x[10],sum=0.0; printf("\nEnter the order of matrix: "); scanf("%d",&n); printf("\nEnter the elements of augmented matrix row-wise:\n\n"); for(i=1; i<=n; i++) { for(j=1; j<=(n+1); j++) { printf("A[%d][%d] : ", i,j); scanf("%f",&A[i][j]); } } for(j=1; j<=n; j++) { for(i=1; i<=n; i++) { if(i>j) { c=A[i][j]/A[j][j]; for(k=1; k<=n+1; k++) { A[i][k]=A[i][k]-c*A[j][k]; } } } } x[n]=A[n][n+1]/A[n][n]; for(i=n-1; i>=1; i--) { sum=0; for(j=i+1; j<=n; j++) { sum=sum+A[i][j]*x[j]; } x[i]=(A[i][n+1]-sum)/A[i][i]; } printf("\nThe solution is: \n"); for(i=1; i<=n; i++) { printf("\nx%d=%f\t",i,x[i]); } getch_(); }
0debug
static void show_format(WriterContext *w, AVFormatContext *fmt_ctx) { char val_str[128]; int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1; print_section_header("format"); print_str("filename", fmt_ctx->filename); print_int("nb_streams", fmt_ctx->nb_streams); print_str("format_name", fmt_ctx->iformat->name); print_str("format_long_name", fmt_ctx->iformat->long_name); print_time("start_time", fmt_ctx->start_time, &AV_TIME_BASE_Q); print_time("duration", fmt_ctx->duration, &AV_TIME_BASE_Q); if (size >= 0) print_val ("size", size, unit_byte_str); else print_str_opt("size", "N/A"); if (fmt_ctx->bit_rate > 0) print_val ("bit_rate", fmt_ctx->bit_rate, unit_bit_per_second_str); else print_str_opt("bit_rate", "N/A"); show_tags(fmt_ctx->metadata); print_section_footer("format"); fflush(stdout); }
1threat
scala infinite loop when replacing concret value by parameter name : I have a problem when trying to replace a concret value by the varibla name winthin an object. the easiest way to explain my problem is that this code works: val a = x.map{f => var c : Array[Int] = Array() if(f._2.size >= 5){ c = f._2 } (f._1, c) } But not this one: val Eps = 5 val a = x.map{f => var c : Array[Int] = Array() if(f._2.size >= Eps){ c = f._2 } (f._1, c) } What I obtain in the second cas is an infinte loop. PS: the code is within a sacal object that is called from the main object.
0debug
Selenium error: 'chromedriver' executable needs to be in PATH : <p>I have Chromium on my computer that runs Debian 9. Here's <code>scraper.py</code>:</p> <pre><code>from selenium import webdriver import time options = webdriver.ChromeOptions() options.add_argument("--ignore-certificate-errors") options.add_argument("--test-type") options.binary_location = "/usr/bin/chromium" driver = webdriver.Chrome(chrome_options=options) driver.get("https://python.org") </code></pre> <p>The Chromium binary is at the specified location. When I run python <code>scraper.py</code>, I get this error.</p> <pre><code>Traceback (most recent call last): File "scraper.py", line 9, in &lt;module&gt; driver = webdriver.Chrome(chrome_options=options) File "/home/me/ENV/pbc_vss/local/lib/python2.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__ self.service.start() File "/home/me/ENV/pbc_vss/local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home </code></pre>
0debug
return null when get value from XML in SQL : <h1>return null , when use variable for get value in XML</h1> <pre><code> DECLARE @source nvarchar(2000); set @source = 'MinExpected' select MinimumExpectedProperties.value('(DepnaRoot[.= sql:variable("@source")]/Type)[1]','int') from tbl_AppWFTiming </code></pre>
0debug
Check all varibales if one of them contains number : I need to check all variables if one of them contains number 6 def func(a, b, c, d, e, f): If True print Yes If False print No
0debug
static void dirac_unpack_block_motion_data(DiracContext *s) { GetBitContext *gb = &s->gb; uint8_t *sbsplit = s->sbsplit; int i, x, y, q, p; DiracArith arith[8]; align_get_bits(gb); s->sbwidth = DIVRNDUP(s->source.width, 4*s->plane[0].xbsep); s->sbheight = DIVRNDUP(s->source.height, 4*s->plane[0].ybsep); s->blwidth = 4 * s->sbwidth; s->blheight = 4 * s->sbheight; ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb)); for (y = 0; y < s->sbheight; y++) { for (x = 0; x < s->sbwidth; x++) { int split = dirac_get_arith_uint(arith, CTX_SB_F1, CTX_SB_DATA); sbsplit[x] = (split + pred_sbsplit(sbsplit+x, s->sbwidth, x, y)) % 3; } sbsplit += s->sbwidth; } ff_dirac_init_arith_decoder(arith, gb, svq3_get_ue_golomb(gb)); for (i = 0; i < s->num_refs; i++) { ff_dirac_init_arith_decoder(arith + 4 + 2 * i, gb, svq3_get_ue_golomb(gb)); ff_dirac_init_arith_decoder(arith + 5 + 2 * i, gb, svq3_get_ue_golomb(gb)); } for (i = 0; i < 3; i++) ff_dirac_init_arith_decoder(arith+1+i, gb, svq3_get_ue_golomb(gb)); for (y = 0; y < s->sbheight; y++) for (x = 0; x < s->sbwidth; x++) { int blkcnt = 1 << s->sbsplit[y * s->sbwidth + x]; int step = 4 >> s->sbsplit[y * s->sbwidth + x]; for (q = 0; q < blkcnt; q++) for (p = 0; p < blkcnt; p++) { int bx = 4 * x + p*step; int by = 4 * y + q*step; DiracBlock *block = &s->blmotion[by*s->blwidth + bx]; decode_block_params(s, arith, block, s->blwidth, bx, by); propagate_block_data(block, s->blwidth, step); } } }
1threat
static void gen_ld (CPUState *env, DisasContext *ctx, uint32_t opc, int rt, int base, int16_t offset) { const char *opn = "ld"; TCGv t0, t1; if (rt == 0 && env->insn_flags & (INSN_LOONGSON2E | INSN_LOONGSON2F)) { MIPS_DEBUG("NOP"); return; } t0 = tcg_temp_new(); t1 = tcg_temp_new(); gen_base_offset_addr(ctx, t0, base, offset); switch (opc) { #if defined(TARGET_MIPS64) case OPC_LWU: save_cpu_state(ctx, 0); op_ld_lwu(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lwu"; break; case OPC_LD: save_cpu_state(ctx, 0); op_ld_ld(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "ld"; break; case OPC_LLD: save_cpu_state(ctx, 0); op_ld_lld(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lld"; break; case OPC_LDL: save_cpu_state(ctx, 1); gen_load_gpr(t1, rt); gen_helper_3i(ldl, t1, t1, t0, ctx->mem_idx); gen_store_gpr(t1, rt); opn = "ldl"; break; case OPC_LDR: save_cpu_state(ctx, 1); gen_load_gpr(t1, rt); gen_helper_3i(ldr, t1, t1, t0, ctx->mem_idx); gen_store_gpr(t1, rt); opn = "ldr"; break; case OPC_LDPC: save_cpu_state(ctx, 1); tcg_gen_movi_tl(t1, pc_relative_pc(ctx)); gen_op_addr_add(ctx, t0, t0, t1); op_ld_ld(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "ldpc"; break; #endif case OPC_LWPC: save_cpu_state(ctx, 1); tcg_gen_movi_tl(t1, pc_relative_pc(ctx)); gen_op_addr_add(ctx, t0, t0, t1); op_ld_lw(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lwpc"; break; case OPC_LW: save_cpu_state(ctx, 0); op_ld_lw(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lw"; break; case OPC_LH: save_cpu_state(ctx, 0); op_ld_lh(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lh"; break; case OPC_LHU: save_cpu_state(ctx, 0); op_ld_lhu(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lhu"; break; case OPC_LB: save_cpu_state(ctx, 0); op_ld_lb(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lb"; break; case OPC_LBU: save_cpu_state(ctx, 0); op_ld_lbu(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "lbu"; break; case OPC_LWL: save_cpu_state(ctx, 1); gen_load_gpr(t1, rt); gen_helper_3i(lwl, t1, t1, t0, ctx->mem_idx); gen_store_gpr(t1, rt); opn = "lwl"; break; case OPC_LWR: save_cpu_state(ctx, 1); gen_load_gpr(t1, rt); gen_helper_3i(lwr, t1, t1, t0, ctx->mem_idx); gen_store_gpr(t1, rt); opn = "lwr"; break; case OPC_LL: save_cpu_state(ctx, 1); op_ld_ll(t0, t0, ctx); gen_store_gpr(t0, rt); opn = "ll"; break; } (void)opn; MIPS_DEBUG("%s %s, %d(%s)", opn, regnames[rt], offset, regnames[base]); tcg_temp_free(t0); tcg_temp_free(t1); }
1threat
Angular reactive forms set and clear validators : <p>Please assist, i want to remove all validators in form, Please advise if its possible or not and if not whats the better way to remove validators if you have a form Group of 20 or more form controls, see example below.</p> <pre><code> ngOnInit() { this.exampleFormGroup = this.formBuilder.group({ surname: ['', [Validators.required, Validators.pattern('^[\\w\\s/-/(/)]{3,50}$')]], initials: ['', [Validators.required, Validators.maxLength(4)]] }); } public removeValidators() { this.exampleFormGroup.get('surname').clearValidators(); this.exampleFormGroup.get('initials').clearValidators(); this.exampleFormGroup.updateValueAndValidity(); } public addValidators() { this.exampleFormGroup .get('surname').setValidators([Validators.required,Validators.pattern('^[\\w\\s/-/(/)]{3,50}$')]); this.exampleFormGroup.get('initials').setValidators([Validators.required, Validators.maxLength(4)]); this.exampleFormGroup.updateValueAndValidity(); } </code></pre> <p>The above method <code>addValidators()</code> will add validators and <code>removeValidators()</code> will remove validators when executed. but the problem i have is, i have to specify the form control im trying to clear validators. is there a way to just do <code>this.exampleFormGroup.clearValidators();</code> and clear all in the form and again <code>this.exampleFormGroup.setValidators()</code> to set them back. i know i may be asking for a unicorn but in a scenario where the formGroup has 20 or more controls clearing and setting validators can be painful so a map on how to handle such scenarios will be much appreciated. </p>
0debug
def is_Product_Even(arr,n): for i in range(0,n): if ((arr[i] & 1) == 0): return True return False
0debug
plotly in R: Listing legend items horizontally and centered below a plot : <p>I have been tweaking legends in plotly and R. One thing I am unable to figure out is how (if it is possible) to reposition legend items so that they are listed horizontally and centered below the plot. The default legend items are positioned vertically and located to the right of the plot, as shown here:</p> <pre><code>plot_ly(data = iris, x = Sepal.Length, y = Petal.Length, mode = "markers", color = Species) </code></pre> <p>I am able to get the legend below and centered to the plot by the following:</p> <pre><code>plot_ly(data = iris, x = Sepal.Length, y = Petal.Length, mode = "markers", color = Species) %&gt;% layout(legend = list(x = 0.35, y = -0.5)) </code></pre> <p>However, I notice that this legend position changes based on how I view the plot (the dimensions I make the plot window, etc). Because of this, the legend will sometimes accidentally overlap the plot (by being positioned too high up) or be separated from the plot by an awkwardly-large distance (by being positioned too low). Here is an example image of the legend being positioned too low:</p> <p><a href="https://i.stack.imgur.com/KgQ97.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KgQ97.png" alt="Legend moves depending on plot window dimensions"></a></p> <p>Moreover, when placing the legend below the plot, it may look better to have legend items listed horizontally (instead of vertically). In this example, it would be great to have virginica, versicolor, and setosa listed left to right in the legend (instead of top to bottom). Hence, ideally looking like this:</p> <p><a href="https://i.stack.imgur.com/WBNZy.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WBNZy.png" alt="Ideal"></a></p> <p>Is it possible to obtain this - that is, a legend positioned centered and below the plot (that does not change location with window size) while listing its items horizontally?</p>
0debug
MySQL Error Nr. 1064 : MySQL Error Number. 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near... after the research then tried this method ; changed TYPE=InnoDB to ENGINE=InnoDB then using query to create, the error still exist. [1]: http://i.stack.imgur.com/rQQjy.png
0debug
static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0, const uint16_t *ubuf0, const uint16_t *ubuf1, const uint16_t *vbuf0, const uint16_t *vbuf1, const uint16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, enum PixelFormat dstFormat, int flags, int y) { x86_reg uv_off = c->uv_off << 1; const uint16_t *buf1= buf0; if (uvalpha < 2048) { __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1(%%REGBP, %5, %6) "pxor %%mm7, %%mm7 \n\t" WRITEBGR24(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest), "a" (&c->redDither), "m"(uv_off) ); } else { __asm__ volatile( "mov %%"REG_b", "ESP_OFFSET"(%5) \n\t" "mov %4, %%"REG_b" \n\t" "push %%"REG_BP" \n\t" YSCALEYUV2RGB1b(%%REGBP, %5, %6) "pxor %%mm7, %%mm7 \n\t" WRITEBGR24(%%REGb, 8280(%5), %%REGBP) "pop %%"REG_BP" \n\t" "mov "ESP_OFFSET"(%5), %%"REG_b" \n\t" :: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest), "a" (&c->redDither), "m"(uv_off) ); } }
1threat
Automatically generate .factorypath on project import when using maven project in eclipse : <p>The <code>.factorypath</code> file is a generated file, which eclipse requires for annotation-processing. The m2eclipse plugin does generate this file when using "Update Maven Project" (Alt+F5) and checking "Update project configuration from pom.xml".</p> <p>However, I don't want to check this file into version control. But if not, and someone from the team does a fresh checkout, and imports the project in eclipse, the <code>.factorypath</code> does not get generated until the "Update Maven Project" is performed manually. I don't want this manual step when a project gets imported, this has to happen automatically. Is there an option, that a project has to be updated upon import?</p>
0debug
static int opt_map(OptionsContext *o, const char *opt, const char *arg) { StreamMap *m = NULL; int i, negative = 0, file_idx; int sync_file_idx = -1, sync_stream_idx; char *p, *sync; char *map; if (*arg == '-') { negative = 1; arg++; } map = av_strdup(arg); if (sync = strchr(map, ',')) { *sync = 0; sync_file_idx = strtol(sync + 1, &sync, 0); if (sync_file_idx >= nb_input_files || sync_file_idx < 0) { av_log(NULL, AV_LOG_FATAL, "Invalid sync file index: %d.\n", sync_file_idx); exit_program(1); } if (*sync) sync++; for (i = 0; i < input_files[sync_file_idx].nb_streams; i++) if (check_stream_specifier(input_files[sync_file_idx].ctx, input_files[sync_file_idx].ctx->streams[i], sync) == 1) { sync_stream_idx = i; break; } if (i == input_files[sync_file_idx].nb_streams) { av_log(NULL, AV_LOG_FATAL, "Sync stream specification in map %s does not " "match any streams.\n", arg); exit_program(1); } } file_idx = strtol(map, &p, 0); if (file_idx >= nb_input_files || file_idx < 0) { av_log(NULL, AV_LOG_FATAL, "Invalid input file index: %d.\n", file_idx); exit_program(1); } if (negative) for (i = 0; i < o->nb_stream_maps; i++) { m = &o->stream_maps[i]; if (check_stream_specifier(input_files[m->file_index].ctx, input_files[m->file_index].ctx->streams[m->stream_index], *p == ':' ? p + 1 : p) > 0) m->disabled = 1; } else for (i = 0; i < input_files[file_idx].nb_streams; i++) { if (check_stream_specifier(input_files[file_idx].ctx, input_files[file_idx].ctx->streams[i], *p == ':' ? p + 1 : p) <= 0) continue; o->stream_maps = grow_array(o->stream_maps, sizeof(*o->stream_maps), &o->nb_stream_maps, o->nb_stream_maps + 1); m = &o->stream_maps[o->nb_stream_maps - 1]; m->file_index = file_idx; m->stream_index = i; if (sync_file_idx >= 0) { m->sync_file_index = sync_file_idx; m->sync_stream_index = sync_stream_idx; } else { m->sync_file_index = file_idx; m->sync_stream_index = i; } } if (!m) { av_log(NULL, AV_LOG_FATAL, "Stream map '%s' matches no streams.\n", arg); exit_program(1); } av_freep(&map); return 0; }
1threat
Read parameters from file both to C and Python scripts : <p>I am new to C programming, and I am trying to have one parameters file that will be accessed by Python script and C script, so I would have to define the parameters in both scripts every run. For example, in C I have:</p> <pre><code>doublereal N,DB,DW,PP; N = 15; DB = 1.2; DW = 150; PP = 90; </code></pre> <p>In Python I save the parameters in a dictionary</p> <pre><code>pars = {'N':15.0,'DB':1.2,'DW':150.0,'PP':90.0} </code></pre> <p>What is the best way to structure a file from which I will read those values both into Python and C scripts?</p>
0debug
void qtest_add_func(const char *str, void (*fn)) { gchar *path = g_strdup_printf("/%s/%s", qtest_get_arch(), str); g_test_add_func(path, fn); }
1threat
getting a number using regular expressions : <p>I have the following string:</p> <p>PR-1333|testtt</p> <p>I want to get the number 1333 using regular expressions in javascript. How can I do that? </p>
0debug
static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, int flags) { MOVStreamContext *sc = st->priv_data; int sample, time_sample; int i; sample = av_index_search_timestamp(st, timestamp, flags); av_log(s, AV_LOG_TRACE, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample); if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp) sample = 0; if (sample < 0) return AVERROR_INVALIDDATA; sc->current_sample = sample; av_log(s, AV_LOG_TRACE, "stream %d, found sample %d\n", st->index, sc->current_sample); if (sc->ctts_data) { time_sample = 0; for (i = 0; i < sc->ctts_count; i++) { int next = time_sample + sc->ctts_data[i].count; if (next > sc->current_sample) { sc->ctts_index = i; sc->ctts_sample = sc->current_sample - time_sample; break; } time_sample = next; } } time_sample = 0; for (i = 0; i < sc->stsc_count; i++) { int next = time_sample + mov_get_stsc_samples(sc, i); if (next > sc->current_sample) { sc->stsc_index = i; sc->stsc_sample = sc->current_sample - time_sample; break; } time_sample = next; } return sample; }
1threat
static uint32_t set_isolation_state(sPAPRDRConnector *drc, sPAPRDRIsolationState state) { trace_spapr_drc_set_isolation_state(spapr_drc_index(drc), state); if (state == SPAPR_DR_ISOLATION_STATE_ISOLATED) { g_free(drc->ccs); drc->ccs = NULL; } if (state == SPAPR_DR_ISOLATION_STATE_UNISOLATED) { if (!drc->dev || drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_UNUSABLE) { return RTAS_OUT_NO_SUCH_INDICATOR; } } if (spapr_drc_type(drc) == SPAPR_DR_CONNECTOR_TYPE_LMB) { if ((state == SPAPR_DR_ISOLATION_STATE_ISOLATED) && !drc->awaiting_release) { return RTAS_OUT_HW_ERROR; } } drc->isolation_state = state; if (drc->isolation_state == SPAPR_DR_ISOLATION_STATE_ISOLATED) { if (drc->awaiting_release) { uint32_t drc_index = spapr_drc_index(drc); if (drc->configured) { trace_spapr_drc_set_isolation_state_finalizing(drc_index); spapr_drc_detach(drc, DEVICE(drc->dev), NULL); } else { trace_spapr_drc_set_isolation_state_deferring(drc_index); } } drc->configured = false; } return RTAS_OUT_SUCCESS; }
1threat
void tcg_gen_ld8s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset) { tcg_gen_ld8s_i32(TCGV_LOW(ret), arg2, offset); tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_HIGH(ret), 31); }
1threat
Choosing DB pool_size for a Flask-SQLAlchemy app running on Gunicorn : <p>I have a Flask-SQLAlchmey app running in Gunicorn connected to a PostgreSQL database, and I'm having trouble finding out what the <code>pool_size</code> value should be and how many database connections I should expect.</p> <p>This is my understanding of how things work:</p> <ul> <li>Processes in Python 3.7 DON'T share memory</li> <li>Each Gunicorn worker is it's own process</li> <li>Therefore, each Gunicorn worker will get it's own copy of the database connection pool and it won't be shared with any other worker</li> <li>Threads in Python DO share memory</li> <li>Therefore, any threads within a Gunicorn worker WILL share a database connection pool</li> </ul> <p>Is that correct so far? If that is correct, then for a synchronous Flask app running in Gunicorn: </p> <ul> <li>Is the maximum number of database connections = (number of workers) * (number of threads per worker)?</li> <li>And within a worker, will it ever use more connections from a pool than there are workers?</li> </ul> <p>Is there a reason why <code>pool_size</code> should be larger than the number of threads? So, for a gunicorn app launched with <code>gunicorn --workers=5 --threads=2 main:app</code> should <code>pool_size</code> be 2? And if I am only using workers, and not using threads, is there any reason to have a <code>pool_size</code> greater than 1?</p>
0debug
replace an array with an additional element : I have an array with `id` and `des` elements. i want to add extra element like `value:0` in that array. So i have tried it with a loop and done it. let data = [ { "id": 1001, "des": "aaa" }, { "id": 1002, "des": "aaa" } ]; for (let i = 0; i < data.length; i++) { let tempObj = { "id": data[i].id, "des": data[i].des, "value": 0 } data[i] = tempObj; } Is it possible can do without loop? In javascript any custom functions are available?
0debug
I have a device specific issue in my android app. image icon onclick a new fragment should get loaded but instead it navigates to Dashboard . : @Override public void onClick(View v) { switch (v.getId()) { case R.id.add_deal: Intent addDealIntent = new Intent(mContext, BaseFragmentActivity.class); addDealIntent.putExtra("Merchant", merchantInfo); addDealIntent.putExtra("FragmentClassName", AddDealFragment.class.getName()); addDealIntent.putExtra("toolbarTitle", "Add Deal"); mContext.startActivity(addDealIntent); break; case R.id.add_product: Intent addProductIntent = new Intent(mContext, BaseFragmentActivity.class); addProductIntent.putExtra("Merchant", merchantInfo); addProductIntent.putExtra("Categories", mMerchantCategories); addProductIntent.putExtra("SubCategories", mMerchantSubCategories); addProductIntent.putExtra("SubSubCategories", mMerchantSubSubCategories); addProductIntent.putExtra("SuperSubCategories", mMerchantSuperSubCategories); addProductIntent.putExtra("FragmentClassName", AddProductFragment.class.getName()); addProductIntent.putExtra("toolbarTitle", "Add Product"); mContext.startActivity(addProductIntent); break; case R.id.dialog_button_cancel: dismiss(); break; default: break; } dismiss(); }
0debug
how to know CSS-class of current node, JS : I wanted to do little menu for navigation in nodes.I have a model of site where i training in js. And my problem, how to display class of node in results block. I looked that i can display only a node name or a node type, but it's very uncomfortable and i just think if classes is all named that it's will be more convenient way for display.Please give a recommendation for my code.In the end, I want to add that I am only learning English, and because of this, there may be some errors. Thank you.[It's my HTML code][1] and [my Js code][2](some functions not yet done). [1]: https://i.stack.imgur.com/5g4ye.png [2]: https://i.stack.imgur.com/r5p00.png
0debug
setTimeout doesn't work when closure is included : <p>So I have this piece of code...</p> <pre><code> var string = 'qwe'; document.addEventListener('click', function(e){ function bar(b){ var a = string[b]; if (a == 'q') { console.log('first'); } if (a == 'w') { console.log('second'); } if (a == 'e') { console.log('third'); } } setTimeout( bar(0), 1000 ); }); </code></pre> <p>Problem is setTimeout doesn't work. Code executes right after clicking.</p> <p>It's weird because if I avoid using the closure, it works...</p> <pre><code>setTimeout(function bar(){ var a = string[0]; //...everything else },1000 ); </code></pre> <p>But that would probably make the code messy/redundant, since I plan on doing it 3 times. Ideally the working code would be...</p> <pre><code>setTimeout( bar(0), 1000 ); setTimeout( bar(1), 2000 ); setTimeout( bar(2), 3000 ); </code></pre> <p>But again, setting timeOut like this doesn't work for some reason :/ Any ideas why?</p>
0debug
int ff_dxva2_commit_buffer(AVCodecContext *avctx, AVDXVAContext *ctx, DECODER_BUFFER_DESC *dsc, unsigned type, const void *data, unsigned size, unsigned mb_count) { void *dxva_data; unsigned dxva_size; int result; HRESULT hr; #if CONFIG_D3D11VA if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) hr = ID3D11VideoContext_GetDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context, D3D11VA_CONTEXT(ctx)->decoder, type, &dxva_size, &dxva_data); #endif #if CONFIG_DXVA2 if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) hr = IDirectXVideoDecoder_GetBuffer(DXVA2_CONTEXT(ctx)->decoder, type, &dxva_data, &dxva_size); #endif if (FAILED(hr)) { av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 0x%lx\n", type, hr); return -1; } if (size <= dxva_size) { memcpy(dxva_data, data, size); #if CONFIG_D3D11VA if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) { D3D11_VIDEO_DECODER_BUFFER_DESC *dsc11 = dsc; memset(dsc11, 0, sizeof(*dsc11)); dsc11->BufferType = type; dsc11->DataSize = size; dsc11->NumMBsInBuffer = mb_count; } #endif #if CONFIG_DXVA2 if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) { DXVA2_DecodeBufferDesc *dsc2 = dsc; memset(dsc2, 0, sizeof(*dsc2)); dsc2->CompressedBufferType = type; dsc2->DataSize = size; dsc2->NumMBsInBuffer = mb_count; } #endif result = 0; } else { av_log(avctx, AV_LOG_ERROR, "Buffer for type %u was too small\n", type); result = -1; } #if CONFIG_D3D11VA if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) hr = ID3D11VideoContext_ReleaseDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context, D3D11VA_CONTEXT(ctx)->decoder, type); #endif #if CONFIG_DXVA2 if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD) hr = IDirectXVideoDecoder_ReleaseBuffer(DXVA2_CONTEXT(ctx)->decoder, type); #endif if (FAILED(hr)) { av_log(avctx, AV_LOG_ERROR, "Failed to release buffer type %u: 0x%lx\n", type, hr); result = -1; } return result; }
1threat
Chrome - You connection to this site is not fully secure : <p>I've recently had an SSL installed onto my server.</p> <p>I'm getting the "Your connection to this site is not fully secure" warning when using Chrome. I understand this relates to passive elements being loaded over a non secure connection and I understand what this means.</p> <p>I cannot find any elements on the site being loaded over a non secure network and I've run it through a tool to check and not found any. I've created a blank HTML page with nothing on it and so I presume no chance of there being an element loaded on a non secure connection but I still get the warning.</p> <p>Does anyone know why this may be?</p> <p>Thanks</p>
0debug
How I can impute a specific row with mean in pandas? : I am trying to impute mean to a specific column in my data frame, the names of the columns are in a list. for col in ValIndex: #ValIndex has the columns name dataSet[col] = dataSet[col].fillna(dataSet[col].mean()) I get this error when I run my code: can only concatenate str (not "int") to str
0debug
static inline int cris_lz(int x) { int r; asm ("lz\t%1, %0\n" : "=r" (r) : "r" (x)); return r; }
1threat
void qemu_chr_info(Monitor *mon) { CharDriverState *chr; TAILQ_FOREACH(chr, &chardevs, next) { monitor_printf(mon, "%s: filename=%s\n", chr->label, chr->filename); } }
1threat
cannot get the $_GET value in PHP : <p>i am passing values inthe URL by the $_GET :</p> <pre><code> &lt;a href="http://localhost/myFiles/confirmation.php?`pseudo='.$pseudo.'&amp;key'.$key.'"&gt;Confirmer votre compte&lt;/a&gt;` </code></pre> <p>i get the values in the URL of the concerned page like this :</p> <pre><code>http://localhost/myFiles/confirmation.php?pseudo=test&amp;key08656996298 </code></pre> <p>but when i do this :</p> <pre><code>echo $_GET['pseudo'] ; echo $_GET['key']; </code></pre> <p>it displays the 'pseudo' but not the key ! this is the error ( ! ) Notice: Undefined index: key in C:\wamp64\www\myFiles\confirmation.php on line 5</p>
0debug
Why am I getting 'Terminated due to timeout' error here? : <p>I'm solving <a href="https://www.hackerrank.com/challenges/circular-array-rotation" rel="nofollow">this problem</a> on Hackerrank.</p> <p>John Watson performs an operation called a right circular rotation on an array of integers, [a[0],a[ 1]......a[n]].After performing one right circular rotation operation, the array is transformed from [a[0],a[ 1]......a[n]] to [a[n- 1],a[0]......a[n-2]].</p> <p>Watson performs this operation 'k' times. To test Sherlock's ability to identify the current element at a particular position in the rotated array, Watson asks 'q' queries, where each query consists of a single integer, 'm', for which you must print the element at index in the rotated array (i.e., the value of a[m] ).</p> <p>Input Format</p> <p>The first line contains 3 space-separated integers,'n' ,'k' , and , 'q' respectively. The second line contains 'n' space-separated integers, where each integer 'i' describes array element a[n] (where 0&lt;=i <p>Output Format</p> <p>For each query, print the value of the element at index 'm' of the rotated array on a new line.</p> <pre><code>#include &lt;cmath&gt; #include &lt;cstdio&gt; #include &lt;vector&gt; #include &lt;iostream&gt; #include &lt;algorithm&gt; using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n,k,q,temp; cin&gt;&gt;n&gt;&gt;k&gt;&gt;q; //Input of n,k,q; int arr[n],qur[q]; for(int i=0;i&lt;n;i++) //Input of array { cin&gt;&gt;arr[i]; } for(int i=0;i&lt;q;i++) //Input of query numbers { cin&gt;&gt;qur[i]; } for(int z=0;z&lt;k;z++) { temp = arr[n-1]; for(int i=n-1;i&gt;0;i--) { arr[i]=arr[i-1]; } arr[0]=temp; } for(int i=0;i&lt;q;i++) { cout&lt;&lt;arr[qur[i]]&lt;&lt;endl; } return 0; } </code></pre> <p>The code's logic seems to be flawless. I'm a newbie.Thanks in advance.</p>
0debug
document.location = 'http://evil.com?username=' + user_input;
1threat
how to assing array variable as a hash? : @array=(10,45,20); @sum=($array[0]+$array[1]+$array[2]); %hash; $hash{$array[0]}{$array[2]}=$sum[0] I'm trying to print this hash.As key1 is the array[0] ,key2 is array[1] and $sum[0] is the value.But hash couldn't work.What I'm doing wrong?
0debug
ssize_t v9fs_iov_vunmarshal(struct iovec *out_sg, int out_num, size_t offset, int bswap, const char *fmt, va_list ap) { int i; ssize_t copied = 0; size_t old_offset = offset; for (i = 0; fmt[i]; i++) { switch (fmt[i]) { case 'b': { uint8_t *valp = va_arg(ap, uint8_t *); copied = v9fs_unpack(valp, out_sg, out_num, offset, sizeof(*valp)); break; } case 'w': { uint16_t val, *valp; valp = va_arg(ap, uint16_t *); copied = v9fs_unpack(&val, out_sg, out_num, offset, sizeof(val)); if (bswap) { *valp = le16_to_cpu(val); } else { *valp = val; } break; } case 'd': { uint32_t val, *valp; valp = va_arg(ap, uint32_t *); copied = v9fs_unpack(&val, out_sg, out_num, offset, sizeof(val)); if (bswap) { *valp = le32_to_cpu(val); } else { *valp = val; } break; } case 'q': { uint64_t val, *valp; valp = va_arg(ap, uint64_t *); copied = v9fs_unpack(&val, out_sg, out_num, offset, sizeof(val)); if (bswap) { *valp = le64_to_cpu(val); } else { *valp = val; } break; } case 's': { V9fsString *str = va_arg(ap, V9fsString *); copied = v9fs_iov_unmarshal(out_sg, out_num, offset, bswap, "w", &str->size); if (copied > 0) { offset += copied; str->data = g_malloc(str->size + 1); copied = v9fs_unpack(str->data, out_sg, out_num, offset, str->size); if (copied > 0) { str->data[str->size] = 0; } else { v9fs_string_free(str); } } break; } case 'Q': { V9fsQID *qidp = va_arg(ap, V9fsQID *); copied = v9fs_iov_unmarshal(out_sg, out_num, offset, bswap, "bdq", &qidp->type, &qidp->version, &qidp->path); break; } case 'S': { V9fsStat *statp = va_arg(ap, V9fsStat *); copied = v9fs_iov_unmarshal(out_sg, out_num, offset, bswap, "wwdQdddqsssssddd", &statp->size, &statp->type, &statp->dev, &statp->qid, &statp->mode, &statp->atime, &statp->mtime, &statp->length, &statp->name, &statp->uid, &statp->gid, &statp->muid, &statp->extension, &statp->n_uid, &statp->n_gid, &statp->n_muid); break; } case 'I': { V9fsIattr *iattr = va_arg(ap, V9fsIattr *); copied = v9fs_iov_unmarshal(out_sg, out_num, offset, bswap, "ddddqqqqq", &iattr->valid, &iattr->mode, &iattr->uid, &iattr->gid, &iattr->size, &iattr->atime_sec, &iattr->atime_nsec, &iattr->mtime_sec, &iattr->mtime_nsec); break; } default: break; } if (copied < 0) { return copied; } offset += copied; } return offset - old_offset; }
1threat
No img-responsive in Bootstrap 4 : <p>I just downloaded the source code for Bootstrap 4 alpha 2 and can't find the class <code>img-responsive</code> in it. It exists in Bootstrap 3 source code and I can find it with Notepad++ but in Bootstrap 4s <code>bootstrap.css</code> in <code>dist</code> folder it doesn't exist.</p> <p>What happend to it??</p>
0debug
What does :scope "provided" mean? : <p>I've seen a lot of places where some dependencies in Clojure project are marked with <code>:scope "provided"</code> (<a href="https://github.com/funcool/cats/blob/d1b7f3d60c7791798182937c54cbafa4e81536d4/project.clj#L6-L12" rel="noreferrer">example</a>).</p> <p>What does it mean?</p>
0debug
mysql select count long query time : 3 million table records, select count query time is 0.6 seconds 3.2 million table records, select count query time is 8.4 seconds (200,000 new records) 3 million table records, select count query time is 8.4 seconds (delete 200,000 records) 1.2 million table records, select count query time is 9.7 seconds (more than 200,000 records deleted) Data are normal when they are less than 3 million. Insert 200,000 data at a time, execute multiple times, and delete tests. Mysql5.6, windows10 select count(1) from t_node; delete from t_Node limit 200000; insert into t_node select * from t_node limit 200000; i want select count query time < 1s
0debug
How do I add a description to a field in "GraphQL schema language" : <p>I have a graphql schema, a fragment of which looks like this:</p> <pre><code>type User { username: String! password: String! } </code></pre> <p>In graphiql, there is a description field, but it always says "self-descriptive". How do I add descriptions to the schema? </p>
0debug
Regex to find digits group after a text match : <p>I have tried many regex expressions but unable to get the desired output. My string is </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-html lang-html prettyprint-override"><code>Ms.Evalyn J Hobbs AND Mr.Jan K Hir sch AND Ms.Gale D Bannister 3611 </code></pre> </div> </div> </p> <p>I need to extract the digits group which come after Mr or Mrs that is 3611</p>
0debug
How Can I consume this Json using React-Native? : <p>i'd like to know how can I use and consume this json, showing and updading always the list, please i need this for my work and i am struggling to make it.</p> <p><a href="https://i.stack.imgur.com/Za5Hs.png" rel="nofollow noreferrer">HERE THE JSON</a></p>
0debug