Search Results

Search found 1875 results on 75 pages for 'matt blaine'.

Page 51/75 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Pre-populate iPhone Safari SQLite DB

    - by Matt Rogish
    I'm working with a PhoneGap app that uses Safari local storage (SQlite DB) via Javascript: http://developer.apple.com/safari/library/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/UsingtheJavascriptDatabase/UsingtheJavascriptDatabase.html On first load, the app creates the database, tables, and populates the data via a series of INSERT statements. If the user closes the app while this processing is happening, then my app database is left in an inconsistent state. What I prefer to do is deploy the SQLite DB as part of my iTunes App packaging so nothing must be populated at app cold start. However, I'm not sure if that is possible -- all of the google hits for this topic that I can find are referring to the core-data provided SQLite which is not what we're using... If it's not possible, could I wrap the entire thing in a transaction and keep re-trying it when the app is restarted? Failing that, I guess I can create a simple table with one boolean column "is_app_db_loaded?" and set it to true after I've processed all my inserts. But that's really gross... Ideas? Thanks!!

    Read the article

  • Intermittent NoClassDefFoundError error running Selenium JUnit tests

    - by Matt Sheppard
    For some time, I've been running a substantial set of JUnit / Selenium tests against a number of platforms on a nightly basis. Intermittently (about once in every 40 runs), all the tests for a given platform fail with a NoClassDefFoundError on the common superclass of all my tests as follows. java.lang.NoClassDefFoundError: [common super class of all my selenium tests] at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructors(Class.java:1459) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) Re-invoking the tests will generally get the tests running normally, so it's clearly something dependent on some condition I am not considering. What might be causing this error to occur seemingly randomly?

    Read the article

  • SelectedItem in ListView binding

    - by Matt
    I'm new in wfp. In my sample application I'm using a ListView to display contents of property. I don't know how to bind SelectedItem in ListView to property and then bind to TextBlock. Window.xaml <Window x:Class="Exec.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Main window" Height="446" Width="475" > <Grid> <ListView Name="ListViewPersonDetails" Margin="15,12,29,196" ItemsSource="{Binding Persons}" SelectedItem="{Binding CurrentSelectedPerson}"> <ListView.View> <GridView> <GridViewColumn Header="FirstName" DisplayMemberBinding="{Binding FstNamePerson}"/> <GridViewColumn Header="LastName" DisplayMemberBinding="{Binding SndNamePerson}"/> <GridViewColumn Header="Address" DisplayMemberBinding="{Binding AdressPerson}"/> </GridView> </ListView.View> </ListView> <TextBlock Height="23" Name="textFirstNameBlock" FontSize="12" Margin="97,240,155,144"> <Run Text="Name: " /> <Run Text="{Binding CurrentSelectedPerson.FstNamePerson}" FontWeight="Bold" /> </TextBlock> <TextBlock Height="23" Name="textLastNameBlock" FontSize="12" Margin="97,263,155,121"> <Run Text="Branch: " /> <Run Text="{Binding CurrentSelectedPerson.SndNamePerson}" FontWeight="Bold" /> </TextBlock> <TextBlock Height="23" Name="textAddressBlock" FontSize="12" Margin="0,281,155,103" HorizontalAlignment="Right" Width="138"> <Run Text="City: " /> <Run Text="{Binding CurrentSelectedPerson.AdressPerson}" FontWeight="Bold" /> </TextBlock> </Grid> </Window> MainWindow.xaml.cs Tman manager = new Tman(); private List<Person> persons; public List<Person> Persons { get { return this.persons; } set { if (value != null) { this.persons = value; this.NotifyPropertyChanged("Data"); } } } private Person currentSelectedPerson; public Person CurrentSelectedPerson { get { return currentSelectedPerson; } set { this.currentSelectedPerson = value; this.NotifyPropertyChanged("CurrentSelectedItem"); } } public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(string propertyName) { var handler = this.PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(propertyName)); } } private void Window_Loaded(object sender, RoutedEventArgs e){ ListViewPersonDetails.ItemsSource= manager.GetPersons(); } Person.cs class Person { public string FirstName { get; set; } public string LastName { get; set; } public string Address { get; set; } } Thanks for any help.

    Read the article

  • Python's JSON module doesn't use __get__?

    - by Matt
    When I serialize a list of objects with a custom __get__ method, __get__ is not called and the raw (unprocessed by custom __get__) value from __set__ is used. How does Python's json module iterate over an item? Note: if I iterate over the list before serializing, the correct value returned by __get__ is used.

    Read the article

  • How to select parent row only if has at least one child?

    - by Matt McCormick
    I have a simple one-to-many relationship. I would like to select rows from the parent only when they have at least one child. So, if there are no children, then the parent row is not returned in the result set. Eg. Parent: +--+---------+ |id| text | +--+---------+ | 1| Blah | | 2| Blah2 | | 3| Blah3 | +--+---------+ Children +--+------+-------+ |id|parent| other | +--+------+-------+ | 1| 1 | blah | | 2| 1 | blah2 | | 3| 2 | blah3 | +--+------+-------+ I want the results to be: +----+------+ |p.id|p.text| +----+------+ | 1 | Blah | | 2 | Blah2| +----+------+

    Read the article

  • Using jQuery to call a web service

    - by Matt
    I have created a web service which takes a username and password as parameters and returns a list of children in JSON (the user is a Social Worker). The web service is hosted locally with IIS7. I am attempting to access the web service using javascript/jquery because it will eventually need to run as a mobile app. I'm not really experienced with web services, or javascript for that matter, but the following two links seemed to point me in the right direction: http://williamsportwebdeveloper.com/cgi/wp/?p=494 http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/ This is my html page: <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="TestWebService.aspx.cs" Inherits="Sponsor_A_Child.TestWebService" %> <asp:Content ID="Content1" ContentPlaceHolderID="stylesPlaceHolder" runat="server"> <script type="text/javascript" src="Scripts/jquery-1.7.1.js"> $(document).ready(function () { }); function LoginClientClick() { $("#query_results").empty(); $("#query_results").append('<table id="ResultsTable" class="ChildrenTable"><tr><th>Child_ID</th><th>Child_Name</th><th>Child_Surname</th></tr>'); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "http://localhost/PhoneWebServices/GetChildren.asmx/GetMyChildren", data: '{ "email" : "' + $("#EmailBox").val() + '", "password": "' + $("#PasswordBox").val() + '" }', dataType: "json", success: function (msg) { var c = eval(msg.d); alert("" + c); for (var i in c) { $("#ResultsTable tr:last").after("<tr><td>" + c[i][0] + "</td><td>" + c[i][1] + "</td><td>" + c[i][2] + "</td></tr>"); } } }); } </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="server"> <div id="LoginDiv"> Email: <input id="EmailBox" type="text" /><br /> Password: <input id="PasswordBox" type="password" /><br /> <input id="LoginButton" type="button" value="Submit" onclick="LoginClientClick()" /> </div> <div id="query_results"> </div> </asp:Content> And this is my web service code: [WebMethod (Description="Returns the list of children for whom the social worker is responsible.")] public String GetMyChildren(String email,String password) { DataSet MyChildren=new DataSet(); int ID=SocialWorkerLogin(email, password); if (ID > 0) { MyChildren = FillChildrenTable(ID); } MyChildren.DataSetName = "My Children"; //To prevent 'DataTable name not set' error string[][] JaggedArray = new string[MyChildren.Tables[0].Rows.Count][]; int i = 0; foreach (DataRow rs in MyChildren.Tables[0].Rows) { JaggedArray[i] = new string[] { rs["Child_ID"].ToString(), rs["Child_Name"].ToString(), rs["Child_Surname"].ToString() }; i = i + 1; } // Return JSON data JavaScriptSerializer js = new JavaScriptSerializer(); string strJSON = js.Serialize(JaggedArray); return strJSON; } I followed the examples in the provided links, but when I press submit, only the table headers appear but not the list of children. When I test the web service on it's own though, it does return a JSON string so that part seems to be working. Any help is greatly appreciated :)

    Read the article

  • How to create a view of table that contains a timestamp column?

    - by Matt Faus
    This question is an extension of a previous one I have asked. I have a table (2014_05_31_transformed.Video) with a schema that looks like this. I have put up the JSON returned by the BigQuery API describing it's schema in this gist. I am trying to create a view against this table with an API call that looks like this: { 'view': { 'query': u 'SELECT deleted_mod_time FROM [2014_05_31_transformed.Video]' }, 'tableReference': { 'datasetId': 'latest_transformed', 'tableId': u 'Video', 'projectId': 'redacted' } } But, the BigQuery API is returning this error: HttpError: https://www.googleapis.com/bigquery/v2/projects/124072386181/datasets/latest_transformed/tables?alt=json returned "Invalid field name "deleted_mod_time.usec". Fields must contain only letters, numbers, and underscores, start with a letter or underscore, and be at most 128 characters long." The schema that the BigQuery API does not make any distinction between a TIMESTAMP data type and a regular nullable INTEGER data type, so I can't think of a way to programmatically correct this problem. Is there anything I can do, or is this a bug with BigQuery's view implementation?

    Read the article

  • Ajax problem after deleting a div, then creating a new one

    - by Matt Nathanson
    I'm building a custom CMS where you can add and delete clients using ajax and jquery 1.4.2. My problem lies after I delete a div. The ajax is used to complete this and refresh automatically.. But when I go to create a new div (without a hard refresh) it puts it back in the slot of the div I just deleted. How can I get this to completely forget about the div i just deleted and place the new div in the next database table? link for reference: http://staging.sneakattackmedia.com/cms/ //Add New client // function AddNewClient() { dataToLoad = 'addClient=yes'; $.ajax({ type: 'post', url: '/clients/controller.php', datatype: 'html', data: dataToLoad, target: ('#clientssidebar'), async: false, success: function(html){ $(this).click(function() {reInitialize()}); //$('#clientssidebar').html(html); $('div#' + clientID).slideDown(800); $(this).click(function() { ExpandSidebar()});}, error: function() { alert('An error occured! 222');} });}; //Delete Client // function DeleteClient(){ var yes = confirm("Whoa there chief! Do you really want to DELETE this client?"); if (yes == 1) { dataToLoad = 'clientID=' + clientID + '&deleteClient=yes', $.ajax({ type: 'post', url: '/clients/controller.php', datatype: 'html', data: dataToLoad, success: function(html) { alert('Client' + clientID + ' should have been deleted from the database.'); $(this).click(function() {reInitialize()}); $('div#' +clientID).slideUp(800); }, error: function() { alert('error'); }});};}; //Re Initialize // function reInitialize() { $('#addnew').click(function() {AddNewClient()}); $('.deletebutton').click(function() {clientID = $(this).parent().attr('id'); DeleteClient()}) $('.clientblock').click(function() {clientID = $(this).attr('id'); ExpandSidebar()});}; //Document Ready // $(document).ready(function(){ if ($('isCMS')){ editCMS = 1; $('.deletebutton').click(function() {clientID = $(this).parent().attr('id'); DeleteClient()}); $('#addnew').click(function() {AddNewClient()}); $('.clientblock').click(function() {clientID = $(this).attr('id'); ExpandSidebar()}); $('.clientblock').click(function() {if (clickClient ==true) { $(this).css('background-image', 'url(/images/highlightclient.png)'); $(this).css('margin-left' , '30px'); }; $(this).click(function(){ $(this).css('background-image', ''); }); $('.uploadbutton').click(function(){UploadThings()}); }); } else ($('#clientscontainer')) { $('#editbutton').css('display', 'none'); }; }); Please help!!!

    Read the article

  • xs:choice unbounded list

    - by Matt
    I want to define an XSD schema for an XML document, example below: <?xml version="1.0" encoding="utf-8"?> <view xmlns="http://localhost/model_data" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost/model_data XMLSchemaView.xsd" path="wibble" id="wibble"> <text name="PageTitle">Homepage</text> <text name="Keywords">home foo bar</text> <image name="MainImage"> <description>lolem ipsum</description> <title>i haz it</title> <url>/images/main-image.jpg</url> <type>image/jpeg</type> <alt>alt text for image</alt> <width>400</width> <height>300</height> </image> <link name="TermsAndConditionsLink"> <url>/tnc.html</url> <title>Terms and Conditions</title> <target>_blank</target> </link> </view> There's a view root element and then an unknown number of field elements (of various types). I'm using the following XSD schema: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://localhost/model_data" targetNamespace="http://localhost/model_data" id="XMLSchema1"> <xs:element name="text" type="text_field"/> <xs:element name="view" type="model_data"/> <xs:complexType name="model_data"> <xs:choice maxOccurs="unbounded"> <xs:element name="text" type="text_field"/> <xs:element name="image" type="image_field"/> <xs:element name="link" type="link_field"/> </xs:choice> <xs:attribute name="path" type="xs:string"/> <xs:attribute name="id" type="xs:string"/> </xs:complexType> <xs:complexType name="image_field"> <xs:all> <xs:element name="description" type="xs:string"/> <xs:element name="title" type="xs:string"/> <xs:element name="type" type="xs:string"/> <xs:element name="url" type="xs:string"/> <xs:element name="alt" type="xs:string"/> <xs:element name="height" type="xs:int"/> <xs:element name="width" type="xs:int"/> </xs:all> <xs:attribute name="name" type="xs:string"/> </xs:complexType> <xs:complexType name="text_field"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="name" type="xs:string"/> </xs:extension> </xs:simpleContent> </xs:complexType> <xs:complexType name="link_field"> <xs:all> <xs:element name="target" type="xs:string"/> <xs:element name="title" type="xs:string"/> <xs:element name="url" type="xs:string"/> </xs:all> <xs:attribute name="name" type="xs:string"/> </xs:complexType> </xs:schema> This looks like it should work to me, but it doesn't and I always get the following error: Element <text> is not allowed under element <view>. Reason: The following elements are expected at this location (see below) <text> <image> <link> Error location: view / text Details cvc-model-group: Element <text> unexpected by type 'model_data' of element <view>. cvc-elt.5.2.1: The element <view> is not valid with respect to the actual type definition 'model_data'. I've never really used XSD schemas before, so I'd really appreciate it if someone could point out where I'm going wrong.

    Read the article

  • Using AJAX to get a specific DOM Element (using Javascript, not jQuery)

    - by Matt Frost
    How do you use AJAX (in plain JavaScript, NOT jQuery) to get a page (same domain) and display just a specific DOM Element? (Such as the DOM element marked with the id of "bodyContent"). I'm working with MediaWiki 1.18, so my methods have to be a little less conventional (I know that a version of jQuery can be enabled for MediaWiki, but I don't have access to do that so I need to look at other options). I apologize if the code is messy, but there's a reason I need to build it this way. I'm mostly interested in seeing what can be done with the Javascript. Here's the HTML code: <div class="mediaWiki-AJAX"><a href="http://www.domain.com/whatever"></a></div> Here's the Javascript I have so far: var AJAXs = document.getElementsByClassName('mediaWiki-AJAX'); if (AJAXs.length > 0) { for (var i = AJAXs.length - 1; i >= 0; i--) { var URL = AJAXs[i].getElementsByTagName('a')[0].href; xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { AJAXs[i].innerHTML = xmlhttp.responseText; } } xmlhttp.open('GET',URL,true); xmlhttp.send(); } }

    Read the article

  • python - checking if a user has admin privileges

    - by Matt
    Hi, I'm writing a little program as a self-learning project in Python 3.x. my idea is for the program to allow two fields of text entry to the user, and then plug the user's input into the value of two specific registry keys. What I was wondering, and something my books don't seem to cover, is if there is a simple way to make it check if the current user can access the registry. I'd rather it cleanly tell the user that he needs admin privileges than for the program to go nuts and crash because it's trying to access a restricted area. I'd like it to make this check as soon as the program launches, before the user is given any input options. What code is needed for this? thanks for the help

    Read the article

  • Relative Paths, etc. on an Apache server

    - by Matt H.
    I'm really stuck here. I have 2 issues at once: First, my site is stored (both on local development and on live server), in a subdirectory.. as I'm working on multiple sites. i.e. /Sites/www.mysite.com/(site files here) When I'm referring to files in my web pages, I want to refer to, say, my /images directory without hard-coding every occurrence as /www.mysite.com/images/myfile.jpg Is there a way to simply redefine how the leading "/" gets interpreted by the server? Question two, concerning PHP mod_rewrite I have this set of rewrite rules. The objective is to turn www.mysite.com/faq into www.mysite.com/index.php?page="faq" RewriteEngine On RewriteCond %{REQUEST_URI} !mysite.com RewriteRule (.*) mysite.com/$1 RewriteRule ^([a-zA-Z0-9_-]+)$ /mysite.com/index.php?site=$1 RewriteRule ^([a-zA-Z0-9_-]+)/$ /mysite.com/index.php?site=$1 I don't have a problem when a url gets passed in the 2nd-to-last format (as the example above). However, if the trailing "/" is added: www.mysite.com/faq/, my external script references break: (such as src=js/script.js)...

    Read the article

  • Data scheme question

    - by Matt
    I am designing a data model for a local city page, more like requirements for it. So 4 tables: Country, State, City, neighbourhood. Real life relationships is: Country owns multiple State which owns multiple cities which ows multiple neighbourhoods. In the data model: Do we link these with FK the same way or link each with each? Like in each table there will even be a Country ID, State ID, CityID and NeighbourhoodID so each connected with each? Other wise to reach neighbourhood from country we need to join 2 other tables in between? There are more tables I need to maintain for IP addess of cities, latitude/longitude, etc.

    Read the article

  • Can I get a table name from a join select resultset metadata

    - by Matt
    Below is my code trying to retrieve table name form Resultset ResultSet rs = stmt.executeQuery("select * from product"); ResultSetMetaData meta = rs.getMetaData(); int count = meta.getColumnCount(); for (int i=0; i<count; i++) { System.out.println(meta.getTableName(i)); } But it returns empty, no mention it is a join select resultset. Is there any other approaches to retrieve table name from reusltset metadata?

    Read the article

  • listview tile layout problem (vb.net)

    - by Matt Facer
    hi guys, I have a listview which displays (eventually) an album cover of an itunes play list with the album name under it. the problem I am having is that I cannot get the album art (currently a blank square) ABOVE the album name. It always is on the side... how do I do it? I've tried adding column headers and alsorts... code to set up the listview Dim myImageList As ImageList albumList.View = View.Tile albumList.TileSize = New Size(120, 150) ' Initialize the item icons. myImageList = New ImageList() myImageList.Images.Add(Image.FromFile("c:/test.jpg")) myImageList.ImageSize = New Size(80, 80) albumList.LargeImageList = myImageList I then do a loop to display each album name which uses Dim item0 As New ListViewItem(New String() _ {Albums(i).Name}, 0) albumList.Items.Add(item0) the output is http://i111.photobucket.com/albums/n122/mfacer/Screenshot2010-05-02at164815.png but as i said, I want the album name under the orange box.... any ideas?? Thanks for any info!

    Read the article

  • C# System.Diagnostics.Process redirecting Standard Out for large amounts of data

    - by Matt
    I running an exe from a .NET app and trying to redirect standard out to a streamreader. The problem is that when I do myprocess.exe out.txt out.txt is close to 14mb. When I do the command line version it is very fast but when I run the process from my csharp app it is excruciatingly slow because I believe the default streamreader flushes every 4096 bytes. Is there a way to change the default stream reader for the Process object?

    Read the article

  • .NET equivalent of httpunit

    - by Matt
    I will openly admit that I fall on the side of Test Driven Development. I have run into a situation that I would like to test, but I haven't found a good way to do so. I have been working in ASP.NET MVC and I would like to test that the parts of code that I am putting into the view layer (and I know that I need to keep that as minimal as possible). I am looking for an equivalent in .NET to httpunit in Java or something similar.

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >