w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Unable to move items to Trash
You can find out what the problem is by logging the error in your else: NSLog(@"Unable to move %@ %@", sourcepath, [error localizedDescription]); Also, unless you abort the loop when you encounter an error, you should reset error to nil. Also, you should probably be using NSWorkspace and performFileOperation:NSWorkspaceRecycleOperation instead of moving each file individually: [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:_downloadpath destination:@"" files:list tag:nil];

Categories : Objective C

Put Back Items from Trash Programmatically
Last time I checked, the Put Back feature was totally Finder-specific. That is, moving a file to the trash programmatically doesn't allow even the Finder to put it back. Only items trashed by the Finder can be put back by the Finder. (Even dragging an item from a folder on the Dock to the trash doesn't allow it to be put back, because the Dock trashed it, not the Finder.) Even for an item which the Finder can put back, there's no documented way to do the Put Back operation programmatically. However, for your own app, you can certainly undo the operation without keeping a separate copy of the file (until the user empties the trash). -[NSWorkspace recycleURLs:completionHandler:] will give you the URLs for the items in the trash. Store the bookmark data for those URLs and the original conta

Categories : Osx

String variable shows as empty but length shows it to not be
.NET uses BStrings, which are length-prefixed and null-terminated. So if the first character in RecievedString is the null character (''), then it will not be printed, since strings end at their first null character.

Categories : Vb.Net

Trash characters when using buffers in c++
You named a function DLL_PingConnection=(TYPE_DLL_PingConnection) dynLib2.GetSymbol(.... and call it with OSOZ.OSOZ_PingConnection(buffor_ping_xml); you typedef a function typedef bool(*TYPE_DLL_PingConnection)(char*); you create a variable char buffor_ping_xml[2000]; in your typedef it is char* and your buffor_ping_xml is char how can that work ? try char *buffor_ping_xml = new char[2000]; /* or */ wchar_t *buffor_ping_xml = new wchar_t[2000]; /* or */ wxChar *buffor_ping_xml = new wxchar[2000]; bool is_ping = DLL_PingConnection(buffor_ping_xml); wxString mystring = wxString::FromUTF8(buffor_ping_xml); write mystring to file. To Do: look in your wxwidgetslibs folder for your libs are there libwxmsw29ud_* with a 'u' in the name (after version number here 29)? If n

Categories : C++

C#, DataGridView - New row contains trash after being selected
After some time trying to solve the problem I've found out, that whenever you want to insert something into a row as an addition to what the user has put there, you should always use DefaultValuesNeeded event instead of RowValidated. DefaultValuesNeeded handles deleting remainings of the row properly, if edition is not committed. If you insert anything, even a null, in RowValidated the row counts as edited and will try to sync itself to the database. The confusing part (and probably a bug) is that an "edited" row containing a null is displayed as a new empty row on DataGridView bottom, not as a regular empty row. Thus, this row will raise an error saying that you cannot delete new row, should you try to delete it.

Categories : C#

Move files to Trash/Recycle Bin in Qt
I think that there is no cross-platform way. Simple moving files to "trash" location will not give effect, because user may switch off this possibility. Maybe, this url will help: http://www.hardcoded.net/articles/send-files-to-trash-on-all-platforms.htm

Categories : C++

How to determine if a volume supports Trash?
A nice person from the Apple Dev Forums hunted up the answer: From the 10.8 Foundation release notes: NSFileManager Trash APIs In Mac OS 10.8, NSFileManager has new methods to manage the Trash. The -[NSFileManager trashItemAtURL:resultingItemURL:error:] will attempt to move the item at the given URL to the trash, returning the resulting URL by reference. As part of this operation, the system may rename the file to avoid name conflicts; if so, the resultingItemURL will reflect this new name. [snip] Some volumes may not support a Trash folder, so these methods will report failure by returning NO or nil and an NSError with NSFeatureUnsupportedError. NSFeatureUnsupportedError is a new error code in the NSCocoaErrorDomain that indicates a failure to perfo

Categories : Osx

Getting trash data in char* while using it as buffer in function
DLL_PingConnection(var avXml:PChar):Boolean; This is not a full declaration. Obviously, it is a function since it has a Boolean return type. But does it also declare a calling convention as well - stdcall (__stdcall in C/C++) or cdecl (__cdecl in C/C++)? If not, then it is using Delphi's default register convention instead (which is __fastcall in Borland/CodeGear/Embarcadero C++ compilers only, but has no equivalent in any other C/C++ compiler). Your existing typedefs are using your C++ compiler's default calling convention, which is usually __cdecl. Calling convention mismatches are the most common problem with using DLLs, as it causes mismanagement of the call stack, which affects how parameters are passed, accessed, and cleaned up. Also, what version of Delphi was the DLL wr

Categories : C++

Why does Sidekiq and Rails return "wrong constant name Trash"?
You will probably have a mismatching file name, mapping class name the wrong way (maybe a typo). Look for something like "nested controller" which contain a class declaration with a different name ... something like the following : app/controllers/trash?/your_controller.rb class Trash::YourController < ApplicationController def index ... end end see the mismatching/typo between trash? (dirname) and the relative class name Trash.

Categories : Ruby On Rails

How to enable trash to accept drop from cocoa application?
For dropping outside the location on your machine use the below DataSource methods:- - (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard { NSArray* entityArray=[yourArrayController selectedObjects]; NSString* filename=[[[entityArray objectAtIndex:0]valueForKey:@"fileName"]stringValue]; [pboard setPropertyList:[NSArray arrayWithObject:filename] forType:(NSString*)kPasteboardTypeFileURLPromise]; NSPoint dragPosition; NSRect imageLocation; NSEvent *theEvent = [NSApp currentEvent]; dragPosition = [tv convertPoint:[theEvent locationInWindow] fromView: nil]; dragPosition.x -= 16; dragPosition.y -= 16; imageLocation.origin = dragPosition; imageLocatio

Categories : Objective C

jQuery UI leaving trash elements behind after .hide('blind').remove()
Your .hide() call has not finished in time for your .remove() call. You need to supply a callback to the .hide() method, like so: $('target-elem').hide('blind', function () { $(this).remove(); }); For more information, please see http://api.jqueryui.com/hide/

Categories : Jquery

Buffered writer writes memory trash on text file
Because write() writes a character . Writes a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored. Parameters: c - int specifying a character to be written You can use Writer#write(String): writer.write(String.valueOf(nodes));

Categories : Java

list.getchildAt(i) return null pointer ,only shows visible views not shows more
I guess you should think fo a better approach than iterating over the EditTexts with getChildAt() to collect all the value. I take it that the user can change the values in the EditTexts, you can have an Array of size 30 of Values and everytime the user enters / changes a value you change the according value in the Array. Use a listener that changes the values in your Array like this.

Categories : Android

My horizontal navigation menu shows as 1 line in chrome, others shows 2 lines
you are aware that in: .mainnav ul li a:link,.mainnav ul li a:visited there are double padding decalarations? padding:4px; padding: 0 0.73em; You can combine those: padding: 4px 0.73em; Seems that the issue with the navigation list is that there is too much spacing in between them in combination with the amount of items. I there are too much items, the normal behavior is the wrapping, you could decrease spacing, font-size to fix this.

Categories : HTML

My hibernate application shows message in console and shows session closed error on browser
At first look it seems like a possibility of 2 issues ContactManager object which you are trying to save is null Your variable name 'Contact' is incorrect, it should be 'contact' (some hibernate thingy) Where is your hbm.xml file ? There may be a reference of 'Contact' the class in that file still around somewhere Edit Solutions Put a if (developer != null) before your 'save(developer)' Rename Contact to contact Put the hbm file contents on the question, without that cant review the mapping Hope it clear now. Edit 2 : Do a clean build. Its possible your build is not updated.

Categories : Hibernate

Applet shows empty in the browser
Recommendations: Don't override a JApplet's paint method. Instead override a JPanel's paintComponent method and display the panel in the applet. Don't call repaint() in the paintComponent method. Please. Don't read in images in the paint or paintComponent method. Read the image in once only. Don't read the image in as a file but rather as a resource. Test to make sure that you're looking in the right location for the image. You would benefit much by reading a few tutorials on Swing graphics as much of what you're doing looks like you're doing a bit of guessing. The tutorials will show you the right way to do things. You won't regret reading them. Even better than painting the images in a JPanel is to put them into ImageIcons and display them in JLabels.

Categories : Java

ListFragment shows "Empty List" when it most definitely is not
Its mostly because you have not given an id for your list Adapter. ListView lv = (ListView) findViewById(R.id.list); ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, studentList); lv.setAdapter(arrayAdapter); This should work, though the method seems redundant.

Categories : Java

Spinner populated in xml shows as empty (Android)
Try this, Resources res = getResources(); apModeAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, res.getStringArray(R.array.anti_pump_ap_mode_array) );

Categories : Android

Translation of empty string shows po header
Ok, found out what was going on, according to Why does gettext translate an empty string to the .po header text? and http://www.gnu.org/software/gettext/manual/gettext.html#MO-Files Having the original strings sorted enables the use of simple binary search, for when the MO file does not contain an hashing table, or for when it is not practical to use the hashing table provided in the MO file. This also has another advantage, as the empty string in a PO file GNU gettext is usually translated into some system information attached to that particular MO file, and the empty string necessarily becomes the first in both the original and translated tables, making the system information very easy to find. So I can't avoid checking the string.

Categories : Django

Angularjs ng-repeat shows n items n times
To work with a list of strings in ng-options, you need the comprehension expression looks like this <select ng-model="currentField" ng-options="field for field in fieldNames"></select> DEMO

Categories : Angularjs

Textmate shows files in the project folder that have been deleted
As per the comments, this is a git issue, and not a textmate issue. Try this: $ git commit -a -m "git comment" $ git push origin master According to the OP, this will also work: $ git add -A Reference: Textmate 2 Alpha showing references for deleted files

Categories : Misc

Admin shows entries of a model even though database is empty
The problem was related to Redis. Simply flushing the Redis-db solved the problem. $ redis-cli $redis> flushall $redis> exit

Categories : Django

JOIN operation codeigniter shows empty results
I think that the problem in users.id so replace it with users.cust_id . It may get the result you. the correct code is : function get_ac_no($user_id) { //echo $user_id; $this->load->database(); $this->db->select('ac_number'); $this->db->from('account_numbers'); $this->db->join('users','account_numbers.customer_id = users.cust_id'); $this->db->where('account_numbers.customer_id ',$user_id); $this->db->limit(1); $q = $this->db->get(); $r = $q->result(); var_dump( $r ); return $r; }

Categories : Codeigniter

logcat filter shows count but empty when selected
It doesn't always update that value when you clear it or if they get pushed out of the buffer. As long as you don't tamper with ADB or manually clear it it the 'No Filter' option should stay full though.

Categories : Android

Angular.js filter shows no results on empty input
You forgot to initialize query. add $scope.query = ''; in your controller. EDIT : above statement is wrong. Sorry. In addition to the above, your query variable is out of the scope. (so just defining query in the controller's scope would disconnect the object...) Here is the cleanuped / working code example. http://plnkr.co/edit/0aT33Q2H2SQTPG4E62Zb?p=preview

Categories : Angularjs

android fragment listview shows items partially
After some days I find out the exact problem. I was including a ListView into a ScrollView, and that's clearly not recomended by Android developers. You can look for further info here: Why ListView cannot be used in a ScrollView? Anyway, if you want to do it, you can do that with a hack. Take a look at these proposals: How can I put a ListView into a ScrollView without it collapsing? For me that worked. Problem solved.

Categories : Android

When creating a new blank C# ASP.NET Empty Website nothing shows up in the Solution Explorer
An empty solution contains nothing, therefore it is called empty. If you want to see a sample, you should choose ASP.NET Web Forms Application or ASP.NET MVC Application.

Categories : Visual Studio 2012

Serializing to array shows empty brackets and formats incorrectly in Rails
You Should join the array by comma object.join(',') in your example: <%= f.text_area :department,value: @org.department.join(','), :cols => "10", :rows => "10" %>

Categories : Ruby On Rails

WinDbg shows some variables but not others, shows some variables in same location
<> Nowadays Compiler has been enhanced a lot to get better optimized binary with optimized performance and other metrics. Hence compiler store few variables as locals(visible via 'dv /v' command) and store other variables in their registers. That's the reason you didn't see variable int myInt in dv command. We can get to know which registers are being used for the variables, by disassembling the function using 'uf binary!functionname' or by viewing disassembled code in Windbg View-> Disassembly. Note that the driver may behave little differently with and without optimization of the compiler in the aspects of performance, memory usage, etc. So its always recommended to debug the one generated from the default optimized compiler, as this is the one used in realtime user scenario.

Categories : Windows

Canvas convert to Image shows empty Image
var canvas = document.createElement("canvas").innerHTML; gives you and empty string not a new canvas element. Its hard to draw into a string, try changing it to this. var canvas = document.createElement("canvas");

Categories : HTML

Rails command working , rails -v shows Rails 4.0.0 , gem list rails shows 3.2.13
I don't know why you want remove rails 4, if you are already using rvm you should easily switch between ruby/rails versions without any problem, if you don't know rvm i recommend you to read why-you-should-use-rvm if you should remove obligatory rails 4.0.0 try this command : gem uninstall rails --version 4.0.0 if this can't solve your problem please add more details in your question

Categories : Ruby On Rails

Tomcat 7 - Secure a folder under webapps folder
I found a way to solve this problem. This is what I came up with, 1) Convert 'files' folder to a web application and make files (say pdf) secured by using tomcat's FORM based authentication 2) After getting authenticated to 'myweb' - here authentication is not tomcat container based, its based on spring & hibernate - asynchronously invoke a servlet (PopulateServlet.java) in 'files' web app from '/myweb/customerhomepage.jsp' and set tomcat role username & pwd in 'files' web app session whenever there is a request to protected pdf under 'files' web app, login.jsp will be invoked - in this jsp populate hidden j_username & j_password fields from session object which was already populated by PopulateServlet. Using jquery ajax, the html form will be

Categories : Security

Moving files from one folder to a hot folder BUT only move one at a time when the hot folder is empty
Pretty sure this should do what you want in vbscript: Set objFS = CreateObject("Scripting.FileSystemObject") set objFolderA = objFS.GetFolder("c:Folder A") set objFolderB = objFS.GetFolder("c:Folder B") For each objFile in objFolderA.Files Do While True If objFolderB.Files.Count = 0 Then objFS.MoveFile objFile.Path, ojbFolderB.Path & "" Exit Do End If Loop Next

Categories : Batch File

Get the Value First Before the Form Shows up PHP
So you have your dropdown, submit that value to either self or another php script that contains this: $selected = $_POST['select']; for($i = 0; $i<$selected; $i++){ echo "<input type='text' name='email$i'>"; } $selected is the value of the dropdown menu. Now we have a for loop. It set's $i to zero then says while $i is less than the value of your drop down value, add 1 more to $i and run echo "<input type='text' name='email$i'>"; As you can see, I appended $i to to email so that each field has it's own unique name. What you can do as well is do just as CP510 says and add onchange='this.form.submit()' to the select tag so it is submitted automatically and I would submit the form to the same page. This meaning set the action of the form of which the select menu

Categories : PHP

clock_gettime always shows 0
Because the compiler optimizes away your loop. Do something inside the loop that can't be simplified easily (by the compiler that is); so create some result. Then use (e.g. print) this result after the loop. You could also try to switch off optimisation(s) when you compile. But since your current loop is very easy to optimise away, this may not make a difference.

Categories : C

PHP to delete SQL but still shows
$res=mysql_query("SELECT FROM `users` WHERE `UserId`=$UserId"); select what? Guessing the delete users works as it gets the id from $_GET, where as the traders never actually gets any data from mysql query. EDIT - longer explanation The delete users works as your userid used on the delete query is provided without needing the select: $UserId = $_GET['i']; The delete traders wont work because you did not select anything to get the traders id from the user id to use on the delete query $res=mysql_query("SELECT FROM `users` WHERE `UserId`=$UserId"); $TraderId=mysql_result($res,0,"TraderId"); ie "SELECT FROM users" - select WHAT?

Categories : PHP

Shows dump on 404
You are quite close, I think you should just need to disable the debug mode in your controller file (index.php for instance) by passing a false parameter : $configuration = ProjectConfiguration::getApplicationConfiguration('myapp', 'prod', false); For your 404, you also need to edit in your *error_404_module* and *error_404_action* parameters in application settings.yml like this

Categories : PHP

UITableView shows nothing
Make sure to change this line of your file from: (in the .h file) @interface YourClass : something to: @interface YourClass : something <UITableViewDataSource, UITableViewDelegate> If you haven't already.

Categories : Objective C

It shows " UI unfortunately stop"
According to this post The messages you are seeing in the debug log are a problem with the emulator and can be just filtered out. I am not sure what the real problem is yet, but one issue is the code int arraylistSize = a.size(); for(int i = 0; i < arraylistSize; i++) { textview1.setText(a.get(i)); textview1.setText("*"); } It should probably be more like: int arraylistSize = a.size(); StringBuffer sb = new StringBuffer(); for(int i = 0; i < arraylistSize; i++) { sb.append(a.get(i)); if (i != arraylistSize -1) { sb.append("*"); } } textview1.setText(sb.toString()); as it is going to change the value of the text so fast that you won't see anything but the last "*". If you filter the logcat as per the link, you will probably see a null pointer

Categories : Java

SQL View Shows same id once
This is a string concatenation problem. The query looks something like this in SQL Server: create view v_userphone select u.username, u.address, stuff((select ','+phonenumber from userphone up where up.userid = u.userid for xml path ('') ), 1, 1, '' ) as phonenumbers from users u;

Categories : SQL



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