Posts

Showing posts from August, 2010

ruby - Rails 3: How to intercept any http request -

Let's say I have an AP / Assets / Image / Primetime / Maritrified Maze 1 I have an image on JPG if I directly image via Url http: // localhost: 5555 / assets / personal / myrestrictedimage1.jpg I I am able to see the image. I have a way to inspect any http request to determine whether the user has permission to access it or not. I know that I can use before_filter in controllers to perform some rehearsal. Before continuing on any of the controller functions, but I do not think it will help me because I am trying to take a controlling action for this. I have heard that I may be able to do this with a rake work, but after a lot of searching I did not get anything that I am trying to do. Maybe I have to make a ruby ​​gem to do this but I have no clue how to do this. Can anyone tell me in the right direction? Thank you. I used rack middleware The middleware class looks like this: / P> class MyChecker def initialize (app) @app = App and def call (env) if (...

- Where Developers Learn, Share, & Build Careers

I want to create an EDM from my database file (.mdf), but I do not want to work with all the columns. How do I leave these columns with .edmx? You can not choose specific column of time generation. But, if you only want to work with a subset of the column, then the EDM produces the entire table; Then in the surface of the designer you can select the columns you do not need and press remove to remove them from the model. A note is that if there are some obstacles in your database, such as non-blank columns are not a default value, if you try to add or update entities without those pillars in your model If an exception will be thrown.

- Where Developers Learn, Share, & Build Careers

The problem is that we can not get the gateway of a field (non-generic) which remains only in the base class, in which The common type is please see the code snippet below. Calling f.GetValue (a) will throw exceptions with the message: Can not be used on fields with late-bound operational types, What kind of type Containsensen generic parameters are true. class program {static zero main (string [] args) {type abstractGenericType = typeof (ClassB ;) FieldInfo [] fieldInfos = abstractGenericType.GetFields (BindingFlags.Public | BindingFlags.Instance); Class AA = New Class ("Hello"); Foreach (fees in fieldInfo field) {f.GetValue (a); // Invalid Operation conviction}}} Internal class ClassB Our design requires that we get FieldInfo first before any instance of real objects. Therefore we can not use type type A = abstractGenericType.MakeGenericType (typeof (string)); FieldInfo [] fieldInfos = typeA.GetFields (); thanks I think it comes to this problem Norm...

php - same name for multiple inputs -

I have a form ... where I have to use the same name as the field for each product on the form. No part, item and price, if I want to add many items with an order button, then it can not be different. The example code below works with Cart32's shopping cart software to add many items to the cart. I would like to know how many items they use, such as parts, and are capable of achieving all the values ​​of that area. I tried to write my page to get input and could not get many items for my life, repeat areas like parts, quantity and value I have $ _REQUEST, $ _POST and $ _GET has tried and I get only the last value, so this is not a case. Here is an empty example input type = hidden name = 'item' value = 'product1' & gt; input type = hide name = 'value' value = '27.99 '& gt; '3' name = 'input' = '0' & gt; & lt; input type = hidden Name = 'Part' 'value =' 11 '& gt; Input ,...

c# - Download images from web and use downloaded images when presen -

My C # program needs to display several possible images at a time. The images are on the web and I have the exact URL for each. The program needs to either load the image from the web or, if it has been previously loaded, load it with memory / file (as from the web The previous load should be saved in memory / file). How do I implement this? I can get loading from the web with the WebRequest object, but later, fast, not enough to save it for use. WebRequest request = WebRequest.Create (imageURL); Stream stream = request GetResponse () GetResponseStream (); PictureBoxFirstPack.Image = Image.FromStream (stream); I'm sure you should be able to: memorystream ms = new memorystream (); Stream.CopyTo (ms); Byte [] data = MS. ToArray (); Once you take it as a byte array, you can keep it in a dictionary, database or anywhere you want.

- Where Developers Learn, Share, & Build Careers

मैं मौजूदा सरणी A A_array पर आधारित एक नया सरणी B_array बनाना चाहूंगा । यदि उस मद में A_array में कोई निश्चित फ़ील्ड है तो उसे B_array में जोड़ें। वर्तमान में यह मेरे पास है और यह सब कुछ में डाल रहा है बी_अरे : बी_अरे = ए_अरे.मैप {| आइटम | अगर item.name == 'जोश'} ए_अरे: [आईडी: 0, नाम: "जोश", ईमेल: "जोश @ जॉश @ Gmail.com "], [आईडी: 1, नाम:" स्कॉट ", ईमेल:" स्कॉट @ जोश @ जीमेल डॉट कॉम "], [आईडी: 2, नाम:" जोश ", ईमेल:" डान @ जोश @ जीमेल : [id: 0, नाम: "जोश", ईमेल: "जोश @ josh@gmail.com"], [आईडी: 2, नाम: "जोश", ईमेल: "dan @ josh@gmail.com"] धन्यवाद! उपयोग करें: a = [{id: 0, नाम: "जोश ", ईमेल:" जोश @ josh@gmail.com "}, आईडी: 1, नाम:" स्कॉट ", ईमेल:" scott @ josh @ gmail.com "}] b = a.select {| i | मैं [: नाम] == 'जोश'} आपके द्वारा दी गई शर्त के आधार पर फ़िल्टर करेगा और परीक्षणों को पास करने वाले तत्वों क...

haskell - New at haskel having trouble with String -> Double in list -

I'm enjoying this new language, sometimes it's difficult to harass. My professor wants, he wants me to accept numbers from the user and calculate an average average. So far, I leave an error for some kind of error except to my original program. I am a student in a computer, and this is an assignment question that I am trying to do for me. Module main (listM, main) where importing system. IiO import data List list = = [1, 2, 3] main = average list M = real listM / genericLength list putStrLn (show (listM)) Now I have this error, Insane running ...: S Q1.hs: 12: 18: Input `= ' on parse error It's good to hear that you are having fun learning Haskell! As far as your job is concerned: you are not doing any harm at all. I will say: You are almost As Dwileson explained in his excellent answer, due to the reason that the compiler rejects your program that your definition of listM was previously placed in the importable Haskell module, you Always star...

perl - Using a match from a regex in another regex: skipping over metacharacters -

I have a regular expression (Reggae1) plus some Perl code that selects a specific string of text, it has to be shared with theSTART_POOINT, This is the start of a big string from a large text document that I want to remove from a larger text document. I want to use another regular expression (REGEX 2) to remove from START_POINT to END_POINT. I have a set of words to use in regular expressions (REEGEx 2), which will easily get END_POINT. Here's my problem. START_POINT Text strings can include metaccharuchers, which will be interpreted differently by regular expressions. I do not know the time before that who will be this. I am trying to process a large set of text documents and will be different in the document from the START_POINT document. How can I define a text string as a text string and with meta characters? Not in the form of text string? Perhaps this code will help to understand more than $ START_POINT has been identified in the code above this part of the code and the l...

Javascript ActiveElement and Keydown Event Listener -

I'm new to JavaScript and I'm trying to scan the following code to see if the ID = "Subcommunity" is active, if not it, so i click on submit button with AD = "A" I'll click when I press 'A' on the keyboard. Now when I select the text box I get a warning, but when I do not have it selected it does not raise my keydown. Please help! GetActive function (if (document.activeElement.id == 'lessonNum') {Warning ('subtitle active'); Var B1 = new boolean (1); } Else {var b1 = new boolean (0); }} Document.addEventListener ("keydown", keyDownTextField, incorrect); Function keyDownTextField (e) {var keyCode = e.keyCode; If (keycode == 65) {if (b1 == 0) {Warning ('one is pressed'); . Click on Document.getElementById ('A') (); }} In your code: Gt; GetActive Function () {& gt; If (document.activeElement.id == 'lessonNum') {& gt; Warning ('subnote active'); & Gt; Var B1 = new b...

jQuery Validation failing unless call $('#form').valid() -

I have a large application that is using a lot of jQuery and today I went to a page in the test that Will not be valid correctly. I have saved a copy of the page and removed all the other jellies, which leaves the code to validate a field, with which I'm having trouble. In the following code, it works perfectly: But if I make a warning comment, it does not work. And the warning always shows the value of 'true'. This sounds like a silent question to me but I have 50 other pages like clock clock and I'm coming down on this one. We are using jQuery everywhere for all types of operations. But this one page will not work Why can not one possibly keep the light why the alert will work? I am happy to punish the fact that this answer :) Thank you in advance! I think you have BTN service as a submit button. You click the submit button. Therefore, no one is applying verification at the time of submit, which is why you need to call. Valid () again. I jus...

can a MP4 file contains more than one movie atom? -

We know the movie molecule in the information of an MP3 container file store that describes the film's data. I am thinking that there can be more than one movie atoms (atomic type 'move') in an MP3 file? Does anyone know? Thanksgiving A valid mp3 file can contain only a single 'moov' box It is ISO 14496- 12 is stated in 8.2.1 of the specification: Metadata for a presentation is stored in a single movie box which is at the top-level of the file, usually the start or end of the box file Is close to, though it is not necessary. If you are using split MP4 files then the role of 'move' is mostly 'Moof' boxes and they are usually present at times.

java - Check in compile time if someClass.class is derived from a anotherClass.class? -

This is a newbie question, in Java, if I have some class. If the class is possible at compile time, then another class. In class or run-time In the code: anotherClass. Class.isAssignableFrom (someClass.class); If you also want to check that the other class is a real square (and not the interface), then add it to the call: ! AnotherClass Class.isInterface () & amp; Amp; & Amp; Second class Class. EssentialFamFom (some class class); Example: System.out.println (number.clash.esignableForm (integer.clash)); // true Note that for example will not work for you because you do not have just examples. The class or interface represented by this class object is either the same, or is a superclass or superfinfo, class or interface The specified class is represented by the parameter. If it is true then if it gives; Otherwise it incorrectly if this class object represents a primitive type, then this method returns true if the specified class parameter is ...

html - Unreasonable bottom space on the page -

Does anyone help me to understand why our website has very little space? Please see I have been playing for some time already and did not know what the problem is. Thank you! #main_content_container {top: -170px;

mongodb - How do you query for embedded objects from a repository with Spring Data? -

I have an object, let's call it a item . Speaking conceptually, users can take action against these items. My document is root item , and it has embedded inside action . P> I have created a Spring Data repository: public interface item crude referitry and lt; Items, string & gt; Is it possible to make a method, perhaps by commenting it with any type of @Query , which is the Action that some criteria Matches? I want to get this data to show a user's recent history in Items 's. Can act link in your document type and link them to your items 's? It is possible to query action that you called with the following pattern The method can be used: findByAction_ {actionPropertyName} or if it is not ambiguous then you can remove the underscores. 1.3.2.2.1. Property expression from

- Where Developers Learn, Share, & Build Careers

I am using jQueryMobile - SimpleDialog2 However, I want to disable the button according to something > Ok, I'm not sure this is the best way, but I Unable to get 'disabled' effect Close: (disabled)? Wrong: True, Subject: (Disabled)?

ruby on rails - How do you use map to get a hash instead of an array? -

I am currently using the following to get an array of certain fields in a table: classes.all.map (and: teacher_name) This gives it: ["James", "Josh" , "Peter" I wish there is something in return for a hash, where I can include teacher_ID: {"James "= & Gt; "1", "Josh" => "2", "Peter" => "3"} I tried to use the classrooms.all.map (& amp;: teacher_name, & amp;: teacher_id) Syntax error is returned. Thank you! Do it in a new way: pairs = Classrooms.all .map {| T | [T. TeacherName, T. Teacher_ID] # [key, value]} hash = hash [couple] #in / old / ruby: hash [* pairs.flatten] .. or whatnot View

How do you create a BLOB column in rails postgresql database -

I am trying to store binary data in database (PostGrassClose on Heroco) I I understand that there are two different ways to store binary data in postgres. A blob and a byte .. When I create a table in my migration, create_table: binaries do | T | T. Binary: Data termination This creates a column in the data type database. My question is ... How can I create a record of Blob? Why should I ask? It seems that when I send a ten byte file to my box, it keeps it as a string of hex values, which is prepared with "e". So my 10 bytes are 21. My 10 meg file is 20 mega (and one byte), ext, ext, ext ... Now what bothers me, but as I really do not care about performance (I Beaten), which does not bother me the most. which really bothers me; When I read the contents of the database, I get 21 bytes, not 10. This is unrecognizable. Then my question is again .. How do I create a Blob column in Rail / PostGraskcl / Harokee environment? Bitia is a blog postgresql ver...

html - How to positioning an image between two div -

Image
I have to position an image between the bottom of the two div, like each other: The code for this example is: & lt; Div style = "background: blue; width: 500px; height: 150px; overflow: hidden;" & Gt; & Lt; Div style = "background: red; width: 500px; height: 100px; margin-top: 20px;" & Gt; // Does the image go here? & Lt; / Div & gt; & Lt; / Div & gt; I know that with full status, I can make that image a status .. but I do not like the situation like this .. Is there any other way? Thanks! full CSS sample

linux - Special characters in agetty.c -

agetty.c कुछ अक्षर जैसे @ मानते हैं, विशेष रूप से । जब एक @ प्रतीक लॉगिन संकेत पर दर्ज किया जाता है, तो यह सभी पाठ को निकाल देता है क्या यह सुरक्षा के साथ कुछ भी करता है या क्या वे डिजाइन के अनुसार हैं जिन्हें विशेष वर्ण मानते हैं? यदि आप स्रोत को देख रहे हैं, तो आप देखेंगे कि दोनों @ और Ctrl यू लाइन को मारने वाले चरित्र के लिए समानार्थक शब्द हैं यह उन दिनों से एक ऐतिहासिक अवशेष है जब TTY लाइन अनुशासन प्रवाह नियंत्रण के लिए एनएसी (Ctrl-U) यद्यपि कुछ सिस्टम मौजूद हैं जो अभी भी प्रयोग करने योग्य वर्ण सेट पर हार्डवेयर की सीमाएं डालते हैं, लेकिन ऐतिहासिक अवशेष जैसे @ अभी भी 3 डिवाइस के लिए जारी रहती हैं, जहां आप वास्तविक Ctrl-U नहीं भेज सकते हैं इसे 0x15 के रूप में मिला बीएस के लिए एक ऐतिहासिक समानार्थी के रूप में आप # के साथ एक ही विशेषता को भी देखेंगे। यहां तक ​​कि अगर आप पुराने उपकरणों की उपेक्षा करते हैं जो बहुत सीमित हैं, तो पुरानी आदतें, विशेष रूप से गेट्टी और स्टाटी में रहती है क्योंकि "हमने हमेशा ऐसा किया है"।

html - Redirect to the same page but with a message in it -

I am creating a login page in JSP. I have a index.jsp page, where there is a present form and some javascript writers. In the database, check for username and password in check1.jsp file My issue is after entering the user name and password, when I Pressing the login button, I have check1.jsp linked to the form, if the user matches the username and password and exists, then it is welcome.jsp Redirects to, but if the username does not exist or the password is found If not, then I'm returning a small message under the index.jsp box that the username is not present or the password does not match , currently I only Redirected to index.jsp . How should I show the appropriate small message below the login box on the same index.jsp page ?? You can use the object here: in check1 .jsp : redirect (loginSuccess) to {// welcome.jsp} {session.setAttribute ("error", "username or password is incorrect") ; // index.jsp} index.jsp : string m...

mysql - inserting/reading blob data from php -

. After I have been using the following scripts to test and then reading the Blob data the entry script : Include ('session.php'); $ Provider = $ _ POST ['provider_id']; $ Trd_period = $ _ POST ['trading_period_month']; $ Pdf_statement = stream_get_contents (fopen ($ _files ['pdf_statement'] ['tmp_name'], 'rb')); $ Pdf_statement_clean = addslashes ($ pdf_statement); '.. $ Pdf_statement_clean $ insert = "Update rd_provider_statement set pdf_statement =" ", creation_user_id = 'SCO' where provider_id = '" $ provider .. "'And trading_period_month =' $ trd_period .. "'"; Mysql_query ($ insert); Mysql_query ("COMMIT"); Echo mysql_error (); Download the script: Include ('session.php'); // post variable $ TP_Month = $ _ POST ["trading_period_month"]; $ Provider = $ _ POST ["provider_id"]; $ TP_format = substr ($ TP_Month, 0, 7); // ...

jquery - Passing a variable value to a variable in a script function (Javascript) -

I would like to know how to pass the value of a variable to a variable in a java script function which is written in the HTML file at top. I wrote it like this: myjsfile.js : var abc = "10"; HTML file : & lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" & gt; (Function () {var test = document.createElement ('script'); test.type = 'text / javascript'; test.async = true; test.src = 'testquery.js'; var s = document.getElementsByTagName ( 'Script') [0]; s.parentNode.insertBefore (test, s); warning (ABC);}) (); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; / Body & gt; & Lt; / Html & gt; I can not find the output Please help! thank you in advanced. Actually, I'm trying to create a jquery plugin like Google Analytics. / pre>

ios - nsdictionary , nsarray to mutable versions -

इस सवाल का पहले से ही एक उत्तर है: 3 जवाब मुझे प्रत्येक में एक सरणी मिली इस सरणी का तत्व एक शब्दकोश है और प्रत्येक शब्दकोश में कुछ सरणियाँ हैं यह ऐसा है [{[]], {[]}] यह एक सर्वर प्रतिक्रिया से प्राप्त स्कीमा है। [__ एनएससीएफ़िएडर सेट ऑब्जेक्ट: फॉरके:]: अपरिवर्तनीय ऑब्जेक्ट को भेजा जाने वाला तरीका बदलना तो इसके लिए सबसे अच्छा तरीका क्या है? मुझे सभी वस्तुओं के माध्यम से पाश को अस्थिर बनाने की आवश्यकता है? या क्या कोई अन्य तरीका है? क्योंकि जब मैं अचयनित कॉपी विधि को कॉल करता हूं, तो यह केवल बाहरी परत को अस्थिर करने के लिए परिवर्तित करता है। किसी भी मदद की सराहना की जाएगी .. JSON इनपुट से अस्थिर कंटेनर बनाने का एक विकल्प है। कैसे TouchJSON के सीजेएसओंडेरियालाइज़र सेटअप करने के लिए ऑब्जेक्ट का उदाहरण देखें परिवर्तन योग्य आउटपुट।

- Where Developers Learn, Share, & Build Careers

Image
I am working on the iOS address book, but when there are some problems, I say that Prompt the user to choose a person's record: The ABPeoplePickerNavigationController class allows users to browse the list of their contacts and select one person and at your option, one of that person's properties. To use people's selector, do the following: Create an example of a class and start over. Set up a delegate, which should adopt the ABPeoplePickerNavigationControllerDelegate Protocol. Alternatively, set the displayed properties in an array of properties that you display. The respective constant is defined as integer; Wrap them with a number in a NSNumber object: The method can be inserted into an array without obtaining any object. People animated the current Model Week Controller as the Modular View Controller: The method is recommended that you present it using the animation. Point one says Create an example of class and start , in its init methods In...

How can i stop orientation change in android table? -

Hi, I'm developing Android apps in the tablet version. Here I am facing problems with orientation so I want to make my application only in portrait mode. For this I have used a feature like snippet below for every activity in my app. Used to be. But with the scenario, it is not good to test the application with the tablet physical condition. This is going to the picture for the first time again. I made the program an activity in the picture but there is no effect. Please give me some help here. My programmatic orientation is fixed. setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); Post text "itemprop =" text "> Try it out ... & activity activity: label = "@ string / app_name" Android: name = "abc.xyz Dd.MainScreen" Android: ScreenErmentation = "Portrait" Android: configChanges = "KeyboardHidden | Orientation "> This will prevent it from being converted to landscape...

java - Common value configuration in Spring XML -

I have several spring beans in which the property value is the same for all of string . Is there any way where I can define string in XML at one place and can reference it in all the beans on the value settings of the property? & lt; Bean id = "some bean" class = "test.SomeBean" & gt; & Lt; Property Name = "Property 1" Ref = "Some Value" & gt; & Lt; / Property & gt; & Lt; Property Name = "General Property" Value = "General Value" & gt; & Lt; / Property & gt; & lt; Bean id = "next bean" class = "test.extBean" & gt; & Lt; Property name = "property 2" ref = "some value" & gt; & Lt; / Property & gt; & Lt; Property Name = "General Property" Value = "General Value" & gt; & Lt; / Property & gt; How to set commonValue in a different place and see it in both places? Try...

silverlight - How do I fix this Simple Styling Usercontrol with dependencyproperties on Title and Content? -

I have a Silverlight XML user control that I want to use to show that elements are grouped together into layouts is done. Xaml is: & lt; UserControl x: class = "StylingLibrary.FieldSet" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/ Xaml "xmlns: D =" http://schemas.microsoft.com/expression/blend/2008 "xmlns: mc =" http: // schemas Openxmlformats.org/markup-compatibility/2006 "xmlns: system =" clr- Namespace: system; assembly = mscorlib "mc: Ignorable =" d "d: DesignWidth =" 200 "D: DesignHeight =" 200 "& gt; & Lt; Grid X: Name = "FieldTotalout Route" Horizontal Alignment = "Statch" Vertical Element = "Stretch" & gt; & Lt; Frontline horizontal alignment = "statch" vertical alignment = "statch" style = "{static resource fieldset board}" ...

java - wikipedia parser -

For example, I want to read the Wikipedia page through an analyst, for example, JWPL I am able to do it, But my problem is: I should count the letters between the headings and sections and the number of links. Using JWPL, I could find a list of sections within each link from the list, but I am not able to count the characters. Overall, my purpose is to read a Wikipedia page, convert my data model into my data modell and give it another file that includes my data model. My data model is a file that will include: Section name, number "section and the number of characters between the next link or other section. Thanks for the help. There is a better way of doing this, currently using available services in Wikipedia. You can interact using the set Read Wikipedia's Metadata page In addition to the Media Yaviki tells a bit on this interaction Good luck

qt - Finding the child widget in a group box -

I have a QPushButton object and a QLabel object that is placed in the QGridLayout layout. This QGridLayout is set to a QGroupBox object. How can I recover QPushButton now that exists in this group box effectively? I have tried the following code but it has not returned a valid QPushButton object. QGroupBox * grpBox = 0; GrpBox = (QGroupBox *) ui.tableWidget- & gt; Salviddetate (fromRow, 0); QGridLayout * GridLayout = (QGridLayout *) grpBox- & gt; Layout (); QPushButton * btn = Grid layout-> Finding & lt; QPushButton * & gt; ("+"); Thank you, Rakesh. Finds exactly what it should have been called on the QGroupBox object.

vb.net - How to dynamically size elements in windows forms? -

I have a windows form written in VB.NET (I'm also taking suggestions in C #) and I have Two datagrid views are vertically aligned, so above each other. I would like to be able to maximize the window and would like to extend the datagrid window with the window so that it looks roughly the same but bigger. I have tried to use the docking and anchoring control and I have not found any way to do this without having to overlap or leave huge spaces in which this should be expanded. Thank you You first make grid and second dock to fill on top While docking should be executed before top docking (you can adjust it in the document settings tool window) This solution will first release the grid at the same height. You can also handle the form resize event and calculate the position and size of the grid.

duplicates - Expression engine: list categories of results, preventing category name duplication -

I'm trying to achieve something like this Category 1 | Category 2 | Category 3 | Category 4 | category 5 | Category 6 Product 1 (in category 1) Product 2 (in categories 1 and 2) Product 3 (in categories 1 and 3 Product 4 (in category ) 4) Product 5 (in category 5) Actually, this is a result page, products have been assigned as categories in the form of a menu. This is what I am getting with the above product data Category 1 | Category 1 | Category 1 | Category 2 | Category 3 | Category 4 | Category 5 Products 1 (in category 1) Product 2 (in categories 1 and 2) Product 3 (in categories 1 and 3 - Product 4 (in category 4) Product 5 (Category 5) > I am using this expression engine tag (I have used an extension of GW code categories, but it should be done easily with standard expression engine tags ) exp: gwcode_categories channel = "product" group_id = "1" output_depth = "2" entry_id = "{entry_id}" entry_coun...

php - Class field as array of objects -

मैंने अगले वर्ग की घोषणा की है: वर्ग पृष्ठभूमि {सुरक्षित $ users = array (); ......} और मैं $ उपयोगकर्ता को उपयोगकर्ता () की सरणी के रूप में कार्य करता हूं, जो एक अन्य वस्तु है I ' Ve बनाया समस्या यह है जब मैं इस पद्धति का उपयोग करने की कोशिश करता हूं: फ़ंक्शन createB () {foreach ($ this- & gt; उपयोगकर्ता $ उपयोगकर्ता के रूप में) {$ name = $ user- & gt; getName ( ); }} और $ user- & gt; getName () वास्तव में एक त्रुटि है क्योंकि $ उपयोगकर्ता वस्तु के रूप में नहीं देखा जाता है इसके लिए क्या कारण हो सकता है? अग्रिम धन्यवाद समस्या हो सकती है वास्तव में आबादी वाले $ उपयोगकर्ताओं के साथ नहीं हो सकता है इस तरह के मुद्दे को रोकने के लिए इसे जोड़ने का प्रयास करें यदि यह मदद नहीं करता है, तो कृपया जानकारी जोड़ें कि कैसे $ उपयोगकर्ता आबादी वाले हैं। फ़ंक्शन createB () (यदि (! खाली ($ इस- & gt; उपयोगकर्ता)) {foreach ($ यह- & gt; उपयोगकर्ता $ उपयोगकर्ता के रूप में) {यदि ($ उपयोगकर्ता उपयोगकर्ता का उदाहरण है) {$ name = $ user- & gt; getNa...

Spring tx:annotation-driven works in eclipse, but not in tomcat -

I think there is a problem with Spring Annotation-powered transaction management and Tomcat. These are some beans in my reproduction: & lt; Bean id = "datasource" class = "service.mbitis.routingdatasource" & gt; & Lt; / Bean & gt; & Lt; Bean id = "Transaction manager" class = "org.springframework.jdbc.datasource.DataSourceTransactionManager" & gt; & Lt; Property Name = "Data Source" Riff = "Data Sources" / & gt; & Lt; / Bean & gt; & Lt; Tx: annotation-driven transaction-manager = "transaction manager" /> When I run the project in eclipse, everything works fine. But when I run the project in Tomcat, it does not get before the creation of beans. It does not even give an indication of whether I am an error or a wrong. The log shows that it immediately transforms the bean and then suddenly destroys all beans: [DEBUG] 12 July 09: 28: 55.888 Preparing an example...

android - DownloadManager double download -

text "itemprop =" text "> I have the following problem: whenever I download the file containing DownloadManager it is downloaded twice (save in the" Fashion "file name Here's my code: Public Zero Download () {Request Request = New Request (Uri.parse (_wrapper.getURL) ); Request.setTitle (getFileName (_wrapper.getURL ())); Request.setVisibleInDownloadsUi (wrong); Request.setDestinationInExternalFilesDir (_context, null, "/" + getFileName (_wrapper.getURL ())); _downloadID = _downloadManager.enqueue (requested); } Public BroadcastReceiver getDownloadFinishedBroadcastReceiver () {BroadcastReceiver Receiver = New BroadcastReceiver () {@Override Public Zero onReceive (context pContext, intent pIntent) {string action = pIntent.getAction (); If (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals (verb)) {query query = new query (); Query.setFilterById (_downloadID); Cursor cursor = _downloadManager.query (query); If (cursor.moveToFirst ()) {file f...

shell - vim and unix pipe -

गलती से आज मैं एक मजेदार कमान चलाया जो कि vi filename | वीआई - यह मेरा टर्मिनल भी पकड़ा Ctrl-C का कोई फायदा नहीं था। मुझे टर्मिनल केवल बंद करना था मैंने इसे कई बार कोशिश की और अपने दोस्त की मशीन पर भी कोशिश की। बस सोच रहा था कि क्यों Ctrl-C भी मदद करने में सक्षम नहीं था। vi Stdin से पढ़ रहा है जब आप vi Ctrl + c में संपादित करते हैं तो या तो काम नहीं करता है : q या : q! एक सामान्य vi सत्र की तरह काम करेगा।

gis - create shape file (.shp) for polygon in C# -

I want to create a shape file which can be used with GIS solution map. The situation is such that the user will draw some polygons on the map by clicking on it. Therefore, I have long time to attract polygon. Now I want to export this size for a long time so that it can also be shown on other GIS applications. I do not know anything about the shape files, so creating a size file is a tough task? Does anyone tell me where I want to start searching? Thank you for your help You can apply it to a doctor Well, of course, do not do that. Google will definitely help you for the size file library There is a good thing to start with the sharks: Other options here (not that young)

Google Apps script overflow when created using GUI builder -

I created this GUI using Google Apps Script GUI Builder but when it was running on Firefox it was completely nonsense Was there. The flow panel behaves like a horizontal panel. But that's fine. I can use chromium but in both browsers, only part of the GUI show. What can i do Please suggest me to see. It is running when it looks I think you A 'master panel' (full panel) should be used so that all other widgets can hold it and it is sung when Ui will fix the window size. This will be useful for collecting data in your callback element. Okay, at least this happens when I use the GUI Builder. Another option would be to use the app.setwidth ('Pixes'). SetHeigth ('pixelsize') with the correct size EDIT: You are right, the full panel does not solve it ... but setWidth () does ... use this like this: var app = UiApp.createApplication (). SetTitle ("panel") setWidth (of 1500 ') setHeight (' 600 ') .. Var GUI = app.loadComponent...

c# - Dispose the connection or Close the connection -

Which of the following two ways is better performance? (var db_Connection_s = new DBC connection ()) {// todo: conversation with database connection} or simply: DB_Connection_s.Close (); Finally. What makes the concept of pooling unusable? Because if I settle the connection with each use, then I will have to open a new connection every time (and there will be no connection to the pool). source = P> Therefore, remove the worry about performance loss due to the missed pool connection. # The difference from code perspective should be so small that using should always be used . >

c# - Does a Thread stop itself once it's function scope is over? -

थ्रेड myThread = नया थ्रेड (नया पैरामीटरेटेडथेडस्टार्ट (धागा फंक्शन)); सार्वजनिक शून्य थ्रेड फंक्शन () {// एक परिमित कोड चलाएं ...} सवाल है: myThread एक बार निपटारा threadFunction () खत्म हो गया है? थ्रेड्स का निपटान करने की आवश्यकता नहीं है। थ्रेड वर्ग IDisposable को लागू नहीं करता है और इसके पास विच्छेदन विधि नहीं है। जब आपका धागा पूरा हो जाता है को साफ करने के लिए कुछ विशेष करने की आवश्यकता नहीं है।

php - What will I miss by jumping straight into ASP.NET MVC? -

I'm coming from a computer science type background (problem of many genres), mainly C / C ++ and recently decided that I wanted to join web development C # Basic Windows Forms App Have some experience with I spent some time feeling that I was looking forward to two of my best options: PHP / MySQL or ASP.NET MVC I thought I was asp.NET because I am quite familiar with the prevailing language and although I'm a Linux / Weim fan, I'm comfortable using VS. I have a fairly basic knowledge of HTML / CSS and I am hoping to develop it as I have followed my ASP.NET MVC Web Dave Path; However, after going through some tutorials / information, I see how everything is being understood with HTML helpers. Am I going to learn all the basic principles of web development or am going to learn how to develop sites within this special environment? If so, how can a checklist of retrospective web development knowledge look like? That I can go before proceeding with ASP. C...

java - android scale tab image -

Image
I set an image for each tab and the result is expected but on some devices (tablets or some smartphone models) Image is seen bigger and above text How to solve it? Thank you Activity, state selector selector = new state listdable (); Selector.addState (new int [] (android.R.attr.state_selected}, DSL); icon.setImageDrawable (selector); layout, & Nbsp; TabHost xmlns: android = "http://schemas.android.com/apk/res/android" Android: id = "@ Android: id / tabhost" Android: layout_width = "fill_preview" Android: layout_heil = " Fill_parant "> gt; RelativeLayout Android: layout_width =" fill_parent "Android: layout_height =" fill_parent "> & Lt; / LinearLayout & gt; & Lt; / RelativeLayout & gt; I believe these links will guide you to solve your problem.

Get error message of page validators for particular group by javascript in asp.net -

I am trying to write a javascript function in which I want to show error message in invalid areas of assumptions whose group name was given is. Actually I have a different set of assumptions and want to show an error message in the alert if the value entered is valid for the group, whose button is pressed using the normal function. I am using the following code: function check (group) {if (Page_ClientValidate (group)) {true; } Other {var message = ""; (I = 0; i & lt; Page_Validators.length; i ++) {If (! Page_Validators [i] .isValid) {message = message + Page_Validators [i] .Errormessage + "\ n"; }} Alert (enter the field marked with "* or invalid data \ n" + message); return false; } I want to run the following section of code for a particular group of validators: var message = ""; (I = 0; i & lt; Page_Validators.length; i ++) {If (! Page_Validators [i] .isValid) {message = message + Page_Validators [i] .Errormessage + ...

model view controller - How to implement widgets on PlayFramework2? -

question How to appear on each page is a widget (database call) Can I apply to the website? Context I have a traditional web application with sidebar. The sidebar includes data: Username, Details about the account (last connection and others) Demographic message users by profile And other data extracted from the database. So far the solution As it is shown in the official document, it is possible to present a template inside a template which is an interesting feature but it is not enough Since I need data from the database to be sung in my widget, I This will mean: Obtaining all the data needed for the sidebar anywhere From each controller, each view of that data Passing switch to Calls to an external template for each template at the end, with the data. What I would like to do as I am present in the Symfony2 framework I want to be able to call the controller directly. {% myController: MyActionMethod%} How can this kind of mechanism be implemen...

html - jQuery CSS width attribute returning inconsistent on Safari -

Below is a snippet of my jQuery where I am trying to grab a dropdown and pick an inline width style from it. My problem is that, to get not on Safari II, a newWidth is 225. targetSelect r_select So I can do that for example, why would I return a different width than Safari Firefox? // Select the current selection box target = Select ($); NewWidth = parseInt (targetSelect.css ('width')); My Markup: & lt; Select name = "r_select" id = "r_select" style = "width: 225px; height: 50px; float: left;" & gt; & Lt; Options & gt; Mikelson & lt; / Options & gt; & Lt; Options & gt; Montgomerie & lt; / Options & gt; & Lt; Options & gt; Watson & lt; / Options & gt; & Lt; Options & gt; Casey & lt; / Options & gt; & Lt; / Select & gt; I should add, that I do not have the same problem with this dropdown: & lt; Id = "r_select_overlay" class = "r_s...

PHP in Azure cloud service -

Can anyone suggest that the ezoor cloud service requires configuration to run a simple php file. I am able to see my simple php file in the Azur Web site, but I can see the same file in the Azure Cloud service. Can someone give me some ideas? When you say "I am able to see my simple php file in the Azure Web site, But I am not able to see the same file in the Azure cloud service. ", I believe that you mean that you can browse your PHP site in Windows Azure websites, but not configured as something With the Windows Azure service gone Cloudapp.net is not that so? As you have asked for suggestions, here are some steps you can take to troubleshoot your problem: PHP file ie universal name .cloudapp.net / phpinfo.php Does this file show errors not found, or does it give PHP error related to runtime? The reason for this is that before you deploy it, you have to put all the PHP files together in addition to the PHP runtime in your package. If you miss any important...

javascript - trigger is causing an overwrite meaning wrong number is displayed in textbox -

I have installed a demo for this problem that you can access by clicking Are there. Step 1: When you open the demo, click on the "Open grid" link and select the button "7". It will display a text box and 7 letter buttons below. Step 2: Select the 2 letter button below the option (one button is selected when green is selected) Step 3: Now you can add a green plus button Click on it, and click on it and it opens a modal window. Step 4: In the modal window there is a search bar, type "AAA" and submit the search, you will see a bunch of rows. Step 5: In the first row, you have the number 1 in the "number" answer "column, click on the" Add "button in this line, the modal window will close, but the problem is because" the answer The number of "text box" 1 "does not display. It displays" 2 ", the reason for this is explained below: Problem: " Answer Number "in the text box, it shoul...

mysql - Need help designing my invoice db structure -

Image
I have a website where customers can buy membership. Customers can visit payment history at any time and can see that Ben has bought. I am trying to design DB to make an invoice, but something is not right for me. My current setup looks like this: + ----------- + ------------ - + --------- + | Invoice | Invoice_item | Products | + ----------- + -------------- + --------- + | ID | ID | ID | | Fk_userID | Characters | Name | | | Volume | Price | | | Zodiac | | | Fk_invoiceID | | + ----------- + -------------- + --------- + This It seems logical that there is a foreign key in the context of invoice_item in product . But what if a product has been removed? If they are related, the row in item_list will be deleted or set to tap. And if you want to see the old invoice it will not work and the product is no longer available. Then, should the product and item_list be related? Once defined, you can not delete a product, so a product Add field - I am using an enum...

javascript - Parallax, as a homepage banner -

This is a very vague question, but I'm not sure where to start, so if someone asks me some ideas You can be great, then you are great I have a perpendicular effect on the homepage of my website, but I am unsure about how to make this impact. I want that effect here and crated here. They both use the same principle, where you scroll down the image and the text at different speeds and are fade out. So basically my question is, does anyone know that where should I start to make this or any download that can create an effect? Thanks for any help It does not seem difficult, just their Look at the source code: There is a section of a name on the bottom: Parallax

backbone.js - Backbone.Collection.each - Very strange behaviour -

अब एक बैकबोन संग्रह की प्रत्येक विधि का उपयोग करते समय मैं बहुत असामान्य व्यवहार का अनुभव कर रहा हूं। मेरे ऐप में, मैं उपयोगकर्ताओं को मौजूदा मॉडल को संपादित करने की अनुमति देता हूं, जिसमें उस मॉडल में कई बार बाधाएं शामिल करना और संपादन करना शामिल है मॉडल और इसके समय की बाधाएं बैकबोन रिलेशनल के साथ जुड़ी हुई हैं I हर बार जब उपयोगकर्ता एक नया समय बाधा जोड़ने के लिए क्लिक करता है, तो मैं इसे सहेजने के बिना रिश्ते को एक टाइमकोनस्ट्रेनट मॉडल जोड़ता हूं। यदि कोई उपयोगकर्ता फिर से संपादन को रद्द करने का निर्णय करता है, तो सभी नये / न सहेजे गए समयसंयोजन रिश्ते से हटा दिए जाने चाहिए। हालांकि, जब मैं अपने संग्रह पर लूपिंग कर रहा हूं, तो यह अंतिम पुनरावृत्ति करने के लिए प्रतीत नहीं होता। इस व्यवहार को प्रदर्शित करने के लिए मैंने एक जेएसफेल्ड का निर्माण किया: निम्नलिखित चरणों का पालन करना हैं: "नीति संपादित करें" पर क्लिक करें "नया समय प्रतिबंध" बटन का उपयोग करके 2 या अधिक नई समय की कमी जोड़ें द्वारा संपादन रद्द करें "रद्द करें संपादन" पर क्लिक करें ...

java - Index Out Of Bounds Exception in ArrayList while removing objects -

platform: jacrere I generally use for the ends that rely on the back Because the theoretically fall after properly removing them: 0123456789 Even removing the numbers: i = 9: 0123456789 i = 8 // Remove 8: 012345679 i = 7: 012345679 i = 6 // Remove 6: 01234579 and so on But when this object is removed, I get an exception: A (int i = dArea.size ()) -> 1; I> = 0; I--) {if (dArea.get (i) .getOwn () == 1) {if (dArea.get (i) .getSK () == 2) {if (dArea .get (i) .getX ( ) - dArea.get (i) .getW () / 2> 1350) {dArea.remove (i); } If (DARA.Tet (i) .getX () + DARA.Tet (i) .getW () / 2 685) {DARA.Read (I); } If (DARA.Tet (I) .getY () + DiareaTet (I) .getH () / 2 Why and how to correct any thoughts? if using else instead of Try to Otherwise, a repetition more than one element in your loop (check 'w' once and 'h' for check).

- Where Developers Learn, Share, & Build Careers

I used both find and to find the command Is Can anyone explain how they work? What else happens? In the context of updatedb command command thanks in advance. find does not find it on the fly.

javascript - Map Not Loading in Strange Situations -

One site: www.michelesgranola.com, the store store is not always loaded. If you go directly to the page, then it has the tendency to load: However if you enter the square on the page through the "Search for a store" button, So it usually does not load. He said, sometimes it will load and sometimes it will not happen. How to make a suggestion about solving it? Thank you! > https: // - To link you to use https: // protocol on your home page The link must be set - it currently points to the page using the http: // protocol. If you open your Javascript console while loading that page (using http: //) you will see this message: do not load XMLHttpRequest Https://www.michelesgranola.com/wp/?sm-xml-search=1&lat=39.2904028&lng=-76.â↓|76.61218930000001&query_type = All & amp; Border = 0 & amp; Address = & amp; City = & amp; State = & amp; Pid = 14; Zip = & amp; Origin is not permitted by entry-control-permission-origin of h...

ruby on rails - Using layouts from a mountable engine -

I'm looking for the following problem: The db_core app contains only a small model core system. The Db_core app will not have any views. At the top of the DB_core app we have an admin interface. It will be a mountable engine, the admin interface will serve assets such as JavaScript, CSS, Image etc. Finally we will have additional mountable engines; like. "Blog", "Forum", "Authentication" which will be mounted on the db_core application, and all of these mountable engines should have the same layout as the Admin Interface Engine. I have a test and are running where db_core provides app properties, but I am not able to figure out how to serve the properties to any other engine, so the db_core application is small And remain free from any property and scenes. db_core Engine A -> Admin Interface (Property) Engine B, C, D, ... - & gt; Other other engines using assets from Engine A I think that you actually mean a separate e...

recursion - Simple c++ recursive explaination needed -

I am currently trying to wrap my head around recursive, so I picked up the C ++ textbook and started reading It was easy to understand the first page of the chapter on recapitulation, but then I found an item which was not understood for me. Returns the integer height (node ​​* p) {if (p == NULL); ; Other {return 1+ max (height (p-; lynch), height (p-> arlink)); } If maximum gives me the highest quality of two values, then what is the maximum argument for which it is returning at the height. If someone can help me then I would appreciate it ... Recurring Recurring Recurring: You can understand that the height of an empty tree is 0 You can understand that the height of generic non-empty tree is 1+ longest subtitle The height of which can be started from left or right side) From the beginning, you can degrade the code if you attract the tree, you will see What happens is that. If you have a / bc / dee height (a) will return for example 1 + maximum (heig...

- Where Developers Learn, Share, & Build Careers

I need to do a query in the MySQL, which returns different values ​​for the product_id, but I want to enter the 'id' field There is a need to pick and return which is in the specific table. - I will use it differently and I want to use it on product_id and see id SELECT DISTINCT id, product_id order_cart it will be easy to do on Pgsql But I do not know how to do it on mysql. Your query is not well defined: Consider this table id product_id 1 1 2 2 3 1 4 2 What should be the result of your query? If you mean id product_id 1 or 3 1 2 or 4 2 You are in the country of non-determinative questions. What can you do SELECT MIN (id), product_id order_cart GROUP BY product_id which will definitely arise id product_id 1 1 2 2

ruby on rails - How to change the response format depending on the data sent? -

I'm doing some controller to submit reports and this is my problem: User A Allows to download the open page with a form that changes the format of the download format and the date of the report. A selected input is set to the download format. When the user presses the button I want to respond based on the selected format. The problem is that this is a specified trough url, then trying to do something like this: The case format when "xlsx" then format.xlsx {... } When "html" then format.html {...} ... end does not work because the rail or browser (I'm not sure) is expected to have an HTML response. Although I have two options: Change the URL of the form onsubmit which creates a more dependent application on Javascript. Or redirect_to url + ". # {Params [: download_format]}" In other ways I feel better but I have to pass : report_date in the url and I can not find a way to do this. I have tried this: url = my...

- Where Developers Learn, Share, & Build Careers

I inherited my master page from a class called MasterParent. Compilation Error :: Description: During the compilation, I receive an error as the following: An error during the compilation of a resource required to serve this request Hui. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: ASPNET: Make sure the square this code matches the defined file 'inherits' attribute, and it extends the correct base class (eg Page or UserControl) that Source Error: line 8: namespace PortfolioApplication line 9: {Line 10: public partial class masterpage: MasterParent Line 11: {Line 12:} My code: MasterParent.cs Using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.UI; Using System.Web.UI.WebControls; Namespace PortfolioApplication {public abstract class MasterParent: System.Web.UI.MasterPage {protected void Page_Load (object sender, EventArgs e) {} #regi...

linux - tomcat 7 shows compile error in a hello world jsp -

कृपया जानकारी को देखें एक ?? ¢ उद्देश्य: एक जेएसपी पृष्ठ चलाने के लिए जो जावा क्लास को कॉल करता है, दोनों टॉमकैट सर्वर पर रहते हैं एक ?? ¢ पर्यावरण सर्वर वातावरण: लिनक्स सर्वर: टोमैक 7.0.27 IDE: कोई नहीं एक ?? ¢ जेएसपी (यह सब करता है एक प्रदर्शित करता है स्ट्रिंग) & lt;% @ पृष्ठ आयात करें = "हैलोवाल्ड.हेल्लोवर्ल्ड"% & gt; & LT; एचटीएमएल & gt; & Lt; HEAD & gt; & Lt; TITLE & gt; हैलो वर्ल्ड / TITLE & gt; & Lt; / HEAD & gt; & LT; body & gt; & Lt; H1 & gt; हैलो वर्ल्ड & lt; / H1 & gt; स्ट्रिंग है: & lt;% = HelloWorld.HelloWorld.display ()% & gt; & Lt; / body & gt; & Lt; / एचटीएमएल & gt; एक ?? ¢ जेएसपी स्थान : टॉमकैट / वेबएप्स / हैलो / हैलो.जस्प एक ?? ¢ जावा वर्ग (यह सब करता है एक स्ट्रिंग लौटाता है) पैकेज HelloWorld; सार्वजनिक वर्ग हैलोवाल्ड {सार्वजनिक स्थिर स्ट्रिंग डिस्प्ले () {"Hello World!" // स्ट्रिंग प्रदर्शित करें }} एक ?? ¢ जाव...

CakePHP How to get latest auto incremented id after saving data -

I have also examined the question as well. I am trying to apply the model described in question. What I want to do, on the Anch function of the message controller, make a record in the thread table (this table has only 1 field, which is the primary key and auto increment), then take your ID and Insert this message in the table with the User ID that I already have, and then save it in the message_read_state and thread_participant table. This is what I am trying to do in the thread model: function saveThreadAndGetId () {// $ data = array ('thread' = & gt; array )); $ Data = array ('id' = & gt; ''); // debugger :: dump (print_r ($ data)); $ This- & gt; Save ($ data); Debug ('id:'. $ This-> ID); $ Thread id = $ this- & gt; GetInsertID (); Debug ($ threadid); $ Thread id = $ this- & gt; GetLastInsertId (); Debug ($ threadid); Die (); Return $ thread; } $ Data = array ('id' = & gt; ''); This row from the...