Posts

Showing posts from April, 2011

c# - Quick Filter in WPF ListView -

Our project has a quick filter option, when a user types, "test" in the text box means, It filters out the WPF ListView with the matching text on 3 columns (there are 7 columns in the view). The problem is, the list takes a little more time to filter the item item (say 3 seconds). And the user will have to wait to complete the filter for "T" to type the "A" unit. This gives a bad experience to the user. The list view should be used for the overview option & lt; SomeItemViewModel & gt; . I had a different dictionary & lt; String, string & gt; I tried to place the searchable column in , where the value 3 would be the string contex of the searchable columns, instead of searching each row from each column and Observable Collection, I used to match the dictionary value I can filter the record and fill the archive . This approach works a bit better, but is still not satisfactory. Any other approach? One option filtering must not

android - click listview item go->new activity? -

हैलो मुझे एक सूची दृश्य गतिविधि मिली सार्वजनिक वर्ग के टुकड़े गतिविधि बढ़ाता है {@ ओवरराइड संरक्षित शून्य ऑन क्रेट (बंडल सहेजे गए इन्स्टैंसस्टेट) {सुपर। कॉन्टेट (सहेजे गए इन्स्टेंसस्टेट); setContentView (R.layout.dersler); स्ट्रिंग [] myArray = getResources ()। GetStringArray (आर। अरे। डर्स्लर); ArrayAdapter & LT; स्ट्रिंग & gt; एड = नया अर्रे एडाप्टर & lt; स्ट्रिंग & gt; (यह, एंड्रॉइड। आर। लेट। सिंपल_लि_लि_ईटेम_1, मायअरे); setListAdapter (एएडी); } निजी शून्य सेट लिस्ट एडाप्टर (ArrayAdapter & lt; String & gt; aad) {/ TODO स्वत: उत्पन्न विधि स्टब}} xml कोड & lt; relativeLayout xmlns: एंड्रॉइड = "http://schemas.android.com/apk/res/android" एंड्रॉइड: layout_width = "match_parent" एंड्रॉइड: layout_height = "match_parent" एंड्रॉइड: अभिविन्यास = "ऊर्ध्वाधर" & gt; एंड्रॉयड: layout_width = "match_parent" android: layout_height = "wrap_content" एंड्रॉइड: layout_alignParentTop = "true&qu

internet explorer 8 - target=_blank doesn't work in IE8, running IEs side-by-side (I run the package of IEs via VirtualBox) -

IE8 can sometimes prevent links from spawn if they have target = _blank set. This problem is limited to the corrupted installation of IE, such as when installing multiple-versions side-by-side I have received an answer once, and hopefully it Will save somebody some time The answer to the answer is in the comments listed earlier. It depends on which IE8 alone you use. I have a problem using "Final Build site - Internet Explorer Collections" (1.6) version 1.6.0.3. The developer has fixed this bug as 1.6.0.4, and links with target = "_ blank" now work as expected.

Columns to Row in SQL Server without union -

तालिका #temp (tempid int, tempname nvarchar (50), option1 nvarchar (50), विकल्प 2 नर्वचर ( 50), option3 nvarchar (50)) #temp (tempid, tempname, option1, option2, option3) मान (1, 'हाँनोकैनल', 'हाँ', 'नहीं', 'रद्द करें') में सम्मिलित करें मुझे आउटपुट के रूप में tempid tempname विकल्प 1 'हाँ नॉनकैनल' 'हाँ' 1 'हाँनोकैनल' 'नहीं' 1 'हाँ नॉकैनल' 'रद्द करें' इस तरह की कोशिश करें SELECT t। * Temp OUTER APPLY (VALUES (Tempid, tempname, option1))

internet connection - Android: Force close the app in Application class -

I have a class that increases the application class. In this class I am checking Internet connectivity and calling the web service. The method I am using below is to check: The public static bullion is the Internet connect (reference macantax) {connectivity manager contacts = (connectivity) Manager) mContext .getSystemService (reference. CONNECTIVITY_SERVICE); If (connection! = Null & amp; (connec.getNetworkInfo (1) .getState () == NetworkInfo.State.CONNECTED) || (connec.getNetworkInfo (0) .getState () == NetworkInfo.State.CONNECTED)) {Back true; } return false; } When there is no internet connection, I want to close the application. How to do this I have an alternative solution if there is no internet connection, I can skip the API process and wait for the first activity to start and as soon as it starts it I can end the activity. Is it possible to do this in the application class? Why do you want to close an application? When there is no internet, you can

How can I prevent my javascript from polling websites too fast? -

Image
I created this website some time ago for the purpose of grabbing and displaying random puu.sh images. This is also a warning, the content that is generated by this site is generated, and I can not guarantee it to SFW. I have started to look at it again, and it seems that there is something in it with serious bugs with the system used to collect the content How can I change so that he can not spam puu.sh and refuse to accept it? Here is the code: var currentThumb = 0; Function getImgUrl () {var text = (Math. (Math.rendum (* 9)) ToString (); // var text = '3T'; var possible = "ABCDEFGHIKLMAPQRTUVXXBCCDGGLMNAPQRSUVXX123456789" (var i = 0 ; I & lt; 4; i ++) text + = possible.Chat (Math. Floor (Math.Random) * Possible length); Return 'http://puu.sh/' + Text;} Function Open_in_new_tab (url) {var win = window.open (url, '_blank'); win.focus ();} function getImages () {// var width = window.innerWidth; Var for picture = 10; var var = 0; i &am

jquery - SignalR: Cannot read property 'hub' of undefined? -

Image
I am trying to add signal R to my MVC application. Signal R is well loaded and in the right order < / P> But still when i $ I am trying to read Connection.hub.start () , I am getting this error down One more thing when I made the console.log ($ Connection) to Jquery.signalr * .js was found in the file $ .connection in the console sign you R may need to start callback after the load, especially when the script is loaded on to dynamically embedded in the document.

java - Primefaces Picklist Converter -

I am using PrimFace 4.0 and JSF 2.2. I used a picklist with the converter The problem is that I do not get the right arg2 in my converter, it always says 0 I hope this element's ID And I can parse it from the source / target list. any idea? Inspired by my converter . My picklist declaration is as follows: & lt; P: PickList value = "# {loadingPlaceGroups.pickList}" style = "margin: 0" var = "loading place" converter = "primetime pixelist converter" item value = "# {loadingPlace}" item label = "# {loadingPlace. Name} # {loadingPlace Location.address.street} # {loadingPlace.location.address.houseNr} # {loadingPlace.location.address.zipCode} # {loadingPlace.location.address.city} "showSourceFilter =" true "showTargetFilter =" True "filterMatchMode =" "style class =" picklist 500x350 eser picklelist 500x350 target "& gt; & Lt; F: Aspect Name = "Source Capt

c# - The type or namespace name 'Device' does not exist in the namespace 'System' -

I am trying to work whose purpose is supported by Net Framework 4.5. I'm working on Winodws 8 and I have the .Net Framework 4.5, but I'm getting the name of the type or name space 'device' namespace is not present in the 'system' error Any solution? type or namespace name 'XXX' Always keep in mind, if you get this error then there are three possibilities. You have not forgotten the instructions to use. / Li> You do not remember the assembly reference You have put "assembly reference" in place of "use of directing", but the goal structure of the current project is called assembly assembly reference Structure is less than version. The problem should be solved with almost all the cases above three steps. Hope it helps.

regex - remove exact match word from a string -

मैं नीचे दिए वाक्य में "amp" शब्द को निकालना चाहता हूं। मूल : x & lt; - 'आओ *** amp *** यह सिर्फ फुकेत के पहले से ही बड़े पैमाने पर गलत व्याख्या को प्रोत्साहित करती है' मुझे क्या चाहिए : x हालांकि, अगर मैंने gsub का इस्तेमाल किया है, तो "आम" के शब्द में "amp" को हटा दिया जाएगा जो कि मैं चाहता हूं कि ऐसा न हो। क्या मैं जान सकता हूँ कि इस मामले में मुझे किस फ़ंक्शन का उपयोग करना चाहिए? & gt; जीसब ("एप", "", एक्स) [1] "इस पर आते हैं, सिर्फ फुकेत का पहले से ही शेख़ी गलतप्रदर्शन को प्रोत्साहित करता है" आप इस regex का उपयोग कर सकते हैं: gsub (" \\ bamp \\ b "," ", x) # [1]" इस पर आओ \\ b शब्द सीमा का अर्थ है।

regex - How to build a Java regular expression pattern using variables -

Edit to help clarify the request: I need to create a Java Regular Expression pattern It contains three elements; A Reggex string was added with an integer variable with the end of the Regex string. Example HTML: & lt; Div class = "page" & gt; 1 & lt; / Div & gt; & Lt; Div class = "listItem" & gt; & Lt; A href = "this is / a-dummy-url-extension" & gt; I developed regedx patterns: int page = 1; Pattern p = Pattern.compile ("Page \" & gt; "+ Page +" Purpose: After reading the line according to the line using the methods given below, use the regex pattern to find the above HTML line. is not working right now. You can: string pattern format = "slider \ "& gt;% d & lt; / Div & gt; & Lt; Div class = \ "listItem \" & gt; & Lt; A href = \ "(. *?) \" & Gt; Pattern = Pattern.compile (string format (pattern format, 1)) Patt

cryptography - DES decryption in Windows Phone 8 -

I need to decrypt the DES code in my Windows Phone 8 project. I tried to use DESCryptoServiceProvide but I It seems that it is not available for Windows Phone 8 (though MSDN says this is). I also tried the Bouncy Castle Library but they also failed. Please suggest / help with any other third party DS decrypt library. You can try our free package SecureBlackbox Products - This includes the implementation of several encryption algorithms including DES And there are available legislatures for WP8.

php - Magento - Newly added products not showing -

I created a new product from the Magenta backend but it does not display itself under the relevant category or in the product page. If I type the product URL key then it goes to the 404 page. I This is just a simple product and I have checked the following, the product is enabled : Yes Visibility: List, Search Product Images: All good quantities available: 99 99999 Stock availability: Assign a category to the stock: Yes (I also went here to manage the category to see the products of the class and there Under products Products in Web Sites: Specified Cache: 10x Cleared Indexing: Completed I have done one thing which I did not have to do with the app / code / core / mage / catalog / model / category.php and getProductCollection () before the back $ store var_dump ($ Collection-> GetAllIds ()); Then I went to the category page and I can see all the product ID assigned to that category of var_dump output, but even then the new product was not there: ( Is this r

c# - Register and deregister an event with reflection in WinRT -

For my open source project, I am trying to implement a better page class for WinRT and WinPRT (8.1) . The square is located in a PCL library, this is why I have to register the backed-down event by reflection without the reflection code looks like this: using Windows.Phone.UI. Input; Namespace Sample Universal Phone App {Public Square Mycelace {Public Zero Start (HardwareButton. Backed + OnBacked;} Public Zero Stop () {HardwareButton. Backpoked - = On Backpress;} Private Zero OnBackpressed (Object Sender, BackPressedEventArgs E) { // TODO: Add more code e.Handled = true;}} } Now I need exact logic but due to reflection hardwarebutton < / Code> and BackPressedEventArgs classes are available to me ICL is not available in the library. I How can I do this? Here's a solution to this question: Public category MyClass {Personal object _backPressedToken; Private StaticType only to read _ HardwareButton Type; Private Static Readonly Event InfoBackPressAvent; St

java - Error: insert enum identifier and enum body -

This is my code, both syntax errors are more specifically on line 16 "private getTotalGrains (k, grains);" By reading other similar questions, can there be something to write the method inside any other method? If I do not think there is enough experience to see it, then it will be amazing. Import java.util.Scanner; Public square grains {public static zero main (string [] args) {{grain = new grain (); Grain.getTotalGrains (); } Int grain = 0; Scanner Keyboard = New Scanner (System.in); System.out.println ("How many days the program will run? Enter the number between 1 and 64"); Int k = keyboard.nextInt (); Private Milltotalgrain (K, cereals); {K = K-1; Grain = grain * 2; Do {getTotalGrains (K, Grains); } While (k == 1); {System.out.println (grain + "grain of rice."); } While (K & lt; 1); {System.out.println ("Invalid number please try again."); } While (k> 64); {System.out.println ("Invalid number please try again."); }}}}

.net - EventWaitHandle - multiple threads = inconsistent behaviour -

I am trying to set up some comics with a device where you can send commands and get a response Are there. However, I want to make sure that I control a timeout flag to prevent the waiting period of indefinite time. I have done something like this: Private volatile eventwhathand_ignal; Send Public Zero () {// Some _signal.WaitOne (30000); // continue with _signal.Reset (); } Get public null () {_signal.Set (); } My question is, if I have many threads (let's say 2 for this example) that method can send and use the following scenario: < P> Thread A: // Sends a "listen" command, but send no response (); Thread B: // Sends a "canceled" order and response (success) is received Send (); I get inconsistent results, that is, sometimes both threads are released when I get a response to the second command (cancellation) which I can understand, but sometimes sometimes Thread kills the timeout of 30000 - which I can not understand. Is it any

controller - Issue retrieving data with options -

I am using the following code to retrieve all messages with the same thread_id for a Customer Portal project. View public threads (thread_id = void) {if (& gt; message- & gt; exists ($ thread_id)) {throwing exception to new nautofoad (__ ('invalid message')); } $ options = array ('conditions' = & gt; array ('Message.thread_id' = & gt; $ thread_id)); $ Message = $ this- & gt; Message-> Search ('all', $ option); $ This- & gt; Set (compact ('message)); } Currently $ thread_id is set as an integer, although I would eventually like to use a random string. This works fine if the $ thread_id should also have the record ID in the message table 1 as seen in the table below, however, if the $ thread_id value does not match the record ID, then I Receives an error - '/ messages / view_thread / 5' did not find the server at even if a thread of 5 $ message in thread id thread_id topic 1 1 test message 2 1 re: te

c++ - Trouble calling the print function of a pointer -

I'm actually stumped from some homework. I'm working on I. I am working on a function called "boxFactory", which gives an indicator of the box base class in the test class. The test class calls the print function with that indicator. I'm trying to get check-box box printing before working on other types. However, when I run the code below, the exception is put on the BPTR-> print (OS) which reads: "Unwanted exception to the assignment on 0x0091C512: 0xC0000005: Location of access violation 0xCCCCCCD0 Read. " box * Boxfitcher (four c, int w, int h) {box * b; If (C == 'C') {checker CB; B = & amp; Cb; B & gt; SetHeight (h); B & gt; SetWidth (W); Return b; } Return tap; } code snippet from the test class: box * bptr = boxFactory ('c', 5,3); // check print # 7 os.str (""); // Reset Output Holder BPTR- & gt; Print (os); T.test (os.str () == "xx x \ nx x \ nx x x \ n", "print 5x3 che

jquery - Calling a controller function through a button -

I have a problem using Symphony 2 and requests I am reading some docs but it only confuses me Can you clear this easy thing for me? Thank you. I am creating a website with some articles that a user can add to their favorites. All institutions are fine, mapping and base too. I just have problems in front I want a button on the article page that calls a function in my controller (which says the correct repository method) and does not refresh the page (This is why I can not only use PHP If the call works then I am thinking about changing the button color. What do you use for this? Thanks You want to use here, jQuery is . The U needs a route in context: / * * * @ Root ("/ do_something", name = "your_action_route") * / Public function doSomethingAction (Request $ request) { And then you can script ad JS in your twig template: $ (document) .on (click) ',' Button ', function () {$ .ajax (' {{path ('your_action_route')}},

java - How I can do this using navigation drawer? -

Image
How can I do this please help me? This is using the navigation drawer list view with sub items. How can I do this? < Instead of a simple list view in the navigation drawer, you have to use the detailed list view - div class = "post-text" itemprop = "text"> You can follow this tutorial to get the basic idea

gnu - Makefile Secondary Expansion -

Manual Section 3.8 says: "During the secondary expansion of clear rules, $ Assess $ @ and $$% , respectively, for the target's file name, and when the goal is a collection member, the name of the target member. $$ < / Code> variable reviews the first condition in the first rule of this goal. Evaluate the list of all the necessary conditions for the $$ ^ and $$ + rules Same goal from (without $$ + duplication and $$ ^ ). The following examples will help clarify these behaviors: < Code> .SECONDEXPANSION: foo: foo.1 times.1 $$ $ <$$ ^ $$ + # line # 1 foo: foo.2 bar.2 $$ <$$ ^ $$ + # line # 2 foo: foo.3 bar.3 $$ <$$ ^ $$ + # line # 3 In the first condition list, all three variables ($$ & lt; $$$, and $$ +) expand to empty string. " My question: why $$ Extension in empty string? The above paragraph says that its goal should be first for the first rule of this goal. Will this not be a fuo? Manual misleading, possibly due t

Spring Bean with Factory Method from XML to Java Config -

अनुवाद यह बीन का सही तरीका कौन सा है: & lt; बीन आईडी = "VelocityEngine" class = "org.springframework.security.saml.util.VelocityFactory" कारखाने-विधि = "मिलेंगेंइन" / & gt; एक्सएमएल से जावा-कॉन्फ़िग ( कारखाने-विधि पर ध्यान दें)? क्या निम्न समाधान सही है? < पूर्व> @ बीन सार्वजनिक वेलाकीइंजिन veloctyEngine () {वापस VelocityFactory.getEngine (); } क्या स्प्रिंग-दर्शन के अनुसार बेहतर कार्यान्वयन है? चीयर्स, वी। जिस तरह से आप ऐसा कर रहे हैं वह सही लगता है। ब्लॉग पोस्ट देखें।

Dereferencing arrays that contain pointers in C -

I wrote a program that included two rows of integers which used to swap from time to time. Therefore, what I did was allocated to two different pointers that would display the required rows. I then placed both pointers in a static indicator array which would easily facilitate swapping. The problem I have is by mistake, for example, take it: #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; Int main (zero) {char * a = malloc (size of (four) * 5); Char * temp [] = {a}; Int i, h, k = 'a'; For (i = 0; i <5; i ++) a [i] = k ++; For (i = 0; i <5; i ++) printf ("% c", temporary [0] [i]); Free (a); Return 0; } with output: abcde I accidentally use the members of the array contained within the static array by dereferencing the second order I tried: "[] []" I did not feel much about this incident because everything was compiled and ran completely, even in the production of expected results for. The problem came when I

ios - how to make uiviews only rotate (transform) when orientation changes? -

I'm looking to implement the same behavior as the iOS camera app. When orientation changes, thoughts and controls only roam in place, but keep the same situation. I have tried to set this type of position - (zero) Will Animatoration interface orientation: (UINFF) orientation operator period: (NSTEEInterval) period {CGTT Newbottom Control Foam; CGRect newTopControlsFrame; If (UIInterfaceOrientationIsPortrait (toInterfaceOrientation)) {CGFloat screenHeight = fmaxf (self.view.bounds.size.height, self.view.bounds.size.width); NewBottomControlsFrame.origin.x = 0; NewBottomControlsFrame.origin.y = ScreenHight - 70; NewBottomControlsFrame.size.height = 70; NewBottomControlsFrame.size.width = 320; NewTopControlsFrame.origin = CG pointmake (0, 0); NewTopControlsFrame.size = CGSizeMake (320, 50); Self.bottomControlsContainer.frame = newBottomControlsFrame; Self.topControlsContainer.frame = newTopControlsFrame; NSLog (@ "Frame:% F,% F,% F,% F", Newbottom Controllsframe.org.x,

c++ - Contents of an untyped object copied into vector -

I am trying to write content of an intermediate object which keeps the images of an image in a vector filled with unsigned characters . Sadly, I can not get it to work, maybe someone can tell me in the right direction? What's my time here: vector & lt; Unsigned four & gt; SQLiteDB :: BlobData (int clmNum) {// I get data of image configuration zero * data = sqlite3_column_blob (pSQLiteConn-> pRes, clmNum); Vector & lt; Unsigned four & gt; Bytes; // Image size changes in bytes int size = matching (clone); Unsigned four b [size]; memcpy (b, data, size); For (int j = 0; j and lt; size, j ++) {bytes. Push_back (b [j]) m) return bytes; } If I try to find the contents of the bytes vector then all this is empty. The question is, how can I get data in vector? You should use the vector constructor, which takes some of the rockers: < Pre> constant unsigned char * data = static_cast & lt; Kong unsigned letter * & gt; (Sqlite3_column_blob (p

html - How to properly scroll IFrame to bottom in javascript -

For a fake-webpage used to research interactions on websites, I used a javascript to send a mockup message -Stream made This message stream is loaded in an iframe and should show images at pre-determined intervals and by placing a new image on the bottom of the page, scroll down to the bottom of the page. The images are working very well with the available script to display. However, both Chrome and IE have trouble scrolling down the page. As soon as the image is attached, I would like to scroll down to the bottom of the page, but now it has added a delay of 5 miles because it seems that sometimes my questions are: Is it okay to use document.body.scrollHeight for this purpose? Can I scroll straight away, or do I need a small gap before scrolling? After adding an image, how is the code to scroll down to the bottom of the iframe? The following function is used and trypost () starts onLoad: function scrollbotm () {window.scrollBy (0, document .body.scrollHeight); } Functi

Executing mount command from java / Child Shell cannot access the mounted directories -

I have a dragon script, which needs to be executed with a Java code. I use the following command: ScriptResult Results = Executor. ExecuteCommand (script, params.getParams (), incorrect); But the executor. executeCommand () A new shell fork I had previously run a mount command and the contents of / mnt / folder1 are accessible from the parent shawl but are not available from the new ignored hair shell. string cmd = new string ("/ bin / mount ") I have tried to execute the mount command, just before the executor. Process P = New Processor Builder (CMD). Start (); and string to executeCommand () Ip: / folder1 / mnt / folder1 " CMD = new string ("mount"); string [] arg = new string [] {"ip: / folder1," / mnt / folder1 "}; Process RR = Runtime.Greatantum (). Exec (cmd); Both give the following error: java.io.IOException: "mount ip: / folder1 / mnt / folder1" did not run the program Can be: error = 2, by processing ma

c# - Join clause incorrect on multiple join LINQ -

I have a similar match query like this: public static list & lt; Answer & gt; GetDetailedAnswers (string tag) {usage (database db = new database ()) {list & lt; Answer & gt; Answer = Question by searching in DB. Join Questioner in DB Answer on search. The id is equal to equal. Joining the dealer in dealer DB. Reply on Deaddler. DialerID deal is equal. To join DB in IT. Country on the deal. Area ID is equal to country. Where to search Basic Inquiry == Select the tag new {ParentSection = quest.ParentSection, Section = quest.Section, Dealer = Dealer.Name, Basic Answers = answ.Original, EngAnswer = answ.English, Region = country.Country}. ); Answer to return; }} and I have such an internal range: public class answers {public string generator information {received; Set; } Receive the public string stream { Set; } Public String Dealer {get; Set; } Public String OriginalAnswer {get; Set; } Public String EngAnswer {get; Set; } Receive public string field { Set; }}

php - How to make row have 4 products instead of 3 on Magento categories page -

I'm new to Magmento. I am trying to replace one of the 3 products with the line layout for 4 products in each line layout. I am searching but I can not find any solution. Here is my closest approach: I have set "app / design / frontend / default / mimate template / template / catalog / product / list.file" and "$ _columnCount = 4". The problem is that I still receive 9 products every single time, so I get 2 rows with 4 products, but the last one has only 1 product. Any help would be appreciated. thank you in advanced. You can set the number of columns through layout / catalog.xml Find the line that looks like this: & lt; Verb method = "set columncat" & gt; & Lt; Columns & gt; 4 & lt; / columns & gt; & Lt; / Action> Change the value of 4 to 3.

What's the fastest way to run T4MVC manually in VS 2013? -

I'm working on a large project which uses T4MVC due to project size, run my T4MVC template It takes a lot of time, therefore the use of AutoT4MVC for my scenario is very slow. So every time I make some significant changes about my methodologies, I have to select the T4MVC template , Right-click on it, and then clicking on "Run Custom Tool" Not. It's quite tedious and I'm sure that's a better way. Since the OT4 MVC is not an option, is there a plugin or hack that allows me to put a button on my IDE which will run the T4MVC template included in my project? There is a menu item under Build - & gt; Convert all T4 templates will run all the templates in your solution. This command is also available on the Build Toolbar, so if you turn on it (see -> Toolbars - & gt; Build) you will get the button you are looking for.

php - How to send a form on a distant API using symfony2 forms -

I created a bundle of all the webservices in my Simply 2 project which used to save my files in the cloud (eg That Amazon S3). Some of these webservices allow files to send files directly without using them: & lt; Form action = "api.thecloud.com/specificId?reirectUrl=MyUrlToGetTheResponse" & gt; & Lt; Input type = "file" name = "file" /> & Lt; Input type = "submit" / & gt; & Lt; / Form & gt; The given redirectUrl perm allows me to get information from the upload and save it in my database. My problem is that I want to make it transparent and adaptable to other bundles, such as with the standard Symphony form type. Is there a good way to do this? The solution I found is a bit complicated and I think there is a cleaner way to do this: I make a type of type that specifies the action URL: public function buildForm (formbuilder interface $ builder, array $ option) {$ builder- & gt; Add ('file&#

android - How to access the variables of a function of a class from another class in Java -

कॉस्ट लैट लोक कोड.जावा सार्वजनिक वर्ग CustLatLongCo आदेशों का क्रियान्वयन कार्य करता है LocationListener {LocationManager locationManager; स्थानलिस्टर स्थान स्थानक; स्ट्रिंग लैट; स्ट्रिंग प्रदाता; स्ट्रिंग समिति; स्ट्रिंग src लाँगलिटी; संरक्षित बूलियन जीपीएस_अनैशल, नेटवर्क_अनुक्रमण; @Create पर सार्वजनिक शून्य को ओवरराइड करें (बंडल सहेजे गए इन्स्टैंसस्टेट) {सुपर.नक्रेट (सहेजे गए इन्स्टेंसस्टेट); setContentView (R.layout.activity_main); LocationManager = (LocationManager) getSystemService (प्रसंग .LOCATION_SERVICE); LocationManager.requestLocationUpdates (LocationManager.GPS_PROVIDER, 0, 0, यह); } @ ओवरराइड सार्वजनिक रिक्त स्थान पर स्थान परिवर्तित (स्थान स्थान) {// TODO स्वतः व्युत्पन्न पद्धति stub srcLatitude = location.getLatitude () + ""; srcLongitude = location.getLongitude () + ""; } @StatusChanged (स्ट्रिंग प्रोवाइडर, इंट स्टेटस, बंडल एक्स्ट्रास) पर ओवरराइड पब्लिक व्हाईड {// TODO ऑटो-जनरेटेड विधि स्टब} @ProviderEnabled पर सार्वजनिक ओवरराइड सक्षम करें (स

.net - Regular expression with delimiters -

I would like to use a regular expression in a string like .NET, which has a format where the delimiter '< / Code> Values ​​and separators are and values: 'A $ 04' and 'A & amp; Amp; & Amp; 585262 & amp; YY '& amp; ; 05555 ' The problem I get is that the separator & amp; can also be displayed inside each one value. Would you please do me without using a loop? I tried some regular expressions but were not successful. Try '[^'] + '(& Amp;; [^ '] +') * It should work till you can aprophrase in your fields. Note that I think your fields can not be empty - change + to handle this case * .

c++ - Sorting a map with unknown keys by value -

मेरे पास निम्न शैली में एक नक्शा है: mapa ["01"] = 2 नक्शा ["111"] = 3 यह दिखाता है कि पाठ में प्रत्येक उप-स्ट्रिंग कितनी बार दिखाई देती है (पाठ में 1s और 0s होते हैं)। अब हम कहते हैं कि मैं 10 सबसे अधिक बार उपयोग किए गए उप-स्ट्रिंग्स को आउटपुट करना चाहता हूं, मुझे मानचित्र में सभी चाबीओं के माध्यम से जाना होगा और उन सबसे बड़े मूल्यों के साथ मिलना होगा (मूल्य, उतरते)। कोई छद्म कोड या आज्ञाओं का उपयोग करना चाहिए? अगर यह आपके लिए किसी भी उपयोग का है, तो मैं कार्य पर काम कर रहा हूं और मुझे सभी मान मिल गए हैं, मुझे नहीं पता कि उन्हें कैसे सॉर्ट करना है। / p> इसे देखें, आप मूल रूप से मानचित्र को पुनरावृत्त करें और मान पर std :: partial_sort का उपयोग करें। typedef std :: जोड़ी & lt; std :: string, int & gt; mypair; संरचना इंट्रकम्प {बूल ऑपरेटर () (कॉन्स्ट माइपेयर एंड एलएचएस, कंट माइपेयर एंड आरएचएस) {रिटर्न एल एच। सीकंड & gt; rhs.second; }}; शून्य प्रिंट 10 (const std :: map & lt; std :: string, int & gt; और mymap) {std :: vector

SQL query with variables in python -

I am creating a program that is a user interface for quizes fixed by teachers in a primary school. I'm trying to use the data typed by the user on the previous page. It is searching for people in the database that match the related user name and quiz number. This is because the teacher can see how well the students are doing on some poems. This is my code. dbDatabase = sqlite3.connect ('c: \\ xampp \\ cgi-bin \\ Makingableable.db') cuDatabase = dbDatabase cursor () Fieldstorage = cgi.FieldStorage () # Quizno = Fieldstorage.getvalue ("quizno") typed on the webpage executable for UserID = Fieldstorage.getvalue ("username") # print (Quizno) # print (UserID) in cuDatabase (line) in CuDatabase (from "result" As a result, WHERE QuizID = '"+ + str (Quizno) +" "" and UserID =' "+ UserID +" ''): Print (line) DbDatabase.commit () cuDatabase.close () < / Pre> I'm getting the error message

api - Venue/search endpoint not expected results -

Can you help me with the square API? When I search with a category id and place, I get a return of 18 places, When I search from another category ID and the same place, I get 32 ​​locations Get the benefit of But when I try to search from both the categories and the same place, I only give 22 returns. In this case I expect the integration of places, but unfortunately it gives me some subsets. Thanks Just adding client_id & Amp; URL parameter request on client_secret,

javascript - How do I save/export an SVG file after creating an SVG with D3.js (IE, safari and chrome)? -

I currently have a website D3 and I want the user to have the option of saving SVG as SVG file Could. I'm using crowbar.js to do this, but it only works on Chrome. None of Safari and IE are used to download the file click () used in crowbar.js method has been denied. var e = document.createElement ('script'); If (window.location.protocol === 'https:') {e.setAttribute ('src', 'https://raw.github.com/NYTimes/svg-crowbar/gh-pages/svg-crowbar.js '); } Other {e.setAttribute ('src', 'http://nytimes.github.com/svg-crowbar/svg-crowbar.js'); } E.setAttribute ('class', 'SVG-Caubawar'); document.body.appendChild (E); How do I download a SVG file based on the SVG element on my website in Safari, IE and Chrome? There are 5 steps I use these methods often for inline SVG output. Get inline SVG element in the output. Get the STV source by XMLSerializer. Name spaces of svg and xlink. Prepare the svg's URL

php - Submit a Form using PUT instead of POST -

I have a controller that presents the form with AJAX requests. I do not want to repeat myself, so I put the processing code in some method: // post request public work should be made (request $ request) {return $ the-> and; ProcessEdit ($ request); } // PUT request should process public function updates ($ id, $ request request) {$ entity = $ this- & gt; Search Entity ($ id); // Custom method if (! $ Unit) returned $ $- & gt; MyCustomErrorResponse (); $ $ Return - process edit ($ request, $ unit); } Private Function Process Edit (Request $ request, unit $ unit = zero) {$ form = $ this- & gt; CreateForm ('my_entity', $ unit); $ Form & gt; handleRequest ($ request); If ($ form-> isValid ()) {// do something} other {// handle invalid form} return $ response; } I have the following two routes: ajax_create: pattern: / defaults: {_controller: 'MyBundle: Ajax: create'} Methods: [ POST] ajax_update: pattern: / id} default: {_controller: 'M

c# - Populate 2Dimensional Array -

I am trying to write some arguments which allow me to store values ​​in a 2 dimensional array. Under the function given below, I would like to store current coins [i] value stored in the form of a consolidated coin variable. However, I am not sure how I can do this. The reason for this happening is that I would like to loop through the array when it will be populated once and print current coins [i] with the corresponding coin variable Which indicates the amount to be used to deliver the change. Function: int counter = 0; Int Coin; For (int i = 0; i & lt; coins; album; i ++) {coin = math.min (quantity [i], (int) (change / coin [ii])); Counter + = coin; Change - = coin * coins [i]; // [Coins [i], coin] console want to be stored in 2Darray. Wrightite ("number of coins = {0}", counter); If there is another way that this can be done, please provide suggestions. Keeping in mind, I can not use anything from collection classes. All answers are appreciated.

c# - Bing Maps GetRoute gives '0x8004231C' error -

I am trying to show a path from point-to-point on Bing-Maps (test on real devices). I have logged in to GeoCoordinate and I am trying to get the route through Windows PhoneToolKit while waiting for . Query GetRouteAsync () Unfortunately, I'm getting an unknown error: The result of the async call: 'e. The result 'threw an exception of type. Reflection.TargetInvocationException ' Internal Exception: Exceptions HRESULT: 0x8004231C I have checked and seen That this error code is not listed in the error list ... The related code is below I have used the exact same code as the sample set of the Windows Phone Toolkit, but removed those things Nothing to do to get a pass route: Private async zero BtnShowRoute_Tap (Object Sender, System.Windows.Input.GestureEventArg s E) {tryoutquery query = new route (); & Lt; GeoCoordinate & gt; WayPoints = new list & lt; GeoCoordinate & gt; (); WayPoints.Add (new GeoCoordinate (47.23449, -121.172447));

html - How to check the incoming link in PHP -

I am writing a PHP module where I have to check that incoming links are coming from a particular page. I have 2 pages: Services.php: I have href something like this & lt; A href = "product.php" & gt; Subscribe now & lt; / A & gt; Product.php: Here I check here using the following codes from the link services.php: > < Code> $ ref_url = $ _SERVER ['HTTP_REFERER']; $ RefData = parse_url ($ ref_url); If (stropo ($ refData ['path'], 'services.php')! == incorrect) {// Subscription_Module} else {// Other} Unless user & lt; clicks on a href = "product.php", works fine until then; & Gt; Subscribe now & lt; / A & gt; Although However, there is a side effect, when the user is on the services.php page and then clicks on product.php on the header, then it executes < Code> Subscribe_module Any ideas in PHP, how to fix it? thanks simple, nest another loop if (stroffo $

c# - ORM which can insert entity into more than one table -

मेरे पास ऐसा टेबल है, जो SQL सर्वर में है Table1 आईडी (पीके), नाम Table2 Table1_Id (fk), शीर्षक, विवरण, SomeData कोड से सम्मिलित करते हुए (सी # का उपयोग करके) मैं चाहता हूं इस डेटा को बनाने के लिए दो अनुरोध करने से बचें। क्या कोई ओआरएम है, या कुछ सरल। डेटा जो इसे संभालता है अगर मैं कॉल करता हूँ var myObject = new MyObject () {नाम = "नाम", विवरण = "वर्णन", शीर्षक = "शीर्षक", कुछडेटा = "कुछ डेटा"}; db.Table1.Insert (myObject); मुझे लगता है कि वहाँ कुछ ऐसा हो सकता है जो उपयोग में विदेशी कुंजी को पहचानने के लिए पर्याप्त चतुर है? मुझे लगता है कि यहाँ मुख्य कठिनाई यह है कि मेरा आईडी एसक्यूएल द्वारा स्वत: बढ़ाया जा रहा है, इसलिए विदेशी कुंजी का मिलान करना मुश्किल हो सकता है। धन्यवाद! आप ऐसा करने के लिए एंटिटी फ़्रेमवर्क का उपयोग कर सकते हैं। असल में आप एक इकाई को परिभाषित करते हैं, तो आप इसे अधिक से अधिक मानचित्रित करते हैं एक SQL तालिका। Ie आप एक सार इकाई व्यक्ति और कंक्रीट संस्थाओं को नियोजित कर सकते हैं कर्मचारी और

javascript - Angularjs: Singleton service using $http -

Is it possible to create a service using $ HTTP, which is the method, URL, success and failure callback Take the form of the parameter when called from the controller. I want to get the following type of functionality using angular var ajax = {URL: "webservice url", login: wrong, imported id: "", token: '', userdetails: new Backbone.collection.extend ({}), Server call: function (method, data, success callback, failurecol) {var that = this; //console.log(method); //console.log(successCallBack); That.showLoading (); $ .jax ({url: that.URL + method, method: 'post', data: data, // contentType: "application / json; charset = utf-8", success: function (data) {that.hideLoading ( ); If (that.checkForError (data)) {successCallBack (data);}}, failed: function (data) {that.hideLoading (); failurecol (data);}}); } I am using the folder structure inside the app and inside services that I have the code defined (['./ module' ], '

c# - Asp Gridview use Boundfields? or Templatefields? -

मैं डेटा तालिका में डेटा डालता है उदा। dt.TableName = "SA1"; da.Fill (डीटी); GridView1.DataSource = dt; GridView1.DataBind (); अब मुझे यकीन नहीं है कि मुझे बाउंडफील्ड (सभी स्तंभों के लिए) का उपयोग करना चाहिए & lt; asp: बाउंडफिल्ड डेटाफिल्ड = "यूनिट" हैडर टेक्स्ट = " यूनिट "सॉर्टएक्सप्रेस =" यूनिट "/ & gt; या और उपयोग करें: asp: TemplateField & gt; & LT; HeaderTemplate & gt; इकाइयां & lt; / हैडर टेम्पलेट & gt; & LT; ItemTemplate & gt; & Lt; एएसपी: टेक्स्ट बॉक्स रनैट = "सर्वर" आईडी = "टीएक्सबीयूनेट" टेक्स्ट = '& lt;% # Eval ("यूनिट")% & gt;' & gt; & lt; / asp: टेक्स्ट बॉक्स & gt; & Lt; / ItemTemplate & gt; & Lt; / एएसपी: TemplateField & gt; और जैसे ही मैं साथ में जाता हूं, डेटा को जोड़ता हूं, ग्रिडव्यू का उद्देश्य केवल डेटा प्रदर्शित करना है यदि आप पंक्तियों को किसी भी फैंसी या किसी विशेष डिज़ाइन के बिना प्रदर

sql - Oracle database subquery results in multiple rows -

Hi there is a SQL problem, and I hope the answer is very simple. I have the database with the following structure. State gender birth name calculation ----- --------------- --------- --- --- AC F1923 Helen 15 AKF1926 Helen 35 AKF1927 Susan 25 AKF 1920 Helen has 15 thousand records and I want to see that the output is like this: < Code> birth name 1910-1911-1912 - & gt; 2012 ----- ------ --------- -------- ------ Helen 5 6 12 800 Using MS Access I was able to get some results with it: SELECT DISTINCT as1 birthname AS XP1, (Select the total number from AC AS, where as 1 Birth name = as2.birthname and as1.gender = as2.gender and as1.state = as2.state and as1.birthyear = as2.birthyear and at birth = 1910) as of 1910, (AC Select the total number from AS2 where as1.birthname = as2.birthname and as1.gender = as2.gender and as1.state = as2.state and as1.birthyear = as2.birthyear and at birth = 1911) 1 9 1In the form, select the total number of 2 (from AK), where as1.

javascript - prevent dbl click not working on pop up z-layer -

I have a layer, when the user clicks on a link, there is another link inside this z-layer which The video loads, something strange, when they double click on the link if they right click, they only click once. I know that this is not the best solution to fix this problem, but I have to do this work, till I find out what the real problem is. I tried putting a link in the home page and it works fine. Any help is welcome. JS $ (document) .ready (function () {$ ('. Answer_link'). Bind ('Dblclick', Function (e) {alert (); // e.preventDefault ();})}); HTML & lt ;? Php echo & lt; Div class = "answer_recorded_container" & gt; & Lt; a class = "answer_link" href = "javascript: getvideo (\ '. $ d-> video.' \ ', \' '. $ owner.' \ ');" & Gt; & Lt; Div & gt; '. $ D & gt; Question '. & Lt; Br> & Lt; Br> & Lt; / Div & gt; & Lt; / A & gt

c# - ASP Force download txt file sending back source instead -

My ASP has a function that returns a TXT file. I want the user to download the file, but the browser wanted to display it when I did Response.Redirect ("/ Dir / Dir / TextFilePath.txt") ; So I've found that if you add it, it forces you to download it in the header. Response Adhider ("content-disposo", "attachment; filename = / dr / dar / textfilepath.Text"); And this force downloads the file with a catch. The file is ASPX source code and not my TCT file .... this is the correct name but it is definitely not a TCTIF file. Here is a correct way to download files in ASP.NET 'a right way' and note Do not keep the 'right way', you can do it in other ways but it works for me. try {Response.Clear ()); Response.ClearHeaders (); Response.ClearContent (); Response.AddHeader ("content-effect", "attachment; file name =" + _philename); Response.AddHeader ("Content-Type", "App / Word")

python - Use foreign keys in unmanaged model in Django -

I have some unmanaged models to get data from Oracle Database, but I can not read anything in the documentation about joining tables. I have these models class Model1 (models.Model): id = Models.CharField (max_length = 200, primary_key = true) name = model.carfield (max_length = 200, empty = true, empty = true) = meta: managed = incorrect db_table = 'table_1_name' class Model2 (models.Model): Model1_id = models.CharField (max_length = 200, empty = true, zero = true) Class meta: Managed = Wrong db_table = 'table_2_name' And in tables I model 1 and model 2 I am trying to join. I thought I would get the data with Model1 = models.ForeignKey (Model1) in obj.model1__name , but I did not work it can do. The problem is nothing with unmanaged models - this is just a question of syntax. The foreign declaration is correct, but related information is used through dot syntax: obj.model1.name .

find middle point in c array -

I'm studying C programming. I want to get the middle point of the array without knowing about its length. The length is 6, the middle point was 4, but I have an error and I do not know what it is. Here is my code: int * a = (int *) malloc (sizeof (int) * n); Int i; For (i = 0; i Anyone can help you, thank you. scanf ("% d", a [i]) scanf ("% d", and a [i]) and < Do not forget code> free memory when you have it. (It does not make any difference to such small applications, but if you get out of the learning phase and are entering real life then this is a good habit) Anything else : sizeof (a) is the size of the indicator, not the size of the pointer point to allocate the memory (as is stated correctly in other answers).

Vaadin 6 and maven integration results in 404 resource not available error -

I am developing a Vatican Hello user application with vaadin 6.8.5 jar. it works fine. But when I convert the project to Maven, shows 404 HTTP status reports with error in the form of the resource. Please suggest any suggestion to fix this problem. My daily application Application in public class teston model {/ ** * * / Private static final big serial warsion UID = 1 L ; @ Override Public What's Init (Windows) {Window Main Window = New Window ("Sampletest App"); Label label = new label ("Hello plaintiff user"); mainWindow.addComponent (labeled); SetMainWindow (MainWindow); }} Web.xml & lt; Servlet & gt; & Lt; Servlet-name & gt; Template application & lt; / Servlet-name & gt; & Lt; Servlet category & gt; com.vaadin.terminal.gwt.server.ApplicationServlet & lt; / Servlet category & gt; & Lt; Init-param & gt; & Lt; Description & gt; Vaudin application class launches & lt; / Description

ruby - undefined method 'each_pair' with openstruct -

I'm using OpenStruct to manipulate Jason like this: OpenStruct.new '{" age ": 100," name ":" name "} '' and I'm getting NoMethodError:" {\ "age \": 100, \ "name \" The undefined method for 'each_pair' "": \ "name \" ": string This piece of code was working some time ago, and now it is not. I am using Ruby 2.1 Just do this: requires 'json' OpenStruct.new (JSON.parse (your_string)) will replace your JSON string object in Ruby hash object.

colors - CSS: How to make link colour the same as parent div -

There is a simple rule that can be written in CSS so that all links can choose the standard font color selected in those divisions. , But when they go for blue color and when they are not clicked to change the color, then I want to keep them in light only, else it remains the same, this is the only div which is the problem Coming down in the bottom CSS: .textundergrey {height: 140px; Width: 950px; Margin-left: auto; Margin-right: auto; Margin-top: 15px; Font-family: "OpenSane Lite", Ariel, Serif; Font-size: 20px} If you want to keep the link in the same color Div you should use the color: heir and when you should use the rotation then blue should be turned on: a: hover {color: blue; } With this code link also, do not change colors. Try: HTML: & lt; Div id = "yellow" & gt; & Lt; A href = "#" & gt; Yellow & lt; / A & gt; & Lt; / Div & gt; & Lt; Div id = "red" & gt; & Lt; A hr

javascript - Radio buttons inside Kendo grid -

In my condo grid I need three radio buttons which are tied to my data source and are inline editable. The problem is the editor when I click on a column (and I make a div wall to force the editor to call), then the value for the editor editor is not set correctly. When I click on one column and the other column, the value is not saved. And if I click on the second line for the same column, the name (radio group) is not set correctly (two editor lines of the same name). Is there any way to treat the editor correctly? I have been using javascript to define the following grid: 1 Edit: I created a template for some added extended readability And line-breaks in the editor but they should not be present in the code. Edit 2: Fixed error in input tag validation. & lt; Html & gt; & Lt ;! - Head code - & gt; & Lt; Body & gt; & Lt; div id = "grid" & gt; & Lt; / Div & gt; & Lt; Script & gt; $ {Document} .ready (function

javascript - Match a string using a regular expression -

मेरे पास निम्न स्ट्रिंग है name = cvbb & source = Mamma + Mia & startdate = 2014-03-24 मैं नियमित अभिव्यक्ति के साथ नाम से संबंधित मान से कैसे मेल कर सकता हूँ, अर्थात् स्ट्रिंग "cvbb" / [^ name] = [^ & Amp;] / मैचों = सीवीबीबी लेकिन मुझे केवल सीवीबीबी चाहिए यह ऐसा लगता है कि आप URL पैरामीटर मान प्राप्त करना चाहते हैं? इस मामले में आप इस फ़ंक्शन का उपयोग कर सकते हैं: फ़ंक्शन getParameterByName (नाम) {name = name.replace (/ [\ [] /, "\\ [")। Replace (/ [\ ]] /, "\\]"); var regex = नया RegExp ("[\\? & amp;]" + name + "= ([^ & amp; #] *)"), परिणाम = regex.exec (location.search); रिटर्न परिणाम == नल? "": डिकोडुरिक घटक (परिणाम [1] .replace (/ \ + / g, "")); } Var value = getParameterByName ('शुरुआती'); यह 2014-03-24 नामित एक var में मान डाल देगा