problem
stringlengths
26
131k
labels
class label
2 classes
ASP.NET Core support in Visual Studio 2015? : <p>Now that ASP.NET Core is shipped with VS 2017(getting released on March), How long will they support ASP.NET Core in VS 2015? </p> <p>I mean project.json will no longer be used, then do we need to move existing projects to VS 2017 and dont use VS 2015 to work with ASP.NET Core.</p>
0debug
static uint32_t bitband_readb(void *opaque, target_phys_addr_t offset) { uint8_t v; cpu_physical_memory_read(bitband_addr(opaque, offset), &v, 1); return (v & (1 << ((offset >> 2) & 7))) != 0; }
1threat
An explicit conversion exists (are you missing a cast?) shenoywebapi D:\shenoystudio\shenoywebapi\Controllers\RateController.cs 69 Active : Hello guys can anyone try to solve this my error i got stuck here, it shows the ..(Cannot implicitly convert type 'shenoy webapi.Models.PatIndex' to 'System.Collections.Generic.IEnumerable<shenoywebapi.Models.PartIndex>'. An explicit conversion exists (are you missing a cast?) shenoywebapi D:\shenoystudio\shenoywebapi\Controllers\RateController.cs 69 Active) ```[Route("api/Rate/getproductrate")] public IEnumerable<Rate> GetProductRate() { var list = new List<Rate>(); var dsRate = SqlHelper.ExecuteDataset(AppDatabaseConnection, CommandType.StoredProcedure, 0, "GetProductRates"); if (dsRate.Tables[0].Rows.Count > 0) { foreach (DataRow row in dsRate.Tables[0].Rows) { list.Add(new Rate { Id = Convert.ToInt64(row[0]), SerialNumber = row[1].ToString(), ProductName = row[2].ToString(), Unit = row[3].ToString(), PartIndex = new PartIndex { Series = row[4].ToString() }, }); } } return list; } ``` this is my model ```namespace shenoywebapi.Models { public class Rate { public long Id { get; set; } public DateTime wefDate { get; set; } public string SerialNumber { get; set; } public string ProductName { get; set; } public string Unit { get; set; } public long Rates { get; set; } public IEnumerable<PartIndex> PartIndex { get; set; } } } ``` Severity Code Description Project File Line Suppression State Error CS0266 Cannot implicitly convert type 'shenoywebapi.Models.PartIndex' to 'System.Collections.Generic.IEnumerable<shenoywebapi.Models.PartIndex>'. An explicit conversion exists (are you missing a cast?) shenoywebapi D:\shenoystudio\shenoywebapi\Controllers\RateController.cs 69 Active
0debug
Need advice on how to optimize my regex code : I am trying to create a custom field in Google Data Studio using RegEx to basically create a filter based on Page URL. While I'm not getting an error message in GDS, the filed is not functioning. CASE WHEN REGEXP_MATCH(Page, "(/bachelor-applied-science-health-sciences/|/bachelor-international-public-health/|/bachelor-science-health-education-and-health-promotion/|/bachelor-science-health-sciences-healthy-lifestyles-coaching/|/bachelor-science-nutrition/|/speech-and-hearing-science-bs/|/doctor-behavioral-health-clinical/|/doctor-behavioral-health-management/|/integrated-behavioral-health-clinical-grad-certificate/|/integrated-behavioral-health-management-grad-certificate/|/master-advanced-study-health-informatics/|/international-health-management-mihm/|/graduate/master-science-biomedical-diagnostics/|/graduate/medical-nutrition-ms/|/master-science-nutrition-dietetics/|/master-science-science-health-care-delivery/|/graduate-certificate-science-health-care-delivery/)") THEN "College of Health Solutions" ELSE "Other" END
0debug
static void cmos_init(int ram_size, const char *boot_device, BlockDriverState **hd_table) { RTCState *s = rtc_state; int val; int fd0, fd1, nb; int i; val = 640; rtc_set_memory(s, 0x15, val); rtc_set_memory(s, 0x16, val >> 8); val = (ram_size / 1024) - 1024; if (val > 65535) val = 65535; rtc_set_memory(s, 0x17, val); rtc_set_memory(s, 0x18, val >> 8); rtc_set_memory(s, 0x30, val); rtc_set_memory(s, 0x31, val >> 8); if (ram_size > (16 * 1024 * 1024)) val = (ram_size / 65536) - ((16 * 1024 * 1024) / 65536); else val = 0; if (val > 65535) val = 65535; rtc_set_memory(s, 0x34, val); rtc_set_memory(s, 0x35, val >> 8); rtc_set_memory(s, 0x3d, boot_device2nibble(boot_device[1]) << 4 | boot_device2nibble(boot_device[0]) ); rtc_set_memory(s, 0x38, boot_device2nibble(boot_device[2]) << 4 | (fd_bootchk ? 0x0 : 0x1)); fd0 = fdctrl_get_drive_type(floppy_controller, 0); fd1 = fdctrl_get_drive_type(floppy_controller, 1); val = (cmos_get_fd_drive_type(fd0) << 4) | cmos_get_fd_drive_type(fd1); rtc_set_memory(s, 0x10, val); val = 0; nb = 0; if (fd0 < 3) nb++; if (fd1 < 3) nb++; switch (nb) { case 0: break; case 1: val |= 0x01; break; case 2: val |= 0x41; break; } val |= 0x02; val |= 0x04; rtc_set_memory(s, REG_EQUIPMENT_BYTE, val); rtc_set_memory(s, 0x12, (hd_table[0] ? 0xf0 : 0) | (hd_table[1] ? 0x0f : 0)); if (hd_table[0]) cmos_init_hd(0x19, 0x1b, hd_table[0]); if (hd_table[1]) cmos_init_hd(0x1a, 0x24, hd_table[1]); val = 0; for (i = 0; i < 4; i++) { if (hd_table[i]) { int cylinders, heads, sectors, translation; translation = bdrv_get_translation_hint(hd_table[i]); if (translation == BIOS_ATA_TRANSLATION_AUTO) { bdrv_get_geometry_hint(hd_table[i], &cylinders, &heads, &sectors); if (cylinders <= 1024 && heads <= 16 && sectors <= 63) { translation = 0; } else { translation = 1; } } else { translation--; } val |= translation << (i * 2); } } rtc_set_memory(s, 0x39, val); }
1threat
uint64_t ram_bytes_total(void) { return last_ram_offset; }
1threat
How can I change an IBAction to mouseEntered? : <p>I want to create an IBAction when my mouse enters an NSButton. Whenever I create an IBAction from the button, it only works when I click it.</p> <p>How can I make it so that the IBActions works when my mouse enters the button?</p>
0debug
How can I change the format of this input? : <p>I have this script in js:</p> <p><strong>CODE HTML:</strong></p> <pre><code>&lt;input class="required-input" type="text" name="date_of_birth" id="date_of_birth" placeholder="MM/DD/YYYY"&gt; </code></pre> <p><strong>CODE JS:</strong></p> <pre><code>$('.required-input').each(function() { $(this).on('input keyup keypress blur change', function() { const dob= /^([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})$/; var regex; if ($(this).attr("id") == "date_of_birth") { regex = dob; } //SOME CODE JS: }); }); </code></pre> <p>I want these things:</p> <p>1.To be the next format <code>23/09/1992</code></p> <p>2.You can not write more characters than necessary.</p> <p>3.You can not write letters, only numbers</p> <p>How to change this variable <code>(dob)</code> to be good?</p> <p>Thanks in advance!</p>
0debug
PostgreSQL run query as a string in place of sql file : <p>I have a need to run a query for maintenance reasons as below using psql</p> <pre><code>psql -U postgres -d test 'update sometbl set col1 = true;' </code></pre> <p>I could put the query in a sql file and run it using -f option but I really need this to run from within a bash script and don't want to have to use an additional sql file for this simple query.</p>
0debug
Update .NET web service to use TLS 1.2 : <p>I need to use TLS 1.2 to connect from my .NET web service to another that is going to force TLS 1.2. I found a resource that said .NET 4.6 uses TLS 1.2 by default so that sounded like the easiest solution. I updated the .NET framework on the server and restarted. In IIS I tried to make an application pool using .NET 4.6 but 4.0 was the only option. Then I found something that said it would still say 4.0 because 4.6 is an "in place" update to .NET 4.0. So I thought maybe I was done. However on an error page that I got for unrelated reasons, it said <code>Microsoft .NET Framework Version:4.0.30319</code> so it seems I have not successfully upgraded. Any pointers on how to make sure my application pool is using .NET 4.6, or more generally how to enable TLS 1.2?</p>
0debug
Count unique values in excel Columns with blanks : <p>I have Data in one column (m), the data contains a number of blanks &amp; I want to be able to count the number of unique occurances that begin with the number 2. </p>
0debug
PHP MySQLi Prepaired Statement's returns false : <p>I'm having a problem with a prepaired statement system though a system of Classes that managed our DB Table Entries.</p> <p>So the problem i'm having is that the generated SQL of </p> <pre><code>INSERT INTO `sys_User` SET `email` = ? `last_name` = ? `password` = ? `encryption` = ? </code></pre> <p>on the line below <code>$stmt = $db-&gt;prepare($sql);</code> is failing (returning false)</p> <p>However i'm not getting an error back from the Database engine,</p> <pre><code>Array ( [Number] =&gt; 256 [String] =&gt; MySQLi Query failed MySQL said ''. [File] =&gt; /var/www/models/table/base.php [Line] =&gt; 282 ) </code></pre> <p>Inside a base class for all Database Table Classes.</p> <pre><code>$db = self::getDatabase(); $bindParamArgs = array(); $bindParamArgs[] = ""; $sql = "INSERT INTO `".$this-&gt;getTableName()."` SET "; foreach($this-&gt;updated as $name =&gt; $val){ $sql .= " `".$name."` = ?"; $bindParamArgs[0] .= $columns[$name]-&gt;Type; $bindParamArgs[] = &amp;$this-&gt;values[$name]; } echo $sql; $stmt = $db-&gt;prepare($sql); if(!$stmt){ \trigger_error("MySQLi Query failed MySQL said '".$stmt-&gt;error."'.", \E_USER_ERROR); } $result = \site\model\Database::getEvaluatedBind($stmt, $bindParamArgs); </code></pre> <p>Some Needed Info: <code>self::getDatabase();</code> Returns the connection the the Database (MySQLi) object</p> <p><code>$this-&gt;getTableName()</code> get the table name for the table we're working in this is worked out from the class name that has been called</p> <p><code>$this-&gt;updated</code> an array of all columns in the Table equal to boolean true if it has been modified and needs to be saved.</p> <p><code>\site\model\Database::getEvaluatedBind(mysqli_stmt &amp;$stmt, $params)</code> a custom method i created of calling bind_param that keeps the damn pass by refference system happy, </p> <p>This must be something so simple i'm missing i just can't work it out</p>
0debug
const char *bdrv_get_device_name(const BlockDriverState *bs) { return bs->blk ? blk_name(bs->blk) : ""; }
1threat
How to convert JSON to Object format in JAVA : I have a link https://jsonplaceholder.typicode.com/posts to which giving JSON format returned. that I have to be convert in Object format. Can anyone suggest me to convert in Object format? public String ExposeServices() { RestTemplate restTemplate= new RestTemplate(); String forresouseURL="https://jsonplaceholder.typicode.com/posts"; ResponseEntity<String> response= restTemplate.getForEntity(forresouseURL, String.class); Gson gson = new Gson(); // Or use new GsonBuilder().create(); String target2 = gson.toJson(response, User.class); HashMap<String, String> jsonObject= response; System.out.println(target2); //response.getBody(). return target2; } This is what I have tried but its not returning any value. I have to get JOSN value in Object formate then have to insert In MYSQL DB.
0debug
C# or C++ ; It is possible to modify memory like in CE? : <p>It is <strong>Possible</strong> to modify memory like in <strong>CE</strong>? Something like:</p> <p><strong>Original</strong>:</p> <pre><code>je 011D5F29 </code></pre> <p><strong>Modified</strong>:</p> <pre><code>jmp 011D5F6E </code></pre> <p>It is possible to do in <strong>C#</strong>? If it's not, then it's possible in <strong>C++</strong>?</p> <p>If it's possible in <strong>C#</strong> or <strong>C++</strong>, then send me code Thank <strong>you</strong> for reading :)</p>
0debug
int msmpeg4_decode_picture_header(MpegEncContext * s) { int code; #if 0 { int i; for(i=0; i<s->gb.size_in_bits; i++) printf("%d", get_bits1(&s->gb)); printf("END\n"); #endif if(s->msmpeg4_version==1){ int start_code, num; start_code = (get_bits(&s->gb, 16)<<16) | get_bits(&s->gb, 16); if(start_code!=0x00000100){ fprintf(stderr, "invalid startcode\n"); num= get_bits(&s->gb, 5); s->pict_type = get_bits(&s->gb, 2) + 1; if (s->pict_type != I_TYPE && s->pict_type != P_TYPE){ fprintf(stderr, "invalid picture type\n"); #if 0 { static int had_i=0; if(s->pict_type == I_TYPE) had_i=1; if(!had_i) return -1; #endif s->qscale = get_bits(&s->gb, 5); if (s->pict_type == I_TYPE) { code = get_bits(&s->gb, 5); if(s->msmpeg4_version==1){ if(code==0 || code>s->mb_height){ fprintf(stderr, "invalid slice height %d\n", code); s->slice_height = code; }else{ if (code < 0x17){ fprintf(stderr, "error, slice code was %X\n", code); s->slice_height = s->mb_height / (code - 0x16); switch(s->msmpeg4_version){ case 1: case 2: s->rl_chroma_table_index = 2; s->rl_table_index = 2; s->dc_table_index = 0; break; case 3: s->rl_chroma_table_index = decode012(&s->gb); s->rl_table_index = decode012(&s->gb); s->dc_table_index = get_bits1(&s->gb); break; case 4: msmpeg4_decode_ext_header(s, (2+5+5+17+7)/8); if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb); else s->per_mb_rl_table= 0; if(!s->per_mb_rl_table){ s->rl_chroma_table_index = decode012(&s->gb); s->rl_table_index = decode012(&s->gb); s->dc_table_index = get_bits1(&s->gb); s->inter_intra_pred= 0; break; s->no_rounding = 1; } else { switch(s->msmpeg4_version){ case 1: case 2: if(s->msmpeg4_version==1) s->use_skip_mb_code = 1; else s->use_skip_mb_code = get_bits1(&s->gb); s->rl_table_index = 2; s->rl_chroma_table_index = s->rl_table_index; s->dc_table_index = 0; s->mv_table_index = 0; break; case 3: s->use_skip_mb_code = get_bits1(&s->gb); s->rl_table_index = decode012(&s->gb); s->rl_chroma_table_index = s->rl_table_index; s->dc_table_index = get_bits1(&s->gb); s->mv_table_index = get_bits1(&s->gb); break; case 4: s->use_skip_mb_code = get_bits1(&s->gb); if(s->bit_rate > MBAC_BITRATE) s->per_mb_rl_table= get_bits1(&s->gb); else s->per_mb_rl_table= 0; if(!s->per_mb_rl_table){ s->rl_table_index = decode012(&s->gb); s->rl_chroma_table_index = s->rl_table_index; s->dc_table_index = get_bits1(&s->gb); s->mv_table_index = get_bits1(&s->gb); s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE); break; if(s->flipflop_rounding){ s->no_rounding ^= 1; }else{ s->no_rounding = 0; s->esc3_level_length= 0; s->esc3_run_length= 0; #ifdef DEBUG printf("*****frame %d:\n", frame_count++); #endif return 0;
1threat
IntelliSense keeps giving [Failure] Could not find a part of the path C:\TEMP : <p>After changing my temporary folder, I got an issue with IntelliSense in VS2015 complaining it cannot find the temp folder (other applications, including VS2015, find the new location just fine).</p> <p>The error I receive after firing up a project (seems to happen with any type of solution, C#, ASP.NET etc) is repeatedly this message in the output window of Visual Studio 2015:</p> <p><a href="https://i.stack.imgur.com/DPdZP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DPdZP.png" alt="enter image description here"></a></p> <pre><code>[Failure] Could not find a part of the path 'R:\TMP\.NETFramework,Version=v4.0.AssemblyAttributes.cs'. [Failure] Could not find a part of the path 'R:\TMP\.NETFramework,Version=v4.0.AssemblyAttributes.cs'. [Failure] Could not find a part of the path 'R:\TMP\.NETFramework,Version=v4.0.AssemblyAttributes.cs'. [Failure] Could not find a part of the path 'R:\TMP\.NETFramework,Version=v4.0.AssemblyAttributes.cs'. [Failure] Could not find a part of the path 'R:\TMP\.NETFramework,Version=v4.0.AssemblyAttributes.cs'. [Failure] Could not find a part of the path 'R:\TMP\.NETFramework,Version=v4.0.AssemblyAttributes.cs'. [Failure] Could not find a part of the path 'R:\TMP\.NETFramework,Version=v4.0.AssemblyAttributes.cs'. </code></pre> <p>I think I replaced all rogue references to the <code>R:\TMP</code> location in the registry, but this one remains. Anyone any idea how to fix this?</p>
0debug
How can I extend the length of an array by 1 in C#? : <p>I want an array capacity to increase as I add items in order to add as many items to it as possible. Is there a way to do this in C#?</p>
0debug
static target_ulong h_vio_signal(CPUState *env, sPAPREnvironment *spapr, target_ulong opcode, target_ulong *args) { target_ulong reg = args[0]; target_ulong mode = args[1]; VIOsPAPRDevice *dev = spapr_vio_find_by_reg(spapr->vio_bus, reg); VIOsPAPRDeviceInfo *info; if (!dev) { return H_PARAMETER; } info = (VIOsPAPRDeviceInfo *)qdev_get_info(&dev->qdev); if (mode & ~info->signal_mask) { return H_PARAMETER; } dev->signal_state = mode; return H_SUCCESS; }
1threat
static void av_always_inline filter_mb_edgech( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; const int alpha = alpha_table[index_a]; const int beta = beta_table[qp - qp_bd_offset + h->slice_beta_offset]; if (alpha ==0 || beta == 0) return; if( bS[0] < 4 ) { int8_t tc[4]; tc[0] = tc0_table[index_a][bS[0]]+1; tc[1] = tc0_table[index_a][bS[1]]+1; tc[2] = tc0_table[index_a][bS[2]]+1; tc[3] = tc0_table[index_a][bS[3]]+1; h->h264dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta); } }
1threat
pass javascript variable value to c++ vatiable : I'm using g++ to edit a html webpage, so How do I pass a Javascript variable value to C++ variable by using a Javascript function? e.x. function convert(val){//conversion}
0debug
How can i re-write this haskell function complexity : <pre><code>c:: Integer -&gt; Integer c n | n &lt; 3 = n + 100 | otherwise = c (n-2) + c (n-3) + c (n-2) </code></pre> <p>Complexity of c in this form is exponential. Rewrite function c so that it's complexity is linear. c x should terminate if 1000 &lt; x 100000.</p>
0debug
Data to be inserted in online database of a Website when there is no internet : <p>I am working on an ERP System(Website) developed in php(Laravel).The requirement which i need to implement is that when ever there is no internet but if a user wants to submit data,he/she could do that and when internet comes and website start working.i want that offline data to be retrieved.</p> <p>Happy Coding! </p>
0debug
Cannot read property 'outlets' of null in Angular 4 : <p>I have Angular 4.3.6 project where a template snippet produces this error.</p> <p>Template block:</p> <p><code>&lt;a [routerLink]="['/article',article?.id]"&gt;{{article?.title}}&lt;/a&gt;</code></p> <p>Error stack trace:</p> <pre><code>ArticleSpComponent.html:26 ERROR TypeError: Cannot read property 'outlets' of null at createNewSegmentGroup (router.es5.js:2967) at updateSegmentGroup (router.es5.js:2896) at router.es5.js:2914 at forEach (router.es5.js:593) at updateSegmentGroupChildren ( </code></pre> <p>The error cause seems to be obvious. article variable is fetched async from Http and initialized after page is rendered so firstly it's null. However I thought that putting ? after this variable allows to avoid this issue.</p> <p>Can you please advise?</p>
0debug
What is the best way to declare on UI component in android with Kotlin? : <p>I'm trying to build android application using Kotlin for the first time.</p> <p>I want to declare on some buttons outside the OnCreate method and i can initialize them only Inside this function with findViewById.</p> <p>Can i declare in simple and clean code like in java?</p> <pre><code>private Button btnProceed; </code></pre> <p>Because when converting it to Kotlin it look like:</p> <pre><code>private var btnProceed: Button? = null </code></pre> <p>And then when initialize OnClick function need to add ! sign:</p> <pre><code>btnProceed!!.setOnClickListener </code></pre> <p>What is the right and cleanest way? </p>
0debug
How to optimize slq query? : Hi this is my procedure i think it is to long an not optimized.How can i optimize it better to short query.<br/> This is the query:<br/> <pre><code> ALTER function [dbo].[FuncBusReport](@startdate datetime,@enddate datetime,@top int ,@state int) returns @BusTable table ( [Id][int] identity(1,1) not null ,[state][nvarchar](50) ,[Price][nvarchar](50) ,[ReserveType][nvarchar](50) ,[ObjectIdDepartue][int] ,[IssueDate][nvarchar](50) ,[BankId][int] ,[Confirmed][bit] ,[TrackingCode][nvarchar](50) ,[Transactionsuccess][nvarchar](50) ,[Name][nvarchar](128) ,[TiketUrl][nvarchar](128) ,[ObjectIdReturn] [int] null ,[TelNumber][nvarchar](50) null ) as begin if(@state=1) insert into @BusTable select top (@top) 'ناموفق' ,[Price] ,'اتوبوس' ,[ObjectIdDepartue] ,[dbo].PersianDate(IssueDate) + ' '+ [dbo].[TimeOfDateTime](IssueDate) ,[BankId] ,[Confirmed] ,[TrackingCode] ,[Transactionsuccess] ,[dbo].[Profile].FirstName+' '+[dbo].[Profile].LastName as Name ,[dbo].GetUrlDownloads(4,[ObjectIdDepartue]) ,[ObjectIdReturn] ,[dbo].[payments].[TelNumber] from [dbo].[payments] inner join [dbo].[Profile] on [dbo].[Profile].[UserId]=[dbo].[payments].UserId where [dbo].[Payments].[IssueDate] >=@startdate AND [dbo].[Payments].[IssueDate] <=@enddate and [dbo].[payments].ReserveType=4 and [dbo].[payments].[transactionsuccess] in(0,1) and [dbo].[payments].[state] in (1,2) else if(@state=3) insert into @BusTable select top (@top) 'پرداخت موفق رزرو ناموفق' ,[Price] ,'اتوبوس' ,[ObjectIdDepartue] ,[dbo].PersianDate(IssueDate) + ' '+ [dbo].[TimeOfDateTime](IssueDate) ,[BankId] ,[Confirmed] ,[TrackingCode] ,[Transactionsuccess] ,[dbo].[Profile].FirstName+' '+[dbo].[Profile].LastName as Name ,[dbo].GetUrlDownloads(4,[ObjectIdDepartue]) ,[ObjectIdReturn] ,[dbo].[payments].[TelNumber] from [dbo].[payments] inner join [dbo].[Profile] on [dbo].[Profile].[UserId]=[dbo].[payments].UserId where [dbo].[Payments].[IssueDate] >=@startdate AND [dbo].[Payments].[IssueDate] <=@enddate and [dbo].[payments].ReserveType=4 and [dbo].[payments].[state] in (3,5) else if(@state=6) insert into @BusTable select top (@top) state ,[Price] ,'اتوبوس' ,[ObjectIdDepartue] ,[dbo].PersianDate(IssueDate) + ' '+ [dbo].[TimeOfDateTime](IssueDate) ,[BankId] ,[Confirmed] ,[TrackingCode] ,[Transactionsuccess] ,[dbo].[Profile].FirstName+' '+[dbo].[Profile].LastName as Name ,[dbo].GetUrlDownloads(4,[ObjectIdDepartue]) ,[ObjectIdReturn] ,[dbo].[payments].[TelNumber] from [dbo].[payments] inner join [dbo].[Profile] on [dbo].[Profile].[UserId]=[dbo].[payments].UserId where [dbo].[Payments].[IssueDate] >=@startdate AND [dbo].[Payments].[IssueDate] <=@enddate and [dbo].[payments].ReserveType=4 and [dbo].[payments].[state] =6 else if(@state=4) insert into @BusTable select top (@top) 'برگشت خرید' ,[Price] ,'اتوبوس' ,[ObjectIdDepartue] ,[dbo].PersianDate(IssueDate) + ' '+ [dbo].[TimeOfDateTime](IssueDate) ,[BankId] ,[Confirmed] ,[TrackingCode] ,[Transactionsuccess] ,[dbo].[Profile].FirstName+' '+[dbo].[Profile].LastName as Name ,[dbo].GetUrlDownloads(4,[ObjectIdDepartue]) ,[ObjectIdReturn] ,[dbo].[payments].[TelNumber] from [dbo].[payments] inner join [dbo].[Profile] on [dbo].[Profile].[UserId]=[dbo].[payments].UserId where [dbo].[Payments].[IssueDate] >=@startdate AND [dbo].[Payments].[IssueDate] <=@enddate and [dbo].[payments].ReserveType=4 and [dbo].[payments].[state] =4 else if(@state=0) insert into @BusTable select top (@top) case when [state] in(1,2) then 'ناموفق' when [state] in(3,5) then 'پرداخت موفق و رزرو ناموفق' when [state] = 4 then 'برگشت خرید' when [state] = 6 then 'پرداخت موفق رزرو موفق' end ,[Price] ,'اتوبوس' ,[ObjectIdDepartue] ,[dbo].PersianDate(IssueDate) + ' '+ [dbo].[TimeOfDateTime](IssueDate) ,[BankId] ,[Confirmed] ,[TrackingCode] ,[Transactionsuccess] ,[dbo].[Profile].FirstName+' '+[dbo].[Profile].LastName as Name ,[dbo].GetUrlDownloads(4,[ObjectIdDepartue]) ,[ObjectIdReturn] ,[dbo].[payments].[TelNumber] from [dbo].[payments] inner join [dbo].[Profile] on [dbo].[Profile].[UserId]=[dbo].[payments].UserId where [dbo].[Payments].[IssueDate] >=@startdate AND [dbo].[Payments].[IssueDate] <=@enddate and [dbo].[payments].ReserveType=4 return end; </code></pre>
0debug
static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, QemuConsole *con, int idx, GSList *group, GtkWidget *view_menu) { Error *local_err = NULL; Object *obj; obj = object_property_get_link(OBJECT(con), "device", &local_err); if (obj) { vc->label = g_strdup_printf("%s", object_get_typename(obj)); } else { vc->label = g_strdup_printf("VGA"); } vc->s = s; vc->gfx.scale_x = 1.0; vc->gfx.scale_y = 1.0; vc->gfx.drawing_area = gtk_drawing_area_new(); gtk_widget_add_events(vc->gfx.drawing_area, GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_SCROLL_MASK | GDK_KEY_PRESS_MASK); gtk_widget_set_can_focus(vc->gfx.drawing_area, TRUE); vc->type = GD_VC_GFX; vc->tab_item = vc->gfx.drawing_area; gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), vc->tab_item, gtk_label_new(vc->label)); gd_connect_vc_gfx_signals(vc); group = gd_vc_menu_init(s, vc, idx, group, view_menu); vc->gfx.dcl.ops = &dcl_ops; vc->gfx.dcl.con = con; register_displaychangelistener(&vc->gfx.dcl); return group; }
1threat
Python: I do not understand this syntax : <p>Now I learn about network programming. I wanted to write myself a <code>recvall</code> function. My messages are sent through a TCP sockets and always end with the <code>\r\n</code>. Googling some articles and blog posts, I found a method I do not understand. Can it be written simpler?</p> <pre><code>def recvuntil(s, needle): data = "" while data[-len(needle):] != needle: data += s.recv(1) return data </code></pre> <p>The line I do not understand: <code>while data[-len(needle):] != needle:</code>. It does not make any sense to me (but, however, it works). <code>-len(needle)</code> should return a negative number and strings are numbered starting from <code>0</code> ... </p>
0debug
int add_av_stream(FFStream *feed, AVStream *st) { AVStream *fst; AVCodecContext *av, *av1; int i; av = &st->codec; for(i=0;i<feed->nb_streams;i++) { st = feed->streams[i]; av1 = &st->codec; if (av1->codec_id == av->codec_id && av1->codec_type == av->codec_type && av1->bit_rate == av->bit_rate) { switch(av->codec_type) { case CODEC_TYPE_AUDIO: if (av1->channels == av->channels && av1->sample_rate == av->sample_rate) goto found; break; case CODEC_TYPE_VIDEO: if (av1->width == av->width && av1->height == av->height && av1->frame_rate == av->frame_rate && av1->gop_size == av->gop_size) goto found; break; default: abort(); } } } fst = av_mallocz(sizeof(AVStream)); if (!fst) return -1; fst->priv_data = av_mallocz(sizeof(FeedData)); memcpy(&fst->codec, av, sizeof(AVCodecContext)); feed->streams[feed->nb_streams++] = fst; return feed->nb_streams - 1; found: return i; }
1threat
build rejected from facebook : I have submitted my app simulator build for review process but it is rejected and reason is **cant get item 1 of {}** any one have any idea why build is rejected and how fb review apps
0debug
static int mpegts_handle_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags) { int ret; *timestamp = RTP_NOTS_VALUE; if (!data->ts) return AVERROR(EINVAL); if (!buf) { if (data->read_buf_index >= data->read_buf_size) return AVERROR(EAGAIN); ret = ff_mpegts_parse_packet(data->ts, pkt, data->buf + data->read_buf_index, data->read_buf_size - data->read_buf_index); if (ret < 0) return AVERROR(EAGAIN); data->read_buf_index += ret; if (data->read_buf_index < data->read_buf_size) return 1; else return 0; } ret = ff_mpegts_parse_packet(data->ts, pkt, buf, len); if (ret < 0) return AVERROR(EAGAIN); if (ret < len) { data->read_buf_size = FFMIN(len - ret, sizeof(data->buf)); memcpy(data->buf, buf + ret, data->read_buf_size); data->read_buf_index = 0; return 1; } return 0; }
1threat
Getting incorrect date from 24 hours format time string in Objective C iOS : I have to fetch date in format (YYYY-MM-dd hh:mm:ss) from a 24 hours format (HH:mm) time string. I have used the following code but I'm getting wrong output : NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setCalendar:[[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]]; [formatter setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]]; [formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]]; [formatter setDateFormat:@"HH:mm"]; NSDate *myDate = [formatter dateFromString:@"13:54"]; And I am getting incorrect output : 2000-01-01 13:54:00 +0000 But I want the output like "2017-01-02 13:54:00" I checked this "http://stackoverflow.com/questions/25051915/ios-nsdate-from-string-with-time-only" but didn't get correct solution. Please help me to achieve this. Thanks !
0debug
int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) { AVFilterContext *ret; *filter_ctx = NULL; if (!filter) return AVERROR(EINVAL); ret = av_mallocz(sizeof(AVFilterContext)); ret->av_class = &avfilter_class; ret->filter = filter; ret->name = inst_name ? av_strdup(inst_name) : NULL; if (filter->priv_size) ret->priv = av_mallocz(filter->priv_size); ret->input_count = pad_count(filter->inputs); if (ret->input_count) { ret->input_pads = av_malloc(sizeof(AVFilterPad) * ret->input_count); memcpy(ret->input_pads, filter->inputs, sizeof(AVFilterPad) * ret->input_count); ret->inputs = av_mallocz(sizeof(AVFilterLink*) * ret->input_count); } ret->output_count = pad_count(filter->outputs); if (ret->output_count) { ret->output_pads = av_malloc(sizeof(AVFilterPad) * ret->output_count); memcpy(ret->output_pads, filter->outputs, sizeof(AVFilterPad) * ret->output_count); ret->outputs = av_mallocz(sizeof(AVFilterLink*) * ret->output_count); } *filter_ctx = ret; return 0; }
1threat
How to get a result from fragment using Navigation Architecture Component? : <p>Let's say that we have two fragments: <code>MainFragment</code> and <code>SelectionFragment</code>. The second one is build for selecting some object, e.g. an integer. There are different approaches in receiving result from this second fragment like callbacks, buses etc. </p> <p>Now, if we decide to use Navigation Architecture Component in order to navigate to second fragment we can use this code:</p> <pre><code>NavHostFragment.findNavController(this).navigate(R.id.action_selection, bundle) </code></pre> <p>where <code>bundle</code> is an instance of <code>Bundle</code> (of course). As you can see there is no access to <code>SelectionFragment</code> where we could put a callback. The question is, how to receive a result with Navigation Architecture Component?</p>
0debug
how to reshape a dataset for RNN/LSTM model? : <p>I am trying to build an RNN/LSTM model for binary classification 0 or 1</p> <p>a sample of my dataset (patient number, time in mill/sec., normalization of X Y and Z, kurtosis, skewness, pitch, roll and yaw, label) respectively.</p> <pre><code>1,15,-0.248010047716,0.00378335508419,-0.0152548459993,-86.3738760481,0.872322164158,-3.51314800063,0 1,31,-0.248010047716,0.00378335508419,-0.0152548459993,-86.3738760481,0.872322164158,-3.51314800063,0 1,46,-0.267422664673,0.0051143782875,-0.0191247001961,-85.7662354031,1.0928406847,-4.08015176908,0 1,62,-0.267422664673,0.0051143782875,-0.0191247001961,-85.7662354031,1.0928406847,-4.08015176908,0 </code></pre> <p>and this my code</p> <pre><code>import numpy as np from keras.datasets import imdb from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from keras.layers import Bidirectional from keras.preprocessing import sequence # fix random seed for reproducibility np.random.seed(7) train = np.loadtxt("featwithsignalsTRAIN.txt", delimiter=",") test = np.loadtxt("featwithsignalsTEST.txt", delimiter=",") x_train = train[:,[2,3,4,5,6,7]] x_test = test[:,[2,3,4,5,6,7]] y_train = train[:,8] y_test = test[:,8] # create the model model = Sequential() model.add(LSTM(20, dropout=0.2, input_dim=6)) model.add(Dense(4, activation = 'sigmoid')) model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) model.fit(x_train, y_train, epochs = 2) </code></pre> <p>I am trying to reshape the dataset to be able to feed it to an RNN/LSTM model.</p> <p>because it gives me the following error</p> <blockquote> <p>Error when checking input: expected lstm_1_input to have 3 dimensions, but got array with shape (1415684, 6)</p> </blockquote> <p>can anyone help me? thanks in advance.</p>
0debug
Underfined function SUM Sqlite : function SUM return value underfiend, why i can set result in TextView. It my code: mDb = new loaithu( getActivity() ); Cursor cursor = mDb.GetQueryData( "SELECT khoanThu, money, SUM(money) FROM 'khoanthu' ;" ); if(cursor!=null && cursor.getCount() > 0){ if(cursor.moveToFirst()){ do{ Object result = cursor.getString( 2 ); Log.i("oke", "" + cursor.getCount()); String k = (String)result; Log.i("SHOWWWWW", "" + k); //tv.setText( result); }while (cursor.moveToNext()); } } cursor.close(); [enter image description here][1] [1]: https://i.stack.imgur.com/CTK29.png
0debug
Source code to upload files from galley to server and display it in list in Codename One : <p>Shai Almog You have made facebook clone and whatsapp clone.So you can easily help me.Can you please give me the source code for that or i have made a similar app in android studio and can I convert it to Codename one</p>
0debug
static int load_apply_palette(FFFrameSync *fs) { AVFilterContext *ctx = fs->parent; AVFilterLink *inlink = ctx->inputs[0]; PaletteUseContext *s = ctx->priv; AVFrame *master, *second, *out = NULL; int ret; ret = ff_framesync_dualinput_get_writable(fs, &master, &second); if (ret < 0) return ret; if (!master || !second) { ret = AVERROR_BUG; goto error; } if (!s->palette_loaded) { load_palette(s, second); } ret = apply_palette(inlink, master, &out); if (ret < 0) goto error; return ff_filter_frame(ctx->outputs[0], out); error: av_frame_free(&master); av_frame_free(&second); return ret; }
1threat
ssize_t pt_getxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size) { char *buffer; ssize_t ret; buffer = rpath(ctx, path); ret = lgetxattr(buffer, name, value, size); g_free(buffer); return ret; }
1threat
What is an attribute of the type of the same name of the class that created it? : I have the next code in c #: class Person { private int nombre; // here mi question: private Person variable; } //That mean this type of variable : 'Person' ?
0debug
static av_cold int che_configure(AACContext *ac, enum ChannelPosition che_pos, int type, int id, int *channels) { if (*channels >= MAX_CHANNELS) return AVERROR_INVALIDDATA; if (che_pos) { if (!ac->che[type][id]) { if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement)))) return AVERROR(ENOMEM); ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr); } if (type != TYPE_CCE) { ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0]; if (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) { ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1]; } } } else { if (ac->che[type][id]) ff_aac_sbr_ctx_close(&ac->che[type][id]->sbr); av_freep(&ac->che[type][id]); } return 0; }
1threat
static uint64_t softusb_read(void *opaque, target_phys_addr_t addr, unsigned size) { MilkymistSoftUsbState *s = opaque; uint32_t r = 0; addr >>= 2; switch (addr) { case R_CTRL: r = s->regs[addr]; break; default: error_report("milkymist_softusb: read access to unknown register 0x" TARGET_FMT_plx, addr << 2); break; } trace_milkymist_softusb_memory_read(addr << 2, r); return r; }
1threat
How to find all lines in code where inheritance take place? : <p>Is there any tool/static analysis tool/build in compiler or IDE tool that can find all lines of code where inheritance take place?</p> <p>What I want to do is to find all inheritance cases and then check if base class have virtual destructor.</p>
0debug
How to fix the Anaconda linter showing errors for f-strings in Sublime Text 3? : <p>The error shown is simply "[E]" so I'm not sure how to exempt this error in the Anaconda preferences.</p> <p>e.g. the linter error for <code>print(f"Hello, world!")</code> says "<em>[E] invalid syntax</em>"</p>
0debug
Unexpected end of JSON input in MongoDB Compass : <p>I want to import data of type json in MongoDB compass, the import function gives this error " unexpected end of json input "</p> <p><a href="https://i.stack.imgur.com/kTBmO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kTBmO.png" alt="enter image description here"></a></p> <p>there is a some of my json file </p> <pre><code>[ { 'id' :4, 'user' : 'test@example.com', 'date1' :'2019-03-01', 'date2' : '2019-04-01', 'statut' : 'Good', 'guest_number' : 4 } ] </code></pre>
0debug
how to split words in astring in c? : I need to build a program that recives up to 30 chars from the user, and then to play with it. For example, i need to reverses the sentence and then print it, or to rotate it. I have been trying to copy the words of the sentence one by one to a matrix of [30][31], but it does not working... any ideas? and i can not use pointers... thanks for the help :) #include <stdio.h> #include <string.h> void main(){ int i=0,j=0,wrongData=0,charCounter=0,word=0,letter=0; char st[100],arr[100]={0},mat[30][31]={0}; printf("Please, enter your sentence >"); gets(st); while(i<strlen(st)){ if('A'<=st[i] && st[i]<='Z'){ charCounter++; arr[j] = st[i]; i++; j++; } else if(st[i]==' '){ arr[j] = ' '; i++; j++; while(st[i] == ' '){ i++; } } else if(st[i]=='\0'){ arr[j] = '\0'; break; } else { puts("ERROR: Incorrect data, try again."); wrongData=1; break; } if(wrongData==0){ if(charCounter>30){ puts("ERROR: Incorrect data, try again."); } } } puts(st); puts(arr); if(arr[j]==' '){ word++; } while(arr[j]!=' ' && letter<32){ strcpy(mat[word],arr); } if(arr[j]=='\0'){ mat[word][letter]=arr[j]; } puts(mat[word]); }
0debug
How to write a program that check validity of the password : <p>''' How to write a Python program to check the validity of password input by users. Allow a user 3 attempts, on the 4th one exit the program(Google is your friend :)).</p> <pre><code>Validation : •At least 1 letter between [a-z] and ta least one letter between [A-Z]. •At least 1 number between [0-9]. •At least 1 character from [$#@]. •Minimum length 6 characters. •Maximum length 16 characters. </code></pre> <p>'''</p>
0debug
Adding a hyperlink VBA : <p>I am desperately searching for a solution for my following problem in VBA for Excel: </p> <p>I want to request user input asking for entering a website link. The code should transfrom this into a hyperlink (like excel does with the HYPERLINK formula). The output should add the word <em>website</em> to the ActiveCell with a hyperlink to the input website. </p> <p>this is my latest approach: </p> <blockquote> <pre><code>Sub add_hyperlink() link = Chr(34) &amp; InputBox("Enter link") &amp; Chr(34) ActiveSheet.Hyperlinks.Add anchor:=ActiveCell, Address:=link, ScreenTip:="Follow this link", TextToDisplay:="website" End Sub </code></pre> </blockquote> <p>Thanks for your help!</p>
0debug
static void omap_disc_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_dss_s *s = (struct omap_dss_s *) opaque; if (size != 4) { omap_badwidth_write32(opaque, addr, value); return; } switch (addr) { case 0x010: if (value & 2) omap_dss_reset(s); s->dispc.idlemode = value & 0x301b; break; case 0x018: s->dispc.irqst &= ~value; omap_dispc_interrupt_update(s); break; case 0x01c: s->dispc.irqen = value & 0xffff; omap_dispc_interrupt_update(s); break; case 0x040: s->dispc.control = value & 0x07ff9fff; s->dig.enable = (value >> 1) & 1; s->lcd.enable = (value >> 0) & 1; if (value & (1 << 12)) if (!((s->dispc.l[1].attr | s->dispc.l[2].attr) & 1)) { fprintf(stderr, "%s: Overlay Optimization when no overlay " "region effectively exists leads to " "unpredictable behaviour!\n", __func__); } if (value & (1 << 6)) { } if (value & (1 << 5)) { } s->dispc.invalidate = 1; break; case 0x044: s->dispc.config = value & 0x3fff; s->dispc.invalidate = 1; break; case 0x048: s->dispc.capable = value & 0x3ff; break; case 0x04c: s->dispc.bg[0] = value & 0xffffff; s->dispc.invalidate = 1; break; case 0x050: s->dispc.bg[1] = value & 0xffffff; s->dispc.invalidate = 1; break; case 0x054: s->dispc.trans[0] = value & 0xffffff; s->dispc.invalidate = 1; break; case 0x058: s->dispc.trans[1] = value & 0xffffff; s->dispc.invalidate = 1; break; case 0x060: s->dispc.line = value & 0x7ff; break; case 0x064: s->dispc.timing[0] = value & 0x0ff0ff3f; break; case 0x068: s->dispc.timing[1] = value & 0x0ff0ff3f; break; case 0x06c: s->dispc.timing[2] = value & 0x0003ffff; break; case 0x070: s->dispc.timing[3] = value & 0x00ff00ff; break; case 0x078: s->dig.nx = ((value >> 0) & 0x7ff) + 1; s->dig.ny = ((value >> 16) & 0x7ff) + 1; s->dispc.invalidate = 1; break; case 0x07c: s->lcd.nx = ((value >> 0) & 0x7ff) + 1; s->lcd.ny = ((value >> 16) & 0x7ff) + 1; s->dispc.invalidate = 1; break; case 0x080: s->dispc.l[0].addr[0] = (hwaddr) value; s->dispc.invalidate = 1; break; case 0x084: s->dispc.l[0].addr[1] = (hwaddr) value; s->dispc.invalidate = 1; break; case 0x088: s->dispc.l[0].posx = ((value >> 0) & 0x7ff); s->dispc.l[0].posy = ((value >> 16) & 0x7ff); s->dispc.invalidate = 1; break; case 0x08c: s->dispc.l[0].nx = ((value >> 0) & 0x7ff) + 1; s->dispc.l[0].ny = ((value >> 16) & 0x7ff) + 1; s->dispc.invalidate = 1; break; case 0x0a0: s->dispc.l[0].attr = value & 0x7ff; if (value & (3 << 9)) fprintf(stderr, "%s: Big-endian pixel format not supported\n", __FUNCTION__); s->dispc.l[0].enable = value & 1; s->dispc.l[0].bpp = (value >> 1) & 0xf; s->dispc.invalidate = 1; break; case 0x0a4: s->dispc.l[0].tresh = value & 0x01ff01ff; break; case 0x0ac: s->dispc.l[0].rowinc = value; s->dispc.invalidate = 1; break; case 0x0b0: s->dispc.l[0].colinc = value; s->dispc.invalidate = 1; break; case 0x0b4: s->dispc.l[0].wininc = value; break; case 0x0b8: s->dispc.l[0].addr[2] = (hwaddr) value; s->dispc.invalidate = 1; break; case 0x0bc: case 0x0c0: case 0x0c4: case 0x0c8: case 0x0cc: case 0x0d0: case 0x0d8: case 0x0dc: case 0x0e0: case 0x0e4: case 0x0e8: case 0x0ec: case 0x0f0 ... 0x140: case 0x14c: case 0x150: case 0x154: case 0x158: case 0x15c: case 0x160: case 0x168: case 0x16c: case 0x170: case 0x174: case 0x178: case 0x17c: case 0x180 ... 0x1d0: case 0x1d4: case 0x1d8: case 0x1dc: break; default: OMAP_BAD_REG(addr); } }
1threat
C# Multi-dimensional arrays lengt : <p>I have an array:</p> <pre><code> string[,] array = new string[5, 24]; </code></pre> <p>I want to get the length/size of the first array = "5".</p>
0debug
void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert) { sd->readonly_cb = readonly; sd->inserted_cb = insert; qemu_set_irq(readonly, bdrv_is_read_only(sd->bdrv)); qemu_set_irq(insert, bdrv_is_inserted(sd->bdrv)); }
1threat
Visual Studio offline installation remove old versions : <p>Is there a possibility to remove the old versions of installation packages from the layout folder of Visual Studio 2017 offline installation? This folder needs a lot of memory on my HDD.</p>
0debug
how can i set value in a select with angularJS : i want set a option from a select getting id, and all others objects to a directive and show it. Let me explain: I'm trying edit a object "dynamically" Here is my obj structure [ { nome: "name", //phone company codigo: "id", //that isn't sequential (14, 16, 29...) categoria: "category", //cellphone or landline preco: "price" //float digits } ] "Contato" is my contact object, structure: [ { nome:"name", telefone:"1233-1233", data:"2016-06-25T22:03:21.508Z", operadora: { nome:"name", codigo:"(code)", -> int categoria:"category", preco:"(price)" -> float }, serial:"<H_ZZ<ET9B" -> randomic ASCII generated } ] Price is decorative, all things don't make sense, just for "learning" Then i call directive: <ui-accordions> <ui-accordion ng-repeat="contato in contatos | filter:{nome: criterioBusca} | orderBy:criterioDeOrdenacao:direcaoOrdenacao" username= contato.nome serial= contato.serial telefone= contato.telefone data = contato.data operadora = contato.operadora operadoras=operadoras > </ui-accordion> </ui-accordions> //orderBy:criterioDeOrdenacao: direcaoOrdenacao -> orderBy: orderCritery: orderDirection //filter:{nome: criterioBusca} -> name: searchCritery I use directive "uiAccordions" because can open one accordion each I use directive "uiAccordion" to get params and show with external Url (html file) My select in html external file (directive use that) <select class="form-control" ng-model="contatoOperadoras" ng-options="operadoraTemp.nome + ' (' + (operadoraTemp.preco | currency) +')' for operadoraTemp in operadoras | orderBy:'nome'"> <option value=""></option> <!-- This is who i want select --> </select> I put that gay in uiAccordion call (look ui declaration) operadora = contato.operadora This give me actual operadora object (phone company) of this contato (contact/user) All this is just learning but i can't solve that. I think if i create other param index and pass in the option tag (value), but how? I want show like that <option value=(selected "codigo">(selected {{operadora.nome}})</option> Sorry for a not grammatical english, but here on my country english is the last language encouraged by authorities (like in high school, like that), i'm learning by myself. Any doubt about code/grammatical, ask =) Thanks guys. []'s Best regards, Luan
0debug
OPENVPN route local net to remote server : <p>I have configured a openvpn connection from my debian pc to my remote debian server, and it works. In fact, I can ping 10.0.0.1 (address in vpn of the server).</p> <p>Now I want to share this connection. I want my other clients on lan can access the server without openvpn client. How can I do it?</p> <p>My lan standard address are 192.168.2.x. How can I set the 192.168.2.123 address to connect directly to remote server?</p>
0debug
Make mongoose string schema type default value as blank and make the field optional : <p>I have a test schema with mongoose in nodejs like</p> <pre><code>testschema = mongoose.Schema({ name:{ type:String, required:true, unique:true }, image:{ type:String, required:true }, category:{ type:String }, }); </code></pre> <p>How can i make the category field as optional and make it default to blank if not given by user? </p> <p>I tried </p> <pre><code> category:{ type:String, optional: '' }, </code></pre> <p>but when printing out the documents saved with the scheme it doesnt even shows the field category.</p>
0debug
static av_cold int vaapi_encode_h265_init_internal(AVCodecContext *avctx) { static const VAConfigAttrib default_config_attributes[] = { { .type = VAConfigAttribRTFormat, .value = VA_RT_FORMAT_YUV420 }, { .type = VAConfigAttribEncPackedHeaders, .value = (VA_ENC_PACKED_HEADER_SEQUENCE | VA_ENC_PACKED_HEADER_SLICE) }, }; VAAPIEncodeContext *ctx = avctx->priv_data; VAAPIEncodeH265Context *priv = ctx->priv_data; int i, err; switch (avctx->profile) { case FF_PROFILE_HEVC_MAIN: case FF_PROFILE_UNKNOWN: ctx->va_profile = VAProfileHEVCMain; break; case FF_PROFILE_HEVC_MAIN_10: av_log(avctx, AV_LOG_ERROR, "H.265 main 10-bit profile " "is not supported.\n"); return AVERROR_PATCHWELCOME; default: av_log(avctx, AV_LOG_ERROR, "Unknown H.265 profile %d.\n", avctx->profile); return AVERROR(EINVAL); } ctx->va_entrypoint = VAEntrypointEncSlice; ctx->input_width = avctx->width; ctx->input_height = avctx->height; ctx->aligned_width = FFALIGN(ctx->input_width, 16); ctx->aligned_height = FFALIGN(ctx->input_height, 16); priv->ctu_width = FFALIGN(ctx->aligned_width, 32) / 32; priv->ctu_height = FFALIGN(ctx->aligned_height, 32) / 32; av_log(avctx, AV_LOG_VERBOSE, "Input %ux%u -> Aligned %ux%u -> CTU %ux%u.\n", ctx->input_width, ctx->input_height, ctx->aligned_width, ctx->aligned_height, priv->ctu_width, priv->ctu_height); for (i = 0; i < FF_ARRAY_ELEMS(default_config_attributes); i++) { ctx->config_attributes[ctx->nb_config_attributes++] = default_config_attributes[i]; } if (avctx->bit_rate > 0) { ctx->va_rc_mode = VA_RC_CBR; err = vaapi_encode_h265_init_constant_bitrate(avctx); } else { ctx->va_rc_mode = VA_RC_CQP; err = vaapi_encode_h265_init_fixed_qp(avctx); } if (err < 0) return err; ctx->config_attributes[ctx->nb_config_attributes++] = (VAConfigAttrib) { .type = VAConfigAttribRateControl, .value = ctx->va_rc_mode, }; ctx->nb_recon_frames = 20; return 0; }
1threat
Ubuntu 16.04 LTS freezing after suspend : <p>I just installed ubuntu 16.04 LTS on my dell inspiron 7000 series, I know that there are some compatibility issues with some of the newer drivers (I already had to fix a bug with my graphics driver). Ubuntu runs just fine, but when I suspend it or close the lid of my laptop, I cannot get it to start up again. I either get a black screen, or a frozen login screen an I have to do a hard shutdown and restart to get it to work again.</p> <p>After some research I found that it could be something wrong with the kernel, (I was running 4.10, but I tried running it on version 4.6 and got the same result). Any suggestions would be appreciated, thanks</p> <p>System specs</p> <p>1 tb HDD, intel i7- 7th gen quad core, nvidia gtx 1050ti with DDR4, 16gb ram 2400 mHz</p>
0debug
How to pass style props for a specific component in react-native : <p>I tried creating a button with specific styles for its . I had more than 3 properties like justifyContent, alignItems, backgroundColor and height. I wanted to pass a style from another component to this, so that the backgroundColor property of the button changes.</p> <p>My Code:</p> <pre><code>import React from 'react'; import { Text, TouchableOpacity } from 'react-native'; const Button = ({ buttonName, csCode }) =&gt; { const { buttonStyle, textStyle } = styles; return ( &lt;TouchableOpacity style={{ buttonStyle, backgroundColor: [csCode] }}&gt; &lt;Text style={textStyle}&gt; {buttonName} &lt;/Text&gt; &lt;/TouchableOpacity&gt; ); }; const styles = { textStyle: { alignSelf: 'center', color: '#ffffff', fontSize: 35, fontWeight: '600', }, buttonStyle: { justifyContent: 'center', alignSelf: 'stretch', height: '20%', } }; export { Button }; </code></pre> <p>Here, the buttonStyle is not applied to the buttons, instead only the backgroundColor prop is only being applied. Any help ?</p> <p>Thanks.</p>
0debug
Swift Tuple Not a Collection? : In Swift, why isn't a tuple considered a collection type? Of course this is fussbudget territory, but I find a certain amount of fussing helps me understand, retain, and organize what I'm learning. Thanks.
0debug
How to terminate Scanf() if input entered after whitespace is invalid one in C? : <p>Suppose I have to enter 3 inputs separated by space. Let it be "3 4 5". now if user inputs "3 10 5" and as only single digit is accepted as a constraint </p> <p>I want to make scanf() terminate after 10 when space is entered. </p> <p>Please help. </p>
0debug
int iommu_dma_memory_set(DMAContext *dma, dma_addr_t addr, uint8_t c, dma_addr_t len) { target_phys_addr_t paddr, plen; int err; #ifdef DEBUG_IOMMU fprintf(stderr, "dma_memory_set context=%p addr=0x" DMA_ADDR_FMT " len=0x" DMA_ADDR_FMT "\n", dma, addr, len); #endif while (len) { err = dma->translate(dma, addr, &paddr, &plen, DMA_DIRECTION_FROM_DEVICE); if (err) { return err; } if (plen > len) { plen = len; } do_dma_memory_set(dma->as, paddr, c, plen); len -= plen; addr += plen; } return 0; }
1threat
How can I rotate a Container widget in 2D around a specified anchor point? : <p>I'd like to perform a very simple 2D rotation of a Container widget (that contains a handful of other widgets.) This widget would be rotated around a single fixed point in the center, with no deformations. </p> <p>I tried using the <code>transform</code> property with <code>Matrix4.rotationZ</code>, which somewhat works – but the anchor point is in the <strong>top-left</strong> corner, not in the <strong>center</strong>. Is there an easy way to specify that anchor point? </p> <p>Furthermore, is there an easier way to 2D-rotate this widget that doesn't require Matrix4?</p> <p><a href="https://i.stack.imgur.com/yDwVK.png"><img src="https://i.stack.imgur.com/yDwVK.png" alt="desired and actual transformations"></a></p> <pre><code>var container = new Container ( child: new Stack ( children: [ new Image.asset ( // background photo "assets/texture.jpg", fit: ImageFit.cover, ), new Center ( child: new Container ( child: new Text ( "Lorem ipsum", style: new TextStyle( color: Colors.white, fontSize: 42.0, fontWeight: FontWeight.w900 ) ), decoration: new BoxDecoration ( backgroundColor: Colors.black, ), padding: new EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 16.0), transform: new Matrix4.rotationZ(0.174533), // rotate -10 deg ), ), ], ), width: 400.0, height: 200.0, ); </code></pre>
0debug
JFrame scaling in Java 9 : <p>Exactly the same code running under Java 9u4 on the left and 8u144 on the right on Windows 7.</p> <p><a href="https://i.stack.imgur.com/ddwTE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ddwTE.png" alt="different window sizes"></a></p> <p>Java 9 seems to making the window larger. What is causing this - JEP 263? How can I disable it?</p> <pre><code>public class SimpleFrame { public static void main(String[] args) { JFrame frame = new JFrame(); frame.getContentPane().add(new JLabel("Horse")); frame.setSize(new Dimension(200, 100)); frame.setVisible(true); } } </code></pre>
0debug
Convert Jquery code into pure javascript code : <p>I have a following Jquery code and I need to convert it into pure javascript code. Can any one please help me to convert it to javascript code</p> <pre><code>$( "#buttonOne" ).on('click', function() { $('#divOne').hide(); }); </code></pre> <p>Thanks in advance</p>
0debug
static void yuv2yuvX_c(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, int dstW, int chrDstW) { int i; for (i=0; i<dstW; i++) { int val=1<<18; int j; for (j=0; j<lumFilterSize; j++) val += lumSrc[j][i] * lumFilter[j]; dest[i]= av_clip_uint8(val>>19); } if (uDest) for (i=0; i<chrDstW; i++) { int u=1<<18; int v=1<<18; int j; for (j=0; j<chrFilterSize; j++) { u += chrUSrc[j][i] * chrFilter[j]; v += chrVSrc[j][i] * chrFilter[j]; } uDest[i]= av_clip_uint8(u>>19); vDest[i]= av_clip_uint8(v>>19); } if (CONFIG_SWSCALE_ALPHA && aDest) for (i=0; i<dstW; i++) { int val=1<<18; int j; for (j=0; j<lumFilterSize; j++) val += alpSrc[j][i] * lumFilter[j]; aDest[i]= av_clip_uint8(val>>19); } }
1threat
Hi Everyone I dont know how to write syntaq sql.. : I dont know how to write syntaq sql.. for example SELECT username FROM login WHERE username='select usr from employee where status='Activ'; those are bad/error. how to write well ?
0debug
android google map current location not getting : <p>i am working on a google map activity. i am trying to get the current location.it works perfectly on emulator but not getting the current location on my phone. here is the code which i am using in my application...</p> <pre><code>locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); provider = locationManager.getBestProvider(criteria, false); Location location = locationManager.getLastKnownLocation(provider); if (location != null) { double lat = (double) (location.getLatitude()); double lng = (double) (location.getLongitude()); Constants.lat = String.valueOf(lat); Constants.lng = String.valueOf(lng); } </code></pre> <p>Constants is the class where i have decalred the latitude and longitude static variables declared. This code is written in a function and it is call from onCreate method.I am getting null location everytime.I have declare below code also in manifestfile.</p> <pre><code> &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; </code></pre> <p>Can anybody please help me ? Thanks . </p>
0debug
Initializing a struct outside of main() using malloc (C89) : <p>I'm trying to implement a doubly linked list in C and I need to use an initialize function, while maintaining a size field. My code is as follows:</p> <pre><code>typedef struct element{ struct element* next; struct element* prev; int value; }element_t; typedef struct linkedlist{ element_t* head; element_t* tail; int size; }linkedlist; void init(linkedlist* list){ list = malloc(sizeof(linkedlist)); list-&gt;size = 0; } int main(int argc, char** argv){ linkedlist* list; init(list); return 0; </code></pre> <p>When I'm trying to access list->size in the init function, I get the correct value, But when I try to access list->size from main the program returns a strange, large negative value (probably an address in hex).</p> <p>Would like to know what I'm doing wrong. stdlib is included.</p>
0debug
Greatest value from an array of numbers (Ruby) : <p>I am currently learning Ruby and for the sake of my life I cannot find a solution to this:</p> <p>Return the greatest value from an array of numbers.</p> <p>Input: [5, 17, -4, 20, 12] Output: 20</p> <p>Can anyone help me out with this and explain why they used their solution?</p> <p>thank you.</p>
0debug
Downloading canvas image using toBlob : <p>I am attempting to download a large canvas image (several thousand pixels height and width) on the click of a button using <code>toBlob</code> in the following code, which doesn't seem to work:</p> <pre><code>document.getElementById("download_button").onclick = function() { var link = document.createElement("a"); link.download = "image.png"; canvas.toBlob(function(blob){ link.href = URL.createObjectURL(blob); console.log(blob); },'image/png'); console.log(link.href); link.click(); } </code></pre> <p><code>console.log(blob)</code> in the callback function returns: <code>Blob {size: 64452, type: "image/png"}</code></p> <p>But <code>console.log(link.href)</code> returns nothing. </p> <p>Am I not using <code>.createObjectURL</code> correctly?</p> <p>I used to work with <code>toDataURL</code>, but it stopped working above a certain canvas size. And this post <a href="https://stackoverflow.com/questions/35480112/canvas-todataurl-download-size-limit">canvas.toDataURL() download size limit</a> suggested to try <code>toBlob</code>.</p>
0debug
Json object to Parquet format using Java without converting to AVRO(Without using Spark, Hive, Pig,Impala) : <p>I have a scenario where to convert the messages present as Json object to Apache Parquet format using Java. Any sample code or examples would be helpful. As far as what I have found to convert the messages to Parquet either Hive, Pig, Spark are being used. I need to convert to Parquet without involving these only by Java.</p>
0debug
static int pred_weight_table(H264Context *h) { int list, i; int luma_def, chroma_def; h->use_weight = 0; h->use_weight_chroma = 0; h->luma_log2_weight_denom = get_ue_golomb(&h->gb); if (h->sps.chroma_format_idc) h->chroma_log2_weight_denom = get_ue_golomb(&h->gb); luma_def = 1 << h->luma_log2_weight_denom; chroma_def = 1 << h->chroma_log2_weight_denom; for (list = 0; list < 2; list++) { h->luma_weight_flag[list] = 0; h->chroma_weight_flag[list] = 0; for (i = 0; i < h->ref_count[list]; i++) { int luma_weight_flag, chroma_weight_flag; luma_weight_flag = get_bits1(&h->gb); if (luma_weight_flag) { h->luma_weight[i][list][0] = get_se_golomb(&h->gb); h->luma_weight[i][list][1] = get_se_golomb(&h->gb); if (h->luma_weight[i][list][0] != luma_def || h->luma_weight[i][list][1] != 0) { h->use_weight = 1; h->luma_weight_flag[list] = 1; } } else { h->luma_weight[i][list][0] = luma_def; h->luma_weight[i][list][1] = 0; } if (h->sps.chroma_format_idc) { chroma_weight_flag = get_bits1(&h->gb); if (chroma_weight_flag) { int j; for (j = 0; j < 2; j++) { h->chroma_weight[i][list][j][0] = get_se_golomb(&h->gb); h->chroma_weight[i][list][j][1] = get_se_golomb(&h->gb); if (h->chroma_weight[i][list][j][0] != chroma_def || h->chroma_weight[i][list][j][1] != 0) { h->use_weight_chroma = 1; h->chroma_weight_flag[list] = 1; } } } else { int j; for (j = 0; j < 2; j++) { h->chroma_weight[i][list][j][0] = chroma_def; h->chroma_weight[i][list][j][1] = 0; } } } } if (h->slice_type_nos != AV_PICTURE_TYPE_B) break; } h->use_weight = h->use_weight || h->use_weight_chroma; return 0; }
1threat
static int allocate_buffers(ShortenContext *s) { int i, chan, err; for (chan = 0; chan < s->channels; chan++) { if (FFMAX(1, s->nmean) >= UINT_MAX / sizeof(int32_t)) { av_log(s->avctx, AV_LOG_ERROR, "nmean too large\n"); return AVERROR_INVALIDDATA; } if (s->blocksize + s->nwrap >= UINT_MAX / sizeof(int32_t) || s->blocksize + s->nwrap <= (unsigned)s->nwrap) { av_log(s->avctx, AV_LOG_ERROR, "s->blocksize + s->nwrap too large\n"); return AVERROR_INVALIDDATA; } if ((err = av_reallocp_array(&s->offset[chan], sizeof(int32_t), FFMAX(1, s->nmean))) < 0) return err; if ((err = av_reallocp_array(&s->decoded_base[chan], (s->blocksize + s->nwrap), sizeof(s->decoded_base[0][0]))) < 0) return err; for (i = 0; i < s->nwrap; i++) s->decoded_base[chan][i] = 0; s->decoded[chan] = s->decoded_base[chan] + s->nwrap; } if ((err = av_reallocp_array(&s->coeffs, s->nwrap, sizeof(*s->coeffs))) < 0) return err; return 0; }
1threat
av_cold void dsputil_init(DSPContext* c, AVCodecContext *avctx) { int i; ff_check_alignment(); #if CONFIG_ENCODERS if (avctx->bits_per_raw_sample == 10) { c->fdct = ff_jpeg_fdct_islow_10; c->fdct248 = ff_fdct248_islow_10; } else { if(avctx->dct_algo==FF_DCT_FASTINT) { c->fdct = fdct_ifast; c->fdct248 = fdct_ifast248; } else if(avctx->dct_algo==FF_DCT_FAAN) { c->fdct = ff_faandct; c->fdct248 = ff_faandct248; } else { c->fdct = ff_jpeg_fdct_islow_8; c->fdct248 = ff_fdct248_islow_8; } } #endif if(avctx->lowres==1){ c->idct_put= ff_jref_idct4_put; c->idct_add= ff_jref_idct4_add; c->idct = j_rev_dct4; c->idct_permutation_type= FF_NO_IDCT_PERM; }else if(avctx->lowres==2){ c->idct_put= ff_jref_idct2_put; c->idct_add= ff_jref_idct2_add; c->idct = j_rev_dct2; c->idct_permutation_type= FF_NO_IDCT_PERM; }else if(avctx->lowres==3){ c->idct_put= ff_jref_idct1_put; c->idct_add= ff_jref_idct1_add; c->idct = j_rev_dct1; c->idct_permutation_type= FF_NO_IDCT_PERM; }else{ if (avctx->bits_per_raw_sample == 10) { c->idct_put = ff_simple_idct_put_10; c->idct_add = ff_simple_idct_add_10; c->idct = ff_simple_idct_10; c->idct_permutation_type = FF_NO_IDCT_PERM; } else { if(avctx->idct_algo==FF_IDCT_INT){ c->idct_put= ff_jref_idct_put; c->idct_add= ff_jref_idct_add; c->idct = j_rev_dct; c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM; }else if((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER || CONFIG_VP6_DECODER ) && avctx->idct_algo==FF_IDCT_VP3){ c->idct_put= ff_vp3_idct_put_c; c->idct_add= ff_vp3_idct_add_c; c->idct = ff_vp3_idct_c; c->idct_permutation_type= FF_NO_IDCT_PERM; }else if(avctx->idct_algo==FF_IDCT_WMV2){ c->idct_put= ff_wmv2_idct_put_c; c->idct_add= ff_wmv2_idct_add_c; c->idct = ff_wmv2_idct_c; c->idct_permutation_type= FF_NO_IDCT_PERM; }else if(avctx->idct_algo==FF_IDCT_FAAN){ c->idct_put= ff_faanidct_put; c->idct_add= ff_faanidct_add; c->idct = ff_faanidct; c->idct_permutation_type= FF_NO_IDCT_PERM; }else if(CONFIG_EATGQ_DECODER && avctx->idct_algo==FF_IDCT_EA) { c->idct_put= ff_ea_idct_put_c; c->idct_permutation_type= FF_NO_IDCT_PERM; }else{ c->idct_put = ff_simple_idct_put_8; c->idct_add = ff_simple_idct_add_8; c->idct = ff_simple_idct_8; c->idct_permutation_type= FF_NO_IDCT_PERM; } } } c->diff_pixels = diff_pixels_c; c->put_pixels_clamped = ff_put_pixels_clamped_c; c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_c; c->add_pixels_clamped = ff_add_pixels_clamped_c; c->sum_abs_dctelem = sum_abs_dctelem_c; c->gmc1 = gmc1_c; c->gmc = ff_gmc_c; c->pix_sum = pix_sum_c; c->pix_norm1 = pix_norm1_c; c->fill_block_tab[0] = fill_block16_c; c->fill_block_tab[1] = fill_block8_c; c->pix_abs[0][0] = pix_abs16_c; c->pix_abs[0][1] = pix_abs16_x2_c; c->pix_abs[0][2] = pix_abs16_y2_c; c->pix_abs[0][3] = pix_abs16_xy2_c; c->pix_abs[1][0] = pix_abs8_c; c->pix_abs[1][1] = pix_abs8_x2_c; c->pix_abs[1][2] = pix_abs8_y2_c; c->pix_abs[1][3] = pix_abs8_xy2_c; c->put_tpel_pixels_tab[ 0] = put_tpel_pixels_mc00_c; c->put_tpel_pixels_tab[ 1] = put_tpel_pixels_mc10_c; c->put_tpel_pixels_tab[ 2] = put_tpel_pixels_mc20_c; c->put_tpel_pixels_tab[ 4] = put_tpel_pixels_mc01_c; c->put_tpel_pixels_tab[ 5] = put_tpel_pixels_mc11_c; c->put_tpel_pixels_tab[ 6] = put_tpel_pixels_mc21_c; c->put_tpel_pixels_tab[ 8] = put_tpel_pixels_mc02_c; c->put_tpel_pixels_tab[ 9] = put_tpel_pixels_mc12_c; c->put_tpel_pixels_tab[10] = put_tpel_pixels_mc22_c; c->avg_tpel_pixels_tab[ 0] = avg_tpel_pixels_mc00_c; c->avg_tpel_pixels_tab[ 1] = avg_tpel_pixels_mc10_c; c->avg_tpel_pixels_tab[ 2] = avg_tpel_pixels_mc20_c; c->avg_tpel_pixels_tab[ 4] = avg_tpel_pixels_mc01_c; c->avg_tpel_pixels_tab[ 5] = avg_tpel_pixels_mc11_c; c->avg_tpel_pixels_tab[ 6] = avg_tpel_pixels_mc21_c; c->avg_tpel_pixels_tab[ 8] = avg_tpel_pixels_mc02_c; c->avg_tpel_pixels_tab[ 9] = avg_tpel_pixels_mc12_c; c->avg_tpel_pixels_tab[10] = avg_tpel_pixels_mc22_c; #define dspfunc(PFX, IDX, NUM) \ c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_c; \ c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_c; \ c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_c; \ c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_c; \ c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_c; \ c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_c; \ c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_c; \ c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_c; \ c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_c; \ c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_c; \ c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_c; \ c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_c; \ c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_c; \ c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_c; \ c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_c; \ c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_c dspfunc(put_qpel, 0, 16); dspfunc(put_no_rnd_qpel, 0, 16); dspfunc(avg_qpel, 0, 16); dspfunc(put_qpel, 1, 8); dspfunc(put_no_rnd_qpel, 1, 8); dspfunc(avg_qpel, 1, 8); #undef dspfunc #if CONFIG_MLP_DECODER || CONFIG_TRUEHD_DECODER ff_mlp_init(c, avctx); #endif #if CONFIG_WMV2_DECODER || CONFIG_VC1_DECODER ff_intrax8dsp_init(c,avctx); #endif c->put_mspel_pixels_tab[0]= ff_put_pixels8x8_c; c->put_mspel_pixels_tab[1]= put_mspel8_mc10_c; c->put_mspel_pixels_tab[2]= put_mspel8_mc20_c; c->put_mspel_pixels_tab[3]= put_mspel8_mc30_c; c->put_mspel_pixels_tab[4]= put_mspel8_mc02_c; c->put_mspel_pixels_tab[5]= put_mspel8_mc12_c; c->put_mspel_pixels_tab[6]= put_mspel8_mc22_c; c->put_mspel_pixels_tab[7]= put_mspel8_mc32_c; #define SET_CMP_FUNC(name) \ c->name[0]= name ## 16_c;\ c->name[1]= name ## 8x8_c; SET_CMP_FUNC(hadamard8_diff) c->hadamard8_diff[4]= hadamard8_intra16_c; c->hadamard8_diff[5]= hadamard8_intra8x8_c; SET_CMP_FUNC(dct_sad) SET_CMP_FUNC(dct_max) #if CONFIG_GPL SET_CMP_FUNC(dct264_sad) #endif c->sad[0]= pix_abs16_c; c->sad[1]= pix_abs8_c; c->sse[0]= sse16_c; c->sse[1]= sse8_c; c->sse[2]= sse4_c; SET_CMP_FUNC(quant_psnr) SET_CMP_FUNC(rd) SET_CMP_FUNC(bit) c->vsad[0]= vsad16_c; c->vsad[4]= vsad_intra16_c; c->vsad[5]= vsad_intra8_c; c->vsse[0]= vsse16_c; c->vsse[4]= vsse_intra16_c; c->vsse[5]= vsse_intra8_c; c->nsse[0]= nsse16_c; c->nsse[1]= nsse8_c; #if CONFIG_DWT ff_dsputil_init_dwt(c); #endif c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c; c->add_bytes= add_bytes_c; c->diff_bytes= diff_bytes_c; c->add_hfyu_median_prediction= add_hfyu_median_prediction_c; c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c; c->add_hfyu_left_prediction = add_hfyu_left_prediction_c; c->add_hfyu_left_prediction_bgr32 = add_hfyu_left_prediction_bgr32_c; c->bswap_buf= bswap_buf; c->bswap16_buf = bswap16_buf; if (CONFIG_H263_DECODER || CONFIG_H263_ENCODER) { c->h263_h_loop_filter= h263_h_loop_filter_c; c->h263_v_loop_filter= h263_v_loop_filter_c; } if (CONFIG_VP3_DECODER) { c->vp3_h_loop_filter= ff_vp3_h_loop_filter_c; c->vp3_v_loop_filter= ff_vp3_v_loop_filter_c; c->vp3_idct_dc_add= ff_vp3_idct_dc_add_c; } c->h261_loop_filter= h261_loop_filter_c; c->try_8x8basis= try_8x8basis_c; c->add_8x8basis= add_8x8basis_c; #if CONFIG_VORBIS_DECODER c->vorbis_inverse_coupling = vorbis_inverse_coupling; #endif #if CONFIG_AC3_DECODER c->ac3_downmix = ff_ac3_downmix_c; #endif c->vector_fmul = vector_fmul_c; c->vector_fmul_reverse = vector_fmul_reverse_c; c->vector_fmul_add = vector_fmul_add_c; c->vector_fmul_window = vector_fmul_window_c; c->vector_clipf = vector_clipf_c; c->scalarproduct_int16 = scalarproduct_int16_c; c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c; c->apply_window_int16 = apply_window_int16_c; c->vector_clip_int32 = vector_clip_int32_c; c->scalarproduct_float = scalarproduct_float_c; c->butterflies_float = butterflies_float_c; c->butterflies_float_interleave = butterflies_float_interleave_c; c->vector_fmul_scalar = vector_fmul_scalar_c; c->vector_fmac_scalar = vector_fmac_scalar_c; c->shrink[0]= av_image_copy_plane; c->shrink[1]= ff_shrink22; c->shrink[2]= ff_shrink44; c->shrink[3]= ff_shrink88; c->prefetch= just_return; memset(c->put_2tap_qpel_pixels_tab, 0, sizeof(c->put_2tap_qpel_pixels_tab)); memset(c->avg_2tap_qpel_pixels_tab, 0, sizeof(c->avg_2tap_qpel_pixels_tab)); #undef FUNC #undef FUNCC #define FUNC(f, depth) f ## _ ## depth #define FUNCC(f, depth) f ## _ ## depth ## _c #define dspfunc1(PFX, IDX, NUM, depth)\ c->PFX ## _pixels_tab[IDX][0] = FUNCC(PFX ## _pixels ## NUM , depth);\ c->PFX ## _pixels_tab[IDX][1] = FUNCC(PFX ## _pixels ## NUM ## _x2 , depth);\ c->PFX ## _pixels_tab[IDX][2] = FUNCC(PFX ## _pixels ## NUM ## _y2 , depth);\ c->PFX ## _pixels_tab[IDX][3] = FUNCC(PFX ## _pixels ## NUM ## _xy2, depth) #define dspfunc2(PFX, IDX, NUM, depth)\ c->PFX ## _pixels_tab[IDX][ 0] = FUNCC(PFX ## NUM ## _mc00, depth);\ c->PFX ## _pixels_tab[IDX][ 1] = FUNCC(PFX ## NUM ## _mc10, depth);\ c->PFX ## _pixels_tab[IDX][ 2] = FUNCC(PFX ## NUM ## _mc20, depth);\ c->PFX ## _pixels_tab[IDX][ 3] = FUNCC(PFX ## NUM ## _mc30, depth);\ c->PFX ## _pixels_tab[IDX][ 4] = FUNCC(PFX ## NUM ## _mc01, depth);\ c->PFX ## _pixels_tab[IDX][ 5] = FUNCC(PFX ## NUM ## _mc11, depth);\ c->PFX ## _pixels_tab[IDX][ 6] = FUNCC(PFX ## NUM ## _mc21, depth);\ c->PFX ## _pixels_tab[IDX][ 7] = FUNCC(PFX ## NUM ## _mc31, depth);\ c->PFX ## _pixels_tab[IDX][ 8] = FUNCC(PFX ## NUM ## _mc02, depth);\ c->PFX ## _pixels_tab[IDX][ 9] = FUNCC(PFX ## NUM ## _mc12, depth);\ c->PFX ## _pixels_tab[IDX][10] = FUNCC(PFX ## NUM ## _mc22, depth);\ c->PFX ## _pixels_tab[IDX][11] = FUNCC(PFX ## NUM ## _mc32, depth);\ c->PFX ## _pixels_tab[IDX][12] = FUNCC(PFX ## NUM ## _mc03, depth);\ c->PFX ## _pixels_tab[IDX][13] = FUNCC(PFX ## NUM ## _mc13, depth);\ c->PFX ## _pixels_tab[IDX][14] = FUNCC(PFX ## NUM ## _mc23, depth);\ c->PFX ## _pixels_tab[IDX][15] = FUNCC(PFX ## NUM ## _mc33, depth) #define BIT_DEPTH_FUNCS(depth, dct)\ c->get_pixels = FUNCC(get_pixels ## dct , depth);\ c->draw_edges = FUNCC(draw_edges , depth);\ c->emulated_edge_mc = FUNC (ff_emulated_edge_mc , depth);\ c->clear_block = FUNCC(clear_block ## dct , depth);\ c->clear_blocks = FUNCC(clear_blocks ## dct , depth);\ c->add_pixels8 = FUNCC(add_pixels8 ## dct , depth);\ c->add_pixels4 = FUNCC(add_pixels4 ## dct , depth);\ c->put_no_rnd_pixels_l2[0] = FUNCC(put_no_rnd_pixels16_l2, depth);\ c->put_no_rnd_pixels_l2[1] = FUNCC(put_no_rnd_pixels8_l2 , depth);\ \ c->put_h264_chroma_pixels_tab[0] = FUNCC(put_h264_chroma_mc8 , depth);\ c->put_h264_chroma_pixels_tab[1] = FUNCC(put_h264_chroma_mc4 , depth);\ c->put_h264_chroma_pixels_tab[2] = FUNCC(put_h264_chroma_mc2 , depth);\ c->avg_h264_chroma_pixels_tab[0] = FUNCC(avg_h264_chroma_mc8 , depth);\ c->avg_h264_chroma_pixels_tab[1] = FUNCC(avg_h264_chroma_mc4 , depth);\ c->avg_h264_chroma_pixels_tab[2] = FUNCC(avg_h264_chroma_mc2 , depth);\ \ dspfunc1(put , 0, 16, depth);\ dspfunc1(put , 1, 8, depth);\ dspfunc1(put , 2, 4, depth);\ dspfunc1(put , 3, 2, depth);\ dspfunc1(put_no_rnd, 0, 16, depth);\ dspfunc1(put_no_rnd, 1, 8, depth);\ dspfunc1(avg , 0, 16, depth);\ dspfunc1(avg , 1, 8, depth);\ dspfunc1(avg , 2, 4, depth);\ dspfunc1(avg , 3, 2, depth);\ dspfunc1(avg_no_rnd, 0, 16, depth);\ dspfunc1(avg_no_rnd, 1, 8, depth);\ \ dspfunc2(put_h264_qpel, 0, 16, depth);\ dspfunc2(put_h264_qpel, 1, 8, depth);\ dspfunc2(put_h264_qpel, 2, 4, depth);\ dspfunc2(put_h264_qpel, 3, 2, depth);\ dspfunc2(avg_h264_qpel, 0, 16, depth);\ dspfunc2(avg_h264_qpel, 1, 8, depth);\ dspfunc2(avg_h264_qpel, 2, 4, depth); switch (avctx->bits_per_raw_sample) { case 9: if (c->dct_bits == 32) { BIT_DEPTH_FUNCS(9, _32); } else { BIT_DEPTH_FUNCS(9, _16); } break; case 10: if (c->dct_bits == 32) { BIT_DEPTH_FUNCS(10, _32); } else { BIT_DEPTH_FUNCS(10, _16); } break; default: av_log(avctx, AV_LOG_DEBUG, "Unsupported bit depth: %d\n", avctx->bits_per_raw_sample); case 8: BIT_DEPTH_FUNCS(8, _16); break; } if (HAVE_MMX) dsputil_init_mmx (c, avctx); if (ARCH_ARM) dsputil_init_arm (c, avctx); if (CONFIG_MLIB) dsputil_init_mlib (c, avctx); if (HAVE_VIS) dsputil_init_vis (c, avctx); if (ARCH_ALPHA) dsputil_init_alpha (c, avctx); if (ARCH_PPC) dsputil_init_ppc (c, avctx); if (HAVE_MMI) dsputil_init_mmi (c, avctx); if (ARCH_SH4) dsputil_init_sh4 (c, avctx); if (ARCH_BFIN) dsputil_init_bfin (c, avctx); for(i=0; i<64; i++){ if(!c->put_2tap_qpel_pixels_tab[0][i]) c->put_2tap_qpel_pixels_tab[0][i]= c->put_h264_qpel_pixels_tab[0][i]; if(!c->avg_2tap_qpel_pixels_tab[0][i]) c->avg_2tap_qpel_pixels_tab[0][i]= c->avg_h264_qpel_pixels_tab[0][i]; } ff_init_scantable_permutation(c->idct_permutation, c->idct_permutation_type); }
1threat
Why does Apple's documentation only show the properties and method signatures but not the actual code? : <p>I'm exploring Apple's documentation and would like to understand how classes such as UIApplication do what they do under the hood however if you command click "UIApplication", Xcode only shows UIApplication's properties and method signatures but not the actual code inside the methods. I figured this would be valuable information to know if we could see what's going on inside of Apple's provided classes but why isn't it available for us to know or see? </p> <p>For example, here is what's shown if you command click UIApplication: </p> <pre><code>public class UIApplication : UIResponder { public class func sharedApplication() -&gt; UIApplication unowned(unsafe) public var delegate: UIApplicationDelegate? public func beginIgnoringInteractionEvents() // nested. set should be set during animations &amp; transitions to ignore touch and other events public func endIgnoringInteractionEvents() public func isIgnoringInteractionEvents() -&gt; Bool // returns YES if we are at least one deep in ignoring events public var idleTimerDisabled: Bool // default is NO public func openURL(url: NSURL) -&gt; Bool @available(iOS 3.0, *) public func canOpenURL(url: NSURL) -&gt; Bool public func sendEvent(event: UIEvent) public var keyWindow: UIWindow? { get } public var windows: [UIWindow] { get } public func sendAction(action: Selector, to target: AnyObject?, from sender: AnyObject?, forEvent event: UIEvent?) -&gt; Bool public var networkActivityIndicatorVisible: Bool // showing network spinning gear in status bar. default is NO // default is UIStatusBarStyleDefault // The system only calls this method if the application delegate has not // implemented the delegate equivalent. It returns the orientations specified by // the application's info.plist. If no supported interface orientations were // specified it will return UIInterfaceOrientationMaskAll on an iPad and // UIInterfaceOrientationMaskAllButUpsideDown on a phone. The return value // should be one of the UIInterfaceOrientationMask values which indicates the // orientations supported by this application. @available(iOS 6.0, *) public func supportedInterfaceOrientationsForWindow(window: UIWindow?) -&gt; UIInterfaceOrientationMask public var statusBarOrientationAnimationDuration: NSTimeInterval { get } // Returns the animation duration for the status bar during a 90 degree orientation change. It should be doubled for a 180 degree orientation change. public var statusBarFrame: CGRect { get } // returns CGRectZero if the status bar is hidden public var applicationIconBadgeNumber: Int // set to 0 to hide. default is 0. In iOS 8.0 and later, your application must register for user notifications using -[UIApplication registerUserNotificationSettings:] before being able to set the icon badge. @available(iOS 3.0, *) public var applicationSupportsShakeToEdit: Bool @available(iOS 4.0, *) public var applicationState: UIApplicationState { get } @available(iOS 4.0, *) public var backgroundTimeRemaining: NSTimeInterval { get } @available(iOS 4.0, *) public func beginBackgroundTaskWithExpirationHandler(handler: (() -&gt; Void)?) -&gt; UIBackgroundTaskIdentifier @available(iOS 7.0, *) public func beginBackgroundTaskWithName(taskName: String?, expirationHandler handler: (() -&gt; Void)?) -&gt; UIBackgroundTaskIdentifier @available(iOS 4.0, *) public func endBackgroundTask(identifier: UIBackgroundTaskIdentifier) /*! The system guarantees that it will not wake up your application for a background fetch more frequently than the interval provided. Set to UIApplicationBackgroundFetchIntervalMinimum to be woken as frequently as the system desires, or to UIApplicationBackgroundFetchIntervalNever (the default) to never be woken for a background fetch. This setter will have no effect unless your application has the "fetch" UIBackgroundMode. See the UIApplicationDelegate method `application:performFetchWithCompletionHandler:` for more. */ @available(iOS 7.0, *) public func setMinimumBackgroundFetchInterval(minimumBackgroundFetchInterval: NSTimeInterval) /*! When background refresh is available for an application, it may launched or resumed in the background to handle significant location changes, remote notifications, background fetches, etc. Observe UIApplicationBackgroundRefreshStatusDidChangeNotification to be notified of changes. */ @available(iOS 7.0, *) public var backgroundRefreshStatus: UIBackgroundRefreshStatus { get } @available(iOS 4.0, *) public var protectedDataAvailable: Bool { get } @available(iOS 5.0, *) public var userInterfaceLayoutDirection: UIUserInterfaceLayoutDirection { get } // Return the size category @available(iOS 7.0, *) public var preferredContentSizeCategory: String { get } } </code></pre>
0debug
permutation in perl script : Hi i am working on a script in perl i have seen codes for permutation but my problem is i have an array with values say @array =(john, cena , barrack, obama, donald, trump) value at index 0 is first name and at 1 is last name at 2 is first name again and at 3 is last name and so on. so it should be like john cena barrack obama donald trump i need permutation for this combination barrack obama donald trump john cena donald trump john cena barrack obama like this how this can be done!!
0debug
Swift: Convenience initializers - Self used before self.init call : <p>We are getting the following error on the convenience method below:</p> <blockquote> <p>Self used before self.init call</p> </blockquote> <pre><code>class MyClass { var id : Int var desc : String init?(id : Int, desc : String) { self.id = id self.desc = desc } convenience init?(id : Int?) { guard let x = id else { return } self.init(id : x, desc : "Blah") } } </code></pre> <p>How can we implement this type of behavior in Swift?</p>
0debug
Find missing elements in an ordered array consists of number sequences (Ruby) : In an ordered array, how to find the missing elements in an ordered array? with a condition that the missing elements have to be one of the existing element (represent by `v`) + 1 or v - 1. The smallest element is 0. e.g. [0, 1, 2, 4, 5, 6, 9, 10, 12, 13, 17] returns [3, 7, 8, 11, 14, 16, 18]
0debug
overloading methods in python class : <p>I tried to add numpy arrays in method overloading but got error like TypeError: add() missing 1 required positional argument: 'n3'</p> <pre><code>import numpy as np class addition: def add(self,n1,n2): return n1+n2 def add(self,n1,n2,n3): return n1+n2+n3 s=np.array([[1,2,3],[3,4,4]]) s1=np.array([[1.0,2,3],[3,4,4]]) s3=np.array([[1.0,2.4,3.7],[3,4,4]]) c=addition() print(c.add(1,2)) </code></pre>
0debug
when I use pygame to load an picture,but an error has occured : it's my code: my_ship = pygame.image.load('images\ship.bmp') I use pycharm6 and python3.6,l'm a beginner in python,hope someone can help me.
0debug
static void pc_i440fx_2_4_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_i440fx_2_5_machine_options(m); m->alias = NULL; m->is_default = 0; pcmc->broken_reserved_end = true; pcmc->inter_dimm_gap = false; SET_MACHINE_COMPAT(m, PC_COMPAT_2_4); }
1threat
static int64_t calculate_mode_score(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, strip_info *info) { int x; int entry_size = s->pix_fmt == AV_PIX_FMT_YUV420P ? 6 : 4; int mb_count = s->w * h / MB_AREA; mb_info *mb; int64_t score1, score2, score3; int64_t ret = s->lambda * ((v1_size ? CHUNK_HEADER_SIZE + v1_size * entry_size : 0) + (v4_size ? CHUNK_HEADER_SIZE + v4_size * entry_size : 0) + CHUNK_HEADER_SIZE) << 3; switch(mode) { case MODE_V1_ONLY: ret += s->lambda * 8 * mb_count; for(x = 0; x < mb_count; x++) { mb = &s->mb[x]; ret += FF_LAMBDA_SCALE * mb->v1_error; mb->best_encoding = ENC_V1; } break; case MODE_V1_V4: for(x = 0; x < mb_count; x++) { mb = &s->mb[x]; score1 = s->lambda * 9 + FF_LAMBDA_SCALE * mb->v1_error; score2 = s->lambda * 33 + FF_LAMBDA_SCALE * mb->v4_error[v4]; if(score1 <= score2) { ret += score1; mb->best_encoding = ENC_V1; } else { ret += score2; mb->best_encoding = ENC_V4; } } break; case MODE_MC: for(x = 0; x < mb_count; x++) { mb = &s->mb[x]; score1 = s->lambda * 1 + FF_LAMBDA_SCALE * mb->skip_error; score2 = s->lambda * 10 + FF_LAMBDA_SCALE * mb->v1_error; score3 = s->lambda * 34 + FF_LAMBDA_SCALE * mb->v4_error[v4]; if(score1 <= score2 && score1 <= score3) { ret += score1; mb->best_encoding = ENC_SKIP; } else if(score2 <= score1 && score2 <= score3) { ret += score2; mb->best_encoding = ENC_V1; } else { ret += score3; mb->best_encoding = ENC_V4; } } break; } return ret; }
1threat
Why does k8s secrets need to be base64 encoded when configmaps does not? : <p>Why does k8s secrets need to be base64 encoded when configmaps does not?</p> <p>When creating a configmap you simply do somthing like this:</p> <pre><code>apiVersion: v1 kind: ConfigMap metadata: name: my-configmap data: SOME_KEY: a string value </code></pre> <p>But when you want to create a secret you have to <code>echo -n "some secret string" | base64</code> and then put the result of that in a file looking something like this:</p> <pre><code>apiVersion: v1 kind: Secret metadata: name: my-secret type: Opaque data: SOME_KEY: c29tZSBzZWNyZXQgc3RyaW5n </code></pre> <p>I really wonder why there is this difference? Are kubernetes secrets simply base64 encoded strings? I would expect that secrets were stored encrypted in kubernetes. </p>
0debug
c++11 std::unique_ptr error cmake 3.11.3 bootstrap : <p>I am trying to bootstrap cmake 3.11.3 on Ubuntu 16.04.4 LTS xenial.</p> <p>I have upgrade my gnu g++ compiler as follows:</p> <pre><code>&gt; $ g++ --version g++ (Ubuntu 8.1.0-5ubuntu1~16.04) 8.1.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. </code></pre> <p>And manually re-pointed the symbolic links:</p> <pre><code>$ ll /usr/bin/*g++* lrwxrwxrwx 1 root root 5 Jun 8 16:57 /usr/bin/g++ -&gt; g++-8* -rwxr-xr-x 1 root root 919832 Apr 24 15:02 /usr/bin/g++-5* lrwxrwxrwx 1 root root 22 Jun 6 04:26 /usr/bin/g++-8 -&gt; x86_64-linux-gnu-g++-8* lrwxrwxrwx 1 root root 22 Jun 8 16:58 /usr/bin/x86_64-linux-gnu-g++ -&gt; x86_64-linux-gnu-g++-8* lrwxrwxrwx 1 root root 5 Apr 24 15:02 /usr/bin/x86_64-linux-gnu-g++-5 -&gt; g++-5* -rwxr-xr-x 1 root root 1071984 Jun 6 04:26 /usr/bin/x86_64-linux-gnu-g++-8* </code></pre> <p>However, I get the following error in the configuration of cmake:</p> <pre><code>$ sudo ./bootstrap --------------------------------------------- CMake 3.11.3, Copyright 2000-2018 Kitware, Inc. and Contributors Found GNU toolchain C compiler on this system is: gcc C++ compiler on this system is: g++ Makefile processor on this system is: make g++ has setenv g++ has unsetenv g++ does not have environ in stdlib.h g++ has stl wstring g++ has &lt;ext/stdio_filebuf.h&gt; --------------------------------------------- make: Warning: File 'Makefile' has modification time 2.3 s in the future make: 'cmake' is up to date. make: warning: Clock skew detected. Your build may be incomplete. loading initial cache file /mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/Bootstrap.cmk/InitialCacheFlags.cmake CMake Error at CMakeLists.txt:92 (message): The C++ compiler does not support C++11 (e.g. std::unique_ptr). -- Configuring incomplete, errors occurred! See also "/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeOutput.log". See also "/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeError.log". --------------------------------------------- Error when bootstrapping CMake: Problem while running initial CMake --------------------------------------------- </code></pre> <p>Any idea why I get a c++11 <code>std::unique_ptr</code> non-compliant error?</p>
0debug
static av_cold int theora_decode_init(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; int ptype; const uint8_t *header_start[3]; int header_len[3]; int i; avctx->pix_fmt = AV_PIX_FMT_YUV420P; s->theora = 1; if (!avctx->extradata_size) { av_log(avctx, AV_LOG_ERROR, "Missing extradata!\n"); return -1; } if (avpriv_split_xiph_headers(avctx->extradata, avctx->extradata_size, 42, header_start, header_len) < 0) { av_log(avctx, AV_LOG_ERROR, "Corrupt extradata\n"); return -1; } for (i = 0; i < 3; i++) { if (header_len[i] <= 0) continue; init_get_bits8(&gb, header_start[i], header_len[i]); ptype = get_bits(&gb, 8); if (!(ptype & 0x80)) { av_log(avctx, AV_LOG_ERROR, "Invalid extradata!\n"); } skip_bits_long(&gb, 6 * 8); switch (ptype) { case 0x80: if (theora_decode_header(avctx, &gb) < 0) return -1; break; case 0x81: break; case 0x82: if (theora_decode_tables(avctx, &gb)) return -1; break; default: av_log(avctx, AV_LOG_ERROR, "Unknown Theora config packet: %d\n", ptype & ~0x80); break; } if (ptype != 0x81 && 8 * header_len[i] != get_bits_count(&gb)) av_log(avctx, AV_LOG_WARNING, "%d bits left in packet %X\n", 8 * header_len[i] - get_bits_count(&gb), ptype); if (s->theora < 0x030200) break; } return vp3_decode_init(avctx); }
1threat
i want to know efficient sorting method in nx2 array in c++ : For example, if an array is stored like this ex) input 0 1 2 3 4 5 6 7 8 9 7 5 3 9 1 2 4 8 6 0 i want to print the idx of the second array in order of magnitude ex) output 3 , 7 , 0 , 8 , 1 , 6 , 2 , 5 , 4 , 9 What is an efficient way to do this?
0debug
OpenGLRenderer: Davey : <p>I have noticed that from time to time, android shows the following log message:</p> <pre><code>I/OpenGLRenderer( 4958): Davey! duration=1923ms; Flags=1, IntendedVsync=12247... </code></pre> <p>Does anyone know the reason why my OpenGLRenderer is calling <code>Davey!</code>?</p>
0debug
Can we share code between react webapp and react native app and is react-native production ready : <p>We have a stable version of a widget developed with reactjs. We would like to develop mobile version of the same. Is it better to develop with react native and share the code across the 2 apps or is it better we develop the widget natively.</p> <p>Bare in mind that we do have expertise in both(react and android dev) but we do not want to invest to much time on developing the entire app again.</p> <p>Are there any tools/resources available to get this done faster if we choose react-native?</p> <p>Resources available online:</p> <p><a href="http://jkaufman.io/react-web-native-codesharing/" rel="noreferrer">http://jkaufman.io/react-web-native-codesharing/</a></p> <p><a href="https://arielelkin.github.io/articles/why-im-not-a-react-native-developer.html" rel="noreferrer">https://arielelkin.github.io/articles/why-im-not-a-react-native-developer.html</a></p> <p><a href="https://medium.com/@felipecsl/thoughts-on-react-native-from-an-android-engineers-perspective-ea2bea5aa078" rel="noreferrer">https://medium.com/@felipecsl/thoughts-on-react-native-from-an-android-engineers-perspective-ea2bea5aa078</a></p> <p>Cheers!!!</p>
0debug
static int kvm_put_xsave(CPUState *env) { #ifdef KVM_CAP_XSAVE int i; struct kvm_xsave* xsave; uint16_t cwd, swd, twd, fop; if (!kvm_has_xsave()) return kvm_put_fpu(env); xsave = qemu_memalign(4096, sizeof(struct kvm_xsave)); memset(xsave, 0, sizeof(struct kvm_xsave)); cwd = swd = twd = fop = 0; swd = env->fpus & ~(7 << 11); swd |= (env->fpstt & 7) << 11; cwd = env->fpuc; for (i = 0; i < 8; ++i) twd |= (!env->fptags[i]) << i; xsave->region[0] = (uint32_t)(swd << 16) + cwd; xsave->region[1] = (uint32_t)(fop << 16) + twd; memcpy(&xsave->region[XSAVE_ST_SPACE], env->fpregs, sizeof env->fpregs); memcpy(&xsave->region[XSAVE_XMM_SPACE], env->xmm_regs, sizeof env->xmm_regs); xsave->region[XSAVE_MXCSR] = env->mxcsr; *(uint64_t *)&xsave->region[XSAVE_XSTATE_BV] = env->xstate_bv; memcpy(&xsave->region[XSAVE_YMMH_SPACE], env->ymmh_regs, sizeof env->ymmh_regs); return kvm_vcpu_ioctl(env, KVM_SET_XSAVE, xsave); #else return kvm_put_fpu(env); #endif }
1threat
donot know how to implement snmp in python : I am now currently working with snmp. The package I used is pysnmp...but I do not know how to implement snmp in python. The problem is, given an ip address it should give the details of that device using snmp.culd anyone suggest me how to do it?
0debug
document.write('<script src="evil.js"></script>');
1threat
static void vhost_dev_unassign_memory(struct vhost_dev *dev, uint64_t start_addr, uint64_t size) { int from, to, n = dev->mem->nregions; int overlap_start = 0, overlap_end = 0, overlap_middle = 0, split = 0; for (from = 0, to = 0; from < n; ++from, ++to) { struct vhost_memory_region *reg = dev->mem->regions + to; uint64_t reglast; uint64_t memlast; uint64_t change; if (to != from) { memcpy(reg, dev->mem->regions + from, sizeof *reg); } if (!ranges_overlap(reg->guest_phys_addr, reg->memory_size, start_addr, size)) { continue; } assert(!split); reglast = range_get_last(reg->guest_phys_addr, reg->memory_size); memlast = range_get_last(start_addr, size); if (start_addr <= reg->guest_phys_addr && memlast >= reglast) { --dev->mem->nregions; --to; assert(to >= 0); ++overlap_middle; continue; } if (memlast >= reglast) { reg->memory_size = start_addr - reg->guest_phys_addr; assert(reg->memory_size); assert(!overlap_end); ++overlap_end; continue; } if (start_addr <= reg->guest_phys_addr) { change = memlast + 1 - reg->guest_phys_addr; reg->memory_size -= change; reg->guest_phys_addr += change; reg->userspace_addr += change; assert(reg->memory_size); assert(!overlap_start); ++overlap_start; continue; } assert(!overlap_start); assert(!overlap_end); assert(!overlap_middle); memcpy(dev->mem->regions + n, reg, sizeof *reg); reg->memory_size = start_addr - reg->guest_phys_addr; assert(reg->memory_size); change = memlast + 1 - reg->guest_phys_addr; reg = dev->mem->regions + n; reg->memory_size -= change; assert(reg->memory_size); reg->guest_phys_addr += change; reg->userspace_addr += change; assert(dev->mem->nregions == n); ++dev->mem->nregions; ++split; } }
1threat
static void monitor_parse(const char *optarg, const char *mode) { static int monitor_device_index = 0; QemuOpts *opts; const char *p; char label[32]; int def = 0; if (strstart(optarg, "chardev:", &p)) { snprintf(label, sizeof(label), "%s", p); } else { snprintf(label, sizeof(label), "compat_monitor%d", monitor_device_index); if (monitor_device_index == 0) { def = 1; } opts = qemu_chr_parse_compat(label, optarg); if (!opts) { fprintf(stderr, "parse error: %s\n", optarg); exit(1); } } opts = qemu_opts_create(qemu_find_opts("mon"), label, 1); if (!opts) { fprintf(stderr, "duplicate chardev: %s\n", label); exit(1); } qemu_opt_set(opts, "mode", mode); qemu_opt_set(opts, "chardev", label); if (def) qemu_opt_set(opts, "default", "on"); monitor_device_index++; }
1threat
static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) { const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; int alpha = alpha_table[index_a]; int beta = beta_table[qp - qp_bd_offset + h->slice_beta_offset]; if (alpha ==0 || beta == 0) return; if( bS[0] < 4 ) { int8_t tc[4]; tc[0] = tc0_table[index_a][bS[0*bsi]]; tc[1] = tc0_table[index_a][bS[1*bsi]]; tc[2] = tc0_table[index_a][bS[2*bsi]]; tc[3] = tc0_table[index_a][bS[3*bsi]]; h->h264dsp.h264_h_loop_filter_luma_mbaff(pix, stride, alpha, beta, tc); } else { h->h264dsp.h264_h_loop_filter_luma_mbaff_intra(pix, stride, alpha, beta); } }
1threat
what mean two variables written together without any assignments? : Making class for work with stack (code is not mine) I have code like this: class stack { private: int size; int* data; // what next line mean? size_t ptr; public: stack(int valid_stack_size) { this->size = valid_stack_size; this->ptr = 0; this->data = new int[valid_stack_size]; } void push(int value) { if (this->ptr >= (size_t)this->size) cout << "Стек полон" << endl; this->data[this->ptr++] = value; } int pop() { if (this->ptr == 0) cout << "Стек пуст" << endl; return this->data[--this->ptr]; } }; what does size_t ptr mean? size_t takes ptr value? or? Sorry for my bad english
0debug
static uint64_t assigned_dev_ioport_rw(AssignedDevRegion *dev_region, target_phys_addr_t addr, int size, uint64_t *data) { uint64_t val = 0; int fd = dev_region->region->resource_fd; if (fd >= 0) { if (data) { DEBUG("pwrite data=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx ", addr="TARGET_FMT_plx"\n", *data, size, addr, addr); if (pwrite(fd, data, size, addr) != size) { error_report("%s - pwrite failed %s", __func__, strerror(errno)); } } else { if (pread(fd, &val, size, addr) != size) { error_report("%s - pread failed %s", __func__, strerror(errno)); val = (1UL << (size * 8)) - 1; } DEBUG("pread val=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx ", addr=" TARGET_FMT_plx "\n", val, size, addr, addr); } } else { uint32_t port = addr + dev_region->u.r_baseport; if (data) { DEBUG("out data=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx ", host=%x\n", *data, size, addr, port); switch (size) { case 1: outb(*data, port); break; case 2: outw(*data, port); break; case 4: outl(*data, port); break; } } else { switch (size) { case 1: val = inb(port); break; case 2: val = inw(port); break; case 4: val = inl(port); break; } DEBUG("in data=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx ", host=%x\n", val, size, addr, port); } } return val; }
1threat
static int ram_save_target_page(MigrationState *ms, QEMUFile *f, RAMBlock *block, ram_addr_t offset, bool last_stage, uint64_t *bytes_transferred, ram_addr_t dirty_ram_abs) { int res = 0; if (migration_bitmap_clear_dirty(dirty_ram_abs)) { unsigned long *unsentmap; if (compression_switch && migrate_use_compression()) { res = ram_save_compressed_page(f, block, offset, last_stage, bytes_transferred); } else { res = ram_save_page(f, block, offset, last_stage, bytes_transferred); } if (res < 0) { return res; } unsentmap = atomic_rcu_read(&migration_bitmap_rcu)->unsentmap; if (unsentmap) { clear_bit(dirty_ram_abs >> TARGET_PAGE_BITS, unsentmap); } last_sent_block = block; } return res; }
1threat
static void virtio_pci_device_unplugged(DeviceState *d) { VirtIOPCIProxy *proxy = VIRTIO_PCI(d); bool modern = !(proxy->flags & VIRTIO_PCI_FLAG_DISABLE_MODERN); bool modern_pio = proxy->flags & VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY; virtio_pci_stop_ioeventfd(proxy); if (modern) { virtio_pci_modern_mem_region_unmap(proxy, &proxy->common); virtio_pci_modern_mem_region_unmap(proxy, &proxy->isr); virtio_pci_modern_mem_region_unmap(proxy, &proxy->device); virtio_pci_modern_mem_region_unmap(proxy, &proxy->notify); if (modern_pio) { virtio_pci_modern_io_region_unmap(proxy, &proxy->notify_pio); } } }
1threat
static void gen_mtsrin_64b(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); #else TCGv t0; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); return; } t0 = tcg_temp_new(); tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 28); tcg_gen_andi_tl(t0, t0, 0xF); gen_helper_store_sr(cpu_env, t0, cpu_gpr[rS(ctx->opcode)]); tcg_temp_free(t0); #endif }
1threat
static void xilinx_spips_realize(DeviceState *dev, Error **errp) { XilinxSPIPS *s = XILINX_SPIPS(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); XilinxSPIPSClass *xsc = XILINX_SPIPS_GET_CLASS(s); int i; DB_PRINT("realized spips\n"); s->spi = g_new(SSIBus *, s->num_busses); for (i = 0; i < s->num_busses; ++i) { char bus_name[16]; snprintf(bus_name, 16, "spi%d", i); s->spi[i] = ssi_create_bus(dev, bus_name); } s->cs_lines = g_new0(qemu_irq, s->num_cs * s->num_busses); ssi_auto_connect_slaves(DEVICE(s), s->cs_lines, s->spi[0]); ssi_auto_connect_slaves(DEVICE(s), s->cs_lines, s->spi[1]); sysbus_init_irq(sbd, &s->irq); for (i = 0; i < s->num_cs * s->num_busses; ++i) { sysbus_init_irq(sbd, &s->cs_lines[i]); } memory_region_init_io(&s->iomem, &spips_ops, s, "spi", R_MAX*4); sysbus_init_mmio(sbd, &s->iomem); s->irqline = -1; fifo8_create(&s->rx_fifo, xsc->rx_fifo_size); fifo8_create(&s->tx_fifo, xsc->tx_fifo_size); }
1threat