Search Results

Search found 1280 results on 52 pages for 'bill yang'.

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

  • [PHP] access array element by value

    - by Brandon
    array( [0] name => 'joe' size => 'large' [1] name => 'bill' size => 'small' ) I think i'm being thick, but to get the attributes of an array element if I know the value of one of the keys, I'm first looping through the elements to find the right one. foreach($array as $item){ if ($item['name'] == 'joe'){ #operations on $item } } I'm aware that this is probably very poor, but I am fairly new and am looking for a way to access this element directly by value. Or do I need the key? Thanks, Brandon

    Read the article

  • TypeInitilazationException When Getting an NHibernate Session

    - by Paul Johnson
    I’ve run into what appears to be an NHibernate config problem. Basically, I ran up a simple proof of concept persistence integration test using NUnit, the test simply querys an Oracle database and successfully returns the last record received by the underlying table. However, when the assemblies are taken out of the NUnit test environment and deployed as they would be for an actual application build, my call for an NHibernate session results in a ‘TypeInitializationException’ whilst executing the code line: sessionFactory = New Configuration().Configure().BuildSessionFactory() The application is a vb.net console app running against an Oracle 9.2 database, using a ‘coding framework’ published on the web by Bill McCafferty entitled 'NHibernate Best Practices with ASP.NET' (pre S#harp Architecture). I am running version 2.1.2.4000 of NHibernate. Any assistance much appreciated. Kind Regards Paul J.

    Read the article

  • warning in Eclipse

    - by lego69
    hello, I have some problems with Eclipse, I have structure struct Account{ const char* strLastName; //Client's last name const char* strFirstName; //Client's first name int nID; //Client's ID number int nLines; //Number of lines related to account double lastBill; //Client's last bill for all lines List linesDataBase; }; And I can't compile my code eclipse gives me an errors: Syntax error before List no semicolon at end of struct or union ISO does not allow extra ";" outside a function I have no idea how to change it, thanks in advance for any help

    Read the article

  • how to avoid returning mocks from a mocked object list

    - by koen
    I'm trying out mock/responsibility driven design. I seem to have problems to avoid returning mocks from mocks in the case of finder objects. An example could be an object that checks whether the bills from last month are paid. It needs a service that retrieves a list of bills for that. So I need to mock that service that retrieves the bills. At the same time I need that mock to return mocked Bills (since I don't want my test to rely on the correctness bill implementation). Is my design flawed? Is there a better way to test this? Or is this the way it will need to be when using finder objects (the finding of the bills in this case)?

    Read the article

  • Domain-driven design with Zend

    - by mik
    This question is a continuation of my previous question here http://stackoverflow.com/questions/2122850/zend-models-architecture (big thanks to Bill Karwin). I've made some reading including this article http://weierophinney.net/matthew/archives/202-Model-Infrastructure.html and this question http://stackoverflow.com/questions/373054/how-to-properly-create-domain-using-zend-framework Now I understand, what domain driven design is. But examples are still very simple and poor. They are based on one table and one model. Now, my question is: do they use Domain Model Design in real-world PHP projects? I've been looking for some good documentation about this, but I haven't found anything good enough, that explains how to manage several tables and transfer them to Domain Objects. As long as I know, there is Hibernate library, that has this features in Java, but what should I use in PHP (Zend Framework)?

    Read the article

  • Choice of programming language for learning data structures and algorithms

    - by bguiz
    Which programming language would you recommend to learn about data structures and algorithms in? Considering the follwing: Personal experience Language features (pointers, OO, etc) Suitability for learning DS & A concepts I ask because there are some books out there that are programming language-agnostic (written from a Mathematical perspective, and use pseudocode). If I learn from one of these I would like to work out the algorithms in a chosen language. Then, there are other books which introduce DS & A concepts with examples in a particular programming laguage - and I would follow these examples as well. Either way, I have to choose a language, and I would like to stick to one throughout. Which one best fits the bill.

    Read the article

  • Embedded web server and gui framework for .NET applications

    - by Toad
    Hi, I'm looking for a framework which allows me to manage my application through a webbased GUI (using an embedded webserver) instead of winforms. Something like this: http://www.webtoolkit.eu/wt but then for .NET In my code I should be able to instantiate classes (like buttons, forms etc), and when a user browses to a given port, the app should render it as javascript/ajax etc etc. preferably, when buttons are pushed, a notification in my code should be called. this is a less specific question than another one I posted about extjs. I hope this will attract more viewers since it is more generic Thanks. Update: cassini like solutions don't fit the bill. Since the webbrowser is embedded in my application, there is no need for ASP.NET server side scripts. I would rather have the framework, call functions inside my application when things happen on the page. onButtonClicked() for instance.

    Read the article

  • I have Following code but rest of it how?

    - by Hakan
    I have following code which is putting value of text box to table but i can't manage how to delete record. Can someone help me about it? Dim meter As DataTable = Me.DataSet1.Tables.Item("tblmeter") Dim row As DataRow = meter.NewRow() row.Item("No") = Me.txtno.Text row.Item("Turnover") = Me.txtturnover.Text row.Item("Total Win") = Me.txttotalwin.Text row.Item("Games Played") = Me.txtgamesplayed.Text row.Item("Credit In") = Me.txtcreditin.Text row.Item("Bill In") = Me.txtbillin.Text row.Item("Hand Pay") = Me.txthandpay.Text row.Item("Date") = DateTime.Today.ToShortDateString meter.Rows.Add(row) Me.TblMeterTableAdapter.Update(Me.DataSet1.tblMeter) meter.AcceptChanges() Dim table As DataTable = Me.DataSet1.Tables.Item("tblmeter") Dim defaultView As DataView = table.DefaultView Dim cell As New DataGridCell((defaultView.Table.Rows.Count - 1), 1) Me.DataGrid1.CurrentCell = cell txtno.Text = "" txtturnover.Text = "" txttotalwin.Text = "" txtgamesplayed.Text = "" txtcreditin.Text = "" txtbillin.Text = "" txthandpay.Text = "" txtno.Focus() I am using following code but it's not update records. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim current As DataRowView = DirectCast(Me.BindingContext.Item(Me.DataSet1.Tables.Item("tblmeter")).Current, DataRowView) current.Delete() Me.DataSet1.tblMeter.AcceptChanges() Me.TblMeterTableAdapter.Update(Me.DataSet1.tblMeter) End Sub Code deletes records from datagrid but not updating. Any help

    Read the article

  • better way to write this

    - by ash34
    Hi, I have to create a hash of the form h[:bill] = ["Billy", "NA", 20, "PROJ_A"] by login where 20 is the cumulative number of hours reported by the login for all task transactions returned by the query where each login has multiple reported transactions. Did I do this in a bad way or this seems alright. h = Hash.new Task.find_each(:include => [:user], :joins => :user, :conditions => ["from_date >= ? AND from_date <= ? AND category = ?", Date.today - 30, Date.today + 30, 'PROJ1']) do |t| h[t.login.intern] = [t.user.name, 'NA', h[t.login.intern].nil? ? (t.hrs_per_day * t.num_days) : h[t.login.intern][2] + (t.hrs_day * t.workdays), t.category] end Also if I have to aggregate not just by login but login and category how do I accomplish this? thanks, ash

    Read the article

  • Prepare and import data into existing database

    - by Álvaro G. Vicario
    I maintain a PHP application with SQL Server backend. The DB structure is roughly this: lot === lot_id (pk, identify) lot_code building ======== buildin_id (pk, identity) lot_id (fk) inspection ========== inspection_id (pk, identify) building_id (fk) date inspector result The database already has lots and buildings and I need to import some inspections. Key points are: It's a one-time initial load. Data comes in an Excel file. The Excel data is unaware of DB autogenerated IDs: inspections must be linked to buildings through their lot_code What are my options to do such data load? date inspector result lot_code ========== =========== ======== ======== 31/12/2009 John Smith Pass 987654X 28/02/2010 Bill Jones Fail 123456B

    Read the article

  • Passing single attributes to associated factories

    - by lambdabutz
    I'm looking for a way to pass fields into the factories of associated models without having to explicitly call the factory itself. For example, lets say I have some factories like so: Factory.define :person do |person| person.name "Default Bob" person.sex "M" person.house {|p| p.association(:house)} end Factory.define :house do |house| house.color "Red" house.has_ac true house.suburb {|h| h.association(:suburb)} end Factory.define :suburb do |suburb| suburb.name "Little boxes" end This is fine and all, but if I want to use factories to create someone in a specific house in a specific suburb I have do this: sub = Factory(:suburb, :name => "Blue town") house = Factory(:house, :color => "Blue", :suburb => sub) person = Factory(:person, :name => "Bill", :house => house) While this isn't bad in this small case, my actual models sometimes have 7 or 8 associations, and when I want to create an object whose associations I only care about a single attribute, the code for this starts to get really heavy. Is there somewhat I can pass attributes to nested Factories without having to recall the Factory itself?

    Read the article

  • Script to Copy User according to UID

    - by bradlis7
    I'm looking for a way to copy all non-system users from one PC to another. I can get the group and passwd files copied over using this awk -F":" ' $3 > 499 ' etc/passwd >> /etc/passwd awk -F":" ' $3 > 499 ' etc/group >> /etc/group But, how would I go about getting the shadow file copied over since it does not store the UID? Assume that there are over 1000 users, so doing a grep with the usernames, such as egrep '(bob|bill|sarah|sal):' etc/shadow >> /etc/shadow generating the usernames from the awk code above, would be a bit inefficient, but a possible option.

    Read the article

  • How do I return pure XML from asmx web service?

    - by User
    I want an asmx webservice with a method GetPeople() that returns the following XML (NOT a SOAP response): <People> <Person> <FirstName>Sara</FirstName> <LastName>Smith</LastName> </Person> <Person> <FirstName>Bill</FirstName> <LastName>Wilson</LastName> </Person> <People/> How can I do this?

    Read the article

  • How to decomment an html/php webpage?

    - by Sam
    A crazy question: Imagine a webpage file called somepage.php And it contains some html php contents in my editor I see: <html><head></head><body> <?=$welcome . $essay . $thatsAllForNowFolks . $footer ?> <!-- Blue Ball Bell Blow Bows Bats Beef Bark Bill Boss --> </body></html> When I browse my site I see those comments in the final result, while I only want that comment to be only in my editor for my secretive inspirations and don't want the whole world to know what I'm thinking when I'm developing, as well as I see those comments for any and all my website visitors as wasted bandwitch of internet speed. How do I decomment my entire html/php files at the moment the html is served? Ideas, code and suggestions are much appreciated. My thanks in advance...

    Read the article

  • How do I get a count of events each day with SQL?

    - by upl8
    I have a table that looks like this: Timestamp Event User ================ ===== ===== 1/1/2010 1:00 PM 100 John 1/1/2010 1:00 PM 103 Mark 1/2/2010 2:00 PM 100 John 1/2/2010 2:05 PM 100 Bill 1/2/2010 2:10 PM 103 Frank I want to write a query that shows the events for each day and a count for those events. Something like: Date Event EventCount ======== ===== ========== 1/1/2010 100 1 1/1/2010 103 1 1/2/2010 100 2 1/2/2010 103 1 The database is SQL Server Compact, so it doesn't support all the features of the full SQL Server. The query I have written so far is SELECT DATEADD(dd, DATEDIFF(dd, 0, Timestamp), 0) as Date, Event, Count(Event) as EventCount FROM Log GROUP BY Timestamp, Event This almost works, but EventCount is always 1. How can I get SQL Server to return the correct counts? All fields are mandatory.

    Read the article

  • Eliminating matching values in a SQL result set

    - by Burgess Taylor
    I have a table with a list of transactions (invoices and credits) and I need to get a list of all the rows where the invoices and credits don't match up. eg user product value bill ThingA 200 jim ThingA -200 sue ThingB 100 liz ThingC 50 I only want to see the third and fourth rows, as the values of the others match off. I can do this if I select product, sum(value) ... group by product having sum(value) < 0 which works well, but I want to return the user name as well. As soon as I add the user to the select, I need to group by it as well, which messes it up as the amounts don't match up by user AND product. Any ideas ? I am using MS SQL 2000... Cheers

    Read the article

  • C# XML Serialisation Only Serialise Single Element in List

    - by guazz
    Given some sample XML such as: <XML> <EMPLOYEES> <EMPLOYEE isBestEmployee="false">John"<"/EMPLOYEE> <EMPLOYEE isBestEmployee="true">Joe"<"/EMPLOYEE> <EMPLOYEE isBestEmployee="false">Bill"<"/EMPLOYEE> </EMPLOYEES> </XML> How do I serialise just the employee with isBestEmployee="true" to a single Employee object?

    Read the article

  • Wavefront obj loader iphone materials problem

    - by Magda
    Hi! I use Bill Duney wavefront obj loader. I'm new in opengles and it was really helpful. unfortunately... I exported a revit file to dwg and then open it with blender/google sketchUp and then to wavefront obj. Next, add my files to your loader and got strange results. The project load correctly vertex and normals but does a strange results with materials (I use only material, without textures). The one file is loaded with some materials on different faces the other, doesn't load materials but after a click makes the model green. If you have a minute and could help me out, please. I uploaded the project here. http://www.sendspace.pl/file/ecd348a3674ed1fe6eb10e5 Thanks for answering, Magda

    Read the article

  • Can I prevent iPhone from using 3G under any circumstances?

    - by dageshi
    I'm writing a travel guide related app that will download large databases (60meg) potentially overseas, with the reachability code I can tell when a host is reachable via wifi or 3g BUT I'm worried that if for some reason the wifi connection breaks for a minute or so as some DSL connections are likely to do on occasion the iphone will switch transparently to 3G and without realising I could be racking up someones phone bill with overseas data charges! So I'm wondering if anyone has any experience, in the event of such break in wifi connectivity (wifi still works but it's connection to the net is down) would the reachability code report ReachableViaWWAN? So I could wait till my download code returns, check how the host is currently reachable and if it's via 3g I could abort? Is it possible to select what type of connection I can use aka 3g or wifi exclusively?

    Read the article

  • Recursion Interview Questions [closed]

    - by halivingston
    Given a string, "ABC", print all permutations Given a dollar bill, fill out possible ways it can summed up using .25, .10, .5, etc. Given a phone number (123-456), print out all it's word counter parters like (ADG-XYZ) A B C D E F G H I J K L M N O P In the above 2D matrix, print all possible words (just literally all words, and sure we could check if it's exists in a dictionary). The base case is I think here is that reaching the same i, j positions. Any others you can think of?

    Read the article

  • rails rollback updates when task fails

    - by ash34
    Hi, I have the following "generate_report" method being called from a rake task, which gets a hash as an input, that contains the reported hours spent by each user on a task and outputs the data as a .csv report. desc "Task reporting" task :report, [:inp_dt] => [:environment] do |t, args| h = select_data(args.inp_dt) /* not shown here */ generate_report(h) end def generate_report(h) out_dir = File.dirname(__FILE__) + '/../../output' myfile = "#{out_dir}" + "/monthly_#{Date.today.strftime("%m%d%Y")}.csv" writer = CSV.open(myfile, 'w') h.each do |h,v| v.each do |key,val| writer << val end end writer.close end where h = {:BILL=>{:PROJA=>["CYR", "00876", "2", 24], :PROJB=>["EPR", "00876", "2", 16]}, :JANE=>{:PROJA=>["TRB", "049576", "2", 16]}} I would like to set/update a 'processed' flag for each reported transaction and only commit the update when the file is written correctly or rollback the updates when the task fails. How can I accomplish this. thanks, ash

    Read the article

  • Regular Expression .net flavor

    - by user1440109
    Dont ask how this works but currently it does ("^\|(.?)\|*$")....kinda. This removes all extra pipes...part one....I have searched all over no anwser yet. I am using VB2011 beta...asp web form......vb coding though! I want to capture special character pipe (|) which is used to seperate words...i.e. car|truck|van|cycle problem is users lead with, trail with, use multiple, and use spaces before and after...i.e. |||car||truck | van || cycle. another example: george bush|micheal jordon|bill gates|steve jobs <-- this would be correct but when I do remove space it takes correct space out. so I want to get rid of whitespace leading, trailing, any space before | and space after | and only allow one pipe (|)....in between alphanumeric of course.

    Read the article

  • Is NoSQL ideal to store stats?

    - by Ivan
    I'm not terribly familiar with NoSQL systems, but I remember reading a while back that they are ideal to handle statistical data. Since I'm about to start writing code that will record data like "how many users were registered on each day", I was thinking I could use this as an opportunity to learn more about NoSQL if it fits the bill. If NoSQL is indeed ideal for this, could you provide me with some information as to why? And which specific systems are best suited for this particular need? Thanks!

    Read the article

  • rails data aggregation

    - by ash34
    Hi, I have to create a hash of the form h[:bill] = ["Billy", "NA", 20, "PROJ_A"] by login where 20 is the cumulative number of hours reported by the login for all task transactions returned by the query where each login has multiple reported transactions. Did I do this in a bad way or this seems alright. h = Hash.new Task.find_each(:include => [:user], :joins => :user, :conditions => ["from_date >= ? AND from_date <= ? AND category = ?", Date.today - 30, Date.today + 30, 'PROJ1']) do |t| h[t.login.intern] = [t.user.name, 'NA', h[t.login.intern].nil? ? (t.hrs_per_day * t.num_days) : h[t.login.intern][2] + (t.hrs_day * t.workdays), t.category] end Also if I have to aggregate this data not just by login but login and category how do I accomplish this? thanks, ash

    Read the article

  • Multi join query returns to many results and improperly matched

    - by Woot4Moo
    I have the following minimal schema in Oracle: http://sqlfiddle.com/#!4/c1ed0/14 The queries I have run yield too many results and this query: select cat.*, status.*, source.* from cats cat, status status, source source Left OUTER JOIN source source2 on source2.sourceid = 1 Right OUTER JOIN status status2 on status2.isStray =0 order by cat.name will yield incorrect results. What I am expecting is a table that looks like the following however I cannot seem to come up with the correct SQL. NAME AGE LENGTH STATUSID CATSOURCE ISSTRAY SOURCEID CATID Adam 1 25 null null null 1 2 Bill 5 1 null null null null null Charles 7 5 null null null null null Steve 12 15 1 1 1 1 1 In plain English what I am looking for is to return all known cats + their associated cat source + their cat status while retaining null values. The only information I will have is the source that I am curious about. I also only want the cats that have a status of either STRAY or UNKNOWN (null)

    Read the article

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