Posts

Showing posts from April, 2014

audio - pulseaudio has no module-dbus-protocol -

I want to run pulseaudio using dbus. I have read several instructions about using the module 'module- dbus-protocol'. But it does not exist. $ pacmd load-module module- dbus-protocol module load failure I saw it with autocomplete, 'PACMD list-module', and even in built-in git sources. Is my PulseAudio properly configured? Or am I having a version problem? Currently I use PulseAudio 5.0 Edit: found in my / usr / lib / pulse / folder My mistake was to separate me into / usr / lib - / usr / local / lib - There was a module of different Palsodio versions and my running PA was adding the old one. I have just removed Pulseido files by simply / usr * repo and have reinstalled PulseDadi

java - Good practice to pass variables between cucumber-jvm steps -

Now I am doing something like an example to pass the variable between the steps: Feature: demo scenario: user user creation form management create the user has created the Java class with the "Test" make known the user successfully Speed ​​definitions: public class CreateUserSteps {Private string user name; @ ( "^ User Construction Forms Management $") public void User_creation_form_management () thrrowable throws {// ...} @ ( "^ Create a user with the name" ([^ \ "] *) \" $ ") public void Create_user_with_name (string username) Throhebl {// ... this.userName = userName;} ^ @ again ( "the user has been successfully created $") public void User_is_created_successfully () is equal to the throws // name thrrowable .User name} My question is whether to share information between steps Is this a good practice? Or would better define this feature: Then the user has been successfully created with the name "test...

python - GTK3 small font and entries on win8 -

Image
I have created a GTK3 + Python 3 application and have made it packet with CX_Freeze. When I run it on WinXP, the GTK Entry map is OK, but the font on the win8 and the hegath of GTK entry is small, because you can see it on the screenshot. I change the gtk CSS style Tried: .entry {height: 25px; } but height property is not supported except font-size and padding but no success Tried. Did you set the Gtk.Entry () size directly in the dragon Have tried? SomeEntry = Gtk.Entry () & lt; Br / & gt; SomeEntry.set_size_request (100, 25) This width will determine the height of 100 pixels, 25 pixels.

c# - Complex Views containing multiple Partial Views in ASP.MVC -

Image
मेरे पास निम्न फ़ॉर्म है: संपादित करें कुछ आंशिक दृश्य है जिसे संपादित दृश्य नामक अलग दृश्य मॉडल से संपादित करें। खोज एक आंशिक दृश्य है, एक और आंशिक मॉडल - फ़िल्टर (_SearchFilter) और खोज परिणाम (_SearchResults)। उन सभी विचारों को एक दृश्य मॉडल, SearchVM साझा करता है। अंत में मैं एक अपडेटिव बनाने की कोशिश कर रहा हूं जो चित्र पर दिखाता है। इसमें EditVM और SearchVM इंस्टेंस हैं। मेरी समस्या UpdateVM के बारे में जानकारी खो रही है। पहले मैं क्रिया अद्यतन प्राप्त कर रहा हूँ। [ HttpGet] सार्वजनिक वर्चुअल कार्यरूट अद्यतन () {var मॉडल = नया UpdateVM (); Var सर्चVM = नया सर्चमीम (); Model.searchVM = searchVM; Var editVM = नया editVM (); Model.editVM = editVM; वापसी देखें (मॉडल); } दृश्य इस प्रकार दिखता है: @model updateVM @ html.partial (MVC.Shared.Views.Search, Model.searchVM) @Html। आंशिक (MVC.Shared.Views._Edit, Model.editVM) समस्या फ़िल्टर पर खोज के साथ शुरू होती है जैसा कि आप _Search आंशिक दृश्य को देख सकते हैं केवल एक SearchVM पारित किया गया है। मुझे खोज करना च...

vb.net - Create folder from textbox input in visual basic -

I want to create a folder in VB with a textbox Like I have a "browse" button, a textbox1 and "create folder" buttons, I want to browse a folder on the file system where users want to create folders and select the selected location as textbox1 , then user should click on the "Create Folder" button; If the folder does not exit, then a dialog should say that the folder has been created successfully if the folder exists, then it should say, the folder already exists. All help is very much appreciated Thanks . This is the code that I'm trying to write yet: Importing System IO public square at 1 dim folder name string CreateFolder (private function) FolderName = TextBox1.Text My.Computer.FileSystem.CreateDirectory ( "" & amp; FolderName & amp; "") are My.Computer.FileSystem.DirectoryExists ("" & FolderName & amp; "") = False Throw New Exception ("The specified path does not exist...

java - How to identify application that calls web service -

I have a Java servlet application with 6 web services and one web requests, I have to determine whether it is live or tested, by calling the web service example I believe that I can set it up with the URL, I.e. https: // localhost: 8443 / projectname / etc or https: // localhost: 8443 / projectnameTEST / etc I'm trying to get it by using HttpServletRequest and I know that I have a type of How do Ia is to call the designated Web service "getDocument" But I started to HttpServletRequest inside GetDocument? In this way how can I create a parameter "request" in the getDocument web service and have it started for request information? Public Zero doGet (HttpServletRequest request, HttpServletResponse response) throws exceptions ... stringbuffer url = request.getRequestURL (); ...} You can retrieve client information, for example: @WebService () public class SomeWebService {... @resource Personal WebServiceContext wsc; ... @WebMethod Public Zero...

Split a file between two specific values and put it in a array in perl -

नमूना फ़ाइल: ### वर्तमान जीपीएस निर्देशांक ### बस में .. ।: अज्ञात ### पावर स्रोत ### 2 ### टीपीएम स्थिति ### 0 ### बूट संस्करण ### जीडी35 1.1.0.12 - निर्मित 14:22:56, जुलाई 10 232323 मुझे नीचे की तरह सरणियों में फाइल से ऊपर विभाजित करना है: @ current0_ps_Coordinates नीचे जैसा होना चाहिए ### वर्तमान जीपीएस निर्देशांक ### बस में ...: अज्ञात मुझे पर्ल में कोई मदद करना है? (वर्तमान कार्यक्रम टिप्पणी से जोड़ा गया है) #! / Usr / local / lib / perl / 5.14.2 -w मेरे @ लाइनें; मेरी $ फ़ाइल; मेरी लाइनें; मेरी $ i; #chomp $ i; $ File = 'test.txt'; # फाइल खोलें नाम (INFO, $ file); # फ़ाइल को @lines = & lt; INFO & gt;; खोलें; # इसे सरणी बंद (INFO) में पढ़ें; # फ़ाइल को अपने $ लाइन (@ लाइनों) को बंद करें {प्रिंट "$ line"; } रेखा से फ़ाइल लाइन पढ़ें पिछली नई लाइनों को हटाने के लिए chomp का उपयोग करें यदि इनपुट लाइन इस regexp / ^ ### (। *) ### / से मेल खाती है, तो आपके पास "सरणी" का नाम है $ 1 में इन मैचों से @ चालू0_PS_Coordinate...

indexing - Excel - Return multiple matching values from a column, horizontally in one row -

I have an Excel formula, which is considered to be working but gives #VALUE and why I can not understand . I have this table: AB 1 | | | 2 | Orange | 1 | 3 | Apple 2 | 4 | Grapes | 3 | 5 | Orange | 4 | 6 | Apple 5 | 7 | Grapes | 6 | 8 | Apple 7 | I want to check the matching values ​​in column A such as "Apples", "Oranges" etc. and return all relevant values ​​from column B to one line: Output should be like this, but only me # VRA: ABCD 11 | Apple 2 | 5 | 7 | 12 | Orange | 1 | 4 | #NUM | This is the formula: = INDEX ($ B $ 2: $ B $ 8, Small (IF ($ A $ 11 = $ A $ 2: $ $ 8, line ($ A $ 2: $ A $ 8) -ROW ($ A $ 2) +1), COLUMN (A1))) I hope this formula will help you. Press Ctrl + shift + enter to work on the formula, Ordering the product column is OK. = If (column () - 4 = The -4 column is referring to where you are going to look at the value and see -5 where you are going to get the value. The column "c" is empty COL A...

ruby on rails - Get last occurence of nested array -

By querying two sections and applying the following methods: .each_with_index. Chunk {| Enum, i | I get this structure: [[False, [[# # Post ID: 1, Title: enum.is_a? (Note)} "something", 0]]], [false, [[# # and #; Lit; Post ID: 2, Title: "Something", 1], [# & lt; Post ID: 3, Title: "Something", 2]]], [True, [ID # 1, Title: "Something", 3], [# & lt; Note ID: 77, Title: "Something", 4]]]] In the scene, I have to know when I am on the last object, in this case the index status 4, I How do i In this view, you could just do this: array .flatten.last which looks like this: [1] PRI (main)> gt; [[False, [["1"]]], [false, [2]], ["post 3"]], [true, [1], ["note 77"]]]] .flatten Last = & gt; "note 77" Thanks for the amendment Cary.

javascript - Populate HTML CANVAS with local device file -

I'm building an HTML5 app for Android using Intel XDK. I am based on myself this.dirEntry.getFile (imagePath, {}, function (file entry) {fileEntry. File (function (file) {console.log ("Loading" + file.fullPath + "to canvas"); var ctx = Container GetContext ('2d'); var img = new image (); var url = Window.URL} window.webkitURL; var src = url.createObjectURL (file); img.onload = function () {ctx.drawImage (img, 0, 0); url.revokeObjectURL (src);} img.src = src ;});}, Function (evt) {console.log (evt);}); When I test with IntelXDK and Veeran, I get: Loading file: /// storage / emulate / 0 / Android / Data / Com Intel.html5tools.apppreview / cache / repositories / 00001 / summary.jpg processMessage failed to canvas: error: writing error: type error processMessage failed: pile: writing error: type error on load (file: /// data /data/com.intel .html5tools.apppreview / files / appmobicache / nE5zi-ycD6TAzOFeh0Y3aXzMHLix6sA22cSUzZ6e3lo / 4.0.0 / ...

php - Using if statements for GET Values -

मेरे पास एक php अनुरोध में निम्न चर है: myfile.php? Location = 0 और / बेडरूम = 0 यह वह कोड है जिसे मैं इसे पुनः प्राप्त करने के लिए उपयोग कर रहा हूं (मैं फ़ील्ड प्रकारों को इंगित करता हूं क्योंकि यह केवल अनुरोध है कि मैं कैसे विनियंस कर रहा हूं)। $ location = intval ($ _ अनुरोध ['स्थान']); फ़ील्ड प्रकार = int (11) $ बेडरूम = अंतराल ($ _ अनुरोध ['बेडरूम']); फ़ील्ड प्रकार = टिनिंट (3) इस प्रकार मैं चर को संभाल रहा हूं: यदि ($ location == 0) $ ilocation = 2, 3,4,5,6,7 '; और $ आयलॉन = $ स्थान; यदि ($ बेडरूम == 0) $ ibedrooms = '-1,1,2,3,4,5,6,7,8,9'; और $ ibedrooms = $ बेडरूम; इस तरह से मैं अपनी क्वेरी में इसका उपयोग कर रहा हूं: जहां realty.published = '1' और locid IN ($ स्थान) और बेडरूम में ($ बेडरूम) जब मेरे पास स्थान = 0 और बेडरूम = 1 का अनुरोध होता है, तो यह ठीक काम करता है लेकिन बेडरूम = 0 मुझे कोई परिणाम नहीं मिलता है। जब मैं बेडरूम का स्टेटमेंट को और बेडरूम में बदलें (-1, 1, 2, 2, 3, 4, 6, 7, 8, 9) यह काम करता ह...

javascript - ExtJS TriggerField set value -

I created the SelectOne Component that expanded Triggerfield, Trigger set to trigger, click OK to open a new window with the grid My problem is that how to return val = {id: "1234"), or Text: "Selected value"} "> You can create your custom trigger Wants to override the rawToValue and getSubmitValue methods And add a custom value to keep the information selected from your grid. You will define your trigger like this: Ext.define ('Ext.ux .CustomTrigger ', {extend:' Ext.form.field.Trigger ', nickname:' widget.customtrigger ', config: {option: null}, // override rawToValue method rawToValue: function () {return it. );}, // override getSubmitValue method getSubmitValue: function () {click the override trigger on this return.getOption ()} / click trigger: function () {....}} On your grid, right button and item wclic handle R must use the triggerfield.setOption () method to capture the selected value and us...

php - deleting all files from a folder, excluding some files from being deleted -

The following thread (first post) I have successfully completed the deletion of all files from the folder using php. This is the code I use: $ files = glob ('path / to / temp / *'); // get all file name foreach ($ files as $ files) {// iterative files if (is_file ($ file)) unlink ($ file); // delete file} I want to exclude some files from being deleted. What code adjustment should I apply? $ files = glob ('path / per / temporary / *'); // Receive all filename $ exemption = [["amazingfile_a", "amazingfile_b"]; Foreign Currency (files as $ $ file) {// ifre file (if_file ($ file) and amp; amp;; in_array (end (explosion ("/", $ file)), $ exceptions ($ File); // delete file}

Why does jQuery validation plugin configuration override after initialisation not work? -

I am trying to set up the form validation. My plan is to initialize the page with the configured identity object and reset it's configuration for my needs when necessary. But it does not work as expected, after initialization it does not accept a new configuration object. Here's my code: & lt; Form id = "testform" & gt; & Lt; Input type = "text" name = "myField" value = "" id = "myFieldID" class = "myFieldClass" placeholder = "type something ..." title = "Please fill my field" /> & Lt; Input type = "submit" class = "validate" name = "submit" value = "test" /> & Lt; / Form & gt; & Lt; Script & gt; Var Validator = $ ('# testform') Validate ({debug: true}); Validator = $ ('# testform') Validate ({Debug: False, Rule: {myField: "Required"}, Message: {myField: "Hello Other!"}}); & L...

php - How to know if the cache in doctrine 2 + zend framewrok is working? -

एक सिद्धांत 2 + ज़ेंड फ्रेमलेख 2 प्रोजेक्ट में कैश के लिए मेरा कॉन्फ़िगरेशन है: module.config.php: // सिद्धांत सिद्धांत 'सिद्धांत' = & gt; सरणी ('चालक' = & gt; सरणी (__NAMESPACE__। '_driver' = & gt; सरणी ('वर्ग' = & gt; 'सिद्धांत' \ ORM \ मानचित्रण \ ड्राइवर \ व्याख्यान ड्रिवर '' 'पथ' = & gt; सरणी (__ डीआईआर__। '/ ../src/ '। __NAMESPACE__।' / इकाई '),),' orm_default '= & gt; सरणी (' ड्राइवर '= & gt; सरणी (__NAMESPACE__।' \ इकाई '= & gt; __NAMESPACE__।' _driver '),) ), 'विन्यास' = & gt; सरणी ('orm_default' = & gt; सरणी ('मेटाडेटाकाच' = & gt; 'mycache', 'query_cache' = & gt; 'mycache', 'result_cache' = & gt; 'माईकैच',)) ), 'Service_manager' = & gt; सरणी ('कारखानों' = & gt; सरणी ('अनुवादक' = & gt; 'ज़ेंड I18n \ ट्रांसलेटर \ ट्...

google app engine - ndb unique key in range -

I am using the Google app engine and need to keep keys for an entity between 1000 and 2 ^ 31 I am considering two ways to do this: 1) Place a counter over the keys created according to the details given here. But it requires a lot of datastore which writes / writes for each key and I'm not sure that it is guaranteed to be compatible. 2) Generate a random intro in my category and check whether the key is already in the database or not. To make it cheaper, I would like to open one of the keys, but without saving my key as a separate field, there is no way to do this: MyEntity.query (MyEntity.key_field == new_random_number) .fetch (keys_only = True) Is there a better way of achieving this? get_or_insert example. Import 7 unique keys import webapp2 google.appengine.ext import datetime import from dndb datetime import random import logging class example (ndb.model): data = ndb.StringProperty () modified = Ndb .DateTimeProperty (auto_now = true) Created = ndb.DateTimePr...

string - In Python 2, can I pass a list to the percent-format operator? -

I have a list of things I want to print using the format string. In Python 3-style, using "a string" .format (arg, arg, arg), it's easy. I can simply replace it with arguments with * mylist , like mylist = [1,2,3] "{} {} {}". Format (* mylist)) I can not do this work with the old percentage formatting. I have tried stuff like the "% i% i% i"% mylist , % i% i% i "% (mylist) , and % I% i% i "% (* mylist) but I keep syntax errors or" not enough logic ". Is it impossible in 2.x style? ETA: I'm changing the example above, I did not really mean list , tupal . I am still learning and I have not been used to produce two different array-like. Should just work. & gt; & Gt; & Gt; Mylist = (1, 2, 3) # & lt; ---- Tuple & gt; & Gt; & Gt; "% I% i% i"% mylist '1 2 3' BTW, (1, 2, 3) A Tupe is literal, not a list Verbal & gt; & Gt; & Gt; Mylist = [1, 2, ...

neo4j - How to use parameters correctly in Transactional Cypher HTTP -

I'm a bit stuck I'm trying to use the parameters of my HP request to reduce the overhead, but I did not know why this would not work: {"statements": [statement ":" Matt (n: person) WHERE n.name = {name} SET n.dogs {{"}" Returns: "{{"} ":" {{"}": "", "andres", "dogs": 5}, {"name": "Michael", "dogs": 3}, {"name" "Someone", "dogs": 2}]}]} I I know that given in the manual Open equally a transaction with a statement from Dahrnon and try to feed different "lines" as Parametrs first transaction I / COMMIT. What am I missing? I have modified an answer since that which allows for the majority of the parameter 'set' Seems to work by using a FOREACH statement. {{"Parameter": {{"props": {{"userid": "177032492760", "Username": "John"}, "State...

Javascript enumerate object value: the difference obj.key vs obj[key] -

इस सवाल का पहले से ही एक उत्तर है: 10 उत्तर किसी ऑब्जेक्ट के जरिए दोबारा, Obj.key का उपयोग करके संदर्भ मान सभी "अपरिभाषित" मिलता है जबकि obj [key] ठीक काम करता है वे समान नहीं हैं वे नहीं हैं? क्या मुझे कुछ याद आ रहा है? jsfiddle लिंक: फ़ंक्शन इटरेट ओबज (obj, callback) {if obj == null || type ob ob! = "Object") { वापसी; } के लिए (obj में var कुंजी) {// कॉलबैक (कुंजी, obj [कुंजी]); Console.log ("obj.key --- & gt;" + obj.key); Console.log ("obj [key] --->" + obj [कुंजी]); // कॉलबैक (कुंजी, ओबीजे.की); "दूसरा": {दूसरे: "1", दूसरे 1: "3", दूसरा 2: "अन्य": " 2 "}, अंत:" foo "} फिर से ओबज (नमूना, फ़ंक्शन (कुंजी, मान) {// console.log (" कुंजी: "+ + +", "+" मान: "+ मान);}) नहीं वे समान नहीं हैं जब आप ऑब्जेक्ट पर प्रॉपर्टी लुकअप कर रहे हैं और जो संपत्ति आप देख रहे हैं, या इस उदाहरण में 'कुंजी' में कुछ और के लिए एक प्लेसहोल्डर है...

IOS, Swift, Animation chaining, waiting main thread until chain completes -

This question has been asked at least as I have searched for answers but never for my satisfaction. I have 52 subwigs that represent the card deck. Cards appear in the center of the screen, two of the cards are divided into piles and then merge together as a felt deck. If I type self.standardShuffle () to but if I enter self.standardShuffle () in a row Call 2 times, so it works fine. The second call flies the first animation in flight and the animation is wasted. There should be a way to block the calling thread until the action series is completed. The timers are very unwieldy and I can not put all my code inside the animation blocks (and it does not work anyway). Is anyone's real answer? Please There should be a way to block the calling thread is not there never not blocked never If you think that the answer you have seen is not satisfactory, you have not read them carefully, read them and trust them. You can easily arrange the first animation to be ...

mysql - Finding intervals in a table -

The problem here is that I have state timestamps with different processes and states. for example. The process with ID 135 was at this time 1 state was "2014-01-09 15:41:22". 4 state types are 0 = fine 1 = warning 2 = important 3 = unknown. Here is a piece of table: id state_time process_id position 37 "2014-01-09 15:41:22" 135 1 92 "2014-01-09 15:42:01" 135 0 153 "2014-01-09 15:46:28" 135 1 204 "2014-01-09 15:47:25" 135 0 25 9 "2014-02-05 14:48:00" 135 1 321 "2014 -02-05 14:49:20 "135 2 352" 2014-02-05 14:50:40 "135 2 383" 2014-02-05 14:52:00 "135 1 464" 2014-02-05 14 : 53: 20 "135 2 576" 2014-02-05 14:54:40 "135 2 621" 2014-02-05 14:56:00 "135 2 666" 2014-02-05 14:57:20 " 135 1 747 "2014-02-05 14:58:40" 135 3 792 "2014-02-05 15:00:07" 135 1 957 "2014-02-05 15:18:53" 135 0 Here I have selected only one process, but ma...

itext - PDFStamper.close() throws IOException error -

We are trying to add a stamp to the 150MB file. When executed pdfstamper.close (), then we get the following error: 2014-10-17 11: 02: 29,470 Error: IOException: not as test.pdf file or resource. ** java.io.IOException: ** test.pdf ** File or Resource not found in the form of **. Com.itextpdf.text.pdf.RandomAccessFileOrArray at & lt; Init & gt; (RandomAccessFileOrArray.java:107) on com.itextpdf.text.pdf.RandomAccessFileOrArray. & Lt; Init & gt; (RandomAccessFileOrArray.java:79) When we removed the watch folder, file and has been replaced by a hidden file. In hiding we do not have the stamp placed on the PDF image.

javascript - Jquery Droppable not working for Dynamically added DIVS -

I have the same problem and I need to resize drag drop and function functionality, It works well with a static element, but I have to add dynamic devices, and this resize property works properly for dynamic devices, but droppable Functionality Not working ... I spent the last day in R & D and found solutions for that This is one How can I remove it? Here is the code snippet CSS # section1> Div {Display: Table-Cell; / * Width: 1%; * / Border-right: 1px dotted red; Text align: center; } HTML & lt; Input type = "button" class = "mybutton" value = "add div" /> & Lt; Br / & gt; & Lt; Div class = "selectorfild" style = "height: 100px; width: 100px; background-color: green;" & Gt; & Lt; / Div & gt; & Lt; Div id = "section1" style = "height: 100px; line-height: 20px; width: 100%; limit: 1px dotted red; display: table;" & Gt; & Lt; Div class ...

How do I use the W3C tidy-html5 bundle on Mac OS via TextMate OR command line? -

I have installed the W3C Clean-HTML5 bundle here: ~ / Library / Application Support / Avian / Priestin Copy / Bundle / itemprop = "text" Clean-html5 However, when I run the command in the terminal, it does not seem to recognize the HTML5 tag. It seems that this is probably the old HTML clean method, which only understands XHTML / HTML4 for example, if I run:. clear ~ / desktop / tidy- test.html I get this output: line 1 column 180 - Error: & lt; Aside & gt; Not recognized! Line 1 column 180 - Warning: unexpected and lieutenant; Separate & gt; Line 1 Column 353 - Error: & lt; Section & gt; Not recognized! Line 1 Column 353 - Warning: Unexpected & lt; Section & gt; Line 1 column 418 - warning: place invalid character code 139 line 1 column 419 - warning: place invalid character code 134 line 1 column 421 - warning: place invalid character code 139 line 1 column 422 - warning: place invalid character code 134 line 1 Column 424 - wa...

python - pyephem advances observer date on NeverUpError -

First question: I am searching on a large group of latitude / Set Bar Some of these points are near the pillars. The following code, NeverUpError Moon = Effam. Pisces () obs = ephem.Observer () obs.lat = '89 'extends observer's date on obs.lon =' 0 'obs.date = ephem.Date (' 01/01/2014 ') print obs. Date # 2014/1/1 00:00:00 obs.next_rising (moon) # traceback (most recent call final): # ... #imam. Never at all: 'Moon' below the horizon prints on 2014/1/1 12:04:01 print obs.date # 2014/1/1 12:04:01 Is there a way to check before obs.next_rising (moon) ? I would like to retain the date in the observation. I currently try / leave the block and to reset it and reset it to the date. Is there a better way? Second question: Already related, is the library thread safe? I set it to calculate several dates at a time in a different thread using the queue and threading module. First answer: The fact that the date of change, a bug in Py...

c# - Instantiating DbEntityEntry<T> with Reflection -

After I am trying to create a DbEntityEntry & lt; Through reflections for testing purposes T & gt; Its constructor is internal, but I want to call it and pass it in one unit: Public DbEntityEntry & lt; T & gt; Entry & lt; T & gt; (T unit) where T: class {type construction type = type (DbEntityEntry ); Binding Flags = Binding Flags Nonpolic | BindingFlags.Instance; Object X = Activator Create (creation type, flags, blank, new object [] {entity}, blank); I am: Type 'System.Data.Entity.Infrastructure.DbEntityEntry`1 Creator [[System.Object, mscorlib, version = 4.0 .0.0, Culture = Neutral, PublicKeyToken = b77a5c561934e089]] 'Not Found is the source for the creator. Internal DbEntityEntry (InternalEntityEntry internalEntityEntry) {DebugCheck.NotNull (Internal Interval Entry); _internalEntityEntry = internalEntityEntry; } Any way to create an example? UPDATE: The original code was actually picked up from Mark Gravel's last repl...

mysql anomalies (ERROR! The server quit without updating PID file) -

Something really strange happened in my MySQL database. This morning I came to work, and found out that my Mac desktop was off, even if I had left it last night. I started it, and running on my local Microsoft DB (OS X 10.9.5 ) And tried to log in with their regular credentials, and there was an entry denied error. I tried to reset the root password via terminal: sudo /usr/local/mysql/support-files/mysql.server sudo mysqld_safe --skip-grant-tables mysql - U root UPDATE mysql.user SET password = password ('password') Where user = 'root'; Flush Pvt .; Then I tried to restart the server: sudo /usr/local/mysql/support-files/mysql.server start and found . Error! Server PID file (/usr/local/var/mysql/Mac-Pro.local.pid) left without updating I tried to check whether the mysql process is typing ps aux or not. Grep mysql , but did not find any results. Then I decided to reboot, and was running after the reboot server. However, if I try to restart the serv...

c# - Redirect to a different page in a new window -

I am trying to give the user a new browser window and redirect them to a different page. I did it before using it ScriptManager.RegisterStartupScript (page, typef (string), "popup", "window.open ('davatim expans', 'ipx', '_blank')", truth ); This is the thing that the page I'm on is the URL / file path, for example localhost / protected / admin / allUsers ASPX But the page I need to redirect is just localhost / protected / myPage2.aspx , so when the window opens, the server throws error It has entered the file path .. Local Host / Protected / Admin / Accountant Expansion. Espacks Is there something wrong with my script manager line or is there any way to correctly point out the URL? I would use javascript but it must be done in this way. Try this one so that localhost / protected / myPage2.aspx open: window.open ('../ claim time expansion', '_blank')

objective c - Another application window close -

इस प्रश्न के समान: http://stackoverflow.com/questions/12422327/other-application-window- क्लोज़ इवेंट क्या अन्य अनुप्रयोग विंडो को बंद करने के लिए मॉनिटर करने के लिए पहुंच क्षमता मॉडल के अलावा कोई रास्ता नहीं है? मुझे इस पर काम करने के लिए उपयोगकर्ताओं को पहुंच योग्यता मोड चालू करने की आवश्यकता नहीं हो सकती। NSWorkspace अधिसूचना केवल आपको बताएगा कि क्या आवेदन समाप्त किया गया था।

python - Why does gitpython on windows always get file not found errors? -

While searching for a tutorial for gitpython, and following the steps from the next step, there are some problems on my machine: i is a Windows 7 environment, And GIT version 1.7.11. MMS Sigma.1 with Python 2.7 Everything is fine with Easy_install, the repo object is created successfully, and commands like repo.tree () and repo.branches work if I have a repo. Is_dirty () If I do not find any non-specific files, errors are not found. WindowsError: [Error 2] The system can not find the file specified. Any ideas? path = "c: \\ path_to_repo" repo = repo (path) emphasis repo.bare == wrong print repo.tree () repo.branches print dir (repo) # it always crashes ... repo.is_dirty () TIA for any help. You have git.ext in your PATH , but it can easily be tested by executing itself if you see an error, you can add it to PATH , or GIT_PYTHON_GIT_EXECUTABLE can be executable for executables that git-python should be executed for git command line services. It w...

protractor - Selenium webdriver unknown error -

I am using protractors to perform some E2 tests, but despite successfully running the tests, Selenium-WebDowner Completed after throwing error. ... / node_modules / grunt-protractor-runner / node_modules / protractor / node_modules / selenium-web driver / lib / atoms / error.js: 113 var template = new error (this message. ); ^ Unknown error: No such session ... I am having trouble finding out what I am doing. EDIT: I came to know that the problem was that I wanted to measure some testing times in the browser. Was shutting down. Can I close the browser again and re-open because browser.coos () and then browser.get () are not working? Edit: With launcher 3.3.0 it is now possible to open Browser.restart ()

JSON serialization in javascript and php deserialization -

Hello I have problems with deserialization of serialized JSON in JavaScript. I have a form on the webpage and every line is a product (inputs, picks, checkboxes): name, value, total math, ... name 2, value 2 , Total count 2, .... .. I take a form and serialize it with javascript (function jjaxload is normal, jquery foundation is $ .ajax (...) and it is in other places correctly Works) var form = $ ('# myForm'); Formksubmit (function (event) {event.preventDefault (); ajaxLoad (form.attr ( 'action'), form.parent (), {jsonData: JSON.stringify (form.serializeArray ())});}) ; In php, the data has been received and my code is the following: $ data = json_decode ($ jsonData, true); $ This- & gt; Template-> Data = print_a ($ data, 1); returns something like this: array ([0] => array ([name] => product [0] [cor_projectProduct_name ] [value] = & gt; 1ks Replika Kádnerova jáchymovského stand tolaru BJ) [1] = & gt; array ([name] = & gt...

objective c - Assigning pattern information to pictures (iOS) -

I'm new to iOS development world and I'm making a small (potential addictive) game. I know Python and HTML / CSS, so I will be able to face computer terms, but if you are able to explain any answer, then it would be good. For a short time, on a screen in my game, let's assume this is 'Arrow Left, Arrow Right, Arrow Left' (as a picture). Then the user will have to repeat the pattern (in the right order) to proceed. I'm going to use the UIGestureRecognizer to call the boost function with the 'right' pattern The next step in my programming tells the pictures 'path'. The identifier will check that the user input is equal to the given pattern, but I need to see for the computer whether the pattern shown is input by the user (sorry it is misleading). In essence, what is the most effective way of identifying a computer if the pattern given by the user is similar to the one on the screen. Thank you in advance, OK, so I actually forgot for...

matplotlib - Hierarchical clustering of heatmap in python -

I have an NXM matrix with values ​​from 0 to 20. I easily get a heatmap using matplotib and packer. Now I want to apply a hierarchical clustering and a dangram which uses SASP. I want to re-order each dimension (rows and columns) so that it can show which elements are the same (according to the clustering result). If the matrix class (NxN), then the code would be something like this: clustering = linking (matrix, method = "average") dendrod (clustering, orientation = 'right') How do I get link matrix when the dimensions are different? Do I have to calculate each distance manually between each pair element? I'm not sure how this is using matlotib and pancalir, though the marine carbon package There is basic support for what you are trying to achieve. Example: Import seaweed as SAB; Sns.set () Flights = sns.load_dataset ("Flights") Flights = Flights. ("Month", "year", "passengers") g = sns.clustermap (flights...

jquery - Send data to a site to obtain a Json with php -

I'm having any problem, this is the thing that I was reading a json file with jquery, and it's good The way I was working, but now I have to read it in PHP, but this is that I am using some data to get some parts of JSON: Datastring = "id =" + id + "& Todos =" + false; $ .ajax ({type: "post", url: "http://www.url.com/example", data: datestring, datatype: "jason", success: function (data, textstate, jxaxhr) { And I did not have any problems with it, because I was sending data to the site so it gave me the information that I want, but I do not know how to do it in PHP, I was trying $ str = file_get_contents ('http://www.url.com/example.json'); $ json = json_decode ($ str, true) var_dump ($ Take And of course this site is not returning me because I am not sending data I hope there is a way. Thanks! You should use the curl or fsockopen if it is not current and can not be enabled (too much Rar...

imagemagick - Imagick stopped working after upgrading to OS X Yosemite -

Imagery is usually used to work on Mavericks before upgrading Yosomite. Why any suggestions are being stopped? Yosemite ships with version 5.5.14 you have to re-establish all your previous PECL modules , And need to reconfigure your /etc/php.ini for the new extension path / usr / lib / php / extensions / no-debug-non. -zts-20121212 .

javascript - cannot iterate through array and change value in JS -

Image
I have to repeat through an array, change one of its values, and change the changes to a Another is to make an order. This is what I have done so far: JS: var arr = new array (); Arr ['t1'] = "sdfsdf"; Arr ['t2'] = "sdfsdf"; ARR ['T3'] = "SDFDDF"; Arr ['t4'] = "sdfsdf"; Arr ['t5'] = "sdfsdf"; Var final = new array (); For (var i = 0; i & lt; = 5; i ++) {AR ['T2'] = I; Last.push (Arrival); } Console.log (last); Unfortunately, these are my results As you can see, I'm not getting the result as 0,1,2. Instead, I'm receiving 2, 2, 2. What is my outcome? How can I fix it? You have to copy, otherwise you are working in the context of the same object all the time. As previously mentioned - Javascript does not have an associate array, only properties with properties. var arr = {}; // empty object arr ['t1'] = "sdfsdf"; Arr ['t2']...

CocoaPod Podspec Dependency On couchbase-lite-ios -

Image
मेरे पास निर्भरता के साथ एक पॉडस्पेक है: s.dependency "couchbase-lite -आईओएस "," ~> 1.0 " जब मैं स्पेक फाइल लिंटा जाता हूं, तो मुझे मिल जाता है: पॉड स्पेक्ट लिंट - नो-क्लीन। .. घातक त्रुटि: 'काउचबेस लाइट / काउचबेस लाइट एच' फ़ाइल नहीं मिली मैं उपयोग कर रहा हूँ अन्य निर्भरताओं के विपरीत, इस फली में .h / .m फ़ाइलों के बजाय एक चौखटे शामिल हैं I couchbase-lite-ios के लिए podspec अभी अद्यतन किया गया था, इसलिए मुझे लगता है कि यह अभी भी मान्य है। मैं थोड़ी देर के लिए यह पता लगाने की कोशिश कर रहा हूं। इसके अलावा, अगर मैं pod install करता हूं और परियोजना का निर्माण करता हूं, तो सब कुछ ठीक से लिंक हो जाता है। मैंने बदल दिया #import & lt; couchbaseLite / couchbaseLite.h & gt; से #import "couchbaseLite.h"

How to check if a set contains an array in Javascript? -

मैं यह जांचना चाहूंगा कि एक सेट में एक सरणी है। var x = new सेट(); x.add (2); x.has (2); // रिटर्न सही, ठीक x.add ([3,4]); x.has ([3,4]); // झूठी रिटर्न मुझे यह पता है: [1,2] == [1,2]; // लौटा झूठा मैं दो सरणियों का प्रयोग करके लूप या जेएसएएन.स्ट्रिन्ग की तुलना कर सकता हूं। हालांकि सेट के अंदर एरे के मामले में इसे कैसे निपटाना है? सेट करें सेट में संग्रहीत मानों की तुलना के लिए अनिवार्य रूप से === का उपयोग करें। यदि आप इसे स्वयं हल करना चाहते हैं, तो आपको अपने सेट डेटा संरचना को पाशन या बनाने का सहारा लेना होगा। जब आप अपना समाधान करते हैं तो आप इसे बराबर विधि पर निर्भर कर सकते हैं ताकि प्रत्येक ऑब्जेक्ट स्वतंत्र रूप से निर्धारित कर सकें कि यह दूसरे के बराबर है।

hover - jquery sidebar putting next to each other -

I have put a sidebar with hover-delay animation, but I can not copy the column correctly to the first This is my first problem. Secondly, I would like to use the jspanel plugin, so that clicking on a sub-item in a sidebar will create a draggable window. I hope this can be brought to a working position. Thank you very much for the responses in advance! here [a link] ()! $ ('# categories'). Corner ("keep the top"); $ (Document) .ready (function () {$ ("# foo"). Click (function () {$ () .jspanel (). Show ();});}); $ ("#navigation ul.sub-level") .coreor (""). CSS ("border", "3px double blue"); JQuery.fn.hoverWithDelay = function (callback, out callback, delay) {this.each (function () {var timer, $ this = this; $ (this) .more (function () {timer = setTimeout (function) {Timer = tap; callbackcall ($ this);}, delay);}, function () {if (timer) {clear timeout (timer); timer = null;} and callback outside. Call ($ this...

vba - Memory/resource limits in Excel 2007 vs 2010 -

I have a macro which works fine in Excel 2007, but with errors in 2010, "Excel does this work Do not complete available resources. Choose fewer data or close other applications. " Here is the relevant section of the code: with. Worksheets (first-detector) .Renz ("1: 1") .Value2 = ps_rng.Range ("1: 1"). Value 2 ps_rng.Range (CSRR (start_row) and ":" and CSRR (ANDOOO)) destination destination: =. Range ("2:" & I'm pretty sure why it works fine in 2007, but not in 2010.

ios - NSData made from gif file reduced to less than 10kb when sending via email -

Ive got a code that creates a GIF file in an NIDITA object in the AP document folder and then returns that object to Connects to the email. Everything works perfectly in the Xcode Simulator and adds the correct file size in the mail window. Although the gif displays on the iPad as an animated file in the mail window but the file size is less than 10kb and does not animate when opened at the end. I have tested the GIF file in the Documents folder via iTunes file sharing and it is working perfectly I check the size of the data in the code below and output for 5.9 mb file 6084937 (checked via iTunes file sharing). It's like 4.1 KB in the mail window. Any thoughts that I am doing wrong? Thank you :) Code given below: MFMailComposeViewController * picker = [[MFMailComposeViewController alloc] init]; Picker.mailComposeDelegate = self; [Picker set topic: @ "GIF file from app"]; [Invoice Setmeseed Bidi: @ "MyGamplan GIF Image" is HTML: Yes]; NSURL * d...

jquery - How to re-use $.when() with Deferred -

मैं एक jQuery डिफरेड का पुन: उपयोग करना चाहूंगा HTML: & lt; form id = "theform" class = "form-horizontal" action = "" method = "post" & gt; & Lt; div वर्ग = "फॉर्म-एक्शन" & gt; & Lt; बटन प्रकार = "सबमिट करें" वर्ग = "बीटीएन बीटीएन-प्राथमिक" & gt; कुछ करो & lt; / बटन & gt; & Lt; / div & gt; & Lt; / प्रपत्र & gt; जावास्क्रिप्ट: var adefred = $। निष्क्रिय (); Var doSomething = function () {console.log ('doSomething' में); aDeferred.resolve (); Console.log ('स्थिति को हल करने के बाद:' + adefred.state ()); } $ ('# TheForm')। Submit (फ़ंक्शन (इवेंट) {event.preventDefault (); console.log ('सबमिट करें में राज्य:' + adferred.state ()); doSomething ();}); $। जब (एडेडर्ड) .done (function () {console.log ('हम कर रहे हैं'); adeferred = $। निष्क्रिय ();}); -> पहली बार बटन पर क्लिक किया जाता है, मैं अनुक्रम को समझता हूं: ...

sql server - SQL CASE: IF 2 different columns = something then the 3rd column = something; IF [a] = a AND [b] = b THEN [c] =c -

c - While loop not terminating with '\0' -

This is a function to read the character's character from the file and then convert the string to a float, but when the loop GSF 555 "Gas Filters - Ford Escort" 64.50 9 & lt; - This is what has been read with "64.50", but with "64.50" PKL070 "Park Lens - Toyota Corolla" 36.50 8 while loop '/ 0' before Goes and also reads "9" and letters from the next line of data. I have printf to see just what has happened. float getPrice (FILE * in) {char ch; Int i = 0; Four letters [10]; Ch = fgetc (in); Printf ("INDEX + NUMBER =% d% c \ n", i, ch); If (ch == '\ 0') ch = fgetc (in); Str [i ++] = ch; While (ch! = '\ 0' and & amp; i I'm not sure what I'm looking for in your post where \ u Talking, but I can see some problems. First, fgetc returns an integer, not a character, it may be important to test for file offs because EOF is an integer with 1, not a character that is u...

regex - wildcard .htaccess and reject some address on subdomain -

मुझे चाहिए कि सभी फाइल या निर्देशिका up.example.com उपडोमेन अस्वीकार कर दी गई है और 404 त्रुटि दिखाती है । इसके अलावा मुझे index.php पर एक और अनुरोध बिंदु चाहिए। मैं यह कोड लिखता हूं: RewriteEngine रीवाइट कंड पर% {HTTP_HOST} ^ अप \ (। +) $ [एनसी] रिवरइटकॉन्ड% {REQUEST_FILENAME} -f [OR] रीव्रैटकॉन्ड% {REQUEST_FILENAME} -डी रिक्राइट नियम ^ (। *) $ - [आर = 404, एल, एनएस] रीराइटकॉन्ड% {REQUEST_FILENAME}! -f पुनर्लेखनकंड% {REQUEST_FILENAME}! -डी रीराइटर्यूल। Index.php [एल, क्यूएसए] जब मैं http://up.example.com/test.jpg यदि test.jpg फ़ाइल रूट सर्वर पर मौजूद है, तो मुझे यह त्रुटि दिखाएं: नहीं मिला अनुरोधित URL /test.jpg इस सर्वर पर नहीं मिला था। अप 80. अपेड सर्वर पर पोर्ट 80 यह ठीक है! लेकिन जब test.jpg अस्तित्व में नहीं है, तो मुझे यह त्रुटि दें: नहीं मिला अनुरोधित URL /index.php इस सर्वर पर नहीं मिला था। Apache Server up.example.com पोर्ट 80 इसके बजाय खोलें index.php ( index.php root पर मौजूद है) क्यों? और मैं इसे कैसे ठीक कर सकता हूं? असल...

java - keep getting null pointer exception in linked list -

इस सवाल का पहले से ही एक उत्तर है: 12 जवाब मैं एक को हटाने की कोशिश कर रहा हूँ लिंक की गई सूची से विशेष स्ट्रिंग, लेकिन मैं रिक्त सूचक अपवाद त्रुटि प्राप्त कर रहा हूँ! किसी भी मदद के दोस्तों? सार्वजनिक शून्य हटाना (स्ट्रिंग deleteName) {LinkedListNode current = head; अगर (सिर == रिक्त) {System.out.println ("सूची से हटाने के लिए कुछ भी नहीं! डेटा डालें।"); } // सिर के लिए और अगर (वर्तमान .getName () == deleteName) {head = current.getNext (); } // tail for if else (findTail ()। GetName () == deleteName) {जबकि (current.getNext)। GetNext ()! = नल) {current = current.getNext (); } Current.setNext (नल); } Else {while (current.getNext)। GetName ()! = DeleteName) {current = current.getNext (); } Current.setNext (वर्तमान .getext ()। GetNext ()); } System.out.println (""); System.out.println (deleteName + "सूची से हटा दिया गया है।"); } कुछ संपादन किया था अब काम करता है! तारों की तुलना करने के लिए == का उपयोग न करें। सार्वजनिक शून्य हटाना (स...

Passing an array as a function argument from within a function which takes it as an argument in C -

G'day! If I have a function that takes an array of ints as an argument, and then within that function, send that function to another function, whether it still edits array values And will be divided into the main level instead of the function level? i.e int main (int argc, char * argv []) {int a [50]; FunctionB (A); } Where the function looks like B: void functionB (int a []) {functionC (a); } And the function C is the one that actually changes values ​​within A []. Should see mainly the changed array or the original A []? Thank you! Indicator will modify the array then it will modify the original array. Check it zero function C (int A []) {a [0] = 1; A [1] = 2; } Zero function B (int a []) {functionC (A); } Int main (int argc, char * argv []) {int a [2] = {5,5}; Printf ("Before the call:% d% d \ n", a [0], a [1]); FunctionB (A); Printf ("After call:% d% d \ n", a [0], a [1]); }

Nginx lua modify html response after proxy_pass -

What am I trying to do for a POC and adding a href to the web pages coming from a dynamic backend server Adding Href is easy to use "subs_filter", but I have to use embedded information in response to the creation of href. Is it possible to use LUA to process the reaction from proxy_pass, to modify it and return to the requester (client)? Any other suggestions are welcome I see the code below, now I see Lua better and see how I use NGX. The 'body_filter' is the right way though the code seems quite simple but I can not get the regex to work. The forward background, I am trying to parse the returned proxy_pass response, it is parsed for start and end time, then a JS script url is inserted into the head. Reaction to the example which I want to regx again. Notifications Horace: 08H50 Horror Day: 09 H14 Code from within 'Location {}' Body_filter_by_lua '- my regex which is valid but does not appear within the lucid - local, for, err = ng...

Import Class from a python package at runtime -

I am trying to write a function that will take the name of class Will import and do some work. def search (** kwargs): "": return: "" "Try: Model = __import__ ('girvi.models', globals (), local (), quad' Model_name '], -1) Exclude Exception: Make some return result: Exception increase (' Model not found ') But the thing is that model In the class that has kwargs ['model_name'] imported successfully but how can I use it please someone can help me. I will try the following: Import Lib import sys def import_class (class_name, module_name = "girvi.models"): module = importlib.import_module (module_name) class_object = getattr (module, class_name) # nested classes does not work for class_object return __ Import __ should use importlib.import_module .

encoding - How to encode packet information by XOR in matlab -

Image
I am working in the Channel Coding section. For example, the input bit is encoded with my key information: x = [1 0] and the G matrix is ​​given g = 1 0 0 1 Then the encoding symbol will be y = mod (x * G, 2) to convert% mod to binary bit This code is very simple idea for encoding bits of processing in coding. Now I want to map this work for packet encoding. Some papers have been told that we can do this for packet encoding, if we consider each packet en bytes. For example, I have a text file whose size is 3000bytes, I will now divide the file into 1000 packets. Therefore, the size of each packet is 3 bytes. My problem is that I did with bit encoding However, I do not have any idea of ​​working with packet encoding. Please tell me if you have worked with this problem I have heard that there are only two levels 0 and 1 in bit encoding, so we can use GF = 2 if we work for packet level , We should consider GF> 2; I'm not sure that it The second question is if th...

php - How to show page by order in Post Query Wordpress -

I want to show the page in a custom template. I use the Post Query Loop to show the page and it works. But I do not want the home page to be shown. And I want to show my pages according to the order of ordering. I order the pages. But I am not able to fix it. & lt ;? Php global $ post; $ Args = array ('posts_per_page' => 3, 'post_type' = & gt; 'page', 'command' => 'ASC'); $ Myposts = get_posts ($ Args); If (! Myposts below!): Foreach ($ myposts $ post): setup_postdata ($ post); ? & Gt; & Lt; Section class = "colon-1-3" & gt; & Lt; Div class = "wrap-col" & gt; & Lt; Div class = "box" & gt; & Lt; Div & gt; & Lt; H2 & gt; & Lt ;? Php the_title (); ? & Gt; & Lt; / H2 & gt; & Lt; Figure & gt; & Lt; Img src = "& lt ;? php echo get_template_directory_uri () ;? & gt; /images/page1_img1.jpg" alt = "" & ...

java - Get data from table using jSoup -

I'm looking at using jSoup to get data from the table. I want to put it in the table, which I can use in my code. I am also not sure how to do this I am playing with JSOP and currently I am able to print each cell using a loop from the table - but obviously, it Can not always be used because the number of cells in the table will change. Document Doctor = Jsoup.connect ("http://www.sportinglife.com/greyhounds/abc-guide") .get (); Int n = 0; Whereas (n & lt; 100) {element tablehead = doc.select ("td"). Get (n); (Element element: tableHeader.children ()) {// Here you can do something with each element System.out.println (element.text ()); } N ++; } How can I do this? To achieve your goal, you must apply a few things. Take a look at this Groove script - Now let us know what we have list & lt; Element & gt; Here we are specifying that we need to enter the line tr / Code> This is the instant child of the tomb which is immediately...

google app engine - multiple filters vs OR , ndb query -

इन प्रश्नों के बीच अंतर क्या है: qry1 = Account.query () # सभी खाता प्राप्तकर्ताओं को पुनः प्राप्त करें qry2 = qry1.filter (अकाउंट। यूरीड & gt; = 40) # यूज़र आईडी पर फ़िल्टर करें; = 40 qry3 = qry2.filter (अकाउंट। यूसेरड & lt; 50) # यूज़रआइटर पर फ़िल्टर & lt; 50 के रूप में अच्छी तरह से और => qry = Article.query (एनडीबी.ओआर (अकाउंट। यूसरिड & gt; = 40, अकाउंट। यूसेरीड & lt; 50)) और => qry = Article.query (ndb.and (अकाउंट। युरीड & gt; = 40, अकाउंट। यूसेरीड & lt; 50)) पहली क्वेरी एक AND करता है I इस प्रकार, केवल ऐसी संस्थाएं जो दोनों असमानताओं से मेल खाती हैं, क्वेरी से वापस आ जाएंगी। दूसरी क्वेरी एक OR करता है इस प्रकार, किसी भी फिल्टर के मेल खाने वाली संस्थाओं को वापस लौटा दिया जाएगा। एनडीबी प्रश्नों के बारे में अधिक जानकारी के लिए, एक नज़र डालें।

c - Purpose of #define foo() do { } while (0) -

While browsing the sources of LinCAN driver, I found some macros that were bothering me. # other / * CONFIG_PREEMPT * / #define can_preempt_disable () while doing (0) #define can_preempt_enable () while {0} #endif / * CONFIG_PREEMPT * / I understand utility of {...} ... if break (position); ...} while (0); Type a throw by using break . I wrap the sequence of works like quote eg #define FOO () do {foo (); times (); } While avoiding unconscious if I understand that sometimes "no-op statements" are required for #define, but this is particularly important to (0) Why? In particular, empty braces, false conditions, while ... do? Some syntax warnings do not quite understand me? This is: #if! Defined (CONFIG_PREEMPT_RT) & amp; Amp; (Defined (CONFIG_PREEMPT) || (LINUX_VERSION_CODE & gt; = KERNEL_VERSION (2,6,0)) #define can_preempt_disable preempt_disable #define can_preempt_enable preempt_enable #else/ * CONFIG_PREEMPT * / #define can_preempt_di...

c++ - How to control the copy of return object into a new object? -

This code is overloaded in order to control operator behavior for the operator = class A objects, and the copy constructor was also declared to see that it was used for the copy process. My question is, the compiler, a_object + b_object in c_object if the copy constructor and assignment operator was not used as shown in the output ? And in this case how to control the copy behavior? #include & lt; Iostream & gt; #deleted panellines (x) std :: cout & lt; & Lt; X & lt; & Lt; "---------------------------- \ n"; Class A {IIT value; Public: A (Int V = 0): Value (v) {} A (Constant A and A) {std :: cout & lt; & Lt; "CUSTOM CREATOR ... \ n"; Value = a.value; } Consta and A. Operator = (Constant A & A) {std :: cout & lt; & Lt; "= Operator ... \ n"; This- & gt; Value = a.value; Return * This; } Const. One operator + (Constant A & A) {Return A (Value + A. Value); } Zero print (std :: ostream & o...