Posts

Android WebView Not Loading URL

Answer : Did you added the internet permission in your manifest file ? if not add the following line. <uses-permission android:name="android.permission.INTERNET"/> hope this will help you. EDIT Use the below lines. public class WebViewDemo extends Activity { private WebView webView; Activity activity ; private ProgressDialog progDailog; @SuppressLint("NewApi") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); activity = this; progDailog = ProgressDialog.show(activity, "Loading","Please wait...", true); progDailog.setCancelable(false); webView = (WebView) findViewById(R.id.webview_compontent); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setLoadWithOverviewMode(t...

Are There Alternatives To Sysinternals ADInsight?

Answer : There are known issues with ADInsight and it is no longer supported or developed. It has issues loading its DLL in certain environments, specifically on VMs (see http://forum.sysinternals.com/adinsight-doesnt-work-hangs_topic18891.html and http://forum.sysinternals.com/adinsight-operation_topic18963.html) (archive links) The best solution I have found is to turn on Active Directory Diagnostic Logging as described at http://www.activedir.org/Articles/tabid/54/articleType/ArticleView/articleId/41/Default.aspx (archive link). Basically, you want to set the following registry values: Path: HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Diagnostics\15 Field Engineering Type: DWORD Value: 5 Path: HKLM\SYSTEM\CurrentControlSet\Services\NTDS\Parameters\Expensive Search Results Threshold Type: DWORD Value: 1 These changes do not require a reboot but are set per server, so implementing for an entire forest/domain would best be done via Group Policy Preferences. Once set you will...

Adding An External Directory To Tomcat Classpath

Answer : Just specify it in shared.loader or common.loader property of /conf/catalina.properties . See also question: Can I create a custom classpath on a per application basis in Tomcat Tomcat 7 Context hold Loader element. According to docs deployment descriptor (what in <Context> tag) can be placed in: $CATALINA_BASE/conf/server.xml - bad - require server restarts in order to reread config $CATALINA_BASE/conf/context.xml - bad - shared across all applications $CATALINA_BASE/work/$APP.war:/META-INF/context.xml - bad - require repackaging in order to change config $CATALINA_BASE/work/[enginename]/[hostname]/$APP/META-INF/context.xml - nice , but see last option!! $CATALINA_BASE/webapps/$APP/META-INF/context.xml - nice , but see last option!! $CATALINA_BASE/conf/[enginename]/[hostname]/$APP.xml - best - completely out of application and automatically scanned for changes!!! Here my config which demonstrate how to use development version of project files ...

Array To Set And Set To Array In Js Code Example

Example: js new array from new set return Array . from ( new Set ( this . posts . map ( e => e . category ) ) )

Modulenotfounderror No Module Named 'cv2' Spyder Code Example

Example 1: ModuleNotFoundError: No module named 'cv2' To solve this run the following # main opencv pip install opencv - python # contrib package for the extra features pip install opencv - contrib - python The official installation instructions are on the opencv website . More info can be found here : https : //www.pyimagesearch.com/opencv-tutorials-resources-guides/ Example 2: ModuleNotFoundError: No module named 'cv2' sudo apt - get install python - opencv libopencv - dev python - numpy python - dev

Android - Flip Image In Xml

Image
Answer : Use the scale attributes in ImageView android:scaleX="-1" //To flip horizontally or android:scaleY="-1" //To flip vertically Here's a very short and easy to understand solution. Add this to the imageView: android:rotationX="180" This will flip the imageView horizontally (left<->right). For vertically, put this: android:rotationY="180" Example: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="original image:"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/test"/> ...

Array Join Php Code Example

Example 1: php array join $arr = array ( 'Hello' , 'World!' , 'Beautiful' , 'Day!' ) ; echo join ( ", " , $arr ) ; Example 2: join array of strings php $arr = array ( 'Hello' , 'World!' , 'Beautiful' , 'Day!' ) ; echo join ( "," , $arr ) ; Example 3: php join array Definition and Usage The join() function returns a string from the elements of an array. The join() function is an alias of the implode() function. Note: The join() function accept its parameters in either order. However, for consistency with explode(), you should use the documented order of arguments. Note: The separator parameter of join() is optional. However, it is recommended to always use two parameters for backwards compatibility. Syntax join(separator,array) Example Join array elements with a string: <?php $arr = array ( 'Hello' , 'World!' , 'Beautiful' , 'Day!' ) ; echo ...

Can Ping IP Address And Nslookup Hostname But Cannot Ping Hostname Temporarily In Windows

Answer : I faced the same problem in my network. When you use this command: ping icecream It uses WINS server since you have used icecream not icecream.my.domain . When looking for such words, Windows looks for NETBIOS names, but when you look for complete domain records, it will look in the DNS server. You can use one of the solutions below: Make sure you have correct records for that station in your WINS server. Use the complete domain name instead of using the host file. E.g. icecream.my.domain You don't have DNS suffixes configured. Either configure them, or use FQDN like this and it should work: ping icecream.my.domain

Matplotlib Plot Color Code Example

Example 1: change plot line color in matplotlib plot ( x , y , color = 'green' , linestyle = 'dashed' , marker = 'o' , markerfacecolor = 'blue' , markersize = 12 ) . Example 2: change graph colors python matplotlib plt . plot ( [ values ] , color = 'color' ) Example 3: matplotlib color Alias Color 'b' blue 'g' green 'r' red 'c' cyan 'm' magenta 'y' yellow 'k' black 'w' white

Bind Scroll Jump Code Example

Example: csgo mouse wheel jump bind bind mwheelup + jump ; bind mwheeldown + jump ; bind space + jump

Change Background Image Opacity

Answer : Nowadays, it is possible to do it simply with CSS property "background-blend-mode" . <div id="content">Only one div needed</div> div#content { background-image: url(my_image.png); background-color: rgba(255,255,255,0.6); background-blend-mode: lighten; /* You may add things like width, height, background-size... */ } It will blend the background-color (which is white, 0.6 opacity) into the background image. Learn more here (W3S). You can't use transparency on background-images directly, but you can achieve this effect with something like this: http://jsfiddle.net/m4TgL/ HTML: <div class="container"> <div class="content">//my blog post</div> </div>​ CSS: .container { position: relative; } .container:before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; z-index: 1; background-image: url('i...

Bootstrap Label And Input Code Example

Example 1: bootsrap label <span class= "label label-default" >Default Label</span> <span class= "label label-primary" >Primary Label</span> <span class= "label label-success" >Success Label</span> <span class= "label label-info" >Info Label</span> <span class= "label label-warning" >Warning Label</span> <span class= "label label-danger" >Danger Label</span> Example 2: bootstrap radio <div class= "form-check form-check-inline" > <input class= "form-check-input" type= "radio" name= "inlineRadioOptions" id= "inlineRadio1" value= "option1" > <label class= "form-check-label" for= "inlineRadio1" > 1 </label> </div> <div class= "form-check form-check-inline" > <input class= "form-check-input" type= "radi...

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...

Addgroup Vs Groupadd

Answer : On most distribution adduser and addgroup are interactive 'convenience' wrappers around the commands useradd and groupadd . You can find addgroup using the command which addgroup , on my machine (Ubuntu 11.04) this lives in /usr/sbin/addgroup . On my box addgroup is a perl script that prompts for various options (interactively) before invoking the groupadd command. groupadd is usually preferable for scripting (say, if you wan't to create users in batch), whereas addgroup is more user friendly (especially if you are unfamiliar with all the options and flags). Of course addgroup also takes many options via the command when you invoke it, but it is primarily intended as an interactive script. Interestingly on my box addgroup is a symlink to adduser , the script checks the name it was invoked under and performs different actions accordingly. groupadd is more preferable for better cross-linux and sometimes cross-unix systems compatibility. addg...

Calculating Coordinates Given A Bearing And A Distance

Answer : It seems like these are the issues in your code: You need to convert lat1 and lon1 to radians before calling your function. You may be scaling radialDistance incorrectly. Testing a floating-point number for equality is dangerous. Two numbers that are equal after exact arithmetic might not be exactly equal after floating-point arithmetic. Thus abs(x-y) < threshold is safer than x == y for testing two floating-point numbers x and y for equality. I think you want to convert lat and lon from radians to degrees. Here is my implementation of your code in Python: #!/usr/bin/env python from math import asin,cos,pi,sin rEarth = 6371.01 # Earth's average radius in km epsilon = 0.000001 # threshold for floating-point equality def deg2rad(angle): return angle*pi/180 def rad2deg(angle): return angle*180/pi def pointRadialDistance(lat1, lon1, bearing, distance): """ Return final coordinates (lat2,lon2) [in degrees] given...

Burger Menu W3schools Code Example

Example 1: burger menu css /* Link to Codepen in source for PoC */ < style > .container { background : dodgerblue ; padding : 20 px ; height : 70 px ; } #hamburger { width : 40 px ; height : 40 px ; display : block ; position : relative ; float : right ; transform : rotate ( 0 deg ) ; transition : .5 s ease-in-out ; cursor : pointer ; } #hamburger span { display : block ; position : absolute ; height : 4 px ; width : 100 % ; background : white ; border-radius : 9 px ; opacity : 1 ; left : 0 ; transform : rotate ( 0 deg ) ; transition : .25 s ease-in-out ; } #hamburger span :nth-child ( 1 ) { top : 0 px ; } #hamburger span :nth-child ( 2 ) { top : 12 px ; } #hamburger span :nth-child ( 3 ) { top : 24 px ; } #hamburger .open span :nth-child ( 1 ) { top : 14 px ; transform : rotate ( 135 deg ) ; } #hamburger .open span :nth-child ( 2 ) { opa...