Posts

Showing posts from October, 2001

C# Entity Framework Sqlquery Example

Example 1: entity framework with query c# using ( var ctx = new SchoolDBEntities ( ) ) { var studentName = ctx . Students . SqlQuery ( "Select studentid, studentname, standardId from Student where studentname='Bill'" ) . FirstOrDefault < Student > ( ) ; } //Reference Link //https://www.entityframeworktutorial.net/Querying-with-EDM.aspx Example 2: entity framework with query C# using ( var ctx = new SchoolDBEntities ( ) ) { var studentName = ctx . Students . SqlQuery ( "Select studentid, studentname, standardId from Student where studentname='Bill'" ) . FirstOrDefault < Student > ( ) ; } //https://www.entityframeworktutorial.net/Querying-with-EDM.aspx //https://www.entityframeworktutorial.net/EntityFramework4.3/raw-sql-query-in-entity-framework.aspx

Android - Can I Disable MTP Mode And Just Have A Regular USB Connection?

Answer : I'm not 100% sure. But IIRC, the problem with normal USB storage is Android has to partition your phone for internal storage and USB storage. Your computer can then umount the USB storage from phone and mount it in your computer. So in many phones without MTP, even though the internal storage had capacity like 16GB, only 1 or 2 GB was available for app installation. While some phone gave up to 8GB for app, that space was wasted for people who didn't need that much for app but needed space for music and photos. With MTP mode, there isn't separate partition but a whole single partition. So if you have 16GB internal storage in your phone, you can use whole 16GB for apps, music and photos. MTP mode is available from Honeycomb and I don't think it's an optional component. I mean I don't think you can say I don't want MTP mode, I want USB storage mode.

Convert String Array To Char Array Code Example

Example 1: java string to char array String str = "example" ; char [ ] ch = str . toCharArray ( ) ; Example 2: char array to string java char [ ] a = { 'h' , 'e' , 'l' , 'l' , 'o' , ' ' , 'w' , 'o' , 'r' , 'l' , 'd' } ; String str = new String ( a ) ; Example 3: Convert char array to string in java // java convert array of char to string public class CharArrayToString { public static void main ( String [ ] args ) { char [ ] charArray = new char [ ] { 'F' , 'l' , 'o' , 'w' , 'e' , 'r' , 'B' , 'r' , 'a' , 'c' , 'k' , 'e' , 't' , 's' } ; String str = new String ( charArray ) ; System . out . println ( str ) ; } } Example 4: convert string to char array in java String str = "example" ; char [ ] ch = str . toCh

Css Opacity Transition Example

Example 1: css transition opacity /* Answer to: "css transition opacity" */ /* CSS transitions allows you to change property values smoothly, over a given duration. */ .myClass { vertical-align : top ; transition : opacity 0.3 s ; /* Transition should take 0.3s */ -webkit-transition : opacity 0.3 s ; /* Transition should take 0.3s */ opacity : 1 ; /* Set opacity to 1 */ } .myClass :hover { opacity : 0.5 ; /* On hover, set opacity to 2 */ } /* From `opacity: 1;` to `opacity: 0.5;`, the transition time should take 0.3 seconds as soon as the client starts to hover over the element. */ Example 2: css opacity animation <style > .myelement { animation : fade-out ; } @keyframes fade-out { 0% { opacity : 1.0 } 100 { opacity : 0.0 } } </style> Example 3: opacity transition in css /* Opacity transition in CSS By using this we can add element transition with some delay. And due to transition delay its look like animatio

Hide Horizontal Scrollbar Css Code Example

Example 1: DISABLE the Horizontal Scroll html , body { max-width : 100 % ; overflow-x : hidden ; } Example 2: hide scrollbar css /* Hide scrollbar for Chrome, Safari and Opera */ .scrollbar-hidden ::-webkit-scrollbar { display : none ; } /* Hide scrollbar for IE, Edge add Firefox */ .scrollbar-hidden { -ms-overflow-style : none ; scrollbar-width : none ; /* Firefox */ } Example 3: hide horizontal scrollbar css .x-scroll-disabled { overflow-x : hidden ; } Example 4: remove horizontal scrollbar css overflow-x : hidden ; Example 5: hide scrollbar css /* A very quick an applicable solution is to use this piece of code: */ html { overflow : scroll ; overflow-x : hidden ; } ::-webkit-scrollbar { width : 0 px ; /* remove scrollbar space / background: transparent; / optional: just make scrollbar invisible / } / optional: show position indicator in red */ ::-webkit-scrollbar-thumb { background : #FF0000 ; } Example 6: hide scrollbar html css /* On Chrome

Bootstrap Modal Show Jquery Code Example

Example 1: onclick open modal jquery $ ( '#myModal' ) . modal ( 'toggle' ) ; $ ( '#myModal' ) . modal ( 'show' ) ; $ ( '#myModal' ) . modal ( 'hide' ) ; Example 2: programmatically show modal boostrap $ ( '#myModal' ) . modal ( 'show' ) ; Example 3: onclick open modal jquery $ ( '#myModal' ) . modal ( 'show' ) ; Example 4: hide bootstrap modal jquery $ ( document ) . ready ( function ( ) { $ ( ".btn" ) . click ( function ( ) { $ ( "#myModal" ) . modal ( 'hide' ) ; } ) ; } ) ; Example 5: how to show bootstrap modal < script > var myModal = new bootstrap . Modal ( document . getElementById ( 'ModalID' ) ) myModal . show ( ) < / script > Example 6: onclick open modal jquery $ ( '#my-modal' ) . modal ( { show : 'false' } ) ;

ADB Driver And Windows 8.1

Answer : UPDATE: Post with images ➤ English Version | Versión en Español If Windows fails to enumerate the device which is reported in Device Manager as error code 43 : Install this Compatibility update from Windows. If you already have this update but you get this error, restart your PC (unfortunately, it happened to me, I tried everything until I thought what if I restart...). If the device is listed in Device Manager as Other devices -> Android but reports an error code 28 : Google USB Driver didn't work for me. You could try your corresponding OEM USB Drivers, but in my case my device is not listed there. So, install the latest Samsung drivers: SAMSUNG USB Driver v1.7.23.0 Restart the computer ( very important ) Go to Device Manager, find the Android device, and select Update Driver Software . Select Browse my computer for driver software Select Let me pick from a list of device drivers on my computer Select ADB Interface from the list Select SAMSUN

CSS Media Queries For Screen Sizes

Answer : Put it all in one document and use this: /* Smartphones (portrait and landscape) ----------- */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } /* Smartphones (landscape) ----------- */ @media only screen and (min-width : 321px) { /* Styles */ } /* Smartphones (portrait) ----------- */ @media only screen and (max-width : 320px) { /* Styles */ } /* iPads (portrait and landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* Styles */ } /* iPads (landscape) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* Styles */ } /* iPads (portrait) ----------- */ @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) { /* Styles */ } /* Desktops and laptops ----------- */ @media only screen and (min-width : 1224px) { /* Styles */ } /

C++ Qt QFuture Code Example

Example: c++ qt QFuture QFuture intFuture = QtFuture::connect(&object, &MyObject::mySignal);

Calling Non-Static Method In Static Method In Java

Answer : The only way to call a non-static method from a static method is to have an instance of the class containing the non-static method. By definition, a non-static method is one that is called ON an instance of some class, whereas a static method belongs to the class itself. You could create an instance of the class you want to call the method on, e.g. new Foo().nonStaticMethod(); Firstly create a class Instance and call the non-static method using that instance. e.g, class demo { public static void main(String args[]) { demo d = new demo(); d.add(10,20); // to call the non-static method } public void add(int x ,int y) { int a = x; int b = y; int c = a + b; System.out.println("addition" + c); } }

Cdnjs Vue Code Example

Example 1: vue js cdn < script src = "https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js" > < / script > Example 2: vue cdn < script type = "module" > import Vue from 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.esm.browser.js' < / script >

Bootstrap Responsive Button Code Example

Example 1: bootstrap a link disabled <a class= "btn disabled" href= "#" >Disabled link</a> Example 2: bootstrap buttons Sizes Fancy larger or smaller buttons? Add .btn-lg or .btn-sm for additional sizes. <button type= "button" class= "btn btn-primary btn-lg" >Large button</button> <button type= "button" class= "btn btn-secondary btn-lg" >Large button</button> <button type= "button" class= "btn btn-primary btn-sm" >Small button</button> <button type= "button" class= "btn btn-secondary btn-sm" >Small button</button> <button type= "button" class= "btn btn-primary btn-lg btn-block" >Block level button</button> <button type= "button" class= "btn btn-secondary btn-lg btn-block" >Block level button</button> <a href= "#" class= "btn btn-pr

H2 Css Style Line Spacing Code Example

Example 1: line spacing css line-height : 20 px ; /* 4px +12px + 4px */ /* OR */ line-height : 1.7 em ; /* 1em = 12px in this case. 20/12 == 1.666666 */ Example 2: css line spacing line-height : 1.5 ; /* Prefered */ line-height : 1.5 em ; line-height : 150 % ; line-height : 24 px ;

Javascript Dom Onclick This Code Example

Example 1: javascript onclick document .getElementById ( "myBtn" ) .addEventListener ( "click" , function ( ) { alert ( "Hello World!" ) ; } ) ; Example 2: javascript onclick // The element id ( TheElementID ) and var name ( myElement ) can be named anything. var myElement = document. getElementByID ( 'TheElementID' ) ; myElement .onclick = function ( ) { // Carry out a function here... }

26 Inch To Cm Code Example

Example: inch to cm 1 inch = 2.54 cm

Howw To Print A Double C Code Example

Example: print double in c # include <stdio.h> int main ( ) { double d = 123.32445 ; //using %f format specifier printf ( "Value of d = %f\n" , d ) ; //using %lf format specifier printf ( "Value of d = %lf\n" , d ) ; return 0 ; }

How To Print Memory Address In C Code Example

Example: how to print the address of a pointer in c int a = 42 ; printf ( "%p\n" , ( void * ) & a ) ;