Monday, 15 February 2010

c - shm_open() function is not creating the shared memory -


I am trying to open a shared memory, it is not giving me any such file or directory error but I have The name field contains a file as well as a directory.

  fd_sh = shm_open ("/ home / angus / c_tutorials / interview / linux_sys_pgm / mmap / region", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); If (fd_sh == -1) {mirror ("fd_sh: ERROR"); Return -1; }    

In linux (I think your OS, your code has been given ), The name should start with a slash, but there is no other after, eg "/ myshm" - not a regular file name.

From man page:

  Shm_open () is similar to open (2). Specifies the shared memory object to be created or opened. The use of bleach for Porta, a shared memory object should be identified by identifying the names of / somename; It is that NAME_MAX (i.e., 255) contains a redundant string containing an initial slash, after one or more characters, none of which is slash   

By doing so This will work fine.

Actually this happens that as a file named / dev / shm , you will need to create a directory structure to use the path; This is not a good idea because this directory is only in memory.

symfony - How to customize form_label block in form template in Symfony2? -


I am trying to customize form_label in a template that already provides a template.

Use example in I:

  {% use_form_label '}}} {form_label} with form_label as base_form_label%} {% block (' Base_form_label ')}} {% expected to use%} & lt; Span class = "required" heading = "this field is required" & gt; * & Lt; / Span & gt; {% Endif%} {% endblock%}   

But nothing changed!

Can you help me?

This is my solution.

At the top of my form.html.twig file:

  {'MyBundle: Activity: Form / fields. Html.wig '%}   

And now in fields.html.twig, I have the form_label custom:

  {% expanded' form_div_layout.html.twig ' %} {% Block form_label%} {% spaceless%} {% if not compound%} {% set label_attr = label_attr | Merge ({'for': 'id})%} {% endif%} {% if required%} {% set label_tr = label_it | Merge ({label_attr.class | default ('') ~ 'required') | trim}}%} {% Endif%} {% label is empty%} {% set label = name | standardization%} {{Attrename} for labels, label attribute =} in label, {{attrname}} = "{{attrvalue}} {{end_only}" & gt; ({{attr.note}}) Lt; / span & gt; {% endif%} & lt; / Labels & gt; {% Endpaceless%} {% endblock form_label%}    

Highcharts y axis and x axis display -


I'm stuck with highchips <2>

  • X axis , For X, also set the date time and I need to display the last value also display the grid line above this final value. The problem is that it takes 5 to 5 years and the last grid requires only 3 years of width.

    If anyone has some suggestions about it, I have been lost between showbills and TicTerWelld , and Donuts start looking for solutions.

    To specify a xAxis property that you can use, you can use it clearly.

      xx: {tick-position: [date.utc (1 980,1,1), date.utc (1, 1), date. UTC (2000), 0,1), date.utc (2010,0,1), date.utc (2013,0,1)], ....}    

  • ruby on rails - NoMethodError - undefined method `by_email' for ActiveModel::MassAssignmentSecurity::BlackList:Class: -


    I have an email_ address object that I am trying to see if the blacklist is for that particular domain . I'm calling it this way:

      elsif @ email.blacklisted? (@ Domain.id) Do something ... end   

    I am getting the error: NoMethodError - Undefined for 'by_email' for ActiveModel Method :: MassAssignmentSecurity :: BlackList: Class:

    I have also tried to make a .find_all_by_id that's the same error instead of using the blacklist scope I created although this is driving me crazy No idea would be amazing!

    Email address class

      class email address & lt; ActiveRecord :: Base Attr_accessible: Email ,: global_blacklist has_many: Transaction is_mahmed: black_lists has has_many: opt_outs validates: email,: appearance = & gt; True ,: Specification = & gt; Correct confirmation: global_blacklist, acceptance = & gt; True df blacklisted? (Domain_id) black_lists = BlackList.by_email (self.id) .by_domain (domain_id) black_lists.count & gt; 0 End End   

    Blacklist Class

      Class Blacklist & lt; ActiveRecord :: Base attr_accessible: domain_id ,: email_address_id ,: date_added belong_to: domain is_to: email_address validates: domain_id ,: presence = & gt; Correct confirmation: email_address_id ,: presence = & gt; Correct confirmation: date_added ,: presence = & gt; True is GLOBAL_BLACK_LIST_THRESHOLD = 2 Regions: by_domain, - & gt; (Domain_id) {where ('domain_id =?', Domain_id)} Scope: by_email, - & gt; (Email_id) {where ('email_address_id =?', Email_id}}    

    just any And the problem is ...

    Class name blacklist (Capital L) seems to be an active-modal class name.

    I changed the class name to blacklist (one word instead of two) and the problem went away.

    c# - Can I use varbinary type to store image in SQL Server database? -


    I am trying to store an image in my SQL server database, what datatype should I use?

    In the code aspx.cs below, I am trying to read all the bytes from the input bytes and trying to store it in the database, but by byte [] The array is not updated correctly in the table, am I missing something?

      Secure Zero Page_load (Object Sender, EventArgs e) {Request.InputStream.Position = 0; Byte [] content = new byte [request.InputStream.label]; request. Input stream. Read (content, 0, (int.) Request. InputStream.Length); Con.Open (); Try {String query = "update tblImageUpload set" + IMAGE_ID + "= @imageBytes, where Image_ID = '" + CID + "' '; int i = 0; (CMD = new SQL command (query, conn)) Using (CMD.Pamators.ed ("@Ifhites", SQLDB type Verbari, content length) value = content; I = CMD.exequestone ();} Response.Write ("upload query =" + query); Write ("upload code =" + i);} hold (ex before) {Response.Write ("upload code =" + east);}    

    < Div class = "post-text" itemprop = "text">

    You You can use VARBINARY Yes.

    You can use it like this:

      cmd.Parameters add ("@Ifhites", SqlDbType.VarBinaryMax); Cmd.Parameters ["imagebytes"]. Value = Content;    

    php - Change string in an array from file read and rewrite -



    What I basically want to do is read a file and then at the moment with another Change the string I have written:

      $ pap = file ('../papier.js'); $ = Counting count ($ pap); ($ I = 0; $ i & lt; $ count; $ i ++) {If (stropos ($ Pap [$ i], "url: 'php / function.php'")) {$ url = dirname ( Dirname (curPageURL). ())) '/ Php / function.php'; Str_replace ("url: 'php / function.php'", $ url, $ pap [$ i]); }} $ Fs = fopen ('../papier.js', 'w +'); For ($ i = 0; $ i & lt; $ count; $ i ++) FILIT ($ FS, $ PAP [$ i]); Fclose ($ FS);   

    This gets the right key, but I do not see any changes in the file ... this is the part of the file that should be changed:

     < Code> (function ($) {$ .fn.papier = function (book, params) {var id = $ (this); var request = $ .ajax ({type: 'POST', url: 'php / function: (Data: 'getOpt', book: book}, datatype: 'jason', preceded by: function () {id.append ('& lt; img id = "papierloadinggifimage" src = "css / images / loader.gif" / & Gt; ');}, success: function (opt) {if (opt [0]! = False) {var request = $ .ajax ({type:' POST ', url:' php /function.php ' date : {Act: 'getbook', book: book},    

    You "str_replace" But you are not using the result at all.

    wordpress - Display inline image attachments with wp_mail -


    I have a problem.

    I would like to add an image to an email and display it inline, the problem with some other PP-generated content is that I do not have any idea how to attach the inline Use the attached file attachment array for wp_mail.

    My solution was to encode images in base64 and inline HTML to them like this:

        

    But the problem is that from Gmail / Outlook Image The SRQ deletes the data, so it has no clue as

      the alt   

    How to use an attachment to modify (header to work with base 64) or embed inline?

    Thanks, Radu.

    wp_mail uses PHPMailer class. All inline attachments are required for the Wp_mail () You can use the filter phpmailer_init to change the phpmailer object before sending the email.

      $ body = 'Hello John, check out my new cool photo & lt; img src = "cid: my-cool-picture-uid" width = "300" height = "400" & gt; Thank you, hope you like it ;) ';   

    This was an example of putting an image into your email body.

      $ file = '/path/to/file.jpg'; // phpmailer will load this file $ uid = 'my-cool-picture-uid'; // will map it to UID $ name = 'file.jpg'; // This attachment will be the filename for the global $ phpmailer; Use Add_action ('phpmailer_init', function (& amp; $ phpmailer) ($ file, $ uid, $ name) {$ phpmailer-> SMTPKeepAlive = true; $ phpmailer- & gt; AddEmbeddedImage ($ file, $ Uid, $ name);}); // Now just call wp_mail () wp_mail ('test@example.com ',' Hi John ', $ body);   

    It's all.

    How to load an image from flash library? -


    I am developing an advertisement that includes the zooming effect on mouse hover. Currently it is loading an external image that is placed in the same folder.

    What do I want to do: I have to load the image from my flash library. Can anyone help me out quickly in this?

    In the Action Script, the Loader class is a display object, so that you can do the following:

      var imageLoader: loader = new loader (); Var Image: URLRequest = New URLRequest ("path / to / image.format"); ImageLoader.load (image); AddChild (imageLoader); ImageLoader.x = 200; ImageLoader.y = 300;   

    Note that you will need to import your appropriate classes (see AS3 Docs and view the above mentioned sections and use the relevant import statement) and that the URLRequest manufacturers exported them. The SSFF is relative to the file and is not in your source folder.

    Good luck!

    Mask image with static threshold in matlab -


    I have to infuse an image with a static threshold of 10% of the intensity in matlab. I get the intensity to use the mean2 (image) and it gives a meaning which is one of the 15.10 diagram, thus I mean the threshold 1.51 . im2bw (image, level) takes the threshold between 0 and 1. How to uninterite my image in matlab in this case?

    You can binaroarize the image with a simple logical statement. For perfection, I have also added the threshold fixation.

      threshold = means (image (:)); Binarymask = image & gt; 0.1 * threshold;    

    .net - How do I check if a filename matches a wildcard pattern? -


    इस सवाल का पहले से ही एक उत्तर है: < 8 जवाब

    मुझे पता है मैं कर सकता हूँ < / P> <पूर्व> डायरेक्टरी। गेटफ़ाइलें (@ "सी: \", "*। एचटीएमएल")

    और मुझे उन फाइलों की एक सूची मिलती है जो * .html फ़ाइल पैटर्न।

    मैं व्युत्क्रम करना चाहता हूं। फ़ाइल नाम abc.html को देखते हुए, मुझे एक ऐसा तरीका चाहिए जो मुझे बताएगा कि वह फ़ाइल नाम *। Html पैटर्न से मेल खाता है। उदाहरण के लिए

      class.method ("abc.html", "* .html") // रिटर्न true class.method ("abc.xml", "* .html") // गलत वर्ग को वापस लौटाता है। ("Abc.doc", "*।। Oc") // रिटर्न true class.method ("Jan24.txt", "Jan * .txt") // रिटर्न true class.method ("Dec24 .txt "," Jan * .txt ") // रिटर्न गलत   

    डॉटनेट में कार्यक्षमता मौजूद होना चाहिए। मुझे नहीं पता कि यह कहां से सामने आ गया है।

    पैटर्न बदलने के लिए regex एक तरह से जाना हो सकता है। हालांकि ऐसा लगता है कि बहुत सी बढ़त वाले मामले हैं और इससे अधिक परेशानी हो सकती है।

    नोट: प्रश्नों में फ़ाइल का नाम अभी भी अस्तित्व में नहीं है, इसलिए मैं सिर्फ एक निर्देशिका को लपेट नहीं सकता। Getfiles कॉल करें और देखें कि क्या परिणाम सेट में कोई प्रविष्टि है।

    जाने का सबसे आसान तरीका वाइल्डकार्ड को फिर से लागू करें, और फिर उसे लागू करें:

      सार्वजनिक स्थिर स्ट्रिंग वाइल्डकार्डटोरगेक्स (स्ट्रिंग पैटर्न) {वापसी "^" + रेगेक्स। एस्केप (पैटर्न)। बदलने के("\\*", "।*")। बदलें ("\\?", "।") + "$"; }   

    लेकिन अगर आप किसी कारण से regex का उपयोग नहीं कर सकते हैं, तो आप वाइल्डकार्ड मिलान के अपने स्वयं के कार्यान्वयन को लिख सकते हैं। आप एक पा सकते हैं।

    अजगर क्रियान्वयन से एक दूसरे को रखी गई है:

      सिस्टम का उपयोग कर; क्लास ऐप {स्टैटिक व्हाइड मेन () {कंसोल। वीडलाइन (मैच ("abc.html", "* .html")); // सही कंसोल लाता है। WrightLine (मैच ("abc.xml", "* .html")); // गलत कंसोल पर लौटता है। WrightLine (मैच ("abc.doc", "*।। Oc")); // सही कंसोल लाता है। WrightLine (मैच ("Jan24.txt", "Jan * .txt")); // सही कंसोल लाता है। WrightLine (मैच ("Dec24.txt", "Jan * .txt")); // रिटर्न झूठी} स्थिर बूल मिलान (स्ट्रिंग एस 1, स्ट्रिंग एस 2) {यदि (एस 2 == "*" || एस 1 == एस 2) सच हो; यदि (s1 == "") झूठी वापसी; अगर (एस 1 [0] == एस 2 [0] || एस 2 [0] == '?') रिटर्न मैच (एस 1 एसबस्ट्रिंग (1), एस 2 एसबस्ट्रिंग (1)); अगर (एस 2 [0] == '*') रिटर्न मैच (एस 1 एसबस्ट्रिंग (1), एस 2) || मैच (S1, s2.Substring (1)); विवरण झूठा है; }}    

    Excel VBA function works in Visual Basic, but fails in Worksheet -


    I am trying to create a data array using "CurrentRegion".

      function process data () dim data list () data list = range ("A1"). Work on current data 'Let's Function'   

    When I check it in Visual Basic (Run / F5), it works very well; There is no problem with my data list. However, if I set a cell in my worksheet:

       

    The function silently fails in the "CurrentRegion" phase. Why does this happen If you call a function call from an Excel cell (such as user-defined-function / UDF), you can access the functions assigned to the categories through parameters. Any access to other categories (and .CurrentRegion is a limit) will result in the "possible circular of cancellation of execution".

    In addition, in the UDF you can not modify anything on the worksheet - but the result of the function is only back!

    For more information, see this.

    php - Returning a variable that has to be updated from a function, not returning? -


    There are so many codes, but most of them are irrelevant, so I will only post one snippet

      $ error_message = ""; The function died ($ error) // If there is something, send the URL with the error message {session_start (); $ _SESSION ['Error'] = $ error; Header ("Location: http://mydomain.com/post/error.php"); Die (); }   

    This works fine, sends the user with an error session, which displays an error at error.php

      function fetch_post ( $ Url, $ Error_message) {$ sql = "SELECT * FROM inserted_posts WHERE name = '$ name'"; $ Result = mysqli_query ($ conn, $ sql); $ Num_rows = mysqli_num_rows ($ result); If ($ num_rows & gt; 0) {$ error_message = $ url} "Already exists in database, not added"; Return $ error_message; }}   

    This also works fine, checks that if the "post" exists in the database, if this happens, then this error $ error_message

      while ($ current <= $ s) {$ dom = file_get_html ($ start_url. Current); // page + page number $ post = $ dom- & gt; Search ('div [class = post] h2 a'); $ I = 0; Where ($ i & lt; 8) {if (empty ($ posts [$ i])) // If this link is found in $ post_now = 'http://www.somedomain.org' then check $ post [$ I] - & gt; Href; // Extension and save it fetch_post ($ post_now, and $ error_message); // send to function} $ i ++; } $ Current ++; // one page in the current page number)   

    This is the main loop, it leaves me some variables, and fetches posts from an exsternal website and in the function of the URL and error message Fetch_posts

    (I send it together, and I'm referring it to the context couse i asume is the only way to keep it global?)

     < Code> if (strlen ($ error_message> 0)) {dead ($ error_message); }   

    And this is the last snippet right after the loop, this error message is to send in a function error if the error message contains any characters, but it does not detect any characters is ?

    you want:

      strlen ($ error_message)> ; <  

    not

      strlen ($ error_message> 0)   

    In addition, call-time pass After-5.3.0 the conclusion has been removed and removed after 5.4.0, instead of calling your function in this way:

      fetch_post ($ Post_now, and $ error_message);   

    You might want to define it like this:

      fetch_post ($ url, and $ error_message) function {$ sql = "SELECT * FROM Inserted_posts WHERE name = '$ name' "; $ Result = mysqli_query ($ conn, $ sql); $ Num_rows = mysqli_num_rows ($ result); If ($ num_rows & gt; 0) {$ error_message = $ url} "Already exists in database, not added"; Return $ error_message; }}   

    Although you are returning an error message in a loop, it would be better to do this:

      $ error_messages = array (); // ... while while loop ($ error = fetch_post ($ post_now)) {$ error_messages [] = $ error; } // ... is the end while the (! Empty ($ error_messages)) {dead ($ error_messages); // Make changes to work with your array}    

    asp.net - Folder Permissions IIS 7 server. Denying acces to folder to web browsers -


    I'm new to the server and I want to ask a simple question.

    I have found a website (ASPX) with a folder where I store the image.

    Connect through the mobile HTC client (generic handler) and download images from the folder, but I want to deny access to the web in this folder

    Advance Thanks

    I think you can use something like this

      & Lt; Configuration & gt; & Lt; Location Path = "MySub Directory" & gt; & Lt; System.web & gt; & Lt; Authority & gt; & Lt; Deny users = "*" /> & Lt ;! - Disallow all users - & gt; & Lt; / Authorization & gt; & Lt; /system.web> & Lt; / Location & gt;   



    Is there a TypeScript library for speech recognition? -


    Is there a type of script library for speech recognition, such as the implementation of Chrome using WebKitPitch recognition?

    Too many all .d.ts files are ending; I do not see one there.

    php - Conditional INSERT INTO MySQL - WHERE NOT EXISTS -


    I am trying to INSERT in an inquiry when the customer does not already record to purchase a product.

    I have tried the SQL down, but it does not seem to work. Values ​​('$ userID', '$ product', '$ value') where the product is not present (from where the product selects the product)

      $ queryAddPurchase = "user id, product, = '$ Product' and User ID = '$ userID') ";   

    The error I am getting is:

    There is an error in your SQL syntax; Any advice will be appreciated!

      Add an unseen key to the optional tab purchase (`userID`,` product ') - this is just a one time Run. This table changes (UserID, Product, Price) value ('$ UserID', '$ Product', '$ Price'); Keep in mind, this prevents him from buying any product several times, which is not the desired result. / P>  

    ios - Localizable.strings causing plist parsing error -


    I localized the Localizable.strings file in my Xcode project to localize my application in a few different languages. However, after editing every file in the standard "key = value" format, I get the following parsing error, which does not specify a file, making it difficult to track what it mentions.

    CFPropertyListCreateFromXMLData (): Old-style Plist Parser: missing semicolon in dictionary on line 10. Parsing will be skipped to break on _CFPropertyListMissingSemicolon to debug.

    I've seen about each of the * .strings files, especially on line 10, and I have not received any interest or are concerned that due to this issue What is happening . Please tell me where I am wrong

    Here is a project that is a local theorem. All other files follow the same format. = "Voice address" "Header" = "Koppen" "key" = "blank" "value" = "wired" "" = "parameter" = " Parameter "" to add a new line "=" Request "" Request "=" Verzoek Uitvoeren "" Response "=" Antwoord "" Received Headers "=" Ontvangen Koppen "" Error "=" Fout "" Loading "=" Vergeauk AN Het Vesture "

    Then I use NSLocalizedString () to provide translated strings.

    As stated in the error message, you are losing semicolon at the end of each row. "foo" = "bar";

    what is the correct format

    math - Creating a rotation matrix based on two vectors -


    When I pass in a vector (V), I am looking to create a rotation matrix (m) where M * [0, 0, 1] (next) = V .

    I am doing this because I want to use the matrix to use other vectors to multiply them in the local place (not sure that this is the correct word but hopefully you Understand)

      V = [0, 1, 0] m =? Result = M * V = [0, 0, -1]   

    So if [0,0,1] becomes 90 degrees upwards [0,1,0] After multiplying by M ... what is M ?

    Three-dimensional rotation is difficult to think about and difficult to interpret in text is. However, according to estimates of a set of three-dimensional axes, the shape of your left hand is possible. See the following Wikipedia page describing Fleming's left hand rule; In particular, look at the second diagram, in which the fingers marked as I , b , and f :

    Make the same composition with your own hands, and instead of labeling the fingers i , b , and f , call them < Em> x , y , and z apart from this, we would say that at which point these three fingers meet the palm of your hand, the origin, point (0), and basically one of these fingers / thumbs On the side of the positive direction

    Vector V = (0 0 0) is a point with your pointing finger (which we have called y ). We want to rotate this point as the point (0 -1). This point sits on the z axis (thumb), but it is negative, so under the tip of the thumb in the direction of the root, one unit sits "down".

    So, to rotate the point (0 0) (0 -1 -1), we need to rotate it around the x axis (the middle of your middle finger) . Imagine putting a compact disc on your middle finger, from which it sits on the plane defined by your director finger and thumb. ( x , y ) plane ??? And insert a mark on the disk one unit from its center Now imagine to align that mark with your index finger so that sitting on the mark point (0 to 0). You can rotate the disk around your middle finger so that sitting on the mark point (0-1 -1). Therefore, the required rotation is a rotation around the x axis.

    The following Wikipedia page gives you the equation for it. x is the matrix for the rotation around the axis:

      / 0 0 | 0 cos θ -sin θ | If you use your right hand to rotate the disk, then the matrix is ​​defined so that a negative value for θ matches the clockwise speed with its right hand (and vice versa for a positive value) The angle we need to rotate is the negative quarter turning and the required matrix:  
      / 1 0 \ | 0 0 1 | \ 0-0 /   

    Remember that Angels can be expressed in degrees or radians, so if you implement more general rotation in the code, then you have to see this What is the hope of your math library?

    html - How to keep these two elements next to eachother -


    At first I was coding the contact form to my websites, and I wanted to create it so I returned to the options Had to go or send But I saw that they were not together. Now, I know that this is probably a very silent question, but I have got back from vacation, so I have a very big brain fart.

    Here's my HTML:

      & lt; P & gt; Go back & lt; Sup> Or & lt; / Sup> & Lt; / P & gt; & Lt; Input type = "submit" value = "send!" Name = "submit" />   

    I wish I could show an image but I can not do this at the moment.

    This style is & lt; P & gt; Add to tag:

      Display: inline-block;   

    Example:

      p {display: inline-block; }   

    Try to use a square or id on it, otherwise and lt; P & gt; -tags inline-block s.

    HTML

      & lt; P class = "myDescription" & gt; Go back & lt; Sup> Or & lt; / Sup> & Lt; / P & gt; & Lt; Input type = "submit" value = "send!" Name = "submit" />   

    CSS

     . MyDescription {Display: Inline-Block; }    

    Behavior of extended bytes/characters in C/POSIX locale -


    Both C and POSII require only limited characters in C / POSIs locale, but additional characters are present . It leaves many freedoms for implementation; For example, support for all Unicode (in the form of UTF-8) in C locale is consistent with behavior. However, the most historic implementation takes C-locale "8-bit-clean" single-byte character encoding, either as ISO-885 9-1 (Latin-1) or a "abstract bit-bit set set" Non-ASCII bytes are abstract characters that are not with any particular identities. (In the latter case, if the compiler defines __ STDC_SIO_10646___ , then they usually correspond to Unicode characters , Usually Latin-1 grade.)

    Another analogous option that seems too low is popular that all non-ASCII bytes are treated as non-characters, i.e. they respond with a EILSEQ error Please give it.

    I am interested in knowing whether the implementation is to take this or any other unusual option in implementing the local area. Is there any implementation where attempt to convert "high bytes" in local local results EILSEQ or in addition to treatment in the form of single-byte characters or UTF-8 (abstract or Latin-1) Does anything?

    In the last reply to your comment:

    Basically it is possible that bytes out of portable character sets can be illegal non-bytes (EILSEQ) or some multibyte encoding (UTF-8 or a Stateless Legacy CJK encoding)

    You can find an example

    Plan 9 supports only "C" locale as you can see and, when it comes to port Ebl letter is a rune out, so it handles it as a character from a different encoding.

    There may be another candidate and (as far as they use). In the Minix source code, I also searched for new encoding when the size of the letter was not 8bit.

    Ruby on Rails Each... do loop displays the hash -


    I'm building an app's management dentists and locations. I have just finished showing the list of all the practitioners in that place and finished adding the code and adding the code. However, when I present the page, it is dumping the entire hash (places. Practitioner.each) above my formatted list. How did I go to hash?

    My show.html.erb here

      & lt; P & gt; & Lt; B & gt; Place name: & lt; / B & gt; & Lt;% = @ location.location_name% & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; B & gt; Location ID: & lt; / B & gt; & Lt;% = @ location.id% & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Strong & gt; Doctors at this place & lt; / Strong> & Lt; / P & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; First name & lt; / Th & gt; & Lt; Th & gt; Last name & lt; / Th & gt; & Lt; Th & gt; Role & lt; / Th & gt; & Lt; Th & gt; Production target & lt; / Th & gt; & Lt; Th & gt; & Lt; / Th & gt; & Lt; / TR & gt; & Lt;% = @ location Practitioner. Businessman & Gt%; & Lt; TR & gt; & Lt; Td> & Lt;% = Doctor First_name% & gt; & Lt; / Td> & Lt; Td> & Lt;% = practitioner.last_name% & gt; & Lt; / Td> & Lt; Td> & Lt;% = practitioner.role% & gt; & Lt; / Td> & Lt; Td> & Lt;% = Doctor.production_gall% & gt; & Lt; / Td> & Lt; Td> & Lt;% = link_to "edit", edit_practitioner_path (practitioner)%> & Lt; / Td> & Lt; / TR & gt; & Lt;% end% & gt; & Lt; / Table & gt;   

    and how this page looks ...

      Location name: Waterview location ID: 1 doctor at this location [# & lt; Business ID: 1, first_name: "Dr. Robert", last_name: "angux", role: "dentist", production_gown: 10000, location_id: 1, created_t: "2013-03-26 17:34:38", updated_t : "2013-03 -26 21:52:37" & gt;, # & lt; Business ID: 3, first_name: "mementa", last_name: "hickleberry", role: "hajinist", production_gown: 4800, location_id: 1, created_t: "2013- 03-26 21:49:46", updated_at: "2013 -03-26 21:49:46 "& gt;, # & lt; Business ID: 4, first_name: "Dr. Sandra", last_name: "Pager", role: "dentist", production_gown: 22000, location_id: 1, created_t: "2013-03-26 22:05:38", updated_t: "2013-03-26 22:05:38" & gt;] First Name Last Name Role Production Target ** Dr. Robert Anjoy Dentist 10000 Edit Smantha Hickleberry Hygenist 4800 edit Dr. Sandra preser dentist 22000 edit   

    What am I doing wrong? I just have a table list ...

    Dennis

    this line is yours problem. You are using the "=" symbol that displays the output of the Ruby statement:

      & lt;% = @ location.practitioner.each do | Businessman & Gt%;   

    Change it to:

      & lt;% @ location.practitioner.each do | Businessman & Gt%;    

    html - How to render a table like the first picture use css? -


    छवि दर्ज करें यहाँ विवरण

    मैं एक मेज सीएसएस करना चाहता हूँ, लेकिन मैं" tr "

    इस सीएसएस को जोड़ें:

      टीडी {सीमा: 1 पीएक्स ठोस # 000; }    

    firewall - Block Internet Connection on Eclipse -


    Is it possible to block all network connections on Eclipse? My position is that I have unit tests in Eclipse and I want to see which unit of the test will try to connect to the network. It was difficult to understand from source code and I think that is the easiest way to block connection and see who will be unsuccessful.

    Thank you in advance

    Sometimes I do this:

    In Eclipse Preferences, select "Active Provider" for GenNell-> Network Connection, "Manual" and set invalid proxy.

    JMeter and Oracle AQ -


    Anyone have any experience using JMeter and Oracle AQ? I am trying to publish a message in Oracle, using a JMS publisher, but my only information is from the binding file.

    First of all, read ( Oracle® Fusion Middleware for Configuring and Managing JMS Oracle WebLogic Server chapter 8: Oracle AQ JMS with interoperability), so it needs to know about you that provides you with AQ allows users to grant, AJ Jems connection factories name, and AQ remote Jeandiai Jems Destination name It says weblogic, but they use very config we do.

    1. Put Oracle JDBC Jar (ojdbc6.jar) and Oracle AQ Jar (found in $ aqapi.jar, $ in Weblogic.

        java.naming : WL_HOME / server / lib) in jmeter's lib dir   
    2. Create jndi.properties file with the following entries. factory.initial = oracle.jms.AQjmsInitialContextFactory db_url = Your Oracle DB instance JDBC URL java.naming.security.principal = username_with_aq_permission_grants java.naming.security.credentials = password

    3. the put jndi.properties in a jar

        jar cf my- JNDI-properties.jar jndi.properties   

      and put in a JM EB ODD DIR

    4. Create Jems publisher Jemaitr, and enter:

      1. Check the "use" jndi.properties file
      2. Connection Factory: See and keep an AM JMS prefix value. Do not use normal factories
      3. Destination :. Either line / Your_Queue_Name or subject / Your_Topic_Name
      4. Uncheck "? Use authorization"

        Fill out what you need.

      5. Have fun.

        Thanks for the info jndi.properties.

    php - mysql_fetch_array() and mysql_query() problems -


    I keep this error in my error log and I'm not sure why I have seen everywhere and Google has But I lost and I need help: < P> This is the reference that is the code:

      $ getlatlong = mysql_query ("choose from * zipcity where zip = '" $ url [2] "'", $ thief). $ Ll = mysql_fetch_array ($ getlatlong);   

    If you need this, then this is the full code:

       Current_group- & gt; Name; $ Group_id = $ bp- & gt; Group-> Current_group- & gt; Id; $ Groupll = groups_get_groupmeta ($ group_id, $ meta_key = 'latlong'); $ Groupnamecount = strlen ($ group_name); $ Groupcity = groups_get_groupmeta ($ group_id, $ meta_key = 'city'); $ Groupstate = groups_get_groupmeta ($ group_id, $ meta_key = 'state'); $ Mapaddress = $ group_name '+'. $ Groupcity '+'. $ Groupstate; If ($ groupnamecount == '5') {$ grouptype = "zip"; } If ($ grouttpe == "zip") {$ url = explosion ('/', $ _ server ['REQUEST_URI']); $ Zip = $ url [2]; $ Getlatlong = mysql_query ("Select * Zipcode Zip = '". $ Url [2]. "'", $ Conn); $ Ll = mysql_fetch_array ($ getlatlong); } And {$ groupcity = groups_get_groupmeta ($ group_id, $ meta_key = 'city'); $ Groupstate = groups_get_groupmeta ($ group_id, $ meta_key = 'state'); $ Mapaddress = $ group_name '+'. $ Groupcity '+'. $ Groupstate; }   

    UPDATE

    The issue was that code $ was further declared under the code. Once I decided that, it worked perfectly. Thanks to everyone who answered!

    There is a problem with your connection $ connection, it is not connected and return empty < / Div>

    c++ - Weird result on simple linked list code -


    OK I'm paying around with a simple linked list code.

    If I keep the head node in the public, then I declare an indicator (head 2) to store the top node of the first list (first) in the main program. I declare second name as second list, and assign head 2 as the top node of the second list. Then I remove head2 then I reach out to the members of "seconds" (whose head has been removed from the node) and print them I hope to make a split mistake, but it works, only the data of the head node For printing is 0. What is for me, is that if the head node has been removed, then what is the next indicator of the head node in memory? (It is accessed by print to sort through the list. I am using G ++ 4.6.1 in Ubuntu. Here is the code:

      # include  data = one; navy-> next = head; head = nawness;} zero list 1 :: print () {n} Od * dummy = head; while (dummy) {std :: cout  data  gt; next;}} int Main () {list1 first; first.insert (1); first.insert (2); first.insert (4); first.insert (9); list 1 second; node * head2 = new node; head2 = first Head; second head = head 2; delete head2; second print (); return 0;}    

    Your code invokes undefined behavior by accessing the object whose lifetime has expired.

    There is nothing weird to do that it can still work.

    Undefined behavior can mean anything happiness, in which you are looking.

    java - Display JLabel partially on top of another JLabel -


    I am trying to display cards in my GUI and I want to overlap the card to save space. However, I can not seem to work on this. I am currently using a midgetout, though it seems that it is more than anything else than the JLAB issue.

    To describe it at a high level, consider playing a game of cards in real life. When you hold the card in your hand, you only need to see the part of the card, so one card of the card overlaps with a second card, and until the last card is not fully displayed when Until that nothing happens on it. I want to overlap in a way that only one part below the card is shown, and then the top card is shown completely.

    The current problem is that when I add JLable to JNLL, this is what is already there with the latest label I want it already exists. I can not find any way that allows me to determine which label is in front.

    I want to do something like this:

    Put 1 card in cell 0 at any place where both cards are exaggerated, card 2 is top

    Just folds it back, which comes first on the performance of a component, suggests first-service priority. I have a lasting, first service priority. And as I said, I had no luck trying to find a method that allows anyone from this.

    If none of these is clear, please let me know. thank you in advanced.

    It seems that the JPNL was found in the container, in which there is a setComponentZOrder () < / Code> That sounds like what it is necessary for you.



    filter - Regex filtering list of words -


    I need a simple regex, but I can not do it by my own I have no luck with different methods I try to do

    I have a list of words for which I have to separate from my lessons.

      text = hoy es un dia soleado y ma ±   

    list of words that I will filter by text: y , es , s , es , un , UN , un , Las , Los , la , lo , etc

    then The resultant text will be: <<< Code>

    These words will be a filter list that I need to filter with my texts is.

    I tried to do something like this:

      (?! [LL] [AAO] [SS] * \ b [[EE]? [LL] \ b ]) [\ W] +   

    so I can filter with:

    ?! [LL] [AAO] [SS] * \ b word las , loss , las , , lo

    [EE]? [Ll] \ b] the word l , l EL , eL < P> But if I apply, then the letter L and L are not filtered.

    How can I do this regex?

      s / \ b (y | es | es | un | UN | combined Explanation:  

    \ b is a word boundary. It looks for places where words break, but in reality nobody chooses.

    javascript - Gridview loading animation using JQuery is a still frame i.e. does not animate -


    Hello and thanks for watching.

    In my previous project, I used to use an UpdatePanel to load the loader GIF when I was busy in making data bound with my gridview. I wanted to transfer this part of the code to JQuery so that I change the update panel with an IMG tag to connect to GIF after seeing this solution ()

    In my index.html page I have

        

    And I called ShowLoaderImage from ASP: The button I was using to populate the source of Gridview.

      & lt; Asp: button id = "View_Data_Button" CssClass = "Datatoon" OnClick = "View_Data_Button_Click" OnClientClick = "ShowLoader Image ()" Runat = "Server" Text = "View Data" />   

    I was hoping to start spinning the image when I click on the button to load the gridview, and disappeared if the gridview was loaded from the document. Instead, I see a frozen frame of GIF - no animation. How can I fix it?

    I suggest changing the html in the element

      $ ('# Data_loding_div'). Html ('& lt; img alt = "loadingImage" src = "/ images / loadingImage.gif" / & gt;')   

    Getting later data, $ ('# data_loding_div'). Html (data);

    How do I use an OAuth2 token with ANY version of the youtube python API -


    I started to grab the token Oauth2 with some functions:

    I tried: < / p>

      yt_service = gdata.youtube.service.YouTubeService () yt_service.developer_key = YOUTUBE_DEV_KEY yt_service.access_token = FRESH_OAUTH2_ACCESS_TOKEN yt_service.client_id = YOUTUBE_OAUTH2_CLIENT_ID yt_service.email = YOUTUBE_USER_EMAIL yt_service.password = YOUTUBE_USER_PASSWORD yt_service.source = YOUTUBE_DEV_SRC yt_service.ProgrammaticLogin ()   

    but I'm not sure how to properly GetFormUploadToken or UpdateVideoEntry call. Earlier I was just using a developer_key and it was working (using gdata.youtube.service.YouTubeService () ).

    I also tried to use this for example, but it did not comment very well and the docs were not any better:

    I just tried to change Construction (YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, http = credentials.authorize (httplib2.Http ()))

    the

    Construction (YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, ACCESS_TOKEN = current_access_token)

    But it's just complaining that it does not know that is ACCESS_TOKEN .

    This is how I am doing this

      def _yt_oauth_flow_hack (auto, secret_json_str, scope, redirect_uri = none): "" "version of a hacked: oauth2client.clientflow_from_clientsecrets" "client_type, = clientsecrets.loads (secret_json_str) if client_type client_info [Clientsecrets.TYPE_WEB, clientsecrets.TYPE_INSTALLED] return OAuth2WebServerFlow (client_info [ 'client_id'], client_info [ 'client_secret'], scope, redirect_uri = redirect_uri, user_agent = none, auth_uri = client_info [ 'auth_uri'], token_uri = client_info [ 'token_uri']) def begin_authentication ( Self): '' 'authentication process begins and URL us We have to authorize this to be authorized to use the material that gives it, otherwise create the service and no one will go back, '' 'credentials = self._storage.get (), then there is no credibility the Print: - flow = self._yt_oauth_flow_hack (AUTH_JSON, self.scope) flow.redirect_uri = OOB_CALLBACK_URN 'stored credentials we need fresh authorization' return flow.step1_get_authorize_url () elif (credentials.invali d or credentials.token_expiry & lt ; = (Datetime.now () + timedelta (second = time.timezone))): print 'end of certification period - try going to refresh them' Try: http = httplib2.Http ( ) Credentials Refresh (HT) Print 'Success!' Except AccessTokenRefreshError: Unable to refresh print credentials - Request new people. Credit http = httplib2.Http () http = credentials.authorize (http), self.service; - Flow = self._yt_oauth_flow_hack (AUTH_JSON, self.scope) flow.redirect_uri = OOB_CALLBACK_URN return flow.step1_get_authorize_url () print '& gt credibility' = Weight ( 'youtube', 'v3', http = http) No   

    What do I download when I set up my API account AUTH_JSON storage is a customized version of their storage to work with a postgres db, but the principle is still the same.

    php - How to Get XML Second Child -


    Does anyone help me get another child of the following XML:

      & Lt; ? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; GetItemResponse xmlns = "Kalash: eBay: APIs: EBLbase Content" & gt; & Lt; Timestamp & gt; 2013-03-27T03: 39: 01.575Z & lt; / Timestamp & gt; & Lt; Ack & gt; Success & lt; / Ack & gt; & Lt; Version & gt; 815 & lt; / Edition & gt; & Lt; Build & gt; E815_CORE_API_15855340_R1 & lt; / Build & gt; & Lt; Items & gt; & Lt; ApplicationData & gt; 881030. B.0000 & lt; / ApplicationData & gt; & Lt; Automatic payment & gt; False & lt; / Automatic payments & gt; & Lt; BuyerProtection & gt; ItemEligible & lt; / BuyerProtection & gt; & Lt; BuyItNowPrice currencyID = "USD" & gt; 0.0 & lt; / BuyItNowPrice & gt; & Lt; Country & gt; America & lt; / Country & gt; & Lt; Currency & gt; Dollar & lt; / Currency & gt; & Lt; Gifticon & gt; 0 & lt; / Gifticon & gt; & Lt; HitCounter & gt; RetroStyle & lt; / HitCounter & gt; & Lt; ItemID & gt; & Lt; / ItemID & gt; & Lt; ListingDetails & gt; & Lt; Adult & gt; False & lt; / Adlt & gt; & Lt; BindingAuction & gt; False & lt; / BindingAuction & gt; & Lt; CheckoutEnabled & gt; True & lt; / CheckoutEnabled & gt; & Lt; ConvertibuetinoPrice Currency ID = "USD" & gt; 0.0 & lt; / ConvertedBuyItNowPrice & gt; & Lt; ShippingServiceOptions & gt; & Lt; ShippingService & gt; UPSGround & lt; / ShippingService & gt; & Lt; Shipping servicecast currencyID = "USD" & gt; 9.99 & lt; / ShippingServiceCost & gt; & Lt; / ShippingServiceOptions & gt; & Lt; InternationalShippingServiceOption & gt; & Lt; ShippingService & gt; StandardInternational & lt; / ShippingService & gt; & Lt; Shipping ServiceCast Currency ID = "USD" & gt; 39.99 & lt; / ShippingServiceCost & gt; & Lt; / InternationalShippingServiceOption & gt; & Lt; Items & gt;   

    I am using one to see the cycle through all the items ($ items as $ items). I need to get the service from shipping service and shipping.

    I want to do the following but this does not work:

      // $ $ item for shipping- item-> GetElementsByTagName ('ShippingServiceCost') - & gt; Items (0) - & gt; NodeValue; // $ items for international services- & gt; GetElementsByTagName ('shipping servicecast') - & gt; Item (1) - & gt; Nodeville; Edit  

    Edit

    Because you have posted the full XML Php Xml traversing will look like this:

      $ xml = simplexml_load_string ($ response); Foreign currency ($ xml - gt; item-> listing as a $ child) {foreach ($ child- & gt; children () as the $ option) {if (isset ($ option-> ; Shipping service service)) {echo $ option- & gt; GetName () ":". $ Option- & gt; Shipping ServiceCast "& lt; br & gt;"; The XML you posted contains errors, in the future please validate it before posting so that we do not need to fix the errors.)  

    If you have PHP 5 + So you can use Simplex to parse your XML. In addition, you have to close your "item" XML tag.

    Then the code is created:

      & lt ;? Php $ xml = simplexml_load_file ("test.xml"); Foreign ($ xml- & gt; children () $ as child) {echo $ child-> GetName () ":". $ Child-> Shipping ServicesCast "& lt; br & gt;"; }? & Gt;   

    XML:

      & lt; Items & gt; & Lt; ShippingServiceOptions & gt; & Lt; ShippingService & gt; UPSGround & lt; / ShippingService & gt; & Lt; Shipping servicecast currencyID = "USD" & gt; 9.99 & lt; / ShippingServiceCost & gt; & Lt; / ShippingServiceOptions & gt; & Lt; InternationalShippingServiceOption & gt; & Lt; ShippingService & gt; StandardInternational & lt; / ShippingService & gt; & Lt; Shipping ServiceCast Currency ID = "USD" & gt; 39.99 & lt; / ShippingServiceCost & gt; & Lt; / InternationalShippingServiceOption & gt; & Lt; / Item & gt;   

    Output:

      Shipping Services Option: 9.99 International Shipping Service: 39.99    

    html - How to Prevent form submitting using jquery? -


    In fact, in the jsp page I am using spring tags and jquery code. Hear my code ..

      & lt; Form: Form Action = "Process" & gt; & Lt; P class = "forget" & gt; & Lt; A href = "Login / Forgot Password" class = "submit_forgot password" & gt; Forgot your password? & Lt; / A & gt; & Lt; / P & gt; & Lt; P class = "remember" & gt; & Lt; Input id = "signin_submit" value = "sign in" tabindex = "6" type = "submit" & gt; & Lt; / P & gt; & Lt; / Form: Form & gt; & Lt; Script & gt; $ ('# Login'). Submit to: function () {$ .blockUI ({Message: '': {Target: '#', success: function (feedback text, status text, excerpt, $ form) {warning (response text);} & Lt; h1 & gt; Just a moment ... & lt; / h1 & gt; '});}}} $ ('. Submit_forgotPassword ') (function (event) {event.preventDefault (); // Default Hyperlink Behavior $ ("# Login") Ent ("Action", $ (this) .attr ("href")); $ ("# login"). Submit ();}); & lt; / Scripts & gt;   

    The problem form is not necessarily the necessary car Rawai

    Actually two actions in my code 1. submit 2. forgot password ?

    1. For the first time We give the right price and click submit. It is working perfectly ..

    2. Second time (after click logout) we send emails and forgot password ? Link email will send an email ID that is also working perfectly ... Now the problem has occurred ...

    3.3 times when we give correct value Are and Click submit to send email to email (this is working as a second step) ...

    Why is it working so I am specifying every click operator form ...

    Ever forgot password?

    You forgot the password by clicking the "Forgot Password" button Forms are changing on the "gone" link. We have to link the "submit" to submit the form or else the "Submit" button will post on the "forgot password" link.

      & lt; Script & gt; $ ('# Login'). Submit to: function () {$ .blockUI ({Message: '': {Target: '#', success: function (feedback text, status text, excerpt, $ form) {warning (response text);} & Lt; h1 & gt; Just a moment ... & lt; / h1 & gt; '});}}} $ ('. Submit_forgotPassword '). (Function (event) {event.preventDefault () ; // Prevent the default hyperlink behavior Save the original form before saving it before submitting the link link var submitBtnLink = $ ("# LOGIN" $. ("Action"); $ (" $ ("Action", $ (this) .attr ("href")); $ ("# login"). Submit (); // Forgot Password $ ("# Login") and submit Return to the form action to submit the link. At ("Action", submitBtnLink);}); & lt; / script & gt;   

    Try it < / Div>

    geometry - IDML : How are shapes stored in IDML files? -


    While reading IDML spread, I have encountered many figures. Each size has its own geometry that looks -

      - & lt; Pathgometry & gt; - & lt; GeometryPathType PathOpen = "false" & gt; - & lt; PathPointArray & gt; & Lt; Pathpoint typewrite = "- 611.51548.5" left direction = "- 611.5" 1548.5 "anchor =" - 611.5 "1548.5" /> & Lt; Pathpoint Type Right Drawing = "- 611.5 2339.5" Left Direction = "- 611.5 2339.5" Anchor = "- 611.5 2339.5" /> & Lt; Pathpoints type right drawing = "- 533.3 2339.5" left direction = "- 533.3 2339.5" anchor = "- 533.3 2339.5" /> & Lt; Pathpoints type right drawing = "- 533.3 1548.5" left direction = "- 533.3 1548.5" anchor = "- 533.3" 1548.5 "/> & Lt; / PathPointArray & gt; & Lt; / GeometryPathType & gt; & Lt; / PathGeometry & gt;   

    This is trivial for rectangular (as shown above), where and lieutenant; Pathpoints & gt; Each attribute in the element indicates an endpoint in the rectangle. What happens to other shapes? In other words, what is the meaning of right-hand drawing, left-hand drawing and anchor properties? Is there a way to determine how he is looking at, pathpoints?

    Thank you.

    Each IDML pathpoint type is a node on a cubic with control and anchor points Define the end points and curvature of the combination line. All the rows of idml are defined as they decrease, but as you have seen, the control and anchor points for a straight line are the same. Straight line polygons (like a triangle like) are defined in the same way.

    There is only a small collection of size shapes (see rectangular, oval, graphic lines, polygon - see 10.3.1 in the specification). You can draw any form from IDML by drawing a line at a time, but it is more efficient to make different routines for rectangular and oval shapes.

    If you make the row, first if PathOpen == false.

    Recognizing a face in a set of images -


    I am currently searching to search in a set of images for a face which is present on an image I'm giving a starting point

    The basic idea behind this is that I have an example of images eg a party and want to find all the images of myself, thus after party I use a webcam or something like that I do and take the image of my face. Then goes through the library or program folder and connects each image to "webcam image" Optinally search can be corrected only by not providing a base image but multiple rendering.

    Is not a library available to a person on the image but to recognize it. Face face of this image in the form of face, and the face has a 90% chance of being the same as compared to this second image?

    Take a look at OpenCV for C ++

    I work with it , And have realized those apps that can detect game cards based on pre-loaded templates of those cards, but OpenCV is also excellent for recognizing (such a templateing face)

    MiB Is this a good starting point?

    c# - passing in Geography Type and SQL converts to Geography type? -


    How do I get geography data (the lawn / lawn) and it has the geography column in a SQL database. I'm referring Microsoft.SqlServer.Types SqlGeographyBuilder

    I should also add that this is SQL2008r2 to get

    My C # project too 4.0 is using

    This is just a snippet that I am using in my C # code to code:

     < Code> SqlParameter param21 = new SqlParameter (); Param21.ParameterName = "@ Size"; Param21.UdtTypeName = "Geography"; Param21.SqlDbType = System.Data.SqlDbType.Udt; Param21.Size = 1; SqlGeographyBuilder sqlGeogBuild = New SqlGeographyBuilder (); Sql geographical sqlGeog = null; SqlGeogBuild.SetSrid (4267); If (inputReader [parmLatColumnName] length of .ToString () & gt ;. 0 & amp; & amp; inputReader [parmLonColumnName] .ToString () Length & gt ;. 0) {sqlGeogBuild.BeginGeography (OpenGisGeographyType.Point); Sklajogbildkbeginfaigre (Flotkpars (Inputrider [Prmltklumntme] ()) Ktostring, Flotkpars (Inputrider [Prmlonsolumntme] Ktostring ())); SqlGeogBuild.EndFigure (); SqlGeogBuild.EndGeography (); SqlGeog = sqlGeogBuild.Constructed geography; Param21.Value = sqlGeog; } And {param21.Value = DBNull.Value; } SqlComm.Parameters.Add (param21);   

    When I used Profiler I found that my query looked like this:

      declared @ p21 sys.geography set @ p21 = convert (sys. geography, 0xE6100000010C00000080B0374040000000806BD057C0) executive insPoints @ stCty = N'31256 ', @ InstrumentType = N' '' 'ogVal', @ FileDate = '2008-01-03 00:00:00', @ EntryNumber = N '' '500' '@ volume = N'NULL, @ p = N'NULL' @ lessor = N 'name' @ lessee = N 'company name' '', @ InstrumentDate = '2000- 01 -12 0:00:00 ', @ duration = 3, @ TermType = n' '' 'year', @ expired = '2010-07-12 00:00:00', @ royalty = 0.00 , 01,00,000, GrossAcres @ = 1.00, 0,00,000, @ AgencyId = N'NULL ', @ Agency = n' Free ', @ EffDate = null, @ survey = N' A500, A06, A700, A400, A900 ' , @ Longitude = -9 1.00,00,00,000, @lititude = 30.00,00,00,000, @ size = @ p21   

    why is it a geography Type is to change when I am passing it in a form of geography?

    SQL Server permits to define its data type. This is called User Defined Data Type (UDT).

    You are using the user-defined type to define @Shape . As you do not have a different user defined data type Georgaphy is defined in your database, this system changes the value for the datatype geography . Episode is not important, it is importtant that using a different property of

    SqlParameter class - DbType instead of reference db data type directly to this Will be resolved. However, there is no geography member in it.

    It looks like the difference between Net and SQL Server. Try setting up DbType = "Geography" , but it is unlikely to work.

    cocoa touch - How to place another TextLabel in UITableViewCell's right side in iOS -


    I want to put another cell text on the right side of UITableViewCell in iOS such as the following picture < / P>

    Enter image details here

    How can I do this ?

    Thanks for any help.

    UITableViewCell has a property, detailTextLabel , which you can inquire about Just specify the text that labels match the text label

    ie.

      cell.textLabel.text = @ "Google"; Cell.detailTextLabel.text = @ "tomorrow";   

    Small "arrows", in addition, is a helpful view on the cell

      cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;    

    ios - Good practice loading UIImage -


    There are some icons in my app that I reuse in several views (for example a favorite icon).

    To save memory, I was wondering if using a class with class messages that loads static images would be a good idea?

    For example:

      + (UIImage *) Favorites icon {Fixed UIImage * icon; If (! Icon) icon = [UIImage imageNamed: @ "favorite .png"]; Return icon; }   

    Or should I just use the + (UIImage *) nameNamed: (NSString *) name every time I need it?

    Thanks for your advice.

    [UIImage imageNamed:] is already doing something hood Actually, it's smart, because it is doing things like dumping images when the memory is low and they are not needed immediately, while your preferred icon method fills them forever Happens

    In general, it would be better to avoid optimization, unless you have not prepared your app and then have a profile to see how / where it needs correction otherwise you will waste time Whether or even doing things worse, I advise you how to use your app to use instruments, it is very complicated, but it has been a lot of fun You let him hang.

    Hadoop - Produce multiple values for a single key -


    मैं अपनी आवश्यकता के अनुसार हौप में wordcount प्रोग्राम को सफलतापूर्वक बदल कर सका। हालांकि, मुझे एक और स्थिति है जहां में मैं 3 मानों के लिए एक ही कुंजी का उपयोग करता हूं। मान लें कि मेरी इनपुट फाइल नीचे दी गई है

      एक अपरकेस 1 पहले नंबर नहीं मैं एक छोटे से छोटे अक्षर b। अपरकेस 2 secondnumber II romannumber b लोअरकेस   

    वर्तमान में मेरे नक्शे में / प्रोग्राम कम करें, मैं ऐसा कुछ कर रहा हूँ नीचे। यहां ए कुंजी है और 1 मूल्य है।

      ए 1   

    मुझे अपने मानचित्र को नीचे की तरह कुछ करने के लिए कम करना होगा।

      ए 1 मैं   

    मैं उन्हें नीचे की तरह 3 अलग-अलग कार्यक्रमों में कर सकता हूं और आउटपुट का उत्पादन कर सकता हूं।

      ए 1 ए मैं ए   

    हालांकि, मैं उन्हें एक कार्यक्रम में ही करना चाहता हूं असल में, मेरे नक्शा समारोह से मैं यह करना चाहता हूं।

      संदर्भ.लिखित (कुंजी, मान 1); context.write (कुंजी, मान 2); context.write (कुंजी, value3);   

    क्या कोई ऐसा तरीका है जो मैं इसे तीन अलग-अलग कार्यक्रम लिखने के बजाय एक ही कार्यक्रम में कर सकता हूं?

    संपादित करें:

    मुझे एक अधिक स्पष्ट उदाहरण। मुझे नीचे की तरह कुछ करना चाहिए

      एक अपरकेस 1 पहलेनंबर 1.0 फ्लोटनम्बर स्ट्र स्ट्रिंग चेकिंग एक अपरकेस 2 सेकंडनम्बर 2.0 फ्लोटनंबर आईएनजी स्ट्रिंगचेकिंग   

    मेरा अंतिम आउटपुट होगा,

      ए 3 3.0 स्ट्रिंग   

    3 दो पूर्णांक का योग है, 3.0 फ्लोट संख्या का योग है और स्ट्रिंग दो स्ट्रिंग्स का समाकलन है।

    सबसे पहले आपको अपने सभी तीन मानकों के लिए समग्र लिखने योग्य की आवश्यकता होगी।

      सार्वजनिक वर्ग संमिश्र मूल्ययोग्य लेखन योग्य {int val1 = 0; फ़्लैट वैल 2 = 0; स्ट्रिंग वैल 3 = ""; सार्वजनिक संमिश्र () {} सार्वजनिक संमिश्र विरेटिव (इंट वैल 1, फ्लोट वैल 2, स्ट्रिंग वैल 3) {this.val1 = val1; This.val2 = val2; This.val3 = val3; } @ ओवरराइड पब्लिक वाइड रीडफिल्ड (डेटाइनपूट इन) IOException फेंकता {val1 = in.readInt (); Val2 = in.readFloat (); Val3 = WritableUtils.readString (इन); } @ ओवरराइड पब्लिक रिक्त लिखित (डेटा आउटपुट आउट) IOException फेंकता {out.writeInt (val1); out.writeFloat (val2); WritableUtils.writeString (बाहर, val3); } सार्वजनिक शून्य मर्ज (कम्पोजिट योग्य अन्य) {this.val1 + = other.val1; This.val2 + = other.val2; This.val3 + = other.val3; } @ ओवरराइड सार्वजनिक स्ट्रिंग टूस्ट्रिंग () {return.val1 + "\ t" + this.val2 + "\ t" + this.val3; }}   

    फिर कम करने में आप ऐसा कुछ करेंगे ...

      सार्वजनिक शून्य कम करें (पाठ कुंजी, अयोग्य और लिखित; संमिश्र-योग्य & gt; मूल्य, संदर्भ सीटीएक्स) IOException फेंकता है, बाधित; एक्सपेशेशन {संमिश्र विशय योग्य; के लिए (संमिश्र मूल्ययोग्य अगले: मान) {out.merge (अगले); } Ctx.write (कुंजी, बाहर); }   

    आपका मैपर केवल एक समग्र मानकों प्रति नक्शे आउटपुट करेगा।

    मैंने इसे संकलित करने की कोशिश नहीं की है, लेकिन सामान्य विचार है क्या आप वहां मौजूद हैं।

    user interface - Dynamic Population of Popup Menu - MATLAB -


    Another guide question.

    I have created a GUIDE figure with a pop up menu. While calling data, the elements of the menu are dynamically determined. Example: myGUI (data, popup name) should be called and then the strings included in popup names should be used to label options. I am able to do this in the callback for the popup menu. Although this means popups will not be populated until I actually press on the popup menu and select the first blank (empty) option.

    My question is how can I populate it dynamically Create a function (or some other function) I also need to do this with a proper function (fill the row and column names, Although this is not dynamic anymore)

    My unsuccessful attempt, which led me to realize that I could not use handle, the data in the construction work was as follows:

     < Code>% --- object builder When executed, after setting all properties. Function Popup menu 1_CreateFcn (H object, Event data, Handle) are popup names = varargin {2}; Set (hObject, 'string', {handles.popupNames {1: end}}); % --- executed during the creation of the object, after installing all the properties. Function uitable1_CreateFcn (H object, Event Data, Handle) handset. Data = varargin {1}; T = utility (handles. Appropriate 1); Set (t, 'data', handlesdata {1}) set (t, 'columnname', {'a', 'b', 'c'}) set (t, 'ro name', {'1' '2 ',' 3 '})    

    The guide creates a myGui_OpeningFcn (HObject , EventData, Handle, WarGin) . In it, you can initialize your string:

      The function handles myGui_OpeningFcn (hObject, eventdata, handle, verruin). Output = hObject; Set (handles pop menu 1, 'string', virgin {2}); Set (handles. Appropriate1, 'data', wordpress {1}); Set (handles. Appropriate 1, 'column name', {'a' 'b' 'c'}); Set (handles. Appropriate1, 'ro name', {'1' '2' '3'}); Guadata (Hobbect, Handle); End   

    Use the new handle for the GUI with the handle structure updates. If you do not call guidata , then whenever you change the handles structure, the changes you have made will not be reflected.

    batch file - Keep X instances of Y running at all time, windows -


    How can I make sure with the batch script that I always run an ex example of cmd.exe for example?

    I have searched and found that it gives me NBR X lines if X is running.

      tasklist / FI "IMAGENAME eq exe.exe" 2 & Gt; NUL |   

    And then START XXX X has stopped running any one, then Find / Find / I / n "exe.exe"?

    how about

      set PROG = exe.exe set COUNT = 0 set = 5 want / f "skip = 1" %% i IN (get wmic process name where name = "% PROG%") (if / i %% i% PROG% set / one COUNT + = 1 is the same) Exclamation count: %%% %% (% 1%,% WANT%) %% of WANT% gtr %% of% /%>% /% / html>

    c++ - Qt with OpenCv does nothing -


    I'm using QT 5.0.2 and try to get started with OpenCV.

    If I run the following program, it shows only a console and presses any key but it does not show any image, I do not even get the qDebug () message.

    However, I got the message by removing OpenCV stuff.

    PS: Yes I have ensured that the Desert JPG is in the same folder where XE is first-openCV-test.pro:

      QT + = Core QT - = gui target = first openCV tests CONFIG + = console config - = App_bundle Template = app source + = main.cpp INCLUDEPATH + = F: \\ \\ Qt libraries Opencv \\ \\ \\ Opnecv_build_2k4k5 set \\ LIBS + = -LF: \\ Qt \ libraries \\ \\ Opencv Opnecv_build_2k4k5 \\ install \\ lib \ -lopencv_core245.dll \ -lopencv_highgui245.dll \ -lopencv_imgproc245.dll \ -lopencv_features2d245.dll \ -lopencv_calib3d245.dll   

    main.cpp:

      Include # lt; QDebug & gt; # Include & lt; QCoreApplication & gt; #include & lt; Opencv2 / core / core.hpp & gt; #include & lt; Opencv2 / highgui / highgui.hpp & gt; Int main (int argc, char * argv []) {// read an image qDebug () << & Lt; "Start Getting Started"; Cv :: Mat image = cv :: imread ("Desert.jpg"); // Create an image window named "My image" qDebug () & lt; & Lt; "Name window"; Cv :: nameWindow ("My Image"); // Show image on window qDebug () & lt; & Lt; "Show image:"; Cv :: imshow ("My image", Image); // wait for 5000 ms. QDebug () & lt; & Lt; "stop"; CV :: waitKey (5000); Return 1; }   

    ////////////////////////////////////// //////////////////////////////////////////////// //

    Thanks for the quick reply.

    I tried some things and made them all again and downloaded it again. I changed it for:
    QT + = Core QT - = GUI target = First test configuration + = console config - = app_bundle template = application source + = main.cpp

      INCLUDEPATH + = 'F / QT / libraries / opencv / build / include "\" F / QT / libraries / opencv / Construction / / Opencv include "\" F / QT / libraries / opencv / Construction / / in opencv2 Includes "LIBS + = -L" F: / QT / libraries / opencv / build / x86 / mingw / lib "-libopencv_core245.dll -libopencv_highgui245.dll -libopencv_imgproc245.dll -libopencv_features2d245.dll -libopencv_calib3d245. dll   

    But now I get the following errors:

    F: \ A_PROJECTS \ open CV \ first test \ first test \ main.cpp: -1: Fehler: Undefined Reference to CV: FastFree (Zero *) '

    F: \ A_PROJECTS \ Open CV \ First Test \ first test \ main.cpp: -1: Fehler: `CV :: mat undefined reference:: Deallocate () '

    I'm not sure if this will help, but try Do ...

    First of all, in my programs I ' \\ < / Strong> 'instead of' / 'bars. Second, I never put it. Libs on DLL

    LIBS + = -LC: / OpenCV / lib / -libopencv_core245 -llibopencv_highgui245 -llibopencv_imgproc245

    Try to make those changes and I Use something like this again to 'run qmake' and 'rebuild all' if you are using qtcreator.

    c# - Saving a list of entities to the db - MVC -


    I think I'm doing almost this work, but I can not understand how it will end.

    Model: Public Square Location {Public Ink Placement Command {Receive; Set; } Public String SiteCode {get; Set; } Public Int Insurance (Received; Set; } Public Inc IncidentId {get; Set; }}

    See model

      public list & lt; Location & gt; {Get Listings; Set; }   

    Controller:

      [httpPOST] Public ActionStrust Adrecord (RecordView Model Model) {if (ModelState.IsValid) {location location; Foreign language (local place in the model) list {location = new location {PersonId = model.PersonId, SiteCode = loc.SiteCode, IncidentId = loc.IncidentId}; } {Var db = new MyEntities ()) using {db.Order.AddObject (event); Db.Location.AddObject (location); Db.Comment.AddObject (comment); Db.SaveChanges (); }   

    line db.Location.AddObject (location); Getting blank. How do I get a listing from foreach, db?

    You are very close!

      // Create a new list of your unit location (namespace data may not contain) var location list = new list & lt; Data Location & gt; (); Foreign language (List in model location) (var location = new data. Location {PersonId = model.PersonId, SiteCode = loc.SiteCode, IncidentId = loc.IncidentId}; locationList.Add (location);} (var db = New MyEntities {Db.Order.AddObject (event); Foreign language (various items in the space object) {db.Location.AddObject (location);} Db.Comment.AddObject (comment); db.SaveChanges () );}   

    Or: Because you already have a listing on your model, instead of using

      (var db = new MyEntities () ) {Db. Order.AddObject (event); Foreign language (in model location ) (Var location = new data. Location {PersonId = model.PersonId, SiteCode = loc.SiteCode, IncidentId = loc.IncidentId}; db.Location.AddObject (location);} Db.Comment.AddObject (comment); db SaveChanges ();}    

    java - server socket loose binding -


    I want to develop master server and secondary server

    when the master server is down Secondary server should come on the same port.

    But when the master server is ready to start the secondary server, it should be slowed down so that the master server can start on the same port.

    Is there any way secondary server knows that another process is trying to start on the same port?

    If you need it always, then keep your server up always, You can follow this method,

    Create a basic process, which will be born to a child, listening to the actual service on the harbor when the child is serving the actual requests, then the parent < Will wait for the child to die by using code> waitpid in C (crash / state) Change). So whenever the child goes down, the parents know and produce the new process. - Favorite Attitude .


    If you need a master-secondary design specifically,

    When completing a secondary request, it can always wait for the signal Master Server So when the master is finished, its first task will be to send the signal through the reach of the secondary (either via a PID file or file lock or forced failure) so that the secondary can be closed honestly.

    android - Benefits of native ActionBar vs custom implementation? -


    I would like to use native Google actionbar class for my application, however, I want to be able to change it in a dynamic form To skip the most image from, disable the icon and focus the heading. I was thinking, is it possible if I should apply my actionbase?

    My reason is due to the desire to change the most left image (IE navigation drawer indicator) because I am using the navigation drawer but some screens want to display the above indicator instead. By looking through the documentation for ActionBarDrawerToggle, there is a method to enable / disable the navigation drawer icon (

    < P> SetDrawerIndicatorEnabled), when it is disabled it goes back to the home-up prompt.

    Another option is to recreate the drawer in those special screens, which you want to separate the mark and specify the new icon in the form of drawers, not sure if it will work.



    html - How do I center the content of this website? -


    So I'm doing a website for an assignment and for some reason I can not seem to align the content Website. It's a simple layout, it's pure content, no sidebar or anything. Here's the HTML for the content:

      & lt ;! - Start content column - & gt; & Lt; Div id = "content" & gt; & Lt; Img src = "img8.png" style = "width: 460px; height: 100px;" Alt = "Pokémon" & gt; & Lt; Br> Pokuman: First Movie & lt; Br> Soundtrack & lt; / Div & gt; & Lt ;! - Last content column - & gt;   

    And here's the CSS:

      body {background: black; Font-family: Trajan Pro, Ariel, Helvetica, Sense-Serif; Font-size: 28px; Text align: center; Background-image: url ('img2.jpg'); Double-repeat: repeat-x; Background-position: bottom center; Background-size: 460px 300px; } #content {float: left; Color: # 333; Limit: 1px solid # ccc; Background: Transparent; Margin: 0 auto; Height: 1024px; Width: 460px; Display: Inline; }   

    Thank you in advance to all of you. I am trying to align the contents of the image in the background image so that I can become like a fading effect, but the material can not be centered.

    All that you should have done float: left; and display: inline; to #content CSS selector.

    php - With multiple websites hosted at same ip in Apache, how do I set which one is the default? -


    I have many virtualhosts in Apache, listening to all port 80s, my server name is set to different web addresses. When I go directly to the IP address, Apache sends me one of those websites as the default. I want to change the virtual location that places the requests at the IP address. How do i do this
      & lt ;! - It is currently the default (probably because it is in alphabetical order) - & gt; & Lt; VirtualHost *: 80 & gt; ServerAdmin Webmaster @ Localhost Server's name mywebsite.com DocumentRoot / var / www / testother ... & lt; / VirtualHost & gt; & Lt ;! - I think this should be the default - & gt; & Lt; VirtualHost *: 80 & gt; ServerAdmin Webmaster @ Localhost Server's name myotherwebsite.com DocumentRoot / var / www / test ... & lt; / VirtualHost & gt;    

    From my own Apache configuration file:

       

    Note that this is outside the DocumentRoot one VirtualHost block. I think you have something similar but if not, you can set it this way. These orders may be so messy

    c++ - object oriented programming style and pointers to pointers -


    I want to create a simple linked list class and other data structures in C ++ to object oriented programming. After editing my old C code I had something like that (I've included one of the functions):
      template   

    How it is used:

      int main () {llist & lt; int & gt; * my_integer_list = nullptr; llistAdd (& amp; my_integer_list, 42); lli StAdd (& my_integer_list, 128); llistAdd (& amp; my_integer_list, 1337); (AutoIrr = & amp; my_integer_list; (* IR)! = Nullptr; llistIrAdv (& amp; itr)) cout & lt; Lt; (** IRR). Data & lt; endl; llistClear (& my_integer_list); return 0;}   

    The problem that works all perfectly That's how C ++ uses the method of llistAdd (..) instead of OOP-style functions. The problem is that my code is index-to-pointers and point-to-point two pointers Works with (see llistItrAdv (..) ). If I use methods, then I will need to:

      template & lt; Typename T & gt; List and lieutenant; T & gt; * List and lieutenant; T & G: :: Add (Const T & D) {LIlist & lt; T & gt; * Temp = new list & lt; T & gt; (D); Temp- & gt; Next = this; Return temporary; } Int main () {llist & lt; Int & gt; * My_integer_list = nullptr; My_integer_list = my_integer_list-> Add (42); My_integer_list = my_integer_list-> Clear (); Return 0; }   

    It again creates ugly codes and is likely to leak memory. There should be a better way of doing this with methods, but I can not really think of anything. I tried to make methods for the indicators, but it is illegal in C ++ Can you learn what OOP-style is like the proper class like the class?

    The fact your face has encountered is the fact that your list class is actually Instead of the full list, there is a single node in the linked list, so it does not mean that it will have adding method to see that it is actually also in your non-OOP code - enter list The function does not work on any list object, but on an object (just an indicator here) whose A list is in the context of the object. It suggests a solution to your problem: Rename your old class on llistnode and for a llistnode Create a new list class with the indicator and the new class

      template    

    php - Transaction rollback on connection failure or timeout -


    This question is asked by Navaneeth Adruguli


    The question is:
    How to SQL Server Will transaction rollback work? What if I have too many updates in the transaction and during an update connection failure or when the connection time is over? In this situation the server may be rollback (in the case of connection failure) without connecting to SQL Server SQL Server. If possible, how?

    If there is an error in the system's network, then withdraw the SQL server transaction. When the system crashes or closes in the middle, it can automatically be restored from the crash.

    javascript - Cordova processMessage failed: Stack: undefined (and) Error: illegal access -


    I am trying to get regId through this GCM.

    I can not find a transcript of a document 'Invalid access' error message ... Looks like a permissible thing. The notification functions on the GCM ping a log message, it indicates execution Error message:

      Process message failed: Stack: Undefined process message failed: Error: Invalid access process message failed: Message: Jjavascript: onNotificationGCM ({\ "Regid \": \ "APA91bGQkVTa6KGBQzNz9spnYgYEL6RSJKyyoNh5GnhrkD04wVgm1detXbuATLRC_Evjduv 4NCPZWzw_Q-ilEl4U_XBjibiSHPgzWEoO0_VBqB6HT_TDNMsJoxoGZu1ZXyFZNDXQawCJxv5KcQiCp7zmbaICt9n4TQ \ ", \" event \ ": \" registered \ "})    

    Ok, go figure. It seems that I was trying to parse JS object with JSON.parse, which was also searched through - erases these 'invalid access' errors once When I made sure that the JSON passed in the message was a string before parsing, the errors disappeared and the regId was successful That was managed. W00t.

    java - Find out whether a file have extension or not -


    I have a file, sometimes with extensions or with out extensions. Using Java to know if there is a specific file extension

    Commons-A method in IO A file extension with a path or file name that will be found: For example

      string result = file name availability. Extension ("foo.txt");   

    returns the result txt . If there is no extension in the file, you will get an empty string back. A simple isExty check on the string will tell you whether there is any extension. From documentation:

    When you deal with file names, you can influence issues with Windows based development machine when going to a Unix-based production machine. The purpose of this class [commons-io] is to help them avoid those problems.

    This method gives the literal portion of the filename after the last point. There should be no directory separator after dot.

    javascript - compare position of multiple divs -


    I have a dragable object when the status of objects is omitted, then it is similar to another device, a warning message Should be visible. Example:

      & lt; Div id = "ha" & gt; 1 & lt; / Div & gt; & Lt; Div id = "ha2" square = "box" & gt; 2 & lt; / Div & gt; & Lt; Div id = "ha3" square = "box" & gt; 3 & lt; / Div & gt; & Lt; Div id = "ha4" square = "box" & gt; 4 & lt; / Div & gt;   

    JS:

      var posbox = $ (". Box"). Event (); Var boxbound = posbox.left; $ ("#h"). Draggable ({drag: function () {var pos = $ (this) .position (); var left = pos.left; if (left == boxleft) {warning ("similar");}}});   

    The problem is that it only compares the first box with the class box. The number of divisions can change from time to time, so I can not put each status in a string and then compare the dragable to each of them. Is there any way to do this?

    You can do this -

      var posbox = $ ( ". Box"). Map (function () {return $ (this). Position () .left;}) Get (); $ ("#h"). Draggable ({drag: function () {var pos = $ (this) .position (); var left = pos.left; var p = $ .inArray (left, posbox); if (P & gt; -1) { Console.log (":" + $ ('. Box'). Eq (p) .text ());}}});   

    Demo --- & gt;

    ruby on rails - ActiveRecord exists? with associations -


    मेरे पास निम्न ActiveRecord कॉल है:

      @payment = account.business.payments।  भुगतान  के लिए  पैराम्स [: id]  के आईडी के साथ कौन सी खोजों को खोजता है (पैरामीटर [: आईडी])   

    । हालांकि, यह एक RecordNotFound अपवाद फेंकता है।

    मैं मौजूद है? कॉल करना चाहूंगा, यह देखने के बजाय कि कोई अपवाद फेंकने से बचने के लिए रिकॉर्ड मौजूद है या नहीं। भुगतान .exists? (Account.business.payments.find (params [: id])) काम नहीं कर रहा है।

    मैं केवल खोज करना चाहता हूं संबंधित उस संबंधित से व्यवसाय भुगतान करते हैं, और Payment.exists? (? Id = & gt; params [: id]) कर रहे सभी भुगतान नहीं करते < / code>।

    नोट: खाता has_one business

    / कोड> और व्यापार है_माएं भुगतान

    जहां की खोज करें के बजाय का उपयोग करें, यह एक ActiveRecord :: relation 0 या अधिक रिकॉर्ड का प्रतिनिधित्व करेगा, जिसमें से आप चेन <कोड > .exists? : <पूर्व> @payments = account.business.payments.where (id: params [: id]) अगर @ payments.exists? # ... अंत

    Using Python to Remove All Lines Matching Regex -


    I am trying to remove all the lines where my regex matches (regex just searching for any row In which it has Yahoo!). import reile inputfile = open (

    'c: \\ temp \\ script \\ remove.txt', 'w', encoding = "utf8") I get the following error:

    Tracebacks (most recent call final): line 170, sub returned _compile (pattern, flags) .sub (repl, string, count) TypeError: expected string or buffer

    If you want to modify the original file, use the fileinput module:

      importin fileinput .input (r'C: \ temp \ lip If not re.search (r '\ byahoo \ b', line): print line,    

    c# - Adding "key" attribute to properties in a base class in MVC 4 for Entity Code First -


    I have a del in which there is a square in which there is a list of items (this is from metadata, T source code Is):

      public class APIKeyInfo {public APIKeyInfo (); Public long accessmask {get; Set; } Public listing & lt; AccountEntry & gt; Character {receive; Set; } Public Date Expired {Received; Set; }} Public Class Account Entry {Public Account Entry (); Public long spectrum {received; Set; } Public string name {get; Set; } ... other properties}   

    Now in my code, I have an extended class of APIKeyInfo, which specifies a database table using the EF code:

      [table ("MyPK")] Public Class MyAPI: APIIEFO {{Key] Public Intake {Received; Set; } [Required] public string vCode {get; Set; }}   

    The problem is that the easf tells me to give an error that when it runs on the API table at the APIKeyInfo (the "I listed on the list" tries to create the table) property on the MAPK FK), it says that the key has not been defined. So, my question is, how can I specify the key to the "list characters" property when I do not access the source code? I hope for something like:

      [Table ("MyPK")] Public Class Mykey: APIKeyInfo {[Key] Public int KeyId {get; Set; } [Required] public string vCode {get; Set; } [Key] basis. Character. Character id; }   

    Just tell which property to use, but obviously it does not work.

    I have not really tried to do this, but I do not know why this will not work . Instead of using properties, try to use EntityTypeConfiguration objects ...

      Public class MyApiKeyMapping: EntityTypeConfiguration & lt; MyApiKey & gt; {Public MyApiKeyMapping () {this.ToTable ("MyApiKey"); this. Haski (K => KKIID); this. Property (P => P. Vcode) .IsRequired (); }} Public class accountantremruppapping: entity type configuration & lt; Accountantry & gt; {Public Accountantry Mapping () {this.ToTable ("Accountantry"); this. The Husky (k = & gt;.}}   

    Which should you create a mapping for the entities that you do not own (hopefully).

    Then in your reference you simply add the following.

      public class MyApiContext: DbContext {... protected override void OnModelCreating (DbModelbuilder Modlbilder) {modelBuilder.Configurations.Add (new MyApiKeyMapping ()); Modlbilder. configuration. add (new Khataintry mapping ());}}   

    have relationships to set mapping And can also add other properties.

    jquery - animate the images container to the position where is going to be on fullview -


    I have the code below from a tutorial () and the image container is animated in a middle right position! But I want to be left below it! Whatever I was trying to do is wrong or not reproducible on any other screen size! It does not matter to me! Please help!

      // Animate the image container in the case where the fullview is on thumbstestyle = {left: $ (window). Wth ($) - $ rings Wrapper (Wide) - 25 + 'PX', // 25 Fullview Thumb-wrapper is the right / right of the top header: ($ (window). Light () / 2) - ($ rings: wrapper.height () / 2 ) - 22 + 'Px' / 10 Fullsite thumb-cover margin is top / bottom;); $ ThumbsWrapper.stop () Application Style (Thumstyle, $. Extension (true, [], {Duration: Enneasp Speed, Easy: Annexing}));    

    simple, just left as 0 Do and below as 0 should do this.

    unchecked code
      thumbsstyle = {left: 0 down: 0}; $ ThumbsWrapper.stop () Application Style (Thumstyle, $. Extension (true, [], {Duration: Enneasp Speed, Easy: Annexing}));    

    java - Apache Commons Net Slow FTP Upload -


    I am using Apache Commons Net 3.3 to handle FTP transfers in a Java application.

    The download is working very well, but I am getting very slow speed compared to local internet connection capabilities.

    The code writing the file data in that stream looks like this:

      BufferedOutputStream Out = New BufferedOutputStream (ftp.getOutputStream (prt)); BufferedInputStream = new BufferedInputStream (prov.getInputStream (S)); Byte [] Buff = New Byte [BUFF_SIZE]; Int len; While ((lain = in. Read (fond)) gt; = 0 & amp;; prog.is was canceled ()) {out.write (buff, 0, len); Total + = Lane; Prog.set progress ((int) (Math Field (Total / Combo) * 100))); } In.close (); Out.close ();   

    BUFF_SIZE = 16kB

    I have an FTPclient buffer size that is generated by setBufferSize

    Also set to 16kB is not with i server or my internet connection, because the file is used as upload fax client by earning more reasonable speed by using FileZilla.

    This issue also appears with Java 6 and 7 JVM.

    Does anyone have an idea why this is happening? Is there a problem in Commons Net or Java? Or is there something that I have not configured correctly?

    Same problem - try SDK 1.6 solution, but try to find a better way

    UPD: solution (see comment)

    javascript - Is it possible to find the distance between ticks in D3.js? -


    Is there any way to detect the distance between the tick marks on the X axis? I am using gradient scale with range-band, in which I tell that there is no tick function in it.

      var x = d3.scale.ordinal () Range Points ([_ margin.left, cWidth]); X.domain (['' December, 'Jan']); Var testTicks = x.ticks (2);   

    This fixes the axis (can not post an image), but how can I get the distance

    (Edit: Added x. Domain)

      var data = [45, 31, 23], // whatever your The data is GraphHeight = 400, // However, if you want to set many numbers TicksY = 4, // set y scale // (hardcoded domain for minimum and maximum data vals in this example; you use d3.max real life Should do) y = D3.scale.linear (). Category (Graphite, 0)) Domain (23, 45), yAxis = d3.svg.axis (). Scale (y). Invalid ("left"). Ticks (numberTicksY), // Example returns - & gt; [20, 30, 40, 50] tickArr = y.ticks (numberTicksY), // To determine the positions, the last 2 ticks with the y scale FN (if the Seal has used the first 2) have been used by tickDistance = Y (tickArr [tickArr.length - 1]) - Y (Teeker [tickr. Length - 2]);    

    c# - Using a Singleton pattern to Linq to Sql Data Context -


    I have some confusion in SQL in SQL. I am looking for a real reason,

    "There is already an open data reader connected to this command which must be closed first

    especially in the multitasking environment. Most people are saying that the reason for this is that the data reference thread is not

    please see the following thread for best answer

    But in my case , I am using another class call "A" which is in the singleton pattern The objective of this class is to provide data context objects in a single context. I keep the example of this class "A" as a global example in the derived class and a special example by calling the datacontax.

    My question is,

    Will my method call increase uncontrolled memory? Based on my understanding, Singleton will maintain an instance, as a static object. August My assumption is wrong, please give me a good explanation.

    Note:

    My method throws the same exception in the call, so I'm sure That is the same problem in this scenario.

    Your approach will normally cause problems. Do not do this just like a datacontax is not intended to be a singleton.

    Even if A is a singleton, then create a new DataContext code within the appropriate methods within A , A within a DataContext instead of being in the form of a variable. (You can also consider that A should actually be a singleton in the first place.)

    Creating gradient lines in CSS -


    The question, if I want to create gradient lines, similar to the lines that appear on AT & AM, the T drop down menu Which separates the menu item, how do I go about it? I want to make a similar effect on a menu that I'm coding, and I do not want to use images. Is there a way to get it in css? Help much appreciated! Thank you.

    You can use a GUI, just copy the CSS into your code:

    Example:

      #div {/ * IE10 Consumer Preview * / Background Image: -MMS-Linear-Slope (Below, #FFFFFF0%, # 00A3EF100% ); / * Mozilla Firefox * / background-image: -Mo-linear-shield (bottom, #FFFFFF 0%, # 00A3EF100%); / * Opera / background-image: -o-linear-shield (bottom, #FFFFF0%, # 00A3EF100%); / * WebKit (Safari / Chrome 10) * / Background image: -WebKit-Gradient (Linear, Left Down, Left Top, Color-stop (0, #FFFFFF), Color-stop (1, # 00A3EF) ); / * WebKit (Chrome 11+) * / background-image: -webkit-linear-gradient (bottom, #FFFFFF 0%, # 00A3EF 100%); / * W3C markup, IE 10 release preview * / background-image: linear-shield (top, #FFFFF0%, # 00A3EF100%); }    

    c++ - Overriding Copy Constructor for CObList MFC -


    I am working in MFC, and I have my own templated class (CDFAbillist) that comes from the coblig and the member I can accept that my own class (CDFAbject) is obtained from CObject. I have to override the compiler-generated copy constructor for CDFAObList because it eventually works under CObject, in which the personal copy and assignment form The Nkshn and gives me this:

      1> C2248 error: 'CObject :: CObject': can not use declared private member in class' CObject '1;' Cobbet :: Cobbet '1 & gt; View the manifesto of 'Cobbett' see the manifesto of 1 & gt; This function created by the Diagnostic Compiler, 'COBList :: CObList (cost cobbler & amp;)'   

    This gives me errors above, although I have the copy maker override and the assignment operator is given the CDFB Overloaded in But when I try to override the copy maker for CDFAObList, I get the following compiler errors:

      1> Error C4430: Missing type specifier - int assumed. Note: C ++ does not support default-int1 gt; See the templates immediate reference to 'cdfabilist & lt; T & gt; Being compiled   

    This is my templated class:

      #include "DFAObject.h" #include "DFAManDoc.h" #Include "DFAManTreeView .h "template and lieutenant; Square T & gt; Class CDFobilist: Public Counselist {Public: CDFBist (Zero) {} CDFBylist (CDCountor * PDC, CTreeCtrl * pTree, xml_document * pXmlDoc) {Doctor = PDK; Tree = PTRE; XmlDoc = pXmlDoc; } // Problem Copy Constructor CDFAObList (const CDFAblicist & lt; T & gt; and tocopy) {doc = toCopy.doc; Tree = tocopy.tree; XmlDoc = toCopy.xmlDoc; (Int i = 0; I & lt; toCopy- & gt; GetSize (); i ++) {This- & gt; AddHead ((* T *) to copy-> GetTail ()); }} Preserved: CDCone * Doctor; CTREECtrl * tree; Xml_document * xmlDoc; };   

    I have never used a class template before, so I'm probably doing a bunch of wrong things. Thanks in advance for your help.

      CDFAObList ( 
      Instead of CDFAObList (const CDFAblicist & lt; T & gt; toopy)     

    >