Search Results

Search found 324 results on 13 pages for 'benjamin baron'.

Page 3/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Is the addition of a duration to a date-time defined in ISO 8601?

    - by Benjamin
    I've writing a date-time library, and need to implement the addition of a duration to a date-time. If I add a 1 month duration: P1M to the 31st March 2012: 2012-03-31, does the standard define what the result is? Because the resulting date (31st April) does not exist, there are at least two options: Fall back to the last day of the resulting month. This is the approach currently taken by the ThreeTen API, the (alpha) reference implementation of JSR-310: ZonedDateTime date = ZonedDateTime.parse("2012-03-31T00:00:00Z"); Period duration = Period.parse("P1M"); System.out.println(date.plus(duration).toString()); // 2012-04-30T00:00Z Carry the extra day to the next month. This is the approach taken by the DateTime class in PHP: $date = new DateTime('2012-03-31T00:00:00Z'); $duration = new DateInterval('P1M'); echo $date->add($duration)->format('c'); // 2012-05-01T00:00:00+00:00 I'm surprised that two date-time libraries contradict on this point, so I'm wondering whether the standard defines the result of this operation?

    Read the article

  • WUBI Install freezes on startup

    - by Benjamin
    Ok, I don't completely know of all the specifications, but installing Ubuntu 12.04.1 on my cousin's old Windows XP computer, an old Compaq from around 2004. After install via Wubi, and going through several unsuccessful install attempts, I finally get the start up screen of Ubuntu, and it freezes once you get to the pretty default wallpaper. Not even a login screen. Just instant freeze! We've left it on for about a day now and its still frozen, any help? (Please reply ASAP, he wont stop bugging me about it)

    Read the article

  • Is there a batch processing framework that could be used for C++ applications?

    - by Benjamin
    In my team we develop several command-line C++ applications that work together; they're currently run by hand in separate windows, and after a while managing windows gets really confusing. I'm looking for a better way to manage the processing of these applications; ideally it would have a GUI with the ability to do the following: start applications in a specified order display application status close particular applications Is there anything available that does this type of thing or would we need to develop our own? Is there a better way than this?

    Read the article

  • Google indexing pages with #! although we don't have any

    - by Benjamin Gruenbaum
    Our company has developed a Single Page Application using AngularJS and its routing. Google indexed our site decently with JavaScript but it did not index some pages very well so we have developed an HTML only version. We have followed the Ajax Crawling Specification posted here and have a <meta name='fragment' content='!'> tag and canonical urls. We expect http://www.example.com/foo/bar to be fetched from http://www.example.com/?_escaped_fragment_=/foo/bar. However, we have found out that when we rolled the AJAX specification we now have all pages indexed twice, once with the JavaScript version as http://www.example.com/foo/bar and once with the new version as http://www.example.com/#!/foo/bar. This is harmful to us since it's duplicate content and also mis-representing out site. I have tried looking for similar questions here and in the Google product forum but could not come up with anything.

    Read the article

  • XamlParseException due to DatePicker from WPFToolKit

    - by baron
    Hello everyone, Error : UnhandledException: System.Windows.Markup.XamlParseException: '/WPFToolkit;component/DataGrid/Themes/Luna.NormalColor.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Could not load type 'System.Windows.Controls.Primitives.MultiSelector' from assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Error at object 'System.Windows.ComponentResourceKey' in markup file 'WPFToolkit;component/DataGrid/Themes/Luna.NormalColor.xaml'. Error at object 'System.Windows.ResourceDictionary'. ---> System.Windows.Markup.XamlParseException: Could not load type 'System.Windows.Controls.Primitives.MultiSelector' from assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Error at object 'System.Windows.ComponentResourceKey' in markup file 'WPFToolkit;component/DataGrid/Themes/Luna.NormalColor.xaml'. ---> System.TypeLoadException: Could not load type 'System.Windows.Controls.Primitives.MultiSelector' from assembly 'PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. I keep getting the following exception. I am getting the exception when I run the application exe from the Release folder. I do not get the exception at all when normally debugging the application in Visual Studio. I have worked out that the exception is because of a DatePicker control I am using - as if I remove the control (build and run the release exe again) the exception goes away. How on earth could I work out what is going wrong here? The datepicker looks so much better but for the effort this looks like it might be to fix I may be incline to switch for a textbox which I validate when the submit button is pressed! Dissapointing...

    Read the article

  • Sending email through proxy using gmail smtp

    - by baron
    Hello everyone, Trying to send some email in my C# app. I am behind a proxy - which is no doubt why the code isn't working. This is what I have so far: App.Config: <system.net> <defaultProxy enabled="false"> <proxy proxyaddress="xxx.xxx.xxx.xxx"/> </defaultProxy> <mailSettings> <smtp deliveryMethod="Network"> <network host="smtp.gmail.com" port="587"/> </smtp> </mailSettings> </system.net> Code: var username = "..."; var password = "..."; var fromEmail = "..."; var toEmail = "..."; var body = "Test email body"; var subject = "Test Subject Email"; var client = new SmtpClient("smtp.gmail.com", 587) { Credentials = new NetworkCredential(username, password), EnableSsl = true }; try { client.Send(fromEmail, toEmail, subject, body); } catch (Exception e) { MessageBox.Show(e.Message); } Everytime I get System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com' Where/how do I start to debug?

    Read the article

  • WPF Radiobutton equivalent

    - by baron
    What is the WPF equivalent for WinForms radio button CheckedChanged? I have your basic 2 radio button set up, where when one is selected a textbox is enabled and when the other is selected it is disabled. For the time being I was using RadioButton_Checked, except, I set IsChecked true for one button in the xaml. When I reference the textbox in that Checked method it throws NullReferenceException... Let me know if you need code.

    Read the article

  • No application is associated with the specified file exception

    - by baron
    UnhandledException: System.ComponentModel.Win32Exception: No application is associated with the specified file for this operation at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start(String fileName) Hi everyone, I am getting the following exception on one machine I am testing on when trying to use Process.Start to open a .csv file. I think this is happening because no file association has been set for .csv files on this box. So how would you avoid this situation? Force the Process.Start to open in Notepad? - Ideally it should be opened in excel, but what do you do if excel then doesn't exist on that computer? Thanks

    Read the article

  • Webclient using download file to grab file from server - handling exceptions

    - by baron
    Hello everyone, I have a web service in which I am manipulating POST and GET methods to facilitate upload / download functionality for some files in a client/server style architecture. Basically the user is able to click a button to download a specific file, make some changes in the app, then click upload button to send it back. Problem I am having is with the download. Say the user expects 3 files 1.txt, 2.txt and 3.txt. Except 2.txt does not exist on the server. So I have code like (on server side): public class HttpHandler : IHttpHandler { public void ProcessRequest { if (context.Request.HttpMethod == "GET") { GoGetIt(context) } } private static void GoGetIt(HttpContext context) { var fileInfoOfWhereTheFileShouldBe = new FileInfo(......); if (!fileInfoOfWhereTheFileShouldBe.RefreshExists()) { throw new Exception("Oh dear the file doesn't exist"); } ... So the problem I have is that when I run the application, and I use a WebClient on client side to use DownloadFile method which then uses the code I have above, I get: WebException was unhandled: The remote server returned an error: (500) Internal Server Error. (While debugging) If I attach to the browser and use http://localhost:xxx/1.txt I can step through server side code and throw the exception as intended. So I guess I'm wondering how I can handle the internal server error on the client side properly so I can return something meaningful like "File doesn't exist". One thought was to use a try catch around the WebClient.DownloadFile(address, filename) method but i'm not sure thats the only error that will occur i.e. the file doesn't exist.

    Read the article

  • Why is this class library dll not getting information from app.config

    - by baron
    I am developing a custom HttpHandler, to do so I write a C# Class Library and compile to DLL. As part of this I have some directory locations which I want not hard coded in the app, so i'm trying to put it in the app.config which I've used before. Before this has worked by just going building the app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Share" value="C:\...\"/> </appSettings> </configuration> And then obtaining this in code like: var shareDirectory = ConfigurationManager.AppSettings["Share"]; But when I compile it and put it in the bin folder for the webservice, it keeps getting null for shareDirectory, probably because it can't find app.config. So how do I make sure this is included so I don't have to hard code my direcotry locations? I notice it will essentially after compiled we get the assembly.dll and the assembly.dll.config which is the app.config file, so it's definetly there in the bin folder!

    Read the article

  • Deploying an HttpHandler web service

    - by baron
    I am trying to build a webservice that manipulates http requests POST and GET. Here is a sample: public class CodebookHttpHandler: IHttpHandler { public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") { //DoHttpPostLogic(); } else if (context.Request.HttpMethod == "GET") { //DoHttpGetLogic(); } } ... public void DoHttpPostLogic() { ... } public void DoHttpGetLogic() { ... } I need to deploy this but I am struggling how to start. Most online references show making a website, but really, all I want to do is respond when an HttpPost is sent. I don't know what to put in the website, just want that code to run. Edit: I am following this site as its exactly what I'm trying to do. I have the website set up, I have the code for the handler in a .cs file, i have edited the web.config to add the handler for the file extension I need. Now I am at the step 3 where you tell IIS about this extension and map it to ASP.NET. Also I am using IIS 7 so interface is slightly different than the screenshots. This is the problem I have: 1) Go to website 2) Go to handler mappings 3) Go Add Script Map 4) request path - put the extension I want to handle 5) Executable- it seems i am told to set aspnet_isapi.dll here. Maybe this is incorrect? 6) Give name 7) Hit OK button: Add Script Map Do you want to allow this ISAPI extension? Click "Yes" to add the extension with an "Allowed" entry to the ISAPI and CGI Restrictions list or to update an existing extension entry to "Allowed" in the ISAPI and CGI Restrictions list. Yes No Cancel 8) Hit Yes Add Script Map The specified module required by this handler is not in the modules list. If you are adding a script map handler mapping, the IsapiModule or the CgiModule must be in the modules list. OK edit 2: Have just figured out that that managed handler had something to do with handlers witten in managed code, script map was to help configuring an executable and module mapping to work with http Modules. So I should be using option 1 - Add Managed Handler. See: http://yfrog.com/11managedhandlerp I know what my request path is for the file extension... and I know name (can call it whatever I like), so it must be the Type field I am struggling with. In the applications folder (in IIS) so far I just have the MyHandler.cs and web.config (Of course also a file with the extension I am trying to create the handler for!) edit3: progress So now I have the code and the web.config set up I test to see If I can browse to the filename.CustomExtension file: HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. So in IIS7 I go to Handler Mappings and add it in. See this MSDN example, it is exactly what I am trying to follow The class looks like this: using System.Web; namespace HandlerAttempt2 { public class MyHandler : IHttpHandler { public MyHandler() { //TODO: Add constructor logic here } public void ProcessRequest(HttpContext context) { var objResponse = context.Response; objResponse.Write("<html><body><h1>It just worked"); objResponse.Write("</body></html>"); } public bool IsReusable { get { return true; } } } } I add the Handler in as follows: Request path: *.whatever Type: MyHandler (class name - this appears correct as per example!) Name: whatever Try to browse to the custom file again (this is in app pool as Integrated): HTTP Error 500.21 - Internal Server Error Handler "whatever" has a bad module "ManagedPipelineHandler" in its module list Try to browse to the custom file again (this is in app pool as CLASSIC): HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler.

    Read the article

  • Handling two WebException's properly

    - by baron
    Hi Everyone, I am trying to handle two different WebException's properly. Basically they are handled after calling WebClient.DownloadFile(string address, string fileName) AFAIK, so far there are two I have to handle, both WebException's: The remote name could not be resolved (i.e. No network connectivity to access server to download file) (404) File not nound (i.e. the file doesn't exist on the server) There may be more but this is what I've found most important so far. So how should I handle this properly, as they are both WebException's but I want to handle each case above differently. This is what I have so far: try { using (var client = new WebClient()) { client.DownloadFile("..."); } } catch(InvalidOperationException ioEx) { if (ioEx is WebException) { if (ioEx.Message.Contains("404") { //handle 404 } if (ioEx.Message.Contains("remote name could not") { //handle file doesn't exist } } } As you can see I am checking the message to see what type of WebException it is. I would assume there is a better or a more precise way to do this? Thanks

    Read the article

  • ThreadAbortException (WebClient using DownloadFile to grab file from server)

    - by baron
    Hi Everyone, Referencing my Earlier Question, regarding downloading a file from a server and handling exceptions properly. I am positive that I had this solved, then in classic programming fashion, returned days later to frustratingly find it broken :-( Updated code: private static void GoGetIt(HttpContext context) { var directoryInfoOfWhereTheDirectoryFullOfFilesShouldBe = new FileInfo(......); var name = SomeBasicLogicToDecideName(); //if (!directoryInfoOfWhereTheDirectoryFullOfFilesShouldBe.RefreshExists()) //{ // throw new Exception(string.Format("Could not find {0}.", name)); //} var tempDirectory = ""; //Omitted - creates temporary directory try { directoryInfoOfWhereTheDirectoryFullOfFilesShouldBe.CopyAll(tempDirectory); var response = context.Response; response.ContentType = "binary/octet-stream"; response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}.zip", name)); ZipHelper.ZipDirectoryToStream(tempDirectory, response.OutputStream); response.End(); } catch (Exception ex) { Debug.WriteLine(ex.ToString()); context.Response.StatusCode = 404; } finally { tempDirectory.DeleteWithPrejudice(); } } This was working fine, and returning the zip, otherwise if the file didn't exist returning 404. Then on the client side I could handle this: public bool Download() { try { using (var client = new WebClient()) { client.DownloadFile(name, tempFilePath); } } catch (Exception) { fileExists = false; } return fileExists; } But the problem now is two things. 1) I get System.Threading.ThreadAbortException: Thread was being aborted in the server side try-catch block. Usually this was just a file not found exception. I have no idea what or why that new exception is throwing? 2) Now that a different exception is throwing on the server side instead of the file not found, it would seem I can't use this set up for the application, because back on client side, any exception is assumed to be filenotfound. Any help, especially info on why this ThreadAbortException is throwing!?!? greatly appreciated. Cheers

    Read the article

  • How could I make this display for listbox?

    - by baron
    Hello everyone, I have a databound listbox which is actually displaying two columns of data. It is displayed as follows: <UserControl.Resources> <DataTemplate x:Key="AlignedPairs"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="10" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock Text="{Binding Fruits}" Grid.Column="0" /> <TextBlock Text="->" TextAlignment="Center" Grid.Column="1" /> <TextBlock Text="{Binding Colors}" Grid.Column="3" /> </Grid> </DataTemplate> </UserControl.Resources> <ListBox Name="lbStuff" Grid.ColumnSpan="2" Grid.Row="1" ItemTemplate="{StaticResource AlignedPairs}"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> </ListBox.ItemContainerStyle> </ListBox> Then Itemsource set in codebehind. Based on some logic however, I would like to set either a line or a item in one of the columns, e.g. a fruit to red, or the line to bold. I have code to work out which Fruit or Color I would like to differentiate (by color/bold) in the code behind, but I can't figure out, especially given the custom listbox display, how I could go about setting a particular item to a different color/bold. Does anyone have any ideas? Let me know if any further code is required. Cheers.

    Read the article

  • I am getting an error when trying to use melt() on a dataframe containing Dates

    - by Dan
    I'd like to melt the dataframe so that in one column i have dates in a second i have username as the variable and finally the value. I'm getting this error: Error in as.Date.numeric(value) : 'origin' must be supplied and while I understand the error I'm not exactly sure how to get around it. A small sample of the data is: structure(list(created_at = structure(c(14007, 14008, 14009, 14010, 14011, 14012), class = "Date"), benjamin = c(16, 0, 0, 0, 0, 0), byron = c(0, 0, 0, 0, 0, 0), cameronc = c(0, 0, 0, 0, 0, 0), daniel = c(0, 0, 0, 0, 0, 0), djdiaz = c(0, 0, 0, 0, 0, 0), gene = c(16, 77, 64, 38, 72, 36), joel = c(0, 0, 0, 0, 0, 2), kerem = c(0, 0, 0, 0, 0, 0), sophia = c(0, 0, 0, 0, 0, 0), SuperMoonMan = c(0, 0, 0, 0, 0, 0)), .Names = c("created_at", "benjamin", "byron", "cameronc", "daniel", "djdiaz", "gene", "joel", "kerem", "sophia", "SuperMoonMan"), row.names = c(NA, 6L), class = c("cast_df", "data.frame")) Thanks for your help.

    Read the article

  • Cannot resolve IHttpHandler

    - by baron
    For some reason when I am trying to create a class which implements IHttpHandler I cannot resolve IHttpHandler. Statements like: using System.Web; are not helping either. This is a class library project, I am following example here: http://www.15seconds.com/issue/020417.htm What am I doing wrong?

    Read the article

  • Temporary debug releases and final application releases

    - by baron
    I have a quick question regarding debug and release in VS 2008. I have an app i've been working on - its not yet complete but the bulk of the functionality is there. So basically i'm trying to give a copy of it now to the person helping with documentation - just so they can have a play and get the feel for what i've made. Now the question is how to provide it to them. I was told to just copy the .exe out of the debug/bin folder and put that onto USB. But when testing, if I run this .exe anywhere else (outside of this folder) it crashes. I've now worked out why this is: var path = ConfigurationManager.AppSettings["PathToUse"]; var files = Directory.GetFiles(path); throws a null reference, so that App.config file is not being used. If I copy that file in with the .exe it works again. So actually my question is regarding the best way to manage this situation. What is the best way to provide a working copy to people, and, is there a reference on preparing apps for release - so everything is packaged together and installed in a clean structured folder heirarchy?

    Read the article

  • Batch scripting for directories or better method

    - by baron
    Hi Everyone, Looking at creating a simple batch file for my app. My app needs some directories to be in place as it runs. The first method I thought was just make a batch script: @ECHO OFF IF NOT EXIST C:\App GOTO :CREATE ELSE GOTO :DONTCREATE :CREATE MKDIR C:\App\Code ECHO DIRECTORY CREATED :DONTCREATE ECHO IT WAS ALREADY THERE 1) This doesn't run as I would expect. Both :CREATE and :DONTCREATE seem to run regardless? How do I do an If properly then? Output: A subdirectory or file C:\App\Code already exists. DIRECTORY CREATED IT WAS ALREADY THERE So it enters both true and false statements? 2) The app is a C# WPF app. For what I am trying to do here (create a couple of directories if they don't already exist) - should I do it some other way? Perhaps in the application as it runs?

    Read the article

  • Deploying web service

    - by baron
    I am trying to build a webservice that manipulates http requests POST and GET. Here is a sample: public class CodebookHttpHandler: IHttpHandler { public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") { //DoHttpPostLogic(); } else if (context.Request.HttpMethod == "GET") { //DoHttpGetLogic(); } } ... public void DoHttpPostLogic() { ... } public void DoHttpGetLogic() { ... } I need to deploy this but I am struggling how to start. Most online references show making a website, but really, all I want to do is respond when an HttpPost is sent. I don't know what to put in the website, just want that code to run. Some links i've tried so far: http://my.execpc.com/~gopalan/dotnet/webservices/webservice_server.html http://www.beansoftware.com/asp.net-tutorials/deploy-asp.net.aspx http://msdn.microsoft.com/en-us/library/6x71sze4%28VS.80%29.aspx http://www.c-sharpcorner.com/UploadFile/rajaduraip/SimplestwaytoCreateNDeployWebServices12232005054219AM/SimplestwaytoCreateNDeployWebServices.aspx

    Read the article

  • HTTP Error 403.1 - Permissions are fixed, what else is wrong?

    - by baron
    I have developed a HTTP Handler Web Service, and have had it successfully deployed, through testing on other environments i've ran into another problem. This is the error message I receive: You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed. HTTP Error 403.1 - Forbidden: Execute access is denied. Internet Information Services (IIS) So it is obvious what needs to be fixed, so: 1) Start Internet Information Services (IIS) Manager. 2) Right-click the Web site that contains the SharePoint Web site that you created, and then click Properties. 3) Click the Home Directory tab. 4) Under Application settings, click either Scripts only in the Execute permissions list or Scripts and Executables in the Execute permissions list (as appropriate to your situation). Click OK. 5) Quit IIS Manager. But I'm still getting the same error. So what else could be wrong?

    Read the article

  • Pyplot connect to timer event?

    - by Baron Yugovich
    The same way I now have plt.connect('button_press_event', self.on_click) I would like to have something like plt.connect('each_five_seconds_event', self.on_timer) How can I achieve this in a way that's most similar to what I've shown above? EDIT: I tried fig = plt.subplot2grid((num_cols, num_rows), (col, row), rowspan=rowspan, colspan=colspan) timer = fig.canvas.new_timer(interval=100, callbacks=[(self.on_click)]) timer.start() And got AttributeError: 'AxesSubplot' object has no attribute 'canvas'

    Read the article

  • SImplifying with LINQ - Basic selection

    - by baron
    Hello foreach (var person in peopleList.Where(person => person.FirstName == "Messi")) { selectPeople.Add(person); } I am just wondering if there is any way to simplify this using LINQ. Like rather than look at all the people I was trying to use LINQ to just fill a list with the "Messi"'s... was trying something like... var selectPeople = peopleList.Select(x=>x.FirstName=="Messi"); Then I could just add everyone in that list without a check. But it doesn't quite work as planned. Maybe there's no point simplifying that expression. But the question seemed worthwhile just to strengthen my LINQ knowledge.

    Read the article

  • Multiline for WPF TextBox

    - by baron
    I am developing a app for sending some feedback. Basically i'm trying to make a TextBox for comments, but i'm used to the WinForms MultiLine=true. I've set MinLines to 3, which is getting there, but preferably i'd like if user is able to type wherever in this block, like press enter and do dot points sort of thing - like: - Item 1 blah - Item 2 blahlb lahbvl d But at the moment the text all stays on one line. - Item 1 blah - Item 2 blahb blahb blah This comments will then help fill the body of an email which is sent. It may be pointless if I can't easily keep the same formatting when putting this string into the email body string (so that it looks like it does when sent as it does when typed). Can I achieve what I'm after or do I have to leave it as all text on one line?

    Read the article

  • How can I debug this web service http handler?

    - by baron
    Hello everyone, I am building a Httphandler following these instructions here It manipulates HTTP POST and HTTP GET. I have a client with two buttons two POST and GET. After i've tested and happy everythings working I move it from localhost to IIS. Now when I do this I get an exception in the POST handler code. How on earth can I debug this code line by line? I managed to do this awhile ago, I thought it was by attaching to process but I can't work it out. I can emulate GET just by typing address in browser, post im not sure about. I've tried telnetting and sending it from there but haven't had any luck.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >