Search Results

Search found 249 results on 10 pages for 'volim te'.

Page 8/10 | < Previous Page | 4 5 6 7 8 9 10  | Next Page >

  • Jar not found when executing class

    - by Simon
    Hi there, I'm working through the ANTLR book and there are many examples that should be easy to compile using the command line. Some information to get te problem: antlr-3.2.jar contains the ANTLR classes. I added the antlr-3.2.jar to the CLASSPATH environment variable (Windows 7) and when compiling the classes with javac everything works fine. This is what i execute to compile my program: javac Test.java ExprLexer.java ExprParser.java Test.java contains my main()-method whereas ExprLexer and ExprParser are generated by ANTLR. All three classes use classes contained in the antlr-3.2.jar. But so far so good. As I just said, compiling works fine. It's when I try to execute the Test.class that I get trouble. This is what I type: java -cp ./ Test When executing this, the interpreter tells me that he can't find the ANTLR-classes contained in the antlr-3.2.jar, altough I added an entry in the CLASSPATH variable. E:\simone\Programmierung\Language Processing Tools\ANTLR\Book Samples and Exercises\Exercise\1\output\Test.java Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/runtime/Cha rStream Caused by: java.lang.ClassNotFoundException: org.antlr.runtime.CharStream at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) Could not find the main class: Test. Program will exit. I'm using Windows 7 and Java 1.6_20. Can someone tell what is going on? Why will the interpreter not look in the jar-Archive I specified in the CLASSPATH? I found some kind of workaroud. I copied the antlr-3.2.jar into the directory where the Test.class is located and then executed: java -cp ./;antlr-3.2.jar Test This worked out. But I don't want to type the jar-Archive everytime I execute my test programs. Is there a possibility to tell the interpreter that he should automatically look into the archive?

    Read the article

  • Save a PDF created with FPDF php library in a MySQL blob field

    - by Davide Gualano
    I need to create a pdf file with the fpdf library and save it in a blob field in my MySQL database. The problem is, when I try to retrieve the file from the blob field and send it to the browser for the download, the donwloaded file is corrupted and does not display correctly. The same pdf file is correctly displayed if I send it immediately to the browser without storing it in the db, so it seems some of the data gets corrupted when is inserted in the db. My code is something like this: $pdf = new MyPDF(); //class that extends FPDF and create te pdf file $content = $pdf->Output("", "S"); //return the pdf file content as string $sql = "insert into mytable(myblobfield) values('".addslashes($content)."')"; mysql_query($sql); to store the pdf, and like this: $sql = "select myblobfield from mytable where id = '1'"; $result = mysql_query($sql); $rs = mysql_fetch_assoc($result); $content = stripslashes($rs['myblobfield']); header('Content-Type: application/pdf'); header("Content-Length: ".strlen(content)); header('Content-Disposition: attachment; filename=myfile.pdf'); print $content; to send it to the browser for downloading. What am I doing wrong? If I change my code to: $pdf = new MyPDF(); $pdf->Output(); //send the pdf to the browser the file is correctly displayed, so I assume that is correctly generated and the problem is in the storing in the db. Thanks in advance.

    Read the article

  • ASP.Net menu databinding encoding problem

    - by WtFudgE
    Hi, I have a menu where I bind data through: XmlDataSource xmlData = new XmlDataSource(); xmlData.DataFile = String.Format(@"{0}{1}\Navigation.xml", getXmlPath(), getLanguage()); xmlData.XPath = @"/Items/Item"; TopNavigation.DataSource = xmlData; TopNavigation.DataBind(); The problem is when my xml has special characters, since I use a lot of french words. As an alternative I tried using a stream instead and using encoding to get the special characters, with the following code: StreamReader strm = new StreamReader(String.Format(@"{0}{1}\Navigation.xml", getXmlPath(), getLanguage()), Encoding.GetEncoding(1254)); XmlDocument xDoc = new XmlDocument(); xDoc.Load(strm); XmlDataSource xmlData = new XmlDataSource(); xmlData.ID = "TopNav"; xmlData.Data = xDoc.InnerXml; xmlData.XPath = @"/Items/Item"; TopNavigation.Items.Clear(); TopNavigation.DataSource = xmlData; TopNavigation.DataBind(); The problem I'm having now is that my data doesn't refresh when I change the path where the stream gets read. When I skip through the code it does, but not on my page. So the thing is either, how do I get the data te be refreshed? Or (which is actually preferred) how do I get the encoding right in the first piece of code? Help is highly apreciated!

    Read the article

  • Wpf progressbar not updating during method calculation

    - by djerry
    Hey guys, In my app, i have an import option, to read info from a .csv or .txt file and write it to a database. To test, i"m just using 200-300 lines of data. At the beginning of the method, i calculate number of objects/lines to be read. Every time an object is written to the database, i want to update my progressbar. This is how i do it : private void Update(string path) { double lines = 0; using (StreamReader reader = new StreamReader(path)) while ((reader.ReadLine()) != null) lines++; if (lines != 0) { double progress = 0; string lijn; double value = 0; List<User> users = new List<User>(); using (StreamReader reader = new StreamReader(path)) while ((line = reader.ReadLine()) != null) { progress++; value = (progress / lines) * 100.0; updateProgressBar(value); try { User user = ProcessLine(lijn); } catch (ArgumentOutOfRangeException) { continue; } catch (Exception) { continue; } } return; } else { //non relevant code } } To update my progressbar, i'm checking if i can change the ui of the progressbar like this : delegate void updateProgressbarCallback(double value); private void updateProgressBar(double value) { if (pgbImportExport.Dispatcher.CheckAccess() == false) { updateProgressbarCallback uCallBack = new updateProgressbarCallback(updateProgressBar); pgbImportExport.Dispatcher.Invoke(uCallBack, value); } else { Console.WriteLine(value); pgbImportExport.Value = value; } } When i!m looking at the output, the values are calculated correctly, but the progressbar is only showing changes after the method has been called completely, so when the job is done. That's too late to show feedback to the user. Can anyone help me solve this. EDIT : I'm also trying to show some text in labels to tell te user what is being done, and those aren't udpated till after the method is complete. Thanks in advance.

    Read the article

  • Problem with date parameter - Oracle

    - by Nicole
    Hi everyone! I have this stored procedure: CREATE OR REPLACE PROCEDURE "LIQUIDACION_OBTENER" ( p_Cuenta IN NUMBER, p_Fecha IN DATE, p_Detalle OUT LIQUIDACION.FILADETALLE%TYPE ) IS BEGIN SELECT FILADETALLE INTO p_Detalle FROM Liquidacion WHERE (FILACUENTA = p_Cuenta) AND (FILAFECHA = p_Fecha); END; and my c# code: string liquidacion = string.Empty; OracleCommand command = new OracleCommand("Liquidacion_Obtener"); command.BindByName = true; command.Parameters.Add(new OracleParameter("p_Cuenta", OracleDbType.Int64)); command.Parameters["p_Cuenta"].Value = cuenta; command.Parameters.Add(new OracleParameter("p_Fecha", OracleDbType.Date)); command.Parameters["p_Fecha"].Value = fecha; command.Parameters.Add("p_Detalle", OracleDbType.Varchar2, ParameterDirection.Output); OracleConnectionHolder connection = null; connection = this.GetConnection(); command.Connection = connection.Connection; command.CommandTimeout = 30; command.CommandType = CommandType.StoredProcedure; OracleDataReader lector = command.ExecuteReader(); while (lector.Read()) { liquidacion += ((OracleString)command.Parameters["p_Detalle"].Value).Value; } the thing is that when I try to put a value into the parameter "Fecha" (that is a date) the code gives me this error (when the line command.ExecuteReader(); is executed) Oracle.DataAccess.Client.OracleException : ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYSTEM.LIQUIDACION_OBTENER", line 9 ORA-06512: at line 1 the thing is that te date in the data base is saved like a date but it's format is "2010-APR-14" and the value I send is a datetime that has this format: "14/04/2010 00:00:00" could it be that??? I hope my post is understandable.. thanks!!!!!!!!!!

    Read the article

  • Text editor capable of viewing invisibles?

    - by Timo
    A recent problem* left me wondering whether there is a text editor out there that lets you see every single character of the file, even if they are invisible? Specifically, I'm not looking for hex editing capabilities, I am interested in a text editor that'll show me all of the invisible characters (not just the common whitespace / line break characters). The BOM marker is just one example, others are e.g. mathematical invisibles or possibly unsupported characters. I'm not looking for a text editor that simply supports a large variety of text encoding / translations between encodings. All text editors I've come across treat the invisible characters correctly i.e. leave them invisible (or simply get removed in the translation as in the case of the BOM marker). I'm asking this mostly out of academic interests, so I'm not particular about any specific OS. I can easily test Linux and OSX solutions, but if you recommend a Windows editor, I would appreciate if you include descriptions of how the editor handles invisibles other than whitespace / line breaks. *The incident that lead me to this question: I wrote a perl script using TextWrangler and managed to change the encoding to UTF8 BOM, which inserts te BOM marker at the start of the file. Perl (or rather the operating system) promptly misses the #! and mayhem ensues. It then took me the better part of an afternoon to figure this out since most text editors do not show the BOM marker even with various "show invisibles" options turned on. Now I've learned my lesson and will use less immediately :-).

    Read the article

  • Treebeard admin in Django

    - by Sharath
    I've setup Treebeard in Django and everything seems to have gone well. I tried to setup the admin system and I can see my models being presented in the admin interface. However, when I try to add new data using the admin interface, I get the following error in my template. The code still works fine, and I did a check in my DB and the data seems to be inserted properly. However, the view doesn't seem to load properly. Any idea about what is causing this?? The exception am getting is.. Caught an exception while rendering: Failed lookup for key [request] in u'[{\'action_index\': 0, \'block\': , , , , , , ]}, {\'block\': , , , ], , , , , \n \', ], , ], , , , ], , , \n \', , , , , , , , , ], , ], \n \']}, {\'cl\': , \'root_path\': None, \'actions_on_bottom\': False, \'title\': u\'Select album to change\', \'has_add_permission\': True, \'media\': , \'is_popup\': False, \'action_form\': , \'actions_on_top\': True, \'app_label\': \'gallery\'}, {\'MEDIA_URL\': \'\'}, {\'LANGUAGES\': ((\'ar\', \'Arabic\'), (\'bn\', \'Bengali\'), (\'bg\', \'Bulgarian\'), (\'ca\', \'Catalan\'), (\'cs\', \'Czech\'), (\'cy\', \'Welsh\'), (\'da\', \'Danish\'), (\'de\', \'German\'), (\'el\', \'Greek\'), (\'en\', \'English\'), (\'es\', \'Spanish\'), (\'et\', \'Estonian\'), (\'es-ar\', \'Argentinean Spanish\'), (\'eu\', \'Basque\'), (\'fa\', \'Persian\'), (\'fi\', \'Finnish\'), (\'fr\', \'French\'), (\'ga\', \'Irish\'), (\'gl\', \'Galician\'), (\'hu\', \'Hungarian\'), (\'he\', \'Hebrew\'), (\'hi\', \'Hindi\'), (\'hr\', \'Croatian\'), (\'is\', \'Icelandic\'), (\'it\', \'Italian\'), (\'ja\', \'Japanese\'), (\'ka\', \'Georgian\'), (\'ko\', \'Korean\'), (\'km\', \'Khmer\'), (\'kn\', \'Kannada\'), (\'lv\', \'Latvian\'), (\'lt\', \'Lithuanian\'), (\'mk\', \'Macedonian\'), (\'nl\', \'Dutch\'), (\'no\', \'Norwegian\'), (\'pl\', \'Polish\'), (\'pt\', \'Portuguese\'), (\'pt-br\', \'Brazilian Portuguese\'), (\'ro\', \'Romanian\'), (\'ru\', \'Russian\'), (\'sk\', \'Slovak\'), (\'sl\', \'Slovenian\'), (\'sr\', \'Serbian\'), (\'sv\', \'Swedish\'), (\'ta\', \'Tamil\'), (\'te\', \'Telugu\'), (\'th\', \'Thai\'), (\'tr\', \'Turkish\'), (\'uk\', \'Ukrainian\'), (\'zh-cn\', \'Simplified Chinese\'), (\'zh-tw\', \'Traditional Chinese\')), \'LANGUAGE_BIDI\': False, \'LANGUAGE_CODE\': \'en-us\'}, {}, {\'perms\': , \'messages\': [], \'user\': }, {}]' This happens after I hit the save button in Django admin. This is my admin.py implementation.. class MP_Album_Admin(TreeAdmin): pass admin.site.register(Album,MP_Album_Admin)

    Read the article

  • Problem with apostrophes and other special characters when using aspell in windows

    - by Loftx
    Hi there, We seem to be having a problem with the spell checker on our content management system where it marks the ve part of We’ve as a misspelling. The spellchecker uses aspell which is called from a script on the server which executes the cmd.exe and uses it to pipe a file into aspell (it's a long winded way I know, but our server side programming langauge (ColdFusion) doesn't support writing to stdin for executables). Aspell is called by executing: c:\windows\system32\cmd.exe /c type d:\path_to_file\file.txt | "C:\Program Files\Aspell\bin\aspell" --lang=en -a Where file.txt contains the text to be spelled e.g. ^Oh have We’ve (the carat is added to prevent piping problems I believe). Aspell then output: @(#) International Ispell Version 3.1.20 (but really Aspell 0.50.3) * * * & ve 62 12: vie, voe, V, v, veg, vet, Be, Ce, be, Ev, E, e, vex, VA, VI, Va, Vi, vi, we, VD, VF, VG, VJ, VP, VT, Vt, vb, vs, DE, De, Fe, GE, Ge, He, IE, Le, ME, Me, NE, Ne, OE, PE, Re, SE, Se, Te, Xe, he, me, re, ye, Ave, Eve, Ive, ave, eve, VAR, var, veer, vier, view, vow However, we have a dev site, with the same version of Aspell, and when the same file is used it outputs with no misspellings. Both servers are running Aspell 0.50.3 on Windows server 2003, but there could be other differences in configuration: @(#) International Ispell Version 3.1.20 (but really Aspell 0.50.3) I'm wondering if the problem is to do with the piping part of the process or something different in the Aspell configuration. Does anyone have any ideas? Cheers, Tom

    Read the article

  • How to organize the work when project needs to be re-implemented due to poor code quality?

    - by Dmitriy Nagirnyak
    Hi, I have joined a very small where one main developer has been buiding the web app (.NET 4.0) during ~6 months. The project should be delivered within next 2 months. After first look at the code I can say that I would never allow it to go to production (things like catch { }, not tests at all with WebForms etc). So the code quality is incredibly low. My task is to improve that and still deliver the solution. So I plan to start with unit testing and MVC2 reimplementing most of the functionality (though using some of the existing code). I estimate that I will need about 6 weeks to catch up with the current progress and be on te same functionality level as the application will be in 6 months. The problem is that the main developer who has been working on the project does not seem to be very 'professional' and skillful (he seems to be really starting in IT and many basic things are unknown to him). It will take significant amount of time and effort to educate him how to do the proper testing, development and apply some patterns. I am ready to take responsibility for the reimplemnting the application but at the same time I don't want the main developer to be on idle but as he won't be able to significantly contribute to the better-world project at this stage I am not sure what would the best way to keep productivity high for both of us. Currently I think following solution is good enough: He proceeds doing what he does until I will catch up with him and then start working on a new project together. The problem is that of course this approach is not very productive as one developer will do better-world project while the other will proceed with what he did, effectively doing similar tasks. Can you suggest how we could better organise the work together in order to be most efficient for the overall project? Thanks, Dmitriy.

    Read the article

  • MultipartFormDataContent Access to patch xx is denied

    - by Florian Schaal
    So I'm trying to upload a pdf file to a restapi. For some reason I the application cant get access to the files on my pc. The code im using to upload: public void Upload(string token, string FileName, string FileLocation, string Name, int TypeId, int AddressId, string CompanyName, string StreetNr, string Zip, string City, string CountryCode, string CustomFieldName, string CustomFieldValue) { var client = new HttpClient(); client.BaseAddress = _API.baseAddress; //upload a new form client.DefaultRequestHeaders.Date = DateTime.Now; client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(token); using (var multiPartContent = new MultipartFormDataContent()) { //get te bytes from a file byte[] pdfData; using (var pdf = new FileStream(@FileLocation, FileMode.Open))//Here i get the error. { pdfData = new byte[pdf.Length]; pdf.Read(pdfData, 0, (int)pdf.Length); } var fileContent = new ByteArrayContent(pdfData); fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") { FileName = FileName + ".pdf" }; //add the bytes to the multipart message multiPartContent.Add(fileContent); //make a json message var json = new FormRest { Name = Name, TypeId = TypeId, AddressId = AddressId, CompanyName = CompanyName, StreetNr = StreetNr, Zip = Zip, City = City, CountryCode = CountryCode, CustomFields = new List<CustomFieldRest> { new CustomFieldRest {Name = CustomFieldName, Value = CustomFieldValue} } }; var Content = new JsonContent(json); //add the json message to the multipart message multiPartContent.Add(Content); var result = client.PostAsync("forms", multiPartContent).Result; } } }

    Read the article

  • Reading Data from DDFS ValueError: No JSON object could be decoded

    - by secumind
    I'm running dozens of map reduce jobs for a number of different purposes using disco. My data has grown enormous and I thought I would try using DDFS for a change rather than standard txt files. I've followed the DISCO map/reduce example Counting Words as a map/reduce job, without to much difficulty and with the help of others, Reading JSON specific data into DISCO I've gotten past one of my latest problems. I'm trying to read data in/out of ddfs to better chunk and distribute it but am having a bit of trouble. Here's an example file: file.txt {"favorited": false, "in_reply_to_user_id": null, "contributors": null, "truncated": false, "text": "I'll call him back tomorrow I guess", "created_at": "Mon Feb 13 05:34:27 +0000 2012", "retweeted": false, "in_reply_to_status_id_str": null, "coordinates": null, "in_reply_to_user_id_str": null, "entities": {"user_mentions": [], "hashtags": [], "urls": []}, "in_reply_to_status_id": null, "id_str": "168931016843603968", "place": null, "user": {"follow_request_sent": null, "profile_use_background_image": true, "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/305726905/FASHION-3.png", "verified": false, "profile_image_url_https": "https://si0.twimg.com/profile_images/1818996723/image_normal.jpg", "profile_sidebar_fill_color": "292727", "is_translator": false, "id": 113532729, "profile_text_color": "000000", "followers_count": 78, "protected": false, "location": "With My Niggas In Paris!", "default_profile_image": false, "listed_count": 0, "utc_offset": -21600, "statuses_count": 6733, "description": "Made in CHINA., Educated && Making My Own $$. Fear GOD && Put Him 1st. #TeamFollowBack #TeamiPhone\n", "friends_count": 74, "profile_link_color": "b03f3f", "profile_image_url": "http://a2.twimg.com/profile_images/1818996723/image_normal.jpg", "notifications": null, "show_all_inline_media": false, "geo_enabled": true, "profile_background_color": "1f9199", "id_str": "113532729", "profile_background_image_url": "http://a3.twimg.com/profile_background_images/305726905/FASHION-3.png", "name": "Bee'Jay", "lang": "en", "profile_background_tile": true, "favourites_count": 19, "screen_name": "OohMyBEEsNice", "url": "http://www.bitchimpaid.org", "created_at": "Fri Feb 12 03:32:54 +0000 2010", "contributors_enabled": false, "time_zone": "Central Time (US & Canada)", "profile_sidebar_border_color": "000000", "default_profile": false, "following": null}, "in_reply_to_screen_name": null, "retweet_count": 0, "geo": null, "id": 168931016843603968, "source": "<a href=\"http://twitter.com/#!/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>"} {"favorited": false, "in_reply_to_user_id": 50940453, "contributors": null, "truncated": false, "text": "@LegaMrvica @MimozaBand makasi om artis :D kadoo kadoo", "created_at": "Mon Feb 13 05:34:27 +0000 2012", "retweeted": false, "in_reply_to_status_id_str": "168653037894770688", "coordinates": null, "in_reply_to_user_id_str": "50940453", "entities": {"user_mentions": [{"indices": [0, 11], "screen_name": "LegaMrvica", "id": 50940453, "name": "Lega_thePianis", "id_str": "50940453"}, {"indices": [12, 23], "screen_name": "MimozaBand", "id": 375128905, "name": "Mimoza", "id_str": "375128905"}], "hashtags": [], "urls": []}, "in_reply_to_status_id": 168653037894770688, "id_str": "168931016868761600", "place": null, "user": {"follow_request_sent": null, "profile_use_background_image": true, "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/347686061/Galungan_dan_Kuningan.jpg", "verified": false, "profile_image_url_https": "https://si0.twimg.com/profile_images/1803845596/Picture_20124_normal.jpg", "profile_sidebar_fill_color": "DDFFCC", "is_translator": false, "id": 48293450, "profile_text_color": "333333", "followers_count": 182, "protected": false, "location": "\u00dcT: -6.906799,107.622383", "default_profile_image": false, "listed_count": 0, "utc_offset": -28800, "statuses_count": 3052, "description": "Fashion design maranatha '11 // traditional dancer (bali) at sanggar tampak siring & Natya Nataraja", "friends_count": 206, "profile_link_color": "0084B4", "profile_image_url": "http://a3.twimg.com/profile_images/1803845596/Picture_20124_normal.jpg", "notifications": null, "show_all_inline_media": false, "geo_enabled": true, "profile_background_color": "9AE4E8", "id_str": "48293450", "profile_background_image_url": "http://a0.twimg.com/profile_background_images/347686061/Galungan_dan_Kuningan.jpg", "name": "nana afiff", "lang": "en", "profile_background_tile": true, "favourites_count": 2, "screen_name": "hasnfebria", "url": null, "created_at": "Thu Jun 18 08:50:29 +0000 2009", "contributors_enabled": false, "time_zone": "Pacific Time (US & Canada)", "profile_sidebar_border_color": "BDDCAD", "default_profile": false, "following": null}, "in_reply_to_screen_name": "LegaMrvica", "retweet_count": 0, "geo": null, "id": 168931016868761600, "source": "<a href=\"http://blackberry.com/twitter\" rel=\"nofollow\">Twitter for BlackBerry\u00ae</a>"} {"favorited": false, "in_reply_to_user_id": 27260086, "contributors": null, "truncated": false, "text": "@justinbieber u were born to be somebody, and u're super important in beliebers' life. thanks for all biebs. I love u. follow me? 84", "created_at": "Mon Feb 13 05:34:27 +0000 2012", "retweeted": false, "in_reply_to_status_id_str": null, "coordinates": null, "in_reply_to_user_id_str": "27260086", "entities": {"user_mentions": [{"indices": [0, 13], "screen_name": "justinbieber", "id": 27260086, "name": "Justin Bieber", "id_str": "27260086"}], "hashtags": [], "urls": []}, "in_reply_to_status_id": null, "id_str": "168931016856178688", "place": null, "user": {"follow_request_sent": null, "profile_use_background_image": true, "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/416005864/Captura.JPG", "verified": false, "profile_image_url_https": "https://si0.twimg.com/profile_images/1808883280/Captura6_normal.JPG", "profile_sidebar_fill_color": "f5e7f3", "is_translator": false, "id": 406750700, "profile_text_color": "333333", "followers_count": 1122, "protected": false, "location": "Adentro de una supra.", "default_profile_image": false, "listed_count": 0, "utc_offset": -14400, "statuses_count": 20966, "description": "Mi \u00eddolo es @justinbieber , si te gusta \u00a1genial!, si no, solo respetalo. El cambi\u00f3 mi vida completamente y mi sue\u00f1o es conocerlo #TrueBelieber . ", "friends_count": 1015, "profile_link_color": "9404b8", "profile_image_url": "http://a1.twimg.com/profile_images/1808883280/Captura6_normal.JPG", "notifications": null, "show_all_inline_media": false, "geo_enabled": false, "profile_background_color": "f9fcfa", "id_str": "406750700", "profile_background_image_url": "http://a3.twimg.com/profile_background_images/416005864/Captura.JPG", "name": "neversaynever,right?", "lang": "es", "profile_background_tile": false, "favourites_count": 22, "screen_name": "True_Belieebers", "url": "http://www.wehavebieber-fever.tumblr.com", "created_at": "Mon Nov 07 04:17:40 +0000 2011", "contributors_enabled": false, "time_zone": "Santiago", "profile_sidebar_border_color": "C0DEED", "default_profile": false, "following": null}, "in_reply_to_screen_name": "justinbieber", "retweet_count": 0, "geo": null, "id": 168931016856178688, "source": "<a href=\"http://yfrog.com\" rel=\"nofollow\">Yfrog</a>"} I load it into DDFS with: # ddfs chunk data:test1 ./file.txt created: disco://localhost/ddfs/vol0/blob/44/file_txt-0$549-db27b-125e1 I test that the file is indeed loaded into ddfs with: # ddfs xcat data:test1 {"favorited": false, "in_reply_to_user_id": null, "contributors": null, "truncated": false, "text": "I'll call him back tomorrow I guess", "created_at": "Mon Feb 13 05:34:27 +0000 2012", "retweeted": false, "in_reply_to_status_id_str": null, "coordinates": null, "in_reply_to_user_id_str": null, "entities": {"user_mentions": [], "hashtags": [], "urls": []}, "in_reply_to_status_id": null, "id_str": "168931016843603968", "place": null, "user": {"follow_request_sent": null, "profile_use_background_image": true, "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/305726905/FASHION-3.png", "verified": false, "profile_image_url_https": "https://si0.twimg.com/profile_images/1818996723/image_normal.jpg", "profile_sidebar_fill_color": "292727", "is_translator": false, "id": 113532729, "profile_text_color": "000000", "followers_count": 78, "protected": false, "location": "With My Niggas In Paris!", "default_profile_image": false, "listed_count": 0, "utc_offset": -21600, "statuses_count": 6733, "description": "Made in CHINA., Educated && Making My Own $$. Fear GOD && Put Him 1st. #TeamFollowBack #TeamiPhone\n", "friends_count": 74, "profile_link_color": "b03f3f", "profile_image_url": "http://a2.twimg.com/profile_images/1818996723/image_normal.jpg", "notifications": null, "show_all_inline_media": false, "geo_enabled": true, "profile_background_color": "1f9199", "id_str": "113532729", "profile_background_image_url": "http://a3.twimg.com/profile_background_images/305726905/FASHION-3.png", "name": "Bee'Jay", "lang": "en", "profile_background_tile": true, "favourites_count": 19, "screen_name": "OohMyBEEsNice", "url": "http://www.bitchimpaid.org", "created_at": "Fri Feb 12 03:32:54 +0000 2010", "contributors_enabled": false, "time_zone": "Central Time (US & Canada)", "profile_sidebar_border_color": "000000", "default_profile": false, "following": null}, "in_reply_to_screen_name": null, "retweet_count": 0, "geo": null, "id": 168931016843603968, "source": "<a href=\"http://twitter.com/#!/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>"} {"favorited": false, "in_reply_to_user_id": 50940453, "contributors": null, "truncated": false, "text": "@LegaMrvica @MimozaBand makasi om artis :D kadoo kadoo", "created_at": "Mon Feb 13 05:34:27 +0000 2012", "retweeted": false, "in_reply_to_status_id_str": "168653037894770688", "coordinates": null, "in_reply_to_user_id_str": "50940453", "entities": {"user_mentions": [{"indices": [0, 11], "screen_name": "LegaMrvica", "id": 50940453, "name": "Lega_thePianis", "id_str": "50940453"}, {"indices": [12, 23], "screen_name": "MimozaBand", "id": 375128905, "name": "Mimoza", "id_str": "375128905"}], "hashtags": [], "urls": []}, "in_reply_to_status_id": 168653037894770688, "id_str": "168931016868761600", "place": null, "user": {"follow_request_sent": null, "profile_use_background_image": true, "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/347686061/Galungan_dan_Kuningan.jpg", "verified": false, "profile_image_url_https": "https://si0.twimg.com/profile_images/1803845596/Picture_20124_normal.jpg", "profile_sidebar_fill_color": "DDFFCC", "is_translator": false, "id": 48293450, "profile_text_color": "333333", "followers_count": 182, "protected": false, "location": "\u00dcT: -6.906799,107.622383", "default_profile_image": false, "listed_count": 0, "utc_offset": -28800, "statuses_count": 3052, "description": "Fashion design maranatha '11 // traditional dancer (bali) at sanggar tampak siring & Natya Nataraja", "friends_count": 206, "profile_link_color": "0084B4", "profile_image_url": "http://a3.twimg.com/profile_images/1803845596/Picture_20124_normal.jpg", "notifications": null, "show_all_inline_media": false, "geo_enabled": true, "profile_background_color": "9AE4E8", "id_str": "48293450", "profile_background_image_url": "http://a0.twimg.com/profile_background_images/347686061/Galungan_dan_Kuningan.jpg", "name": "nana afiff", "lang": "en", "profile_background_tile": true, "favourites_count": 2, "screen_name": "hasnfebria", "url": null, "created_at": "Thu Jun 18 08:50:29 +0000 2009", "contributors_enabled": false, "time_zone": "Pacific Time (US & Canada)", "profile_sidebar_border_color": "BDDCAD", "default_profile": false, "following": null}, "in_reply_to_screen_name": "LegaMrvica", "retweet_count": 0, "geo": null, "id": 168931016868761600, "source": "<a href=\"http://blackberry.com/twitter\" rel=\"nofollow\">Twitter for BlackBerry\u00ae</a>"} {"favorited": false, "in_reply_to_user_id": 27260086, "contributors": null, "truncated": false, "text": "@justinbieber u were born to be somebody, and u're super important in beliebers' life. thanks for all biebs. I love u. follow me? 84", "created_at": "Mon Feb 13 05:34:27 +0000 2012", "retweeted": false, "in_reply_to_status_id_str": null, "coordinates": null, "in_reply_to_user_id_str": "27260086", "entities": {"user_mentions": [{"indices": [0, 13], "screen_name": "justinbieber", "id": 27260086, "name": "Justin Bieber", "id_str": "27260086"}], "hashtags": [], "urls": []}, "in_reply_to_status_id": null, "id_str": "168931016856178688", "place": null, "user": {"follow_request_sent": null, "profile_use_background_image": true, "profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/416005864/Captura.JPG", "verified": false, "profile_image_url_https": "https://si0.twimg.com/profile_images/1808883280/Captura6_normal.JPG", "profile_sidebar_fill_color": "f5e7f3", "is_translator": false, "id": 406750700, "profile_text_color": "333333", "followers_count": 1122, "protected": false, "location": "Adentro de una supra.", "default_profile_image": false, "listed_count": 0, "utc_offset": -14400, "statuses_count": 20966, "description": "Mi \u00eddolo es @justinbieber , si te gusta \u00a1genial!, si no, solo respetalo. El cambi\u00f3 mi vida completamente y mi sue\u00f1o es conocerlo #TrueBelieber . ", "friends_count": 1015, "profile_link_color": "9404b8", "profile_image_url": "http://a1.twimg.com/profile_images/1808883280/Captura6_normal.JPG", "notifications": null, "show_all_inline_media": false, "geo_enabled": false, "profile_background_color": "f9fcfa", "id_str": "406750700", "profile_background_image_url": "http://a3.twimg.com/profile_background_images/416005864/Captura.JPG", "name": "neversaynever,right?", "lang": "es", "profile_background_tile": false, "favourites_count": 22, "screen_name": "True_Belieebers", "url": "http://www.wehavebieber-fever.tumblr.com", "created_at": "Mon Nov 07 04:17:40 +0000 2011", "contributors_enabled": false, "time_zone": "Santiago", "profile_sidebar_border_color": "C0DEED", "default_profile": false, "following": null}, "in_reply_to_screen_name": "justinbieber", "retweet_count": 0, "geo": null, "id": 168931016856178688, "source": "<a href=\"http://yfrog.com\" rel=\"nofollow\">Yfrog</a> At this point everything is great, I load up the script that resulted from a previous Stack Post: from disco.core import Job, result_iterator import gzip def map(line, params): import unicodedata import json r = json.loads(line).get('text') s = unicodedata.normalize('NFD', r).encode('ascii', 'ignore') for word in s.split(): yield word, 1 def reduce(iter, params): from disco.util import kvgroup for word, counts in kvgroup(sorted(iter)): yield word, sum(counts) if __name__ == '__main__': job = Job().run(input=["tag://data:test1"], map=map, reduce=reduce) for word, count in result_iterator(job.wait(show=True)): print word, count NOTE: That this script runs file if the input=["file.txt"], however when I run it with "tag://data:test1" I get the following error: # DISCO_EVENTS=1 python count_normal_words.py Job@549:db30e:25bd8: Status: [map] 0 waiting, 1 running, 0 done, 0 failed 2012/11/25 21:43:26 master New job initialized! 2012/11/25 21:43:26 master Starting job 2012/11/25 21:43:26 master Starting map phase 2012/11/25 21:43:26 master map:0 assigned to solice 2012/11/25 21:43:26 master ERROR: Job failed: Worker at 'solice' died: Traceback (most recent call last): File "/home/DISCO/data/solice/01/Job@549:db30e:25bd8/usr/local/lib/python2.7/site-packages/disco/worker/__init__.py", line 329, in main job.worker.start(task, job, **jobargs) File "/home/DISCO/data/solice/01/Job@549:db30e:25bd8/usr/local/lib/python2.7/site-packages/disco/worker/__init__.py", line 290, in start self.run(task, job, **jobargs) File "/home/DISCO/data/solice/01/Job@549:db30e:25bd8/usr/local/lib/python2.7/site-packages/disco/worker/classic/worker.py", line 286, in run getattr(self, task.mode)(task, params) File "/home/DISCO/data/solice/01/Job@549:db30e:25bd8/usr/local/lib/python2.7/site-packages/disco/worker/classic/worker.py", line 299, in map for key, val in self['map'](entry, params): File "count_normal_words.py", line 12, in map File "/usr/lib64/python2.7/json/__init__.py", line 326, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded 2012/11/25 21:43:26 master WARN: Job killed Status: [map] 1 waiting, 0 running, 0 done, 1 failed Traceback (most recent call last): File "count_normal_words.py", line 28, in <module> for word, count in result_iterator(job.wait(show=True)): File "/usr/local/lib/python2.7/site-packages/disco/core.py", line 348, in wait timeout, poll_interval * 1000) File "/usr/local/lib/python2.7/site-packages/disco/core.py", line 309, in check_results raise JobError(Job(name=jobname, master=self), "Status %s" % status) disco.error.JobError: Job Job@549:db30e:25bd8 failed: Status dead The Error states: ValueError: No JSON object could be decoded. Again, this works fine using the text file as input but now DDFS. Any ideas, I'm open to suggestions?

    Read the article

  • MATLAB Easter Egg Spy vs Spy

    - by Aqui1aZ3r0
    I heard that MATLAB 2009b or earlier had a fun function. When you typed spy in the console, you would get something like this: http://t2.gstatic.com/images?q=tbn:ANd9GcSHAgKz-y1HyPHcfKvBpYmZ02PWpe3ONMDat8psEr89K0VsP_ft However, now you have an image like this:http://undocumentedmatlab.com/images/spy2.png I'd like it if I could get the code of the original spy vs spy image FYI, there's a code, but has certain errors in it: c = [';@3EA4:aei7]ced.CFHE;4\T*Y,dL0,HOQQMJLJE9PX[[Q.ZF.\JTCA1dd' '-IorRPNMPIE-Y\R8[I8]SUDW2e+' '=4BGC;7imiag2IFOQLID8''XI.]K0"PD@l32UZhP//P988_WC,U+Z^Y\<2' '&lt;82BF>?8jnjbhLJGPRMJE9/YJ/L1#QMC$;;V[iv09QE99,XD.YB,[_]=3a' '9;CG?@9kokc2MKHQSOKF:0ZL0aM2$RNG%AAW\jw9E.FEE-_G8aG.d]_W5+' '?:CDH@A:lpld3NLIRTPLG=1[M1bN3%SOH4BBX]kx:J9LLL8H9bJ/+d_dX6,' '@;DEIAB;mqmePOMJSUQMJ2\N2cO4&TPP@HCY^lyDKEMMN9+I@+S8,+deY7^' '8@EFJBC<4rnfQPNPTVRNKB3]O3dP5''UQQCIDZ_mzEPFNNOE,RA,T9/,++\8_' '9A2G3CD=544gRQPQUWUOLE4^P4"Q6(VRRIJE[n{KQKOOPK-SE.W:F/,,]Z+' ':BDH4DE>655hSRQRVXVPMF5_Q5#R>)eSSJKF\ao0L.L-WUL.VF8XCH001_[,' ';3EI<eo ?766iTSRSWYWQNG6$R6''S?*fTTlLQ]bp1M/P.XVP8[H9]DIDA=]' '?4D3=FP@877jUTSTXZXROK7%S7(TF+gUUmMR^cq:N9Q8YZQ9_IcIJEBd_^' '@5E@GQA98b3VUTUY*YSPL8&T)UI,hVhnNS_dr;PE.9Z[RCaR?+JTFC?e+' '79FA?HRB:9c4WVUVZ+ZWQM=,WG*VJ-"gi4OTes-XH+bK.#hj@PUvftDRMEF,]UH,UB.TYVWX,e\' '9;ECAKTY< ;eWYXWX\:)YSOE.YI,cL/$ikCqV1guE/PFL-^XI-YG/WZWXY1+]' ':AFDBLUZ=jgY[ZYZ-<7[XQG0[K.eN1&"$K2u:iyO9.PN9-_K8aJ9_]]82[' '?CEFDNW\?khZ[Z[==8\YRH1\M/!O2''#%m31Bw0PE/QXE8+R9bS;da^]93\' '@2FGEOX]ali[][9(ZSL2]N0"P3($&n;2Cx1QN9--L9,SA+T< +d_:4,' 'A3GHFPY^bmj\^]\]??:)[TM3^O1%Q4)%''oA:D0:0OE.8ME-TE,XB,+da;5[' '643IGQZ_cnk]_^]^@@;5\UN4_P2&R6*&(3B;E1<1PN99NL8WF.^C/,a+bY6,' '7:F3HR[dol^_^AA<6]VO5Q3''S>+'');CBF:=:QOEEOO9_G8aH6/d,cZ[Y' '8;G4IS\aep4_a-BD=7''XP6aR4(T?,(5@DCHCC;RPFLPPDH9bJ70+0d\\Z' '9BH>JT^bf45ba.CE@8(YQ7#S5)UD-)?AEDIDDD/QKMVQJ+S?cSDF,1e]a,' ':C3?K4_cg5[acbaADFA92ZR8$T6*VE.*@JFEJEEE0.NNWTK,U@+TEG0?+_bX' ';2D@L9dh6\bdcbBEGD:3[S=)U7+cK/+CKGFLIKI9/OWZUL-VA,WIHB@,`cY']; i = double(c(:)-32); j = cumsum(diff([0; i])< =0) + 1; S = sparse(i,j,1)'; spy(S)

    Read the article

  • Crash on replacing map annotations

    - by Alwin
    Solved it, see below code I'm trying to replace annotations on my MapView depending on the distance between user location and annotation. The annotations are getting replaced like they should, but when I touch te mapview my app crashes. This is de code I have so far: NSMutableArray *tempArray = [[NSMutableArray alloc] init]; for (id object in self.mapAnnotations) { if([object isKindOfClass:[ClosedAnnotation class]]) { ClosedAnnotation *ann = (ClosedAnnotation *)object; CLLocation *tempLocation = [[CLLocation alloc] initWithLatitude:ann.coordinate.latitude longitude:ann.coordinate.longitude]; double distance = [self.currentLocation getDistanceFrom: tempLocation] / 1000; [tempLocation release]; if(distance <= 1.0){ [mapView removeAnnotation:object]; OpenAnnotation *openAnnotation = [[OpenAnnotation alloc] initWithLatitude:ann.coordinate.latitude longitude:ann.coordinate.longitude imageSrc:[ann getImageSrcForAnnotation] title:ann.title tekst:[ann getTextForAnnotation] imageSize:[ann getSizeForImage] username:[ann getUserNameForAnnotation] usertext:[ann getUserTextForAnnotation]]; [mapView addAnnotation:openAnnotation]; [tempArray addObject:openAnnotation]; [openAnnotation release]; } else { [tempArray addObject:object]; } } else if([object isKindOfClass:[OpenAnnotation class]]){ OpenAnnotation *ann = (OpenAnnotation *)object; CLLocation *tempLocation = [[[CLLocation alloc] initWithLatitude:ann.coordinate.latitude longitude:ann.coordinate.longitude] autorelease]; double distance = [self.currentLocation getDistanceFrom: tempLocation] / 1000; [tempLocation release]; if(distance > 1.0){ [mapView removeAnnotation:object]; ClosedAnnotation *closedAnnotation = [[ClosedAnnotation alloc] initWithLatitude:ann.coordinate.latitude longitude:ann.coordinate.longitude imageSrc:[ann getImageSrcForAnnotation] title:ann.title tekst:[ann getTextForAnnotation] imageSize:[ann getSizeForImage] username:[ann getUserNameForAnnotation] usertext:[ann getUserTextForAnnotation]]; [mapView addAnnotation:closedAnnotation]; [tempArray addObject:closedAnnotation]; [closedAnnotation release]; } else { [tempArray addObject:object]; } } } [self.mapAnnotations removeAllObjects]; [self.mapAnnotations addObjectsFromArray:tempArray]; [tempArray release]; I solved it by getting rid of the complete "two-class"-structure and handling everything within one annotation class. Works like a charm now.

    Read the article

  • cookies handling on webrequest and response

    - by manish patel
    I have created a application that has a function mainpost. It is created to post data on a https sites. Here I want to handle cookies in this function. How can I do this task? public string Mainpost(string website, string content) { // this is what we are sending string post_data = content; // this is where we will send it string uri = website; // create a request HttpWebRequest request = (HttpWebRequest) WebRequest.Create(uri); request.KeepAlive = false; request.ProtocolVersion = HttpVersion.Version10; request.Method = "POST"; // turn our request string into a byte stream byte[] postBytes = Encoding.ASCII.GetBytes(post_data); // this is important - make sure you specify type this way request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = postBytes.Length; Stream requestStream = request.GetRequestStream(); // now send it requestStream.Write(postBytes, 0, postBytes.Length); requestStream.Close(); // grab te response and print it out to the console along with the status // code HttpWebResponse response = (HttpWebResponse)request.GetResponse(); string str = (new StreamReader(response.GetResponseStream()).ReadToEnd()); Console.WriteLine(response.StatusCode); return str; }

    Read the article

  • CSS: div text wrap around floated div

    - by Thildemar
    I am trying to create a site that has a fixed width content div and a floating div in the blank space on the right of the page, like so: <html> <div style="width:150px;float:right;border:thin black solid"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam.</div> <div style="width:400px"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </div> </html> This works fine, but when the page is re sized too small either the left div jumps down or the text within it does not start wrapping around the right div until its about halfway through it. I would like the test within the left div to wrap around the float is the page width is too small. What am I missing??

    Read the article

  • Python/MySQL fails under Windows

    - by AP257
    I'm trying to get Python 2.6 to communicate with MySQL Server 5.1, under Windows XP, but I keep getting a strange error, "SystemError: NULL object passed to Py_BuildValue": >>> import MySQLdb as mysql >>> db = mysql.connect(user = "root", passwd="whatever", db="mysql", host="localh ost") >>> cu = db.cursor() >>> cu.execute("show tables") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\dirr\lib\site-packages\MySQLdb\cursors.py", line 173, in execu te self.errorhandler(self, exc, value) File "C:\ dirr\lib\site-packages\MySQLdb\connections.py", line 36, in de faulterrorhandler raise errorclass, errorvalue SystemError: NULL object passed to Py_BuildValue I thought it might be a character set problem, but I've tried setting and setting MySQL as UTF-8, and it hasn't made a difference. I guess there must be a problem with python-mysql. Can anyone help? UPDATE OK, python-mysql under windows is a bit of a nightmare, particularly with Python 2.6 it seems. Rather than installing python-mysql with pip, use this installer instead. That fixed it.

    Read the article

  • Ruby : UTF-8 IO

    - by subtenante
    I use ruby 1.8.7. I try to parse some text files containing greek sentences, encoded in UTF-8. (I can't much paste here sample files, because they are subject to copyright. Really just some greek text encoded in UTF-8.) I want, for each file, to parse the file, extract all the words, and make a list of each new word found in this file. All that saved to one big index file. Here is my code : #!/usr/bin/ruby -KU def prepare_line(l) l.gsub(/^\s*[ST]\d+\s*:\s*|\s+$|\(\d+\)\s*/u, "") end def tokenize(l) l.split /['·.;!:\s]+/u end $dict = {} $cpt = 0 $out = File.new 'out.txt', 'w' def lesson(file) $cpt = $cpt + 1 file.readlines.each do |l| $out.puts l l = prepare_line l tokenize(l).each do |t| unless $dict[t] $dict[t] = $cpt $out.puts " #{t}\n" end end end end Dir.new('etc/').each do |filename| f = File.new("etc/#{filename}") unless File.directory? f lesson f end end Here is part of my output : ?@???†?†?????????? ?...[snip very long hangul/hanzi mishmash]... ????????†? ???N2 : ?e?te?? (2) µ???µa (Note that the puts l part seems to work fine, at the end of the given output line.) Any idea what is wrong with my code ? (General comments about ruby idioms I could use are very welcome, I'm really a beginner.)

    Read the article

  • Change an Image while using JCrop

    - by Bathan
    Hi guys! Im working on a new feature in my site and I got stucked really bad. Im using JCrop obviously to crop an Image on my website. The new feature that I've been asked to Implement is to allow the user to change the colors of the Image being cropped. I have now 3 images , Color, GrayScale and Sepia. I can change the source of the image tag using javascript so the image gets changed without reload but I cannot do this once the JCrop has been enabled because it replaces the original Image for a new one. I thought I could disable JCrop, Replace the Image and then Re-Enable, but i couldnt do such thing. The example I found where the JCrop gets destroyed (example5 in Demo zip) uses an object : jcrop_api = $.Jcrop('#cropbox'); But Im enabling JCrop in a different manner,more like Example 3 : jQuery('#cropbox').Jcrop({ onChange: showPreview, onSelect: showPreview, aspectRatio: 1 }); How can I destroy JCrop so I can replace te Image? Is there another way to do this? Please help! I Could easily reload the page each time the user changes de color of the image but we all know that's not cool. Any comments will be apreciated. Thanks

    Read the article

  • Windows Service doesn't start process with different credentials

    - by Marcus
    I have a Windows Service, running as a user, that should start several processes under different user credentials. I'm using the following code to start a process: Dim winProcess As New System.Diagnostics.Process With winProcess .StartInfo.Arguments = "some_args" .StartInfo.CreateNoWindow = True .StartInfo.ErrorDialog = False .StartInfo.FileName = "C:\TEMP\ProcessFromService\ProcessFromService\bin\Debug\ProcessFromService.exe" .StartInfo.UseShellExecute = False .StartInfo.WindowStyle = ProcessWindowStyle.Hidden 'Opgave WorkingDirectory kan soms tot problemen leiden, indien betreffende directory 'niet bereikbaar (rechten) is voor opgegeven gebruiker. 'Beter dus om deze niet op te geven. '.StartInfo.WorkingDirectory = My.Computer.FileSystem.SpecialDirectories.Temp .StartInfo.Domain = "" .StartInfo.UserName = "MyUserId" Dim strPassword As String = "MyPassword" Dim ssPassword As New Security.SecureString For Each chrPassword As Char In strPassword.ToCharArray ssPassword.AppendChar(chrPassword) Next .StartInfo.Password = ssPassword .Start() End With The process is correctly started when I use the same credentials as of which the Windows Service is running under. The process is not started, without any error, when I use different credentials. In other words: If the Windows Service is running as UserA then I can start a process running as UserA. If the Windows Service is running as UserB then I can not start a process running as UserA. I have created a test project in which I can reproduce this problem. If you put this project in C:\Temp then the used paths will be correct. You can download this test project here: https://dl.dropboxusercontent.com/u/5391091/ProcessFromService.zip NB: I hope this info is enough to explain it. If you need more info, please let me know and I will add it.

    Read the article

  • Flash doesn't connect to socket even though policy allows it

    - by Bart van Heukelom
    In my Flash app, I'm connecting to my server like this: Security.loadPolicyFile("xmlsocket://example.com:12860"); socket = new Socket("example.com", 12869); socket.writeByte(...); ... socket.flush(); At port 12860 I'm running a socket policy server, which (according to this document) correctly serves up my policy like this: 00000000 3c 70 6f 6c 69 63 79 2d 66 69 6c 65 2d 72 65 71 <policy- file-req 00000010 75 65 73 74 2f 3e 00 uest/>. 00000000 3c 63 72 6f 73 73 2d 64 6f 6d 61 69 6e 2d 70 6f <cross-d omain-po 00000010 6c 69 63 79 3e 3c 73 69 74 65 2d 63 6f 6e 74 72 licy><si te-contr 00000020 6f 6c 20 70 65 72 6d 69 74 74 65 64 2d 63 72 6f ol permi tted-cro 00000030 73 73 2d 64 6f 6d 61 69 6e 2d 70 6f 6c 69 63 69 ss-domai n-polici 00000040 65 73 3d 22 6d 61 73 74 65 72 2d 6f 6e 6c 79 22 es="mast er-only" 00000050 20 2f 3e 3c 61 6c 6c 6f 77 2d 61 63 63 65 73 73 /><allo w-access 00000060 2d 66 72 6f 6d 20 64 6f 6d 61 69 6e 3d 22 2a 22 -from do main="*" 00000070 20 74 6f 2d 70 6f 72 74 73 3d 22 31 32 38 36 39 to-port s="12869 00000080 22 20 2f 3e 3c 2f 63 72 6f 73 73 2d 64 6f 6d 61 " /></cr oss-doma 00000090 69 6e 2d 70 6f 6c 69 63 79 3e 00 in-polic y>. I get no security warnings, which I used to get before the policy server was in place. Still, the connection to port 12869 doesn't work. It's made (I can see with Wireshark and on the server), but no data is sent by Flash. It might be worth knowing that the SWF itself is served from example.com as well.

    Read the article

  • MAAttachedWindow hide

    - by Montecorte
    I had the same problem that The-Kenny at this post but I fixed it adding the windowDidResignKey: method on the MAAttachedWindow.m, but now my problem is that when I click outside the StatusBar item keeps blue background and when I click another time on the status item it goes normally and I have to click a second time on it to show the window. I tried to add a method in the CustomView (the view of the status item) that do the same thing that te mouseDown method: - (void)mouseDown:(NSEvent *)event { NSRect frame = [[self window] frame]; NSPoint pt = NSMakePoint(NSMidX(frame), NSMidY(frame)); NSLog(@"%g,%g",pt.x,pt.y); clicked = !clicked; [controller toggleAttachedWindowAtPoint:pt]; [self setNeedsDisplay:YES];} my method is: - (void)windowDidResignKey { NSLog(@"Resigned"); NSRect frame = [[self window] frame]; NSPoint pt = NSMakePoint(NSMidX(frame), NSMidY(frame)); NSLog(@"%g,%g",pt.x,pt.y); clicked = !clicked; [controller toggleAttachedWindowAtPoint:pt]; [self setNeedsDisplay:YES];} I call this method in the windowDidResignKey that I have defined on MAAttachedWindow.m, but this method dont call correctly the toggleAttachedWindowAtPoint method, I dont know exactly why, it's only called when I click another time over the status item If anybody knows how to do that any help would be fine. Thank you so much :)

    Read the article

  • Debugging Post Request with Chrome Dev Tools

    - by benek
    I am trying to use Chrome Dev for debugging the following Angular post request : $http.post("http://picjboss.puma.lan:8880/fluxpousse/api/flow/createOrUpdateHeader", flowHeader) After running the statement with right-click / evaluate, I can see the post in the network panel with a pending state. How can I get the result or "commit" the request and leave easily this "pending" state from the dev console ? I am not yet very familiar with JS callbacks, some code is expected. Thanks. EDIT I have tried to run from the console : $scope.$apply(function(){$http.post("http://picjboss.puma.lan:8880/fluxpousse/api/flow/createOrUpdateHeader", flowHeader).success(function(data){console.log("error "+data)}).error(function(data){console.log("error "+data)})}) It returns : undefined EDIT The post I am trying to solve generate an HTTP 400. Here is the result : Request URL:http://picjboss.puma.lan:8880/fluxpousse/api/flow/createOrUpdateHeader Request Method:POST Status Code:400 Mauvaise Requ?te Request Headersview source Accept:application/json, text/plain, / Accept-Encoding:gzip,deflate,sdch Accept-Language:fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4 Connection:keep-alive Content-Length:5354 Content-Type:application/json;charset=UTF-8 Cookie:JSESSIONID=285AF523EA18C0D7F9D581CDB2286C56 Host:picjboss.puma.lan:8880 Origin:http://picjboss.puma.lan:8880 Referer:http://picjboss.puma.lan:8880/fluxpousse/ User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36 X-Requested-With:XMLHttpRequest Request Payloadview source {refHeader:IDSFP, idEntrepot:619, codeEntreprise:null, codeBanniere:null, codeArticle:7,…} cessionPrice: 78 codeArticle: "7" codeBanniere: null codeDateAppro: null codeDateDelivery: null codeDatePrepa: null codeEntreprise: null codeFournisseur: null codeUtilisateur: null codeUtilisateurLastUpdate: null createDate: null dateAppro: null dateDelivery: null datePrepa: null hasAssortControl: null hasCadenceForce: null idEntrepot: 619 isFreeCost: null labelArticle: "Mayonnaise de DIJON" labelFournisseur: null listDetail: [,…] pcbArticle: 12 pvc: 78 qte: 78 refCommande: "ref" refHeader: "IDSFP" state: "CREATED" stockArticle: 1200 updateDate: null Response Headersview source Connection:close Content-Length:996 Content-Type:text/html;charset=utf-8 Date:Fri, 08 Nov 2013 15:19:30 GMT Server:Apache-Coyote/1.1 X-Powered-By:Servlet 2.5; JBoss-5.0/JBossWeb-2.1

    Read the article

  • Call HashMap from jsp EL ?

    - by Parhs
    Here is my Entity Class public enum UnitType { HOSPITAL, HEALTHCENTER } public static LinkedHashMap<UnitType, String> unitType = new LinkedHashMap<UnitType, String>() { { put(UnitType.HEALTHCENTER, "???t?? ??e?a?"); put(UnitType.HOSPITAL, "??s???µe??"); } }; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String address; @Column(columnDefinition = "TEXT") private String info; @Enumerated(EnumType.STRING) private UnitType type; At my jsp <c:forEach var="unit" items="${requestScope.units}"> <tr> <td>${unit.id}</td> <td>${unit.name}</td> <td>${unit.address}</td> <td>??!?</td> <td><a href="#">?e??ss?te?a</a></td> </tr> </c:forEach> How can i place the text value of the enum at ??!? .. Any idea? Tried some ways but nothing worked..

    Read the article

  • Problem when compressing SWF in Linux with java.util.zip

    - by CaioToOn
    Hi! I've created a servlet that changes the binaries of a SWF file and output it to the user. The SWF is compressed by ZLIB by default. Then I inflate, change the binaries, deflate and output the result. Everything was running right on a Windows Server 2008 (also in 2003). Currently, we need change the server to Linux, and then, this servlet is somehow outputing a corrupted SWF File... what could be the problem? What intrigues me more is that there is no difference between the Windows and Linux servlet versions. Is there any undocumented linux specific behaviour for the java.util.zip package? My Windows Server is (where the servlet is working): Windows Server 2008 (6.0 - x86) Apache 2.2.11 Tomcat 6.0.16.0 Java JDK 1.6.0_12-b04 My CentOS Server is (where te servlet doesn't work) CentOS 5.4 (2.6.18-164.15.1.el5 - i386) Apache 2.2.3 Tomcat 6.0.16.0 Java JDK 1.6.0_12-b04 Any lead would be appreciated! Cheers, CaioToOn!

    Read the article

  • Disable/Enable applicationbar Button in runtime with event textchanged (Windows Phone)

    - by user3621634
    In this part of the code is the event TextChanged to enable the button in te applicationbar Code in C# private void Textbox_TextChanged(object sender, EventArgs e) { ApplicationBarIconButton btn_guardar = ApplicationBar.Buttons[0] as applicationBarIconButton; if (!string.IsNullOrEmpty(txt_nom_usuario.Text) && !string.IsNullOrEmpty(txt_edad_usuario.Text) && !string.IsNullOrEmpty(txt_peso_usuario.Text)) { btn_guardar.IsEnabled = true; } else btn_guardar.IsEnabled = false; } Code XAML <phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar Mode="Default" IsVisible="True"> <shell:ApplicationBarIconButton x:Name="btn_guardar" IconUri="/icons/appbar.save.rest.png" Text="Guardar" Click="btn_guardar_Click" IsEnabled="False" /> <shell:ApplicationBarIconButton x:Name="btn_atras" IconUri="/icons/appbar.back.rest.png" Text="Atrás" Click="btn_atras_Click" /> </shell:ApplicationBar> </phone:PhoneApplicationPage.ApplicationBar> <TextBlock x:Name="lbl_ingresanombre" Height="39" Margin="60,28,0,0" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Width="248" FontSize="29.333" FontFamily="{StaticResource Helvetica}"><Run Text="Ingresa "/><Run Text="tu nombre"/></TextBlock> <TextBox x:Name="txt_nom_usuario" Height="63" Margin="47,58,69,0" TextWrapping="Wrap" Text="&#xa;" FontSize="21.333" VerticalAlignment="Top" IsEnabled="True" /> <TextBlock x:Name="lbl_edad" Height="38" Margin="60,117,0,0" TextWrapping="Wrap" Text="Ingresa tu edad" VerticalAlignment="Top" FontSize="29.333" HorizontalAlignment="Left" FontFamily="{StaticResource Helvetica}"/> <TextBox x:Name="txt_edad_usuario" InputScope="TelephoneLocalNumber" Height="63" TextWrapping="Wrap" Text="&#xa;" FontSize="21.333" Margin="47,147,69,0" VerticalAlignment="Top" MaxLength="3" />

    Read the article

< Previous Page | 4 5 6 7 8 9 10  | Next Page >