Posts

Showing posts from November, 2018

Alter Table Modify Column Oracle Code Example

Example 1: alter table column size oracle ALTER TABLE tablename MODIFY fieldname VARCHAR2 ( 100 ) ; Example 2: alter table oracle ALTER TABLE tablename MODIFY columnname varchar2 ( 100 ) Example 3: orcale sql change column type ALTER TABLE table_name MODIFY column_name action ; Example 4: oracle alter table add column ALTER TABLE table_name ADD column_name data_type constraint ;

C# Draw Rawpixels On Window Code Example

Example 1: how to draw a dot in c# private void Form1_Paint ( object sender , PaintEventArgs e ) { using ( Pen p = new Pen ( Brushes . Black ) ) { p . DashStyle = System . Drawing . Drawing2D . DashStyle . Dot ; e . Graphics . DrawLine ( p , 10 , 10 , 11 , 10 ) ; } } Example 2: c# windows forms draw pixel private void SetPixel_Example ( PaintEventArgs e ) { // Create a Bitmap object from a file. Bitmap myBitmap = new Bitmap ( "Grapes.jpg" ) ; // Draw myBitmap to the screen. e . Graphics . DrawImage ( myBitmap , 0 , 0 , myBitmap . Width , myBitmap . Height ) ; // Set each pixel in myBitmap to black. for ( int Xcount = 0 ; Xcount < myBitmap . Width ; Xcount ++ ) { for ( int Ycount = 0 ; Ycount < myBitmap . Height ; Ycount ++ ) { myBitmap . SetPixel ( Xcount , Ycount , Color . Black ) ; } } // Draw m

How To Find Vector Length In Numpy Matrix Code Example

Example: numpy how to length of vector >> > x = np . zeros ( ( 3 , 5 , 2 ) , dtype = np . complex128 ) >> > x . size 30 >> > np . prod ( x . shape ) 30

How To Compile Saas Scss To Css Command Line Code Example

Example: how to compile scss to css // Install node-sass npm i node-sass // In package .json : "scripts": { ... "scss" : "node-sass — watch scss -o css" } // Run the compilation npm run scss

Node Moudle React Bootstrap Index Code Example

Example 1: add bootstrap to react 1 .run commnad in cmd npm install bootstrap --save 2 .after install add this to index.js import 'bootstrap/dist/css/bootstrap.min.css' ; Example 2: install boostrap react npm install react-bootstrap bootstrap

Google Fonts Minions Font Code Example

Example 1: google font roboto @import url ( 'https://fonts.googleapis.com/css2?family=Roboto&display=swap' ) ; font-family : 'Roboto' , sans-serif ; Example 2: google fonts roboto //html <link rel= "preconnect" href= "https://fonts.gstatic.com" > <link href= "https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap" rel= "stylesheet" > //css @import url ( 'https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap' ) ; font-family : 'Roboto' , sans-serif ;

Bridge From Wifi To Ethernet Not Working (Windows 10)

Answer : Wi-Fi cannot be bridged to Ethernet. This is not a Windows limitation in any way. There’s a good explanation on why that is in the old OpenWrt wiki. Instead, you should use Internet Connection Sharing (ie. make your PC a router): Go to the Network Connections control panel (where you’re currently trying to create the bridge) Open your Wi-Fi connection’s properties. Switch to the “Sharing” tab Enable it, selecting your Ethernet connection as the “Home networking connection”. Everything should automatically work after that. Wi-Fi CAN be bridged to Ethernet on Windows 10. Connect to Internet via WiFi. Take note of your private IP settings (e.g. IP:192.168.1.44 SM:255.255.255.0 GW:192.168.1.1 DNS:192.168.1.1) In Control Panel > Network and Internet > Network Connections, highlight WiFi and Ethernet (use shift click or Ctrl Click or shift arrow key). Rt-click on highlighted area and choose "Bridge Connections" At this point, hosting PC will lik

Bypass Popup Blocker On Window.open When JQuery Event.preventDefault() Is Set

Answer : Popup blockers will typically only allow window.open if used during the processing of a user event (like a click). In your case, you're calling window.open later , not during the event, because $.getJSON is asynchronous. You have two options: Do something else, rather than window.open . Make the ajax call synchronous, which is something you should normally avoid like the plague as it locks up the UI of the browser. $.getJSON is equivalent to: $.ajax({ url: url, dataType: 'json', data: data, success: callback }); ...and so you can make your $.getJSON call synchronous by mapping your params to the above and adding async: false : $.ajax({ url: "redirect/" + pageId, async: false, dataType: "json", data: {}, success: function(status) { if (status == null) { alert("Error in verifying the status."); } else if(!status) { $("#agreement&quo

Addforce Unity 2d Example

Example: how to make rb.addforce 2d public Rigidbody rb ; //make reference in Unity Inspector public float SpeedX = 0.1f ; public float SpeedY = 0.5f ; rb . AddForce ( new Vector2 ( SpeedX , SpeedY ) ) ;

Convert To String In Python Code Example

Example 1: int to string python # Use the function str() to turn an integer into a string integer = 123 string = str ( integer ) string # Output: # '123' Example 2: how to make an int into a string python int x = 10 string p = str ( x ) Example 3: convert int to string python num = 333333 print ( str ( num ) ) Example 4: make int into string python number = 12 string_number = str ( number ) Example 5: to str python >> > str ( 10 ) '10' >> > int ( '10' ) 10 Example 6: how to convert to string in python str ( integer_value )

50 Minute Timer Code Example

Example: 20 minute timer for good eyesight every 20 minutes look out the window at something 20 feet away for 20 seconds

1 Oz To Grams Code Example

Example: oz to g 1 ounce (oz) = 28.3495231 grams (g)

Android Hide Keyboard Not Working - Cannot Hide Soft Keyboard

Answer : Changing HIDE_IMPLICIT_ONLY to 0 did it (after I changed to hideSoftInputFromWindow() from of hideSoftInputFromInputMethod() ). However I'm not sure why HIDE_IMPLICIT_ONLY isn't working since I am not explicitly opening the keyboard with a long press on Menu. Another option to prevent it from activity in AndroidManifest.xml file android:windowSoftInputMode="stateAlwaysHidden" - This method will prevent loading/showing keyboard when the activity is loaded. But when you click the editable component like edittext the keyboard will open. perfect for my requirement. <activity android:name=".Name" android:label="@string/app_name" android:windowSoftInputMode="stateAlwaysHidden"> 1.first bind your edit text token with keyboard and open i.e inputMethodManager.showSoftInput(_edittext, 0); //here _edittext is instance of view 2.keyboard will get hidden automatically if the edit

Converting A String To Int In Groovy

Answer : Use the toInteger() method to convert a String to an Integer , e.g. int value = "99".toInteger() An alternative, which avoids using a deprecated method (see below) is int value = "66" as Integer If you need to check whether the String can be converted before performing the conversion, use String number = "66" if (number.isInteger()) { int value = number as Integer } Deprecation Update In recent versions of Groovy one of the toInteger() methods has been deprecated. The following is taken from org.codehaus.groovy.runtime.StringGroovyMethods in Groovy 2.4.4 /** * Parse a CharSequence into an Integer * * @param self a CharSequence * @return an Integer * @since 1.8.2 */ public static Integer toInteger(CharSequence self) { return Integer.valueOf(self.toString().trim()); } /** * @deprecated Use the CharSequence version * @see #toInteger(CharSequence) */ @Deprecated public static Integer toInteger(String self) { return toInteg

Android Studio Setting Background Color Code Example

Example: android studio set background color YourView.setBackgroundColor(Color.argb(255, 255, 255, 255));

Grid Span All Columns 2 Row Code Example

Example: have an item span multiple columns css grid .item { grid-column : 2 / span 3 ; grid-row : 1 / span 2 ; }

Access Bool Arduino Code Example

Example: arduino bool bool var = 0 or 1;

66 Inches In Cm Code Example

Example: inch to cm 1 inch = 2.54 cm

Can We Rely On String.isEmpty For Checking Null Condition On A String In Java?

Answer : No, absolutely not - because if acct is null, it won't even get to isEmpty ... it will immediately throw a NullPointerException . Your test should be: if (acct != null && !acct.isEmpty()) Note the use of && here, rather than your || in the previous code; also note how in your previous code, your conditions were wrong anyway - even with && you would only have entered the if body if acct was an empty string. Alternatively, using Guava: if (!Strings.isNullOrEmpty(acct)) Use StringUtils.isEmpty instead, it will also check for null. Examples are: StringUtils.isEmpty(null) = true StringUtils.isEmpty("") = true StringUtils.isEmpty(" ") = false StringUtils.isEmpty("bob") = false StringUtils.isEmpty(" bob ") = false See more on official Documentation on String Utils. You can't use String.isEmpty() if it is null. Best is to have your own method to check nul

Bootstrap Panel In Bootstrap 4 Code Example

Example: bootstrap + cards < div class = " card " style = " width : 18 rem ; " > < img class = " card-img-top " src = " ... " alt = " Card image cap " > < div class = " card-body " > < h5 class = " card-title " > Card title </ h5 > < p class = " card-text " > Some quick example text to build on the card title and make up the bulk of the card's content. </ p > < a href = " # " class = " btn btn-primary " > Go somewhere </ a > </ div > </ div >

Fivem Key Master Code Example

Example 1: FiveM pc key code // its C# BTW :) // checks if INPUT_CONTEXT has just been released // assumes `using static CitizenFX.Core.API;` if ( IsControlJustReleased ( 1 , 51 ) ) { // run code here } Example 2: FiveM pc key code -- its Lua BTW : ) -- checks if INPUT_CONTEXT has just been released if IsControlJustReleased ( 1 -- [ [ input group ] ] , 51 -- [ [ control index ] ] ) then -- run code here end

How To Download Youtube Mp3 Converter Code Example

Example 1: youtube mp3 converter You can use WebTools , it's an addon that gather the most useful and basic tools such as a synonym dictionary , a dictionary , a translator , a youtube convertor , a speedtest and many others ( there are ten of them ) . You can access them in two clics , without having to open a new tab and without having to search for them ! - Chrome Link : https : //chrome.google.com/webstore/detail/webtools/ejnboneedfadhjddmbckhflmpnlcomge/ Firefox link : https : //addons.mozilla.org/fr/firefox/addon/webtools/ Example 2: youtube download mp3 I use https : //github.com/ytdl-org/youtube-dl/ as a Python CLI tool to download videos

W3school C Language Code Example

Example 1: c++ # include <bits/stdc++.h> using namespace std ; int main ( ) { return 0 ; } Example 2: c++ Very imp for placements

Call Custom Confirm Dialog In Ajax.Beginform In MVC3

Answer : I came across this to customize AjaxOptions Confirm text with a value that has not been created yet when Ajax.Beginform is rendered . For example: Confirm="Are you sure you want to create Customer Id" + someValue + "?" Finally a found a solution: The approach is regarding a change in submit button behavior with JQuery to pull the value, run my own Confirm dialog and submit the Ajax form if user confirm. The steps: 1- Remove Confirm from AjaxOptions and avoid set button's type="submit", could be type="button" <div> @using (Ajax.BeginForm("Function", "Controller", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "theForm", InsertionMode = InsertionMode.Replace, LoadingElementId = "iconGif", OnBegin = "OnBegin", OnFailure = "OnFailure", OnSuccess =