Posts

Showing posts from August, 2010

javascript - Jquery get consistent width using document body -

I want to get the width of a web page and found that $ (window) Width () does not return a corresponding value due to the width of the scrollbar, depending on the browser and whether the scrollbar is visible instead of window I am getting width of the document body : $ ('body'). InnerWidth () The correct value returns when the test is done Anyone using this approach has any problem? In the body setting {width: 100%;}. You may need to put that code in $ (document) .ready (function () {}); There is a problem getting the DOM element size in callback or in a short timeout, before you can calculate it in its final state, then you can get the shape after it. Although the correct width appears instantly, there may also be a few milliseconds, where it has not been calculated. Hope that helps.

iframe - Bootstrap slider does not work when setting images in table -

The first problem is a Bootstrap slider: When I try to slide iframes while clicking on imaging and its work, But when I set the picture in an HTML table Second: There is a very refreshing page, I think the reason is in the iframes because when I change the iframes of images, the problem disappears Also knows what is wrong? My HTML code: & lt; Div class = "content" & gt; & Lt; Div class = "icon" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; A href = "johnmaus" class = "link" rel = "1" & gt; & Lt; Img src = "image / icons / disabled / Johnmos.jpg" alt = "200px" id = 'john mouse' class = "imgikon" gt; & Lt; / A & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; A href = "gymtiner" class = "link" rel = "2" & gt; & Lt; Img src = "image / icons / disabled / gymnotro.jp...

ruby on rails 3 - How reset primary key in Active Record with SQLITE3 -

I have this problem. I am creating a table called the post and then I have recorded some records how can I shorten the table so that the post is the primary key again 1 use rake is 1 with db: drop code for me $ rails console & gt; ActiveRecord :: base.connection.execute ("Remove from sqlite_sequence where name = 'yourtablename'" Ensure that you are using the appropriate yourtablename and following the name conventions.The name of the table is always low-case and plural. For example, if your model name If your model name is Image , then the name of your table will be the image user . Code>. Let me know what is the solution to this problem.

facebook - how to specify scope in html5 login buttons -

एक फेसबुक एप के लिए एक लॉगिन बटन बनाने का उदाहरण देता है: & lt; fb: लॉगिन-बटन क्षेत्र = "public_profile, ईमेल" onlogin = "चेक लॉगिन स्टेट ();" & gt; & Lt; / अमेरिकन प्लान: के लिए लॉग इन बटन & gt; वह यूआरएल आपको अधिक विवरणों के लिए भी संदर्भित करता है। उस लिंक में एक लॉगिन बटन जनरेटर है। डिफ़ॉल्ट मानों का उपयोग करके मैं "लिंक प्राप्त करें" बटन पर क्लिक करता हूं और चार विकल्प प्रस्तुत करता हूं: एचटीएमएल 5, एक्सएफबीएमएल, आईएफआरएएमएएम और यूआरएल। उत्तरार्द्ध दो पर क्लिक करने से मुझे एक " यह प्लगइन इस प्रकार के एम्बेडिंग का समर्थन नहीं करता। कृपया JavaScript SDK और XFBML या HTML5 कार्यान्वयन " संदेश का उपयोग करें। XFBML लिंक वह एक है जो "जावास्क्रिप्ट एसडीके के साथ वेब के लिए फेसबुक लॉगिन" यूआरएल से अधिक करीब से लॉगिन बटन जैसा दिखता है। लेकिन मान लें कि मैं एचटीएमएल 5 कोड का इस्तेमाल करना चाहता हूं। एचटीएमएल 5 कोड के साथ मैं स्कोप और ऑनलागिन का उपयोग कैसे करूं? क्या एचटीएमएल 5 कोड क्षेत्र और onlogin विशेषत...

Perlbrew install perl takes forever, just install already-compiled perl -

perlbrew installs perl and runs all the tests that are installed on my machine Always (> 60 minutes) for Is it possible to set up a pre-built-end-test-run Pearl, such as the APT-End like Perlebue did for Linux packages to save time? perlbrew by its nature that makes it suitable for your OS and architecture is. He said, you can do things fast with the -n flag, which you have to rely on your OS vendor for versatile vs. created. Leave the test if you have multiple cores, then the -j flag probably creates things in parallel. Try the time perlbrew install -n -j5 perl-5.20.0 and see how it compares to the default method.

javascript - MongoDB: incorrect update count -

In my database, I have a field called 'fruits' which is a simple array i when this array In the element, I use the $ addToSet to insert only those components that are not already present. I want to know that the element that I have inserted actually revises this area. However, docModified parameter always returns 1 return in the callback, whenever I try to add an element that already exists . model.update ({user name: user name}, // document {$ addToSet: {fruit: "apple"}}, // Add "apple" for fruit field function, DocModified] {console.log (docModified); // problem: this will print "1", whatever it is); Do anyone know why? Thanks a lot! (Using BTW I am using Mongoose) Existing method implementation in the use of legacy writing concern API Do the calculation of revised documents as you note, even if there is no real change in the material, such as an operation that does not add a new member to the set, the revised count will be retu...

html - Can't change font size of a href -

I want to change the font size of my single href which links back to the top of the page. My HTML code: & lt; A href = "# topofpage" class = "top" & gt; Return to the top of the page & lt; / A & gt; My CSS code: a.top (font-size: 40px;} Try your CSS error a.top {font-size: 40px;}

php - I want to put short code on the right hand side of my screen? -

I would like to put a simple short code on the right hand side of my screen. On I want to left: & lt; Hr & gt; & Lt ;? Php echo do_shortcode ('[smoothslider]'):? & Gt; & Lt; Hour & gt; And on the right I would like to: & lt; Hr & gt; & Lt ;? Php echo dow_shortcode ('[Easyjubby]'):? & Gt; & Lt; Hour & gt; How can I do this? At present they just go over each other. Usage float: right to place content on the right side of the window And float: left CSS . Leftalign {top: 0; Swim left; }. Write line {top: 0; float right; } HTML & lt; Hour & gt; Div class = 'leftalign' & gt; & Lt ;? Php echo do_shortcode ('[smoothslider]'):? & Gt; & Lt; / Div & gt; & Lt; Div class = 'rightalign' & gt; & Lt ;? Php echo dow_shortcode ('[Easyjubby]'):? & Gt; & Lt; / Div & gt; is here

python - Why do I have to restart the tcp_server program once it receives the data? -

Here's the code I'm using in a simple tcp_server in Python: - Import socket TCP_IP = '127.0.0.1' TCP_PORT = 5005 BUFFER_SIZE = 1024 s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) s.bind ((TCP_IP, TCP_PORT)) s.listen (1) conn, addr = s .accept () #inputs = [conn, serial_obj] output = [] # read_input.read_input (input, output) while 1: data = conn.recv (BUFFER_SIZE) data then: Brake print "Data received:", data Conn.send conn.close () Once my data is received, the connection has been removed and I will To start the campaign the tcp_server program is to run again. I am listening to it forever. The external loop always keeps running for each incoming connection. The internal loop runs according to the data received on the current connection. Try it: import socket TCP_IP = '127.0.0.1' TCP_PORT = 5005 BUFFER_SIZE = 1024 s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) s.bind ((TCP_IP, TCP_PORT) )) S.listen (1) While true: con...

access vba - Proper syntax for activating record selectors -

I would like to know the proper syntax for writing a string which will activate and deactivate the record selector on the form 'frmEffortImpact' Located on 'frmProjectCharter01' unfortunately, I continue receiving an error message "Properties or Properties not supported by Object". This is the code that I am currently using: Private Sub CMDAidPhts_Link () If I Allow = true form! [Frmprojectcharter01]! [FrmEffortImpact] .Correct Selectioner = Wrong Ise if.AllowAdditions = False Then Forms! [Frmprojectcharter01]! [FrmEffortImpact] .Corped selector = true if with form! [Frmprojectcharter01]! [FrmEffortImpact] You are reaching subform control (which has properties like SourceObject and Linkmasterfield). To obtain the usual form properties of the form to be used as a subform, you need to reach the Forum property of the form control. form! [Frmprojectcharter01]! [FrmEffortImpact] .form. Record Selector = False Then you can reach. Workers selec...

c# - Server side execution -

I am creating a binary options website in VB.NET. The server must collect data from any other site and send data to customers. The server must work independently from the user. Do I need a dedicated server that runs a different executable that collects data, or can I insert the code in the server side of my default page ( Default.aspx.vb )? If I put the code in Default.aspx.vb , when will the server start? I have inserted the code that collects the data in public shared sub head () , but it does not start it only starts when I code the code to public sub New () . Put in The server must collect data from another site and send data to customers. The server should be automatically activated by the user. What is the nature of the data? It is not clear when you say that it should work automatically, but at the same time suggest putting it in your default.aspx.vb page (which is "client call server" => "server load default The page that calls to the data s...

syntax - How to provide default value for a parameter of delegate type in C#? -

In C #, we can provide the default values ​​of parameters such as: void Foo ({} However, when the method is signed: zero FooWithDelegateParam (function & lt; string, string> prediction) {} zero FooWithDelegateParam (Func> string, string> predicate = (string ) = & Gt; {return Y;}) {} but do not compile it So, what is the correct syntax for doing this? Note: I provide a way to assign a input string to output string mapper through a delegate I am trying, and if not provided, I just want to return the input string. Therefore, suggestions on any alternative approach to getting it are greatly appreciated thanks. The default values ​​for the parameters you can not basically have are the compress-time constants. However, if you are happy to use the value of the value as "code default", then it may be: zero FooWithDelegateParam (Funk & lt; string, string & gt; = null) {predicate = predicate ?? (X = & gt; x); Pros and Cons: ...

callstack - Ruby: method lookup in an outer frame -

I am trying to clone that F # people call "forward pipe" operator with Ruby and some Partial breakthrough was achieved. Class Object Dft> & Gt; (Rhs) rhs.ispect if rhs.is_a puts it? The symbol is called the method (RAS). Insipent method (RAS). Call self-form rhs.call self-end and end # 1 in 1024; Gt; & Gt; 3 Example 2 puts (1..10) .select {| X | X.even? } {.map | X | 10 × x}. Example # Example 3 (1..10) .select {| X | X.even? } {.map | X | 10 × x} Interviews & gt; & Gt; Proc.new {| X | Puts x} # example 4 (1..10) .select {| X | X.even? } {.map | X | 10 × x} Interviews & gt; & Gt; Lambda {| X | Puts x} # Examples 5 (1..10) .select {| X | X.even? } {.map | X | 10 × x} Interviews & gt; & Gt; - & gt; (X) {puts x} # example6 (1..10) .select {| X | X.even? } {.map | X | 10 × x} Interviews & gt; & Gt; Method (: puts) #Example7 (1..10) .select {| X | X.even? } {.map | X | 10 × x} Interviews & gt; & Gt; : Puts #Example 8 squ...

Android WebView content scaling -

I have the same application on two devices with different screen sizes, one is 1024x600 (180dpi), the other is 1280x800 (213dpi ) is. This app contains webviews with the dimension specified in pixels, on the first device it is slightly shorter. The problem is that when I load my custom HTML page, the page is right on the first device with a small screen and a webview, but with the big screen and big webview on the second screen, it is not fit. I hope the page is white After the vacancy, it will be fit for the second webview, because the page is fixed size and another device screen is large, how can it be decided? HTML was on this line: This was the reason that setInitialScale () did not work before.

javascript - Need to Enable or Visible Submit Button after clicking on facebook share button -

New in JavaScript --- I've added Facebook share button to my page I submit the button The need to do this should be seen after clicking the Facebook Share button below I have used this code Please help thanks in advance

python method for solving a Weighted Least Squares with non-diagonal weight matrix -

मैं linalg.lstsq (A, y) का उपयोग कर रहा हूँ प्रकार y = ax । जब मैं एक विकृत वजन मैट्रिक्स डब्ल्यू के साथ एक WLS समस्या को हल करना चाहता हूं, तो मैं सुझाए गए समाधान का उपयोग कर सकते हैं और लागू कर सकते हैं: वा ए = ए * एनपी एसक्यूआरटी (एनपीडीओगोनाल (डब्ल्यू)) wy = y * np.sqrt (np.diagonal (w)) linalg.lstsq (wA, wy) [0] हालांकि, अगर W विकर्ण नहीं है, तो यह काम नहीं करेगा। मैं विश्लेषणात्मक समाधान (के अनुसार) को लागू कर सकता हूँ: ATWA = np.dot (np.dot (AT, W), ए) एटीवी = एनपी.डॉट (एनपी.डॉट (एटी) , W), y) linalg.lstsq (ATWA, ATWY) [0] लेकिन मुझे आश्चर्य है कि अगर एक संभावना है, linalg का उपयोग कर, या कोई अन्य लाइब्रेरी , जैसे कुछ ही बुला: हल (y, ए, डब्ल्यू)

javascript - Detecting line-breaks in browser/css-forced line breaks -

& lt; P style = "width: 60px" & gt; I am some random text. I have some text. Blubber & lt; / P & gt; The translated HTML may have the above result, I have some RDO text. I have some text. Bblabla I want to split the paragraph line from the above paragraph lines. So what is the expected result, & lt; P style = "width: 60px" & gt; I have some RA & lt; / P & gt; & Lt; P style = "width: 60px" & gt; Nandom Text I & lt; / P & gt; & Lt; P style = "width: 60px" & gt; Some text & lt; / P & gt; & Lt; P style = "width: 60px" & gt; .blabla & lt; / P & gt; Is it possible to apply in JavaScript? Why do I divide it by PS? Because I would like to get my paging system for a long HTML, where all the paragraphs and splag paragraphs within one height are the same & lt; Div class = "page" & gt; & Lt; / Div & gt; . Finally, the ent...

google app engine - Running XG Transactions in GAE Python -

I am trying to prepare automatic local unit tests for my app engine application, running on the python. It seems that whenever I am trying to call for a transaction which is a cross group ((XG = true)), the transaction simply does not work and the value is not accumulated Are there. Since I know that XG transactions need HRD, I have placed these lines: self.policy = datastore_stub_util.seselectorrandomHRConsistencyPolicy (probability = 0) self .testbed.init_datastore_v3_stub (compatibility_polis = self-polio) To simulate HRD However - still nothing. Note that all functions work very well both in development and production. Just not in the unit test Any ideas? probability = 0 means that the results will never be consistent, You probably want to set it instead of 1. This means that how the behavior of your tests works in different environments, is different, but if the query is just to verify the code you have verified, then it is OK . (If the query is part ...

sql - Linq select returned where clause field -

var abba = (t1 to mdc.table1 in t2 in mdc.table2 equals t2 at t1.id ). Select ID new {T1, T2}. Encodable (); If (A = 1) ABBA = ABBA Where (q = & gt; q.t1.cid == x); Second abba = abba Where (q = & gt; q.t1.cid == y); Var global = ebay Select (q = & gt; new {newname1 = t1fild1, nunam2 = t 2.field2}). ToList (); I only want to create a list of 2 fields but 2 fields returned and where the segment field. Profiler View exec sp_executesql N'SELECT [Extent1]. [Cid] AS [cid], gt; & Gt; & Gt; This is where the segment [extent1] has been entered. [Field 1] AS [Nunam 1], [extant 2]. [Field 2] AS [Numan 2] FOr [DBO]. [Table 1] AS [Extension 1] Inner Join [DBO]. [Table 2] at AS [Extent 2] [Extent 1]. [ID] = [Extension 2]. [Id] WHERE [Extension 1]. [CID] = @ P_LLC__0 ', N' @ P_LLC__0, ', @ P_LLK__0 = 10000 I think I understand your question ... Why is a section included in the generated SQL? This line will add a section here because it is stil...

php - Short method for echo in HTML-document? -

क्या एक html स्क्रिप्ट के अंदर एक चर को एको करने का एक छोटा रास्ता है उदाहरण के लिए: index.php ... & lt; head & gt; & lt; शीर्षक & gt; & lt;? Php echo $ MyTitle; ? & Gt; & lt; / title & gt; & lt; / head & gt; ... हाँ है & lt ;? = $ MyTitle? & Gt; लेकिन यह कुछ php कॉन्फ़िगरेशन में अक्षम किया जा सकता है जिसे आपके php.ini में short-open-tag / html>

javascript - SlimerJS Click a link/button -

I'm trying to click a button on a page using SlimerJS. On the SlimerJS documentation, I see the sendEvent (eventType, arg1, arg2, button, modifier) ​​ which allows us to click on the position given by the X and Y coordinates is. Therefore, I try to get these X and Y buttons in the following way: var requires webpage = ("webpage"). Create (); Function click button (button) {var rect = button.getBoundingClientRect (); Webpage.sendEvent ('click', rect.left, rect.top, 'leave', 0); } Webpage.open (url). Then (function () {var button = webpage evaluation (function () {signInButton = document.query selector ("# sign in"); return signin button;}); click button (button);}); In this way, no error is thrown, but does not seem to click on the button. Is there anything wrong with this exercise? Is there a better way? Is there a way to click on a button or a link that is just the name of the ID or tag? This is a very difficult way to do th...

javascript - google ga analytics.js linkid.js on highly generic sites -

I just thought that Google Analytics Link ID is working on highly generic websites? I have a lot of recommended widgets on my site that are randomly generated every minute. Is this potentially able to track Google? What does it have on Linked? Is it possible to track the page area of ​​how many clicks get? Like sidebar or overlay click? Advanced link attribution works by looking at the ID of the clicked element; If there is no such program in which the script runs to find the ID of a parent element, then three nodes increase upwards, if it does not get the ID then it silently fails. If your webpage often changes due to dynamically-generated widgets, then the script will also work on some technical tabs but the collected data will be meaningless.

Why Does OpenCV Won't Detect Eyes With Haar Cascades In Python? -

I am trying to detect a pair of eyes inside a rectangular shape that appears when OpenCV 2.4.x Python. Here is my code: FACE_DETECT = "lbpcascade_frontalface.xml" EYE_DETECT = "haarcascade_eye.xml" DOWNSCALE = 4 webcam = cv2.VideoCapture (0) face_classifier = cv2.CascadeClassifier (FACE_DETECT) eye_classifier = Cv2 if webcam.OPPD (): #csscade classifier (EEEEEDactCT): # Try to get the first frame rival, frame = webcam. Reed () Other: Ravel = False while Rev: Minoisage = (frame size [1] / dotscale, frame size [0] / DOWNSCALE) miniframe = cv2.resize (frame, at least) faces = face _classifier. DCTExamulti Skelele (Minibrammem) Eyes = I-Classifier. FT, FE, FW, FH = [FV] in DOWNSCALE FV cv2.rectangle (frame, (fx, fy), (fx + fw, fy + fh), (0, 0, 255) for DCTF fax (Ex, ey, ew, eh) in eyes: cv2 rectangle (frame, (east, ei), ((pre + ew), (IE + eh)), (50, 50, 50), 3) cv 2. IMhho ("eyes =% s"% (eyes,), frame) cv2.imshow ("cam", frame) ravel, frame = ...

The way of adding array in PHP -

I'm testing PHP (5.4.4) for some code in apache (2.2.22). I wonder how PHP actually works to parse the code given below. & lt ;? Php $ x = array ('st1' = & gt; 'gd1', 'st2' = & gt; 'gd2'); $ Y = array ('st1' => gt; t1 '' whistle 3 '=> gt;' t3 '); $ Z = $ x + $ y; Var_dump ($ z); Result array (3) {["st1"] = & gt; String (3) "GD1" ["st2"] = & gt; String (3) "gd2" ["st3"] = & gt; But how does this work? For example (I have been guessed): $ x is first parsed and added to $ z, while $ parsing Y, the PP interpreter thinks the key 'ST1' exists (Which means the priority of $ x is more than $ y), and does not override it and add 'st3' and try not to assume it. Just want to make sure I have misunderstood it ... If the keys are numeric, then all the values ​​will appear in the new array. If the keys are string, d...

javafx - Java MediaPlayer totalduration unknown -

I have a short question I am creating an audio player, but I have a small problem when I Use: Duration Period = this.mediaplayer.getTotalDuration (); The period will become unknown, then I have tested, media media player is not zero. Does anyone know how can I fix this problem? Thankyou very much. you mediaPlayer.getCurrentTime () getTotalDuration receives total playback period including all chakras (repetition). getCurrentTime retrieves the current media time

python - get input file name and file extention using flask -

का कहना है कि मेरे पास & lt; input name = "upload" type = "file" & gt; और मैं picture.jpg को अपलोड कर रहा हूं। सवाल यह है कि मैं फाइल का नाम + extention कैसे प्राप्त करूं? दूसरे शब्दों में request.files.filename या request.upload.filename जवाब मिला request.files ['upload']। फ़ाइल नाम फ़्लास्क में फ़ाइल नाम और विस्तार देता है

java - Logback eclipse RCP configuration -

मेरे पास एकाधिक प्लगिन के साथ ईक्लिप्स ई 4 प्रोजेक्ट है I मेरे पास एक ch.qos.logback प्लग इन है जिसमें निम्न शामिल हैं: लॉग-क्लाच-क्लासिक-1.0.11.jar लॉगबैक-कोर-1.0.11.jar slf4j-api-1.7.5.jar इसमें मुख्य अनुप्रयोग पैकेज जिसमें .product फ़ाइल है मैंने उस src फ़ोल्डर के अंतर्गत एक लॉग-बैक-test.xml फ़ाइल रखा है जिसमें: & lt; एपेन्डर नाम = "STDOUT" class = "ch.qos .logback.core.ConsoleAppender "& gt; & Lt;! - एन्कोडर को निर्दिष्ट किया जाता है ch.qos.logback.classic.encoder.PatternLayoutEncoder डिफ़ॉल्ट रूप से - & gt; & LT; एनकोडर & gt; & Lt; pattern & gt;% d {HH: mm: ss.SSS}% -5 लेवल [% धागा] [% लकड़िया {50}] -% msg% n & lt; / pattern & gt; & Lt; / एनकोडर & gt; & Lt; / appender & gt; & Lt; एपेन्डर नेम = "डेब्यूफ़ाइल" वर्ग = "ch.qos.logback.core.FileAppender" & gt; & LT; फ़ाइल & gt; /tmp/Debug.log< / फ़ाइल & gt; & LT; संलग्न & gt; झूठी & lt; / संलग्न ...

c - Assert the allocation of a variable-length array -

I apologize for possible duplicate (can not find the answer): We need to make sure that allocation of a variable-length array is successfully completed? For example: zero func (int size) {int arr [size]; If (arr == NULL) {// exit with failure} and {// continue as planned}} It seems that the answer is yes Thanks Update: I accept the fact that I am sure It has not been done that the above code has been compiled (assuming it does this). If it does not compile, then it means that no one has a way to emphasize the allocation of a variable-length array. Therefore, I think that if the allocation fails, the program crashes immediately. This will be a very strange matter, because it makes sense for the event to crash after an illegal memory allocation (read or write). Or maybe the allocation will not be a reason, but as soon as I reach an array on an entry that "falls" out of the stack, I may have memory access violation (such as in stack-overflow W) ....

javascript - How to add option/ ListItem to dropdownlist dynamically -

I need to dynamically create my DDL, I get use of JSON from DSB (I any I do not get the problem ) but could not show my data in my DDL ... I tried three different ways, nothing is changing. What am I doing? // HTML and ATP: dropdown list id = "product ddl" runat = "server" css class = "ddl" & gt; & Lt; / Asp: dropdownlists & gt; // javascript function creatDDL (data) {var obj = $ .parseJSON (data.Data); (Var i = 0; i & lt; obj.length; i ++) {$ ("# Product DDL") for Attachments ("& lt; Option & gt;" + obj [i] .ID + "'-'" + + obj [i] .name + "& lt; / option & gt;"); $ ("# ProductDDL"). Attachments ("& lt; Option & gt;" + obj [i] .ID + "'-'" + obj [i] .name + "& lt; / Options & gt;"); $ ("# ProductDDL") .andend ($ (" gt; & lt; / options & gt;") .HTML (obj [i] .ID + "...

string - Position of a sublist in a list haskell -

OK, I am trying to write a function that determines the position of a string if the first one Say the suburbs of "Pie" is like a string and someone else like "Apple" will return to function 5, because the first letter of "pie" is in string "apple" on position 5 Can anybody do this? See the question it was told a few days ago (and answered) and your problem My solution: findStr :: string - & gt; String - & gt; Maybe int findStr pat str = findStrHelp pat str 0 where findStrHelp _ [] _ ​​= nothing FindStrHelp pat s @ (x: xs) n | Pat == (le (length pat) s) = bus n | Otherwise = Search SRTLP Pat XS (N + 1) To get this code without possibly getting, just remove the findStrHelp _ [] _ ​​ and With just n , n can also be with typing sign int .

sql server - How to reach maximum of product -

I'm new to Esquilla and I'm trying to write a query that multiply with maximum two separate columns Takes it. / P> A table is called a portfolio and the amount of shares purchased is done. The other table is called investment and the price is paid. After multiplying the two values, I am trying to get the highest (maximum) purchase price. Any help would be appreciated. Assuming that you are the maximum you want, and that the price is stored in the investment table ' Quantity 'column and the number of shares purchased is the' amount 'column on the portfolio table, and that the link between portfolio and investment tables is' port_id' You want something like this: SELECT MAX (t2.mount * t1.quantity) AS 'Maximum Purchase Price' Investment T1 JOIN Portfolio T2 ON t1.port_id = t2.port_id If you have more The need then you can add them in the SELECT list and you Group will add by (lots of posts related to this). Hope it helps!

linux - How to use Bash (sed or any other) command to insert at EOF-nth line -

I searched in stack overflow, but, I did not find any solution. Try hard enough. I have a file containing this type of code - ... {... zero ABC () {if (condition) {x = y ; Z = 0; }}} / EOF I x = y; and z = 0; I want to insert some lines of code between . This can be done in 2 ways - Pattern x = y; and search for later do not find the lines in the file - NUMOFLINES = $ (wc -l some.txt | awk '{print $ 1} ') TOINSERTLINE = NUMOFLINES-5 Therefore, putting on the value of the tinselline. More optimal methods are welcome Answers answered from discussion - sed -i > strong> anubhava . These were closest to what I wanted. If you want to insert a line after the 5th line sed : Data from here to enter data-file 'file sed -i.bak $ data- file File

ios - Objective C - SKNode subclass to 'swallow' touches? -

I am trying to subclass a sqn so that when you its frame (touch) , it has been notified by the Chittegabian :: method. However, it seems that it will be notified only when someone SKSpriteNode has touched the child. I tried to override the included in : method but not with success. Here is my code: @interface gameNode: SKNode {SKSpriteNode * MainChar;} @ Property (weak, non-nominal) id & lt; gameNodeDelegate & gt; representative; @end @implementation GameNode // When touched, touches: Method: Not being called method - (id) init {if ( Self = [super init]) {self.userInteractionEnabled = YES; maincars = [SKSPractnode node]; // When touched, touches: method called MainChar.color = [SKColor redColor]; MainChar.size = CGSizeMake (25 , 25); [Main move: [SKAK scale: 0 duration: 0]]; Main buyer = CP point make (100, 100); [Self linking child: chief minister]; SKSpriteNode * n = [SKSpriteNode node]; // When touched, then touches: method is called. N.size = mainChar.siz...

c# - Streaming jpegs via a web service -

I am capturing jpegs from an IP camera. I'm uploading it through a web service on my server. Then I render an image on a canvas. A user can see the speed through a browser. I was using 4 IP cameras on each channel 360x288 resolution. Byte array size is usually 15 kb. Switching to an IP camera with resolution of 720x576, payload of byte array for 4x multiplied single camera of 360x288. I looked into this question and answered it here: The person who answered the hidden shows that not using a byte array at all We do. Just stream it At present, I am using the WCF TCP binding and I was wondering how can I implement this streaming option in this setup? How do I use it for continuous pictures (as opposed to a video file)? How does the code look? I'm googling as my type, but what big bit array would be split into 2 smaller and upload seperalty and then recombine on server would be better? I am using c # I will suggest the streaming approach Because it is very ...

ruby - Creating multi-dimensional array of hashes -

I want to loop through a multi-dimensional array: array = [[1 , 2,3,4,5], [6,7,8,9,10]] and create a hash with keys from any other array: > hash = hash.new multirere = arrays.Anupate array.each do | Value | Key Values.Each | Key | I = Key value Index (key) hash [key] = value [i] at the end hash multiraure and lieutenant; & Lt; Hash ultimately puts multi-dimensional puts hash output: {"one" => 1, "two" = & gt; 2, "three" => 3, "four" = & gt; 4, "five" = & gt; 5} {"A" = & gt; 6, "two" = & gt; 7, "three" = & gt; 8, "four" = & gt; 9, "five" = & gt; 10} and the last is multiple : {"one" => 6, "two" = & gt; 7, "three" = & gt; 8, "four" = & gt; 9, "five" => 10} {"one" = & gt; 6, "two" = & gt; 7, "three" = & g...

Image creating in PHP/Javascript giving a grey output around the image -

Here's the link and to see what I'm saying. Demo: If I try to crop the image a lot, then this is the right size and correct image Will produce, but you can see the color around it. I do not know how to change it, here it is save.php ' which is said in Javascript: & lt; Php if ($ _ server ['REQUEST_METHOD'] == "POST") {// Image name $ name = sha1 (uniqid (mt_rand (), true)); // url = 'temp /' to save the crop image to the location $ Name '. Jpg '; $ Dst_x = 0; $ Dst_y = 0; $ Src_x = $ _POST ['x']; // Crop Start x $ src_y = $ _POST ['y']; // Crop Srart y $ src_w = $ _POST ['w']; // $ src_x + $ dst_w $ src_h = $ _POST ['H']; // $ src_y + $ dst_h // has set a specific size for the image / default to get the width and height from the crossed image is $ Dst_w = 240; $ Dst_h = 240; // base64 part $ base64 = $ _POST ['image']; // If the URL is a base 64 string (if substrate ($ base64, 0...

scala - Best practice for modifying collection attributes functionally -

I'm curious about how to implement a class that adheres to strict functional programming rules. For example, if I have a class in which there are two characteristics and I have a way that modifies them, how would I do this? The characteristics will be private vals, and the method will have to return a new instance of the attribute whenever it modifies it. It's okay, except I would like to keep it in vogue, that is, I need a way to set the value. What would be the best way to do this so that I do not have thousands of examples, a collection, floating in memory? This is my opinion, but; As classes of classes do, I will apply a code to the copy method to make amendments possible to maintain irreversible, but in some cases I can help to destabilize it. can not do ; For example, when something is expected that the copy operation is too big and slow for the classroom; Like when there are frequent revised members in the class and do not worry about thousands of instance...

operator overloading - Overload Python 'in' to return non-bool -

I overload the in operator to return a non-bowl object to a code Trying to do it, but it seems to be doing anyway. Here is my use case: class dataset (object): def __init __ (self): self._filters = [] DF filter (self, f): self._filters.append (f ) Returns Self Class Equal Filter (def): def __init __ (Self, Field, Val): ... Class Subfilter (object): def __init __ (self, field, wall): ... Class filter builder (object): def __init __ (self, area): self._field = area def __eq __ (self, val): return similar filter (self._field, wal) def __contains __ (auto, vals): return SubsetFilter (self._field, vals) veggie = FilterBuilder ('v The fruit = 'filter' ('fruit') DS = dataset (). Filter (veggie == 'carrot') (fruit in '[apple', 'orange']) ). At the end of the code, DS in the similar filter for veggie == 'carrot' , and true For in fruit ['apple', 'orange'] . subset for DS Here the real problem is that, as...

javascript - How to rotate div in circular motion while counter rotating inner circles? -

Image
I'm trying to get this image. Circles on the edges are clickable, its structure is such that each rotation will be equal to 45 degrees Celsius. I will rotate the property for CSS Transaction Rotation. How should this work? When we click on any circle on the edge it should come into its active state and it should always be rotated in clockwise direction. What I have done here I received rotation assigning numbers to the boards that is, if 7 is clicked on the number then it rotates by angle (9-7) * 45 = 90 . (This time I have not changed the numbers dynamically, that is, the Circle circles are moving around.) It works fine here. But, look at this scenario: When we click on second place, it rotates by 315 degrees and then if you click again on the same (second) position, it will make an angle of 270 and it will be clockwise in the wall Rotate direction I think this is his behavior but, I do not want to be like that. It should be rotated in the clockwise directio...

html - Make small pages fill browser height -

How do you make small pages to fill the height of the browser so that the footer is not in the middle For example & lt; Body & gt; & Lt; Div data-off scan = "off canvas-wrap" & gt; & Lt; Div class = "inner-rap" & gt; & Lt;% = Render 'Layout / Navigation'% ' & Lt; Section square = "main-section" & gt; & Lt;% = Render 'Layout / Message'% & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "large -12 column" & gt; & Lt;% = yield% & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Section & gt; & Lt; Div class = "footer-bottom" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "small-12 column small-center text-center" & gt; & Lt; Ul class = "foot-link" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; About & lt; / A ...

python - Closing a file descriptor I've used with fdopen -

what, if anything, then I need to close the file descriptor from os.open Is needed by I / code> and later is used with OSFodeDown ? OSError I get the code given below, I think the answer can be "nothing", but I do not get confirmation in the docs. fd = os As a file with Open (OS) path.expanduser ("~ / desktop / foo"), OS FDOPIN (FD, "WT"): Pass oscillos (FD) # OSER: [Eran 9] in Python 2 and usually On Python 3, the file is the owner of the FDOPPIN C standard IO file descriptor when the file closes with the fclose , the underlying descriptor also stops. Is locked at the end of the block with . Linux Manu The FDOPN () function combines a stream with the existing file descriptor, the mode of the FD stream ("R", "R +", "W", "W +") , "A", "A +") should be compatible with the mode of the file descriptor. The file stream of the new stream is related to the indicator FD, and the error...

What is a resolver (specifically in C#) -

There is a question about the new C # (and in general programming) and opponents: What is the meaning of solving an assembly (ie .dll file)? In fact, I am trying to integrate our custom CRM with the sage and I have been told that before I can join the sage DB, I need to find out a special conference and solve it before I resolve all other relevant assemblies. I know that is unclear but this is a very common question, so I'm hoping someone can help me! Please note this is in C #. Resolving an assembly means finding and loading it. If the assembly is not strong, then the steps given are given to resolve it: Try loading in the Appbase directory (where the application is hosted) Try to load them from the subdirectory of Appbase with the same name of the assembly (like Appbase / Acme / acme.dll) Loading from additional directories specified in assembly.exe.config (xcopy deployment) Try If the assembly is strong, then check the calor The sign is also in GAC and che...

Jquery solution like on played.to -

How can I get such a site behavior? I mean, when you scroll a Skype, automatically jump to the next header with a nice smooth transition. Is there any solution available to do this? After finding a search through the page code, I found a solution, here it is: Hope you find it useful.

html - Add text to empty label in div without adding height to div -

The problem is that there are some inputs between the CSS line from the separator, they are all vertical, and labeled below the input. The problem is that when there is a verification error, some text is kept inside this label, which makes it visible, it makes the div bigger and the container gives the height to the divas, So the input is no longer aligned vertically. Is there a way that the label already has a different height than zero when there is no text? Is this help? Jsfiddle: Approach 1 In this solution, a fixed height is given according to the labeled cart size of the label. html & Lt; / Div & gt; & Lt; Div id = "labDiv" & gt; & Lt; Label id = "laboratory" & gt; & Lt; / Label & gt; & Lt; / Div & gt; & Lt; Div & gt; & Lt; Input type = "button" value = "show content in label" id = "showLab" /> & Lt; / Div & gt; CSS #labDiv {height: 18px;...

javascript - Cant find Jquery UI dependencies using Bower, Jquery UI, and RequireJS -

I am using a Jquery UI, Bower, and RequireJS in a project and in need to configure Jquery UI The difficulty is coming. Actually Jquery UI is trying to find its dependencies in the root directory, and where not located, giving me an error I understand 1.11 as Jquery UI supports AMD and Document notes This works with a directory such as: ├── index.html ├── js │ ├── App.js │ ├── jquery-ui │ │ ├── accordion Js │ │ ├── autocomplete.js │ │ ├── button.js │ │ ├── core.js │ │ ├── datepicker.js │ │ ├── dialog.js │ │ └── ... │ ├── jquery.js │ └── require.js However, Using God, directory More ├── index.html ├── JS │ ├── app.js | ── Bower_comannants │ ├── jquery-ui │ │ ├── accordion.js │ │ ├── autocomplete.js │ │ ├── button.js │ │ ├── core.js │ │ ├── datepicker.js │ │ ├── dialog.js │ ├─ Jquery │ │ ├── jquery.js │ └── is required │ │ ├── require.js requires a configuration so that Jquery Can UI get your dependency? I was working partially via aliasing bower_components with path at...

java - Is it necessary to execute a task on Hadoop DataNode? -

क्या यह हैडोप काम करता है? क्लाइंट MapReducer नौकरी / प्रोग्राम को NameNode सबमिट करें। JobTracker (पर रहता है NameNode ) व्यक्तिगत कार्य मशीनों (दिनांक नोड्स) पर चल रहे गुलाम कार्य ट्रैकर्स को कार्य को आवंटित करता है प्रत्येक कार्यचैकर पर क्लिक करें नोड क्या इसका अर्थ है कि जॉब स्लेव कंप्यूटिंग इंजन या प्रोसेसिंग पावर का उपभोग करने वाला है। क्या होगा अगर मैं किसी अन्य मशीन का उपयोग करना चाहता हूं ( Hadoop स्थापना प्रणाली) क्लस्टर? Hadoop अपने DataNode (s) के लिए एक बहुत ही कुशल तरीके से बड़े डेटा वितरित करता है। नया परिदृश्य निम्नानुसार होगा: । सर्वर b क्लाइंट a.1) Hadoop क्लस्टर्स b.1 का उपयोग करते हुए अनधिकृत डेटा वितरित करें। क्लाइंट निष्पादित करेगा (NameNode को सबमिट नहीं किया गया) एक MapReducer नौकरी जो Hadoop क्लस्टर डेटानोड से डेटा प्राप्त कर रहा है। यदि यह संभव है तो जॉबट्रैकर (NameNode) और टास्कट्रैकर (DataNode) का क्या होगा? मैं Hadoop के प्रमुख भाग की अनदेखी कर रहा हूं यहां पर क्लाइंट मशीन पर नौ...

ubuntu - Python not importing correctly after upgrade to 14.04 -

I can not import import module from standard library with C extension. This happened after upgrading from U.0.0.0.0 to Ubuntu 14.04. I have tried to re-install Python, Python, but it is not being assisted I have seen other people with similar posts, but they all use virtual, while I use it all I'm not doing Python 2.7.3 (default, 1 August 2012, 05:16:07) [GCC 4.6.3] Type linux2 on "help", "copyright", "credit" or " License "for more information. & Gt; & Gt; & Gt; Import pickle, email, JSON, readline, socket, turtle and gt; & Gt; & Gt; Import ctypes traceback (most recent call final): File "& lt; stdin>", line 1, & lt; Module & gt; The file "/usr/lib/python2.7/ctypes/__init__.py", line 10, & lt; Module & gt; _ctypes Import association, structure, array import error: no module _ctypes and gt; & Gt; & Gt; Import io traceback (most recent call final): File "...

unity3d - Finger Touch instead of First Person Character -

Probably very easy but ..... this script is working well, it is from Boris Media When it shows a text entered in the character box collider, I do not use characters that I am using a 3D model so that the user must touch the model, should not run through the game. thank you in advanced. #pragma strict var Note: GameAbject; Start function () {note.SetActive (wrong); } Function OnTriggerEnter () {note.SetActive (true); } Function OnTriggerExit () {note.SetActive (false); } Here is an example in C # , but If you need it then there can be no difficulty in converting to javascript : vector 2 touchposs = input. Gatecht (0). Legislation; Ray ray = camera. ScreenpointTorai (new vector 3 (Touchpos.ex, touch.p.a., 0)); Reit Hit Hit; If (Physics. Recast (ray, out hit)) // The user's touch has collided with some, now we have to see who collided with it. You can also use hit points if you want to get touch status in the world (hit.collider.tag == "GameObjectTag") {Deb...

python - Find the last substring after a character -

I know how to find a substring: from start index to letters between the end, etc., but I have problems Which I do not know how to solve: I have a string, for example a path: folder1 / folder2 / folder3 / new_folder / image.jpg and another path: folder1 / folder2 /folder3/folder4/image2.png And from this path I only want to take the previous parts: image.jpg and image2.png . If I do not know when it starts (I do not know the index, but I think it will be after the last / character) How can I get a substrings, if at times Letter repeats ( / ) and extensions are different ( .jpg and .png even more)? os.path.basename () Returns the file name of your path: & gt; & Gt; & Gt; Import os.path & gt; & Gt; & Gt; Os.path.basename ('Folder 1 / folder2 / folder3 / new_folder / image.jpg') 'image.jpg' For a more common string splitting problem, you use to split The string on the given alphabet sequence count from the end : ...

Wait for an input BATCH -

Do I want to wait for some time input to have a bat file. If there is no input then I want to get it some adee Even so far I have. @echo off: START cls timeout 10 sets input = set / p input = amount of RAM: '% input%' == '% input%' Geto CraftBookKit: Fallback "C: \ Program Files \ Java \ jre7 \ bin \ java.exe "-Xmx4G -jar"% ~ dp0craftbukkit Jar ": CRAFTBUKKIT" C: \ Program Files \ Java \ jre7 \ bin \ java.exe "-Xmx% Input% G - Jar "% ~ dp0craftbukkit.jar" GARTA START options Use / t with command: @echo off: START cls errorlevel = 0 option / i "message:" / t10 if '% errorlevel % '=='% 0% 'Geto CraftbookKit: Faw Back "C: \ Program Files \ Java \ jre7 \ Bin \ java.exe" -Xmx4G -jar "% ~ dp0craftbukkit.jar": CRAFTBUKKIT "C: \ Program Files \ Java \ jre7 \ bin \ java.exe" -xmx % Input% G -jar "% ~ dp0craftbukkit jar" Geto Start To learn more in CM...

Add an unique ID into an existing MySQL table -

विज़िटर तालिका --------------------- ---------------------------------- आईडी (auto_incr।) | आईपी ​​| आईएसपी | गिनती | समय | (आईएसपी_आईडी) ----------------------------------------------- -------- मेरे पास यह MySQL तालिका है जिसमें सभी अनन्य आईपी पतों और एक आईपी ने आईपी जैसी अन्य आईपी जानकारी जैसे समय पर आईपी वेबसाइट का दौरा किया है आदि। मैं isp_id नामक एक और कॉलम कैसे जोड़ सकता हूं, जो हम प्रत्येक आईएसपी के लिए अद्वितीय होगा उदाहरण के लिए, यदि कोई विशेष आईएसपी 10 बार मौजूद है, आईएसपी_आईडी इन आईएसपी के लिए एक समान होगा, और अगर कोई अन्य आईएसपी 2 बार मौजूद है, आईपीआईआईडी एक से बढ़ेगी। मैं यह कैसे प्राप्त कर सकता हूं? मेरे खराब अंग्रेजी के लिए क्षमा करें। मैं अल्बानिया से हूं। कई प्रश्न शामिल हैं, आप यहां एक प्रदर्शन देख सकते हैं: संक्षेप में, चरण 1 ISP को पकड़ने के लिए एक तालिका बनाने के लिए है (एक आईपी प्रति पंक्ति): तालिका isps बनाने के लिए (id int नल auto_increment, isp_name varchar (20 ), प्राथमिक कुंजी (आईडी)); आप वर्तमान में आपके विज़िटर तालिका पर मौजूद...

How to make a jQuery slider loop -

I have the following code for a slider and it works right but the slider closes after moving images from the previous image I want to make this slider loop infinitely. The code is: & lt; Script type = "text / javascript" & gt; $ (Function () {setInterval ("rotateImages ()", 3000);}); Function rotate images () {var oCurPhoto = $ ('# chica div.current'); Var oNxtPhoto = oCurPhoto.next (); If (oNxtPhoto.lenght == 0) onNxtPhoto = $ ('# chica div.first'); OCurPhoto.removeClass ('Current') addClass ('Previous'). Anxaxus ('on'). Animate ({opacity: 1.0}, 2000, function () {oCurPhoto.removeClass ('prevailing');}); $ ('#paintings'). Animate ({"left": "= 0"}, 1000); } & Lt; / Script & gt; This is HTML: & lt; Div class = "current" & gt; & Lt; A href = "#" & gt; & Lt; Img src = "galeria_1.jpg" alt = "Galleria de Imagens...

c# - How do I rewrite this SQL query in LINQ format? -

I have a SQL query that returns the surrounding rows for a given ID. So we say that I'm trying to find 3 rows for a given media id of 8000. (Previous row, current row, next line). I am also not sure if this is the best way to get my results here on any of those results: SELECT * (SELECT TOP 1 * Media where MediaIDype = 1 and MediaID & lt; 8000 Order Media Select ID DESC Union * MediaID = 8000 UNION SELECT TOP 1 * Media where mediaTipid = 1 and Media ID> 8000) TBL by order of TBL. Media ID I am importing this query into a C # web application and would like to convert the query to LINQ format. I am struggling with this. I think IM is off . Here is my LINQ code: // Previous record, get current record, next record var result = (in DB from M. Media where m.mediaiatid = = 1 & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; एमडीआई & lt; 8000 orderbay M. media descending selection M). Take (1). Union (from DB Media in M, where M. mediaid == ...

c# - string capturing before / symboal -

इस सवाल का पहले से ही एक उत्तर है: 5 जवाब कहें कि मेरे पास एक स्ट्रिंग है : स्ट्रिंग a = "abc और dcg / foo / oiu"; अब मैं आउटपुट को चाहूंगा "abc और dcg" मैंने कोशिश की है: स्ट्रिंग आउटपुट = a.Substring (a.IndexOf ('/')); लेकिन यह पिछले हिस्से को वापस नहीं देता मैंने कोशिश की है trim () भी, लेकिन मुझे प्रदान नहीं करता परिणाम के साथ। इसे आज़माएं: स्ट्रिंग परिणाम = a .Split ( '/') [0] .Trim (); विभाजित ऑपरेशन आपको '/' से अलग 3 उपस्ट्रिंग देगा और आप इंडेक्स को निर्दिष्ट करके जो भी चाहते हैं उसे चुन सकते हैं।

mysqli - PHP - call_user_func_array return a warning -

मेरे कोड का पालन करें: $ query = mysqli_prepare ($ res, $ my_query); विदेशी मुद्रा ($ कुंजी के रूप में $ डेटा = & gt; $ मान) {$ डेटा [$ की] = & amp; $ डेटा [$ की]; } Call_user_func_array (ऐरे ($ query, 'bind_param'), $ डेटा); mysqli_stmt_execute ($ क्वेरी); mysqli_stmt_close ($ क्वेरी); क्वेरी काम करती है, लेकिन मुझे लॉग में एक चेतावनी मिली: call_user_func_array () का मान 1 पैरा मान्य कॉलबैक होना मेरा PHP संस्करण 5.5 है। इसे कैसे हल करें? call_user_func_array ([क्लासनाम, विधि], सरणी $ तर्क); समस्या यह है कि पैरामीटर 1 आपके मामले में एक वस्तु है। यह काम करना चाहिए call_user_func_array (सरणी ('mysqli_stmt', 'bind_param'), $ डेटा); फार्थर, mysqli_prepare त्रुटि पर गलत लौटाता है, ताकि कॉल करने योग्य न हो।

pubnub - Number of channels and billing -

I am looking for an app that monitors public transport buses for a major city: I have a quick prototype using the public, GPS signal is sent to a channel near buses, and users simply have phones subscribing to channels. I have questions: I'm planning for each bus route, one channel There are 50 routes in the city, so there are 50 routes. Does it follow the best practice? Is there an API to list the channels? I am sending a message to each other that each channel assumes that there are 50 routes with 5 buses running every 24 hours. 216000000 daily messages will be charged for one day? Does your Android client publish a network connection each time? I want to reduce the bandwidth used by the phone that transmits GPS signals. The bus users often want to see the location of buses. I know the best practice is to subscribe to a public and a private channel What is the best way to do this? If you can answer the above questions then I appreciate it. full di...