Search Results

Search found 8223 results on 329 pages for 'odd behavior'.

Page 9/329 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Change Linux console screen blanking behavior

    - by quack quixote
    How do I change the screen blanking behavior on Linux virtual terminals? For example, if I switch to a VT from X, login, and leave the system alone for 5 minutes or so, the screen will blank like a screensaver. It comes back with any keypress, like a screensaver. Mostly I just want to change the timeout, but I'm also interested in other settings. If it helps, one of my systems is running Ubuntu 10.04 with the stock graphics drivers. fbset shows the console using the radeondrmfb framebuffer device.

    Read the article

  • Difference in behavior of reboot

    - by LinuxPenseur
    Hi, I have 2 machines running linux. In one machine, the reboot command is an executable normally found in all linux distributions. In the second machine the reboot command is a shell script customized using some other hardware tool commands to reboot the system. One behavior difference between the 2 machines is that when i execute reboot command on the first machine, it shows another shell prompt and then only reboots. But in the case of second machine, it reboots without showing a shell prompt. I expect the second machine to behave the same way as first machine when reboot command is given. Currently i am analyzing the source code of shutdown.c and halt.c normally found in linux distributions, so that i can find out the implementation which produces the shell propmt on reboot and use that in the shell script in second machine. Kindly give me some pointers on where i should start looking to find the implementation. Thanks

    Read the article

  • Wifi and eth behavior

    - by r00ster
    I have a wireless router 150M Wireless Lite N Router Model No. TL-WR740N / TL-WR740ND. Normally, when I'm connected to the local network using eth0 I can ping other machines by issuing ping name. When I'm connected through wifi I have to issue ping name.domain.com. The machine is only visible in intranet. How to achieve the same behavior with wifi? The second problem is, that I can not connect to some external sites through wifi but through eth everything is ok. I guess that is related to some port forwarding, but I'm not sure. How can I resolve this issue? EDIT: I'm using Linux Mint.

    Read the article

  • Strange filesystem behavior, Ubuntu 9

    - by Fixee
    I have two windows open on the same machine (Ubuntu 9, ia32, server). I'll call these windows W1 and W2. W1: $ cd ~/test $ ls sample $ In W2 I run "make" from a parent directory that recreates file test/sample: $ make project . . $ cd test $ ls sample $ Now, returning to W1: $ ls $ cd ../test $ ls sample $ In other words, after I build from another window and the file test/sample is replaced, ls shows the file as missing in the 2nd window until I cd ../test back into the directory whereupon it reappears. I can give more details if required, but just wondering if this is a well-known behavior.

    Read the article

  • Wifi and eth behavior

    - by r00ster
    I have a wireless router 150M Wireless Lite N Router Model No. TL-WR740N / TL-WR740ND. Normally, when I'm connected to the local network using eth0 I can ping other machines by issuing ping name. When I'm connected through wifi I have to issue ping name.domain.com. The machine is only visible in intranet. How to achieve the same behavior with wifi? The second problem is, that I can not connect to some external sites through wifi but through eth everything is ok. I guess that is related to some port forwarding, but I'm not sure. How can I resolve this issue? EDIT: I'm using Linux Mint.

    Read the article

  • Are ORM's counterproductive to OO design?

    - by Jeremiah
    In OOD, design of an object is said to be characterized by its identity and behavior. Having used OR/M's in the past, the primary purpose, in my opinion, revolves around the ability to store/retrieve data. That is to say, OR/M objects are not design by behavior, but rather data (i.e. database tables). Case and point: Many OR/M tools come with a point-to-a-database-table-and-click-object-generator. If objects are no longer characterized by behavior this will, in my opinion, muddy the identity and responsibility of the objects. Subsequently, if objects are not defined by a responsibility this could lend a hand to having tightly coupled classes and overall poor design. Furthermore, I would think that in an application setting, you would be heading towards scalability issues. So, my question is, do you think that ORM's are counterproductive to OO design? Perhaps the underlying question would be whether or not they are counterproductive to application development.

    Read the article

  • Odd behavior when recursively building a return type for variadic functions

    - by Dennis Zickefoose
    This is probably going to be a really simple explanation, but I'm going to give as much backstory as possible in case I'm wrong. Advanced apologies for being so verbose. I'm using gcc4.5, and I realize the c++0x support is still somewhat experimental, but I'm going to act on the assumption that there's a non-bug related reason for the behavior I'm seeing. I'm experimenting with variadic function templates. The end goal was to build a cons-list out of std::pair. It wasn't meant to be a custom type, just a string of pair objects. The function that constructs the list would have to be in some way recursive, with the ultimate return value being dependent on the result of the recursive calls. As an added twist, successive parameters are added together before being inserted into the list. So if I pass [1, 2, 3, 4, 5, 6] the end result should be {1+2, {3+4, 5+6}}. My initial attempt was fairly naive. A function, Build, with two overloads. One took two identical parameters and simply returned their sum. The other took two parameters and a parameter pack. The return value was a pair consisting of the sum of the two set parameters, and the recursive call. In retrospect, this was obviously a flawed strategy, because the function isn't declared when I try to figure out its return type, so it has no choice but to resolve to the non-recursive version. That I understand. Where I got confused was the second iteration. I decided to make those functions static members of a template class. The function calls themselves are not parameterized, but instead the entire class is. My assumption was that when the recursive function attempts to generate its return type, it would instantiate a whole new version of the structure with its own static function, and everything would work itself out. The result was: "error: no matching function for call to BuildStruct<double, double, char, char>::Go(const char&, const char&)" The offending code: static auto Go(const Type& t0, const Type& t1, const Types&... rest) -> std::pair<Type, decltype(BuildStruct<Types...>::Go(rest...))> My confusion comes from the fact that the parameters to BuildStruct should always be the same types as the arguments sent to BuildStruct::Go, but in the error code Go is missing the initial two double parameters. What am I missing here? If my initial assumption about how the static functions would be chosen was incorrect, why is it trying to call the wrong function rather than just not finding a function at all? It seems to just be mixing types willy-nilly, and I just can't come up with an explanation as to why. If I add additional parameters to the initial call, it always burrows down to that last step before failing, so presumably the recursion itself is at least partially working. This is in direct contrast to the initial attempt, which always failed to find a function call right away. Ultimately, I've gotten past the problem, with a fairly elegant solution that hardly resembles either of the first two attempts. So I know how to do what I want to do. I'm looking for an explanation for the failure I saw. Full code to follow since I'm sure my verbal description was insufficient. First some boilerplate, if you feel compelled to execute the code and see it for yourself. Then the initial attempt, which failed reasonably, then the second attempt, which did not. #include <iostream> using std::cout; using std::endl; #include <utility> template<typename T1, typename T2> std::ostream& operator <<(std::ostream& str, const std::pair<T1, T2>& p) { return str << "[" << p.first << ", " << p.second << "]"; } //Insert code here int main() { Execute(5, 6, 4.3, 2.2, 'c', 'd'); Execute(5, 6, 4.3, 2.2); Execute(5, 6); return 0; } Non-struct solution: template<typename Type> Type BuildFunction(const Type& t0, const Type& t1) { return t0 + t1; } template<typename Type, typename... Rest> auto BuildFunction(const Type& t0, const Type& t1, const Rest&... rest) -> std::pair<Type, decltype(BuildFunction(rest...))> { return std::pair<Type, decltype(BuildFunction(rest...))> (t0 + t1, BuildFunction(rest...)); } template<typename... Types> void Execute(const Types&... t) { cout << BuildFunction(t...) << endl; } Resulting errors: test.cpp: In function 'void Execute(const Types& ...) [with Types = {int, int, double, double, char, char}]': test.cpp:33:35: instantiated from here test.cpp:28:3: error: no matching function for call to 'BuildFunction(const int&, const int&, const double&, const double&, const char&, const char&)' Struct solution: template<typename... Types> struct BuildStruct; template<typename Type> struct BuildStruct<Type, Type> { static Type Go(const Type& t0, const Type& t1) { return t0 + t1; } }; template<typename Type, typename... Types> struct BuildStruct<Type, Type, Types...> { static auto Go(const Type& t0, const Type& t1, const Types&... rest) -> std::pair<Type, decltype(BuildStruct<Types...>::Go(rest...))> { return std::pair<Type, decltype(BuildStruct<Types...>::Go(rest...))> (t0 + t1, BuildStruct<Types...>::Go(rest...)); } }; template<typename... Types> void Execute(const Types&... t) { cout << BuildStruct<Types...>::Go(t...) << endl; } Resulting errors: test.cpp: In instantiation of 'BuildStruct<int, int, double, double, char, char>': test.cpp:33:3: instantiated from 'void Execute(const Types& ...) [with Types = {int, int, double, double, char, char}]' test.cpp:38:41: instantiated from here test.cpp:24:15: error: no matching function for call to 'BuildStruct<double, double, char, char>::Go(const char&, const char&)' test.cpp:24:15: note: candidate is: static std::pair<Type, decltype (BuildStruct<Types ...>::Go(BuildStruct<Type, Type, Types ...>::Go::rest ...))> BuildStruct<Type, Type, Types ...>::Go(const Type&, const Type&, const Types& ...) [with Type = double, Types = {char, char}, decltype (BuildStruct<Types ...>::Go(BuildStruct<Type, Type, Types ...>::Go::rest ...)) = char] test.cpp: In function 'void Execute(const Types& ...) [with Types = {int, int, double, double, char, char}]': test.cpp:38:41: instantiated from here test.cpp:33:3: error: 'Go' is not a member of 'BuildStruct<int, int, double, double, char, char>'

    Read the article

  • Strange ASP.NET Queue Performance Counters Behavior?

    - by LemurTech
    We have an ASP.NET 2.0 site running in classic mode. I am seeing very strange behavior in the performance counter values. Perhaps these are bugs (I've been all over Google trying to verify this, without much luck), or perhaps it is just my inexperience with monitoring these things. This PerfMon graph (http://imgur.com/Jv5io5J) represents a load test where I add up to 350 virtual users to the site, at a rate of about 1/sec, performing relatively simple page browsing. At the end of the test, I gradually taper off the number of users. This is a 4 CPU server. Machine.config settings for are at the defaults. The solid blue line is ASP.NET Apps v2.x\Requests Executing for the application in question. The profile makes perfect sense, with a quick ramp-up to 32 executing requests (minWorkerThreads x 4CPUs), followed by a slower ramp-up to 48 ((maxWorkerThreads - minWorkerThreads) x 4CPUs). The solid yellow line is ASP.NET v2.x\Requests Queued. Again, this makes sense: after the initial 32 request threads are activated, the queue begins to build as new thread initialization can't keep pace with incoming requests. But as executing requests reaches its highest possible value of 48, the counter for ASP.NET Apps v2.x\Requests Queued (green solid line) suddenly springs to life and maintains step with the yellow counter. As far as I can tell, and with no other apps running on the server, these two counters should have had the same values from the start. One other odd thing: The counter for ASP.NET v2.x\Request Wait Time (dotted yellow line) also does not spring to life until executing requests reaches 48. Shouldn't I be seeing values here from the moment ASP.NET v2.x\Requests Queued begins to build? And likewise, why would ASP.NET Apps v2.x\Request Execution Time (dotted blue) increase significantly only after that peak of 48 is reached? Shouldn't it ramp-up gradually along with queued requests?

    Read the article

  • Override the default row error behavior for a DataGridView

    - by Pat
    I have a DataGridView that is bound to a DataTable. When a row in the table has an error (row.RowError is not empty), the DGV helpfully displays an error icon and tooltip with the error text. Instead of, or in addition to, this behavior, I would like to change the entire row color. What event does the DGV subscribe to in order to handle errors and/or how can I override the DGV's default behavior?

    Read the article

  • WPF - attached behavior to capture MouseEnter on Image in TreeviewITem

    - by pileggi
    Hi! Could I have, please, a little code-sample of WPF "attached behavior"? I explain my problem: I've done my TreeView all with XAML but now I'd like to manage an event with code-behind. The HierarchicalDataTemplate contains an Image. I need to capture the events MouseEnter / MouseLeave on the Image. I'd like to do this with "attached behavior", but I don't know how. Thank you! Pileggi

    Read the article

  • Behavior Tree Implementations

    - by Hamza Yerlikaya
    I am looking for behavior tree implementations in any language, I would like to learn more about how they are implemented and used so can roll my own but I could only find one Owyl, unfortunately, it does not contain examples of how it is used. Any one know any other open source ones that I can browse through the code see some examples of how they are used etc? EDIT: Behavior tree is the name of the data structure.

    Read the article

  • What causes this logrotate behavior in Puppet?

    - by ujjain
    After running logrotate, Puppet starts writing it's logs into /var/log/puppet/masterhttp.log-20130616. How come it doesn't keep logging in /var/log/puppet/masterhttp.log? It seems normal behavior is renaming the original log-file and start with a clean fresh log-file to start writing in that log file, keeping the other file as a log-archive. [root@puppetmaster puppet]# ls -al total 97520 drwxr-x---. 2 puppet puppet 4096 Jun 16 03:24 . drwxr-xr-x. 12 root root 4096 Jul 1 09:11 .. -rw-r--r--. 1 puppet puppet 0 Jun 16 03:24 masterhttp.log -rw-rw----. 1 puppet puppet 99847187 Jul 1 09:19 masterhttp.log-20130616 [root@puppetmaster init.d]# cat /etc/logrotate.d/puppet /var/log/puppet/*log { missingok notifempty create 0644 puppet puppet sharedscripts postrotate pkill -USR2 -u puppet -f /usr/sbin/puppetmasterd || true [ -e /etc/init.d/puppet ] && /etc/init.d/puppet reload > /dev/null 2>&1 || true endscript } [root@puppetmaster init.d]# How can I make Puppet log to /var/log/puppet/masterhttp.log and not to /var/log/puppet/masterhttp.log-20130616? Even restarting puppet doesn't make it log into /var/log/puppet/masterhttp.log instead of /var/log/puppet/masterhttp.log-20130616.

    Read the article

  • Apache mod_rewrite weird behavior in Internet Explorer

    - by morrty
    I'm attempting to setup redirection for a couple of root domains. Firstly, here is the code in my httpd-vhosts.conf file: <VirtualHost *:80> ServerAdmin ****@example.com ServerName example.com ServerAlias example2.com RewriteEngine On RewriteCond %{HTTP_HOST} !^192\.168\.0\.1$ # This is our WAN IP RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/?(.*) http://www.%{HTTP_HOST}/$1 [L,R,NE] </VirtualHost> What this does is redirect the root domain of example.com or example2.com or any host other than www to www.example(2).com The part I'm having a problem with is the RewriteRule itself. the $1 is supposed to match the pattern of the RewriteRule and add it in the substitution. For example: "http://example.com/test.html" should rewrite to "http://www.example.com/test.html" It works in all modern browsers like it's supposed to except for IE8 or IE9 (I didn't test other IE versions). In IE, this works: "http://example.com" to "http://www.example.com" In IE, this does not work: "http://example.com/test.html" to "http://www.example.com/test.html" Does anyone have an explanation for this behavior? I hope I've explained it well enough. Thank you.

    Read the article

  • Strange difference in bash behavior across systems

    - by pinkie_d_pie_0228
    I have two systems, an Ubuntu computer and an Android tablet. I have built and configured bash for Android to be used in adb, so it's the same version as my Ubuntu bash, and they use mostly the same bashrc and configuration, and the same exact options set by shopt. However, there is a slight difference in that the Android bash behaves as I expect when I I try to tab-complete something using a variable in it, but the Ubuntu bash doesn't. #Android ls $HOME/loc<tab> => ls $HOME/local #As expected Basically, the variable is taken into account when completing. But then #Ubuntu ls $HOME/loc<tab> => ls \$HOME/loc #Undesired behavior. The list of options is as follows, and is the same in both builds of bash. autocd:checkwinsize:cmdhist:expand_aliases:extglob:extquote:force_fignore:histappend:interactive_comments:progcomp:promptvars:sourcepath What can be making the Ubuntu version escape the $ instead of using it for completion as in the Android build? What can I do to make both work the same way? Any help will be greatly appreciated.

    Read the article

  • hyper-v cluster behavior when losing network connectivity

    - by ChristopheD
    Setup: (rather new) Hyper-V R2 cluster with 2 nodes (in failover configuration). Fysical host OS: Windows Server 2008. About eight VM's (mixed: Windows Server 2008 and Linux) Yesterday we had a power outage of about 15 minutes. Our blades are on UPS so the fysical host machines (Windows Server 2008) never went down. Our main switches are not on UPS (yet) and we saw the behaviour similar to the following (as distilled from the event logs). The nodes in the cluster lost means of communication (because the external switches went down). The cluster wants to bring down one (the first) of the nodes (to start failover?). The previous step impacts clustered storage where the virtual machine VHD's are located. All VM's got brutally terminated and were found in a failed state in the failover manager in the host OS'es. The Linux VM's were kernel panicking and looked like they had their disk ripped out. This whole setup is rather new to us, so we are still learning about this. The question: We are putting switches on UPS soon but were wondering if the above is expected behavior (seems rather fragile) or if there are obvious improvements configuration-wise to handle such scenario's ? I can upload an evtx file concerning what exactly was going on in case that's necessary.

    Read the article

  • Unexpected media key behavior on new Acer Aspire

    - by Morgan May
    I'm having weird issues with the media keys (play/pause, previous, next, etc.) on a new Acer Aspire laptop. This is the first Acer I've owned and also my first Windows 7 computer, so I'm not sure whether the behavior is a result of some hidden Acer process that I haven't rooted out yet, or some Windows 7 option that I'm not aware of, or something else. I'm experiencing two issues that I suspect are related. Both problems are intermittent but happen more often than not. The media player I'm using is Winamp. I'm pretty sure I've had the same problem when using other media players, but when I tried to verify that before posting this, I only had the problems with Winamp. Because the problems are intermittent, I'm not sure if that's significant. 1) When I press the Play/Pause media key, in addition to playing or pausing the media player, it brings up a little menu in the center of the screen that lists my removable drives (CD/DVD, USB drives, etc.). To make the menu go away I have to either click away from it or hit Escape. Selecting a drive on the menu doesn't seem to do anything. 2) When I press the Previous or Next media keys, it skips 2+ tracks instead of just one (the exact number seems to vary). I've poked around all the control panel options that I can find, and looked through all the utilities that came with the computer with no luck. There's nothing that I can find in the (very slim) documentation, either. I have a hunch that the problem is caused by whatever utility manages global hotkeys, but I haven't found any way to configure that. Any guidance would be greatly appreciated. UPDATE: It looks like Winamp was the culprit. I did have the problem when using other media players, but when I uninstalled Winamp, the problem went away. I'd like to use Winamp, but I can survive with other players.

    Read the article

  • Same script, different behavior [migrated]

    - by Antoine_935
    I just stumbled upon an interesting bug... Still trying to figure out what is exactly happening. Maybe you can help. First, the context. I'm currently building yet another man to html converter (for some reasons I won't motivate here, but I need it). So, have a look at the screenshot below (see the link), more precisely at the outlined spots. See? On the upper shell, I have &lt ; and &gt ;, that is, escaped html. While on the shell below I have < and directly. But as you can see (or do I seriously need looking glass ?), the command man 2 semget | webmanneris the same on both sides, as is the which webmanner. The two are executed roughly at the same moment, with no modification made to the script between. [Oops, cannot post pictures just yet... Here comes the link] http://aspyct.org/media/webmanner-bug.png But the shell below is older (open about 1 hour ago). Newer shells all print out &lt ;. So my first guess was that it somehow had a cached reference to the old inode of the file, or old blocks or whatever. So I modified parts of the script, at the start and then at the end, to print different messages. And, surprise, the message shown up on both terminals. But still, same difference between &lt ; and <. I'm confused... How to explain that behavior? I'm working on a OSX 10.8 (Mountain Lion) EDIT: OK, there is one big difference: the shell below uses ruby 1.9.3, while above is 1.8.7. Is there any known difference in string handling between the two versions ?

    Read the article

  • How to get desired FireFox last tab behavior?

    - by JustJeff
    All tabs should be the same; so if any of the have a 'close' button, they all should, including the last tab. I see no reason that a tab's close button should suddenly vanish simply b/c that tab has become the last one open. If I have N tabs open, and park the mouse over the left-most tab's close button, this vanishing close button trick means now I have to make a large mouse move to get to the app's close button. Unsat. Mouse moves = too many milliseconds wasted. Closing the last tab should NOT take me to my home page, or any other page whatsoever. I want the browser to close with the last tab. I do not expect or want "new tab" behavior when I click a Close button. Now, I've gone into about:config and played with browser.tabs.closeWindoWithLastTab, but this setting oversteps its purpose; while it does make the browser close, for some inexplicable reason, it also suppresses the last tab's close button! I have tried the "last tab close button" add-on, and while this does restore the close button, the add-on oversteps by taking the liberty of turning closeWindowWithLastTab off. Is there some way out of this pickle? Is it too hard to just code things to provide simple, orthogonal actions, so that everybody can config the UI to their liking, and not just to a few pre-fab configurations that the developers think everyone should like? Btw, FF 13.0.1 on ms windows

    Read the article

  • Silverlight ComboBox Attached Behavior

    - by Mark Cooper
    I am trying to create an attached behavior that can be applied to a Silverlight ComboBox. My behavior is this: using System.Windows.Controls; using System.Windows; using System.Windows.Controls.Primitives; namespace AttachedBehaviours { public class ConfirmChangeBehaviour { public static bool GetConfirmChange(Selector cmb) { return (bool)cmb.GetValue(ConfirmChangeProperty); } public static void SetConfirmChange(Selector cmb, bool value) { cmb.SetValue(ConfirmChangeProperty, value); } public static readonly DependencyProperty ConfirmChangeProperty = DependencyProperty.RegisterAttached("ConfirmChange", typeof(bool), typeof(Selector), new PropertyMetadata(true, ConfirmChangeChanged)); public static void ConfirmChangeChanged(DependencyObject d, DependencyPropertyChangedEventArgs args) { Selector instance = d as Selector; if (args.NewValue is bool == false) return; if ((bool)args.NewValue) instance.SelectionChanged += OnSelectorSelectionChanged; else instance.SelectionChanged -= OnSelectorSelectionChanged; } static void OnSelectorSelectionChanged(object sender, RoutedEventArgs e) { Selector item = e.OriginalSource as Selector; MessageBox.Show("Unsaved changes. Are you sure you want to change teams?"); } } } This is used in XAML as this: <UserControl x:Class="AttachedBehaviours.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:this="clr-namespace:AttachedBehaviours" mc:Ignorable="d"> <Grid x:Name="LayoutRoot"> <StackPanel> <ComboBox ItemsSource="{Binding Teams}" this:ConfirmChangeBehaviour.ConfirmChange="true" > </ComboBox> </StackPanel> </Grid> </UserControl> I am getting an error: Unknown attribute ConfirmChangeBehaviour.ConfirmChange on element ComboBox. [Line: 13 Position: 65] Intellisense is picking up the behavior, why is this failing at runtime? Thanks, Mark EDIT: Register() changed to RegisterAttached(). Same error appears.

    Read the article

  • [ASP.NET] Odd HttpRequest behaviour

    - by barguast
    I have a web service which runs with a HttpHandler class. In this class, I inspect the request stream for form / query string parameters. In some circumstances, it seemed as though these parameters weren't getting through. After a bit of digging around, I came across some behaviour I don't quite understand. See below: // The request contains 'a=1&b=2&c=3' // TEST ONLY: Read the entire request string contents; using (StreamReader sr = new StreamReader(context.Request.InputStream)) { contents = sr.ReadToEnd(); } // Here 'contents' is usually correct - containing 'a=1&b=2&c=3'. Sometimes it is empty. string a = context.Request["a"]; // Here, a = null, regardless of whether the 'contents' variable above is correct Can anyone explain to me why this might be happening? I'm using a .NET WebClient and UploadDataAsync to perform the request on the client if that makes any difference. If you need any more information, please let me know.

    Read the article

  • Odd SQL Results

    - by Ryan Burnham
    So i have the following query Select id, [First], [Last] , [Business] as contactbusiness, (Case When ([Business] != '' or [Business] is not null) Then [Business] Else 'No Phone Number' END) from contacts The results look like id First Last contactbusiness (No column name) 2 John Smith 3 Sarah Jane 0411 111 222 0411 111 222 6 John Smith 0411 111 111 0411 111 111 8 NULL No Phone Number 11 Ryan B 08 9999 9999 08 9999 9999 14 David F NULL No Phone Number I'd expect record 2 to also show No Phone Number If i change the "[Business] is not null" to [Business] != null then i get the correct results id First Last contactbusiness (No column name) 2 John Smith No Phone Number 3 Sarah Jane 0411 111 222 0411 111 222 6 John Smith 0411 111 111 0411 111 111 8 NULL No Phone Number 11 Ryan B 08 9999 9999 08 9999 9999 14 David F NULL No Phone Number Normally you need to use is not null rather than != null. whats going on here?

    Read the article

  • Passing html parameters to server odd problem

    - by StealthRT
    Hey all i am having a weird problem with sending data back to my server. This is the code i am using: NSString *theURL =[NSString stringWithFormat:@"http://www.xxx.com/confirm.asp?theID=%@&theName=%@&empID=%@&theComp=%@", theConfirmNum, tmpNBUserRow.userName, labelTxt.text, theID]; NSLog(@"%@,%@,%@,%@", theConfirmNum, tmpNBUserRow.userName, labelTxt.text, theID); NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:theURL]]; [request setHTTPMethod:@"POST"]; NSError *error; NSURLResponse *response; NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding]; if ([data isEqualToString:@"Done"]) I can run the code from the browser and it works just fine using the data i got from the NSLog output. The NSLog output for each value is correct. But for some reason when i put a break on the IF ([data isEqualToString:@"Done"]) it has no return value. I checked each value for what it was sending (and again, it was correct in the NSLog output) and i found that the value "theID" said "Out of scope". Although, again, the NSLog had the value in it correctly? So i searched the forum and found a simular problem. I took their advice and added "RETAIN" to the "theID" value like so: theID = [customObjInstance TID]; [theID retain]; However, that did not solve the issue... Here is the console NSLog output: [Session started at 2010-04-11 01:31:50 -0400.] wait_fences: failed to receive reply: 10004003 wait_fences: failed to receive reply: 10004003 nbTxt(5952,0xa0937500) malloc: *** error for object 0x3c0ebc0: double free *** set a breakpoint in malloc_error_break to debug 2010-04-11 01:32:12.270 nbTxt[5952:207] 5122,Rob S.,5122,NB010203 The NSLog values i am sending is the last line "5122,Rob S.,5122,NB010203" Any help would be great :o) David

    Read the article

  • Odd behavior in Django Form (readonly field/widget)

    - by jamida
    I'm having a problem with a test app I'm writing to verify some Django functionality. The test app is a small "grade book" application that is currently using Alex Gaynor's readonly field functionality http://lazypython.blogspot.com/2008/12/building-read-only-field-in-django.html There are 2 problems which may be related. First, when I flop the comment on these 2 lines below: # myform = GradeForm(data=request.POST, instance=mygrade) myform = GradeROForm(data=request.POST, instance=mygrade) it works like I expect, except of course that the student field is changeable. When the comments are the shown way, the "studentId" field is displayed as a number (not the name, problem 1) and when I hit submit I get an error saying that studentId needs to be a Student instance. I'm at a loss as to how to fix this. I'm not wedded to Alex Gaynor's code. ANY code will work. I'm relatively new to both Python and Django, so the hints I've seen on websites that say "making a read-only field is easy" are still beyond me. // models.py class Student(models.Model): name = models.CharField(max_length=50) parent = models.CharField(max_length=50) def __unicode__(self): return self.name class Grade(models.Model): studentId = models.ForeignKey(Student) finalGrade = models.CharField(max_length=3) # testbed.grades.readonly is alex gaynor's code from testbed.grades.readonly import ReadOnlyField class GradeROForm(ModelForm): studentId = ReadOnlyField() class Meta: model=Grade class GradeForm(ModelForm): class Meta: model=Grade // views.py def modifyGrade(request,student): student = Student.objects.get(name=student) mygrade = Grade.objects.get(studentId=student) if request.method == "POST": # myform = GradeForm(data=request.POST, instance=mygrade) myform = GradeROForm(data=request.POST, instance=mygrade) if myform.is_valid(): grade = myform.save() info = "successfully updated %s" % grade.studentId else: # myform=GradeForm(instance=mygrade) myform=GradeROForm(instance=mygrade) return render_to_response('grades/modifyGrade.html',locals()) // template <p>{{ info }}</p> <form method="POST" action=""> <table> {{ myform.as_table }} </table> <input type="submit" value="Submit"> </form> // Alex Gaynor's code from django import forms from django.utils.html import escape from django.utils.safestring import mark_safe from django.forms.util import flatatt class ReadOnlyWidget(forms.Widget): def render(self, name, value, attrs): final_attrs = self.build_attrs(attrs, name=name) if hasattr(self, 'initial'): value = self.initial return mark_safe("<span %s>%s</span>" % (flatatt(final_attrs), escape(value) or '')) def _has_changed(self, initial, data): return False class ReadOnlyField(forms.FileField): widget = ReadOnlyWidget def __init__(self, widget=None, label=None, initial=None, help_text=None): forms.Field.__init__(self, label=label, initial=initial, help_text=help_text, widget=widget) def clean(self, value, initial): self.widget.initial = initial return initial

    Read the article

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