Search Results

Search found 8001 results on 321 pages for 'empty'.

Page 11/321 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • using empty on inaccessible object with __isset and __get

    - by David
    <?php class Magic_Methods { protected $meta; public function __construct() { $this->meta = (object) array( 'test' => 1 ); } public function __isset($name) { echo "pass isset {$name} \n"; return isset($this->$name); } public function __get($name) { echo "pass get {$name} \n"; return $this->$name; } } $mm = new Magic_Methods(); $meta = empty($mm->meta->notExisting); var_dump($meta); echo "||\n"; $meta = empty($mm->meta); var_dump($meta); The snippet above does not work as expected for me. Why would the first empty() ommit the __isset? I get this: pass get meta bool(true) || pass isset meta pass get meta bool(false) I would expected identical results or another pass at the __isset, but not a direct call to __get. Or am I missing something here?

    Read the article

  • Prevent empty form input array from being posted?

    - by user355295
    Sorry if this has been answered somewhere; I'm not quite sure how to phrase the problem to even look for help. Anyway, I have a form with three text input boxes, where the user will input three song titles. I have simple PHP set up to treat those input boxes as an array (because I may want, say, 100 song titles in the future) and write the song titles to another document. <form method="post"> <input type="text" name="songs[]" value="" /> <input type="text" name="songs[]" value="" /> <input type="text" name="songs[]" value="" /> <button type="submit" name="submit" value="submit">Submit</button> </form> <?php if (isset($_POST['submit'])) { $open = fopen("test.html", "w"); if(empty($_POST['songs'])) { } else { $songs = $_POST['songs']; foreach($songs as $song) { fwrite($open, $song."<br />"); }; }; }; ?> This correctly writes the song titles to an external file. However, even when the input boxes are empty, the external file will still be written to (just with the <br />'s). I'd assumed that the if statement would ensure nothing would happen if the boxes were blank, but that's obviously not the case. I guess the array's not really empty like I thought it was, but I'm not really sure what implications that comes with. Any idea what I'm doing wrong? (And again, I am clueless when it comes to PHP, so forgive me if this has been answered a million times before, if I described it horribly, etc.)

    Read the article

  • Logging to MySQL without empty rows/skipped records?

    - by Lee Ward
    I'm trying to figure out how to make Squid proxy log to MySQL. I know ACL order is pretty important but I'm not sure if I understand exactly what ACLs are or do, it's difficult to explain, but hopefully you'll see where I'm going with this as you read! I have created the lines to make Squid interact with a helper in squid.conf as follows: external_acl_type mysql_log %LOGIN %SRC %PROTO %URI php /etc/squid3/custom/mysql_lg.php acl ex_log external mysql_log http_access allow ex_log The external ACL helper (mysql_lg.php) is a PHP script and is as follows: error_reporting(0); if (! defined(STDIN)) { define("STDIN", fopen("php://stdin", "r")); } $res = mysql_connect('localhost', 'squid', 'testsquidpw'); $dbres = mysql_select_db('squid', $res); while (!feof(STDIN)) { $line = trim(fgets(STDIN)); $fields = explode(' ', $line); $user = rawurldecode($fields[0]); $cli_ip = rawurldecode($fields[1]); $protocol = rawurldecode($fields[2]); $uri = rawurldecode($fields[3]); $q = "INSERT INTO logs (id, user, cli_ip, protocol, url) VALUES ('', '".$user."', '".$cli_ip."', '".$protocol."', '".$uri."');"; mysql_query($q) or die (mysql_error()); if ($fault) { fwrite(STDOUT, "ERR\n"); }; fwrite(STDOUT, "OK\n"); } The configuration I have right now looks like this: ## Authentication Handler auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp auth_param ntlm children 30 auth_param negotiate program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic auth_param negotiate children 5 # Allow squid to update log external_acl_type mysql_log %LOGIN %SRC %PROTO %URI php /etc/squid3/custom/mysql_lg.php acl ex_log external mysql_log http_access allow ex_log acl localnet src 172.16.45.0/24 acl AuthorizedUsers proxy_auth REQUIRED acl SSL_ports port 443 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl CONNECT method CONNECT acl blockeddomain url_regex "/etc/squid3/bl.acl" http_access deny blockeddomain deny_info ERR_BAD_GENERAL blockeddomain # Deny requests to certain unsafe ports http_access deny !Safe_ports # Deny CONNECT to other than secure SSL ports http_access deny CONNECT !SSL_ports # Allow the internal network access to this proxy http_access allow localnet # Allow authorized users access to this proxy http_access allow AuthorizedUsers # FINAL RULE - Deny all other access to this proxy http_access deny all From testing, the closer to the bottom I place the logging lines the less it logs. Oftentimes, it even places empty rows in to the MySQL table. The file-based logs in /var/log/squid3/access.log are correct but many of the rows in the access logs are missing from the MySQL logs. I can't help but think it's down to the order I'm putting lines in because I want to log everything to MySQL, unauthenticated requests, blocked requests, which category blocked a specific request. The reason I want this in MySQL is because I'm trying to have everything managed via a custom web-based frontend and want to avoid using any shell commands and access to system log files if I can help it. The end result is to make it as easy as possible to maintain without keeping staff waiting on the phone whilst I add a new rule and reload the server! Hopefully someone can help me out here because this is very much a learning experience for me and I'm pretty stumped. Many thanks in advance for any help!

    Read the article

  • Varchar2 and Oracle quick question

    - by DAVID
    Hi guys im using varchar2 for a product name field, but when i query the databa from the run SQL command line it shows too many empty spaces, how can i fixe this withouth changing the datatype here is the link to the ss http://img203.imageshack.us/img203/20/varchar.jpg

    Read the article

  • Check if an object is defined in html

    - by Manikanta
    In HTML, I have an object tag as follows: <OBJECT ID="objectid" CLASSID="some-class-id" CODEBASE="some-codebase"> I have written a function in JavaScript to access this object. I checked the null value as follows: if(objectid==null){-----} i want to check if the object is undefined or is empty. Do we have any functions to check so?

    Read the article

  • Remove accents from String .NET

    - by developerit
    Private Const ACCENT As String = “ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÌÍÎÏìíîïÙÚÛÜùúûüÿÑñÇç” Private Const SANSACCENT As String = “AAAAAAaaaaaaOOOOOOooooooEEEEeeeeIIIIiiiiUUUUuuuuyNnCc” Public Shared Function FormatForUrl(ByVal uriBase As String) As String If String.IsNullOrEmpty(uriBase) Then Return uriBase End If ‘// Declaration de variables Dim chaine As String = uriBase.Trim.Replace(” “, “-”) chaine = chaine.Replace(” “c, “-”c) chaine = chaine.Replace(“–”, “-”) chaine = chaine.Replace(“‘”c, String.Empty) chaine = chaine.Replace(“?”c, String.Empty) chaine = chaine.Replace(“#”c, String.Empty) chaine = chaine.Replace(“:”c, String.Empty) chaine = chaine.Replace(“;”c, String.Empty) ‘// Conversion des chaines en tableaux de caractŠres Dim tableauSansAccent As Char() = SANSACCENT.ToCharArray Dim tableauAccent As Char() = ACCENT.ToCharArray ‘// Pour chaque accent For i As Integer = 0 To ACCENT.Length – 1 ‘ // Remplacement de l’accent par son ‚quivalent sans accent dans la chaŒne de caractŠres chaine = chaine.Replace(tableauAccent(i).ToString(), tableauSansAccent(i).ToString()) Next ‘// Retour du resultat Return chaine End Function

    Read the article

  • Gateway setting is empty

    - by Dodi Jones
    This laptop hasn't been used in almost a year. It connected to the internet just fine last time used. Now it can't get on line. ipconfig:The Gateway setting for this computer is empty. Make sure your access point is working properly. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Dodi>IPCONFIG /ALL Windows IP Configuration Host Name . . . . . . . . . . . . : 8A287A4ADEF0487 Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Unknown IP Routing Enabled. . . . . . . . : Yes WINS Proxy Enabled. . . . . . . . : No Ethernet adapter Wireless Network Connection: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : LAN-Express AS IEEE 802.11g miniPCI Adapter Physical Address. . . . . . . . . : 00-14-A4-72-37-E1 Dhcp Enabled. . . . . . . . . . . : No IP Address. . . . . . . . . . . . : 192.168.0.1 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : DNS Servers . . . . . . . . . . . : 192.168.1.1 Ethernet adapter Local Area Connection: Media State . . . . . . . . . . . : Media disconnected Description . . . . . . . . . . . : Intel(R) PRO/100 VE Network Connection Physical Address. . . . . . . . . : 00-01-4A-EF-A8-7D How do I fix this?

    Read the article

  • ssh login fails for user with empty password

    - by Reid
    How do you enable ssh login on OS X 10.8 (Mountain Lion) for a user with an empty password? I've seen others asking this question, and like me it's for the same reason: a parent who can't deal with passwords. So "set a password" is not an option. I found references to adding "nullok" to various PAM config files. Didn't work. Found sshd config "PermitEmptyPasswords yes". Didn't work. I've done a diff on "ssh -vvv" between a successful ssh with a password-enabled account and the one with no password. 54,55c54,55 < debug2: dh_gen_key: priv key bits set: 133/256 < debug2: bits set: 533/1024 --- > debug2: dh_gen_key: priv key bits set: 140/256 > debug2: bits set: 508/1024 67c67 < debug2: bits set: 509/1024 --- > debug2: bits set: 516/1024 79c79 < debug2: key: /Users/rae/.ssh/rae (0x7f9a0241e2c0) --- > debug2: key: /Users/rae/.ssh/rae (0x7f81e0c1e2c0) 90,116c90,224 < debug1: Authentications that can continue: publickey,keyboard-interactive < debug2: we did not send a packet, disable method < debug3: authmethod_lookup keyboard-interactive < debug3: remaining preferred: password < debug3: authmethod_is_enabled keyboard-interactive < debug1: Next authentication method: keyboard-interactive < debug2: userauth_kbdint < debug2: we sent a keyboard-interactive packet, wait for reply < debug2: input_userauth_info_req < debug2: input_userauth_info_req: num_prompts 1 < debug3: packet_send2: adding 32 (len 14 padlen 18 extra_pad 64) < debug1: Authentications that can continue: publickey,keyboard-interactive < debug2: userauth_kbdint < debug2: we sent a keyboard-interactive packet, wait for reply < debug2: input_userauth_info_req < debug2: input_userauth_info_req: num_prompts 1 < debug3: packet_send2: adding 32 (len 14 padlen 18 extra_pad 64) < debug1: Authentications that can continue: publickey,keyboard-interactive < debug2: userauth_kbdint < debug2: we sent a keyboard-interactive packet, wait for reply < debug2: input_userauth_info_req < debug2: input_userauth_info_req: num_prompts 1 < debug3: packet_send2: adding 32 (len 14 padlen 18 extra_pad 64) < debug1: Authentications that can continue: publickey,keyboard-interactive < debug2: we did not send a packet, disable method < debug1: No more authentication methods to try. < Permission denied (publickey,keyboard-interactive). --- > debug1: Server accepts key: pkalg ssh-dss blen 433 > debug2: input_userauth_pk_ok: fp 6e:02:20:63:48:6a:08:99:b8:5f:12:d8:d5:3d:e1:fb > debug3: sign_and_send_pubkey: DSA 6e:02:20:63:48:6a:08:99:b8:5f:12:d8:d5:3d:e1:fb > debug1: read PEM private key done: type DSA > debug1: Authentication succeeded (publickey). > Authenticated to cme-mini.local ([192.168.1.5]:22). > debug2: fd 7 setting O_NONBLOCK > debug3: fd 8 is O_NONBLOCK > debug1: channel 0: new [client-session] > debug3: ssh_session2_open: channel_new: 0 > debug2: channel 0: send open > debug1: Requesting [email protected] > debug1: Entering interactive session. > debug2: callback start > debug2: client_session2_setup: id 0 > debug2: fd 5 setting TCP_NODELAY > debug2: channel 0: request pty-req confirm 1 > debug1: Sending environment.

    Read the article

  • Filling up the empty blocks when the player touches the safe zone again! using cocos2d

    - by user3445020
    Hi guys i am stuck with filling up the data of all the blocks which are empty like the ones in the image. As you can see there i have a pacman like object where i will be moving around. But when you are in the empty space where there are no Blue boxes available i should be able to add new blocks in the path of my pacman and when it touches any other blue boxes like in the below case if my pacman touches the top row of the blue box i should be able to fill all the empty boxed inside the border of the path created by pacman. For now i am using a 2d bool array to store all the filled boxed info like if there is a box inside i am making that cell in an array as true. But how to fill the area with blue boxes after player finishes his path ? Any help would be great thank you. More info about this problem is here: filling the empty spaces in a certain region in a grid using c++ Same problem

    Read the article

  • WPF: IEditableCollectionView and CanAddNew and empty collections

    - by Aran Mulholland
    We were having some issues with the wpf datagrid and IEditableCollectionView (although this question applies to using IEditableCollectionView and ItemsControl) When you have a collection with no items in it, the IEditableCollectionView cannot determine what items should be inserted so it sets CanAddNew=false we found a solution here (buried deep in the comments) that goes like so : If you derive from ObservableCollection like this public class PersonsList : ObservableCollection<Person> { } you will find out that if the initial collection is empty, there won't be a NewItemPlaceHolder showing up on the view. That's because PersonsList cannot resolve type T at design time. A workaround that works for me is to pass type T as a parameter into the class like this PersonsList<T> : ObservableCollection<T> where T : Person { } This approach will place the NewItemPlaceHolder even if the collection is empty. I'm wondering if there is an interface i can implement on my collections that inform the IEditableCollectionView which type to create should i get an AddNew request.

    Read the article

  • egg git interface for emacs, commit message empty

    - by Gauthier
    I'm using egg (emacs got git) as git interface in emacs. Whenever I try to achieve a commit --amend, I receive a "GIT-COMMIT-AMEND> Aborting commit due to empty commit message". This is what i do: C-u C-x v c Then the commit buffer appears, with the message of my previous commit. Then upon C-c C-c I get the message stated above: empty commit message. I think I've had this behaviour with regular commits (as in not amend) before, but can't remember or find how I solved it. I tried editing the message (adding a space somewhere). No work. I tried saving the buffer before committing, that wouldn't work either (since C-c C-c is not active in another buffer than the commit buffer). Any clue?

    Read the article

  • Visual Studio 2008 "Publish" option generates some empty folders

    - by Kevin Pang
    When I right click an ASP.NET MVC solution and select the "Publish" option, the final output it generates contains several empty top-level folders. For instance, the "Service References" folder that gets automatically added when you add a service reference to a web app is generated without any files in it. Why are these folders generated at all if there's no content in them? Is there a way to let Visual Studio know to not bother publishing them? This isn't a big deal since it doesn't really affect the app (and before deploying I can always delete the empty folders), but it's a little annoying.

    Read the article

  • Remove the elements and contents before an element

    - by Jerry
    Hello guys I am trying to remove the elements and contents before a link inside a div when a user clicks a button. What is the best way to do it?? <div id="dialog" class="window"> //will be inserted a <select> element and few text here //but I want to clear them after the user click a button <a href="#" class="close">Close it</a> // I want to keep this <a> link. </div> My Jquery $('.model').click(function(e) { $("#dialog").empty(); //I can't use this because <a> will be deleted. Any better ideas? }); Thanks for the reply...

    Read the article

  • WPF Listbox - Empty List Display Message

    - by David Ward
    Can anyone suggest the best way to display a Textblock (with a text such as "List Empty") so that it's visibility is bound to the Items.Count. I have tried the following code and can't get it to work, so think that I must be doing it wrong. <ListBox x:Name="lstItems" ItemsSource="{Binding ListItems}"> </ListBox> <TextBlock Margin="4" FontStyle="Italic" FontSize="12" Text="List is empty" Visibility="Collapsed"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=lstItems, Path=Items.Count}" Value="0"> <Setter Property="Visibility" Value="Visible" /> </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> </TextBlock>

    Read the article

  • ASP.Net GridView GridViewDeleteEventArgs.Keys empty

    - by the berserker
    I have following Gridview: <asp:GridView ID="GridView1" runat="server" CssClass="table" DataKeyNames="groupId" DataSource="<%# dsUserGroupsSelected %>" DataMember="Group" etc....> and after firing RowDeleting event handler: protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) e.Keys is empty. Moreover, in runtime if I check dsUserGroupsSelected.Group.PrimaryKey it is poulated with: {System.Data.DataColumn[1]} [0]: {groupId} so it's really odd to me. Am I missing something? I have this kind of a workaround: int groupId = (int)GridView1.DataKeys[e.RowIndex].Value; which will work just fine, but I just can't get it why e.Keys (and e.Values) would be empty!? Any ideas?

    Read the article

  • struts2 StringLengthFieldValidator annotation not working for empty string

    - by dcp
    Let's say I have this annotation for a struts2 validation: @StringLengthFieldValidator(key = "key14", fieldName = "poNumber", minLength = "1", maxLength = "255", message = "poNumber must be between 1 and 255 characters.") public void setPoNumber(String poNumber) { this.poNumber = poNumber; } The behavior I'm seeing is that if I pass a string that is empty to this setter, (ex. setPoNumber("")) the validator doesn't catch the error. Strings that are over 255 are caught fine. Equally strange is if I change minLength to 2 and pass a string of length 1, it will catch the error as well. But empty string does not seem to be caught when minLength = "1". For this reason, I cannot use this validator. I just wondered if I'm doing something wrong. I'm using struts 2.1.8.1. Thanks for any advice.

    Read the article

  • Avoid generating empty STDOUT and STDERR files with Sun Grid Engine (SGE) and array jobs

    - by vy32
    I am running array jobs with Sun Grid Engine (SGE). My carefully scripted array job workers generate no stdout and no stderr when they function properly. Unfortunately, SGE insists on creating an empty stdout and stderr file for each run. Sun's manual states: STDOUT and STDERR of array job tasks will be written into dif- ferent files with the default location .['e'|'o']'.' In order to change this default, the -e and -o options (see above) can be used together with the pseudo-environment-vari- ables $HOME, $USER, $JOB_ID, $JOB_NAME, $HOSTNAME, and $SGE_TASK_ID. Note, that you can use the output redirection to divert the out- put of all tasks into the same file, but the result of this is undefined. I would like to have the output files suppressed if they are empty. Is there any way to do this?

    Read the article

  • Java: design problem with final-value and empty constructor

    - by HH
    $ javac InitInt.java InitInt.java:7: variable right might not have been initialized InitInt(){} ^ 1 error $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; // Design Problem? // I feel the initialization problem is just due to bad style. InitInt(){} InitInt{ // Still the error, "may not be initialized" // How to initialise it? if(snippetBuilder.length()>(charwisePos+25)){ right=charwisePos+25; }else{ right=snippetBuilder.length()-1; } } public static void main(String[] args) { InitInt test = new InitInt(); System.out.println(test.getRight()); } public int getRight(){return right;} } Partial Solutions and Suggestions use "this" to access methods in the class, instead of creating empty constructor change final to non-final with final field value: initialize all final values in every constructor remove the empty constructor, keep your code simple and clean

    Read the article

  • SSIS Dataflow From Excel Empty Rows

    - by Gerard
    Hi All, I am using SSIS Dataflow to import data into SQL2008. My data source is an excel file. The dataflow is working, however it seems that it is importing empty rows from the Excel file. I don't understand why this is happening. For example i have data in rows 1 to rows 100,000. But when the data flow task runs it might say it is importing 200,000 rows. When I then import the data back into excel, I get 200,000 rows of data with 100,000 empty rows in between the data. Can someone please help? Thanks

    Read the article

  • Socket Select with empty fd set

    - by whoi
    Hi; Suppose you have an fd set which can have zero or more sockets in it. When I try to call select operation on empty fd set, what I get is -1 as the number of fds which are set, meaning error. So what would you suggest to overcome this problem, you might say do not call if empty but I have a loop and any time fd set can hold 0 or more sockets. What is the best approach about this problem? (we are on C programming language)

    Read the article

  • DataTable C# Empty column type

    - by Dested
    I am trying build a DataTable one row at a time using the following code. foreach (var e in Project.ProjectElements[hi.FakeName].Root.Elements()) { index = 0; object[] obj=new object[count]; foreach (var holdingColumn in names) { string d = e.Attribute(holdingColumn.Key).Value; obj[index++] = d; } dt.Rows.Add(obj); } The problem is the DataTable has types tied to the columns. Sometimes im passing null (or an empty string) in that object index and it is telling me that it cant be converted properly to a DateTime (in this case). My question is what should I default this value to, or is there some way to have the DataTable ignore empty values.

    Read the article

  • Return an empty IEnumerator

    - by Rekreativc
    Hello! I have an interface that, among other things, implements a "public IEnumerator GetEnumerator()" method, so I can use the interface in a foreach statement. I implement this interface in several classes and in one of them, I want to return an empty IEnumerator. Right now I do this the following way: public IEnumerator GetEnumerator() { ArrayList arr = new ArrayList(); return arr.GetEnumerator(); } However I consider this an ugly hack, and I can't help but think that there is a better way of returning an empty IEnumerator. Is there?

    Read the article

  • Neglect empty cells while refreshing

    - by Ashok Vardhan
    I have an excel macro which refreshes the worksheet. However, if the file (in .csv format) with which the worksheet is being refreshed has empty cells, it's shifting the data from other columns and placing the data in wrong columns. However,if I manually refresh the sheet, it's working fine. I don't know how I can fix this. I just want my whole .csv file including empty cells to appear as it is in the worksheet. Any suggestions would be greatly helpful. The following is the Macro code. With Worksheets("RawData1").QueryTables(1) .TextFilePromptOnRefresh = False .RefreshStyle = xlinsertdelete .Connection = Application.Substitute(.Connection, CurrPath, NewPath) .Refresh End With // We can assume that we have CurrPath and NewPath properly

    Read the article

  • snipMate only working on empty buffer?

    - by JesseBuesking
    I'm attempting to use snipMate with sql files, however it doesn't seem to work when editing an existing file. If I create a new empty buffer (no file; e.g. launch gvim from the start menu), and set the filetype to sql (:set ft=sql), it works. However, if I then try to open a sql file (e.g. :e c:\blah.sql) and edit it, snipMate no longer works. What gives!? Setup: gvim vim 7.3 Windows 7 snipMate 0.84 Also, I do in fact have filetype plugin on in my .vimrc file. edit Apparently if I open an empty buffer, set the filetype to sql, then save to file using w c:\blah.sql, I now have a sql file open AND snipMate continues to work. edit Here's a gist of my current .vimrc in case it helps: https://gist.github.com/3946877

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >