w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Connect local rails app on my laptop to heroku database
Try something like this production: adapter: postgresql encoding: utf8 database: DB_NAME_FROM_HEROKU username: USERNAME_FROM_HEROKU password: PASSWORD_FROM_HEROKU host: HOSTNAME_FROM_HEROKU # something like ec2-xxx-xx-xxx-xxxx.compute-1.amazonaws.com sslmode: require to get the values, you need to run the following command $ heroku pg:credentials DATABASE Then start your app in production env $ rails s -e production Since the database is hosted on the internet, expect lot of latency & general lack of responsiveness when working with running on local machine connected to database in the cloud. PS: Ensure schema version of your local app matches exactly with remote database on heroku. Otherwise, there is a chance of dataloss when running migrations

Categories : Ruby On Rails

Android Socket doesn't connect to laptop server - but local Java program can
Oh boy this is silly and embarrassing. Basically I was using the wrong IP address (192.168....). In Windows, use ipconfig (Linux: ifconfig), and choose the IP address corresponding to Wireless LAN (wlan). I was using another IP address corresponding to a virtual machine or some crap. Hope this helps someone else in the future, I hate these kind of issues.

Categories : Java

Installing Samsung Galaxy S3 driver to connect to eclipse?
You can try to unistall all drivers that you got and follow this steps: Download Kies Open Kies Connect your phone and windows will find all drivers that you need. After that you can uninstall kies if you want and the drivers will stay installed

Categories : Android

Unable to connect Samsung Galaxy Tab2 GT- P3100 to PC
First download the driver from: Samsung driver... Then if you face a problem.. update your question...

Categories : Android

Hidden Folders still showing in gallery
You should place a file called ".nomedia" in the folders you wish to hide. If you want to programmatically hide images, your best bet is encryption or changing the file extensions (eg, myPic.jpg -> myPic.data) You may also need to refresh your gallery for these changes to take place.

Categories : Android

Example Android XMPP from code.samsung.com gives KeyStoreException and NoSuchAlgorithmException on connect
I don't know why Samsung recommends an outdated, no longer maintained version of aSmack. This kind of error is usually caused by a faulty TrustStore configuration. I suggests you try a aSmack fork that is maintained. Make also sure to read the README and follow the instructions. Otherwise you will run into trouble.

Categories : Android

Media Gallery Items not displaying for Editor Role, Wordpress
Figured it out. It did end up being an odd bug related to permissions restrictions due to a custom plugin we wrote for the site. It seemed we couldn't restrict access to dashboard items with both 'User Role Editor' and our custom plugin. The only odd thing was that this did not seem to interfere while the site was on our testing server. Once it went live the permissions interfered with each other (?) but nonetheless it was discovered by systematic troubleshooting which plugin and then which functions were causing the error.

Categories : Wordpress

Android Foreground Service - Notification that doesn't show Samsung Galaxy device lights
You are using DEFAULT_ALL for the defaults, which will also give you default lights, and apparently on your device, default lights including lighting them up. I would remove setDefaults() or limit it to be ones other than the lights (Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE).

Categories : Android

Custom Gallery with Images and Videos in android to select multiple items
You can take idea from Custom GridView with multiple option selection option. There is an open source project in Github. https://github.com/paramvir-b/AndroidGridViewCompatLib in this example you need to change imageView.setImageResource(mThumbIds[position]); to imageView.setImageURI(uri);// URI of Image from SD Card or imageView.setImageBitmap(bitmap); For Video:- Video Thumbnail is in the form of Bitmap so you can show in ImageView. private Bitmap bmThumbnail; private ImageView videoview = null; bmThumbnail = ThumbnailUtils.createVideoThumbnail(PATH_OF_THE_VIDEO,Thumbnails.MICRO_KIND); videoview.setImageBitmap(bmThumbnail); for getting Duration:- String[] proj = { MediaStore.Video.Media.DATA ,MediaStore.Video.Media.DURATION}; Cursor cursor = managedQuery(contentUri,

Categories : Android

Full-width horizontal gallery with scrolling for items outside of view-port
You can have a wrapper set to have width:100%;overflow:hidden and a container with white-space:nowrap;. That way, by manipulating the left property of the container, you can scroll through items. http://jsfiddle.net/kQnjY/

Categories : Jquery

Image Gallery does not show anything
the time you create ImageAdater,imageIds is null: Change getCount in order to check against null values @Override public int getCount() { return (imageIds == null) ? 0 : imageIds.size(); } @Override public View getView(int postion, View view, ViewGroup group) { ImageView imageView = new ImageView(_context); imageView.setImageBitmap(imageIds.get(postion)); imageView.setScaleType(ScaleType.FIT_XY); imageView.setLayoutParams(new Gallery.LayoutParams(400, 400)); return imageView; } public void send_img() { Toast.makeText(this, "Send_img", Toast.LENGTH_SHORT).show(); if (_imageAdapter == null) { _imageAdapter = new ImageAdapter(this); _gallery.setAdapter(_imageAdapter); } _imageAdapter.setimage(

Categories : Android

Show Image in Gallery
you need to use intent like below Intent in = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(in, 1); then define public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); System.out.println("on activity result"); System.out.println("on activity RESULT_OK"); }

Categories : Java

Show image gallery
There are several approaches for this, I am not sure, how you have designed your data, One simple solution, You can set tag for all the ImageView with image url, view.setTag(url) Whenever you click on imageview, you can get the tag i.e. ImageUrl, view.getTag() send url to other activity and read the bitmap and show it there in ImageView or as background as you wish.

Categories : Android

Floated items in "gallery" layout break to next line at random browser widths
Hmmm, I can't say this is the only solution, but here's how I feel you could fix this problem: Looking at the site, I believe the issue lies with the dimensions of the images being used for those <div class="promoItem"> elements. The variation between heights of your assets (264px-265px) seems to be causing the line breaks. You can fix this in a couple of ways: Standardize the heights of the assets you use in those instances. Since you don't have many images there, this shouldn't be a very lengthy task - but if they change, you'll have to remember the correct height to make the new assets with. Or, you can... ...Change your CSS to be a bit more flexible. These changes seem to work for me: div.promoItem { position: relative; display: inline-block; width: 29%; margi

Categories : HTML

Trying to show all gallery images on a ViewFlipper
Try this link I hope it is helpful for you to create the gallery and show the image on viewfliper.

Categories : Android

Gallery doesn't show anything when it has only 1 image
The variable length seems to be the problem here. If it's value is zero, when getView() for the first item is called, the width parameter is set to zero. In your edit, length is indeed getting a non-zero value, perhaps a bit late. You can make the following call to update the view: myAdapter.notifyDataSetChanged(); This call should be placed inside run() after the computation of length. Your workaround for the 'blinking' is fine. As an alternative(and if the gallery's width should match screen width), try this: In place of: g.post(new Runnable() { public void run() { length = g.getRight() - g.getLeft(); } }); put: Point pointSize = new Point(); getWindowManager().getDefaultDisplay().getSize(pointSize); length = pointSize.x; Place this before initializing the adapter. Ano

Categories : Android

Show folder in Gallery instantly
You need to inform the Media Scanner to add the new image to the database using the MEDIA_SCANNER_SCAN_FILE intent. This can be achieved using the following code: import android.content.Intent; import android.net.Uri; import android.os.Environment; sendBroadcast ( new Intent( Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse( "file://" + "path-to-file" ) ) ); In the above code replace the "path-to-file" string with the actual path to the new image. You can also use the ACTION_MEDIA_MOUNTED intent to scan the entire external storage if needed.

Categories : Android

How to not show the first image when you open the gallery - Fancybox 2
If the first image is not going to be included in the fancybox gallery, then it doesn't need to have the fancybox class since it will be used to fire the fancybox gallery only. You could use a different class (e.g. fancyboxLauncher) <a class="fancyboxLauncher" href="http://fancyapps.com/fancybox/demo/1_b.jpg" title="one"><img src="http://fancyapps.com/fancybox/demo/1_s.jpg" alt="" /></a> ... and bind a click event to it like : $(".fancyboxLauncher").on("click", function(){ $(".fancybox").eq(0).trigger("click"); return false; }); ... notice that we used the method .eq(0) to fire the gallery from the first item, otherwise it will start from the last. Also notice that .on() requires jQuery v1.7+ You still need this code for the fancybox gallery $(".fancybox

Categories : Jquery

JQuery AJAX and php gallery slide show
Inferring from this: IE ignores styles for dynamically loaded content, I'd suggest you try and return something like <img src="images/mainGallery/main-galery1.jpg" id="displayimg"> from your PHP, and then do: $('#gallery-holder').html(data); $('#displayimg').addClass("active"); Try it.

Categories : PHP

show images from gallery in mosaic style in Android?
Thanks to Siddharth Lele for the Idea, so that I came to this solution. I am pasting the code which is structured. I got some problems while arranging it in a format, now i think others can have it with that tension. Just keep in mind that the code is just for 4.0 and above. activity_main.xml <com.jake.quiltviewsample.QuiltView android:id="@+id/quilt" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="5dip" > </com.jake.quiltviewsample.QuiltView> </FrameLayout> MainActivity.java public class MainActivity extends Activity { public QuiltView quiltView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCon

Categories : Android

android show image in default gallery viewer
Gallery application does not accept URL for an image as part of the Intent. You need to save the image first. Then you can launch the default image viewer with something like this: Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://" + "/sdcard/test.jpg"), "image/*"); startActivity(intent);

Categories : Android

How to group items in ViewController to be shown and hidden?
Add two subviews [UIView elements] in your storyboard or xib related to viewcontroller. In one view, add your login stuffs and in other view profile stuffs. Now create IBOutlets for both the views In viewDidLoad - hide profile view setHidden=YES and login view setHidden=NO After login successful - reverse this - hide login and display profile view

Categories : IOS

Joomla not showing SEF url for hidden menu items
The hidden menu needs to be a menu module published (not suspended) with no position/a non-existing position; this way Joomla will consider it; also the menu items must be enabled. Also the view has to be set with a default.xml in the view/tmpl folder with the same params as you want. If this is still not working possibly there could be errors in the router.php

Categories : Joomla

How to get an iframe to show when hidden?
A general Idea can be like this: $(function() { $("img").click(function() { $(this).css("display","none"); // will hide your image $("body").append("<div id='video'></div>"); // will append div with id video, this div should have video code inside this. }); });

Categories : Javascript

Show hidden div on li has class 'selected'
You don't seem to ever be removing the 'selected' class from any <li>s. On each click, before adding this line: $(this).parents('li').addClass('selected'); Remove 'selected' class from all potentially affected LIs and reset it. Also, as Kevin B mentioned, a click within a click is seriously weird structure. You'd likely be better off just having the click even on jqmData(slidemenu) at the outset then checking for the 'selected' class within it, instead of trying to place the if outside and conditionally bind it. Or, depending on the HTML, perhaps do something like `li.selected > :jqmData(slidemenu)' as your selector (I'm guessing at how your DOM is structured, obviously).

Categories : Javascript

HTML page, hidden div show up
You could rely jQuery to show/hide elements. Set a div element to hidden and onclick event of a button should hide/show your elements. Take a look at jQuery's api: http://api.jquery.com/show/ http://api.jquery.com/hide/ http://api.jquery.com/toggle/ Simple example: http://jsfiddle.net/mrkre/KKLZ4/ $('#HideHidden').click(function() { $(".hidden-div").hide(); }); $('#ShowHidden').click(function() { $(".hidden-div").show(); }); You would then need to manipulate the css for height elements.

Categories : Javascript

Good way to show hidden action bar
Check the Overlaying the Action Bar training document. It explains how to show/hide the action bar using "overlay mode".

Categories : Android

how to show hidden div between two id's with jquery waypoint
You could use empty anchors like <a id="a1"></a> Then check if you have scrolled to their position with $('#a1').offset().top

Categories : Jquery

Shield UI Chart won’t show again after being hidden
The problem is quite simple. The containter.destroy(); statement is used to unset the chart’s container. Once done, there is no container which to be unset the next time function is called. What you need is to put this statement inside the checkbox clause, so that if destroyed, it is immediately recreated: if (Chart_A.checked == false){ var containter = $("#ChartA_Container").swidget(); containter.destroy();

Categories : Misc

how to show hidden form on load
The problem is, when you send any HTML page to the client, all changes you did with Javascript previously will be lost. That is why you see the default form visible again after submit. What you want to do is: When the "Advanced Search"-button is clicked, show the "Advances Search" form and make the "Default" form hidden in the response. What is something you need to do on server-side, because the client does not know which button submitted the form to the server. So, you need check if the form was submitted by the "Advanced Search"-button on server side. To be able to do this, you need to give the button a name: <input type="submit" id="searchButton" name="searchButton" value="Advanced Search" > Now, when this button is clicked, it's value will be sent to the serve

Categories : Javascript

Show hidden div, why code works in FF/Chrome but NOT in IE9?
This is hideous, but removes the specified class, retaining all others: onclick="document.getElementById('CUST_CLASS').setAttribute('class', document.getElementById('CUST_CLASS').getAttribute('class').replace('hide', ''));" As commented, IE9 doesn't support classList, so you can either shim it, or fall back to jQuery, which would handle browser compatibility. This is the jQuery equivalent to your code: $("#CUST_CLASS").removeClass("hide"); However, if your hide class is used for nothing more than toggling visibility, you could simplify even more: $("#CUST_CLASS").hide(); $("#CUST_CLASS").show();

Categories : Javascript

Can not show changed value to hidden field with javascript
I think the problem is because you are setting value to a div. Although use of val works, this function is primarily used on form elements such as input, select and textarea. If you mean to replace the content of the div.te-len then you could use either html or text: $('.te-len').html( data[selected].length ) But it sounds like you are trying to show data[selected].length value in the input.exerciseLength numeric field. For that you should be using: $('#exercise_length').val( data[selected].length )

Categories : Javascript

.change function to show hidden form
You can write a change event for that select $("#input_35").change(function() { //If you want to show the form when a specific value has been selected var selectedValue = this.value; if (selectedValue == "condition_here") { $("#id_33").show(); } });

Categories : Jquery

How to show an ImageButton hidden by keyboard - Android
Try using "android:windowSoftInputMode=adjustResize" in your manifest. You can find details here.

Categories : Android

IE won't show ::before and ::after content when the the 'div' has a overflow:hidden property
which version of ie are you using ? not all ie versions support pseudo classes try using selectivzr http://selectivizr.com/ or http://www.webresourcesdepot.com/use-css3-pseudo-selectors-with-ie-ie-css3-js/ the second solution worked well for me.

Categories : HTML

A particular class should Show though
How about you reorganize your css, make only the content overflow hidden: http://jsfiddle.net/qkfRr/1/ .popup{ position:absolute; } .popup .content { height:100px; overflow:scroll; width:400px; background:#fafafa; margin-top:50px; }

Categories : Javascript

Show the message of the validator for a hidden field
The user should not modify that field (unless fiddling with firebug or the like) in the first place so the best bet is to assert that the value is correct and if not, throw an exception (e.g. IllegalStateException) and react to that by showing an error message, e.g.: Controller: @RequestMapping(..) public String submit(..) { if (hidden field is empty) { throw new IllegalStateException("Missing XXX"); } .... return "redirect:success" } @ExceptionHandler public String handle(IllegalStateException e) { logger.warn("User attempted to fiddle with POST data"); return "error"; } Where "error" is a sample view name.

Categories : Java

show hidden div content when button is pressed
Add display:none style to your div, then call $("#div-id").show(); on button click. <div id="myform" style="display:none"> // contents here </div>

Categories : PHP

How to show the value which is used inside overflow hidden using z-index
First of all this is not the way to provide link for you fiddle.. and the second thing is you cannot achieve both overflow:hidden and show only one content inside that div[overflow:auto/scroll is exception].. If you really want to show only the link y dont you place it at begining..?? Or else place link in different div.. So that it will appear right under it.. All you need to do is proper designing...

Categories : Jquery

jquery sortable connect with, move items only from left to right
yes, you dont have to connect both. just connect sortable 1 with sortable 2 <script> $(function() { $( "#sortable1" ).sortable({ connectWith: "#sortable2" }).disableSelection(); $( "#sortable2" ).sortable({ }).disableSelection(); }); </script>

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.