Tutorial by Examples: er

put this code inside your ViewHolder note: In this code I am using btnExpand click-event, for whole recyclerview click event you can set listener to itemView object. public class MyViewHolder extends RecyclerView.ViewHolder{ CardView cv; TextView recordName, visibleFile, date, t...
If you just want to get data, but not modify anything, you can turn off change tracking and proxy creation. This will improve your performance and also prevent lazy loading. Bad Example: using(var context = new Context()) { return await context.Set<MyEntity>().ToListAsync().ConfigureAw...
The alert method displays a visual alert box on screen. The alert method parameter is displayed to the user in plain text: window.alert(message); Because window is the global object, you can call also use the following shorthand: alert(message); So what does window.alert() do? Well, let's ta...
You can extend and register a component in one step: Vue.component('custom-component', { template: '<div>A custom component!</div>' }) Also when the component is registered locally: var Parent = Vue.extend({ components: { 'custom-component': { templa...
public class VolleyErrorHelper { /** * Returns appropriate message which is to be displayed to the user * against the specified error object. * * @param error * @param context * @return */ public static String ...
In order to obtain a Google Maps API key for your certificate, you must provide the API console with the SH1-fingerprint of your debug/release keystore. You can obtain the keystore by using the JDK's keytool program as described here in the docs. Another approach is to obtain the fingerprint progr...
It is perfectly fine to use a package name other than the folder name. If we do so, we still have to import the package based on the directory structure, but after the import we have to refer to it by the name we used in the package clause. For example, if you have a folder $GOPATH/src/mypck, and i...
Sometimes gotoAndStop() is called in the middle of the code that refers some frame-based properties. But, right after the frame is changed all links to properties that existed on the current frame are invalidated, so any processing that involves them should be immediately terminated. There are two ...
Iterators utilize a form of the for loop known as the generic for loop. The generic form of the for loop uses three parameters: An iterator function that gets called when the next value is needed. It receives both the invariant state and control variable as parameters. Returning nil signals term...
The Lua standard library provides two iterator functions that can be used with a for loop to traverse key-value pairs within tables. To iterate over a sequence table we can use the library function ipairs. for index, value in ipairs {'a', 'b', 'c', 'd', 'e'} do print(index, value) --> 1 a, ...
Both pairs and ipairs represent stateless iterators. A stateless iterator uses only the generic for loop's control variable and invariant state to compute the iteration value. Pairs Iterator We can implement the stateless pairs iterator using the next function. -- generator function which initial...
Stateful iterators carry some additional information about the current state of the iterator. Using Tables The addition state can be packed into the generic for loop's invariant state. local function chars_iter(t, i) local i = i + 1 if i <= t.len then return i, t.s:sub(i, i)...
import pandas as pd generate random DF df = pd.DataFrame(np.random.randint(0,10,size=(10, 3)), columns=list('ABC')) In [16]: print(df) A B C 0 4 1 4 1 0 2 0 2 7 8 8 3 2 1 9 4 7 3 8 5 4 0 7 6 1 5 5 7 6 7 8 8 6 7 3 9 6 4 5 select rows where value...
Example A var i,a,b,len; a = {x:0,y:0} function test(){ // return object created each call return {x:0,y:0}; } function test1(a){ // return object supplied a.x=0; a.y=0; return a; } for(i = 0; i < 100; i ++){ // Loop A b = test(); } for(i = 0; i < 100; ...
Without a try catch block, undefined functions will throw errors and stop execution: undefinedFunction("This will not get executed"); console.log("I will never run because of the uncaught error!"); Will throw an error and not run the second line: // Uncaught ReferenceError:...
Think of the mediator pattern as the flight control tower that controls planes in the air: it directs this plane to land now, the second to wait, and the third to take off, etc. However no plane is ever allowed to talk to its peers. This is how mediator works, it works as a communication hub among ...
Yii2 provides efficient ways to retrieve data from the database.Consider an example of a simple employee table having fields emp_id, emp_name and emp_salary. In order to retrieve the employee names and their salaries, we use the query. select emp_name,emp_salary from employee To generate the abo...
Multiple conditions can be written using where() method as given below. // Creates a new \yii\db\Query() object $query = new \yii\db\Query(); $rows = $query->select(['emp_name','emp_salary']) ->from('employee') ->where(['emp_name' => 'Kiran', 'emp_salary' => 2500...
Suppose we have a JSON string: ["first","second","third"] We can parse this JSON string into a String array : Gson gson = new Gson(); String jsonArray = "[\"first\",\"second\",\"third\"]"; String[] strings = gson.fromJson(j...

Page 178 of 417