Search Results

Search found 1198 results on 48 pages for 'phil brown'.

Page 33/48 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Obj-c Turning long string into multidimensional array

    - by Phil
    I have a long NSString, something like "t00010000t00020000t00030000" and so on. I need to split that up into each "t0001000". I'm using... NSArray *tileData = [[GameP objectForKey:@"map"] componentsSeparatedByString:@"t"]; And it splits it up, but the "t" is missing, which I need (although I think I could append it back on). The other way I guess would be to split it up by counting 8 char's, although not sure how to do that. But ideally I need it split into a [][] type array so I can get to each bit with something like... NSString tile = [[tileData objectAtIndex:i] objectAtIndex:j]]; I'm new to obj-c so thanks for any help.

    Read the article

  • Repeater not repeating :0) (asp.net)(vb)

    - by Phil
    Morning stackoverflow, I have a repeater, with the following code in my aspx page; <asp:Repeater ID="Contactinforepeater" runat="server"> <HeaderTemplate> <h1>Contact Information</h1> </HeaderTemplate> <ItemTemplate> <table width="50%"> <tr> <td colspan="2"><%#Container.DataItem("position")%></td> </tr> <tr> <td>Name:</td> <td><%#Container.DataItem("surname")%></td> </tr> <tr> <td>Telephone:</td> <td><%#Container.DataItem("telephone")%></td> </tr> <tr> <td>Fax:</td> <td><%#Container.DataItem("fax")%></td> </tr> <tr> <td>Email:</td> <td><%#Container.DataItem("email")%></td> </tr> </table> </ItemTemplate> <SeparatorTemplate> <br /><hr /><br /> </SeparatorTemplate> </asp:Repeater> Then I have this code in my aspx.vb to get the data; If did = 0 Then s = "sql works on db server" x = New SqlCommand(s, c) x.Parameters.Add("@contentid", Data.SqlDbType.Int) x.Parameters("@contentid").Value = contentid c.Open() r = x.ExecuteReader r.Read() Contactinforepeater.DataSource = r Contactinforepeater.DataBind() End If c.Close() r.Close() If Not did = 0 Then s = "sql works on db server" x = New SqlCommand(s, c) x.Parameters.Add("@contentid", SqlDbType.Int) x.Parameters("@contentid").Value = contentid x.Parameters.Add("@did", SqlDbType.Int) x.Parameters("@did").Value = did c.Open() r = x.ExecuteReader r.Read() Contactinforepeater.DataSource = r Contactinforepeater.DataBind() End If r.Close() c.Close() If 'did' is or is not '0' I still get no data outputted to the page. I just get the 'contact information' h1 header from the header template. I've tested the value of s in sqlsms and it works fine. Position, surname, telephone, fax, email all exist in the db. The particular page I am checking exists and has 1 set of contact information attached. Where am I going wrong? Thanks! ps. Does my syntax appear correct? pps. I am also open to different ways of achieving the same result. I tried via an sqldatasource but ran into problems when using variables as params (there is no option to select them, only controls, querystring etc)

    Read the article

  • Do you code variables in your language?

    - by Phil Hannent
    I am just working on a project where the library has an object with the property color, however being British I always use colour when writing variables and properties. I also just found some legacy code where the British developer used color in a variable name. Is American English the default for development now?

    Read the article

  • An example of advanced database search

    - by Phil
    Hi there, im looking for an example script. I saw one yesterday but for the life of me I can't find it again today. The task I have is to allow the user to search 1 database table via input controls on an aspx page where they can select and , or , equals to combine fields, generating the sql on the fly with a stringbuilder or similar. (it runs behind the corp firewall) Please can someone point me in the right direction of an example or tutorial I've been working on the page, but have run into problems. Here is a snippet; If NameSearch.Text IsNot String.Empty And andor1v IsNot "0" Then sql += "Surname LIKE '%" & name & "%' " & andor1v & " " ElseIf NameSearch.Text IsNot String.Empty And andor1v Is "0" Then sql += "Surname LIKE '%" & name & "%' " End If

    Read the article

  • What is wrong with my SQL syntax for an UPDATE with a JOIN?

    - by Phil H
    I have two tables, related by a common key. So TableA has key AID and value Name and TableB has keys AID, BID and values Name, Value: AID Name 74 Alpha AID BID Name Value 74 4 Beta Brilliance I would like to update the TableB Value here from Brilliance to Barmy, using just the Name fields. I thought I could do it via an UPDATE containing a JOIN, but Access (I know...) is complaining with 'Syntax error (missing operator) in query expression ' and then everything from 'Barmy' here: UPDATE tB SET tB.BValue='Barmy' FROM TableB tB INNER JOIN TableA tA ON tB.AID=tA.AID WHERE tB.Name='Beta' AND tA.Name='Alpha'; What is my heinous crime? Or is it just Access not conforming?

    Read the article

  • What algorithm would you use to code a parrot?

    - by Phil H
    A parrot learns the most commonly uttered words and phrases in its vicinity so it can repeat them at inappropriate moments. So how would you create a software version? Assuming it has access to a microphone and can record sound at will, how would you code it without requiring infinite resources? The best I can imagine is to divide the stream using silences in the sound, and then use some pattern recognition to encode each one as a list of tokens, storing new ones as you meet them. Hashing the token sequences and counting occurrences in a database, you could build up a picture of the most frequently uttered phrases. But given the huge variety in phrases, how do you prevent this just becoming a huge list? And the sheer number of pairs to match would surely generate lot of false positives from the combinatorial nature of matching. Would you use a neural net, since that's how a real parrot manages it? Or is there another, cleverer way of matching large-scale patterns in analogue data?

    Read the article

  • Unable to Connect to Management Studio Server

    - by Phil Hilliard
    I have a nasty situation. I am using Microsoft SQL Server Management Studio Express edition locally on my pc for testing, and once tested I upload database changes to a remote server. I have a situation where I deleted the Default Database on my local machine, and instead of searching hard enough to find an answer to that problem, I uninstalled and reinstalled Management Studio. Since then Management Studio has not been able to connect to the server. Is there any help (or hope for me for that matter), out there????? The following is the detailed error message: =================================== Cannot connect to LENOVO-E7A54767\SQLEXPRESS. =================================== A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (.Net SqlClient Data Provider) ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476 ------------------------------ Error Number: -1 Severity: 20 State: 0 ------------------------------ Program Location: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server) at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

    Read the article

  • String / DateTime Conversion problem (asp.net vb)

    - by Phil
    I have this code: Dim birthdaystring As String = MonthBirth.SelectedValue.ToString & "/" & DayBirth.SelectedValue.ToString & "/" & YearBirth.SelectedValue.ToString Dim birthday As DateTime = Convert.ToDateTime(birthdaystring) Which produces errors (String was not recognized as a valid DateTime.) The string was "01/31/1963". Any assistance would be appreciated. Thanks.

    Read the article

  • Copy/publish images linked from the html files to another server and update the HTML files referenci

    - by Phil
    I am publishing content from a Drupal CMS to static HTML pages on another domain, hosted on a second server. Building the HTML files was simple (using PHP/MySQL to write the files). I have a list of images referenced in my HTML, all of which exist below the /userfiles/ directory. cat *.html | grep -oE [^\'\"]+userfiles[\/.*]*/[^\'\"] | sort | uniq Which produces a list of files http://my.server.com/userfiles/Another%20User1.jpg http://my.server.com/userfiles/image/image%201.jpg ... My next step is to copy these images across to the second server and translate the tags in the html files. I understand that sed is probably the tool I would need. E.g.: sed 's/[^"]\+userfiles[\/image]\?\/\([^"]\+\)/\/images\/\1/g' Should change http://my.server.com/userfiles/Another%20User1.jpg to /images/Another%20User1.jpg, but I cannot work out exactly how I would use the script. I.e. can I use it to update the files in place or do I need to juggle temporary files, etc. Then how can I ensure that the files are moved to the correct location on the second server

    Read the article

  • Is there a neater way to get the first occurrence of something?

    - by Phil H
    I have a list which contains a number of things: lista = ['a', 'b', 'foo', 'c', 'd', 'e', 'bar'] I'd like to get the first item in the list that fulfils a predicate, say len(item) > 2. Is there a neater way to do it than itertools' dropwhile and next? first = next(itertools.dropwhile(lambda x: len(x) <= 2, lista)) I did use [item for item in lista if len(item)>2][0] at first, but that requires python to generate the entire list first.

    Read the article

  • jquery function inside .ready

    - by phil
    Could anyone tell me why 'function()' right after .ready is needed to make the script work? <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").hide(); }); }); </script> </head> <body> <h2>This is a heading</h2> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button type="button">Click me</button> </body> </html>

    Read the article

  • getting active records to display as a plist

    - by phil swenson
    I'm trying to get a list of active record results to display as a plist for being consumed by the iphone. I'm using the plist gem v 3.0. My model is called Post. And I want Post.all (or any array or Posts) to display correctly as a Plist. I have it working fine for one Post instance: [http://pastie.org/580902][1] that is correct, what I would expect. To get that behavior I had to do this: class Post < ActiveRecord::Base def to_plist attributes.to_plist end end However, when I do a Post.all, I can't get it to display what I want. Here is what happens: http://pastie.org/580909 I get marshalling. I want output more like this: [http://pastie.org/580914][2] I suppose I could just iterate the result set and append the plist strings. But seems ugly, I'm sure there is a more elegant way to do this. I am rusty on Ruby right now, so the elegant way isn't obvious to me. Seems like I should be able to override ActiveRecord and make result-sets that pull back more than one record take the ActiveRecord::Base to_plist and make another to_plist implementation. In rails, this would go in environment.rb, right?

    Read the article

  • Hovering Div Shows a Hidden Div - Prototype

    - by phil
    I have three divs set up in the following way: <div class="outer-div"> <div class="inner1"></div> <div class="inner2" style="display:none;"></div> </div> I have the second inner div hidden via the inline style. What I am trying to accomplish is that when the outer div, or basically any of the content is hovered over then the inner2 would appear. I am unfamilar with Prototype and having a terrible time trying to get my head around it. Missing jQuery but this time around Prototype is totally required. Thanks in advance for any help!!

    Read the article

  • Do you employ any tools for managing technical debt?

    - by Phil.Wheeler
    The site I work with on a day-to-day basis has its share of shortcomings and we often make design decisions to "get us by right now" with the intention of fixing those up later. I've found that making the time to actually go back and fix them, let alone remembering what the full list of to-do items is can be challenging at best. Can you recommend any tools, resources or tricks that help you effectively manage your technical debt?

    Read the article

  • jQuery, wont change value but will change any othere attribute...

    - by Phil Jackson
    function send_mail( token, loader ) { $(".send_mail").bind( "click", function() { try{ var to = $(this).attr('ref'); var mail_form = $("#mail_form"); mail_form.find("li:eq(0) input").val("sdsds"); //mail_form.find("li:eq(0) input").attr("ref", "sdsds"); //mail_form.find("li:eq(0) input").attr("value", "sdsds"); $.fancybox(mail_form.html(), { 'autoDimensions' : false, 'width' : 360, 'height' : 200, 'transitionIn' : 'none', 'transitionOut' : 'none', 'scrolling' : 'no', 'showCloseButton' : false }); return false; }catch(err){alert(err);} }); } My problem being that the above will not work yet if I use //mail_form.find("li:eq(0) input").attr("ref", "sdsds"); it will change the ref and even //mail_form.find("li:eq(0) input").attr("value", "sdsds"); will not work... Any ideas whats happening here?

    Read the article

  • Unusual conversion error (string to integer) asp.net

    - by Phil
    I have my repeater item template: <ItemTemplate> <tr><td><%#Container.DataItem("Category")%></td></tr> </ItemTemplate> Hooked up to: s = "SQL that works ok on server" x = New SqlCommand(s, c) x.Parameters.Add("@contentid", SqlDbType.Int) x.Parameters("@contentid").Value = contentid c.Open() r = x.ExecuteReader If r.HasRows Then Linksrepeater.DataSource = r Linksrepeater.DataBind() End If c.Close() r.Close() When I run the code I get: Invalid Cast Exception was not handled by user code (Conversion from string "category" to type 'Integer' is not valid.) I'm not sure how / why it is trying to convert "Category" to integer as in the db it is a string. Can you please tell me how to avoid this error? thanks.

    Read the article

  • Will my shared variables loose value? (asp.net vb)

    - by Phil
    I have a class includes.vb that holds some variables (sharing them with other pages) like: Public Shared pageid As Integer = 0 I then have a function that does some work with these variables returning them with values; Return pageid When I step through the code, the variables have values (while stepping through the function), but when they are returned to the page, they come back null. Do they loose value everytime a page is loaded? Can you suggest an alternative method? Thanks a lot.

    Read the article

  • Show/Hide divs with same class - jquery

    - by phil
    Hello, I have 1 div that will contain 3-5 divs with the same class. Below the div is an anchor. I would like for when this anchor is clicked it will hide the first div and then show the second. Another click would show the next and so on. I have set display:none on all divs but the first so only one is currently showing. I just can't figure out how to hide the first and then show the second, then third, then next when clicking the anchor. <div class="container-div"> <div class="inner-div">...</div> <div class="inner-div" style="display:none;">...</div> <div class="inner-div" style="display:none;">...</div> <a href="#" class="more">More</a> </div> So when the more anchor is clicked it would show one inner-div one at a time. Any suggestions or ideas would be greatly appreciated. Also, I would like to use jquery to accomplish this.

    Read the article

  • fancybox - passing 'this' to onClosed function

    - by Phil Jackson
    Hi this is probly really simple but I juast cant seem to figure it out! if( is_logged_out( html ) ) { var throughClick = $(this); $.fancybox( html, { 'autoDimensions' : false, 'width' : 'auto', 'height' : 'auto', 'transitionIn' : 'none', 'transitionOut' : 'none', 'hideOnOverlayClick' : false, 'showCloseButton' : false, 'onClosed' : function( throughClick ) { alert(throughClick.attr('name')); throughClick.trigger('click'); } }); }else{ All i want to do is pass the object of whichever button or link that was clicked, so once the user has logged back in it will process again. Any help is much appreciated.

    Read the article

  • Make these 2 sql statements into one with the same functionality

    - by Phil
    I have sql statement one; select linkscat.id, linkscat.category from linkscat, contentlinks, links where contentlinks.linksid = links.id and contentlinks.contentid = @contentid and links.linkscatid = linkscat.id order by linkscat.category and sql statement 2 takes a parameter called @linkscat which is 'id' from the statement above; select * from links where linkscatid= @linkscat I'm running into all types of trouble trying to use many sqldatareaders, nested repeaters etc, but it would be great if all the work could be done in the one statement? Is this possible and if so please can you help by posting the final statement? Thanks greatly, any help much appreciated!

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >