Search Results

Search found 317 results on 13 pages for 'jamie dixon'.

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

  • Deleting a user > need to also delete their project, and then activities for that project? (PHP, MyS

    - by Jamie
    Hi guys, Really stuck with this... basically my system has 4 tables; users, projects, user_projects and activities. The user table has a usertype field which defines whether or not they are admin or user (by an integer)... An admin can create a project, create an acitivity for the project and assign a user (limited access user) an activity. Therefore, this setup means that an admin is never directly associated with an activity (instead a project). When my head admin user deletes an admin, I need all projects and activities (for their projects) to be deleted also. My delete script for a user is simple so far and works, but I'm having trouble on how to gain the projectID in order to know which activities to remove (associated with the projects which are about to be deleted): $userid = $_GET['userid']; $query = "DELETE FROM users WHERE userid=".$userid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); $query = "DELETE FROM projects WHERE userid=".$userid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); $query = "DELETE FROM userprojects WHERE userid=".$userid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); $query = "DELETE FROM activities WHERE projectid=".$projectid; $result = mysql_query($sql, $connection) or die("Error: ".mysql_error()); Now the first three queries execute fine, obviously because the userid is being retrieved successfully. However the 4th and final query I know is wrong, because there is no projectid to be gained from anywhere, however I put it there to help understand what I am trying to get!! :D Im guessing that i would need something like 'WHERE projectid=' then something to gather the removed projects from the userid which can be related to the activities for that project(s)!! Its a simple concept but I'm having trouble...please excuse any bad code as I am learning also. Thanks for any help!

    Read the article

  • Problems with sticky footer - CSS - main content wont go 100% height (float)

    - by Jamie
    I'm trying to implement hxxp://www.cssstickyfooter.com however I am having a few problems! See screenshot: hxxp://img22.imageshack.us/img22/2654/71161106.jpg The div "Content" contains both left and right columns. On smaller resolutions this is working as expected however once the user starts to increase there resolution the content doesn't expand as I intend it to. If you notice the blue box. That should stretch to the footer at the bottom of the page. If you notice that the blue divider line (right_container3-4) stops also at the same point. CODE HTML: hxxp://tinyurl.com/m39x52 CSS: hxxp://tinyurl.com/lb62ej I would apriciate any help at all! I've been racking my brains for ages on this one, its just a small site so I suppose it's not too much of an issue. But it's nice to know all the same! Thankyou P.S. Sorry about the URL formatting

    Read the article

  • Unable to install Management Studio Express 2008 due to Visual Studio 2008 installation

    - by Jamie
    I am attempting to install Managment Studio Express 2008 on a Win7 system that already has Visual Studio 2008 installed. I have installed VS 2008 SP1, which results in the About box for Visual Studio giving a version of 9.0.30792.1 SP. When I attempt the Management Studio installation I see a message that tells me that I must install SP1. However, this is already installed. After a fair bit of searching I came across the link below, where someone had commented with a command line option for the installation executable that forced it to skip the check. However, this simply pushed the error to later in the installation process. http://www.thushanfernando.com/index.php/2008/08/10/fix-rule-previous-releases-of-microsoft-visual-studio-2008-failed/. This seems to be a perennial problem for Microsoft. I can't remember a time when I've painlessly installed both Management Studio and Visual Studio. I can't imagine that this is an unusual combination, after all! Anyone had any success in solving this problem before I take on the day-long task of uninstalling and reinstalling Visual Studio and all its associated bits?

    Read the article

  • extjs - 'Store is undefined'

    - by Jamie
    Hi all, I'm pretty sure this a trivial problem and i'm just being a bit stupid. Your help would be hugely appreciated. In controls/dashboard.js I have: Ext.ill.WCSS.controls.dashboard = { xtype:'portal', region:'center', margins:'35 5 5 0', items:[{ columnWidth: 1, style:'padding:10px', items:[{ title: 'My Cluster Jobs', layout:'fit', html: "test" }] },{ columnWidth: 1, style:'padding:10px', items:[{ title: 'All Cluster Jobs', iconCls: 'icon-queue', html: "test", items: new Ext.grid.GridPanel({ title: 'Cluster Job Queue', store: Ext.ill.WCSS.stores.dashboardClusterJobs, width: 791, height: 333, frame: true, loadMask: true, stateful: false, autoHeight: true, stripeRows: true, floating: false, footer: false, collapsible: false, animCollapse: false, titleCollapse: false, columns:[ { xtype: 'gridcolumn', header: 'Job ID', sortable: true, resizable: true, width: 100, dataIndex: 'JB_job_number', fixed: false }, { xtype: 'gridcolumn', header: 'Priority', sortable: true, resizable: true, width: 100, dataIndex: 'JAT_prio', fixed: false }, { xtype: 'gridcolumn', header: 'User', sortable: true, resizable: true, width: 100, dataIndex: 'JB_owner' }, { xtype: 'gridcolumn', header: 'State', sortable: true, resizable: true, width: 100, dataIndex: 'state' }, { xtype: 'gridcolumn', header: 'Date Submitted', sortable: true, resizable: true, width: 100, dataIndex: 'JAT_start_time' }, { xtype: 'gridcolumn', header: 'Queue', sortable: true, resizable: true, width: 100, dataIndex: 'queue_name' }, { xtype: 'gridcolumn', header: 'CPUs', sortable: true, resizable: true, width: 100, dataIndex: 'slots' } ], bbar: { xtype: 'paging', store: 'storeClusterQueue', displayInfo: true, refreshText: 'Retrieving queue status...', emptyMsg: 'No jobs to retrieve', id: 'clusterQueuePaging' } }) }] }] }; Simple enough, note the reference to 'Ext.ill.WCSS.stores.dashboardClusterJobs' So in stores/dashboard.js I just have this: Ext.ill.WCSS.stores.dashboardClusterJobs = new Ext.data.XmlStore({ storeId: 'storeClusterJobs', record: 'job_list', autoLoad: true, url: 'joblist.xml', idPath: 'job_info', remoteSort: false, fields: [ { name: 'JB_job_number' }, { name: 'JAT_prio' }, { name: 'JB_name' }, { name: 'JB_owner' }, { name: 'state' }, { name: 'JAT_start_time' }, { name: 'slots' }, { name: 'queue_name' } ] }); I run the code and I get 'store is undefined' :S It's confusing me a lot. All of the javascripts have been included in the correct order. i.e. <script type="text/javascript" src="/js/portal.js"></script> <script type="text/javascript" src="/js/stores/dashboard.js"></script> <script type="text/javascript" src="/js/controls/dashboard.js"></script> Thanks guys!

    Read the article

  • Python equivalent of IDL's stop and .reset

    - by Jamie
    Hi there, I'm relatively new to python but have a bit of experience using IDL. I was wondering if anyone knows if there are equivalent commands in python for IDL's stop and .reset commands. If I'm running some IDL script I wrote that I put a stop command in, essentially what it does is stop the script there and give me access to the command line in the middle of the script. So I have access to all the functions and variables that I defined before the stop command, which I find really useful for debugging. The .reset command I find extremely useful too. What it does is reset the the IDL environment (clears all variables, functions, etc.). It's as if I closed that session and opened a new one, but without having to exit and restart IDL. I find that if I'm trying to debug a script I wrote it's useful sometimes to start from scratch and not have to reset IDL (or python now). It would be useful also in python to be able to un-import any modules I had previously imported. Any help with these issues would be greatly appreciated. Cheers Related Python Drop into REPL Is it possible to go into ipython from code?

    Read the article

  • Android EditText won't take up remaining space

    - by Jamie
    In my Android app, I have a tabbed Activity. In one of the tabs I have two TextViews and two EditTexts. The first EditText is only one line, and that's fine. However, I want the other EditText, android:id="@+id/paste_code", to take up the remaining space, but no matter what I do to it, it will only show one line. I don't want to manually set the number of lines, since the number that would fit on the screen differs based on your device. Here's the relevant code. It's nested inside all the necessary components for a tabbed Activity. <ScrollView android:id="@+id/basicTab" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Paste title" android:layout_weight="0" /> <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/paste_title_hint" android:id="@+id/paste_title" android:lines="1" android:gravity="top|left" android:layout_weight="0" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Paste text" android:layout_weight="0" /> <EditText android:layout_width="fill_parent" android:layout_height="fill_parent" android:hint="@string/paste_hint" android:id="@+id/paste_code" android:gravity="top|left" android:layout_weight="1" /> </LinearLayout> </ScrollView>

    Read the article

  • How do I show a user's credit based on their session

    - by Jamie
    Hi all - I'm developing a simple LAMP app where users can credit their account using Paypal. I suspect this is a simple issue, but have spent quite a while experimenting to no avail and would appreciate any thoughts: System has a user management system working fine using sessions, but I can't get it to display the current user's credit. But I've been trying things along the lines of: $result = mysql_query(" SELECT * FROM users INNER JOIN account ON account.UserID=account.UserID ORDER BY account.accountID"); while($_SESSION['Username'] = $row['Username'] ) { echo $row['Username']; echo $row['Credit']; } I suspect the while statement is invalid, but I want it to echo username and credit where the current session username = the username stored in the database. Thanks so much for taking a look - very much appreciated.

    Read the article

  • How to share classes between DLLs

    - by Jamie Hale
    I have an unmanaged Win32 C++ application that uses multiple C++ DLLs. The DLLs each need to use class Foo - definition and implementation. Where do Foo.h and Foo.cpp live so that the DLLs link and don't end up duplicating code in memory? Is this a reasonable thing to do?

    Read the article

  • Archive log transfer from Oracle 9i to Oracle 10g

    - by Jamie Love
    Hi all, I have a situation where I need to transfer Oracle 9i archive logs to an Oracle 10g database, from where they are to be mined by a log-miner and then used by an Oracle streams capture/apply processes. (Oracle 9 archive logs can be read by the Oracle 10 logminer - I can manually copy the archive logs across, manually register them and have them mined, captured then applied). The difficulty is that the way Oracle does archive log transfer changed quite a bit between 9i and 10g and setting up the 9i database to transfer to the remote machine like so: log_archive_dest_state_2 = enable log_archive_dest_2 = "service=OTHERMACHINE arch optional" no longer works. I get this in the 9i logs: *** 2009-05-22 04:03:44.149 RFS network connection lost at host 'OTHERMACHINE' Error 3113 attaching RFS server to standby instance at host 'OTHERMACHINE' Error 3113 attaching to destination LOG_ARCHIVE_DEST_2 standby host 'OTHERMACHINE' Heartbeat failed to connect to standby 'OTHERMACHINE'. Error is 3113. *** 2009-05-22 04:03:44.150 kcrrfail: dest:2 err:3113 force:0 ORA-03113: end-of-file on communication channel And in the 10g log I get: Fri May 22 04:07:42 2009 WARNING: inbound connection timed out (ORA-3136) My question is: Does anyone know how I could configure my 9i or 10g server such that the 10g server will accept the 9i connection in such a way that I can transfer the 9i archive logs to the 10g server. It would be a bonus if the archive logs would be automatically registered in the 10g server. Note I have not set up a full DataGuard configuration here and the 10g database is not a secondary server. Thanks for any suggestions. Edit Note that I can log on to the 10g server from the 9i server via sqlplus, so connectivity is not the problem Edit 2 After a large amount of time searching for a solution, I've finally decided that such a mechanism doesn't work, and that a non-Oracle method of transferring archive logs from 9i to 10g will need to be used (e.g. rsync).

    Read the article

  • Why is Apache seg faulting?

    - by Jamie Howard
    We have a production server that seems to Seg Fault a few times every day. The fault is picked up by Apache and logged in the error log - but there seems to be no traffic around the time. If it's a request generating the fault then it looks like it happens before any other logging is made so I can't see how it's happening so it's very hard to debug. Our setup is Linux 64 bit Centos 5.3 Apache is loaded with the following modules apachectl -t -D DUMP_MODULES | more Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) auth_basic_module (shared) auth_digest_module (shared) authn_file_module (shared) authn_alias_module (shared) authn_anon_module (shared) authn_dbm_module (shared) authn_default_module (shared) authz_host_module (shared) authz_user_module (shared) authz_owner_module (shared) authz_groupfile_module (shared) authz_dbm_module (shared) authz_default_module (shared) ldap_module (shared) authnz_ldap_module (shared) include_module (shared) log_config_module (shared) logio_module (shared) env_module (shared) ext_filter_module (shared) mime_magic_module (shared) expires_module (shared) deflate_module (shared) headers_module (shared) usertrack_module (shared) setenvif_module (shared) mime_module (shared) dav_module (shared) status_module (shared) autoindex_module (shared) info_module (shared) dav_fs_module (shared) vhost_alias_module (shared) negotiation_module (shared) dir_module (shared) actions_module (shared) speling_module (shared) userdir_module (shared) alias_module (shared) rewrite_module (shared) proxy_module (shared) proxy_balancer_module (shared) proxy_ftp_module (shared) proxy_http_module (shared) proxy_connect_module (shared) cache_module (shared) suexec_module (shared) disk_cache_module (shared) file_cache_module (shared) mem_cache_module (shared) cgi_module (shared) version_module (shared) security2_module (shared) unique_id_module (shared) fcgid_module (shared) php5_module (shared) proxy_ajp_module (shared) ssl_module (shared) Here's an exert from the Apache error log: [Mon Mar 15 06:39:25 2010] [error] [client 213.246.222.74] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Mon Mar 15 07:41:31 2010] [error] [client 213.246.222.74] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Mon Mar 15 08:24:16 2010] [error] [client 67.19.250.146] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Mon Mar 15 08:43:46 2010] [error] [client 213.246.222.74] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Mon Mar 15 08:54:02 2010] [error] [client 74.208.123.71] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Mon Mar 15 09:09:51 2010] [notice] child pid 2138 exit signal Segmentation fault (11), possible coredump in /tmp [Mon Mar 15 09:45:27 2010] [error] [client 213.246.222.74] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Mon Mar 15 09:49:05 2010] [error] [client 190.12.113.196] File does not exist: /var/www/vhosts/default/htdocs/phpMyAdmin [Mon Mar 15 09:49:06 2010] [error] [client 190.12.113.196] File does not exist: /var/www/vhosts/default/htdocs/PMA And the Access log around the same time (09:09:51): 213.246.222.74 - - [15/Mar/2010:08:43:46 +0000] "GET /" 400 561 "-" "-" 208.80.193.28 - - [15/Mar/2010:08:52:20 +0000] "GET / HTTP/1.0" 301 313 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; SU 2.009)" 74.208.123.71 - - [15/Mar/2010:08:54:02 +0000] "GET /w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1" 400 298 "-" "-" 81.149.146.231 - - [15/Mar/2010:09:15:18 +0000] "GET /zabbix/ HTTP/1.1" 200 3565 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10" 81.158.71.196 - - [15/Mar/2010:09:16:06 +0000] "GET / HTTP/1.1" 301 313 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.0.18) Gecko/2010020219 Firefox/3.0.18" 213.246.222.74 - - [15/Mar/2010:09:45:27 +0000] "GET /" 400 561 "-" "-" 213.246.222.74 - - [15/Mar/2010:09:45:27 +0000] "GET /w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1" 400 298 "-" "-" 190.12.113.196 - - [15/Mar/2010:09:49:05 +0000] "GET /phpMyAdmin/main.php HTTP/1.0" 404 295 "-" "-" So As you can see, there's no access logged around the time of the fault!! How annoying :s I enabled core dumps and here is the backtrace: #0 0x00007f9c8c8a858b in memcpy () from /lib64/libc.so.6 No symbol table info available. #1 0x00007f9c8cfb066d in apr_pstrcat (a=<value optimized out>) at strings/apr_strings.c:165 cp = 0x1fa6b "\205¦H\211¦t`¦\003" argp = 0x7f9c9ad790e8 "Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Referer, Re"... res = 0x0 saved_lengths = {129643, 2, 43, 140310399395576, 0, 140310394592712} nargs = <value optimized out> len = <value optimized out> adummy = {{gp_offset = 16, fp_offset = 32668, overflow_arg_area = 0x7fff968a0ec0, reg_save_area = 0x7fff968a0de0}} #2 0x00007f9c8cfb1bf9 in apr_table_merge (t=0x7f9c8f83b148, key=0x7f9c85a465fe "Vary", val=0x7f9c9ad99070 "Referer, Referer, Referer, Referer, Referer") at tables/apr_tables.c:688 next_elt = (apr_table_entry_t *) 0x7f9c8f83b270 end_elt = (apr_table_entry_t *) 0x7f9c8f83b270 checksum = <value optimized out> hash = 22 #3 0x00007f9c85a42cfa in ?? () from /etc/httpd/modules/mod_rewrite.so No symbol table info available. #4 0x00007f9c85a44022 in ?? () from /etc/httpd/modules/mod_rewrite.so No symbol table info available. #5 0x00007f9c8e87bd1a in ap_run_fixups () from /usr/sbin/httpd No symbol table info available. #6 0x00007f9c8e88e8f8 in ap_process_request () from /usr/sbin/httpd No symbol table info available. #7 0x00007f9c8e88bb40 in ?? () from /usr/sbin/httpd No symbol table info available. #8 0x00007f9c8e887ca2 in ap_run_process_connection () from /usr/sbin/httpd No symbol table info available. #9 0x00007f9c8e892849 in ?? () from /usr/sbin/httpd No symbol table info available. #10 0x00007f9c8e892ada in ?? () from /usr/sbin/httpd No symbol table info available. #11 0x00007f9c8e892b90 in ?? () from /usr/sbin/httpd No symbol table info available. #12 0x00007f9c8e89387b in ap_mpm_run () from /usr/sbin/httpd No symbol table info available. #13 0x00007f9c8e86de48 in main () from /usr/sbin/httpd No symbol table info available. Can anyone shed any light on how to move forward with this? I can confirm that the server is operational and doesn't appear to be misbehaving - the failures are so infrequent that I haven't seen it do one while making a request myself. Really appreciate any help! Cheers!

    Read the article

  • Preventing $.POST hijack

    - by Jamie
    I'm currently building a facebook application. Lets say I have a variable $uid that identifies the user so I can store this in my database along with their submitted data. I pass $uid and $data via json encoded values using $.post. However, this doesn't prevent someone changing $uid to save data as someone else. I have been thinking about how to overcome this, so far I haven't found a solution apart from: create database with $uid $secretkey on first page load. When $.post send $secretkey with the post and then retrieve the $uid from the database. Would this be the correct approach to use?

    Read the article

  • Jabber integration into site and multiple domains

    - by Jamie
    Hi all, I'm creating a centralised web product, i.e. a customer gets assigned a personal domain, for example company1.example.com or company2.example.com and can then use our service. I'm planning to integrate a jabber service into the website. I have already found a decent jabber client library which I can use for the site. I know that jabberd2 uses mysql, which is perfect because I want to use the web interface to add users, delete users, view message logs etc. However, my problem is when I have two companies or more. I would like a jabber server which can host multiple domains, i.e. jabber.company1.example.com, jabber.company2.example.com Do you have any experience of this? And do you know of a good jabber server which will do this? Any help would be hugely appreciated!

    Read the article

  • Showing a tooltip on a combobox from the itemtemplate (WPF)

    - by Jamie
    I have a ComboBox with a DataTemplate. The DataTemplate has two controls, each of which has a ToolTip attached to it. The list of items of the ComboBox has the tooltips as expected when you hover over each control. But the selected item area on top of the ComboBox does not display the tooltips, though the controls are rendered as expected. Is there a way to force the tooltips to be displayed?

    Read the article

  • C# Error reading two dates from a binary file

    - by Jamie
    Hi all, When reading two dates from a binary file I'm seeing the error below: "The output char buffer is too small to contain the decoded characters, encoding 'Unicode (UTF-8)' fallback 'System.Text.DecoderReplacementFallback'. Parameter name: chars" My code is below: static DateTime[] ReadDates() { System.IO.FileStream appData = new System.IO.FileStream( appDataFile, System.IO.FileMode.Open, System.IO.FileAccess.Read); List<DateTime> result = new List<DateTime>(); using (System.IO.BinaryReader br = new System.IO.BinaryReader(appData)) { while (br.PeekChar() > 0) { result.Add(new DateTime(br.ReadInt64())); } br.Close(); } return result.ToArray(); } static void WriteDates(IEnumerable<DateTime> dates) { System.IO.FileStream appData = new System.IO.FileStream( appDataFile, System.IO.FileMode.Create, System.IO.FileAccess.Write); List<DateTime> result = new List<DateTime>(); using (System.IO.BinaryWriter bw = new System.IO.BinaryWriter(appData)) { foreach (DateTime date in dates) bw.Write(date.Ticks); bw.Close(); } } What could be the cause? Thanks

    Read the article

  • ASP.NET MVC Authentication Cookie Not Being Retrieved

    - by Jamie Wright
    I am having a hard time implementing "Remember Me" functionality in an MVC application with a custom principal. I have boiled it down to ASP.NET not retrieving the authentication cookie for me. I have included a snaphot below from Google Chrome. Shows the results of Request.Cookies that is set within the controller action and placed in ViewData for the view to read. Notice that it is missing the .ASPXAUTH cookie Shows the results from the Chrome developer tools. You can see that .ASPXAUTH is included here. Does anyone know what the issue may be here? Why does ASP.NET not read this value from the cookie collection?

    Read the article

  • Three Checkboxes, One must be selected to enable submit button, needs Jquery?

    - by Jamie
    I have between 1-three checkboxes and by default they are all disabled. In order for the submit button to be active ove checkbox minumum must be selected. Can someone help me with a jquery snippet to achieve this? My markup looks like this and the site used jquery 1.42. Please and thankyou! <form action="/cart/add" method="post" id="pform"> <h3 class="goudy">Make your selection:</h3> <ul id="variants"> <li> <input type="checkbox" name="id[]" value="39601622" id="radio_39601622" style="vertical-align: middle;" class="required" /> <label for="radio_39601622[]">$38.00 - Original Antique Photo</label> </li> <li> <input type="checkbox" name="id[]" value="39601632" id="radio_39601632" style="vertical-align: middle;" class="required" /> <label for="radio_39601632[]">$8.99 - SCAN</label> </li> <li> <input type="checkbox" name="id" value="39777962" id="radio_39777962" style="vertical-align: middle;" class="required" /> <label for="radio_39777962">$2.99 - Rigid Sleeve</label> </li> </ul> <div class="buttons clearfix"> <input type="image" src="../images/add-to-cart.png" name="add" value="Add to Cart" id="add" class="send-to-cart" /> </div> </form>

    Read the article

  • C# Number of days between two dates problem

    - by Jamie
    Hi all, I have a small problem with the code below, the 'days' variable always seems to be 0 no matter how far apart the days are. Can you see anything obviously wrong? System.TimeSpan span = dates[0] - dates[1]; // e.g. 12/04/2010 11:44:08 and 18/05/2010 11:52:19 int days = (int)span.TotalDays; if (days > 10) //days always seems to be 0 { throw new Exception("Over 10 days"); } Thanks

    Read the article

  • SQL Server cast fails with arithmetic overflow

    - by Jamie Ide
    According to the entry for decimal and numeric data types in SQL Server 2008 Books Online, precision is: p (precision) The maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18. However, the second select below fails with "Arithmetic overflow error converting int to data type numeric." SELECT CAST(123456789 as decimal(9,0)) SELECT CAST(123456789 as decimal(9,1))

    Read the article

  • Two way binding settings problem.

    - by Jamie
    Hi, I am having a problem using two way binding with a listpicker. I am able to set the value using c# but not in the SelectedItem=".." in xaml. The binding is returning the correct value (and is a value in the listpicker) as i have texted it by assigning the text to a textblock. When the page loads, the binding used on the listpicker causes a System.ArgumentOutOfRangeException The code i am using to set it is: // Update a setting value. If the setting does not exist, add the setting. public bool AddOrUpdateValue(string key, Object value) { bool valueChanged = false; try { // If new value is different, set the new value if (settingsStorage[key] != value) { settingsStorage[key] = value; valueChanged = true; } } catch (KeyNotFoundException) { settingsStorage.Add(key, value); valueChanged = true; } catch (ArgumentException) { settingsStorage.Add(key, value); valueChanged = true; } catch (Exception e) { Console.WriteLine("Exception occured whilst using IsolatedStorageSettings: " + e.ToString()); } return valueChanged; } // Get the current value of the setting, if not found, set the setting to default value. public valueType GetValueOrDefault<valueType>(string key, valueType defaultValue) { valueType value; try { value = (valueType)settingsStorage[key]; } catch (KeyNotFoundException) { value = defaultValue; } catch (ArgumentException) { value = defaultValue; } return value; } public string WeekBeginsSetting { get { return GetValueOrDefault<string>(WeekBeginsSettingKeyName, WeekBeginsSettingDefault); } set { AddOrUpdateValue(WeekBeginsSettingKeyName, value); Save(); } } And in the xaml: <toolkit:ListPicker x:Name="WeekStartDay" Header="Week begins on" SelectedItem="{Binding Source={StaticResource AppSettings}, Path=WeekBeginsSetting, Mode=TwoWay}"> <sys:String>monday</sys:String> <sys:String>sunday</sys:String> </toolkit:ListPicker> The StaticResource AppSettings is a resource from a seperate .cs file. <phone:PhoneApplicationPage.Resources> <local:ApplicationSettings x:Key="AppSettings"></local:ApplicationSettings> </phone:PhoneApplicationPage.Resources> Thanks in advance

    Read the article

  • Making two Windows using CreateWindowsEx() - C

    - by Jamie Keeling
    Hello, I have a windows form that has a simple menu and performs a simple operation, I want to be able to create another windows form with all the functionality of a menu bar, message pump etc.. as a separate thread so I can then share the results of the operation to the second window. I.E. 1) Form A opens Form B opens as a separate thread 2)Form A performs operation 3)Form A passes results via memory to Form B 4)Form B display results I'm confused as to how to go about it, the main app runs fine but i'm not sure how to add a second window if the first one already exists. I think that using CreateWindow will allow me to make another window but again i'm not sure how to access the message pump so I can respond to certain events like WM_CREATE on the second window. I hope it makes sense. Thanks! Edit: I've attempted to make a second window and although this does compile, no windows show atall on build. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { //Fields WCHAR buffer[256]; struct DiceData storage; HWND hwnd; // Act on current message switch(message) { case WM_CREATE: AddMenus(hMainWindow); hwnd = CreateWindowEx( 0, "ChildWClass", (LPCTSTR) NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, hMainWindow, NULL, NULL, NULL); ShowWindow(hwnd, SW_SHOW); break; Any suggestions as to why this happens?

    Read the article

  • PHP REST Clients

    - by Jamie Rumbelow
    I'm trying to connect to a RESTful web service, but I'm having some troubles, especially when sending data over PUT and DELETE. With cURL, PUT requires a file to send, and DELETE is just weird. I'm perfectly capable of writing a client using PHP's socket support and writing the HTTP headers myself, but I wanted to know whether you guys have ever used or seen a REST client for PHP?

    Read the article

  • Interacting with system commands using a web dev language

    - by Jamie
    Hi all, First of all, sorry for the vague title. Let me explain. At work we're currently using SunGrid I've been assigned a project to create a web interface wrapper for interacting with the engine. i.e. displaying users jobs, submitting jobs via a nice GUI etc. (most of the sgrid commands output xml which is nice) My question for you chaps is the following: What web dev language would you use to interact with the system? i.e. use the language to do a system call and evaluate the response. I'm not after an argument on which language is best, I just would like to know which language is specifically good for interacting with the system and is also good for web dev.

    Read the article

  • WriteableBitmap in .NET 4

    - by Jamie
    Hi there, I have got a problem: I would like to use a method Render() for WriteableBitmap object. However, as I noticed, the method is not available without using a Silverlight assembly System.Windows.dll. I need to use RenderTargetBitmap in my project (PresentationCore assembly for standard .net). Here is the problem - there are definitions of some classes in both assemblies, thus they are in conflict. Basically, I need to add some stuff to Bgra32 bitmap. However, RenderTargetBitmap works only with Pbgra32 ones. I found that using WriteableBitmap to render would be nice. Maybe I am wrong? Do you have any ideas? Thank you in advance for the reply! Cheers

    Read the article

  • Listing down stored records localStorage | Google Chrome Extensions

    - by Jamie
    How do I get to list down the stored records in the for loop? Basically I want it to list down the records like this: '<div id="record_' + number + '">' + localstorage value + '</div>' The number in the class should add 1 every record, e.g. 1, 2, 3, 4 every record it lists down, and so on. The localstorage value should show the localStorage[] but the problem is, the localStorage name has the same, e.g. (clicks on button) it will save the value of the URL into a localStorage I then open the application and shows the window.html inside there is list of stored records by using this: '<div id="record_' + number + '">' + localstorage value + '</div>' INCLUDING the record number to add per record 1, 2, 3, etc... like this: <div id="record_1">localstorage value</div> <div id="record_2">localstorage value</div> <div id="record_3">localstorage value</div> <div id="record_4">localstorage value</div> <div id="record_5">localstorage value</div> <div id="record_6">localstorage value</div> etc...

    Read the article

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