Tutorial by Examples: any

SELECT item.item_id, ANY_VALUE(uses.tag) tag, COUNT(*) number_of_uses FROM item JOIN uses ON item.item_id, uses.item_id GROUP BY item.item_id shows the rows in a table called item, the count of related rows, and one of the values in the related table called uses. You can th...
from subprocess import check_call ok = check_call(['ffmpeg','-i','input.mp3','output.wav']) if ok: with open('output.wav', 'rb') as f: wav_file = f.read() note: http://superuser.com/questions/507386/why-would-i-choose-libav-over-ffmpeg-or-is-there-even-a-difference What are ...
In order to create an use a custome tag,we need to follow couple of steps: Create a tag file,defining the attributes used by it and any variables which will be used by the tag a. The attributes need to have a name,their type and and required field with a boolean value b. The variables will be...
Lets say there is roles and permissions. Each role may belongs to many permissions and each permission may belongs to many role. so there will be 3 tables. two models and one pivot table. a roles, users and permission_role table. Role Model public function permissions() { return $this->bel...
TestFldrChain() demonstrates how to reference any folder within any accessible store: Sub TestFldrChain() Dim Fldr As Folder Set Fldr = Session.Folders("A").Folders("A2"). _ Folders("A21").Folders("A213") Debug.Print...
In our AppServiceProvider.php public function boot() { HasMany::macro('toHasOne', function() { return new HasOne( $this->query, $this->parent, $this->foreignKey, $this->localKey ); }); } Suppose we have shop modal and ...
SDKMAN! is the Software Development Kit Manager for Java. It can be used to install and manage versions of the Spring Boot CLI as well as Java, Maven, Gradle, and more. $ sdk install springboot
// How many Items does a Sales Order have... // ... if we're in the context of a Sales Order record var itemCount = nlapiGetLineItemCount("item"); // ... or if we've loaded the Sales Order var order = nlapiLoadRecord("salesorder", 123); var itemCount = order.getLineItemC...
// How many lines in a sublist in SuiteScript 2.0... require(["N/record"], function (r) { var rec = r.load({ "type": r.Type.SALES_ORDER, "id": 123 }); // How many lines are on the Items sublist? var itemCount = rec.getLineCount...
#define kPaperSizeA4 CGSizeMake(595.2,841.8) First of all implement UIPrintPageRenderer protocol @interface UIPrintPageRenderer (PDF) - (NSData*) printToPDF; @end @implementation UIPrintPageRenderer (PDF) - (NSData*) printToPDF { NSMutableData *pdfData = [NSMutableData data]; ...
Using many ECHO commands to create a batch file: ( echo echo hi, this is the date today echo date /T echo echo created on %DATE% echo pause >nul )>hi.bat The command interpreter treats the whole section in parenthesis as a single command, then saves all the output to hi.bat. ...
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="${http.port}" doc:name="HTTP Listener Configuration"/> <db:mysql-config name="MySQL_Configuration" host="${db.host}" port="${db.port}"...
This is an example of how you would do a one to many mapping using XML. We will use Author and Book as our example and assume an author may have written many books, but each book will only have one author. Author class: public class Author { private int id; private String firstName; ...
/* these IN and OUT filerefs can point to anything */ filename in "anyfilehere.xlsx"; filename out "anyfilehere.xlsx"; /* copy the file byte-for-byte */ data _null_; length filein 8 fileid 8; filein = fopen('in','I',1,'B'); fileid = fopen('out','O',1,'B'); ...
So let's say you have two different entities, something like this: public class Person { public int PersonId { get; set; } public string Name { get; set; } } public class Car { public int CarId { get; set; } public string LicensePlate { get; set; } } public class MyDemoCon...
In the last example, you can see that EF figures out which column is the foreign key and where should it point to. How? By using conventions. Having a property of type Person that is named Person with a PersonId property leads EF to conclude that PersonId is a foreign key, and it points to the prima...
In the previous examples a car cannot exist without a person. What if you wanted the person to be optional from the car side? Well, it's kind of easy, knowing how to do one-to-many. Just change the PersonId in Car to be nullable: public class Car { public int CarId { get; set; } public s...
Let's move on to the other scenario, where every person can have multiple cars and every car can have multiple owners (but again, the relationship is bidirectional). This is a many-to-many relationship. The easiest way is to let EF do it's magic using conventions. Just change the model like this: ...
You might want to rename the fields in the join table to be a little more friendly. You can do this by using the usual configuration methods (again, it doesn't matter which side you do the configuration from): public class CarEntityTypeConfiguration : EntityTypeConfiguration<Car> { publi...
I have to admit, I'm not really a fan of letting EF infer the join table wihtout a join entity. You cannot track extra information to a person-car association (let's say the date from which it is valid), because you can't modify the table. Also, the CarId in the join table is part of the primary ke...

Page 5 of 6