Search Results

Search found 1689 results on 68 pages for 'andrew 1510'.

Page 44/68 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • How does the iPhone SDK Core Data system store date types to sqlite?

    - by Andrew Arrow
    I used core data to do this: NSManagedObjectContext *m = [self managedObjectContext]; Foo *f = (Foo *)[NSEntityDescription insertNewObjectForEntityForName:@"Foo" inManagedObjectContext:m]; f.created_at = [NSDate date]; [m insertObject:f]; NSError *error; [m save:&error]; Where the created_at field is defined as type "Date" in the xcdatamodel. When I export the sql from the sqlite database it created, created_at is defined as type "timestamp" and the values look like: 290902422.72624 Nine digits before the . and then some fraction. What is this format? It's not epoch time and it's not julianday format. Epoch would be: 1269280338.81213 julianday would be: 2455278.236746875 (notice only 7 digits before the . not 9 like I have) How can I convert a number like 290902422.72624 to epoch time? Thanks!

    Read the article

  • Incremement Page Hit Count in Django

    - by Andrew C
    I have a table with an IntegerField (hit_count), and when a page is visited (ie. http://site/page/3) I want record id 3 'hit_count' column in the database to increment by 1. The query should be like: update table set hit_count = hit_count + 1 where id=3 Can I do this with the standard Django Model conventions? Or should I just write the query by hand? I'm starting a new project, so I am trying to avoid hacks. We'll see how long this lasts! Thanks!

    Read the article

  • Django QuerySet ordering by expression

    - by Andrew
    How can i use order_by like order_by('field1'*'field2') For example i have items with price listed in different currencies, so to order items - i have to make currency conversion. class Currency(models.Model): code = models.CharField(max_length=3, primary_key=True) rateToUSD = models.DecimalField(max_digits=20,decimal_places=10) class Item(models.Model): priceRT = models.DecimalField(max_digits=15, decimal_places=2, default=0) cur = models.ForeignKey(Currency) I would like to have something like: Item.objects.all().order_by(F('priceRT')*F('cur__rateToUSD')) But unfortunately it doesnt work, i also faild with annotate. How can i permorm QuerySet ordering by result of value multiplication of 2 model's fields.

    Read the article

  • Logical equality in C

    - by andrew cooke
    [It seems odd this doesn't exist, so apologies in advance if it's a duplicate] I want to test for logical equality in C. In other words, I want to know whether two values would be equal if both were converted in the normal way associated with logical expressions. In C99, I think that (bool)a == (bool)b gives what I want. Is that correct? What is the normal way of writing this in traditional C?

    Read the article

  • Can't correctly stream x264 video to mobile via RTSP

    - by Andrew
    Hello! I'm trying to stream video compressed with x264 and NeroAAC and hinted with MP4Box. When i'm playing it with VLC player streaming works fine, as expected. When i'm trying to open URL with my HTC Hero, it switches to player mode, then starts "loading video" animation, then after some time it shows "unable to connect to server". Sample movies provided with DSS streamed fine regardless bitrate. I tried few encoding options, but always the same result. I suspect nocabac and level=11 but it didn't changed nothing. Is there some more specific encoding options for such type? Thank You!

    Read the article

  • How to handle concurrency control in dynamic data?

    - by Andrew
    I've been quite impressed with dynamic data and how easy and quick it is to get a simple site up and running. I'm planning on using it for a simple internal HR admin site for registering people's skills/degrees/etc. I've been watching the intro videos at www.asp.net/dynamicdata and one thing they never mention is how to handle concurrency control. It seems that DD does not handle it right out of the box (unless there is some setting I haven't seen) as I manually generated a change conflict exception and the app failed without any user friendly message. Anybody know if DD handles it out of the box? Or do you have to somehow build it into the site?

    Read the article

  • Finding spelling of an element in an ignore case dictionary

    - by Andrew White
    Hi, Weird question, but I have a dictionary created with StringComparer.OrdinalIgnoreCase, looks something like this AaA, 10 aAB, 20 AAC, 12 I then use myDictionary["AAA"] to find the value associated with the key, but what I also need to know is what the actual spelling of the key is in myDictionary, e.g. in this case I want it to return AaA. Any way to do this without a loop? Thx.

    Read the article

  • Creating a [materialised]view from generic data in Oracle/Mysql

    - by Andrew White
    I have a generic datamodel with 3 tables CREATE TABLE Properties ( propertyId int(11) NOT NULL AUTO_INCREMENT, name varchar(80) NOT NULL ) CREATE TABLE Customers ( customerId int(11) NOT NULL AUTO_INCREMENT, customerName varchar(80) NOT NULL ) CREATE TABLE PropertyValues ( propertyId int(11) NOT NULL, customerId int(11) NOT NULL, value varchar(80) NOT NULL ) INSERT INTO Properties VALUES (1, 'Age'); INSERT INTO Properties VALUES (2, 'Weight'); INSERT INTO Customers VALUES (1, 'Bob'); INSERT INTO Customers VALUES (2, 'Tom'); INSERT INTO PropertyValues VALUES (1, 1, '34'); INSERT INTO PropertyValues VALUES (2, 1, '80KG'); INSERT INTO PropertyValues VALUES (1, 2, '24'); INSERT INTO PropertyValues VALUES (2, 2, '53KG'); What I would like to do is create a view that has as columns all the ROWS in Properties and has as rows the entries in Customers. The column values are populated from PropertyValues. e.g. customerId Age Weight 1 34 80KG 2 24 53KG I'm thinking I need a stored procedure to do this and perhaps a materialised view (the entries in the table "Properties" change rarely). Any tips?

    Read the article

  • Monitor resolution changes look of website

    - by Andrew
    I have a website that looks fine in my resolution and even in the more common 1024 x 768. Yet, in someone else's browser in 1024 x 768, it's too wide and the website doesn't even center correctly. Is there a way to have a proper width layout that doesn't change when the resolution is changed?

    Read the article

  • Doing a join across two databases with different collations on SQL Server and getting an error.

    - by Andrew G. Johnson
    I know, I know with what I wrote in the question I shouldn't be surprised. But my situation is slowly working on an inherited POS system and my predecessor apparently wasn't aware of JOINs so when I looked into one of the internal pages that loads for 60 seconds I see that it's a fairly quick, rewrite these 8 queries as one query with JOINs situation. Problem is that besides not knowing about JOINs he also seems to have had a fetish for multiple databases and surprise, surprise they use different collations. Fact of the matter is we use all "normal" latin characters that English speaking people would consider the entire alphabet and this whole thing will be out of use in a few months so a bandaid is all I need. Long story short is I need some kind of method to cast to a single collation so I can compare two fields from two databases. Exact error is: Cannot resolve the collation conflict between "SQL_Latin1_General_CP850_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

    Read the article

  • Styling individual radio buttons in drupal form

    - by Andrew
    I have this group of radio buttons in which each of individual button has of its own position set through style attribute. I would like to how can I archive the same by using drupal form api. I found how to style as whole but, not as individual control within group. Here's how my html code look like - <input type="radio" name="base_location" checked="checked" value="0" style="margin-left:70px;float:left;"/><span style="float:left;">District</span> <input type="radio" name="base_location" value="1" style="margin-left:50px;float:left;"/><span style="float:left;">MRT</span> <input type="radio" name="base_location" value="2" style="margin-left:60px;float:left;"/><span style="float:left;">Address</span> And this is the drupal code I'm stuck at - $form['base_location'] = array( '#type' => 'radios', '#title' => t('base location'), '#default_value' => variable_get('search_type', 0), '#options' => array( '0'=>t('District'), '1'=>t('MRT'), '2'=>t('Address')), '#description' => t('base location'), I'm aware of #type=radio existence. However, I do not know how to group all my radio buttons together in this regard. If I use same array key for all of them, they would collide each other. If I don't, they aren't seen as part of the same group. I thank you in advance.

    Read the article

  • C# Excel Exception

    - by Andrew James Watt
    I am trying to copy all data from worksheet1 and paste the values into worksheet2 at the same position I am using office 2003 and the Interlop library. Here is my code; public void CreateExcelWorksheet() { Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); if (xlApp == null) { Console.WriteLine("EXCEL could not be started. Check that your office installation."); return; } xlApp.Visible = true; Workbook wb = xlApp.Workbooks.OpenXML(@"C:\XML_Export.xml", Type.Missing, 2); Worksheet worksheet1 = wb.Worksheets[1] as Worksheet; Worksheet worksheet2 = wb.Worksheets[2] as Worksheet; worksheet1.UsedRange.Copy(Type.Missing); worksheet2.PasteSpecial(Microsoft.Office.Interop.Excel.XlPasteType.xlPasteValues, false, false, Type.Missing, Type.Missing, Type.Missing, Type.Missing); } For some reason after the paste command the following exception occurs: Exception from HRESULT: 0x800A03EC Could anyone help?

    Read the article

  • When to alter a function vs when to just write a new one...?

    - by Andrew Heath
    /is n00b Through the gift of knowledge and expertise encoded here, I am doing my best to avoid n00b mistakes as I learn the basics of programming. I use functions when I (think I) can in PHP, and keep them somewhat sorted in different includes. The n00b problem I'm running into now is situations where perhaps 4/5th of an existing function is relevant to a new need. Maybe there are a slightly different set of inputs, or an additional calculation or two in the series, or output needs a different format/structure... but the core of the function is still applicable. Is there a good rule of thumb regarding when one should bolt-on crap to an original function and when one should (literally) copy & paste most of it into a new function and tweak to fit the situation? On the one hand I feel bad duping code, on the other I feel bad cluttering up an existing function with stuff not always needed...

    Read the article

  • How do I get the server hostname from a mounted directory with cocoa/obj-c?

    - by Andrew
    Currently when I open a file with my program I can select files on a server by clicking on the server name in the sidebar in an NSOpenPanel and then selecting the file. No problem, this works fine for using the file as long as the shared directory is mounted. I get a path like "/Volumes/SHARENAME/filename.bla". My question is how do I get the server hostname of the computer it came from. For instance, if I clicked on the device with name SERVERNAME under "Shared" in the NSOpenPanel how do I get SERVERNAME from "/Volumes/SHARENAME/filename.bla". I have looked at quite a bit of documentation and have been unable to find a solution for this problem. Any help toward this will be greatly appreciated. Thank you.

    Read the article

  • Change cell color in Excel according to adjacent dropdown value

    - by Andrew Heath
    I understand how to make a dropdown list. I understand how to make conditional formatting change the color of a cell. What I do not understand is how to make conditional formatting change the color of a cell based solely on the state of another cell (not a comparison). A1 is a No / Yes dropdown list B1 is a criteria statement If the user satisfies the criteria statement in B1, they select Yes on the dropdown list in A1. For quick reference, if possible, I'd like B1 to change to a green background color on this event... and of course change back to no-fill if the dropdown is reset to No. Is this possible in Excel 2003 and/or 2007?

    Read the article

  • Easy way to parse a url in C++ cross platform?

    - by Andrew Bucknell
    I need to parse a url to get the protocol host path and query in an application I am writing in c++. The application is intended to be cross platform. Im surprised I cant find anything that does this in boost or poco libraries. Is it somewhere obvious Im not looking? Any suggestions on appropriate open source libs? Or is this something I just have to do my self? Its not super complicated but it seems such a common task I am surprised there isnt a common solution.

    Read the article

  • P/Invoke a Function Passed a StringBuilder

    - by andrew
    in a C# file i have a class Archiver { [DllImport("Archiver.dll")] public static extern void archive(string data, StringBuilder response); } string data is an input, and StringBuilder response is where the function writes something the archive function prototype (written in C) looks like this: void archive(char * dataChr, char * outChr); and it receives a string in dataChr, and then does a strcpy(outChr,"some big text"); from C# i call it something like this: string message = "some text here"; StringBuilder response = new StringBuilder(10000); Archiver.archive(message,response); this works, but the problem, as you might see is that i give a value to the StringBuilder size, but the archive function might give back a (way) larger text than the size i've given to my StringBuilder. any way to fix this?

    Read the article

  • Building html tables from query data... faster?

    - by Andrew Heath
    With my limited experience/knowledge I am using the following structure to generate HTML tables on the fly from MySQL queries: $c = 0; $t = count($results); $table = '<table>'; while ($c < $t) { $table .= "<tr><td>$results[0]</td><td>$results[1]</td> (etc etc) </tr>"; ++$c; } $table .= '</table>'; this works, obviously. But for tables with 300+ rows there is a noticeable delay in pageload while the script builds the table. Currently the maximum results list is only about 1,100 rows, and the wait isn't long, but there's clearly a wait. Are there other methods for outputting an HTML table that are faster than my WHILE loop? (PHP only please...)

    Read the article

  • How can I create Wikipedia's footnote highlighting solely with jQuery

    - by andrew.bachman
    I would like to duplicate Wikipedia's footnote highlighting from in-text citation click solely in jQuery and CSS classes. I found a webpage that describes how to do so with CSS3 and then a JavaScript solution for IE. I would like however to do so solely with jQuery as the site I'm doing it on already has a bunch of jQuery elements. I've come up with a list of the process. In-Text Citation Clicked Replace highlight class with standard footnote class on <p> tag of footnotes that are already highlighted. Add highlight to the appropriate footnote Use jQuery to scroll down the page to appropriate footnote. I've come up with some jQuery so far but I'm extremely new to it relying heavy on tutorials and plugins to this point. Here is what I have with some plain English for the parts I haven't figured out yet. $('.inlineCite').click(function() { $('.footnoteHighlight').removeClass('footnoteHighlight').addClass('footnote'); //add highlight to id of highlightScroll //scroll to footnote with matching id }); If I had a method to pass a part of the selector into the function and turn it into a variable I believe I could pull it off. Most likely I'm sure one of you gurus will whip something up that puts anything I think I have done to shame. Any help will be greatly appreciated so thank you in advance. Cheers.

    Read the article

  • Taking my ASP.NET from my local comp to the server

    - by Andrew G. Johnson
    Hi All, So I have been developing a small ASP.NET web app in C# for my company over the past few weeks and now I am trying to push it onto our Rackspace server. First step was to create a virtual directory because we want it to be www.ourdomain.com/appname/ and most of the stuff on ourdomain.com is currently in classic ASP. So I did this and then uploaded my stuff to the new folder. I *think* I did this at least semi-right because the error message I am getting is that nice puke color (ASP.NET style instead of classic ASP style) -- problem is it is generic and just saying runtime error. I tried just copy/pasting <customErrors mode="On" /> into the web.config file in the /appname/ directory but nothing changed So the actual questions are: How can I get a more descriptive error, when I was developing locally I just pushed the "play button" in VS2010 and it would either show me the app or tell me where I screwed up Is there anything else I'm doing wrong that may be causing this? If there's things I need to check lemme know!

    Read the article

  • Viewing Crystal Reports other than through custom developed webform or winform apps

    - by Andrew
    At work we currently have a custom in-house built winforms app for the business users to view reports. It has role-based security and several administrator functions. My boss is thinking about getting me to port this app to webforms. My question is, are there options other than custom built winforms and webforms apps for deploying/viewing/administrating Crystal Reports at an enterprise level (role-based security, easy report deployment, etc)? I'm thinking about third-party packages or perhaps applications provided by Microsoft/Business Objects/SAP? We are using Crystal Reports 11.5.

    Read the article

  • Best way to stop SQL Injection in PHP

    - by Andrew G. Johnson
    So specifically in a mysql database. Take the following code and tell me what to do. // connect to the mysql database $unsafe_variable = $_POST["user-input"]; mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')"); // disconnect from the mysql database

    Read the article

  • Choosing a Java IDE for homework assignments

    - by Andrew
    Can anyone recommend a light Java IDE that doesn't require you to make new projects each time you want to compile and run a program? I just want to be able to open java files and compile and run them. I have already tried Eclipse and NetBeans but both require you to make a new project each time you want to compile and run a program. Making a new project is fine for large scale projects but for small school assignments this just makes the process more tedious. Thanks

    Read the article

  • ASP.NET ListView, custom DataSources, and editing items

    - by Andrew Shepherd
    The MSDN walkthroughs provide a number of examples where you can drag a DataSource from the toolbox, run through some simple configuration steps, then drag a ListView onto the screen, point it at the DataSource, and hey - you've got full table editing. Now I'm trying to write my own DataSource class (a class that implements System.Web.UI.IDataSource) and my own DataSourceView class. I now assign an instance of this custom DataSource class to the ListView.DataSource propery. The display of all the items is working well. However, updating, inserting and deleting just is not working. I'm overriding every function I can in my DataSourceView class, and they just aren't being called. This is such a huge topic, I'll focus this question on one simple example: When you press the "Edit" button (the button inside the ItemTemplate with a CommandName of "Edit", you expect the ItemTemplate to be replaced by an EditItemTemplate. This did not happen. The only way I could get it to happen was to handle the onitemediting event. protected void _listViewPublicHolidays_ItemEditing(object sender, ListViewEditEventArgs e) { _listViewPublicHolidays.EditIndex = e.NewEditIndex; _listViewPublicHolidays.DataBind(); } This is hardly a problem, but how come I had to do it at all? In the MSDN walkthroughs where I attach a ListView to a LinqDataSource, this code doesn't have to be written. Can someone who's been here before hazard a guess as to what would be different or missing in my custom datasource?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >