Posts

Showing posts from February, 2012

linux - Grep two words followed by a alphabetic character -

How can I make both "HD" and "SD" after any alphabetical character in an order? Example: * = Alphabetical characters dmesg | Grep hd * dmesg | Grep sd * using the -E option For grep : dmesg | Grep -E 'HD * | Sd * ' For your specific example, you do not even need to type the -E option: Dmesg | Grep '[HS] D *' will suffice.

metaprogramming - Meta-Programming in Delphi - Adding a function call to every method of a class -

I want to add some instrumentation to an application, basically adding the function call as the first line for each Wish I Method / Event In many statistics, code appears broadly. Process TSomeClass.SomeProcedure; Start the execution quarter (classname, 'some process'); // This is what I want to insert. // Finishing the rest process; I can do it manually in thousands of ways (maybe it may take a few hours), but I was thinking that there was some programmatic way to do this. I can extract the code quite easily with a regular expression, but one way to add it ( start after process or Can not define the function and enter the code with the appropriate parameters.) This will be a big case for AOP in Delphi, but it is not very well supported. For some backgrounds, I am working with a large heritage application server (Dataset / DCOM) and I want to determine which functions the client is still calling. The Execution Control Function gives class as a class distri...

java - Finding if there's a similar decimal digit in two ints -

I currently take a Java class in my High School, and I should get a code to help figure it out. That is equal to number in two ints. For example, ints 49 and 93, both ints (which is 9) have a similar number. I have to write a code to see if there is a mutual point. / P> Update: You were asking what I have tried to do, on which I have already commented below, here it is. // declare int a = 12; Int b = 23; Char a1 = a.charAt (0); // A clear coding error UPDATE: This is what I have tried, thanks to Mohammed Adil's suggestions. int a = 12; Int b = 23; String first INT = ""; String secondin = ""; FirstInt = integer.tastin (A); SecondInt = integer.trusting (b); Int firstCharA = firstInt.charAt (0); Int secondCharA = First Inc. Chat (1); Int firstCharB = secondInt.charAt (0); Int secondCharB = Second Ink. Chat (1); Update: These are comparisons. if (firstly == firsthandharatakarta) first time == second charch || bcc secondhand == first warning ...

c# - Omit XML declaration? -

I have an XElement that I need to parse to remove white space in the closing tag. My code looks like this: var stringBuilder = new StringBuilder (); (Var String Vibrator = Using New String Vibrator) {xelement.Save (stringWriter); } StringBuilder.Replace ("/>", "/>"); Var xml = stringBuilder.ToString (); Actually, I am making a string manufacturer and am changing the unnecessary white space. The resulting string looks fine, in addition it contains the XML declaration. I know that on an XMLroller, I can leave the declaration with OmitXmlDeclaration , but StringWriter does not have this. Is there any way to do this, or do I need to do manually, understand the result from string resulting? For clarity, here & # 39; s before and after XML: // first & lt; Actionitem actiontaken = "none" target = "0" without target = "0"> & Lt; Airways & gt; Popup window & lt; / Windowname & gt; & Lt; Wind...

java - Android listview issues -

I am developing an Android application with my main activity, I will navigate to each other, Will show as. My problem lists a different adapter and lists the content in the list of contents. My other activities are xml: The activity is called: activity_doctor. Back code: increase the public activity of the public class {@Override protected void onCreate {Bundled savedinstenstate} {super.naught (the savedinstenstate); SetContentView (R.layout.activity_doctor); // Show button at the top of the action bar getActionBar () setDisplayHomeAsUpEnabled (true). ArrayList & LT; Doctor & gt; Docs = null; StrictMode.ThreadPolicy Policy = New StrictMode.ThreadPolicy.Builder (). PermitAll () Build (); StrictMode.setThreadPolicy (policy); Try {String Doctor = GetDoctorsFromServer (); Docs = Gate Doctor ListFrostler String (Doctor); } Grip (Exception E) {// TODO Auto generated blocking block e.printStackTrace (); } ListView myListView = New ListView (this); String [] docsair =...

install.packages - R-3.0.2- Win8-64bit: error with installing packages -

I have just started from R. I run a 64 bit Windows 8 machine. Here are the commands given to me. I have been issued and responses received by me: install.packages ("DMWR") Library () # to check that What DMWR was installed and it appears in the package in the library ## 'C: / Program Files / R / R-3.0.2 / Library' Library (DMWR) # Where is it that I get an error message: Load Error in namespace (j & lt; - i [[1L]], c (lib.loc, .libpaths ()), version check = vi [[ja]]): 'abind' Labor has no Package or namespace failed to load "Dimwaar ' I can how to fix it? Thanks for all! The steps given here are: Here are the steps: install.packages (' Abind '). Install.packages ('zoots') install.packages ('quantmod') install.packages ('ROCR') and finally: Pre> Library (DMWR) Thanks for James!

java - Using wildcard with Lists.partition and nested generic types -

I am using, though I have thought that this is a general question about generic in Java. I can do this: Public Zero to some (list & gt; DataBean & gt; ID) {list & lt; List & lt; DataBean & gt; & Gt; Lists = lists. Division (id, MAX_ITEMS); Why can not I do this? Public Nullification is an extension of some (list & lt;? Databane & gt; ID) {list & lt; List & lt;? Extension of Databen & gt; & Gt; Lists = lists. Division (id, MAX_ITEMS); I get the following compilation error: type mismatch: list & lt; List & lt; Can not convert from capture # 1? Extension of Databen & gt; & Gt; List & lt; List & lt;? Extension of Databen & gt; & Gt; You need to bind in such a way that it can be completed. Otherwise, ? List for ? is not related to id . You can declare a common method with a named parameter instead of the generic parameter with the wildcard: public & lt; T increases Databen ...

c++ - Rental car mileage overage calculation function -

I'm writing to try to create a mileage overage calculation function for a C ++ program I'm going to switch this function There is a problem in working properly within the statement. What I am trying to achieve (or calculate) amount of profit on the limit of carSize mileage * On rent day Double Calmiles (intimate, day, four carousges) (dual) So far my code is: MilesFee = 0; Double Compact Overage Charge = .05; Double midSizeOverageCharge = .07; Double Full Size Overage Charge = .09; Int compact delimilarity = 20; Int midSizeDailyMilesLimit = 25; Int fullSizeDailyMilesLimit = 30; Switch (carcases) {case 'C': case 'C': {while (mi and GT; compact delimited limit * days) {milesFee = (miles * day) / compact daily Mile limit; } If (milesoff> compact delimited limit) {milesFee = milesFee * Compact overage charge; Cout & lt; & Lt; "Overlays fees" and lieutenant; & Lt; Milfie & lt; & Lt; Endl; break; }} Case 'M': Case ...

objective c - Is it possible to override the style of all UIButtons text -

We are using a third-party SDK that creates popup UIViews (looks like social icon content). Button text IOS7 is blue, but we need to override them. I wonder if I have to go to the monkey patch SDK or I can override at another level? follow the following [[UIButton presence] setTitleColor: [UIColor purpleColor] forState: UIControlStateNormal]; In the - (BOOL) Application :( UIApplication *) Finnish Launching Option: (NSDictionary *) Launch Option and you'll change the color of all the buttons on the app. To read this article more selectively

php - mysql doesn't recognize text and number combinations -

इस सवाल का पहले से ही एक उत्तर है: 33 उत्तर मैंने एक साधारण उदाहरण लिखा है मेरी समस्या का नीचे: & lt; html & gt; & LT; बॉडी & gt; & Lt; form action = "test.php" विधि = "पोस्ट" & gt; & Lt; input type = "text" name = "refValue" & gt; & Lt; इनपुट प्रकार = "सबमिट करें" name = "go" & gt; & Lt; / प्रपत्र & gt; & Lt;? Php $ sql_connect = mysql_connect ("स्थानीयहोस्ट", "रूट", "रूट") या मर ("कोई कनेक्ट नहीं"); $ Sql_data = mysql_select_db ("सूरज", $ sql_connect) या मर ("कोई डेटाबेस नहीं"); $ RefVal = $ _POST ['refValue']; $ सपा = mysql_query ("चयन से डेटा जहां रेफरी ="। $ RefVal); जबकि ($ col = mysql_fetch_array ($ SP)) {गूंज $ col ['num']; }; ? & Gt; & Lt; / body & gt; & Lt; / html & gt; यह जो मेज से जुड़ता है वह मूल रूप से दो पंक्तियों के साथ दो कॉलम है और इस...

ios - Loading a nib file within a nib file -

Image
I have setup a nib file to include some basic UIView elements within a large UIView element, two elements UIImageView class There are sub-classes (user to display data to the meter) Anyway, in my mind, I want to make these meters as my nib file because they have a lot of visual elements and for their prudence it is personalized in their own Nib file By form I would also like to see a controller for meter and other basic elements in the original nib file. I have set up my custom class (called UMeters) as a child meter nib object in parent nibb. I am having difficulty loading the child in the original nibb, when I override the UIMeter initWithCoder method it creates an infinite loop because I am trying to use Loadnibamed to access the child nib file. I have also tried to load the nib from the original controller but loadnibamed it loads the baby both nib and nibb. It probably will understand more with code and images: The UIMeter code is not really sure that I also need it because ...

sql server - MS SQL Triggers used instead of Views -

This is my first question, please be diligent. In the company in which I currently work, we use MS SQL Server for database of financial products and everything that is connected with it and is a main application used by customers. Goes (within internal customers - company). The previous programmer has created the database in this way every single payment that matches one row in the table (since we have made different payments since different tables for that matter) is a trigger Which calculates the balance of the entire contract - which can sometimes end up to more than 60 seconds .... Usually it does not take more than 15, but still it looks silly (slow) is. To mention that the system is not a transaction ... nevertheless ... and possibly 15+ long transactions can not be done. I have proposed that all those triggers should be cut (only they should be left to take care of the historical tables) and should be done by all calculation scenes. Of course I can not even introduce...

windows - find_path doesn't work if environment variable has spaces -

I'm trying to automatically compile my cmake project, but if there's an empty space in my path, there are problems. Here's my command line (Windows Command Prompt) c: \ code \ codetrainerplugins-build> Type% CODETRAINER_PATH% \ include \ common \ exportapi.h #pragma Once ... the file has been found ... Here is my CMClists.txt file: CMAKE_MINIMUM_REQUIRED (code 2.6) project (codetrainer plugin) message ("$ ENV (CODETRAINER_PATH)" FIND_PATH (CODETRAINER_FRAMEWORK_PATH NAMES / Common / ExportApi.h PATHS ENV CODETRAINER_PATH) If (CODETRAINER_FRAMEWORK_PATH) message (STATUS "CodeTrainer Framework found: $ { CODETRAINER_FRAMEWORK_PATH} ") and () message (FATAL_ERROR" CodeTrainer Framework Not Found ") ADIF (ADD_SUBDIRECTORY) (ADD_SUBDIRECTORY) (test) Here is the output when CODETRAIN ER_PATH Include spaces (see space on the way): C: \ code \ codetrainerplugins- create & gt;% CODETRAINER_PATH% echo "C: \ Code Trainer...

jquery - arrange array in a "checkerboard" pattern based on type using javascript and/or underscore -

TWEET | INSTAGRAM INSTAGRAM | Tweet it TWEET | INSTAGRAM INSTAGRAM | Tweet The amount of tweets in the array is much higher than the amount of photos in the instma, but I have to make sure that regardless of the number of items in the feed, the results are optional in this fashion. How can I rearrange the array with the most efficient, as if I keep this method? I can only use JavaScript, jquery or underscores. To start, you must apply a couple of JS functions as follows: function getElements () {// can be implemented by you, gives an array} function element ItsTweet (elem) {// you have to implement, give a boolean} A few of the assumptions that were made here are that we leave processing after the tweets or the Instagram Programming is encouraged. It should also be noted that intermediate results are collected in the array. For larger sets, it is likely to be more efficient to track the number of indexes during the formation of the resulting array. Bu...

How to programmatically verify test has failed using TechTalk.SpecFlow and C#? -

I want to execute the [afterTestRun] attribute marked method after the exam [binding] Specialty Marked Classes How can I achieve something like this: Binding] the public class checker [[later testfile] // There is no such feature, DoStuff () {}} or [binding] public class tester [[post-test] public service Ethical Zero Dustf (If (Scenario Contact. Current. TestShaft) // No such property {// After reading some documents, I have found the next solution: }}} Public class checker [[later Sissenario] Public Zero Lakescreen () (if (Landscape contact. Current test error! = Null) {web browser. Tech screenshot (); // your custom browser scra Take the screenshot method}}}

c - Writing argv[] through write() -

Here's a bit of a problem. I am trying to write the data that the user has entered in argv [1] I have to use write () to complete it. int main (int argc, char * argv []) {write (1, "your file's name:", 15); Write (1, argv [1], 100); Return 0; } The above is my code I really want to know what it is to see whether it is possible to function with type 1 which connects the string and variables together. Even with the above ceremony, I get more when I run the order. For example, if I would have typed in Stakhwarflo is my output screen on argv [1] ... YourFileName: stackoverflowXDG_VTNR = 7SSH_AGENT_PID = 1733XDG_SESSION_ID = c2CLUTTER_IM_MODULE = ximSESSION = Ubuntu GPG_AGam @ am-GA -880GM-UD2H: ~ $ it should not only display your files: stack overflow You need to create some code of string.h For example, strlen will resolve their issues over printing desired: write (1, argv [1], Streln (Argv [1])); Because it is so problem argv [1] espec...

php - Simple HTML Dom - find text between divs -

I need to draw the text between divs ("third of all ...") - use of simple HTML domains Do PHP library What I am thinking, I have tried! next_sibling () returns the comment, and next_sibling () -> gt; Next_sabilling () tags, ideally I will be at the end of the first comment and next Div class = "left" & gt; Bla-bla .. & lt; Div class = "float" & gt; Blah blah ... ... & lt; / Div & gt; & Lt ;! - End of div.float - & gt; & Lt; Br / & gt; Third of four demonstrations in the Morning Melinda series of the Society ... & lt; A href = 'index.php? Page = ticket & month = 20140201 '& gt; & Amp; Amp; Lt; & Amp; the lift; Go back to the full event list & lt; / A & gt; & Lt; / Div & gt; & Lt ;! - / end div.left - & gt; print it down and - comment tag // move a class float Accompanies the div. There is a comment between $ div_float = $ html- & gt; Se...

MongoDB database schema design advice (sharing) -

I am trying to create a media-oriented API with nodes .JS and MongoDB. The main part of the app is the media unit. You can share the media unit with users, events, etc. The schema is as follows: created: '12 January 2014 ', Title:' New Book ', Description:' This is a [drama, 'new'], Event: [123] ',' 234 '], Users: [' 123 ',' 234 '],' New Book ', File Type: 1, Size: 230, Categories: [' Horror ',' Romantic '], Tags: [' 111 ',' 222 '], Type: 1, Producer:' John Gallagher ', Yuri:' http://test.com/book.pdf ' Operations: Media A is shared with user B, C I'm trying to get the media to get an event D, E Added in the query: Show all the media which is shared with user B Db.media.find ({ User: '111'}) Show all media within the eventD db.media.find ({Event: '234'}) I am not sure how to approach this problem. Is this an appropriate a...

c# - Parent child loop, design pattern -

Assume that I have two squares (using C #). Class A and B can be converted into Class AB. B is the parent (type B) of a property in class. I have an example which I can call list & lt; B & gt; wants to change to a list & lt; A & gt; In Class A, there is information to know which parent is the example of B. Suppose I have a loop trough my list & lt; A & gt; to change it for (int i = 0; i The method ConvertToB creates a b example and if the parent is already in, then listOfB searches. So we say that our convertor tab looks like this: Public B ConvertTob (AA, List & Lt; B & gt; listOfB) {B newInstanceOfB = A to B; Bipart = List of B First and default (x = & gt; x.Id == a.ParentId); } If this has not been converted yet, then this code will be incorrect. If we change the listofA [1] then F.X, this will be the list of related parents B [6] We will not be available at the time when we want to change the listofA [1]. My question...

c# StringReader, XmlReader, XSLT - Unexpected XML Declaration -

After I can read XML from a string and this function has been used to apply an XSLT style sheet; Working very well for a small part of XML: Private Static String TransformXML (string XML, string XSLT) {string output = String.Empty; (Using XmlReader XRT = XmlReader.Create (SRT)) using (StringReader srt = New StringReader (XSLT)) {{StringReader Mr. = New StringReader (XML)) {XmlReader XRI = XmlReader.Create (Mr.)) {XslCompiledTransform xslt = New XslCompiledTransform (); Xslt.load (XRT); Using StringWriter sw = new StringWriter ()) (XmlWriter xwo = XmlWriter.Create (sw, xslt.OutputSettings)) // Using XSL OutputSettings, then this HTML {xslt.Transform (XRI, xwo) Can be produced as; Output = sw.ToString (); }}} Return output; } However, with a large part of XML, I am getting errors, even if I know that it is formatted correctly. Here is an example error: the unexpected end of the file while parsing the name. Line 1, position 30001. My guess is there is a limit on buffering, b...

Excel VBA - Use an existing string in called sub -

I already ask for so much apologies I am halfway through a userform and in Excel I'm trying to make some big cuts with my code using the call - I have 12 buttons which all do the same thing, the only difference is that each button is subtly dependent on the sub-button caption is . My problem is that I do not already understand a way to use the string declared in the button sub, then use it in the sub-sub I know that you can do this, but my Google skills do not fail me ( Can anyone show me how to do this? Hopefully everyone understands ... My code has a very small snippet , But you get jist: public subcommand Tone 4_click () String name as the dim name = CommandButton4. Caption call sort 1 and all` and another (tried to do it as a function for testing and error ) Public Sub-order 1 (name as string) Label11 caption = name sheet (name). You are passing an argument for the other substrin or function. First of a string There is a sample of: - function ...

How can I store private posts and likes on Android? -

I will create an Android app where users can login with Facebook or Twitter (with no problem with it) and then they Login (with Facebook or Twitter) Show all posts to all friends who have number of likes next to each post Text form Where they can write their posts and Can be photographed. People who log in, they can only like one and can see how many likes are stored in it. The important thing is that posts and likes should not be shown to everyone in Facebook Diary or Twitter account, but only for my app's users. I can say that I just want to create a little personal social network with posts (with likes and comments). Can anyone help me? I do not know how to store all the posts and like "Live" ...

python - pandas dtype conversion from object to string -

I have a CSV file containing some columns which are numbers and some strings are I when I myDF.dtypes then shows me all the string columns as object . Someone asked a related question about why this is done. Is it possible to reinclude the string from the dtype object? Also, in general, there is an easy way to reuse dtype to int64 and Float64 to int32 and float32 and save data size (in memory / disk)? All strings are variable-length (which is the object is dtype). You can series.astype ('S32') if you want; But if you store it in a datafile or do a lot with it, then it will be done again for simplicity. Some serial formats, e.g. HDFStore however stores the wire on the disk as a fixed-length string. You can series.astype (int32) if you want and store it as a new type.

javascript - How can I make a box automatically move down? -

यूआरएल : मुद्दा : यह पोस्ट ड्रॉप डाउन बॉक्सेज के बारे में है, वे वर्तमान में जगह तय हो गई हैं। मुझे यह पसंद है, इसलिए वे एक-दूसरे के नीचे सीधे होते हैं, और फिर जब आप एक दूसरे पर विस्तार करते हैं तो नीचे धक्का दिया जाता है मैं यह कैसे करूँगा? सेटअप : प्रत्येक बॉक्स इसकी खुद की डिवा है (बॉक्स 6 से बॉक्स 6 तक), और यह दो डिवा (शीर्ष और नीचे में है सीएसएस : यह मैं इस्तेमाल किया सीएसएस है: मैं काफी कुछ एक रास्ता होना चाहिए इसे कम कोड के साथ भी करने के लिए। लेकिन वैसे भी मैं इसे अधिक होने के बारे में अधिक चिंतित हूँ ताकि बॉक्स के विस्तार के नीचे नीचे दिए गए बॉक्स नीचे हो जाएं। सवाल में कोड "/ * ABOUT / /" के अधीन है, इसलिए यदि आप खोजते हैं कि यह आना चाहिए > क्या आप एक एम्परेन्टियन की तरह कुछ सोच रहे हैं? HTML & lt; div id = "accordion" & gt; & lt; h3 & gt; 1,000 अनुयायियों - $ 4.99 & lt ; / H3 & gt; & lt; div & gt; & lt; div & gt; & lt; img src = 'http: //www.ibcs-software.com/images/tick.png...

swi Prolog - Error arguments not sufficiently Instantiated -

I'm new to Prolog and when I query sortedUnion ([1,1,1,2,3, 4, 4,5], [0,1,3,3,6,7], [0,1,2,3,4,5,6,7]). I get an error Exception: (7) Unify ([_G114, _G162, _G201, _G231, _G243], [_G249, _G297, _G336, _G357, _G369] ], [0, 1, 2, 3, 4, 5, 6, 7])? So I hope someone can tell me why my code is wrong and why is it wrong? % undup (L, U) keeps properly when the UL can be obtained, destroy the repeating components of the same element ([], []). UPDATE ([x | xs], [_ | B]): - Remove (x, x, k), apu (k, b). remove(_,[],[]). Remove (Y, [Y | T], D): - Remove (Y, T, D). Remove (Y, [S | T], [SR]): - No (Y = S), Remove (Y, T, R). % Holds SortedUnion (L1, L2, U), when U is an example of each element of L1 and L2 sortidunes ([H.T.T], [SR], [F | B]): [H. T.], N.), Apup ([SR], M), united (N, M, [F | B]). Unite ([], [], [] unite ([X], [], [X]) unify ([], [X], [X] unify ([H.T.T], [ SR], [X | Ax]]: - S = H, X, is united (T, R, XS). Unite ([H. T], [SR], [X | Ax]]: - H & LT; S, X is H, united...

css float - Ruby-on-rails trying to get text and link_to on the same screen line -

Ruby on the rail - One page (view) displays how trying is to change. Float to display an index page with an image as well as an image I am currently using. I want the text (Markdown Post.audi) to see below below ... after "more" (where there is more one underlined link). Currently "more" appears on a new line. I'm getting ... "compiled javascript code.The second command is" run ", which compiles the code in your editor and evaluates javascript that shows the result of your ... more " what do i want ..." compiled javascript code. The second command is "run", which compiles the code to evaluate your editor and javascript Results show ... more " I have an App / View / Po St / index & lt; Div class = "article-face-img" & gt; & Lt;% face_image = article_face_image Post% & gt; & Lt;% = image = image_tag Face_Shapes, Size: "260x205", Category: "Article-Face-IMG"%...

parsing - Confused about std.xml - how do I read attributes? -

I have thrown together an XML control file for a command-line tool, which I use to manage my compiler My goal is to use this XML file to basically use a code like compile d -release foo.d to open it, process it to create Dmd -m64 -O -inline -release - Noboundscheck foo.d and execute it. I've redesigned the XML file here for clarity: & lt; Compilers & gt; & Lt; Compiler id = "d" & gt; & Lt; Command & gt; "Dmd -m64" & lt; / Command & gt; & Lt; Mode & gt; & Lt; Mode id = "- debug" & gt; "- debug-unit-w -de" & lt; / Mode & gt; & Lt; Mode id = "- release" & gt; "-Olline -Release -Nobbed Check" & lt; / Mode & gt; & Lt; / Mode & gt; & Lt; / Compiler & gt; & Lt; Compiler id = "java" & gt; & Lt; Order & gt; "Javac" & lt; / Order & gt; & Lt; Mode & gt; & Lt; Mode id = "- debu...

node.js - Trying to plug in another provider to Passport and its complaining of strategy not found -

I am using mean.io and I basically change any mention of a geethb passport strategy with another strategy The one who uses it passport, passport fit, what I can see should work outside of the box - to do this. However, when I click on the sign with the button in the audio demo app, I get the following error: Error: Anyone under the name Strategy is not registered: FBIT (/project/node_modules/passport/lib/passport/middleules/authenticate.jshew 37:37) on passport. Authentication (/ project / node_module /passport/lib/passport/middleware/authenticate.js/744:7) on callback (/project/node_modules/express/lib/router/index.js:164:37) Ultimate (/ Project / Node_module / express / lib) on /router/index.js:138:11) on the router. (/project/node_modules/express/lib/router/index.js:145)) router. Object on _dispatch (/ project / node_module / express / lib / router / index.js: 173: 5) Project on Stroke (/project/node_modules/express/lib/router/index.js:33:10) on next (/project/node_modules/...

ruby - Rails: refactoring chained where clauses -

What is the best practice to write something like this? I find it way too cumbersome: def filtered_components (template) components.joins (: template). Where (templates: {id: template.id}). (Where state: 'work'). Where (['fake_created_at'; time ']', time.New]). Order ('Created DASC') End There will be a better way, right? Thank you. Use the boxes that meet the majority of ActiveRecord . For anything complex, you are going to end up with too many filter chaining. Where combined to complexity def filtered_components (template) components.joins (: template) where little to little where combined. ["Template_id =? AND state =? And fake_created_at In addition, depending on your situation, you may not need template_id your where section if you type : template on : If you are joining the component , ActiveRecord will translate it: "template" on "INNER JOIN" templates ".component_id =" components ...

java - Null Pointer Exception Error on a Constructor -

तो मेरे पास एक कन्स्ट्रक्टर है जो पेंडेमिक मोडेल को दूसरी ग्रिड की प्रतिलिपि बनाता है जिसे इस .grid कहते हैं। मुझे java.lang.NullPointerException और एक अन्य त्रुटि यह कहने में एक त्रुटि है कि जब मैं ग्रहण पर त्रुटि को क्लिक करता हूं तो यह मेरे आखिरी कथन को नेस्टेड लूप पर हाइलाइट करता है। मुझे नहीं पता कि समस्या कैसे ठीक करें किसी भी विचार? / ** * प्रतिलिपि कन्स्ट्रक्टर * यह माना जाता है कि अन्य नल नहीं है और यह कि यह मस्तिष्कमॉडल * अन्य की एक गहरी प्रति है (यानी, अन्य। ग्रिड को एक नए में कॉपी किया गया है * 2-मंद सरणी इस। ग्रिड) * @ परम अन्य महामारी मोडेल जो प्रतिलिपि बनाई गई है * / सार्वजनिक महामारी मोडेल (अन्य महामारी मण्डल) {this.rows = other.rows; This.column = other.column; के लिए (int i = 0; i & lt; अन्य। आरओ; i ++) {के लिए (इंट जे = 0; जे एंड एलटी; अन्य.columns; j ++) {this.grid [i] [जे] = अन्य। ग्रिड [आई] [जे ]; मैं जानता हूं कि जावा शैतान का मतलब था, आप अपना आरंभ नहीं कर रहे हैं। ग्रिड ऑब्जेक्ट। आपका कोड शायद इस तरह दिखना चाहिए: सार्वजनिक मण्डलीमॉडेल (अन्य महामा...

Crawl to final URL from within Excel VBA -

I have a list of domain names, and many of them have been redirected to the same domain. For example ... foo1.com, foo2.csm and foo3.com do all I collect at foo.com. I am trying to duplicate the list of domains by writing a VBA script to load the final page and remove it from the URL. I started with this article which retrieves the title of the page, but how to modify it to get the final URL (from which I am url. Can someone point me in the right direction? Add "Microsoft XML, v3.0" (or Reference to any version you have) sub-tester () debug.print check redirect ("adhpn2.com") end subfinction check reday If not (like URL string), "http: // *" like URL, "url =" http: // "and urls with new MSXML 2. SRACXHHTP 40. Open" Head ", URL, Failure check = reset. Reset end with end function

html - Internal path versus http paths -

For example, you have the following paths on the website: / site / Resource / IMG / Large Image JPG Now you say that you have changed that path with the following path: http: //www.mydomain/site/ resources / img / Bigger image JPG Is there any difference (and means my performance) and how many images are there to slow down the site? Look for full coverage of these topics, and relative URLs of best practices Recommendation - i.e. /site/resources/img/bigImage.jpg edit : Here is the relative versus URL question, which makes a good point Is: You will see a decrease in the file size with a relative URL. Unless you are looking at a large number of images, it probably will not be a big difference, but when it comes to file size, then small is better.

osx - Custom-drawn NSView Redraws Whole View Inside Edited Subviews -

Image
I have an NSView that is displaying a custom background with an image, but whenever I press a button Or edit the labels in the program, it seems that the image of the background pulls it back into the edited sub-view. I have found that by solving the issue by creating the scene layer in the IB, but in the larger app I am making, the cause of the scene layer backup causes many other issues. I have made it, for example, to clearly show the app clearly what is happening. There is another image after pressing the button, which edits the labels text programmatically, it seems as if the background image starts at the top of the button and is coming around both the buttons and the label. This view is being made like this: - (zero) direct: (NSRctact) Gandrecht {{[Nsimage image nominated: @ "Redgreengridged.png" ] Draw Incente: From the dungeon: NSGroRyct Operation: NSCMopozetosSourceAppear: 1]; } Before editing: after editing: Is there a scene that I can d...

Display PHP errors -

इस सवाल का पहले से ही एक उत्तर है: 21 उत्तर मुझे होस्ट करने में समस्या है और होस्टिंग इस के साथ मेरी मदद करना नहीं चाहता है मैं विकास के लिए php त्रुटियाँ दिखाना चाहता हूं, लेकिन जब पृष्ठ पर एक त्रुटि होती है तो मैं केवल रिक्त पृष्ठ देखता हूं मैं .htaccees का उपयोग नहीं कर सकता क्योंकि सर्वर एपीआई सीजीआई / फास्टसीजीआई और php.ini काम नहीं करता है। मैंने कोशिश की यह php.ini में है। अभी भी एक रिक्त पृष्ठ काम नहीं किया, और मैं उद्देश्य पर php वाक्यविन्यास में एक त्रुटि बना। display_errors = on display_startup_errors = पर इस पृष्ठ पर मेरे पास भी है: error_reporting (E_ALL); संपादित करें: मारियो द्वारा हल किया, मैंने php.ini को .user.ini में बदल दिया और यह काम किया। कोशिश करें ini_set ('display_errors', '1'); आपकी PHP फ़ाइल में स्रोत:

algorithm - Solving runtime of T(n) = n^(1/2)T(n^(1/2)) + n -

I am trying to find the recursion order of the following: T ) = N ^ (1/2) T (N ^ (1/2)) + n But I can not find the zodiac or even an equation that (N) Does anyone have to help me with the equation for the recap of the conference? t (n) = n ^ (1/2) t (n ^ (1 / 2) + n = n ^ (1/2) [n ^ (1/2 ^ 2) t (n ^ (1/2 ^ 2) + n ^ (1/2)] + n = n ^ (3 / 2 ^ 2) T (n ^ (1/2 ^ 2) + 2n = n ^ (3/2 ^ 2) [n ^ 1/2 ^ 3 t (n ^ (1/2 ^ 3) + n ^ (1/2 ^ 3)] + 2n = and so on n ^ (1/2 ^ k) = 2 1/2 ^ k logn = 1 logn = 2k log logn = k = n ^ (1-1 / 2 ^ K) T (n ^ (1/2 ^ k) + cube = n / n (1/2 ^ k) t (2) + cube = n / 2 * 2 + nloglogn = n + nloglogn = o (nloglogn )

python - Opening multiple links in default browser as tabs, why do I get multiple windows? -

I have just created a simple script that links to a hand-typed list opens in the default browser. It succeeds in opening pages, but often spreads to all pages by opening two or three windows. Web Browser New = 2 DRF Open_page (URL) Import: Webbrozer.Open (URL, new = new) DRF file_LAN (FNA): Open with FNA (FNA): For I, calculate in L (F) : Open return with i + 1 line_len = file_len ('social.txt') as the open ('social.txt') f: content1 = f.readlines () in the range I (line_len): Url = content1 [i ] .rstrip () open_page (url) print url This is dependent on your browser As a documentation for: If New 2, then a new browser page ("tab") is opened. So, why can not it be possible? There are at least two reasons, and perhaps more: When you call webbrowser.open> second time, it is still open the first window Is not ready. Therefore, when he tries to create a new tab in the current window, then is is not a current window, so it creates a new ...

html - Stop Menu from Shifting -

I created a menu but due to some reason drops on the left side of the menu when the browser is resized and if this happens, Does the range disappear? Is there any way to prevent it from happening and until it reaches a certain size, can the whole menu be scaled? Our My CSS: @Churset "UTF-8"; / * Main CSS Document * / #parent {padding: 0px, auto; Width: 50%; Minimum-width: 50%; Height: 50px; Margin top: 3%; Margin-left: 25%; Margin-right: 15%; Background: #FFF; Border bottom: thin groove # 000; } # Child-left {float: left; Padding-left: 25px; Width: 35%; Minimum-width: 35%; Height: 50px; Background: #FFF; } # Child-right {padding-top: 15px; Paddle-right: 20px; float right; Width: 60%; Minimum-width: 60%; Height: 35px; Background: #FFF; } #logger {padding: 0px, auto; Width: 100%; Height: 50px; Margin-left: 15%; Margin-right: 15%; Background: #FFF; } # Menu {float: true; Paddle-right: 7%; Font-family: "courier new", courier, monospace; Font-size: 18px; Font-we...

JavaScript - How to add links to the DOM -

I'm new to javascript, so this question might be easy for you: I 'DOM Trying to add an additional URL link, but my current code is not working. In my mind, my code should work perfectly, but the code should think itself otherwise. // Additional URL link which will come under the first one // establish a connection in the DOM var target = Document.getElementsByTagName ("A"); // We need to create new element var newLink = document.createElement ("a"); // Our new "A" tag has been created, but we have to add some things to NewLink.setAttribute ("href", "http://www.ign.com/"); // Now we need to add some text to the new user, click the new "A" element newLink.appendChild (document.createTextNode ("click me!");); // Finally, add a new element and we have golden goals .appendChild (newLink); change target.appendChild (newLink); to target [0] .appendChild (newLink); "target" an array a...

python 2.7 - LCS algorithm in dot plot -

I hope someone can help me, I just can not get my program running The LCS (the longest normal substring) matrix (and later the longest is trying to find the normal substring). I can not get the dot plot together. I'm trying to add it to my empty matrix but it does not work. What am I doing wrong? def compute_lcs (seq_A, seq_B): longest = 0 DotPlot = [] m = len (seq_A) n = len (seq_B) limit line (1, M + 1): # Dotplet to call in range (1, N + 1): temp_row = [] if Siisi_a [line] == Sisibiac [Cola]: If line == 0 or call == 0: Dotplot [line-Cola] = 1 temp_row.append (DotPlot [row, cola]) and: dotplot [row, cola] = dotplot [row-1, cola -1] + 1 temp_row.append (DotPlot [row, cola]) and: dotplot [row, Cola] = 0 temporary_property (dotplot [row, cola]) dot Slat back thanks!

email - Save X-Cart cart -

So what I need is to save the X-Cart cart somehow, and basically this cart is not in cookies but Save on Server Side Sessions, but the database, so that a customer filled out the checkout form, but never checkedout, then email the user something like, "Have you forgotten to pay?" or something else. I hope what you say to me. Take a look at this. It is not free, but like any other extant module, you can download it for free. XD

php - NetBeans Code Completion on Doctrine 2 Entities? -

What principle is there any way to complete the Netbeans code on 2 entities? I have a simple unit created with some protected variables and public methods. I create unit manager in my bootstrap.fp file like this: $ em = EntityManager :: create ($ Conn, $ config); I use my theory unit like this: $ myObject = $ em- & gt; GetRepository ('Institutions MyObject') - & gt; FindOneById (1); The real code works fine The problem is that NetBusiness is not fulfilling the code on MyObject's methods or properties. How do I enable it? Netbeans code in your code sample is not able to complete the complete code, because of the combination with the parameter Using the method getRepository (), the netbeans must compile the function getRepository () to check the type of return. A solution for that variable is to use type hinting: public function x () {/ * @ $ MyObject MyObjectType * / $ myObject = $ Em- & gt; GetRepository ('Institutions MyObject'...

C Program to display the highest and lowest entered numbers. Programming Beginner -

I'm taking a C programming class in this semester and I do not have any programming experience, this made it very difficult for me. Has been done for assignment or study. The assignment is to write a program that will allow the user to input any values ​​and display the largest and lowest values ​​inputed. He will have to accept positive and negative numbers and entering 0 will end the program. If the first number entered is 0, then a message stating that should be displayed. It may be a lot of laughter for some of you, but I have it here. #include & lt; Stdio.h & gt; Int main (zero) {float max = 0, a; Float min = 0, b; Printf ("entering 0 will end the sequence of input values. \ N"); Do {printf ("Enter Number:"); If (a & gt; min) {a = min;}}} (while one (=! =) 1); {If (a & lt; max) {a = max;} 0); Printf ("Your largest number was% .3f. Your smallest number was% .3f", max, minimum); Return 0; } Also, any of you can reco...

ios - Inject dynamic library into enterprise app (ipa) -

I want to inject my library to an existing enterprise app (IPA file). I got mach_inject, but only for MacOSX. It's possible to do this because it is possible. Please help any thoughts, suggestions will be really helpful. It is not clear what you want to do but mach_inject uses mock ports with the Mac OS kernel One way to interact with user apps is not relevant at all for the IPA, which is essentially a collection - like Zip or Terra. I suspect that you are describing that you have a library that you want to include / include the links in the user app but you do not want them to see your source code and vice versa. Give. I am not familiar with motana but use the IPA for distribution on the basis of what you have described, which is completely possible, but it is using a precompiled object module which will be distributed in the Facebook SDK is.

c - Passing array (member of a struct) to function -

इस सवाल का पहले से ही एक उत्तर है: 3 जवाब मैं पास करने का प्रयास कर रहा हूं, संदर्भ के अनुसार, एक समारोह में वर्णों की 1-डी सरणी। यहां प्रासंगिक कोड है: शून्य फ़ंक्शन 1 (); शून्य फ़ंक्शन 2 (संरचना टेम्पलेट *); संरचना टेम्पलेट {चार सरणी [11]; }; Function1 () {struct टेम्पलेट myStruct = {0}; // समारोह 2 आरंभ (& amp; myStruct); } फ़ंक्शन 2 (स्ट्रक्चर टेम्पलेट * myStruct) {शून्य लिखतअरेरे (चार सरणी [11]); // स्थानीय रूप से एक फ़ंक्शन लिखने की घोषणा कर रहा हैतोअरे (myStruct- & gt; सरणी); } शून्य लिखतअरेरे (चार सरणी [11]) {/ *** सामान ****}} अब, जब इस कोड को डीबग करना, मुझे एक अप्रत्याशित परिणाम मिलता है। एक बार मैंने लिखने के लिए प्रवेश किया है (), मैं कॉल p sizeof (array) जो रिटर्न 4. क्या 11 का मूल्य वापस नहीं किया जाना चाहिए? मुझे पता है कि सभी चर के लिए "sizeof" संकलित समय पर संकलित किया जाता है। तो कंपाइलर लिखने के लिए "चार सरणी [11]" को लिखने के लिए क्यों है? जब आप कोई फंक्शन में एक तर्क के रूप में एक सरणी पास करते हैं, तो स...

how to add class in 4th li using jquery -

I'm enjoying Jquery , but I only have basic knowledge How to use jquery in code in its 4 li . & lt; Ul id = "item" & gt; & Lt; Li & gt; Sample & lt; / Li & gt; & Lt; Li & gt; Sample & lt; / Li & gt; & Lt; Li & gt; Sample & lt; / Li & gt; & Lt; Li & gt; Sample & lt; / Li & gt; & Lt; Li & gt; Sample & lt; / Li & gt; & Lt; Li & gt; Sample & lt; / Li & gt; & Lt; / Ul & gt; Thank you in advance ... Hope this makes sense. $ (" #team "). Eq (3) .addClass ("your-class"); More info: Demo:

How to refer my own environment variables in NDK(Android.mk) -

I have a problem. I have my own environment variable (example: MY_HOME). And I want to use it in my Android.mk so I have tried the following, MY_DIR: = $ (MY_HOME) ... LOCAL_SRC_FILES: $ $ (MY_DIR) /sources/test.cpp But there is no material in MY_DIR for compiling, I mean $ (MY_DIR) returns blank (""). Android.mk

java - Class not found Exception:com.mysql.jdbc.Driver (RMI program not working) -

फ़ाइल : SelectServerIntf.java : आयात करें java.rmi। ​​*; Import java.util। *; सार्वजनिक इंटरफेस का चयन करेंसर्वरइन्टेफ़ दूरस्थ {हैशमैप निष्पादित करें () चयन करता है RemoteException फेंकता है; } फ़ाइल : SelectServerImpl.java : आयात करें java.rmi। ​​*; आयात java.sql। *; Import java.rmi.server। *; Import java.util। *; सार्वजनिक श्रेणी का चयनसर्वरइंपल यूनिकस्टरेमोटऑब्जेक्ट का विस्तार करता है SelectServerIntf {सार्वजनिक SelectServerImpl () फेंकता है RemoteException {} सार्वजनिक हैशमैप निष्पादित करें () फेंकता है दूरस्थ एक्सपेशेशन {स्ट्रिंग ड्रायवर = "com.mysql.jdbc.Driver"; स्ट्रिंग यूआरएल = "jdbc: mysql: // स्थानीयहोस्ट: 3306 / एबीसी 2"; स्ट्रिंग क्वेरी = "छात्र से * चुनें '"; कनेक्शन con = नल; वक्तव्य stat = नल; हैशमैप एचएम = नल; {Class.forName (DRIVER) प्रयास करें; } पकड़ (क्लासनोटफौन्डएक्सेशन सीएन) {System.out.println ("क्लासनोटफ़ाउंड" + सीएन); } {Con = DriverManager.getConnection (url, "root", "root") का प...

random - nested loop, how to end loop and how to get loop to continue to cycle? java, eclipse -

My program will not do that I need it and I got stuck on this issue for six hours. It indicates to the user how many times they want to toss a coin, according to the program, how many heads and tails were thrown, and with the total head and tail as well as the percent which had been rolled into the head, my problem is That it goes through for the first time once the loop ends it just stops and the user does not indicate any other number to choose or leave the program For the sector and press 0 to return to the main menu, I can how to fix it myself? Apart from this, how can I get the option of returning to the second loop? I have tried the break method and it does not work for me. I do not know if I'm actually lost. How can I make it, this loop continues to toss the coin and still ask users how often they want to toss. While at the same time pressing Just 0 and allowing it to exit the loop to return to the main menu? I did not post that code here, but it is a little loop with va...

ruby on rails - edgeguides code - confused about a particular error -

ठीक है ... & lt;% = form_for: आलेख, url: articles_path do | | f & Gt%; & Lt;% if @ article.errors.any? & Gt%; & Lt; div id = "error_explanation" & gt; & Lt; h2 & gt; & lt;% = बहुवचन (@ article.errors.count, "त्रुटि")% & gt; इस आलेख को सहेजने से प्रतिबंधित किया गया: & lt; / h2 & gt; & LT; ul & gt; & Lt;% @ article.errors.full_messages.each do | msg | | & Gt%; & Lt; li & gt; & lt;% = msg% & gt; & lt; / li & gt; & Lt;% end% & gt; & Lt; / ul & gt; & Lt; / div & gt; & Lt;% end% & gt; & Lt; p & gt; & Lt;% = f.label: शीर्षक% & gt; & lt; br & gt; & Lt;% = f.text_field: शीर्षक% & gt; & Lt; / p & gt; & Lt; p & gt; & Lt;% = f.label: टेक्स्ट% & gt; & lt; br & gt; & Lt;% = f.text_area: टेक्स्ट% & gt; & Lt; / p & gt; & Lt; p & gt; & Lt;% = f.submit% & gt; &...

c++ - Unknown code showing in GDB step through -

I was running GDB and while keeping a step through some simple C ++ code, it displayed the code below Started doing. Does anyone have any clue as to this code? _Unwind_SjLj_Register (fc = 0x28feac) ../../../../src/gcc-4.6.1/libgcc/ ../gcc/unwind-sjlj.c:126 126. ./../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c: There is no such file or directory in ../../../. ./src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c (gdb) in step 128 ../../../ ../src/gcc-4.6.1/libgcc/ ../gcc/unwind-sjlj.c (gdb) in Phase 131 ../../../../src/gcc-4.6.1/libgcc/ ./gcc/unwind-sjlj.c (gdb) In step 133 ../../../../src/gcc-4.6.1/libgcc/../gcc/unwind-sjlj.c (does not know that this is the exact version you are using, but should be enough to get it): // / / Exception holds that the name of each function called at the beginning // Exports Zero _Unwind_SjLj_Register (struct _Unwind_FunctionContext * FC) {FC- & gt; Prev = __Unwind_SjLj_GetTopOfFunctionStack (); __Unwind_SjLj_SetTopOfFunctionStack (FC); } G...

php - Insert into Database when ID/name is used multiple times -

मेरे पास यह तालिका है: foreach (// conditionals) {& lt; td id = "changeStatus" & gt; & Lt; input type = "text" name = "rcStatus" मान = "" / & gt; & Lt; / टीडी & gt; } & lt; td & gt; s रिक्त हैं, और जब मैं हर एक पर क्लिक करता हूं, सेल का बीजीएलर बदलता है, और आरसीस्टैटस । मैं इस कोड का उपयोग कर रहा हूं: & lt; स्क्रिप्ट & gt; $ ('# Table #changeStatus') क्लिक करें (फ़ंक्शन () {var सेल = $ (यह); राज्य = सेलडेटा ('राज्य') || 'पहले'; स्विच (राज्य) {मामला 'पहले': Cell.adClass ('red'); सेलडेटा ('राज्य', 'दूसरा'); यह। GetElementsByTagName ('इनपुट') [0] .value = "miss"; break; // अन्य मामलों यहां}}) ; & Lt; / स्क्रिप्ट & gt; मेरी समस्या अब यह है कि मुझे अपने डेटाबेस में rcStatus के मान को संग्रहित करने की आवश्यकता है क्या होता है कि मैं केवल सबसे हाल ही में सेट rcStatus को स्टोर करने में सक्षम हूं। मैं PHP का उप...

java - dateadd function is not working in Hibbernate -

I want to get data from my database in the past day and for this, I added a DATE_ADD function Is using mysql database in my hibernate query, but I am having an error running the query and here is the query: Select the column name from tabname, where column name = DATE_ADD ( Day, -1, receptive) Call the function Sir If your function is a string or varchar value . session.createSQLQuery (select "my_fn: param1)") Where my_fn parameter param1 Is the name of your function with.

visual studio 2012 - Is there any possible way to keep comments at a single place if it is repetitive? -

I do not know, but there is a possible way to comment on one place in a studio? Or in some comments it is like creating a link and if we click on that link and this comment jumps to the bunch of code, we can write that link where to write that bunch of code Necessary . So no repetitive comments are written. The C # compiler allows you to reference an external XML file in which the actual one Comments To do this, you must include & lt; Include & gt; Use element /// & lt; Include file = 'file.doc' path = 'parent / hair [@ name = "member"] / *' / & gt; The contents of file.doc need to be an XML file and for that method the comment should be on the path stated in the XML code path element & lt; Guardian & gt; & Lt; Hair name = "member" & gt; & Lt; Summary & gt; Original comment & lt; / Summary & gt; & Lt; / Child & gt; & Lt; / Parent & gt; More information is av...

ios - How to create flow view layout in iphone -

I have successfully applied the coverflow view in my page. However, as you can see in the attached image from SnapGuide , Does not start from the visual center, but with extreme authority. I tried to do this by creating the first view as an index of 0 with a transparent background. When I keep scrolling sideways, it works fine. However, while scrolling backwards, the index seemed to override each other. Example: Index of 0 will overlap the index of 0. I do not know why this is happening. Is there an alternative way that SnapGuide would have implemented it, which I do not remember?