problem
stringlengths
26
131k
labels
class label
2 classes
static int vc9_decode_init(AVCodecContext *avctx) { VC9Context *v = avctx->priv_data; GetBitContext gb; if (!avctx->extradata_size || !avctx->extradata) return -1; avctx->pix_fmt = PIX_FMT_YUV420P; v->avctx = avctx; if (init_common(v) < 0) return -1; if (avctx->codec_id == CODEC_ID_WMV3) { int count = 0; init_get_bits(&gb, avctx->extradata, avctx->extradata_size); decode_sequence_header(avctx, &gb); count = avctx->extradata_size*8 - get_bits_count(&gb); if (count>0) { av_log(avctx, AV_LOG_INFO, "Extra data: %i bits left, value: %X\n", count, get_bits(&gb, count)); } else { av_log(avctx, AV_LOG_INFO, "Read %i bits in overflow\n", -count); } } v->width_mb = (avctx->coded_width+15)>>4; v->height_mb = (avctx->coded_height+15)>>4; v->mv_type_mb_plane = (uint8_t *)av_malloc(v->width_mb*v->height_mb); if (!v->mv_type_mb_plane) return -1; v->skip_mb_plane = (uint8_t *)av_malloc(v->width_mb*v->height_mb); if (!v->skip_mb_plane) return -1; v->direct_mb_plane = (uint8_t *)av_malloc(v->width_mb*v->height_mb); if (!v->direct_mb_plane) return -1; #if HAS_ADVANCED_PROFILE if (v->profile > PROFILE_MAIN) { v->over_flags_plane = (uint8_t *)av_malloc(v->width_mb*v->height_mb); if (!v->over_flags_plane) return -1; v->ac_pred_plane = (uint8_t *)av_malloc(v->width_mb*v->height_mb); if (!v->ac_pred_plane) return -1; } #endif return 0; }
1threat
Isn't there a way to jump between conflicts in VSCode? : <p>Despite my googling, I can't find a keyboard shortcut (or any shortcut) to jump to the next conflict when you're in viewing a file in <em>conflict mode</em> (opening a file marked (C) in the source control panel, where the <code>Accept Current Change | Accept Incoming Change | etc</code> menu is shown).</p> <p><a href="https://i.stack.imgur.com/H3spN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H3spN.png" alt="Conflict mode"></a> Note: This is different than compare mode where adds and dels are marked with red and green and F7 or the arrows works.</p>
0debug
How to generate a unique Long value in Java? : <p>everyone.</p> <p>I have a simple question. Is the value returned by <code>UUID.randomUUID().getMostSignificantBits()</code> ALWAYS unique?</p> <p>I need to generate a Long value which needs to ALWAYS be unique. Is there any other way to generate a Long that accomplishes this?</p> <p>Thanks.</p>
0debug
how to validate a username and password using textFieldDidChange using objective c? : -(void)select { NSString *sql1= [NSString stringWithFormat:@"SELECT * FROM sample"]; sqlite3_stmt *statement; if( sqlite3_prepare_v2(db, [sql1 UTF8String], -1, &statement, NULL) == SQLITE_OK ) { while( sqlite3_step(statement) == SQLITE_ROW ) { char *field1=(char *)sqlite3_column_text(statement,0 ); NSString *field1Str=[[NSString alloc]initWithUTF8String:field1]; NSLog(@"The string value is %@ ",field1Str); char *field2=(char *)sqlite3_column_text(statement,1 ); NSString *field2Str=[[NSString alloc]initWithUTF8String:field2]; NSLog(@"The string value is %@ ",field2Str); [self.usertext1 addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; -(void)textFieldDidChange :(UITextField *)_usertext1{ if([_usertext1.text isEqualToString:field1Str]&&[_passtext2.text isEqualToString:field2Str]) { _outbutton.enabled="YES"; } else { _outbutton.enabled="NO"; } } }} } I am new to iOS programming..I have tried above code for validating username and password while user will type ....I don't no how to use textFieldDidChange and forControlEvents:UIControlEventEditingChanged...I just want to make my login page more secure and efficient...If I type correct values or wrong value the controll goes to next page ....how can I validate plz help me....
0debug
I'm trying to create a table of buttons where the rows have the height of the tallest button and the columns have the width of the widest button : I want to create a table of buttons that when generated with x rows and y columns and user generated button captions - each button in a row is as tall as the tallest one and each button in a column is as wide as it's widest. example - `enter code here` https://jsfiddle.net/vooka/u46j42jr/ I'm curious if there is a solution to this with flex box or if I need to use JS? Thank you
0debug
Printf is not working in AJAX php file? : <p>Hi I want to update some data in my mysql database by using form in html and AJAX technology. I have problem because data is not updated after click on submit and in response message I have not only message but clear mysql ask too! Let's look at my alert: <a href="https://i.stack.imgur.com/gc8od.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gc8od.png" alt="enter image description here"></a></p> <p>My idea is the printf is not really post text into "query" function but this text output is going stright into response data and query is always wrong from empty text...</p> <p>Let's look at my AJAX php file:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php session_start(); error_reporting(0); $imie = $_POST['imie']; $nazwisko = $_POST['nazwisko']; $kodpocztowy = $_POST['kodpocztowy']; $ulica = $_POST['ulica']; $nrdomu = $_POST['nrdomu']; $nrmieszkania = $_POST['nrmieszkania']; $miasto = $_POST['miasto']; try { if (! @include_once('connect.php')) throw new Exception ('connect.php kurwa nie istnieje&lt;/br&gt;'); if (!file_exists('connect.php' )) throw new Exception ('connect.php nie istnieje&lt;/br&gt;'); else require_once('connect.php'); } catch(Exception $e) { echo "Wiadomość: " . $e-&gt;getMessage(); echo "Kod: " . $e-&gt;getCode(); } require_once "connect.php"; $polaczenie = @new mysqli($host, $db_user, $db_password, $db_name); if($rezultat = @$polaczenie-&gt;query(printf("UPDATE adresy SET imie='%s', nazwisko='%s', kodpocztowy='%s', ulica='%s', nrdomu='%s', nrmieszkania='%s', miasto='%s' WHERE id=%s",$imie,$nazwisko,$kodpocztowy,$ulica,$nrdomu,$nrmieszkania,$miasto,$_SESSION['id']))) { $polaczenie-&gt;close(); echo "Good!"; } else { $polaczenie-&gt;close(); echo "Not good!"; } ?&gt;</code></pre> </div> </div> </p> <p>Have you any idea how to solve this problem? Maybe what to use instead printf or echo? Please help, greatings.</p>
0debug
Do C++ developers commonly count on automatic casting? : I've been given the task of porting a Windows program to OS X. Originally written in C++, I'm enjoying it because I don't often work with the C family of languages, and have enjoyed making use of Objective C++ in the port. However, the Windows source code does something strange, and I'm wondering if it's a standard practice. The API we're working with on both Windows and OS X expects a particular object method to be passed an unsigned short. The original Windows developer created the following function to calculate this value: static unsigned short hashcode ( const char* value ) { int h = 0 ; unsigned long length = strlen ( value ) ; for ( int i = 0 ; i < length ; i++ ) { h = ( 31 * h ) + value[i] ; } return h ; } Note that while the function returns an `unsigned short`, the variable it's returning is declared as an `int`. I've checked the documentation, and both OS X and Windows define an `unsigned short` as 2 bytes and an `int` as 4. The value being passed to this function, if the data type isn't taken into account, results in the function returning very large numbers, dozens of digits in some cases. In one case, where I duplicated the algorithm in another language with less strict types, I got a value of `2081357292912430390912`. When I wraped the above function in a command line utility, the same string returned a value of `40576`, I'm guessing because that's the truncated version of the longer value. So I have two questions. First of all, why, if `hashcode` is declared to return an `unsigned short` and it's in fact returning and `int` doesn't the compiler complain? Isn't that what strict data type declarations are for in the first place? To make sure that functions and methods receive and return the data types expected? And second, is this truncation a standard practice? It seems very strange to me, first of all to take advantage of the automatic casting, but also there's no commenting to call out to someone that that's what's happening (and I don't have access to the original developer to ask). Since it isn't commented as being something "special," perhaps it's simply a standard idiom in C/C++?
0debug
Parsing complex json object in PHP : <p>i have this scenario of having a mixed response from a server and i need to process its data in PHP</p> <pre><code>Array ( [14424174] =&gt; Array ( [0] =&gt; Array ( [id] =&gt; 45 [nm] =&gt; This is a driver name [ph] =&gt; 5454545 ) ) ) </code></pre> <p>I want to access id, nm, ph values </p> <p>but i had no luck cause this index number (14424174) is unknown to me, so i need to first store this index and then parse the array </p>
0debug
How i can get items of local scope in nested list? : So i am try to find consecutive and i wrote a script : a = [1, 1, 1, 2, 3, 2,2,2, 1, 2, 3, 4, 1, 1, 1,5,5,5] new_list_1=[] new_list_2=[] def hello(x): for j,i in enumerate(x): try: if x[j] == x[j + 1] or x[j]==x[j-1]: new_list_1.append((i, j)) else: new_list_2.append((i, j)) except IndexError: if x[j]==x[j-1]: new_list_1.append((i, j)) print(hello(a)) print(new_list_1) its returning : [(1, 0), (1, 1), (1, 2), (2, 5), (2, 6), (2, 7), (1, 12), (1, 13), (1, 14), (5, 15), (5, 16), (5, 17)] But i want something like this: expected output: [[(1, 0), (1, 1), (1, 2)], [(2, 5), (2, 6), (2, 7)], [(1, 12), (1, 13), (1, 14)], [(5, 15), (5, 16), (5, 17)]] I don't want to use any external module like itertools chain or groupby , How can i achieve this ?
0debug
What is the regex to get strings with one or more word characters except strings with digit only characters? : <p>What is the regex to get strings with one or more word characters except strings with digit only characters? For example, "word", "word1" match the regex but "1" doesn't. Thanks!</p>
0debug
Why do we need object Serialization in C++? : <p>Do we always need to serialize the object in c++ if we want to persist that object or to transfer over network, or in special cases only.</p> <p>For instance if I have an object of the class </p> <pre><code>class Test { int a; char b; float c; }; </code></pre> <p>i.e. it contains only primitive types do I need to serialize it?</p>
0debug
(Python3) Is there a way to str1 -= str2? : I know -= operation doesn't work in str. But is there a function that works the same? The reason why I need this is because def function(self, str_source): str_source = str_source[:-1] # removing last character of the string str_source += self.other_function() # adding other characters return True in this sort of function, when I do s = s[:-1], the original string does not change. I know why it does not change, and I know I can just return another modified string, but I am currently working on someone else's codes that I can't complete rip off the Project. So is it possible to remove the substring of a string in a function?
0debug
How to build string with Bullet format : <p>I am trying to display string as </p> <blockquote> <pre><code>. string1 . string2 . string3 </code></pre> </blockquote> <p>By using Append function of Jquery how to build string with bullet format.</p>
0debug
Getting an error - 'java: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown' : <p>import java.util.<em>; import java.io.</em>;</p> <p>public class Main { public static void main(String args[]){</p> <pre><code> int total = 0; File file = new File("expenditure.txt"); Scanner fileScanner = new Scanner(file); while (fileScanner.hasNextLine()) { total += fileScanner.nextInt(); } fileScanner.close(); System.out.println("The total expenditure is " + total); } </code></pre> <p>}</p>
0debug
how stringbuffer delete works in java : In java the stringbuffer funtion will work like this str="hello" like it is specified the str.delete(1,3) I wanted to know how it works, like how it takes the position
0debug
static void cpu_unlink_tb(CPUState *env) { #if defined(CONFIG_USE_NPTL) #else TranslationBlock *tb; static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED; tb = env->current_tb; if (tb && !testandset(&interrupt_lock)) { env->current_tb = NULL; tb_reset_jump_recursive(tb); resetlock(&interrupt_lock); } #endif }
1threat
Python: how to find to consecutive positive negative values in an array? : I have the following array: X array([ 3.5, -3, 5.4, 3.7, 14.9, -7.8, -3.5, 2.1]) For each values of `X` I know its recording time `T`. I want to find the indexes between two consecutive positive-negative or viceversa. Concluding I would like an array like Y = array([ T(1)-T(0), T(2)-T(1), T(5)-T(4), T(7)-T(6)])
0debug
Attempted to call an undefined method named "newInstance" of class "Swift_Message" : <p>Since a few days I can't send email anymore using Symfony and Swiftmailer, though I'm using the code from the documentation </p> <pre><code>private function _sendResetPasswordEmail(UserInterface $user) { $subject = $this-&gt;get('translator')-&gt;trans('email-title-reset-password'); $message = \Swift_Message::newInstance() -&gt;setSubject($subject) -&gt;setFrom('contact@example.com') -&gt;setTo($user-&gt;getEmail()) -&gt;setBody( $this-&gt;renderView( 'reset-password-email.html.twig', ['user' =&gt; $user] ), 'text/html' ) ; $this-&gt;get('mailer')-&gt;send($message); } </code></pre> <p>and it used to work</p> <p>and now I can see in the logs</p> <pre><code>"Attempted to call an undefined method named "newInstance" of class "Swift_Message" </code></pre> <p>what could have changed ?</p>
0debug
Recursion not executing properly : Below is the snippet of my code please note: n=22 m=7 array = 0000110000111101000101 checker[] = false public static boolean ultra(int step) { System.out.println(step); if(step>n) { System.out.println("success1"); win=true; return true; } else if (step+m>n-1) { System.out.println("success2"); win=true; return true; } else if(step<0) { return false; } else { try { if(array[step+m]==0 && checker[step+m]==false) { System.out.println("jump"); checker[step+m]=true; return ultra(step+m); } System.out.println("print "+step); if(array[step+1]==0 && checker[step+1]==false) { System.out.println("forward"); checker[step+1]=true; return ultra(step+1); } if(array[step-1]==0 && checker[step-1]==false) { System.out.println("backward"); checker[step+-1]=true; return ultra(step-1); } else { System.out.println("defeat"); return false; } } catch(Exception e) { System.out.println(e.toString()); return false; } } } When I call ultra(0), I get following output: "0" "jump" "7" "jump" "14" "print 14" "defeat" So basically, recursion is not going into the second if condition. It doesn't even print "print + step" for the first level. Hope it makes sense.
0debug
Django saving json value to database/model : <p>Im new to django and im trying to save <strong>json to database</strong>. The problem is that im able to get data the data in my views but not sure <strong>how to save it in database</strong>. Im trying to save the <strong>comments</strong></p> <p>models.py</p> <pre><code>class Post(models.Model): title=models.CharField(max_length=200) description=models.TextField(max_length=10000) pub_date=models.DateTimeField(auto_now_add=True) slug = models.SlugField(max_length=40, unique=True) def __unicode__(self): return self.title class Comment(models.Model): title=models.ForeignKey(Post) comments=models.CharField(max_length=200) def __unicode__(self): return '%s' % (self.title) </code></pre> <p>serializer.py</p> <pre><code>class CommentSerializer(serializers.ModelSerializer): id = serializers.CharField(source="title.id", read_only=True) title = serializers.CharField(source="title.title", read_only=True) class Meta: model = Comment fields = ('id','title','comments') class PostSerializer(serializers.ModelSerializer): class Meta: model = Post fields = ('id','title','description','pub_date') </code></pre> <p>Please help me saving the data from views to database</p> <p>view.py</p> <pre><code>def add_comments(request): if 'application/x-www-form-urlencoded' in request.META['CONTENT_TYPE']: print 'hi' data = json.loads(request.body) comment = data.get('comment', None) id = data.get('id', None) title = data.get('title', None) ....................# not sure how to save to database pass </code></pre> <p>Thanks in advance........Please let me know if there is any better way to do it...</p>
0debug
Swift 3 custom touch motion to trigger action : <p>Im just wondering if there is guide for swift to perform a custom touch motion. Example : draw a free hand circle in the screen and it will unlock the phone/trigger any action.</p> <p>I tried search for the solution but it doesn't guide me to the path i want. Thanks for your links sharing and suggestions.</p>
0debug
int bdrv_in_use(BlockDriverState *bs) { return bs->in_use; }
1threat
How to stuff any number of values in 8-10 bytes of data for n number of 16 bit values? : <p>I am working on algorithm where i can have any number of 16 bit values(For instance i have 1000 16 bit values , and all are sensor data, so no particular series or repetition). I want to stuff all of this data into an 8 or a 10 byte array(each and every value of the 1000 16 bits numbers should be inside the 10 byte array) . The information should be such that i can also easily decode to read each and every value from the 1000 values. I have thought of using sin function by dividing the values by 100 so every data point would always be in 8 bits(0-1 sin value range) , but that only covers up small range of data and not huge number of values. Pardon me if i am asking for too much. I am just curious if its possible or not.</p>
0debug
The program directly executes catch(Runtime error) : [The app executes only the RuntimeException catch][1] [1]: http://i.stack.imgur.com/OWd8P.png
0debug
deep copy arraylist in java : Is this way of overriding `clone` correct? I am getting a runtime error every time. Also can anybody suggest a way to write copy constructor in this class. public class Pair { final StringBuffer x; final StringBuffer y; public Pair(StringBuffer x, StringBuffer y) { this.x = x; this.y = y; } public StringBuffer getX(){ return x; } public StringBuffer getY(){ return y; } public Pair clone(){ Pair p = new Pair(new StringBuffer(), new StringBuffer()); try{ p = (Pair)super.clone(); } catch (CloneNotSupportedException e) { throw new Error(); } return p; } }
0debug
static int vmdk_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum) { BDRVVmdkState *s = bs->opaque; int index_in_cluster, n; uint64_t cluster_offset; cluster_offset = get_cluster_offset(bs, sector_num << 9, 0); index_in_cluster = sector_num % s->cluster_sectors; n = s->cluster_sectors - index_in_cluster; if (n > nb_sectors) n = nb_sectors; *pnum = n; return (cluster_offset != 0); }
1threat
How to remove repetition in output results in this code. : public class ValidInvalidNodes { public static void main(String[] args) { int[][] arr = { { 5, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 5, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 5, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 5, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, -1, 0, 0 }, { 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0 }, { 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, -1, 1, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 1, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, -1, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, -1, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, -1, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, -1, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, -1 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, -1 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, -1 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5 }, }; int position = 0; for (int i = 0; i < arr.length; i++) { for (int j = 0; j < arr[i].length; j++) { if (arr[i][j] == 1) { position = j; if (arr[position][j] == 5) System.out.print(" Valid Static Node V" + j + " \n"); } if (arr[i][j] == -1) { position = j; if (arr[position][j] == 5) System.out.print(" InValid Static Node V" + j + " \n"); } if (arr[i][j] == -1) { position = j; if (arr[position][j] == 55) System.out.print(" InValid Mobile Node V" + j + " \n"); } if (arr[i][j] == 1) { position = j; if (arr[position][j] == 55) System.out.print(" Valid Mobile Node V" + j + " \n"); } } } // System.out.println(""); } } Output: Valid Static Node V1 Valid Static Node V2 Valid Static Node V3 Valid Static Node V4 InValid Static Node V5 InValid Static Node V6 Valid Static Node V7 Valid Static Node V8 Valid Static Node V9 Valid Mobile Node V10 InValid Static Node V11 InValid Mobile Node V12 InValid Static Node V16 InValid Static Node V16 InValid Static Node V13 InValid Static Node V13 Valid Static Node V14 Valid Static Node V14 Valid Static Node V14 Valid Static Node V14 InValid Static Node V15 InValid Static Node V15 InValid Static Node V16 InValid Static Node V17 InValid Static Node V18 InValid Static Node V18 InValid Static Node V18
0debug
Change mysql code to PDO : <p>but i have this project for school, i need to make a blog with a database connection. I have one using mysqli but we are only allowed to use PDO, and in don't know how i can convert it in to PDO can someone help me?</p>
0debug
XML to Linq c# retrieve entrys from xml : Hello everyone i'm new in C# and need to to the following task: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Eintrag> <Kunde> <Email> example@test.de </Email> <Kundennummer>1234567 </Kundennummer> </Kunde> <Kunde> <Email> example1@test.de </Email> <Kundennummer>1234569 </Kundennummer> </Kunde> </Eintrag> <!-- end snippet --> I need to save "Email" and "Kundennummer" of each Kunde in a String. Can you please tell me how to do it? Thank you
0debug
create one list from to two colums : in need Help with oracle SQL. i have a table with from to F B B R R D E X X Q and i need the list F B R D E X Q so my problem is the jump from R-->D to E-->X has anybody an idea ?
0debug
Code snippet for comma separated decimal number javascript : <p>How to create comma separated amount value in javascript? For example, if I provide 123000.00 in textbox, the result should be 1,23,000.00</p>
0debug
select card rectangle from captured image ios : I am working in IOS application where I want to select card rectangle from captured image using camera. So if anybody knows any solution please let me know. Thank you.
0debug
The tkinter .get metho d is not working properly : <p>I am trying to make a formula calculator for a school project. I am trying to use the .get tkinter method to get what is in an Entry. It always sends an error. I don't want to write it into a class though.</p> <p>This is not the final code.</p> <pre><code>from tkinter import * def speedCalc(): _distance = spDistance.get() _time = spTime.get() spDistance = Entry(speed).grid(row=1, column=1) spTime = Entry(speed).grid(row=2, column=1) spSpeed = Entry(speed).grid(row=3, column=1) spConvert = Button(speed, text="Calculate", command=speedCalc) spConvert.grid(row=4, column=1) </code></pre> <p>When I execute the code, it says this on the console:</p> <pre><code>Exception in Tkinter callback Traceback (most recent call last): File"C:\Users\JackP\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1699, in __call__ return self.func(*args) File "C:/Users/JackP/Desktop/Python Projets/Formula App/4. Extention.py", line 25, in speedCalc _distance = spDistance.get() AttributeError: 'NoneType' object has no attribute 'get' </code></pre>
0debug
connection.query('SELECT * FROM users WHERE username = ' + input_string)
1threat
What does the following segment do - Pyhon : I have a problem with the following function.. I can't understand what it does, because I'm new to Python, can you help me, please. Thanks in advance. def foo(limit): a = [True] * limit a[0] = a[1] = False for (i,b) in enumerate(a): if b: yield i for n in xrange(i*i,limit,i): a[n] = False
0debug
static void gen_farith (DisasContext *ctx, enum fopcode op1, int ft, int fs, int fd, int cc) { const char *opn = "farith"; const char *condnames[] = { "c.f", "c.un", "c.eq", "c.ueq", "c.olt", "c.ult", "c.ole", "c.ule", "c.sf", "c.ngle", "c.seq", "c.ngl", "c.lt", "c.nge", "c.le", "c.ngt", }; const char *condnames_abs[] = { "cabs.f", "cabs.un", "cabs.eq", "cabs.ueq", "cabs.olt", "cabs.ult", "cabs.ole", "cabs.ule", "cabs.sf", "cabs.ngle", "cabs.seq", "cabs.ngl", "cabs.lt", "cabs.nge", "cabs.le", "cabs.ngt", }; enum { BINOP, CMPOP, OTHEROP } optype = OTHEROP; uint32_t func = ctx->opcode & 0x3f; switch (op1) { case OPC_ADD_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32(fp1, ft); gen_helper_float_add_s(fp0, cpu_env, fp0, fp1); tcg_temp_free_i32(fp1); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "add.s"; optype = BINOP; break; case OPC_SUB_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32(fp1, ft); gen_helper_float_sub_s(fp0, cpu_env, fp0, fp1); tcg_temp_free_i32(fp1); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "sub.s"; optype = BINOP; break; case OPC_MUL_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32(fp1, ft); gen_helper_float_mul_s(fp0, cpu_env, fp0, fp1); tcg_temp_free_i32(fp1); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "mul.s"; optype = BINOP; break; case OPC_DIV_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32(fp1, ft); gen_helper_float_div_s(fp0, cpu_env, fp0, fp1); tcg_temp_free_i32(fp1); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "div.s"; optype = BINOP; break; case OPC_SQRT_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_sqrt_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "sqrt.s"; break; case OPC_ABS_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_abs_s(fp0, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "abs.s"; break; case OPC_MOV_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "mov.s"; break; case OPC_NEG_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_chs_s(fp0, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "neg.s"; break; case OPC_ROUND_L_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr32(fp32, fs); gen_helper_float_roundl_s(fp64, cpu_env, fp32); tcg_temp_free_i32(fp32); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "round.l.s"; break; case OPC_TRUNC_L_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr32(fp32, fs); gen_helper_float_truncl_s(fp64, cpu_env, fp32); tcg_temp_free_i32(fp32); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "trunc.l.s"; break; case OPC_CEIL_L_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr32(fp32, fs); gen_helper_float_ceill_s(fp64, cpu_env, fp32); tcg_temp_free_i32(fp32); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "ceil.l.s"; break; case OPC_FLOOR_L_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr32(fp32, fs); gen_helper_float_floorl_s(fp64, cpu_env, fp32); tcg_temp_free_i32(fp32); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "floor.l.s"; break; case OPC_ROUND_W_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_roundw_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "round.w.s"; break; case OPC_TRUNC_W_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_truncw_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "trunc.w.s"; break; case OPC_CEIL_W_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_ceilw_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "ceil.w.s"; break; case OPC_FLOOR_W_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_floorw_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "floor.w.s"; break; case OPC_MOVCF_S: gen_movcf_s(fs, fd, (ft >> 2) & 0x7, ft & 0x1); opn = "movcf.s"; break; case OPC_MOVZ_S: { int l1 = gen_new_label(); TCGv_i32 fp0; if (ft != 0) { tcg_gen_brcondi_tl(TCG_COND_NE, cpu_gpr[ft], 0, l1); } fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); gen_set_label(l1); } opn = "movz.s"; break; case OPC_MOVN_S: { int l1 = gen_new_label(); TCGv_i32 fp0; if (ft != 0) { tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[ft], 0, l1); fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); gen_set_label(l1); } } opn = "movn.s"; break; case OPC_RECIP_S: check_cop1x(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_recip_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "recip.s"; break; case OPC_RSQRT_S: check_cop1x(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_rsqrt_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "rsqrt.s"; break; case OPC_RECIP2_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32(fp1, ft); gen_helper_float_recip2_s(fp0, cpu_env, fp0, fp1); tcg_temp_free_i32(fp1); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "recip2.s"; break; case OPC_RECIP1_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_recip1_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "recip1.s"; break; case OPC_RSQRT1_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_rsqrt1_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "rsqrt1.s"; break; case OPC_RSQRT2_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32(fp1, ft); gen_helper_float_rsqrt2_s(fp0, cpu_env, fp0, fp1); tcg_temp_free_i32(fp1); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "rsqrt2.s"; break; case OPC_CVT_D_S: check_cp1_registers(ctx, fd); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr32(fp32, fs); gen_helper_float_cvtd_s(fp64, cpu_env, fp32); tcg_temp_free_i32(fp32); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "cvt.d.s"; break; case OPC_CVT_W_S: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_cvtw_s(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "cvt.w.s"; break; case OPC_CVT_L_S: check_cp1_64bitmode(ctx); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr32(fp32, fs); gen_helper_float_cvtl_s(fp64, cpu_env, fp32); tcg_temp_free_i32(fp32); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "cvt.l.s"; break; case OPC_CVT_PS_S: check_cp1_64bitmode(ctx); { TCGv_i64 fp64 = tcg_temp_new_i64(); TCGv_i32 fp32_0 = tcg_temp_new_i32(); TCGv_i32 fp32_1 = tcg_temp_new_i32(); gen_load_fpr32(fp32_0, fs); gen_load_fpr32(fp32_1, ft); tcg_gen_concat_i32_i64(fp64, fp32_1, fp32_0); tcg_temp_free_i32(fp32_1); tcg_temp_free_i32(fp32_0); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "cvt.ps.s"; break; case OPC_CMP_F_S: case OPC_CMP_UN_S: case OPC_CMP_EQ_S: case OPC_CMP_UEQ_S: case OPC_CMP_OLT_S: case OPC_CMP_ULT_S: case OPC_CMP_OLE_S: case OPC_CMP_ULE_S: case OPC_CMP_SF_S: case OPC_CMP_NGLE_S: case OPC_CMP_SEQ_S: case OPC_CMP_NGL_S: case OPC_CMP_LT_S: case OPC_CMP_NGE_S: case OPC_CMP_LE_S: case OPC_CMP_NGT_S: if (ctx->opcode & (1 << 6)) { gen_cmpabs_s(ctx, func-48, ft, fs, cc); opn = condnames_abs[func-48]; } else { gen_cmp_s(ctx, func-48, ft, fs, cc); opn = condnames[func-48]; } break; case OPC_ADD_D: check_cp1_registers(ctx, fs | ft | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_add_d(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "add.d"; optype = BINOP; break; case OPC_SUB_D: check_cp1_registers(ctx, fs | ft | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_sub_d(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "sub.d"; optype = BINOP; break; case OPC_MUL_D: check_cp1_registers(ctx, fs | ft | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_mul_d(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "mul.d"; optype = BINOP; break; case OPC_DIV_D: check_cp1_registers(ctx, fs | ft | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_div_d(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "div.d"; optype = BINOP; break; case OPC_SQRT_D: check_cp1_registers(ctx, fs | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_sqrt_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "sqrt.d"; break; case OPC_ABS_D: check_cp1_registers(ctx, fs | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_abs_d(fp0, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "abs.d"; break; case OPC_MOV_D: check_cp1_registers(ctx, fs | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "mov.d"; break; case OPC_NEG_D: check_cp1_registers(ctx, fs | fd); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_chs_d(fp0, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "neg.d"; break; case OPC_ROUND_L_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_roundl_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "round.l.d"; break; case OPC_TRUNC_L_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_truncl_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "trunc.l.d"; break; case OPC_CEIL_L_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_ceill_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "ceil.l.d"; break; case OPC_FLOOR_L_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_floorl_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "floor.l.d"; break; case OPC_ROUND_W_D: check_cp1_registers(ctx, fs); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp64, fs); gen_helper_float_roundw_d(fp32, cpu_env, fp64); tcg_temp_free_i64(fp64); gen_store_fpr32(fp32, fd); tcg_temp_free_i32(fp32); } opn = "round.w.d"; break; case OPC_TRUNC_W_D: check_cp1_registers(ctx, fs); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp64, fs); gen_helper_float_truncw_d(fp32, cpu_env, fp64); tcg_temp_free_i64(fp64); gen_store_fpr32(fp32, fd); tcg_temp_free_i32(fp32); } opn = "trunc.w.d"; break; case OPC_CEIL_W_D: check_cp1_registers(ctx, fs); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp64, fs); gen_helper_float_ceilw_d(fp32, cpu_env, fp64); tcg_temp_free_i64(fp64); gen_store_fpr32(fp32, fd); tcg_temp_free_i32(fp32); } opn = "ceil.w.d"; break; case OPC_FLOOR_W_D: check_cp1_registers(ctx, fs); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp64, fs); gen_helper_float_floorw_d(fp32, cpu_env, fp64); tcg_temp_free_i64(fp64); gen_store_fpr32(fp32, fd); tcg_temp_free_i32(fp32); } opn = "floor.w.d"; break; case OPC_MOVCF_D: gen_movcf_d(ctx, fs, fd, (ft >> 2) & 0x7, ft & 0x1); opn = "movcf.d"; break; case OPC_MOVZ_D: { int l1 = gen_new_label(); TCGv_i64 fp0; if (ft != 0) { tcg_gen_brcondi_tl(TCG_COND_NE, cpu_gpr[ft], 0, l1); } fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); gen_set_label(l1); } opn = "movz.d"; break; case OPC_MOVN_D: { int l1 = gen_new_label(); TCGv_i64 fp0; if (ft != 0) { tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[ft], 0, l1); fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); gen_set_label(l1); } } opn = "movn.d"; break; case OPC_RECIP_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_recip_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "recip.d"; break; case OPC_RSQRT_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_rsqrt_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "rsqrt.d"; break; case OPC_RECIP2_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_recip2_d(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "recip2.d"; break; case OPC_RECIP1_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_recip1_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "recip1.d"; break; case OPC_RSQRT1_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_rsqrt1_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "rsqrt1.d"; break; case OPC_RSQRT2_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_rsqrt2_d(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "rsqrt2.d"; break; case OPC_CMP_F_D: case OPC_CMP_UN_D: case OPC_CMP_EQ_D: case OPC_CMP_UEQ_D: case OPC_CMP_OLT_D: case OPC_CMP_ULT_D: case OPC_CMP_OLE_D: case OPC_CMP_ULE_D: case OPC_CMP_SF_D: case OPC_CMP_NGLE_D: case OPC_CMP_SEQ_D: case OPC_CMP_NGL_D: case OPC_CMP_LT_D: case OPC_CMP_NGE_D: case OPC_CMP_LE_D: case OPC_CMP_NGT_D: if (ctx->opcode & (1 << 6)) { gen_cmpabs_d(ctx, func-48, ft, fs, cc); opn = condnames_abs[func-48]; } else { gen_cmp_d(ctx, func-48, ft, fs, cc); opn = condnames[func-48]; } break; case OPC_CVT_S_D: check_cp1_registers(ctx, fs); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp64, fs); gen_helper_float_cvts_d(fp32, cpu_env, fp64); tcg_temp_free_i64(fp64); gen_store_fpr32(fp32, fd); tcg_temp_free_i32(fp32); } opn = "cvt.s.d"; break; case OPC_CVT_W_D: check_cp1_registers(ctx, fs); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp64, fs); gen_helper_float_cvtw_d(fp32, cpu_env, fp64); tcg_temp_free_i64(fp64); gen_store_fpr32(fp32, fd); tcg_temp_free_i32(fp32); } opn = "cvt.w.d"; break; case OPC_CVT_L_D: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_cvtl_d(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "cvt.l.d"; break; case OPC_CVT_S_W: { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_cvts_w(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "cvt.s.w"; break; case OPC_CVT_D_W: check_cp1_registers(ctx, fd); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr32(fp32, fs); gen_helper_float_cvtd_w(fp64, cpu_env, fp32); tcg_temp_free_i32(fp32); gen_store_fpr64(ctx, fp64, fd); tcg_temp_free_i64(fp64); } opn = "cvt.d.w"; break; case OPC_CVT_S_L: check_cp1_64bitmode(ctx); { TCGv_i32 fp32 = tcg_temp_new_i32(); TCGv_i64 fp64 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp64, fs); gen_helper_float_cvts_l(fp32, cpu_env, fp64); tcg_temp_free_i64(fp64); gen_store_fpr32(fp32, fd); tcg_temp_free_i32(fp32); } opn = "cvt.s.l"; break; case OPC_CVT_D_L: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_cvtd_l(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "cvt.d.l"; break; case OPC_CVT_PS_PW: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_cvtps_pw(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "cvt.ps.pw"; break; case OPC_ADD_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_add_ps(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "add.ps"; break; case OPC_SUB_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_sub_ps(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "sub.ps"; break; case OPC_MUL_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_mul_ps(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "mul.ps"; break; case OPC_ABS_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_abs_ps(fp0, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "abs.ps"; break; case OPC_MOV_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "mov.ps"; break; case OPC_NEG_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_chs_ps(fp0, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "neg.ps"; break; case OPC_MOVCF_PS: check_cp1_64bitmode(ctx); gen_movcf_ps(fs, fd, (ft >> 2) & 0x7, ft & 0x1); opn = "movcf.ps"; break; case OPC_MOVZ_PS: check_cp1_64bitmode(ctx); { int l1 = gen_new_label(); TCGv_i64 fp0; if (ft != 0) tcg_gen_brcondi_tl(TCG_COND_NE, cpu_gpr[ft], 0, l1); fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); gen_set_label(l1); } opn = "movz.ps"; break; case OPC_MOVN_PS: check_cp1_64bitmode(ctx); { int l1 = gen_new_label(); TCGv_i64 fp0; if (ft != 0) { tcg_gen_brcondi_tl(TCG_COND_EQ, cpu_gpr[ft], 0, l1); fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); gen_set_label(l1); } } opn = "movn.ps"; break; case OPC_ADDR_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, ft); gen_load_fpr64(ctx, fp1, fs); gen_helper_float_addr_ps(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "addr.ps"; break; case OPC_MULR_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, ft); gen_load_fpr64(ctx, fp1, fs); gen_helper_float_mulr_ps(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "mulr.ps"; break; case OPC_RECIP2_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_recip2_ps(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "recip2.ps"; break; case OPC_RECIP1_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_recip1_ps(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "recip1.ps"; break; case OPC_RSQRT1_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_rsqrt1_ps(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "rsqrt1.ps"; break; case OPC_RSQRT2_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_load_fpr64(ctx, fp1, ft); gen_helper_float_rsqrt2_ps(fp0, cpu_env, fp0, fp1); tcg_temp_free_i64(fp1); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "rsqrt2.ps"; break; case OPC_CVT_S_PU: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32h(fp0, fs); gen_helper_float_cvts_pu(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "cvt.s.pu"; break; case OPC_CVT_PW_PS: check_cp1_64bitmode(ctx); { TCGv_i64 fp0 = tcg_temp_new_i64(); gen_load_fpr64(ctx, fp0, fs); gen_helper_float_cvtpw_ps(fp0, cpu_env, fp0); gen_store_fpr64(ctx, fp0, fd); tcg_temp_free_i64(fp0); } opn = "cvt.pw.ps"; break; case OPC_CVT_S_PL: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_helper_float_cvts_pl(fp0, cpu_env, fp0); gen_store_fpr32(fp0, fd); tcg_temp_free_i32(fp0); } opn = "cvt.s.pl"; break; case OPC_PLL_PS: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32(fp1, ft); gen_store_fpr32h(fp0, fd); gen_store_fpr32(fp1, fd); tcg_temp_free_i32(fp0); tcg_temp_free_i32(fp1); } opn = "pll.ps"; break; case OPC_PLU_PS: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32(fp0, fs); gen_load_fpr32h(fp1, ft); gen_store_fpr32(fp1, fd); gen_store_fpr32h(fp0, fd); tcg_temp_free_i32(fp0); tcg_temp_free_i32(fp1); } opn = "plu.ps"; break; case OPC_PUL_PS: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32h(fp0, fs); gen_load_fpr32(fp1, ft); gen_store_fpr32(fp1, fd); gen_store_fpr32h(fp0, fd); tcg_temp_free_i32(fp0); tcg_temp_free_i32(fp1); } opn = "pul.ps"; break; case OPC_PUU_PS: check_cp1_64bitmode(ctx); { TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); gen_load_fpr32h(fp0, fs); gen_load_fpr32h(fp1, ft); gen_store_fpr32(fp1, fd); gen_store_fpr32h(fp0, fd); tcg_temp_free_i32(fp0); tcg_temp_free_i32(fp1); } opn = "puu.ps"; break; case OPC_CMP_F_PS: case OPC_CMP_UN_PS: case OPC_CMP_EQ_PS: case OPC_CMP_UEQ_PS: case OPC_CMP_OLT_PS: case OPC_CMP_ULT_PS: case OPC_CMP_OLE_PS: case OPC_CMP_ULE_PS: case OPC_CMP_SF_PS: case OPC_CMP_NGLE_PS: case OPC_CMP_SEQ_PS: case OPC_CMP_NGL_PS: case OPC_CMP_LT_PS: case OPC_CMP_NGE_PS: case OPC_CMP_LE_PS: case OPC_CMP_NGT_PS: if (ctx->opcode & (1 << 6)) { gen_cmpabs_ps(ctx, func-48, ft, fs, cc); opn = condnames_abs[func-48]; } else { gen_cmp_ps(ctx, func-48, ft, fs, cc); opn = condnames[func-48]; } break; default: MIPS_INVAL(opn); generate_exception (ctx, EXCP_RI); return; } (void)opn; switch (optype) { case BINOP: MIPS_DEBUG("%s %s, %s, %s", opn, fregnames[fd], fregnames[fs], fregnames[ft]); break; case CMPOP: MIPS_DEBUG("%s %s,%s", opn, fregnames[fs], fregnames[ft]); break; default: MIPS_DEBUG("%s %s,%s", opn, fregnames[fd], fregnames[fs]); break; } }
1threat
apply event only on single class with same class in multiple container : I am trying to creating my own read More/less function for comments. [ReadMore ReadLess Image][1]. During developing this, I followed by a problem. Suppose, I have 3 comments(**see first Image**) with more than 500 chars. In these comments all/full text is not shown, so i add *ReadMore* Links to read all comment. Show Only that class where i clicked.. Problem : When i click on one of these links *ReadMore* its shows me all three comments with full text Instead to show me only clicked class text. Problem Image: img.ctrlv.in/img/16/03/12/56e4110ccb82d.png My jsBin : https://jsbin.com/waqoror/1/edit?html,js,console,output Paste my Snippet also here Now <!-- begin snippet: js hide: true --> <!-- language: lang-js --> function mangeText(text) { var minCharLength = 50; var readL ="Read Less"; var readM = "Read More"; var txt = text, txtLength = 0, totLength = ""; var startDisplayText = "", startupCont = "", hiddenContent = ""; txtLength = txt.length; for (var i = 0; i < minCharLength; i++) { totLength += txt[i]; //console.log("["+i+"] "+totLength); } if (txt.length >= (minCharLength + 50)) { startupCont += "<span class='yughi501 _po2075 tetb_apndShw umoriRut' style='display:inline-block'> " + totLength + " <span>" + "<a href='#' onclick='ReadMoreLess()' class='txb_rdM _d1e301 _oijd51 _pedu' style='display:inline-block'> " + readM + "</a>" + "</span>" + "</span>"; hiddenContent = "<span class='yughi411 _po21075 _umori120Rut tetb_apndhd' style='display:none'> " + txt + " <span>" + "<a href='#' onclick='ReadMoreLess()' class='txb_rdL _pedu'> " + readL + " </a>" + "</span>" + "</span>"; txt = startupCont; txt += hiddenContent; } return txt; } function ReadMoreLess(){ if($(".tetb_apndhd").css("display") == "none"){ console.log("IF"); $(".tetb_apndhd").css({"display":"inline-block"}); $(".tetb_apndShw").css({"display":"none"}); }else if(($(".tetb_apndhd").css("display") == "inline-block")){ console.log("ELSE IF"); $(".tetb_apndShw").css({"display":"inline-block"}); $(".tetb_apndhd").css({"display":"none"}); } } $(".apndbtn").click(function (){ var txt = mangeText($(".txt").val()); $(".dclr").append(txt); }); <!-- language: lang-css --> .txt{width:300px;height:150px;resize:none} <!-- language: lang-html --> <!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-1.11.3.js"></script> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> </head> <body> <textarea class="txt" id="tt">Etiam vitae faucibus urna. Cras in enim ac eros cursus euismod. Aenean tristique arcu eu quam pharetra rutrum. Proin tincidunt magna at nibh tristique, eu finibus ipsum ultricies. Nunc eget lorem ac diam dictum condimentum. Vestibulum eu nisi a lorem ornare finibus.</textarea><br/> <button class="apndbtn">Append</button> <div class="dclr"></div> </body> </html> <!-- end snippet --> I tried My best to explain my problem. I hope you will understand. Ty In advance and used your time on my problem. [1]: http://i.stack.imgur.com/A2xUQ.png
0debug
How C arrays are structured : <p>I have a question about how C arrays are stored in memory. But I'm having trouble formulating the question, so here's my best try to put it into words. I have trouble with English. Let's say we have a three dimensional array:</p> <pre><code>int foo[2][3][4]; </code></pre> <p>Elements can be accessed using either array or pointer notation:</p> <pre><code>foo[i][j][k] *(*(*(foo + i) + j) + k) </code></pre> <p>We could think of the array as a pointer to a pointer to a pointer to an int, or, for example, a pointer to a 2 dimensional array like (*a)[2][3].</p> <p>The problem in my thinking is this: I would have thought that in order to 'extract' values in the array, we'd only have to dereference the top level of the array (i.e. [i]) once, the second level (i.e. [j]) twice, and the third level (i.e. [k]) three times. But actually we always have to dereference three times to get to any value. Why is this? Or is this really the case?</p> <p>I try to imagine the array structure in memory.</p> <p>Apologies for my poor way to express this.</p>
0debug
SH7750State *sh7750_init(CPUSH4State * cpu) { SH7750State *s; int sh7750_io_memory; int cpu_model = SH_CPU_SH7751R; s = qemu_mallocz(sizeof(SH7750State)); s->cpu = cpu; s->periph_freq = 60000000; sh7750_io_memory = cpu_register_io_memory(0, sh7750_mem_read, sh7750_mem_write, s); cpu_register_physical_memory(0x1c000000, 0x04000000, sh7750_io_memory); sh_intc_init(&s->intc, NR_SOURCES, _INTC_ARRAY(mask_registers), _INTC_ARRAY(prio_registers)); sh_intc_register_sources(&s->intc, _INTC_ARRAY(vectors), _INTC_ARRAY(groups)); sh_serial_init(0x1fe00000, 0, s->periph_freq, serial_hds[0]); sh_serial_init(0x1fe80000, SH_SERIAL_FEAT_SCIF, s->periph_freq, serial_hds[1]); tmu012_init(0x1fd80000, TMU012_FEAT_TOCR | TMU012_FEAT_3CHAN | TMU012_FEAT_EXTCLK, s->periph_freq); if (cpu_model & (SH_CPU_SH7750 | SH_CPU_SH7750S | SH_CPU_SH7751)) { sh_intc_register_sources(&s->intc, _INTC_ARRAY(vectors_dma4), _INTC_ARRAY(groups_dma4)); } if (cpu_model & (SH_CPU_SH7750R | SH_CPU_SH7751R)) { sh_intc_register_sources(&s->intc, _INTC_ARRAY(vectors_dma8), _INTC_ARRAY(groups_dma8)); } if (cpu_model & (SH_CPU_SH7750R | SH_CPU_SH7751 | SH_CPU_SH7751R)) { sh_intc_register_sources(&s->intc, _INTC_ARRAY(vectors_tmu34), _INTC_ARRAY(NULL)); tmu012_init(0x1e100000, 0, s->periph_freq); } if (cpu_model & (SH_CPU_SH7751_ALL)) { sh_intc_register_sources(&s->intc, _INTC_ARRAY(vectors_pci), _INTC_ARRAY(groups_pci)); } if (cpu_model & (SH_CPU_SH7750S | SH_CPU_SH7750R | SH_CPU_SH7751_ALL)) { sh_intc_register_sources(&s->intc, _INTC_ARRAY(vectors_irlm), _INTC_ARRAY(NULL)); } return s; }
1threat
int event_notifier_test_and_clear(EventNotifier *e) { uint64_t value; int r = read(e->fd, &value, sizeof(value)); return r == sizeof(value); }
1threat
whats wrong with my android studios gradle? : Error:No cached version of com.android.databinding:compilerCommon:1.0-rc5 available for offline mode. <a href="toggle.offline.mode">Disable Gradle 'offline mode' and sync project</a> even in the preview part , there is no phone screen
0debug
View at the bottom in a UIScrollView, with AutoLayout : <p>I'm setting up content in a scroll view with autolayout. The objects in the scrollview are pinned top-to-bottom to the previous one, so that they are under one another. I have a footer view that is added at the end, below these objects. </p> <p>Here's the catch: when there's few content, the contentView will be smaller than the screen height, so the footer view will appear somewhere in the middle of the screen (which is the normal behavior). But I'd like to prevent that, and make the view stay somewhere at the bottom. </p> <p>In other words, I would like to setup a double constraint like:</p> <pre><code>Put this view below all the objects in the scrollview AND keep this view at a distance of max [some number] of the bottom of the screen </code></pre> <p>In a way that both constraints are always satisfied:</p> <ul> <li>If the height of the content is bigger than the screen, then the view appears at the bottom, after scrolling down</li> <li>If the height is smaller, then the view is "pinned" to the bottom of the screen, leaving a space relatively big between the bottom of the content and the top of this view</li> </ul> <p>How can I achieve that with AutoLayout?</p>
0debug
int acpi_add_cpu_info(Object *o, void *opaque) { AcpiCpuInfo *cpu = opaque; uint64_t apic_id; if (object_dynamic_cast(o, TYPE_CPU)) { apic_id = object_property_get_int(o, "apic-id", NULL); assert(apic_id <= MAX_CPUMASK_BITS); set_bit(apic_id, cpu->found_cpus); } object_child_foreach(o, acpi_add_cpu_info, opaque); return 0; }
1threat
Perl Regex: Adding a symbol in front of another symbol in a string : <p>If i had a string:</p> <pre><code>my $string = "a/hello/bye/d"; </code></pre> <p>I would like to add in a "\" symbol infront of every "/" symbol found inside the string. Are there any possible ways to do this?</p> <p>Example:</p> <pre><code>$string = "a\/hello\/bye\/d"; </code></pre>
0debug
Improve bar graph legends with matplotlib : My graph legend (the one below graph - X) is taking a huge space from the total "image". Any idea how I could improve it? For instance, display this field inside the bars?! Thanks for your support. My code for graph settings is: import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['font.sans-serif'] = "Century Gothic" matplotlib.rcParams['font.family'] = "Century Gothic" ax = df1.plot.bar(x = '', y = ['Events Today', 'Avg. Events Last 30 Days'], rot = 25, width=0.8 , linewidth=1, color=['midnightblue','darkorange']) for item in ([ax.xaxis.label, ax.yaxis.label] + ax.get_xticklabels() + ax.get_yticklabels()): item.set_fontsize(15) ax.legend(fontsize = 'x-large', loc='best') plt.tight_layout() ax.yaxis.grid(True, which='major', linestyle='-', linewidth=0.15) ax.set_facecolor('#f2f2f2') plt.show() [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/wm3rE.png
0debug
static int output_packet(AVInputStream *ist, int ist_index, AVOutputStream **ost_table, int nb_ostreams, const AVPacket *pkt) { AVFormatContext *os; AVOutputStream *ost; uint8_t *ptr; int len, ret, i; uint8_t *data_buf; int data_size, got_picture; AVFrame picture; short samples[AVCODEC_MAX_AUDIO_FRAME_SIZE / 2]; void *buffer_to_free; if (pkt && pkt->pts != AV_NOPTS_VALUE) { ist->next_pts = ist->pts = pkt->dts; } else { ist->pts = ist->next_pts; } if (pkt == NULL) { ptr = NULL; len = 0; goto handle_eof; } len = pkt->size; ptr = pkt->data; while (len > 0) { handle_eof: data_buf = NULL; data_size = 0; if (ist->decoding_needed) { switch(ist->st->codec.codec_type) { case CODEC_TYPE_AUDIO: ret = avcodec_decode_audio(&ist->st->codec, samples, &data_size, ptr, len); if (ret < 0) goto fail_decode; ptr += ret; len -= ret; if (data_size <= 0) { continue; } data_buf = (uint8_t *)samples; ist->next_pts += ((int64_t)AV_TIME_BASE/2 * data_size) / (ist->st->codec.sample_rate * ist->st->codec.channels); break; case CODEC_TYPE_VIDEO: data_size = (ist->st->codec.width * ist->st->codec.height * 3) / 2; avcodec_get_frame_defaults(&picture); ret = avcodec_decode_video(&ist->st->codec, &picture, &got_picture, ptr, len); ist->st->quality= picture.quality; if (ret < 0) goto fail_decode; if (!got_picture) { goto discard_packet; } if (ist->st->codec.frame_rate_base != 0) { ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec.frame_rate_base) / ist->st->codec.frame_rate; } len = 0; break; default: goto fail_decode; } } else { data_buf = ptr; data_size = len; ret = len; len = 0; } buffer_to_free = NULL; if (ist->st->codec.codec_type == CODEC_TYPE_VIDEO) { pre_process_video_frame(ist, (AVPicture *)&picture, &buffer_to_free); } if (ist->st->codec.rate_emu) { int64_t pts = av_rescale((int64_t) ist->frame * ist->st->codec.frame_rate_base, 1000000, ist->st->codec.frame_rate); int64_t now = av_gettime() - ist->start; if (pts > now) usleep(pts - now); ist->frame++; } #if 0 if (ist->st->codec.codec_id == CODEC_ID_MPEG1VIDEO) { if (ist->st->codec.pict_type != B_TYPE) { int64_t tmp; tmp = ist->last_ip_pts; ist->last_ip_pts = ist->frac_pts.val; ist->frac_pts.val = tmp; } } #endif if (start_time == 0 || ist->pts >= start_time) for(i=0;i<nb_ostreams;i++) { int frame_size; ost = ost_table[i]; if (ost->source_index == ist_index) { os = output_files[ost->file_index]; #if 0 printf("%d: got pts=%0.3f %0.3f\n", i, (double)pkt->pts / AV_TIME_BASE, ((double)ist->pts / AV_TIME_BASE) - ((double)ost->st->pts.val * ost->time_base.num / ost->time_base.den)); #endif ost->sync_ipts = (double)ist->pts / AV_TIME_BASE; if (ost->encoding_needed) { switch(ost->st->codec.codec_type) { case CODEC_TYPE_AUDIO: do_audio_out(os, ost, ist, data_buf, data_size); break; case CODEC_TYPE_VIDEO: { int i; AVOutputStream *audio_sync, *ost1; audio_sync = NULL; for(i=0;i<nb_ostreams;i++) { ost1 = ost_table[i]; if (ost1->file_index == ost->file_index && ost1->st->codec.codec_type == CODEC_TYPE_AUDIO) { audio_sync = ost1; break; } } do_video_out(os, ost, ist, &picture, &frame_size, audio_sync); video_size += frame_size; if (do_vstats && frame_size) do_video_stats(os, ost, frame_size); } break; default: av_abort(); } } else { AVFrame avframe; AVPacket opkt; av_init_packet(&opkt); avcodec_get_frame_defaults(&avframe); ost->st->codec.coded_frame= &avframe; avframe.key_frame = pkt->flags & PKT_FLAG_KEY; if(ost->st->codec.codec_type == CODEC_TYPE_AUDIO) audio_size += data_size; else if (ost->st->codec.codec_type == CODEC_TYPE_VIDEO) video_size += data_size; opkt.stream_index= ost->index; opkt.data= data_buf; opkt.size= data_size; opkt.pts= ist->pts; opkt.flags= pkt->flags; av_write_frame(os, &opkt); ost->st->codec.frame_number++; ost->frame_number++; } } } av_free(buffer_to_free); } discard_packet: return 0; fail_decode: return -1; }
1threat
GLSL error: `out' qualifier only valid for function parameters in GLSL 1.10 : <p>My shaders have in/out keywords. But I've got GLSL compile error: <code>'out' qualifier only valid for function parameters in GLSL 1.10</code>. Shaders have <code>#version 330</code> directive. Calling <code>glGetString(GL_SHADING_LANGUAGE_VERSION)</code> returns 3.30. </p> <p>Here is my project: <code>github.com/wlad031/ssu-coursework-2016</code>. Input folder contains shaders. Main source files are <a href="http://github.com/wlad031/ssu-coursework-2016/blob/master/src/ShaderProgramControl.cpp" rel="nofollow">src/ShaderProgramControl.cpp</a> and <a href="http://github.com/wlad031/ssu-coursework-2016/blob/master/src/Shader.cpp" rel="nofollow">src/Shader.cpp</a>. Where is my mistake?</p>
0debug
static void bufp_alloc(USBRedirDevice *dev, uint8_t *data, int len, int status, uint8_t ep) { struct buf_packet *bufp; if (!dev->endpoint[EP2I(ep)].bufpq_dropping_packets && dev->endpoint[EP2I(ep)].bufpq_size > 2 * dev->endpoint[EP2I(ep)].bufpq_target_size) { DPRINTF("bufpq overflow, dropping packets ep %02X\n", ep); dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 1; } if (dev->endpoint[EP2I(ep)].bufpq_dropping_packets) { if (dev->endpoint[EP2I(ep)].bufpq_size > dev->endpoint[EP2I(ep)].bufpq_target_size) { free(data); return; } dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0; } bufp = g_malloc(sizeof(struct buf_packet)); bufp->data = data; bufp->len = len; bufp->status = status; QTAILQ_INSERT_TAIL(&dev->endpoint[EP2I(ep)].bufpq, bufp, next); dev->endpoint[EP2I(ep)].bufpq_size++; }
1threat
What do assembly registers refer to in C code? : <p>I'm currently refactoring c code and inside there is assembly code:</p> <pre><code>asm("movl $8, %esi\n\t" movl $.LC0, %edi\n\t" "movl $0, %eax"); </code></pre> <p>What doe each of the registers mean? In the c code, there isn't other asm code that assigns $8 or $.LC0, I'm assuming $0 is just a zero value</p>
0debug
How pass data in two Component using anugular 4 : i am using EventEmitter with Services. please help how i can pass data in two component on page redirect . Thanks in advanced
0debug
Java 8 - Quartz scheduler to schedule task for specific time daily : I want to execute a set of task and am using Quartz Scheduler. Right now, am executing the task for every `10` minutes. But i want to execute the task for the specific time on daily basis. for example i want to execute the task on `8 am` daily. Please find my below quartz scheduler code public void start() { try { scheduler = new StdSchedulerFactory().getScheduler(); scheduler.start(); schedule(DocumentIndexing.class, "0 0/10 * * * ?"); } catch (Exception e) { System.out.println(e); } }
0debug
Tensor is not an element of this graph; deploying Keras model : <p>Im deploying a keras model and sending the test data to the model via a flask api. I have two files:</p> <p>First: My Flask App:</p> <pre><code># Let's startup the Flask application app = Flask(__name__) # Model reload from jSON: print('Load model...') json_file = open('models/model_temp.json', 'r') loaded_model_json = json_file.read() json_file.close() keras_model_loaded = model_from_json(loaded_model_json) print('Model loaded...') # Weights reloaded from .h5 inside the model print('Load weights...') keras_model_loaded.load_weights("models/Model_temp.h5") print('Weights loaded...') # URL that we'll use to make predictions using get and post @app.route('/predict',methods=['GET','POST']) def predict(): data = request.get_json(force=True) predict_request = [data["month"],data["day"],data["hour"]] predict_request = np.array(predict_request) predict_request = predict_request.reshape(1,-1) y_hat = keras_model_loaded.predict(predict_request, batch_size=1, verbose=1) return jsonify({'prediction': str(y_hat)}) if __name__ == "__main__": # Choose the port port = int(os.environ.get('PORT', 9000)) # Run locally app.run(host='127.0.0.1', port=port) </code></pre> <p>Second: The file Im using to send the json data sending to the api endpoint:</p> <pre><code>response = rq.get('api url has been removed') data=response.json() currentDT = datetime.datetime.now() Month = currentDT.month Day = currentDT.day Hour = currentDT.hour url= "http://127.0.0.1:9000/predict" post_data = json.dumps({'month': month, 'day': day, 'hour': hour,}) r = rq.post(url,post_data) </code></pre> <p>Im getting this response from Flask regarding Tensorflow:</p> <p>ValueError: Tensor Tensor("dense_6/BiasAdd:0", shape=(?, 1), dtype=float32) is not an element of this graph.</p> <p>My keras model is a simple 6 dense layer model and trains with no errors.</p> <p>Any ideas?</p>
0debug
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 20 : <p>I have an work for school, I need to make array using int type numbers. I already assigned every value. If i try to run it, it shows that there is - Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 20.</p> <pre><code> if (K==0) { Random r = new Random(); for (i = 0; i &lt; 20; i++) A[i] = r.nextInt() * 100 - 50; } else { for (i=0; i &lt; 20; i++) { // It shows that problem is somewhere in A[i] = A[i + 1] + K; // these 2 lines. } System.out.println("A:"); for (i = 0; i &lt; 20; i++) </code></pre>
0debug
How to recreate this mouseover effect from Blue Origin? : <p>On <a href="https://www.blueorigin.com/" rel="nofollow">https://www.blueorigin.com/</a> they have a mouseover effect on the front page with the "Astronaut Experience" and "tech..." boxes that are side by side each other underneath the video.</p> <p>I am learning how to code websites right now, and working on making one right now with that similar style of effect. How would I be able to implement this? I have some basic javascript knowledge, html, css and using nodejs+express</p>
0debug
Understanding Type of IO () in `let` Expression : <p>Given:</p> <pre><code>λ: let f = putStrLn "foo" in 42 42 </code></pre> <p>What is <code>f</code>'s type? Why does <code>"foo"</code> not get printed before showing the result of <code>42</code>?</p> <p>Lastly, why doesn't the following work?</p> <pre><code>λ: :t f &lt;interactive&gt;:1:1: Not in scope: ‘f’ </code></pre>
0debug
static av_cold int sonic_decode_init(AVCodecContext *avctx) { SonicContext *s = avctx->priv_data; GetBitContext gb; int i; s->channels = avctx->channels; s->samplerate = avctx->sample_rate; if (!avctx->extradata) { av_log(avctx, AV_LOG_ERROR, "No mandatory headers present\n"); return AVERROR_INVALIDDATA; } init_get_bits8(&gb, avctx->extradata, avctx->extradata_size); s->version = get_bits(&gb, 2); if (s->version >= 2) { s->version = get_bits(&gb, 8); s->minor_version = get_bits(&gb, 8); } if (s->version != 2) { av_log(avctx, AV_LOG_ERROR, "Unsupported Sonic version, please report\n"); return AVERROR_INVALIDDATA; } if (s->version >= 1) { int sample_rate_index; s->channels = get_bits(&gb, 2); sample_rate_index = get_bits(&gb, 4); if (sample_rate_index >= FF_ARRAY_ELEMS(samplerate_table)) { av_log(avctx, AV_LOG_ERROR, "Invalid sample_rate_index %d\n", sample_rate_index); return AVERROR_INVALIDDATA; } s->samplerate = samplerate_table[sample_rate_index]; av_log(avctx, AV_LOG_INFO, "Sonicv2 chans: %d samprate: %d\n", s->channels, s->samplerate); } if (s->channels > MAX_CHANNELS || s->channels < 1) { av_log(avctx, AV_LOG_ERROR, "Only mono and stereo streams are supported by now\n"); return AVERROR_INVALIDDATA; } s->lossless = get_bits1(&gb); if (!s->lossless) skip_bits(&gb, 3); s->decorrelation = get_bits(&gb, 2); if (s->decorrelation != 3 && s->channels != 2) { av_log(avctx, AV_LOG_ERROR, "invalid decorrelation %d\n", s->decorrelation); return AVERROR_INVALIDDATA; } s->downsampling = get_bits(&gb, 2); if (!s->downsampling) { av_log(avctx, AV_LOG_ERROR, "invalid downsampling value\n"); return AVERROR_INVALIDDATA; } s->num_taps = (get_bits(&gb, 5)+1)<<5; if (get_bits1(&gb)) av_log(avctx, AV_LOG_INFO, "Custom quant table\n"); s->block_align = 2048LL*s->samplerate/(44100*s->downsampling); s->frame_size = s->channels*s->block_align*s->downsampling; av_log(avctx, AV_LOG_INFO, "Sonic: ver: %d.%d ls: %d dr: %d taps: %d block: %d frame: %d downsamp: %d\n", s->version, s->minor_version, s->lossless, s->decorrelation, s->num_taps, s->block_align, s->frame_size, s->downsampling); s->tap_quant = av_calloc(s->num_taps, sizeof(*s->tap_quant)); if (!s->tap_quant) return AVERROR(ENOMEM); for (i = 0; i < s->num_taps; i++) s->tap_quant[i] = ff_sqrt(i+1); s->predictor_k = av_calloc(s->num_taps, sizeof(*s->predictor_k)); for (i = 0; i < s->channels; i++) { s->predictor_state[i] = av_calloc(s->num_taps, sizeof(**s->predictor_state)); if (!s->predictor_state[i]) return AVERROR(ENOMEM); } for (i = 0; i < s->channels; i++) { s->coded_samples[i] = av_calloc(s->block_align, sizeof(**s->coded_samples)); if (!s->coded_samples[i]) return AVERROR(ENOMEM); } s->int_samples = av_calloc(s->frame_size, sizeof(*s->int_samples)); if (!s->int_samples) return AVERROR(ENOMEM); avctx->sample_fmt = AV_SAMPLE_FMT_S16; return 0; }
1threat
I have a error in the output please help me out : Write a program to read through the mbox-short.txt and figure out the distribution by hour of the day for each of the messages. You can pull the hour out from the 'From ' line by finding the time and then splitting the string a second time using a colon. From stephen.marquard@uct.ac.za Sat Jan 5 09:14:16 2008 Once you have accumulated the counts for each hour, print out the counts, sorted by hour as shown below. **Expected output:** 04 3 06 1 07 1 09 2 10 3 11 6 14 1 15 2 16 4 17 2 18 1 19 1 **Code:** fname = raw_input('Enter file name: ') fhand = open(fname) c = dict() for line in fhand: if not line.startswith('From ') : continue pieces = line.split() time = pieces[5] parts = time.split(':') hour = parts[0] c[hour] = c.get(hour,0) + 1 lst = list() for key in c: value = c[key] lst.append( (value, key) ) lst.sort() for value, key in lst: print key, value **Output I got** 06 1 ← Mismatch 07 1 14 1 18 1 19 1 09 2 15 2 17 2 04 3 10 3 16 4 11 6
0debug
static void msrle_decode_pal8(MsrleContext *s) { int stream_ptr = 0; unsigned char rle_code; unsigned char extra_byte; unsigned char stream_byte; int pixel_ptr = 0; int row_dec = s->frame.linesize[0]; int row_ptr = (s->avctx->height - 1) * row_dec; int frame_size = row_dec * s->avctx->height; while (row_ptr >= 0) { FETCH_NEXT_STREAM_BYTE(); rle_code = stream_byte; if (rle_code == 0) { FETCH_NEXT_STREAM_BYTE(); if (stream_byte == 0) { row_ptr -= row_dec; pixel_ptr = 0; } else if (stream_byte == 1) { return; } else if (stream_byte == 2) { FETCH_NEXT_STREAM_BYTE(); pixel_ptr += stream_byte; FETCH_NEXT_STREAM_BYTE(); row_ptr -= stream_byte * row_dec; } else { if ((row_ptr + pixel_ptr + stream_byte > frame_size) || (row_ptr < 0)) { printf(" MS RLE: frame ptr just went out of bounds (1)\n"); return; } rle_code = stream_byte; extra_byte = stream_byte & 0x01; if (stream_ptr + rle_code + extra_byte > s->size) { printf(" MS RLE: stream ptr just went out of bounds (2)\n"); return; } while (rle_code--) { FETCH_NEXT_STREAM_BYTE(); s->frame.data[0][row_ptr + pixel_ptr] = stream_byte; pixel_ptr++; } if (extra_byte) stream_ptr++; } } else { if ((row_ptr + pixel_ptr + stream_byte > frame_size) || (row_ptr < 0)) { printf(" MS RLE: frame ptr just went out of bounds (2)\n"); return; } FETCH_NEXT_STREAM_BYTE(); while(rle_code--) { s->frame.data[0][row_ptr + pixel_ptr] = stream_byte; pixel_ptr++; } } } memcpy(s->frame.data[1], s->palette, 256 * 4); if (stream_ptr < s->size) printf(" MS RLE: ended frame decode with bytes left over (%d < %d)\n", stream_ptr, s->size); }
1threat
static av_cold int sunrast_encode_close(AVCodecContext *avctx) { av_frame_free(&avctx->coded_frame); return 0; }
1threat
Xcode8.3 constantly crashes after update : <p>After update Xcode 8.3 is crashing constantly. At start it was 30 to 40 minutes but today it is crashing after just 10 seconds. Any help will be highly appreciated. Below is crash report.</p> <pre><code>Process: Xcode [555] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 8.3 (12169) Build Info: IDEFrameworks-12169000000000000~2 App Item ID: 497799835 App External ID: 821487965 Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Xcode [555] User ID: 501 Date/Time: 2017-03-29 17:52:50.427 +0500 OS Version: Mac OS X 10.12.4 (16E195) Report Version: 12 Anonymous UUID: C95FFD88-0B61-915D-E373-1F31A265D400 Time Awake Since Boot: 250 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Application Specific Information: MainQueue: _compat_sourcekitd_set_notification_handler_block_invoke_2 ProductBuildVersion: 8E162 ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-12150/DVTFoundation/FilePaths/DVTFilePath.m:905 Details: Path must be absolute but is not: &lt;built-in&gt; Object: &lt;DVTFilePath&gt; Method: +filePathForPathString: Thread: &lt;NSThread: 0x7fc33ae02970&gt;{number = 1, name = main} </code></pre>
0debug
ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks, MemoryRegion ram_memories[], hwaddr ram_bases[], hwaddr ram_sizes[], const unsigned int sdram_bank_sizes[]) { ram_addr_t size_left = ram_size; ram_addr_t base = 0; int i; int j; for (i = 0; i < nr_banks; i++) { for (j = 0; sdram_bank_sizes[j] != 0; j++) { unsigned int bank_size = sdram_bank_sizes[j]; if (bank_size <= size_left) { char name[32]; snprintf(name, sizeof(name), "ppc4xx.sdram%d", i); memory_region_allocate_system_memory(&ram_memories[i], NULL, name, bank_size); ram_bases[i] = base; ram_sizes[i] = bank_size; base += bank_size; size_left -= bank_size; break; } } if (!size_left) { break; } } ram_size -= size_left; if (size_left) printf("Truncating memory to %d MiB to fit SDRAM controller limits.\n", (int)(ram_size >> 20)); return ram_size; }
1threat
How to create custom date in JS and Ruby backend? : <p>I have a backend Ruby and front-end JS. In the database I put a date field as an integer, now when I fillup my date field with an input like this <strong>12/11/20</strong> it shows just first number <strong>12</strong> in created form, but when I write all numbers together like this <strong>121120</strong> it put exactly <strong>121120</strong>. What have I change to have my date shown in a normal way like <strong>12/11/20</strong>?</p>
0debug
How to Write Json Array to file using jackson : <p>I created a Json file where i wanted to write write java object as Array element. Im using jackson.</p> <pre><code> try{ String json; String phyPath = request.getSession().getServletContext().getRealPath("/"); String filepath = phyPath + "resources/" + "data.json"; File file = new File(filepath); if (!file.exists()) { System.out.println("pai nai"); file.createNewFile(); } json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(story); Files.write(new File(filepath).toPath(), Arrays.asList(json), StandardOpenOption.APPEND); } </code></pre> <p>This is not what i exactly want .it creates data like </p> <pre><code>{ "storyTitle" : "ttt", "storyBody" : "tttt", "storyAuthor" : "tttt" } { "storyTitle" : "a", "storyBody" : "a", "storyAuthor" : "a" } </code></pre> <p>I just need to create a Array of Json where i add java object, data should be like this </p> <pre><code>[{ "storyTitle" : "ttt", "storyBody" : "tttt", "storyAuthor" : "tttt" } ,{ "storyTitle" : "a", "storyBody" : "a", "storyAuthor" : "a" }] </code></pre>
0debug
SSIS Catalog - All Executions report only shows #Error in all headings and hyperlinks : <p>I'm running an SSIS package on a recent install of SQL Server 2016. Recently the All Axecutions report of the Integrations Services Catalogs SSISDB started looking like the screenshot below. The package that is executed on a 5 minute basis runs fine. No errors. I can see the data being transferred as expected. Something is wrong with this report. I did some searching around and can't seem to find anything. </p> <p>Anybody have any ideas as to what is wrong? Why is it showing #Error everywhere?</p> <p><a href="https://i.stack.imgur.com/zZBBi.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zZBBi.png" alt="enter image description here"></a></p>
0debug
static void tcg_reg_alloc_bb_end(TCGContext *s, TCGRegSet allocated_regs) { int i; for (i = s->nb_globals; i < s->nb_temps; i++) { TCGTemp *ts = &s->temps[i]; if (ts->temp_local) { temp_save(s, ts, allocated_regs); } else { #ifdef USE_LIVENESS_ANALYSIS if (!ts->indirect_base) { assert(ts->val_type == TEMP_VAL_DEAD); continue; } #endif temp_dead(s, ts); } } save_globals(s, allocated_regs); }
1threat
Integer Array List Adding Elements : <p>I'm having a bit of a problem with an ArrayList I'm trying to use for a clock deep link in Android. I'm just trying to create an ArrayList with the values [1,2,3,4,5,6,7].</p> <p>Here's what I have right now:</p> <pre><code> ArrayList&lt;Integer&gt; daysList = new ArrayList&lt;&gt;(); daysList.add(5); </code></pre> <p>The <code>add</code> is underlined and says "Cannot resolve symbol: add"</p> <p>Thanks in advance!</p>
0debug
const char *avcodec_configuration(void) { return FFMPEG_CONFIGURATION; }
1threat
static void alpha_translate_init(void) { int i; char *p; static int done_init = 0; if (done_init) return; cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env"); p = cpu_reg_names; for (i = 0; i < 31; i++) { sprintf(p, "ir%d", i); cpu_ir[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0, offsetof(CPUState, ir[i]), p); p += (i < 10) ? 4 : 5; sprintf(p, "fir%d", i); cpu_fir[i] = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0, offsetof(CPUState, fir[i]), p); p += (i < 10) ? 5 : 6; } cpu_pc = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0, offsetof(CPUState, pc), "pc"); cpu_lock = tcg_global_mem_new(TCG_TYPE_I64, TCG_AREG0, offsetof(CPUState, lock), "lock"); #undef DEF_HELPER #define DEF_HELPER(ret, name, params) tcg_register_helper(name, #name); #include "helper.h" done_init = 1; }
1threat
Autosyncing database for filemaker pro like system : <p>I am working for a Lab. We mainly use google sheets to keep basic data. Whenever a change is made from a computer update is shown on every other computer too. We also use Filemaker Pro on some computers. I want the Structure and form of Filemaker Pro and autosyncing and formulas of googlesheets The one thing i can't seem to figure out on google sheets is how to change a cell's value from another cell. Google App script allows me to do this but i am wondering if there is another way. I am ok with learning another language and platform (SQL) as long as they have what i need. Thank you very much.</p>
0debug
how to get the sum of numbers via map? : How to get the sum of elements (numbers) that I get from the database? <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> const onSum = () => { return invoiceList.map(i => { // i.number summ }) }; <!-- language: lang-html --> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script> <!-- end snippet -->
0debug
Unix in sas command : What does below code do and what are the possible output of sas dataset new if i have below folder and sas files in the location c:/data. new new.sas7bat news.sas7bat filename files pipe "find c:/data -name '*.sas7bat; data new; infile files lrecl=120 pad missover; input; if index(lowcase(_infile_), 'datas') then delete; type = 'F'; run; How does _infile process in this code.
0debug
Filter rows by distinct values in one column in PySpark : <p>Let's say I have the following table:</p> <pre><code>+--------------------+--------------------+------+------------+--------------------+ | host| path|status|content_size| time| +--------------------+--------------------+------+------------+--------------------+ |js002.cc.utsunomi...|/shuttle/resource...| 404| 0|1995-08-01 00:07:...| | tia1.eskimo.com |/pub/winvn/releas...| 404| 0|1995-08-01 00:28:...| |grimnet23.idirect...|/www/software/win...| 404| 0|1995-08-01 00:50:...| |miriworld.its.uni...|/history/history.htm| 404| 0|1995-08-01 01:04:...| | ras38.srv.net |/elv/DELTA/uncons...| 404| 0|1995-08-01 01:05:...| | cs1-06.leh.ptd.net | | 404| 0|1995-08-01 01:17:...| |dialip-24.athenet...|/history/apollo/a...| 404| 0|1995-08-01 01:33:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:35:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:36:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:36:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:36:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:36:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:36:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:36:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:37:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:37:...| | h96-158.ccnet.com |/history/apollo/a...| 404| 0|1995-08-01 01:37:...| |hsccs_gatorbox07....|/pub/winvn/releas...| 404| 0|1995-08-01 01:44:...| |www-b2.proxy.aol....|/pub/winvn/readme...| 404| 0|1995-08-01 01:48:...| |www-b2.proxy.aol....|/pub/winvn/releas...| 404| 0|1995-08-01 01:48:...| +--------------------+--------------------+------+------------+--------------------+ </code></pre> <p>How I would filter this table to have only distinct paths in PySpark? But the table should contains all columns.</p>
0debug
How does the Gerrit server intercept commits. Looking for technical details : <p>I understand that Gerrit receives git commits (using the <code>update</code> hook perhaps), and write them on a fake ref somewhere until the peer review is done, but how exactly does that process work in terms of the technical implementation? And what Git commands are involved?</p>
0debug
Java: validate a text : I'm using OCR to recognize (german) text in an image. It works good but not perfect. Sometimes a word gets messed up. Therefore I want to implement some sort of validation. Of course I can just use a wordlist and find words that are similar to the messed up word, but is there a way to check if the sentence is plausible with these words? After all my smartphone can give me good suggestions on how to complete a sentence
0debug
FileUpload1.SaveAs(Server .MapPath ("resume\\"+FileUpload1.FileName + " ")); StatusLabel.Text = "Upload status: File uploaded!"; : FileUpload1.SaveAs(Server .MapPath ("resume\\"+FileUpload1.FileName + " ")); StatusLabel.Text = "Upload status: File uploaded;
0debug
Im watching the tutorials on unity. Error CS1002 and Error CS1519 pops up. does anyone know how to fix error? : <p>I copied what the script says in video but it gives me errors.</p> <p>The video is called- "Unity 5- Roll a Ball Game - 3 of 8: Moving the Camera - Unity Official Tutorial" Timeframe "4:32" is where you will see the full script in video</p> <p>Script (image)-</p> <p>line 9 is where all three errors are taken place </p> <p>line 9-</p> <p>Private Vector3 offset3;</p> <p>errors- </p> <p>Error CS1002 ; expected </p> <p>Error CS1519 Invalid token ';' in class, struct, or interface member declaration </p> <p>Error CS1519 Invalid token ';' in class, struct, or interface member declaration</p> <p>screenshot-<br> <a href="https://i.stack.imgur.com/vyEsR.png" rel="nofollow noreferrer">script in visual studios and errors</a></p>
0debug
wirdest eror in c# page : the c# code: using (c) { c.Open(); using (SqlCommand command = new SqlCommand("DELETE FROM [User] WHERE Username like @username", c)) { command.Parameters.AddWithValue("@username", txtuser.Text); command.ExecuteNonQuery(); } c.Close(); } Response.Redirect("Manger Control.aspx", true); } the eror: > An exception of type 'System.InvalidOperationException' occurred in > System.Data.dll but was not handled in user code > > Additional information: The connection was not closed. The > connection's current state is open.
0debug
Scratch file not running on IntelliJ IDEA : <p>I am trying to run a <strong>Kotlin</strong> <a href="https://www.jetbrains.com/help/idea/scratches.html" rel="noreferrer">scratch file</a> in IntelliJ just like you would run a Java scratch file, but it doesn't work.</p> <p>I created a new Kotlin scratch file, but can't run the code even after attempting the following:</p> <ul> <li>Create a <code>main</code> function and print something inside.</li> <li>Print something with <code>println</code> outside of the main function.</li> <li>Create a <code>class</code> with a <code>main</code> function inside and <code>println</code> something.</li> </ul> <p>When I create a new kotlin project, the project runs fine. The issue happens only with scratch files. I am using kotlin plugin version 1.1.51 on IntelliJ 2017.1</p> <p>As the screenshot shows, the icon that allows you to run kotlin code doesn't show up on the left of the editor window:</p> <p><a href="https://i.stack.imgur.com/dcoLj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dcoLj.png" alt="enter image description here"></a></p>
0debug
class="fa fa-facebook share function not working : <p>Currently on my website when user click the share icon to share a product on their own facebook profile, nothing happens. </p> <p>When users click on the share icon for Twitter, they are able to share a prewritten tweet about the product. </p> <p>I'm not sure why the facebook icon is not working correctly. I'm using a very old version of the wordpress theme Bridge.</p> <p>Thank you, </p> <p>this is on <a href="http://www.frankmurphyfashions.com/product/reversible-tote-charges-phone/" rel="nofollow noreferrer">http://www.frankmurphyfashions.com/product/reversible-tote-charges-phone/</a> but is happening for all our products.</p>
0debug
Java for:each loop problem doesn't work while for loop works on the same programm.Can anybody tell the difference and tell me why? : *Java for:each loop problem doesn't work while for loop works on the same programm.Can anybody tell the difference and tell me why?* package pkgtry; public class Try{ public static void main(String args[]) { int array[] = {1,45,57,313,56,1,235,213,352323,547,441,56,2314}; System.out.println("Ta stoixeia tou pinaka prin thn taxinomhsh: "); for (int i : array){ System.out.print(" " + array[i]); } System.out.println(); Try.insertionSort(array); System.out.println("Ta stoixeia tou pinaka meta thn taxinomhsh: "); for (int i : array){ System.out.print(" " + array[i]); } } public static void insertionSort(int array[]){ for(int i=1; i<array.length; i++){ int current = array[i]; int j=i; while(j>0 && array[j -1]> current){ array[j] = array[j-1]; j--; } array[j] = current; } } }
0debug
Jquery Button Disable : Hello I want to disable my button if any of my **.Info** div contains `<i>` tag contains a specific class I am trying to do it button nothing works for me **Here is my code** $(document).ready(function() { $(".Info").change(function () { var str = ""; if ($("i.fa fa-times").length > 0) { $('#jsbutton').attr('disabled', 'disabled'); } else { $('#jsbutton').removeAttr('disabled'); } }); }); **and here is my Fiddle** https://jsfiddle.net/h7a1hhsw/
0debug
cant understand what is wrong with my code : <p>Write a function name " month_days" that receive a parameter(m) which represent a number between 1-12 (months of the year). The function returns how many days in that month[in January(1)there are 31 days'and so on).If the number is not between 1-12 the function will return -1 </p> <pre><code>def month_days(m): if m = 1: return 31 elif m = 2: return 28 elif m = 3: return 31 elif m = 4: return 30 elif m = 5: return 31 elif m = 6: return 30 elif m = 7: return 31 elif m = 8: return 31 elif m = 9: return 30 elif m = 10: return 31 elif m = 11: return 30 elif m = 12: return 31 </code></pre> <p>The IDE shows that there is something wrong with the code and i cant understand whats wrong</p>
0debug
Selenium:ElementNotVisibleException : I tried to testing [phptravel][1] and click on the myaccount link but selenium return me ElementNotVisibleException when i click on it. What wrong with it? Please help me to solve it. Thanks in advance. public void login(WebDriver driver) { driver.navigate().to("https://www.phptravels.net/"); WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.elementToBeClickable(By.xpath("/html/body/nav/div/div[1]/a"))); // Error on here myAccount.click(); WebDriverWait myAccountWait = new WebDriverWait(driver, 10); myAccountWait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id=\"li_myaccount\"]/ul"))); loginLink.click(); WebDriverWait loginWait = new WebDriverWait(driver, 10); //loginWait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id=\\\"loginfrm\\\"]/div[1]/div[5]/div/div[1]/input"))); username.sendKeys("user@phptravels.com"); password.sendKeys("demouser"); loginBtn.click(); } [1]: https://www.phptravels.net/
0debug
how to redirect user from viewing a page with no token php : <p>I am trying to write an php page that will use a token system to be viewed currently i have my page but I can't secure it if you visit the url with no token it throw some errors about undefined variable i need to redirect the person visiting without the creditianls to an error page rather than having the serve through undefined variable T any help towards the right direction on how to use the if (issert) statement to check please</p>
0debug
Want to push some key value pair to a nested json : JSON: 1 { "sourcePath": "vv", "targetPath": "bb" } I'm get a key value pair like JSON:1 and already I have a nested json like JSON:2 JSON : 2 { "user": "hdpsrvc", "update": "13/06/2016 17:43:22", "template": "template_1", "formBody": [ { "tabIndex": 0, "type": "text", "name": "sourcePath", "label": "Source path" }, { "tabIndex": 1, "type": "text", "name": "targetPath", "label": "Target path" } ], } and I want to push the key value pair of JSON:1 to nested json like below (please see the red mark bold key value pair under formBody) { "user": "hdpsrvc", "update": "13/06/2016 17:43:22", "template": "template_1", "formBody": [ { "tabIndex": 0, "type": "text", "name": "sourcePath", "label": "Source path", "sourcePath": "vv" }, { "tabIndex": 1, "type": "text", "name": "targetPath", "label": "Target path", "targetPath": "bb" } ], } I'm working with angular Thanks in advance.
0debug
Setting a textView equal to a value in an Array Java : <p>I have written some simple code to generate a random value in my array. It generates that random value, but I cannot set my textView equal to that value. This is a very simple problem, but I can't seem to find the solution anywhere.</p> <p>Here is my code...</p> <pre><code>final String[] group_topics = {"Walking", "Swimming", "Running"}; public void getRandomTopic1() { Random random = new Random(); int index = random.nextInt(group_topics.length); topicOne.setText(group_topics[index]); topicOne = (TextView) findViewById(R.id.textView2); } </code></pre>
0debug
Undefined reference to sleep, even though I included unistd.h : Trying to use sleep() to pause my program briefly. Except when i "make" I get an undefined reference to sleep ,even though I include unistd.h at the top. I'm using linux but all the solutions I found to this problem were for people on Windows. Any suggestions? Thanks
0debug
IsNullOrEmpty' does not exist in the current context : <p>I have this code:</p> <pre><code>public static FormattedString AddParagraph(this FormattedString formattedString, string text) { if (IsNullOrEmpty(text)) return formattedString; else { formattedString.Spans.Add(new Span { Text = text + Environment.NewLine + Environment.NewLine, ForegroundColor = Color.FromHex("555555") }); return formattedString; } } </code></pre> <p>But it's telling me: The name 'IsNullOrEmpty' does not exist in the current context </p> <p>Can anyone give me advice on how I can check if this string is "" or it has something other than ""?</p>
0debug
static variables memory footprint : **Approach 1**: Say I have a constant in 500 (five hundred) classes like this: public static final String NAME = "CHICAGO"; **Approach 2**: Or I can just store it in one class and import that class in those 500 classes and invoke it directly `Constants.NAME`. public class Constants { private Constants() { } public static final String NAME = "CHICAGO"; } Can someone please answer me what is the memory footprint of either approaches? Approach A will take more memory? Or Approach B will take equivalent memory? This question is only about memory footprint.
0debug
parsley.js is not working in my django form validation : This code in django does not show any validation error.Am i missing any syntax or tag ? ` <head> <link rel="stylesheet" type="text/css" href="/static/css/side_file.css"> <script type="text/javascript" src="/static/js/parsley.js"> </script> <link rel="stylesheet" type="text/css" href="/static/css/side_file.css"> <script type="text/javascript" src="/static/js/parsley.js"> </script> </head>` ` <body> <form data-parsley-validate method="POST"> {{form}} </form> </body>`
0debug
GuestExec *qmp_guest_exec(const char *path, bool has_arg, strList *arg, bool has_env, strList *env, bool has_input_data, const char *input_data, bool has_capture_output, bool capture_output, Error **err) { GPid pid; GuestExec *ge = NULL; GuestExecInfo *gei; char **argv, **envp; strList arglist; gboolean ret; GError *gerr = NULL; gint in_fd, out_fd, err_fd; GIOChannel *in_ch, *out_ch, *err_ch; GSpawnFlags flags; bool has_output = (has_capture_output && capture_output); arglist.value = (char *)path; arglist.next = has_arg ? arg : NULL; argv = guest_exec_get_args(&arglist, true); envp = has_env ? guest_exec_get_args(env, false) : NULL; flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD; #if GLIB_CHECK_VERSION(2, 33, 2) flags |= G_SPAWN_SEARCH_PATH_FROM_ENVP; #endif if (!has_output) { flags |= G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL; } ret = g_spawn_async_with_pipes(NULL, argv, envp, flags, guest_exec_task_setup, NULL, &pid, has_input_data ? &in_fd : NULL, has_output ? &out_fd : NULL, has_output ? &err_fd : NULL, &gerr); if (!ret) { error_setg(err, QERR_QGA_COMMAND_FAILED, gerr->message); g_error_free(gerr); goto done; } ge = g_new0(GuestExec, 1); ge->pid = gpid_to_int64(pid); gei = guest_exec_info_add(pid); gei->has_output = has_output; g_child_watch_add(pid, guest_exec_child_watch, gei); if (has_input_data) { gei->in.data = g_base64_decode(input_data, &gei->in.size); #ifdef G_OS_WIN32 in_ch = g_io_channel_win32_new_fd(in_fd); #else in_ch = g_io_channel_unix_new(in_fd); #endif g_io_channel_set_encoding(in_ch, NULL, NULL); g_io_channel_set_buffered(in_ch, false); g_io_channel_set_flags(in_ch, G_IO_FLAG_NONBLOCK, NULL); g_io_add_watch(in_ch, G_IO_OUT, guest_exec_input_watch, &gei->in); } if (has_output) { #ifdef G_OS_WIN32 out_ch = g_io_channel_win32_new_fd(out_fd); err_ch = g_io_channel_win32_new_fd(err_fd); #else out_ch = g_io_channel_unix_new(out_fd); err_ch = g_io_channel_unix_new(err_fd); #endif g_io_channel_set_encoding(out_ch, NULL, NULL); g_io_channel_set_encoding(err_ch, NULL, NULL); g_io_channel_set_buffered(out_ch, false); g_io_channel_set_buffered(err_ch, false); g_io_add_watch(out_ch, G_IO_IN | G_IO_HUP, guest_exec_output_watch, &gei->out); g_io_add_watch(err_ch, G_IO_IN | G_IO_HUP, guest_exec_output_watch, &gei->err); } done: g_free(argv); g_free(envp); return ge; }
1threat
Python - How do I create a tile based movement with non integer movement? : everything is in the title, I know how to create a tile based movement and create non integer movement but not both together. Here is what I aldready done : self.acc = vec(0 ,0) keystate = pygame.key.get_pressed() if keystate[pygame.K_UP]: self.acc.y = -PLAYER_ACC if keystate[pygame.K_DOWN]: self.acc.y = PLAYER_ACC if keystate[pygame.K_LEFT]: self.acc.x = -PLAYER_ACC if keystate[pygame.K_RIGHT]: self.acc.x = PLAYER_ACC self.acc += self.vel * PLAYER_FRICTION self.vel += self.acc if abs(self.vel.x) < 0.1: self.vel.x = 0 if abs(self.vel.y) < 0.1: self.vel.y = 0 self.pos += self.vel * self.game.dt self.rect.center = self.pos Thank you.
0debug
Looping through object properties of an array and comparing : <p>I've got an array of objects containing several properties, looking something like this:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>[ { "title" = "Test", "prop1" = 4, "prop2" = 6 }, { "title" = "Test2", "prop1" = 5, "prop2" = 7 }, { "title" = "Test", "prop1" = 6, "prop2" = 14 } ]</code></pre> </div> </div> </p> <p>What I want to do, is…</p> <ul> <li>looping through the objects</li> <li>comparing the title, to only have one output per title later on</li> <li>sum up the properties of the objects with the same title</li> </ul> <p>So in the end my output would be something like…</p> <ul> <li>Test, 10, 20</li> <li>Test2, 5, 7</li> </ul> <p>I tried to store values in variables, comparing these variables, but this only worked for two sets of data and in my case there can be also five, ten or 15 sets of data with the same title.</p> <p>Any help appreciated, thanks! :)</p> <p><em>Additional information: I need to access the properties by name, like</em> <code>data[1]['title']</code></p>
0debug
def check_smaller(test_tup1, test_tup2): res = all(x > y for x, y in zip(test_tup1, test_tup2)) return (res)
0debug
Add strong typing for react navigation props : <p>I'm using typescript in my react-native project(expo).</p> <p>The project uses react-navigation, so on my screens I can set <code>navigationOptions</code> and I have access to the prop <code>navigation</code>.</p> <p>Now I'm trying to strongly type these so I get hints for what properties are available to set.</p> <pre><code>interface NavStateParams { someValue: string } interface Props extends NavigationScreenProps&lt;NavStateParams&gt; { color: string } class Screen extends React.Component&lt;Props, any&gt; { // This works fine static navigationOptions: NavigationStackScreenOptions = { title: 'ScreenTitle' } // Does not work static navigationOptions: NavigationStackScreenOptions = ({navigation, screenProps }) =&gt; ({ title: navigation.state.params.someValue }) } </code></pre> <p>What would be the best way to handle react-navigation as props for components.</p>
0debug
Material UI Tooltip Stays Open after triggered Dialog is closed : <p>My assumption is the state of the Dialog is causing the issue, but I have not been able to figure this out. The Tooltip works as intended until the IconButton is clicked. The Dialog pops up as it should but when the dialog is exited, the Tooltip pops up as active.</p> <pre><code>class DeleteDocument extends React.Component { state = { open: false, }; onDeleteFile() { try { ensureJobIsUnlocked(); } catch (err) { return; } const confirmedByUser = true; if (confirmedByUser) { this.props.onDeleteFile(this.props.selectedDocument.id); this.setState({ open: false }); } } handleClickOpen = () =&gt; { this.setState({ open: true }); }; handleClose = () =&gt; { this.setState({ open: false }); }; render() { return ( &lt;div&gt; &lt;Tooltip id="tooltip-icon" title="Delete Document"&gt; &lt;div&gt; &lt;IconButton disabled={(this.props.selectedDocument == null)} onClick={this.handleClickOpen} &gt; &lt;DeleteIcon /&gt; &lt;/IconButton&gt; &lt;/div&gt; &lt;/Tooltip&gt; &lt;Dialog open={this.state.open} onClose={this.handleClose} aria-labelledby="alert-dialog-title" aria-describedby="alert-dialog-description" &gt; &lt;DialogTitle id="alert-dialog-title"&gt;{'Delete Document'}&lt;/DialogTitle&gt; &lt;DialogContent&gt; &lt;DialogContentText id="alert-dialog-description"&gt; This will delete the currently active PDF/Component Design. Are you sure you want to do this? &lt;/DialogContentText&gt; &lt;/DialogContent&gt; &lt;DialogActions&gt; &lt;Button onClick={this.handleClose} color="primary"&gt; Cancel &lt;/Button&gt; &lt;Button onClick={this.onDeleteFile.bind(this)} color="primary" autoFocus&gt; Delete &lt;/Button&gt; &lt;/DialogActions&gt; &lt;/Dialog&gt; &lt;/div&gt; ); } } </code></pre>
0debug
hi friends how to write convert xml file to xsl file. below code is xml file : xml file: how to taken by row tag fields _id,_uuid,_position,_address in xsl formate <response> <row> <row _id = "1570186" _uuid = "D284E0E9-9807-491F-9A1D-21CB47ABED10" _position = "1570186" _address = "http://data.montgomerycountymd.gov/resource/_4mse-ku6q/1570186"> <date_of_stop> 2014 - 09 - 30 T00: 00: 00 </date_of_stop> </row> </row> </response> how to convert xml file to xsl file. please send solution as early as possible. thank you
0debug
alert('Hello ' + user_input);
1threat
DISAS_INSN(scc) { int l1; int cond; TCGv reg; l1 = gen_new_label(); cond = (insn >> 8) & 0xf; reg = DREG(insn, 0); tcg_gen_andi_i32(reg, reg, 0xffffff00); gen_jmpcc(s, cond ^ 1, l1); tcg_gen_ori_i32(reg, reg, 0xff); gen_set_label(l1); }
1threat
local methods in a class (python) : <p>I have a class "NN" which trains a neural network. The problem is that some of the methods in the class can not be seen/used by the others, line 47 and 50 says "undefined name truncated_normal". I can create an "NN"-class, but when I try call say <code>nn.create_weights()</code> it throws an error, that "truncated_normal" does not exists. The same goes for <code>af(x)</code> and <code>daf(x)</code></p> <p><a href="https://i.stack.imgur.com/jeO1Q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jeO1Q.png" alt="enter image description here"></a></p> <p>Any suggestions?</p>
0debug