Search Results

Search found 1405 results on 57 pages for 'martin eve'.

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

  • VBScript - copy files modified in last 24 hours

    - by Martin North
    Hi, I'm trying to copy files from a directory where the last modified date is within 24hours of the current date. I'm using a wildcard in the filepath as it changes every day I'm using; option explicit dim fileSystem, folder, file dim path path = "d:\x\logs" Set fileSystem = CreateObject("Scripting.FileSystemObject") Set folder = fileSystem.GetFolder(path) for each file in folder.Files If DateDiff("d", file.DateLastModified, Now) < 1 Then filesystem.CopyFile "d:\x\logs\apache_access_log-*", "d:\completed logs\" WScript.Echo file.Name & " last modified at " & file.DateLastModified end if next Unfortunately this seems to be copying all files, and not just the recently modified ones. Can anyone point me in the right direction? many thanks Martin.

    Read the article

  • Simplest way to use a DatagridView with Linq to SQL

    - by Martín Marconcini
    Hi, I have never used datagrids and such, but today I came across a simple problem and decided to "databind" stuff to finish this faster, however I've found that it doesn't work as I was expecting. I though that by doing something as simple as: var q = from cust in dc.Customers where cust.FirstName == someString select cust; var list = new BindingList<Customer>(q.ToList()); return list; Then using that list in a DataGridView1.DataSource was all that I needed, however, no matter how much I google, I can't find a decent example on how to populate (for add/edit/modify) the results of a single table query into a DataGridView1. Most samples talk about ASP.NET which I lack, this is WinForms. Any ideas? I've came across other posts and the GetNewBindingList, but that doesn't seem to change much. What am I missing (must be obvious)? Thanks in advance. Martin.

    Read the article

  • Copying contents of a MySQL table to a table in another (local) database

    - by Philip Eve
    I have two MySQL databases for my site - one is for a production environment and the other, much smaller, is for a testing/development environment. Both have identical schemas (except when I am testing something I intend to change, of course). A small number of the tables are for internationalisation purposes: TransLanguage - non-English languages TransModule - modules (bundles of phrases for translation, that can be loaded individually by PHP scripts) TransPhrase - individual phrases, in English, for potential translation TranslatedPhrase - translations of phrases that are submitted by volunteers ChosenTranslatedPhrase - screened translations of phrases. The volunteers who do translation are all working on the production site, as they are regular users. I wanted to create a stored procedure that could be used to synchronise the contents of four of these tables - TransLanguage, TransModule, TransPhrase and ChosenTranslatedPhrase - from the production database to the testing database, so as to keep the test environment up-to-date and prevent "unknown phrase" errors from being in the way while testing. My first effort was to create the following procedure in the test database: CREATE PROCEDURE `SynchroniseTranslations` () LANGUAGE SQL NOT DETERMINISTIC MODIFIES SQL DATA SQL SECURITY DEFINER BEGIN DELETE FROM `TransLanguage`; DELETE FROM `TransModule`; INSERT INTO `TransLanguage` SELECT * FROM `PRODUCTION_DB`.`TransLanguage`; INSERT INTO `TransModule` SELECT * FROM `PRODUCTION_DB`.`TransModule`; INSERT INTO `TransPhrase` SELECT * FROM `PRODUCTION_DB`.`TransPhrase`; INSERT INTO `ChosenTranslatedPhrase` SELECT * FROM `PRODUCTION_DB`.`ChosenTranslatedPhrase`; END When I try to run this, I get an error message: "SELECT command denied to user 'username'@'localhost' for table 'TransLanguage'". I also tried to create the procedure to work the other way around (that is, to exist as part of the data dictionary for the production database rather than the test database). If I do it that, way, I get an identical message except it tells me I'm denied the DELETE command rather than SELECT. I have made sure that my user has INSERT, DELETE, SELECT, UPDATE and CREATE ROUTINE privileges on both databases. However, it seems as though MySQL is reluctant to let this user exercise its privileges on both databases at the same time. How come, and is there a way around this?

    Read the article

  • Huh? Android Preferences page refuses to load after adding SDK 1.6

    - by Android Eve
    This one is really weird. I had a perfectly working Eclipse + Android 2.2 SDK working in both Administrator account and LUA (Limited User Account) under Windows XP. Then I decided to add the Android 1.6 SDK (I could do it from an Administrator account only). It seemed to have gone well, since it still works perfectly -- but only in that Administrator account! When I try to start Eclipse under a LUA, I receive the following error message box: Which disappears within 2-3 seconds and replaced with: I then tried to check the Preferences page, but again, all I receive is error messages: and: Any idea why this is happening and how to fix this? (I would love to be able to continue working from a LUA)

    Read the article

  • Which data structure for List of objects + datagrid wiev

    - by Martin
    Hi, I have to develop a code which will store a list of objects, as example below 101, value 11, value 12, value 13 ...etc 102, value 21, value 22, value 23 ...etc 103, value 31, value 32, value 33 ...etc 104, value 41, value 42, value 43 ...etc Now, the difficulty is, that first column is an identifier, and whole table should always be sorted by it. Easy access to each element is required. Additionally, list should be easily updated, and extended by adding element at the end as well as in front and still keep being sorted by first column. Finally, I would like to be able to display values of the above in datagridview. What is most important is a performance of the implementation, as rows will be updated many times per second, and datagridview should be able to display all changes immediately. I was thinking about creating class for the values, and then a Dictionary but encountered a problem with displaying values in gridview. What would be the most optimal way of implementing the code? Thanks in advance Martin

    Read the article

  • Squid on windows loadbalancing only to one server

    - by Martin L.
    After thousands of googles and trying days i cant get the load balancer/failover in squid on windows to work. Iam using squid 2.7. My webservers are 2 single NIC lighttpd and one dual nic lighttpd. server1 in this example is running squid on port 80 and lighttpd on port 8080 (just to test) Requirements: All 3 webservers running lighttpd should be balanced two option for load balancing: Best would be if server1 is busy server2 takes over, if server2 is busy server3 takes over, etc.. Round robin style evenly distributed load. Eg server1 takes first call, server2 second etc.. All requests should be treated the same way (no url rewriting or so on) Sent host headers have to be redirected to every server as http host header, speaking of "server1", "server1.company.internal" and "10.211.1.1". My approach: acl all src all acl manager proto cache_object http_port 80 accel defaultsite=server1.company.internal vhost #reverse proxy entries cache_peer 10.211.2.1 parent 8080 0 no-query originserver round-robin login=PASS name=server1_nic1 cache_peer 10.211.1.2 parent 80 0 no-query originserver round-robin login=PASS name=server2_nic1 cache_peer 10.211.2.3 parent 8080 0 no-query originserver round-robin login=PASS name=server3_nic1 cache_peer 10.211.2.4 parent 8080 0 no-query originserver round-robin login=PASS name=server3_nic2 #decl of names of squid host acl registered_name_hostdomain dstdomain server1.company.internal acl registered_name_host dstdomain server1 #ip of squid host acl registered_name_ip dstdomain 10.211.2.1 # access: redirects the correct squid hostname http_access allow registered_name_hostdomain http_access allow registered_name_host http_access allow registered_name_ip http_access deny all cache_peer_access server1_nic1 allow registered_name_hostdomain cache_peer_access server1_nic1 allow registered_name_host cache_peer_access server1_nic1 allow registered_name_ip cache_peer_access server2_nic1 allow registered_name_hostdomain cache_peer_access server2_nic1 allow registered_name_host cache_peer_access server2_nic1 allow registered_name_ip cache_peer_access server3_nic1 allow registered_name_hostdomain cache_peer_access server3_nic1 allow registered_name_host cache_peer_access server3_nic1 allow registered_name_ip cache_peer_access server3_nic2 allow registered_name_hostdomain cache_peer_access server3_nic2 allow registered_name_host cache_peer_access server3_nic2 allow registered_name_ip cache_peer_access server1_nic1 deny all cache_peer_access server2_nic1 deny all cache_peer_access server3_nic1 deny all cache_peer_access server3_nic2 deny all never_direct allow all Problems: Load balancer does not load balance other than to first server. Only if the first server is killed in any way the second will take over. I have seen the others working at some point, but definitely not as the intended load balancing described above. If the cache_peer_access is not defined sometimes the wrong hostname is sent to the backend webserver and this always depends on the defaultsite= parameter. Probably because the host header on the request to squid is not set and its replaced by defaultsite. Leaving out defaultsite didnt solve the problem. The only workaround i found for this is the current approach with cache_peer_access. Questions: Does the cache_peer_access influence the round-robin? Is there a better workaround to pass the host header to the backed webservers? Which parameters do increase the speed of load balancing or does anyone have a better approach? -Martin

    Read the article

  • How much does an InnoDB table benefit from having fixed-length rows?

    - by Philip Eve
    I know that dependent on the database storage engine in use, a performance benefit can be found if all of the rows in the table can be guaranteed to be the same length (by avoiding nullable columns and not using any VARCHAR, TEXT or BLOB columns). I'm not clear on how far this applies to InnoDB, with its funny table arrangements. Let's give an example: I have the following table CREATE TABLE `PlayerGameRcd` ( `User` SMALLINT UNSIGNED NOT NULL, `Game` MEDIUMINT UNSIGNED NOT NULL, `GameResult` ENUM('Quit', 'Kicked by Vote', 'Kicked by Admin', 'Kicked by System', 'Finished 5th', 'Finished 4th', 'Finished 3rd', 'Finished 2nd', 'Finished 1st', 'Game Aborted', 'Playing', 'Hide' ) NOT NULL DEFAULT 'Playing', `Inherited` TINYINT NOT NULL, `GameCounts` TINYINT NOT NULL, `Colour` TINYINT UNSIGNED NOT NULL, `Score` SMALLINT UNSIGNED NOT NULL DEFAULT 0, `NumLongTurns` TINYINT UNSIGNED NOT NULL DEFAULT 0, `Notes` MEDIUMTEXT, `CurrentOccupant` TINYINT UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`Game`, `User`), UNIQUE KEY `PGR_multi_uk` (`Game`, `CurrentOccupant`, `Colour`), INDEX `Stats_ind_PGR` (`GameCounts`, `GameResult`, `Score`, `User`), INDEX `GameList_ind_PGR` (`User`, `CurrentOccupant`, `Game`, `Colour`), CONSTRAINT `Constr_PlayerGameRcd_User_fk` FOREIGN KEY `User_fk` (`User`) REFERENCES `User` (`UserID`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Constr_PlayerGameRcd_Game_fk` FOREIGN KEY `Game_fk` (`Game`) REFERENCES `Game` (`GameID`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=INNODB CHARACTER SET utf8 COLLATE utf8_general_ci The only column that is nullable is Notes, which is MEDIUMTEXT. This table presently has 33097 rows (which I appreciate is small as yet). Of these rows, only 61 have values in Notes. How much of an improvement might I see from, say, adding a new table to store the Notes column in and performing LEFT JOINs when necessary?

    Read the article

  • The application has stopped unexpectedly: How to Debug?

    - by Android Eve
    Please note, unlike many other questions having the subject title "application has stopped unexpectedly", I am not asking for troubleshooting a particular problem. Rather, I am asking for an outline of the best strategy for an Android/Eclipse/Java rookie to tackle this formidable task of digesting huge amounts of information in order to develop (and debug!) a simple Android application. In my case, I took the sample skeleton app from the SDK, modified it slightly and what did I get the moment I try to run it? The application (process.com.example.android.skeletonapp) has stopped unexpectedly. Please try again. OK, so I know that I have to look LogCat. It's full of timestamped lines staring at me... What do I do now? What do I need to look for? Is there a way to single-step the program, to find the statement that makes the app crash? (I thought Java programs never crash, but apparently I was mistaken) How do I place a breakpoint? Can you recommend an Android debug tutorial online, other than this one?

    Read the article

  • How Many States Does an Activity Have?

    - by Android Eve
    The Activity lifecycle section in the Application Fundamentals tutorial states that there are 3 states: An activity has essentially three states: (1. active/running 2. paused 3. stopped) But then as I continued reading the actual Activity class documentation, the Activity Lifecycle section states that there are 4 state: An activity has essentially four states: (1. active/running 2. paused 3. stopped 4. "dropped"?) Both sources (on the same website) agree about the first 3, but the 4th one is only mentioned in the class documentation and is unnamed. So, are there really 4 states or only 3? If there are 4, what is the name of the 4th one? Please help me understand this discrepancy. Also, highlighted colored blocks in this beautiful and very informative flowchart don't seem to correspond to the states. Where, in the flowchart, would you mark the 3 or 4 states?

    Read the article

  • What can't the NDK be used for?

    - by Android Eve
    From the official NDK site: The Android NDK... provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change. Yet, it is always described as a companion tool to the Android SDK and as a toolset that allows to "implement parts of your applications using native-code languages such as C and C++". My understanding from this is that, unlike the Java based SDK, the NDK is not designed to implement certain parts of an Android application. Is this correct? If so, what parts doesn't the NDK allow implementing?

    Read the article

  • Google app engine-php: script handler

    - by Eve
    I try to create php web app using GAE. In the GAE tutorial, "A script handler executes a PHP script to handle the request that matches the URL pattern. The mapping defines a URL pattern to match, and the script to be executed" Now I want to map the url with the file having same name in the folder, e.g. if the url is /hello.* , it will map the file name hello.php in the folder. And if it is /hello1.*, hello1.php in the folder will be responded to the server. I thought this should be done directly by mapping the name of the url with the name in the folder. But if I left empty for the handler in the app.yaml, I got an error. So I want to know how to set up the handler in app.yaml?

    Read the article

  • GROUP_CONCAT in CodeIgniter

    - by mickaelb91
    I'm just blocking to how create my group_concat with my sql request in CodeIgniter. All my queries are listed in a table, using Jtable library. All work fine, except when I try to insert GROUP_CONCAT. Here's my model page : function list_all() { $login_id = $this->session->userdata('User_id'); $this->db->select('p.project_id, p.Project, p.Description, p.Status, p.Thumbnail, t.Template'); $this->db->from('assigned_projects_ppeople a'); $this->db->where('people_id', $login_id); $this->db->join('projects p', 'p.project_id = a.project_id'); $this->db->join('project_templates t', 't.template_id = p.template_id'); $this->db->select('GROUP_CONCAT(u.Asset SEPARATOR ",") as assetslist', FALSE); $this->db->from('assigned_assets_pproject b'); $this->db->join('assets u', 'u.asset_id = b.asset_id'); $query = $this->db->get(); $rows = $query->result_array(); //Return result to jTable $jTableResult = array(); $jTableResult['Result'] = "OK"; $jTableResult['Records'] = $rows; return $jTableResult; } My controller page : function listRecord(){ $this->load->model('project_model'); $result = $this->project_model->list_all(); print json_encode($result); } And to finish my view page : <table id="listtable"></table> <script type="text/javascript"> $(document).ready(function () { $('#listtable').jtable({ title: 'Table test', actions: { listAction: '<?php echo base_url().'project/listRecord';?>', createAction: '/GettingStarted/CreatePerson', updateAction: '/GettingStarted/UpdatePerson', deleteAction: '/GettingStarted/DeletePerson' }, fields: { project_id: { key: true, list: false }, Project: { title: 'Project Name' }, Description: { title: 'Description' }, Status: { title: 'Status', width: '20px' }, Thumbnail: { title: 'Thumbnail', display: function (data) { return '<a href="<?php echo base_url('project');?>/' + data.record.project_id + '"><img class="thumbnail" width="50px" height="50px" src="' + data.record.Thumbnail + '" alt="' + data.record.Thumbnail + '" ></a>'; } }, Template: { title: 'Template' }, Asset: { title: 'Assets' }, RecordDate: { title: 'Record date', type: 'date', create: false, edit: false } } }); //Load person list from server $('#listtable').jtable('load'); }); </script> I read lot of posts talking about that, like replace ',' separator by ",", or use OUTER to the join, or group_by('p.project_id') before using get method, don't work. Here is a the output of the query in json : {"Result":"OK","Records":[{"project_id":"1","Project":"Adam & Eve : A Famous Story","Description":"The story about Adam & Eve reviewed in 3D Animation movie !","Status":"wip","Thumbnail":"http:\/\/localhost\/assets\/images\/thumb\/projectAdamAndEve.png","Template":"Animation Movie","assetslist":"Apple, Adam, Eve, Garden of Eden"}]} We can see the GROUP_CONCAT is here (after "assetslist"), but the column stills empty. If asked, I can post the database SQL file. Thank you.

    Read the article

  • According to MSDN ReadFile() Win32 function may incorrectly report read operation completion. When?

    - by Martin Dobšík
    The MSDN states in its description of ReadFile() function (http://msdn.microsoft.com/en-us/library/aa365467%28VS.85%29.aspx): “If hFile is opened with FILE_FLAG_OVERLAPPED, the lpOverlapped parameter must point to a valid and unique OVERLAPPED structure, otherwise the function can incorrectly report that the read operation is complete.” I have some applications that are violating the above recommendation and I would like to know the severity of the problem. I mean the program uses named pipe that has been created with FILE_FLAG_OVERLAPPED, but it reads from it using the following call: ReadFile(handle, &buf, n, &n_read, NULL); That means it passes NULL as the lpOverlapped parameter. That call should not work correctly in some circumstances according to documentation. I have spent a lot of time trying to reproduce the problem, but I was unable to! I always got all data in right place at right time. I was testing only Named Pipes though. Would anybody know when can I expect that ReadFile() will incorrectly return and report successful completion even the data are not yet in the buffer? What would have to happen in order to reproduce the problem? Does it happen with files, pipes, sockets, consoles, or other devices? Do I have to use particular version of OS? Or particular version of reading (like register the handle to I/O completion port)? Or particular synchronization of reading and writing processes/threads? Or when would that fail? It works for me :/ Please help! With regards Martin

    Read the article

  • Purpose of dereferencing a pointer as a parameter in C.

    - by Leif Andersen
    I recently came along this line of code: CustomData_em_free_block(&em->vdata, &eve->data); And I thought, isn't: a->b just syntactic sugar for: (*a).b With that in mind, this line could be re-written as: CustomData_em_free_block(&(*em).vdata, &(*eve).data); If that's the case, what is the point of passing in &(*a), as a parameter, and not just a? It seems like the pointer equivalent of -(-a) is being passed in in, is there any logic for this? Thank you.

    Read the article

  • Excel VBA: Passing a collection from a class to a module issue

    - by Martin
    Hello, I have been trying to return a collection from a property within a class to a routine in a normal module. The issue I am experiencing is that the collection is getting populated correctly within the property in the class (FetchAll) but when I pass the collection back to the module (Test) all the entries are populated with the last item in the list. This is the Test sub-routine in the standard module: Sub Test() Dim QueryType As New QueryType Dim Item Dim QueryTypes As Collection Set QueryTypes = QueryType.FetchAll For Each Item In QueryTypes Debug.Print Item.QueryTypeID, _ Left(Item.Description, 4) Next Item End Sub This is the FetchAll property in the QueryType class: Public Property Get FetchAll() As Collection Dim RS As Variant Dim Row As Long Dim QTypeList As Collection Set QTypeList = New Collection RS = .Run ' populates RS with a record set from a database (as an array), ' some code removed ' goes through the array and sets up objects for each entry For Row = LBound(RS, 2) To UBound(RS, 2) Dim QType As New QueryType With QType .QueryTypeID = RS(0, Row) .Description = RS(1, Row) .Priority = RS(2, Row) .QueryGroupID = RS(3, Row) .ActiveIND = RS(4, Row) End With ' adds new QType to collection QTypeList.Add Item:=QType, Key:=CStr(RS(0, Row)) Debug.Print QTypeList.Item(QTypeList.Count).QueryTypeID, _ Left(QTypeList.Item(QTypeList.Count).Description, 4) Next Row Set FetchAll = QTypeList End Property This is the output I get from the debug in FetchAll: 1 Numb 2 PBM 3 BPM 4 Bran 5 Claw 6 FA C 7 HNW 8 HNW 9 IFA 10 Manu 11 New 12 Non 13 Numb 14 Repo 15 Sell 16 Sms 17 SMS 18 SWPM This is the output I get from the debug in Test: 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM 18 SWPM Anyone got any ideas? I am probably totally overlooking something! Thanks, Martin

    Read the article

  • Version Control and Coding Formatting

    - by Martin Giffy D'Souza
    Hi, I'm currently part of the team implementing a new version control system (Subversion) within my organization. There's been a bit of a debate on how to handle code formatting and I'd like to get other peoples opinions and experiences on this topic. We currently have ~10 developers each using different tools (due to licensing and preference). Some of these tools have automatic code formatters and others don't. If we allow "blind" checkins the code will look drastically different each time someone does a check in. This will make things such as diffs and merges complicated. I've talked to several people and they've mentioned the following solutions: Use the same developer program with the same code formatter (not really an option due to licensing) Have a hook (either client or server side) which will automatically format the code before going into the repository Manually format the code. Regarding the 3rd point, the concept is to never auto-format the code and have some standards. Right now that seems to be what we're leaning towards. I'm a bit hesitant on that approach as it could lead to developers spending a lot of time manually formatting code. If anyone can please provide some their thoughts and experience on this that would be great. Thank you, Martin

    Read the article

  • Assigning specific menu administration rights for roles in drupal

    - by Martin Andersson
    Hello folks. I'm trying to give one of my roles the administrative rights to add/remove content in a specific menu (but not all menus). I think I found a module that should enable something like this, http://drupalmodules.com/module/delegate-menu-administration I've followed the instructions, added the role to my user, checked the "administer some menus" value for that role and checked the "Make admin" field for that role and specific menu in Menus. I also gave the role permissions to change page and story content. However, it still wont let the user add any new content it creates in any menu, and I get an error message saying "warning: Invalid argument supplied for foreach() in /home/martin/www/drupal/modules/delegate_menu_admin/delegate_menu_admin.module on line 346." Line 346 looks like this: foreach ($form['menu']['parent']['#options'] as $key => $value) { I did a print_r($form); in the file just before it and there's no such array that I can see: [menu] => Array ( [#access] => 1 [delete] => Array ( [#access] => ) ) When I gave the role "administer menu" permissions, nothing extra was printed at all, leading me to the assumption that the delegate_menu_admin.module file is not used at all while both the "administer menu" and the "administer some menus" (from the delegate-menu-administration module) permissions are set! Is this some incompatibility between the module because of some drupal update? Or am I just too tired and too stupid? :)

    Read the article

  • Loading the target of a link in a <DIV> via jQuery's .live event into the same <DIV>??

    - by Martin Pescador
    Hello together I call a certain div from another page with jquery to be loaded into a div on my main page like this: <script type="text/javascript"> $("#scotland").load("http://www.example.com/scotland .gallery"); </script> <div id="scotland"></div> The div I call is a piece of code which is automatically generated by a CMS made simple module, by the way. Now it comes to my problem: The .gallery div I call, looks, a little simplified, like this: <div class="gallery"> <span><img src="http://www.example.com/scotlandimage1.jpg"></span> <span class="imgnavi"><a href="link_to_next_page_with_one_image">Next image</href></span> </div> I want the "next image"-link to load the next page into the .gallery div (it is always a page with one image on it). But what it does, is, it opens the new page http://www.example.com/scotland only. I tried to use jquerys .live event to load the linked page (that would be "scotlandimage2" and the navigation, as you can see in the upper part - not only the image!), but I must have done something wrong. I tried different ways, but never got it to work. This was my last try: $(".imgnavi a").click(function() { var myUrl = $(this).attr("href"); $(".gallery").load(myUrl); return false; }); I have to admit that I am very new to jquery... But does someone know what I did wrong (do I even follow the right handlers?)? Thanks very much in advance! Martin

    Read the article

  • How to visualize a list of lists of lists of ... in R?

    - by Martin
    Hi there, I have a very deep list of lists in R. Now I want to print this list to the standard output to get a better overview of the elements. It should look like the way the StatET plugin for eclipse shows a list. Example list: l6 = list() l6[["h"]] = "one entry" l6[["g"]] = "nice" l5 = list() l5[["e"]] = l6 l4 = list() l4[["f"]] = "test" l4[["d"]] = l5 l3 = list() l3[["c"]] = l4 l2 = list() l2[["b"]] = l3 l1 = list() l1[["a"]] = l2 This should print like: List of 1 $ a:List of 1 ..$ b:List of 1 .. ..$ c:List of 2 .. .. ..$ f: chr "test" .. .. ..$ d:List of 1 .. .. .. ..$ e:List of 2 .. .. .. .. ..$ h: chr "one entry" .. .. .. .. ..$ g: chr "nice" I know this is possible with recursion and the deepness. But is there a way to do this with the help of rapply or something like that? Thanx in advance, Martin

    Read the article

  • Why does ANTLR not parse the entire input?

    - by Martin Wiboe
    Hello, I am quite new to ANTLR, so this is likely a simple question. I have defined a simple grammar which is supposed to include arithmetic expressions with numbers and identifiers (strings that start with a letter and continue with one or more letters or numbers.) The grammar looks as follows: grammar while; @lexer::header { package ConFreeG; } @header { package ConFreeG; import ConFreeG.IR.*; } @parser::members { } arith: term | '(' arith ( '-' | '+' | '*' ) arith ')' ; term returns [AExpr a]: NUM { int n = Integer.parseInt($NUM.text); a = new Num(n); } | IDENT { a = new Var($IDENT.text); } ; fragment LOWER : ('a'..'z'); fragment UPPER : ('A'..'Z'); fragment NONNULL : ('1'..'9'); fragment NUMBER : ('0' | NONNULL); IDENT : ( LOWER | UPPER ) ( LOWER | UPPER | NUMBER )*; NUM : '0' | NONNULL NUMBER*; fragment NEWLINE:'\r'? '\n'; WHITESPACE : ( ' ' | '\t' | NEWLINE )+ { $channel=HIDDEN; }; I am using ANTLR v3 with the ANTLR IDE Eclipse plugin. When I parse the expression (8 + a45) using the interpreter, only part of the parse tree is generated: http://imgur.com/iBaEC.png Why does the second term (a45) not get parsed? The same happens if both terms are numbers. Thank you, Martin Wiboe

    Read the article

  • Oracle syntax - should we have to choose between the old and the new?

    - by Martin Milan
    Hi, I work on a code base in the region of about 1'000'000 lines of source, in a team of around eight developers. Our code is basically an application using an Oracle database, but the code has evolved over time (we have plenty of source code from the mid nineties in there!). A dispute has arisen amongst the team over the syntax that we are using for querying the Oracle database. At the moment, the overwhelming majority of our queries use the "old" Oracle Syntax for joins, meaning we have code that looks like this... Example of Inner Join select customers.*, orders.date, orders.value from customers, orders where customers.custid = orders.custid Example of Outer Join select customers.custid, contacts.ContactName, contacts.ContactTelNo from customers, contacts where customers.custid = contacts.custid(+) As new developers have joined the team, we have noticed that some of them seem to prefer using SQL-92 queries, like this: Example of Inner Join select customers.*, orders.date, orders.value from customers inner join orders on (customers.custid = orders.custid) Example of Outer Join select customers.custid, contacts.ContactName, contacts.ContactTelNo from customers left join contacts on (customers.custid = contacts.custid) Group A say that everyone should be using the the "old" syntax - we have lots of code in this format, and we ought to value consistency. We don't have time to go all the way through the code now rewriting database queries, and it wouldn't pay us if we had. They also point out that "this is the way we've always done it, and we're comfortable with it..." Group B however say that they agree that we don't have the time to go back and change existing queries, we really ought to be adopting the "new" syntax on code that we write from here on in. They say that developers only really look at a single query at a time, and that so long as developers know both syntax there is nothing to be gained from rigidly sticking to the old syntax, which might be deprecated at some point in the future. Without declaring with which group my loyalties lie, I am interested in hearing the opinions of impartial observers - so let the games commence! Martin. Ps. I've made this a community wiki so as not to be seen as just blatantly chasing after question points...

    Read the article

  • Running an executable on network share with CustomAction with wix?

    - by martin
    Hello, i have created a msi-package which compresses some xml-files to a zip-file during installation. I have created a CustomAction for this purposes: <CustomAction Id="CompressMy" BinaryKey="zipEXE" ExeCommand="a -tzip &quot;[TEMPLATE_DIR]my.zip&quot; &quot;[TempSourceFolder]data.xml&quot;" Return="check" HideTarget="no" Impersonate="no" Execute="deferred" /> The installation works fine, if i try to install to a local drive, but recently a customer wanted to install [TEMPLATE_DIR] to a network drive on Windows Vista. The CustomAction fails, because of the elevated install-user hasn't mapped the network drive, even if the installer-calling user has mapped the drive. This happens also, if I try to install to an unc-path. I use 7zip for compressing. I have added it to my msi-package. I have tried to set Impersonate="yes", but then the Installations fails, if my TEMPLATE_DIR is f.e. the ProgramData-dir. Do you have any idea what i can do? I thinked about checking if TEMPLATE_DIR is a network path, but I didn't know how i can check this. Or do you have any other Ideas how I can provide a local and a network installation while using this custom action. Would be great if there are any advices, greetings, Martin

    Read the article

  • How to access elements in a complex list?

    - by Martin
    Hi, it's me and the lists again. I have a nice list, which looks like this: tmp = NULL t = NULL tmp$resultitem$count = "1057230" tmp$resultitem$status = "Ok" tmp$resultitem$menu = "PubMed" tmp$resultitem$dbname = "pubmed" t$resultitem$count = "305215" t$resultitem$status = "Ok" t$resultitem$menu = "PMC" t$resultitem$dbname = "pmc" tmp = c(tmp, t) t = NULL t$resultitem$count = "1" t$resultitem$status = "Ok" t$resultitem$menu = "Journals" t$resultitem$dbname = "journals" tmp = c(tmp, t) Which produces: str(tmp) List of 3 $ resultitem:List of 4 ..$ count : chr "1057230" ..$ status: chr "Ok" ..$ menu : chr "PubMed" ..$ dbname: chr "pubmed" $ resultitem:List of 4 ..$ count : chr "305215" ..$ status: chr "Ok" ..$ menu : chr "PMC" ..$ dbname: chr "pmc" $ resultitem:List of 4 ..$ count : chr "1" ..$ status: chr "Ok" ..$ menu : chr "Journals" ..$ dbname: chr "journals" Now I want to search through the elements of each "resultitem". I want to know the "dbname" for every database, that has less then 10 "count" (example). In this case it is very easy, as this list only has 3 elements, but the real list is a little bit longer. This could be simply done with a for loop. But is there a way to do this with some other function of R (like rapply)? My problem with those apply functions is, that they only look at one element. If I do a grep to get all "dbname" elements, I can not get the count of each element. rapply(tmp, function(x) paste("Content: ", x))[grep("dbname", names(rapply(tmp, c)))] Does someone has a better idea than a for loop? Thanx, Martin

    Read the article

  • start-stop-daemon quoted arguments misinterpreted

    - by Martin Westin
    Hi, I have been trying to make an init script using start-stop-daemon. I am stuck on the arguments to the daemon. I want to keep these in a variable at the top of the script but I can't get the quotations to filter down correctly. I'll use ls here so we don't have to look at binaries and arguments that most people wont know or care about. The end result I am looking for is for start-stop... to run ls -la "/folder with space/" DAEMON=/usr/bin/ls DAEMON_OPTS='-la "/folder with space/"' start-stop-daemon --start --make-pidfile --pidfile $PID --exec $DAEMON -- $DAEMON_OPTS Double escaping the options and trying innumerable variations of quotations do not help... Then they end up at the daemon they are always messed up. Enclosing $DAEMON_OPTS in quotes changes things... then they are seen as one since quote... never the right number though :) Echoing the command-line (start-stop...) prints exactly the right stuff to screen. But the daemon (the real one, not ls) complains about the wrong number of arguments. How do I specify a variable so that quotes inside it are brought along to the daemon correctly? Thanks, Martin

    Read the article

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