w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Cocoa finder menu item for folders only
Add the following code to the .plist: <key>NSServices</key> <array> <dict> <key>NSMenuItem</key> <dict> <key>default</key> <string>Folder Handling Demo</string> </dict> <key>NSMessage</key> <string>handleServices</string> <!-- This specifies the selector --> <key>NSPortName</key> <string>Tmp</string> <!-- This is the name of the app --> <!-- Here we're limiting where the service will appear. --> <key>NSRequiredContext</key> <dict> <key>NSTextContent</key> <string>FilePath&l

Categories : Objective C

Cocoa: how to remove item from Finder's context menu via service?
The documentation says: You should not use this function to unregister the services provided by your application. For your application’s services, you should use the setServicesProvider: method of NSApplication, passing a nil argument. So, do what you did in applicationDidFinishLaunching:, except pass nil instead of self. (I don't know whether you'll need to do the NSUpdateDynamicServices step.)

Categories : Objective C

Criteria or dynamic finder to retrieve like/unlike status of a status update item in grails
I am just throwing out an idea: user.like would give you all the likes of an user. status.like would give you all the likes of a status. Would you not be able to find out whether an user's like is also a status' like? You need to find out a Like which belongs to both User and Status.

Categories : Grails

Trying to display info from database but nothing is showing up - WordPress/PHP
There are a few things to attend in that code. Proper include_once usage You have to include the route of the file in disk, not the public url. Something like: include_once(get_stylesheet_directory() . "/layout-listings.php"); or better yet, use get_template_part: get_template_part('layout', 'listings'); Use get_posts or new WP_Query instead of doing explicit queries You should try to use queries only when there is no other choice, use get_posts instead: $pageposts2 = new WP_Query(array( 'meta_key' => 'listing_open', 'meta_value' => 'NO' )); The code above will get the results you need. Pros about using wordpress functions: wordpress cache compatibility with third party plugins, like as multilanguage plugins pagination If the query is too complex for WP_Quer

Categories : PHP

Mongo showing on php info but MongoClient not working?
I'm assuming that the version of mongo listed in phpinfo is 1.2 -- MongoClient class wasn't out until v1.3 if so, you need to update mongodb to the newer version. https://bugs.launchpad.net/ubuntu/+source/php-mongo/+bug/1096587

Categories : PHP

eclipse debugger showing false info?
The debugger is not lying. You're assuming that all the keys of the map should be stored in the private keySet field of the HashMap. But this is not the case. This variable is lazily populated when the keySet() method is called. Just look at the method implementation. If you want to know something about your map, use its documented, specified API: use the Display view, type functions.keySet(), right-click and choose "Evaluate", and then you'll really get the key set of the map.

Categories : Eclipse

Get Image Dimensions from Url in Python
Your main issue is you are searching the html source for references to height and width. In most cases (when things are done well), images don't have height and width specified in html, in which case they are rendered at the height and width of the image file itself. To get the height and width of the image file, you need to actually query for and load that file, then check the height and width using image processing. If this is what you want, let me know, and I'll help you work through that process. import urllib, cStringIO from PIL import Image # given an object called 'link' SITE_URL = "http://www.targetsite.com" URL = SITE_URL + link['src'] # Here's a sample url that works for demo purposes # URL = "http://therealtomrose.therealrosefamily.com/wp-content/uploads/2012/08/headshot_tig

Categories : Python

Getting dimensions of background-image
The issue is that some browsers add quotes to the CSS, and it was trying to load (in the fiddle's case) "http://fiddle.jshell.net/_display/%22http://placehold.it/200x300%22". I've updated your .replace() to look for " as well, and a fiddle is at http://jsfiddle.net/4uMEq/ $('#test').on('click', function () { $(this).text(getDimensions($(this))); }); var getDimensions = function (item) { var img = new Image(); img.src = item.css('background-image').replace(/url(|)$|"/ig, ''); return img.width + ' ' + img.height; };

Categories : Javascript

GridLayout - showing basic info from data in sqlite
As per your question, I assume that you want to display your data on an activity correct? here is the link that expalins it Using Intent in an Android application to show another activity

Categories : Android

How can I get info about the list View Item selected
You should modify this part of code to put name of image to its Tag property: foreach (string imageFile in files) { try { System.Drawing.Image myImage = Image.FromFile(imageFile); myImage.Tag="image name for each item";//you can put for example image file name myImageList.Images.Add(myImage); myImage.Dispose(); } catch { } } then when you want to get selected image's name you can use this code: private void imageListView_Clicked(object sender, EventArgs e) { String imgName= (String)imageListView.SelectedItems[0].ImageList.Images[0].Tag; }

Categories : C#

AVCaptureSession image dimensions (with GPUImage)
It is indeed possible to pull the dimensions out of the capture session. Here's how: // self.videoCamera is a GPUImageVideoCamera AVCaptureVideoDataOutput *output = [[[self.videoCamera captureSession] outputs] lastObject]; NSDictionary* outputSettings = [output videoSettings]; long width = [[outputSettings objectForKey:@"Width"] longValue]; long height = [[outputSettings objectForKey:@"Height"] longValue]; if (UIInterfaceOrientationIsPortrait([self.videoCamera outputImageOrientation])) { long buf = width; width = height; height = buf; } GPUImageMovieWriter * mw = [[GPUImageMovieWriter alloc] initWithMovieURL:movieURL size:CGSizeMake(width, height)];

Categories : IOS

How to calculate dimensions after applying Matrix3D to image
Admittedly, I've never done this with a matrix applied, but, I believe you can use: image.getLayoutBoundsWidth(), image.getLayoutBoundsHeight(), image.getLayoutBoundsX(), and image.getLayoutBoundsY() to get these values. These methods from the ILayoutElement interface have a default boolean argument, postLayoutTransform (defaults to to true). When postLayoutTransform is true, the functions return values with the transformation applied.

Categories : Actionscript

Displaying dimensions of each image as caption or label
Here's a Fiddle HTML <img src="/" alt="Image"/> <img src="/" alt="Image"/> <img src="/" alt="Image"/> <img src="/" alt="Image"/> <img src="/" alt="Image"/> <img src="/" alt="Image"/> CSS img { width: 250px; /* For demo purposes */ height: 200px; /* For demo purposes */ border: none; } .img-wrapper { position: relative; float: left; margin: 0 12px 12px 0; border: 1px solid #555; } .img-wrapper span { display: block; text-align: center; } jQuery $(function() { $('img').each(function() { var image = $(this), imgW = $(this).outerWidth(), imgH = $(this).outerHeight(), size = '<span>'+imgW+'px X '+imgH+'px</span>'; $(this).wrap('<div class="img-wrapper">'+size+'</div>

Categories : Javascript

How to get image dimensions before it's lazy loaded using jQuery?
Get the height of the image stored in the data-src attribute before it is lazy loaded in, add those together, then set the container to that height. Yes, because it is given that the width does not change. If it saves your time, you can also investigate plugins like imagesloaded and lazyload.

Categories : Javascript

Resizing each image based on dimensions in jQuery
You have a syntax error in your script, and '.thumbImage' must be set to a height of 100%: Syntax error: if( $(this).height() < $(this).width() || ($(this).height() == $(this).width() ) ) (You missed a closing bracket) CSS: .thumbImage { height:100%; } JS Fiddle: http://jsfiddle.net/fMhr2/1/ Also, you should calculate the ratio to get it to work properly, like Salketer just mentioned. I added that to this JSFiddle

Categories : Jquery

How calculate aspect ratio from dimensions of image
I think you are looking for HCF (Highest Common Factor) but the ratio (Width:835,Height:625) will be 167:125. Here is the function by which you can calculate HCF between 2 numbers. private int FindHCF(int m, int n) { int temp, reminder; if (m < n) { temp = m; m = n; n = temp; } while (true) { reminder = m % n; if (reminder == 0) return n; else m = n; n = reminder; } } So here is the rest of the code int hcf = FindHcf(835, 625); int factorW = 835 / hcf; int factorH = 625 / hcf;

Categories : C#

if you know an image's dimensions, how do you scale it without a reflow in a fluid container
I think you may just be looking for overflow: hidden on the div. The only down side is if you expand the image too much it won't fit in the div. div { width: 50%; background-color: red; overflow:hidden; }

Categories : CSS

Images not being transformed to correct dimensions in image carousel
In Actual result jsfiddle, I changed #carousel a, img { display: block; float: left; border: none; position: relative; } to: #carousel a, #carousel img { display: block; float: left; border: none; position: relative; } Is that what your are looking as output, please run and see.

Categories : Javascript

How do i get the image dimensions (height, width) from a file by using javascript
Bind the load event First, and then do all processing that needs the image to be loaded inside of the load event. function calculate(callback) { $("<img/>").load(function() { var pic_real_width = this.width; // Note: $(this).width() will not var pic_real_height = this.height; // work for in memory images. callback(pic_real_width,pic_real_height); }).attr("src", $("#pp_photo_popUp")[0].src); } calculate(function(width,height) { console.log(width,height); }); If you set the src first, some versions of IE will immediately trigger the load event synchronously, thus triggering it before you have even bound to it. That's why i swapped the order. Additionally, I added the callback parameter because I assume later in the function you were going to re

Categories : Javascript

Product image is not showing up in poduct page where as showing list
Firstly, you must confirm whether the media.phtml is loaded. You may insert some dummy characters in the media.phtml to see whether it will show in the frontend. Thus, if the characters show, congratulations, you are just close to find the problem. In this situation, most problems are caused by image attributes not loading to the model object. Simply just reload the object with the following snippets: $_product = Mage::getModel('catalog/product')->load($_product->getId()); Otherwise, you may confirm the following things: Is the media.phtml is overload by the other theme? Compare with the default catalog.xml with your current one, to find out the media.phtml is correctly loaded, including path, block type, name, as, etc. Check the permission settings for the xml and template fi

Categories : Image

OpenCV cvtColor() change my image dimensions and have wrong colors
It could be that "something passed as argument" does not have enough data to fill 720 lines. With some video cameras, not all three channels are represented using the same number of bits. For example, when capturing video on an iPhone, the three channels use 8-4-4 Bytes instead of 8-8-8. I haven't used this type of a camera with OpenCV, but most likely the problem is here.

Categories : C++

Android 2.3.4: How do I determine the dimensions of an image to customize the layout during startup?
Create a bitmap from the drawable resource. Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher); Once you have the bitmap, you can get the image dimensions through bitmap.getWidth() & bitmap.getHeight().

Categories : Android

Changing the dimensions of a BitMapImage in WPF, and what kind of objects can I put in an element?
Ok, I figured out my question. Jeez, what a dummy. Below is the code I changed that got me the results I wanted: Uri uri = new Uri("pack://application:,,,/Images/DeployWiz_Network.png"); BitmapImage source = new BitmapImage(); source.BeginInit(); source.UriSource = uri; source.DecodePixelHeight = 10; source.DecodePixelWidth = 10; source.EndInit(); return source;

Categories : C#

Image in gui with gridlines convert to a textfile with N by M dimensions of the grid and the plotted points matlab
Here is an example. Main file This should be the main script. Grid_Size = [5 5]; Grid_Type = 1; % The group of the new clicked points. % Initialize Grid_Matrix = zeros(Grid_Size); grid_h = []; % Grid image handle fig_h = figure('Units', 'Normalized'); % Show your image rgb = imread('peppers.png'); im_h = imshow(rgb); % Shut off the 'HitTest' to keep the functionality of figure ButtonDownFcn set(im_h, 'HitTest', 'Off'); hold on % Hold on for the overlaying grid image. % Image normalized position Image_Pos = get(ancestor(im_h, 'axes'), 'Position'); im_size = size(rgb(:,:,1)); % Set the Mouse click callback for the figure (to a script in this case) set(fig_h, 'ButtonDownFcn', 'Mouse_Click'); Mouse_Click.m The script callback, I suggest script rather than function to avoid the com

Categories : Matlab

Getting image info anonymously through Imgur API in C#
Your first line should read HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("https://api.imgur.com/3/image/8ABRUYt"); The correct url is "https://api.imgur.com/3/image/{id}" - {id} being your picture ID. Your post helped me greatly getting started on simply viewing a picture from imgur! I would vote you up, but that requires 15 reputation :( I'll be sure to rep you, when I can :)

Categories : C#

ListFragment only showing first item
I suspect that your items are there, just out of sight. Check out your R.layout.activity_torrent_detail_images and confirm that your items are able to be seen. It is quite likely that as you add items, the items are being added to the right of the previous item, going off the screen. For debugging purposes, I would recommend that each item in your list have a height and width of wrap_content so that you can see where the other items are going.

Categories : Java

class item not showing up
Edit: you have the "" outside of your div "#full_image" so I replace #full_image .close_full {... with this .close_full {... and the class .close_full, now is like this: .close_full { height: 29px; width: 29px; position: relative; background: url('http://tabtimes.com/sites/default/files/Steve%20Wozniak%202.jpg') no-repeat; bottom: 5%; right: -29px; cursor: pointer; z-index: 9999999; background-position: right top; opacity: 1; display: block; } I dont know where you what the close_full link realy must be, but here you have the example: http://jsfiddle.net/2M6KA/8/

Categories : HTML

asp.net image button's imageurl property not showing image of network location?
Is that your actual code? 'Cause you probably need to use double backslash, like: if(System.IO.File.Exists("\\MyPC-pc\u165121142\MyFolder\pid\11\Profile\FImage\Koala6192013104451AM.jpg")) { ImgImage.ImageUrl="\\MyPC-pc\u165121142\MyFolder\pid\11\Profile\FImage\Koala6192013104451AM.jpg"; }

Categories : C#

Generating a secondary tile with image not showing image immediately
It’s just a guess, but maybe disposing fileStore doesn’t dispose file — it will happen once garbage collection occurs, but until then, the file can’t be read. So: using (var fileStore = IsolatedStorageFile.GetUserStoreForApplication()) { using (var file = fileStore.OpenFile("Shared/ShellContent/tile_" + source.Ticker + "_medium.png", FileMode.Create)) { bitmap.WritePNG(file.AsOutputStream().AsStreamForWrite()); } }

Categories : C#

showing the checked item alone without check box
You shouldn't be using forms for non-edit display purposes. Instead, make a method on your class: from forms import PERSON_ACTIONS PERSON_ACTIONS_DICT = dict(PERSON_ACTIONS) class Actions(models.Model): report = models.ForeignKey(Report) action = models.IntegerField('Action type') def action_as_text(self): return PERSON_ACTIONS_DICT.get(str(self.action), None) Then you can just do {{ obj.action_as_text }} in a template and get the text you want. Note that it would probably be more common to use integers in the PERSON_ACTIONS array (then you don't need the str call in action_as_text.)

Categories : Django

DropdownList Not Showing Selected Item
@Html.DropdownList("FaultCode", new SelectList(faultCodeList, "Value", "Text","Other")) You need to bind to SelectList than List, so that last parameter you can mention the selected value is "Other".

Categories : C#

My app is showing "This item is not compatible with your device"
It's because of your permissions. See more about this here: Manifest and supported devices showed in android market Is there a way to install app that has send_sms permission on tablet Why was our Application upgrade on Android Market not visible to all devices? It's difficult to say exactly which ones are causing the problems, I think it could be ACCESS_FINE_LOCATION and CAMERA but I have no access to these devices and no way to be sure. In all cases the fix is not to remove the permissions but also use the <uses-feature> tags to ensure the market knows these are not requirements for your app.

Categories : Android

Passing from Javascript canvas image info AND some vars to PHP
I think using JSON would be a good way to send the data to your PHP file. That way you can store multiple variables in an Object or Array. // Store your data in an Object var imageData = { url: 'http://adsadsf.com', name: 'foobar.gif', width: 500, height: 400, directory: 'img/' } var ajax = new XMLHttpRequest(); ajax.open("POST", 'saving.php', false); // Send the imageData object as JSON ajax.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); ajax.send(JSON.stringify(imageData)); Unfortunately I don't know enough about PHP to explain exactly how to handle the received JSON data, but I guess you can use the json_decode method for that. More about JSON: http://www.json.org/js.html

Categories : PHP

Info box similar to Google Image Search Results
If you want to avoid javascript as much as possible, you can create a <div class='info'> with the details about the image after each <div class="item"> like so: <div class="item"> <img src="some_relative_image.png"/> </div> <div class="info"> Details about the first image. </div> <div class="item"> <img src="some_relative_image.png"/> </div> <div class="info"> Details about the second image. </div> <div class="item"> <img src="some_relative_image.png"/> </div> <div class="info"> Details about the third image. </div> After that, replace this line in your css: div.info { display: normal; } with: div.info { display: none; } This will make the details

Categories : Javascript

SaveLoad image info (path, resourceId) to device
There is a mistake in the save method of your ResourceBitmapDescriptor class: editor.putString(KEY_DESCRIPTOR_TYPE, TYPE_IS_RESOURCE); editor.putInt(KEY_GALLERY_VALUE, resId); You're using the wrong key for the resource id. It should assumedly be KEY_RESOURCE_VALUE: editor.putString(KEY_DESCRIPTOR_TYPE, TYPE_IS_RESOURCE); editor.putInt(KEY_RESOURCE_VALUE, resId);

Categories : Android

adding an image to a pin's info window (Google maps)
Try to put it inside a infowindow.setContent('<div><img src="rute.jpg" /></div>'); infowindow.open(map,marker); I hope it helps. Check out the google maps API documentation too, there's a lot of infomration. https://developers.google.com/maps/documentation/javascript/

Categories : IOS

AppCompat - Item not showing in action bar for API levels v8-13
the problem is this android:showAsAction="always" that needs to be youpackagename:showAsAction="always" actually looking over it again you declared that twice android:icon="@drawable/abc_ic_menu_moreoverflow_normal_holo_dark" android:showAsAction="always" remove that bit

Categories : Android

List item not showing correct text
// try this one public class PendingAdapter extends BaseAdapter { private List<Map<String, Object>> mPendingItemList; public PendingAdapter() { mPendingItemList = DataModel.getInstance().getPendingItemList(); } @Override public int getCount() { return mPendingItemList.size(); } @Override public Object getItem(int position) { return mPendingItemList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (null == convertView) { convertView = Lay

Categories : Android

Default item showing in non-editable comboBox
Let's say you have filled your disabled combobox like this: LPCTSTR s[] = {_T("Blue"), _T("Red"), _T("Yellow")}; CComboBox* pCombo = (CComboBox*)GetDlgItem(IDC_COMBO_COLOR); if(pCombo) { for(int i=0; i<3; ++i) { pCombo->AddString(s[i]); } pCombo->SetCurSel(1); // <- sets the default value. here it would be "Red" } As illustrated in the code snippet, you would simply do it by setting the currently selected item (index based)

Categories : C++

Form panel not showing by set active item
Your right about setActiveItem and you need to use it. because Ext.Viewport.add() only adds to viewPort not shows the view. So only problem in your code is you created formPanel, but not added it in the AddContact View. ........... // same code { xtype: 'button', text: 'Get Data', handler: function() { Ext.Msg.alert('Form Values', JSON.stringify(formPanel.getValues(), null, 2)); } }, { xtype: 'button', text: 'Clear Data', handler: function() { formPanel.reset(); } } ] }); this.add(f

Categories : Extjs



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