Posts

Showing posts from March, 2011

Python pandas - MultiIndexed Series to Dataframe -

(background: I am trying to learn Pandas and matplotlib and get some good graphs from my good ideas. ) I have managed to parse some data into a multi-indexed series (let's call it series ): msgs id Datetime_period A 2014-07-04 07:00 1 2014-07-04 08:00 2 2014-07-08 11:00 5b 2014-07-08 11:00 1C 2014-07-04 07:00 2 For graphs, I would like to organize it into datafir such as A Looks like something: Index ABC 2014-07-04 07:00 1 0 2 2014-07-04 08: 00 2 0 2014-07-08 11:00 5 1 0 How would I do this? I think I can do something like this for me in ['A', 'B', 'C']} for df = DataFrame ({i: series.ix [ I]) But is there another way to 'Pandu'? (Or if not, how do I get the ['A', 'B', 'C'] list from series instead of clearly writing it above?) Alternatively (matters In this it is easy to use), there is also a basic 'raw' dataframe available that I used to build series in the first place. It contains a timest...

python - Save a dynamic page to a file or web archive -

Image
I want to save a page to my disk (also to open it off-line) If the page is very basic: Some text, some images, some links etc. I have no problem. But if I want to save a page like https://www.python.org/ I have many problems with the granphix I was trying to: Htmldata = urllib2.urlopen ('https://www.python.org/') .read () F = Open ('myfile.html', 'w') F.write (htmldata) f.close () But when I open my file, I: Even if I try to save any img from the page (subscribe to bs4 to use BS 4 By doing yoga), she got only one image. My file page is still there, so how can I save a page to open it off-line? Maybe it should not be .html file but anything else? You can download HTML images, CSS, URLs in JS and download them, and then change Ulls in HLR and Set file location on your disk. BTW: Probably the new URL will need the file: // prefix. BTW: Some images can be defined in CSS or JS files. So you have to find the URL in CSS and JS, download them...

java - libgdx sprite dimension meters or pixels? -

I'm reading "Learning Libegade Game Development". I tried the following snippet: // The first camera object was created with a 5x5 viewport. Orthographic camera camera = new orthographic camera (5, 5); I have a texture of 32 pixels with dimensions of 32 pixels. I create a phantom outside of this Sprite spr = new Sprite ( Texture); // I set the size of the SRR as spr.setSize (1,1); According to the book, the above dimensions are meters and there are no pixels What I can not understand is how mapping is being done from meters to pixels on the screen? When I had to draw the sprite on the screen, the size is not even half a meter alone. In addition, the size of the built-in texture is 32 x 32 pixels when I change the shape, the shape of my preferences also changes Then, spr.setPosition (x, y) What will be the dimensions? Will they be meters or pixels? Texture size in the library such as dimensions and use of pixels - game units setPosition Game units...

laravel - Blank page "redirecting to..." message -

Each time I return a redirect to a route from a certain controller, the redirect always occurs before the following message : redirecting to https: // localhost .... This indicates that for a few seconds more complete redirects It is done. Everyone had this error before? It appears for every redirect in my controller, so I thought it would be logical to add my entire controller, but if you need to see the controller please comment. On another forum someone said that the issue was that there was an extra space in front of my php tag I removed it and now it works perfectly!

statusbar - Objective-C: Modal transition with status bar -

The status bar is hidden in my main view controller (in viewDidLoad): [[UIApplication shared application] Set Status Barhard: Yes]; I present a modal view in which I do not want to hide the status bar, so I use (in the scene view controller in the front panel): [[UIApplication shared application] Set Status Barhard: No]; This works, however, it seems a bit vague because the status bar appears again at the top after the modal submission. I want the status bar to be presented with the model. (Ie, I want to attach it to the naval bar of the controller)

javascript - Save integer as float -

फ़ंक्शन prec (numb) {var numb_string = numb.toString ()। Split ('।') Return numb_string [(Numb_string.length - 1)] लंबाई} समारोह सींग (न्यूनतम, अधिकतम) {var most_accurate = Math.max (सटीक (न्यूनतम), सटीक (अधिकतम)); वापसी ((मठ। यादृच्छिक () * (अधिकतम - न्यूनतम) + न्यूनतम)। फिक्स (सबसे अधिक सटीक)); } // इन बिंदुओं के बीच यादृच्छिक संख्या देता है। 1 दशमलव सटीक स्थान: console.log (रैंडी (2.44.4)); // इन अंकों के बीच यादृच्छिक संख्या देता है। सटीकता के 3 दशमलव स्थान: console.log (रैंडी (2.443,4.445)); // इन अंकों के बीच यादृच्छिक संख्या देता है। 3 दशमलव स्थानों की शुद्धता चाहते हैं हालांकि, 0 प्राप्त करें: console.log (रेंडी (2.000,4.000)); // मुझे दशमलव स्थान क्यों मिलता है? क्योंकि फ़्लोट्स स्वतः पूर्णांक में गोल हो जाते हैं: console.log (4.0); // चाहते हैं 4.0 लॉग इन करने के लिए इसके बजाय मुझे '4' मिलता है आपको यह पढ़ना जरूरी नहीं है कि फ़ंक्शन कैसे काम करते हैं। बस सांत्वना लॉग असल में, मुझे दो अंकों के बीच एक सटीक डिग्री के एक यादृच्छिक संख्या को वापस करना होग...

api - Yahoo YQL returning INKApi error -

Correctly started returning the INKApi error. Specifically, I'm talking about the Yahoo! Baseball API. I'm definitely not the only person to get the error. But Yahoo is not responding to the posts on its message boards, see: I tried to contact them through their contact form, but no response. Does anyone have the solution for this? When will this be an idea (or if) Yahoo will address this issue? Can anyone help in contacting Yahoo directly? Thank you. I think the only way to contact them is that they can modify their APIs and You can give developers what they want .. In my opinion we do not have to do anything about this .. you should contact someone at Yahoo. See this link ..

php - Testing MySQL Updates Per Second Limit -

Assume I have 1 table and 100 rows in this table. The table is simple and contains only one auto increment [code> id area and a load_count field. Each time a web page loads, this query is executed and the load_count is increased from 1 ... UPDATE table_name SET load_count = load_count + 1 WHERE id = $ id How can I test my query to my server per second? Can I test 10 page loads per second Or will I run into errors on 1000? How can I simulate the number of page loads per second and the result of the record for MySQL performance?

javascript - Can I avoid using the word "this" inside Typescript when calling a function that came in through a constructor? -

I have: class AdminHomeController {personal configuration 1; // I tried different forms here, but nobody has configured 2 public; // Constructor (Private $ area: IAdminHomeControllerScope) {this.config = $ scope.config; // & lt; & Lt; This works) Fixed $ injection = ['$ scope']; ConfigChanged = (explicit) = & gt; {This.config.clear (); }; } This code works and requires all the methods in this.config though there is a way that I this Can I remove the requirement? I want to be able to do the following code: configChanged = (clear) => {Config.clear (); }; I tried with many different forms but I can not get it to do this work. angular.module ('admin') .controller ('AdminHomeController', ['$ http', Here is an example of a single code before typing here . '$ Q', '$ scope', 'utility service', administrator main controller]); Function adminHomeController ($ http, $ q, $ scope, utilityService) {var a...

Android Palette in RecyclerView -

आईएम प्रत्येक bitmap से मेरे रिसाइक्लर देखें और इसे मेरे टेक्स्ट की पृष्ठभूमि के रूप में सेट करें इसलिए मैंने निम्नलिखित : Picasso.with (ctx) .load (curs.getString (curs .getColumnIndex (TimelineDatabase.KEY_IMAGE)) की कोशिश की। इन्टी (धारक .vUserPost, नया कॉलबैक () {@Override सार्वजनिक शून्य पर सफलता () {{बिटमैप बिटमैप} प्रयास करें ((बिटमैपड्रॉवेबल) होल्डर.आईयूयूएसएरपोस्ट .गेटड्रॉउबल ()) .बिल्टमैप (); पैलेट पैलेट = पलेटगेट (बिटमैप); टोस्ट Maketext (ctx, palette.getVibrantColor ()। GetRgb (), टोस्ट। लंगथा_लॉन्ग)। दिखाएं ();} पकड़ (अपवाद ई) {e.printStackTrace ();}} हालांकि , कोई टोस्ट नहीं दिखाया गया है, और मैं नल सूचक प्राप्त करता हूं अपवाद के साथ निम्नलिखित लॉगकैट: 07-27 07: 13: 34.163: डब्ल्यू / सिस्टम। एर (4900): जावा .lang.NullPointerException: आभासी विधि 'int android.support.v7.graphics.PaletteItem.getRgb ()' को एक रिक्त वस्तु संदर्भ पर आमंत्रित करने का प्रयास 07-27 07: 13: 34.163: डब्ल्यू / सिस्टम। एर (4900): पर com.joy.timeline.Fetch $ TimelineFet...

xml - How do i span fo:table-cell from one named column to another? -

I am changing this XML table to PDF using Xslt. Insertion / @notely it detects where the span is the beginning and Entry / No Namred knows where the span will end. I have spread the cells before the numerical @ colname value, but this one stump help me please. This is my source xml: & lt; Table & gt; & Lt; Title & gt; Table title & lt; / Title & gt; & Lt; Tgroup cols = "5" colsep = "1" rowsep = "1" & gt; & Lt; Colspec colname = "colspec0" colwidth = "557 *" /> & Lt; Colspec colname = "colspec2" colwidth = "823 *" /> & Lt; Colspec colname = "colspec1" colwidth = "702 *" /> & Lt; Colspec colname = "col1" colwidth = "4452 *" /> & Lt; Colspec colname = "col2" colwidth = "4646 *" /> & Lt; Thead & gt; & Lt; Line & gt; & Lt; Entry named = "Kolspec 0" Named = ...

java - Having trouble with multidimensional array initialization -

I'm trying to learn Java and of course I'm starting to have a problem of starting multidimensional array Here's the code I'm trying to face that I'm trying to write ... import java.util.Scanner; Public square is a {public static zero major (string algos []) {int p [] [] = null; System.out.println ("Type ur array here:"); System.out.println ("how many rows and columns:"); Int line, colmn; Scanner u = new scanner (System.in); Scanner y = new scanner (System.in); Scanner T = New Scanner (System.in); Scanner r = new scanner (System.in); Line = t. NXIT (); Colmn = r.nextInt (); (Int i = 0; i & lt; = line; i ++) {int j = u.nextInt (); for int (v = 0; v & lt; = colmn; v ++); P [row] [colmn] = j; } Int a [] [] = p; System.out.println ("given array:"); Y (a); } Public static zero y (int n [] []) {for (int i = 0; i & lt; n.length; i ++) {for (int j = 0; j & lt; n [i] Length; j ++) {system .out.print (n [i] [j]); } System.ou...

unity3d - Why does Resources.Load <Sprite> return null? -

There are several spirits in my project which are located in Assets \ Sprats, which I want to load using the C # script . I tested it: Sprite myFruit = Resources.Load & lt; Sprite & gt; ("Graphics_3"); but myFruit is still empty. resources.Load property / resources Will search a directory. If you want to put it in the Sprites directory, then it is the resource (e.g., Property / Resources / Sprite ). Then you can load it like this: Sprite myFruit = Resources.Load & lt; Sprite & gt; ("Sprites / Graphics_3"); Also make sure that you have set your image type Sprite in Inspector. If you want to load multiple sprites, then use it: Sprite [] myFruit = Resources.LoadAll & lt; Sprite & gt; ("Sprites / Graphics_3"); See for more information.

php - Why this strange infinite loop occurs -

क्या किसी को पता है कि निम्न कोड क्यों है: foreach ($ _POST $ new = & Gt; $ new_val) {foreach ($ info = $ old = & gt; $ old_val) {if ($ new == $ पुरानी || $ new_val! == $ old_val) {$ change_log [$ old] = array ("पुराना "= & Gt; $ old_val," new "= & gt; $ new_val,); var_dump ($ change_log); }}} ओएस लटकाए (जैसे अनंत लूप में जा रहा है)। लेकिन जब "अगर" स्थिति ऑपरेटर में होती है || इसे & amp; amp; & amp; जैसे: यदि ($ नया == $ पुराना और amp; $ new_val! == $ old_val) सब ठीक हो गया। इसमें क्या गलत है || इस कोड में यह var_dump ($ change_log) है; लंबे समय तक। यदि सभी मान बदल जाते हैं, तो उस पंक्ति में 50 * 50 गुना और हर बार (प्रत्येक बेमेल के लिए) लंबाई $ change_log बढ़ता है। तो सबसे खराब स्थिति में, यह 2500 बार प्रिंटिंग $ change_log की लंबाई 2500 हो सकती है। इस लाइन को var_dump ($ change_log) रखें; बाहरी लूप के बाद और देखें क्या होता है।

upsert - Mysql UPDATE ON DUPLICATE KEY only inserting -

to I'm trying to run a query in order to insert duplicates or update. I am using a unique index for duplicates, but I can not seem to do this work. It still adds new records, hoping for some fresh eyes can tell my problem. Thank you. This is my schema If the table does not exist then 'pricing_patching' (`custom 'varchar (6) default tap comment' customer code ',` Recipe 'Varchar (15) default faucet, `item' varchar (120) faucet 'item code' from dProduce,` unit_wector` double (12,4) default faucet, `case_cast` double (12,4) default null comment ' projected Projekted_rrjin float (12,3) default nULL Recommend 'projected margin', 'Projekted_mrjin' float (12, 3) default nULL a The Omtm 'projected price', `Prvritti` Tinint (1) level trends default tap Comment 1 = up, 0 = down,` Note 'varchar (255)' notes on the default tap Comment 'data,' Sptah_of` Date of 'Empty comment' This data, 'Accept...

apache - how to change the home directory? -

मदद कृपया रीडायरेक्ट करें। निम्न प्रकार की संरचना है: site.ru (कैटलॉग) index.php (फ़ाइल) Htaccess फ़ाइल (फ़ाइल) catalog.php (फ़ाइल) लैंडिंग (कैटलॉग) index.php (फ़ाइल) लोड हो रहा है जब address.ru फ़ाइल खोलता है site.ru / index.php लेकिन जब मुझे एक ब्राउज़र एड्रेस साइट में लोड किया जाता है तो। साइट खोलता है site.ru / catalog / index.php जिसमें ब्राउज़र का पता निम्न होगा: site.ru अर्थात वाक्यांश "सूची" के बिना क्या आपका मतलब catalog.php क्योंकि आप एक निर्देशिका सूची नहीं है और इसके अंदर index.php । ऐसा करने के लिए, अपने .htaccess फ़ाइल, का उपयोग करें: डायरेक्टरी इंडेक्स कैटलॉग.php index.php index.html यदि आप लैंडिंग / index.php खोलना चाहते हैं (आपके कोड में, आपके पास (कैटलॉग) लैंडिंग के पास है), फिर इस तरह से लाइन समायोजित करें: डायरेक्टरी इंडेक्स लैंडिंग / इंडेक्स.एफ़पी सूचकांक। पीएचपी index.html index.ht मी

python - "file being used by another process" error message -

Yes, there are many other questions on this subject, I have seen the reactions but I have not seen any such useful solution gives. I have a problem in its simplest form: import os, time hfile = "status. Html" hf = open (hfile, "w") hf.write (Str (buf)) hf.close time.sleep (2) # Allow time to capture os.system (hfile) # File in the default browser I get this error message : "The process can not access the file because it is being used by another process". No other process is using it, because I can access it without error from another program, even if I run os.system (file) There is no point in using unlocker from the Python console , as soon as I leave the program, I can open the html file in the browser, no complaints from the system. This is not releasing the 'closed' file properly. I run programs like this out of Pearl all the time, leaving a delay of 1 or 2 seconds without any problem. Any suggestions? You are not ...

Using a Server in C# -

I have created a program that saves information on .dat files. Every time the program stops, the old information is replaced with the new information. When I open the program, it reads the information about the data files. I want to create a server that I would be able to upload .at files to it, and each Form_Close will be removed from breaking old information and uploading new information to server Will. When I open the program, I want to delete .dat files on the computer and change it with the information given on the server. What is the best service for this kind of problem? I thought I should use Google Drive I P> You have a lot of options, which are better for you, depending on your projects and goals, but they all will work. You can use Cloud Drive, such as Google Drive, Dropbox, Amazon S3 and so on. And there are two ways to use them: Just upload your file to the local folder in the file. Copy and assign it to the cloud client. Use the Cloud Drive...

string - How to add text to python calculation? -

I'm trying to create it with the help of a python: In a loop for one ( (I + (i + 2.5)) Text [i + (i * (i + 2.5))] Text Result: Text 1+ (1 * (1 + 2.5) text 4.5 text text 2+ (2 * (2 + 2.5) lesson 11 text text 3+ (3 * ( 3 + 2.5)) Text 1 9.5 Text etc. Each i must have a different formatting All code Should be in a commandline I have made it Python-C "import locale; locale.setlocale (locale.lc_all, ''); print ('\ n' in the category (1, 10, 1)) to join (locale.format ('\% UPDATE Strong>: With the help of the reply of Tanmeia Mehr, I have created this command: Python-C "import system, locale; [sys.stdout.write (' Text1 '+' \% .2f + (\% .2f * (\% .2f + 2.5)) '\% (i, i, i) +' text2 '+' \% .2f '\% (i + (I * (i + 2.5)) + + 'text3' + '\ n') for category (1,11,1)] " but still me Not know I think it will help, please specify that something Also to be added dragon - ...

dependency injection - why the ui not refresh when data updated in typescript and angularjs program -

I learn typing and analogues for a few days, and now I have a question that confuses me for days, I have a Gps tacking system, so I try to write a service like this: 1. Module service {Export class MyService {getGpsPeople (): Array & Lt; AppCommon.GPSPerson & gt; {Var gpsPeople = new arrays & lt; AppCommon.GPSPerson & gt; (Var i = 0; i & lt; 10; i ++) {var tempPerson = New AppCommon.GPSPerson ({name: "user name" + i.toString ()}); GpsPeople.push (tempPerson); } Return GPSSpolle; }} MyService class} 2. Controller like this: Module AppCommon {Export Class Controller {Area: NGIScope; Manufacturer ($ Range: NG. ISSCOP) {this.scope = $ scope; }}} Module controllers {Export interface increases IMyScope ng.IScope {gpsPeople: Array & lt; AppCommon.GPSPerson & gt ;; } Export class MyController extends AppCommon.Controller {Scope: IMI Scope; Static $ injection = ['$ scope', 'myService']; Manufacturer ($ amount: IMI scope, service...

PHP/MYSQL remove row by id -

I have a form that asks the user to enter the examination ID that they want to remove from the exam table in DB Are there. I have the problem that the user enters the ID, which does not match in the DB, the script seems to ignite the other situation completely ignoring the fire. I may have implemented this wrong but as far as I know I can not see where I am wrong, but I suspect that if anything wrong in my case Has happened. This is my form for which the user needs to enter the exam ID to delete & Lt; Div class = "formContent" & gt; & Lt; = "Id" for labeL & gt; Id & lt; / LabeL> & Lt; Input type = name of text = "id" square = "input" & gt; & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Input type = "submit" value = "delete" & gt; & Lt; / Div & gt; & Lt; / Form & gt; ` This function has passed which contains the...

ios - I want to populate an array2 with values from 1 to 100, but leaving values which are present in array1 -

I want to populate array2 with values ​​from 1 to 100, but except the values ​​that are present in array1, Array1 sort Can not be done. For example: if array1 [2,8,3], I want array2 to be [1,4,5,6,7,9,10,11 .... 98,99,100]. If I correctly understand what you are trying to achieve , This code snippet will resolve the problem: (NSInteger i = 1; i It will basically repeat from 1 to 100 and see if the current number is merged into array1 - if not, then this number should be numbered in arrayn (If you need a string as your original code, use [NSString stringWithFormat: @ "% d", i] ).

php - Query data using curl -

Why this code is not working, why - I do not understand. The code gets a response from the curl (to see) in this answer, yes, if it is found - which displays the text - if not, the second code: & Lt ;? Php / curl $ ch = curl_init ('http: //dev.local/phpwhois-4.2.2/example.php? Query = domain.ru & product = item'); Curl_setopt ($ CH, CURLOPT_USERAGENT, "Mozilla / 5.0"); Curl_setopt ($ CH, CURLOPT_HEADER, incorrect); $ Curl = curl_exec ($ ch); Echo $ curl; Curl_close ($ ch); If (preg_match ('~ \ s * yes \ s * ~ u', $ curl) 'echo'; Else echo 'other lesson'; ? & Gt; Strange error, more accurate, this is not at all, but - if curl sends text Yes, that does not work, he writes, and if he does not give the lesson - Also other. If all the text which is only kept in the variable that curls itself, then it works. This is what gives curl to 'e (written in writing, what else is there to write this answer): regrinfo-> array dis...

unix - Sleep() returns early in xcode -

If I run the code in xodod, then return to sleep when the child process goes out in just 1 second; But when I run this code in the terminal and it will sleep 10 seconds, why ?? int main (int argc, const char * argv []) {pid_t pid; If ((pid = fork ()) == 0) {sleep (1); } And {sleep (10); Printf ("hello"); } Return 0; } OK if you check the return code from sleep, you will see it return to -1 is checking the error at and EINTR . If you need to use, please work on this issue to see the answer I answered.

regex - Removing some letters from a string in matlab -

I have such a string id = "MOD09GA.A2008077.h00v08.005.2008080115153.hdf.xml" I want to remove some numbers from the string. I want it to be "MOD09GA.A2008077.h00v08.hdf" I know that I regexp (id, '".hdf" ',' Match ') How can I do this in matlab? How can I remove additional numbers? Thank you in advance You probably want to see and want to: c = straplip (id, '.'); NewID = Strōjōn (c ([1 2 3 6]), '.'); Alternatively, you can see the regexp and sprintf : C = regexp (id, '\.', 'Split' ); NewID = sprintf ('% s.', C [[1 2 3 6]}); NewID (end) = []; Abandon% of the follower '

ios - UIVisualEffectView doesn't blur it's SKView superview -

Image
I am writing a spritekit game and facing a problem with a blurred view, which is on SKVU. This game is supposed to slide right when it is stopped and it should blur the contents of the parent's view (SKVUE) like Control Center panel in iOS 7. This is the desired appearance: What exactly do I get: In fact, the view is not completely black on the left, you can see how highlights from the supervision are struggling through a slightly opaque review, but no stigma has been applied. Is this an iOS 8 bug / feature, or is it my mistake / misconception Here are my universal effects subclasses: class optionsView: UIVisualEffectView {// ... Init (Size: CGSize) {button = [UIButton] () super.init (effect: UIBlurEffect (style: dark)) frame = seagrakemake (-based width, 0, size.wind, size.heat) AddButtons () clipsToBounds = true} function show () {UIView.animateWithDuration (0.3, animation: {self.frame.origin.x = 0})} Hide the function () {UIView.animateWithDuration (0.3, Anima...

Jquery append and a javascript links -

मैं क्लाइंट साइड पर जेसन फाइल से लिंक उत्पन्न कर रहा हूं। loadSubjects = function ( ) {Return importData ("themen", function () {var i, _i, _ref, _results; _results = []; के लिए (i = _i = 0, _ref = data.themen.themen.length - 1; 0 & lt; = _ref; _i & lt; = _ref: _i & gt; = _ref; i = 0 & lt; = _ref? ++ _ i: --_ i) {$ ("# विषयबीटीएन")। संलग्न ('& lt; a href = "जावास्क्रिप्ट : "+ डेटा [" थीमन "] [" डेटा + "[डेटा [" थीन "] [" थीमन "] [आई] [" दिनांकईनाम "] + '"); "वर्ग =" बीटीएन बीटीएन-एमजीजी "& gt; "" "[']" ["नाम"] +' & lt; / a & gt; '); console.log (' appending: '+' & lt; a href = "जावास्क्रिप्ट: जेनरेट करेंविज़िविववलोकन (" '+ डेटा ["थीमन" ] "" [डेटा "[" थीमन "] [" थीमन "] [i] [" नाम "" "" "" ...

eclipse - Android app - share intent fatal error -

07-27 11: 29: 26.390: ई / AndroidRuntime (691): गंभीर अपवाद: मुख्य 07-27 11: 29: 26.390: ई / AndroidRuntime (691): java.lang.NullPointerException 07-27 नवम्बर: 29: 26.390: ई / AndroidRuntime (691): com.androidma.voteq.MainActivity.onCreateOptionsMenu पर (MainActivity.java:271 ) 07-27 नवम्बर: 29: 26.390: ई / AndroidRuntime (691): 29:: 26.390: ई / AndroidRuntime (691): एंड्रॉयड पर android.app.Activity.onCreatePanelMenu (Activity.java:2444) 07-27 नवम्बर में .support.v4.app.FragmentActivity.onCreatePanelMenu (FragmentActivity.java:225) 07-27 नवम्बर: 29: 26.390: ई / AndroidRuntime (691): android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu (ActionBarActivity.java पर: 233) 07-27 नवम्बर: 29: 26.390: ई / AndroidRuntime (691): पर android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu (ActionBarActivityDelegateICS.java:146) 07-27 नवम्बर: 29: 26.390: ई / AndroidRuntime ( 691): एंड्रॉइड। Support.v7.app.ActionBarActivity.onCreatePanelMenu (ActionBarActivity.java20000)...

how does object behave here in javascript? -

इस सवाल का पहले से ही एक उत्तर है: 6 जवाब मुझे पता है कि हम कर सकते हैं ' टी सीधे एक वस्तु की तुलना करें कि अन्य के बराबर है {} == {} झूठी बदलेगी। var b = {}; बी === ऑब्जेक्ट (बी); // सच ब === ऑब्जेक्ट ({}); // झूठी हालांकि, ऊपर के कोड मुझे भ्रमित करते हैं, क्यों b === वस्तु ({}) वापसी झूठी? कोई यह बता सकता है? यह वास्तव में ऑब्जेक्ट में है निर्माता दिए गए मान के लिए ऑब्जेक्ट आवरण बनाता है। यदि मान रिक्त या अपरिभाषित है, तो यह एक रिक्त ऑब्जेक्ट बनायेगा और लौटाएगा, अन्यथा, यह एक प्रकार का ऑब्जेक्ट वापस करेगा जो कि दिए गए मान से मेल खाती है। यदि मान एक वस्तु पहले से ही है, तो वह मूल्य लौटाएगा। जैसा कि आप पहले से जानते हैं, दो ऑब्जेक्ट समान नहीं हैं {} == {} // false लेकिन जब आप किसी ऑब्जेक्ट को ऑब्जेक्ट कन्स्ट्रक्टर में पास करते हैं, तो वह सटीक एक ही ऑब्जेक्ट देता है, न कि एक नया। var b = {}; बी === ऑब्जेक्ट (बी); // सच यहां आप ऑब्जेक्ट कन्स्ट्रक्टर को उसी ऑब्जेक्ट को पास करते हैं जो आप फिर से तुलना कर रहे हैं, और ऑब्जेक्ट कन्स्ट्रक्टर...

python - Calculate cost to combine subsets to get original set -

I have a list of items [1,2,3] And I have some subsets of the list above with a special cost such as {(1): 5.0, (2): 3.0, (3): 2.5, (1,3): 6.0, (2,3): 5.0,} I have to find a way to get the list above with the lowest price. For example, I could get [1,2,3] by combination (1), (2), (3) at the cost of 10.5, combinations (1,3) and ( 2) with the cost of 9.0 and combination (1) and (2,3) 10.0 with the cost . With my second choice I will be able to reach the lowest price. because I consider that the solution I present combination of a set division of the above list [1,2,3] and if any special subtitles in Arabic, but this solution is not optimal their The set of lists is a huge cost associated with generating partitions. set partitioning algorithm Try: Cost of each object => Exclude any set of two objects with the value of each item. Three words whose cost is> = the cost of some combination of size set> 3. ... greedy algorithms bit: One of th...

apache - Using a .htaccess to RewriteRule and Redirect 301 at the same time? -

I have certain URLs that I want to display on my website differently. For example, I have to be "/ contact.php" "/ contact". So I have added it to my .htaccess: rewrite ^ contact.php and pointing to the same page, 2 different URLs To avoid having, I also want to redirect a 301 between the old URL and the new one: 301 / contact.php redirect http://www.example.com/contact Each row above works well differently but if I add them both to my htaccess, There is a yoke loop. How can I fix this? Finally, if I type "/ contact" or "/contact.php", then I want to see the contact page with the URL "/contact". Edit: I also tried to do such things, and it does not work: Rewriteum ^ / contact \ .php $ http: //www.example. Com / Contact [R = 301, L] Rematerialized Rules ^ / Contact $ / Contact PHP [L] Yes, it will actually cause redirection loop The mod_rewrite rules are applied in a loop. REQUEST_URI value contact.ph...

c# - What events are fired after user's click is handled? -

इस सवाल का पहले से ही एक उत्तर है: 2 जवाब मैं उपयोगकर्ता को संभालता हूं बटन की तरह: निजी शून्य btnScanDirectory_Click (ऑब्जेक्ट प्रेषक, EventArgs ई) {// कुछ कोड} क्या घटनाओं को btnScanDirectory_Click ) यह काम खत्म करता है? कारण मैं पूछ रहा हूँ, कि btnScanDirectory_Click () में मैं एक नया थ्रेड () जो मैं "आग और भूल" पेड़। BeginnInvoke () विधि जो TreeView को अपडेट करती है। इसलिए जब कर्मचारी धागा बंद हो जाता है, मुख्य थ्रेड अभी भी उन एकाधिक हैंडलिंग इनवोक () कॉल से निपटने, और जब मैं पेड़ की तरह tree.ExpandAll (); उसी में btnScanDirectory_Click () - इसका कोई प्रभाव नहीं है। मुझे मुख्य थ्रेड में प्रतीक्षा करने का तरीका नहीं मिल सका जबकि सभी एंडइन्वेक () विधियां "कहा जाता है, इसलिए मैं पेड़ की कोशिश करना चाहता हूं। एक्सपेंड सभी () उस घटना में जो बाद btnScanDirectory_Click () समाप्त हो गया है। इस पृष्ठ को देखें। इसमें निम्नलिखित विवरण होते हैं और मुझे लगता है कि आप यही पूछ रहे हैं: कर्सर एक नियंत्रण के ऊपर है, तब माउस ब...

sql server - SQL query: convert -

I am trying to read a column from the database using a SQL query. Columns contain empty string or number strings, such as "" "" 9600 " I am trying to find the right square query to remove all the numbers and I am getting rid of the vacant places, but I am stuck in. So far I have found SELECT * from the base WHERE is not convert (INT, code) done in program r (package sqldf) If all columns are valid integers You can use it: select *, dot (code as integer) from IntCode to the base where the code is & lt; & gt; '' Use to prevent cases when the field is not a valid number, then , select cast, (from the codeN base cross Incutcode applies (when code is not like code \ '^ [^ 0-9]%') then terminate the code) N (codeN) where codeN is not zero UPDATE to find those rows Yes code is not a valid number, SELECT * base where code '% [^ 0-9]%'

Rails - how to validate presence of attribute AFTER creation -

I have implemented an IP tracking feature in the preparation of my sign-up page, when a user signs up, So the country sends the user, so to know the status of the new created account user_country to populate I know whether it is possible Is - the way I do other user attributes ( email , password ...) when the user is being created , The user_country To ensure the implementation of the recognition of a way that it is not empty or zero, which means that the user must always recognize a country. I can not use the classic method with valid : user_country, presence: true because when the user is made user_country still be filled , But WAITS registrar registrar calls the GeoOder this way => The following is the method 'after_sign_up_path_' / app / controller / reg Istrations_controller.rb class registration controller & lt; Wise: RegistrationsController Layout 'Lightbox' def updated account_update_params = devise_parameter_sanitizer.sanitiz...

polymer form using paper-input and core-ajax -

I am working on a custom element that uses a quiet service to send the methode node data to a database Will work in the form. I have 3 questions about this element. Can this also work? I am trying to use a method that seems unlike the data binding method when collecting data from a server. It can be used to send to the server. In the main-Ajax element I am using the automatic = "false" attribute. If this method can be used to send, how can I capture the body = "{}" when the line in the submitted PHP? I know that it has not been sent as $ _GET, it has been sent as $ _POST, or do I need to use any other method to capture it? My element template currently appears & Lt; Paper-input floating label label = "street address:" value = "{{address}}" & gt; & Lt; / Paper-Input & gt; & Lt; Br> & Lt; Paper-input Floating Label Label = "City" Value = "{{city}}" & gt; & Lt; / Paper-I...

oop - PHP extending a namespaced library -

What is the best way to expand a library in PHP? I am using the library. In my code, I instantiate the library like this: //// OAuth2 server is required ('./aauth2-server-php / src / OAuth2 / Autoloader.php '); OAuth2 \ Autoloader :: Register (); There are all OAuth2 classes under the namespace starting with OAuth2 \ foo \ bar; I am able to give these classes a unique name for my own classes without specifying the namespace (Which I do not like to do). However, I want to make my namespace in order to keep the actual class names in my expanse. For example, when I try to expand the PWO class like this, then it says, 'Class PEDA is already instant'. I therefore tried it in MyServer.php, I have: & lt ;? Php namespace mines; Class server OAuth2 \ Server {}? & Gt; But then I get an error that class MyNS \ OAuth2 \ server does not exist . Obviously, this is not it, and I do not think you can go up a level with the names as you c...

cocos2d x - Debugging Lua Project created in Cocos Code IDE creates "Waiting for debugger to connect" in Win-7 -

I created the established Cocos Code IDE and a new Lua project. When the debugging project (F11) game window pops up and sends me a message to connect to the debugger and then freezes. Apart from this, a dialogue appears, which states that the game module has stopped working. Does anyone have experience before this? I was facing a single problem. The console log says that the cylinders reach for the SLIL value of line 620. Because of this the code is cc.AsyncTaskPool.TaskType = {TASK_IO = 0, TASK_NETWORK = 1, TASK_OTHER = 2, TASK_MAX_TYPE = 3,} To proceed with cc.AsyncTaskPool = {}

java - Android Background Sockets -

Therefore, I am creating an app, and I need a continuous background thread. It should not be closed, the socket is always open, so please tell me to send and close the data, because I have sent an authorized request every time, and sometimes the app receives the data from the server. So, will AsyncTask be OK to use? AsyncTask is used for small, fast background work and not long-term background work for it You should use the service or at least thread.

c# - How can i sort a List<string> according to the numbers in each string in each index? -

Finally in the thread list I have for example: 1 Hello world Then I have in Index 2: 33 Hello Then I have 3 in index: / P> 76 Hello In index 4: 2 good numbers 1 33 76 2 > Each index is a part of the string. 1 Hello world is a string I want to sort the list according to the numbers so that this example should be: 1 Hello World 2. good 33. hello 76. hello and then numbers are part of the string they are not int. This is the method which lists: public string GetResponsers (string content) {string responser = ""; & Lt; String & gt; Thread list = new list & lt; String & gt; (); Int f = 0; Int startPos = 0; While (true) {string firstTag = " gt; String end tag = "& amp; n"; F = contents.IndexOf (first tag, startPos); If (f == -1) {break; } Int G = Content Index (last tag, f); StartPos = G + Last tag. Responder = Content.Substring (f + 22, g - f - 22); ThreadList.Add (responser); } Return Representat...

javascript - Can't get EXIF info using loadImage.parseMetaData -

I load javascript image. I'm using Parsmade_Data () so that I can try to orient an image on the Web, so I will rotate it. If I see the orientation in hardcodes (see "Orientation: 3" in my second load image call), then I can rotate it ... but I use loadImage.parseMetaData to get orientation I am trying to do I have used Web based Exhibence Parsers and orientation information is in the image. When I call load image The UltimateData "data.exif" appears blank. See this Bela: var xhr = New XMLHttpRequest (); Xhr.open ('GET', 'http://www.filepicker.io/api/file/U0D9Nb9gThy0fFbkrLJP', true); Xhr.responseType = 'blob'; Xhr.onload = function (e) {if (this.status == 200) {// Note: Response instead of .responseText console.log ("Found Image"); Var blob = new blob ([this.response], {type: 'image / png'}); Console.log ("About parsing Blob:" + _.pairs (this.response)); LoadImage.parseMetaData (blob, function) {co...

ruby on rails - undefined method "arel_table" for Images:Module? -

I have the user: the following docs through the union. I have 3 models posted class posts image class image & lt; ActiveRecord :: Base has_many: image_posts has_many: Post, via = & gt; : Image_posts end and ImagePost class ImagePost & lt; ActiveRecord :: Base is_to: images is_to: posts end and when I try: post = post.last post.images I get "undefined method" for arel_table "for images: module" error . What is arel_table and how to fix this mistake? Thank you. There is a problem defining the relationship between SAP and it should always be singular class ImagePost & lt; ActiveRecord :: Base is_to: image is_to: post end

Ignoring a JSON field in Haskell Aeson input -

मेरे पास हास्केल रिकॉर्ड है डेटा उपयोगकर्ता = उपयोगकर्ता {email :: text, token :: text} और मैं किसी भी इनपुट JSON में "टोकन" के मान को अनदेखा करना चाहता हूं उदाहरण के लिए, यदि इनपुट JSON {"email": "foo@bar.com", "टोकन": "abc123"} मैं जिसके परिणामस्वरूप उपयोगकर्ता वस्तु को उपयोगकर्ता {email = "foo@bar.com", टोकन = ""} को शामिल करना चाहता हूं। मैं परिभाषित करता हूं निम्नलिखित: उदाहरण FromJSON उपयोगकर्ता जहां parseJSON (ऑब्जेक्ट v) = उपयोगकर्ता & lt; $ & gt; V।: "ईमेल" & lt; * & gt; V।:? " क्या टोकन फ़ील्ड का मान सेट करने का एक बेहतर तरीका है?" "।! =" "- टोकन पार्सजेसॉन _ =" अमान्य उपयोगकर्ता " v।:? मैंने कोशिश की Lang-hs prettyprint-override "> उदाहरण FromJSON उपयोगकर्ता जहां parseJSON (ऑब्जेक्ट v) = उपयोगकर्ता & lt; $ & gt; V।: "ईमेल" & lt; * & gt; "" - टोकन parseJSON _ = ...

why not always branch(make it default) when we clone in git? -

This question may sound strange, let me explain this. I am recently learning GIT and I have a question. I have heard that people had said that whenever you have to add a new feature / bug fix repo, you can always be the branch, later you can be flexible in code roll out and deployment of production using merge and rebace. I've got this part But why did not someone divide the project and add changes directly to the original / master? I almost feel like we do a repo clone, we always do the branches because we've got to complete the work and we do not want to mess up the original / master up. So, why do not we just make a new branch instead of a clone? One of the workflows you are describing is possible, not only one more definite Imagine that you want to accelerate just on one project, then the branches and then the merger / merger will be back in the way of your work. . On the other hand, if you have been running for a long time, automatically branches will get you ...

objective c - stringByAppendingString on same object -

I have a question on NSString , so the question is: NSString str = @ "Hello"; Str = [str stringByAppendingString: @ "world"]; If we get NSLog to str we will get an output - HelloWorld So my question is that if str is NSString class variable one can not be changed after its one constant (which has been defined) ) So how can we change it, (note that I have used the same NSString object str ). You have not declared the string as static, but NSString It is irreversible that you are creating a new string and replacing str is an unstable type in many OBJ-C classes, so if you want to modify this string as an example, So you want something else: NSMutableString * str = [NSMutableString stringWithString: @ "Hello"]; [Stradded string: @ "world"]; Note, @ "Hello" is a NSString , so by trying to start a NSMutableString using that syntax An error will occur

git - How does one change a range of commits to have happened on another branch? -

My impression is that the solution is simple, but I can not find an example that clearly resolves my problem I do get guidance on the following: I currently have a history: a - - - c - - - - - f master \ \ B - - - d - e - - - g - h topic d , e , g , And h must all be done on master . At this point only the difference should be B then it should look like: a - - - c - d - e - f - g - h master b topic or better yet: A - C - D - E - F - G - H Master \ b topic ... but I do not know how to be completed It does not seem that I have written D , e Can I merge into live , and . H all ends at I b with master . I believe that I can raise them cherries, but it seems that to present future problems, what is the best solution? If you are pushing these branches in any remote repo, this is not a good past history If you have pushed, then I would like to avoid writing again by doing this: Master 's F > Master Cherry-selected D , e , g an...

java - False - Dead Code, OK. But nothing for True, why? -

निम्न कोड पर विचार करें: यदि (सत्य) {System.out.println ( "सच"); } यदि (झूठे) {System.out.println ("गलत"); } आप एक्लिप्स आईडीई का उपयोग कर रहे हैं। आपको उपरोक्त false के लिए ईक्लिपस आईडीई में डेड कोड चेतावनी मिलेगी / कोड> ब्लॉक लेकिन क्यों true ब्लॉक के लिए कोई चेतावनी संदेश नहीं है, भले ही इस स्थिति में स्थिति अनावश्यक है? सवाल मूर्खतापूर्ण हो सकता है लेकिन यह एक वैध प्रश्न जैसा लग रहा था किसी भी विचार? यह शायद एक राय आधारित प्रश्न है, लेकिन क्या बिल्ली, मैं फेंक दूँगा मेरी राय में। अगर किसी को यदि (सच) , तो या तो वे जानते हैं कि वे क्या कर रहे हैं, बस प्रयोग कर रहे हैं, या निराशाजनक हैं यह एक गलती होने की संभावना नहीं है। यह ग्रहण करने के लिए यह विशेष तर्क होगा, और यह उचित नहीं लगता। आप इसके बारे में कह सकते हैं अगर (गलत) - ऐसा ग्रहण नहीं होना चाहिए इस बारे में चेतावनी दें क्योंकि जिसने इसे टाइप किया है उसे पता होना चाहिए कि वह क्या कर रहे हैं हालांकि, ग्रहण के पास पहले से ही इस स्थिति के अलावा अन्य स्थितियों में मृत कोड को पक...

swing - Displaying messge when pausing a game in java -

I have developed in Java I have all the functionality like posing, resuming is. But my problem is now to display a message that prevents the game between "game penalty" between JFrame . I tried to apply the JLabel ImageIcon but failed. Please provide any help. Thanks in advance. Public Class Nequalas applies the JFL keyListener {boolean for_pause; Private canvas canvas; // Variable declaration-finished public nuclides () {// frame section canvas initial = new drawbacks (); Canvas.setPreferredSize (new dimension (CANVAS_WIDTH, CANVAS_HEIGHT)); This.setContentPane (canvas); This.setDefaultCloseOperation (EXIT_ON_CLOSE); This.pack (); SetLocationRelativeTo (zero); This.setTitle ("bouncing ball"); This.setVisible (true); //this.setResizable (false); AddKeyListener (this); Draw_rect (); } ActionList Action = New Executioner () {@ Override Public Voice Action Crorded (ActionAge AE) {update}; Repaint (); }}; Timer t = new timer (8, action); Public Zero Update (...

css - Is there a way to make the 'hamburger menu' lines in Foundation 5 thicker? -

Actually, the hamburger lines (horizontal white lines) are a bit lean :) I wonder if they have any way ? My HTML: & lt; Nav class = "tab-hide hide-to-medium" & gt; & Lt; Section class = "left-small" & gt; & Lt; One square = "left-canvas-toggle menu-icon" & gt; & Lt; Period & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; / Section & gt; & Lt; / Neo & gt; CSS: . Menuu-icon: after {box-shadow: 0px 2px 0px white, 0px 2px 0px white, 0px 2px 0px white; } I went to the inspector and tried to change the CSS on the fly, but nothing went unnoticed ... though these qualities were ... .tab-bar Menuu-icon {text-indent: 2.1875rem; Width: 2.8125rem; Height: 2.8125rem; Display area; Padding: 0; White color; Status: Relative; Webkit-Conversions: Translation 3D (0, 0, 0); Conversion: Translation 3D (0, 0, 0); } Small lines are controlled by the .tab-bar .menu Is -con span: after pseud...

Git is unable to access jarfile on Windows. No backslash characters are showing up in file path -

मैं एक checkstyle.xml फ़ाइल को पूर्व-कंपाइल गिट हुक में एकीकृत करने का प्रयास कर रहा हूं। मैं सफलतापूर्वक कमांड चलाया git config --add checkstyle.xml C: \ users \ & lt; user & gt; \ documents \ & lt; एप-नाम & gt; \ checkstyle \ checkstyle.xml हालांकि, अब जब मैं कमेंट करने का प्रयास करता हूं मुझे निम्न त्रुटि मिलती है: त्रुटि: जर्फाइल को एक्सेस करने में असमर्थ C: उपयोगकर्ता & lt; उपयोगकर्ता & gt; दस्तावेज़ & lt; AppName & gt; । ध्यान दें कि बैकस्लैश मौजूद नहीं हैं। मैंने git config फाइल को देखा और प्रत्येक बैकस्लैश के पास एक एस्केप वर्ण के रूप में इसके सामने एक बैकस्लैश है। क्या गिट कोई बैकस्लाब्स नहीं पहचानता है? मैंने फाइल को बदले में आगे स्लैश के साथ जोड़ने की कोशिश की और मुझे लगता है कि जारफाइल भ्रष्ट है। git config --add C: \ mydir \ checkstyle.xml पूर्व> से git config --add C: \\ mydir \\ checkstyle.xml काम किया। जीआईटी दोनों स्लैश और बैकस्लैश को समझता है बैकस्लैश जोड़ने के लिए, आपको उन्हें बचाना होगा। इसल...

python 3.x - Pycharm IDE and Jetbrains IntelliJ -

Why is the PyCharm IDE launched in the icon of IntelliJ Idea in the Windows 7 taskbar? So, instead of launching PyCharm IDE that opens in the PyCharm icon in the titbar, it is opened in the icon of IntelliJ. known issue, please vote

How to add 2 variables in the email body in win32com with Python? -

मेरे पास यह ईमेल टेम्पलेट है: def email_tamplate (* args): Format = { 'असम्धारित': 0, 'प्लेन': 1, 'एचटीएमएल': 2, 'आरटीएफ': 3} प्रोफाइल = "आउटलुक" # सत्र = विनोककॉम.क्लेइंट। डिस्पैच ("मैपसी सत्र") दृष्टिकोण = win32com.client डिस्पैच ( "Outlook.Application") # session.Logon (प्रोफ़ाइल) mainMsg = outlook.CreateItem (0) mainMsg.To = "myemail@amazon.com" mainMsg.Subject = "स्वचालित बकवास डेली अपडेट" mainMsg.BodyFormat = प्रारूप [ 'आरटीएफ'] मुख्य संदेश। HTMLBody = body2 mainMsg.Send () # इस लाइन में वास्तव में ईमेल भेजता है और एक ईमेल भेजना चाहते हैं जिसमें शरीर में 2 टेबल हैं इसलिए मेरे पास 2 निकाय हैं: यहां एक है: eod = [] body2 = ['& lt; html & gt; & lt; body & gt; & lt; तालिका सीमा = "1" शैली = "चौड़ाई: 300px" & gt; & lt; टीआर & gt; & lt; टीडी & gt; शीर्षक स्तर & lt; / टीडी & gt; & lt; / टीआर & gt; & lt;...