Search Results

Search found 1725 results on 69 pages for 'equation solving'.

Page 58/69 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • How to handle people who lie on their resume

    - by Juliet
    I'm conducting technical interviews to fill a few .NET positions. Many of the people I interview really do know .NET pretty well, but I find at least 90% of embellish their skillset anywhere between "a little" and "quite drastically". Sometimes they fabricate skills relevant to the position they're applying for, sometimes they not. Most of the people I interview, even the most egregious liars, are not scam artists. They just want to stand out among the crowd, so they drop a few buzzwords on their resume like "JBoss", "LINQ", "web services", "Django" or whatever just to pad their skillset and stay competitive. (You might wonder if a person lies about those skills, whether they are just bluffing their way through a technical interview. My interviews involve a lot of hands-on coding and problem-solving -- people who attempt to bluff will bomb the hands-on coding portion in the first 3 minutes.) These are two open-ended questions, but it would really help me out when I make my recommendations to the hiring managers: 1) Regarding interviewing etiquette, should I attempt to determine whether a person really possesses all of the skills they claim to have? Can I do this without making the candidate feel uncomfortable? 2) Regarding the final decision, should I recommend candidates who are genuinely qualified for the positions they're applying for, even if they've fabricated portions of their skillset?

    Read the article

  • How can I correctly calculate the direction for a moving object?

    - by Jakub Hampl
    I'm solving the following problem: I have an object and I know its position now and its position 300ms ago. I assume the object is moving. I have a point to which I want the object to get. What I need is to get the angle from my current object to the destination point in such a format that I know whether to turn left or right. The idea is to assume the current angle from the last known position and the current position. I'm trying to solve this in MATLAB. I've tried using several variations with atan2 but either I get the wrong angle in some situations (like when my object is going in circles) or I get the wrong angle in all situations. Examples of code that screws up: a = new - old; b = dest - new; alpha = atan2(a(2) - b(2), a(1) - b(1); where new is the current position (eg. x = 40; y = 60; new = [x y];), old is the 300ms old position and dest is the destination point. Edit Here's a picture to demonstrate the problem with a few examples: In the above image there are a few points plotted and annotated. The black line indicates our estimated current facing of the object. If the destination point is dest1 I would expect an angle of about 88°. If the destination point is dest2 I would expect an angle of about 110°. If the destination point is dest3 I would expect an angle of about -80°.

    Read the article

  • How to handle building and parsing HTTP URL's / URI's / paths in Perl

    - by Robert S. Barnes
    I have a wget like script which downloads a page and then retrieves all the files linked in img tags on that page. Given the URL of the original page and the the link extracted from the img tag in that page I need to build the URL for the image file I want to retrieve. Currently I use a function I wrote: sub build_url { my ( $base, $path ) = @_; # if the path is absolute just prepend the domain to it if ($path =~ /^\//) { ($base) = $base =~ /^(?:http:\/\/)?(\w+(?:\.\w+)+)/; return "$base$path"; } my @base = split '/', $base; my @path = split '/', $path; # remove a trailing filename pop @base if $base =~ /[[:alnum:]]+\/[\w\d]+\.[\w]+$/; # check for relative paths my $relcount = $path =~ /(\.\.\/)/g; while ( $relcount-- ) { pop @base; shift @path; } return join '/', @base, @path; } The thing is, I'm surely not the first person solving this problem, and in fact it's such a general problem that I assume there must be some better, more standard way of dealing with it, using either a core module or something from CPAN - although via a core module is preferable. I was thinking about File::Spec but wasn't sure if it has all the functionality I would need.

    Read the article

  • HELP ME !! I am Not able to update form data to mysql using php and jquery

    - by Jimson Jose
    i tired and was unable to find the answer i am looking for an answer. my problem is that i am unable to update the values enterd in the form. I have attached all the files i'm using MYSQL database to fetch data. what happens is that i'm able to add and delete records from form using jquery and PHP scripts to MYSQL database, but i am not able to update data which was retrived from database. the file structure is as follows index.php is a file with jquery functions where it displays form for adding new data to MYSQL using save.php file and list of all records are view without refrishing page (calling load-list.php to view all records from index.php works fine, and save.php to save data from form) - Delete is an function called from index.php to delete record from mysql database (function calling delete.php works fine) - Update is an function called from index.php to update data using update-form.php by retriving specific record from mysql tabel, (works fine) Problem lies in updating data from update-form.php to update.php (in which update query is wrriten for mysql) i had tried in many ways at last i had figured out that data is not being transfred from update-form.php to update.php there is a small problem in jquery ajax function where it is not transfering data to update.php page. some thing is missing in calling update.php page it is not entering into that page I am new bee in programming i had collected this script from many forums and made this one.So i was limited in solving this problem i cam to know that this is good platform for me and many where we get a help to create new things.. please guide me with your help to complete my effors !!!!! i will be greatfull to all including ths site which gave me an oppurtunity to present my self..... please find the link below to download all files which is of 35kb (virus free assurance) download mysmallform files in ZIPped format, including mysql query thanks a lot in advance, May GOD bless YOU and THIS SITE

    Read the article

  • Comparing strings that contain formatting in C#

    - by Finglas
    I'm working on a function that given some settings - such as line spacing, the output (in string form) is modified. In order to test such scenarios, I'm using string literals, as shown below for the expected result. The method, using a string builder, (AppendLine) generates the said output. One issue I have run into is that of comparing such strings. In the example below, both are equal in terms of what they represent. The result is the area which I care about, however when comparing two strings, one literal, one not, equality naturally fails. This is because one of the strings emits line spacing, while the other only demonstrates the formatting it contains. What would be the best way of solving this equality problem? I do care about formatting such as new lines from the result of the method, this is crucially important. Code: string expected = @"Test\n\n\nEnd Test."; string result = "Test\n\n\nEnd Test"; Console.WriteLine(expected); Console.WriteLine(result); Output: Test\n\n\nEnd Test. Test End Test

    Read the article

  • How I May Have Taken A Wrong Path in Programming

    - by Ygam
    I am in a major stump right now. I am a BSIT graduate, but I only started actual programming less than a year ago. I observed that I have the following attitude in programming: I tend to be more of a purist, scorning unelegant approaches to solving problems using code I tend to look at anything in a large scale, planning everything before I start coding, either in simple flowcharts or complex UML charts I have a really strong impulse on refactoring my code, even if I miss deadlines or prolong development times I am obsessed with good directory structures, file naming conventions, class, method, and variable naming conventions I tend to always want to study something new, even, as I said, at the cost of missing deadlines I tend to see software development as something to engineer, to architect; that is, seeing how things relate to each other and how blocks of code can interact (I am a huge fan of loose coupling) i.e the OOP thinking I tend to combine OOP and procedural coding whenever I see fit I want my code to execute fast (thus the elegant approaches and refactoring) This bothers me because I see my colleagues doing much better the other way around (aside from the fact that they started programming since our first year in college). By the other way around I mean, they fire up coding, gets the job done much faster because they don't have to really look at how clean their codes are or how elegant their algorithms are, they don't bother with OOP however big their projects are, they mostly use web APIs, piece them together and voila! Working code! CLients are happy, they get paid fast, at the expense of a really unmaintainable or hard-to-read code that lacks structure and conventions, or slow executions of certain actions (which the common reasoning against would be that internet connections are much faster these days, hardware is more powerful). The excuse I often receive is clients don't care about how you write the code, but they do care about how long you deliver it. If it works then all is good. Now, did my "purist" approach to programming may have been the wrong way to start programming? Should I just dump these purist concepts and just code the hell up because I have seen it: clients don't really care how beautifully coded it is?

    Read the article

  • Is there any function in Matlab for changing the form of matrix?

    - by niko
    Hi, I have to get the unknown matrix by changing the form of known matrix considering the following rules: H = [-P'|I] G = [I|P] where H is known matrix G is unknown matrix which has to be calculated I is identity matrix So for example if we had a matrix H = [1 1 1 1 0 0; 0 0 1 1 0 1; 1 0 0 1 1 0] its form has to be changed to H = [1 1 1 1 0 0; 0 1 1 0 1 0; 1 1 0 0 0 1] so -P' = [1 1 1; 0 1 0; 1 1 0] and in case of binary matrices -P = P therefore G = [1 0 0 1 1 1; 0 1 0 0 1 0; 0 0 1 1 1 0] I know how to solve it on the paper by performing basic row operations but don't know how if there is any function already written in Matlab to calculate G from H or H from G by considering the above rules. I would be very thankful if anyone of you could suggest any method for solving the given problem. Thank you.

    Read the article

  • Managing StringBuilder Resources

    - by Jim Fell
    My C# (.NET 2.0) application has a StringBuilder variable with a capacity of 2.5MB. Obviously, I do not want to copy such a large buffer to a larger buffer space every time it fills. By that point, there is so much data in the buffer anyways, removing the older data is a viable option. Can anyone see any obvious problems with how I'm doing this (i.e. am I introducing more performance problems than I'm solving), or does it look okay? tText_c = new StringBuilder(2500000, 2500000); private void AppendToText(string text) { if (tText_c.Length * 100 / tText_c.Capacity > 95) { tText_c.Remove(0, tText_c.Length / 2); } tText_c.Append(text); } EDIT: Additional information: In this application new data is received very rapidly (on the order of milliseconds) through a serial connection. I don't want to populate the multiline textbox with this new information so frequently because that kills the performance of the application, so I'm saving it to a StringBuilder. Every so often, the application copies the contents of the StringBuilder to the textbox and wipes out the StringBuilder contents.

    Read the article

  • What should I do with an over-bloated select-box/drop-down

    - by Tristan Havelick
    All web developers run into this problem when the amount of data in their project grows, and I have yet to see a definitive, intuitive best practice for solving it. When you start a project, you often create forms with tags to help pick related objects for one-to-many relationships. For instance, I might have a system with Neighbors and each Neighbor belongs to a Neighborhood. In version 1 of the application I create an edit user form that has a drop down for selecting users, that simply lists the 5 possible neighborhoods in my geographically limited application. In the beginning, this works great. So long as I have maybe 100 records or less, my select box will load quickly, and be fairly easy to use. However, lets say my application takes off and goes national. Instead of 5 neighborhoods I have 10,000. Suddenly my little drop-down takes forever to load, and once it loads, its hard to find your neighborhood in the massive alphabetically sorted list. Now, in this particular situation, having hierarchical data, and letting users drill down using several dynamically generated drop downs would probably work okay. However, what is the best solution when the objects/records being selected are not hierarchical in nature? In the past, of done this with a popup with a search box, and a list, but this seems clunky and dated. In today's web 2.0 world, what is a good way to find one object amongst many for ones forms? I've considered using an Ajaxifed search box, but this seems to work best for free text, and falls apart a little when the data to be saved is just a reference to another object or record. Feel free to cite specific libraries with generic solutions to this problem, or simply share what you have done in your projects in a more general way

    Read the article

  • jQuery Syntax Error - Trying to detect viewport size and select background image to use w/CSS

    - by CuppyCakes
    Hi all. Please be gentle, I'm still learning. I imagine that the solution to my problem is simple and that perhaps I have just been in front of the computer too long. I am trying to detect the size of the viewport, and then use a different sized image for a background on an element depending on the size of the viewport. Here is what I have so far: $(document).ready(function(){ var pageWidth = $(window).width(); if ( pageWidth <= 1280 ) { $('#contact').css('background-image', 'url(../images/contact_us_low.jpg)'); } elseif ( pageWidth > 1280 ) { $('#contact').css('background-image', 'url(../images/contact_us_high.jpg)'); } }); Error: missing ; before statement [Break on this error] elseif ( pageWidth 1280 ) {\n (Line 7) To me it seems like all of my semi-colons are in the right place. Two questions: Am I going about solving the problem in a sensible way? To me a simple conditional should solve this background problem, as the code is merely selecting between two images based on what size it detects the viewport to be. Can you please help point out my n00b syntax error? Sometimes it really does help to have an extra pair of eyes look at something like this, even if small. Thank you kindly for your advice, I will continue poking and perusing the docs I have available to me.

    Read the article

  • Use MySQL trigger to update another table when duplicate key found

    - by Jason
    Been scratching my head on this one, hoping one of you kind people and direct me towards solving this problem. I have a mysql table of customers, it contains a lot of data, but for the purpose of this question, we only need to worry about 4 columns 'ID', 'Firstname', 'Lastname', 'Postcode' Problem is, the table contains a lot of duplicated customers. A new table is being created where each customer is unique and for us, we decide a unique customer is based on 'Firstname', 'Lastname' and 'Postcode' However, (this is the important bit) we need to ensure each new "unique" customer record also can be matched to the original multiple entries of that customer in the original table. I believe the best way to do this is to have a third table, that has 'NewUniqueID', 'OldCustomerID'. So we can search this table for 'NewUniqueID' = '123' and it would return multiple 'OldCustomerID' values where appropriate. I am hoping to make this work using a trigger and the on duplicate key syntax. So what would happen is as follows: An query is run taking the old customer table and inserting it in to the new unique table. (A standard Insert Select query) On duplicate key continue adding records, but add one entry in to the third table noting the 'NewUniqueID' that duped along with the 'OldCustomerID' of the record we were trying to insert. Hope this makes sense, my apologies if it isn't clear. I welcome and appreciate any thoughts on this one! Many thanks Jason

    Read the article

  • Static and Dynamic Scooping Problem

    - by Devyn
    Hi, I'm solving following code in Static and Dynamic Scooping. I got following answer but I need someone to confirm if I'm correct or not since I'm a bit confusing. I really appreciate if anyone can explain in simple way! Static => (1)8 (2)27 Dynamic => (1)10 (2)27 proc main var x,y,z; proc sub1 var x,z x := 6; z := 7; sub2; x := y*z + x; print(x); ---- (2) end; proc sub2 var x,y x := 1; y := x+z+2; print(y); ---- (1) end; begin x := 1; y:=3; z:=5; sub1; end

    Read the article

  • Creating Binary Block from struct

    - by MOnsDaR
    I hope the title is describing the problem, i'll change it if anyone has a better idea. I'm storing information in a struct like this: struct AnyStruct { AnyStruct : testInt(20), testDouble(100.01), testBool1(true), testBool2(false), testBool3(true), testChar('x') {} int testInt; double testDouble; bool testBool1; bool testBool2; bool testBool3; char testChar; std::vector<char> getBinaryBlock() { //how to build that? } } The struct should be sent via network in a binary byte-buffer with the following structure: Bit 00- 31: testInt Bit 32- 61: testDouble most significant portion Bit 62- 93: testDouble least significant portion Bit 94: testBool1 Bit 95: testBool2 Bit 96: testBool3 Bit 97-104: testChar According to this definition the resulting std::vector should have a size of 13 bytes (char == byte) My question now is how I can form such a packet out of the different datatypes I've got. I've already read through a lot of pages and found datatypes like std::bitset or boost::dynamic_bitset, but neither seems to solve my problem. I think it is easy to see, that the above code is just an example, the original standard is far more complex and contains more different datatypes. Solving the above example should solve my problems with the complex structures too i think. One last point: The problem should be solved just by using standard, portable language-features of C++ like STL or Boost (

    Read the article

  • "Exception in thread "main" java.lang.NoSuchMethodError Do i miss library in the installed JDk?

    - by Ahmad
    Hello every body I was using the JDK very well writing the code then i use "javac" to compile it then "java" to run it But Recently when i write a code and compile it then if i try to run it this exception appears to me "Exception in thread "main" java.lang.NoSuchMethodError " at first i thought there is something wrong in my code , i searched in the internet for a solving for this problem but i didn't find anything may help me Then i try to run the "HelloWorld" example i made it before, it runs i copied the code and pasted it in another file and changed the name to "HelloWorld2" and compile it by "javac" and tried to run it by "java" the same exception appears i was surprised why? it is the same code then i used the "javap" which decompile the code with both i found this difference in the first one (the old one) "public static void main(java.lang.String[])"; but in the second (the new one) "public static void main(String[])"; without java.lang then i compiled the old one which works and runs by "javac" and when i try to run it, it didn't run and give me the same exception i tried with some of my old codes it run and when i compile it by "javac" it doesn't work I searched to find a solution to this problem and i found nothing

    Read the article

  • How do I send data between two computers over the internet

    - by Johan
    I have been struggling with this for the entire day now, I hope somebody can help me with this. My problem is fairly simple: I wish to transfer data (mostly simple commands) from one PC to another over the internet. I have been able to achieve this using sockets in Java when both computers are connected to my home router. I then connected both computers to the internet using two different mobile phones and attempted to transmit the data again. I used the mobile phones as this provides a direct route to the internet and if I use my router I have to set up port forwarding, at least, that is how I understand it. I think the problem lies in the method that I set up the client socket. I used: Socket kkSocket = new Socket(ipAddress, 3333); where ipAddress is the IP address of the computer running the server. I got the IP address by right-clicking on the connection, status, support. Is that the correct IP address to use or where can I obtain the address of the server? Also, is it possible to get a fixed name for my computer that I can use instead of entering the IP address, as this changes every time I connect to the internet using my mobile phone? Alternatively, are there better methods to solving my problem such as using http, and if so, where can I find more information about this? Thanks!

    Read the article

  • How to determine the width of content or size a container to content

    - by ISVK
    My goal is to display the entire contents of a FlowDocument (that is, without paginating) in a column layout. It would have a fixed height, but the width would depend on the contents of the FlowDocument. My problem is: FlowDocumentReader does not automatically resize to the contents of the FlowDocument. As you see in my XAML below, FlowDocumentReader.Width is 5000 units (just a large number that can accommodate most documents) -- when I make it Auto, it just clips to the width of the ScrollViewer and paginates my stuff! Is there a proper way of solving this problem? I also made a screenshot of what this looks like now, but the ScrollViewer scrolls past the end of the document in most cases: http://i.imgur.com/3FSRl.png <ScrollViewer x:Name="scrollViewer" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" > <FlowDocumentReader x:Name="flowDocReader" ClipToBounds="False" Width="5000" > <FlowDocument x:Name="flowDoc" Foreground="#FF404040" ColumnRuleWidth="2" ColumnGap="40" ColumnRuleBrush="#FF404040" IsHyphenationEnabled="True" IsOptimalParagraphEnabled="True" ColumnWidth="150"> <Paragraph> Lorem ipsum dolor sit amet, ...etc... </Paragraph> <Paragraph> Lorem ipsum dolor sit amet, ...etc... </Paragraph> <Paragraph> Lorem ipsum dolor sit amet, ...etc... </Paragraph> </FlowDocument> </FlowDocumentReader> </ScrollViewer>

    Read the article

  • Nesting arbitrary objects in Java

    - by user1502381
    I am having trouble solving a particular problem in Java (which I did not find by search). I do not know how to create a nested lists of objects - with a different type of object/primitive type at the end. For example: *Note: only an example. I am actually doing this below with something other than Employee, but it serves as simple example. I have an array of an object Employee. It contains information on the Employee. public class Employee { int age int salary int yearsWorking public Employee () { // constructor... } // Accessors } What I need to do is organize the Employees by quantiles/percentiles. I have done so by the following: import org.apache.commons.math.stat.descriptive.rank.Percentile; public class EmployeeSort { public void main(String args[]) { Percentile p = new Percentile(); Employee[] employeeArray = new Employee(100); // filled employeeArray double[] ageArray new double[100]; // filled ageArray with ages from employeeArray int q = 25; // Percentile cutoff for (int i = 1; i*q < 100; i++) { // assign percentile cutoff to some array to contain the values } } } Now, the problem I have is that I need to organize the Employees first by the percentiles of age, then percentiles of yearsWorking, and finally by percentiles of salary. My Java knowledge is inadequate right now to solve this problem, but the project I was handed was in Java. I am primarily a python guy, so this problem would have been a lot easier in that language. No such luck.

    Read the article

  • Enforce link in Team foundation server bug work item for duplicates

    - by Tewr
    We have just started out with Team Foundation Server 2008 / Visual Studio Team System and we are pleased to find how we can export and modify work items to our needs. However, this last thing that would make the setup perfect for us has proved somewhat difficult: We have exported the Bug work item type and have made modifications to it to appear differently to different groups of users. We do, however, see a potential problem in non-developers reporting bugs which turn out to be duplicates. We would like to enforce that users who close a ticket with resolved reason:duplicate also creates a link to the bug which is perceived as the first bug report. I have looked at System.RelatedLinkCount, and put the rule <FIELD type="Integer" name="RelatedLinkCount" refname="System.RelatedLinkCount"> <WHEN field="Microsoft.VSTS.Common.ResolvedReason" value="duplicate"> <PROHIBITEDVALUES> <LISTITEM value="0" /> </PROHIBITEDVALUES> </WHEN> </FIELD> However, when I try to put anything in that scope, the importer tells me that System.RelatedLinkCount does not accept the rule, no matter what I put, but the rule above shows what I am trying to do (even though the most preferable rule would also check that the bug that I link to is not a duplicate as well, though this is overkill :P) Has anyone else tried to enforce rules like this in work items? Is there another approach to solving the same issue? I am thankful for any thoughts on the matter.

    Read the article

  • How might a C# programmer approach writing a solution in javascript?

    - by Ben McCormack
    UPDATE: Perhaps this wasn't clear from my original post, but I'm mainly interested in knowing a best practice for how to structure javascript code while building a solution, not simply learning how to use APIs (though that is certainly important). I need to add functionality to a web site and our team has decided to approach the solution using a web service that receives a call from a JSON-formatted AJAX request from within the web site. The web service has been created and works great. Now I have been tasked with writing the javascript/html side of the solution. If I were solving this problem in C#, I would create separate classes for formatting the request, handling the AJAX request/response, parsing the response, and finally inserting the response somehow into the DOM. I would build properties and methods appropriately into each class, doing my best to separate functionality and structure where appropriate. However, I have to solve this problem in javascript. Firstly, how could I approach my solution in javascript in the way I would approach it from C# as described above? Or more importantly, what's a better way to approach structuring code in javascript? Any advice or links to helpful material on the web would be greatly appreciated. NOTE: Though perhaps not immediately relevant to this question, it may be worth noting that we will be using jQuery in our solution.

    Read the article

  • Conversion between different template instantiation of the same template

    - by Naveen
    I am trying to write an operator which converts between the differnt types of the same implementation. This is the sample code: template <class T = int> class A { public: A() : m_a(0){} template <class U> operator A<U>() { A<U> u; u.m_a = m_a; return u; } private: int m_a; }; int main(void) { A<int> a; A<double> b = a; return 0; } However, it gives the following error for line u.m_a = m_a;. Error 2 error C2248: 'A::m_a' : cannot access private member declared in class 'A' d:\VC++\Vs8Console\Vs8Console\Vs8Console.cpp 30 Vs8Console I understand the error is because A<U> is a totally different type from A<T>. Is there any simple way of solving this (may be using a friend?) other than providing setter and getter methods? I am using Visual studio 2008 if it matters.

    Read the article

  • Localisable Resources: how can (should one?!) wrap a UI layer source as a BL layer service?

    - by Ciel
    A service that returns localised strings could be wrapped in a service, so that it could be used both locally (eg in an MVC app) and remotely (eg possibly Silverlight). But...if sticking with the standard practice of creating resources in the UI assembly, that would in effect make a lower layer (BL/Services) have to have a ref on a higher layer (UI)...a definite no-no. And whereas a lot of AppWide resources (eg: AppName, OK, Cancel, etc.) could be defined in a Common cross-cutting assembly, and the BL/ResourceSerouce could ref and wrap those, that doesn't work in a a Modular App, where the Core app should have no binding to/knowledge of any Module. One solution could be to have each module, once mounted in mem, 'register' their Resource files with the service, who would then return it to the service (rather a long round trip, but at least consistent as a service, and potentially resources/images could be shared with other resources). Secondly, that may work in a web app...but not sure how that pattern could be extended to a Silverlight modular app (the round tripping becomes prohibitive). ie...what are best practices for allowing Resources to be to be defined by the UI designer, in a higher level, but served from the lower BL layer, as a Service? Or is there a better way of understanding/solving the problem?

    Read the article

  • Develop multiple very similar projects at once

    - by Raveren
    I am developing a semi-complicated site that is available in several countries at once. Much effort has been put in to make the code bases as similar as possible to one another and ultimately only the config file and some representational data will differ between them. Each project has its own SVN repository which maps directly to a live test site. That part is handled by the IDE we use to work. Now I am in need to create a some sort of system to keep all these projects in sync. The best theoretical solution so far is to create a local hook script that would fire on committing and Merge the committed files from the project that is being committed to all other projects Optionally upload them to the live site, replacing previous files The first problem is that I don't know how I would do the merging - I guess it would be like applying a SVN patch or something. The second is if I do not want to upload the changes to the live server, how would I go about synching the live and local code bases (replace older files?). I am posting this question, not going through the potentially huge trouble of solving the aforementioned problems myself is that I believe this is a pretty common situation and someone would already have a solution and others may benefit from the answers in the future. Lastly, I'm on windows7, develop PHP and use tortoiseSVN.

    Read the article

  • Match Anything Except a Sub-pattern

    - by Tim Lytle
    I'd like to accomplish what this (invalid I believe) regular expression tries to do: <p><a>([^(<\/a>)]+?)<\/a></p>uniquestring Essentially match anything except a closing anchor tag. Simple non-greedy doesn't help here because `uniquestring' may very well be after another distant closing anchor tag: <p><a>text I don't <tag>want</tag> to match</a></p>random data<p><a>text I do <tag>want to</tag> match</a></p>uniquestring more matches <p><a>of <tag>text I do</tag> want to match</a></p>uniquestring So I have more tag in between the anchor tags. And I'm using the presence of uniquestring to determine if I want to match the data. So a simple non-greedy ends up matching everything from the start of the data I don't want to the end of the data I do want. I know I'm edging close to the problems regular expressions (or at least my knowledge of them) aren't good at solving. I could just through the data at an HTML/XML parser, but it is just one simple(ish) search. Is there some easy way to do this that I'm just missing?

    Read the article

  • looking for advise on importing excel into mysql with php

    - by Ole Media
    Alright, see if I can pick your brains from you all. I'm currently working on a project where all the information comes from different clients, the only thing in common is that the received data is done with excel. The excel spread sheet that they present is just a bunch of references and codes, and the problem than I'm facing is that I need the references and codes to be entered in certain format in order for the website to work. The perfect situation will be to go to each client and teach how I would need the data, but I can't do that because of the large number of clients, and more importantly I will be interrupting their work flow. Each client has its own codes and reference model and they are not willing to change their process The good news is that there is a standard pattern for the codes, but I'm talking close to 200 thousand codes with a bunch of combination. They way that we are currently solving the problem is that we have a person who checks each excel sheet received, runs a few macros, and manually fixes those codes in which the macro was not able to fix. The person that is doing this, is already burn out and frustrated and I would like to automatize this process with php. Suggestions?

    Read the article

  • Error in bisection method code in Matlab

    - by Amanda Collins
    I need to write a proper implementation of the bisection method, which means I must address all possible user input errors. Here is my code: function [x_sol, f_at_x_sol, N_iterations] = bisection(f, xn, xp, eps_f, eps_x) % solving f(x)=0 with bisection method % f is the function handle to the desired function, % xn and xp are borders of search, % f(xn)<0 and f(xp)>0 required, % eps_f defines how close f(x) should be to zero, % eps_x defines uncertainty of solution x if(f(xp) < 0) error('xp must be positive') end; if(f(xn)>0) error('xn must be negative') end; if (xn >= xp) error ('xn must be less than xp') end; xg=(xp+xn)/2; %initial guess fg=f(xg); % initial function evaluation N_iterations=1; while ( (abs(fg) > eps_f) & (abs(xg-xp) > eps_x) ) if (fg>0) xp=xg; else xn=xg; end xg=(xp+xn)/2; %update guess fg=f(xg); %update function evaluation N_iterations=N_iterations+1; end x_sol=xg; %solution is ready f_at_x_sol=fg; if (f_at_x_sol > eps_f) error('No convergence') end and here is the error message I receive when I try to test this in Matlab: >> bisection(x.^2, 2, -1, 1e-8, 1e-10) Attempted to access f(-1); index must be a positive integer or logical. Error in bisection (line 9) if(f(xp)<0) I was attempting to see if my error codes worked, but it doesn't look like they do. I get the same error when I try to test it on a function that should work.

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >