Posts

Showing posts from June, 2013

android - Immersive mode on Jelly Bean - Menu bar not disappearing -

itemprop = "text"> After creating my activity full screen using the sample code in the Android document: // This snippet hides the system bar Private Zero Hide SystemUI () set // // set the content to appear under the IMMERSIVE flag // System Bar, so that the content is hidden // content hidden and the size of the content Do not change. .. GetWindow () getDecorView () setSystemUiVisibility (View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN // hide the status bar | | hide View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // navigation bar View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); } // This snippet shows the system bar. It removes / removes all the flags, except that the content is displayed under the system bar. Private Zero showSystemUI () {GetWindow () getDecorView () setSystemUiVisibility (View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM...

c++ - Finding Unexercised Bits of Allocated Data -

Is there a device to check unexpected bits in the data allocated in C / C ++? We can use such tools when we are trying to reduce memory consumption in the DMD D compiler written in C ++. See for details. Update : I think that's a good contender, okay? After reading the conversation, I think that whatever you need to do is just as you Suggestion is to use a heap such as. So if you see that some special type is allocated a lot then you can look at it. Voluntaryly, however, without imaginary bits, I do not kill an important memory in the compiler as a hog, there should be big things above AST creation and all optimization (IPO). In addition, if you find some types that are actually beneficial by switching on the small footprint type, then ensure benchmark for performance Benchmarking is important, because a specific 4/8 If there is enough information to differentiate the byte type, then it can be a good thing that the CPU is usually slowed and computes on those types...

xml - How to modify Tomcat related changes in GGTS -

I have a grails app project and it needs to be run in GGTS via run-app command. I want to change the context of In-Bermate Tomcat. MML which uses GGTS / Gallery. For example, I want to add sessionCookiePath = "/" in context.xml to share the session. I can not find the location of XML files. I checked folders (undergrades), where some belong to TomKit, but I am not able to find related files in Tomcat cone. What is the session's cookiespath = "/" to add via Config.groovy app project ?? Or can I get it in the real context of actually built biscuits? Or should I take a completely different approach ?? In fact, I used the link suggested by Time_Actets and was able to configure sessionCookiePath if any If the session is looking for an answer to set a session cookie, use it. Under the presentations-> script-> Elliots- groovy (_Events.groovy create)) Configure the event below Add the tab eventConfigureTomcat = {tomcat - & gt; If (GrailsUtil.e...

silverlight - prevent datagrid stretching to row height -

I have two datagrads in the same line, two different columns. Depending on the data, the width of the datagrid on my left is 400-500. The grid on the right hand side is usually only 100 to the maximum of 100. My issue is pulling the right hand data grid to match the grid height on the left side. There is this to disable this anyway Let's see if you put them both in Grid.Row = "0" "itemprop =" text "> Let me assume the default vertical alignment of Stretch to DataGrid . That means they will fill the vertical position presented by the line. Try to install ... & lt; SDK: Data Grid Grid.Column = "2" VerticalAlignment = "Top" ... />

Changing puppet module source -

I examined puppet documents but there was no suggestion about it. I have puppet modules for monit - In it there are some predefined configurations for some services - files folder -. I want to add more, but it is not certain how to do it correctly in a puppet way. Is it OK to add new service configuration to local 'puppet / module / monit / file / folder? Will this folder be overwritten if it is updated for the module? Or maybe there is a better way to do this? PS My services are not public, so I can not request the original dhoppe-monit repository bridge. The bridge request is a good keyword. If you can not send your requirements upstream, you may want to maintain a private fork / branch instead. And yes, you'll need to stay upstream with the changes to make sure that you continue to work extra. In addition to writing your module with scratch, I really do not see another way to do this.

sql - How can I combine these two query from the same table? -

Since "Koldfugn Innr does not support connecting via join or outer join clauses" How can I combine these two questions Where do they give me data from the last 2 months? Select Starburst_dipta_name, STARBURST_DIPT_AVL, CSE_Rep_Resume with MONTHLY_PAST_DATE, where STARBURST_DIPT_NAME is not a null and YEAR (MONTHLY_PAST_DATE) = YEAR (GETDATE ()) and MONTH (MONTHLY_PAST_DATE) = MONTH (GETDATE ()) - 1 Select starburst_dept_name, starburst_dept_average, from MONTHLY_PAST_DATE to cse_reports_month where starburst_dept_name is not a null and YEAR (MONTHLY_PAST_DATE) = YEAR (GETDATE ()) and MONTH (MONTHLY_PAST_DATE) = MONTH (GETDATE ()) - 2 I would like a query to add these two how do I do this so that it works in coldfusion do? What would I like to compare Starburst_dipt_verage to last month & gt; Last 2 months ago? Just to clarify, CF does not support just inner and outer Johns a query (QoQ) Is the name of the cse_reports_month query or the name of the database ...

linux - Any command we can use to convert windows file to unix or mac file? -

I do not want to use the dos2unix tool. I want to use the command in the Ubuntu terminal so that the windows can be converted to a UNIX file. Is it possible. I looked through other articles and tried those commands, but nobody is working, anybody can help You can use tr to remove the carriage return in this way: tr -d '\ r' & lt; Windows File & gt; UnixFile You can see the carousis return in your file by using cat -vet WindowsFile And they will appear as ^ M

Floating point rounding error php ...how can I make sure it works correctly? -

I have the following function that determines whether I have paid the sale completely, I do not remember that I Why, but it is still working and I do not remember why I had to do this. function_payments_cover_total () {/ Get_payments is a list of payment amount such as: //10.20, 10.21, or 10.1010101101 (maximum 10 decimals) $ total_payments = 0; Foreign Currency ($ this-> Sales_lib- & gt; get_payments () $ form of payment) {$ total_payments + = $ payment ['payment_mount']; } // to_currency_no_money round the total if at two decimal places (to_currency_no_money ($ this-> sale_lib- & gt; get_total ()) - $ total_payments) & gt; 1e-6)) {return false; } Back true; } I am wondering if there is ever a case where this function will return false due to a rotating error when it should not be. I have a question about the main part: & gt; 1e-6 I think before I was, but in some cases it was causing the problem. & gt; I think that whatever you h...

c - How to have an array of functions that returns pointers of ints -

जब मैं निम्नलिखित पंक्ति को संकलित करने का प्रयास करता हूं int * x [] (), (* y) (); मुझे त्रुटि "एक्स प्रकार के कार्यों के एक सरणी के रूप में घोषित एक्स ()" 2 फ़ंक्शन पॉइंटर्स की एक सरणी के लिए इसे आज़माएं। #include & lt; stdio.h & gt; Int * पहले (शून्य) {वापसी नल; } Int * दूसरा (शून्य) {वापसी नल; } Int मुख्य (शून्य) {int * (* fx [2]) (शून्य); एफएक्स [0] = पहले; एफएक्स [1] = दूसरा; / * ... * / अगर (एफएक्स [0] () == एफएक्स [1] ()) {printf ("दोनों कॉलिंग कॉलिंग समान मूल्य देता है। \ N"); } वापसी 0; }

extjs - how set a initial/default item in menu button? -

I'm looking for menu buttons and do not see the initial / default item in the menu when first Have I remembered this time it has been sung? How to do this? This is checked: true you can move it Click on the second option to make it work.

sling - Sharing xml string between two components on different pages in cq5 -

I tried to use the two feature attributes to share data between two JSPSs, but this second JSP Not working as requested. I have also gone through the question, but this is not my situation, how to share data or strings between two component jsps set as sling: Type the resource on two different pages? Here's more information about the scenario: There will be a link on the first component, the second resource that will be clicked will take you to the other component in the form of resource type. Thank you. As you've already noted, these are two separate requests, so on the first The attributes set will not be available on the second request, which is generated when click on the link. I think the data you want to pass (XML string) can be very large in size, so you do not want to use the request parameters. In that case, you can save the data in some temporary location (in the repository or in disk) and then pass that parameter in the second component as a request para...

How Would I Create An Object In JavaScript? -

To be more specific, I essentially need to create an object where I can store and read prices . I am a part of a knot in JS, so I am sorry if I have limited understanding. I give an example. var usrobj = mainobj.id (userID Here); Var usrplays = usrobj.plays; Content of that kind But, I would also like to write play values. any idea?? (I do not know a crap of Javascript, mostly compared to you) Object actually You are awesome in JS because they are very simple You can create an object like: var usrobj = {}; This is what you need after you can easily add the key to it: userobj.plays = somevalue; And read it easily since: console.log (userobj.plays); Hope that helps.

templates - C++ boost::variant generic converter -

I've been trying for the last three days to find out how boost :: variant & lt; ... & gt;, but it's been quite difficult. The one that I can solve here is that it is not normal: #include & lt; Iostream & gt; # MyVariant = boost :: variant & lt; Int, std :: string & gt; Use "boost \ variant \ variant.hpp"; Square type: converter: public boost: static_visitor & lt; & Gt; {Private: Temporary int _int; Mutable std :: string_string; Fixed variant converter (MyVariant & amp; v) {VariantConverter Res; V.apply_visitor (race); Withdrawal reserve; // Copy will disappear, right? } Public: Zero operator () (Int & amp; i) const {_int = i; } Zero operator () (std :: string & amp;; const {_string = s; } Fixed int to_int (MyVariant v) {Return Application (V) .from_int (); } Fixed std :: string to_string (MyVariant v) {return application (v) .from_string (); } Int to_int () {return _int; }; Std :: string from_string () {return_strin...

Sorting a list of custom data types by certain attribute in Haskell -

मान लें कि हमारे पास कस्टम डेटा प्रकार है: डेटा व्यक्ति = व्यक्ति {first_name: : स्ट्रिंग, अंतिम_नाम :: स्ट्रिंग, उम्र :: इंट} deriving (ORD, EQ, Show) यह भी कहें कि मेरे पास इन व्यक्ति डेटा प्रकारों की सूची है I मैंने पहले से ही ऐसे फ़ंक्शन बना लिए हैं जो क्रम में इन लोगों को शामिल करता है, लेकिन यह प्रत्येक व्यक्ति के पहले मूल्य तक सीमित है, first_name मैं जो करने की कोशिश कर रहा हूं वह व्यक्ति डेटा प्रकार को संशोधित करता है ताकि इस प्रकार की फ़ंक्शन प्रथम_नाम के बजाय उम्र के अनुसार हो (केवल वरीयता को स्वैप करने के साथ ही उम्र पहले हो)। मुझे पता है मुझे ऑर्ड के लिए अपना खुद का तुलना फ़ंक्शन लिखने के लिए उदाहरण कीवर्ड का उपयोग करने की आवश्यकता है I यह वह जगह है जहाँ मैं फँस गया हूँ क्या कोई मेरी मदद कर सकता है? संपादित करें: हां, यह है एचडब्ल्यू-- दुर्भाग्यवश इसे जिस तरह से मैं वर्णन कर रहा हूं उसे करने की आवश्यकता है। उस समस्या से निपटने का सबसे आसान और सबसे लचीला तरीका है, यह देखते हुए कि व्यक्ति मानों को सॉर्ट करने के लिए कई वैध तरीके हैं, यह बदलकर नहीं है O...

android - How can I create a preference that changes the background of all activities in the app? -

I am creating an app and I do not know how to select a color in an activity in the app And this app changes the background of all the other activities I'm using Android Studio. Here is the code from my preferences screen. I would like to know what should be added. preference xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" android : Layout_width = "match_parent" Android: layout_height = "match_parent" android: background = "@color / bkgcolor" Android: paddingBottom = "@ Dimen / activity_vertical_margin" Android: paddingLeft = "@ Dimen / activity_horizontal_margin" Android: paddingRight = "@ Dimen / Activity_horizontal_margin "Android: paddingTop =" @ Dimen / activity_vertical_margin "Devices: Reference =". SetActivity "& gt; & lt; / Preferences screen & gt; The best approach defines a topic an...

How to make a dynamically allocated array that can hold derived objects in c++ -

Hello, I am doing a project for school that should use a dynamic allocated array of objects. I am wondering where I went wrong on this. Mammals * Pets = New mammals [gallop]; Pets [Calculation] = New Dog (Template, Tempamark) There is an error which says that no operator matches these operands for the second line of code. If my creator helps it, and the dog is the creator. Mammal :: mammals (zero) {weight = 0; Name = ""; Cout & lt; & Lt; "Including Mammalian Default Constructor \ n"; } Mammal :: Mammal (Int tempvate, string template) {weight = tempweight; Name = tempname; Cout & lt; & Lt; "Including Mammalian Constructor \ n"; } Dog :: Dog (int tempvate, string template) {SetVette (Template); Setname (tempname); Cout & lt; & Lt; "Inviting Dog Constructor \ n"; } Thanks, To declare you an array Like the indicator,: mammals ** pets = new mammals * [Erezes];

elasticsearch - Elastic Search Distinguish Fuzzy Results -

As a requirement when searching a fuzzy, we need to differentiate those results without matching a quick match The results are, which match the results,. For example if index is in: Red car Fox like car blue car And the query "purple or car ~" will have all the consequences with the fujis of 1, but "fox cart" will be marked specifically as a fuzzy result. I was wondering if there is any support for this facility or is there any suggestion about implementing this facility? I'm guessing that one option is setting Fazita to 0 and then executes the query and then marks the difference. I appreciate that someone can give better suggestions? Thank you in advance. Running two different questions is the approach that I understand most. / P> You can run two questions as if someone only matches exact, and other only fuzzy results, such as: Exact match only : Purple car Fuzzy matching only: purple car-carb Which set mutually You must d...

objective c - Convert delegate to static function -

I am trying to develop evidence of a simple, one file concept code as follows: int main (int argc, const char * argv []) {NSString * requestString = @ "https://www.example.com"; NSURL * requestUrl = [NSURL URLWithString: requeststring]; NSURLRequest * Request = [NSRR request request with url: Request URL Cache Policy: NSURAEstLLodiingLocalaccount Data Timeout Interval: 10.0F]; NSURLConnection * connection = [[NSURLConnection alloc] initWithRequest: Request Rep: Self]; Return 0; } The request from example.com uses a private CA from HTTPS, so I need to rely on that CA. In order to believe in CA, I need to add some code to NSURLConnectionDelegate --connection: didReiveiveAuthenticationChallenge: issue me the problem of callback For NSURLConnection , and the only way I know how to do it is with another different object. Is it possible to level the delegation in a stable work so that I can keep all the code in a file? This is not possible what you are doin...

ruby - Rails: validate number of associations -

How can you write verification for many organizations that are outdated? I have written something like this: Validate the documents of the class: publication_count Personal def publication_count if publication count & gt; Template.component_count errors.add (: article, 'too many') Elsif publications count & lt; Template.component_count errors.add (: article, 'not enough') end end are both publication and template associations. I get a rollback error with this code, even if the record should be valid. Your code appears correctly, so it seems that the associations are not set up properly or saved. going. Have you tested this: Both the publication and the template before you save it > Document assigned for example? There is no rollback error for a different reason, such as the specificity failure? Is this the true belief that has been unsuccessful at any other?

c# - Accessing items in multiple models in a single view in MVC4 -

I have an issue on how to access variables from various scenes in mvc. The way I have installed it , I have a scene on which I would like to display values ​​from several models. I know that to repeat through the items, I have to use the predecessor, but I do not know how to reach other people. In this way I say this model in this view: @modelInMerebal & lt; MyApp.Models.Problems & gt; This is my model where I am trying to use values: public class problems {public Ent ID (get; set) ;} Public String title {get; set;} Public IEnumerable & lt; MyApp.Models.Category & gt; Categories {receive; set;} Public IEnumerable & lt; MyApp.Models.Type & gt; Type {Receive; These are my other models: Public Partial Category Category {Public Ent ID}; Set;} Public That string title {get; set;}} public partial class type {public id id (get; set;} public indefinite order {receive; set;} public string description {get; set;}} Here's an example of what I'm...

c - GWAN Key-Value persistent store -

I want to use the GWAN API key-value to record and read many data (in multi-threaded manner) . The problem is that my recording is only available on the current page and therefore can not be used on my other pages. Can you show me an example or how to create a clear KV store (which will be accessible to all my subdomains)? Here is an example that I currently use: KV_T Store; Kv_init (and store, "user", 10, 0, 0, 0); Kv_item item; Item.key = "pierre"; Item.klen = sizeof ("Pier") - 1; Item.val = "pierre@example.com"; Item.flags = 0; kv_add (and store, and items); Char * p = kv_get (and store, "pirie", size ("pierce") - 1); Xbuf_xcat (get_reply (argv), "& lt; br & gt; Pierce's email address:% s ", p); But not constantly. Instead of being available for all scripts as G-Wan scripts, 'Global' variable 'static '(For each script) instead of compiled and linked. Therefore, you ...

java - Compiling OpenCV on Ubuntu -

When I try to create OpenCVi for Java on Ubuntu, I get the following error: [61%] Built-in target opencv_test_objdetect generated opencl_kernels.cpp, opencl_kernels.hpp /home/dinhvantan/opencv/opencv/cmake/cl2cpp.cmake:50 (string) CMake error: string sub-command MD5 to create identity Does not [2]: *** [module / ocl / opencl_kernels.cpp] making error 1 [1]: *** [module / ocl / CMakeFiles / opencv_ocl.dir / all] making error 2 [1]: ** * Waiting for incomplete jobs .... [70%] targets Opencv_legacy: *** [all] Error 2 Can anybody tell me that what is required of me to solve this problem? indicates that you need to upgrade to a new Seamax version. Use the new Ubuntu release or PPA, or build a limit from the source.

activeadmin - error undefined method `group_values' in active_admin rails -

I try to apply active_admin to my app, and I am following this tutorial: http://activeadmin.info/documentation.html But when I am executing this command in my console: Generates Rail Activation: Resource Product produces the file successfully: app / admin / product.rb But when I'm active in the Active_admin index I get this kind of error when using the page: Undefined method 'group_iman' for ActionView :: Template :: error (# & lt; Array: 0xcfe093c & gt;) How to fix it? Your administrator / product.rb allows you to enter this code: Thank you before: ActiveAdmin.register Product, as: = & gt; "All Products" end Hope that help

javascript - How to add option values on silviomoreto's Bootstrap-Select -

I have used bootloader selection of Schalmomerato but I have problems I have 2 dropdowns (select) an area dropdown And cities are now, I have a jquery onchange function, the functions will change the values ​​in the dropdown of cities based on the selected area. Here's my code: & lt; Id = "area" category = "select" & gt; & Lt; / Select & gt; & Lt; Select ID = "Cities" category = "Selected Picker" & gt; & Lt; / Select & gt; $ ("Change", Function () {$ ("# Cities"). Html ('& lt; Option & gt; City 1 & lt; / option & gt; & lt; Option & Gt; city 2 & lt; / option & gt; ';)); The problem do I find compatibility? When I removed the class "selectpicker" it works fine, but I can not remove it because I used it for my dropdown UI. I checked the documentation here but I could not find the relevant answer to my question. Thanks! Try select...

objective c - Does Calling -init on super Chew Up Memory -

निम्नलिखित उद्देश्य-सी में सामान्य है। - (id) init {if (आत्म = [सुपर इनिट]) {// कस्टम इनिशियलाइज़ेशन} रिटर्न स्व; } क्योंकि एक -init एक उदाहरण विधि है, इसे एक क्लास का एक वैध उदाहरण पर कॉल किया जाना चाहिए, और एक क्लास का उदाहरण तत्काल होना चाहिए। यह तत्काल मेमोरी का उपयोग करता है -init को super पर कॉल करता है, स्मृति का उपयोग करें क्योंकि उसे init विधि को कॉल करने के लिए एक नया ऑब्जेक्ट इन्स्तांत करना पड़ता है? सुपर उपयोग मेमोरी पर कॉलिंग करता है क्योंकि इसे किसी नए ऑब्जेक्ट को इन्स्तांत करना पड़ता है पर init विधि को कॉल करें? नहीं, क्योंकि आपके आधार गलत है सुपर , एक संदेश के रिसीवर के रूप में, एक ही वस्तु के रूप में self है; यह कम्पाइलर के बजाय का उपयोग करने के लिए सिर्फ एक संकेत है। सुपरक्लास के साथ पूर्व प्रारंभ विधि का पता लगाना, लेकिन विधि चलाने वाला उदाहरण अभी भी समान है। सुपर कीवर्ड का उपयोग करके कोई नया उदाहरण नहीं बनाया गया है।

c++ - Is there an alternative to Cocoa Sourceview for Qt on Mac? -

Should anyone know that Mac exists for Qt? I can not find any information online and I am not sure that it should be hand written. Any help would be appreciated. In normal terms, you should understand that the SourceView program has been written using Objective-C / Coco. So you can not get exactly the same program using C ++ / QT. But, if you reduce your needs, then you can also get a few components and even programs written using C ++ / QT, which can meet your needs. Are there. / P> The sooner the answer, I say that you have to write all by hand. But you can find lots of ready to use components and source code snippets. Take a look at the approach there is. Dig in that direction. In addition, there are a lot of resources to read about this type of programming: - 49th tutorial on QT by zero line. ... Hope this helps best wishes!

python - Scrapy a website that need use cookies -

I am creating a scrap to scrap a website, but this website is working with cookies, I do not I know how I can make instructions to scrape the website's data by using cookies. class dmozspider (spider): name = "dmoz" allowed_domains = ["dmoz.org "] Start_urls = [" http: //Www.dmoz.org/Computers/Programming/Languages/Python/Books/ "] DRF Pars (self, response): cell = selector (Re: =) Site = sel.HtmlXPathSelector ('// ul [@ class = "directory-url"] / Li') Item = [] For sites in the sites: items = website () item ['name'] = site. xpath ('a / text ()'). Remove () item ['url'] = site Exped ('a / @ href'). Remove () items. Upload (item) return item How can I add cookies to this URL correctly @ omair_77, you can override your spider's start_requests method to add cookies. Initial request by your spider: def start_reques ts (self): return [request (url = "http://www.example.com"...

Why does Python not have an 'is even' method for integers and what should I do about it? -

There is no 'is_even' method or nothing for integer in Python. For example: if with integer_value%, 2 == 0: do something It is not clear what to really do. While it is more understandable immediately: if_even (integer_value): # something this means That I need to write an AVIven function where I want it. def is_even (integer): if integer% 2 == 0: return true: return wrong What is a better option? What is the code itself that is readable and clearly intended, or is there comments everywhere? To quote a recent blog entry which is rounding: "Notice how much stronger this approach is compared to using comments, if you have arguments If you change, you put immediate pressure to change the variable name, it is not so with comments. I agree with DHH, the comment is dangerous and is caused by rot - it is better to write self-documentation code. > Am I this multi There is usually no problem in local functions - or using lambdas - and I usual...

dictionary - Mapbox fitBounds, function bounds map but does not render tiles -

Here, my javascript code to map the fit ballers of that map and then into that map. The map meets the boundaries according to the geography, but the problem is that when a marker is on the map and I try to be bound, the map tiles images are not render. This marker only displays no tile images in the map. var latLongCollection = []; Var map; $ (Document) .ready (function () {map ();}); Function map () {map = L.mapbox.map ('DivId', 'ProjectId'); get data(); } Function: AjaxSuccess, error: function () {$ .jax ({type: "GET", url: someUrl, data type: "json", contentType: "application / json; charset = utf-8" {} }); } Function AjaxSuccess (data) {if (data == empty; data.length == 0) {return; } Var geoJson = {"type": "feature collection", "features": []}; $ .each (data, function (index, value) {var latitude = parseflow (value.latidued), longitude = parseflot (value lonetuct); if (latitude & latitude) {v...

visual c++ - Binding base class object to Gridview itemSource in windows store app( metro app) c++ not working -

In the store app in my window, I apply the occurrence of change in property in the base class called "baseclass" I want to type in my gridview item and I receive this base class "Base Class" in the successor class "DerivedClass" [Windows :: UI :: Xaml :: Data :: bindable] Ref Class Base Class: Windows :: UI :: XML :: Dependency Object, Windows :: UI :: XML: : Data :: InotifyPropertyChanged {} Ref class DerivedClass: public BaseClass {} Then I created a Windows :: UI :: Xaml :: Interop :: IBindableObservableVector ^ vector and created a base class object Class object using its protected object derived from but its base class data is not bound in grid view. So, but when I create an object of the base class can bind data Gridwu. DerivedClass ^ derivedClass = Ref Derivative Class (); Base Class ^ Base Class = Reserved & lt; Base Class ^ & gt; (Derived class); Windows :: UI :: Xaml :: Interop :: IBindableObservableVector ^ m_Vector = Ref: new ...

android - How to access custom fonts from library project? -

I created an Android library project. I used custom fonts in my XML from my property folder but I did not use any other After integrating the project, I can not access fonts from the asset folder of the Library Project. I can access it from the new project's asset folder. When I used it with the library project, it was stopped and the error was "made quite basic" How can I get Asset Folder fonts from Library Project? Is it possible ?? thank you in advanced. Your description is not clear, you should provide your code. To access fonts from properties, you have to put the method inside the create () method, then you can create your own typeface with the font in the property / font folder Protected Zero Corrupt (Bundle Saved Instantstate) {Typefaces myFont = Typeface.createFromAsset (getAssets (), "Fonts / Fonts. TTF"); }

cPickle.load() in python consumes a large memory -

मेरे पास एक बड़ा शब्दकोश है जिसका संरचना दिखता है: dcPaths = {'id_jola_001' : CPath उदाहरण} जहां सीपीथ स्वयं परिभाषित वर्ग है: वर्ग सीपीथ (ऑब्जेक्ट): def __init __ (स्वयं): # कुछ विशेषताएँ स्वयं .m_dAvgSpeed ​​= 0.0 ... # सीएनडोड की सूची self.m_lsNodes = [] की सूची जहां m_lsNodes सीएनड की एक सूची है: वर्ग सीएनडी (ऑब्जेक्ट): def __init __ (स्वयं): # कुछ गुण self.m_nLoc = 0 # एप्लिकेशन की एक सूची self.m_lsApps = [] यहां, m_lsApps CApp की एक सूची है, जो एक अन्य स्व-परिभाषित वर्ग है: वर्ग CApp (ऑब्जेक्ट): def __init __ (स्व): # कुछ विशेषताएँ स्वयं। M_nCount = 0 self.m_nUpPackets = 0 मैं cPickle का उपयोग करके इस शब्दकोश को सीरियल कर सकता हूं: डीआरफ़ सीरियललाइज़ 2 फ़ाइल (स्ट्रफाइलनाम, स्ट्रॉओटीडीआईआर, ओबीजी): अगर लैन (ओबीजे)! = 0: strOutFilePath = "% s% s"% ( strOutDir, strFileName) खुले (strOutFilePath, 'w') के रूप में होटफ़ाइल के रूप में: cPickle.dump (obj , hOutFile, प्रोटोकॉल = 0) वापसी strOutFilePath अन्य: प्रिंट ("serialize ...

css - String To HttpPostedFilebase -

I have a theme themebuilder, which is making a topic from MVC C #, I have a model that contains CSS To save it to the CSS file from Themebuilder, which was back to the body, I can easily manage it in the folder by creating my CSS file, but I have to convert the CSS file to the binary file from within the database. Now I have a problem when I want to read CSS from the model & amp; Change it directly into the HTTP posted filebase. So it is possible or in some way to convert it to the HTML post via the string filebase. No need to convert it to HttpPostedFileBase by applying a direct string of CSS file names inside the path You can use that database as a saved CSS. You just need to create a method to get a binary CSS file from DB & amp; Change it to string then it will do the same thing that you have implemented as a CSS file.

jquery - ion.rangeSlider lock the slider to predefined values -

Is the slider an option to lock predefined values? I mean: ["7.5", "15", "35", "65", "99", "125", "150", "199", "29", " 39 9 "," 499 "], I now only" 7.5 "to 15,35 ........................ .................................................. .................................................. .................................................. ............................... Because when I start the slider with "7.5" then it gives me 43, 79 Shows I do not want this value, the slider only transfers the given values! If you can please! ($ ('$ Range_slider_a'). Length) {$ ("# range_slider_a") IonRangeSlider ({Type: "Single", Step: 10, Postfix: "7.5", "15", "35", "65", "99", "125", "$", Min: 7.5, Max: 49 9, // to: 7.5, haset: true, value: $ ('value'); $ (...

r - Retained order from data.frame in boxplot -

I have data. When I plot it in the boxplot, it automatically sorts by alphabetically by boxple Is there no way to use the data? Data. Frame (by date): Date ID Rate Label 20131103 54232 98 54232 20131103 20131223 32123 94 32123 20131223 20140101 12345 89 12345 20140101 boxplot: boxplatform (data_set $ rate ~ data_set $ label, data = data_set, col = "yellow", main = rate trend, las = 2, pp = 0, outcol = "red", equal to (mar = c (12, 5, 4, 2) + 0.1)) Depending on the data, Automatically sort data by base Is there no way to fill the data in the box-plot? I am using R v2.12.2. Thanks for the help. This factor is due to the order of the level of the label: a possibiliy: (data_set, boxplot (rate ~ factor) (Label, level = unique (label)), col = "yellow", main = "rate trends", with Las = 2, pch = 0, outcol = "red", par (mar = c ( 12, 5, 4, 2) + 0.1)) hth

shell - replace each occurrence of "[i]" with some random number in text file using bash -

I want to change "[i]" sub-substring with some random number using bass. Like abc. [I] .xyz [i] .lmn [i] should be output abc.3.xyz.5.lmn.32 Here are 3, 5, 32 randomized numbers. #! / Bin / bash # $ result replace_random ($ search, $ replaced), replace all the places in # $ # instead of $ # in # random number # using Bash's built-in PRNG and return on Return_Rendam () (local S = $ 1 local replace = $ 2 # while $ $ ($ search)) is replaced by $, replaces first place # $ with random number varies with "$ Replaced "forces this as a simple string To be believed in # and not to avoid example. '[I]' is defined as a # square class (the same is true for '?' And '*') while [[$ $ s} == * "$ {replace}" *]]; Echo $ $ s s = $ {s / "$ {replace}" / $ RANDOM} "$ {s}"} foo = 'abc [I] .xyz [i] .lmn [i] .aab 'bar = $ echo "$ {foo}" "[i]") "foo = [$ foo]" echo "bar =...

android - Where have I to define the onclick for button in customized dialog? -

I have found a dialog in a dialog. It works fine. I use a custom layout for my dialogue. These are two buttons release_scan_dialog.xml & Lt; Button Android: id = "@ + id / storage" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: text = "scan2" /> & Lt; / LinearLayout & gt; ScanFragment.java public class ScanFragment extends DialogFragment {public Android. app.Dialog onCreateDialog (android.os.Bundle savedInstanceState) {AlertDialog dialog = new AlertDialog.Builder (this.getActivity ()) .setView (this.getActivity (). getLayoutInflater (). add (R.layout.release_scan_dialog, null) ) .setTitle (R.string.title_store) .setPositiveButton (android.R.string.ok, new DialogInterface.OnClickListener () {@Override public void onClick (DialogInterface dialog, int which) {}}) .setNegativeButton (android.R .string.cancel, New DialogInterface.OnClickListener () {@Override Click on Publ...

arrays - Extract html attributes from string in PHP -

इस सवाल का पहले से ही एक उत्तर है: 27 जवाब मेरे पास एक ऐसा चर है जो दिखता है इस तरह से: $ var = '& lt; li डेटा-tpl-classname = "class" data-tpl-title = "innerHTML" & gt; & lt; / li & gt; और मैं डेटा-टीप्ल-एट्रिब्यूट्स को एक तरीके से निकालना चाहता हूं ताकि मैं एक परिणामी सरणी के साथ समाप्त कर सकूं जो इस तरह दिखता है: $ array = ('क्लासनाम' = & gt; 'वर्ग', 'शीर्षक' = & gt; 'innerHTML') "डेटा- tpl-" विशेषताओं की संख्या भिन्न होती है, और यह हमेशा एक & lt; li & gt; तत्व इसके अलावा, यह हमेशा एक ही प्रारूप का अनुसरण करता है: डेटा-टीप्ल-एट्रिब्यूनेम = "एट्रिब्यूट प्लेसमेंट" । मैं उन विशेषताओं को कैसे प्राप्त कर सकता हूं और उन्हें किसी सरणी में संग्रहीत कर सकता हूं, Regex का उपयोग किए बिना ? मैं बिना हर जगह regex कहता हूं क्योंकि मैं हर जगह देखता हूं ऐसा लगता है कि regex का प्रयोग करके html पार्स करना बुरा व्यवहार है, या यह इस मामले में ठीक है? itemprop = ...

liferay - Is it possible to overwrite web-form-portlet portlet.properties with hook? -

Is it possible to overwrite a web-form-portlet portal? With the hook in the Lifari portals? Thank you very much for your reply. No, you can create portal projects in web-form-portlet, change your IDE, properties And then deploy the web-form portlet again.

html - CSS calc() in border-width? -

Can I use calc () with border width? I would like the following CSS to work: .mi element (border-left-width (10% + 10px); Calc (10% + 20px);} But for whatever reason, any value I Calc () with no results in any given range. The document I found is not clear whether Calc can be used - it says that I someone Also gt I target IE9, but I get the same results in Chrome 34 and Firefox 28. I know that I can use jQuery to achieve these things, but I unfortunately, Code> border width Unfortunately, border width can not use one% value because no% is related to the size of the element Therefore, basically ... no you calc Ima-not with width% can use because it does not know what it's like

Redirect User to Play store From Android App -

Hello Friends, I'm developing an app, I had to redirect the user to an app store, I but the discovery has no success .. the code below button 1. setOnClickListener (new OnClickListener () {@Override on public void (see v_arg) {intent scene = new intent ( "Android.intent.action.VIEW", Uri. From ("https://play.google.com/store/apps/details?id=com.adeebhat.rabbitsvilla/")); Preliminary (Viewfinder);} Grip (Exception e) {Toast.makeText (GetApplicationContext), "Unable to reconnect again ...", toast .LENGTH_LONG) .show (); E.printStackTrace ();}}}); Button2.setOnClickListener (New OnClickListener) {@Override public void Click (See v_arg) {Intent visible = new Intent ( "android.intent.action.VIEW", Uri.parse ( "market: // details? Id = Com .adeebhat.rabbitsvilla / ")); StartActivity (viewIntent);} hold (exception e) {toast.makeText (getApplicationContext (), "unable to connect to retry ...", toast.LNGTH_LONG). Show (); E....

sql - MS access latest date issue -

I have 2 excel files where I maintain the rates and rates of assets and the dates of issue. Another best file is the list of assets and those dates were sold when Then there are the following columns in a superior file: property ------ rate --- --- rate_such_on 1.x ------- 1500 - ----- 21-Apr-2012 2. X ------- 2000 ------ 28-Aug-2013 3. Jade ------- 2200 ------ 11-January-2014 4. X ------- 3000 ------ 1-January-2014 Other The best file is (suppose): Property ----- Sololdt1 X ------ 1-December -2012. Z ------ 12-March- 2014 Asset X's sold date is between 1 January 2014 and 28-August-2013, so it has a rate of 2000 Should take it. If for example the date sold on April 22, 2014, the rate should be taken as 1500. If sold date is 27-August 2013 then it should display blank record. So the originally sold date should be more than the latest release date and the rates will be as per the specific date. I can easily do this work in Excel but the problem is that now the Excel fil...

android - ProgressDialog doesn't appear when calling a thread inside AsyncTask -

I have an app that sends a file through a socket, while doing so I want to show progress in the progression. The app sends the file completely, but I am not able to display the dialog. increases public activity ProgressDialogActivity {Private ProgressDialog downloadDialog = null; Private string filePath; @ Override Protected Zero (InstanceStat saved from bundle) {// Todo auto-generated method stub super. Connet (Saved Instantstate); FilePath = getIntent (). GetExtras () GetString ("file path"); DownloadingOug = new progression (this); Work myTask = new work (); MyTask.execute (0); } Private Zero Show Message (Last String msg) {this.runOnUiThread (New Runnabal) {@Override Public Zero Run () {// TODO Auto generated method Stub Toast. Make text (getApplicationContext (), msg, 'enter code' toast.LENGTH_SHORT) .show ();}}); } Working in the Private Class Async Task & lt; Integer, integer, boolean & gt; Observer {Private thread t; Applies; @ OverEride Protect...

mysql - Getting a result that matches one column with another -

Hi, I am using mysql to be able to do a table with a column with a column and I need to give it to me. result. I know that mysql has dropped, but I am using Bella mysqli, so I am currently using mysql as the basis for learning. This is my statement from SELECT `overview 'products where' overview '=` image` is here: Looks like my desk id | Name | Image | Overview 91 | Product 1 | Product1.jpg | This product is an overview of 192. Product 2 | Product2.jpg | This is an overview of Product 2. If the result is in the same line then it should be the result of observing the image. The expected product will be: This product is an overview of 1 This product is an overview of I hope this makes sense. I recommend you use the joining table: In this way, you will only see the values ​​of the 'overview' column that will match the values: 'PYPO products' from SELECT p.overview P2 ON p.overview = p2.image Image 'column's

OpenERP disable editing of field if in edit mode -

We need to allow a field to be visible but not editable in editing mode. Is it possible in OpenERP? If I can not at least hide it in edit mode? Thank you! This is the only readable attribute for stock.view_production_lot_revision_form Example: & lt; Field name = "author_id" readonly = "1" />

css - Break lines in html column -

मेरे पास एक तालिका में पाठ है जैसा निम्न है: & lt; td style = "white -स्पेस: अब आइपॉड "& gt; कुछ मान: अन्य मान; व्यक्ति-1: PERSON2 & lt; / टीडी & gt; मेरे पास समस्या यह है कि यह कुछ मान: एक अन्य मान; व्यक्ति -1: व्यक्ति 2 को कॉलम के अंदर एक पंक्ति के रूप में प्रदर्शित किया गया है। ; पर मैं इसे कैसे तोड़ सकता हूं? तो क्या यह अभी भी उसी पंक्ति / स्तंभ में है, लेकिन स्तंभ में 2 पंक्तियों के रूप में? स्पष्ट लाइन ब्रेक बनाने के लिए & lt; br / & gt; का उपयोग करें: & lt; td style = "white-space: nowrap" & gt; कुछ मान: अन्य मान; & lt; br / & gt; व्यक्ति -1: व्यक्ति 2 & lt; / td & gt;

java - JSF - loading a xhtml from outside -

Hey, I'm starting my journey with JSF and Java, I have a question about this topic. Question: Is it possible to load and use XHTML, which is not actually inside a war file, but is it somewhere out? I want to store it in a database or eventually on an FTP server. Can I register it as a resource in JSF? I'm not sure about the database part, but some interesting approaches to connecting to a NAS drive (Which can also work as an FTP location) If you are deployed as an open war, then using the links in the built-in OS, you can get the mapped drive (NAS place) allows you to map a location, where you can use your XHTML form John can FTP. If you are posted on Weblogic (I'm sure other people have the same characteristics) you can use all the requests in web.xml to redirect to an underlying NAS location. I have successfully used JSP and HTML in both the above methods so there are no challenges with XHTML.

shell - How to get input from command line in a simple bash file? -

I think this is the worst error I have ever seen. I have written what I have seen here too: But constantly I get an error. My plan is to know how the read command works but it seems to be a crappy error in my code or terminal. I wonder if anyone has seen similar problems? / code> #! / Usr / bin / bash echo "plz enter" Read the text echo "You entered $ text" Transcript $ text echo "$ text" Error: $ Test.sh plz b: is not a valid identifier $ $ / You can not notepad ++: edit> gt; Can also convert the end of the line format. EOL conversion & gt; Unix , then save and run the file.

active directory - is ADD-distributiongroupmember a cmdlet in powershell to add members into a distribution list -

I am trying to write a power script to add and delete members from the distribution list present in Active Directory. I tried an order to add members to the distribution list, which: ADD-DistributionGroupmember- "employee" -mail "johnevans@contoso.com" but when I try to execute this order tell me An error occurred that add-distributiongroupmember is an invalid command. Therefore, someone can give me a power script to add and remove members from the distribution list present in Active Directory. Add-item-distribution group member is an Exchange CMDlet, and it's the exchange management snapin or remote exchange management session. the wanted. You can accomplish the same thing by using the ActiveDirectory module and add-adgroup member, but you will not be able to use the user's email address as a member identity to add. The exchange will act as an identifying reference with him, but the native AD CMDlets will not be there.

Ember.js Undefined retrieving property of a model -

I found this model, where there is an array of site sites: app topology = D. Mod. Extension ({name: DS.TRR ('string'), site: DS.ETT ()}); And I am trying to retrieve this array in a calculated asset: return.filterBy ('name', This.get ('selectedName'.)) ('Site'); The filter returns the return value: & lt; App Topology: ember411: 1 & gt; But with the receiving ('site') it is undefined. Are you sure that the filter does not return an array? Therefore [and lieutenant; App Topology: ember411: 1> Something like this will be done, see if it returns an orange, you can use the first object property: return.filterBy ('name', this.get ('selectedName')). Get ('firstObject'). ('Site');

assembly - NEON memcpy , memset and using .c with .s files -

I am trying to get acquainted with the Neon instructions both the assembly and the internal. I would like to use Neon Memcpy with GCV V4.8.2 hardfp accordindg to I usee: I've also found this topic: but it's slightly different from the official ARM Page Implementation Unfortunately I have never C is not used with files, so I need some help. my. The c file looks like this: #include & lt; Stdlib.h & gt; # Include & lt; Stdio.h & gt; #include & lt; String.h & gt; # Include & lt; Math.h> # Include & lt; Time.h> # Include & lt; Stdint.h & gt; #include & lt; arm_neon.h & gt; Int main () {clock_t start, end; // timer variable uint32_t i, X = 100; Size_t size = 2048 * 32 / * arbitrary * /; Size_t offset = 1; Char * src = malloc (sizeof (char) * (size + offset)); Char * dst = malloc (sizeof (char) * (size)); NEONCopyPLD (DST, SRT + offset, size); Memcpy (dst, src + offset, size); Return (0); } and the assembly.s file i...

html - CSS: container to show PRE tag with scroll bars -

Image
I have some server-side code which can be found in html & lt; Pre & gt; & Lt; / Pre & gt; tag and I would like to put them in a container with scroll bars (in particular, table cells - with equal width). Obviously, I'm going to & lt; Pre & gt; I want to preserve the tag whitelisting format. (): HTML: & lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; Colonel 1 & lt; / Th & gt; & Lt; Th & gt; Colonel 2 & lt; / Th & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Pre & gt; Function This Ietsat (Blaise) test (123456789 test 123456789 test 123456789} & lt; / td> & lt; td & gt; & lt; pre & gt; function this iSatat (blah) (Test 123456789 test 123456789 test 123456789} CSS: table {width: 100%; border: 1px solid red;} TD {width: 50%; overflow: scroll; border: 1px solid blue;} (I call it firefight I'm testing in OX) What am I...

asp.net - How to set a file size limit on FileUpload Control -

While uploading a file, I get an error - out of size exception I gave the following Try to get rid of the code! - Written in vb Dim file as string = FileUploadVal.PostedFile.ContentLength if file size & gt; 1048576 Then des_label = "The file is too big!" But if there are still errors, is there a way to set the file limit before uploading? The size of the file will exceed the permitted web config. You can set the upload file to limit the size. The MaxRequestLength property specifies the range of buffering thresholds in the input stream. For example, this limit can be used to prevent denial of service attacks, which is caused by users posting large files to the server, & Lt; HttpRuntime executionTimeout = "max.exeLength =" number "requestLengthDiskThreshold =" number "Useful Qualified Redirect URL =" [trood fault] "minfrereddates =" number "minoloclefefreadreds =" number "app appraisequileEli...

Jenkins skips build shell command -

I have created a freestyle Jenkins job In the configuration I said that the Build Execute Shell was created with the simple command "Building Hello World" is. When I create a job, I think that is never executed. I do not find any shell errors in world output and can you tell me why this is happening. What type of shell are you using? I have the same problem with the tcsh - a command was not executed (not even echoed with the -x option). As it turned out, that was because there was no "Newline" character after that command, and that is a problem with that TCS.

c# - Prompt the user to download an excel file built server side -

Image
I have a way of calling my CreateAnnuityExcel sheet when pressed on the "Create button". Public ActionResult ShowAnnuityPMT (FormCollection is the form, string SubmitValue, name of the string file) {// to finalList, the code (SubmitValue = = "Save") {CreateAnnuityExcelSheet (finalList: Method To CreateAnnuityExcelSheet Call, Form, DTCIer); // When I call this method, I want to download the excel file created in the user / browser CreateAnnuityExcelSheet} Return the partial view ("ShowDetail", the last list); } The method looks like this: Public Zero CreateAnnuityExcelSheet (list of calculation> cList, formCollection as intDTCyear) {list From & lt; Count & gt; NewList = New list & lt; Count & gt; (); NewList.Add (cList.First ()); // Get value for the first line StartValue = newList [0] .StartValue; Var Radio = Form ["Advance Orories"]; String filename = newest list [0] .CalculationName; String path = @ "c: \ ex...

javascript - Output text in Browser string by string -

कल्पना कीजिए कि मेरे पास एक सर्वर स्क्रिप्ट है सामग्री प्रकार: पाठ / विमान पूंछ गूंज -फ /var/log/http/access.log|grep लिंग चूंकि ब्राउज़र और वेब सर्वर दोनों बफर आउटपुट हैं, इसलिए तक ट्रांसमिशन समाप्त होने तक मुझे परिणाम दिखाई नहीं देंगे। मैं स्ट्रिंग्स से परिणाम कैसे देखूं? मैं सर्वर (पर्ल, पीएचपी) को नियंत्रित कर सकता हूं और मैं क्लाइंट पर कुछ शुद्ध जेएस का उपयोग कर सकता हूं। हो सकता है कि मुझे किसी तरह वेबसाकेट और AJAX का उपयोग करना चाहिए? अच्छा enought काम करता है! पाठ / सादे काम नहीं करता है - ब्राउज़र केवल तैयार सामग्री का उत्पादन करता है, लेकिन पाठ / html महान काम करता है! [root @ CENTOS-6 ~] # बिल्ली chank-server.sh फ़ंक्शन लॉग {एलो $ 1 & gt; और 2} लॉग 'शुरू' नींद 2 लॉग 'इको हैडर' गूंज एचटीटीपी / 1.1 200 ओको सामग्री प्रकार: पाठ / एचटीएमएल प्रतिध्वनि स्थानांतरण- एन्कोडिंग: चंकेड गूंज कैश-नियंत्रण: नो-कैश एखो लॉग 'इको मेसेज' के लिए i में {1..9} करो एको-एक "9 \ r \ n" इको-एक "पंक्ति $ i & lt; br & gt; \ r \ n...

jquery - Draggable - set helper if condition is true -

Is it possible to set assistant in jquery only (say) when you start dragging, the control key is pressed ? I tried to do this: Start: function (Event, UI) {ui.helper =! Cntrl pressed? "Basic": $ (" ") Text ($ (this) .text ()). Css ({"background": $ (this) .Css ("background"), "padding": $ (this) .css ("padding"). Atter ("Data-Premet ID": $ (this) .attr ("data-permit id"), "data-print nazive": $ (this.) .attr ("data-predmetNaziv")} addClass (" Assistant"); } Thanks! yes it is possible, accept options one function: A function that will return a DOMElement to be used during dragging. Here you can check whether CTRL is pressed and work accordingly to keep a jQuery / DOM element back in. code: $ (function () {$ ("# draggable"). Draggable ({Support: Work} (Evt) {Return! Evt.ctrlKey? $ (This): $ (" Demuoduo ");}}};}); Demo:

css - Programmatically scroll ng-repeat with overflow:hidden -

Image
I am using the following markup (ZE) to make a digit with AngularJS. ul pijijana took .o: A and lacquo; Li (ng-repeat = "months in months | order:" _ id "" ng-square = "month ._id === shown? 'Current': ''") a (ng- href = "# Months / {Month._id}} ") {{month._id | Monthly: 'Short'}} li.arrow # right-arrow: One & raquo; In CSS, I have set the overflow: hidden . I get this: Perfect, But obviously it can get long time How can I scroll this when the user finally clicks on the small arrow symbols? I've tried like $ (...). Animate ({left: '- = 20'}) But it only gets neglected (I'm guessing because of Foundation CSS) Any thoughts? UPDATE I have a semi-working solution, but it's ugly. I changed the ng-show condition to list items such as: li (ng-repeat = "month in month | order: '' _ Id '"ng-class =" month._id ===' current ':' '...

how to read XML with ruby -

Is there any way to read XML with Ruby and get properties easily? what might happen? & lt; People & gt; & Lt; John ID = 1 & gt; & Lt; / John & gt; & Lt; My id = 2 & gt; & Lt; / My & gt; & Lt; / People & gt; I want to see Mary or Johns ID. (John ['id']?) Try / code / Sample code from Xmlfile) # Now root element root = xmldoc.root puts "root element:" + root.attributes ["shelf"] # All this movie titles will be produced Xmldoc.elements.each ("archive / movie") {| E Puts "movie title:" + e.attributes ["title"]}

operators - Why does this code produce 3 in JavaScript? -

निम्न कोड क्यों उत्पन्न करता है a == 3 ? var x = "abc"; var y = 3; var z = "xyz"; var a = x & amp; amp; वाई || z; मुझे उम्मीद थी कि इसका परिणाम a == true होगा। क्यों तार्किक ऑपरेटर "abc" के रूप में true का मूल्यांकन करने पर 3 के रूप में true का मूल्यांकन नहीं करता है। इसके बजाय यह परिणाम के रूप में 3 पैदा करता है। इसके अलावा, यदि आप y = 0 को बदलते हैं तो a == "xyz" जिसका अर्थ है कि & amp; amp; amp; इलाज 0 के रूप में false । संख्या के रूप में किसी संख्या के इलाज के लिए क्या होगा? तार्किक ऑपरेटरों के साथ क्या हो रहा है? यह उम्मीद की जानी है। जावास्क्रिप्ट (और कई अन्य भाषाओं) में, न केवल बूलियंस स्वयं या गलत हैं, लेकिन अन्य वस्तुएं भी सत्य या झूठी हो सकती हैं (देखें): मान [â |? | |] यदि आवश्यक हो, तो बूलियन मान में कनवर्ट किया जाता है। यदि मान है [â |? | |] 0 , -0 , नल , झूठा , NaN , अपरिभाषित , या रिक्त स्ट्रिंग ( "" ), [यह] झूठी है किसी भी ऑब्जेक्ट या स्ट्रिंग "झूठे...