Posts

Showing posts from June, 2014

java - Testing for optional exception in parameterized JUnit 4+ test -

I am trying to write a unit test for a method that takes a string as a parameter and a Exceptions are distorted (and if it's okay then none). I want to write a parametred test that feeds in many strings and expected exceptions (in which none is thrown when input string is created well!). If @Test (expect = SomeException.class) is trying to use annotations, then I have two problems: Expected = Null is not allowed, so I How can I test for the expected outcome of an exception (for well-formed input wires)? Expected = Not possible? I have not tried this yet, but I have a strong doubt that this is the case after reading (Can you please tell that this is true?): This is the best solution I have found so far. What do you think about it, especially than that: Thanks for any help, I look forward to discussion :) ValidStringsTest InvalidStringsTest / Li> Remember: Readability of your tests is even more important: Note: Already examines all valid assumptions (n...

python - What exactly are Django Apps -

I have to switch from trains to diego, to expand my mind, and a question arises in my mind. My train app is quite messy, because my hobby based development approach is a patch and glue. I have seen very quickly that Django is split between a project and an app according to your site, a project multiple applications , And an app can be used for many apps. This made me amazed, because it will clarify the rows between the areas of my site. I tried to find some more examples and information on it, but I could not answer my question, Which is: How big / small is this app? Do they want to communicate close / near? For example, is an app to deal with the profiles of smart users, and is another app for dealing with blog posts and comments of those users? (In my site, a user can have many blogs, with different profiles). Or are they meant to be used otherwise? is a fancy name for a degeneracy app a Python package actually , That's the only thing that separates a Denggo a...

domain driven design - In CQRS, how do I communicate a list of allowable methods on an aggrregate to the UI? -

I have a total root order, and there are several ways in it that are set internally to my 'status' field Submit Hold Hold Hold Confirm Cancel etc. Available actions are dependent on the order's order (as if it can already be placed on hold) The problem is that I want to provide a query to tell the UI Required commands are available, so I can hide the actions that could otherwise throw InvalidOperationException How can I do this with a minimum DRY violation? Simple Solution Example: PlaceOnHoldCommand Result OrderPlacedOnHoldEvent / read the query model and select it. In addition to being placed in ( eventstore ), it is published and controlled by OrderTransitionsEventHandler , which denormalizes changes available in a DB table associated with the order. The customer selects available changes and works accordingly (hides unavailable buttons or such.) This is definitely one of the options do not expect that there will be no duplication. T...

sql - How to insert unique value into non-identity field -

I have an insert to try a primary key field in which he and other fields in a set table (this field 1 Call it) This is unique (this is a unique obstacle in other specific fields that prevents my inclusion). Field 1 is not an identity field, so it does not automatically number. Unfortunately I can not change the table. The existing insertion code is made to increase and contains looping / cursor in it. Select MAX (Field 1) + 1 Anything like this, without any looping / cursor to insert anyway? This area is meant for me, but there already are having 500,000+ records using their silly numbering plan, so I should respect that It's simple, but (ReceiptNumber Regions I want to insert an) .: set lane XACT_ABORT-announced transaction start TransMain @nvErrMsg nvarchar (4000) --Insert inventory receipts Avanti_InventoryReceipts (ReceiptNumber, ItemNumber, ReceiptDate, ORDERNUMBER, JobNumber, Supplier, LineNumber, MultiLineNumber, insert in [position], QtyOrdered, QtyRecei ,,,,,,,,...

c - fgets() skipped -

इस सवाल का पहले से ही एक उत्तर है: 1 उत्तर मैं एक प्रोग्राम लिख रहा हूँ स्कूल जहां उपयोगकर्ता इनपुट का नाम, घंटे काम करता है, और प्रति घंटा मजदूरी। int main () {char name [SIZE]; Char चयन = 'जेड'; इंट घंटे वर्धित = 0, काउंटर = 0, फ्लैग = 1; फ्लोट प्रति घंटा राइट = 0.0; Const फ्लोट otRate = 1.5; Const int week = 40; जबकि (फ्लैग == 1) {system ("cls"); Printf ("\ n \ tP एक वाई आर ओ एल एल पी आर ओ जी आर ए एम \ n"); प्रिंटफ़ ("--------------------------------------------- \ n "); Printf ("\ t (ए) - नई पेरोल जानकारी \ n \ t (बी) - प्रदर्शन पेरोल \ n \ t (सी) - छोड़ें \ n \ t"); Scanf ("% c", और चयन); चयन = टुपर (चयन); स्विच (चयन) {मामला 'ए': सिस्टम ("सीएलएस"); Printf ("कर्मचारी नाम दर्ज करें:"); Fgets (नाम, आकार, stdin); स्ट्रिप_इनलाइन (नाम, 50); Printf ("\ n प्रति घंटा की दर दर्ज करें"); स्कैन एफ ("% एफ", और प्रति घंटा की दर); Printf ("\ n इस सप्ताह काम किया घंटे:...

asp.net mvc - Can an mvc razor @helper return a non-encoded tag? -

It is contrived, but what I'm doing is basically like this I have a @bloper: @helper MyImage (int i) {string s = "& lt; img src = '{0}' / & gt;"; String theImage = ""; Switch (i) {Case 0: theImage = "test1.png"; break; Case 1: theImage = "test2.png"; break; Default: theImage = "error.png"; break; } String r = string.format (s, image); @ (R)} The output I get on the web page is definitely the actual string: ? You can use @HTML @ (r) . Instead of (R)

How to get basic Visual Studio features for javascript (VS 2010) -

I 2010 is seeing a good way to add some capabilities to JavaScript Intelligence which are working properly for C #. Specifically, I want to: Dependable refactor javascript code Go to function definition ( F12 for me) and Check all the uses of a function or item ( Shift + F12 for me). I have information and, but I have not received any comments about what kind of facilities they advertise, they are supported in javascript. The features they advertise are based on the languages ​​which are very less dynamic. So, I ask: Any comment on the plugins mentioned above? Is there any other good plugins that make these features (or most of them) VS? Add to 2010? Is there any IDE that this facility has been fixed? Great support for javascript. Refactoring (this is not 100% reliable because it is not possible with JavaScript, but it actually Go to Definition Find Use On the Negative side, this is a little expensive; But, as far as I am concerned, the ...

php - How can I post a JSON multi-dimensional data via Jquery.post? -

How can I post a JSON multi-dimensional data by $ .post? For example, I have this multi-dimensional array in JSON format: {"file": {"name": "1024x768.jpg", "type": "image \ / jpeg", "Tmp_name": "C: \\ wamp \\ tmp \\ php8F59.tmp", "Error": 0, "Size": 469159}} I Jquery Post () to post JSON data $ Post ("process.php", '{"name": "1024x768.jpg", "type": "image \ / jpeg", "tmp_name": "c: \\ wamp \\ tmp \\ php8F59.tmp" , "Error": 0, "size": 469159}} ', function (xml) {}); So I can get this code in process.php print_r ($ _ POST) : Array ([file] = & gt; Array ([name] = & gt; 1024x768.jpg [type] => image / jpeg [tmp_name] => c: \ wamp \ Tmp \ phpA1.tmp [error] = & gt; 0 [size] => 469159)) Is this possible? Try it out: $ Post ("process.php", {...

c++ code: class or structure: difficult to understand -

संभव डुप्लिकेट: मैं संरचना के लिए किसी शीर्षलेख फ़ाइल को देख रहा हूं, लेकिन ऐसा लगता है कि फ़ंक्शंस इस संरचना का एक हिस्सा हैं ... तो फिर यह एक वर्ग है, लेकिन कैसे रोकना है? या उपयोग करें? संरचना रिकॉर्डिंग {फ़्लैग मोड; अहस्ताक्षरित लघु अंतराल; अहस्ताक्षरित लघु बचत_साइकिल; आभासी शून्य SavetoFile (फ़ाइल * फ़ाइल, बूल नियंत्रण, PhaseData * __ चरणडेटा = नल); वर्चुअल बूल लोडफ्रेम फाइल (फाइल * फ़ाइल, बूल नियंत्रण, फेजडाटा * __ चरणडेटा = नल); }; सी ++ वर्ग और struct समान हैं, सिवाय इसके कि पूर्व के लिए डिफ़ॉल्ट एक्सेस स्पेसिफायर निजी है, जबकि बाद के लिए यह सार्वजनिक है। class बेस {/ * .. * /}; वर्ग फू: बेस {int i; }; संरचना बार: बेस {int i; }; उपरोक्त कोड में Foo निजी कोड से बेस से प्राप्त होता है, जबकि बार ऐसा सार्वजनिक रूप से करता है इसी प्रकार, Foo :: i निजी है जबकि बार :: i सार्वजनिक है ध्यान दें कि दोनों मामलों में i की दृश्यता के लिए विरासत से कोई लेना-देना नहीं है, यह वही होगा, भले ही Foo और बार नहीं किया आधार से वारिस। इन अंतरों के...

layout - How do you add a custom view on a view in Android? -

I have a graph view (custom view) and a main view in Android. Based on the user's preference, I want to add a 1-5 graph view to my main scene but I'm not sure how (I'm purely using Java and not xml). Any advice or suggestion you are welcome In your activity, Something that is about the beginning of your on-Crete () method: setContentView (R.layout.main); Your main In the XML file you are probably the one element that has some type of layout. I agree to LinearLayout for now, but it works well with all kinds. You will need to get the context of this layout and to do this, there should be an ID in it. So if there is nothing like that in the layout, then you have to add it: android: id = "@ + id / myMainLayout" Then your Java After some time after calling setContentView (), you can find the context of your layout in such a way: LinearLayout myLayout = (LinearLayout) findViewById (R.id.myMainLayout) ; Once you reference your layout, you can a...

Regex replace expression in Ruby on Rails -

I need to change some text in a DB area based on a regex search on the string. So far, I have this: foo = my_string.gsub (/ \ [0-9 \] /, "replacement" + array [#] + "Text") Therefore, I am searching for each number in the field surrounded by brackets ([1], [2], etc.) What I would like to do is find each The number (within brackets) is found, and that number is used to find a specific array node. Any thoughts? I know that someone needs some kind of explanation. The easiest way is to use the block type: foo = My_string.gsub (/ \ [(\ d +) \] /) {array [$ 1.to_i]} and note that inside the Regex capture group inside the block , Global $ 1 which matches the first Capture group. You can also use named capturing group, but there will be a separate global requirement for this because to get the existing MatchData inside the $ ~ block The only way is (AFAIK): foo = my_string.gsub (/ \ [(? & Lt; num & gt; \ d +) \] /) {| M A [$ ~ [: ...

Rails and multi-databases, how would capistrano perform db updates on the db's? -

In the Saas environment, I want to create multiple databases for each customer (or group of clients, shared by some criteria). How do all databases migrate when using updates using Castistano? If DB is bigger, then is there a way to deactivate DB migration while running Cassistaro? I think you have to write your own custom migration task. If you do not want to run the migration, there is not a database server with it: primary = & gt; True set

php function error warning -

My provision is environment php 5.2, now php is 5.3. When I took the website to a new environment, this error shows error alert: Fatal error: Call unchanged function imagecreatefrompng () xx / application and the error code is the ninth line in the following code: secure function IM ($ file) {if (! File_exists ($ file)) die ('file does not exist.'); $ Info = getimagesize ($ file); Switch ($ info ['mime']) {case 'image / gif': $ mim = imagecreatefromgif ($ file); break; Case 'image / png': $ mim = imagecreatefrompng ($ file); // error line imagealphobalending ($ MIM, false); Imedecalpha ($ mim, true); break; Case 'image / jpeg': $ mim = imagecreatefromjpeg ($ file); break; Default: Dead ('File Format Errors.'); } Return $ MIM; } How should I change it? Help phpinfo () check that you have PHP The Gd library for installation is . It seems that it is missing.

java - how to change appearance of ContentProposalAdapter -

I'm using a ContentProposalAdapter to auto-complete a textbox, it's okay, but I want to That the format of the font or popup background color, and more, I searched but I did not find any ContentProposalAdapter method to do these things. How can I change the nature of a ContentProposalAdapter? I have no experience with this Jeff part, but when you check the documentation, You can find the method to openProposalPopup () This class provides some overritable ways to allow popups to be manually controlled. However, most implementations remain private. Open the proposal popup and display the proposals provided by the offer provider. This method comes back immediately, that is, it does not wait for an offer to choose. This method is used by subclasses to explicitly use the opening of the popup. If there is no proposal to show any one, the popup will not open and a beep will appear. If you check the code for this method, then you should open the / ** * Proposal ...

tablelayout - How to get list of product in memory in Android -

I have a list of products. There can be 5000 records in it. I have given the endorsement page. First of all, it loads 50 records. Then if we press Next option (& gt;) then load the next 50 options as follows. I have designed a table layout. ArrayList & lt; Product & gt; ProductList = New Arrestists & lt; Products & gt; (); ProductList = getProducts (); Table layout TL; Tl = (Table Layout) Find VVBIID (RID tableLayout1); If (productList.size ()> 0) {for (int i = 0; i This is my implementation. I have not run away from pointing to the page yet. How can I get it in memory and load it? Please help me I recommend that you get a param pageindexã ?? ? ? You can then set a trigger, which is active on the page endorsement page. And update the UI by Handler

How to handle Ajax request with MVC in PHP -

I am currently working on my own MVC framework in PHP. I want to know how to deal with Ajax requests ... URI created a page using www.domain.com/controller/method/params URI is a The router is passed through the class, which receives the controller and methods + parameters to use It looks good yet, but I also have a header and footer, maybe the original page But there will also be a sidebar and the main content of the MVC page Part will fill. When I make an Ajax request, for example, www.domain.com/user/create: Controller = user method = create for example I Trying to create the whole page as it is sending one P> Here are some incomplete answers. Here's how you do it, it's very easy ... What you're doing is checking for AJAX header and depending on it, Different content Does not. AJAX header: $ _ server ['http_X_REQUESTED_WITH'] It will be set to XMLHttpRequest for AJAX requests After all major JavaScript libraries there is a stan...

postgresql - PL/pgQSL - enumerating over ROWTYPE in stored procedure -

After loading data from a CSV in an existing postgraz table, I will have a duplicate record that requires a merge. To do this, I plan to use a stored procedure that does the following: current_record airports% ROWTPE; New_record airports from Airports to% current_record from SELECT * to IKo LOOP SELECT * (STRICT) at new_record at airports where iko = current_record.iko and oid & lt; Current_record.oid - Is it possible to calculate on each such field? For Int i = 0; I & lt; New_record.fields.count; I ++ loop if new_record.field [i] not tap current_record.field [i] = new_record.field [i] end loop; End loop; Can I use the fields for internal loop as shown above, or do I have to decode my change logic for each field in the table? There are about 70 columns in it. How to do this, other better ways besides this will also help. TIA There is no direct support for this. However you can ask the system catalog from within your function. But this will not do things fast....

functional programming - What is the point of multiple parameter clauses in function definitions in Scala? -

I am trying to understand the point of this language feature of several parameter segments and why you would use it for example What is the difference between these two functions? class WTF {def} doublemclause (x: int) (y: int) = x + y def acronym (x: int, y: int) = x + y}> & gt; Val underTest = new WTF & gt; & Gt; Undeste DoubleClickClues (1) (1) // result '2' & gt; & Gt; UnderTest.OneParamClause (1,1) // is the result '2' There is something on it to see that it matters to you. NB: Tip These are called 'parameter clauses', but I think some people also call them 'parameter lists'. There are three practical uses of many parameter lists here, It is especially useful when using top sequence methods to assist with the type estimate, the first parameter x with parameter a of g2 is approximate, so in the second parameter, the function argument f f = f (x) g1 (2, x => gt); df g1 [a] (x: a, F: A => A) = F (...

iphone - Help with Memory leak: init NSMutableArray from file -

At some point in my app, I need to load a list from a file, so I used to load the list I apply this method: - (zero) load list {NSString * filePath = [self-data-file path]; // This is the way to return a method file if ([[NSFileManager defaultManager] fileExistsAtPath: filepath] {NSMutableArray * tempArray = [[NSMutableArray alloc] initWithContentsOfFile: filepath]; Self.list = [[NSMutableArray alloc] initWithArray: tempArray]; [TempArray release]; }} self.list is a (retaining) property. I think the leak is from [alloc] when I init in selfl.list. I used self.list = [[NSMutableArray alloc] initWithArray: tempArray] autorelease]; But the app crashes due to EXC_BAD_ACCESS so I'm confused here how to solve it. Thanks for any suggestions. "itemprop =" text "> simply assign, self.list = tempArray; As tempArray is already an array, you do not need to create another array from it. You can specify self.list directly

http - firefox ipv6 connection failed while tcp layer connected -

I am trying to connect with IPv6 Link-Local address from Windows XP SP3 to Firefox 6. IPv4 address of the service works well, IPv6 connection failed with failed error. By wirehaark, it is celebrated as sequence: direction protocol port transmission 1. Customer - & gt; Server: TCP 1061- & gt; 80 [syn] 2. Servers - & gt; Client: TCP 80-> 1061 [syn, ack] 3. Client - & gt; Server: TCP 1061- & gt; 80 [ack] 4. Client - & gt; Server: http [Receive] 5. Server - & gt; Client: http [200 OK] In the 5th transmission, the requested HTML file is included. But the browser connection failed. It seems that TCP receives the layer message and can not deliver it to the HTTP layer or the browser. I've disabled the firewall, and the results are the same. Can someone give a clue or a hint to follow? Thank you. I suspect that this is not a complete reaction in packet 5. Usually this type of problem is due to broken path MTU discovery. If the path has a t...

javascript - How to get relative position of a draggable item when dropped? -

मेरे पास निम्न है: $ (function () {// चित्र खींचें $ ("। Item")। Draggable ({// स्थान हटा दिया गया है जहां स्थिति का पता लगाएं। स्टॉप: फ़ंक्शन (ईवेंट, यूआई) {// शो गिरा दिया गया स्थान। Var Stoppos = $ (this) .position (); $ ( "Div # stop")। पाठ ("रोकें: \ n लेफ्ट:" + Stoppos.left + "\ nTop:" + Stoppos.top);}}})}}; जब मैं इसे ड्रॉप करता हूं, तब आइटम की स्थिति प्राप्त होगी, लेकिन यह ब्राउज़र विंडो के सापेक्ष है, न कि वे उस डिवाइन के भीतर हैं जो वे अंदर हैं। मैं उनकी रिश्तेदार स्थिति कैसे प्राप्त कर सकता हूं? संपादन- & gt; यहां html / css है: & lt; शैली प्रकार = "टेक्स्ट / सीएसएस" & gt; कंटेनर {मार्जिन-टॉप: 50 पीएक्स; कर्सर: ले जाने के; } #screen {अतिप्रवाह: छिपा हुआ; चौड़ाई: 500px; ऊँचाई: 500px; दोनों को साफ करो; सीमा: 1px ठोस काला; } & Lt; / style & gt; & LT; बॉडी & gt; & Lt; div वर्ग = "कंटेनर" & gt; & Lt; div id = "स्क्रीन" & gt; & Lt; img id = "pro...

javascript - How to create AJAX semi-synchronous behaviour -

Before coming in an easy way to dynamically load my head, Together, and simultaneously link the HTML canvas sections which are stored on the server, but obviously, initialization on the client (when it seems to be important in the inequal environment). I was thinking that help me find a way to load simple JavaScript scripts Let's define a load ('foo.js') function Instructions for loading the script foo.js from and executes it as a javascript code. Looking at three files stored on the server: AJS a = 10; B.js Load ('ajs'); B = A +10; C.js Load ('BJ'); C = b + 10; If the customer complies with the command load ('C.js'); What is the easiest / most reliable way to implement this? I had an idea that the code server had to scan and return all the scripts one at a time. Minimum request php requests are required for this. However, if the customer has already requested the C.js , the script must be present in the client side...

regex - Client side validation, Regext to match tag,or how to validate blog post to prevent script posting -

I was looking for regex to match the speed tag, I used ASP.NET MVC 3.0 humorous recognition I am here. I get this regexp "^ [[script | (| | | \ N)? & Gt; (| | \ N) *? & Lt; / script & gt;] * $" found How to fix this? Here are some examples: Here are some examples: 1) & lt; Script & gt; Warning ("a"); & Lt; / Script & gt; & Lt; Div style = "clear: both" & gt; & Lt; Br / & gt; & Lt; / Div & gt; 2) & lt; Script src = "/ anypath" type = "text / javascript" & gt; Antything & lt; / Script & gt; & Lt; Div style = "clear: both" & gt; & Lt; Br / & gt; & Lt; / Div & gt; 3) & lt; Div style = "clear: both" & gt; & Lt; Br / & gt; & Lt; / Div & gt; & Lt; Script & gt; & Lt; / Script & gt; What I'm doing - I want to validate blog post input to stop the post script a...

table - Jquery fails to dynamically create a row cross browser -

I have this function for my comment system but it does not dynamically add row ... this is what Looks like: var myTable = $ ("# adddatacom" + id); Var Magic Newwe = Document. CreateElement ('tr'); MagicNewRow.htmlContent = '& lt; Td class = "comment" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; TD width = "600px" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt ;? Php echo $ userimg2; ? & Gt; & Lt; / Td> & Lt; Td> & Lt; B & gt; & Lt; A href = "profile.php" & gt; You can & lt; / A & gt ;, & lt; / B & gt; & Lt; B style = "color: green" & gt; Just now & lt; / B & gt; & Lt; Br> '+ ComMessage.val () +' & lt; / Td> & Lt; / Tr & gt; & Lt; / Table & gt; & Lt; / Td> '; MagicNewRow.innerHTML = '& lt; Td class = "comment" id = ...

c# - Concurrent requests with a static value and webservices -

I have a web server (ASP.Net - mono 2.6.7), whose value is static float x There are two ways: getX () and setX (newX) . I have two clients, a PC with a C # console app and the other is Mobile Device with Mobile Android (KSAP2). Both web servers can be used. I do not know: if my mobile device tries to getX () , while my PC setsX (NewX) , Will there be any problem with this? Thank you. This is not a good practice for state-wide implementation for services You can fulfill multiple requests Can be in different instances. This is the case in ASP.NET web services. In WCF, using configuration, you can change instancing behavior. For example, you can give an example to fulfill all the requests (some of them may be concurrent) - In case, the unstable state in one (as in your case), you need to synchronize access to the state. The thread on the shared state will generate a hindrance in completing synchronization requests because only one request can reach the state on the thr...

serialization - PHP unserialize error -

मुझे निम्न त्रुटि मिल रही है: - संदेश: unserialize () function.unserialize : 65535 बाइट्स ऑफसेट 65517 पर त्रुटि क्या अनसियरीयइज़ का अधिकतम आकार है? यहां मेरे PHP में प्रश्न में एक पंक्ति है: $ सरणी = unserialize ($ ईमेल); // यह $ ईमेल का उत्पादन होता है (यह सब बहुत बड़ा नहीं है) स्ट्रिंग (65535) "a: 12134: {i: 0; s: 29:" 12someemail@addr.com "; i: 1; s : 31: "5myname@email.com" डेटाबेस फ़ील्ड (संभवत:) आप अपने सीरिजलाइज्ड डेटा को संचित कर रहे हैं जिसमें एक आकार सीमा है जो उस स्ट्रिंग की लंबाई से अधिक हो जाती है - मूलतः, आपका डेटा दूषित है।

c++ - wxWidgets Crash on closing application -

This is probably a stupid question because this crash may be related to some invalid indicator or the item already deleted, but the code By all means I did not know where the problem is. When I turn off the software, I found a SIGSEVerror with the following message: # 0 00000000 0x003f01c5 (??) (??: ??) # 1 004D36BC wxSocketClient :: ~ wxSocketClient (it = 0x2a8bf80, __in_chrg = & lt; value is optimized & gt;) (../../src/common/socket.cpp:1237) # 2 0042 e 9 AAA :: ~ AAA (this = 0x2a5998c, __in_chrg = & quot; value-optimized & gt;) (C: \ Documents and Settings \\ My Documents \ Programming \ Assistant \ Assistant \ src \ pasan.cpp: 71) # 3 00416A49 AssistantFrame: : ~ AssistantFrame (this = 0x2a592c8, __in_chrg = & gt; value GT out and customize;) (C: \ d Avejh and Settings \\ My Documents \ programs \ Accessories \ Accessories \ AssistantMain.cpp: 937) # 4 00416FCB AssistantFrame :: ~ Shaikfrem (it = 0x2a592c8, __in_chrg = & lt; value is optimized &...

jquery - Ajax loading in a container. Problem with height? -

I'm having a problem, so let me describe your situation: I have a site 2 main areas A navigation link and where content is shown. I am using AJAX so that when I complete these steps on a link, click: 1) Content in #fadea 2 ) New content is loaded 3) The height of #main changes 4) New content is shown. But for some reasons on some pages, the height of # has not been adjusted appropriately, it will be very small, cut down the content. Ive noticed that this is only for the first time that you load the page, so I think the problem of the browser is not able to calculate the height of it properly until all the data is downloaded. But I can not understand why this happens, because the callback function should not start unless everything is loaded? Anyway, I hope you guys can give me a hand thank you! $ ("a: not ('noajax')"). Live ("click", function (e) {e.preventDefault (); // Load new page link = $ (this) .attr ("href"); Load...

c# - How to match a file path with a file search pattern (i.e. *.jpg)? -

I know that all files that match the search pattern in a folder like this: directoryinfo folderinfo = new directoryinfo (folderpath); Fileinfo [] fileInfos = folderInfo.GetFiles (disassembly); But my problem is, if I already know the file path, how can I match it to the search pattern? For compatibility, the search pattern should have the same format as * .jpg or something. Your question is interpreted as meaning, that is, you already have a file path There is a string and just to see if it matches a certain pattern, for that you first have to consider whether you need to actually pattern patterning, for example it would be better to use the extension directly. Considering that there is no alternative, you probably want to use regular expression to convert the string into a regular expression with a wild card. Unfortunately, I am not aware of any of the ways of doing this, but it is possible to avoid any such characters that would be appropriate in Reggae and replace ...

ruby - Watir-Webdriver: Uploading files isn't working correctly on firefox -

Using this code, I can not find a file to upload the website properly. The browser set ("+ folder name" / iTunesArtwork ") Once the code is run, it shows that it is displayed by displaying a spinning wheel Uploading, but it is not actually uploaded and the wheel just spins. If I upload it on my own, though it uploads properly. Here is a link for html: / P> As you can see that HTML is in a form tag if I have to go through the file without any fax If I try to use IEL then it will tell me an error that the conversation can not be negotiated because it is not visible. What is any clue? Your local file that you are uploading will not be present locally. I uploaded your HTML: I tried to do it: Ruby-1.9.2-P290: 001> "water-webdriver" => true ruby ​​- 1.9.2-P 290: 002 & gt; B = W Master :: browser. Start "http://dl.dropbox.com/u/18859962/uploader.html" = & gt; # & Lt; Watir :: Browser :: 0x..fdea53ebfe3940b9a url =...

jquery - Dynamically add and remove nested form fields -

Image
मैं आउट-ऑफ-डेट रेलीग्स के साथ निम्नलिखित का पालन कर रहा हूं: मैं रेल 3 में कोड का काम करने की कोशिश कर रहा था, लेकिन दुर्भाग्य से मैं केवल फंक्शंस को समाप्त करने के लिए काम कर रहा हूं (मैंने कोड को कहीं और तोड़ा)। मैंने 'नीस्टेडफॉर्म' मणि के साथ खेलने के लिए भी कोशिश की है जो एक चीख-साफ पाड़-निर्मित वातावरण में बहुत अच्छा काम करता है, लेकिन यह मेरे वर्तमान प्रोजेक्ट में सुचारू ढंग से नहीं दिख रहा है। इसके अलावा, मैं वास्तव में यह समझना चाहता हूं कि इस पर एक त्वरित मणि-तय करने के बजाय पर्दे के पीछे क्या हो रहा है क्योंकि यह मेरे ऐप का मुख्य हिस्सा है। गतिशील रूप से नेस्टेड फ़ील्ड JQuery के साथ या कुछ अच्छे सहायक विधियों वास्तव में, वास्तव में सराहना की जाएगी। क्या आप कोई अतिरिक्त समस्या पोस्ट कर सकते हैं आप नेस्टेडफॉर्म मणि के साथ चल रहे हैं? यदि आप कुछ और स्पष्ट कोड-वार की तलाश कर रहे हैं, तो आप केवल एक बना सकते हैं सहायक सूची में jQuery क्लोन () आपकी सूची का पहला तत्व, किसी भी इनपुट को शुद्ध करें, और jQuery के अनुलग्नक () ने नेस्टेड तत्वों की सूची के अं...

how to get image name using camera intent in android? -

I want to take the current image of the camera using this code. I can get the image from the camera and display it in the image view. I want to know the file name of that image Intent Intent = New Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE); StartActivityForResult (intent, CAMERA_PIC_REQUEST); Public Zero (Int Request Code, Ink Results, Code, Intent Data) on Active Result {super.onActivityResult (requestCode, Resultscode, Data); Switch (requestcode) {case 2: {if (resultCode == RESULT_OK) {bitmap thumbnail = (bitmap) data.getExtras (). Get ("data"); Mg_view.setImageBitmap (thumbnail); } break; Post-text "itemprop =" text "> In your activity ( Which is called YourActivity ): public static id TAKE_IMAGE = 111; Uri Mkeptide ImageURI; Call a camera anywhere ! try {string fileName = "temp.jpg"; content values ​​= new content value (); Values.put (MediaStore.Images.Media.TITLE, filename); MCapturedImageURI = getCon...

objective c - SubStrings from String Array iPhone -

मेरे पास एक सरणी है, नीचे देखें, NSMutableArray * myArray = [[NSMutableArray alloc ] InitWithObjects: @ "45 x 2", @ "76 x 3", @ "98 x 3", शून्य]; अब मुझे सभी स्ट्रिंग चाहिए जो कि किसी अन्य सरणी में "x" वर्ण के लिए सही है। मुझे ऊपर की ओर से तत्वों @ "2", @ "3", @ "3" के साथ एक सरणी की आवश्यकता है। मैं यह कैसे प्राप्त कर सकता हूं ?? धन्यवाद .. NSMutableArray * myArray = [[NSMutableArray alloc] initWithObjects: @ "45 x 2 ", @" 76 x 3 ", @" 98 x 3 ", शून्य]; NSMutableArray * tempArray = [NSMutableArray सरणी]; के लिए (myArray में NSString * स्ट्रिंग) {NSArray * array = [स्ट्रिंग घटकों से निर्धारित किया गया है: @ "x"]; यदि (सरणी कोटि 1) [tempArray addObject: [सरणी ऑब्जेक्टऐटीइंडएक्स: 1]]; }

cmd.exe equivalent of /dev/stdout, to write to stdout 'as a file' -

I have a batch file that calls the Windows GUI application. The GUI app writes that it takes the output (interesting bits anyways) into its GUI display instead of the standout, although I would like to display it in the CMD window where the batch file is running. Thankfully there is an option to write output to a file in the app, so I need to redirect it to the studio. * In Nix I will give the file to write / dev / stdout but what will happen in Windows / CMD? It seems that the windows are not equal to Unix / dev / stdout. Take a look at this thread:

xcode4 - If you define an Objective C block within a block within a function, what scope does the inner block have access to? -

If a function defines a block within a block, then Internal Blocking In addition, do you have to do this to prevent self from continuing (the debate is preoccupied properly): - (zero) function {__block id me = self; ^ {__bloc id me2 = me; ^ {[M2 ...]; ^}}} I have blocks of the form - (zero) function {__block bool isOK = true; // ... [someArray enumerateObjectsWithBlock: ^ (id obj, bool ** stop) {// ... [someOtherArray enumerateObjectsWithBlock: ^ (id obj, bool ** stopping) {// ... isOK = false; }]; }]; } Then the internal block has reached the scope of the outer block. Why do you want to stop keeping yourself? The object must be filled in any way for the lifetime of the block.

kernel - Server drops to dracut debug shell after upgrading from Fedora 14 to 15 -

I have upgraded to Fedora 15 using the upgrade now. Specifically, I did sudo yum update sudo yum install preupgrade sudo preupgrade-cli "Fedora 15 (Lovelock)" when to me Therefore, I have entered: sudo reboot and waiting to complete the upgrade. My server now fails to reboot, leaving debug shell: Debug is leaving shell shell: can not use TTI; Typing job control off: Typing in 'dmesg' gives me the following information (I have left everything but have the last two rows): [8.574475] Dracula: Autosambling MD Red [29.531556] Draft Warning: No root device found "Block: / dev / disk / by-uuid / 812eb062-d765-4065-be34-4a2cf4160064" The system is installed on two S-ATAII HDs (RAID 1) and I can boot into the system by selecting the old Fedora 14 kernel (2.6.35.14-95.fc14.x86_64) in GRUB. Celebrities: [raid1] md127: active raid1 sda [1] sdb [0] 1953511424 External exterior blocks: / MD 0/0 [2/2] [ Uu] [& gt; .................... re...

xml - Nested list with number labels -

I have a nested list, and so I want the label nested too. This is my code: & lt ;! - For the first list - & gt; & Lt; Xsl: Template Name = "List 1-Label" & gt; & Lt; Xsl: number format = "1." / & Gt; & Lt; / XSL: Templates & gt; & Lt ;! - Nestle List - & gt; & Lt; Xsl: Template name = "list-2-label" & gt; & Lt; Xsl: number format = "1.1." / & Gt; & Lt; / XSL: Templates & gt; The first number in the last template ( 1 .1.) I want to be in relation to the original item in this case; "3". Here is the XML structure: & lt; List1 & gt; & Lt; Items & gt; Test & lt; / Item & gt; & Lt; Items & gt; Test & lt; / Item & gt; & Lt; List2 & gt; & Lt; Items & gt; Test & lt; / Item & gt; & Lt; Items & gt; Test & lt; / Item & gt; & Lt; / List2 & gt; & Lt; Items & gt; Test & l...

html - Inserting space, padding between images with CSS -

I am trying to add some images to a space that contains two rows of 3 total images, . I have made a bela with code here Images show how I would like them, though I want to add padding, or place in the middle of each image, Want to remove? Can someone tell me how can this be done by changing margins and there is no difference in padding characteristics? Or if you really want to imagine ...

wpf - Base a ControlTemplate on another ControlTemplate -

I know that there should be an easy answer for this, but I can not find it. I got a button style named ' hoverbutton . & lt; Style x: key = "hover button" target type = "button" & gt; & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "Button" & gt; & Lt; Border & gt; & Lt; ContentPresenter / & gt; & Lt; / Border & gt; & Lt; ControlTemplate.Triggers & gt; & Lt; Trigger Property = "Ismouth Over" Value = "True" & gt; & Lt; Setter Property = "Borderbrush" Value = "Black" /> & Lt; Setter Property = "Background" Value = "WhiteSmoke" /> & Lt; Setter Property = "Foreground" Value = "Darkard" /> & Lt; / Catalyst & gt; & Lt; /ControlTemplate.Triggers> & Lt; / ControlTemplate & gt; & Lt; /Setter.Va...

javascript - Change the image of a JSF commandbutton with DHTML event onmouseover -

I want to change the image of my button when the mouse goes over it. I can do this for DHTV Event OnMoverOver, but how? Do I still need to make javascript for this? What should I do to make this work? This is my current code: & lt; H: commandButton class = "btn" image = "/ resources / images / mainbtn1.png" onmouseover = "/ resources / images / Mainbtn2.png" / "& gt; this & lt; h: commandButton Image = "foo.png" & gt; one HTML Lt; input type = "image" src = "foo.png" & gt; . onmouseover attribute (such as all the * as attributes ) Javascript should point to the functions, however, you are putting image path in there area. This only causes a javascript error (which you may have seen if You have to write some JS which changes src E the attribute of the image button accordingly: onmouseover = "this.src = '/ resources / images / mainbtn2.png'" don ...

unixodbc and netezza ODBC driver issue (Undefined symbol: SSL_connect) -

I'm trying to set up unixODBC to connect to the Netezza database, although I'm getting the "Undefined Icon: SSL_connect" "When I try to connect using isql. Currently using: CentOS 5.5, unixODBC 2.3.0 (the same problem with 2.2.11). I have done the following: According to README.txt coming with ODBC drivers, configure LD_LIBRARY_PATH, ODBCINI, and NZ_INI_FILE_PATH It has been made. It has been ensured that all libraries are loaded using the ldd command symbolic link for Libssl and libcrypto. Netezza drivers loaded the path The /etc/ld.so.conf file has been updated to ensure that this is done. Used to confirm the nm SSL_connect symbol in the driver. The dltest file against this symbol is running a "file not found" error reporting Which I took Usually when I isql -v run tries to do additional debugging LD_DEBUG to obtain information environment variable, which SSL_co me Nnect. (FYI, Export LD_Debugs = File SQL SOS OSSS which I have ...

visual studio - Need help with accepting decimals as input in C# -

I wrote a program in C # running Pythagorean theorem. I have some help if I would like some help on allowing the program to accept decimal numbers from user input. using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; Namespace project_2 {class program {static zero main (string [] args) {int sideA = 0; Int sideB = 0; Double side c = 0; Console Write ("Enter an integer for side A"); Side A = Convert ToInt16 (Console.Readline ()); Console Write ("Enter an integer for side b"); Sideb = convert.ToInt16 (console .readline ()); Side C = Math Po ((SaidA * Side A + Sidebie * Sidebie), .5); Console Write ("This is the length in side c ..."); Console.WriteLine (sideC); Console.ReadLine (); }}} I Math it Trying to do research using the abus and likewise to get build errors only. Help in Written Path will be greatly appreciated. I recommend using decimal. Trips This pattern is very safe because it enters exceptions an...

How to sync Lua and C++ garbage collection -

I am trying to embed lava in an existing C ++ application and for this it is inherited from a class by one The standard process has worked out. I see that the serious problem is that if a highlighted object is deleted or deleted in C ++ environment, a call from Lua will crash if the program is being removed by using the 'Delete' program I could probably write a cover on Leah being taken to care for the delocation, but if memory was allocated by C ++ and when the scope of the appropriate variable is over thanks. Thank you. Thank you. Thank you. Thank you. In general, there is a way to decide what is the owner of which memory, whatever object is owned by each cover. (And therefore will be destroyed by Lea) or by your application. If you have given Lua the owner of C ++ to an indicator of an object, then you have to find a way to make sure that Lua does not use this pointer before that point where C ++ Eliminates it There are several ways to avoid this: One way to tran...

java - Project structure organization: how to make it better? -

All - There are many web applications, based on some versions of the spring developed all the time But different teams in the organizations they each make their war, put a different context to work within, and often get deployed on the same machine, because their functionality is knit together. So we end up with: tomcat / webapps / {A, B, C ...} On deployment, each one is very Use the same set of tool chains, repeat all around the spring jar and dependence. I am thinking that there is a way to improve project structure, single each webpage resides in its own source repo and speeds up its own growth? ? Any pointer or reference much appreciates. Oliver You probably have to take an app server like jboss , But can not you use the ear file and you can create Maven for the module? In this way you can put them in different repos, if you want to do it with your pom and then there is another project with a palm for the ear file: Here the Maven Cannes plugin Is: ...

php - Multiple conditions in the ternary operator safe? -

I have seen the advice that says that the ternary operator should not be nested. I have tested the code below and it works fine. My question is, I have not seen the use of a ternary operator like this before, so it is reliable because it was used in a if or something like this and then bites me (no Due to context or readability, but also due to failure). $ rule1 = true; $ Rule2 = False; $ Rule3 = true; $ Res = (($ rule1 == true) & amp; ($ rule2 == incorrect) & amp; ($ rule3 == true))? right wrong; If ($ res) {echo "good"; } And {resonate "unsuccessful"; } Thanks! If the results are returning from you, the Ternary operator is only "true" and "false", then you No operator required. You may just: $ res = (($ rule1 === true) & amp; ($ rule2 === incorrect) & amp; ($ rule3 === True)) But to answer your question, yes many situations work perfectly well.

c# - Dynamic SQL query causes "Unclosed quotation mark" error -

I am getting this error: After the character string, the quotation mark symbol '' . With the following code: lSQL = "Remove from TBL corrections where courseCode = '" + aCourseCode + "' '; where lSQL is a local variable and aCourseCode is a store value. Any suggestions? You should use always queries, or your code is sensitive to errors worse than SQL injection attacks. When building questions Use the never string constant in the form this is the correct way: (var conn = new SqlConnection (ConnectionString)) by using (var cmd = conn. CreateCommand ()) {conn.Open (); Cmd.CommandText = "Remove from TBL corse where course code = @ course seed"; Cmd.Parameters.AddWithValue ("@ courseCode", aCourseCode); Int Removed RowsCount = cmd ExecuteNonQuery ();} will ensure that even if there are some escape and dangerous characters in the aCourseCode variable, they will be properly controlled.

javascript - Using jQuery in Firefox Addons -

Does anyone use jQuery properly in Firefox addon ? I have seen, but I'm not getting anyway which is relevant to the latest version of jQuery, and I know that I can not include it due to the conflict through the script tag. Thanks in advance! "post-text" itemprop = "text"> You can use a subscript loader to load the JavaScript code (including JQuery) into an arbitrary field. See.

dynamic - How to make from var_str import var_str in python -

इस सवाल का पहले से ही एक उत्तर है: 9 जवाब मुझे समझाने दो .. मैं यह करना चाहता हूं: a = "somedir.somefile" b = "someclass" आयात b खैर , मैं यह एक निर्देशिका के अंदर स्वत: सभी वर्गों को आयात करने के लिए करना चाहता हूं, और मुझे नहीं पता कि कितने कक्षाएं हैं। a =" somedir.somefile "b =" someclass "मॉड्यूल = __import___ (a, globals (), स्थानीय (), [बी], -1) clazz = getattr (मॉड्यूल, बी) अब आप ऐसा कर सकते हैं: उदाहरण = क्लैज () उदाहरण.मैथ ()

Inheritances in Java -

I used to discuss the legacy on the Web in this example, and I'm not easy about the results, Missing important public class A {int i = 5; Public A () {foo (); } Private zero foo () {System.out.println (i); }} Extension of public square b A {int i = 6;} Expansion of public square cb {int i = 7; Public zero foo () {System.out.println ("C's foo"); Println (super.i); }} I am trying to figure out what the following command is happening: cc = new c (); System.out.println (CI); I know that when we make a new example of C , we approach for the creation of A and B, then we will be A () - (Question 1) Is i (AK) being started on the way? Now we need to call the foo () - (question 2) - consider foo () as a code of foo () ? What else would be if the foo () in B? So it was considered as an override and operated by foo () of C? As far as I know, there is no override related to local characters. How is it System.out.println (c.i) 7 and 5? It should not...

A basic 3 table inner join in MySQL? -

I tried to search for a question like this, but many of them joined with more complex select clauses While my question is more simple and should be a fast reference to newbies on MySQL Being used in Oracle SQL, I was trying to join three tables and wanted to delete like this: remove to tbl_login, tbl_profile, images WHERE tbl_login.loginid = Tbl_profile.loginid and tbl_profile.loginid = Images.loginid and loginid = 'derek'; MySQL is my attempt: Delete from tbl_profile, use images, tbl_login, tbl_profile, insert inner images, tbl_login, WHERE, tbl_profile.loginid = images. Loginid and images.loginid = tbl_login.loginid and loginid = 'derek'; I ran into PHPMyadmin's SQL section and he told me that login was unclear which I thought was funny because if I'm joining three tables, why would it be unclear? So I edited it and it was done as that it was removed from the tbl_login table on the right line, but it was terminated by my second Rows from the ...

BOOST ASIO: How to use limited buffer size with async_read_until -

itemprop = "text"> I use a small buffer (for example 128 bytes) and I want to use "async_read_until" TCP connections with large incoming messages (except for all 128 bytes before the delimiter) How can this be done? The ASIO docs are not very clear what happens when the buffer provided is not large enough here is my code for initiazation read typedef boost :: share_ptr & Lt; Boost :: asio :: streambuf & gt; Streambuf_ptr; Streambuf_ptr inBuf (new boost :: asio :: streambuf (128)); Boost :: asio :: async_read_until (* sock, * inBuf, "\ r \ n \ r \ n", boost :: bind (my_read_handler, sock, inBuf, boost :: asio :: placeholders :: error, boost :: Asio :: placeholder :: bytes_transferred)); provided buffer is not enough, when async_read_until is complete And then invites the reader handler with the error code asio :: error :: not_found , which means that the delimiter was not found. At that point, you call some (or all) data fro...

sql server - SQL returns less results when using UNION? -

I have a SQL Server stored procedure that does not give me all the results when I add to the union and in the second half . The first half will give me all 6 results of the union's use, I only get 5. There are 3 patients [Chart Number], 2 items should be displayed in each If [CPTCode] is the same for both patients of a patient, then when adding union, only one of the two entries is shown (this gives me 6 with all [cptcode] without union) The second half is actually not pulling any information with what I am doing now, but it is necessary. choose / * Patients with chart number * / b1. [Chart Number], 'First Name' in the form of 'First Name' as the 'First' name as '0', [new name], [original name], [last name] as '', 'latex' [first name] , ''). [Feature code]) as [feature], isnull (B1.DOS, '') as [dos], isnull (ins. [Name], lytec. [Primary code] [primary code] Isnull (b1. [CPTCode], '') as cptCode, isnull...

Javascript Library - Mobile Touch - Draggable Objects on axis without disabling scroll -

I have a page with slider carousel Recently, I want to add touch interfacing to swipe the finger to find slides Work has been assigned. I have an old jQuery plugin that is no longer supported. It is necessary for touch sliding, but if the slider has swipe in the boundaries of the carousel element, then the ability to scroll that page with vertical swipe has been disabled. Does anyone have an element dragable library that allows a specified axis (horizontal, for example) which will not disable vertical scrolling intentions if the origin of the swipe occurs within the element ? IPhone, Blackberry OS 5 + should work on all devices. Engadget.com has a slider on the mobile website that completes it. is a couple that can help you in any of these custom slider plug-ins Can easily integrate.

swing - Java Initialization Block -

Can someone help me understand the following construction? I am having trouble understanding that it is an early or an unknown class. I am not familiar with this syntax. JTable jt = New JTable (Data, Field) ** {Public Table Cell Renderer getCellRenderer (int row, EIT column) {// TODO automatically generated method stub return renderer; }}; ** This creates an anonymous internal square that extends to JTable, and Overrides GetCellRenderer method Long explanation: You are creating a class that explicitly enhances JTable without the name, instead of using the standard class declaration: Expanded JTable JTable {}> Public Category Extended Visibility of this class is limited to that class, within which it has been defined and done immediately. To override a method (getCellRenderer ()) of a particular class (jettbol), when it is quite useful for you, like the code you need, for some purposes it is limited to the current category reference. This approach has some advant...

c# - Some irritations with ListView and DataContext -

मैंने निम्नलिखित C # और XAML कोड लिखा है: नामस्थान सूचीदृश्य उदाहरण 1 {सार्वजनिक आंशिक कक्षा मुख्य विंडो: विंडो {सार्वजनिक पर्यवेक्षण कलेक्शन & lt; MyColleague & gt; MyCollegues = नया निरीक्षणीय चयन & lt; MyColleague & gt; (); सार्वजनिक मैनविंडो () {myCollegues.Add (नया MyColleague () {नाम = "टिम", उपनाम = "मीयर"}); MyCollegues.Add (नया MyColleague () {नाम = "मार्टिन", उपनाम = "हैनसेन"}); MyCollegues.Add (नया MyColleague () {नाम = "ओलिवर", उपनाम = "ड्रम"}); InitializeComponent (); } सार्वजनिक पर्यवेक्षण योग्यता & lt; MyColleague & gt; माइकर्लेग्स {प्राप्त करें {this.myCollegues return; }}} सार्वजनिक वर्ग MyColleague {सार्वजनिक स्ट्रिंग नाम {get; सेट; } सार्वजनिक स्ट्रिंग उपनाम {get; सेट; }}} एक्सएएमएल-कोड: & lt; ग्रिड & gt; & Lt; ListView ItemsSource = "{बाध्यकारी}" डेटाकॉन्टेक्स्ट = "{बाइंडिंग रिलेटिव सोरस = {रिलेटिवसॉर लिस्ट} दृश्य उदाहरण 1: मेन वान्डो}, पथ = मा...

Play video with java -

Here's the problem: I have to play a video with Java (any type: Avi, Veve, etc.). I tried the jmf api a few days ago but it will not play any video. I have heard from this mess and support since then, so I have left it. I have also tried JFMPG, but it is very heavy, because I want to play a small presentation only before running a program. Is there any other way to do this, can I try another library? JMF is super easy if you want to play simple video. increases the public class media player JFrame {public media player (set) (set layout (new border layout ()); // file that you want to play url mediaURL = // Maybe Media Media player with Media Player Media Player = Manager. Create Realized Player (Media URL); // Get component for video and playback control component video = media player.GetViewUlcollegePint (); Component Control = Media Player .getControlPanelComponent (); Adding (Video, BorderLayout.CENTER); Adding (Control, BorderLayout.SOUTH); }} Boom! You have the ...