complex

Linq duplicate removal with a twist

I got a list that contains al the status items of each order. The problem that i have is that i need to remove all the items of which the status -> logdate combination is not the highest. e.g var inputs = new List<StatusItem>(); //note that the 3th id is simply a modifier that adds that amount of secs //to the c...

Php deliberately awkward?

I'm trying to create a login process (as people who have answered my previous question will know) But it seems impossible to create one process that will work with a desktop app and a standard website. Instead I have the login function in Usermanagement.php (which is a class, icyntk) but then in another php file (api/login.php) I have:...

Multiplying complex with constant in C++

The following code fails to compile #include <iostream> #include <cmath> #include <complex> using namespace std; int main(void) { const double b=3; complex <double> i(0, 1), comp; comp = b*i; comp = 3*i; return 0; } with error: no match for ‘operator*’ in ‘3 * i’ What is wrong here, why cannot I multiply w...

complex sql which runs extremely slow when the query has order by clause

I have following complex query which I need to use. When I run it, it takes 30 to 40 seconds. But if I remove the order by clause, it takes 0.0317 sec to return the result, which is really fast compare to 30 sec or 40. select DISTINCT media.* , username from album as album , album_permission as permission , user a...

PHP , How can I get values out of a complex array ?

I am calling a soap function that returns the following array: Array ( [FastAddressResult] => Array ( [IsError] => false [ErrorNumber] => 0 [ErrorMessage] => [Results] => Array ( [Address] => Array ( [Id] => 13872147.00 [OrganisationName] => [DepartmentName] => [Line1] => Methley Grove [Line2] => [Line3] => [Line4] => [Line5] => [PostT...

mysql complex key or + auto increment key (guid)

Hi, I have not very big db. I am using auto increment primary keys and in my case there is no problem with that. GUID is not necessary. I have a table containing this fields: from_destination to_testination shipper quantity Where the fields 1,2,3 needs to be unique. Also I have second table that for the fields 1,2,3 stores bought q...

ASP.net MVC - Update Model on complex models

Hi there, I'm struggling myself trying to get the contents of a form which is a complex model and then update the model with that complex model. My account model has many individuals [AcceptVerbs(HttpVerbs.Post)] public ActionResult OpenAnAccount(string area,[Bind(Exclude = "Id")]Account account, [Bind(Prefix="Account.Individuals")] En...

Parsing Complex Text File with C#

Hello, I need to parse a text file that has a lot of levels and characters. I've been trying different ways to parse it but I haven't been able to get anything to work. I've included a sample of the text file I'm dealing with. Any suggestions on how I can parse this file? I have denoted the parts of the file I need with TEXTINEED. (...

Defining a Class in Objective C, XCode

Hello; I am new to Objective C, and am trying to write a class that defines a complex number. The code seems fine but when I print to the console, my values for instance variables are 0. Here is the code: // // ComplexNumber.h // Mandelbrot Set // // Created by Brett on 10-06-02. // Copyright 2010 __MyCompanyName__. All rights res...

is there a design pattern for complex aspnet UI validation?

As an example, say I have a single domain object with 100 properties. In my UI I need complex validation of the style: If A = 1, show controls B, C, D. B is required, C is not, and D is not required must be less than 30 if it is populated. If A = 2, show controls B, D, E. B is not required, D is required but has no limits, and E is ...

WPF simple property vs. complex property

Hi! In WPF it's better to create a property "complex" (i.e. of type "Visibility") or a property simple (i.e. of type boolean) and then using a converter to bind the property? The first way is shorter to write, but I don't know what is better about the performances. Thank you! Pileggi ...

Need help using json-framework on iPhone

So I've got json-framework up and running on my project, but need help figuring out how to use it to parse this json string: [ { "id":"0", "name":"name", "info":"This is info", "tags":[ { "id":"36", "tag":"test tag" }, { "id":"37", "tag":" tag 2" } ], "other":"nil" }, { "id":"1", "name":"name", "info":"This is info", "tags":[ { "id":"36...

Determinant of a complex matrix in R

Is there a way to calculate the determinant of a complex matrix? F4<-matrix(c(1,1,1,1,1,1i,-1,-1i,1,-1,1,-1,1,-1i,-1,1i),nrow=4) det(F4) Error in determinant.matrix(x, logarithm = TRUE, ...) : determinant not currently defined for complex matrices library(Matrix) determinant(Matrix(F4)) Error in Matrix(F4) : complex matrices not...

Django-models. Complex request to database.

I need to make special request to database through django. For example: class Model(models.Model): name=models.CharField() date=models.DateTimeField() other=models.TextField() How do I ask for row which name containe word 'Hello' (it shoul ignor register of first letter) end it is must be in diapason of date, for exam...

Proper Approach to Unit testing a "complex" application service

I have an application service (ie. large method) responsible for coordinating the interaction between several business objects. Essentially it takes a DTO from one system which contains customer information and an invoice, and translates it and imports it into a different system based on various business rules. public void ProcessQueue...

iPhone -- working with complex numbers

I'm trying to figure out the best way to put complex numbers into my math-oriented iPhone app. I've found the mac osx manual page for complex numbers, which looks like a reasonable start. Three questions: (1) Is this the best starting point? (2) I will need an object-oriented wrapper -- can NSValue do this somehow? Or should I just...

Parse google reverse geocode json on iphone

I'm using json-framework to parse some simple json in my iphone app, and it works fine. But now I'm needing to parse the json from google's reverse geo-coder which is very complex and really big. The json output can be seen here: http://maps.google.com/maps/geo?q=40.714224,-73.961452&amp;output=json&amp;sensor=true_or_false I'm trying t...

developing complex website

Hello guys, I am an average developer who can program in php,ajax(jquery), mysql, html, css I'd am to develop a web2 standard university portal website with the following features fees payment, course registration viewing results online etc. easy adding of modules later (eg taking test online) These are the technologies and conside...

TSQL how do you insert rows from a table returned by function for each values in another table?

Hello, sorry for the poorish description it is really hard to explain what I am trying to do. But this is some pseudo: foreach (row in Table1) insert Table2 select * from getValuesTable('text', row.Column1) I'm not too sure how to get that initial join together because it will not allow me to alias the returned table from getValue...

Finding correct php regex for this complex element

Hi since hours im trying to get a regex which is able to find the following part in a string. [TABLE|head,border|{ #TEXT|TEXT|TEXT# TEXT|TEXT|TEXT TEXT|TEXT|TEXT TEXT|TEXT|TEXT }] Its from a simple self made WYSIWYG Editor, which gives the possibility to add tables. But the "syntax" for a table should be as simple as the one above. N...