Daily Archives

Articles indexed Monday December 17 2012

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

  • PHP variable equals true no matter what the value, even 0

    - by kaigoh
    This is the var_dump: object(stdClass)#27 (8) { ["SETTING_ID"]=> string(2) "25" ["SETTING_SOURCE"]=> string(2) "XV" ["SETTING_FLEET"]=> string(3) "313" ["SETTING_EXAM"]=> string(1) "A" ["SETTING_HIDE"]=> string(1) "0" ["SETTING_THRESHOLD"]=> string(1) "0" ["SETTING_COUNT"]=> string(8) "POSITIVE" ["SETTING_USAGE"]=> string(7) "MILEAGE" } The variable I am testing is SETTING_HIDE. This is being pulled from MySQL using the Code igniter framework. I don't know if it is just me being thick after a rather long day at work or what, but no matter what value the variable holds, any if statement made against it returns true, even when typecast as a boolean or a direct string comparison, ie. == "0" or == "1". Anyone with a fresh pair of eyes care to make me feel silly!?! :) Just to clarify: Have tried the following: if($examSetting->SETTING_HIDE == "1") { $showOnABC = "checked=\"checked\""; } if((bool)$examSetting->SETTING_HIDE) { $showOnABC = "checked=\"checked\""; } if($examSetting->SETTING_COUNT == "POSITIVE") further on in my code works perfectly.

    Read the article

  • on Google App Engine 500 Error, it should be 200 instead of 500

    - by Faisal Amjad
    requestToken = function() { var getTokenURI = '/gettoken?userid=' + userid; var httpRequest = makeRequest(getTokenURI, true); httpRequest.onreadystatechange = function() { if (httpRequest.readyState == 4) { if (httpRequest.status == 200) { openChannel(httpRequest.responseText); } else { alert('ERROR: AJAX request status = ' + httpRequest.status); } } } }; function makeRequest(url, async) { var httpRequest; if (window.XMLHttpRequest) { httpRequest = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } if (!httpRequest) { return false; } httpRequest.open('POST', url, async); httpRequest.send(); return httpRequest; } it is running excellent on localhost...but on google app engine it httpRequest.status equals 500 and goes in else statement. WHY? LOG on google app engine: /getFriendList?userid=d 500 253ms 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11 175.110.179.86 - - [17/Dec/2012:08:35:33 -0800] "POST /getFriendList?userid=d HTTP/1.1" 500 0 "http://faisalimmsngr.appspot.com/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11" "faisalimmsngr.appspot.com" ms=254 cpu_ms=110 instance=00c61b117caf2d11ca57d2a2296ccd0b902b038a W 2012-12-17 08:35:33.272 Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@10ff62a{/,/base/data/home/apps/s~faisalimmsngr/1.363934467542140431} org.mortbay.util.MultiException[java.lang.UnsupportedClassVersionError: adv/web/mid/exam/FriendServlet : Unsupported major.minor version 51.0, java.lang.UnsupportedClassVersionError: adv/web/mid/exam/MessageServlet : Unsupported major.minor version 51.0, java.lang.UnsupportedClassVersionError: adv/web/mid/exam/TokenServlet : Unsupported major.minor version 51.0] at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:656) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:219) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:447) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:454) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461) at com.google.tracing.TraceContext.runInContext(TraceContext.java:703) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:338) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:330) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251) at java.lang.Thread.run(Thread.java:679) java.lang.UnsupportedClassVersionError: adv/web/mid/exam/FriendServlet : Unsupported major.minor version 51.0 at com.google.appengine.runtime.Request.process-c04431eac3a1f275(Request.java) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:634) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at org.mortbay.util.Loader.loadClass(Loader.java:91) at org.mortbay.util.Loader.loadClass(Loader.java:71) at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:454) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461) at com.google.tracing.TraceContext.runInContext(TraceContext.java:703) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:338) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:330) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458) at java.lang.Thread.run(Thread.java:679)

    Read the article

  • iReport / jFreeChart - Combining getItemPaint() override and series colors

    - by barneskd
    I'm attempting to create a bar chart that needs to use specific series colors for N number of categories and a separate color for 1 other category. Here is an example: http://i.imgur.com/1DeCF.png (Sorry, I don't have enough points to embed images yet) In the mockup, Categories 1-3 use a collection of 5 colors to render their series while Category 4 uses a single grey color. My first approach was to override the getItemPaint() method using a customizer class, but I can only figure out how to define a color on the category level, not the series level. Is it possible to define colors on category and/or series levels? Something like, If category != "Category4" Use colors A, B, C, D, and E in category's series Else Use color F in category's series Another thought I had was to combine iReport's Series Colors bar chart property and the getItemPaint() override; that way I could define the 5 colors to use in iReport and use the getItemPaint() override only in the case where the category equals "Category 4". So far I've had no luck combining the two; if the override is defined it overrides iReport's Series Color property.

    Read the article

  • wso2 governance email templates

    - by Barry Allott
    We have gotten WSO2 governance registry to send e-mails successfully. Now we want to template the emails that are being sent out. There is a sample at : http://docs.wso2.org/wiki/display/Governance450/Notification+E-mail+Customization+Sample This allows you to alter the text coming through the event but is there an easier way that writing Java code? We cannot compile the sample anyway as the Maven compiler keeps looking up the references files and errors with checksum validation failed. Thanks

    Read the article

  • jQuery mobile ajax login form authentication

    - by Jakub Zak
    I know i already asked simillar question, but now when I work with jQuery Mobile I can't figure it out. So I have this form: <div data-role="page" data-theme="a" id="login_page"> <div data-role="header" data-position="fixed"> <h1>****</h1> </div> <div data-role="content"> <form id="login_form" method="POST" data-ajax="false"> <label for="basic">Username:</label> <input type="text" name="name" id="username" value=""/> <label for="basic">Password:</label> <input type="password" name="password" id="password" value=""/> <input type="submit" value="Login" id="login" name="login"/> </form> </div> <div data-role="footer" data-position="fixed"> <div data-role="navbar"></div> </div> </div> And I need to submit Username and Password to php script, where php replies and send "success" or "failed". Here is php: <?php session_start(); $username = $_POST["name"]; $password = $_POST["password"]; include('mysql_connection.php'); mysql_select_db("jzperson_imesUsers", $con); $res1 = mysql_query("SELECT * FROM temp_login WHERE username='$username' AND password='$password'"); $count=mysql_num_rows($res1); if($count==1){ echo "success"; }else{ echo "failed"; } ?> And to do all this I want to use this script: $(document).ready(function() { $("form").submit(function(){ $.mobile.showPageLoadingMsg(); $.ajax({ url: "http://imes.jzpersonal.com/login_control.php", type: "POST", dataType: "jsonp", jsonp: "jsoncallback", data: $("form#login_form").serialize(), success: function( response ){ $.mobile.changePage( "http://imes.jzpersonal.com/user_panel.html"); } }); return false; }); }); But I can't make it work, I know I must have mistakes in there, I just can't find them, or better way to do it. Thank you in advance for any help.

    Read the article

  • highlight text in 2 textboxes at the same time

    - by user1907736
    I am trying to create a packet analyzer for an online game using C# and I am new to c#. I have 2 RichTextBoxes, 1 shows the packet in bytes and the other one shows the packet in ANSI. Here is what I want to achieve: When I select(highlight) data in the byte text box, I want the corresponding data in the ANSI text box to also be highlighted. (and vice-versa) When I change data in the 1 of the textboxes, I want the corresponding data in the other textbox to also be changed. How do I do these?

    Read the article

  • How to register a custom type in Hibernate using org.springframework.orm.hibernate4.LocalSessionFactoryBean

    - by Luis
    I'm migrating from hibernate 3 to hibernate 4, In hibernate 3 the way I was registering a custom type was: public class AnnotationSessionFactoryBean extends org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean { private Collection<? extends BasicType> customTypes; public Collection<? extends BasicType> getCustomTypes() { return customTypes; } public void setCustomTypes(Collection<? extends BasicType> customTypes) { this.customTypes = customTypes; } @Override protected Configuration newConfiguration() throws HibernateException { Configuration configuration = super.newConfiguration(); if (CollectionUtils.hasEntries(customTypes)) { for (BasicType customType:customTypes) { configuration.registerTypeOverride(customType); } } return configuration; }} I'm now trying to do the same operation but using hibernate 4, my question is how is the best way to do this? since I dont have access do change configuration when using "org.springframework.orm.hibernate4.LocalSessionFactoryBean" instead of "org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean". Thanks

    Read the article

  • Application icons for Flex mobile app targeting Android and iOS

    - by Alexander Farber
    The Adobe doc Developing AIR applications for mobile devices lists quite a few icons to be declared in an application descriptor file. But when I try Export Release Build with the following myApp-app.xml: <icon> <image16x16>assets/icons/16x16.png</image16x16> <image29x29>assets/icons/29x29.png</image29x29> <image32x32>assets/icons/32x32.png</image32x32> <image36x36>assets/icons/36x36.png</image36x36> <image48x48>assets/icons/48x48.png</image48x48> <image57x57>assets/icons/57x57.png</image57x57> <image72x72>assets/icons/72x72.png</image72x72> <image114x114>assets/icons/114x114.png</image114x114> <image128x128>assets/icons/128x128.png</image128x128> <image512x512>assets/icons/512x512.png</image512x512> <!-- <image50x50>assets/icons/50x50.png</image50x50> <image58x58>assets/icons/58x58.png</image58x58> <image100x100>assets/icons/100x100.png</image100x100> <image144x144>assets/icons/144x144.png</image144x144> <image1024x1024>assets/icons/1024x1024.png</image1024x1024> --> </icon> I get the error message (regardless if deploying for Android or iOS) unless I comment the 5 lines as above: error 103: application.icon.image50x50 is an unexpected element/attribute error 103: application.icon.image58x58 is an unexpected element/attribute error 103: application.icon.image100x100 is an unexpected element/attribute error 103: application.icon.image1024x1024 is an unexpected element/attribute error 103: application.icon.image144x144 is an unexpected element/attribute My question is what to do here? Moving those 5 icons underneath <android>....</android> or <iphone>....</iphone> doesn't help either. Using Flash Builder 4.7 beta under Windows 7 / 64 bit.

    Read the article

  • Embedded MongoDB when running integration tests

    - by seanhodges
    My question is a variation of this one. Since my Java Web-app project requires a lot of read filters/queries and interfaces with tools like GridFS, I'm struggling to think of a sensible way to simulate MongoDB in the way the above solution suggests. Therefore, I'm considering running an embedded instance of MongoDB alongside my integration tests. I'd like it to start up automatically (either for each test or the whole suite), flush the database for every test, and shut down at the end. These tests might be run on development machines as well as the CI server, so my solution will also need to be portable. Can anyone with more knowledge on MongoDB help me get idea of the feasibility of this approach, and/or perhaps suggest any reading material that might help me get started? I'm also open to other suggestions people might have on how I could approach this problem...

    Read the article

  • Weblogs.asp.net has a problem, it is spam

    - by Chris Hammond
    Is anyone at Microsoft listening to the SPAM problem here on Weblogs.asp.net? My “ Can anyone do anything about the spam here on weblogs.asp.net? ” post from October got over 12 spam comments posted to it in the past 24 hours. I have comments all moderated, but that just means I have a crapload of work to do each time people comment. Also, when you click on a link from a comment notification email you are taken to an insecure site warning due to an invalid SSL Cert. We really just need some updates...(read more)

    Read the article

  • Uncheck Radio Button on Double Click

    - by Rajneesh Verma
    Hi, Recently I got one requirement that i have to uncheck radio button list when a user double click it (Try to uncheck). I did this using JAVA Script. Below is the code. Designer: 1: < head runat ="server" > 2: < title > :Radio Button List Demo: </ title > 3: < script language ="javascript" type ="text/javascript" > 1:   2: //Global variable to store selectedvalue 3: var lastchecked = "" ; 4:   5: function rblSelectedValue...(read more)

    Read the article

  • Parallel task in C# 4.0

    - by Jalpesh P. Vadgama
    In today’s computing world the world is all about Parallel processing. You have multicore CPU where you have different core doing different work parallel or its doing same task parallel. For example I am having 4-core CPU as follows. So the code that I write should take care of this.C# does provide that kind of facility to write code for multi core CPU with task parallel library. We will explore that in this post. Read More

    Read the article

  • Upgrading Active Directory from 2000 to 2008

    - by Doug
    Our config is currently: 1 Windows 2000 domain controller running ISA2000, dhcp, dns 1 Windows 2003 domain controller as main file server, prob cert server as well, dhcp, dns 1 Windows 2008/Exchange2010 domain controller as Exchange server, DHCP,DNS Currently getting FRS errors on files server journalwrap error Currently getting FRS errors on othe DC's can't replicate from above Exchange DC holds Schema, rid,pdc, and infastructure roles File Server holds Domain namaing operation master role WOW, I didn't set this up, just inherited it. Am I right to assume that fixing the FRS errors is #1, what do I need to do for that? set enable journalwrap auto restore in registry? Demote W2000 domain controller, should that have any implications for ISA? We have Forefront to be deployed but that's another day Transfer Domain Nameing Role to Exchange server (I know or think having an Exchange server as DC isn't best practive) We will be getting another server W2008 to replace current file server and I thought it could takeover all roles once deployed Demote W2k3 file server and then raise functional domain level to 2008 Am I missing anything other that the sense to walk away? Thanks

    Read the article

  • Scanning for new disks attached using virtio?

    - by larsks
    I can successfully attach disks to a running KVM instance using virsh attach-disk... virsh attach-disk node-1 /dev/vg_lunsr/lun1 vdb Disk attached successfully ...but these new devices aren't seen by the guest without a reboot, which almost defeats the purpose of dynamic attachment. If these were SCSI devices I would use e.g. /sys/class/scsi_host/host0/scan to request the SCSI drivers to scan for new devices. Is there an equivalent capability for the virtio block driver?

    Read the article

  • understanding mount -o bind

    - by Ionut
    Few questions after the following commands: mount -o bind /new_disk/home/user/ /home/user/ mount -o bind --no-mtab /new_disk/home/user/ /home/user/ What is the difference between the two commands other than " Mount without writing in /etc/mtab. This is necessary for example when /etc is on a read-only filesystem." What is the difference between mount -o bind and mount --bind ...if there are Let's suppose i don't know there is a partition mounted using -o bind --no-mtab...where can I find if there is any mound point with bind ? The only way i can detect this is grep user /proc/mounts but in that line there is no info abut bind. Thank you.

    Read the article

  • Should I install Windows Management Framework 3.0?

    - by Massimo
    I'm posting this as a BIG CAVEAT to everyone. I know it's not a standard Q&A, but I think this is someone every Windows admin should know. There is a very real risk of falling into Big Troubles. Microsoft has recently released Windows Management Framework 3.0 for Windows Server 2008 and Windows Server 2008 R2 systems, which includes some nice things native to Windows Server 2012 (like PowerShell 3.0) and lots of improvements to WMI, WinRM and other management technologies. Windows Update is advertising it as an optional update. Should I install it on my servers?

    Read the article

  • Nginx Ip Whitelist

    - by Will
    Is it possible to create a ip whitelist for my nginx proxy server without adding allow or deny in the config file is it possible i can get nginx to link to a separate database to check if the user is allowed to access the website . Ideally i could do with nginx linking to an external database or at minimum a list off allowed ips on the same server so i can easily update the list whit out restarting nginx every time. In the future i would like to link nginx to my website and a user will login and there ip will be linked to there account and they will be able to update there ip if it has changed to there new one to grant them access so i need to keep in mind that it would be easyer to do this if i have external list off ips in some kind off database any help is apreshiated

    Read the article

  • On-demand RHEL/Centos Linux admin and MySQL admin

    - by user1322092
    Could you share with me a few reputable businesses/websites where I can quickly onboard a RHEL/Centos Linux admin or even a MySQL admins (say if I need help with disaster recovery). I have a cloud server, and I would like to task an admin to perform specific maintenance or even periodic. With the abundance of solely-run cloud servers, I would imagine there's a demand for this type of service (certainly for me).

    Read the article

  • Nginx as a reverse proxy + Apache or completely cut out Apache? (WordPress Multisite)

    - by user715564
    I am starting a WordPress multisite network with domain mapping and I am trying to think through my server set up. Right now, I only have one medium sized VPS but hopefully I will need to add more servers later so ideally the solution will also accommodate future growth. My question is, would it be better to set up Nginx as a reverse proxy with Apache or use only Nginx? It seems like setting up Nginx as a reverse proxy would be easier and offer less of a possibility of problems but, on the other hand, would using only Nginx add substantial benefits?

    Read the article

  • How to choose which fields are available via LDAP from an Active Directory

    - by Felix Eve
    I'm using PHP to do an ldap search and then pull the attributes out using ldap_get_attributes. This returns an array of data (that can be seen here) however there are some fields that are missing such as Organization Title, department, company, address and telephone number. How to I make these fields available? There is a similar question here: http://www.petri.co.il/forums/showthread.php?t=15227 I've followed the steps outlined there an tried changing some access permissions but am not really sure what I'm doing and can't see any permissions that directly relate to the fields that I can see when I edit a user in the "Active Directory Users Computers" window. I am a PHP developer, not a Windows server administrator so am finding configuring an AD rather challenging so please don't assume any level of knowledge about AD. I've asked the same question on stack exchange but understand this is a more relevant place to ask.

    Read the article

  • RPM with RHEL: install 2 version of same package / different arch

    - by Nicolas Tourneur
    I think the title is pretty self explanatory :) Is it possible, under RHEL (v 5) to install 2 instances of the same packages with 32 bit support for one and 64 bits support for the other one? Obviously, the running host has a 64 bit kernel and has the compatibility libraries required. (in this case, we would need a 64 bits JDK and a 32 bits one). If yes, are there any special rpm flag to use (change of installation directory for instance)? Thanks in advance,

    Read the article

  • Windows XP SP3 client over NAT to a Windows 2008 R2 SP1 file server disconnection

    - by Patrick Pellegrino
    we just transferred a pilot group from our old(!!) Netware infrastructure to an Microsoft infrastructure. Since then, our users got problems accessing their files. They all experience disconnection from the mapped drives. The file server is access via a WAN connection by a firewall (Sonicwall) between both network and we do NAT. All clients have Windows XP SP3 and the file server is an Windows 2008 R2 SP1. On the file server I got many Event Id 2012. Many post over the Internet suggested a problem between the SMB protocol and NAT. We need a short term fix to continue to transfer users from Netware to Microsoft after what will work to remove the NATing. I found this MS KB http://support.microsoft.com/kb/2444558 that suggested a kind of workaround for Windows 7 clients but I can found anything for Windows XP. Anyone can help me with this ? We don't want to stop the project and do a network job before migrating. Regards. Update: Our few Windows 7 computers doesn't seem to have this issue.

    Read the article

  • Boot another OS e.g. Windows *once* on a dual-boot machine

    - by user974312
    I have a dual-boot machine with Windows and Linux on it. It doesn't reside at my hand, instead , it's placed in the datacenter which I have to access remotely. For most of time, I work on Linux. But there is some occasion that I have to use the Windows OS on it. Here is the problem. I hope to do all those following things remotely. Do some magic to Grub. Reboot the machine from Linux. Grub boots Windows. Access Windows remotely. Work done. Reboot the machine from Windows. Grub boots Linux. So I wonder whether I can set the booting target at the next time, for only once? Thanks.

    Read the article

  • VMWare hypervisor with only 1 network card?

    - by Rafiq Maniar
    VMWare hypervisor minimum requirements states that the minimum network requirements is: one NIC, plus one for Management interface (source: http://www.vmware.com/products/datacenter-virtualization/vsphere-hypervisor/requirements.html) It used to be possible to use 1 NIC only. Is anybody using the new versions of VMWare in this configuration? I ask because my colo provider will only provide me with 1 uplink (my server does have 2 NICs). I need to be able to run the VMs and also have remote management using only 1 NIC. Possible?

    Read the article

  • error: The specified device is claimed by another driver (uvcvideo) on the host operating system

    - by kamal
    I am trying to run an ubuntu 11, in VMplayer 5 on an ubuntu 12.04 host, and when trying to run the guest, i get this error, and no display. The specified device is claimed by another driver (uvcvideo) on the host operating system. The device might be in use. To Continue, the device will first be disconnected from its current driver. I also found a sort of related comment ( RESOLVED ) on similar issue on: ubuntu forums

    Read the article

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