Search Results

Search found 27946 results on 1118 pages for 'output buffer empty'.

Page 62/1118 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • I'm looking for a constraint to prevent the insert of an empty string in MySQL

    - by Marga Keuvelaar
    Ok, in this question I learned how to prevent the insert of a NULL value. But, unfortunately, an empty string is being inserted anyway. Apart from preventing this on the PHP side, I'd like to use something like a database constraint to prevent this. Of course a check on the application side is necessary, but I'd like it to be on both sides. I am taught that whatever application is talking to your database, it should not be able to insert basically wrong data in it. So... CREATE TABLE IF NOT EXISTS tblFoo ( foo_id int(11) NOT NULL AUTO_INCREMENT, foo_test varchar(50) NOT NULL, PRIMARY KEY (foo_id) ); Would still allow me to do this insert: INSERT INTO tblFoo (foo_test) VALUES (''); Which I would like to prevent.

    Read the article

  • PHP 5.4: disable warning "Creating default object from empty value"

    - by Werner
    I want to migrate code from PHP 5.2 to 5.4. This worked fine so far except that all the code I use makes extensive use of just using an object with a member without any initialisation, like: $MyObject->MyMember = "Hello"; which results in the warning: "Creating default object from empty value" I know that the solution would be to use: $MyObject = new stdClass(); $MyObject->MyMember = "Hello"; but it would be A LOT OF WORK to change this in all my code, because I use this many times in different projects. I know, it's not good style, but unfortunately I'm not able to spend the next weeks adding this to all of my code. I know I could set the php error_reporting to not reporting warnings, but I want to be able to still get other warnings and notices. This warning doesn't seem to be effected by enable or disable E_STRICT at all. So is there a way to just disable this warning?!

    Read the article

  • efficient way to detect if an image is empty

    - by Jos
    Hi, I need a very fast method to detect if an image is empty. Im my case then all pixels are white and transparant. The images are png's. My current method is to load them in a memory bitmap and check each pixel value, but this is way to slow. Is there a more efficient way? This is my current code: 'Lock the bitmap bits. Dim bmpData As System.Drawing.Imaging.BitmapData = bmp.LockBits(rectBmp, _ Drawing.Imaging.ImageLockMode.ReadOnly, bmp.PixelFormat) Try Dim x As Integer Dim y As Integer For y = 0 To bmpData.Height - 1 For x = 0 To bmpData.Width - 1 If System.Runtime.InteropServices.Marshal.ReadByte(bmpData.Scan0, (bmpData.Stride * y) + (4 * x) + 3) <> 0 Then Return True Exit For End If Next Next Finally bmp.UnlockBits(bmpData) End Try

    Read the article

  • textfield value empty when i fill it with javascript

    - by Turi
    i am using modalpopup to enter some value in a textfield. after the value is selected in the modalpopup view, the modalpopup is closed and the value has taken the propriate value. Even if the value is displyed in the textfield, the textfield1.text returns me string empty. when i see the source code (html), i see that even that the textfield is displaying something it hasn't really this value in it, because the appropriate html input field hasn't value yet. thats the code i use to fill this textfield. function CloseRequestModal(s) { document.getElementById('<%=txtRequest.ClientID%>').value = s; var mpu = $find('<%=ModalPopupExtender3.ClientID%>'); mpu.hide(); } Please Help, Thanks in advance.

    Read the article

  • Empty or "flush" a file descriptor without read()?

    - by Teddy
    (Note: This is not a question of how to flush a write(). This is the other end of it, so to speak.) Is it possible to empty a file descriptor that has data to be read in it without having to read() it? You might not be interested in the data, and reading it all would therefore waste space and cycles you might have better uses for. If it is not possible in POSIX, do any operating systems have any non-portable ways to do this? UPDATE: Please note that I'm talking about file descriptors, not streams.

    Read the article

  • Choosing the non-empty Monoid

    - by Nikita Volkov
    I need a function which will choose a non-empty monoid. For a list this will mean the following behaviour: > [1] `mor` [] [1] > [1] `mor` [2] [1] > [] `mor` [2] [2] Now, I've actually implemented it but am wondering wether there exists some standard alternative, because it seems to be a kind of a common case. Unfortunately Hoogle doesn't help. Here's my implementation: mor :: (Eq a, Monoid a) => a -> a -> a mor a b = if a /= mempty then a else b

    Read the article

  • jquery $.post returned data from php is empty

    - by vee
    hi, i'm using this code to post to a php page: var qreq = ".....myurl.php"; $.post(qreq, function(data){alert(data);}); in my PHP file i have this: ...... $prevtopic = $row["topic_id"]; echo $prevtopic; the alert comes up, but is blank. for some reason data is empty even though i'm echoing from the PHP file. i also tried just echoing "hi" but that didn't work either. what am i doing wrong? thanks.

    Read the article

  • jQuery form serialize - empty string

    - by user137348
    My html: <script type="text/javascript"> $(function() { $("#bt1").click(function() { var f = $("#form1"); var formData = f.serialize(); alert(formData); }); }); </script> <div id="div1"> <form id="form1" action="/Home/Test1" method="post" name="down"> <div id="div2"> <input id="input1" type="text" value="2" /> </div> </form> </div> <input type="submit" id="bt1" /> When I fire up the click event, formData is empty. I'm using jQuery 1.4.2.

    Read the article

  • RealPath returns an empty string

    - by Abs
    Hello all, I have the following which just loops through the files in a directory and echo the file names. However, when I use realpath, it returns nothing. What am I doing wrong: if ($handle = opendir($font_path)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != "a.zip") { echo $file.'<br />';//i can see file names fine echo realpath($file);// return empty string?! } } closedir($handle); } Thanks all for any help on this. ~I am on a windows machine, running php 5.3 and apache 2.2.

    Read the article

  • Empty Structures compile in VB 10+

    - by Mark Hurd
    This is at least a documentation error, if not a bug. In VB.NET prior to .NET 4.0 (i.e. VB.NET 7 through 9) an empty Structure declaration fails at compile-time with error BC30281: Structure 'MySimpleEmpty' must contain at least one instance member variable or Event declaration. E.g. The following two structures compile successfully in VB10, and not prior: Structure MySimpleEmpty End Structure Public Structure AnotherEmpty Public Const StillEmpty As Boolean = True End Structure I note the documentation for the Error BC30281 stops at VB9, but the documentation for the Structure statement still has the datamemberdeclarations as required even as of VB11 (.NET 4.5 VS2012). These two Structures compile in VB11 (VS2012) as well. (Thanks John Woo.) Is there some blog entry or documentation confirming this is an intended change or a bug in VB10 and later?

    Read the article

  • Linq Query ignore empty parameters

    - by Cj Anderson
    How do I get Linq to ignore any parameters that are empty? So Lastname, Firstname, etc? If I have data in all parameters it works fine. refinedresult = From x In theresult _ Where x.<thelastname>.Value.TestPhoneElement(LastName) Or _ x.<thefirstname>.Value.TestPhoneElement(FirstName) Or _ x.<id>.Value.TestPhoneElement(Id) Or _ x.<number>.Value.TestPhoneElement(Telephone) Or _ x.<location>.Value.TestPhoneElement(Location) Or _ x.<building>.Value.TestPhoneElement(building) Or _ x.<department>.Value.TestPhoneElement(Department) _ Select x Public Function TestPhoneElement(ByVal parent As String, ByVal value2compare As String) As Boolean 'find out if a value is null, if not then compare the passed value to see if it starts with Dim ret As Boolean = False If String.IsNullOrEmpty(parent) Then Return False End If If String.IsNullOrEmpty(value2compare) Then Return ret Else ret = parent.ToLower.StartsWith(value2compare.ToLower.Trim) End If Return ret End Function

    Read the article

  • Implode and remove empty values

    - by binoy
    Hi, I have an array like this $arr = array('name' => 'John', 'address' => 'IInd Street', 'state' => '', 'country' => 'US'); I want to display the values as John, IInd Street, US (ie, If any value is empty, I don't want to display comma and break over there) I could able to display this with the following code $values = implode(',', $arr); echo $str = implode(',<br />',array_filter(explode(',', $values))); Is there any better way to do this ?

    Read the article

  • Display fraction with numerator/denominator with empty fields for users to enter text

    - by Anil
    Hi all I have a scenario in which I need to design online keyboard with buttons implementing different mathematical functions in ASP.NET. For example 1) A button called "Fraction" Onclicking= should display A numerator and a denominator separated by '-' with empty fields. Just as we write fractions manually. Now when the user clicks on this button the cursor should focus on numerator displaying 'the division line' and then by pressing 'Down' arrow key(on computr keyboard) should focus on denominator allowing users to enter both fields. Keeping it simple the user should be able to toggle between numerator and denominator. Please help me with some sample code. I have got no idea. Thanks in advance

    Read the article

  • Empty dict-like collection problem in SQLAlchemy

    - by maksymko
    I have a mapping in SQLAlchemy that looks like this: t_property_value = sa.Table('property_value', MetaData, autoload = True, autoload_with = engine) orm.mapper(PropertyValue, t_property_value) t_estate = sa.Table('estate', MetaData, autoload = True, autoload_with = engine) orm.mapper(Estate, t_estate, properties = dict( property_hash = orm.relation(PropertyValue, collection_class = column_mapped_collection(t_property_value.c.property_id)) )) Now, everything seems to be fine, when I load the Estate object and it has some relations to PropertyValue objects. However, when it does not, then property_hash attribute is None, instead of being something dict-like, so I can not add new relations like this: estate.property_hash[prop_id] = PropertyValue(...) because I get the "'NoneType' object does not support item assignment" error. So, is there any way to force SQLAlchemy to create proper empty collection?

    Read the article

  • UIPickerView and empty core data array

    - by Mark
    I have a viewcontroller showing items from a core data entity. I also have a tableview listing records from the same entity. The table is editable, and the user could remove all the records. When this happens, the view controller holding the pickerview bombs because it's looking for records in an empty array. How to prevent this? I'm assuming I need to do something different at objectAtIndex:row... # pragma mark PickerView Section - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; // returns the number of columns to display. } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { return [profiles count]; // returns the number of rows } - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { // Display the profiles we've fetched on the picker Profiles *prof = [profiles objectAtIndex:row]; return prof.profilename; } //If the user chooses from the pickerview - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { selectedProfile = [[profiles objectAtIndex:row]valueForKey:@"profilename"]; }

    Read the article

  • group_concat on an empty join in MySQL

    - by Yossarian
    Hello, I've got the following problem: I have two tables: (simplified) +--------+ +-----------+ | User | | Role | +--------+ +-----------+ | ID<PK> | | ID <PK> | +--------+ | Name | +-----------+ and M:N relationship between them +-------------+ | User_Role | +-------------+ | User<FK> | | Role<FK> | +-------------+ I need to create a view, which selects me: User, and in one column, all of his Roles (this is done by group_concat). I've tried following: SELECT u.*, group_concat(r.Name separator ',') as Roles FROM User u LEFT JOIN User_Role ur ON ur.User=u.ID LEFT JOIN Role r ON ur.Role=r.ID GROUP BY u.ID; However, this works for an user with some defined roles. Users without role aren't returned. How can I modify the statement, to return me User with empty string in Roles column when User doesn't have any Role? Explanation: I'm passing the SQL data directly to a grid, which then formats itself, and it is easier for me to create slow and complicated view, than to format it in my code. I'm using MySQL

    Read the article

  • Select fields containing at least one non-space alphanumeric character

    - by zzapper
    (Sorry I know this is an old chestnut; I have found similar answers here but not an exact answer) These are frequent hand written queries from a console so I is what I am looking for is the easiest thing to type SELECT * FROM tbl_loyalty_card WHERE CUSTOMER_ID REGEXP "[0-9A-Z]"; or SELECT * FROM tbl_loyalty_card WHERE LENGTH(CUSTOMER_ID) >0; -- could match spaces Do you have anything quicker to type even if it's QAD?

    Read the article

  • Why DataTable not showing the NULL values?

    - by thevan
    I have one DataTable Which I gets from the BackEnd. But When I fix the BreakPoint and Visualize the DataTable, It does not show the NULL values. Why is it so? In the BackEnd, My Table looks like below: CustID JobID Qty ---------- -------- ------ 1 NULL 100 2 1 200 But in the FrontEnd, My DataTable looks like below: CustID JobID Qty ---------- -------- ------ 1 100 2 1 200 Why it is not showing the NULL Values? Is there any specific reason? How to show the DataTable as it is like in the BackEnd?

    Read the article

  • numberOfSectionsInTableView is requested in/after viewDidLoad ONLY if tableview is empty

    - by Ben Packard
    A simple tableviewController, empty. A modal that can be launched from a button. No data in the data source for the tableview, and no rows displayed. I open the modal, use it to add an item, and return to the tableview controller. The tableview updates itself automatically, and the new row is displayed. I add a second item. The table view does NOT update automatically. I can tell by logging inside numberOfSectionsInTableView that even if I go to add the first item and cancel, the tableview refreshes - it asks for the number of sections, rows, and the cell to display (if there is one). But not if there is one pre-existing row in the table. I've scoured my code but can't find anything that would cause the tableview to know when the first item is added, but none afterwards. Any ideas? EDIT - I have further narrowed my issue so will close this shortly and post a more specific question

    Read the article

  • Ofstream writes empty file on linux

    - by commanderz
    Hi, I have a program which writes its output using ofstream. Everything works perfectly fine on Windows when compiled with Visual Studio, but it only writes empty file on Linux when compiled with GCC. ofstream out(path_out_cstr, ofstream::out); if(out.bad()){ cout << "Could not write the file" << flush; } else{ cout << "writing"; out << "Content" << endl; if(out.fail()) cout << "writing failed"; out.flush(); out.close(); } The directory which is being writen into has 0777 privileges. Thanks for help

    Read the article

  • Auto-fill the current date if the previous row was empty

    - by replax
    I have a spreadsheet sorted by dates. Everyday, I enter new data into it. After each day, I leave one row empty before starting the next day. Example: 20.09.12 XXXXX XXXXX XXXXX XXXX XXXXX XXXX XXXXX XX XX XXXXX XX XXXX 21.09.12 XXX XXXXX XXX XXXX X XXXX XXXX XXX 22.09.12 XXXX XX XXXX XXXX So I want excel to always fill in the current date whenever I enter data after one blank row, but obviously the dates shall stay the same - not be updated to the current date whenever I open excel. I am using Excel 2007 and while non vba ideas are preferred, vba is not a problem either!

    Read the article

  • MSMQ empty object on message body

    - by Owen
    Ok, so I'm very VERY new to MSMQ and I'm already confused. I have created a private queue and added a few messages to it, all good so far. BUT when I retrieve the messages back from the queue the message body contains a empty object of the type I added. By this I don't mean that the body is null, it does have a reference to a type of the object that I added, but it's not instantiated so all the properties are in their null or default state. This is the code I use to add to the queue: using (var mQueue = new MessageQueue(QueueName)) { var msg = new Message(observation) { Priority = MessagePriority.Normal, UseJournalQueue = true, AcknowledgeType = AcknowledgeTypes.FullReceive, }; mQueue.Send(msg); } And this is the code that dequeues the messages: using (var mQueue = new MessageQueue(QueueName)) { mQueue.MessageReadPropertyFilter.SetAll(); ((XmlMessageFormatter)mQueue.Formatter).TargetTypes = new[] { typeof(Observation) }; var msg = mQueue.Receive(new TimeSpan(0, 0, 5)); var observation = (Observation)msg.Body; return observation; }

    Read the article

  • Placeholder containing dynamic table is empty unless I create table twice

    - by Mike O.
    I am dynamically creating a table that contains a textbox in each cell. The table is put in a placeholder control. Everything displays perfectly. The problem is when I go to retrieve the values entered in the cells. I have the code to generate the table in a separate method called CreateTable(). In order for my program to find a table in the placeholder when I go to save, I have to run CreateTable() in a postback event AND in the PageLoad event. If I call CreateTable() in only one of those places and I try to save, it says the placeholder is empty and, therefore, I cannot save the textbox contents. I've tried calling CreateTable() from InitLoad but that doesn't work because it needs to reference values from three static controls: 1 dropdown, 1 listbox, and 1 calendar control, which I don't believe have had their viewstate rendered yet. Anyone have any ideas? It would sure be nice not to have to double the number of database calls just to make this work.

    Read the article

  • nsfetchedresultscontroller with empty sections

    - by WearyMonkey
    I have a database of People and pets, with a one to many relationship Person Pet Name Name Pet <----- Owner I am using a UITableView backed by Core data and a nsfetchedresultscontroller to display the list of pets, grouped into sections by the owner. NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; fetchRequest.entity = [NSEntityDescription entityFromName:@"Pet" inManagedObjectContext:context] NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"Owner.name" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [fetchRequest setSortDescriptors:sortDescriptors]; NSFetchedResultsController *controller = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:context sectionNameKeyPath:@"Owner.name" cacheName:@"Root"]; This works to display all pets under their owners section, however I also want to display the empty sections of People who do not have any pets? Is this possible? Thanks for any help.

    Read the article

  • Form with target="_blank" will produce empty POST data in IE6

    - by Seeker
    I have an iframe containing a form. I want the form to point to a new window when the user submits it. Basically, the following code should do the trick: <?php var_dump($_POST); ?> <form method="post" action="test_post_to_blank.php" target="_blank"> <input type="text" name="test" value="test" /> <input type="submit" /> </form> The problem is that in IE6 a new window is opened with empty POST data. Is there any other way I can get the job done? This does not occur in newer versions of IE. Thanks in advance ;).

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >