Posts

Showing posts from June, 2012

bash - Extracting last 10 lines of a file that match "foo" -

I want to write the last ten lines which contain a special word such as a new text file example in the "foo" file The name for boo.txt . How can I get it at the command prompt of Unix Terminal? You grep and tail : grep can use "foo" input .txt | Tail-N10 & gt; The default number of lines printed by Boo.txt tail is 10, so you can skip the -n 10 section if you Always want that many. & gt; redirection will make boo.txt if it does not exist. If it was present before it was running, the file would be truncated (i.e. empty) first. Then in either case, there should be up to 10 rows of text in boo.txt . If you want to add boo.txt , then you should change & gt; & Gt; . Redirect to using "grep" bar "input.txt. Tail-4 42 & gt; & Gt; Boo.txt If you are looking for the first version of the string, then there may be interest in head .

javascript - storing document in a variable -

I wonder if I store the document in a variable whether there will be a speed increase, so if I have var doc = document; MyElement = doc.getElementById ('Some Thing'); I know in this example that it will not be very different, but my thinking is that my variable will act as a "pointer" in the form of a document and hence the M script No need to try and see the document back. Document is a global object in context of another variable and then document instead of document How fast can it be? This is a vertical question :)

java - Android: ExpandableListView and context menus -

मैं ExpandableListView का उपयोग कर एक ऐप लिख रहा हूं। मैं बेसएक्सपैन्डेबल लिस्टएडएप्टर को मेरे विस्तारयोग्य लिस्टव्यू पर डेटा प्रदान करने के लिए फिर मैं इस दृश्य पर संदर्भ मेनू जोड़ने का प्रयास करता हूं, लेकिन इन मेनू को समूह के लिए अलग से अलग होना चाहिए विस्तार योग्य सूची इसलिए मेरे एडाप्टर के getChildView और getGroupView में मैं setOnCreateContextMenuListener को इस तरह कॉल करता हूं: TextView textView = नया TextView ( TestActivity.this) ;; TextView.setText (getChild (ग्रुपपोजिशन, चाइल्ड पॉज़िशन) .toString ()); TextView.setOnCreateContextMenuListener (नया View.OnCreateContextMenuListener () {@Override सार्वजनिक शून्य परक्रेटटेन्टेक्स्टमेन्यू (संदर्भ मेनू मेनू, दृश्य v, ContextMenu.ContextMenuInfo menuInfo) {TestActivity.this.onCreateChildContextMenu (menu, v, menuInfo);}}); वापसी पाठदृश्य; TestActivity.this.onCreateChildContextMenu बस मेनू में कुछ स्ट्रिंग जोड़ता है। समस्या: यह काफी ठीक काम करता है - संदर्भ मेन्यू प्रकट होता है और अपेक्षित काम करता है लेकि...

android - How do I 'navigate' to an activity that's already running? -

Newbie question ... So I have two activities, cherry and apple, and each button has a button, the second one. Then back and forth In the class "cherry" I say this: intent = new intent (cherry, this, apple, class); startup (intent); This means that it should go to Apple. The activity of the apple has the same code. I think what I am seeing is that every time I start the Activative Apple, it is starting a new instance instead of reactivating the apple. I have suppressed the doctor and can not get the flag or other call, which is what I want. P> What about? It is also useful in completing activities on the back stack until it reaches the target activity. To be clear, your activity may be even after using the flag above it can be restarted when it comes to releasing your activity memory Was destroyed in the endeavor. In other words, you still need to make sure that your activity can be restarted, take appropriate precautions at onPause and onSa...

"No media found". How to insert image in android -

I'm new to Android programming so if someone helps me then I would be really grateful I am trying to implement Steganography in Android but my problem is that I do not know how to insert images in Android. That's why I'm getting "no media was found" . Please help me with it. I tried c: & gt; Adb push c: \ image1.png /sdcard/image1.png But I get this command prompt. failed to copy 'c: The correct directory for my emulator is mnt / sdcard . It works for me: adb push README mnt / sdcard Also keep in mind that you adb shell ls & lt; Path & gt; , which may be sent to you on the right track edit - apparently sdcard to mnt / sdcard and also works for me using the named file Doing image1.png is also working. Maybe you have a problematic file already on that place? Edit - I think you have to turn off the USB mounting option when you will use ADB to push files. It seems that your comment about the gallery is not sear...

What is the & prefix in PHP? -

संभव डुप्लिकेट: Google ने मुझे फिर से विफल कर दिया। निम्न कोड की तीसरी पंक्ति, स्थानीय होस्ट पर ठीक काम करती है, लेकिन मेरे होस्टिंग सर्वर पर एक त्रुटि लौटाता है क्या & amp; उपसर्ग मतलब है और यह मेरे होस्टिंग सर्वर पर एक त्रुटि क्यों लौट रहा है? फ़ंक्शन add_real_escape_string ($ value) {यदि (is_array ($ value)) {foreach ($ value as & amp; $ item) {$ Item = add_real_escape_string ($ आइटम); }} और {अगर (get_magic_quotes_gpc ()) {$ value = स्ट्रिप्सलाशस ($ value); } $ Value = mysql_real_escape_string ($ मान); } वापसी $ मूल्य; } त्रुटि पार्स है: पार्स त्रुटि: सिंटैक्स त्रुटि, अप्रत्याशित '& amp;', T_VARIABLE की अपेक्षा या '$' init.php में लाइन 345 पर & amp; इसका मतलब है कि यह एक प्रति के बजाय संदर्भ गुजरता है, जिसका अर्थ है कि उस ऑब्जेक्ट में आपके द्वारा किए गए सभी परिवर्तन भी उस दायरे के बाहर प्रतिबिंबित होंगे जो इसका उपयोग किया जाता है। अधिक जानकारी के लिए देखें। त्रुटि की व्याख्या के लिए, हम आपको पता होना चाहिए कि आपको क्या त्रुटि...

gpu programming - Errors in Polynomial fitting problem on CUDA -

I tried to use CUDA to make some simple loops on the device, but it seems difficult to understand Qyda is. I'm getting 0 from every function call, when I use the CUDA kernel function with the normal C code. Original code: Dual evaluation (int de, double tmp [], tall * enfwel) * Polynomial fitting problem * / int i, j; Intint M = 60; Double px, x = -1, dx = (double) m, result = 0; (* Nfeval) ++; DX = 2 / dx; (I = 0; i & lt; = M; i ++) for {px = tmp [0]; For (J = 1; J & L; D, J ++) {PX = X * PX + TMP [J]; } If (px and lt; -1; px & gt; 1) result + = (1-px) * (1-px); X + = dx; } Px = tmp [0]; For (J = 1; J & L; D; J ++) PX = 1.2 * PX + TMP [J]; Px = px-72.661; If (px I first wanted to loop on CUDA: Double evaluation _guppu (int de, double tmp [], tall * napvel) {/ * Multilateral fitting problem * / et j; Intint M = 60; Double px, dx = (double) m, result = 0; (* Nfeval) ++; DX = 2 / dx; Int N = M; Double * device_tmp = NULL; Size_t size_tmp = sizeof tmp; Cud...

binary - Obtaining reversed Integer in Java -

There is a method in Java that reverses the bit in an integer reversebits (). I wanted to try another implementation and I have it: public static in reverse (int no) {int num_rev = 0; For (Int i = 0; I > I) & amp; 1); If (((>>) & amp; 1)! = 0) {num_rev = num_rev | (Intel) Math.Po (2, Integer. SSE-I); }} Return num_rev; } The result is not num_rev correct. Anyone have any idea how to "rebuild" the value? Perhaps there is a better way to do this? Thanks for any suggestions Common ways to reverse the bit Will be through bit manipulation, and definitely no floating point math routine! For example (nb: untested). int reverse (int x) {int y = 0; For (int i = 0; i & gt; & Gt; = 1; // shift X correct} return y; } because x is moved right and y moved to the left that the x Eventually MSB becomes y . A good (and well-known method) method is: unsigned infinite reverse (unsigned int x) {x = ((((x and xxaaaaaaa ) & Gt; ...

textarea - Help converting jquery code to normal / plain javascript -

The purpose of converting it so that I can learn how it can be done without jquery. & lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" src = "http://code.jquery.com/jquery-1.4.1.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {// Focus Auto Focus Fields $ ('. Auto-focus: first') Focus (); // Auto-Hint Fields $ ('INPUT.auto-hint, Focus Function () () (if ($ (this) .val () == $ (this) .attr ('title')) {$ (this) .val (''); $ (this) .removeClass (' Auto-hint ');}}) $ (' INPUT.auto- sign, texta.auto-gesture '). Blur (function () {if ($ (this) .val () =' '& Amp; $ (This) .attr ('title')! = '') {$ (This) .Val ($ (this) .attr ('title')); $ (this) .addClass ('auto-hint'); }}; $ ('INPUT.auto- sign, texta.auto-gesture'). (Function () {if ($...

I get error C2440 in C. cannot convert from int to int[][2] -

I get a C2440 error Int can not be converted to int [] [2] Any help is appreciated. #include "stdafx.h" #include "stdio.h" # Enter MAXDATACOL 2 Enter Enter (intDataire [] [MAXDATACOL]); Int main (empty) {int.dtd [] [maxdaxol] = 0; Int i, j; integer value; } Enter zero properties (int decay [] [MAXDATACOL]) {for (;;} {int i, j; printf ("enter the x and y values ​​ending with ctrl z \ n"); if (scans ("% d Break it up;% d ", and Detrore [i], and Detrore [j]) == EOF break;}} 0 one The number is, while the data array is an array (hence the collection of numbers) You are trying to modify the value beyond any limit A 0 MAXDATACOL - 1 If you do not specify the size of the array

keyboard - Simple key listener - java -

I have a code inside an infinite loop. I would like to apply a method which checks whether I press a button or not as a loop breaker. while (true) {... if (this.escapeKeyIspressed ()) // If really the escape on that millisecond then ...}} What is the easiest way to do this in Java? P presents a method to set the console in non-intercept mode to read , Which you can use to break your loop. It also presents some other methods for both Python and Java, but it is considered to be a little laughing and non-portable (for example, Windows will not work under). I do not think there is a 'good' easy way to do this. I'm scared.

asp.net - How to choose files that will go in deploy? -

मेरे पास यह संरचना है: - सामग्री - स्क्रिप्ट - शैलियाँ - स्टेटिक - डिफ़ॉल्ट सीएसएस - डिफ़ॉल्ट.js फ़ोल्डर सामग्री स्रोत नियंत्रण में होना चाहिए, क्योंकि हम वेबसाइट की स्क्रिप्ट और शैलियों को बदलते हैं। इसलिए मैं इस परियोजना में शामिल कर सकता हूं। फ़ोल्डर स्थिर में फ़ाइलें स्रोत नियंत्रण में नहीं होनी चाहिए, यह उत्पन्न होती है और कोई नहीं बनाता है चेकआउट और चेकिन को सक्षम करने के लिए समस्या यदि मैं फ़ोल्डर content परियोजना में यह तब ले जाएगा जब मैं वेबसाइट प्रकाशित करूँगा अगर मैं इसे परियोजना से बाहर कर देता हूं तो यह स्रोत नियंत्रण के साथ काम नहीं करेगा। यदि मैं default.css और default.js को परियोजना से बाहर कर देता हूं स्रोत नियंत्रण में नहीं होगा, लेकिन यह प्रकाशित में नहीं जाएगा (मैं प्रोजेक्ट फ़ोल्डर में सभी फाइलों को प्रकाशित नहीं करना चाहता)। प्रश्न क्या कोई तरीका है I चुन सकते हैं कि मैं किस फाइल को अनदेखा करना चाहता हूं और जिसे मैं प्रकाशित करना चाहता हूं? (पोस्टिंग उत्तर टिप्पणी से ... fwiw) ... विवरण कैसे दृश्य स्टूडियो में एक सफल पट...

Java Collections & aliasing -

How do you deal with aliasing in Java? One simple solution is to make a copy of what we call an ArrayList, but when I try to write the code, my data is overwritten with the newly added data. In detail: Arreelist & lt; ArrayList & gt; Temp = new arreelist & lt; ArrayList & gt; (); ArrayList & LT; ArrayList & gt; PersonRecord = New Arrestists & lt; ArrayList & gt; (); ArrayList & LT; String & gt; PersonDetail = New Arrestist & lt; String & gt; (); ... while (input.hasNextLine ()) {string line = input.nxtain (); String [] token = line split ("", 0); For (string s: token) {personDetail.add (s); } Temp.add (personDetail); PersonRecord.addAll (temp); Temp.clear (); PersonDetail.clear (); } [[Peter, M, 1972], [Peter, M., 1972]] Instead of / pre> : [[Peter, M, 1972], [Anne, F., 1974]] You should get inside a person to get a new array list for each person: ArrayList & lt; ArrayList & gt; PersonRecord = New...

Python regex to match text in single quotes, ignoring escaped quotes (and tabs/newlines) -

Looking at a file of text, where I want to match, it is delimited with single-quotations, but zero or One might have escaped single-quote, plus zero or more tabs and newline characters (not run) - I just want to match text. Example: menu_item = 'casserole'; Menu_item = 'Fry the meat'; Menu_item = 'Tony' magic pizza '; Menu_item = 'hamburger'; Menu_item = 'Dave's Famous Pizza'; Menu_item = 'Dave's less known Gyo'; I want to capture only the text (and empty space) by ignoring tabs / newlines - and I really do not care if the saved quote appears in the results, unless It does not affect the match: Casserole meat loam Tonys magic pizza hamburger Daves famous pizza Dave is less well known gyro # I have managed to create a regex that almost does this - it handles the quotes saved, but not the new lines: MenuPat = r "menu_item = \ '(. *) (\\\')? (\ T | \ n) * (. *) \ '" InFP.readlines () for...

python - Set global template variable in template tag -

I know there are reference processors that can do this, but I want to set the global template variable in the template tag. So far I have tried this: class> SetNode (template.Node): def __init __ (self, key, nodalist): self.key = key self.nodelist = nodelist def render , Context): reference to d in the value = self.nodelist.render (reference) reference: d [self.key] = return value '' Ie repeat all the references and Set the variable, but it does not work. Can anyone explain how to do this? For example, base.html: {{my_var}} {# I set this variable in child template #} {% block content%} {% endblock%} child.html: {% extended 'base.html'%} {% block content%} {% my_var%} Hello {% endset%} { Here's an old-but-one-goi: tag. The code is self-explanatory. Note that its use (possibly) takes some of your business logic into your template, but sometimes it's OK.

sql - Named scopes with inheritance in Rails 3 mapping to wrong table -

I am trying to use inheritance from a class that contains the named area: class one & lt; ActiveRecord :: Base area: useful_second, lambda {| Value1, value2. Where (: value1 = & gt; value1 ,: value2 = & gt; value2) end-end square b & lt; A set_ table_name "b" end is facing the problem that the name of the table in the SQL query still refers to the table of class A: A useful_scape ("alpha", "beta"). To_sql = & gt; "SELECT \" a \ "WHERE \" a \ ". \" Value1 \ "= 'alpha' and \" a \ ". \" Value2 \ "= 'beta'" b. Useful_scape ("alpha", "beta"). To_sql = & gt; "SELECT \" b \ ". * FROM \" b \ "ou \" a \ ". \" Value1 \ "= 'alpha' and \" a \ ". \" Value2 \ "= 'beta'" Note that the table names in the Zare statement now refer to A. I am modifying the ...

regex - To split on the basis of space and special character in python -

v = vi nod-u I want to split this string to get it L = [vi], [nid], [u] l.split ("") is divided on the basis of space. And I do not know how to use regular expression import function properly Can anyone explain how to do this? Are you trying to split the string to get the word? If so, try the following: & gt; & Gt; & Gt; Import re & gt; & Gt; & Gt; Pattern = re.compile (r '\ w +')> & gt; & Gt; & Gt; Pattern.split ('vi nod-u') ['vi', 'nod', 'u']

java - How do you calculate direction of velocity of a circle bouncing off another static circle? -

I've got the code to bounce one another properly for two moving circles, but when the situation is identical to Apply the code One of two moving circles is static and does not move, moving circle seems to be a class of static one. How can I fix this? If you have code for a circle jumping from a wall, you can guess it By searching the line that will be the tangent of the static circle at the point of contact between the circle and the moving circle drama will bounce from the wall that runs along the line.

google code - Providing Help Contents with Java Program -

The best practice to provide "help content" in the Java application is to use ".chm" files Should the "operating system" have built-in support for ".chm" files? I was wondering how I was hosting my project and I was looking at Google code projects and who looks right for my needs, should I redirect them to the support section of my Google code project?

nullreferenceexception - vb.net: how is iif giving a null reference exception? -

Seeing the many posts / articles about using IIF, it all started when I used CIC / C # Tried to use IIF as a conditional operator in the choice of C ++. Borrowed from: After that I have learned about if () method in vb.net. So in the end I wrote a function that gives the appropriate value (which uses reflection) to achieve the objective. But that method (which I wrote) did not throw any exception. Actually I was able to check the type of futility within the function. return value (as some form of form, byVal Property Name as string) in the form of a object, if MyType is nothing then return the string. PropertyInfo () = MyType.GetType (). GetProperties () Return arrPropInfo.Where (function (x) x.Name = PropertyName) .emem (0) .GetValue (MyType, nothing) End function My question is, what Is there something written inside the IIF to throw such an error? - A NullReferenceException If MyType is nothing then throw the new NullReferenceException () Or is t...

file - iPhone: Document Type Description or 'Kind' Description -

Looking at any file type (for example, DOC or PDF), one is similar to the 'type' of the Finder How do you get the details? For example, under Finder, there is 'Word 97 format (.doc)' like DOC, and PDF Care is a portable document format (PDF). According to, 'the iOS file type provides a systemic registry of associations. "But I do not believe I am pulling the right information (I'm not really sure that I'm using the above registry). I am using the code given below, and it is returning to 'com.microsoft.word.doc' for a doctor like RTF 'public.rtf', and PDF 'com.adobe. Pdf 'is a more bizarre link (weblog):' dyn.age81s3pcrv10g 'in the description None of the user friendly. Jeff NSURL * url = [NSURL fileURLWithPath: fullPathName]; if (URL == zero) returns [extension uppercase string] ; // ie, PDF UIDont Control Controller * doc = [UIDOn Interaction Controller Interaction] Controller with URL: URL;; if (Doctor == zer...

events - Fire ResizeEvent in GWT (Google Web Toolkit) -

I have many Google Maps on my site (v3) which you can choose through a tabennial (a per tab) But there is a problem when you switch tabs when you select the tab, this map does not "wake up". To fix this, I need to use ResizeEvent.fire ( source , Window.getClientWidth (), Window.getClientHight ()); This will activate the resizing listener on the map and "wake it up" My problem is that I can not get an indicator for the size of the handler of the browser window (this package is preserved in com.google.gwt.user.client.Window.handlers) so I do not know that my source What to use in the form. If someone has an answer to my solution or any other possible solution then he would be very much appreciative. Thanks, Tom I'm not sure to use the size again This is the best way to do this (I have not embedded a map before), but you might consider using a tablet standpoint instead of a tabline, and instead of firing the call panel resize event, note that you have d...

compilation - Makefile, option to compile all "examples" in directory? -

I did it in different installers, though unfortunately, how can I actually do it or can not remember who From the program this feature is why I can learn from them. I essentially am compiled a shared library (not yet with Otokonf / Libutol, just compile all files in a standard Mesefail) and test simply examples file that is attached to the library (ie ../ bin / libfoo.so.1.0.1 ) Mesefail format what is provided to compile this wildcard Does it? I know that you are automatically asking for a mechanism to create a The source files in the directory, but I dislike that approach; At some point in the future, a person will have to test or disable two, and you are making a bit weird, such as renaming a file, it will not be automatically compiled. I really like every program that you intend to create in Makefile , but it does not need to be awesome. With some you can easily create all your .c files in the .o files or in the executable directly. Here AppArmor looks like...

sendfile - Rails, Download from BLOB database -

I have a problem, I save my upload data in the database file in the Blob file. Now I want to download it .. How to manage I have tried this way (document_file is an area with blob data) send_file @attachment .document_file ,: Nature => Thanks Maybe you send_data for blob data instead of send_file Should use: send_data @ attachment.document_file ,: disposition = & gt; 'Attachment' Consider that the 'Attachment' is the default value, so you can leave it because you should get this error because send_file needs the file path as the argument, no That no blob You can also see:

Cross-platform custom cursors for Qt, cursor in resource file -

I think I'm missing something because I do not see any way to easily cross-platform cursor in QT can . That is, I want to use a standard cursor editor, or just a normal cursor file type, and want to paste it into a resource file. Let me provide some platform specific management handles (i.e. I can not load with a resource) or take a pixmap in a normal way. In the Pixmap method, I will have to wipe it in any way to store the hotspot. I do not want animated cursors, just a plain color image (32x32). What is the easiest way to deal with this? I am currently working on an application where I want to do some good custom cursor The way I'm doing this: Add an image to a QT resource file ( *. QRC ) - I with PNG with transparency Working is exported from SVG (ALWAYS your original art source for such things in SVG, like you need scaling) & lt; RCC & gt; & Lt; Qresource prefix = "/" & gt; & Lt; File alias = "default" & gt;...

java - how to display multiple rows from db to jsp page in struts 2 -

I am a newbie in Stropes 2, I want to display several lines from the database table in a JSP file. How to attribute the values ​​in the JSP page to get or to set the values. This method is often used: public class anAction { Private list display list & lt; Robin & gt; ... Get the rows from the sitter / gesture for display and the jdbc resets in the list ... somewhere in the code ...} Robin is a JavaBin that results in Match one line. Use the following code block to remove the content on the jsp page: & lt; S: iterator value = "displayList" & gt; & Lt; TR & gt; & Lt; TD & gt; Attribute1 & lt; / TD & gt; & Lt; TD & gt; Attribute2 & lt; / TD & gt; ... & lt; TD & gt; AttributeN & lt; / TD & gt; & Lt; / TR & gt; & Lt; / S: iterator & gt; Where attribute1 ... attributeN is similar to the properties defined in Robian. Hope it helps.

c - error: invalid type argument of ‘unary *’ (have ‘int’) -

मेरे पास एक सी प्रोग्राम है: #include & lt; stdio.h & gt; Int main () {int b = 10; // पूर्णांक 10 को चर 'बी' int * a असाइन करें; // एक पूर्णांक 'a' a = (int *) और amp; b पर एक सूचक को घोषित करें; // चर 'बी' के स्मृति स्थान को आइए, इसे एक पूर्णांक सूचक पर डालें और पॉइंटर 'ए' int * c; // एक पूर्णांक 'सी' सी = (पूर्णांक *) में एक संकेतक घोषित करें; // वेरिएबल 'a' का स्मृति स्थान प्राप्त करें जो कि '//' के लिए एक सूचक है। इसे एक पूर्णांक सूचक // पर डालें और पॉइंटर 'c' के लिए इसे असाइन करें। printf ( "% d", (** ग)); // त्रुटि यहाँ होती है वापसी 0; } कम्पाइलर एक त्रुटि उत्पन्न करता है: त्रुटि: अमान्य प्रकार का तर्क "unary" * ??? (क्या है?)? क्या कोई यह समझा सकता है कि इस त्रुटि का अर्थ क्या है? चूंकि c एक पूर्णांक सूचक का पता रखता है, इसका प्रकार चाहिए हो int ** : int ** c; सी = & amp; ए; पूरे कार्यक्रम बन जाता है: #include & lt; stdio.h & gt; Int main () {...

arrays - How to create dynamic Map key in javascript? -

I have tried to create a map like the example below ... Var myMap = {"one": 1, "two": "two", "three": 3.0}; Therefore, I repeat them to: (code of myMap) for {my>} {window.alert ("myMapmap property \ "" + Key + "\" = "+ map [key]); } If my data is dynamic ... and I want to add each of them to the map ... how should the code be? And I hope the key is not stable ... I mean the data taken from other sources like the database, which was not previously defined. var data source = ...; Whereas (var o = dataSource.get ()) {myMap [o.key] = o.value; } (Var key in myMap) {alert ("key:" + "value:" + myMap [key]); } You can just type the object using an array such as syntax. How and where you can get your data

Rendering HTML on Iphone -

I'm planning an EPB / HTML rendering system on the IPAM IAM is not able to experience programming on this platform and I would like to ask what is the best way to start this topic on the iPhone platform. I would like to present the ePub which is HTML + CSS subpage, but I do not want a simple web page view. I need to interact with the lesson and need to underline any other way or add others as text ... This simple HTML rendering is not enough because of control, can someone point me in the right direction where to start looking? HTML / CSS JavaScript embedded in it. For those interactions to work, Need to render. Some "coding rules" with Javascript CSS HTML If you are looking for an app reading app of your own then you can take a look at this ... I am providing an ePub by unpipping and then providing content in a UIwebView. I am working to find a more dynamic approach but you should start it ..

linux - make diff to ignore symbolic link -

मेरी परियोजना में निम्नलिखित संरचना है /project/config.mk / project / dir1 /config.mk - & gt; ../config.mk /project/dir2/config.mk - & gt; ../config.mk जब मैंने पैच फ़ाइल बनाने के लिए diff का उपयोग किया, तो /project/config.mk किया गया था सही है, लेकिन दो प्रतीकात्मक लिंक को कुछ समस्याएं मिलीं। इन दोनों को नई फाइलों के रूप में माना जाता था, डिफ वर्गों को config.mk फ़ाइल की पूरी सामग्री थी। मैंने निम्न सांकेतिक लिंक को अक्षम करने के लिए एक diff विकल्प ढूंढने की कोशिश की, लेकिन ऐसा कोई विकल्प उपलब्ध नहीं है किसी भी सुझाव की सराहना की जाती है। ओवरबोस के सुझाव के रूप में, मैं यह स्क्रिप्ट बना रहा हूं। यह काम करता हैं। समय का उत्तर देने के लिए सभी को धन्यवाद। #! / Bin / sh -v ori_dir = $ 1 new_dir = $ 2 patch_file =। / Patch_file यदि [-f $ {patch_file}] तो rm $ {patch_file} } Fi ori_files = `cd $ {ori_dir}; खोजें। / -प्रकार एफ! $ {Ori_files} में मैं के लिए प्रकार l`; अगर [-f $ {ori_dir} / $ i] तब यदि [-f $ {new_dir} / $ i] तब diff -rup $ {ori_dir} / $ i $ {new_...

actionscript 3 - XML-AS3 Photo Gallery -

If I want to do a photo gallery in categories with categories, how should I structure my XML? Should I do this? & lt; Gallery & gt; & Lt; Category & gt; & Lt; Name & gt; .. & lt; / Name & gt; & Lt; Description & gt; ... & lt; / Description & gt; & Lt; Pick & gt; .. & lt; / Pick & gt; & Lt; Pick & gt; .. & lt; / Pick & gt; & Lt; / Category & gt; & Lt; Category & gt; ....... & lt; / Category & gt; & Lt; / Gallery & gt; Should I have different levels of categories in different XMLs? The way you've set it up, it's perfectly fine. There is no need to separate it in many XML.

hsqldb ignores first insert operation on table at server (server needs to be "warmed up"?) -

We have a very curious problem with hsqldb. We are running a few tests which work well on MySQL, but We recently switched to hsqldb for our unit tests. In doing so, we saw that some of our tests have failed, three records A, B and C have been recorded in an examination, and an attempt has been made to regain the first two, A and B. However, for the first time, we only run tests on a new configuration (empty) database. However, if we repeat the test on the same database, both A and B are returned (before you ask, yes, A and B are different from A, B and C). We have tried to force the database to continue the record, and we have delayed, except for putting the same "heating the database", nothing seems to be done. If we check the hsqldb log, they all are included in the statement to insert, even those people we are unable to use SELECT in our first run on the database. Has anyone ever experienced problems with hsqldb "hot" with a dummy insert statement? If we ...

c# - .NET Form Design - Button Group "Photoshop Tool Style" -

If you have ever used an image editing application, you will know that to select the existing tool There is a group of buttons. A device should be selected at all times, and when the device is selected, the button keeps pressing until a different tool is selected. I controlled ToolStrip and set my images in the ToolStripButton objects, and for each button I checkon click The property is set to the right. I subscribe to checked events on every button, and set another button checkstate to uncheck what I was going to do next Sounds like a kind of hack. Is there a way to accomplish this with the tooltrip control, or is there a better control to use it? I have C # and VS 2010, which targets Network 4 I think That's there However, it can be semi-automated: Call the SetToolButtonsChecked (sender) in each of your click events. ; Private Zero ToolstripButton1_click (Object Sender, EventEurge E) {Settlebuttons Checker (Sender); } is implemented as: ...

Calling ASP.net from Classic ASP -

I'm new to ASP and ASP.NET. I have just started working on a legacy ASP, a classic project and a sample that makes a remote call to ASP.net. Is it possible to call ASP.NET pages from ASP? Are you compatible? / P> So far my impression is that they are not compatible, but I am probably wrong. I mean that the net project can be called with parameters and can be kept individually? Does anyone have experience similar problems or share any suggestions? You can create a COM wrapper for an asp.net dll, for example, If you want only two side-by-side apps that can share information, it's probably easy. Cookies are cookies - you can pass session information with a cookie, as long as both apps understand the format (and they are running in the same domain). Asp.net Sessions data can not be readily available for traditional ASP (as other answer notes), but to use your ASP.NET session to track your users, Not too compelling. You can always create your own session ...

php - zend form validation -

I wonder how Zend_Form validates the input, I mean how it knows which input fields are valid Looked at php globals ($ _ POST, $ _GET) and I came to know how to authenticate (for example) not set to show if someone can give me any suggestions for this stuff ? Good, it is the best option to find: / ** * Validate the form * * @The ultimate array $ data * @ Return boolean * / Public function is valid ($ data) {if (! Is_are ($ data)) {Require_once 'Zend / Form / Exception.php '; Throw new Zend_Form_Exception (__ METHOD__. 'An array is expected'); } $ Translator = $ this- & gt; Gettranslator (); $ Valid = true; $ Ebelongto = null; If ($ this-> isArray ()) {$ eBelongTo = $ this- & gt; GetElementsBelongTo (); $ Data = $ this- & gt; _dissolveArrayValue ($ data, $ eBelongTo); } $ Context = $ data; Forex currency ($ this-> getElements () $ key = & gt; $ element) {if (zero! == $ translator & amp; $ this-> translator () & amp; amp; Amp; a...

Rails 3, cannot see my "model"_path -

I am working on a Rail 3 project. I have a model below (it uses a paperclip to upload an image) class diagram & lt; ActiveRecord :: Base has_and_belongs_to_many: categories has_attached_file: pict ,: styles = & gt; {: Small = & gt; "150x150>" } Validates_attachment_presence: Pict is valid _attachment_size: pict ,: less_than = & gt; 5.Magabyte is valid_datetime_type_type: picture ,: content_type = & gt; ['Image / jpeg', 'image / png', 'image / gif'] end In its index.html.erb, I added a "link_to" to delete the record , But the following does not work: 'image_path' for under-defined method # # Class: 0x10549f560>>: 0x10549d940 & gt; Excluded sources (around line # 16): 8: & lt; Table class = "gallery" & gt; 9: & lt; Tr & gt; 10: & lt;% i = 0% & gt; 11: & lt;% @ pictures.each do | Picture | & Gt%; 12: & lt;% if i% 4 == 0 then% & gt; 13: & l...

c# - textbox formatting -

I need some help with my code. I need the following format, 12345-1234567-1 Actually I just want to write marks and when If the text length reaches 5 then it should add '-' and then the length of 13, then it should be added '-' My code is correcting it but when I use backspace / delete So, it always adds '-' to the 6th and the 14th place. This is my code, Private zero nicNo_txt_KeyUp (Object Sender, KeyEventArgs E) (If eCode.ToString ()! = "Back" || E. Kcode.ToString ()! = "Space" || E.Code.ToString ()! = "Delete") {if (NicNo_txt.TextLength == 5 || nicNo_txt.TextLength == 13) nicNo_txt.AppendText ("-" ); }} Regards Did you try the masked textbox in it You can specify a mask for the format you need

java - Freezing ProgressDialog indicator within AsyncTask with OnItemClickListener -

I have the following code in which information about images is loaded with DB and shown in custom gallery view. The problem is that I can not see any way to set the setting on the OnItemClickListener for the gallery in AsyncTask's background thread because it is part of the main UI thread (I think?). The dialog pops up when I load the activity, but the freeze occurs and I think this is because I am setting up OnItemClickListener in the UI thread which is doing a lot of work. How can I solve this problem? Private class loadsets AsyncTask & lt; String, integer, string & gt; {Progressive dialogue dialog = new progressivity (ActivityGallery.this); Prerequisite (@) {b = getIntent () on @ Override Protected Zero GetExtras (); Dialog.setMessage ("Loading ..."); Dialog.show (); } @ Override protected string doInBackground (string ... parameter) {log. V ("SC", "ASINNC goes here !!"); DB Handler Handler = New DBHDML (activity gallery). SQLiteDatab...

html - Do SVG-enabled browsers ignore alternative images (when included in object tags)? -

Image
An illustration I want to include in a site is 28.1 times smaller in SGG format compared to the same illustration PNG Unfortunately, I have to complete the browser which is not SVG-enabled. That's why I'm still including PNG as an option, such as: & lt; Object type = "image / svg + xml" data = "illustration svg" & gt; & Lt; Img src = "illustration.png" alt = "optional description" & gt; & Lt; / Object & gt; Will SVG enabled browsers ignore PNG in this case or will it be loaded in the background in some way? (I.e. saving me over load time)? Both Firefox v4 and chrome v10 Download Alternate Image You will not save any bandwidth or load time by using any SVG image with PNG fallback. Developed by Firebug and Chrome Developer Tools tested on the Net panel: Note that this does not mean that using SVG is not a good idea. You should still use SVG because it will print and will be better than relate...

artificial intelligence - Does a neural network require binary inputs? -

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

linux - I'm unable to send XML data over HTTP POST request from a particular client to a particular server. How do I debug? -

I am using a Java program that is in our server to post some XML data from a remote client machine I have independently tested different components of the whole system and it has been found that: The customer is able to successfully receive a response to the GET request on the same server. Therefore name resolution related issues can be excluded. The client code in other networks is capable of posting data to our servers, therefore, the server code is working properly to post the same customer on the same server with a different server Trying Apart from this, the systems in other networks are running similar versions of the client. Therefore, client code also works I tried posting XML file via CRL: curl - header 'content-type: text / xml; Charset = UTF-8 '- Data @ 5.xml -X POST http: //myserver.com/updates but also put it above, I have concluded that the problem is not with the Java part, A netstat -ntavp shows the following output: Active Internet connection...

sql server - updating a table with the data from another -

I have two sites that sell the same product (the same database structure and everything). One of them has recently updated all its products and we have to take data from the three tables on the updated site and override those three tables on the date-site. Is there a way to do SQL Server MS? Tried trying to break tables in Iv sql, then include "Choose from db1table to db2table *" but I only get errors from foreign keys. Someone showed me a trick in the Visual Studio enterprise for a while to compare the data, where vs one. Exclude SQL files that you can run to update your table but I only have professional versus 2010 and it is not part of the package. Suppose that both of your databases have the same foreign key constraints and if the foreign key is the only issue of constraints why not just you 1) Disable all foreign keys 2) Load the data 3) Enable all foreign keys I come from the background of Oracle, one in SQL Server Using a script in the bar to disable /...

c# - DateTimePicker ValueChanged Event repeats with month arrow -

The month forward or previous arrow is clicked on my DateTimePicker control, it removes the ValueChanged event repeatedly. I have to use the debugger to stop the application. Note: By the time I click on any date, my application works fine. The MSDN document shows an example for document documentation. But I can not find any example function named Datetime Picture 1_wholes (). The skeleton of this function was made for me when I clicked the control twice in the VSNet 2008 designer. Dave 81 set me on the right path. If you say that, then the problem is that When the user changes the value manually, the closeup event is not shown. The way I have fixed this problem with constant re-firing of the month change, it only changes my Value Change event to refresh if the calendar is not left below. Ie .: private bool _calendarDroppedDown = false; // It is said that when the calendar turns the private zero date StartDateTimePicker_DropDown (Object Sender, EventArgs e) {_calendarD...

Facebook Application iFrame Fixed Element -

I have to make a definite element (a DIV) in the IFrame for my Facebook application. So when the user scrolls down the page, then that element is still fixed at the top of the browser window? Origin: You add stuff to the bag, while you scroll down, and a certain division when you add these things to the bag, show your "score" when you scroll "Score Counter" Should always be seen Thank you! This is not possible if you are using the IFrame Auto-resizing feature of Facebook. Once iframe resizes, so scrolling is not necessary, only available scroll will be one of the original windows. However, the child's IFrame has no information about the scrolling of the parent window (because they are not on the same domain ...) and are trying to scroll the event or the scroll position will return only that scrollbar Position is at 0, or the highest. You can, however, click on the events and remove the click event or the offset of the clicked element. Some examp...

Unable to find the Documentation in Xcode4 -

I was just getting along with XCode4, I suddenly want to see some documents. So I clicked the text and boom to the right. I found that there is no option to "Find text in documentation" option: ( I actually found this option very useful in learning iOS from XCode 3. versions. I have searched for it and could not find it. So now I have to go to Apple's documentation site and search for it. Anyone for this Solution. PS: I know that XCode4 is not good It is ugly, but it is ugly. Click on the Open utility panel and the Quick help tab.

jquery - Get real offset left/top of element with inline offsetparent -

Image
I am trying to get the coordinates of an element on one page. I'm using standard methods to get: var el = element, pos = {x: 0, y: 0}; While (L) {pos.x + = el.offsetLeft; Pos.y + = el.offsetTop; El = el.offsetParent; } But this method fails when the element in the question is display: block , and one is displayed in offset parents: Inline; . This is due to the fact described in this fact: After trying some people with jQuery, they found out that their .offset () -method gives correct offset, and I have looked through the source but Actually did not get how they did. So my question is how do I get the right position? I can not use jQuery for this project, and the method is cumbersome, adding an element and testing is a lot of performance (performance perspective), and using Element.getBoundingClientRect is not available either . If you feel like trying to get it out, then you can go to open your choice and type debugger in the following: var el, el2; El = e...

linux - dlsym()'ing a global variable in C++ -

I want to create a program which is a series of dlopen () (written by itself ) And a omnibox variable is stored in it, which is named a valid variable name called test_suite , which is a null-terminated array of function pointers (the signature of the function is predefined by me , No need to worry about that) The problem is that the G + library has been compiled as: G ++ -Wall-Shared - Radi IP-FPIC foo.cpp -o foo. So and "Function Index" have been declared and allocated: const testunit_testcase test_suite = {...} yet objdump - t foo.so | Grep test_suite Shows: 0000000000200940L O.Data.rel.ro 0000000000000020 _ZL10test_suite Do me 0000000000200940Lo Data .rel.ro 0000000000000020 test_suite so I can do dlsym (dlh, "test_suite") program dllupen () ' foo.so Thanks Appendix Yes, Extern "c" I first tried: extern "c" {const testunit_testcase test_suite [] = {// TESTUNIT_DEF_TESTCASE (doTest)...

How to modify a java program from arrays to arraylist objects? -

// sets a random number of markers in // one-dimensional array // num markers markers in a marker Size Board Size Public Square SimpleDotCom {// Static Individual Final Constants DEFAULT_MARKERS = 3; Private Final Static Ent DEFAULT_BOARD_SIZE = 10; // Private Ent [] markers of data members; // marker posts private int board size stores; // Store at the end of the personal privatization of the board; // SimpleDotCom () (it (DEFAULT_MARKERS, DEFAULT_BOARD_SIZE) in a board of 10 public boards of default constructor // 3 markers; } // // Set markers and boardjokes single dot com (int newmakers, int boardsize) to set constructor {markers = new mark markers]; This.boardSize = boardSize; EndOfMarkers = Marker Long - 1; Int i, j, random; Int [] original = new int [board size]; For (i = 0; i & lt; original; height; i ++); [i] = i; // Basic for tablets (i = original.lambi - 1; i> gt; original.lambi - marker height; i--) {randNum = (int) (math.rendum) * (i + 1)) ; // swap original [i...

c++ - glutBitmapString access violation -

(OS: Windows 7, compiler: Visual Studio 2010 C ++ compiler) The OpenGL program is working in a manner that draws some areas and models, applies to some shaders etc. e.t.c. Now I thought it would be good to add some text, so I added the following three lines in my Draw method: glColor3f (0.5F, 0.5F, 0.5 F); GlRasterPos2f (0, 0); GlutBitmapString (GLUT_BITMAP_HELVETICA_12, (unsigned char *) "some text"); Now in any way, all of this is trapped in my infinite "access violation" loop, which I can not do properly, just for the output of the text, all the other draws Also commented the code, and it still gives access violation error, I am at a loss here because there is nothing that does not affect it, then there is some indication to anyone;)) How does this issue To fix? I could post all my Draw Code, but I also tried an empty project, so I'm pretty sure that it does not have the rest of the code. Edit: I tried to reduce the error even further, and it s...

javascript - I think I am not using Backbone JS's views correctly? -

I have just started using backbone (and underscore) JS. I am applying a big iPad HTML5 and It needs to do all the client side work. The structure of the project is needed and the backbone seems a good fit. It seems that there is not too much on the way and can be used as a bit of toolkit (especially because underscores are also required). I have a question, though. This HTML5 app is basically a page application, everything starts with an index.html file. I know the basic way of managing pieces of URL, which I like. It is easy to set up routing events for specific models. There are about 3 levels of nesting in this HTML5 app in the many "Nespace Layers" that I am working on, this is JSON data, which uses this app ( I do not have to go to local database memory yet, but maybe I want to? Just wanted to take my head around the backbone). They are common webpages, for example, they are just pages of content that are loading in different parts of the webpage. I am using id...

c++ - Is Nokia mis-using static_cast? -

I just came in: Scroll down to the bottom of the page, where you will search QWidget * pw = static_cast & lt; QWidget * & gt; (Guardian); The parent is of type: QObject, which is the base class of QWidget, so in this case, isnt: should dynamic_cast be used? Like: QWidget * pw = dynamic_cast & lt; QWidget * & gt; (Original) Thanks, If you know that You are casting from a descendant to an offspring from below (i.e., you know that the object is actually an example of the descendant), then static_cast is completely legal (and more executable).

arrays - Java game with tiled map background problem -

I am trying to develop a Java 2D game and I have a problem with tiled backgrounds. I am using the Development Games in Java book, but this part is inadequate so I need your help based on the map of the game based on the array string Filename [] ("wwwwwwwwwwww", "pppppppppppp", "oooooooooooo"}; I want to keep this array on jeffrom I try to read it and after double use it for loop to fill a specific image for each letter, I can see that no image is displayed. What is the way to think that I am right I use or want more? Please help I see that the main issue is That you are painting your images on a 1-pixel increase. Mash one should multiply by the width and height of another tile. Additionally, you are loading your pictures for cache ( loadImages () ) , And then again on every one loop walking Very slow and useless

javascript - loop images with jcoverflip -

Anyone knows how to loop images within a jcoverflip carousel in a continuous loop? I have tried to work with Dome Buff, which does not work: P Any ideas? The documentation is very bad and I did not find much on Google You can check whether the hindowjal last item , And if so, you can use the following methods described in their documentation. First ([callback], [originalEvent = {}] currently move to Start. Callback: Function called the Basic Function: The original event item You can use the current current method described in the docs Carousel condition will be achieved. current ([new, present, [original event]] If no criteria have been passed then get the current item index if the new is on, then the current object is in the index Will take.

Screen scraping silverlight browser application info -

I am registered on a site that uses a Silverlight application that shows some personal information. My goal is to be able to read some data from the light application of silver. Is this possible? I know that it can be done using a curl on a regular web page. Thanks "post-text" itemprop = "text"> To get information from the ongoing Silverlight app, you can use a tool to automate the window app. White is mainly used for performing functional testing of applications, but it should also allow you to remove information from the application. For an example of White and Silverlight, see here:

asp classic - How to implement Server side include with navigation links -

I have 4 html pages. 1 of them is a common UI that should be available on all other pages. Navigation page has 3 links which indicates the other 3 pages. I have used all three of these to include this common file How do I handle the link clicking and changing the page accordingly? Can anyone help me in achieving this? Thanks in advance victory For this simple requirement, I You suggest using standard HTML iframe

iphone - how to track language changes in iPad? -

I'm new to developing the iOS app, so I've recently encountered a problem in localizing my app. I want to take some actions in response to language change in system settings. To get the language ID I use [[NSLocale preferredLanguages] objectAtIndex: 0]; In the applicationDidFinishLaunchingWithOptions method method. For the first time, it returns the language id (like "n" for english). Again, I close my application (or send it in the background) and change the language to German. After that, I restart my app, but instead of "de", it still gives "n" I think my app probably can store the old settings anywhere ... but where really ? How to get a valid current price? Take a look at this old answer: Edit: NSString * testLang = [[NSLocale preferred language] objectAtIndex: 0]; NSString * testLang1 = [[NSLokel preferred languages] ObjectAutindex: 1]; NSString * testLang2 = [[NSLokel preferred language] ObjectAutindex: 2]; NSString...

c# - StreamReader and Dispose -

I have a method that takes the stream as a parameter: Public Null Method (stream stream) {...} In this method I am creating StreamReader. Should I use a streamminder using the statement? If so, the stream will be disposed off, it is wrong. What is the best practice to use stream and stream reader in this case? No - in this case it is traditional to settle the caller.

embedded - PIC Capture mode not triggering interrupt -

I am trying to use the capture module on PIC 16 LF 1827, but the ISR has never been entered . I started with a basic falling interrupt (work), then the timer was added to 1 configuration (still working), then the IOC was interrupted and configured / disabled, the relevant CCP interrupt (ISR never entered) has been done). Code is given below: The comment section is the original original IoC setup. I have verified with the MPLB debugger that ISR has not been filed, and this argument is being put on the argument analyzer and confirming it is Rb1. #include "htc.h" // config1 // internal OSC, not wdt, use power-up timer, reset // enable any code security, enable brown-out reset, Clkout Jeepiaio, // internal-external Svichovr off, __CONFIG (FOSC_INTOSC & amp; WDTE_OFF & amp; PWRTE_ON & amp; MCLRE_ON & amp; Seepiafaf & amp; amp; amp; Seepeediaff & amp; Boaran_on & amp; Clokaanff & amp; IESO_OFF Failure clock monitor on & amp; FCMNAFF; / C...

python - Pythonic shortcut for doubly nested for loops? -

Consider that I have a function that takes the Tupply Logic (X, Y), where X was in the range (X ), And in the y category (y), the usual way to do this: For the class X (x): In range Y: function (x, y) To do something x_like_range for some (x, y): function (xy) Was Tuplal (X, Y)? You can use & gt; & Gt; & Gt; Import Products from Iteratolls & gt; & Gt; & Gt; & Gt; & Gt; & Gt; For x, y product (category (3), category (4)): ... print (x, y) ... (0, 0) (0, 1) (0, 2) (0, 3) (1, 0) (1, 1) (1, 2) (1, 3) ... and so on Your code will look like this: Product X (Range (X), Range (Y)): Function (x, y)