Posts

Showing posts from May, 2010

python - Why is the assert not getting imported here -

I have a case for the following unit testing. Import from webpage Connect toTest UTis Import webpageTeast Processor class webpage Utilitest (Unittest.TestCase): def setup (self): self.webPageTestProcessor = WebPageTestProcessor () def test_submitTest (self): url = None; Criterion (self webpage testprocessor submitTest (url), none) If __name__ == '__main__': unittest.main () After execution, I get an error saying. Name Error: The global name 'assertEqual' is not defined I am united to substate.TestCase, then why does not recognize the dragon identity This is a method on self: self .assertEqual (Self.webPageTestProcessor.submitTest (url), none)

ajax - How to load 5 pages without refresh with side bars on drupal -

I'm a newbie for Drupal, now I am working in Doppel CMS. Now I need to refresh the content of 5 nodes (pages) in one page and without the parent page side bar. Like the link below like this Click me on how I can help this link and go down to find tabs in advance Thank you You can try this one This module is serving according to your specifications.

javascript - Tooltip title on image using mouseover? -

I want to display an element title on image (tooltip size). I got the title of the current element $ ('. DownloadPdf'). Mouseover (function () {var currentelement = $ (this) .attr ('title');}); Download is common category on PDF elements. Actually I have a menu bar below in which I have some icons These icons are functional here I want whenever a user enters these symbols, their title should be on the image. This image is nothing, just a tooltip figure. But how to add it to the image? And its position will only be on the element. So how do I get this status? So, spoil and spend at least 3 hours on this small task. Any help would be appreciated. I'm pretty bad when I come to use CSS effectively. OK to add the title attribute to your image and the simplest The easiest way to hover this image will be the reason for the original browser tooltip to show on the image. Check it out (keep your mouse cursor over the image of pdf-icon). In addition, t...

osx - The size of QPushButton breaks layout height (MacOS) -

Image
Consider the situation with QFormLayout. For example, the button needs to add buttons to the layout row: As you see, the height of the layout with the button is greater than the height of the other rows, because the height of the button is higher than the editor's height - the space around the button is: As a result all layout with QPushButton gets broken. In the standard dialogue (QMessageBox) there are large margins around the button in the bottom of the window. As I know that this problem is only relevant to MacOs there are some similar issues and, but there is no answer to what is the shape of QPushButton on Mac, and how to fix it correctly. IMO is the problem with this margin (changing the margins) used with different style (used on OSX) Try typing it by setting a style sheet: pushbutton-> setStyleSheet ("QPushButton {\ n" "margin: 2px; \ n" "} \ N ")

bash - find file with "find" just giving one result -

I try to find a file using the command, but in fact I do not see what I'm doing : Find -Name "Rand *" So I want to search with the current directory in all the subdirectories, and the name is not exactly specified but by Rand To start, well find gives me only one hit, after which it is only counting Closes, something else happens, and I'm sure you hit more than one for this search. So really do not know how to change the command, I get all hits

java - How to form Insert query dynamically in this case -

I have an input string that is shown separately with the @ symbol popcorn @butty I have a table as shown mysql> Description document; + ----------------- + ------------- + ------ + ----- + ---- ----- + ---------------- + | Field | Type | Faucet Key | Default | Extra | + ----------------- + ------------- + ------ + ----- + ---- ----- + ---------------- + | Document_id | Int (11) | No | PRI | Faucet Auto_interpretation | | T1 | Varchar (50) | Yes. | Faucet | | T2 | Varchar (50) | Yes. | Faucet | | T3 | Varchar (50) | Yes. | Faucet | | T4 | Varchar (50) | Yes. | Faucet | | T5 | Varchar (50) | Yes. | Faucet | | T6 | Varchar (50) | Yes. | Faucet | | T7 | Varchar (50) | Yes. | Faucet | | T8 | Varchar (50) | Yes. | Faucet | | T9 | Varchar (50) | Yes. | Faucet | | T10 | Varchar (50) | Yes. | Faucet | | Vendor_brand_id | Varchar (10) | Yes. | Faucet | | Vendor_id | Varchar (10) | Yes. | Faucet | + ----------------- + ------------- + ------ + ----- + ---- ----- + ----------------...

Creating a sass map value from within a mixin - saved globally -

इस सवाल का पहले से ही एक उत्तर है: 2 जवाब क्या यह अपडेट करना संभव है मिक्सिन के भीतर से एक सास नक्शा में मान जिससे कि विश्व स्तर पर बदलाव बच जाएंगे? उदाहरण $ obj: (init: false) @mixin set ($ map) {@if map-get ($ obj, init)! = True {// mixin $ नक्शा से पहले नहीं बुलाया गया है: मानचित्र-सेट ($ नक्शा, init, true); } @else {// mixin को पहले बुलाया गया है}} .test {@ सेट ($ obj) शामिल है; // सही में init मान सेट करता है} .test-2 {@ शामिल करें ($ obj); // init मूल्य पहले से ही सही पर सेट है} मुझे यकीन नहीं है अगर मैं समझता हूं कि आप क्या करने की कोशिश कर रहे हैं, लेकिन आपका कोड ठीक लग रहा है (हालांकि यह परीक्षण नहीं हुआ है), सिवाय इसके कि इसमें कोई नक्शा सेट फ़ंक्शन नहीं है, लेकिन आप एक या सिर्फ मानचित्र-मर्ज का उपयोग कर सकते हैं (यहां जांचें: )। मुझे उम्मीद है कि मदद करता है। @ अद्यतन 1: मुझे लगता है कि मुझे अब आपका सवाल मिला है, आप मिश्रण के माध्यम से संदर्भ पास करना चाहते हैं, इसलिए यदि आपके पास कई मानचित्र हैं, तो आप जो आपको मिक्सिन में अपडेट करना चाहते हैं उस...

sql server - How to copy branch with hierarchyid? -

Image
मेरे पास फ़ील्ड के साथ एक साधारण तालिका है: catalog_id hierarchyid नल अद्वितीय, item_id int नहीं शून्य पहचान (1,1), आइटम_नाम एनवर्चार (50) नल, मुझे एक संग्रहीत प्रक्रिया बनाने की ज़रूरत है जो शाखा को किसी अन्य अभिभावक से कॉपी कर देगा। उदाहरण के लिए, ऐसा कुछ: मैंने एक शाखा को एक अभिभावक से स्थानांतरित करने की प्रक्रिया की है दूसरे के लिए, यहां यह है: वैकल्पिक प्रक्रिया [dbo]। [Move_child] @ चाइल्डआइएनआईटी, @ न्यूपेरेंटआईडी एएनएस के रूप में अनिर्धारित @ नामित पदानुक्रम, @ एनएनयू पदानुक्रम का चयन करें @nold = catalog_id कैटलॉग से जहां धरती Item_id = @ChildId सेट ट्रांसलेशन एस्लोमेशन लेवल सिरिअलज्याबल ट्रांस्सेक्शन का चयन करें @nnew = catalog_id से कैटलॉगसैट्री WHERE item_id = @NewParentId का चयन करें @nnew = @ nnew.GetDescendan टी (अधिकतम (कैटलॉग_आईडी), नल) से कैटलॉग टीरी WHERE catalog_id.GetAncestor (1) = @ nnew; अद्यतन कैटलॉगट्री एसईटी कैटलॉग_आईडी = कैटलॉग_id.GetReparentedValue (@nold, @nnew) WHERE catalog_id.IsDescendantOf (@nold) = 1; कॉममिट ट्रांस्नाइक्शन लेकि...

html - Text positioning in div -

Image
I have to put a zoom picture on my image, and I have tried a lot of ways, but I can not understand it Outside, please help me ... Image "lupe" should be at the top of the image "boy" It should look like this: HTML: & lt; Div class = "section 4" & gt; & Lt; Div class = "content4" & gt; & Lt; P & gt; & Lt; Span style = "font-size: 30px; color: # fdd400" & gt; Nives & lt; / Span & gt; & Lt; / P & gt; & Lt; Img style = "width = 34px; height: 34px;" Src = "picture / lupe.png" /> & Lt; Div class = "pic 1" & gt; & Lt; Img src = "picture / div4-boy.png" /> & Lt; Div class = "text1" & gt; & Lt; P & gt; & Lt; Span style = "font-size: 30px; color: # fdd400; float: left; margin-top: -2%;" & Gt; Loram advertising & lt; / Span & gt; & Lt; / P & gt; & Lt; Br...

android - Pull to refresh is now working properly if buttom half of the screen is listview -

Image
Drag to refresh is now working properly if the lower half of the screen is the list view, when I pull it I try it is not greasy, it jerks. .

PHP Sum Up the value of textbox -

How to submit and display the value of the text box For example, the value of the textbox is 1 and 2 and the second text box 3 will display. Please help me solve the problem. Thanks ~ $ name = $ row ['name']; $ Data2 = mysql_query ("Choose * FROM tblstockmgt WHERE ItemName = '$ name'") or die (mysql_error ()); While ($ row2 = mysql_fetch_array ($ data2)) {resonant " gt; & lt; / td & gt; } just create a varabile $ total and always incrase After this, and loop, type the value into a text box: $ total = 0; While ($ row2 = mysql_fetch_array ($ data2)) {resonant " Input gt; & lt; / td & gt; $ Total + = $ line 2 ['value']; }? & Gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> Total: & lt; Input type = "textbox" name = "total" value = "& lt ;? php echo $ total ;? gt;" / & Gt; & Lt; / TD & gt; & Lt; / TR & gt; Avoid SQL injection, av...

java - Several forms in a JSP page: how to avoid duplicated ids and tedious parameter processing at the same time? -

I have a JSP page which displays a list of items, each one with a form that allows the user to The changes made by the user of the data of this item are processed by the servlet. Right now, the JSP page generates invalid HTML, because every input of each form shares the same ID. I can add some suffix to each ID, but then on the servlet side that collects all the parameters The code calling is not as easy as the request. I can use the request GetParameterNames () and think which input is the ID per its prefix, but I think it looks ugly and this is probably a bad code. Am I missing a better solution? Right now, JSP pages generate invalid HTML, because every input of each form is same ID is shared IDs are not considered here because the request.getparameter ("name") requires the attribute name. So make sure that you have unique name for input in various forms. Many forms in the JSP page: How to avoid duplicate ID and tedious parameters processing at the ...

javascript - Using d3 transitions causes memory leak -

I d3.js. Created the scene with the help of. Visualization uses a lot of changes (like show / hide / move element) I saw a high CPU load and a large increase in memory over time, after some time the visualization made very slow. So I removed the change, or replaced it with a self-made transition function with a slow frame - evaluate. Unfortunately, deleting all infections is not an option because this will give less visualization to the presentation. The rest is the transit circle which is increasing / decreasing the circle radius. Still the memory leak seemed, mostly appearing in Chrome (20,000 windows task manager between 10 minutes). So I wonder if it can happen that the transition itself is causing the memory leak. To check this, I have created a JSWDB to see if a similar change will show results alone. And it does: When running in Chrome, memory increases to 9,500 per 10 minutes (depending on Windows Task Manager). g_svg = d3.select ("# visualization"). (...

c - Why this for loop starts from half and not prints out every thing? -

I am learning C, I have written a program that allows the user to enter an initial number and end the number , And it tells the number from the starting point to the last digit. For example, if a user enters 5 as the starting number and gives 10 as the ending number, then it prints 5 6 7 8 9 10. Here's the code: - #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Int main () {int start; intend ; Int counter; // Initial number ask printf ("Enter initial number:"); Scanf ("% d", and start); // Final number ask printf ("Enter last number:"); Scanf ("% d", and end); (Counter = start; counter & lt; = end; counter ++) {printf ("% d \ n", counter); } Return 0; } The above code runs entirely for short interval numbers (like 5 to 10, 1000 to 1025), but whenever I type in a large number like 100 to 500 digits I print it numbers, starting from 205 to 500, even I scroll, I can not get the numbers from 100...

javascript - node.js / Https with express -

मैं node.js में https के साथ एक्सप्रेस का उपयोग करने का प्रयास करता हूं। इस हिस्से के लिए यहां प्रासंगिक कोड: var express = require ("express"); Var ऐप = एक्सप्रेस (); Var https = की आवश्यकता होती है ('https'); Var निजीकी = fs.readFileSync ('./sslcert / mykey.key', 'utf8'); Var प्रमाण पत्र = fs.readFileSync ('./sslcert / mssl.crt', 'utf8'); Var क्रेडेंशियल्स = {key: privateKey, cert: certificate}; Https.createServer (क्रेडेंशियल्स, ऐप) .listen (5008, फ़ंक्शन (रेस्क) {console.log ("सुनो:" + पोर्ट)}); कंसोल में, यह सुनो: 5008 प्रिंट करता है, लेकिन मुझे नहीं लगता कि मेरे सर्वर को कोई भी अनुरोध मिलता है, भले ही मैंने कुछ भेजा। जब मैं एसएसएल एक्सटेंशन के बिना एक्सप्रेस का उपयोग करता हूं, तो सबकुछ ठीक काम करती है। संपादित करें: यहां जो कोड है जो 5008 पोर्ट के साथ ठीक काम करता है , लेकिन एसएसएल भाग के बिना: var एक्सप्रेस = अपेक्षित ("एक्सप्रेस"); Var ऐप = एक्सप्रेस (); App.listen (5008, कार्य ()...

javascript - More modular; include html elements in .js file? -

I have a page that has many buttons to take action with JavaScript. There is no problem here, just an HTML page and multiple .js file, for each action to separate a .js file stuff and make everything a little more manageable. I will write a script to add them all together in the deployment. Many of my JavaScript functions require html elements to work. For example, color.js needs a div with elements to change color so that the user can change the color and press the button to save the changes. Color.js does the function on-click buttons and in this way. there is no problem. There are many JavaScript actions using many HTML elements, then there is a problem. All these HTML elements should be inserted into an HTML page. This makes things complicated, for example, when I change the color field ID, I have to make changes by going to color.js. Apart from this, I want to find html elements in my huge HTML page and also change it. Can my javascript actions contain the required HTML ...

php - Foreach variable to update databse wordpress -

How can a database be given to update the database? If instead of one variable, I give numbers, okay, I think this is a mistake. global $ wpdb; $ Wpdb- & gt; Teams = $ wpdb-> Prefix 'Thames'; $ Retrieve_data = $ wpdb- & gt; Get_results ("SELECT * FROM $ wpdb- & gt; teams where middle = 'ni' '); Foreign exchange ($ retrieve_data $ as recovery_data) {echo "form method = 'post' 'gt; & lt; table & gt; & lt; tr & gt;"; Echo "& lt; td & gt;" $ Recovered- datas-> Id. "& Lt; / td>"; Input type = 'hidden' name = 'id' & gt; "$ Recovered." And "input id". & Lt; / Input & gt; Input = 'Submit' value = 'OK' /> & Lt; / Td> "; Echo" & lt; / Tr & gt; & Lt; / Table & gt; & Lt; / Form & gt; ";} $ Id = $ _POST ['id']; set type ($ id, 'int'); $ wpdb- &...

javascript - Expand and Collapse with Slide Animation -

Image
I want a clickable text with sliding animation. I currently have: Javascript: ( expand-collapse.js ) $ (document) Ready (work () ($ (".content"), hide (); $ ("title"). Click (function () {var header = $ (this); header.next ("content") Slide toggle (250);});}); HTML: LT; style & gt; .heading {cursor: indicator; thickness of fonts: bold;} & lt; / style & gt; & lt; script src = "js / jquery-1.11.1.min.js" & gt; & Lt; / script & gt; script src = "js / expand-collapse.js" & gt; & lt; / script & gt; & lt; / head & gt; & gt; body & gt; & lt; Lt; div and Image = "Heading"> View SEAT map (extension / collapse) Output: See SEAT MAP (Expand / Collapse) So far, it spreads and falls as it should, Instead of having a static text instead of all the time, I want to say it See Seat MAP ( Istar) seat MAP (compressed) See EXPAND and COLL...

python global parameters file -

I have a python script that calls many functions from other scripts. I give the script as a parameter in the form of a setting file as this: var1 = XXX var2 = YYY ... I would like to make those variables global so that I can use them in every celebration but without having them clear clearly, what is the best way to do this? Thank you. The simplest way the module (such as settings.py ) Recommended. You define the variables in the module only and they will be available for any module that is settings.var_name via the settings module. Example: File settings.py : var_name = "value" File m.py : #! A preferred method is to use the environment (the hair process handles the environment) to pass it in a global context. You can use it for this purpose. An example of how to do this: File a.py : File b.py / code> : import os def echo (): print os.environ ['var_name']

sql - Cross apply to fill down values with multiple columns -

I have a table with some columns I want to fill in the values ​​to change the nulls, but by this extra column is complicated. Here's my sample: Date id1 id2 id3 id4 value 1/1/14 a 1 1 1 1.2 1/2/14 a 1 1 1 null 1/8/14 a 1 1 1 2.3 1/1/14 A2 1 1 10.1 1/2/14 A2 1 1 12.3 1/17/14 A2 1 1 NULL 1/18/14 A2 1 1 10.8 1/1/14 A 2 3 1 100.3 1/2/14 A2 3 1 tap 1/6/14 A2 3 1 110.4 I want to copy down to value value id1 For example, all "A1-1-1" should be isolated from "key-to-1-1", for example, according to what the values ​​have to be copied to me. Required: date id1 id2 id3 id4 value 1/1/14 a1 1 1 1.2 1/2/14 a 1 1 1 1.2 1 / 8 / 14A1 1 1 2.3 1/1/14 A2 1 1 10.1 1/2/14 A2 1 1 12.3 1/17/14 A2 1 1 12.3 1/18/14 A2 1 1 10.8 1 / 1 / 14A 2 3 1 100.3 1/2/14 A2 3 1 100.3 1/6/14 A2 3 1 110.4 I CROSS APPLY announcement @ test table (date DATETIME, Include ID1 VARCHAR (1), ID2INT, ID3INT, ID4INT, Well Float) @ Test Value ('2014-01-01', 'A', '1', ...

opengl es - Android View vs SurfaceView vs GLSurfaceView for 2D drawing app with Zoomable User Interface -

I am planning to write a 2D drawing app with the zoommable user interface. With the app the user must be able to transform (translate and scale) the drawn path (and of course the UI). I think there will be 500 paths at the same time. Now, I am thinking that to get started with an acceptable display (view, surface view or GLSurfaceView), see. I read a post including an Android Developer Guide 1 [1-6] and still is not 100% sure to see what to use. According to the presentation on Google I / O 2009 () and your experience canvas (see and Surface Weave) does not seem to be able to perform quickly while handling more than 100 routes. Is anyone likely to implement the app using canvas or does the way to OpenGL go? [2] [3] [4] [5] [6] Due to your functionality, you will need to use hardware rendering to be dense, therefore in software Every pixel is slowing down. If you want to draw with a canvas, you have to present it with a capable view. Canvas rendering on the surf...

php - query inside a pdo while loop -

Hi, I think I have designed my PDS mysql class worse, because I have some time within Can not put a query in the loop of another query because the new query inside the loop erases the old one, is there an easy way to fix it? I have also really used the old style php / mysql where you create a query, then assign that query within the fetch ($ query) that you do not do with PDO I am in disarray and it is going to annoy me for a long time. My code is cut in the relevant parts class mysql {// query counter public $ counter = 0; // database connection public $ databases; // statement handler public $ STH; // public $ queries = '' Store all queries for debugging; Public function __ composition ($ database_host, $ database_true, $ database_password, $ database_db) {$ options = array (PDO :: MySQL_ATTR_INIT_COMMAND = & gt; 'SET NAMES utf8',); $ This- & gt; Database = New PDO ("mysql: host = $ database_host; dbname = $ database_db", $ database_true, ...

c# - LINQ's deferred execution, but how? -

This should really be something simple but I'm going to ask it in some way, because I think others There will be conflict with it too. Instead of always using the usual LINQ query, why not always execute with the new variable-value? Fixed zero main (string [] args) {Console.WriteLine ("Enter something:"); String input = console Readline (); // For example ABC 123 var points = input Where (four. ISDIG); // 123 while (no.) {Console.WriteLine ("Enter a string that does not have digits"); Input = console Readline (); // ABC console for example). Wrightite ("Bye"); Console.ReadLine (); } In the commented sample it will enter the loop after input ABC123 digits. But if you enter something like ABC to digit still 123 , it will never leave. So why does the LINQ query not evaluate the new input but always the first? I know that I can fix it with this extra line: while (number any) {Console.WriteLine ("Enter a string that Not includ...

xml - Android - Border around ListFragment? -

मेरे पास गतिविधि है जिसमें गतिविधि के एक्सएमएल में एक ListFragment शामिल है फ़ाइल ... & lt; fragment android: id = "@ + id / shoppingListNamesFragment" एंड्रॉइड: name = "com.example.ShoppingListNamesFragment" एंड्रॉइड: layout_below = "@ id / shoppingListsTitle" एंड्रॉइड : Layout_width = "match_parent" एंड्रॉइड: layout_height = "wrap_content" / & gt; मैं इस टुकड़े के चारों ओर सीमा रखना चाहता हूं। मैंने इसे ऊपर एक्सएमएल में जोड़ने की कोशिश की है ... android: background = "@ drawable / white_dashed_border" एंड्रॉइड: padding = "14dp" एंड्रॉइड: layout_margin = "14dp" ... लेकिन यह सीमा नहीं पैदा करता है (जबकि यह एक सीमा बना देता है अगर मैं उन 3 लाइनों को एक्सएमएल में जोड़ता हूं, उदाहरण के लिए, एक LinearLayout पर)। मैं सूचीफ़्रेग्मेंट (आदर्श रूप से xml का उपयोग करके) की सीमा को कैसे जोड़ूं? पीएस - कोई ऐसा प्रश्न है जो एक मूल लेआउट को जोड़ने का सुझाव देता है, लेकिन मैं इसे संभवत: से ...

ruby - Finding characters before a word in a string -

I have data pulled from an xlsx file that looks like this: [6, 2] = & gt; "Comment", [6, 3] = & gt; "Complaint", [6, 4] = & gt; "Inquire" I want to find the array Return the value of second number to the first bracket, search for complaint search 3 Should be back Any help is appreciated. NB - Updated alarms to the alarms for the array. Removed string conversion in OP 'roo' today_file = (File.dirname (__ FILE__) + '/output/today-report.xlsx' is required) def by_value (data, value) found = data Search | Kashmir, V. V == value found and found [0] [1] end data = Roo :: Excelx.new (today_file) output = bi_view (data, "complaint"). This returns the output While returning this return 'nil' The array is produced in this form as follows: {[1, 1] = & gt; "Today's day - 02/10/14", [1, 4] => "Another comment below the fold - scroll down", [2, 1] => "Tomorr...

java ee - Issue with 'context.setResponseContentLength(fileSize)' metthod in JSF -

I am using the jsf-api-2.1.2.jar file which can become a web app with JSF And there I have an object of external syntax, I have an object to use usimhg that is 'responseReset ()', 'setResponseContentType (string)' and setResponseContentLength (int), but it is showing that this method does not exist . I 'External Context. Class' file and have seen that those methods are present in that class, but I'm not sure why it is showing them as undefined methods I'm running this project on the Jboss 5.1 server. Thanks in advance can help me on this!

sql - Need help on a select to gather data from Access database -

Within a PowerShell script, I need to collect data from the Access database. It is mainly the log of my terminal server : Whenever a person logs on or turns off, a script adds a line in my database with the information below (actually very much but I keep it simple :)). Here is the database's record: table log_table date_ac Dept User_ac Typeaccess 1/1/2014 dept1 user1 logon 1/1 / 2014 dept3 user2 logon 1 / 1/2014 dept3 user2 logoff 1/1/2014 dept1 user1 logoff 1/1/2014 dept1 user1 logon 1/1/2014 dept1 user1 logoff 2/1/2014 dept1 user1 logon I want to group it by the department based on the date of the request, and show the number of different people logged on the basis of that time line (only typeacress logon, not lockoff) one day ( If users are on one day Le loges, then it is counted for one, if he logs for two days, then it is counted for him, but if you log in 20 times then my example Should be for a request in -1 1/4/2014 -> 2/1/2014: dept1: 2 (user 1 1/1 o...

java - remove a selected checkbox row(single and multiple) in JTable -

I want to remove the row (one or more of both) whose checkbox was selected in jtable through a button It is not working properly. It is throwing exceptions. This is the code .. Private zeros jButton2ActionPerformed (java.awt.event.ActionEvent evt) {DefaultTableModel Model = (DefaultTableModel) jTable2.getModel (); For (int i = 0; i That's because if the combobox is not selected, then you zero not incorrect . To prevent this, you can check the tap or not before DefaultTableModel Model = (DefaultTableModel) jTable2.getModel (); For (int i = 0; i

regex - Using Varnish 3 to set cookies -

I am trying to set a cookie using varnish but I do not know how many headers of the same name How is the treatment done. For example, if multiple cookies need to be set, the application will be sent: set-cookie: source = source + 2; Expired = Tuesday, 04-Nov-2014 17:12:50 GMT; Path = /; Domain = .xampp.com.local set-cookie: someOtherCookie = othervalue; Expired = Tuesday, 04-Nov-2014 17:12:50 GMT; Path = /; Domain = .xampp.com.local I want to set a cookie in any varnish, but if back-end response contains a set-cookie header or if the client is already Cookies, I have to make sure that I'm not destroying them in the process of setting their cookies. Adds the heading `$ UUID` to the header, or use SID # from the head SID URL if (req.url ~. [And?] SID = ([^ & amp;; +). *") {Set Req.http.x-Varnish-Faked-session = regsub (req.url, ". * [And?] SID = ([^ & amp;; +]. *. *", "Frontend = \ 1");} and {C} {UUID_Buff [50]; generate_uuid (uuid_buf...

dns - How to use Google Compute engine with my own domain? -

I have received these instructions but they are not very clear: I'm using the symbolic name mark but I must specify my own host record? If so, how do I fix an IP address to enter for a record type? If there is no option to set host records on namingchip, then I would like this Google Public-DNS? I'm just trying to solve my domain. Answer for "closed" votes: There are 2 useful votes below, and there are more than 500 views This question is relevant and helpful Assign a static IP address for your compute engine VM instance (static IP address billed) , By default you get a free, short term address) Install Apache on an example. Create your 'a record' or host record for the host name 'www' on the symbol, this static IP address indicates Open the http port so that the example service can be done.

bit manipulation - abs function for float value in java -

I need to create a function abs for the float with a beta operator, this function return float value. I & lt; or & gt; can not be used. I try this (float) ((int) f ^ ((int) f> 31)) - ((int) f & gt; ;> 31) but for -2.5 get value I 2.0 , this is not correct. Can you help me? you can do this float bf = float. BitToFlot (float.floatioidbits (x) and 0x7FFFFFFF);

apache2 - Expression Engine Sidebar Nav issue post migration -

I'm a newbie with EE but I am working in an environment where we transferred EE from one host to another and later post-migrations I have a problem with the nav bar where this code is showing: $ nav): $ class = ($ nav ['url_title'] == 'about-us')? 'Class = "current"': ''; Resonance '' $ Nav ['title'] ''; If ($ nav ['url_title'] == 'about-us'):? & Gt; Company Overview Our History '; Endforeach; ? & Gt; Screenshots located here: Any thoughts? It is not happening on the original server. I guess your old host was turned on in php. So when your new host does not . Would you like to do this by running short_open_tags in your .i file or to and in your template. To confirm also check that the parsing in the PHP template is turned on and it is called on the expected parsing stage (input or output) - you think 'output' is required).

Get data from mysql database inside for loop with php pdo -

javascript - Teminate all running processes -

How can I stop all processes (loops, timeouts, intervals, etc.) and remove individual event handlers ? I do not want to stop further execution, just the stuff that's going on. Example Usage: var i = 0; For (;;) {(i> = 20000)? StopExecution: i ++; }

ruby on rails - Set time zone on one rspec test -

I'm trying to set the time zone on an RSPC test like this: Zone = ActiveSupport :: TimeZone.new ('Hawaii') Time.stub (: now) {Time.now.in_time_zone (zone)} This gives me a stack level very deep error Gives, what am I missing here? Try doing this: Zone = ActiveSupport :: TimeZone.new ('Hawaii') Time.stub (: now) {Time.new.in_time_zone (zone)} I'm not sure, but it looks like Stubbing now and then there is a very serious error due to the stack level in the calling time.now block.

matlab - conversion of cell to matrix that contains text? -

I have a text file that has measurement data, the header is not important, so I used to remove 25 lines before it % I = 1: 25 Leave the first 25 rows for fgetl (inputfile); Then I used the delimiter to get the data delimiter = ''; Values ​​= textscan (inputfile, '% s', 'delimiter', delimiter); I'm trying to change the cell with 1000 characters in the I Here's what I found '2014_11_03_17-19-49 000 430114 516672 960.91 26.2 '' 20l4_ll_03_l7-l9-49 001 430 112 516 656 960.91 26.2 '' 20l4_ll_03_l7-l9-49 002 430 112 516 656 960.91 26.2 '' 20l4_ll_03_l7-l9-49 003 430 112 516 656 960.91 26.2 "I am trying to change the cell In which there are 1000 characters, as in the past I (960.91 and 26.2). I tried to convert it to matrix but I can not support this error cell array or cell array containing the object. How to get those values ​​in the matrix to plot those ideas to conspiracy those ideas. approach #...

windows - Programming performance -

I would like to know that these 2 code variables are similar to display announcements: Int value; For {int i = 0; i or (int i = 0; i Actually, I have to know that to make the process time variable value and allot it in RAM is once in the first case and if it is or not, then 1000 times second . If you are doing c ++ or c # programming, then it does not matter because no runtime The difference will not be the initialization for the simple int type.

composition vs inheritance definition -

I know that it has been asked, but usually the context is explained with something else and seems a little complicated . A legacy occurs when the classes attain the properties from a super class, right? What is composition? class bird; Class duck; Class wing; Duck is a bird & lt; - heritage. Duck "a feather & lt; - Composition is Hope this is two wings.

objective c - NSURLRequest not working on Yosemite Today Extension -

I am trying to create a Yosemite Notification Center widget for my own personal use, using NSURLRequest and NSURL connection It is supposed to get numbers from a server and display that number in a label. I'm working on this general purpose-cocoa app so I do not think there is a problem with my code, but I can not get the exact code to work on the extension today. It seems to me that the error is: 2014-11-04 13: 07: 00.178 b-web mobile downloads [854: 39027] *** Storage Task manager Expert with dispute: Identifier fails : Error Domain = NSCoAired code = 4099 "Could not communicate with the assist app." (The connection to the service named named Com.apple.nsurlstorage-cache was invalid.) UserInfo = 0x60000026e6c0 {NSDebugDescription = com.apple.nsurlstorage-cache The connection to the service named was invalid.}; {NSDebugDescription = "The connection to the service named" com.apple.nsurlstorage-cache was invalid. "; } For today's expansion. M i...

javascript - How to filter nested object not equal in Angular? -

Perhaps some simple syntax may be missing, but I can not find the same filter to work: I can filter : {property: {text: 'yes'}} , but not Filters: {property: {text: 'yes!}} , which works for non-nested objects. HTML: & lt; Ul & gt; & Lt; Li ng-repeat = "attribute | filter in: attribute: {property: {text: 'yes!}}" & Gt; {{Attr.property.text}} & lt; / Li & gt; & Lt; / Ul & gt; {text: 'no'}}, {property: {text: 'no'} js: $ scope.attributes = [{property: {text: 'yes'}} }},]; You can get the same effect in the same way as ng-if : & lt; Ul & gt; & Lt; Li ng-repeat = "attribute in attribute" ng-if = "atri.property.txt! == 'yes'" & gt; {{Attr.property.text}} & lt; / Li & gt; & Lt; / Ul & gt; Alternatively you can write a custom filter that contains logic or some way to flatten the original structure. I do not think tha...

How to make docker image of host operating system which is running docker itself? -

I started using the docker and I can say it is a great concept so far everything is going well Installed the Docker on Ubuntu (My Host Operating System), which was depicted from the repository and made new images. Question: I want to create an image of current operating system How do I get it using Docker? I'm new to Doc, so please ignore any silly things in my questions, if any. I do not understand why you want to do this, but it is not your question The issue is, here's how nothing is made from creating a new Doker image: If you can come with a tar file of your current operating system, Docker can create image with command. cat my_host_filesystem.tar | Docker import - myhost Where myhost you want is the Docker image name and my_host_filesystem.tar the archive file of your OS file system. Also, take a look from the superuser and stack overflow. If you want to know more about this, then search for Docker "Scratch" is a good starting po...

php - use array variable outside for loop -

मेरे पास यह PHP कोड है, लूप के लिए: $ expireData = array ( ); ($ X = 0; $ x & lt; = 10; $ x ++) {$ stmt = $ dbh-> gt; तैयार करें ("चुनें राउंड ((expired - unix_timestamp ()) / 86400) दिन के रूप में, (*) के रूप में गणना करें उपयोगकर्ताओं से सीएनटी WHERE user_by =: उपयोगकर्ता नाम समूह दिन; "); $ Stmt- & gt; bindParam ( ": उपयोगकर्ता नाम", $ userdata [ 'उपयोगकर्ता नाम']); $ Stmt- & gt; निष्पादित (); $ Row = $ stmt- & gt; फ़ेच ALL (); #var_dump ($ पंक्ति); अगर ($ पंक्ति ["सीएनटी"]> gt; {$ expireData [] = $ पंक्ति ["सीएनटी"]; } और {$ expireData [] = 0; }} अगर मैं var_dump ($ पंक्ति) करता हूं: array (2) {0] = & gt; सरणी (4) {["दिन"] = & gt; स्ट्रिंग (2) "27" [0] = & gt; स्ट्रिंग (2) "27" ["सीएनटी"] = & gt; स्ट्रिंग (1) "2" [1] = & gt; स्ट्रिंग (1) "2"} [1] = & gt; सरणी (4) {["दिन"] = & gt; स्ट्रिंग (3) "116...

java - The use of checked exception for errors to be dealt with in web layer -

I have a hard time managing handling of errors in service time, in this method to throw the exception The reason is that when providing password is vulnerable or the confirmation ID is incorrect. The name of the exception is not yet decided. However, are there any exceptions to avoiding any new applications? If so, how do I approach such errors from the collar? In this scenario, the caller is the web layer that displays a web service. I want to handle the error in the web layer and prepare an error message. I have a method: Confirm boolean password reset (Intit Account ID, String Confirmation ID, String Nupsword); And this is an exception class: Public class ban objection exceptions {public obligation violation (string message) (super message) is extracted; }} This article looks like it should be correct: contingency is considered A part of the design It is expected to happen: Regularly but rarely Who cares about it: The upstream code that includes the exa...

ios - Clear NSMutableArray -

I want to store dateArray in internalElement and then clear dateArray when it starts for loop, I have new in dateair The data is there. Currently I am trying to use [dateArray clearAllobjects] to delete the data, but when I do this, it cleanses the internal element, is there a better way of doing this or what I can not find Thanks in advance for your help. NSMutableArray * dateArray = [[nmutab and other] init]; InternalElement = [[NSMutableDictionary alloc] init]; (For object PFObject * object) {newDate = object [@ "date"]; If ([old date is: @ ""]) {NSMutableArray * transactionDetails = [[NSMutableArray alloc] init]; [TransactionDetails addObject: Object [@ "zodiac"]]; [TransactionDetails addObject: Object [@ "memo"]]; [TransactionDetails addObject: Object [@ "class"] [@ "name"]]; [Add Date Array Object: Transaction Details]; OldDate = Item [@ "Date"]; } And if ([New Data: Old Date]) {NSMutableArray * transact...

unity3d - Why is my code duplicating the name of a button? -

I have tried to customize my button in unity, but for some reason the name of the button has been repeated in the corner Button, and can not be customized / removed How do I get rid of duplicates? public GUIStyle style; Public texture load; Public Texture Background Fiction; Zero onGUI () {GUI.skin.button = style; GUI.DrawTitxture (new reset (0, 0, screen.width, screen.height), background suffix, scale mode.ScaleTofit); //GUI.DrawTitxture (new reset (0, 0, 200, 73), load, scale mode. If (GUI.Button (new text (screen.width / 2.5f, screen.ighight / 5, 200,73), "load")) {Application.LoadLevel (1); } {Application.Quit ()) ("GUI button" (New Rect (Screen with / 2.5F, screen. HEIGHT / 3, screen.width / 5, screen. HEIGHT / 10), "Exit game") {application.Quit () ; }}

Rails - How does the show and new action work -

The very common question I was hoping that someone could explain to me is the basic name for a model in the name of the products I am seeing the generated sloppy code. I noticed that there is not much in the controller new and much of the work in the show. In fact, the show is completely empty and only the new line is " @product = Product.new ". I know that these 2 actions should go on a different scene. A new form view in order to show a resource, and input information and a resource form, respectively. So, I'm curious how this really happens. Other actions: redirect_to: some_path that makes sense, but actually shows " action, location: @ productive " bring page to show item when action is empty? Apart from how is it different from redirect_to @product ? render generates a string application Will be displayed as a response to the request. redirect_to generates a feedback header, resulting in a new request for the application. Render action ...

Delete value from sessionStorage JavaScript -

I am implementing some custom timers that aim to calculate the specified time. The timer needs to be counted when the user loads manually. This section works but after the specified time (5 seconds in this case) the user needs to be redirected. For that purpose I am using session storage to keep current calculation time. But after 5 seconds I am trying to get rid of the session and it does not work! Where did I make a mistake? How can I remove items from sessionStorage in my case? Thanks var current time = sessionStorage.getItem ("current time"); If (current time == zero) {currentTime = 0; } SetInterval (function {currentTime ++; if (currentTime == 5) {sessionStorage.removeItem ("currentTime"); location.reload ();} sessionStorage.setItem ('currentTime', current time);), 1000) ; The problem is that location.reload () doesn Javascript can not end execution Therefore, after that line, sessionStorage.setItem ('current time, current time);...

Does Android Studio have a release schedule? (like Chrome) -

Is there a release schedule in Android Studio? Chrome releases every 6 weeks and I was thinking that Android is something similar in the studio. You create at any time you want to source: We try to build one that goes out on the canary channel every week, usually late in the week, but there may be issues to prevent release in any week. When this happens, we occasionally release at the beginning of next week, and sometimes we punch up to the next week's release. It depends on many factors. During development, if a canari channel looks good and does not cause serious problems for some time, then we will promote it to the DR channel. The idea is that the canary channel gets close to the bleeding edge, and Dev Channel updates are less frequent and more stable. We are working until the entire 1.0 release (sorry that I'm obscured about this time, but I'm not announcing a release date here), so the build schedule is finally late I'm hoping that after 1.0 ships a...

Converting exponential into number in java -

इस सवाल का पहले से ही एक उत्तर है: 10 उत्तर कृपया कोई मेरी मदद करो। I मी जावा का उपयोग कर रहा हूँ मैं संख्या को संचित करने के लिए डबल का उपयोग कर रहा हूं I गणना के बाद मुझे 1.38964527 ई + 13 के रूप में आउटपुट मिल रहा है लेकिन मुझे इस प्रारूप में 13896452700000 के रूप में आउटपुट चाहिए.कोई भी कृपया मुझे बताएं कि यह परिवर्तन कैसे करें। मैंने पहले से ही इसे पूर्णांक या स्ट्रिंग में परिवर्तित करने की कोशिश की है। कुछ भी नहीं काम करता है अग्रिम में आपका धन्यवाद कोशिश करें NumberFormat : System.out.println (नया दशमलवफ़ॉर्मेट ("#")। प्रारूप (yourLongNumber)); (आपको प्रत्येक आउटपुट के लिए एक नया प्रारूप नहीं बनाना चाहिए, इसलिए संभव है जब इसे पुनः उपयोग करें।)

apache - Force the mod_rewrite to pass request parameters when rewriting -

I http http ) to all the web server users. This code is using I: RewriteBase / RewriteCond% R {} HTTP_HTTPS} rewrite engine! = Revert Rule ^ (. *) $ Https: //% {SERVER_NAME} / $ 1 [R = 301, L] However, I have realized that when user information With the request to http , then this relay rule is executed, then the postal data is lost. Is there a way to rewrite HTTPS, make sure that all POST data is also sent. two 307 (temporary) and 308 (Permanent), which you can use for this kind of case. These status codes redirect the code to 302 and 301 , but keep the method ( GET / POST ] up to RewriteRule ^ (. *) $ Https: //% {SERVER_NAME} / $ 1 [R = 308, L] However, you should See the answer for the details as long as everything works as expected with the exam 307 .

c++ - C++11 Accessing Unscoped Enumerators with Qualified Name -

I have a question about the words of the C ++ 11 standard because I have not had to dig it in the past It was found that I was confused with the topic of unsampled nimics (confusing unrealistic). I recently had a code in a code review that was using an unsigned enum, but to access the calculator using fully qualified names it: Some entities {Enuma, ...}; Zero foo () {SomeEnum x = SomeEnum :: EnumA; } I was convinced that this was not working and some Annam had to be an ANU class for this behavior, but to ensure it adequately compiled it properly Happened. Seeing in the C ++ 11 standard, I first thought that the standard agreed with me: § 7.2 Intellectuals announcements: Each enum -name and each unscoped calculator has been declared in the realm, which is immediately declared in the enumeration of each test calculator within the scope of calculation. It appears to me to reveal that the unsigned enumerator is declared immediately within the scope of the enumeration,...

virtocommerce - Build Error with PaymentGateways -

I downloaded the previous source code, but I can not build primarily due to this error: C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (2428,5): Error MSB6006: "LC. Payment gateway project PaymentGateways error exited from "Code> Error 1" lc.axa "code -1 2 metadata file 'c: \ user \ ele \ document \ visual studio 2012 \ projects \ virtoCommerce \ src \ extension \ payment \ paymentgateways \ bin \ debug \ VirtoCommerce.PaymentGateways.dll' could not get C: \ user \ liquor \ document \ Visual Studio 2012 \ Projects \ virtoCommerce \ Test \ FunctionalTests \ CSC FunctionalTests Error 3 Metadata File 'C: \ Users \ Alcohol \ Documents \ Visual Studio 2012 \ Projects \ virtoCommerce \ src \ Extension \ Payment \ PaymentGateways \ Bin \ Debug \ VirtoCommerce .PaymentGateways.dll 'could not be found C: \ Users \ B \ Documents \ Visual Studio 2012 \ Projects \ virtoCommerce \ src \ Presentation \ Frontend \...

Not able to invoke Perl script from Java -

I am trying to open Perl script from Java but it seems that I am not able to do this. This is my Perl script which creates a file. This is a simple script. Use strict; Use warnings; Open (my $ FH, '& gt;', 'report.txt'); Print $ FH "My first report generated by Perl \ n"; About $ FH; Print "done \ n"; Here is my Java code that is using above Perl script. package perlfromjava; Import java.io.IOException; Import java.util.logging.Level; Import java.util.logging.Logger; Public category PerlFromJava {public static zero main (string [] args) {try {string command = "perl $ HOME / documents / hello.pl"; Println (order); Proc proc = Runtime.getRuntime (). Exec (command); } Hold (IOException pre) {Logger.getLogger (PerlFromJava.class.getName ()). Log (Level.SEVERE, null, ex); }}} When I run the Perl script command, it is working perfectly, but when I am implementing Perl script from Java, report . Txt file is not being created. ...

Swift cocoa Osx application imageviews -

I am currently working on a fast Coco OSX project. In my project I have 31 nsimage power which is called Space 30, Space 1, Space 2, Space 30. Each image view has 3 possible images, a green image, a blue image and a white image. For each possible scenario, what would be the most effective way of specifying an image for a particular image based on a variable without typing, for example if the variable x = 10 I want to give an image to space 10 and if y = 20 space 20 Will have to give an image. Thanks Funk img space (IMGN: IT) - & gt; NSImage? {If imgNumber == 0 {return space 00.image!} If imgNumber == 1 {return space01.image!} If imgNumber == 2 {return space02.image!} If imgNumber == 3 {return space03.image!} If imgNumber == 4 {return space04.image!} If imgNumber == 5 {return space05.image!} If imgNumber == 6 {return space06.image!} If imgNumber == 7 {return space07.image!} If imgNumber = = 8 {return space08.image!} If imgNumber == 9 {return space09.image!} If imgNumber ==...

c# - EF can't SaveChanges to db -

I try to create a equation unit and add it to SQL Server DB I do not get any error in my code but I do not see any change in the DB. I check DB in Visual Studio in Server Explorer, and the value is not added to it. DB was added to the project when I was making an EFF data model for it in my project so that Visual Studio created a copy of DB in my project. But I do not know why two copies were made in the project directory and / bind / debug directory. Entity class: Public partial equation {public equation () {This.Results = new hashset & lt; Results & gt; (); } Receive public ID { Set; } Public Double A {get; Set; } Public Double B {get; Set; } Public Double C {get; Set; } Public virtual iconging & lt; Results & gt; Results {get; Set; }} ID is the primary key and the identity is (1,1) My code: Private EquationDBEntities = new dbcontext EquationDBEntities (); Equation eq = new equation () {a = 1, b = 2, c = 3}; Dbcontext.Equations.Add (eq); Dbcontext...