Daily Archives

Articles indexed Sunday June 13 2010

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

  • MDI in SWT on Linux??!

    - by Daziplqa
    I'd like to create an MDI application using SWT. I've done extensive searches and reach that the Decorations Object is the one responsable for trying supporting behavior. However, I've a Linux box, and the example provided here: http://java-gui.info/Apress-The.Definitive.Guide.to.SWT.and.JFace/8886final/LiB0070.html#ch08fig02 doesn't works with me. the output of the example provided by the above link is: However, On Linux (GTK), I see only labels without control bars or boxes!! could you please help?

    Read the article

  • Windows 7 VPN Client Default IPsec Configuration?

    - by bwerks
    As far as I can tell, the windows VPN client doesn't provide a lot of flexibility in its IPsec settings. Assuming full configurability on the site end of a client-site VPN configuration, does anyone how to configure the site to match the windows client? Bonus points: how would I discover these settings for myself?

    Read the article

  • C++: How would I get unix time?

    - by John D.
    I need a function or way to get the UNIX epoch in seconds, much like how I can in PHP using the time function. I can't find any method except the time() in ctime which seems to only output a formatted date, or the clock() function which has seconds but seems to always be a multiple of 1 million, nothing with any resolution. I wish to measure execution time in a program, I just wanted to calculate the diff between start and end; how would a C++ programmer do this? EDIT: time() and difftime only allow resolution by seconds, not ms or anything too btw.

    Read the article

  • F# Async problem.

    - by chrisdew
    Hi, I've written a dummy http server as an exercise in F#. I'm using Mono 2.4.4 on Ubuntu 10.04 x86_64, with MonoDevelop. The following code fails to compile with the error: Error FS0039: The field, constructor or member 'Spawn' is not defined (FS0039) Could someone try this in VisualStudio please, I don't know whether this is a Mono problem, or my problem. I have tried several Async examples from the F# book, and they also all produce similar messages about Async.* methods. Thanks, Chris. #light open System open System.IO open System.Threading open System.Net open System.Net.Sockets open Microsoft.FSharp.Control.CommonExtensions printfn "%s" "Hello World!" let headers = System.Text.Encoding.ASCII.GetBytes("HTTP/1.0 200 OK\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: 37\r\nDate: Sun, 13 Jun 2010 05:30:00 GMT\r\nServer: FSC/0.0.1\r\n\r\n") let content = System.Text.Encoding.ASCII.GetBytes("<html><body>Hello World</body></html>") let serveAsync (client : TcpClient) = async { let out = client.GetStream() do! out.AsyncWrite(headers) do! Async.Sleep 3000 do! out.AsyncWrite(content) do out.Close() } let http_server (ip, port) = let server = new TcpListener(IPAddress.Parse(ip),port) server.Start() while true do let client = server.AcceptTcpClient() printfn "new client" Async.Spawn (serveAsync client) http_server ("0.0.0.0", 1234)

    Read the article

  • Is vbscripting that difficult?

    - by eric young
    I need to write some vbscripts in my new project. I was told by other people that vbscripting is easy, but seems to me, it is not. For example, in the following example (provided by microsoft), these functions: CreateObject, CreateShortcut, as well as these property names: TargetPath, WindowStyle, Hotkey, etc, are used, but I just cannot find the corresponding API documentation about how to use them. In other words, how do you know you need to call these functions in your vbscripts? Visual Studio 2008/2010 do not have templates for vbscript either. Could anybody tell me what I am missing, and what the best way is to do vbscripting? set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") set oShellLink = WshShell.CreateShortcut(strDesktop _ & "\MyExcel.lnk") oShellLink.TargetPath = _ "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" oShellLink.WindowStyle = 1 oShellLink.Hotkey = "CTRL+SHIFT+F" oShellLink.IconLocation = _ "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE, 0" oShellLink.Description = "My Excel Shortcut" oShellLink.WorkingDirectory = strDesktop oShellLink.Save

    Read the article

  • NHibernate.NHibernateException: Unable to locate row for retrieval of generated properties: [MyNames

    - by Brad Heller
    It looks like all of my mappings are compiling correctly, I'm able to validly get a session from session factory. However, when I try to ISession.SaveOrUpdate(obj); I get this. Can anyone please help point me in the right direction? private Configuration configuration; protected Configuration Configuration { get { configuration = configuration ?? GetNewConfiguration(); return configuration; } } protected ISession GetNewSession() { var sessionFactory = Configuration.BuildSessionFactory(); var session = sessionFactory.OpenSession(); return session; } [TestMethod] public void TestSessionSave() { var company = new Company(); company.Name = "Test Company 1"; DateTime savedAt = DateTime.Now; using (var session = GetNewSession()) { try { session.SaveOrUpdate(company); } catch (Exception e) { throw e; } } Assert.IsTrue((company.CreationDate != null && company.CreationDate > savedAt), "Company was saved, creation date was set."); } For those that might be interested, here is my mapping for this class: <!-- Company --> <class name="MyNamespace.Company,MyLibrary" table="Companies"> <id name="Id" column="Id"> <generator class="native" /> </id> <property name="ExternalId" column="GUID" generated="insert" /> <property name="Name" column="Name" type="string" /> <property name="CreationDate" column="CreationDate" generated="insert" /> <property name="UpdatedDate" column="UpdatedDate" generated="always" /> </class> <!-- End Company --> Finally, here is my config -- I'm just connecting to a SQL Server CE instance for this for testing purposes. <?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory name=""> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property> <property name="connection.connection_string">Data Source="D:\Build\MyProject\Source\MyProject.UnitTests\MyProject.TestDatabase.sdf"</property> <property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property> <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property> </session-factory> </hibernate-configuration> Thanks!

    Read the article

  • How to get data in the servlet send via dojo.xhrPost

    - by snell
    > var xhrArgs = { > url: '/mum/proxy/http/localhost:8080/DemoProject/MyServlet', > postData:' MyDataToBeSend', > handleAs: 'text', > load: function(data) { }, > error: function(error) {alert(error);}}; var ret = > dojo.xhrGet(xhrArgs); Hi All, I have written the above code in Javascript to send data to a servlet. But I am not understanding how to get the postData in the servlet.

    Read the article

  • Interacts with dialog/whiptail on early boot rcX.d stage?

    - by nm
    Hi buddies, I'm developing on Ubuntu based, actually I got one script in-charged on GUI(console) setup. It runs before another scripts (rcX.d) start. Currently, I installed this script on rc2.d and start earlier than other ones. But when run on real machine, I can't input any keystroke on "dialog --inputbox" or whiptail through shell script. Additionally, It runs well on my Virtual Machine (Virtual Box and Vmware), that's so strange! So, does anybody give some help or point me any clues for overcome this ? Thanks

    Read the article

  • How to add a TabBar to NavigationController based iPhone app

    - by Alex
    I have a simple NavigationController based app. The main window shows a TableView and selecting an item loads a sub-view. I used Interface Builder for UI views. Now I want to add a TabBar to the app. Where do I put it? Do I need a TabBarController? Should it go in the MainWindow.xib, or RootViewController.xib? How do I tie it together with my NavigationController?

    Read the article

  • error C2440: '=' : cannot convert from 'std::string []' to 'std::string []'

    - by Bach
    now what is wrong with this code! Header: #pragma once #include <string> using namespace std; class Menu { public: Menu(string []); ~Menu(void); }; Implementation: #include "Menu.h" string _choices[]; Menu::Menu(string items[]) { _choices = items; } Menu::~Menu(void) { } compiler is complaining: error C2440: '=' : cannot convert from 'std::string []' to 'std::string []' There are no conversions to array types, although there are conversions to references or pointers to arrays there is no conversion! so what is it on about? please help, just need to pass a bloody array of strings and set it to Menu class _choices[] attribute. thanks

    Read the article

  • Map Reduce job on Amazon: argument for custom jar

    - by zero51
    Hi all, This is one of my first try with Map Reduce on AWS in its Management Console. Hi have uploaded on AWS S3 my runnable jar developed on Hadoop 0.18, and it works on my local machine. As described on documentation, I have passed the S3 paths for input and output as argument of the jar: all right, but the problem is the third argument that is another path (as string) to a file that I need to load while the job is in execution. That file resides on S3 bucket too, but it seems that my jar doesn't recognize the path and I got a FileNotFound Exception while it tries to load it. That is strange because this is a path exactly like the other two... Anyone have any idea? Thank you Luca

    Read the article

  • problem with selecting a rows in advanced datagrid using keydown event

    - by user365559
    Hi, I have advanced datagrid with list of items is displayed.I am using keydown for selecting the rows.But the actual problem is when i am selecting the items after the 2nd item it should move to the 3rd item but instead of that its moving back to the 1st item.I have defined selectionmode property to singlerows even then the result same to be same.can any one give me the soloution.

    Read the article

  • Formating a table date field from the Model in Codeigniter

    - by Landitus
    Hi, I', trying to re-format a date from a table in Codeigniter. The Controller is for a blog. I was succesfull when the date conversion happens in the View. I was hoping to convert the date in the Model to have things in order. Here's the date conversion as it happens in the View. This is inside the posts loop: <?php foreach($records as $row) : ?> <?php $fdate = "%d <abbr>%M</abbr> %Y"; $dateConv = mdate($fdate, mysql_to_unix($row->date)); ?> <div class="article section"> <span class="date"><?php echo $dateConv ;?></span> ... Keeps going ... This is the Model: class Novedades_model extends Model { function getAll() { $this->db->order_by('date','desc'); $query = $this->db->get('novedades'); if($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[] = $row; } } return $data; } } How can I convert the date in the Model? Can I access the date key and refactor it?

    Read the article

  • movie does not start in full screen in flash video player

    - by jodeci
    We have this legacy code of a flash video player that functions well enough but still has some loose ends I need to tighten up. It can do the basic "switch to full screen and back to normal size" stunts, however with one exception. On the first fresh load of the app, if I switch to full screen mode first, and then click to play the movie, the player would be in full screen, yet the movie itself would remain in it's original size. //trigger if (stage.displayState == StageDisplayState.NORMAL) { stage.addEventListener('fullScreen', procFullScreen); stage.scaleMode = StageScaleMode.NO_SCALE; stage.displayState = StageDisplayState.FULL_SCREEN; //mv:VideoDisplay mv.percentHeight = 100; mv.percentWidth = 100; mv.x = 0; mv.y = 0; } // event handler if (event.fullScreen) { mv.smoothing = true; this.height = stage.height; this.width = stage.width; //videoCanvas:Canvas videoCanvas.height = Application.application.height; videoCanvas.width = Application.application.width; fullScreenViewStack.selectedIndex = 1; } The VideoDisplay object even returns the expected width/height, but the movie just plays in it's original size. If I switch screen sizes during movie playback, then the movie size will shrink or stretch as it should. I'm running out of ideas, any suggestions? Thanks in advance!

    Read the article

  • Unitesting JSPs

    - by Avi Y
    Hi, I would like to ask you what technologies exist out there for creating unitests for JSPs. I am already aware of the HtmlUnit/HttpUnit/JWebUnit/Selenium possibilities. Thank you!

    Read the article

  • How can I read out the CSS text via Javascript as defined in the stylesheet?

    - by Monokai
    I was thinking of using Javascript to automatically transform CSS3 attributes like border-radius, transform, box-shadow, etc. to their browser specific counterparts. I did some research and found that you can iterate over the stylesheets defined via document.styleSheets. You can find the CSS rules via document.styleSheets[0].cssRules[0].cssText. I want to modify the CSS rules that contain CSS3 attributes by injecting the browser specific attributes with the appropriate vendor-prefix, like -webkit-border-radius, moz-border-radius, etc. However, it seems that the cssText property is preprocessed in each browser, to filter out CSS attributes that it doesn't understand. That practically breaks this idea. Question: is there any way to retrieve the CSS text exactly as defined in the stylesheet? Or: is there another way to accomplish this via Javascript? I'd like to maintain clean CSS files without the need for defining each attribute multiple times for each specific browser.

    Read the article

  • Integrating Simple Machines Forum in my custom membership site - login not working?

    - by Ali
    Hi guys I'm trying to integrate simple machines forum into my custom made membership website. I'm using the SMF API which is available here at http://download.simplemachines.org/?tools. The thing is that its working on my localhost testing server - however on my online server where the system is hosted - its not working. I have set it up so that when the user log into my own custom CMS membership site, he/she is logged in automatically to his/her corresponding account on the forum. However it works on my localhost but online its not working at all.. I log into my site and then browse to the forum to find out I havent been logged in there :( - I think its not creating the cookies or registering the session.. where should I look here. Please do help.

    Read the article

  • Access denied exception while accessing process.MainModule.FileName

    - by Manjoor
    I am listing all running processes in system with it full path. My application is running fine in XP but in vista, it gives access denied exception while accessing MainModule.FileName. (Due to UAC, i think). foreach (Process process in Process.GetProcesses()) { sProcess = process.ProcessName; sFullpath = process.MainModule.FileName; .. .. .. } I did not find a solution to deal with UAC. Any clue??

    Read the article

  • Anyone know of a command-line torrent client to run on a server?

    - by DJTripleThreat
    I have an account with a torrent site that gives and takes credits when you upload/download respectively. My ideal setup to keep my credits going would be some kind of media box that keeps and manages my music and videos etc. Ideally, I'd like this to be a headless box that I could just telnet into and have it run torrents that way. This server would be running ubuntu server by the way.

    Read the article

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