Posts

Showing posts from April, 2010

c# - ReaderWriterLock vs lock{} -

Please tell what the main differences are and when should I use. Focus on web multi-threaded applications Only one to execute the code at the same time Allows threads. It can be more efficient if you are using .NET 3.5, it can be faster to allow multiple threads to read or write at the same time. So if your sharing resource is being written more often, then use ReaderWriterLockSlim . A good example for using it is a file that you read many times (on each request) and you rarely update the content of the file. So when you read from the file, you enter the reading lock, so many requests can open it to read and when you decide to write, then you enter a lock lock, a lock on the file < The basic meaning of using code> is that you can serve a request at a time.

.htaccess - htaccess url rewriting -

301 पुनर्निर्देशित करने का एक आसान तरीका है to मुझे यकीन नहीं है कि .htaccess फ़ाइल में यूआरएल के आखिरी खंड को बनाया जा सकता है? आप कुछ की तरह कोशिश कर सकते हैं: RewriteMap को प्रत्यय का उपयोग करें: ट्यूपर रीवर्टरेबल / (\ w) (\ w +) - (\ w) (\ w +) / दुकान / कैटलॉग / सभी / $ {कैपिटल: $ 1} $ 2 _ $ {कैपिटल: $ 3} $ 4 [आर = 301]

.net - Extension methods overloading in C#, does it work? -

A class that has a method, like this: class window {public It is possible to overload this method more widely: class Window Extensions {Public Zero Display (This Window Window, Object O) {Button Button = Blow Blah (O); Window.Display (button); }} What happened when I tried that I have infinite recursion is this a way to do the job? I want the extension method to be called only when the other method can not be called. Let's go for the specification first, we must understand the rules for method invocations. Roughly, you start with such an example, from the example you are trying to apply a method. You are looking at an accessible method looking for a legacy chain. Then you make your own conclusions and overload resolution rules, and if it succeeds, use the method, then if only such a method is not found, then you try to process the method as an extension method. Therefore, §7.5.5.2 (Extension method invocation), in particular, bold statement: A method invitation

wpf - Transactional objects in .NET -

The cancel button needs to be implemented when editing certain entities in the user interface. Visual models can make transactional. I will try to explain a bit more detail in detail which means: The visual model is connected to the model and exposes the data in such a way that it is easy to handle for the scene (using data binding Do) changes in model change as a result of change in model However, if there is a cancellation button, then you usually do not want to change the model immediately, so I think about any type of buffering changes. When you make changes, the model is being moved, otherwise they are removed. I have now implemented a solution that creates a proxy of the visual model that is not connected to the real visual model proxy model instead of the scene, but using the interceptor changes records in properties and method calls. There is a submission method that applies to invoices on the real visual model. I think this is a very good solution, but it's still q

user interface - Difference between a jQuery plugin and a jQuery widget? -

Can anyone explain the difference between jQuery plugins and jQuery UI widgets? What are the ideological differences? Why do I have to choose one over each other and what are the advantages and opposition for everyone, what are the differences between each intention and concept? I have written both, but I am not clear on Knightley's gritty discrimination. I want to make sure that I am properly applying in every case. Thank you! Widgets are part of the jQuery UI library, where plugins are not. In addition, widgets have a visual component for the GUI, while plug-ins are not necessary (although some do).

vb6 - Hidden Window Display on Users Desktop -

We have a VB6 application that uses a non-visible window (form) for DDE communication. We report to some clients that sometimes they can view this window on their desktop. I have scanned through the code for any view = true or shown as a question, but nothing. We do this with: Load frmDDelink frmDDelink.stuff = Accessories We are really clear (Or not clearly) "Itemprop = "Text"> An abusive app on a customer's machine can do this FindWindow () is a notorious wrong API function. On top of that, all VB6 windows have the same class name. Thunder something, IIRC is wrong Window look Instead of one Deshy your window may be looking for.

javascript - Faking body.scrollHeight -

I have a JavaScript application that is loading in an iframe (via the Lifier Portlet). The actual HTML is just an empty tag and when the document loads, JS is loaded. When Page loads in IFam, this body.scrollHeight property ends 01 because there is no real content before loading in the page. Is there a way to style or modify the page in such a way that body I set the height of the body to 100% and one and ; Nbsp; has tried to add, but it does not work. You can & lt; Body onload = "set a javascript event in doStuff) or set CSS to a certain pixel height such as body {height: 250px} .

Blueprint CSS Extjs and JQuery in the same page, best way to make them coexist without conflict -

I have a web page that requires references to jQuery and Blueprint and Exits, I (1 ) Jquery and other libraries and (2) extjs and other libraries The documents I found seem contradictory to each other, and reference older versions of Libs, wondering if Someone did this and what is the least painful way (so this task does not take me a lot of time) Note: This site requires I6 (it needs to support JS content, so I'm sure it is a relevant part of the information) for your help Thanks "$" selector is not to be used, so there is no dispute between it and jQuery. You can actually use jQuery as a Base Dome Manipulator for EXJGs, which you can use to get the size of that javascript You can reduce what you are doing. BluePrinting CSS will not cause any issues with Javascript, but the design can change Some of ExtJes stuff is its easiest way to ensure that Blueprint CSS stuff before Include Exject CSS; In this way, extges will override anything, and you will n

wcf - Guidance on .net web services -

I have done web services for a few years later, I remember that it is easy to create and consume only one In my current situation, I work in a large organization and we use a lot of DB2 stored procedures that the ManFrame man writes to get human resource data. Now I am starting on a new HR project and replacing one of our other HR apps with the 'Data Access Code', I have suggested that we write a code library DLL Those who used to do all this work and here we use this DLL in our HR apps. Once I suggested that my manager thinks this is a great idea, but he wants to work in web services. My manager has now commissioned me with the research of options to achieve these web services. He wants me to tell him that we should use WCF with it and if Java developers will be able to use the organization's web services, I I have done a lot of web searches and do not have such information I have found that specifically answer these questions. Thank you! Mehrdad'

cucumber - Accessing Related Model's not yet mentioned -

मेरे पास एक उपयोगकर्ता का कारखाना है जो कंपनी का संदर्भ देता है Factory.define: user do | च | F.first_name "जॉन" f.last_name "स्मिथ" f.password "test01" f.password_confirmation {| u | U.password} f.email "john.smith@example.com" f.association: कंपनी,: कारखाना = & gt; : कंपनी का अंत फैक्टरी.डिफ़ाईन: कंपनी करना | एफ | F.name "मेरी कंपनी" अंत कंपनी के कई उपयोगकर्ता हैं अब मैं चाहता हूं कि कंपनी के पास कई ग्राहक हों क्लाइंट का निर्माण करने के बाद कंपनी का उल्लेख करने की कोई ज़रूरत नहीं है, इसके बाद वह कंपनी के अंतर्गत आती है। परिदृश्य: ग्राहक बनाकर उपयोगकर्ता के कंपनी में जोड़ता है उपयोगकर्ता "जॉन" ने "john.sm ... @ example.com", "test01" के साथ पंजीकृत किया है और मैं "john.smith@example.com", "test01" के साथ लॉगिन हूं और मैं ग्राहकों की सूची में हूं I "नया ग्राहक जोड़ें" का पालन करें जब मैं "मेरा Fav क्लाइंट" के साथ "नाम" भरता हूं और मैं "

emacs - How to setup Aquamacs for Clojure development? -

I have tried several times to transfer Emac to Closer development, after blog posts, screencasts and tutorials, But in the way something went wrong sometimes - the keybinding which did not work, the incompatible version, etc., and I found myself to be able to whim back. But I know that I want Parets and Salim. So, I'll try again, this time supported by powerful Stack Overflow ™ community. I hope that the answer will still be answered, and serve as a reference for temporary converts like me. What do I need: - Closer - the latest stable release of Aquamax (if it's good enough, Rich Hickey, this is great for me), a recent version - Closer Mode - Slimy / Swanak - Parade - Something And which is indispensable? Step-by-step instructions will be excellent for installing above - preferably with the link of documents and cheatsheets in the shell script format, I begin with the most common closure-related actions (including key-binding) I would also like to have some pointers

C++ function call with the parameters unknown at compile time -

As soon as it looks strange, I have to call the function in C ++, for which I do not know the signature. In fact, I want to let the user specify a list of logic, and logic types, and then try to call a given function with these arguments. I would like to know if the function call is working or not, and if (miraculously), what is the return value (provided that the return type is zero). Is there any way to do this? Thank you. Take a list of your function variable data types, e.g. std :: vector & lt; Boost :: any & gt; and leave an exception by denying them a bool return or failure. If you are right, entering the highlighted works in the compilation of time, you do not have to keep that restriction on your work and instead you can generate gum codes for the necessary conversions.

pdf - Which Adobe product/What API for form entry -

I have an embedded PDF in a Java-centric web application. I type the data directly into the users PDF, and get that data on the server side. What API do I see? LiveCycle can do this, thinking what else might fit in the bill. LiveCycle is not required on the server to allow data capture in PDF, Will make life very easy. The module you are looking for is LiveCycle Forms ES2 which provides many functionality to snatch information about dynamic and static PDF (and HTML) forms. As a cheaper alternative, you can only embed a PDF form (XFA standard) in your client application. This form must be designed using the Live Castle Designer Tool which is quite affordable. If you want lots of interactivity within PDF (for example, allowing users to save offline for later use or to allow Acrobat comments to be made), you also need to apply a Reader Extension credential to PDF Will happen. Reader Extended form gives you another option, i.e. directly submit data from a PDF form to the S

c - Referring to: How to Use LLIST *mylist[N]; -

This works LIST * mylist [10] = {NULL}; But if I want to do this I get errors: int x = 10; List * MyList [x] = {NULL}; x can be any value I'm setting it up to 10 times using the x as the counter Used to be. Support for variable length Arrays (which uses your other example) came in the C99 standard , Which can not support your compiler. For GCC, you should give the option -std = c99 while compiling.

sql server - Question about Time Statistics, Execution Plan and "print" -

Which field of a large query I am trying to test, which is why I have performed three steps Including the plan, setting the time figures, and printing immediately before and after those sections which I believe can lead to problems. Example: '1' selection ID '2' with print print When I look at my execution plan, it says that a certain Taking the section is a big percentage of "cost" when I compare this percentage for the time that ends in between my print '1' and print '2' I do, it seems that there is no way that the percent is even closer whether it is printed on the estimated cost and time Sector is a safe bet to rely on statistics? If this happens then can it focus on those areas which have passed a big time between the printed values ​​rather than the estimated costs? If you print only '1' and print '2', then when you print your sms If you see messages in the message pane, you are falling prey to bufferi

sql - Query to Delete Posts Older than X Days in WordPress -

I run a blog where communities can post time-sensitive community links (sports scores and so on). After a certain time, these posts are no longer useful, so I want to delete them in a batch through a MySQL query, but I do not know how. I feel that getting rid of those posts completely removes from wp_posts table, is not it? Other tables on the job per post, is not there? I have tried some auto or batch-delete plugins, but they do not work in half-time. Please, can you remove posts from all the relevant tables and provide a MySQL query to your pieces of X days old? Thank you in advance. WordPress has published database structure in its codecs. .

jquery - ajax calls being called too fast -

I have a page with a link, so that the user clicks Facebook to log our API. When you click on it, it calls an Ajax function which calls a php method to remove the user's key from our database, then calls the Facebook API logout function with a JS command. This calls Facebook and the user ends the session. Once logged out, it refreshes the page. My problem is that it seems that the database update is not going to end and the logout of Facebook is not being waited and the page has been refreshed. Since it does not meet it, the information is never removed and my site never gets logged out. Every once in a while, this is a delay, but probably clicks 10 times every time. I put a set time for 2 seconds, but it still does not work. Any thoughts? Do not use setTimeout to try a follow-up time Action to call Ajax instead use a callback function; This way it is guaranteed to execute only after the Ajax call is over.

java - Problem with not closing db connection while debugging? -

I have a Java app that initially opens a connection to a database, and closes it at the end though, The program does not always end, because the exception is thrown or I'm debugging it and it closes in halfway. Is it open connection database to slow down and slow down, or is it automatically cleaned? A database connection is managed by the ownership and database, the class only gives you access to that database If you do not close the connection for processing, then Java class garbage can be collected, but the database can not tell that the connection is no longer in use, resulting in waste of database resources (time-consuming on the database side) Therefore, when you are using your connection , you should make sure Close your code () The method will allow this garbage collector to remind the memory as soon as possible, and more important , it can handle any other database resources (cursor, handles , Etc.), which may be on connection In Java, this is the way t

Change resolution of image from 72 to 25 dpi in PHP -

Do I want to change image resolution from 72 to 25 dpi using PDP? Is this possible? Regards, Salil Gaekwad sorry . Although you can try copying it, to say that you want to create 400x300, 25 dpi image, here's the math: WIDTH 72 -------- 400 25 - ------- w = (25 * 400) / 72 (=) w ~ = 139 pixels HEIGHT 72 -------- 300 25 ------ - h = (25 * 300) / 72 (=) H ~ = 104 pixels You create a new 13 9x104 72dpi image, Work with it and you change it to a size of 400x300 pixels.

unreal development kit - Cannot place KActorSpawnable - UnrealScript -

I hope someone here can help me, I'm trying to create a suitable actor who is The player will be the controller, but when I try to add it through the "actor class" windows, there is nothing to do. Class BallBall KActorSpavnable placeable extends; Default Properties {Start the object = StaticMeshComponent0 StaticMesh = StaticMesh'EngineMeshes.Sphere 'bNotifyRigidBodyCollision = true HiddenGame = TRUE ScriptRigidBodyColisionThreshold = 0.001 Publish = (Dynamic = TRUE) DepthPriorityGroup = SDPG_Foreground End Object} I'm really disappointed with it, thanks any help actually apreciated in advance. My own question has been solved, it seems that my class was right, I just got the wrong place , Although I would be directly located below the actor, but it was located under the actor -> Dynamic Smector -> KACT -> KEETERSpanable -> Ballball

flex - Page number display in Flex3 -

I am creating an image gallery in Flex. On each page I have 3 images. I would like to allow the user to see the page number which is at the top right corner of 1/2 / 3 / 4 / 5/6 >> Here Page 3 is the current page and will be shown in black while other page numbers are in white when we have more than 6 pages, then it is not displayed Is when the user clicks on the 6th page, at which time 6 The change involves the next set of pages. 6 / 7/8/9 >> I have no clue about this to be new to Flex. How do i do this

iphone - How to change number of tabs in tabbar controller application? -

I am developing an iPhone tabbar application with 5 tabs. I just launch two tabs like "Find me" When a user searches for me, the tab will be shown on the second tab and the current location can be used. I want to do some things like "urban teaspoon". I am using the interface builder for all the accessories. If anyone has any ideas, suggestions, links, please provide me. Thank you. // Create array that contains your existing view controllers NSMutableArray * newVCs = [NSMutableArray array : [YourTabBarController viewControllers]]; // The first new VC you want to add (for example a nib) [newVCs addObject: [[[SomeCustomViewController alloc] initWithNibName: @ "yourNibName" bundle: [NSBundle main bundle]] autorelease]]; // The second new VC you want to add (example for the VC generated from the code) [New VCDAdject Object: [[[Other Custom ViewController alloc] initWithNibName: Zero Bundle: Zero] AutoWreck]]; // You want to add the third

working on port 81(wampserver) -

I have recently installed wampserver 2.0 and have configured it to work on Port 81. The problem is now that when I click on phpMyAdmin, the browser on the taskbar inside Wampserver 2.0 localhost / phpmyadmin instead of localhost: 81 / phpmyadmin But I redirected. When I type it manually, everything works fine. How can I fix this? When I click on phpMyAdmin , I want to open the browser instead of localhost: 81 / phpmyadmin localhost / phpmyadmin . is located in the configuration wampmanager.ini , located in the wamp installation directory . This file is generated from wampmanager.tpl , however, you need to change the following line there: type: item; Caption: "$ {w_phpmyadmin}"; Work: Run; Filename: "$ {c_navigator}"; Parameter: "http: // localhost / phpmyadmin /"; Glyph: 5 If you want you can add your own menu item here too. After you change this configuration, you will need to restart the left, because the wampmanager .in

c++ - Application does not start in debugger -

What I am doing does not start in the visual studio 2005 debugger. Here's what I do: I created the application again and hit F5 to start it VS2005-window The title "Project Name (Running) ..." says ... " The debugger buttons appear, but it becomes deeper Appears in the manager, but its memory usage is only 80k Nothing happens for a while, and in the end, I have received the following error message. L get a window: "debugging is being put on hold, but is not yet complete. You can force debugging to stop immediately, but any process can be separated. The debugging is completely stopped " The window does not disappear, so after some time I press the" Stop Now "button. For some time nothing happens (debugger button still Appear, but greyed) A new window appears a little later: "Unable to launch program (path on exe)" OLE Every Skytat N Ventures On Skier " The last sentence is Swedish" OE has sent a request

WPF ListView show Image -

मेरे पास एक साधारण वर्ग है जिसमें स्ट्रिंग और WPF छवि नियंत्रण: सार्वजनिक वर्ग उपयोगकर्ता {सार्वजनिक स्ट्रिंग नाम {get; सेट; } सार्वजनिक प्रणाली। विन्डोज। नियंत्रण। छवि छवि {प्राप्त करें; सेट; }} अब मैं एक ListView में इस वर्ग के उदाहरणों की एक सूची बाध्य कर रहा हूं। अब मैं क्या करना चाहूंगा सूची छवि संपत्ति को प्रदर्शित करता है मैंने DisplayMemberPath से छवि की कोशिश की है >, लेकिन यह इसके बजाय ( System.Windows.Controls.Image ) छवि का ToString मान दिखाता है। कैसे क्या मैं इसे वास्तव में नियंत्रण दिखा सकता हूं? यहां XAML कोड है: & lt; ListView name = "listView1" DisplayMemberPath = "Image "/ & Gt; धन्यवाद! आप एक DataTemplate बना सकते हैं छवि प्रदर्शित करने के लिए ContentPresenter का उपयोग करता है: & lt; लिस्ट बॉक्स & gt; & LT; ListBox.ItemTemplate & gt; & LT; DataTemplate & gt; & Lt; सामग्रीप्रदर्शक सामग्री = "{बाध्यकारी छवि}" / & gt; & Lt; / DataTemplat

python - failed abstraction of variable in for loop -

I'm trying to create a 4x4 sudoku solver in Python (I'm just starting!) And defining While trying, a function to clean my code to some extent, I ran into some weird behavior that I really did not understand Obviously, there is a difference between: sudoku = "0200140000230040" Sudoku = map (Lambda x: '1234' if x == '0' and x, list (sudoku)) For the category I (16): For the boundary for Jammu (4): If the Sudoku [i] == str (j + 1): For the category (4): If the LAN (Sudoku [i / 4 * 4] + K])> 1: sudoku [i / 4 * 4 + k] = sudoku [i / 4 * 4 + k]. Translate (None) for category (J + 1)) (4): If LAN (Sudoku [4 * K + i% 4])> 1: sudoku [4 * k + i% 4] = sudoku [4 * k + i% 4]. Translicate (none, str (J + 1)) and this one: sudoku = "0200140000230040" def sd (l): range ( 4) for: if lan (sudoku [l]) gt; 1: sudoku [L] = sudoku [L]. Translate (None, St (J + 1)) Sudoku = Map (Lambda x: '1234' if x == '0' and X, for list (Sudoku)

design patterns - Django: ForeignKey() or ManyToMany() in this case? Or, other? -

I have a model that is something like this: class return authorization (models Modod): Custom_id = models.CharField (max_length = 40) class RMAAPILog (models.Model): return_authorization = model. ForeignKey (ReturnAuthorization) If I delete () / Strong> A return authorization, I can not remove it all RMAAPILog () s which are related to it in this case they are removed. There may be several attempts to obtain RMA from external APIs (many RMAAPILog () s ReturnAuthorization () , but only one return authorization () for each Definitely RMAAPILog () because it is an attempt to authenticate specific ReturnAuthorization () . What would be better way to do this, or am I thinking all the wrong about it? > related SO question:

permissions - cwRsync ignores "nontsec" on Windows 7 -

I use cwRSync to synchronize some files from Windows This process was used to work fine on Vista But since I upgrade to Windows 7, I have to continue with issues of permission. Some backgrounds ... I used issues of the same permission on Vista, but it was resolved by using the CYGWIN = nontsec environment variable. Permit problem rsync: failed to modify permissions on Xxx: Permission denied (13) Since Windows and UNIX file permissions are different, so syncing files with Windows permissions does not make sense. What rsync does is set the permissions on 0 ( D --------- ) from UNIX. To prevent this, Sigwin has the nontsec variable that gives instructions to ignore the Windows file permissions. The problem is, on Windows 7, nontsec does not appear for any effect. Your solution again, I had to make adjustments to see that it works for me - Instead of content / fstab, I have used this content with the topic of the forum you reference: none / cygdrive cygdriv

java - Small problem while using JOptionPane -

मैं अपॉप्शन प्रदर्शित करने के लिए मेस्पेक्शनपैन। शोमोसेज डिआलोग (रिक्त, ई, "अमान्य नाम", जॉप्शनपेन.एआरआरओआर_एमएमएसईजी) का उपयोग कर रहा हूं। अपवाद वर्ग से विस्तारित लेकिन पॉप विंडो प्रदर्शित नहीं हो रही है जब तक कि जब तक मैं Alt + टैब नहीं दबाता। क्या कारण हो सकता है? नीचे स्निपेट है मुझे कुछ सुझाव दें। आयात करें java.awt.event। *; Import java.awt। *; आयात javax.swing। *; Import java.util। *; Import java.io * *; वर्ग का नामअवजाई अपवाद अपवाद फैलाता है {/ ** * अमान्य नाम * / स्ट्रिंग invName; सार्वजनिक नामनिवामान्य अपवाद () {सुपर (); } सार्वजनिक नामनिवामान्य एक्सप्शन (स्ट्रिंग्स) {invName = s; }} वर्ग SmallException अपवाद फैली {/ ** * लघु नाम * / स्ट्रिंग एस नाम; सार्वजनिक स्मॉल अपेशन () {सुपर (); } सार्वजनिक लघु अपवाद (स्ट्रिंग्स) {sName = s; }} पब्लिक क्लास वैधनाम {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग अर []) {try {BufferedReader br = new BufferedReader (New InputStreamReader (System.in)); System.out.println ("नाम दर्ज करें:"); स्ट्रिंग नाम = br.readLine (); c

c# - Need suggestions for developing Scrabble like game in WPF -

I want to develop a game like Scrabble in WPF for which I need some suggestions for visuals : 1. What control can be used to represent (let's say 9x 9) matrix? During the execution of each cell, it will need its ability to know its status all the time with an ID. How do I assign different visual properties to cell matrix? Do I need something like base layers for base boards and tiles? For argument: 4 How to know about validating a word and its surrounding potential words? Please advise. CodePlex is a complete solution here: html>

How do I create C# configuration files for each of my classes? -

If I go to Project -> MyParaguate Property -> Settings then I can create a settings file for the entire project. Although it is believed that each class will need its configuration file, is there a uniform way of doing this at class level? For example, suppose I have a parent class car with sub-classes Ford and Honda, I have to have a single property YEAR and a piece of code to read YEAR property. I could do this with two configuration files in the same year with the property if I use Ford. Wi-Fi and Honda Compared to YAR, I need two separate pieces to parse the data, which can be dirty for a large number of sections. This is not really designed for it. You can use it from the system. Configuration. Configuration settings to open your code explicitly in the code to read your settings. This will work but the designer will not give you any help in making your settings files. Is there a problem with your class wide settings? Another method that can help you is the c

Unit Conversion in Python -

I am working on a project that allows users to track different data types over time. One part of the base idea is that the user should be able to enter data using any unit. I am looking at both the units: And the quantity: Although I'm not sure the best way to go . Whatever I can tell, the quantity is more complex, but it also includes a better initial list of units. I appreciate the use of clear units in scientific computing applications using clear units to protect your teeth Brushes. It brings some tadium out, but the kind of protection you get can save a lot of trouble for a long time. Like, say,. You may also check these two other python unit / volume packages: I once examined the scientific investigation. Physical Physical Question It did not completely meet my needs, but it can be satisfying you can not tell which features you need from your brief description. I have finished writing my python package for unit conversion and dimensional analysis,

c# - ASP.NET MVC View Model with LINQ To Entities -

Assume that I am creating a query result var query = one to tblXYZ Join the new {ax, bx} in tblABC at c A.id = b.id; What is the best way to pass it into a single scene? Should I make a new object and copy the query result in it? I think it's almost always favorite to create a visual-specific model in the mechanism I control To get the query executed and close to see the list, the second suggestion of @ Mark will also be given. If you have a problem with any question, then diagnosing it is very easy to diagnose, instead of executing the query in the controller. Stack trace is actually useful at that point.

cocoa touch - Fade from iPhone default bitmap into main app -

The easiest / quickest to degrade slowly (0.5 seconds) from default.png / What is the most effective way In the initial app view? My initial try, which does not work so well .. Saturday night, let's see that we can do better :) UIImageView * WhiteoutView = [[UIImageView alloc] initWithFrame: self.view.frame]; // dealloc later this ?? WhiteoutView.image = [UIImage image named: @ "default.png"]; WhiteoutView.alpha = 1.0; [Self.view.frame addSubview: whiteoutView]; [UIView startup permissions: zero reference: zero]; [UIView Set Animation Del: 0.5]; WhiteoutView.alpha = 0; [UIView commitAnimations]; about it: UIImageView * whiteoutView = [[[UIImageView alloc] initWithFrame: self.view.frame] autorelease]; If (whiteoutView! = Zero) {whiteoutView.image = [UIImage imageNamed: @ "Default.png"]; [Self.view addSubview: whiteoutView]; [UIView startup permissions: zero reference: zero]; [UIView Set Animation Duration: 0.5]; WhiteoutView.alpha = 0.0; [UIV

Platform independent size_t Format specifiers in c? -

I want to print a type of type size_t in C but it seems that Size_t is the nickname for different variable types on different architectures. For example, the following code on a machine (64-bit) does not throw any warning: Size_t size = 1; Printf ("size is% ld", size); But the above code on my other machine (32-bit) generates the following warning message: WARNING: Expecting format '% ld' Long intestine ', but type' size_t * 'in logic 3 I suspect that this indicator is due to the difference in size, so that my 64-bit machine size_t is placed in long intervals ( "% ld" ), while my 32-bit machine is aliased for the second type on size_t is . P> Yes: Use the z length modifier: size_t size = (four) of size; Printf ("size is% zd \ n", size is); // decimal size_tprintf ("size is% zx \ n", size is); // hex size_t The other length modifiers available are hh (for char ), h < For

php - Error Using Multiple 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'] = "original"; $ 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"

iphone - UISearchBar with hidden UINavigationBar -

I have a search bar at the top of the table and a hidden navigation bar, along with I UISearchBar I use UISearchDisplayController . UISearchDisplayController is likely to bring forward the navigation bar. So, when I tap the cancel button in the search bar, the navigation bar flies, how can I dismiss this possibility so that the navigation bar is always hidden? Thanks A solution, to make the search bar a table heading view , In which it will scroll with the table, and if you do not want it to appear by default, you can scroll down the program, non-animated, WillAppear in the view it is displayed for the first time. It may or may not understand your UI design, but for example, how Safari works basically.

sql injection - PHP magic_quotes_gpc vulnerability -

I have been assigned one of my company's legacy webpage, and after a day or two around the source, I have found a SQL injection vector similar to the following: mysql_query ("SELECT * FROM WHERE bar = '". $ _GET [' baz ']. "'"); I have tried to do a SQL injection test against it, but it fails because of the PHP magic_quotes_gpc module being turned on. I know magic_quotes_gpc is dirty , but we have hundreds - if not thousands - the lines of the same code above the code Can not afford to close magic_quotes_gpc , because this code will open like an attack to attack. I want to know that the code above is 'Shōogi', and should we immediately fix it or should work to fix it with our other defactor functions. magic_quotes_gpc is the common way to add wrapper function to sites: function m ($ s) {if (get_magic_quotes_gpc ()) $ S = strip slash ($ s); Return mysql_real_escape_string ($ s); } Mysql_query ("SELECT * FROM

c++ - Is there a readable implementation of the STL? -

I'm on Linux; See STL header; They really are really complex. Is there a small version of STL, which has the main features of STL but is really readable? Thank you! is a C ++ standard template library , co- Author Designer Stepanov & amp; Lee (together with P.J. Plager and David Muszer), which describes the possible implementation, is complete with the code - see.

how to debug facebook app/django setup (url is not valid...) -

I am trying to set up a Facebook app using django by following this tutorial: I get to that point where I start at my development server (manage.py runerver 0.0.0.0:80) Then it says: Now you have basic Facebook App should see : I receive an error message, though: The URL is not valid. I think I have set up properly: canvas page url: canvas callback url Question: I What is wrong to know about how to go? Thanks in advance! Update : When I visit, it redirects to where I get the message 'no URL valid' ... However, When I paste url with auth_token in it, Django is expected as the request page ... Facebook is saying that the URL is not valid, if it really is ...? Has your router forwarded a request to your development machine on port 80? If not, you will get an error, such as the Facebook app that works, that the Facebook servers contact your server, get the content, parse it, and re-serve the client. I'm actually getting what is the easiest thing

sql - Find the user with the most contact -

Users send messages in each other message box, find a user, which most other users know (get and Send ??) USER_ID USER_GROUP MESSAGE_ID / li> MESSAGE_MESSAGE MESSAGE_FROM_USER M_ESSAGE_TO_USER A user can send and receive, so who knows other users (Send and receive by ??) < / P> Using SQL Server 2005+, CTE: As with usr_list (SELECT x.user_id, select x.message_from_user as tab x union for other user y.user_id, y.message_to_user as other_user tab Y) SELECT TOP 1 ul.user_id, COUNT ( *) AS Un-CTE's equivalent: num_friends as SELECT TOP 1 ul.user_id, COUNT (node ​​CTE equivalent: *) FROM (SELECT x.user_id, x.message_from_user as other_user from table x UNION SELECT y.user_id, y.message_to_user as other_user table) and UL by UL Group Num_friends DESC by User_id ORDER

css - is font/text sizing in % more accessible and manageble than em? -

Both articles are proving this. I want to know that some users have to see? difference between% and 100 * em (font size for setting) is that AM units The ditch of some browsers related to the use of (which can clearly be worked with body {font-size: 100%}} and then use the units after that.) The clash shaft article, obviously, is bullshit. It leaves half of the facts. The maximum design is decent, but it reflects its age. It was written in '03, and the thing that talks about is in Opera 6 and Netscape 4 - both are obsolete.

complexity theory - Question about NP-Completeness of the Independent Set Problem -

I thought, when the problem is that pnp is full, then we reduce the problem to a known npc But, looking at the solution of the problem of independent set, it does not seem so. To prove that the independent set is NP-complete, you take a graph, get reversed, and then calculate CLIQUE (G) but, doing it the other way It is taking a problem: PI does not know whether it is NPC and then it reduces NPC's problem. 'An example of the solution is. > What am I missing here? This is not wrong because it is doing the other way? To prove that P NP is complete, we need to show two things: / P> It is present in P.NP. There is a polytime reduction algorithm to reduce the number of NP-complete problems to the PO. If we know that CLIQUE is in NPC, then we can easily prove that IS is in NPC. We are in the corner of the polyaitime firator, make sure that not everyone is in the solution of the candidate. We will now have to reduce the CIL to CIlqua. Looking at CLIQUE

Best cross-platform audio library for synchronizing audio playback -

I am writing a cross-platform program that includes a wave scrolling with uncompressed wav / aiff audio playback. Latency and accuracy are very important What is the best cross-platform audio library for audio playback while synchronizing for an external clock? This means that I would like to be able to write playback code so that she sends a listener several times per second, which includes "auditory frame" at the time of notification. All I need to do is do not have any recordings, no mix, 3 No audio, no audio. Playback with just the information available for the best possible hearing. Right now I am considering RTUs and PortAudio, which mostly uses ELSA. Target platform, in order of importance, Mac OSX 10.5 / 6, Ubuntu 10.11, Windows XP / 7. Both C / C ++ are OK. Thank you for your help! Windows can leave ASIs (in case of low delay processing without dropouts) but you can not expect normal users to use the jack (before the app starts the monster should be

time - Questions about implementation of a global register allocator for the tiny c compiler -

In the coming summer, I hope that I will start writing my master's thesis and I am quite busy looking for the thesis topic. . Now I have a pool of such topics in which I am interested and who has hit me the most, it is the implementation of a global register ollocator for a small compiler (graph color or linear scan). So I wanted to leave by and ask if you have ever done that and if this is a possible topic for Master Theses, or if it is very difficult, I would also be very happy if you Can direct for any good literature about this subject (I already have Dragon Book). You should ask your tutor, usually not the internet! Whatever your thesis, you need it: A good tutor Being the best friend with your tutor < Li> And the only way It should be fun - this is an important motivator - but it can be anything for you on Excel Go It's not fun to mess up and the grade is bad. It's not cheap - or not possible - to do all this again. You have a few mon

Android - Adding and showing items to ListView one at a time using an ArrayAdapter -

I am using an array adapter to add items to a custom list view and show results in my Android app. The problem I am facing is that ArrayAdapter waits for this wait until all the items are there before it appears in the scene. To say this, when I'm adding an item to the array adapter and I inform that DataAetChanged, then it does not update the ListView to show the added item. It waits till all items are added and GetView is called before showing the items. I would like to do this showing the list immediately after adding the list to Vieu. Is this possible? I believe the relevant code is the following: r_adapter = New Reminder Adapter (Activity Link Search, this, R.Let Search, ListTime, MyList); ListView.setAdapter (r_adapter); ... r_adapter.notifyDataSetChanged (); R_adapter.clear (); For (int i = 0; i As you can see, even though I am notifying DataSetChanged after the add method, it does not actually update the view. After the loop is over, the scene has finally been

Stop Erlang Daemon -

In addition to running $ killall-9 beam.smp , how do I get an Errong Node program Can I kill when I know its -sname If I do not want to monitor the heartbeat to restart the process, how can I ensure that Any answer given for the above question will also kill Dilbeat? Is a decent guide to deploying Eranga as a daemon? kill and killall with -9 is almost always incorrect . You can easily ask to exit the remote node: rpc: call (remote node, int, stop, []). I do not know if it has to stop the heart from restarting it, but I suggest that if you want to stop it, then you do not want to. Run it in any non stop-stop mode. Update - Jade states that init: stop is correct code heart , so the rpc: call < / Code> The best and the only way to do this.

multithreading - When and why would I use Java synchronization? -

संभव डुप्लिकेट: जावा सिंक्रनाइज़ेशन का उद्देश्य क्या है, और मुझे इसका उपयोग कैसे करना चाहिए? आपके जेनेरिक प्रश्न का एक सामान्य जवाब इसे पसंद नहीं है? कृपया थोड़ा विस्तार करें चीयर्स।

.net - Silverlight 3 alternative to FileVersionInfo.GetVersionInfo -

In a Silverlight 3.0 application I want to use to display the version information of the application. It is not the same and is usually retrieved in a .NET application using code: var executed assembly = assembly. Gate AccedingAssambad (); Var fileVersionInfo = FileVersionInfo.GetVersionInfo (implemented assembly.place); Var Versions Labels = FileversionInfoFileWarson; Unfortunately, the class does not include the Silverlight 3.0 runtime. Is there any alternative way to use this information? There is one way to do this with properties - I'm not sure if it works in Silverlight If you will, you have to tell me. assembly assembly = assembly Gate contingency assembly (); Object [] attributes = assembly. GetCustomAttributes (typeF (AssemblyFileVersionAttribute), Incorrect); If (attributes = null & amp; attributes.Lang> 0) {AssemblyFileVersionAttribute fileVersionAttribute = (AssemblyFileVersionAttribute) attributes [0]; String Version = File Details Attribute E

algorithm - Minimize RMSD between two sets of points -

I need to plot the change of a 3D object against time. I have time to get 3d There are shapes, but they are not guaranteed to be well geographically placed, so I can not present them and slap the pictures together in a movie. So I need to align them so that they are pleasant and consistent in relation to the camera. What I will do is to get a pair of 3D objects, to focus them in the geometric center, then make proper rotation around some axis so that the RMSD can be reduced between the points. It is not difficult, but I would love to know if there is something ready, so that math (and code) is not to be changed again. Of course, I accept objections to my method too. I am working in Python, but any code will do this, and I will change it. Kbask algorithm does this. See:.

sql - Django: Multiple COUNTs from two models away -

I am trying to create a profile page that shows the amount of dwarf that is assigned to each related career. I have 4 careers, each of them has 2 jobs and of course there are many dwarves, each of them has a single job. How can I get the number of dwarfs in each of those careers? My solution was to highlight career names in HTML and to ask a question for every career but it seems like a lot of questions. Here's what I want to: Assigned: 3 Build: 2 Farming: 1 House: 1 These are my models. I add some complications (they are related to their jobs) by not adding careers directly to their midget model. Import django.contrib.auth.models from import django.db import model class carrier (models.Model) from user: name = models.CharField (MAX_LENGTH = 64) def __unicode __ (manually ): Return self.name class job (models.Model): career = models.ForeignKey (carrier) name = models.CharField (MAX_LENGTH = 64) career_increment = models.DecimalField (max_digits = 4, decimal_places =

maven - Is there a Java Class that generates a POM.xml file? -

In my job project, I have recently been asked to create PO files through a Java class. The problem is that I am very, very new to Maven (since last December). Whatever I need is a code that generates an XML file (a palm file, but if I can configure any XML code that will be okay) give all the necessary data So, they do not have to write it manually. I do not know if I am explaining myself, but the question is whether there is a library or class that produces a POM file with any data Training does? If this is not good, then I do not want to search for a little more time which I do not know whether it is also present or if the POM object is as simple as declaration and then a trivial document d = generatePom (POM) Is doing p). Since it is difficult to write any POM files because I think it should be an easy way of doing it but I think I have lost too many API in Javadoc and I can not find my own way. I think that there is no code for this, then to find the POM dictionary (to cove

bit manipulation - Bitwise operations in PHP? -

I think bitwise action is required for very low level programming, such as writing device driver, lower level graphics , Communication Protocol Packet Assembly and Decoding I have been doing PHP for many years, and I have seen very little bitwive operations in PPP projects. Can you give me examples of usage? You can use it to encode a combination of things for bitmask. Actually, it works by giving each bit a meaning, so if you have 00000000 , then each bit represents something, besides having a single decimal number, suppose I have users There are some preferences for which I want to store, but in the case of storage my database is very limited. I could only store the decimal number and get it from that, which are chosen priorities, eg. 9 is 2 ^ 3 + 2 ^ 0 is 00001001 , hence the user's preference is 1 and the preference is 4 < / P> 00000000 which means bin December. Example │││││││└ Priority 1 2 ^ 0 1 | Pref 1 + 2 Dec 3 00000011 is ││││││└─ Priority 2 2 ^

c# - using numbers in a string -

Can I use numbers using the string data type? Make sure you can, and if you want to use them as numbers You can parse the string such as for an integer: string numbereststring = "42"; Int numberFromString; If (int.TryParse (numberAsString, out numberFromString)) {// number successfully parsed with string} Bull will return to parsing if successful. You can also parse directly even if you know that there is a number in the string - using. The string can not be parsed, if it will be thrown. integer number = int.Parse ("42");

iphone - Table Contents not Visible Until Table Scrolls -

I am new to iphone development. I am parsing a variable array of XML strings that are dynamically in a table. Presents. I can not see the content in the table, but as soon as I display the content, I scroll down. Please help me Thanks You can not say without looking at the code, but it seems that - Table view: CellularAntindexpath: Returns the first blank cell. This probably does this, because your data source, in this case XML Parser, has not yet provided data for cells when the table is first loaded. The table browses only visible rows and then closes when you scroll and are visible to new cells, it only receives more data. In your case, it seems that the table There is no data in it when it is first load, but at the time you take it manually to scroll, the data is found in it You are forced to load the data. For the table reload is required to call. Even better, you should change your design to ensure that there is some data to display before the table itself loads. If

Create a simple mootools 1.2 tab system -

I am trying to create a very simple tab interface using mootools 1.2 version. I should not have the Fidgin-Fadeout effect, no sliding or morphing. I have tried to find some demos online, but these are all in reference to different versions or they are very complex compared to my needs. Can you give me some guidelines? This is an image that I am trying to do and a sample code. & lt; Ul id = "button" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Button 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Button 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Button 3 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Button 4 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; Div id = "tab1" &

sql - Strange Oracle date behavior -

I had a strange problem in one of our production databases. Long story short, simple query: Select ID, from triangle (stdate) to table_name where trunc (stdate) = '05 -FEB-09 '; No line returned though, select from the table trunc (stdate) table_name where id = sought_after_id; returned '05 -FEB-09 ' . Only after I try: Setup table_name set stdate = '05 -FEB-09 'id = sought_after_id; My original query works as expected: id, select trunc (stdate) from the table_name where trunc (stdate) = '05 -FEB-09 '; & Gt; Demand_uper_id, '05 -FEB-09 ' So, what was happening with my standard values? You should compare dates with dates (apples for apples ...) and false conversion Should not be trusted. Since TRUNC (date) on a date you should compare it with a date: id, trunc (stdate) from table_name Choose where trunc (stdate) = DATE '2009-02-05' or select id, trunc (stdate) from table_name where trunc (

C# Reflection - Can I check if one method makes a call to another -

I am exploring a method to ensure that method 'A' is called the 'B' method. Therefore, this deal is broadly .. class should be a {internal static zero} method (calling) MethodA () B} should be called by zero MethodB () {// method. }} Class two {internal zero} MethodA (// test that MethodA call method}} I should know that I'm stuck on it for a 2.0.0 ExpressionTrees are not one I do not even believe they will help, but this was my initial idea. Edit: This is for an internal device that visualizes the cyclic complexity of the source, so there is no relation to breaking me. Encapsulation here Apart from this, it is likely that it will be used only for the system. Refine. A code for an IL reader is a project snippet, although you can use it for generic support You may have to patch. Have fun!

security - Do you still use the .Net Configuration tool to give Visual Studio 2008 SP1 access permissions to code on a network drive? If so where is it? -

To allow .net to access the shared network drive, I can not seem to find the old mscorcfg.msc snap is. I downloaded Windows SDK 2008, which transferred the .NET 2.0 SDK (where it was used) but did not get it. Do anyone know that this has been disliked? Is there a new way to give net permissions for shared network drives? mentions you. Net 2.0 in a nutshell, but it's unclear whether this is your targeting. There is no special permission to run .NET 3.5 SP1 now from a network share. Net 2.0 (no SP) does not require such permissions via .NET 3.5.

mysql - a SELECT that returns the highest 'views' and a specific id's 'views' -

Is it possible to write a single query that can return two rows, one is specified in the WHERE section and the other The highest table. For example. Table_1 -row_id -views -content Is there a query that can add the following: Table_1 Where to select from row_id = 10 SELECT MAX (views) Table_1 Or two questions are my only option? I think technically it is possible to use a single query; However, you can use the UNION operator Select Table_1 WHERE row_id = 10 UNION Table_1

html - jQuery hide/show <div> element appearing behind image -

I have a height of 35 pixels and a hidden div that has a height of 200 pixels. I have a jQuery function that hides a small box and shows a bigger division when clicked. All this works well. The problem is, when it is large, it is behind an image which is below it. I have determined the z-index of all affected objects without profit. Any ideas how can I get it back? TIA Added position: relative to div and well in all the world Were from

Mono .NET Error 500 -

Greetings, When I try to apply my pure solution in hosted to host my rent I found this error ... It is very strange because, no matter whether the code is running or is it always? Server error '/' Application object is not set in context for an object instance: HTTP 500. Error in processing the request. Stack trace: System.NullReferenceException: An example of an object on Object Reference System.Web.Compilation.BuildManager.GetPrecompiledApplicationType () [0x00000 on System.Web.Compilation.BuildManager.GetPrecompiledType (System.String virtualPath) [0x00000] SystemWeb.HttpApplicationFactory.InitType (System.Web.HttpContext Reference) [0x00000] Version Information: Mono Version: 2.0.50727.1433; ASP.NET version: 2.0.50727.1433 Can anyone explain what's happening to me and how do I It looks like you're getting it

asp.net mvc - When will a minified version of MicrosoftMvcAjax.js be available? -

I'm running YSlow against my site and the Microsoft Ajax file is too big: = 99.3 And = 136.7k Is Microsoft CdN likely to be a minimum version of these files soon? Already is minified ... if you look at the code. The only way to do this is to do it if they do it for some browsers, they make better ... Coming as 404 The correct address as well as minified is ... I think MVCAjax is 4.3 KB (when saved in disk) and MVCAjaxDebug 12 KB .... ... I know that you are looking for a performance, but I think it might be a dry auspicious. - Mark

Does using undef as hash values save any memory in Perl? -

a Perl idiom to remove duplicate values ​​from an array: @uniq = Keys% {{Map {$ _ = & gt; 1} @list}} Using this version is cheaper: @uniq = keys% {{Map {$ _ = & gt; ; Undef} @list}} I have tested with these one-liners, and it seems that this is true on some versions of Perl: Perl -e 'my% x; $ X {$ _} = 1 for 0.000000; System "ps -ovsz $$" 'perl -e' my% x; Unfifferent for $ X {$ _} = 0..1000_000; System "ps -ovsz $$" ' OK, undef < / Code> is considered a flyweight value, which means that all its references indicate the same figure. You do not do this for other verbal people, you still need the upper part of the slot, though it is mentioned though. However, I do not see any memory for me on Perl 5.10 or 5.11 on Mac OS X. While the perl in is undef can not use more memory in the case, expected me to make sure it uses more memory, so it takes hold anyway . However, I am not eager to investigate memory usage in int

connection string - What is a TNS:listener in the Context of Oracle? -

border line serverfault question, but it seems that I will try here first because I already have luck with Oracle's queries Was there. / P> I am trying to connect to PHP from an oracle database, and I am getting the following error. Ora-12505: TNS: The listener is not currently aware of the given SID in the connect descriptor This error is that the PHP report and error which Appears in listener.log. My immediate problem is fixing this error. The big question I want to answer is how does the Oracle connection model work? It is in a development environment running on my local window machine and working so far. Unfortunately, the environment was handed to me (I did not set it up) and those who set it are unavailable to help me debug it if I'm getting an error with MySQL or PostgreSQL (two systems I'm more familiar with), I'll check to ensure that a database process is running, and then try connecting manually to the user name / W Unfortunately, I'