Posts

Showing posts from February, 2010

c++ - namespace usage -

I am trying to start using the namespace correctly (or at least the best) way. The first thing I tried to do was to avoid using namespace XXX; Instead of initializing my files, I want to use xxx :: yyy as locally possible. Here is a small program that shows: #include If I'm std :: cout; I leave the lines using or std :: endl , then the compiler will complain when I use cout or endl Trying to do But why is it not necessary for srand , rand and time ? I am pretty sure that they are in std , because if I want to specifically put std :: in front of them, then my code is working fine. If you use cstdlib et al, the names in them are kept in both global and std :: namespaces So that you can select them prefixed with std :: or no. It is seen by some as an attribute, and is seen as a wrong practice by others.

iphone - zoomToRect does nothing if your UIScrollView is already at that zoomlevel -

I think I've found a bug in the UIScrollView, but I want to check if others are seeing the same thing And if this is the expected behavior. I have found a UIScrollView and trying to set what it is looking at when using zoomTract it works fine. If I drag the view and drag it somewhere else Is watching and then triggers zoomautract with the same values ​​which it does nothing. The ZoomToRect command performs only a few things, if zoom scales need to be adjusted, if a pan is required, the scene just sits still. Since a user could pinch to zoom in or out, I was hoping to use zoomTorrect and should not scrutinize zoom level separately. Has anyone else experienced this? Should it be or is it a bug? *** Adding the code as a request Call for the first time [myScrollView zoomToRect: Animated ZoomToRect: Yes] ; View the point exactly in the UIScrollView that I wanted to do Now drag the user to the screen and move the point that is looking at UIScrollView No zooming, only

java - How to use a jar that uses Spring in common lib? -

I'm actually new to spring and I'm not sure if I'm doing it correctly. Here's my problem: I have exported a jar which uses Spring 2.5, which is to inject a dependency for the class in another project called "business". There is an accessor using ClassPathXmlApplicationContext to get twenty. I put that code in the common / lib of JBoss 4.2. In a webpad, in a JSP, I get an accessor, and then call it a method with it. The compilation is okay, but when I reach jsp, I have NoClassDefFound on ClassPathXmlApplicationContext . If I use webapp / lib in common / lib , I have a java.lang.ClassNotFoundException: org.acegisecurity.AccessDeniedException . How can I make it work? Or what is another way to do this? You somehow depend on spring protection. Download the Spring-safety jar.

Creating java.util.Map in Android -

I want to make java.util.map in Android with one resource. I want to do this because I have Java. There are several entries to populate in ITP.map and I want to store the values ​​in the project's reserve folder in XML format. How to do this in Android? My map will be around 2500 entries, so I want to make it as effective as possible and I do not want to rigid them ... thanks, yard I think the XML format key-value pair is "too much" to simply store. A text file where a line is a key-value pair, it is more appropriate (such as with a comma separator), parsing will also be easy. foo1, bar1 foo2, bar2 ... Change your text file to the res / raw directory Open it with context.getResources.openRawResource (R.raw) Place them in your map < Li> Split line to loop on each row and get key and value. This is all

php - eZ Publish beginner -

I am trying to learn Ez published CMS, and I could not find any decent tutorials that are easy to understand and to learn. Plz, if anyone can help me with links to any useful tutorials, I would appreciate it .... , thinking a little strange in places, you must be adequately covered to begin. What do you want to learn? Content management / user side, template development, module development? There is a complete lack of documentation later, but you can look at ezwebin (bundle with installation) and choose template development by looking at the technical manual.

java - How to iterate an ArrayList inside a HashMap using JSTL? -

I have a map like this, map & lt; Integer, Arrayist & lt; Object & gt; & Gt; ; MyMap = New LinkedHash & lt; Integer, Arrayist & lt; Object & gt; & Gt; (); Now I have to do this map again and then inside the map ArrayList. How can I do this by using JSTL? You can use tags to arrays, archive and recycle on the map. In the case of arrays and collections, running var will promptly present you the current item. & lt;% @ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" % & Gt; & Lt; C: forEach item = "$ {collectionOrArray}" var = "item" & gt; Item = $ {item} & lt; Br> & Lt; / C: foreach & gt; In the case of a map, every frequency will give you an object which in turn getKey () and GetValue () methods. and lt;% @ taglib prefix = "c" uri = "http: //java.sun com / jsp / jstl / core" & Gt; & Lt; C: forEach item = "$ {

java ee - JSF works only with the .xhtml ending -

I start with the programming of the JSF website. Currently all files have .xhtml closing. When I go everything, it's all right. But when I change the name of the file from start.xhtml to start.jsf, then I became a notifixed error. What is my fault? & lt; Servlet-name & gt; FaceServlet & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Javax.faces.webapp.FacesServlet & lt; / Servlet category & gt; & Lt; / Servlet & gt; & Lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; Faces servlet & lt; / Servlet-name & gt; & Lt; URL pattern & gt; * JSF & Lt; / Url pattern & gt; & Lt; / Servlet-mapping & gt; & Lt; Context param & gt; & Lt; Ultimate Name & gt; Javax.faces.PROJECT_STAGE & lt; / Lastname & gt; & Lt; Ultimate Price & gt; Development & lt; / Super-valued & gt; & Lt; / Reference param & gt; You must change the javax.faces.DEFAULT_

firefox - Why does reduceRight return NaN in Javascript? -

I am using Firefox 3.5.7 and inside firebug I am trying to test the array.reduceRight function I work, it works simple arrays But when I try to do something like I get NaN why? & gt; & Gt; & Gt; Var Description = [{Score: 1}, {Score: 2}, {Score: 3}]; & Gt; & Gt; & Gt; Description [Object score = 1, Object score = 2, Object score = 3]> gt; & Gt; & Gt; description. Reduce (function (x, y) {return x.score + y.score;}, 0) nayn I also tried to map and at least see me the .score component Of each element: & gt; & Gt; & Gt; description. Map (function (x) {console.log (x.score);}) 1 2 3 [undefined, undefined, undefined] I read the documentation but apparently I could call my Description Why is it not able to work for all scores values ​​in the array? The first argument given to the function is the accumulated value. The first call on the function will look like f (0, {Score: 1}). So when you're doing x.score, you&

Modify regex to match dates with ordinals "st", "nd", "rd", "th" -

How can regex down to match the dates with the serial number on the part of the day be modified? This Reggae coincides with "January 1, 2003 | February 29, 2004 | 2 November, 29 320", but I also need it: "January 1, 2003 | February 29, 2004 | November 02, 3202 | March 3, 2010 " ^ (?: (((January (uary)) | Ma (R)? | Y) | July (Y)? | August (Ost)? | October (Ober)? | December (Amber)?) 31 () ((January (uary)) | (R (f)? | Y) | April (IL) |? JU ((?)? (? ) (August) (October) (October) (Amber)? (0? [1- 9] | ([12] \ D) 30) (February (Rਵਰੀ)? \ (0? [1- 9] | 1 \ 2 | [2 | 9] | 8] | [13579] [26]) | ((16 | [ [2 9] \ d) \ d {2} )) Thanks. (1 ) Any month's name or short; (2) white spot; (3) any one or two digits; (4) white space; ( 5) Any cents, ND, RD, th; (6) white space or comma + alternative white space; (7) any four digits; I'm not sure Who are you matching with But if I had January 35, 3001 then I would think that I would capture it again and

c# - Problem with BeginInvoke (the delegate does not perfom any action) -

Hope you're doing well. I am facing an anxious problem with Begininvoke and I really really need your help I have a class reporting which types of reports are many examples < / P> Class reporting: UserControl {// Report UserControl reports are taken from _report1; Report _report2; Report _report3; // Instanciate and passed ID report (instanciated // instanciated and only if it is created to be empty) report back public report GetReport (int reportId); Public delegate void GenerateReportAsImageDelegate (integer reportId, string path) // report if (InvokeRequired) BeginInvoke (new GenerateReportAsImageDelegate (GenerateReportAsImage), new object [] {generated image saved as public void GenerateReportAsImage (integer reportId, string path) {{ ReportId, path}); } Else {// ... Generate report etc ..}} ....} This one user's control is shown in a form and it is the same user control Is also used by Windows To prepare a report every minute, I am using the system. t

safely parsing maps in clojure -

I'm looking for an easy and secure way to parse a map, and only a map, untrusted source maps Contains keywords and numbers, What are the security concerns of using the to read ? read is completely insecure by default, this arbitrary code execution allows for. Try (for example "print-string \" hello \ ")") . You can secure it by binding * read-eval * if any # = signaling is used on the wrong An exception will start, for example: (binding [* reading-aval * false] (read-string "# = (println \" hello \ ")")) Finally, supplying a large number of keywords (: foo,: bar), depending on how you are using it, is potentially a disapproval of service attack. The keywords are closed and never free; if enough use is done, then this process will be out of memory, on the closing-dev list.

javascript - How do I get HTML corresponding to current DOM tree? -

jQuery ("html")। Html () रैपिंग टैग को छोड़कर, इसके अधिकांश को प्राप्त करता है। क्या यह विश्वसनीय है? क्या यह सिर्फ एक अच्छा विचार है जो कि jQuery का आउटपुट लेता है? और लपेटो ... इसके चारों ओर? मैं कम से कम कुछ सिद्धांतों की समस्याओं को देख सकता हूं और स्क्रिप्ट को शामिल कर सकता हूं जिन्हें फिर से शुरू नहीं किया जाना चाहिए। कोई भी बेहतर तरीका? संपादित करें: jQuery ("") .append (jQuery ("html") क्लोन ())। Html () लगभग काम करता है, सिवाय सिद्धांत के लिए। इसे पाने का एक आसान तरीका है? संपादित करें 2: मुझे उचित कगार / लगभग मानक / मानक मोड प्राप्त करने के लिए ज्यादातर कार्यप्रणाली चाहिए। Document.compatMode का आधा हिस्सा है, क्या यह पर्याप्त है? jQuery का उपयोग innerHTML एचटीएमएल प्राप्त करने के लिए आप इस विशेषता का उपयोग करके सटीक DOM स्थिति प्राप्त नहीं कर रहे हैं। उदाहरण के लिए इनपुट मानों की सामग्री या select बॉक्स की स्थिति एक समान नहीं रहेगी जब तक कि आप innerHTML को कॉल करने से पहले ठीक से संशोधित नहीं करते। < / P> यह क

camera - Extracting iPhone Exposure Setting -

संभव डुप्लिकेट: ऐसा लगता है कि इससे पहले एक समान सवाल पूछा गया है, मैं नया आईफोन कैमरा सोच रहा था, अगर कैमरे से एक्सपोजर डेटा निकालने का कोई तरीका है? ऐसा लगता है कि यह आप पर ध्यान केंद्रित करने के आधार पर विभिन्न जोखिम का नमूना करने में सक्षम है, लेकिन मुझे अभी तक कोई और दस्तावेज नहीं मिला है। धन्यवाद नहीं। यह अभी भी उपलब्ध नहीं है।

erlang - how to limit message queue or emulate it? -

I'm processing now! Message, but as I made a little mistake, a message queue size is limited to memory only. I have a tree of procedures where the cards produce messages and feed up to the root and I have to limit the queue or any other way Need to switch from More than this, sometimes the process receives messages from one leaf and sometimes two leaves. In the second case, I need different finite queues for Eva stones. There is no built-in mechanism to limit the message queue size for a process. A common solution to this problem in Erling is to present a flow control protocol between the producer and the consumer, it can be as simple as the sender is waiting for a continue , Before sending the next message. You can invent more complex flow control protocol (windowing, ...), but will often send / wait-answer. The gen_server: call / 2 protocol is a good request-response protocol and can be used by looking at the code for gen_server and gen: call - This probably

c++ - What all Design Patterns can I use? -

1 I need to create a "web service server" (simulator) that generates XML files and for notification Sends async calls to the customer At this point, I am writing a code to create dummy XML files which will be used for testing (FileGeneratorClass - Builder)? 2 Also, can I implement it in such a way that I do not have to write complete code from scratch to emulate another web service server and other file formats ? - What method can I take advantage of there? Objects / classes are generated from 3 schema files (for XML files) and WSDL (for web service), how do I make my code immune to changes in these files (new versions) Can i - Which design pattern ?? (Please tell me if the information I provided is too much or too little, even if you need me) Thank you very much. Disclaimer : I am a complete newbie and using this pattern for a smaller project may be more, yet I want to do it so that I know it / Understand Which I think, when I need to do in a more complicate

C Linked list only contains first element...not sure what happens to rest -

I posted a question about a linked list in a CD some days ago. I thought that everything is fine, then Professor email is telling us that instead of this signature: int insert_intlist (INTLIST * lst, int n); / * Inserts int (n) in an intlist from the beginning * / By mistake it means: int insert_intlist (INTLIST ** Lst, int n); / * Inserts int (n) in an intlist from the beginning * / I thought now that I am quiet that I have an indicator for the indicator, I can move the pointer out and when I return to the main, I still have my complete list of links. He starts with giving us this: INTLIST * init_intlist (int n) {INTLIST * lst; // Store = penter node lst = (INTLIST *) malloc (sizeof (INTLIST)); Make enough memory for // node - lst- gt; Datum = n; // Set lst-> Next = NULL; // Set the Pointer Return List; // Return new list} Which is primarily to start the list: if (lst == NULL) lst = Init_intlist (i); Else insert_intlist (LST, I); The list type is of IN

PHP Session Cookies stopped working on my server ONLY -

I have a strange issue going on with my dev server, just a few hours ago, the PHP session completely left the job Errors were started showing each single file (hundreds) below, session cookies were not written. I can not understand what the problem is, the reason for this is just starting, before everything works and I have not even made any changes. Worse than all, I can not work on it. I tried different browsers, rebooting my server, rebooting my PC too. Anything does not help, any ideas what I can do? This is really crazy Please note that I do not have any white space or printing anything on the screen before calling session_start () Warning: Session_start () [function.session - start]: session cookie can not be sent - Headers that have already been sent (C: \ webserver \ htdocs \ friendproject2 \ labs \ 2.php: 1) Output: C: \ Warning: session_start () [function.session-start]: Sessions can not send cache limiter - headers have already been sent to webserver \ htdocs \ frie

iis - How to specify a timeout value on HttpWebRequest.BeginGetResponse without blocking the thread -

I am trying to issue asynchronous release of web requests. My code is working fine except for one thing: There is no built-in method to specify a timeout at BeginGetResponse . The example of MSDN clearly shows an example, but the downside is that they all end with some objects. VoteOne () which again explicitly tells that this thread blocks it I will be in a high load environment and can not block, but I have more than 2 seconds There is a need to make a request even if it takes time. I lack the ability to create and manage a separate thread pool, is there something already in the framework that can help me? Code> BeginGetResponse () is a way for the callback to enclose, with some indication that the time has expired. The obvious timeout parameter is not respected on the async call unless the return return is returned, the ReadWriteTimeout parameter does not play a non-ownership The solution would be better. Edit: This is how I came: After calling

sql - Check In between two times -

I want to check in IF in sql server .. Checking me periodically and parm1time and paramtime2 I want to return the value if the checkin time is between param1 and param2 how can i write Example @ Checkin = 10.00 Ultimate 1 = 2.00 Ultimate 2 = 13.00 How can I do this in SQL Query SELECT .... WHERE @ CHECKIN BEATWEEN @ param1 and @b2 ultimate or .... about @checkin@param1 and @complete2 etc

removing the empty gray space in datagrid in c# -

How do I remove an empty space, that is, I want the datagrid to automatically resize itself Should not be changed in I know the columns of rows that we can use in the AutoSizeColumnMode fill value, but there is no fill value for AutoSizeRowsMode. is a bit of a hack but you can try it: dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; BTWV has been here.

PHP search array and add content on position where id's are equal -

I have 2 ascock structures containing the same structure, but only one ID is identical. I need to add content to the menu array at the same time as the specific ID of the array included in it. Here is a sample of the array (Menare can catch up to 100 items or more, only one part in the sample is the real content): $ MainArray = Array ([0] = & gt; Array ([item_id] = & gt; 1 [name] => Test1 [helptxt] => item-id 1. [type_id] => 1 # Many other items Can be similar to !!) [1] = & gt; Array ([item_ID] => 2 [name] => test2 [helpcut] = & gt; item-id support text 2 . [Type_id] = & gt; 2 # can be similar to many other items !!) and many more arrays) $ IncludeArray = Arr Ay ([0] = & gt; Array ([type_id] => 1 [typetitle] = & gt; number [typedesc] => description text type_id 1) [1] => array ([type_id] = & Gt; 2 [typetitle] = & gt; value [typedes c] = & gt; should be the desired new array: $ NewMainArray = Array ([0] => a

iphone - viewing tableViewLines on background of custom UIView -

I have a view controller that contains a tableview and a custom loading UIView that shows a loading message and a spinner while the table view Loading of data is a red background in custom UIView that I can see, but I can still see the line of table view, how can I display custom UIV vid without seeing table view lines on the background I am @information loading website @ synthesis spinner; - (id) initWithFrame: (CGRect) frame {if (self = [super initWithFrame: frame]) {// initial code [self setuser interface enabled: no]; [Self setback color: [UIColor blueColor]]; // spinner spinner = [[UIActivindicator Vive Allok] Initvivitivity Indicator Style: UIActivindIndicator ViewTilWite Large]; [Spinner setcenter: CG pointmake (320/2, 150)]; [Self add sublueview: spinner]; [Spinner start-up]; // title label UILabel * titleLabel = [[UILabel alloc] init]; TitleLabel.text = @ "Loading ..."; TitleLabel.font = [UIFont boldSystemFontOfSize: 18]; TitleLabel.lineBreakMode = UILineBreak

ruby on rails - How can I identify and process all URLs in a text string? -

I would like to enumerate all the URLs in a text string, for example: Text = "fasòls http://george.it sdafsda" found for each URL, I want to apply a function method (...) Am string I am using a method like this now: msg = "" if i (i = ~ URI :: regexp) in text.split Nil? Msg = = "" + I and msg + = "" + method (i) end and text = msg this works, but it is slow for long string how do i Can I increase I think "gsub" is your friend here: Category UrlParser attr_accessor: text, url_counter ,: urls def initial (text) @text = parse (text) end personal def pars (text) @ counter = 0 @urls = [] text.gsub (% R {(\ A | \ S +) (http: // [^ \ s] +)}) do @hamles & lt; & Lt; $ 2 "# {$ 1} # {replace_url ($ 2)}" end-end DRP replace_url (url) @counter + = 1 "[# {@ counter}]" end and processed_rill = urppres.new ("a http: // x .com / url two ") parsed_url.text puts parsed_url.urls If you re

obfuscation - Ruby obfuscator -

क्या कोई रूबी ऑब्फ़सकेटर या "कंपाइलर" है? कुछ विकल्प हैं, जैसे या हालांकि, व्याख्याय भाषाओं के सभी obfuscators एक गंभीर दोष है: वे आमतौर पर अधिक परिष्कृत metaprogramming तकनीकों को समझ नहीं है। यही है, वे जरूरी नहीं बता सकते हैं कि कुछ जैसे foo.send (: बार, ...) एक पूरी तरह से अलग पुस्तकालय में बार विधि पर एक आमंत्रण है, या वह eval ("% w की आवश्यकता है {एबीसी डीआरडीफी} ") से तीन अलग-अलग पुस्तकालयों की आवश्यकता होती है ये तुच्छ उदाहरण हैं - जब आप method_missing और मिश्रण के रूप में इसके साथ फेंकते हैं तो चीजें ज्यादा जटिल हो जाती हैं। जब कोई ऑब्फ़्स्कुएटर इस तरह के कोड का सामना करता है, तो यह कर्तव्य को संकलित करेगा उपयुक्त निर्देश, लेकिन यह संभवतः कुछ अन्य पुस्तकालयों या अन्य कोड को अन्य स्थानों से भी शामिल करने के लिए नहीं पता है गतिशील रूप से शामिल डी या की आवश्यकता घ एक स्थिर रूप से जुड़े निष्पादन योग्य में रनटाइम पर उपलब्ध नहीं होगा क्योंकि गंभीर मुद्दों का कारण बन सकता है। दुर्भाग्य से, कई जवाहरात और लाइब्रेरीज़ परिष्कृत मेटाप्रोग्र

Where does my C++ compiler look to resolve my #includes? -

This is really a fundamental question, I am learning C ++ and so far I have only used the standard library is. I & lt; Iostream & gt; There is no other problem with anything else, now I want to use Apache axis, so I have installed it on my machine (a debian system) and following a tutorial that says that I must include: #include & lt; Xercesc / sax2 / SAX2XMLReader.hpp & gt; But G ++ says "Error: xercesc / sax2 / SAX2XMLReader.hpp: No such file or directory". Where is this looking? Do I need to give it more information? Thank you. code> - verbose option: [ ...] #include "..." search starts here: #include & lt; ... & gt; Search starts here: /usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/ usr/lib/gcc / I686-pc-linux-gnu / 4.4.2 /../../../ contains / c ++ / 4.4.2 / i686-pc-linux-gnu / usr / lib / gcc / i686 -pc-linux -GNU / 4.4.2 /../../../../ included / C ++ / 4.4.2 / Backward / USR / local / includ

Will C/C++ libraries work on Android Phone -

What is the experience of anyone using JNI to call the original C / C ++ library in Android ? Is there a suitable environment for running C / C ++ libraries and if there is something special about the environment that you need to adjust? Thanks I understand that the Android standard provides a subset of the standard C ++ runtime library example For Android, in the native code I think there are other restrictions besides this. One complexity is that, while Android can contain many basic libraries, only some of them are considered sufficient to stabilize. Libm (Mathematical Library) header JNI interface header LiboZ (Zlib compression) header Login (Android logging ) Header A minimum set of headers for C ++ support If your C library only uses them, you should be OK. C ++ support seems a little spotty.

proxy - Nginx proxy_pass to a password protected upstream -

I want to pass the request to an upstream server. The original url password is not protected, but the upstream server is I need to inject a basic Auth username / password in the request, but get errors when this happens: upstream support backend {server username: password@support.yadayada Com; } and upstream support backend {server support.yadayada.com; } Location / Deliver {proxy_pass http: // username: password @ backend support; } You get the proxy_set_header authorization "Basic ...."; where .... has a base of 64 users: pass .

delphi - Zoom to full screen? -

How to activate / use this feature in 2010?!? I have the zoom in full screen in Devices & gt; Options & gt; Editor Options & gt; Display clicked OK but nothing has happened, I said to myself, we see what to say about help. I pressed the F1 key, wait a little longer, help is coming, but as I have expected, there is no idea about this, irony is this: Help did not help Google found some old blog posts For those who provide some old information such as double click on the editor tab or by pressing F5 must be rough but, this is not the case, so I am asking here That shoe No further information about this. This option controls whether the code editor, when zoomed , Will zoom to capture the entire screen. If that option is not set, maximizing the editing window will leave the place at the top of the screen for the main IDE application window. If you do not maximize the editor window, then that setting has no effect. Even when you are using the "classic

c# - Help with Predicate<T> delegate -

I am trying to create an overloaded ad using an ordered class as an extension, and some key based values On. The calling code will look like this: OrderDocument = New ordered design (); Prediction & lt; Int> lessThan5 = i =>; I & lt; 5; Hint & lt; String> lenOf2 = s => s.length == 2; Dict.Add ("01", "name", lessThan5); Dict.Add ("02", "Location", lenOf2); I have created an extension method like this: public static class collection extension {add public static zero (this ordered objects, string , String v, predicate p) {if (p) {d.Add (k, v); }}} But this does not work because I can not seem to "bool" in reading a compiler error. Does anybody know what I am missing? Thanks for any help - Katha The problem is that you Are not checking to evaluate the predictions and see if the predicate is satisfied. Now, this is not clear from your question. If you want to test the key or value, check the

regex - Java Regular Expression -

I need to define a (java) regex that will match any string in which none of them are included Is it possible to express it as a single reggae? I know that it will be more readable to use 3 different regexs, but if possible, I want to do it in one. Thanks, Don Try the following: Last Private Static Patterns p = pattern.compile (". * \\ b (?: Foos??. Bars | Bazs) \\ b *"); Public Boolean isGoodString (string stringtest) {return! P.matcher (stringToTest) .matches (); }

php - mutiple database in codeigniter -

I am trying to implement multiple databases in CI. My code is here: < Code> // database.php $ active_group = "default"; $ Active_record = TRUE; $ Db ['default'] ['hostname'] = "localhost"; $ Db ['default'] ['username'] = "root"; $ Db ['default'] ['password'] = "root"; $ Db ['default'] ['database'] = "revx"; $ Db ['default'] ['dbdriver'] = "MySQL"; $ Db ['default'] ['dbipfix'] = "rvx_"; $ Db ['default'] ['pconnect'] = true; $ Db ['default'] ['db_debug'] = true; $ Db ['default'] ['cache_on'] = falls; $ Db ['default'] ['cachered'] = ""; $ Db ['default'] ['char_set'] = "UTF8"; $ Db ['default'] ['dccillet'] = "utf 8_ggri_c"; $ Db ['smf'] ['hostname'] = "localhost"; $

objective c - Problem filling NSMutableArray w/ UIImage objects -

When trying to fill a NSMutableArray with UIImages is me issue one upset. CGBitmapInfo BitmapInfo = kCGBitmapByteOrderMask; CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB (); While (...) // & lt; --- changes through the data sets (Sijeeditaproverarf provider = Sijeediapiproidkretdetadeta (NULL, data, Numbaits, NULL); CGImageRef cImage = CGImageCreate (iw, Ih, 8, 32, 4 * iw, colorful place, Bitmapinfo, provider, zero No, rendering); UIImage * last Image = [UIImage imageWithCGImage: cImage]; [images addObject: finalimage]; // & lt; --- Bejenijeshn declared and immediately before [representatives: final Image]; CGImageRelease (cImage); CGDataProviderRelease (Provider);} CGColorSpaceRelease (colorSpace); [Representative operation complete: six With this: Picture]; Similarly, I have a code going on. That's why I'm basically going to the statement when the bitmap gives the next set of data

asp.net mvc session? -

I am creating an admin interface for the Medical Records Management App. My client has chosen me to easily choose a patient It is said that he would like to work with the user every time, every time he wants to take any action to choose the patient, for example, he says that he will record a record for the patient's current condition (weight, size, etc.) Want to submit and then Give the doctor to a different doctor or change the current working company to the patient. He does not want to choose the same patient three times ... He wants a select dropdown for patients and the patient Want to show different actions for I'm thinking that it should be stored in a session variable in some way .. I have a table of patients and using Im LinqtoSql classes .... do you reccommend ?? help please. Looks like you want to insert some in session - maybe some "Recently patient" information such as patient ID, patient name, etc. Definitely take a look at how to do it in

actionscript 3 - Flex Matrix rotate Image n degrees -

How do I rotate an image like 180 degrees clockwise using matrix I get image 90 I can use the following code to rotate the degree, but it is incremental, meaing var metrics: matrix = new matrix (); Matrix.rotate (Math.PI / 2); Matrix tx = imgControl.content.height; Var Bitmapdata: Bitmapdata = New Bitmapdata (imgControl.content.height, imgControl.content.width); BitmapData.draw (imgControl.content, matrix); ImgControl.source = new bitmap (bitmapdata); Every time I run the code, the image rotates + 90 degrees. I do not want to increase 90 times every time, but it is clear that rotate 180, and so on. I'm not familiar with the matrix, but I think it manipulates the actual bitmap data instead of just the example. Image component rotates box (if I'm wrong then arrest me) If so, then I feel that whenever I rotate the order I will reset the image every time. Am I missing something? P> Matrix does not manipulate any actual bitmap data. This is the bitmap.

css - What are pros to use XHTML 1.0 strict with content="text/html; over HTML 4.01 strict? -

I'm sure all people know here that we serve pages with the right mime type (application / xhtml + xml) Can not say that XHTML will be parsed as HTML from any browser without breaking IE compatibility, and any content given with text / HTML. So if the content is not parsed as XML. I use the XHTML dot type for only one reason: it helps to find "errors" in my markup more stringent than HTML. Even if my documents are also used as text / html Is HTML 4.01 strict to use XHTML 1.0 strict with content = "text / html" Have other benefits? Currently and in the future If I'm already writing well valid HTML 4.01 strictly and Any additional XHTML features (SVG, DocBook, Mathal , OFX, etc.), never to manipulate my XHTML from XL (T) Application in the server document / html + xml > Nobody. You do not get any benefit from XHtml. As far as browser is concerned, this is going to be strange HTML, not XML. To achieve the advantages of XML, such as exten

What is the best way to prevent out of memory (OOM) freezes on Linux? -

Is there any way to work with OOM Killer and to prevent Linux from freezing? I am running Java and C # applications, where any of the allocated memory is usually used, and (if I understand them right) are freeing the overcomment machine. Now, as a temporary solution, I said, /etc/sysctl.conf in vm.overcommit_memory = 2 vm.overcommit_ratio = 10 . Let anyone know why the current OOM weapon can not work properly in a guaranteed manner, whenever the kernel moves out of "real" memory kills the processes. Edit - Many answers are on the lines of Michael. "If you are facing OOM killer related problems, you probably have to run away from memory It has to be corrected ". I do not think this is the right solution, there will always be worm-like apps, and I would like to adjust the kernel so that my whole system is not free. Given my current technical understanding, it does not seem that it should be impossible. Below is actually the original Perl script I

How can I recognize the last iteration in a C++ while loop? -

How do I do that the last player's name is not , then it is: Player Online: Jim, John, Tony and not Player Online: Jim, John, Tony, My code is: bool commands :: whoIsOnline (creature * c, const std :: string and cmd, const std :: string & ultimate ) {Player * player = dynamic_count & lt; Player * & gt; (C); If (player) {player-> SendTextMessage (MSG_STATUS_CONSOLE_BLUE, "player online:"); Autologist and lieutenant; Player & gt; :: Litterator IARR = Player :: listPlayer.list.begin (); Std :: String information; Int count = 0; While (IARR = Player :: listPlayer.list.end ()) {info + = (* iter) .second-> GetName () + "," ;; ++ ITER; ++ count; If (calculated% 10 == 0) {player-> SendTextMessage (MSG_STATUS_CONSOLE_BLUE, info.c_str ()); Info.clear (); }} If (Info.empty ()) player- & gt; Send Text Message (MSG_STATUS_CONSOLE_BLUE, info.c_str ()); } Back true; Instead of thinking it instead, player + "," it

c++ - Equivalent of InterlockedIncrement in Linux/gcc -

This would be a very simple question (can be repeated), but I was unable to find it. The Win32 API provides a very easy set of atomic operations (such as intrinsics) such as interlock incinerator which adds lock using x86 code Does. In addition, Interlock Comprehensive Exchange has been mapped to lock cmpxchg . But, I want to do it in Linux with GCC. Since I am working 64-bit, it is impossible to use inline assembly to have internalities for GCC?

html - How to make styling and functioning of form elements get not to break in all browsers? -

How to style and work the same elements in all browsers? & lt; Form & gt; & Lt; / Form & gt; & Lt; Fieldset & gt; & Lt; / Fieldset & gt; & Lt; Story & gt; & Lt; / Narrative & gt; & Lt; Button & gt; & Lt; / Button & gt; & Lt; Label & gt; & Lt; / Labels & gt; & Lt; Input type = "button" /> & Lt; Input type = "checkbox" /> & Lt; Input type = "file" /> & Lt; Input type = "hidden" /> & Lt; Input type = "picture" /> & Lt; Input type = "password" /> & Lt; Input type = "radio" /> & Lt; Input type = "reset" /> & Lt; Input type = "submit" / & gt; & Lt; Input type = "text" / & gt; & Lt; Gt selection and; & Lt; / Select & gt; & Lt; Options & gt; & Lt; / Options & gt; & Lt; Text area & gt; & Lt; / Text fi

java - Hibernate many to one delets all parents when a child is deleted -

I have country and state objects. I intend that in a relationship from state to country, there are many unidirectional states. I do not want to store any reference to I have defined mapping below. When I even remove a state object, then all the countries are destroyed! & lt ;? XML version = "1.0"? & Gt; & Lt ;! DOCTYPE Hibernate-Mapping Public "- // Hibernate / Hibernate Mapping DTD // N" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> & Lt; Hibernate-Mapping & gt; & Lt; Class name = "places.ountry" table = "COUNTRY" dynamic-update = "true" & gt; & Lt ;! - Technical ID - & gt; & Lt; Id name = "name" type = "string" not saved-value = "new" column = "COUNTRY_NAME" & gt; & Lt; / Id & gt; & Lt ;! - Property - & gt; & Lt; Property name = "anonymous" column = "COMMON_NAME" /> & Lt

ajax - ScriptManager loads multiple java scripts in asp.net ? i need them to be all in one as per YSlow guidelines -

According to Yahoo's guidelines for web site performance, JavaScript should be added to avoid additional http requests, as I saw. YSlow asp.net 3 to 4 scripts for MicrosoftAjax.js, a MicrosoftAjaxForms.js & amp; Some other 2 postback & amp; Client side verification, I want to get these 4 JS in one There 4 Please tell me how do I get it? Thank you. You ScriptManager - CompositeScript Feature ... This can be used like this: & asp: ScriptManager runat = "server" id = "ScriptManager1" & gt; & Lt; CompositeScript & gt; & Lt; Script & gt; & Lt; Asp: ScriptReference name = "MicrosoftAjax.js" /> & Lt; Asp: ScriptReference name = "MicrosoftAjaxWebForms.js" /> & Lt; / Script & gt; & Lt; / CompositeScript & gt; Note that this is an ASP.NET 3.5 feature .. so if you are using at least 3.5, you will have access to it ..

jquery - Can I load external stylesheets on request? -

$। GetScript ('ajax / test.js', फ़ंक्शन () {चेतावनी ('लोड किया गया था। ');}); .. उपरोक्त कोड की तरह जो अनुरोध पर एक बाहरी जेएस लोड करता है, क्या आवश्यक होने पर एक बाहरी सीएसएस स्टाइलशीट लोड करने के लिए कुछ समान उपलब्ध है? उदाहरण के लिए जब मैं अपनी साइट पर लाइटबॉक्सेज़ (इनलाइन पॉपअप) का उपयोग करता हूं, तो मुझे उपयोगकर्ता द्वारा अनुरोधित जब तक कि लाइटबॉक्स जेएस और सीएसएस फाइलों को लोड नहीं करना चाहिए। धन्यवाद हाँ: यदि आप एक स्टाइलशीट से लिंक एक & lt; लिंक & gt; टैग बनाते हैं & lt; head & gt; टैग में जोड़ें, ब्राउज़र वह स्टाइलशीट लोड करेगा। उदाहरण $ ('head')। ('& Lt; link rel = "स्टाइलशीट" प्रकार = "टेक्स्ट / सीएसएस" href = "lightbox_stylesheet.css" & gt;'); हालांकि ,, यह IE 8 या इसके बाद के संस्करण में काम नहीं करता - वहां आपको या तो: अनुलग्न करें href सेटिंग और लिंक से पहले ; या आईई के document.createStyleSheet () विधि का उपयोग करें इसके अलावा, जांचें कि क्

Mobile version of my website, what design width is optimal? -

I am creating a mobile version of the website ... what width should I select for Design? I know that every device has its own width of screen and it is really difficult to fit all the devices ... I am really confused (quite new in the world of mobile websites), please help Please. Thank you. Your approach will depend on how much you want to try (or can) in this Which mobile user do you want to target, for a minimal effort, use 100% according to KNitim and expect to browse your website at a screen width of 128px to 480px. With this approach, you will need to avoid the 'advanced' XHML instructions like CSS and DivX (and JavaScript) because most mobile browsers can not handle some of these aspects. Plan to use tables to manage layout . For a more advanced approach, you can use an open source project called WURFL () which is a mobile browser's database and their capabilities (screen width, CSS, images etc ...). There is a JSP tag library called WNG, where you w

linker - Linux - Is there a way to have a simple static library that contains resources? -

संभव डुप्लिकेट: जीसीसी टूलचैन का इस्तेमाल करते हुए सी स्रोत से जोड़ने के लिए मैं एक स्थैतिक पुस्तकालय में एक संसाधन को एम्बेड करने का एक तरीका निकालने का प्रयास कर रहा हूं एक विंडोज़ डीएलएल के बराबर है जिसमें संसाधनों को एम्बेडेड किया जाता है। क्या यह एक लिनक्स स्थैतिक पुस्तकालय के साथ किया जा सकता है? संक्षेप में, उदाहरण के लिए, यह बिल्ली someresourcedata.txt & gt; Mylib.a और एक संकलित सी कोड के साथ लिंक करने में सक्षम होने के लिए संदर्भ mylib.a । कोई विचार या सुझाव? यदि डेटा को पाठ के रूप में प्रस्तुत किया जा सकता है, तो उसे एक शामिल फ़ाइल में रखें यहां एक उदाहरण है कि यह एक XPM छवि के साथ कैसे करें: / * XPM * / static char * my_xpm_image [] = {"16 16 15 1", "c कोई नहीं", "। सी # 000000 "," + C # 7FFFFF "," @ सी # 007 एफ 7 एफ ", .... और फिर एक स्थैतिक लिब बनाने का मानक तरीका (जो भी हो - मैंने ऐसा नहीं किया है, केवल गतिशील लिब और मैं उस पर थोड़ी सी जंगली हूँ)।

How can I implement extendible hashing in java? -

Great hashing is one of the best hashing method, I want to create programs in Java, do so for extenidble hashing Is there an API available for? I do not get a clear algorithm to do this, so if there is no API, then it is possible that the algorithm I'm just curious, why do you need to implement such algorithms? Are not the standard Java Map deployments for you? If you are suffering from a bulk loaded bulk issue, you should take a look at Hashod () method before choosing non-standard routes. There may also be an option to see some of the options provided by GNU Trav. Finally - the algorithm equivalent to extensible is coking hushing. Some information below: Source code here:

ASP.NET app having viewstate corrupted every few minutes -

I'm having trouble with a web app that I'm getting started by users often getting the following error : Verification Mac verification failed. If this application is hosted by a web form or cluster, make sure that the configuration specifies the same verification key and verification algorithm. AutoGrenate can not be used in a cluster. The problem is that it is not a cluster - it's a single Windows 2003 server, after digging around, it seems that appears in webconfig the machine's < Some additional properties of the / strong> section and the Pages command fix this error: & lt; Machine validation key = 'machine key suspicious' decryption key = 'decryption key snippet' verification = 'SHA1' / & gt; & Lt; Validate pages validate security = "true" enabled EventValidation = "false" & gt; My web After changing these two things in the config, the error goes away, but now I have a new problem

unit testing - What are mock objects in Java? -

I know what is duplicate items in Java. Why do we make them and what their Use? Some object is used for a counterfeit object unit test, if you have objects whose By the ways you want to test, and those methods depend on any other object, you make a duplicate of dependence rather than the real example of that dependency. This allows you to check your object in isolation. There is a general Java framework to create counterfeit goods and they generally allow you to create a mock object whose behavior you can define, so that when you call the methods on the counterfeit object Well know that (as the return value and side effects) expect. For example, a common use case may be in an MVC application, where you have the DAO layer (Data Access Objects) and a controller that displays business logic if you use the unit controller If you want to check, and have dependency on the controller's DAO, then you can duplicate the DAO which will return the dummy object to your controller

jquery - appendTo() is not a function? -

I thought this code should work, but it was not, could anyone explain? $ ("#addLinkLayout input.comment, #addLinkLayoutInput.ink"). Each (function () {$ (this) .val (). AppendTo ('div # links');}); It says that $ (this) .val (). AppendTo () is not a function. attachment can only be applied to jQuery objects Instead, try it: $ ("# addLinkLayout input.comment, #addLinkLayoutInput.ink"), but val .each (function () {$ ('Div # links'). Attachments ($ (this) .val ());});

php - Slashes in MySQL tables, but using PDO and parameterized queries. Whats up? -

OK, so to update my database tables, my code is changing the taste of the following: $ Query = "Comment (comment, comment, rating, userrid) value (: comment, now (), 0,: userrid)"; Try {$ db_conn = new PDF ('mysql: host ='. $ Db_server. '; Dbname ='. $ Db_name, $ db_username, $ db_password); $ Db_conn- & gt; BeginTransaction (); $ Prep = $ db_conn- & gt; Ready ($ query); $ Ready-> Beyond Parm (': Comment', $ Comment, PDO: Parama_ast, 500); $ Ready-> Bindam Parm (': userrid', $ userrid, PDO :: Paramatti, 20); $ Prep- & gt; Executed (); $ Db_conn- & gt; Committed (); } Hold (PDOException $ e) {$ db_conn.rollBack (); Echo "error !:" $ E-> Received Message () " "; Die (); } In the above, the comment comes from a post from another page. Setting properly through the Userrid function call, everything works well, except that the slash is added to the table. Whatever I have read, says that to avoi

algorithm - Efficient search in a corpus -

I have a few million words that I want to find in a billion words carpus. What is the effective way to do this? I'm thinking of a trio, but is there an open source implementation of available tree available? Thank you > - Updated - I should get some more information that is really necessary. We have a system where we crawl news sources and receive popular words based on frequency Word 1 Frequency 1 Word 2 Frequency 2 (Tabs) Delimited) We have also found the most popular words. ($ 1 billion) is from another source, which includes data in the above format. This is what I want to get in the form of output. Common word formulas for both words The words are present only in our source but not in the reference source. There are only words present in the reference source but not in our source. I can use com (Bash command) only for the words in the above information. I do not know how to use com to compare compared to one column compared to both columns. Th

lighttpd - What is the easiest way to front my grails application with LightHTTPD during development? -

I'm not familiar with LightHTTPD and I'm not able to find a guide to how to configure it. Tried to configure it before long, but failed .... What is the easiest way in front of my GREl application in development with LIGHTTPD? " I probably start and stop this by using events available through IEvent.Groovy. Are you going to use static content to use it or to proxy all requests of Grails?

wpf - Dataset validation for type ( C# .NET ) -

Working with dataset validation in my project. I am activating the DataTable_Kallam-Spry event in a partial class of datatable I am verifying my work, but I want to validate the data missmatch on the UI, not on the dataset level but to provide a custom error message. If [someID] expects a number, but for some example the text box enters the string. The problem is that, DataTable_ColumnChanged event, before the fire, the dataset is handling that type of error, and the column can never be changed, I understand it. The question then is how to stop it and how. I want to handle it in a partial datatable class, wrap it in a property or something, but VS produces a bunch of code and I do not know where I want to see :) Thanks. Thanks This is not exactly the answer to your question, but when you mentioned that VS Creating a bunch of Guo, I think that you are probably using drag / drop functionality to complete this task. Why is it partially, as you have already said, you do not under

C# TabPages added at runtime don't autosize the parent form -

I have a simple form that has a tab control scroll, where tab pages are added to the permissions. I've got to do all this work almost as I want to, but when I set the font to autosize, it ignores the rotated tab pages in the calculation ... As long as a new tab page will be added, the tab pages are being added or do they delay autosizing to compute the form? Edit : For the record, I'm testing it 640x480 to start my app (using minimal sept property) and includes 750 wide controls. SuspendLayout () and resumeLayout () Using the trick? It explains how it works. You call SuspendLayout () first, add tab page, then ResumeLayout () . Hope this helps, best regards, Tom.

performance - Why is my sinatra website so slow? -

After asking I started using Sinatra to serve web pages. This evening, a friend, mine and I have started testing the speed of the server. The logging file looks like this: 'rubygems' is required 'sinatra' is required to enable 'haml': session #cookies for! Index End Get and index. It seems like: % title first page% title% h2 first page She's just sitting on a laptop, as I am, With an Apple 802.11N router between us. We are both running Windows 7. I have tried these files on laptops to run Ubuntu 9.10 x64 and all relevant files with Sinatra. It takes 7 seconds to serve Sinatra, a single page request, no problem, server OS, Windows or Linux I think the author managed to get more than 400 requests / processed what gives? (Or should it be on a superuser or such?) I will not have any opinion on that When you should customize your web application. Set up different configurations in your Sinatra app for development and production, becaus

css - What are cross-browser, cross platfom web safe fonts? -

How to create cross-browser, cross-platform and compatible CSS font stacks for all devices? You can not guarantee fonts that will be used on a mobile device in the same way You can guarantee the fonts available on normal computers. A safe bet is to use a normal font family that can be interpreted by a mobile browser to show you relevant fonts, such as font-family : Serif; / * (E.g., times) * / font-family: sans-serif; / * (E.g., helvetia) * / font-family: monospace; / * (E.g., courier) * /

jQuery, PHP form echo does not work -

Can you tell me something is wrong below, for some reason, when I click on the delete image , Which is considered thanks Dave Click on the image to the left & lt; / Form & gt; & Lt; / Div & gt; & Lt; Div id = "del" style = "background-color: # FFFF99; width: 200px; height: 100px;" & Gt; & Lt; / Div & gt; // dela.php & lt;? If ($ _POST ['al_del']) {echo 'variable pass success'; }? & Gt; Post variables are based on the input name, not id, afaik. In addition, I would usually go to if (isset ($ _ POST ['al_del'])) but this is a side bar.

soap - Creating a mock web service from a WSDL file in Python -

We are writing a client for a remote service that exposes SOAP web services and for those services Defines the definition We do not have access to the system during testing, so we want to write a fake service. We are using Python for the client, so ideally we want to use Python for the fake server, although I think it is not strictly necessary. This dream uses the WSDL file that we could fill, and then the service of those who paste the WSGI server as a deployment, even though it does not have to be pasted or WSGI. It works reliably The main thing is that we need to create a stub with the "real" WSDL file so that we can not accidentally write a non-duplicate fake server. We have seen the Library, Sophilib and JDSI using Sood for customer side. However, Vasafi 2 BP stuff in Soapalabab says, "Do not use" on top and ZSI swallows a lot, what do people usually use for this type of thing? Martin As a duplicate server I actually have soap () This takes a WS

c# - How Many Combinations In This If Statement -

OK - I have work with someone who wrote something like this if () if () if () if () I do not like it !! If there are ten different Boolean flags, then how many combinations are there? 10 factual? I am trying to explain why it is bad two flag Two states and 10 flags mean 2 ^ 10 = 1024