Posts

Showing posts from February, 2011

How can I restrict YouTube videos that can't be played in the US, on iOS? -

How can I ban YouTube videos that can not be played in the US? (NSString *) query offset: (int) offset withBlock: (Zero (^) (NSMutableArray * mediaArray, NSError * error)) Block {NSError * searchError = - (zero) loadMediaListWithQuery: [NSError errorWithDomain: @ "No Video Detected!" Code: 120 User Information: NULL]; Query = [query excelstustration: @ ""] == is true? DefaultSearchQuery: Query; NSString * searh_url = [NSString stringWithFormat: @ "% @ q =% @ and orderby = relevance & start index =% d & amp; max-results = 20 & amp; v = 2 and time = all_time & amp; ; Alt = json? ", YoutubeSearhURL, query, offset]; NSURLRequest * urlReques = [[NSURLRequest alloc] initWithURL: [NSURL URLWithString: [UtilsSpaceString: searh_url Convert]]]; AFHTTPRequestOperation * Operation = [[FTPTRAAST Operation Eloc] InitvatRuest: URLReques]; [OperationSatemAllablockWithSoftware: ^ (FHTPPKAEASTA Operation * Operation, ID ResponseAbject) {NSER * Error =

resty gwt - How can I create synchronous calls to rest via javascript using GWT? -

I'm calling my GWT client for the web service being hosted on a different server of Javascript which requires the answer And sung on the UI I used to do it comfortably through living organisms but I am unable to capture the response when the JavaScript method is called from HTML which in turn invokes the rest call. Besides, I want to make sure that if I bring two calls from Javascript after the second call (which calls each other) then the second call is only made when the call is completed first. Is there any way to achieve that? I think there are 2 different problems in your question: / P> A) that Unable to capture the response B) Create a sequence of calls for A) Should you give us more information, code snippets, is it related to your problem? B) These are my suggestions. If you are using 2 asynchronous calls then there is no way to guarantee that the second will return before the second one. Still you can get some sort of synchronization differently. I see

android regarding file read from sandbox -

My name is a file named settings.xml that I copy from property to sandbox, if file does not exist in the sandbox is . This file, then, I am trying to read from sandbox in another activity. I'm getting errors, please help me Copy file from the sync box if not available in the sandbox / private zero copymyfiles (string filename) {FileInputStream fInp; Try {fInp = openFileInput (file name); If (fInp! = Null) {log.i (â "???", "Setting file is found in the sandbox setting");}} Catch (FileNote ExpressE 1) {/ * file is not in the sandbox . Property * / e1.printStackTrace () from; AssetManager assetManager = this.getAssets (); {InputStream = assetManager.open (filename); Log.i (a "", "opening settings xml"); {FileOutputStream FOut = openFileOutput (file name, MODE_WORLD_READABLE); OutputStream Water Out = New OutputStream Witter (Out); {Try current four; String result = ""; While (in.available ()> gt; {current = (char) in.read ();

asp.net mvc - Azure server got error "system lacked sufficient buffer space or because a queue was full Ip" -

I hosted my project on the server of ASP.NET MVC, and I have used Ajq SQL, its The work is fine, but many times when doing any operation, i.e. when the fire from the controller gives this error, "An operation on the socket could not be performed because the system did not have enough buffer space or Queue full ip " and after a few minutes it starts to work fine Awareness is, what is there to throw can tell me that this error Why or any solution to this ?? This is probably the client side problem (ASP.Net App Side). This can happen if you make a lot of socket connections or do not remove the connection properly. Please double-check your application and make sure that: You can close all database connections properly (using () () or call the dispute ()). Socket connection (if any). If your code is okay then you can try to use it. This will not solve this issue only, but your app can help solve it.

wordpress - Filter to check quantity at checkout -

I have a specific task that is possible I want to apply with WooCommerce. I have a method that allows me to do WUIJOIRE Check if the amount of items in the cart is divisible by 12? Actually I have a shop setup, but I need customers to order order quantity of 12 (this is the size of the box that I ship these items). However, I have some product variations (size, width, etc.) and I want the customer to mix variations to reach the quantities of 12 or (24, 36, etc.). I believe that the easiest way to do this is to establish a function that checks the total cart quantity and if it is divisible by 12. If so, then he can move forward. If not, then they need to change their amounts to continue. Does anyone have experience on whether there is a plugin that suits it or if there is some custom code that I can add? Any help is greatly appreciated. Regards, Ryan This should work for you: Add the following to the function. php file will check it in checkout and see if there is a

c# - Find checkbox control in ASPxGridView -

I have an aspxGridView containing a checkbox dataTemplate that has GridVidgetteCalom. Now I have to find that control for every line and check / uncheck / check on runtime. Here is my code for ASPxGridView: & lt; Dx: ASPxGridView id = "RadGrid2" runat = "server" auto generated column = "false" client name = "grid" keyfieldname = "store_id" settingspager-mode = "all alerts" width = "50%" & gt; & Lt; Show settingsVersical ScrollBar = "true" /> & Lt; Columns & gt; & Lt; Dx: GridViewDataCheckColumn caption = "#" visible index = "0" width = "25%" & gt; & Lt; DataItemTemplate & gt; & Lt; dx: ASPxCheckBox ID = "checkbox 1" run = "server" & gt; & Lt; / dx: ASPxCheckBox & gt; & Lt; / DataItemTemplate & gt; & Lt; / dx: GridViewDataCheckColumn & gt; & Lt; Dx: GridViewDataTextColumn fiel

javascript - Canvas Black and White Image to Shape -

Image
I have just loaded a simple image on a canvas. Just a white circle background with its black. What I am trying to convert turns that white area into a shape. This size will be used to detect the limit. Am I assuming that I need a loop via pixel image data pixel? I did this before manipulating the color, but I'm not sure how I would like to know about saving this information in the "border" and / or "border outside". A little more complicated: < / p> Thank you! If the pixels below the mouse is black or white, then how to use context.getImageData to test it Do: To get the main pixel array and test if any group of red, green or blue is near 255 (== white if all RGB 255 is equal to) example Code and a demo: var canvas = document. GetElementById ("canvas"); Var ctx = canvas.getContext ("2D"); Var $ canvas = $ ("# canvas"); Var Canvas Offset = $ canvas.offet (); var offsetX = canvas offset Left; Var offse

arguments - Bash test command operators -

I just started in Bash scripting, and I do not have to find out what the logic is ( -a and -n ). Do they have bug logic or self-generated logic? If ["$ UID" -ne "$ ROOT_UID"] then "should be run as root" encode $ E_NOTROOT fi [-n "S1"] then < P> Memnon for -ne is 'not equal'; It compares arithmetic comparisons to two values ​​for inequality. -n is not empty 'empty'; It tests whether the argument ( "$ 1" in this case) is an empty string. If $ 1 is defined and there is no other value than the empty string, then the test is correct. See for more information. - command, also known as [ , supports other numerical comparison operators: -lt (less than), -le (less than or equal to), -gt (more than), -ge (Greater or equal to), and -ike (equals). The -z operator tests for a zero length string ??? But note that the argument should be enclosed in double quotation marks, however ( [-z

javascript - check the checkbox on load but if the page reloads must remember last state -

I have a group of checkboxes that should be checked when page loads. I have an onload script to check the automatic checkbox, but when I unchecked the checkbox and reloaded the page, it is still checked. How can it remember this in the end? Thanks in advance try it ... var i , Checkbox = document.querySelectorAll ('input [type = checkbox]'); Function save () {for (i = 0; i & lt; checkbox length; i ++) {localStorage.setItem (checkbox [i] .value, checkbox [i] check); }} Function load_ () {for (i = 0; i & lt; checkbox length; i ++) {checkbox [i]. Checked = localStorage.getItem (checkbox [i] .value) === 'true'? right wrong; }} Wisdom of working: -

c# - Stopping a WebClient after usage in Windows Phone 8 -

I want to stop webmail after my use but I could not find any way to do this. Public Static Webclient WebClient = New WebClient (); You can use: For example: var Client = new webmail (); String url = "http://example.com/parameter"; Client.BeginDownloadString (URI); client.CancelAsync ();

javascript - How can I display JSON data in angularJS if the key is variable? -

I am writing a website for my school that, among other things, departmental changes will be displayed. These changes have already been gathered with a script that I wrote. To improve the workflow, I want to automate the speed of data on the website, while the script automatically transmits an email to the department, it also saves information as JSON data and it is on the server Uploads where I use 'angularJS $ http.get to save it in $ scope. var integrationFactory = function ($ http) {var factory = {}; Factory.getNotes = function () {return $ http.get ('/ ci / json_releasenotes.json'); }; Return factory; }; Angular Module ('integration app'). Factory ('integrationfinor', integration point); Because the release notes have been continually upgraded, because I would like to save it because if it happens something like {"0": "This is the first note", "1": "This is the second note", "2": "etc ..

ios - Can access Twitter with one specific user account? -

I'm going to prepare an app that offers retail stores. I want to add the Twitter account of each store to programmatic read only access. All the Twitter questions are talking about access to the device via app settings. Is it possible to access Twitter through accounts stored on the device? Thanks You will need to do some things. If each store has a separate account, then each store account must authorize its app to use its account. Once this is done, your app will need to retrieve and archive the required OAuth token for each store. Finally, your app will need to authenticate with the tokens of the right store to access Twitter as that store.

python - Permission Denied To Write To My Temporary File -

I am trying to create and write a temporary file on Windows OS using Python. I used Python module tempfile to create a temporary file. But when I write that temporary file, I get an error permission denied . Do not I have permission to write in temporary files?! Am I doing something wrong? If I want to create and write a temporary file, how should I do it in Python? I want to make a temporary file in the temporary file for security purposes and not locally (.dir is executed in .dir). IOError: [Errno 13] Permission denied: 'c: \\ user \\ blaza ~ 1 \\ apeda \\ local \\ temp \\ tmpiwz8qw' temp = tempfile.NamedTemporaryFile (). Name # f = open (temp, 'w') on this line # error occurs < P> identical file named actually creates the file for you , there is no need to open it for you to type. In fact, the state: Whether the name can be used to open the file a second time, while the nominal temporary file is still open, the platform is different

web - configure nginx, namecheap show domain instead of ip -

मेरी nginx config फाइल मूल है: सर्वर {80; Server_name example.com www.example.com; स्थान / {रूट / var / www / html /; }} नामचिह्न में मेरे पास एक आईआरपी, 123.45.67.89 के लिए यूआरएलएंड्रॉक्ट अग्रेषण है, जब मैं ब्राउज़र में 123.45.67.89 / आईएमजी.जेपीजी डालता हूं, मुझे उचित छवि मिलती है। जब मैं example.com/img.jpg टाइप करता हूं, तो मेरा ब्राउज़र 123.45.67.89 तक निर्देशित होता है और मुझे 403 मना किया जाता है (मेरे पास कोई index.html नहीं है)। मुझे क्या करना है उचित सर्वर को प्रदर्शित करने के लिए मेरे सर्वर क्या मैं नामचिह्न के भीतर गलत मेनू का उपयोग कर रहा हूं? मुझे पता है कि यह एक बेहद नौसिखिया प्रश्न है, लेकिन मैं इसके साथ लंबे समय से संघर्ष कर रहा हूं; यह मुझे किसी भी गंभीर वेब काम के प्रयास से रखा है और यह मेरे अस्तित्व का खून है कृपया सहायता कीजिए! कृपया इस तरह प्रयास करें: सर्वर {80; Server_name example.com www.example.com; स्थान / {रूट / var / www / html /; } स्थान ~ *।। (Gif | jpg | png | jpeg | ico | avi | mp4 | m4v | flv] {अधिकतम समाप्त; रूट / var / www / im

php - Constant holding $this class name -

Is the current sub class name constant in PHP? So that I will write a function: namespace testing \ that; Classes Mycleus class A {} abstract class class A {public static function getClassName () {back __THIS_CLASS__; // like get_class ($ this); In any static method}} In the end I will do something like this: namespace testing; Test that \ MyClass; Var_dump (MyClass :: getClassName ()); // -> Is this also possible? You are probably watching; It gives the name of the class that is called in the static method. public static function getClassName () {return_called_class (); } MyClass :: getClassName (); // "MyClass"

php - CodeIgniter - Get a variable within quotes. -

I have to get a variable between the quotation marks in the codeigniter. But how can I complete it? $ this-> Db- & gt; Where ('boxing' gt; ', $ start); For example $ beginning value is the 2014-03-17 codeigniter sees it like this: $ this - & gt; Db- & gt; Where ('boekingsdatum & gt;', 2014-03-17); But I would like to like it: $ this-> Db- & gt; Where ('Boekingsdatum & gt;', '2014-03-17'); So I thought the answer would be something like this: $ this-> Db- & gt; Where ('bokingstatum'; ',' $ start '); But then the variable is not written as a variable You can do for dates and only for dates $ this- & gt; Db- & gt; Where ('bokingstatum', date ("YMD", strotomom ($ start));

c# - Does the "using" keyword mean the object is disposed and GC'ed? -

I had a conversation with my colleague today, who said that it is the only statement. // Keywords are used to clear resources that require a settlement (IDisposable interface). (Using the StreamReader reader = new stream reader (@ "c: \ test.txt")) {string line = reader.ReadLine (); } I have indicated that the object is marked as "can be disposed" but it has not been dealt with in reality and unless GC decides to do so, the waste Does not accumulate He answered that the object will be disposed off automatically once, which ends the statement, because the statement used can be translated, translated into the block at the end. Therefore, the object should be used at the very end of the statement. I was confused by this, because I know that using a statement using the statement does not guarantee that the object gets collected-whatever happens That the disposable () method will be called. GC decides how long GC can be. But when he asked for the evide

scala - com.paypal.core.rest.PayPalRESTException:Read timed out -

I am using paypal for payment in my project. It works to successfully complete Visa Cards and MasterCard and payments. Private def defaults (payment: payer, payer, access token: string): payment = {val apiContext = new APICCText (access token) var objPay = payment apiContext.setConfigurationMap (sdkConfig) {ObjPay = objPay.create (apiContext) // Exception is here / here some code ..... ......} hold {case e: PayPalRESTException = & gt; {Println ("Exception in the last payment method") val msg = e.getMessage println (e) println (msg)}} objPay} but American Express & Amp; I get the following exception from Discover card: The last payment method in the exception is com.paypal.core.rest.PayPalRESTException: Read Time-Period Read Time Expired < / Code> I am using these library dependencies ...... "com.paypal.sdk"% "PayPal-Core"% " 1.5.2 "," Com.paypal.sdk "%" rest-api-sdk "%" 0.7.1 "

c# - Alphanumeric not working with underscore -

I am using the following REGEX and what I need, only accept the following uncounted alphanumeric values ​​ 1. should not start with the number 2. Accept the underscores between the character 3. The value may be after the value For example aa_bb a1_a2 I tried with the following which is not working well: @ "^ [a-zA-Z0 - 9] + (_ [A-zA-Z0- 9] +] * $ ", @ "^ [A-zA-Z] [a-zA-Z0- 9 _.] + \ S? $" Use this regex. < P> There are many flaws in your regex ^ [a-zA-Z0- 9] + will allow numbers to begin the test string. There is no space in the end so it will not allow space. Demo here:

jQuery not working, one library working at one time -

I am using jquery Auto complete widget which is using 2 jquery libraries. I have to use another code of jquery as follows: jQuery (document) .ready (function () {$ ("# id"). ('Focus', function ( ($ '(' Html, body '). Chetan ({' scrollTop ': $ ("# div"). Position ()}}}}}};}); For this, I have to add another library of jquery. But using this library, the complete widget stop is working. I have tried jquery noConflict, but no success Is not. You call the so-called jQuery You can try to noConflict mode, before it any other jQuery call: var $ = jQuery.noConflict (); < / P> Also provide more information about errors and other libraries if this solution does not work for you.

asp.net mvc - MVC Razor over ASPX -

I'm new to MVC, an MVC application that I'm working on which uses the espx engine ( The scene is created in ASPX) Now the GUI of the application needs to be migrated and I read on that razor provides the benefit on the aspx engine, which is why the implementation Is better for However, I am more concerned about the application's Display and its Maintenance . So, would anyone please tell me which one meets the requirement? You can mix razors and ASPX in a project, but you can reinstall the master page from ASPX Can not use a razor layout page (at least AFAIK without some trick) Therefore use ASPX on the basis of additional additions to the size of existing applications and to convert existing pages to razors or to continue. For reasons of maintenance I personally do not mix two in the same application. Updates after the comment: The 1000 screen is definitely no longer the size of the IMO, but if you are not using layouts and / or master pages You c

Vim neocomplete auto suggestion -

I am using the insurance planning full plugin. How is the suggestion for neocomplete between auto-string work? def machine_share (): pass Now, if I type share , I'll automatically suggest the machine_share How can I do the job? Note: From auto suggestion, I mean integer. Full of the type that accepts text If the neocomplet The plugin allows to integrate custom completion (I do not know there is a plugin) , you can do this if it only supports 'FullFunction' , then you : setffc = BidiComplete # BidiComplete Otherwise, / P>

c# - ContinueWith loses the SynchronizationContext -

In the snippet below, SynchronizationContext is lost, and this also causes current culture < / code> and current uk agriculture . Comes from log () . Public async Tasks & lt; ActionResult & gt; Index () {log ("before GetAsync"); Wait for the new HTTP client (). Continue GetAsync ("http://www.example.com/"). (Request = & gt; {Log ("Continue"); Request.InstructiveStatusSod ();}, Task Continuation Options. Attachtipant); See Return (); } Fixed zero log (string message) {var ctx = System.Threading.SynchronizationContext.Current; System.Diagnostics.Debug.Print ("{0}; Thread: {1}, Reference: {2}, Culture: {3}, Native Language: {4}", Message, System Threading Thread.Centrethread.ManagedTride, Ctx! = Null? Ctx.GetType () .name: string.optim; system threading thread.contentrath.contentculture.Name, system threading thread.contentthread.correntcurrent.name); } This output is: before GetAsync; Thread: 56, Reference: ASPNe

java - how to bind field to foreign key in bean vaadin -

I have my sister as this public class registration entity {Private long account Number; Private string first name; Private string middlename; Personal string last name; // Business Unit is another table, the professionalism of personal business; } components are like this first name = new textfield ("first name"); FirstName.setRequired (true); FirstName.setWidth (COMMON_FIELD_WIDTH); LastName = New TextField ("Last Name"); LastName.setRequired (true); LastName.setWidth (COMMON_FIELD_WIDTH); Business = new basic selection ("business:"); Occupation.setRequired (true); Occupation.setImmediate (true); Occupation.setWidth (COMMON_FIELD_WIDTH); Occupation.setNullSelectionItemId ("- Select--"); Occupation.addItem ("static"); As long as the first name and last name are assumed, this can be bound in such a way fieldgroup.bind (first name, "first name "); But how can I force business resident to occupationEntity ??

c# - Unable to move ASP.NET Identity model into another assembly -

I tried to follow the steps described in this link to exclude my identity class from our own web application Class Library I do this: Created a web project and named it 3TierExample . New class class library named <3> TierExample.Model was created. The new code library (3TierExample.Model) > / Li> <> 3TierExample <3> in <3> TierExample.Model < For code> identityModel.cs I use the following references: Microsoft. Espenet IDENTITY; Using Microsoft.AspNet.Identity.EntityFramework; Using Microsoft.Owin.Security; Using System.Web; Using the system; _3 Tireexplex Using Models; My name is as follows: Namespace _3 Tiwari example. Model {â ?? |} However I find that I get the following errors: I: .. \ 3TierExample \ 3TierExample \ Default.aspx: asp.NET Runtime Error: The explicit definition of the assembly located in one of the files or assemblies 'Microsoft.AspNet.Identity could not be loaded core, versio

Django video streaming and Safari HTML5 canvas -

I'm streaming smaller videos from the demo view: def (request) : ['Content-type'] = 'video / mp3' response ['content-length'] = OS (file-name = settings.VIDEO_URL + extra_path wrapper = FileWrapper (file (file name, "RB")) response = HTPRPS.png .path.getsize (filename) return response and the html code like this: Everything is fine, but I can see the picture above the video frame in the canvas There is a need to get video screenshots from JS to create. I am using: var video = document.query selector ('video'); var canvas = document.getElementById ( 'Canvas-bg'); var reference = canvas.getContext ('2d'); var w = canvas.width; var h = canvas height; Context.fillRect (0, 0, W, H); Context.drawImage (video, 0, 0, W, H); It works well in Chrome, but after context.drawImage (...) I'm always getting blank reference in Safari. Before I use phage scripts for the DNS, like to: & lt; Source type

python - Py2exe Error creating exe - Directory -

So I'm just trying to create an exe from a simple Hello World program using py2exe. I have created the setup code (setup.py) with the following code: import distutils.core import py2exe setup (console = ['hello.py']) (I have tried setup (console = [{"script": 'HelloOop'}] as a suggestion I run CMD as an administrator and type C: \ python27 \ setup.py py2exe Then it says: Error: hello.py: No such file or directory I have a hello.py file in the same folder As the setup file is viewed on many different forums and py2exe tutorials and there was no answer, any help would be greatly appreciated. You must first navigate to that directory and call then Python: C:> CD C: \ python27c : \ Python27> Python Setup Py py2exe Note: Your HelloOP script should also be in the C: \ python27 directory.

javascript - php jquery voting system -

I am trying to implement a simple voting system. My page has a list of promos, people can vote Are there. I like a voting link - & lt; Button rel = "promo_vote" id = "promo_vote! After clicking on it, the data will be filled in the database for that particular promo and I used a button style to use it as a voting counter. I'm trying to increase its value dynamically. The DB entry is going on completely but the counter does not increase. It seems that this button is not able to recognize. Show me your jquery code. $ ("[rel = promo_vote"]. Click (function () {var p = jQuery ( this); var id_vote_promo = p.attr ("id"); var post_id_of_promo = id_vote_promo.substring (id_vote_promo.indexOf ('!') + 1); var datestring = 'post_ id_of_promo =' + post_id_of_promo; var id_unvote_promo = "promo_unvote! "+ Post_id_of_promo; var vote_counter_id =" #vote_counter! "+ Post_id_promo; var value = $ (vote_counter_id

Structure representing time without date in Python -

What is the Python data structure to represent only hours and seconds without any other information, if not use In my case what is the best structure to do Why not only datetime Use module and attributes for its relevant: datetime import datetime from my_time = '05: 43: 34 'my_time = datetime.strptime ('% H:% M:% S ', My_time) Then you just Ace They can work: gt; & Gt; & Gt; My_time.hour 5 >> & gt; & Gt; My_time.minute 43 & gt; & Gt; & Gt; My_time.second 34

php - locate invisible utf8 characters in mySQL database -

I have a database where I got inside non-UTF 8 characters inside some fields. In fact, if I edit the field value with phpmyadmin, copy the value of the field, paste it on notepad ++, and change the encoding, give me this character ÃÆ'à ¯ € ™ Ã⠀ šÃ, » look, while there is nothing if I change the charset for the URF 8 no bomb. I need to find and find all ANSI visible characters in my SSL table, suppose that these characters should only appear if I paste the value of Notepad ++ < P> Please, if anyone's idea, anything is apreciated. This question is related to this problem: You can try it : Select * from the table where the field name regexp '[^ -]];

Viewing Sitecore DMS profile key values for individual visitors -

In fact this is really a simple question, but I can not get an answer here or on the SDN. How do I view stored profile values ​​for users coming to the site? To elaborate as an example: Tell me that I have 3 visitors, by visiting the site, and at some point a newsletter item is clicked on them and thus their Email has been added to their asp session ID, so I User1@email.com and attached ASP session ID User2@email.com and attached ASP Session ID User3@email.com and attached ASP session ID now states that User1 @ Email dot com I have a main interest in Motorcycles , and I have a set of profile keys , which includes cars, motorcycles and bikes, User1 mostly clicks on motorcycle pages and therefore This key for this user is a high value. Anywhere I should be able to see that user data, with their stored value (Example Data: Car 10, Motorcycles 250, Bike 40) Where can I see that data? Or is it completely impossible? The information that you are looking for (AS

oop - Define a C++ class in 2 cpp files? -

Can I declare my class in 1 class and define 2 different CPP files? (like C #) The main reason is that I now have BTW all my headers "protected" to reduce the line number definition of my class in a single file. "+" Pragma onced ". Header: "foo.h" #pragma once #ifndef FOO_H_2014_04_15_0941 #define FOO_H_2014_04_15_0941 Square CFoo { Public: int plus (int a, int b); Int sub (int a, int b); }; #endif Source: "foo.cpp" #include "stadafx.h "#include" foo.h "Int CFoo :: add (int a, int b) {return a + b; } and "foo2.cpp" #include "stadafx.h" #include "foo.h" int CFoo :: sub (int a, int b) {return a - b; } When I try to find a compiler error in the second CPP file "source file stdafx.h" (also "foo.h") can not open Yes you can. stdafx.h is a precompiled header file. This is a conference of Visual Studio, to optimize compilation, to

c# 4.0 - How to retrieve specific value from XML document in Windows Phone -

How to get the specified value from XML documents Here is my XML document How do I get the "Name" node value that is "ABC"? you XDocument / XElement var doc = XDocument.Parse ( @ "& Lt ;? xml version =" "1.0" "encoding =" "UTF-8");?;? Root = gt; & lt; line & gt; & lt; id & gt; 22608 gt; & lt; name & gt; ABC & lt; / name & gt; & lt; / line> & lt; root & gt; "); Var name element = doc.Root.Element ("line"). Element ("name"); As a side note, you should stay in the Naming convention. Either start all the elements with a single letter or use all lower letters, but I recommend not mixing them according to your example. If you have a naming convention then you only have to remember the name of the element and Not even the cover. Since the name is not checked until the time of continuous naming convention, you will be saving a lot of debu

python - Returning yield of lambda within iter -

f = open ('c: \\ पायथन 33 \\ text file.txt', 'r') सी में आईएआरआर (लैम्ब्डा: एफ। रीड (1), '\ n'): प्रिंट (?) मैं कैसे मान मुद्रित करूँगा जो लैम्ब्डा: एफ.ड्रेड (1) पैदावार कृपया? बस सी प्रिंट करें । ऐसा करने के लिए आप अपने कोड के लिए iter () से प्राप्त कर रहे हैं। f = open ('C: \\ Python33 \\ text file.txt', 'आर') के लिए आईटर (लैम्ब्डा: एफ। रीड (1), '\ n'): प्रिंट (सी) छोटे सुधार सुझाव, स्थान का उपयोग करें: खुले के साथ ('सी: \\ पायथन 33 \\ text file.txt', 'r') के रूप में एफ: सी के लिए आईटर (लैम्ब्डा: एफ.्रेड (1), '\ n' ): प्रिंट (सी) इस तरह आपको f.close () ।

C# regex definition -

Still there are problems in implementing the regex syntax - and in some languages, using different dialects does not make things easy . I want to delete all links containing CID (whatever), replace them with empty string. So I defined: personal reggaege regex = new Regex ("& lt; a href = \" cid: {[a-f0-9 -] *} \ "& gt; [^ & Lt;]) & lt; / a & gt; "); and went for a replacement: html = regex.Replace (html, ""); But for some reason, my reggax does not work. The result is still included: & lt; A href = "cid: c524ae03-7ac7-4823-9a28-af17a6acf12f" & gt; Test.txt & lt; / A & gt; I also tried the following: New Reggae ("& lt; a href = \" cid: [a-f0-9 -] * \ "& Gt; ([^ & lt;]) & lt; / a & gt;"); New Reggae ("& lt; a href = \" cid: {([a-f0- 9-] *)} \ "& gt; ([^ & lt;]) & lt; / a & gt;") ; New Reggae ("& l

ruby - Test Driven Development with RSpec -

I'm new to testing and I need to add code in the code file so that the test specification file passes I wrote a comment in the code file, where I think the test should be written, but how do I write them, so that they pass? My spec code looks like this: "wad_TIM_00_gen" module is required ImpossibleMachine # Input and Output Constants Processed by Sub-Processes DOWN_ARROW = 1 UP_ARROW = 2 RIGHT_ARROW = 3 REPEAT_ARROW = 4 END_PROCESS = 5 START_CURRENT = 6 # Describe the description of the RSPEC test, before the # "start up impossible machine game" (: each) do @process = [] @output = double ('Output'). As_null_object @game = Game.new (@output) End it "Send Welcome Message" to @ @ @ output.should_receive (puts) .with ('Welcome to Impossible Machine!') @ Game It starts with the "initial message" do @ output.should_receive (puts) .with ('the game is starting ...') @ game.start and end << / >> <

how can I convert xsd: pattern in java regex -

As I know, and I've used very little Java regex, a method for converting a control xsd ( Or tool): The pattern in Java regex My XSD: The pattern is as follows: & lt; XSD: Pattern value = "[a-zA-z] {6} [0-9LMNPQRSTUV] {2} [a-zA-z] {1} [0-9LMNPQRSTUV] {2} [a-zA-Z] { 1} [0- 9 LmNPCRSTUV] {3} [AZA-ZED] {1} "/> & Lt; xsd: pattern value = "[0- 9] {11,11}" /> & Lt; / XSD: Ban & gt; & Lt; / XSD: simpleType & gt; You can load XSD in Java and remove the quote. First load the XML program you need in the Java program (I called it CodexSchema.xsd ): DocumentBuilderFactory factory = DocumentBuilderFactory NewInstance (); DocumentBuilder Builder = Factory.Nude DocumentBluilder (); Document source = builder.parse (new file ("CodexSchema.xsd")); After that you can use XPath to find the patterns you want to remove (you want to create a method that takes simple type of name, if You have several procedures). To avoid reg

c# - Preventing page from refreshing aspx.net -

मेरे पास एक एएसपीएक्स पेज है: & lt;% @ पृष्ठ भाषा = " सी # "कोडबेहिन्ड =" xxxx.aspx.cs "इनहेरिट्स =" xxxx "% & gt; & Lt;; DOCTYPE HTML PUBLIC "- // W3C // डीटीटी एक्सएचटीएमएल 1.0 ट्रांसक्रिप्शन // एन" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; html xmlns = "http://www.w3.org/1999/xhtml" & gt; & lt; head id = "head1" runat = "server" & gt; & Lt; title & gt; ड्रॉपडाउनलिस्ट ऑन-चुने गए इंडैक्स परिवर्तित ईवेंट का उपयोग कैसे करें & lt; / title & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; form id = "form1" runat = "server" & gt; & Lt; div & gt; & lt; h2 शैली = "रंग: लाल" & gt; ड्रॉपडाउन सूची: ऑन-चुने गए इंडेक्स बदल गए & lt; / h2 & gt; & Lt; एएसपी: लेबल आईडी = "लेबल 1" रनैट = "सर्वर" फ़ॉन्ट-बोल्ड = "सही" ForeColor = "डोडरब

No active members in the cluster group in tomcat -

I am doing a simple cluster configuration in two diff machines tomat servers, every time I am starting the clamp, There is an error like active members in the group. I'm attaching the cluster configuration & lt; Cluster classname = "org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions = "8" & gt; & Lt; The termination of the manager's classname = "org.apache.catalina.ha.session.DeltaManager" ends on: Shutdown = "False" Aligns = "True" NotifymentArticles = "True" /> & lt; Channel classname = "org.apache.catalina.tribes.group.GroupChannel" & gt; & Lt; Membership classname = "org.apache.catalina.tribes.membership.McastService" address = "111.222.222" port = "64222" frequency = "500" droptime = "3000" /> & Lt; Receiver Classname = "org.apache.catalina.trics.transport.nio.NioReceiver" address = "Aut

javascript - Drag and Drop Angular File Upload with Relatively Positioned Elements -

I have a problem with the filename upload, my drop target is being used with relative position elements 100% Width and height, is located exactly if you drag the file to any non-relatively located element, the overlay looks ok and everything works even though if you drag it to a relatively position then this drag event is not registered. Does. The reason for this is that the relative elements are visible at the top of the dropieria. I have tried to put a drop-target to the z-index, and drag and drop works great, but then I can not click anything HTML & lt; Html & gt; & Lt; Top & gt; ... & lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "dropArea" & gt; ... & lt; / Div & gt; & Lt; Div id = "sitecontent" & gt; & Lt; Div class = "row" & gt; & Lt ;! - This element fails by dragging, because it is relatively condition - & gt; & Lt; Div class = "col-md-12" & gt;

args - Methods/functions in Java -

Guidelines were given with the code given to me: Java allows us to use methods / functions so that we can store the processes we can use. More than once, so I want to update your code where the normal tasks are done, it can be done in any method / function. Any idea how to do this? Package's fifth assignment; Public class arithmetic {public static zero main (string [] args) {// variable first number and second number int length = args.length; If (length! = 3) {System.out.println ("You seem to enter an int, int then, +, - sign an operation like x or /."); Return; } Int firstNumber = integer.parissant (args [0]); Int secondNumber = integer Paracet (Argos [1]); Int extra = first number + second number; Int minus = firstNumber - secondNumber; Int division = firstNumber / secondNumber; Int times = first number * second number; String arithmetic = args [2]; If (arithmetic.quilues ("+")} {System.out.println (Args [0] + + + Arg +2 + + + Arg + 1 + + "=" + Ex

xml - Parsing JSON with AJAX - show random item of the JSON and update after an amount of time -

I am able to parse AJON with AJAX, but at the moment it shows all names from JSON. I have only seen one name and after a while I want to see another one. Ajax code: $ (document)) .ready (function () {parseJson ();}); Function parseJson () {$ .ajax ({url: 'data / members.json', dataType: 'Jason', success: work) {succes (data);}, error: work () {window.alert ( "Error");}}); }; Function succes (dataObj) {var counter = 1; $ .each (DataSub Members, Functions (IndexData, Validata) {var html string = "" htmlString + = '& lt; Article class = "MemberInfu" Data-object = "' + Counter +" "& gt; ;; HtmlString + = "& lt; div class = '' & gt; & lt; p & gt;" + valueData.Firstname + "+ valueData.Surname +" & lt; / Div> "htmlstring + =" "; $ (" # member "). Attachment (html string); counter ++;}); } .append instead of using >. Se

javascript - Populate form text field with button image -

I have seen this question / answered here This essentially what I want, but Instead of the radio button I want to use my own images to use as buttons, so that you can click on the "tag" image and then it will become almost transparent or it will fill in the form field. For a search form, so that people can click on the button by saying "restaurant" and then it will fill in the farm field with the restaurant, they can still type in the main search field if They want, but to use it a little bit of guidance to users If there is any way, we can do this without javascript, but it is terrible but maybe I can not see it. Hopefully this is relatively simple. P> Thanks in advance Click! Enjoy :) HTML: & lt; Field set data-roll = "control group" data-type = "horizontal" & gt; & Lt; Div & gt; & Lt; img class = "stam" alt = "restaurant" src = "img1.jpg" /> & Lt; img class

ios - Shared tests in XCTest test suites -

I have a class that can be configured to do 2 different things I want to test both ways Class is the descendant of UIViewController and most configurations are in the interface builder. I have to verify that both storyboard views and their outlets are connected in the same way, but also to check for difference in behavior. I want to use the shared XCTest suite for this purpose. The purpose of one is to experiment with the left hand, while using an app for the right, both appear after one. The first one (right hand) triggers a segue for each other, the last one (left hand) should trigger a different segue. This is where it is different, for example. Now I want to verify seguoys with trials. I would like to create a BothHandSharedTests suite, which are used to verify everything used to see both the admin instance tests, however, BothHandSharedTests -Used test suite is considered as, which is clearly not. I have come up with these strategies: Heir to an Exist Expectat

Is there any simple way to add a prefix to each element of an array in C? -

I am solving the gray code problem. I created my argument using recursive call. Everything looks fine but I do not know how to prefix '0' or '1' for each element of an array. For example) prefix 0: {00, 01, 11, 10} -> {000, 001, 011, 010} or prefix 1: {00, 01, 11, 10} -> {100, 101, 111, 110 } contains # lt; Stdio.h & gt; #to & lt include, string.h & gt; # Include & lt; Math.h> Int grayCode (int list [], int bit) {int listLen = strlen (list); // Calculation of array length received INR revlist [] = {0}; Int newList [] = {0}; If (listLen & lt; pow (2, bit)) // If the received array length is less than 2 ^ bits, then proceed down. {For (int i = 0; i & lt; listLen; i ++) // Create a reverse order array {revList [i] = list [listLen - i]; } For (int i = 0; i & lt; listLen; i ++) // prefix 0 for each element of an array obtained, I know it does not work. How do i do it {List [ii] = "0" + list [i]; } (Int i = 0; i & lt;

r - How to collect the IDs of same group from one file and write it in second file? -

I have two big txt files. The first file contains two columns: Groups and id each group have different IDs. I want to collect all the IDs in each group in file A And I want to add them to B file. I have tried to use total () and merge () . But I was not sure that it was working correctly. Can anyone provide a good solution to this? The following is the structure of my files and desired output: File A Group ID A / B / CF1A / B / CF5A / B / Cf7a / b / cf6a / b / cf8e / ff1e / ff2e / ff4 . . File b group p / b / c ls a / b / c pr e / f sh e / f sh e / f gn. . Desired output: file B group ID PA / B / CF1 / F5 / F7 / F6 / F8 LS A / B / CF1 / F5 / F7 / F6 / F8 PR E / F R1 / R2 / R4 SHE / FR1 / R2 / R4 SHE / FR1 / R2 / R4 GN . You can do this dplyr like this library df.A & lt; - read.table (text = "group id a / b / cf1a / b / cf5a / b / cf7a / b / cf6a / b / cf8e / fr1 E / FR2E / FR4 ", Header = T, Sep =" ") DF. B & lt; - Read.table (tex

android - How to add edit in child view of every headerview in expandable list view -

Can anyone tell me that a edit button How to add headerview to expandable list view and when I click on that button's button button, will all hair values ​​related to that header be taken to the next activity? Thank you. Expandable list adapter list adapters; ExpandableListView expListView; & Lt; String & gt; ListDataHeader; Hashmap & lt; String, list & lt; String & gt; & Gt; ListDataChild; Protected void onPostExecute (string result) {if (Detaare == NULL; dataarray.length () == 0) {AlertDialog alertDialog = new AlertDialog.Builder (ExperienceDetail.this) .create (); AlertDialog.setTitle ("Experience Expansion"); String Message = "Do not Recover the Experience Details"; AlertDialog.setMessage (message); AlertDialog.setButton ("OK", New DialogInterface.OnClickListener () {click on Public Zero (DialogInterface dialog, int which) {}}); AlertDialog.show (); } Other {try {listDataHeader = New Arrestist & lt; String

How git stores snapshot -

GET, as stated, deltas but not snapshot . Now I have a very specific question. Let's say I have a code and it's master #include And then I'll just change it to an additional line and add another reverse call to the last line of the last # Include & lt; Iostream & gt; using namespace std; Zero swap (four * a, int i, et j) {int t = a [ii]; A [i] = a [ja]; A [j] = t; } Zero Reverse (four * A, int size) {for (int i = 0; i & lt; size / 2; i ++) swap (a, i, size-1i); } Int main () {int n; Cin & gt; & Gt; N; Four a [n]; Int k; Cin & gt; & Gt; K; (Int i = 0; i & lt; n; i ++) cin & gt; & Gt; A [i]; Reverse (A, N-Kashmir); Reverse (A + N-Kashmir, Kashmir); Reverse (A, n); For (int i = 0; i & lt; n; i ++) COAT & LT; & Lt; A [i]; Cout & lt; & Lt; Endl; } And then I commit it to the same branch ( master ). Now my question is, what does GIT Store really do not answer me? Snapshot I want to know whe

Does C# pass a List<T> to a method by reference or as a copy? -

इस सवाल का पहले से ही एक उत्तर है: < / P> 4 जवाब सी # में मेरे पहले कदम उठाते हुए दुनिया सी / सी ++ से है, इसलिए विवरण में थोड़ा धुंधला है। कक्षाएं, जहां तक ​​मुझे समझा जाता था, डिफ़ॉल्ट रूप से संदर्भ से पारित कर दिया जाता है, लेकिन उदाहरण के बारे में सूची के & lt; स्ट्रिंग & gt; और अन्यत्र शून्य डस्टफ (सूची & lt; स्ट्रिंग & gt; strs) {// स्ट्रिंग की सूची के साथ सामान} सूची से & lt; स्ट्रिंग & gt; Sl = नई सूची & lt; स्ट्रिंग & gt; (); // एक लूप आदि में अगला भरण सूची और उसके साथ सामान करें: डस्टफ (एसएल); क्या इस मामले में संदर्भ से पारित किया गया है या एक प्रतिलिपि बनाई गई है जिससे कि मुझे void DoStuff (रेफरी) के रूप में कार्यकर्ता कार्य को फिर से परिभाषित करने की आवश्यकता होगी वास्तव में स्ल पर कार्य करने के लिए और कोई प्रतिलिपि नहीं है इसे संदर्भ से पारित किया गया है सूची & lt; T & gt; एक वर्ग है, और सभी वर्ग के उदाहरण संदर्भ द्वारा पारित किए जाते हैं।

c# - What is the difference of Stream and MemoryStream -

stream and MemoryStream What is the main difference in C #? If I need to create a stream without a file, will I use MemoryStream instead? < "post-text" itemprop = "text"> memorystream goes out of the normal class stream . about from the stream : provides a general view of the sequence of bytes. This is an abstract class. So you can not create an example of stream . You must use one of the derivative classes, such as, etc.

javascript - Ajax returns proper repsonse but not displaying html -

I have a page where I am getting data from SQL database through a call through jQuery and Ajax . When the page loads, the script is getting data from the PHP file. Ajax is getting the right response (I can see it in firebug), but it is not displaying it in the form of HTML in the div. Franchise: & lt; Script src = "//code.jquery.com/jquery-1.11.0.min.js"></script> & Lt ;? Php foreach ($ news item as item):? & Gt; & Lt; Li style = "border-top: 5px solid # a1cb2f;" Class = "block" id = "post_ <" php eq $ $ item ['date_added']? & Gt; & lt; img class = "post_user_img" src = "& lt ;? Php echo "/userdata/profile_pics/".$item['user_img ']? & Gt; "> script type =" text / javascript "& gt; ; Function get_userdata () {user_id = "& lt ;? Php echo $ item ['added']]? & Gt; Var datastring = 'user_id =' + user_id;

javascript - Parse.com Facebook API logIn() method. Callback never gets called -

When my click handler is called the login () function on the client, then I have a fairy popup and a record in the user's archive But callback methods are never known, but callback methods are never called. Instead, I look at the following in the JS console Uncort Type Type: Null Parse -1.2.18. Min.js can not read the 'getTime' property: 3 Here is the code on my page the establishment of the FB API login method calling $ scope.signupFB = function () {Parse.FacebookUtils.logIn (empty, {success} (user) {/ / Can never get $ timeout (function () {$ rootScope.theUser = user; $ location.path ("/ properties");})}}, error: function (user, error) {$ scope.error = "User canceled Facebook login or not fully authorized.";}}); } A website "platform" is enabled in the FB app. Next time I tried I saw Unwanted error: setting AuthResponse is not supported in JS console. The problem comes from using the facebook api. Switch

java - Duplicated result on bolt reception of storm topology -

I am using a bolt which gets the template from another bolt (exclamatory bolt) and on file it Writes, the problem has been that I have repeated the result four times, as when I emit a word, I got the word written four times. Where can the problem possibly be? Public Class PrinterBoitty BaseBasicball {@Override Public Executives Zero (Tupal Tupal, BasicOutput Collector Collector) {try {BufferedWriter Output; Output = new buffed waist (new flamer ("/ root / src / debit-starter / hhttt", true)); Output.newLine (); Output.append (tuple.getString (0)); Output.close (); } Grip (IOException E) {// TODO Auto-Generated Catch Block e.printStackTrace (); }} @ Override Public Zero Disapproved OutputField (Output Field Declaration of D) {}} The solution was to specify 1 bottleneck in the main category: Builder.SetsPout ("spout", new randomseanspout (), 1);

php class inheritance - is it necessary to run constructor on parent(s) -

I'm trying to use OOP for my latest website. I am using the project to develop my understanding of this technique. First I was 'included' in a function folder that contains several php files, such as image .upload.functions.php and normal .error.handling.functions.php etc. However, this time I am using classes wherever possible. I have just read that in order to use a parent's methods (in an extended class) you should run the parent's constructor, but I have not done this and my project works fine Does. So .. I have a form called Form Validation, I have another class named Process Log, which extends form validation. My form validation class tests the strength of the password to make sure it is strong enough, check that a user is in database etc. I extend the form verification with a registration class and a forgotten passhold class. I should have felt: / P> parent :: _ construct (); .. In the manufacturer of each extended class? Did anyone

javascript - How to disable scroll up? -

I want to disable the scroll in my HTML document. how can I do this? I do not want to use this type: $ (window) .load (function () {var _top = $ (window) .scrollTop (); var _direction; var _stopScroll = true ; $ (Window) .scroll (function) {var _cur_top = $ (window) .scrollTop (); if (_top & lt; _cur_top) {_direction = 'down';} and {$ ("body") ScrollTop (90), // scroll} _top = _cur_top; console.log (_direction);});}); Thanks!

.net - Technical difference between web garden and web farm? -

In the case of hosting net on IIS 7, there is a need to know the difference between web garden and web form. Can anyone provide me information related to that? A web garden setting on IIS7 (covered here) to IIS one for IIS virtual directory More workers allow creation of processes when IIS calls more than one simultaneous call it creates the effect of scaling for a web form (where the virtual directory is present on many different IIS installations on separate boxes under an NLB) . Why is this important? If you codify your pure IIS code without any web garden in IIS, then you will not accept that you have mistakenly coded a "sticky" service with links between the client and the web service, usually the same Making misquoted cash or business calls on the server generates reliance on unexpected state. I instruct all my IT to be developed with the web garden for my local IIS so that they do not stumble into problems which hurt in an enlarged environment.