Search Results

Search found 2409 results on 97 pages for 'alex polo'.

Page 52/97 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • How can I test a CRON job with PHP?

    - by alex
    This is the first time I've ever used a CRON. I'm using it to parse external data that is automatically FTP'd to a subdirectory on our site. I have created a controller and model which handles the data. I can access the URL fine in my browser and it works (however I will be restricting this soon). My problem is, how can I test if it's working? I've added this to my controller for a quick and dirty log $file = 'test.txt'; $contents = ''; if (file_exists($file)) { $contents = file_get_contents($file); } $contents .= date('m-d-Y') . ' --- ' . PHP_SAPI . "\n\n"; file_put_contents($file, $contents); But so far only got requests logged from myself from the browser, despite having my CRON running ever minute. 03-18-2010 --- cgi-fcgi 03-18-2010 --- cgi-fcgi I've set it up using cPanel with the command index.php properties/update/ the 2nd portion is what I use to access the page in my browser. So how can I test this is working properly, and have I stuffed anything up? Note: I'm using Kohana 3. Many thanks

    Read the article

  • How to override j_security_check in glassfish?

    - by Alex B
    I'm currently using FORM based authentication in glassfish v2.1 to log users in and it works fine. I want to switch to ProgrammaticLogin and I want to be able to get the initially requested URL (i.e. before redirecting to login page) and use it in my programmatic login code so that the user is redirected back to the requested page after authentication. I've seen the source code for j_security_check - in my case that's FormAuthenticator (catalina codebase) and it saves the initial request in a SavedRequest object in the session but that session is a StandardSession rather than HttpSession so there's no direct way to access it. Or should I change the authentication mechanism from FORM to something else? Thanks!

    Read the article

  • Another Java vs. Scala perspective - is this typical?

    - by Alex R
    I have been reading about Scala for a while and even wrote some small programs to better understand some of the more exoteric features. Today I decided to do my first "real project", translating some 60 lines of ugly Java code to Scala to rewrite it using the better pattern-matching features (why? because the Java version was becoming hard to maintain due to excessive combination of regex and conditionals). About halfway through the editing process, Eclipse thew up this error: I get the general impression that the Scala IDE in Eclipse is a lot buggier and less complete than its Java equivalent. Is this correct or do I just have a bad installation? Is there a better IDE for Scala?

    Read the article

  • Kohana 3 and CRON always accessing index.php (not following the URI argument)

    - by alex
    OK, I hope this is my last question about CRON jobs and Kohana 3. Note: others are not duplicates, just other problems. Here is my CRON job (setup in cPanel) php /home/user/public_html/index.php --uri=properties/update As per this answer. I have set it up so it emails me the output. It is running every 5 mins. Unfortunately, it always emails me the source of the home page of my site (index.php or /). I can access that URL fine in my browser, i.e. http://www.example.com/properties/update and it works and does it's job correctly. I can tell the Cron is never hitting the script because I have a file logger in place. Would this have anything to do with .htaccess? Has this happened to anyone before, and how did they fix it? Many thanks.

    Read the article

  • LINQ XML query at c# wp7

    - by Karloss
    I am working at Windows Phone 7 C#, Xaml, XML and LINQ programming. I need to organize search by part of the name at following XML: <Row> <Myday>23</Myday> <Mymonth>12</Mymonth> <Mynames>Alex, Joanna, Jim</Mynames> </Row> <Row> <Myday>24</Myday> <Mymonth>12</Mymonth> <Mynames>John, David</Mynames> </Row> I have following query: var myData = from query in loadedData.Descendants("Row") where query.Element("Mynames").Value.Contains("Jo") select new Kalendars { Myday = (int)query.Element("Myday"), Mymonth = (int)query.Element("Mymonth"), Mynames = (string)query.Element("Mynames") }; listBoxSearch.ItemsSource = myData; Query problem is, that it will return full part of the names like "Alex, Joanna, Jim" and "John, David". How can i get only Joanna and John? Second question is how it is possible to do that user enters ...Value.Contains("jo") and query still returns Joanna and John? Possible solution (needs some corrections) public string Search_names { get { return search_names; } set { string line = this.Mynames; string[] names = line.Split(new[] { ", " }, StringSplitOptions.None); var jos = from name in names where name.Contains("is") select name; // ["Joanna"] // HOW TO BIND search_names? } }

    Read the article

  • C#/.NET: Separation of multipage tiff with compression "CCITT T.6" very slow

    - by Alex B
    I need to separate multiframe tiff files, and use the following method: public static Image[] GetFrames(Image sourceImage) { Guid objGuid = sourceImage.FrameDimensionsList[0]; FrameDimension objDimension = new FrameDimension(objGuid); int frameCount = sourceImage.GetFrameCount(objDimension); Image[] images = new Image[frameCount]; for (int i = 0; i < frameCount; i++) { MemoryStream ms = new MemoryStream(); sourceImage.SelectActiveFrame(objDimension, i); sourceImage.Save(ms, ImageFormat.Tiff); images[i] = Image.FromStream(ms); } return images; } It works fine, butt if the source was encoded using the CCITT T.6 compression, separating a 20-frame-file takes up to 15 seconds on my 2,5ghz CPU. Saving the images afterwards to a single file using standard compression (LZW), the separation time is under 1 second. Is there a way to speed up the process?

    Read the article

  • Can I void all JavaScript calls to $

    - by alex
    I need some scripts inside an existing site's scripts.js. This site has been online for ages, and I can not touch the scripts file. I am including it standardly in another page. There are numerous jQuery calls in the scripts file. The place I include it does not have jQuery. I want to void all $() type things. I tried this... $ = function() { }; before I included scripts.js and it didn't seem to work. I am still getting errors like $(document) is undefined Is there a way to void all these jQuery calls? Thanks

    Read the article

  • Can't concatenate 2 arrays in PHP

    - by alex
    I've recently learned how to join 2 arrays using the + operator in PHP. But consider this code... $array = array('Item 1'); $array += array('Item 2'); var_dump($array); Output is array(1) { [0]= string(6) "Item 1" } Why does this not work? Skipping the shorthand and using $array = $array + array('Item 2') does not work either. Does it have something to do with the keys?

    Read the article

  • Why do mainframe greybeards refer to DB2/zOS as "he"? [closed]

    - by Alex Nauda
    If you ask a DB2/zOS engine DBA a question about DB2's behavior, the DBA will refer to the DB2 engine as "he" much the way a sailor uses "she" to refer to his ship. For example: "Once you fill the freespace, DB2 still wants to keep those rows in cluster order in the tablespace. That's why he'll split that page in half, and you end up with lots of half-empty pages. That is, unless the cluster key of the row you've just inserted is the highest in the table, in which case he makes a new empty page, and he puts just your new row into that page. So I wouldn't have to do this REORG if you would just sort your input like I suggested." Does anyone know where this tradition comes from?

    Read the article

  • How to close the Facebook pop-up login window after the user Connects?

    - by alex
    Below is my code. For some reason, after the user logs into the little pop-up window, the little window will redirect back to '/" with a lot of session JSON junk at the end of the URL. How do I make it so that the little window closes, and my parent window refreshes? <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US" type="text/javascript"></script> <fb:login-button v="2" onlogin='window.location("/test");' size="medium">Connect</fb:login-button> <script type="text/javascript">FB.init("XXXXX",'/xd_receiver.htm');</script>

    Read the article

  • Cxf HTTPS client example

    - by alex
    Hi all, I need a Cxf client which can deal with HTTPS wsdl url. The cxf documentation isn't really big, so i would appreciate some help. Is there any example of what i want ? google isn't my friend today :( Thx for helping me.

    Read the article

  • LINQ DataLoadOptions - Retrieval of data via Fulltext/Broken Foreign Key Relationship

    - by Alex
    I've hit a brick wall: I have an SQL Function: FUNCTION [dbo].[ContactsFTS] (@searchtext nvarchar(4000)) RETURNS TABLE AS RETURN SELECT * FROM Contacts INNER JOIN CONTAINSTABLE(Contacts, *, @searchtext) AS KEY_TBL ON Contacts.Id = KEY_TBL.[KEY] which I am calling via LINQ public IQueryable<ContactsFTSResult> SearchByFullText(String searchText) { return db.ContactsFTS(searchText); } I am projecting the ContactsFTSResult collection into a List<Contact> which is then given to my viewmodel. Here is the problem: My Contacts table (and therefore the Contact object created via LINQ to SQL) has multiple FK relationships to other information, such as Contact.BillingAddressId is an FK to an Address.Id. That information is missing after I do the fulltext search (e.g. if I try to access Contact.BillingAddress it is null). Can I add this information somehow via DataLoadOptions? I tried LoadWith<Contact>(c => c.BillingAddress) but this doesn't work, I assume because of the fact that I'm calling the function instead of doing the whole query via LINQ.

    Read the article

  • Make a function which returns the original list except the argument

    - by Alex
    I want make a function which takes a list of string and a string and returns NONE if there is no string in the string list, otherwise it returns SOME of the list of string which is the same as the original list of string except it doesn't contain the initial string (pattern): fun my_function (pattern, source_list) = case source_list of [] => NONE | [x] => if pattern = x then SOME [] else NONE | x::xs => if pattern = x then SOME (xs) else SOME (x) :: my_function (pattern, xs) (* this is wrong, what to do here?*) val a = my_function ("haha", ["12", "aaa", "bbb", "haha", "ccc", "ddd"]) (* should be SOME ["12", "aaa", "bbb", "ccc", "ddd"]*) val a2 = my_function ("haha2", ["123", "aaa", "bbb", "haha", "ccc"]) (*should be NONE*) val a3 = my_function ("haha3", ["haha3"]) (* should be SOME []*) I'm confused by the 3rd case: x::xs => .... What should do there? Note that I'd like not to use any sml library function.

    Read the article

  • Is there a tool that can refactor this C code correctly?

    - by Alex
    Lets say I have the following code (the array* function are what we use for resizable arrays and they operate on pointers-to-arrays that are null initialized): typedef struct MyStruct { int i; } MyStruct; MyStruct* GetNewMyStruct(int i) { MyStruct* s = malloc(sizeof(MyStruct)); s->i = i; return s; } int SomeFunction(int number, MyStruct *elem) { MyStruct **structs = NULL; int i; for (i = 0; i < number; i++) arrayPush(&structs, GetNewMyStruct(i)); arrayPush(&structs, elem); return arraySize(&structs); } I decide that SomeFunction is too large and I want refactor it. Currently where I work we use VisualAssist X, which has some refactoring capabilities, but when I use it on this it does not work correctly. If I attempt to use it to refactor out the loop, this is what I get: void MyMethod( int number, MyStruct ** structs ) { int i; for (i = 0; i < number; i++) arrayPush(&structs, GetNewMyStruct(i)); } int SomeFunction(int number, MyStruct *elem) { MyStruct **structs = NULL; MyMethod(number, structs); arrrayPush(&structs, elem); return arraySize(&structs); } This is not correct. MyMethod should take a MyStruct ***, not a MyStruct **. This is because the code I'm refactoring takes the address of structs. The result is that the refactored version will always return 1 (since only one object has been pushed into my array) rather than number+1. Are there other tools out there that do this type of refactoring correctly?

    Read the article

  • Using memcached as a session storage with CodeIgniter

    - by Alex N.
    I am researching possibilities of using memcached as a session storage for a system built on CodeIgniter. Has anybody done this before(that's probably a stupid question :) and if so what's your experience folks? Have you used any existing libraries/extensions? As far as performance improvement what have you seen? Any caveats?

    Read the article

  • Encode/compress sequence of repeating integers

    - by Alex
    Hey there! I have very long integer sequences that look like this (arbitrary length!): 0000000001110002220033333 Now I need some algorithm to convert this string into something compressed like a9b3a3c3a2d5 Which means "a 9 times, then b 3 times, then a 3 times" and so on, where "a" stands for 0, "b" for 1, "c" for 2 and "d" for 3. How would you do that? So far nothing suitable came to my mind, and I had no luck with google because I didn't really know what to search for. What is this kind of encoding / compression called? PS: I am going to do the encoding with PHP, and the decoding in JavaScript.

    Read the article

  • Efficient Clojure workflow?

    - by Alex B
    I am developing a pet project with Clojure, but wonder if I can speed up my workflow a bit. My current workflow (with Compojure) is: Start Swank with lein swank. Go to Emacs, connect with M-x slime-connect. Load all existing source files one by one. This also starts a Jetty server and an application. Write some code in REPL. When satisfied with experiments, write a full version of a construct I had in mind. Eval (C-c C-c) it. Switch REPL to namespace where this construct resides and test it. Switch to browser and reload browser tab with the affected page. Tweak the code, eval it, check in the browser. Repeat any of the above. There are a number of annoyances with it: I have to switch between Emacs and the browser (or browsers if I am testing things like templating with multiple browsers) all the time. Is there a common idiom to automate this? I used to have a JavaScript bit that reloads the page continuously, but it's of limited utility, obviously, when I have to interact with the page for more than a few seconds. My JVM instance becomes "dirty" when I experiment and write test functions. Basically namespaces become polluted, especially if I'm refactoring and moving the functions between namespaces. This can lead to symbol collisions and I need to restart Swank. Can I undef a symbol? I load all source files one by one (C-c C-k) upon restarting Swank. I suspect I'm doing it all wrong. Switching between the REPL and the file editor can be a bit irritating, especially when I have a lot of Emacs tabs open, alongside the browser(s). I'm looking for ways to improve the above points and the entire workflow in general, so I'd appreciate if you'd share yours. P. S. I have also used Vimclojure before, so Vimclojure-based workflows are welcome too.

    Read the article

  • How to catch 'exceptions' for out of order execution in Workflow Foundation 4?

    - by Alex Key
    Hi, I am attempting to model a worklfow using a "WCF Workflow Service" in .net / vs 2010 that needs to handle out of order execution gracefully (but not allow it - if thath makes sense!?) For example I have 2 receive activities one called Initialize and the other called GetValue inside a FlowChart. In most cases Initialize should be called first and GetValue after (as modled in the flow chart). However if GetValue is executed before Initialize I do not want to return an "out of order" exception (although when I look at the WCF test client, I can't actually see an exception). But instead a custom exception saying something like "you must initialize first". In theory I could model this with lots of parallel activities and conditions to check if Initialized / Running / Terminated etc. But the business process I am modelling if very very similar to a state machine... except it must handle people executing things in the wrong order. Ideally I would like to catch the "out of order" exception (thought I don't think it's really an exception as such), check the 'exception' to see which function was attempted to run and then handle it. I have done some research around enabling AllowBufferedReceive. However I don't want to be able to execute out of order (I don't think), but instead give a detailed response if it does happen. I've looked at the new beta state machine template for WF 4 - but i'm not sure if it does what i'm after? I'm not sure if I have the wrong end of the stick, so any help would be greatly appreciated. [EDIT] To help clarify... Sorry it's a tricky one to explain. The standard I am trying to implement (the e-learning standard SCORM RTE) is structured like a state machine i.e. certain functions can only be executed in certain states. However the standard specifies that if the calling clients tries to execute a function that it is not meant to, then a warning should be issued... for example "you cannot use GetValue(), because you have not yet Initialized". Ideally I'd like to structure the workflow as the theoretical state machine and not need to have to use multiple if/else's to handle all the scenarios where something could be executed out-of-order. I'd like to catch a out-of-order exception (but I don't think there is such an exception - as it's not in the debugger) and rethrow it.

    Read the article

  • Sharing Session between webservice and asp.net application

    - by Alex Mendez
    I have an asp.net application and webservices (asmx) that reside in the same application but not in the same folder of the aspx files. I aslo have a winform application that uses the webservices. I have marked the webservice methods with [WebMethod(EnableSession = true)] but I am not able to share the same session values that are on the application in the webservices. The winform application has access to the sessionID from the application and I am using the following code Uri uri = new Uri(ServerServiceUrl); _cookieContainer = new CookieContainer(); _cookieContainer.Add(new Cookie("ASP.NET_SessionId", SessionID, "/", uri.Host)); My question is: Is there something that I am missing or doing wrong that I cannot access the application sessioin from the webservices?

    Read the article

  • Performance of fopen vs stat

    - by Alex Marshall
    Hello, I'm writing several C programs for an embedded system where every bit of performance we can squeeze out will matter. Part of that is accessing log files. When determining if a file exists, is there any performance difference between using open / fopen, and stat ? I've been using stat on the assumption that it only has to do a quick check against the file system, whereas fopen would have to actually gain access to a file and manipulate internal data structures before returning. Is there any merit to this ?

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >