Posts

Showing posts from April, 2010

Why aren't exceptions in C++ checked by the compiler? -

C ++ provides a syntax for exceptions to the check, for example: zero (g) (exception); Zero F () throw (); However, the Visual C ++ compiler does not check them; Throwing flag is ignored only in my opinion, this exception feature is unusable, so my question is: Is there any way to ensure the compiler is sure that the exceptions are correctly captured Are / Reprint? For example, a Visual C ++ plugin or a separate C ++ compiler, PS I want to see the compiler that the exceptions are captured correctly, otherwise You end in a situation where you have to catch around every single function call, even though they clearly tell that they will not throw anything . Update: The Visual C ++ compiler shows a warning when throwing in the function marked with throw (). This is great, but sadly, when you call substrate which warns, for example: void f () throw (int) {int (13); } Zero () throw () {g (); } // There is no warning! Exception specification is very useless in C ++

linux - Preferred terminal scripting language -

Which language do you prefer to write scripts for common tasks (backup, sync, etc.) and why? I am not talking about programming web pages or applications I have come up with the question of why Bash is still popular, for example Python looks more comfortable for me. Do you know it or for some specific reasons? If this "make this directory, to run this command, if this work is going on So this is "-Love, I only use the shell shell scripts. And anything complicated, say something which purses the output of a command and works on it, Python Script - I understand this as early as writing, mainly because shell scripts are difficult to debug (python tr Bash script error than saback messages that are not useful ..), and finally the code becomes much more readable

.net - How can I quickly create large (>1gb) text+binary files with "natural" content? (C#) -

For testing communications purposes, I should be able to create large files, ideally in text, binary and mixed formats In. The contents of the files should not be completely random or equal. A binary file with all zeros is not good. A binary file with not completely random data is also not good. For text, a file with completely random sequences of ASCII is not good - text files should have patterns and frequencies that emulate natural language, or source code (XML, C #, etc.). Pseudo-real lesson The size of each individual file is not important, but for a set of files, I need a total of ~ 8GB. I want to keep the number of files at the manageable level, we say that o (10) to create binary files, I have a large buffer I can and do the system. Random FileStream.Write followed by NextBytes in a loop, like this: Int64 bytes = size; Byte [] buffer = new byte [sz]; (Stream file stream = new flamestream (file name, file mode.creative, write.access write)) (while bytesreading

sql - Can I use SELECT statement inside INSERT values? -

मैंने इसे करने की कोशिश की: tbl_vaucher (vaucher_name, created_date) मूल्यों में सम्मिलित करें ((SELECT टॉप 1 कॉन_फुल_नाम FROM tbl_contact), GETDATE ()) , हो रही है: इस संदर्भ में उपकुंजीय अनुमति नहीं है पाठ "> tbl_vaucher (vaucher_name, created_date) में INSERT चुनें शीर्ष 1 con_full_name, GETDATE () से tbl_contact

postgresql - How much more performant is Postgres than MYSQL on fulltext search? -

I am an MYSQL user, never tried postgres. But find the bottle neck full text in MYSQL when the data set is very large. I ran a benchmark over a large dataset a few years ago and found that: MySQL fullvaster One more drawback is that it inspires Mianjam on you which brings many problems. After the index reaches a certain size, the index update also slows down: When you enter a new line, a significant portion of the index is rebounded, sometimes to include a few hundred megabytes of index for a forum post. Is written. In other words, this is fine for some forums with some small posts, but for one reason Wikipedia does not use it ... PostgreSQL Full Text MySQL is nearly 10-100x faster than full text, is very powerful, abstract, faster on inserts / updates, there is no problem with locks, in other words it is a completely decent solution. Although due to the MVCC data set is larger than the RAM slow searches slow down, postgra has to check the visibility of the rows

.NET C# library for lossless Exif rewriting? -

I have found many codes and libraries for editing. But when the image is greater than one in width and height 16. I'm looking to edit an API file (or even a way of doing it myself in a way) (or add Exif data if it is not yet existed ), Leaving other data unmodified. Is this not possible? By now I could only trace the Xf part (starting with 0xFFE1), but I do not understand how to read the data. If you are planning to code your library for editing tags, Specifications of the interchange format are given. / P> P>

nhibernate - Many-to-Many Cascading Delete -

I have defined many relationships between the two classes. Event and person (defined in a separate database table person_event) Now, suppose I want to delete a person, so all the relevant organizations with the event should also be removed from person_ event table. In other words, I want Caspad on Delight. Consider a scenario: There are three events identified by ID = 1, 2, 3 in the "Events" table. The "person" table includes two people identified by id = 4, 5. "person_exchange" table with associations like 1-4, 2-4, 3-5 Now, suppose I used HibernateEdit () Delete event 1, then not only removes this event 1, and the Association person_event1-4, but the person 4! The problem is 4 is referenced by another tables and it throws an exotic barrier exception ... How could I configure NHibernate to destroy only event and organization person_event? I think if you set the Cascade setting on many for many maps, then you You should be able to ge

javascript - Easiest way to persist data on a PHP page -

I'm developing a web application (which is being developed in PHP) when a user requests a service So fill the user with a lot of length. Once the user fills in the form and submits another page (the confirmation page), in which all the values ​​filled by the user are shown. I should tell you that at this level the data has not yet been saved in MySQL. Now the user can save the service request or return to this page My problem begins here when the user < All the data are lost in the strong> Go Back BTW users use the browser back button instead of the back button provided on the confirmation page. How can the user continue to fill data so that the user can make changes / changes in the data and then submit the changed data again. You can use the code: `session_cache_limiter ( 'Must-redeemer'); ` This works well for me Keep in mind that this line should go before the session () Anyway, this is useful for me because all of the people coming with

perl - How do I create a text file so when it is opened in Excel, rows are grouped together? -

I am collecting some data through Perl script. Using Excel, data needs to be reviewed and processed by others. Currently, I am writing the data as a tab-delimited text file, and Excel can open it properly. There is a hierarchy for the data, however, and it would be easy to see the tree instead of a flat list for reviewers. Instead of submitting data in columns, foo foo1 foo foo2 foo3 times 2 times 2 times ... as a click Submit Group Function of Excel (found under "Data> Settings" in 2007): This is a good match for the presentation, to operate in comparison to the pivot table. A little easier. What is the easiest way to go to this group list from this flat list of columns? Ideally, I I can write the data in a text form that will automatically apply grouping when importing Excel. Alternatively, reviewer can apply after importing data, such as a macro or template Applying, which will also be ok. Since you are already using Perl, I Suggest that use the ex

Truncation errors importing to SQL Server 2005 from Excel -

Long story short, I'm taking a bunch of Excel documents one by one, and importing them using the Import / Export Wizard. In a database in SQL Server 2005. There is a report here (all the processes that do not appear to be a "success") Are there any way to ignore the filtering errors? I'm not taking any advantage in my version, or at least not in my version. - Execute (success) - [Datatheev] copy. [DBO]. [Sheet 0 $] (Error) Message * Error 0xc020901c: Data flow Function: Output "Excel Source Output" (9) Output column with "Value Meaning Details" (234) There was an error. The column status returned: "The text was truncated or one or more characters were not found in the target code page." (SQL Server Import and Export Wizard) * Error 0xc020902a: Data flow function: "Output column" value Mean details "(234)" failed Transaction occurred due to the transaction, and the meaning of the "output column&q

mapping - Recommendation for an embeddable map that is not internet dependent -

I'm looking to embed a mapping mapping control (much like Google Maps or Virtual Earth) into an application In most cases, I will not be able to access the Internet, which means that I can not use the above mentioned API or Google Earth. Must have to live on the machine locally on the map. I know that MapInfo is a big name in that place, but does anyone know from there and if you have implemented a solution using these tools, how was your experience? ESRI is the second biggest company, perhaps the biggest. They have 2 com components, map object and mapobject lt. The latter reduces but royalty is free (i.e. costs for developers, but not per seat)

css - Are Visual Studio web projects Web Standard friendly? -

I am struggling with some in-house developers that use some web apps using C # Are making It seems that in VS 2008 native devices and components are not good about making web standard codes. For example, the navigation component creates items in your table structure. Anyway, create a nice, clean, browser-friendly code to create web projects from Visual Studio? You can use the current ASP.NET controls to change the output. Set up is easy and you do not need to change any existing source code. If you are bound to ASP.NET Winform, you can create your own control set or use 3rd party controls. There is also an XHTML that you can set to harden, so that the controls can be tried to provide a more legitimate core. When you really want to write nice, clean, browser friendly code, you can put a look. ASP.NET MVC gives you full control over the output, but that means you have to do all the things for you WinForms currently ...

database - Modifying an Oracle number column -

I have a table where there is a column number (22, 12) where the number should be (22,2). Since it has data in it, I can not just modify the column in the correct accuracy. What would be the most effective way to go about setting up columns? One thing I have not mentioned before is that the table has many indexes, connected to the trigger and other tables. temporary radius trfoobar disabled; Add optional table fobers (newcomer number); Update Foober SET newcol = oldcol, oldcol = null; Alternative Table Foob Repair (OldCall Number (22.2)); Update Fubar SET oldcol = newcol; Alternative Table Fobre Drop (Nucleus); Enable Trigger Triobarph;

System.Net.FtpWebRequest GetDateTimestamp example -

I am looking at a small bit of sample code which uses the system.Net.FtpWebRequest namespace, which The specified remote file on an FTP server I know that I need to set the object of my request object on the WebRequestMethods.Ftp.GetDateTimestamp, but I'm not sure how to get a response back into the system.Dataite object. Yes - how big was it with me that I went with something like this < Pre> requests = FtpWebRequest.Create ("ftp://ftp.whatever.com/somefile.txt"); request. Method = WebRequestMethods.Ftp.GetDateTimestamp; request. Proxy = faucet; (FtpWebResponse resp = (FtpWebResponse) request.GetResponse ()) using {Console.WriteLine (resp.LastModified); }

Fix file endcoding when downloading a file from Linux to Windows in php -

OK I have a problem. I have a Linux web server (RHEL 4 with APS2) for an application A part of this application is a set of PHP scripts used. I created a script that accepts some form variables and then downloads a file to the user. Code at: Header ('Content-Description: File Transfer'); Header ('content-type: application / octet-stream'); Header ('content-dispute: attachment; filename ='. $ DestFileName); Header ('expiration: 0'); Header ('Cash-Control: Required-Modified, Post Check = 0, Pre-Check = 0'); Header ('pragma: public'); Header ('content-length:'. File size ($ full text)); Ob_clean (); Flush (); Readfile ($ fullpath); All this works fine, and the file is downloaded. But there is a problem. These files are being downloaded from the Linux box, a Windows machine (always). The problem is encoding when you see the file on the linux box, all the text is aligned and all columns look fine. (Files are just flat text fi

Treat missing values as zero in SAS where clause -

Is Oracle equivalent to NVL function in SAS? For example, if I have been told in SAS that section: where myVar & gt; -2; This myVar = is not going to include any rows. If I want to treat zero values ​​as zero, then I have to say: where myVar> -2 or missing (myvor) I should be able to do something like this: Where NVL (Myvar, 0) & gt; -2 / or some SAS equivalent Is there anything in SAS? should work Collage (myVar, 0) & gt; -2 I'm not sure that the function has become available in SAS 9, so if you have a really old SAS version it can not work.

css - Can't figure out the jQuery selector -

So basically I try to maintain the image of upper level categories of a down arrow while hovering over the elements of submenu I am doing I want to do this through a hover function on jQuery, but for that I can not get a selector to target sub menu items. Here's the code that I'm trying to run: $ (document) .ready (function () {$ ('. Sub al & gt; 'Hover' (function () {$ (this) .parents ('a.sub'). Attr ('Src', 'images / DownArrow.png')}}, function () {$ (this) .parents ('A.sub'). Attr ('src', 'images / DownArrowOff.png');});}); On this drop down menu: But as I said I can not understand the selector to target those submenu items I can change src for image. It should be done through CSS, not through CSS (I believe that I know that it works, but the way I have to complete this task) Thanks for any and all help. -Seth I think the images are added to the fly , By them being found by jQuery. Unl

Replacement of Delphi IDE "Sync Edit" in Visual Studio -

Delphi IDE (Borland Developer Studio 2006) features a feature that allows to edit some variables in "sync mode". For example if you have such a code snippet: The text you want to modify You can select (the whole process in this case) and start editing a variable name. It will be edited at all places (except string literals): This is different from refactoring because the scope of change is limited. Its simple and fast I like this feature. Now I have started using Visual Studio for the last few days and have not missed anything like this. Can you suggest anything to get the same effect in Visual Studio? For this feature you can probably use codec from Dev Express. There is something like this in it.

Retrieving the inherited attribute names/values using Java Reflection -

I have a Java object 'ChildObj' which has grown from 'parent oz' Now, if all the properties of hair oboes It is possible to retrieve names and values, where the inherited characteristics are also used, using the Java Reflection Mechanism? I give an array of public attributes, and gives me the array of all fields, but none of those fields are included in the inventory. Is there any way to recover inherited attributes? No, you have to write it yourself, this is a normal recurring method that: public static list & lt; Field & gt; GetAllFields (List & lt; Field & gt; Field, Class & lt;? & Gt; Types) {fields.addAll (Arrays.asList (type.getDeclaredFields ())); If (type.getSuperclass ()! = Null) {getAllFields (field, type.getSuperclass ()); } Return field; } @Test Public Zero getLinkedListFields () {System.out.println (getAllFields (new linked list & lt; field & gt; (), LinkedList.class); }

java - Opening a password-protected website from servlet -

The purpose of the scenario is that the user will use the servlet (for example) which in turn authenticated The password is protected by the website (such as use Windows authentication on the IIS server is enabled) interrupts and then opens - so: The target user will not get prompt for userName; Any other user will not be able to use without knowing the credentials is required Is this possible in Java (HTP URL connection)? << strong> / P> Any help is appreciated. Thanks To ensure that I understand your needs, This is a summary: You want to connect to User A on your first server Server1.domain1.com, which will connect to another server server2.domain2.com (currently under IIS) (from inside Java Server). Then the server 1 will send the user to the server 2 web page, challenge to avoid any authentication popup. Root problem is to be transmitted from server 1 to client browser, then from client browser to server 2, authentication ticket server 1

Spring WS-Security visible in WSDL -

I have implemented authentication via WS-Security on my webservice as described above: < Pre> & lt; Bean id = "callback handler" class = "org.springframework.ws.soap.security.wss4j.callback.SimplePasswordValidationCallbackHandler" & gt; & Lt; Property Name = "User" & gt; & Lt; Theater Content & gt; & Lt; Support key = "bart" & gt; Arani & lt; / Prop & gt; & Lt; / Theater & gt; & Lt; / Property & gt; & Lt; / Bean & gt; & Lt; Bean id = "Annotation mapping" class = "org.springframework.ws.server.endpoint.mapping.PayloadRootNnotationMethodEndpointMapping" & gt; & Lt; Property Name = "Interceptor" & gt; & Lt; List & gt; & Lt; Bean square = "org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor" & gt; & Lt; Property Name = "Validation Actions" value = "UserNameToken" /

c# - .NET string IndexOf unexpected result -

/ P> I'm trying to start it: str.IndexOf ("se \\\" & gt; ") < P> Which Return -1 is not searching for this option? Note: 5x \ 'was shown for a while because the snippet was edited, the original had 3 lines. Your code actually returns from '\\' & gt; Searching for ' . When searching for strings with backslashes, I usually find it easy to use literal strings: str.indexOf (@ "se" "> & gt;") In this case you also have a quote in the search string, so there is still something to avoid, but I find it easier to read it individually. Update : My reply was based on editing which, based on the IndexOf current version of the parameter, I used the str I do not just keep that required character sequence. Comment on this answer based on Update 2 : This is a matter of some confusion about the role of '\' character in the string. When you observe a string in the Visual Studio

debian - How often do I run autoconf? -

In my company, I'm working on creating a Debian deb package from a third party library. The library is built using Autotools. I have never worked with Autotools and I have some hard times coming to library sources like configure.in and Makefile.am files and m4 / < / Code> directory. I am able to create a library using this sequence: aclocal -i m4 -i / usr / share / aclocal autoheader libtoolize --automake automake -a autoconf / Configure> Debian / Rule file I want to use CDBS. I have written it: / code / # /! / Usr / bin / make -f contains /usr/share/cdbs/1/rules/debhelper.mk / usr / share / cdbs / 1 / class /autotools.mk But it does not work, it complains that the configure file is missing and that's right, as the Autotools class expects this file to be present. But it is not there and someone has to call autoconf and friends first! Why does Autotools CDBS class not let me call autoconf and friends? How do I stop this? A Depression:

php - Can someone recommend me a good image upload script -

I'm looking at one of the fancy upload scripts you see on sites that upload while uploading that file. Do your hard disk, and optionally allows you to harvest in one part of the original image. We use PHP and prototype (such a great jQuery plugin ... even if we should probably switch). We currently have a server side script, takes input from this field, but it is very unstable and supports only JPEG and PNG, and some GIF files , So we are looking for replacement for a while now, but I have a hard time finding anything. There are several options you can check here: Find the term "asynchronous": < P> This can satisfy your needs: Another option:

javascript - How do I get this "Share" button to grab the current URL's HTML title in addition to URL? -

I am trying to create the original share button in the form of a learning project. I'm stumped about a little bit of an aspect, while I can catch the URL of the current page and pass it in the URL which prepares the share form, I'm not sure how the HTML title can be increased. What do I have to do here: & lt; A href = "http://www.domain.com/submit" onclick = "window.location = 'http://www.domain.com/submit?url=' + encoder component (window location); return false ; "& Gt; It & lt; / A & gt; Share To get the title of the current page, what do I add to the optical section? Whatever will be passed in the URL as "title =". Bonus: Is there something that I can send some highlighted text from the current page? This URL will be known as "body =" So I want to fill in these empty spots: I think You want to receive the selected text is a bit more complicated, especially if you want to support IE is the s

javascript - Show a DIV with form data on submit -

Maybe I'm stupid I'm submitting a hidden divate with the values ​​of a form on submission. The DIV opens with the right data, but then resets the page after reloading. What am I doing wrong? Here's my test: & lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = us-ascii" /> & Lt; Title & gt; Test & lt; / Title & gt; & Lt; Script type = "text / javascript" & gt; Function Test () {var usr = document.getElementById ('Users'). Values; Var pwd = document.getElementById ('passwd') value; Document.getElementById ('out'). InnerHTML = usr + "" + pwd; Document.getElementById ('out'). Style.display = "block"; Back true; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Form action = "" onsubmit =

eclipse - What method should I use for making my java GUI? -

I am making AWT GUI for simulation game I am working with Java for only 2 years, and therefore There is limited experience with the creation of more complex GUIs. I did some simple people, hard coded, and tried to get Jigoo into eclipse. I am thinking of using the MIG layout, although some people say that I really should try Jiglu and use more GUI builder. I have created the main game aspects, with one down at a time. Right now there are some buttons in it that I am using to test the elements of the game. Obviously now I have to create a better interface for the user. The panel with the tabs panel opens buttons and so on. I am using swings for both games and controls There is some advice on how I should go about this? Netbans is not very good I am using eclipse as my IDE, so a plugin is needed for eclipse. Thanks in advance! I recommend that you give another shot to the latest version of NetBan. It's really easy to create a GUII have never seen another GUI builder wh

websphere - Jsp doesn't see included taglibs. Seems to be a local webshpere 6 configuration issue? -

Try to be descriptive as ill as possible. Status: The strips tag is not being solved on a JSP. When you will see what you should solve as a link: & lt; Html: link page = "/ dto / initDTO.do" & gt; & Lt; B & gt; & Lt; I & gt; Design Control System (DTOCS) for the order & lt; / I & gt; & Lt; / B & gt; & Lt; / Html: link & gt; Which one do I believe that the Straits tag is not being resolved? The source of this page includes: & lt;% @ contains file = "/ common / taglib.jsp"%> And if you look at that jsp: & lt;% @ taglib uri = "/ WEB-INF / tlds / struts-bean.tld "Prefix =" bean "%> & Lt;% @ taglib uri = "/ WEB-INF / tlds / struts-logic.tld" prefix = "argument"%> & Lt;% @ taglib uri = '/ WEB-INF / tlds / struts-template.tld' prefix = 'template'% & gt; & Lt;% @ taglib uri = '/ WEB-INF / tlds / struts-html.tld&#

sharepoint - Team Foundation Server reporting stops refreshing after adding a CMMi repository -

I have this problem and I did not find any issues with this site. Here's the thing. I created TRFS 2008 with the Skrom Template (Kanchango). It was a clean install (a fresh OS, a fresh SQL server, a fresh machine, etc ...). So everything worked like a charm, I started 3 scrum repositories, the permissions assigned, uploaded files and so on ... 3 teams started working on them, and everything was super! By this point there were only 3 scoom repositories in the server and nothing else. Again, I had to create a new repository, but with the CMMI template (provided with TFS). Then everything works (SharePoint site, source control, document ..) ... but .... Report refreshes! Does anyone know how to fix this? Found someone with the same problem, stop sending the reports after adding CMMI project: ) The following link describes how to fix it:

sharepoint explorer view -

Can anyone tell me what I want so that I can see the Explorer for a library in SharePoint? It works on one machine and not the other. It sometimes works on Vista Client, but XP does not. It works in Internet Explorer but does not work on any other machine with the same settings. Please help wss 3.0 on Windows Server 2008 with Vista and XP clients. Thanks On this server part, WebDav is required to be enabled, And the web client running on the client WebClient is just one service, see specific information about how to get started. If WebMail is already running, make sure that the SharePoint site has been added to "Trusted Sites", is a personal list of "Trusted Sites" in I Vista SP1 and above, WebClient.

language agnostic - What different terms mean the same thing (or don't, but people think they do)? -

One of the disadvantages I have running on a daily basis is telling customers one thing, while another means. Generally, this is due to some misconception, but sometimes they are actually saying that I am using a different period. For example, one of my clients mentioned the second day that they said that the facility, "you type." Being a bit confused, I asked him what he said, and he described this feature in Google, once you start writing a search query, Google suggests other popular queries Which match the letters you wrote. Click! They mean themselves complete! She was not wrong, it's just that I had never heard this word before. In the spirit of reducing confusion, what words can you think about, but what does it mean, basically, the same thing? Besides, what people think, but do not do, please distinguish between the two. Please only set one of the terms of reply per answer, so we can vote on the best people. parameter == logic parameter Ther

geometry - A reverse of Haversine formula for MySQL? -

In my DB I store a focus point with radius (in meters). I am looking to pass in a latitude / LNG, and after that there are mysql values ​​stored on me to create a circle to tell me that if the point I passed is that Is there anything within the circle? Is there anything that allows me to do this, like the Hawerson forum (which would have assumed that my issue was already in DB) Harvison Formula: (3959 * ACOS (COS (radian (40)) * COS (radian (lat)) * cos (radian ( long) - radians (-110) + sin (radians (40 )) * Sin (Andean ( long )) db: Circle Letter, CircleLGciter, Radius In passing> foo Choose from id, where lat, in lng (circle function: circle layer, circle leg, radius) MySQL has a full host of spatial data functions: I think that To measure the relationship between Yamiti that section after you:

How to call a JavaScript function from PHP? -

PHP से जावास्क्रिप्ट फ़ंक्शन कैसे कॉल करें? & lt;? Php jsfunction () ; // या गूंज (jsfunction ()); // या कुछ और? निम्न कोड xyz.html से है (एक बटन क्लिक पर) यह एक प्रतीक्षा () को एक बाहरी xyz.js । यह प्रतीक्षा करें () कॉल प्रतीक्षा.php। फ़ंक्शन प्रतीक्षा करें () {xmlhttp = GetXmlHttpObject (); Var url = "wait.php"; \ Xmlhttp.onreadystatechange = आदान-प्रदान; Xmlhttp.open ("GET", यूआरएल, सच); xmlhttp.send (शून्य); } Function statechanged () {if (xmlhttp.readyState == 4) {document.getElementById ("txt")। InnerHTML = xmlhttp.responseText; }} और wait.php & lt;? Php echo "& lt; script & gt; loadxml (); & lt; / लिपि & gt; "; जहां loadxml () एक अन्य PHP फ़ाइल से कॉल कोड उसी तरह है loadxml () अन्यथा ठीक काम कर रहा है, लेकिन इसे जिस तरह से मैं चाहता हूँ उसे नहीं कहा जा रहा है। जहां तक ​​PHP का संबंध है (या वास्तव में, सामान्य में एक वेब सर्वर), एक HTML पृष्ठ एक बड़ी स्ट्रिंग से ज्यादा जटिल न

c++ - Polymorphic member function pointer -

I am trying to write a callback event system in DirectX9. I am trying to use method function signals to trigger events for mouseclick; But I'm having some problems My game uses a gamestate manager to manage the rendering All my gamestates are taken from the base class abstractGameState I have a phantom object with this specific method: m_NewGameSprite-> OnClick (this, and menmanustat :: start the game); The main menu is the current game that is in my game, and StartGame is a void method part of this class. I want to store the function pointer in a variable within my phantom class so that users can click. template & lt; Typename T & gt; Zero onclick (GameState * LinkedState, Zero (T :: * Event Pointer) ()) {m_LinkedGameState = LinkedState; M_EventPointer = Event indicator; // & lt; - does not compile} I tried to downconver the indicator, but it does not really work. These include two variables in my Prayer class Zero (GameState :: * m_EventPoint

java - Eclipse 3.5 (and newer) switching tab is very slow -

I am using Eclipse 3.5 with Java 1.5.0.19 on MacOS 10.5. I have just opened 3 java files 1 files ~ 2000 lines are second 2 ~ 700 lines. But when I switch from 1 file to second, it takes a long time (~ 20 seconds) to switch to eclipse and another tab. I have already changed eclipse.ini to more eclipse.ini-startup ../../../plugins/org.eclipse. Saminox Launcher_1.0.200. v20090520.jar - Launcher.Libri ../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.0.0.v20090519-product org.eclipse.epp.package Jee.product -showsplash org.eclipse.platform - Launcher. Xmx pressure system 256 m -wamarg-dosi.requirewordvvarsian = 1.5 -xstart onfastahrade -dorg.cllips.svt.internal.carbon.smallFonts -XX: maxprimcysin = 512m-xms 128mxxxx1024m -xdock: icon = .. / resource / eclipse .inx -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts Is there any way to get 3.5 faster? Thank you. I found this line in the Eclipse.ini file (found in the eclipse application packag

c# - What's wrong when 'the requested operation cannot be performed on a file with a user-mapped section open?' -

I am developing an application that is reading and writing a certain file on disk (but synchronously) However, how large the file is, the more I receive the following IOException: The requested operation can not be performed on a file that opens a user-mapped section. is being done from: system. IO error .__ error Virus (System32.If., Int32 rights, Boolean useRights, fileshare share, Int32 BufferSize, FileOptions option, SECURITY_ATTRIBUTES secAttrs, string msgPath, Boolean bFromProxy) on System.IO.FileStream..ctor (string path, FileMode mode, using FileAccess , fileshare share, Int32 BufferSize, FileOptions option) SystemkIOkStreamWriterkCreateFile (string path System.IO.StreamWriter..ctor on System.IO.StreamWriter..ctor, boolean append) (string path, Boolean attached, encoding Encoding, int32 bufferSize (string path, boolean append, encoding encoding) on ​​System.IO.File.WriteAllText (string path, st Ring Co ntents, Encoding encoding) System.Windows.Forms.Control.OnClick

sql - Can I use the the power of Generics to solve my issue -

I have a strange issue that I'm loading 1k invoice objects, first in my head in the header, VB I am using Net. I'm able to fix the invoice headers just fine. When I load the details of each invoice, I get timeout on SQL Server. I increased the time period to 5 minutes but still the only thing if I reduce the invoice number to 200 then it works fine. What I'm doing here // I have already loaded the invoice headers. I am now invoicing each invoice for each invoice, invoices as invoice Invoice drInvoiceItems = DBSqlHelperFactory.ExecuteReader (CONNECTION_STRING, CommandType.StandardProcessor, "dbo.getinvoiceitem", _ New SqlParameter ("@ invoicenumber", invoice number, invoice number)) drInvoiceItems.Read () invoice.LineItems.Add (New InvoiceLine ( DrInvoiceItems ("id"), drInvoiceItems ("inv_id"), drInvoiceItems ("prodid"), drInvoiceItems ("name"), drInvoiceItems ("barcode"), drInvoiceItems ("vol

c# - Multiple Methods, or parameters? -

OK, so I'm designing a square here and I have two options. I can write the same method which says an enum. I am trying to figure out the best way to do this. For example: public class myClass {... Public Zero DoStuff1 () {... Content ...} Public Zero DoStuff2 () {. .. Do Stuff ...} Public Zero DoStuff3 () {... Do Stuff ...}} OK, all makes sense, now there will be an alternate way: Public class myClass {... Public Enum Option {Option1, Option2, Option3} Public Zero DoStuff (Option Option) {... Do Stuff ...}} < / Pre> In the case of dry, they are not so bad because the code is very internal Cakes call in any way, so it only looks to the user for it. So why do you like it and there are some guidelines already around it? Was it just me or am I really a smile here?

Python and PGP/encryption -

I want to create a function using Python to encrypt the password with the public key. At the end of the user I need to install PGP software that will generate key pair. I only want to use the public key for encryption and private key for decryption. The problem is coming with the encryption function (how to use the key for encryption) and also in the installation of PGP. Someone can tell me the correct way to do this thanks one is open Source project for using PGP with Python I think that's what you want. You do not really have to invent algorithms, they already exist.

scalability - HAProxy and "sharding" -

I was thinking that someone has used proxy for confining, in particular, I was able to use a cookie I would like to be / I define an identifier and any customer who directs the cookie / identifier combination to the same server. It seems possible and my initial test starts working but I'm not sure. My Listen Configuration looks like this: appli1-rewrite 0.0.0.0:80 listen to the cookie Mysession = Prefix balance roundrobin server app 1_1 192.168.0.1:80 cookie server 01 Server Ap1_2 192.168.0.2:80 Cookie Server 02 Option httpclose However, when I look at the request header using Live Hit Heads I do not show the migration cookie as to who it is I would expect a server based on the prefix operation. I am quite new to Haaproxy so that any help / guidance is great! According to the HAProxy docs, I think you need to zoom a little bit of your Hyproxy Config, To put this a cookie: According to: You want something like this: cookie SERVERID inserted indirect

How to hide javascript errors throw in iFrames? -

I have an IFrame that shows the external web page through a proxy that I control. But this proxy does not organize Javascript for most of the time, the external page throws JavaScript errors. Javascript does not need to work because it is not important. What can I do to hide these JavaScript errors? They are disturbed and more than one of these iframes point to other external sources. Do you want to rewrite your proxy HTML? If you are legitimate or not the HTML, then you & lt; The script & lt ;! - Can replace script /> script with / script? And invalidate any event handler feature z =

asp.net mvc - How to setup MVC routes to handle old ASP classic pages redirects -

I am migrating ASP classic site to ASP.net MVC. Is there a way to redirect what's new traffic? Example: how to go: www.mydomain.com/viewpage.asp?pageid=1234 From: www.mydomain.com/page/1234 Redirection in the BeginRequest method I Finishing up using # 2 because it is easier for my project Sub Application_BeginRequest (as the object-by-sender, _EventArgs) as the bi-sender. Oval by the way String = as request. URL. ToString.ToLower if (fullOriginalpath.Contains ("/viewpage.asp? Pageid =")) then reference. response. Status code = 301 'A permanent redirection issue' Reference Response.Re If you can use sub context.RewritePath , but this URL does not change , Then direct ("/ page /" + getPageIDFromPath (full online path) in the client browser.

c++ - What is LogonUser()'s token returned used for? -

What can you do with token returns? And what is used for it? BOOL logon user (__in LPTSTR lpsz username, __in_opt LPTSTR lpszDomain, __in LPTSTR lpsz password, __in DWORD dwLogonType, __in DWORD dwLogonProvider, __out scan token); I have tokens and it requires a more general discription of how it works and the use of the real world. Thanks, -Pet As MSDN says: "In most cases , The recalled headlock is a primary token, which you can use the CreateProcessAsUser function in the call. There is no reason to believe. Sample: You can write your own runas.exe . Call the logon user with the username and password from the command line and then call CreateProcessAsUser to start the program with the selected credentials.

Is it possible to use anonymous functions in C++ .NET? -

It looks like Boost also supports C ++ 0x anonymous tasks. Although I am using .NET, if I can stick with it it's terrible. Actually I want to write some quick codes for the object. I have a robot which can be about 85-90 states Most states are just "the integer value passed to the robot microcontroller" so I ask the robot to go to 35 instances in the state. However in some states user input is required such as user input so that I would like to keep it simple and write a few lines of code for the difference. I have considered using derivative classes but there are a lot of code involved in modifying some lines. If C ++ By the net you mean C ++ / CLI, so yes. When MS supports C + + 0x lambda expressions in its C ++ compiler, this support will increase to C ++ / CLI if you want Lambda Expression now , then you can add Boost.Lambda Are stuck with.

sql server 2005 - How do I calculate the Azimuth (angle to north) between two WGS84 coordinates in a single T-SQL query? -

, but I can not translate it into a single query T-SQL because my C # implementation is required (if Again ). I also found the following C # solution, which can be translated into a query T-SQL, but it does not produce the correct result Public Stabilized Double GetAzimuth ( WGSCoordC1, WGSCoordC2) {var lat1 = DeGToRad (c1.Latitude); Var lon1 = DagTorad (C 1. Loneticate); Var lat2 = Degotrod (C2lititude); Var lon2 = DegToRad (c2.Longitude); Return Redoutong (Monastery sign (lon1-lon2) * Math. Cos (Lat 2) / Matthew Sign (Math.Ekos (Math Sign. (Lat 2) * Monastery Sign (Let1) + Math. Cos (lat 1) * math. Cos (latt 2) * math. Cos (lawn 2 - lawn 1)))); } code Can someone correct the above code or provide an alternative solution?

c# - Get .sln file from Team Foundation Server SDK -

I am writing a check-in policy for the team foundation server, and would like to know if there is any way TFS SDK With Project Solution The path to the SLN file seems like there should be a way, yet it has not yet got it - any help would be appreciated. Which SLN file? A team can be more than one in the project. If you want to get the path of the current solution, while Visual Studio is running, you can use the Visual Studio SDK to do this.

Help with SQL query -

Let's say I have a table called "REVIEWS" In this table, that review For whom the customers have written various products. I want to be able to get "count" for all reviews written by each customer, so I write: SELECT count (*) AS counter From reviews WHERE customers_id = 12345 Now, my problem is that I want to count as above, but only for customers who have written a particular product review For example, select select from customers_review review WHERE products_id = '170' Sarah The word, I wrote a review for the customers to be able to achieve total COUNT say he wrote to every review, but only looked at a particular product to those customers. Thank you very much for your help. select customer_itit, count (*) from reviews where customers_id (c select reviews from ustomers_id Where products_id = '170') group by customers_id;

c# - Setting the LinqDataSource Where Clause using DateTime Column -

In C # .net, I have the following datasource setup that I dynamically assign a WHERE segment to the rear code Trying to ... & lt; Asp: LinqDataSource ID = "LinqDataSource1" runat = "server" contextname = "MyNameSpace.DataClasses1DataContext" TableName = "MyTableWithADateTimeColumn" & gt; & Lt; / ASP: LinqDataSource & gt; The code looks like something behind ... LinqDataSource1.Where = "MyDateColumn == DateTime (" + date time.Now + ") "; It gives me an error of the '' 'or', 'expected I have tried to put it in quotation marks as well, as well From time to time and without the cast in the form of quotation marks ... LinqDataSource1.Where = @ "MyDateColumn ==" + date time.Now + @ "" " "; This gives me incompatible with the operand types, 'datetime' and 'string' , But I'm clear Is it like that? What will happen about

django refactoring models -

I'm cleaning a little bit on my own project project and so I decided to rename some models which are not needed in some unnecessary areas Remove them. I removed all the tables from DBS and resumed "SyncDeb". However, now I am getting and error pollites.polls.views could not be imported: The name can not be imported OldTableName This is a template error from base.html OldTableName no longer exists (I named it). Does admin site need to work properly with the new schema to run something else? You will have to check your imports in your pollsite.polls.views. Most likely that you still have the old model's name in that file.

sql - Why is this mysql table producing a NULL in the datetime field? -

I have found this table The table contains a bunch of four fields, but in the query field (end) the test_tmp table But there is a character, and there is a date time on the test table. (Table names have been changed to protect customers.) In the test_tmp table, the field contains a month-date pair, such as '10th August 'or '20 Feb'. I am using to include that data: select INSERT IGNORE test (RECNUM, ORDERNUM, CREATEEDATE, EXPIRDATE, FNAME, LNAME), RECNUM, ORDERNUM, CREATEEDATE, CAST ( When the case is in Str_to_date (concat ('expiredate', '', year (now () (), '% b% d% Y') & lt; = cURDATE () then str_to_date (concat (expatate, '', 1 + year (Now ()), '% B% d% Y' ELSE str_to_date (concat (expiredate, '', year (now ()), '% b% d% Y' END AS DATETIME) Extion, FNAME, test_tmp By name is really upset that if I run the 'SELECT' section of the query then everything looks fine but if I run the whole thi

networking - Any free/cheap bandwith shaping or network impairment software with API? -

I have a (preferably) free software to install on the double NIC box to introduce the background size and / or packet Looking for loss, latency, etc. Now I know Damiente and similar software, but I need an API to control it. A simple vegetarian based http or SOAP based on a preferably command line is somewhat more manageable. This can not be the quality of a production because I am planning to use it for demo / prototype. Linux has finished using "TC"

visual studio - Standard margins between controls and standard control sizes -

For example, Windows Form provides the place of my control on the designer form, in the same manner as 12 pixels between the form boundary and the control threshold. . It seems to me too much is this standard value? Also, as I think the standard button should be 23 pixels tall, am I right? Is there a document that tells all this? And can I set this default value in Visual Studio (for example, if the default margin between control and form borders, when the snap is visible, should be 6 pixels instead of 12)? You can always refer to it. Although it comes with an easy table, however, the pixel sizes are using. I do not know a way to control snapping behavior in Visual Studio, however, apparently it can not be done. You can set the grid size, but it will not affect dynamic snapping lines.

python - matplotlib "DLL load failed" when import pylab -

मैं matplotlib के लिए नया हूँ मेरा वातावरण WinXP, PythonWin 2.6.2, NumPy 1.3.0, matplotlib 0.98.5.3। & gt; & gt; & gt; आयात करें matplotlib.pylab के रूप में पियालाब ट्रेसबैक (सबसे हाल ही में कॉल अंतिम): फ़ाइल "& lt; इंटरैक्टिव इनपुट & gt;", पंक्ति 1, & lt; मॉड्यूल & gt; फ़ाइल "डी: \ पायथन 26 \ lib \ site-packages \ matplotlib \ pylab.py", पंक्ति 253, & lt; मॉड्यूल & gt; Matplotlib.pyplot आयात * से फ़ाइल "डी: \ पायथन 26 \ lib \ site-packages \ matplotlib \ pyplot.py", पंक्ति 75, में & lt; मॉड्यूल & gt; स्थानीय, (स्थानीय) ([backend_name]) फ़ाइल "डी: \ पायथन 26 \ lib \ site-packages \ matplotlib \ backends \ __ init__.py", रेखा 25, में pylab_setup globals () फ़ाइल "new_figure_manager, draw_if_interactive" डी: \ पायथन 26 \ lib \ site-packages \ matplotlib \ backends \ backend_tkagg.py ", पंक्ति 8, & lt; मॉड्यूल & gt; आयात करें tkagg # तस्वीर को ब्लूटूटर विस्तार करने के लिए चित्

joomla - Javascript problem with a global external link confirmation alert -

Below is a plugin code for Joomla, it works on its own, and its purpose is to find external links on the page and They have to force them in a new browser window using _blank. I have tried for about an hour (I do not know Javascript properly) but I can not seem to know how to work on an onclick function. The end result, I want to add the ability of a confirmation dialog in this script, which is shown in the second code section. An external link, when clicked, the confirmation dialog will pop up, and if it says yes, then they will be able to get the external URL to open in a new window. When I will create a link with preclick = "return ExitNotice (this.href)", " inside it works perfectly, but since in my website Many people are collecting input, I want confirmation box global. this.blankwin = function () {var hostname = window.location.hostname; Hostname = hostname.replace ("www. "," "). ToLowerCase (); Var a = document.getElementsByTa

PHP object question -

Sorry, maybe there is really a basic question but how do I get it? $ cache = new meme; $ Cache- & gt; Event ($ event) - & gt; remove; Below is called through the function. - & gt; Without deletion , it works perfectly, but I need to find a way to call this way to delete the function. class mem {function event ($ event) {global $ pdo; Global $ memcatch; $ Key = MD5 (sha 1 ($ event). Sha1 ('event')); If ($ -> this- & gt; delete) {return $ memcached-> Delete ($ key); } And {refund $ memcached-> Get ($ key); }}} I hope that the original removal code for my pseudo code is understandable. You are calling delete as if it was in your class There was a method - but you have no method but instead of delete ... instead, you should evaluate the $ event variable as I am doing down and deciding it What action will you take: class mem {private $ pdo; Private $ memcatch; Public Function Event ($ Event) {$ key = md5 (sha1 ($ event). Sha1 (&#

How to implement TDD in ASP.NET WebForms -

I know that test driven design (TDD) due to Microsoft coming out with ASP.Net MVC is ASP.NET However, I have a large brown area (existing) application in the ASP.NET webform, in which I would love to implement some TDD type functionality. I am assuming that there is a way to do this, but what are some viable options? Microsoft introduced ASP.NET MVC because they felt they could earn money from an unused market - those who feel that the web forms are also "heavyweight", and that are programming using the lighter-weight framework Those people who are addicted to the MVC paradigm are included. It also includes those who did not understand the way to test the unit in web forms, and who want to use unit testing and TDD. The way to do this with web forms, apart from anything else, is to separate everything, but a user code is in different classes in the class library. Use TDD to develop those classes. The next layer of the dispute is to use TDD to develop the remainder of

objective c - What is the difference between class and instance methods? -

What is the difference between class method and an example method? Examples of methods are accessories (gates and setters) while class methods are pretty much everything? Like other other answers, an example of a class is used in the example methods, while the class post of a class method is used like "post-text" itemprop = "text"> The experiment can only be done with class names. Objective-C is defined as: @interface myclass: nsobux + (zero) aclassMethod; - (zero) an instant method; @end Then they can be used like this: [MyClass aClassMethod]; MyClass * object = [[MyClass alloc] init]; [Object one way]; 's + stringWithFormat: or NSArray 's + array with array: . An example method would be NSArray 's -count method.

java - How comes .array() doesn't work on ByteBuffers returned from map'ed FileChannels? -

I'm in the memory mapped IO Java Failcanl class you map a Baitbfr to a specific part of a file Allows to I'm just opening a file to read. The problem is that I am getting an exception when I try to call. As a result, the .ray () method on the bytebuger is probably the reason why .ray () returns a byte [] array, and I really want a last byte array? Is there a way around this? I'm going to assume this is about the method that can map a file to memory Is someone whom Can be used by filechannel.map In the document for the document, if the file is mapped as read, any effort to modify buffer will only result: One field of one file can be mapped to one of three ways: Read-only: Any attempt to modify the resulting buffer The reason for throwing a ReadOnlyBufferException will be the reason. ( MapMode.READ_ONLY ) In terms of the exceptions thrown by law, except for the two types that are thrown by the ReadOnlyBufferException - If this buffer is sup

Datacontext and Unit of work -

I'm a newbie for object-oriented programming. I have spent 8 years as a procedural programmer, although Linq to Sql is not a good option, it is still a good light ORM if I want to use LTS as my data access, and I have Compared to my question, there is an MVP pattern for my UI, as follows In an MVP pattern you usually create a presenter for each scene. Suppose that the work of the two units in a game in my thoughts. It is said that I have a client edit screen as u and there is an order order details screen on the same page as my other UOA. My thinking is that I have two presenters who are in the context of datacontext to support adaptive conductors. Is this a specific thing in enterprise application? It looks like you're right. If you want to feel better for the pattern, then you can see free book chapters from the Undaunted Diner Project [at [1]: at

javascript - What is the best way to write to several logs that are continuously being updated? -

Working on an IRC client in Adobe Air in Javascript, and thinking about logging. Each channel would have its log file running when I did not open all the logs? Will I have to log every few minutes? What is the best way to do this? I do not know why not keep all log files open. I do not expect any other application to write the log, at least when your client is open I do not even try to apply my buffering (at least first) just write the lines and write the OS and runtime buffer Do it.

log4net - At what stage do you add logging & tracing in OO? -

What level of interest am I developing, logging and / or tracing in my applications? I am working with Net Stock and Log 4 Net (via commons.logging). Generally taking a TDD approach for development, although not 100% of course, sometimes I know that the test coverage my application sits on all server-side, e.g. Web services, Windows services that consume messages from a bus, ASP.NM MCC Business Admin Apps e.t.c. I found ways to decorate with descriptive logger in my applicatiosn services. Receiving cake from the "INFO" repository "Some work .." 5 cakes were found from the repository. ", And then an uncontrolled accention handler for negligence of app Kamin. The gates that bubble up for the unexpected expectations. However, I usually go back and stop applying it, rather than the beginning of development, near the end of development and I can have only a dozen or two, I think I should To reduce the color of any lower class or class like locker material,