Search Results

Search found 1811 results on 73 pages for 'andrew boyd'.

Page 15/73 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • HTML: Include, or exclude, optional closing tags?

    - by Ian Boyd
    Some HTML1 closing tags are optional, i.e.: </HTML> </HEAD> </BODY> </P> </DT> </DD> </LI> </OPTION> </THEAD> </TH> </TBODY> </TR> </TD> </TFOOT> </COLGROUP> Note: Not to be confused with closing tags that are forbidden to be included, i.e.: </IMG> </INPUT> </BR> </HR> </FRAME> </AREA> </BASE> </BASEFONT> </COL> </ISINDEX> </LINK> </META> </PARAM> Note: xhtml is different from HTML. xhtml is a form of xml, which requires every element have a closing tag. A closing tag can be forbidden in html, yet mandatory in xhtml. Are the optional closing tags ideally included, but we'll accept them if you forgot them, or ideally not included, but we'll accept them if you put them in In other words, should i include them, or should i not include them? The HTML 4.01 spec talks about closing element tags being optional, but doesn't say if it's preferable to include them, or preferable to not include them. On the other hand, a random article on DevGuru says: The ending tag is optional. However, it is recommended that it be included. The reason i ask is because you just know it's optional for compatibility reasons; and they would have made them (mandatory | forbidden) if they could have. Put it another way: What did HTML 1, 2, 3 do with regards to these, now optional, closing tags. What does HTML 5 do? And what should i do? Footnotes 1HTML 4.01

    Read the article

  • XSLT: Transforming into non-xml content?

    - by Ian Boyd
    Is it possible to use XSLT to transform XML into something other than XML? e.g. i want the final non-xml content: <HTML> <BODY> <IMG src="file1.png"><BR> <IMG src="file2.png"><BR> ... <IMG src="filen.png"><BR> </BODY> </HTML> You'll notice this document is HTML, because in HTML IMG and BR tags are forbidden from having a closing tag. This constrasts with xhtml, the reformulation of HTML using xml, where all elements are required from having a closing tag (because in xml every tag must be closed). Is it possible, using XSLT, to generate non-xml output? Another example of non-xml output might be: INSERT INTO Documents (Filename) VALUES ('file1.png') INSERT INTO Documents (Filename) VALUES ('file2.png') ... INSERT INTO Documents (Filename) VALUES ('file3.png') The reason i ask is that as soon as my XSLT contains an <IMG>, the stylesheet contains an error; no closing </IMG>.

    Read the article

  • Signed and RequireAdministrator manifested executable being run from temp folder?

    - by Ian Boyd
    i manifested my executable as require administrator: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <!-- Disable Windows Vista UAC compatability heuristics --> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator"/> </requestedPrivileges> </security> </trustInfo> </assembly> And then i digitally signed it. But then when i run the executable i noticed something odd: the name of the executable on the Consent dialog changed from PingWarning.exe to pinxxxx.tmp; as though a temp copy was made, and that is being run: i dug out Process Montior, to see if anyone is creating a *.tmp file when i launch my executable, and there is: The Application Information service inside this particular svchost container is intentionally copying my executable to the Windows temp folder, and asking for user "Consent" from there; giving an invalid filename. Once consent has been granted, the executable is run from its original location: link text The file is not copied to the temp folder if i do not digitally sign it: So my problem is the invalid filename appearing on the consent dialog when i digitally sign my executable which has been manifested as requireAdministrator. What do?

    Read the article

  • Windows Ribbon Framework: How to change font face and size?

    - by Ian Boyd
    How do you change the font face and font size used by the Windows Ribbon Framwork? Background The user can configure Windows to use their preferred font size, e.g.: 8pt 9pt 12pt and their preferred font face, e.g.: MS Sans Serif Microsoft Sans Serif Tahoma Segoe UI Calibri but the Windows Ribbon Framework by default uses a font that is not the user's preference. Additionally, the user could have specified their font preference in my application, which i want the Ribbon hosted in my application to honor.

    Read the article

  • SQL Server Error: maximum number of prefixes. The maximum is 3.

    - by Ian Boyd
    Trying to run a cross-server update: UPDATE cmslive.CMSFintrac.dbo.lsipos SET PostHistorySequencenNmber = ( SELECT TransactionNumber FROM Transactions WHERE Transactions.TransactionDate = cmslive.CMSFintrac.dbo.lsipos.TransactionDate) Gives the error: Server: Msg 117, Level 15, State 2, Line 5 The number name 'cmslive.CMSFintrac.dbo.lsipos' contains more than the maximum number of prefixes. The maximum is 3. What gives? Note: Rearranging the query into a less readable join form: UPDATE cmslive.CMSFintrac.dbo.lsipos SET PostHistorySequenceNumber = B.TransactionNumber FROM cmslive.CMSFintrac.dbo.lsipos A INNER JOIN Transactions B ON A.TransactionDate = B.TransactionDate does not give an error.

    Read the article

  • Can i change the view without changing the controller?

    - by Ian Boyd
    Pretend1 there is a place to type in a name:     Name: __________________ When the text box changes, the value is absorbed into the controller, who stores it in data model. Business rules require that a name be entered: if there is no text entered the TextBox should be colored something in the view to indicate baddness; otherwise it can be whatever color the view likes. The TextBox contains a String, the controller handles a String, and the model stores a String. Now lets say i want to improve the view. There is a new kind of text box2 that can be fed not only string-based keyboard input, but also an image. The view (currently) knows how to determine if the image is in the proper format to perform the processing required to extract text out of it. If there is text, then that text can be fed to the controller, who feeds it to the data model. But if the image is invalid, e.g.3 wrong file format invalid dimensions invalid bit depth unhandled or unknown encoding format missing or incorrectly located registration marks contents not recognizable the view can show something to the user that the image is bad. But the telling the user that something is bad is supposed to be the job of the controller. i'm, of course, not going to re-write the controller to handle Image based text-input (e.g. image based names). a. the code is binary locked inside a GUI widget4 b. there other views besides this one, i'm not going to impose a particular view onto the controller c. i just don't wanna. If i have to change things outside of this UI improvement, then i'll just leave the UI unimproved5 So what's the thinking on having different views for the same Model and Controller? Nitpicker's Corner 1 contrived hypothetical example 2 e.g. bar code, g-mask, ocr 3 contrived hypothetical reasons 4 or hardware of a USB bar-code scanner 5 forcing the user to continue to use a DateTimePicker rather than a TextBox

    Read the article

  • Delphi: How to avoid EIntOverflow underflow when subtracting?

    - by Ian Boyd
    Microsoft already says, in the documentation for GetTickCount, that you could never compare tick counts to check if an interval has passed. e.g.: Incorrect (pseudo-code): DWORD endTime = GetTickCount + 10000; //10 s from now ... if (GetTickCount > endTime) break; The above code is bad because it is suceptable to rollover of the tick counter. For example, assume that the clock is near the end of it's range: endTime = 0xfffffe00 + 10000 = 0x00002510; //9,488 decimal Then you perform your check: if (GetTickCount > endTime) Which is satisfied immediatly, since GetTickCount is larger than endTime: if (0xfffffe01 > 0x00002510) The solution Instead you should always subtract the two time intervals: DWORD startTime = GetTickCount; ... if (GetTickCount - startTime) > 10000 //if it's been 10 seconds break; Looking at the same math: if (GetTickCount - startTime) > 10000 if (0xfffffe01 - 0xfffffe00) > 10000 if (1 > 10000) Which is all well and good in C/C++, where the compiler behaves a certain way. But what about Delphi? But when i perform the same math in Delphi, with overflow checking on ({Q+}, {$OVERFLOWCHECKS ON}), the subtraction of the two tick counts generates an EIntOverflow exception when the TickCount rolls over: if (0x00000100 - 0xffffff00) > 10000 0x00000100 - 0xffffff00 = 0x00000200 What is the intended solution for this problem? Edit: i've tried to temporarily turn off OVERFLOWCHECKS: {$OVERFLOWCHECKS OFF}] delta = GetTickCount - startTime; {$OVERFLOWCHECKS ON} But the subtraction still throws an EIntOverflow exception. Is there a better solution, involving casts and larger intermediate variable types?

    Read the article

  • What is the worst real-world macros/pre-processor abuse you've ever come across?

    - by Trevor Boyd Smith
    What is the worst real-world macros/pre-processor abuse you've ever come across (please no contrived IOCCC answers *haha*)? Please add a short snippet or story if it is really entertaining. The goal is to teach something instead of always telling people "never use macros". p.s.: I've used macros before... but usually I get rid of them eventually when I have a "real" solution (even if the real solution is inlined so it becomes similar to a macro). Bonus: Give an example where the macro was really was better than a not-macro solution. Related question: When are C++ macros beneficial?

    Read the article

  • Performance hit from C++ style casts?

    - by Trevor Boyd Smith
    I am new to C++ style casts and I am worried that using C++ style casts will ruin the performance of my application because I have a real-time-critical deadline in my interrupt-service-routine. I heard that some casts will even throw exceptions! I would like to use the C++ style casts because it would make my code more "robust". However, if there is any performance hit then I will probably not use C++ style casts and will instead spend more time testing the code that uses C-style casts. Has anyone done any rigorous testing/profiling to compare the performance of C++ style casts to C style casts? What were your results? What conclusions did you draw?

    Read the article

  • Delphi: How to call a method when i click a control?

    - by Ian Boyd
    i have a method: procedure Frob(Sender: TObject); that i want to call when i click a menu item. The method comes to me though an interface: animal: IAnimal; IAnimal = interface procedure Frob(Sender: TObject); end; The question revolves around what to assign to the OnClick event handler of a menu item (i.e. control): var animal: IAnimal; ... begin ... menuItem := TMenuItem.Create(FileMenu) menuItem.Caption := 'Click me!'; menuItem.OnClick := <-------- what to do ... end; The obvious choice, my first attempt, and the wrong answer is: menuItem.OnClick := animal.Frob; So how can i call a method when user clicks a control? See also Why doesn't it work?

    Read the article

  • What is the MVC version of this code?

    - by Ian Boyd
    i'm trying to wrap my head around how to enterprise up my code: taking a simple routine and splitting it up into 5 or 6 methods in 3 or 4 classes. i quickly came up three simple examples of code how i currently write it. Could someone please convert these into an MVC/MVP obfuscated version? Example 1: The last name is mandatory. Color the text box red if nothing is entered. Color it green if stuff is entered: private void txtLastname_TextChanged(object sender, EventArgs e) { //Lastname mandatory. //Color pinkish if nothing entered. Greenish if entered. if (txtLastname.Text.Trim() == "") { //Lastname is required, color pinkish txtLastname.BackColor = ControlBad; } else { //Lastname entered, remove the coloring txtLastname.BackColor = ControlGood; } } Example 2: The first name is optional, but try to get it. We'll add a bluish tint to this "try to get" field: private void txtFirstname_TextChanged(object sender, EventArgs e) { //Firstname can be blank. //Hint them that they should *try* to get it with a bluish color. //If they do enter stuff: it better be not all spaces. if (txtFirstname.Text == "") { //Nothing there, hint it blue txtFirstname.BackColor = ControlRequired; } else if (txtFirstname.Text.Trim() == "") { //They entered spaces - bad user! txtFirstname.BackColor = ControlBad; } else { //Entered stuff, remove coloring txtFirstname.BackColor = SystemColors.Window; } } Example 3 The age is totally optional. If an age is entered, it better be valid: private void txtAge_TextChanged(object sender, EventArgs e) { //Age is optional, but if entered it better be valid int nAge = 0; if (Int32.TryParse(txtAge.Text, out nAge)) { //Valid integer entered if (nAge < 0) { //Negative age? i don't think so txtAge.BackColor = ControlBad; } else { //Valid age entered, remove coloring txtAge.BackColor = SystemColors.Window; } } else { //Whatever is in there: it's *not* a valid integer, if (txtAge.Text == "") { //Blank is okay txtAge.BackColor = SystemColors.Window; } else { //Not a valid age, bad user txtAge.BackColor = ControlBad; } } } Every time i see MVC code, it looks almost like random splitting of code into different methods, classes, and files. i've not been able to determine a reason or pattern to their madness. Without any understanding of they why it's being one some way, it makes no sense. And using the words model, view, controller and presenter, like i'm supposed to know what that means, doesn't help. The model is your data. The view shows data on screen. The controller is used to carry out the users actions And oranges taste orangy. Here's my attempt at splitting things up in order to make the code more difficult to follow. Is this anywhere close to MVC? private void txtFirstname_TextChanged(object sender, EventArgs e) { FirstnameTextChangedHandler(sender, e); } private void FirstnameTextChangedHandler(sender, e) { string firstname = GetFirstname(); Color firstnameTextBoxColor = GetFirstnameTextBoxColor(firstname); SetFirstNameTextBoxColor(firstnameTextBoxColor); } private string GetFirstname() { return txtFirstname.Text; } private Color GetFirstnameTextBoxColor(string firstname) { //Firstname can be blank. //Hint them that they should *try* to get it with a bluish color. //If they do enter stuff: it better be not all spaces. if (firstname == "") { //Nothing there, hint it blue return GetControlRequiredColor(); } else if (firstname.Trim() == "") { //They entered spaces - bad user! return GetControlBadColor(); } else { //Entered stuff, remove coloring return GetControlDefaultColor(); } } private Color GetControlRequiredColor() { return ControlRequired; } private Color GetControlBadColor() { return ControlBad; } private Color GetControlGoodColor() { return ControlGood; } //am i doin it rite i've obfuscated the code, but it's still altogether. The next step in the MVC obfuscation, i gather, is to hide the code in 3 or 4 different files. It's that next step that i don't understand. What is the logical separation of which functions are moved into what other classes? Can someone translate my 3 simple examples above into full fledged MVC obfuscation? Edit: Not ASP/ASP.NET/Online. Pretend it's on a desktop, handheld, surface, kiosk. And pretend it's language agnostic.

    Read the article

  • How to maintain form state after Post-Redirect-Get in ASP.net?

    - by Ian Boyd
    Imagine a page with a form input: Search Criteria: crackers                   From: [email protected]           To: [email protected]       Subject: How to maintain form state with PRG? Message: Imagine a page with form input:                         Send After the user clicks Send, the server will instruct to client to Redirect, as part of the Post-Redirect-Get pattern. POST /mail/u/compose HTTP/1.1 303 See Other Location: http://stackoverflow.com/mail/u/compose And the client will issue a GET of the new page. The problem is that some elements of the existing form are lost: Search Criteria:                    It gets worse when there are a few drop-downs, and checkboxes. How can i maintain form state in using Post-Redirect-Get in ASP.net, given that the viewstate is then non-existent. Bonus Reading ASP.NET: How to redirect, prefilling form data?

    Read the article

  • How to differentiate between exceptions i can show the user, and ones i can't?

    - by Ian Boyd
    i have some business logic that traps some logically invalid situations, e.g. trying to reverse a transaction that was already reversed. In this case the correct action is to inform the user: Transaction already reversed or Cannot reverse a reversing transaction or You do not have permission to reverse transactions or This transaction is on a session that has already been closed or This transaction is too old to be reversed The question is, how do i communicate these exceptional cases back to the calling code, so they can show the user? Do i create a separate exception for each case: catch (ETransactionAlreadyReversedException) MessageBox.Show('Transaction already reversed') catch (EReversingAReversingTransactionException) MessageBox.Show('Cannot reverse a reversing transaction') catch (ENoPermissionToReverseTranasctionException) MessageBox.Show('You do not have permission to reverse transactions') catch (ECannotReverseTransactionOnAlredyClosedSessionException) MessageBox.Show('This transaction is on a session that has already been closed') catch (ECannotReverseTooOldTransactionException) MessageBox.Show('This transaction is too old to be reversed') Downside for this is that when there's a new logical case to show the user: Tranasctions created by NSL cannot be reversed i don't simply show the user a message, and instead it leaks out as an unhandled excpetion, when really it should be handled with another MessageBox. The alternative is to create a single exception class: `EReverseTransactionException` With the understanding that any exception of this type is a logical check, that should be handled with a message box: catch (EReverseTransactionException) But it's still understood that any other exceptions, ones that involve, for example, an memory ECC parity error, continue unhandled. In other words, i don't convert all errors that can be thrown by the ReverseTransaction() method into EReverseTransactionException, only ones that are logically invalid cause of the user.

    Read the article

  • How to have the controller change its behavior depending on the view?

    - by Ian Boyd
    If from one view a user enters some invalid data, e.g.:     E-mail: [email protected]     then i want the controller to: not place the data into the model color the text box reddish not allow the user to save But it's possible that if the user enters the same invalid data in a different view i want the controller to: place the data into the model color the text box reddish allow the user to save But it's possible that if the user enters the same invalid data in a different view i want the controller to: place the data into the model color the text box bluish allow the user to save And it's possible that another view will: place the data into the model leave the text box uncolored allow the user to save And it's possible that another view will: auto-correct the data, placing it into the model color the text-box reddish allow the user to have And it's possible for another view to: auto-correct the data, placing it into the model update the view with the new data color the text-box bluish allow the user to save [ad infinitum] Without using n-controllers for n-views, how do i do this?

    Read the article

  • XPS Document Print Tiling

    - by Boyd
    Currently I have an XPS document whose width is too large for the paper. I would like it to print the clipped off contents on additional pages. I have not been successful at finding a setting to accomplish this. Any ideas for a solution?

    Read the article

  • TwoWay Binding With ItemsControl

    - by Andrew
    I'm trying to write a user control that has an ItemsControl, the ItemsTemplate of which contains a TextBox that will allow for TwoWay binding. However, I must be making a mistake somewhere in my code, because the binding only appears to work as if Mode=OneWay. This is a pretty simplified excerpt from my project, but it still contains the problem: <UserControl x:Class="ItemsControlTest.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <Grid> <StackPanel> <ItemsControl ItemsSource="{Binding Path=.}" x:Name="myItemsControl"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBox Text="{Binding Mode=TwoWay, UpdateSourceTrigger=LostFocus, Path=.}" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <Button Click="Button_Click" Content="Click Here To Change Focus From ItemsControl" /> </StackPanel> </Grid> </UserControl> Here's the code behind for the above control: using System; using System.Windows; using System.Windows.Controls; using System.Collections.ObjectModel; namespace ItemsControlTest { /// <summary> /// Interaction logic for UserControl1.xaml /// </summary> public partial class UserControl1 : UserControl { public ObservableCollection<string> MyCollection { get { return (ObservableCollection<string>)GetValue(MyCollectionProperty); } set { SetValue(MyCollectionProperty, value); } } // Using a DependencyProperty as the backing store for MyCollection. This enables animation, styling, binding, etc... public static readonly DependencyProperty MyCollectionProperty = DependencyProperty.Register("MyCollection", typeof(ObservableCollection<string>), typeof(UserControl1), new UIPropertyMetadata(new ObservableCollection<string>())); public UserControl1() { for (int i = 0; i < 6; i++) MyCollection.Add("String " + i.ToString()); InitializeComponent(); myItemsControl.DataContext = this.MyCollection; } private void Button_Click(object sender, RoutedEventArgs e) { // Insert a string after the third element of MyCollection MyCollection.Insert(3, "Inserted Item"); // Display contents of MyCollection in a MessageBox string str = ""; foreach (string s in MyCollection) str += s + Environment.NewLine; MessageBox.Show(str); } } } And finally, here's the xaml for the main window: <Window x:Class="ItemsControlTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:ItemsControlTest" Title="Window1" Height="300" Width="300"> <Grid> <src:UserControl1 /> </Grid> </Window> Well, that's everything. I'm not sure why editing the TextBox.Text properties in the window does not seem to update the source property for the binding in the code behind, namely MyCollection. Clicking on the button pretty much causes the problem to stare me in the face;) Please help me understand where I'm going wrong. Thanx! Andrew

    Read the article

  • HTTP error code 405: tomcat Url mapping issue

    - by Andrew
    I am having trouble POSTing to my java HTTPServlet. I am getting "HTTP Status 405 - HTTP method GET is not supported by this URL" from my tomcat server". When I debug the servlet the login method is never called. I think it's a url mapping issue within tomcat... web.xml <servlet-mapping> <servlet-name>faxcom</servlet-name> <url-pattern>/faxcom/*</url-pattern> </servlet-mapping> FaxcomService.java @Path("/rest") public class FaxcomService extends HttpServlet{ private FAXCOM_x0020_ServiceLocator service; private FAXCOM_x0020_ServiceSoap port; @GET @Produces("application/json") public String testGet() { return "{ \"got here\":true }"; } @POST @Path("/login") @Consumes("application/json") // @Produces("application/json") public Response login(LoginBean login) { ArrayList<ResultMessageBean> rm = new ArrayList<ResultMessageBean>(10); try { service = new FAXCOM_x0020_ServiceLocator(); service.setFAXCOM_x0020_ServiceSoapEndpointAddress("http://cd-faxserver/faxcom_ws/faxcomservice.asmx"); service.setMaintainSession(true); // enable sessions support port = service.getFAXCOM_x0020_ServiceSoap(); rm.add(new ResultMessageBean(port.logOn( "\\\\CD-Faxserver\\FaxcomQ_API", /* path to the queue */ login.getUserName(), /* username */ login.getPassword(), /* password */ login.getUserType() /* 2 = user conf user */ ))); } catch (RemoteException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } // return rm; return Response.status(201).entity(rm).build(); } @POST @Path("/newFaxMessage") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public ArrayList<ResultMessageBean> newFaxMessage(FaxBean fax) { ArrayList<ResultMessageBean> rm = new ArrayList<ResultMessageBean>(); try { rm.add(new ResultMessageBean(port.newFaxMessage( fax.getPriority(), /* priority: 0 - low, 1 - normal, 2 - high, 3 - urgent */ fax.getSendTime(), /* send time */ /* "0.0" - immediate */ /* "1.0" - offpeak */ /* "9/14/2007 5:12:11 PM" - to set specific time */ fax.getResolution(), /* resolution: 0 - low res, 1 - high res */ fax.getSubject(), /* subject */ fax.getCoverpage(), /* cover page: "" – default, “(none)� – no cover page */ fax.getMemo(), /* memo */ fax.getSenderName(), /* sender's name */ fax.getSenderFaxNumber(), /* sender's fax */ fax.getRecipients().get(0).getName(), /* recipient's name */ fax.getRecipients().get(0).getCompany(), /* recipient's company */ fax.getRecipients().get(0).getFaxNumber(), /* destination fax number */ fax.getRecipients().get(0).getVoiceNumber(), /* recipient's phone number */ fax.getRecipients().get(0).getAccountNumber() /* recipient's account number */ ))); if (fax.getRecipients().size() > 1) { for (int i = 1; i < fax.getRecipients().size(); i++) rm.addAll(addRecipient(fax.getRecipients().get(i))); } } catch (RemoteException e) { // TODO Auto-generated catch block e.printStackTrace(); } return rm; } } Main.java private static void main(String[] args) { try { URL url = new URL("https://andrew-vm/faxcom/rest/login"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); conn.setRequestProperty("Content-Type", "application/json"); FileInputStream jsonDemo = new FileInputStream("login.txt"); OutputStream os = (OutputStream) conn.getOutputStream(); os.write(IOUtils.toByteArray(jsonDemo)); os.flush(); if (conn.getResponseCode() != 200) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (conn.getInputStream()))); String output; System.out.println("Output from Server .... \n"); while ((output = br.readLine()) != null) { System.out.println(output); } // Don't want to disconnect - servletInstance will be destroyed // conn.disconnect(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } I am working from this tutorial: http://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/

    Read the article

  • I can't get SetSystemTime to work in Windows Vista using C# with Interop (P/Invoke).

    - by Andrew
    Hi, I'm having a hard time getting SetSystemTime working in my C# code. SetSystemtime is a kernel32.dll function. I'm using P/invoke (interop) to call it. SetSystemtime returns false and the error is "Invalid Parameter". I've posted the code below. I stress that GetSystemTime works just fine. I've tested this on Vista and Windows 7. Based on some newsgroup postings I've seen I have turned off UAC. No difference. I have done some searching for this problem. I found this link: http://groups.google.com.tw/group/microsoft.public.dotnet.framework.interop/browse_thread/thread/805fa8603b00c267 where the problem is reported but no resolution seems to be found. Notice that UAC is also mentioned but I'm not sure this is the problem. Also notice that this gentleman gets no actual Win32Error. Can someone try my code on XP? Can someone tell me what I'm doing wrong and how to fix it. If the answer is to somehow change permission settings programatically, I'd need an example. I would have thought turning off UAC should cover that though. I'm not required to use this particular way (SetSystemTime). I'm just trying to introduce some "clock drift" to stress test something. If there's another way to do it, please tell me. Frankly, I'm surprised I need to use Interop to change the system time. I would have thought there is a .NET method. Thank you very much for any help or ideas. Andrew Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace SystemTimeInteropTest { class Program { #region ClockDriftSetup [StructLayout(LayoutKind.Sequential)] public struct SystemTime { [MarshalAs(UnmanagedType.U2)] public short Year; [MarshalAs(UnmanagedType.U2)] public short Month; [MarshalAs(UnmanagedType.U2)] public short DayOfWeek; [MarshalAs(UnmanagedType.U2)] public short Day; [MarshalAs(UnmanagedType.U2)] public short Hour; [MarshalAs(UnmanagedType.U2)] public short Minute; [MarshalAs(UnmanagedType.U2)] public short Second; [MarshalAs(UnmanagedType.U2)] public short Milliseconds; } [DllImport("kernel32.dll")] public static extern void GetLocalTime( out SystemTime systemTime); [DllImport("kernel32.dll")] public static extern void GetSystemTime( out SystemTime systemTime); [DllImport("kernel32.dll", SetLastError = true)] public static extern bool SetSystemTime( ref SystemTime systemTime); //[DllImport("kernel32.dll", SetLastError = true)] //public static extern bool SetLocalTime( //ref SystemTime systemTime); [System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "SetLocalTime")] [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] public static extern bool SetLocalTime([InAttribute()] ref SystemTime lpSystemTime); #endregion ClockDriftSetup static void Main(string[] args) { try { SystemTime sysTime; GetSystemTime(out sysTime); sysTime.Milliseconds += (short)80; sysTime.Second += (short)3000; bool bResult = SetSystemTime(ref sysTime); if (bResult == false) throw new System.ComponentModel.Win32Exception(); } catch (Exception ex) { Console.WriteLine("Drift Error: " + ex.Message); } } } }

    Read the article

  • Silverlight Cream for June 09, 2010 -- #878

    - by Dave Campbell
    In this Issue: Andrea Boschin, Emiel Jongerius, Anton Polimenov, Andrew Veresov, SilverLaw, RoboBlob, Brandon Watson, and Charlie Kindel. From SilverlightCream.com: Implementing network protocol easily with a generic SocketClient Andrea Boschin has a post up at SilverlightShow about the SocketClient class and how to use it to implement a POP3 client ... source project included Passing parameters to a Silverlight XAP application Emiel Jongerius describes the two ways to pass parameters to your Silverlight app, with detailed code examples. WP7: What is Windows Phone 7 Anton Polimenov is beginning a WP7 series at SilvelightShow with this backgrounder article. I'm not sure where all of the info came from, but it's an interesting starter. Initialization State Manager Andrew Veresov has a post up discussing storing and managing state in your Silverlight app. The code isn't ready for prime time but it's available. How To Rotate A Regular Silverlight 3 and 4 ChildWindow SilverLaw responds to a forum post about rotating a child window. He's got a Silverlight 3 version on Expression Gallery, and describes the same in Silverlight 4 in this post. Silverlight MergedDictionaries – using styles and resources from Class Libraries RoboBlob has a very clearly-written post up about merged dictionaries, all the things possible with them, and all the code for the project. New Policies for Next Gen Windows Phone Marketplace Brandon Watson has an article up discussing the WP7 phone Marketplace. Lots of specifics and links out to more info... a definite read. Hey, You, Get Off of My Cloud Charlie Kindel has a post up describing the concept of a beta distribution channel through the WP7 Marketplace... another definite read. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Podcast Show Notes: Redefining Information Management Architecture

    - by Bob Rhubart-Oracle
    Nothing in IT stands still, and this is certainly true of business intelligence and information management. Big Data has certainly had an impact, as have Hadoop and other technologies. That evolution was the catalyst for the collaborative effort behind a new Information Management Reference Architecture. The latest OTN ArchBeat series features a conversation with Andrew Bond, Stewart Bryson, and Mark Rittman, key players in that collaboration. These three gentlemen know each other quite well, which comes across in a conversation that is as lively and entertaining as it is informative. But don't take my work for it. Listen for yourself! The Panelists(Listed alphabetically) Andrew Bond, head of Enterprise Architecture at Oracle Oracle ACE Director Stewart Bryson, owner and Co-Founder of Red Pill Analytics Oracle ACE Director Mark Rittman, CIO and Co-Founder of Rittman Mead The Conversation Listen to Part 1: The panel discusses how new thinking and new technologies were the catalyst for a new approach to business intelligence projects. Listen to Part 2: Why taking an "API" approach is important in building an agile data factory. Listen to Part 3: Shadow IT, "sandboxing," and how organizational changes are driving the evolution in information management architecture. Additional Resources The Reference Architecture that is the focus of this conversation is described in detail in these blog posts by Mark Rittman: Introducing the Updated Oracle / Rittman Mead Information Management Reference Architecture Part 1: Information Architecture and the Data Factory Part 2: Delivering the Data Factory Be a Guest Producer for an ArchBeat Podcast Want to be a guest producer for an OTN ArchBeat podcast? Click here to learn how to make it happen.

    Read the article

  • Going to UKOUG in December? Meet the Fusion User Experience Advocates

    - by mvaughan
    By Misha Vaughan, Oracle Applications User Experience The Oracle Fusion User Experience Advocates (FXA) will be hosting a roundtable event at UKOUG in December. The FXA program is run by me and Andrew Gilmour, my co-host and fellow team member from the Oracle Applications User Experience group. At this event, our Advocates will be doing the talking -- or rather, answering your questions. If you come to the roundtable, you will find out that the FXA members are a subset of Oracle ACE Directors who have taken on a commitment to participate in deep-dive training on the Oracle Fusion Applications User Experience, and then blend that training into their own areas of expertise – be it applications, Fusion Middleware, or SOA. The Advocates then make themselves available to local special-interest groups and geographic interest groups for public-speaking events, bringing with them a piece of the Fusion Applications user experience story – including demos. Come to the roundtable for a chance to chat with Andrew and me, but more importantly, take this opportunity to meet some of the Advocates firsthand and find out what they can offer to you and your professional group. For more information on the events and presentations that the Applications User Experience team will take part in at UKOUG, visit our Usable Apps Events page.

    Read the article

  • ArchBeat Link-o-Rama for November 20, 2012

    - by Bob Rhubart
    Oracle Utilities Application Framework V4.2.0.0.0 Released | Anthony Shorten Principal Product Manager Anthony Shorten shares an overview of the changes implemented in the new release. Towards Ultra-Reusability for ADF - Adaptive Bindings | Duncan Mills "The task flow mechanism embodies one of the key value propositions of the ADF Framework," says Duncan Mills. "However, what if we could do more? How could we make task flows even more re-usable than they are today?" As you might expect, Duncan has answers for those questions. Oracle BPM Process Accelerators and process excellence | Andrew Richards "Process Accelerators are ready-to-deploy solutions based on best practices to simplify process management requirements," says Capgemini's Andrew Richards. "They are considered to be 'product grade,' meaning they have been designed; engineered, documented and tested by Oracle themselves to a level that they can be deployed as-is for a solution to a problem or extended as appropriate for a particular scenario." Oracle SOA Suite 11g PS 5 introduces BPEL with conditional correlation for aggregation scenarios | Lucas Jellema An extensive, detailed technical post from Oracle ACE Director Lucas Jellema. Check Box Support in ADF Tree Table Different Levels | Andrejus Baranovskis Oracle ACE Director Andrejus Baranovskis updates last year's "ADF Tree - How to Autoselect/Deselect Checkbox" post with new information. As Boom Lures App Creators, Tough Part Is Making a Living Great New York Times article about mobile app develoment also touches on other significant IT issues. Thought for the Day "Building large applications is still really difficult. Making them serve an organisation well for many years is almost impossible." — Malcolm P. Atkinson Source: SoftwareQuotes.com

    Read the article

  • ArchBeat Link-o-Rama Top 10 for November 2, 2012

    - by Bob Rhubart
    ADF Mobile - Login Functionality | Andrejus Baranovskis "The new ADF Mobile approach with native deployment is cool when you want to access phone functionality (camera, email, sms and etc.), also when you want to build mobile applications with advanced UI, " reports Oracle ACE Director Andrejus Baranovskis. Big Data: Running out of Metric System | Andrew McAfee Do very large numbers make your brain hurt? Better stock up on aspirin. According to Andrew McAfee: "It seems safe to say that before the current decade is out we’ll need to convene a 20th conference to come up with some more prefixes for extraordinarily large quantities not to describe intergalactic distances or the amount of energy released by nuclear reactions, but to capture the amount of digital data in the world." Cloud computing will save us from the zombie apocalypse | Cloud Computing - InfoWorld "It's just a matter of time before we migrate our existing IT assets to public cloud systems," says InfoWorld cloud blogger David Linthicum. "Additionally, it's a short window until the dead rise from the grave and attempt to eat our brains." Is is Halloween or something? Thought for the Day "A computer lets you make more mistakes faster than any invention in human history—with the possible exceptions of hand guns and tequila." — Mitch Ratcliffe

    Read the article

  • cURL looking for CA in the wrong place

    - by andrewtweber
    On Redhat Linux, in a PHP script I am setting cURL options as such: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, True); curl_setopt($ch, CURLOPT_CAINFO, '/home/andrew/share/cacert.pem'); Yet I am getting this exception when trying to send data (curl error: 77) error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none Why is it looking for the CAfile in /etc/pki/tls/certs/ca-bundle.crt? I don't know where this folder is coming from as I don't set it anywhere. Shouldn't it be looking in the place I specified, /home/andrew/share/cacert.pem? I don't have write permission /etc/ so simply copying the file there is not an option. Am I missing some other curl option that I should be using? (This is on shared hosting - is it possible that it's disallowing me from setting a different path for the CAfile?)

    Read the article

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