Posts

Showing posts from May, 2012

How To Rotate Background-image In Css Code Example

Example: rotate background image css .theWholeElement { transform : rotate ( 30 deg ) ; } .justTheBackground { position : relative ; overflow : hidden ; } .justTheBackground ::before { content : "" ; position : absolute ; width : 200 % ; height : 200 % ; top : -50 % ; left : -50 % ; z-index : -1 ; background : url ( background.png ) 0 0 repeat ; transform : rotate ( 30 deg ) ; }

Html Css Space Between Paragraphs Code Example

Example: increase the distance between paragraphs css p { margin-top : 2 em ; margin-bottom : 2 em ; }

ConfigurationManager In WPF

Answer : Just add an app.config and not web.config because it is not a web application. And after that it's too simple, just add a reference to to System.Configuration and then use this. var ConnStr = ConfigurationManager.AppSettings["Trackboard"]; I've figured it out! I shouldn't have created a new config file. There is a default app.config file in the project. Now everything is fine. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <connectionStrings> <add name="Trackboard.Properties.Settings.TrackboardConnectionString" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\DATABASE\Trackboard.mdf;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings> </configuration> private static string ConnStr = ConfigurationMana

Scrollbar Appears Only When Mouse Scroll Using Jquery Codepen Code Example

Example: javascript on scroll change nav color $ ( function ( ) { $ ( document ) .scroll ( function ( ) { var $nav = $ ( ".navbar-fixed-top" ) ; $nav. toggleClass ( 'scrolled' , $ ( this ) . scrollTop ( ) > $nav. height ( ) ) ; } ) ; } ) ;

Bootstrap Modal Js Cdn Code Example

Example 1: open bootstrap modal using javascript $("#myModal").modal(); //open modal $('#myModal').modal('toggle'); //open modal $('#myModal').modal('show'); //open modal $('#myModal').modal('hide'); //hide modal //@sujay Example 2: open bootstrap modal with javascript $("#myModal").modal()

Css3 Keyframes Animation Generator Code Example

Example: animation generator css <div id= "animated-example" class= "animated zoomIn" ></div>

Footer Code W3schools Code Example

Example: html footer <footer> <!-- Footer links --> <nav> <a href= "some-url" target= "_blank" >Footer link</a> <!-- opens in new tab --> <a href= "some-url" >Footer link</a> <a href= "some-url" >Footer link</a> </nav> <!-- Copyright footnote --> &copy ; 2020 Some copyright message. <!-- Contact link --> <address> Contact <a href= "mailto:me@mailservice.com" >me</a> </address> </footer>

Android: Check If Location Services Enabled Using Fused Location Provider

Answer : This android developer training tutorial could help - here's the basics: Code to run in your Activity onCreate(): // Create an instance of GoogleAPIClient. if (mGoogleApiClient == null) { mGoogleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(LocationServices.API) .build(); } mGoogleApiClient.connect(); LocationRequest mLocationRequest = new LocationRequest(); mLocationRequest.setInterval(10000); mLocationRequest.setFastestInterval(5000); mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder() .addLocationRequest(mLocationRequest); PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, builder.build())

000webhost Login Code Example

Example: 000webhost Can anyone help me? 000Webhost is bugging out. Discord: Axqua#2244

Border Radius Only Right Side Flutter Code Example

Example: flutter container border radius only left borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), bottomRight: Radius.circular(10.0)),

Bit Shift C Code Example

Example 1: bitwise operator bitwise complement of N = ~ N ( represented in 2 's complement form ) 2 'complement of ~ N = - ( ~ ( ~ N ) + 1 ) = - ( N + 1 ) Example 2: bitshift c i = 14 ; // Bit pattern 00001110 j = i >> 1 ; // here we have the bit pattern shifted by 1 thus we get 00000111 = 7 which is 14/2 Example 3: bitshift c int i = 7 ; // Decimal 7 is Binary (2^2) + (2^1) + (2^0) = 0000 0111 int j = 3 ; // Decimal 3 is Binary (2^1) + (2^0) = 0000 0011 k = ( i << j ) ; // Left shift operation multiplies the value by 2 to the power of j in decimal // Equivalent to adding j zeros to the binary representation of i // 56 = 7 * 2^3 // 0011 1000 = 0000 0111 << 0000 0011 Example 4: c right bit shift // 5: 0...0101 int a = 5 ; //shift int a 2 bits int n = ( a >> 2 ) ;

Js String To Integer Code Example

Example 1: how to convert string to int js let string = "1" ; let num = parseInt ( string ) ; //num will equal 1 as a int Example 2: Javascript string to int var myInt = parseInt ( "10.256" ) ; //10 var myFloat = parseFloat ( "10.256" ) ; //10.256 Example 3: string to number javascript // Method - 1 ### parseInt() ### var text = "42px" ; var integer = parseInt ( text , 10 ) ; // returns 42 // Method - 2 ### parseFloat() ### var text = "3.14someRandomStuff" ; var pointNum = parseFloat ( text ) ; // returns 3.14 // Method - 3 ### Number() ### Number ( "123" ) ; // returns 123 Number ( "12.3" ) ; // returns 12.3 Number ( "3.14someRandomStuff" ) ; // returns NaN Number ( "42px" ) ; // returns NaN Example 4: convert string to number javascript var myString = "869.99" var myFloat = parseFloat ( myString ) var myInt = parseInt ( myString ) Example

Odometer Js Animation Not Working On Chrome Code Example

Example: chrome css animation not working Can you check those OS settings and confirm that the animations are not turned off? OSX : Settings > General > Accessibility > Reduce Motion IOS : System Preferences > Accessibility > Display > Reduce Motion Windows : Settings > Ease of Access > Show animations in Windows

./images/bootstrap-logo.png React Code Example

Example 1: import img react import shoe1 from './img/shoe_01 .jpg ' const Shoe = ( e ) = > { return ( <div className="shoe-container" > <img src= { shoe1 } alt= "" /> </div> ) ; } Example 2: how to use saved image on react <img alt="timer" src= { require ( './images/timer.png' ) } />

Bulk POST/PUT API Requests Using POSTMAN Or Any Other Means

Image
Answer : Never mind I figured out a way to use postman's collection runner to accomplish the same. For those who struggled like the way I did, here is how to use that feature and its even easier to substitute values to your url on the go. First create a request in Postman: Below is a screenshot for Example : Now the requirement is to post the below url: https://someApiPOSTRequest/clientAssign?auth=123|asdf&otherParamsList=123Params&someOtherParams={{VariableFromFile}}&additionalParams=hardcodedOnURL with values being substituted for {{VariableFromFile}} from the csv file you will need to upload. Your csv should be formatted as below, where the header should have the same variable name used on your url: Click on the '>' button shown below beside Example folder and click on 'Run' to open the same on Collection runner window of postman: Once the Collection Runner window opens up, click on select file option to upload your csv

Cannot Find Module './in-memory-data-service' In Tour Of Heroes For Angular2

Answer : ng generate service InMemoryData --module=app Will create the src/app/in-memory-data.service.ts file. Then add the code listed in the tutorial and it will work. AFAIK they don't even imply that in the tutorial so don't feel bad. In fact what they say is The forRoot() configuration method takes an InMemoryDataService class that primes the in-memory database. The Tour of Heroes sample creates such a class src/app/in-memory-data.service.ts Which is gibberish and wrong. My projects created using current CLI Tools, and I installed this: npm install angular-in-memory-web-api --save It works for me. Just make sure all your bases are covered In your package.json , should match the one on this page. "angular-in-memory-web-api": "~0.1.1", Also, your systemjs.config file looks good too! In your app.module.ts , make sure that your in-memory-data-service import matches your file because in their example they have in-memory-data.service

Style Html5 Audio Player Code Example

Example: css customize audio player audio { filter : sepia ( 20 % ) saturate ( 70 % ) grayscale ( 1 ) contrast ( 99 % ) invert ( 12 % ) ; width : 200 px ; height : 25 px ; } /*or*/ audio : : -webkit-media-controls-panel audio : : -webkit-media-controls-mute-button audio : : -webkit-media-controls-play-button audio : : -webkit-media-controls-timeline-container audio : : -webkit-media-controls-current-time-display audio : : -webkit-media-controls-time-remaining-display audio : : -webkit-media-controls-timeline audio : : -webkit-media-controls-volume-slider-container audio : : -webkit-media-controls-volume-slider audio : : -webkit-media-controls-seek-back-button audio : : -webkit-media-controls-seek-forward-button audio : : -webkit-media-controls-fullscreen-button audio : : -webkit-media-controls-rewind-button audio : : -webkit-media-controls-return-to-realtime-button audio : : -webkit-media-controls-toggle-closed-captions-button

Border Radius Container Flutter Width Code Example

Example 1: container flutter border radius Container ( decoration : BoxDecoration ( color : Colors . blue , borderRadius : BorderRadius . all ( Radius . circular ( 10 ) ) ) ) Example 2: container border radius flutter Container ( child : Text ( 'This is a Container' , textScaleFactor : 2 , style : TextStyle ( color : Colors . black ) , ) , decoration : BoxDecoration ( borderRadius : BorderRadius . circular ( 10 ) , color : Colors . white , border : Border ( left : BorderSide ( color : Colors . green , width : 3 , ) , ) , ) , height : 50 , ) ,

Optional Function Typescript Interface Code Example

Example 1: ts interface optional parameter interface Person { name : string ; age : number ; phone? : string ; } let p: Person = { name : "Ashlee" , age : 29 } ; console. log ( p ) ; Example 2: typescript class implements interface interface Task { name : String ; //property run ( arg : any ) : void ; //method } class MyTask implements Task { name : String ; constructor ( name: String ) { this.name = name ; } run ( arg: any ) : void { console .log ( `running: $ { this.name } , arg: $ { arg } ` ) ; } } let myTask : Task = new MyTask ( 'someTask' ) ; myTask. run ( "test" ) ; Example 3: create method in interface for set TS running : someTask , arg : test

Ajax File Upload With Form Data Laravel 5.3

Answer : Try using the FormData in ajax while you upload a file. Just try this $('form').submit(function(event) { event.preventDefault(); var formData = new FormData($(this)[0]); $.ajax({ url: '{{ url('/agents') }}', type: 'POST', data: formData, success: function(result) { location.reload(); }, error: function(data) { console.log(data); } }); }); OR You can try with this jQuery library https://github.com/malsup/form EDIT public function store(Request $request) { if (User::where('phone_number', '=', Input::get('phone_number'))->exists()) { return $this->respondBadRequest('Phone Number Exists'); } else { $user=User::create($request->all()); if($request->hasFile('image')) { $file = $request->file('i

Android Studio 3.3 RC3 Theme Editor Missing

Image
Answer : According to this issue, the Theme Editor has been disabled. The fact that you get something with the double-shift search option suggests that there is a bug somewhere, as if the Theme Editor is an ex-feature, it should not show up in searches either. Theme Editor is still missing in 3.5 edition. The fact that it hasn't made itself back in makes me think it's been permanently cut. A real shame when there is not a good replacement. It's still possible to edit the theme directly through the styles.xml file, but you will need to look up the syntax yourself for each component. This article does reference the name of several of the components as well as what they are in project: http://www.informit.com/articles/article.aspx?p=2467490&seqNum=5 Android Studio 3.4 for Mac still doesn't have Theme Editor back. Alternative way can be like, In ' values/styles.xml ', you can see soft coded theme colors. It can be changed in ' values/colors.xml

Proxy Server Download Code Example

Example 1: proxy server A proxy server is kind of gateway between our application and the internet . Proxy servers provide varying levels of functionality , security , and privacy depending on your use case , needs , or company policy . Example 2: proxy server windows netsh interface portproxy add v4tov4 listenport = 80 connectaddress = ip - of - server - on - internet connectport = 23 listenaddress = ip - of - windows - machine protocol = tcp

How To Rotate Text In Html Code Example

Example 1: rotate text css .text { /* Browsers not below */ transform : rotate ( -90 deg ) ; /* Safari */ -webkit-transform : rotate ( -90 deg ) ; /* Firefox */ -moz-transform : rotate ( -90 deg ) ; /* Opera */ -o-transform : rotate ( -90 deg ) ; /* IE */ -ms-transform : rotate ( -90 deg ) ; } Example 2: css text rotation .rotate { transform : rotate ( -90 deg ) ; /* Legacy vendor prefixes that you probably don't need... */ /* Safari */ -webkit-transform : rotate ( -90 deg ) ; /* Firefox */ -moz-transform : rotate ( -90 deg ) ; /* IE */ -ms-transform : rotate ( -90 deg ) ; /* Opera */ -o-transform : rotate ( -90 deg ) ; /* Internet Explorer */ filter : progid : DXImageTransform.Microsoft. BasicImage ( rotation= 3 ) ; } Example 3: image rotate with css div { width : 80 px ; height : 80 px ; background-color : skyblue ; } .rotated { transform : rotate ( 45 deg ) ; /* Equal to rotateZ(45deg) */ background-col

Can I Boot Linux From A VHD?

Answer : yes, We just released a sample Linux VHD that you can boot any computer. You can find more info here: Download and boot your physical PC, also runs as vm - http://www.vmlite.com/index.php/forums/17-vboot/1864-linux-vhd-boot-available-download-and-boot-your-physical-pc-also-runs-as-vm 1 Linux as Real Appliance With VBoot for Linux, you can pre-install and pre-configure Linux OS and its applications, then distribute the resulting virtual disk file in VHD format. The vhd can boot a real computer, with configuration and apps instantly available. This way, operating systems are truly manageable, as simple as files. We call such a Linux VHD to be a real appliance, in the sense that it boots physical computers. It's very easy to setup and boot a computer with a vhd file. You download the vhd file, drop it to Windows or Linux file system, then configure the boot loader, and reboot the computer. 2 Linux as Virtual Appliance The exact same vhd file also runs as a vi