Posts

Showing posts from April, 2012

php - file_exist function won't work -

I have a function that checks that the mobile image is present, and if so, it will return the truth, no difference What I can do is that I can not work this function properly. public function mobileImageExist ($ image) {$ file = "images / $ image"; If (file_exists ($ file)) is true; return false; } I have also tried public function mobile imageexist ($ image) {$ file = dirname (__ file __). "/ Images / $ image"; If (file_exists ($ file)) is true; return false; } The $ image parameter that the function is being passed is just the name of the image eg: banner_mobile.jpg

html php get dom table - can't extract table data -

I'm trying to remove two tables when using Get HTML DOM, Can not do to get the information, only what I am getting on the following web page: Can you help in whatever you are doing wrong? The following PHP code is in use & lt ;? Php // How to use basic selector to retrieve HTML content for example ('../ simple_html_dom.php'); // Get from the DOM URL or $$ html = file_get_html ('http://www.lolking.net/now/euw/tallmangreen/'); // Find all links // foreach ($ html- & gt; ('a') $ e) // echo $ e- & gt; Href '& lt; Br> & # 39; & # 39; // Find All Image Foreign Currency ($ HTML- & gt; Find ('IMG' as $ E) echo $ e- & gt; Src '& lt; Br> & # 39; & # 39; // Find all images in the form of $ E as full tag foreign currency ($ html-> search ('IMG') echo $ e- & gt; External Text '& lt; Br> & # 39; & # 39; Find all div tags for $ e with id = gbar foreach ($ html- ...

php - my $_SESSION["message"] echoing everywhere even there is if -

I have a problem. I want to resume my message ("created subject", "subject failing creation" is not created or not) The problem is that the message is on every page, even if $ _ session ["message"] setting if is under the condition I really do not know where the problem is This is on my proceedings page ... if (isset ($ _ POST ["submit"])) {$ menu_name = mysql_prep ($ _ POST [" Menu_name "]); $ Position = (int) $ _POST ["status"]; $ Visible = (int) $ _POST ["visible"]; $ Query = "Include in topics ("; $ query. "=" Menu_name, position, visible "; $ query. =") VALUES ('{$ menu_name}', '{$ position}', '{$ visual } '; $ Result = mysqli_query ($ connection, $ query); if ($ result) {// success // $ _SESSION ["message"] = "created topic"; redirect_to ("manage_content.php"); } And {$ _SESSION ["message"] = "theme c...

python - How can I get useful data from lists in a list? -

The question is probably not very clear here. Here I have a list, like data structure: [[221.86797965649234, 490], [306.5453090728297, 400], [307.362157064 96666, 842]] How can I use an efficient method to get a new list I am [494,400,842]? Currently, my method list = [[221.86797965649234, 490] [306.5453090728297, 400], [307.362157064 96666, 842]] n NewList = []: newList.append (n [1]) If the original list contains more than one million items, it will be very slow, is there any effective way? Use: & gt; & Gt; & Gt; List = [[221.86797965649234, 490], [306.5453090728297, 400], [307.362157064 96666, 842]] & gt; & Gt; & Gt; [1] [4, 0, 400, 842] In the list, if your list contains more than a million items and actually becomes a performance problem, So by storing it in a database or using another approach, which lets you access it more carefully.

javascript - jqGrid: construct postData array using a function's return value -

शुभ संध्या, प्रारंभिक स्थिति अभी ग्रिड बनाते समय मैं स्थिर मानदंडों का उपयोग कर सर्वर से पैरामीटर को पास करता हूं: var $ grid = jQuery ("# ​​grid-table")। jqGrid ({url: '? c = grid.skill.GridSkill & amp; json & amp; o = get-data & amp; type = 1 ', postData: {' person_ref ': फ़ंक्शन () {वापसी $ (' # filter-person_ref ')। val ();},' country_ref ' : फ़ंक्शन () {वापसी $ ('# filter-country_ref')। val ();},}, mtype: 'POST', डेटाटाइप: "जेसन", colNames: self.columnTitles, colModel: self.columnNames, .. ।}); जटिल फ़िल्टर तंत्र (jqGrid नियंत्रण के बाहर) का उपयोग करते समय बनाए रखना बहुत मुश्किल है। वांछित दृष्टिकोण स्थिर दृष्टिकोण के बजाय, मैंने फ़ंक्शन कॉल का उपयोग करते हुए पोस्टडेटा मान सेट करने का प्रयास किया: / ** * अतिरिक्त फ़िल्टर को वामब्राह से अतिरिक्त फ़िल्टर फ़िल्टर में निकालने * / स्व .preparePostData = function () {var arrPostData = {}; // चयन बॉक्स से मूल्य प्राप्त करें ... के लि...

Get only top-level folders in IMAP -

क्या यह एक LIST या LSUB का उपयोग करके केवल शीर्ष-स्तरीय फ़ोल्डर्स को प्राप्त करना संभव है कमांड? मान लें कि मेरे पास निम्न फ़ोल्डर्स हैं (सी क्लाइंट को सूचित करता है, S सर्वर को इंगित करता है): सी: 0007 लिस्ट "" "*" एस : * सूची (\ हसनो चाइल्डलैंड) "।" "इनबॉक्स" S: * सूची (\ HasNoChildren) "।" "कचरा" एस: * सूची (\ हसनो चाइल्डलैंड) "।" "प्रेषित" एस: * सूची (\ हां चाइल्डलैंड) "।" "ए" एस: * सूची (\ हां चाइल्डलैंड) "।" "A.b" S: * सूची (\ HasNoChildren) "।" "A.b.c" S: * सूची (\ HasNoChildren) "।" "विज्ञापन" एस: 0007 ठीक सूची मैं एक विशिष्ट फ़ोल्डर के सबफ़ोल्डर को संदर्भ तर्क का उपयोग करके पुनः प्राप्त कर सकता हूं, जैसे: C: 0008 सूची "एक" "*" एस: * सूची (\ हां चाइल्डलैंड) "।" "ए" एस: * सूची (\ हां चाइल्डलैंड) "।" "A.b" S: * सूची (\ HasNoChildren) "।...

html - W3C Grayscale SVG Filters -

I'm trying to change the W3C greyscale filter found here: This ridiculous on webkit It's simple, but I'm also using it only because Gecko only supports filtering through filters: url (filter.svg) in CSS. I do not have much experience with SVG, and many times I have messed with them, they were very clear in percentage, but it is a bit more complicated with grayscale. So here's the code SVG file. & lt; Svg xmlns = "http://www.w3.org/2000/svg" & gt; & Lt; Filter ID = "Grayscale" & gt; & Lt; FeColorMatrix Type = "Matrix" value = "0.3333 0.3333 0.3333 0 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0 0 0 0 1 0" /> & Lt; / Svg & gt; In particular, I'm looking at it for grayscale up to 90%, so that only 10% of color is visible, but I do not know how this filter works. I found this document here which is considered to be understood An easy way to do this is just to use The saturation type ...

ruby on rails - Cache warming with RABL for JSON templates -

OK, this post is a bit of a word before reaching the actual question, so the compressed version basically deals with caching RABL templates Rabl.render vs. API calls, cache-keys are not the same in the generated cache. Kashmir, now wind-up .. When I have Rab Should I expect to match cash-keys when using render? To improve the reuse of the underlying objects in a Rail API API server archive on Heroku, I have done very well with RABL using Russian doll caching. However, I still go with the archive cache, when the user is generated for the first time on request, this is a burden on experience (like 1 + second API call). ... API / v1 / activities / 26600: read the cache: rabl / activity / 26600 -20140423170223588554000 // hash / d30440d18014c72014a05319af0626f7 cash generated: rabl / activity / 26600-20140423170223588554000 // hash / d30440d18014c72014a05319af0626f7 cache type: rabl / activity / 26600-20140423170223588554000 // hash / d30440d18014c72014a05319af0626f7 C...

android - How to perform multiple related calls to AsyncTasks without overlapping? -

I have an application that needs to call repeatedly for web API, effectively, this SQL table Repeats according to the record and makes a unique call to the web server with appropriate data. This is a kind of data synchronization As I understand when requesting this kind of HTTP request for an API, this UI should be within an AsyncTask to avoid hanging, so I Your AsyncTask class has made a request that parses back and parses feedback, but I need to back this data into the calling class. Above him, I do not want calling classes to run these requests in parallel. I want to make this a request, and do not want to repeat the next record in the table and the second request should not be made until the first request ends. So in a way, I want to block it, but still in a different thread, so that the UI is not static. At least, I think that's what I want. Pseudo code is something on the lines of this: // caller function synchronize public null () {Load all records from SQL tabl...

php - if photo has uploaded successfully -

Image
I would like to be able to upload a photo to my website and it has a different view controller. And if there is an error for it xyz: like: if (! Error) {[self display cigu with identifier: @ "toci and country" sender: self ]; } And {NSERR * error = [request error]; } How do I upload my photos: If Objective-C code: NSData * imageData = UIImagePNGRepresentation ([UIImage imageNamed: @ "image.jpg"]); NSMutableURLRequest * Request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString: @ "http: //**********************] cachePolicy: NSURLRequestReloadIgnoringLocalCacheData timeoutInterval: 20.0]; [Set http system: @ "post"]; [Request Set Value: @ "Image / JPG" forHTTPHeaderField: @ "Content Type"]; [Request Set Value: [NSString stringWithFormat: @ "% lu", (unsigned long) [imageData length]] forHTTPHeaderField: @ "content-length"]; [Set http: bbdi: [self imagedatons]]; NSURLConnection * th...

c++ - passing an object variable as const ..& -

मेरे पास ऐसा फ़ंक्शन है जो bigvalue_t do_bigadd (const bigvalue_t और बायां, const Bigvalue_t & amp; सही) {} और इसे यहाँ बुलाया जा रहा है bigint bigint :: operator + (const bigint & that) const {bigint परिणाम; परिणाम.बिग_मूल्य = do_bigadd (यह- & gt; बड़ा_मूल्य, that.big_value); } मुझे निम्न संकलन त्रुटि मिल रही है त्रुटि: गुजर रहा है? Const bigintâ ???? के रूप में एक ?? एक बड़ा बड़ा तर्क :: तर्क (const bigvalue_t & const bigvalue_t & amp;) का तर्क क्वालिफ़ार्स को अस्वीकार करता है [-fpermissive] मुझे पता है कि क्या गलत है, लेकिन मैं इसे से निपटने का एक तरीका नहीं सोच सकता। मैं कैसे 'इस' के रूप में const bigint और amp; जब यह एक संकेतक है? आपकी समस्या यह है कि do_bigadd नहीं है const (लेकिन यह है const में ऑपरेटर + , और इसलिए आप एक गैर-कॉन्स्ट सदस्य फ़ंक्शन को कॉल करने का प्रयास कर रहे हैं Const वस्तु यह )। आपको do_bigadd const: bigvalue_t do_bigadd (const bigvalue_t और बाएं, const bigvalue_t और दाईं ओर) const {} अगर ...

shell - Pipe a script into bash? -

क्या इसमें कोई अंतर है: $ bash ~ / script.sh और: $ cat ~ / script.sh | Bash वे थोड़ा अलग तरीके से व्यवहार करने लगते हैं, और मैं यह नहीं समझ सकता कि क्या हो रहा है। मेरा script.sh में कई लाइनें होती हैं, लेकिन ऐसा लगता है कि जब मैं पाश को बाश में पाइप करता हूँ (लेकिन जब मैं स्क्रिप्ट को सीधे चलाता हूँ तो पूरा करता है)। क्या है इन दोनों तरीकों से स्क्रिप्ट चलाने में क्या अंतर है? इसके अलावा, जब मैं & lt; का उपयोग करता हूं, तो व्यवहार पहले उदाहरण के समान है (पूरा होने पर चलता है): bash & lt; (~ / script.sh) स्क्रिप्ट सेट -यूके एसएसएच की तर्ज पर है CLUSTER_0_SERVER_0 "do_something" || एसएच CLUSTER_0_SERVER_1 "do_something" ssh CLUSTER_1_SERVER_0 "do_something" || Ssh CLUSTER_1_SERVER_1 "do_something" एक ही स्क्रिप्ट चलाने के आपके तरीके सभी में अलग हैं शब्दों । उदाहरण के लिए इस सरल स्क्रिप्ट देखें: #! / Bin / bash इको $$ ssh 127.0.0.1 प्रतिध्वनि $$ इसे सीधे चलने से सभी लाइनें निष्पादित होंगी और दोनो...

google chrome extension - [Javascript]Passing local vars as parameters to EnventListener Click -

I have to give a local variable value in the function. My code can only alert local versions when it is not used as a parameter for any other function. When I try to pass the value. Here is my code, this file is from 'test.js': function testing () {var divs = document.getElementsByClassName ('post'); {If (divs [i] .id! = Null) for {var i = 0; i & lt; divs.length; i ++} {var element = document.createElement ("div"); Var currentId = divs [i] .id; Element.className = 'myclass'; // warning (currentId); & Lt; - True value element.addEventListener ("click", function () {warning (currentId); // This code is from the manifest: "content_scripts": [{... "js": ["Test.js"]} If I use divs [i], Chrome console reports directly instead of currentId var: Unkit Type error: property can not be read 'id' of 'unknown' (anonymous function) "one Close the loop "problem (se...

c# - Webservice Returns Data All On One Line -

Then I have a basic web service that is grabbing data from an MSSQL database, it works because it's a SQL connection and It is considered in the case of questions, but I would like to know whether it is possible to show the figures a little more beautiful. My goal is to return a name to each line, but the web service only leaves all in between the string tags and all on one line. I am very new to C # and ASP.Net and am surprised that I have made it so far. If possible, I have to format the data in a more pleasant way. This is my code Namespace Customer Service {/// & lt; Summary & gt; Summary descriptions for /// service details & lt; / Summary & gt; [WebServices (namespace = "http://tempuri.org/")] [webssebibing (conferfooto = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem (false)] // Allow this web service to call scripts For, using the ASP.NET AJAX, delete the following line // [System.Web.Script.Services.ScriptService] Public...

algorithm - Reconstructing a tree using inorder and preorder traversals in Python -

I need to create a function that creates a tree from the preorder and the indoor traversel, but I'm not sure where Put the MacNode and recursive calls to make the panel properly. There is a list of entrees considering the iners and the preederers, both of which are the following algorithms for rebuilding trees using trailers? def build (preorder, inorder): root = preorder [0] subtree = inorder [: root-1] true subtree = inorder [root + 1:] If so - how can he take it and use that algorithm in a recursive form to create arahep? I have a class designed to build nodes and then I can use just H.P.AD (node) to make a pile. Ask me to create a node for the node, named "MacDoode" and its construction is as follows (for syntax purposes): class makeonode (): def __init __ (self, character, left = none, right = none): The root node I have to edit the function like this: Def build (preorder, inorder, heap): root = preorder [0] node = mcod (root) # build root node...

uploading image to mysql db by php -

I found my insert.php file: Lt;? php // is the code for the above connection / echo "successfully connection"; $ Image = addlashes (file_get_contents ($ _ FILE ['image'] ['tmp_name'])); $ Image_name = addslashes ($ _ files ['image'] ['name']); Include $ sql = "` myTable` (`id`,` image`, `image_name`] values ​​('1', '{$ image}', '{$ image_name}')"; If (mysql_query ($ sql)) {Echo "Something went wrong !:(";}? My form.php file: & lt; form action = "insert.php" method = "POST" enctype = "multipart / form-data"> file: & lt; / label & gt; & lt; input type = "file" name = "image" /> input type = "submit" /> I got an error when I want to upload an image: / P> "Warning: file_get_contents () [function.file-get-content]: file name /myDomain.com/insert. Can not be empty in php " Update: ...

Java - exclude array positions from a already declared array -

In this way, the code below creates an integer array with 100 positions, makes some math and each in the array posts Returns the result value, and the finally shows all the values ​​inside the array in Jelabal. The problem is: The last line will show all array values ​​from 0 to 100, so even if no array condition is used, it will be shown with "zero" value on the screen, and I do not want it in the same way, I just want to show those posts which actually get a price. I am thinking of excluding those posts which should not be shown to me so that they do not go to JLABB. It's running like this now: If I say that xconv ​​is "13", with the code below, the number that I will get and will be shown on jlabble "[1, 0, 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ... ... (up to the hundredth place) ". I should show it like this: If I say xconv ​​is "13", the number will be "[1,0,1,1]" Thanks! !! ! int [] resto = new int [100]; For ...

java - Different of Thread start() -

In research of previous project coding: I found out that the thread was used in 2 different ways Can be first timerTratt tt = new timerite (); Tt.start (); Second timerTratt tt = new timerite (); New thread (TT) Start (); Is there a difference between these 2 codes? Jeffrey, Yes, The first option created a new timerath object and allocated it to TT handle. After that, starting with that handle (to start) method. The second option created a new timeradad object and handed it in TT handle. Then in the second row, another new thread object was created and handed it over to Tited Headle, and then reached the start () method through that "New Thread Object", thus making the orbitation made in the first line orphaned . The only real difference is that there is some unnecessary work in option two; in the first line I am not 100% on this explanation, so I welcome someone with a deep understanding. - Flech

java - Gradle build with Ajc fails due to Temporary file creation -

ग्रेडल के साथ मेरा एक दिलचस्प मुद्दा है Intellij 13 (windows या linux) के अंदर से "gradle build" चलते समय, मुझे निम्न त्रुटि संदेश मिलता है: 10:05:48 PM: बाह्य कार्य 'बिल्ड' निष्पादित ...: प्रक्रिया रिज़ॉर्प्स UP-TO-DATE: compileAffected विफलता की संभावना: बिल्ड अपवाद के साथ विफल हुआ * क्या गलत था: कार्य निष्पादन के लिए विफल: 'संकलन करें' & Gt; अस्थायी फ़ाइल बनाने में त्रुटि * प्रयास करें: स्टैक ट्रेस प्राप्त करने के लिए --stacktrace विकल्प के साथ चलाएं। अधिक लॉग आउटपुट प्राप्त करने के लिए --info या --debug विकल्प के साथ चलाएं। बिल्ड फेलियल कुल समय: 7.434 सेकंड पहुंच से वंचित है 10:05:56 अपराह्न: बाहरी कार्य निष्पादन समाप्त 'बिल्ड' यहां से, मैं यहां स्थित एक पूर्ण डीबग चलाया: यह दिखाता है कि यह नीचे की पंक्ति में AjcTask.java फ़ाइल में विफल रहा है: TmpFile = फ़ाइल। ("आर्गफाइल", "", यूज़रडीआईआर); शायद इसके लिए और पुराने संस्करण से संबंधित हो, लेकिन अनसुलझे लिनक्स पर, अगर मैं सीडी को परियोजना निर्देशिका में भेजत...

php - MySQL Syntax Error WITH emails -

I am trying to get a posted form variable and mySQL is throwing an error while trying to insert them . Why can not I figure for my life Hope someone can help you submit the function () {Global $ DBC; Enter the value ("$ _SERVER '[' REQUEST_METHOD '] ==' Post ') {$ query =" found1 (fname, lname, email, phone, name, color, model, size, information, location) Mysql_real_escape_string ($ _ POST ['fname']), ". Mysql_real_escape_string ($ _ POST ['lname']).", "Mysql_real_escape_string ($ _ POST ['email']).", ". Mysql_real_escape_string $ _ POST ['mysql_real_escape_string ($ _ POST [' name ']). ",". Mysql_real_escape_string ($ _ POST [' color ']). ",". Mysql_real_escape_string ($ _ POST [' make ']). " "Mysql_real_escape_string ($ _ post ['model'])." "Mysql_real_escape_string ($ _ post ['size']). Mysql_real_escape_string ($ _ ...

php - How to get private variable from I18n yii? -

I have problems with multi languages ​​from yii. I want the administrator to have any language in my system Therefore, I want all the country and region code languages ​​to be i18n yii Need to get from This means that I will display a dropdown list. There are languages ​​of all names in it when I select any language, it will generate automatic area code. Ex: I have selected English, it will generate automatic area code en . I tried $ languages ​​= Yii :: app () - & gt; Locale-> _data; to get an array but because the variable $ _ data is private . This is a code from classicalclass: class increases the CLocale CComponent {public static $ data path; Private $ _id; Private $ _data; And here is the code view that I said: $ languages ​​= Yii :: app () - & gt; Locale-> _data; Var_dump ($ languages ​​['language']); If I have private $ _ data; Change the public $ _Data from ; This will remove the result but it is originally from yii...

javascript - Using Document Ready on Click Event -

I'm still new to javascript. I have an app that has two buttons on the page. There is a cpu_vs_player button that shows a game and the other is a player who displays a different game. The problem is that all the code is located in an application.js file. There is no need to load player_vs_player on $ (document) .ready (function () {}); If I had to play cpu_vs_player How can I do but if I had chosen that game then bring them to load? (I'm just using a route with hidden / visible information on the basis of clicks). Documents. There is nothing after the page page and the event needs to be documented with listeners. Clearly this is the only way to skin this cat. You can either do the jQuery method where you split JavaScript and HTML: & lt; Button id = "button1" & gt; Cpu_vs_player & lt; / Button & gt; & Lt; Button id = "button2" & gt; Player_vs_player & lt; / Button & gt; For javascript: Assume that the func...

Haskell, passing a function to filter in one line? -

I want to filter everything that is not divided by 3 from a list in Hassel, it is technically I What to do Filters (`mod` 3) [1..100] The problem is that, mod x 3 returns a boolean value Will not it be a way of doing it in a row? Or do I need to type another function that gives boolean values? I have read about the CURD Functions, but I am not sure if this is possible because if I used (==) AB and a function, it would not work just. You can use dot notation filter ( == 0). (`Mod`3)) [1..100] generates it [3,6 9, 12 , 15, 18, 21, 24, 27, 30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87 , 90,93,96,99] Dot type signatures are as follows: (.) :: (b -> c) - & gt; (A -> B) - & gt; A - & gt; C

javascript - How to filter a table and display only values than values? -

I'm working on a simple HTML application that has table grid data view sample data as follows . no name section 1 ABC IT 2 DEF CSE I have a search box that will get a search key and display a filtered table view. . A lot of jazzary tables allow me to implement search logic as follows: Say I'll search the search key 'ABC' as the following table: P> Instead of displaying filtered lines, 'ABC' and the entire row as 'IT' or '1' Not be shown. I only want to match the cells that match the search key that match the keyword as follows: Say I give the search key as 'ABC' This filtered table should show as follows: Name ABC You can find Jsfiddle equal to demo: (firefox) html & lt; Input id = "keyword" & gt; & Lt; div id = "maindiv" & gt; & Lt; Table id = "mytble" & gt; & Lt; TR & gt; & Lt; Th & gt; No & lt; / Th & gt; ...

java - Comparing a text from a EditText with an array of string characters -

I am trying to compare text taken from the EditText box - Edittext.getText () with an array of pre string characters. ToString () string [] alphabets = {"a", "b", ........ "z"} I want to compare each letter with the string of text with the edit characters so that I can change the position of one character with another (text taken from the edit text) I can do? Or is there any other better way to do this? Just want to know how to compare each step of the string. edittext.getText (). ToString () with an array of string [] alphabets = {"A", "b", ........ "z"} . What is a better way to parse string for a int such that I get the text from an edit text box And I want to consider it an integer, how can I do this? I am asking this question because I have to implement the encryption algorithm modular arithmetic / mathematics thanks - string editing value = edittext.getText (). ToString (); Intege...

javascript - SVG - How to fill a polygon whose sides are formed from bezier curves? -

Image
I want to create something like the following using pure SVG but without using a D 3 wires similar functionality. I'm enabled standard path Using the elements, using the beijier curves in SVG creates a polygon. But the way to fill that polygon with custom color is not known how to define the boundary of this polygon and set the fill property? Any ideas where the group can help? If you want to fill in this field, you only have one path element You can use Bezier curves together so that one starts where the end is ending. Then, add Z at the end of the path data to close the path. & lt; Svg xmlns = "http://www.w3.org/2000 / SVG" width = "500" height = "300" & gt; & Lt; Path D = "M 480 150 C 300 200, 200 150, 20 200C15 150, 15 150, 20 100C 200 100, 300 150, 480 150Z" Stroke = "Black" Fill = "Red" & gt; & Lt; / Path & gt; & Lt; / Svg & gt; If you know where all your p...

mysql - How Do I Delete All Posts Over 400 Days Old -

I have tried the following phpMyAdmin query in the attempt to delete all posts from database category 378 of more than 400 old days. /p> Delete one, b, c, d from wp_posts Add a left wp_term_relationships b (a.ID = b.object_id) on wp_postmeta c (a.ID = c.post_id) join left Wp_term_taxonomy d ON (d.term_taxonomy_id = b.term_taxonomy_id) LEFT JOIN wp_terms and ON (e.term_id = d.term_id) WHERE e.term_id = 378 and DATEDIFF (now (), a.post_date) & gt; 400 Instead, the query has removed the entire category and all its posts. How do I create that phpMyAdmin query, which will delete any posts that are 400 days old from that specific category? I have a database backup. try like this: where date & lt ; UNIX_TIMESTAMP (DATE_SUB (NOW (), INTERVAL 400 days))

bash - Shell script - Giving error while iterating through array -

I'm trying to check if condition on a name value in the defined array. I'm experiencing this error: main.sh: line 9: [10.247.78.207: command not found main.sh: line 9: [10.247.78.207: command not found This is my code: #! / Bin / bash declared - a name = $ {name :-( 10.247.78.207 10.247.78.206}} for ((I = 0; i change ["$ {names [0]}" == "10.247.78.207"] to ["$ {name [0]}" = = "10.247.78.207"] . This is the place after [ and before ] . Hope this solves your problem.

javascript - Disable mouse wheel scrolling on ListBox -

मेरे पास एक listbox @ Html.ListBox ("lstFacilitySelection", Model.FacilityOptionList, नया {आईडी = "सुविधालिस्टबॉक्स", एकाधिक = "एकाधिक", आकार = 5, शैली = "चौड़ाई: 50%;"})) मैं इस सूची बॉक्स के लिए माउस के व्हील स्क्रॉलिंग को कैसे अक्षम कर सकता हूं, ताकि नियंत्रण के किनारे पर स्क्रॉल बार इस्तेमाल किया जा सकता है? संपादित करें: समाधान ऐशविनी वर्मा द्वारा कुछ बदलाव के साथ प्रस्तावित: $ (दस्तावेज़) .ready (function () {$ ('# सुविधालिस्टबॉक्स')। ({'Mousewheel': function (e) { यदि (e.target.id == 'el') रिटर्न; e.preventDefault (); e.stopPropagation ();}})}); आप इसे jquery का उपयोग कर अक्षम कर सकते हैं । & lt; div class = "scrollable" & gt; & Lt; / div & gt; $ (दस्तावेज़) .ready (फ़ंक्शन () {$ ('body')। पर ({'माउसवील': फ़ंक्शन (ई) {if (e.target.id == 'el') रिटर्न; e.preventDefault () ; e.stopPropagation ();}})});

java - Memory leak in netty API -

I am new to Neti API and I am using netty3.5.2 to develop client and server communication server Yes, but the apple always runs full GC, I use jmap to dump memory and to show which object has captured memory, use jhat. and there are 6413363 examples of DefaultChannelFuture . Someone can tell which threads DefaultChannelFuture examples and how and when will they be released? The suspected top 4 examples are examples of 6413363 class org.jboss. netty.channel.DefaultChannelFuture 631 9 71 Example class org.jboss.netty.util.internal .LinkedTransferQueue $ node 630934 Examples of examples of class org.jboss netty.buffer.bigEndianHeapChannelBuffer 630767 example class org.jboss.netty.channel.DownStreamMessageEvent This overload message queue to make messages fast. Check the nethwork load.

Facebook see who took my quiz -

Our customer wants to ask a simple question that everyone can take, and if the user wants, then share the result Facebook can do it There is a lot more like this: There is only one thing; The client randomly gave one price to one of those users who shared their results on Facebook, more people are actually encouraged to share their results (and thus on Facebook about it). More 'discussion' produces) Is it possible to do this? And if so how? After your user posted a story, a post_id comes back from Facebook And it is of the form - userid_postid Therefore, you _ and this The user will have an ID that shares the story. Hope that helps! :)

php - Converting to PDO -

Many thanks for reading my post I am quite new in PHP. I am working on the project which uses Mysore and I am trying to change it to use PDO. I have a database class in my current set up but I have read and closed that when using PDOs, it is not useless for at least one database class or using PDO. Wanted. I know its a common question, but I want to make sure that as I changed my site, I am moving forward in the right way. Thank you very much OK, this is the most basic example of my first block block. Please do not try to work very hard ... See this try {$ handler = new PDO ('mysql: host = localhost; dbname = app', 'root', 'fidelio'); $ Handler- & gt; Set Attribute (PDO: ATTRRAMOD, PDO :: ERRMODE_EXCEPTION); } Hold (PDOException $ e) {echo $ e-> getMessage (); Die (); } $ Name = "pdotest"; $ Message = "test message"; $ Sql ​​= "Include guestbook (name, message, posted) VALUES (?,?, NOW ())"; $ Query = $ Handler- ...

c# - i want to show images on view page from controller action -

सार्वजनिक कार्यवाही परिणाम GetContentFromFTP () {string [] FTP_Imagery = Directory.GetFiles (@ "एफ: \ abc \ imgfiles \ इमेजरी \ "); स्ट्रिंग [] FTP_Audio = Directory.GetFiles (@ "एफ: \ abc \ audiofiles \ audio \"); वापसी देखें ("शोफाइल"); } यह मेरी नियंत्रक कार्रवाई है जिसमें दो स्ट्रिंग सरणी में सभी ऑडियो फ़ाइल और छवि फ़ाइल का पथ होता है। अब, मुझे ये चित्र मेरे दृश्य पेज "शोफाइल" पर दिखाना है। कृपया मुझे सुझाव दें कि मुझे इसे कैसे कार्यान्वित करना होगा? एक अधिभार है, जो एक मॉडल को देखने के लिए, इस स्थिति में आपकी स्ट्रिंग सरणी अपना कोड निम्न में बदलें: सार्वजनिक कार्यवाही परिणाम GetContentFromFTP () {string [] FTP_Imagery = Directory.GetFiles (@ "एफ: \ abc \ imgfiles \ imagery \"); स्ट्रिंग [] FTP_Audio = Directory.GetFiles (@ "एफ: \ abc \ audiofiles \ audio \"); वापसी देखें ("शोफाइल", FTP_Imagery); } अपने दृश्य में छवियों को लाने के लिए मॉडल ऑब्जेक्ट का उपयोग करें और उन्हें मानक HTML का उपयोग...

r - Choosing entries that are approximately x-apart -

I have a vector whose entries show the location on the sequence, the distance between entries on the sequence is 1 to 10 ^ 7 Is between For a given X I have to get a pair of entries about one distance. Example: v = [1 2 3 1000 1002 2000] After that for X = 1, we [1,2], [1, 3], [2,3], [1000,1002] and X = 1000, we can get [1,1000], [2, 1000], [1002,2000] etc. Any ideas of doing this? Thank you. Perhaps such a function will work: dist = (witch, Margin) {d = extension. Grid (VCC, VCE [2: Length (VCC)] D $ diff = abs (abdomen (D $ Var1 - d $ Var2) - Margin) D [Order: Running D: v = c (1, 2, 3, 1000, 1002, 2000) dist (v, 1000) output will be: Var1 Var2 diff 5 1002 2 0 18 2000 1000 0 20 2 1002 0 28 1000 2000 0 11 1002 3 1. .. A data frame with all pairs sorted in the order of difference. / P>

vb.net - Timeout from .NET but not from sql-server console -

I have a query which takes 10 seconds from the sql-server console, but I get timeout from a program written in VB is ). What could be the reason that I get a timeout from my program but works well with the sqlserver console? My shared code: GetDataSet (ByVal vCommandType as CommandType, ByVal strSQL string, Byval sqlParams New SqlCommaction (Bbdd.connectionString) as DIC new SqlCommand () in the form of DC.CommandTimeout = 600 --- With it, my query works fine DC.CommandText = strSQL DC.CommandType = vCommandType DC.Connection = oConn (SqlParams) if not DC then Parameters. Adrenaline (SKLPRAM) End if the new SQL DTDA (Dc) DIS DA as DMA try new Dataset DA as DA DFFill (DS) returns as DS Exchange Hold oakon at the end. Close () DA Last Function This is quite common and can be for many reasons. SQL Server probably uses a separate scheme cache for SSMS and your application. And if execution plans are different, the execution time may vary widely. SQL Server optimizes specific ...

javascript - Concatenation function name in js -

Is there a way to include the JS function name? Now I have this: switch (play id) {case "11": play 11 (); break; Case "22": Play 22 (); break; Case "33": play33 (); break; Case "44": Play 44 (); break; Default: Break; } And I want to do something like this: var function = "play" + playId + "()"; And call it .. What is the best way if possible? Solution: What did I do with the help of thefourtheye and xdazz : var playFunction = window ["play" + playId]; PlayFunction (); If these functions are defined in global scope, you can obtain them globally Object can: var foo = window ["play" + taskId]; Otherwise you can put them together in one object as if another answer has been suggested.

c# - QueryInterface on Filter in DirectShow.NET -

I am using filters and want to set filter settings. In C ++ it works through the ISettingsInterface. ISettingsInterface * pSettingsInterface = NULL; PRotateFilter-> QueryInterface (IID_ISettingsInterface, (Zero **) and pSettingsInterface); Hr = pSettingsInterface-> SetParameter ("rotationmode", "3"); Hr = g_pGraph-> AddFilter (pRotateFilter, L "RotateFilter"); DirectShowlib c # wrappers do not have such an interface? There's also work on any QueryInterface filter. itemprop = "text"> I declare the solution interface by: [ComImport, System.Security.SuppressUnmanagedCodeSecurity, Guid ("388EEF20-40CC-4752-A0FF-66AA5C4AF8FA"), InterfaceType (ComInterfaceType.InterfaceIsIUnknown)] Public Interface ISettingsInterface {[PreserveSig] (int MarshalAs (UnmanagedType.LPStr)] string type, [MarshalAs (UnmanagedType.I4)] Integer buffersize, [in, out, MarshalAs (UnmanagedType.LPStr)] String value, [In, Out, MarshalAs...

jquery - Javascript function won't pass parameter -

मेरे पास निम्न कोड है: फ़ंक्शन बनाते हैं मार्कर (latlng, name, address) { Var HTML = "& lt; b & gt;" + नाम + "& lt; / b & gt; & lt; br / & gt;" + पता + "& lt; br / & gt; & lt; एक onclick = 'अधिक जानकारी (नाम)' & gt; अधिक जानें & lt; / a & gt;"; var मार्कर = नया google.maps.Marker ({map: position, latlng}); google.maps.event.addListener (मार्कर, 'क्लिक', फ़ंक्शन () {infoWindow.setContent (html); infoWindow.open (मानचित्र, मार्कर);}); markers.push (मार्कर); } अधिक जानकारी (नाम) {$ ('# dcFinder')। Hide (); $ ( '# Moreinfo') शो ()।; । $ ( '# नाम') एचटीएमएल (नाम); } जो Google मानचित्र स्टोर लोकेटर पर काम करता है I मैं पहले समारोह में उपयोग किए जाने वाले नाम से गुजर रहा हूँ और अधिक जानकारी समारोह का एक लिंक बनाने का प्रयास कर रहा हूं। जब लिंक पर क्लिक किया जाता है, उचित दिग्दर्शन दिखाए जाते हैं और छिपा हुआ है, लेकिन नाम नहीं दिखा रहा है । आपको अपने एचटीएमएल म...

ios - Backward with custom string -

I used string arrays for emoticons like this: NSArray * emoticons = Then display such a string in a UITextview: P> > Previous or Delete button, if the last word is in emoticons, then I The entire emoticon string should be removed, not the last one character Any thoughts? Try it out, NSString * string = self.textView. Text; __block NSString * deleteWord = Zero; __bloc NSRange Range Overworld; [String EnumettsstringsResources: NSMKernage (0, Self TextView.SlectedRange.Lichn + Self Textviewview.CallectedRangleLayment) Option: NSSSringNewationByWords | Using NSStringEnumerationBlock: ^ (NSString * substring, NSRange subrange, NSR enclosed range, BOOL * stop) {deleteWord = substring; Range forward = enclosed range; * Stop = yes; }]; If ([Objects included in emoticons: deleteWord]) {string = [string stringBeerPlaceholdingCountry: CategoryForm string with: @ ""]; Self.textView.text = string; Self.textView.selectedRange = NSMakeRange (rangeOfWord....

How to hint an asynchronous operation with a JavaScript promise? -

For learning purposes, I want to show how to help resolve the dependency at the time of database operation in Javascript can do. So, I want to show this: db.find (14); Actually consumes the time behind the curtain. How can I explain the dependence and a possible solution at this time which promises? Do I still have this: // Take the data store operation time function _findByUsername (username) {var user = _.findWhere (user, {username} : Username}); If (! User) {Promise.reject (new error ("user not found.")); } Return Plaintiff. User (user); } One option may be to use the function of the bluebird and a comment Can be added as follows: findByUsername (username) {/ * simulates the behavior of a database operation / / Promise.delay return (10). Then the setter (_. FindWhere (user, {username: user name})}

c++ - Android NDK: build after added a new library module directly under jni/ folder -

मेरे एंड्रॉइड एनडीके प्रोजेक्ट में, मुझे केवल एक पुस्तकालय मॉड्यूल है: jni / android.mk ... (अधिक स्रोत फ़ाइलें) तब, मुझे एक और पुस्तकालय मॉड्यूल जोड़ने की आवश्यकता है, जिसका मौजूदा पुस्तकालय मॉड्यूल से कोई संबंध नहीं है । मेरा मतलब है कि वे स्वतंत्र हैं मैंने सीधे jni / फ़ोल्डर के अंतर्गत नई पुस्तकालय जोड़ा है। jni / android.mk ... (अधिक स्रोत फ़ाइलें) new-lib / Android.mk .. (अधिक स्रोत फ़ाइलें) प्रश्न 1: मैंने अपने एंड्रॉइड प्रोजेक्ट के निर्माण के लिए ndk-build कमांड चलाया है। लेकिन नया -बिब बिल्कुल भी नहीं बनाया गया है। ऐसा इसलिए है क्योंकि मुझे jni / फ़ोल्डर में Android.mk में new-lib मॉड्यूल को घोषित करने की आवश्यकता है? यदि हां, तो कैसे घोषित करें? प्रश्न 2: जब मैं नया-lib लोड करता हूं (लगता है कि मॉड्यूल का नाम "newlib" है), तो मुझे System.loadLibrary ("new-lib / newlib"); या सिर्फ System.loadLibrary ("newlib"); ? सबसे पहले, आप android-ndk कमांड चलाते नहीं हैं, आप ndk-build कमांड चलाते हैं। ...

python - rewriting unfilled field of the model in Django -

People did not fill the B fields in some objects (A, B, C) data base. Now I want the objects to be filtered from object to B, such as: obs in all_ob: if obj.b = "something": obj.delete () but I am getting this error: users.models.DoesNotExist: does not exist for the query line that matches the profile: if c.main_name.user == user [0]: the same error I'm getting on writing is c.main_name.user: so i How do I solve it? I can not rewrite this field because I can not address it and I can not filter this field by deleting some fields, I do not need it Too much to help Thank you .. :) There is a concept in C: class concept (models.Model): partial_url = models.CharField (max_length = 200, unique = true) Insert_links = models.BooleanField (default = true) is_category = models.BooleanField (default = False) date_modified = models.DateTimeField (auto_now = True) main_name = Model. ForeignKey ('Little', related_name = 'concepts', empty = true, zero = true...

javascript - Removing YOURLS branding from stat page -

First of all, this is my URL: So, basically, everything is going well I have a completely custom homepage, anti spam and all this. Then a result page, with all the special types of accessories. But, I want to customize the statistics page. I did this job how to optimize the admin page. This is included in / function-html.php . But if you customize the menu there, then they do not take on the statistics page. Any ideas where I can customize the statistics page? I understand by the question, you need it - Create in a separate PHP file and include it wherever you need the menu. Let's say menu.php in both include / function-html.php and stats.php (Perception), wherever you need a menu, do something like this. & lt ;? Php ... // contains the 'path / in / your / menu.php' in the include menu; ... By doing this, you can customize the menu.php and it will display everywhere you add to it. Note - I know in the comments that if it is not what...

aptana3 - Aptana crashes out of memory -

Aptana crashes with java.lang.OutOfMemoryError: PermGen space ईवेंट लॉप अपवाद लॉगिंग करते समय त्रुटि: जावा हॉटस्पॉट (टीएम) सर्वर वीएम चेतावनी: अपवाद java.lang.OutOfMemoryError हेडलर के लिए संकेत SIGINT प्रेषण उत्पन्न हुआ- वीएम को जबरन टर्मिनेट होने की आवश्यकता हो सकती : न्यूसिज़्म = 256 एम -XX: मैक्सन्यूसिस = 356 एम -XX: पेर्मसीज़ = 256 एम

javascript - HTML - cookies between pages. -

I have a quiz in many HTML pages (I know that it can only be one, but this question (Q1: q1a, q1b, q1c, q1d; q2: q2a, q2b, q2c, q2d, etc.) with 4 radio buttons in each one, and I want to set a cookie with the name of the question (q1) in each page and the checked answer (for example q1a,) I have created this function to set a cookie: function set_cookie (name, value) {var cookie_string = name = "=" + escape (value); Document.cookie = cookie_string; } And I have put it in every page of the quiz. It works well in every page, but when I use a function to use cookies in the last page, it gives this blank space. I have the function: function get_cookie (cookie_name) {var results = document.cookie.match ('(| | | |)?' + Cookie_name + '= ([^;] * ) (| | $) '); If (results) return (unescape (result [2])); And tap return; } But when I call this function with the final level of the quiz function, it is empty: function grade () {Var grade = 0; Var x = ge...

Difference of using static between java and PHP? -

in java i read, static function can only be accessed Static Function or Fixed Variables . I was trying to figure out the difference between using PHP in Java and static. Is this also in PHP ? Can we call non-static work inside static work , PHP Can we call nonstandard work in PHP within phased work? Yes, but no advice was given. As $ this keyword will not be available under static context, however, you can use the static / manually but The result is strict standard notice strict standards: non-static method A :: foo () should not be called statically Not so good!

html - iOS Cordova app doesn't load correctly on device -

Image
There is a problem starting my Cordova app on an iPad. The build works fine (after adding some missing frameworks and removing Arm 64 in the build settings) When the app starts, everything works fine, the splash screen is shown and I get console output in the xcode: [565: 60b] Multi tasking - & gt; Device: Yes, App: Yes [565: 60b] Unlimited access to network resources [565: 60b] Reset plugins due to page load. Then nothing happens for some time only a gray background is shown After some time (approximately 20-30 seconds) the index is loading due to the console log: Full load of [584: 60b]: File: / var / mobile / applications / 64C4D056-619D-46F9-96E4-EAC7E11DBA15 / Email% 20Acquisition.app / www / Index.html The screen turns into a different gray value Index.html background) but it is. I think it has something to do with the build settings in Xcode because it runs on one device, but not the second. When stored and installed (not starting with such a xcode) it do...

Ruby string concat with webrick -

I have this code that I want to modify (new in Ruby) HRand = rand (10) .to_s if (request.path == '/ test') response.status = 200 response ['content-type'] = 'text / html' response.body = File.read ('C: \ # # {HRand} .html ') When I use Localhost: 8080 / test me "No such file or directory C: \ # {hRand} .html " Why is not being changed? This is because string projection only works with double quoted strings: pre> file. ("C: \ # # hRand} .html")

performance - Loading slow: LESS - Bootstrap variables cause waiting time -

I have the following setup: Joomla! 3.2.2, Less than Bootstrap 3.1 I tested the loading time of my page and got bad results, mainly because of low decrease. Composite loading time was 7.96 s Bootstrap / Waiting for short variables 5.3 S !!! This loads all bootstrap variables: template. Free ~ .com / templates / c ~ / less / 9.1 kB bootstrap.less 1.3 KB variables Without 19.6 KB mixins.less 24.2 KB normalized. Without 7.4 kB print.less 1.9 kB loft Without 2.1 kB type Without 5.3 kB code.less 1.3 kB grid.less 2. KB table. Without 4.5 kB forms.less 9.2 kB Button 3.7 KB component-animation Without 786 b glyphikon 14.8 KB without dropdown. 4. KB button-group. 5 kB Input-group. Without 3.5 kB navs.less 5.1 kB navbar Without 13.8 kB breadcrumbs. Panning without page 817b Less 2.1 kb pager Without a 1.1 KB label. Without a 1.3 kB Badge 1.3 kB jumbotron.less 1.2 KB Thumbnail. 1. KB alerts 1.7 kB progress-bars. Without 1.8 kB media.less 1.1 KB list-group. Less 2.1 Kb Panels 3. Without...

ruby on rails - RSpec failure: undefined method `name' for nil:NilClass -

I am walking through a book (Action V14 map in railway 4) and an error in running my imagination Failures: 1) Creating projects can create a project failure / error: click_button 'Create Project' ActionView :: Template :: Error: The undefined method for 'zero' Name ': NilClass # ./app/ Ideas / Project / show.html.erb: 1: In `_app_views_projects_show_html_erb__1338549725163946383_70209940313300' # ./spec/features/creating_projects_spec.rb11:in 'Block ( 2 level) & lt; Top (required) & gt; '1 example ended in 0.23155 seconds, failure 1 failed Example: rspec ./spec/features/creating_projects_spec.rb:4 # Creating projects can create a project I am online and through Finding the book and instructions have been followed. I can not find my fault book (where I am currently on page 91) says that I should get the following error instead: Failure / Error: Hope (page) Has'content ('Project Is Created') is expected to text "Project h...

c++ - Accelerator resource table giving errors -

निम्न संसाधन परिभाषा में क्या गलत है? ACCELERATOR_RESOURCE_ID ACCELERATORS LANGU_ENGLISH, SUBLANG_ENGLISH_US {VK_C , IDA_COPY, NOINVERT, CONTROL, VIRTKEY VK_V, IDA_PASTE, NOINVERT, CONTROL, VIRTKEY VK_A, IDA_SELECTALL, NOINVERT, CONTROL, VIRTKEY} यह मुझे लाइन VK_C पर वाक्यविन्यास त्रुटि देता है , IDA_COPY, नॉनवर्ट, कंट्रोल, वर्टकी हर बार मैं संकलन करता हूं। और मैं इस समस्या को हल नहीं कर सकता। सादे अक्षरों या संख्याओं के लिए वर्चुअल कुंजी पहचानकर्ता परिभाषित नहीं हैं विंडोज हेडर - WinUser.h से: / * * VK_0 - VK_9 एएससीआईआई '0' के समान ही हैं - '9' (0x30 - 0x39) * 0x40: असाइन किया गया * वीके_ए - वीके_ज एएससीआईआई 'ए' - 'जेड' (0x41 - 0x5A) * / इसलिए मान VK_C , VK_V के समान है आदि। समस्या है। कैरेक्टर स्थिरांकों जैसे 'C' या 'V' स्पष्ट रूप से संसाधन कंपाइलर द्वारा समर्थित नहीं हैं और इस प्रथा को लगता है इसके बजाय संख्यात्मक ASCII मान का उपयोग करें: 0x43, IDA_COPY, NOINVERT, CONTROL, VIRTKEY 0x56, IDA_PASTE, NO...

Communication between android phones -

Is it possible to communicate between a specific area of ​​the phone without internet or Bluetooth, whether through 20 meters of app Is the distance? Even if both people do not know each other's numbers? If the user only knows the phone number - try the SMS service: for example. Send intent and SMS via SMS

android - What will happen if leave "developer payload" as blank Google Play In-app Billing -

Image
Well I've read a lot about "developer payload" but I do not understand clearly, " For what has been used for the developer payload ". That's why I'm trying to use it as blank: onUpgradeAppButtonClicked on Public Zero (string SKU) {log d. (Tag, "upgrade button clicked; launch purchase flow for upgrade"); / * * TODO: For security, generate your payload here for verification View comments on Confirm Developer () for more information. Since this is * a sample, we only use an empty string, but on a production app you should carefully create it. * / String payload = ""; MHelper.launchPurchaseFlow (this, SKU, RC_REQUEST, mPurchaseFinishedListener, payload); } and this: verify boolean developer payment (purchase p) {string payload = p .getDeveloperPayload (); Back true; } So I have made a picture. For 3 situations, I want to know what will happen after the situation Yes, the scenario is most likely to occur at Scenario...

scala - SparkPi running slow with more than 1 slice -

Tried to run sparky examples on a new spark and a standalone 12 core three machine cluster. I have failed to understand that running this example with a slice gives better performance than using 12 slices. One such case was when I was using parallel function. Along with adding each slice, the time is almost nearly linear. Please tell me if I am doing something wrong code snippet is given below: val spark = new spark contact ("spark: // telecom: 7077", "sparky", system .getenv ("SPARK_HOME"), list ("target /scala-2.10/sparkpii_2.10-1.0.jar")) Val Slice = 1 Well N = 10000000 * Slice Val count = Spark. Parallel (1 to n, slice) .Map {i = & gt; Val x = random * 2 - 1 val y = random * 2 - 1 if (x * x + y * y & lt; 1) 1 and 0} .readuce (_ + _) println ("Pi roughly +" 4.0 * count / n) spark.stop () UPDATE: The problem was random, because it was a synchronized method, it could not scale to many cores. The random function us...

.htaccess - Forbidden when accessing the wordpress admin panel -

After entering a username and password, I get this message when entering from the WordPress Admin Panel: Forbidden I have tried everything to get it out, replace the .htaccess file and add this piece of code This one can not even solve my problem Also tried this one & lt; Ifmodule mod_rewrite.c & gt; RewriteBase / RewriteCond at RewriteEngine% {QUERY_STRING} ^ redirect_to = http RewriteRule ^ wp-login.php http://example.com/wp-login.php? [R = 301, L] & lt; / IfModule & gt; I should not be able to login for two more last two days. This is a very common problem you are facing, you have to change the network on which You are reaching the admin panel. The reason for this is that nowadays, the hosting provider blocks IP addresses from which WordPress sites admin panels are often used. The same thing happens here as well, change network access and try again. You hope that your problem will be resolved.

templates - Extract the generic type of another generic type in C++ -

I have a square fu which uses two different common types, a _Type And other _Comparator is _Type to std :: vector , std :: list , or std :: string is known as , so it will be of one type within it: T within vector and list ; Within the Four string . My other common type is _Comparator , which is an optional template parameter, by which it specifies its lesser than the user function, factor, or lambda function. If no argument is provided in the form of a second argument parameter then it should be std :: less ; M & gt; functor, by which the type of elements contained in the type M should be _Type . How to do this I do not have this syntax. I have tried: template & lt; Typename _Type & lt; T & gt;, typename _Comparator = less & lt; T & gt; & Gt; @Jakim Pielborg In the comment, I Came along, who gave me the _Type : template And now std :: less compares the right type without complaining.

How to set window title from vim in tmux window -

मैं अपने स्रोत कोड को ब्राउज़ / संपादित करने के लिए cscope + ctags + vim का उपयोग करता हूं। मैंने फ़ाइल नाम को प्रदर्शित करने के लिए set title मेरे .vimrc में डाल दिया है। मैं वर्तमान में विंडो शीर्षक बार में संपादन / पढ़ रहा हूं। यह पूरी तरह से बाश में काम करता है। हालांकि जब मैं vim से tmux खोलता हूं, तो विंडो शीर्षक बार में परिवर्तन नहीं होता है। इसे कैसे ठीक करें? से। इसे अपने .vimrc में रखें: ऑटोकैम्ड बुफ़राईड पोस्ट, फाइल रीडपोस्ट, बुफ़नवेफ़ाइल * कॉल सिस्टम ("टीएमक्स नाम बदलें-विंडो%")