Search Results

Search found 17621 results on 705 pages for 'just my correct opinion'.

Page 13/705 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Python having problems writing/reading and testing in a correct format

    - by Ionut
    I’m trying to make a program that will do the following: check if auth_file exists if yes - read file and try to login using data from that file - if data is wrong - request new data if no - request some data and then create the file and fill it with requested data So far: import json import getpass import os import requests filename = ".auth_data" auth_file = os.path.realpath(filename) url = 'http://example.com/api' headers = {'content-type': 'application/json'} def load_auth_file(): try: f = open(auth_file, "r") auth_data = f.read() r = requests.get(url, auth=auth_data, headers=headers) if r.reason == 'OK': return auth_data else: print "Incorrect login..." req_auth() except IOError: f = file(auth_file, "w") f.write(req_auth()) f.close() def req_auth(): user = str(raw_input('Username: ')) password = getpass.getpass('Password: ') auth_data = (user, password) r = requests.get(url, auth=auth_data, headers=headers) if r.reason == 'OK': return user, password elif r.reason == "FORBIDDEN": print "Incorrect login information..." req_auth() return False I have the following problems(understanding and applying the correct way): I can't find a correct way of storing the returned data from req_auth() to auth_file in a format that can be read and used in load_auth file PS: Of course I'm a beginner in Python and I'm sure I have missed some key elements here :(

    Read the article

  • Always get the correct datetime?

    - by Jesper Mansa
    I was wandering if there is a way/site/link whith the correct time? Not the servers datetime or the clients datetime. I'm using datetime to count down on my gaming site for when it is the users time to make a play. Users come from all ower the world so using the users client time would not match if its from the US to Europe. Then normally I would use the servers time, but somehow it skips 1.2 hours sometimes? I would like to make sure that everbody makes a timestamp from the same source and that source always is correct! Hoping for help and thanks in advance.

    Read the article

  • is this code correct? [closed]

    - by davit-datuashvili
    hi i have poste this code from this title http://stackoverflow.com/questions/2896363/hi-i-have-question-here-is-pseudo-code-about-sift-up-and-sift-down-on-heaps i have following code of siftup on heap is it correct?i have put here because i have changed at old place my question and it became unreadable so i have posted here public class siftup{ public static void main(String[]args){ int p; int n=12; int a[]=new int[]{15,20,12,29,23,17,22,35,40,26,51,19}; int i=n-1; while (i!=0){ if (i==1) break; p=i/2; if (a[p]<=a[i]){ int t=a[p]; a[p]=a[i]; a[i]=t; } i=p; } for (int j=0;j<n;j++){ System.out.println(a[j]); } } } //result is this 15 20 19 29 23 12 22 35 40 26 51 17 is it correct?

    Read the article

  • Trouble calculating correct decimal digits.

    - by Crath
    I am trying to create a program that will do some simple calculations, but am having trouble with the program not doing the correct math, or placing the decimal correctly, or something. Some other people I asked cannot figure it out either. Here is the code: http://pastie.org/887352 When you enter the following data: Weekly Wage: 500 Raise: 3 Years Employed: 8 It outputs the following data: Year Annual Salary 1 $26000.00 2 $26780.00 3 $27560.00 4 $28340.00 5 $29120.00 6 $29900.00 7 $30680.00 8 $31460.00 And it should be outputting: Year Annual Salary 1 $26000.00 2 $26780.00 3 $27583.40 4 $28410.90 5 $29263.23 6 $30141.13 7 $31045.36 8 $31976.72 Here is the full description of the task: 8.17 ( Pay Raise Calculator Application) Develop an application that computes the amount of money an employee makes each year over a user- specified number of years. Assume the employee receives a pay raise once every year. The user specifies in the application the initial weekly salary, the amount of the raise (in percent per year) and the number of years for which the amounts earned will be calculated. The application should run as shown in Fig. 8.22. in your text. (fig 8.22 is the output i posted above as what my program should be posting) Opening the template source code file. Open the PayRaise.cpp file in your text editor or IDE. Defining variables and prompting the user for input. To store the raise percentage and years of employment that the user inputs, define int variables rate and years, in main after line 12. Also define double variable wage to store the user’s annual wage. Then, insert statements that prompt the user for the raise percentage, years of employment and starting weekly wage. Store the values typed at the keyboard in the rate, years and wage variables, respectively. To find the annual wage, multiply the new wage by 52 (the number of weeks per year) and store the result in wage. Displaying a table header and formatting output. Use the left and setw stream manipulators to display a table header as shown in Fig. 8.22 in your text. The first column should be six characters wide. Then use the fixed and setprecision stream manipulators to format floating- point values with two positions to the left of the decimal point. Writing a for statement header. Insert a for statement. Before the first semicolon in the for statement header, define and initialize the variable counter to 1. Before the second semicolon, enter a loop- continuation condition that will cause the for statement to loop until counter has reached the number of years entered. After the second semicolon, enter the increment of counter so that the for statement executes once for each number of years. Calculating the pay raise. In the body of the for statement, display the value of counter in the first column and the value of wage in the second column. Then calculate the new weekly wage for the following year, and store the resulting value in the wage variable. To do this, add 1 to the percentage increase (be sure to divide the percentage by 100.0 ) and multiply the result by the current value in wage. Save, compile and run the application. Input a raise percentage and a number of years for the wage increase. View the results to ensure that the correct years are displayed and that the future wage results are correct. Close the Command Prompt window. We can not figure it out! Any help would be greatly appreciated, thanks!

    Read the article

  • How to make a correct if-statement to filter out values from a xml-file

    - by Garreth 00
    Edit 3: As requested, I'm trying to simplify my question. Here is a sample of some of my data from a xml file: <entry> <title>Entry 1</title> <f:max_value_a>499 999</f:max_value_a> <f:max_value_b>999 999</f:max_value_b> <f:min_value_a>0</f:min_value_a> <f:min_value_b>500 000</f:min_value_b> <f:min_value_c>1 000 000</f:min_value_c> <f:value_for_a>5,10</f:value_for_a> <f:value_for_b>4,50</f:value_for_b> <f:value_for_c>3,90</f:value_for_c> </entry> <entry> <title>Entry 2</title> <f:min_value_a>0</f:min_value_a> <f:value_for_a>4,20</f:value_for_a> </entry> <entry> <title>Entry 3</title> <f:max_value_a>1 999 999</f:max_value_a> <f:min_value_a>100 000</f:min_value_a> <f:min_value_b>2 000 000</f:min_value_b> <f:value_for_a>3,735</f:value_for_a> <f:value_for_b>3,445</f:value_for_b> </entry> f:value_for_d is the highest value, and f:value_for_c is lower than d, and so on. I have a dynamic targetvalue (lets just go with 2 000 000 in this example) I want to get the value where max_value is greater than the targetvalue, but sometimes max_value is not defined and then set to "0". "0" in max_value should mean unlimited "roof". The min_value can not be greater than targetvalue, but sometimes min_value is not defined and then set to "0". "0" min_value should mean a unlimited "floor". I have tried with this code if ($value_for_d > 0 ){ if (($min_value_d <= $targetvalue) xor ($min_value_d == 0)){ if (($max_value_d >= $targetvalue) xor ($max_value_d == 0)){ $query_result = TRUE; $value = $value_for_d; } } }elseif ($value_for_c > 0 ){ if (($min_value_c <= $targetvalue) xor ($min_value_c == 0)){ if (($max_value_c >= $targetvalue) xor ($max_value_c == 0)){ $query_result = TRUE; $value = $value_for_c; } } }elseif ($value_for_b > 0 ){ if (($min_value_b <= $targetvalue) xor ($min_value_b == 0)){ if (($max_value_b >= $targetvalue) xor ($max_value_b == 0)){ $query_result = TRUE; $value = $value_for_b; } } }elseif ($value_for_a > 0 ){ if (($min_value_a <= $targetvalue) xor ($min_value_a == 0)){ if (($max_value_a >= $targetvalue) xor ($max_value_a == 0)){ $query_result = TRUE; $value = $value_for_a; } } } If I run this code with a targetvalue of "2 000 000", I get this result: Entry 1 - 3.9 (correct value is 3.9) Entry 2 - 0 (correct value is 4.2) Entry 3 - 3.445 (correct value is 3.445) If I set the targetvalue to even lower, to 500 000, I get 0 on all my entries.

    Read the article

  • X509Certificate.CreateFromCertFile - the specified network password is not correct

    - by pcampbell
    I have a .NET application that I want to use as a client to call an SSL SOAP web service. I have been supplied with a valid client certificate called foo.pfx. There is a password on the certificate itself. I've located the certificate at the following location: C:\certs\foo.pfx To call the web service, I need to attach the client certificate. Here's the code: public X509Certificate GetCertificateFromDisk(){ try{ string certPath = ConfigurationManager.AppSettings["MyCertPath"].ToString(); //this evaluates to "c:\\certs\\foo.pfx". So far so good. X509Certificate myCert = X509Certificate.CreateFromCertFile(certPath); // exception is raised here! "The specified network password is not correct" return cert; } catch (Exception ex){ throw; } } It sounds like the exception is around the .NET application trying to read the disk. The method CreateFromCertFile is a static method that should create a new instance of X509Certificate. The method isn't overridden, and has only one argument: the path. When I inspect the Exception, I find this: _COMPlusExceptionCode = -532459699 Source=mscorlib Question: does anyone know what the cause of the exception "The specified network password is not correct" ?

    Read the article

  • Correct way to get absolute url in django

    - by dreamiurg
    A problem that I stumbled upon recently, and, even though I solved it, I would like to hear your opinion of what correct/simple/adopted solution would be. I'm developing website using Django + python. When I run it on local machine with "python manage.py runserver", local address is http://127.0.0.1:8000/ by default. However, on production server my app has other url, with path - like "http://server.name/myproj/" I need to generate and use permanent urls. If I'm using {% url view params %}, I'm getting paths that are relative to / , since my urls.py contains this urlpatterns = patterns('', (r'^(\d+)?$', 'myproj.myapp.views.index'), (r'^img/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT + '/img' }), (r'^css/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT + '/css' }), ) So far, I see 2 solutions: modify urls.py, include '/myproj/' in case of production run use request.build_absolute_uri() for creating link in views.py or pass some variable with 'hostname:port/path' in templates Are there prettier ways to deal with this problem? Thank you.

    Read the article

  • Correct way to trigger object clone/memento when property changes

    - by Jay
    Hi, I have a big doubt about the correct way to save an object state (clone object), if necessary to rollback the changes, when a property has changed. I know that the IEditableObject interface exists for those cases but during some tests the BeginEdit would just fire like crazy (I have a DataGrid whose values can be edited but I won't need to keep the state of the object in these cases). I'm following the MVP design pattern in my project and the view's DataContext is a wrapper of my presenter.Let's say I have a CheckBox/TextBox in my UI and when that textbox's value changes, the property bound in the wrapper gets set.Currently, before setting the new value i'm raising an event to the presenter (something like PropertyChanging) that clones my wrapper. I'm doing this because I don't think that job should be done by the wrapper itself but by the presenter.Is this a correct approach? Raising the event is an acceptable solution? I thought of other possible ideas: Interface between presenter and wrapper; Use explicit binding and trigger the binding after saving object's state; What is your opinion about the best way to do this? Should I just keep IEditableObject, is this the best way? Best Regards

    Read the article

  • Is this correct for disposing an object using IDisposable

    - by robUK
    I have a class that implements the IDisposable interface. I am using a webclient to download some data using the AsyncDownloadString. I am wondering have I correctly declared my event handlers in the constructor and within the using statement of the web client? And is this correct way to remove the event handlers in the Dispose method? Overrule is this the correct way to use the IDisposable interface? public class Balance : IDisposable { //Constructor WebClient wc; public Balance() { using (wc = new WebClient()) { //Create event handler for the progress changed and download completed events wc.DownloadProgressChanged += new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged); wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted); } } ~Balance() { this.Dispose(false); } //Get the current balance for the user that is logged in. //If the balance returned from the server is NULL display error to the user. //Null could occur if the DB has been stopped or the server is down. public void GetBalance(string sipUsername) { //Remove the underscore ( _ ) from the username, as this is not needed to get the balance. sipUsername = sipUsername.Remove(0, 1); string strURL = string.Format("https://www.xxxxxxx.com", sipUsername); //Download only when the webclient is not busy. if (!wc.IsBusy) { // Download the current balance. wc.DownloadStringAsync(new Uri(strURL)); } else { Console.Write("Busy please try again"); } } //return and display the balance after the download has fully completed void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { //Pass the result to the event handler } //Dispose of the balance object public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } //Remove the event handlers private bool isDisposed = false; private void Dispose(bool disposing) { if (!this.isDisposed) { if (disposing) { wc.DownloadProgressChanged -= new DownloadProgressChangedEventHandler(wc_DownloadProgressChanged); wc.DownloadStringCompleted -= new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted); wc.Dispose(); } isDisposed = true; } } }

    Read the article

  • Correct Time Display

    - by Matthew
    Guys, I''m looking to get this correct and i'm getting a bit fustrated with this. What I want to do is get hours and days and weeks correct. Example: if this post is < 60min old then have it read: Posted Less then 1 minute ago if this post is < 120min old then have it read: Posted 1 hour ago if this post is 120min old then have it read: Posted 1 hours ago if this post is < 1440min old then have it read: Posted 1 day ago if this post is 1440min old then have it read: Posted 2 days ago Is that right?? This is what I have so far: if (lapsedTime < 60) { return '< 1 mimute'; } else if (lapsedTime < (60*60)) { return Math.round(lapsedTime / 60) + 'minutes'; } else if (lapsedTime < (12*60*60)) { return Math.round(lapsedTime / 2400) + 'hr'; } else if (lapsedTime < (24*60*60)) { return Math.round(lapsedTime / 3600) + 'hrs'; } else if (lapsedTime < (7*24*60*60)) { return Math.round(lapsedTime / 86400) + 'days'; } else { return Math.round(lapsedTime / 604800) + 'weeks'; }

    Read the article

  • Semantically correct XHTML markup

    - by Dori
    Hello all. Just trying to get the hang of using the semantically correct XHTML markup. Just writing the code for a small navigation item. Where each button has effectivly a title and a descrption. I thought a definition list would therefore be great so i wrote the following <dl> <dt>Import images</dt> <dd>Read in new image names to database</dd> <dt>Exhibition Management</dt> <dd>Create / Delete an exhibition </dd> <dt>Image Management</dt> <dd>Edit name, medium and exhibition data </dd> </dl> But...I want the above to be 3 buttons, each button containing the dt and dd text. How can i do this with the correct code? Normally i would make each button a div and use that for the visual button behaviour (onHover and current page selection stuff). Any advice please Thanks

    Read the article

  • Semantically correct nested anchors

    - by Blackie123
    I am working on a web applicaton. And what we also create is something that could be described as inline editing. Just to portray thing I am trying to solve I use example of Facebook post. You have post like. Steve Jobs added 5 new photos Steve Jobs is link that redirects to his profile so in HTML, that would be: <div class="post-block"> <p><a href="stevejobs/" title="#">Steve Jobs</a> added 5 new photos.<p> </div> But what I want is the whole post "block" to be clickable although I want only that name to appear to be link. Normally in HTML logic would say to to this: <a href="stevejobs/" title="#"><div class="post-block"> <p><a href="stevejobs/" title="#">Steve Jobs</a> added 5 new photos.<p> </div></a> But this isn't semantically correct. Quick look to HTML 4.01 or any other standard says something like this: Links and anchors defined by the A element must not be nested; an A element must not contain any other A elements. How to create it semantically correct other than using javascript and defining div:hover state for the whole "div anchor"?

    Read the article

  • Is the below thread pool implementation correct(C#3.0)

    - by Newbie
    Hi Experts, For the first time ever I have implemented thread pooling and I found it to be working. But I am not very sure about the way I have done is the appropriate way it is supposed to be. Would you people mind in spending some valuable time to check and let me know if my approach is correct or not? If you people find that the approach is incorrect , could you please help me out in writing the correct version. I have basicaly read How to use thread pool and based on what ever I have understood I have developed the below program as per my need public class Calculation { #region Private variable declaration ManualResetEvent[] factorManualResetEvent = null; #endregion public void Compute() { factorManualResetEvent = new ManualResetEvent[2]; for (int i = 0; i < 2; i++){ factorManualResetEvent[i] = new ManualResetEvent(false); ThreadPool.QueueUserWorkItem(ThreadPoolCallback, i);} //Wait for all the threads to complete WaitHandle.WaitAll(factorManualResetEvent); //Proceed with the next task(s) NEXT_TASK_TO_BE_EXECUTED(); } #region Private Methods // Wrapper method for use with thread pool. public void ThreadPoolCallback(Object threadContext) { int threadIndex = (int)threadContext; Method1(); Method2(); factorManualResetEvent[threadIndex].Set(); } private void Method1 () { //Code of method 1} private void Method2 () { //Code of method 2 } #endregion }

    Read the article

  • OWASP Regex Repository: Is this regex correct?

    - by Jacco
    I was looking at the regular expression for validating various data types from the (OWASP Regex Repository). One of the regular expressions in there is called safetext and looks like: ^[a-zA-Z0-9\s.\-]+$ My first question is: Is this regular expression correct? complementary question If this Regex Repository any good at all?

    Read the article

  • Correct way to model recursive relationship in Django

    - by Yuval A
    My application has two node types: a parent node which can hold recursive child nodes. Think of it like the post-comment system in SO, but comments can be recursive: parent_1 child_11 child_12 child_121 child_3 parent_2 child_21 child_211 child_2111 Important to note that the parent nodes have different attributes and behavior than the child nodes. What is the correct (and presumably most efficient) way of modeling this relationship in Django?

    Read the article

  • What is the correct response for web service?

    - by Eric
    One of my web services returns the list of ids of the the projects a person is owner of. That is, when I GET http://example.com/wsListProjects?user=eric I get back xml with the list of projects. However, when I specify user=xxx, who doesn't exist, I currently return a 404 response? Is this the correct response to return? Thanks.

    Read the article

  • Report Builder Error (Input string was not in a correct format) when filtering data

    - by JVZ
    Issue: the user is getting an error “The requested list could not be retrieved because the query is not valid or a connection could not be made to the data source.” while trying to filter a reporting using Report Builder 2.0. When you expand the details the message is “Input string was not in a correct format” I verified that when the user clicks to see the filter values the query is being sent to the underlying database (by using profiler). When I build the same report [I'm a server admin] I have no issues and see all the filtered values, which leads me to believe this is a permissions issue. I believe I granted all the correct permissions, see below: Report Server Setup [Project Name] Data Sources Models […other folders] We are using SQL Server 2005. The user belongs to a poweruser domain group which has the following permissions: Home Report Builder View Folders Browser Home/[Project Name] Browser Report Builder View Folders [Data Sources] Browser Content Developer [Models] [Inherit roles from Parent folder] << should be same as [Project Name] folder Report server log is showing the following: w3wp!library!5!04/21/2010-08:47:27:: Call to GetPermissionsAction(/). w3wp!library!a!04/21/2010-08:47:27:: Call to GetPropertiesAction(/, PathBased). w3wp!library!5!04/21/2010-08:47:27:: Call to GetSystemPermissionsAction(). w3wp!library!a!04/21/2010-08:47:27:: Call to ListChildrenAction(/, False). w3wp!library!a!04/21/2010-08:47:27:: Call to GetSystemPropertiesAction(). w3wp!library!a!04/21/2010-08:47:27:: Call to GetSystemPropertiesAction(). w3wp!library!9!04/21/2010-08:47:40:: Call to ListModelPerspectivesAction(). w3wp!library!9!04/21/2010-08:48:22:: Call to GetUserModelAction(//Models/, ). w3wp!library!5!04/21/2010-08:48:45:: Call to GetItemTypeAction(/). w3wp!library!9!04/21/2010-08:48:46:: Call to GetItemTypeAction(/). w3wp!library!5!04/21/2010-08:48:53:: Call to GetItemTypeAction(/). w3wp!library!a!04/21/2010-08:49:21:: Call to ListModelPerspectivesAction(). w3wp!library!b!04/21/2010-08:53:40:: Call to GetUserModelAction(//Models/, ). w3wp!library!5!04/21/2010-08:54:48:: i INFO: Call to RenderFirst( '' ) w3wp!webserver!5!04/21/2010-08:54:48:: i INFO: Processed report. Report='/', Stream='' w3wp!library!9!04/21/2010-08:56:42:: Call to GetItemTypeAction(/). w3wp!library!9!04/21/2010-08:56:42:: Call to GetItemTypeAction(/). w3wp!library!a!04/21/2010-08:56:50:: Call to GetItemTypeAction(/). Any ideas on how to resolve/troubleshoot this issue?

    Read the article

  • MVC Entity Framework Model not returning correct data

    - by quagland
    Hi, Run into a strange problem while writing an ASP.NET MVC site. I have a view in my SQL Server database that returns a few date ranges. The view works fine when running the query in SSMS. When the view data is returned by the Entity Framework Model, It returns the correct number of rows but some of the rows are duplicated. Here is an example of what I have done: SQL Server code: CREATE TABLE [dbo].[A]( [ID] [int] NOT NULL, [PhID] [int] NULL, [FromDate] [datetime] NULL, [ToDate] [datetime] NULL, CONSTRAINT [PK_A] PRIMARY KEY CLUSTERED ([ID] ASC)) ON [PRIMARY] go CREATE TABLE [dbo].[B]( [PhID] [int] NOT NULL, [FromDate] [datetime] NULL, [ToDate] [datetime] NULL, CONSTRAINT [PK_B] PRIMARY KEY CLUSTERED ( [PhID] ASC )) ON [PRIMARY] go CREATE VIEW C as SELECT A.ID, CASE WHEN A.PhID IS NULL THEN A.FromDate ELSE B.FromDate END AS FromDate, CASE WHEN A.PhID IS NULL THEN A.ToDate ELSE B.ToDate END AS ToDate FROM A LEFT OUTER JOIN B ON A.PhID = B.PhID go INSERT INTO B (PhID, FromDate, ToDate) VALUES (100, '20100615', '20100715') INSERT INTO A (ID, PhID, FromDate, ToDate) VALUES (1, NULL, '20100101', '20100201') INSERT INTO A (ID, PhID, FromDate, ToDate) VALUES (1, 100, '20100615', '20100715') INSERT INTO B (PhID, FromDate, ToDate) VALUES (101, '20101201', '20101231') INSERT INTO A (ID, PhID, FromDate, ToDate) VALUES (2, NULL, '20100801', '20100901') INSERT INTO A (ID, PhID, FromDate, ToDate) VALUES (2, 101, '20101201', '20101231') So now, if you select all from C, you get 4 separate date ranges In the Entity Framework Model (which I call 'Core'), the view 'C' is added. in MVC Controller: public class HomeController : Controller { public ActionResult Index() { CoreEntities db = new CoreEntities(); var clist = from c in db.C select c; return View(clist.ToList()); } } in MVC View: @model List<RM.Models.C> @{ foreach (RM.Models.C c in Model) { @String.Format("{0:dd-MMM-yyyy}", c.FromDate) <span>-</span> @String.Format("{0:dd-MMM-yyyy}", c.ToDate) <br /> } } When I run all this, it outputs this: 01-Jan-2010 - 01-Feb-2010 01-Jan-2010 - 01-Feb-2010 01-Aug-2010 - 01-Sep-2010 01-Aug-2010 - 01-Sep-2010 When it should do this (this is what the view returns): 01-Jan-2010 - 01-Feb-2010 15-Jun-2010 - 15-Jul-2010 01-Aug-2010 - 01-Sep-2010 01-Dec-2010 - 31-Dec-2010 Also, I've run the SQL profiler over it and according to that, the query being executed is: SELECT [Extent1].[ID] AS [ID], [Extent1].[FromDate] AS [FromDate], [Extent1].[ToDate] AS [ToDate] FROM (SELECT [C].[ID] AS [ID], [C].[FromDate] AS [FromDate], [C].[ToDate] AS [ToDate] FROM [dbo].[C] AS [C]) AS [Extent1] Which returns the correct data So it seems that the entity framework is doing something to the data in the meantime. To me, everything looks fine! Have I missed something? Cheers, Ben

    Read the article

  • Prolog - generate correct bracketing

    - by Henrik Bak
    I'd like to get some help in the following exam problem, i have no idea how to do this: Input: a list of numbers, eg.: [1,2,3,4] Output: every possible correct bracketing. Eg.: (in case of input [1,2,3,4]): ((1 2) (3 4)) ((1 (2 3)) 4) (1 ((2 3) 4)) (1 (2 (3 4))) (((1 2) 3) 4) Bracketing here is like a method with two arguments, for example multiplication - then the output is the possible multiplication orders. Please help, i'm stuck with this one. Any help is appreciated, thanks!

    Read the article

  • Use case for output buffering as the correct solution to "headers already sent"

    - by kemp
    I see (not just on this site) a lot of question from inexperienced PHP programmers about the infamous "headers already sent... output started at" error, and many people suggest using ouput buffering as a solution. In my experience I have never found a situation where that error wasn't caused by a flow in the program's logic. Are there cases where output buffering is actually the correct solution?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >