Thursday, 15 July 2010

C++: Converting Array class to Class template (Scope issue) -


I am in the initial stage of trying to change an array class, which includes the overloading operator in a templated class. At the moment, I am trying to add the definition of the template to the class and every function. It should be quite simple, however, whenever I run the program, I get a scope error.

The compiler says that 'T' was not declared in this radius (I would comment on the error that happens). The error also occurs on other function definitions. I am using a templated class as a program and it implements the tasks I am trying to do (which is why I am confused). What should I do to resolve this?

Thank you.

  #include & lt; Iostream & gt; # Include & lt; Iomanip & gt; # Include & lt; Cstdlib & gt; # Include & lt; Stdexcept & gt; using namespace std; #ifndef ARRAY_H #define ARRAY_H template & lt; Typename T & gt; Class array {public: arrays (int = 10); Array (Constant Array & amp; nbsp;); ~ Array (); Int getSize () console; Constant Array and Operator = (Constant Ar & amp; amp;;); Bull Operator == (Const Ar and Co.); Bull Operator! = (Constant Array and Right) const {Return! (* It == true); } Int and operator [] (int); Int operator [] (int) const; Private: integer size; Int * ptr; }; #endif Template & lt; Typename t & gt; Array End Lieutenant; T & AG :: Array (Int. Sir Sysi) // Error: T was not declared in this scope ************************************************************ Throw ***** and invalid_gram ("Array Size Mayest Is More Than 0"); Ptr = new int [size]; For (Int i = 0; I   

Before each of your function definitions, you have written: < Previous> template & lt; Typename t & gt;

Your mean:

  template & lt; Typename T & gt;   

That is, it should match the template parameters of your square, which is the capital T .

asp.net mvc - Controling and managing DbContext -


अभी मेरे पास यह संदर्भ है

  नामस्थान Dafoor_MVC.Models {सार्वजनिक वर्ग DafoorDBContext: DbContext {सार्वजनिक डीबीसेट & lt; विभाग & gt; विभाग {प्राप्त करें; सेट; } सार्वजनिक DbSet & lt; पाठ्यक्रम & gt; पाठ्यक्रम {प्राप्त; सेट; } सार्वजनिक DbSet & lt; उत्तर & gt; उत्तर {प्राप्त करें; सेट; }}}   

यह संदर्भ बड़े हो जाएगा क्योंकि मेरे पास लगभग 40 मॉडल हैं जो मैं जोड़ना चाहता हूं।

1- क्या यह 40 मॉडल में एक अच्छा विचार है एक संदर्भ?

2- मुझे यह संदर्भ सभी उपयोगकर्ताओं के बीच साझा करना है, क्योंकि मैं हर बार पूछताछ के साथ डाटाबेस को हिट नहीं करना चाहता अगर रिकॉर्ड पहले से ही एक संदर्भ में है, लेकिन इससे प्रभावित होगा सर्वर मेमोरी, तो मैं कैसे "अंतिम वस्तु का निपटान करने के लिए इस्तेमाल किया वस्तु या वस्तु है कि संदर्भ से निपटने के लिए समय की एक राशि के लिए कहा नहीं मिल सकता है कुछ" कैसे लागू कर सकते हैं? मैं संपूर्ण संदर्भ का निपटारा नहीं करना चाहता।

3-यदि प्वाइंट 2 काम नहीं कर रहा था, तो क्या मैं एक उपयोगकर्ता सत्र में संदर्भ का एक उदाहरण रख सकता हूं ताकि संदर्भ एक उपयोगकर्ता विशिष्ट नहीं होगा स्पिकिशिप

क्या यह एक संदर्भ में 40 मॉडल रखने का एक अच्छा विचार है?

इसमें कुछ भी गलत नहीं है कि यदि वे सभी तार्किक रूप से एक साथ हैं।

मैं यह संदर्भ सभी उपयोगकर्ताओं के बीच साझा करना चाहता हूं < P> नहीं, आप नहीं करते आप प्रत्येक व्यक्तिगत HTTP अनुरोध के संदर्भ को इन्स्तांत करना चाहते हैं, और HTTP अनुरोध को संभालने से पहले इसे निपटाना है। DBContext कैश करें नहीं

क्या मैं एक उपयोगकर्ता सत्र में संदर्भ का एक उदाहरण रख सकता हूँ ताकि संदर्भ एक विशिष्ट उपयोगकर्ता नहीं हो, जो स्पिकिशियल नहीं है

आपको अपने संदर्भ को कैश नहीं करना चाहिए। हालांकि, आप सत्र में संदर्भ का उपयोग करके पुनर्प्राप्त वस्तुओं को संग्रहीत कर सकते हैं। ऑब्जेक्ट्स को नए संदर्भ में पुन: संलग्न करने के बिना आप अपडेट ऑब्जेक्ट्स / ऑब्जेक्ट ग्राफ़ में सक्षम नहीं होंगे।

UPDATE

यहां DBContext को वर्तमान HTTP अनुरोध से परे नहीं रखा जाना चाहिए:



html - Codeigniter with javascript -


is working with codeigniter and trying to submit a form and then closing it with javascript Am I |

I have a popup function;? I call from the parent page:

  & lt; A href = "javascript: popups ('admin / method / variable', 'click', '400', '400')" & gt; Click & lt; / A & gt;   

And here's the function:

  function declines_popup (url, name, width, height) {var top = parseInt ((screen.availHyight / 2) - (height / 2)); Var left = parseInt ((screen.availWidth / 2) - (width / 2)); Var attribute = "location = 1, position = 1, scrollbar = 1, width =" + width + ", height =" + height + ", top =" + up + ", left =" + left; Window.open (url, name, features);}   

and it opens the form:

  & lt; Php echo form_open ('state / validate_rejection/'.file_results->sender_id.'/'.$this->+session->userdata('id'). '/' .file_results- & gt; id, array ( 'Name' = & gt; 'Rejection_form', 'id' = & gt; 'Disapproval_form', 'onsubmit' = & gt; 'window.forms [0]. Submit (); self.close ();') ); ? & Gt;   

  & lt; P & gt; & Lt; Label & gt; Write the reason for the disapproval? & Lt; Span class = 'req' & gt; * Required & lt; / Label & gt; & Lt; Textarea name = "remarks" rows = "8" maximum-width: 380px "autofocus required>   

< / P>

  & lt; input type = "button" square = "button" value = "cancel" /> gt; & lt; input name = "submit_rejection" id = "Submit_rejection" type = "submit" class = "button" value = "send" /> gt;   

As you can see that the form Action is a URL that goes to the controller / method: Here is the method I use: validate the function _rejection () {$ this-> form_validation- & gt; set_rules ('tip ($ The -> form_validation-> run () == true) {$ sender_ id = $ this-> uri-> Segment); if $ ($ - - 'Remarks', 'Remix', 'Trim | Required'); (3)? $ This-> uri-> Segment (3): 0; $ user_id = $ this-> uri-> Segment (4)? $ This-> uri- & Gt; Segment (4): 0; $ file_id = $ this-> Yuri-> Segment (5)? ​​$ This -> Yuri-> Segment (5): 0; // Here the codeigniter model is called a function, and if the query is passed then it goes wrong, if it is $ rejection = $ this-> Files_model- & gt; Reject E ($ sender_id, $ user_id, $ file_id); If ($ rejection == true) {$ this-> Session-> Set_flashdata ('disapproval_succ', 'successfully rejected'); // redirect ('home'); } Other {$ this- & gt; Session-> Set_flashdata ('disavow_file', 'file declery failure'); }} And {$ this-> Session-> Set_flashdata ('remark__validation_errors', validation_errors ()); }}

ND If the form was successfully submitted or unsuccessful, it would set a flash data

Now I want the form to be finalized Or does not the parent's father near Rolod and Popup ?? | Can anybody please help me get this ?? This is a javascript case, but as long as I'm working with coding, thought it would be the best place to post this thread?

Note: For the poor formatting ... im new user and I do not find the code block: S

If I were to you I would use the jQuery dialog. - If hot water is changing then it already exists. The only thing you need to add is to refresh the page.

asp.net - Where to copy referenced assemblies in a .NET project? -


I have a bunch of links in my current .NET 4.5 project (DLLs). However, right now, they all sit in some local folders in my hard drive when someone works on this same project, these reference assemblies are not in the same local folder. I plan that these sects have some folder in my project Copy and place it in source control.

Is this a good plan? And why do these folders usually go into these things?

Nougat is a better way; However, some conventions are not in the newgate. So here's an example that nopCommerce does

  1. Create a dependency folder (inside your project folder)
  2. Keeps assembly of all third parties inside it.

    Enter image details here

    < Img Src = "https://i.stack.imgur.com/KW4cG.png" alt = "Enter image details here">

     Enter image details here

c# - RichTextBox and tab key -


I have created a rich text box and I have seen that when I press the key of the tab, then nothing is doing it is.

By default, the tab focuses on the next control by pressing tabs. Allow true to accept tab characters from the rich textbox.

See this MSDN article.

php - Error: Cannot redeclare class Facebook -


Like many others, I'm having the following error while using the default facebook.php file: < Pre> Fatal Error: Class federation can not be reclassed in class 160: 160: / wamp \ www \ symfony \ src \ acme \ mainbundle \ controller \ facebook.php

The end of the class declaration in Facebook.php

Here is my code:
  need_once ("Facebook.php"); $ Config = array (); $ Config ['appId'] = '479914672022732'; $ Config ['appId'] = 'd451285c1c38126710980d2b7f2b43b4'; // Everything works fine so far This causes the error $ Facebook = new Facebook ($ config);   

How can I fix this error?

Whatever I have tried:

It has been ensured that there are no other functional classes in the project

changing need_once, include_once, etc. .

If a statement is not required to use a file or to make a Facebook verb, then it already exists

research:

As well as many other posts, but they were related to framework such as Dropl, Zend, WordPress, etc.

What I have learned:

A good way to use Facebook Fashion SDK is by using a composer to get it into the project. Then, when defining the Facebook verb variable, be sure to use backslash, so its:

  $ facebook = new / facebook ($ config);    

Why try this if a bundle does this for you?

Check:



c# - SMTP.SendAsync not working correctly -


I am trying to get acquainted with smtp.SendAsync and for some reason I can not find the mailcas to send the ASIN I am here.

Here I have tried.

  // smtp.SendAsync (mm, blank); Error was attempted, operation of ASC was a complete // Task. Before ((=) => smtp.SendAsync (mm, tap)); No error and no email // SMTP S & MALSync (MM)); Error, async operation was attempted, which was completed to each other / Task.Run ((=) => smtp.SendMailAsync (mm)); No error and no email //smtp.Send(mm); Only one works, but it is delayed and that is what I am trying to get away from far away.   

My code:

  Public static zero email (Elevation height, string to email, string to email) {using (bitmap print canvas = shop drawing Margher, Merging, Elevation and Door Uplift, Rotate FlipType.Rocket 90 Fleep Non)) {(var ms = new memorystream ()) {printCanvas.Save (MS, System.Drawings.imaging.imageformat.png); Ms.osition = 0; (MailMessage mm = new mailmessage (new maildirector (via email), new maildood (e-mail)) {mm.Subject = "[Project:" + elevation.ProjectName + "]" + "+" Shop Drawing for Height .Name; Mm.Body = "Your store pictures are attached to this email in the context of the project:" + elevation.ProjectName + "-> height:" + Upgrades .names; = Attachment to new attachment (MS, height. Name + ".PNGG", "image / PNG"); (On) mm.Attachments.Add; (SmtpClient smtp = New SmtpClient ()) using {//smtp.SendAsync (mm, tap)); // task.root (() => smtp.SendAsync (mm, empty)); //smtp.SendMailAsync (mm)); // task.ru (() => smtp.SendMailAsync (mm)); // is the only one who works smtp.Send (mm); }; }; }; }; }    

@Lloyd help wrap the whole body function in a ThreadPool.QueueUserWorkItem from.

  public static void Imelsopdraing Anddurseludebl (IElevation elevation, string of email, string toEmail) {ThreadPool.QueueUserWorkItem (t = & gt; {(bitmap printCanvas = shopDrawing.Merger.MergeElevationAndDoor (height, rotate Flip Type) Rotate90FlipNone) {{using new MS MemoryStream (MS)) {printCanvas.Save (MS, System.Drawing.Imaging.ImageFormat.Png); Ms.Position = 0; Using (MailMessage mm = new MailMessage (new MailAddress (fromEmail), a new mail address (toEmail))) {mm. Subject = "[Project:" + elevation.ProjectName + "]" + "+" shop for height Drawing; name; Mm.Body = "Pictures of your store are related to this email in the context of the project:" + elevation.ProjectName + "-> height:" + elevation.Name; (In the new attachment = attachment (MS, elevation.Name + ".png", "image / png")) {mm. Atkmen (on) ts.Add; (Var smtp = new smtpClient ()) using {smtp.Send (mm); }; }}; }; }; }); }    

powershell - Invoking Read-Host cmdlet from within C# Custom Cmdlet -


I am writing a set of PowerShell CMDlets which require Oauth2 authentication. I am currently able to reach a point where a new browser window opens and the user has copied the access authentication code to go back to the CDdlets. However, this means that I have a separate CMDlet that now accepts the atode code as input.

Is there any way to invite reading-host? I have tried, but despite being listed, Microsoft does not seem to have it. PowerShell.Commands namespace, but something like that.

I have tried the console. Radlin (), but it has just been ignored when CMDlet is turned on.

ReadHostCommand is in Microsoft .PowerShell.Commands namespace But you have to refer to the Microsoft.PowerShell.Commands.Utility.dll assembly.

javascript - jQuery Form Errors -


I have a simple form that is not functional, it's only for a prototype, here's HTML:

  & lt; Form class = "signup" & gt; & Lt; Div class = "group" & gt; & Lt; Div class = "row" & gt; & Lt; Label & gt; Username & lt; / Labels & gt; & Lt; Input type = "text" & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Label & gt; Password & lt; / Labels & gt; & Lt; Input type = "password" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Input type = "submit" value = "sign in" & gt; & Lt; / Form & gt;   

I think this should be because if a user inputs some data (dummy data) in user data and passwords and clicks on Submit, it will show a JavaScript alert in which " Logged in "and if there is no data in any input, then this is showing" JavaScript "warning to me.

I want to use jQuery and it is far away from me:

  $ ('signup'). Submit (function () (if ($ (this) .valid ()) {warning ('login');} else {alert ('error!');}});   

Why is there no reason not working?

It seems that you are trying to use to make sure that you use that page as your page Also, because is not a valid () function that is included with jQuery.

Wordpress Image Gallery Using External Images -


I would like to know about any known image or video gallery plugin, rather than uploading via WordPress media The library uses external media sources.

The worst thing is, is there a plugin that can be scheduled / updates only to the file server?

Thanks in advance!

You can use it jointly with the following. With Imagazine, you can gather external images and share them, while code will present them in html. Code looks like this:

  // where you want to add gallery & lt; Div id = "galleryId" & gt; & Lt; / Div & gt; & Lt; Style & gt; ... & lt; / Style & gt; // it's image zones & lt; Script type = "text / jason" id = "galleryide" & gt; ... & lt; / Script & gt; Has been generated by. & Lt; Script type = "text / javascript" & gt; Function Setup (GID) {} Setup ("Gallery ID"); & Lt; / Script & gt;   

and you can make it a shortcode

exchange server 2010 - Powershell - Change to MB instead of GB -


इसलिए मूल रूप से मेरे पास एक स्क्रिप्ट है:

  $ मेलबॉक्सअरेरे = नया ऑब्जेक्ट सिस्टम ऑब्जेक्ट $ मेलबॉक्सअरेरे | जोड़ें-सदस्य-मेल टाइप नोटप्रतिष्ठा -मूल्य $ mail.issuewarningquota -नाम चेतावनीकॉटा   

और जहां $ मेल:

  $ mail = get-mailbox -id $ _   

अब यह लूप के लिए एक्सचेंज में हर मेलबॉक्स के लिए जानकारी प्राप्त करने में महान काम करता है, लेकिन मुझे यह मुद्दा "WarningQuota" आउटपुट को MB में करना चाहते हैं < कोड> जीबी

मेरे पास TotalItemSize के लिए एक तरीका है जहां:

  TotalItemSize.value.ToMB ()   

लेकिन यह इशू वॉर्निंगकोटा के लिए काम नहीं करेगा / इस के चारों ओर कोई रास्ता नहीं?

मैं कमांड के आदेशों का आदान-प्रदान करने के लिए वाक्य-रचना को नहीं जानता, लेकिन अगर टोटोलाइटमसिस एक संख्या है तो PowerShell MB और GB की गणना करने में वास्तव में अच्छा है।

उदाहरण:

  PS C : \ & gt; $ संख्या = 42 9 4967296 पीएस सी: \ & gt; $ संख्या / 1 जीबी 4 पीएस सी: \ & gt; $ संख्या / 1 एमबी 4096   

इसलिए जब तक यह इंट32 या डबल की तरह एक नंबर है, आपको ऐसा करने में कुछ ऐसा करने में सक्षम होना चाहिए जिसमें एमबी में कनवर्ट करना है।

jquery - Select option by text -


I'm having trouble choosing some default values ​​that come via AJAX

Here's a Bella's:

Here's the code:

HTML:

  & lt; Div & gt; & Lt; = "Condition" for label id = "conditionLabel" & gt; Condition: & lt; / Label & gt; & Lt; Select ID = "Status" & gt; & Lt; Option selected = "true" style = "display: none;" & Gt; Select & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt;   

JS:

  var conditions = [{id: 1, name: "new"}, {id: 2, name: "good"} , {Id: 3, name: "poor"}]; $ .each (conditions, function (key, value) {var cond = '& lt; option value =' '+ value.id +' "& gt; '+ value.name +'  '$ (' #condition '). Attachment (; cond);}); $ ('# Position option [text = "new"]). Ether ('selected', 'selected');   

The last line that is causing me trouble, I want to select the option based on the text

You can use in: :

  $ ('# condition option: in it (" new') '') Is included. 'Selected', true);   

or .filter () :

  $ (' Filter (function () {return this.text === 'new';}) .prop ('selected', true);   

: There will also be included news , so I .filter ()

Why this CSS cube 3d menu works fine in my apple but goes wrong in my pc? -


  [please check my code] [1]   

I did try to upload a photo but some kind of prestige is required,

This is my homework, so please check the code

Your code uses CSS properties such as transform , which is an additional prefix for each browser Required. You probably use Chrome on Mac and Firefox on Mac; In Chrome and Safari, you need to add -webkit - in some properties:

This tool should help:

There your CSS code Paste it, and it will fix all prefixes.

ios - Monotouch Google Analytics with app version -


I am using Google Analytics binding () in my iOS project and everything works fine except the app version It's not watched when I look at Google Analytics reports, the app version is always (not set) .

This is the app I'm using in the app: var ga = GoogleAnalytics.GAI.SharedInstance; Ga.GetTracker ("UA-XXXXXXXX-X"); Ga.DefaultTracker.TrackView ("Home Screen");

Is there something that I'm missing to track my app version?

Thanks in advance.

Regards, Vinciius Azzodo

You really have to set an app version for this I do not know why Google does this to you:

  ga.DefaultTracker.AppVersion = NSBundle.MainBundle.InfoDictionary [New NSString ("CFBundleVersion")]. ToString ();   

This will match your edition to your Info.plist.

objective c - iOS programmatically alter uiview layout -


I have a page on my iOS app based on the following diagram, which is as follows.

  • Dark gray box = Navbar
  • Light gray box = UIView (for presentation, with some nice dropshadow etc.)
  • Black border = UIView (Again, with good shade,
  • 2 text fields
  • Pink box = Second view to display after an event.

    layout

    Currently, I'm laying everything with initWithFrame, and clear Establishing the frame of every item in the form which I'm probably not good at (I am new to the development of iOS, so please tell me in the right direction).

    What I am trying to achieve is that when some text is recorded in text 2 text area To reveal the pink box, and respond properly to the supervision, and layout well around the new field.

    I have no problem with this incident, and I just now Fold the frame of each UIView, but the point is Sector that it is wrong, and would love some pointers I would eventually like to animate the pink box, and I therefore consider that animate it with.

    I hope that I have fully explained myself a lot thanks

    If you want to trigger the event, then you have to run the closed animation behind it, then it is quite straightforward to do this

      - (zero) myEventMethod: (id) this {// Here's the event stuff // Animate the pink box in the visual // Below the Below the pink box is hidden behind the blackview and 0.3 delay: 0.0 option [UIView animateWithDuration is starting: It will be taken down 44px every time myEventMethod did not test // need not be careful - hopefully right - you want to drop it down to 44 pixels in 0.3 seconds UIViewAnimationOptionCurveEaseIn Animation: ^ {CGRect pinkboxEndFrame = CGRectMake ( Self.blackView.frame.origin.x, self.blackView.frame.origin.y + 44, self.pinkbox.frame.size.width, self.pinkbox.frame.size. Height); [Self. Pinbox Set Frame: PinkboxFrame]; } Completion: zero]; }   

    Just update the above with any other animation, which you want to do in other views.

    For more information about animating the scenes, you can see the apple from here.

  • google app engine - How to JSON format an HTTP error response in webapp2 -


    I am using webapp2 for development in App Engine. What I want to do to send a custom JSON formatted response in case of an error, for example when the length of request is large, to respond to a Threshold, HTTP 400 and response body

      {'Error': 'InvalidMessageLength'}   

    In WebApp2, there are some exceptions to the option of assigning an error handler. For example:

      app.error_handlers [400] = handle_error_400   

    where handle_error_400 is the following:

      def handle_error_400 (Request) The above code is executed.  

    How dynamically different response formats (HTML and JSON) are based on the above setup? That is, how is it possible to call different versions of the handle_error_400 function?

    Here is a fully working example which is the same error handler for all types of errors And if your URL starts with / json then a response code / JSN (what kind of feedback should you give, to decide if you want to < Code> request how to make good use of the object, use its own imagery):

      import Webapp2 import json def handle_error (request, feedback, exception): if request.path.startswith ('/ json'): response.headers.add_header ('content-type', 'app / jason') result = {'status' : 'Error', 'Status_code': exception.code, 'error_message': exception.explanation,} response.write (json.dumps (result)) Other: response.write (exception) response.set_status (exception.code) app = Webapp2WSGIApplication () app.error_handlers [404] = handle_error app.error_handlers [400] = Handler Dior   

    In the above example, you can easily test different behaviors through the following URLs: Which is a 404 Test that is the easiest error:

      http: // localhost: 8080/404 http: // localhost: 8080 / json / 404    

    forms - bootstrap input field and dropdown button submit -


    Target: An input box where a value can be typed, there is a bootstrap dropdown on the right side of that input box Button where they can select "Store Name, City, State or Zip"

    They will type the name (say Walmart) and then select the store name. When they choose the store name, this form will submit and send two post values ​​to be handled by the PP:

    search terms | Search Type

    Here's the code for the button:

       & Lt; Div class = "input-append" & gt; & Lt; Input class = "span2" id = "appendedInputButton" type = "text" & gt; & Lt; Div class = "btn-group" & gt; & Lt; Button class = "BTN dropdown-toggle" data-toggle = "dropdown" & gt; Action & lt; Span class = "caret" & gt; & Lt; / Span & gt; & Lt; / Button & gt; & Lt; Ul class = "dropdown menu" & gt; & Lt; Li & gt; Search store name & lt; / Li & gt; & Lt; Li & gt; Search City & lt; / Li & gt; & Lt; Li & gt; Search State & lt; / Li & gt; & Lt; Li & gt; Find ZIP code & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Form & gt;    

      & lt; Name of the form = "Search form" id = "searchForm" method = "post" /> & Lt; Div class = "input-append" & gt; & Lt; Input class = "span2" id = "appendedInputButton" name = "search_term" type = "text" & gt; & Lt; Input class = "span2" id = "search_type" name = "search_type" type = "hidden" & gt; & Lt; Div class = "btn-group" & gt; & Lt; Button class = "BTN dropdown-toggle" data-toggle = "dropdown" & gt; Action & lt; Span class = "caret" & gt; & Lt; / Span & gt; & Lt; / Button & gt; & Lt; Ul class = "dropdown menu" & gt; & Lt; Li onclick = "$ ('# search_type') Val ('store'); $ ('# searchForm') Submit ()" & gt; Find the store name & lt; / Li & gt; & Lt; Li onclick = "$ ('# search_type'). Val ('city'); $ ('#searchform'). Submit ()" & gt; Search City & lt; / Li & gt; & Lt; Li onclick = "$ ('# search_type'). Val ('state'); $ ('# searchForm'). Submit ()" & gt; Search State & lt; / Li & gt; & Lt; Li onclick = "$ ('# search_type'). Val ('zip'); $ ('# searchForm') Submit ()" & gt; Find ZIP code & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Form & gt;   

    $ _ POST ['search_term'] entered text and $ _ POST ['search_type'] will Store , city , state , or zip .

    ruby - Validating form fields submitted in rails belong to owner -


    I have a model named PaymentMethods that comes under the user. When the user goes to checkout, they are presented with a list of available payment methods which are related to them. What is the best way to ensure that a user can not manually edit the domain and use someone else's payment method?

    Am I currently using a custom verification in my model

      def at payment_math_? Errors.add (: payment_method, "This card is not for you") unless that is self.user.payment_methods.include? Self.payment_method ending   

    Is this the best way to do it in Rails?

    I think that, generally, this is a very good way.

    There are some points that may be worth mentioning.

    Usually, when adding errors to a particular attribute, it is done with the volume segment in which the subject is not included. The reason is because full_messages inserts the name of the attribute with the helpful error. In this case, the full message is "Payment Method This Card You do not have to be "I just suggest you to change the message" not yours ", as a result of which" payment method is not yours "if they are receiving this message, they probably know why they received it ... An alternative to minimizing the message will be to add the whole error to the base, but this field_world will not work in the same luggage scene.

    Secondly, you have two Self s can be removed, they are unnecessary.

    In the end, in my opinion, the right amount is logic for such recognition, some more complex would probably be a warrant.

    Edit:

    Try this:

      Valid: payment_machine, included: {in: Lambda {| X | X.user.payment_methods}}    

    How to aggregate data into dictionary (or some other database) in python? -


    I am thinking that in order to consolidate the following data there would be a good method in Python, which would be asked from one function to another. Need to go keys or if I use SQLite to read and write data, it would be better to perform the performance.

    For example, the function collects from which some pseudocode:

      import sys def aggregatesources (sys.argv [1], sys.argv [2], sys. Argv [3]): source1 = open (sys.argv [1], 'r') # source1.txt source1data = source1.read () source2 = open (sys.argv [2], 'r') # source2. Txt source1data = source2.read () source3 = open (sys.argv [3], 'r') # source3.txt source1data = source3.read () aggregated_data = source1 + source2 + source3 # + etc ...   

    This is a function that needs to be consolidated into sources but my question is that when I supply sources:

      type1, 32 type2, 9 Typ E3, 12 type4, 21 etc ...   

    There is a way to collect data and associate it within a big dictionary so that:

      type1 , [Source1, 32], [source2, etc ...], [etc ...]   

    I want to use Python's dictionary query speed to make this instantaneous, But if there can be alternative solutions, do the same, expand on them.

    after "div class =" itemprop = "text">

    What you are looking for should do this:

     < Code> CSV import def add_source_to_dict (mydict, SourceFileName): my_reader = csv.reader (for csvfile) atype, value in my_reader: open (SourceFileName, 'rb') does not asyype in mydict as csvfile, then: Mydict [atype] = {} mydict [atype] [sourceFileName] = return mydict data = {} data = add_source_to_dict (data, "source1.txt")   

    Interactive: < / P>

      & gt; & Gt; & Gt; Data = {}> gt; & Gt; & Gt; Data = add_source_to_dict (data, "source1.txt") & gt; & Gt; & Gt; Data = add_source_to_dict (data, "source2.txt") & gt; & Gt; & Gt; Data {'type1,': {'source2.txt': '44', 'source1.txt': '32'}, 'type3,': {'source2.txt': '46', 'source1. Txt ':' '2' ',' Type 2, ': {' source2.txt ':' 45 ',' source1.txt ':' 9 '},' type4, ': {' source2.txt ':' 47 ',' Source1.txt ':' 21 '}}    

    netcdf - How do I get multiple images into GrADS meta file with out doing them one by one -


    I am working in Graeds to build plots for a model run (NetsFF file) I am very new to I'm trying to find out how to send metadata (all images from animation) to multiple images without having to do one at a time.

    Another option would be to slow down the animation on the screen.

    My advice would be to stop using Grad and switch to Python. I can recommend using this

    javascript - CSS hover bug on Lion/Mountain Lion with hidden scrollbars -


    I have a list where a button is shown inside each list item when you rotate it on each list On the right edge of the item. It works fine when there is no need to scroll the list, but it does not work properly when it needs to scroll to the Sher / Mountain Lion in Safari with hidden scrollbar. It seems that the CSS hover position of the underlying item is removed when the mouse is more than the hidden scrollbar area, so the button disappears.

    I have reproduced the problem here:

      & lt; Div id = "list1" class = "list" & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Br / & gt; & Lt; Br / & gt; & Lt; Div id = "list2" class = "list" & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; Div & gt; Foo & LT; Button & gt; & Lt; / Button & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

    CSS:

      .list {height: 200px; Width: 300px; Border: 1 px solid gray; Overflow: Auto; } .list div {padding: 5px 0px 5px 5px; Border bottom: 1px solid #eee; } .list div: hover {background: #eee; } .list button {float: true; display none; } .list div: hover button {display: block;    

    add position: relative; to .

    Being completely hidden from the problem gets rid of the problem, but it is a bad UX, strongly discouraged and should not really be considered an option. If I find anything else then report back.

    java - No applet found error? -


    I am writing a program for a class where the national flag should be flagged for the national anthem on the American flag scale. I got the code but got an error that the applet is still not found, though it is not here I am using Eclipse

    Code:

      @SuppressWarnings ("Serial") anyone can help me with the public? Class Lab 5b Jepllet {Private Audio Clip Audio Clip; Public Labs 5b (Add) (New ImagePanel ()); URL urlForAudio = getClass (). GetResource ("audio / us.mid"); Audioclip = applet NAU Audio Clip (URLForAudio); Audioclip.loop (); } Public Zero Start () {If (audio clip! = Zero) audioclip.loop (); } Public Zero Stop () {If (audio clip! = Tap) audioclip.stop (); } / ** Main Method * / Public Stable Zero Main (string [] ARG) {// Create a frame Jeffrey Frame = New JFram ("Lab 5"); // Make an example of Apple Lab 5B applet = New Lab 5b; Applet.init (); // Add applet example to frame frame. ADD (applet, java.at.birdlutut.cer); Frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); // Display frame frame .Setset (200, 660); Frame.setVisible (true); }} @SuppressWarnings ("serial") class ImagePanel JPanel extended {private image icon imageIcon = new ImageIcon ("image / us.gif"); Private image image = imageIcon.getImage (); Private int y = 550; Public Image Panel () {Timer Timer = New Timer (120, New Timer Listener); Timer.start (); } Class timer listener verifies Alicer {Public Zero ActionPerfed (Action Event e) {increaseY (); }} Public Nil rise Y () {if (y>; 0) {y--; Repaint (); }} / ** Drag image to panel * / Protected Waste Paint Comonant (Graphics G) {SuperPaintConant (G); If (image! = Null) {g.fillRect (0, 0, 10, 660); G.drawImage (Image, 11, Y, 160, 84, this); }}}   

    Enter the code here

    Many things for

    • applets main () do not begin execution in the method. However, if you expand your class , then it is possible to execute applets by using the Java interpreter method ( main <) > Frame .

    • It is important to have the init () method because it's the browser or applet viewer to notify this applet It is always loaded in the system. It is always called for the first time that the start method is called.

    • JFrame and JApplet All the top levels, instead of adding the containers and the applet to frames , I would like to create an object of the JPanel because it has both the JFrame / JApplet can be added in your case. Just add ImagePanel to your top-level container.

    • To access the files on the hard disk,

    • I / O stream Applet for This is not possible.

      Read more

    ios - Make UITableViewCell behave like a real button -


    I want to create UITableViewCell to behave like a real code.

    Know that I am using

      - (zero) table view: (UITableView *) table view was SelectionRowAtIndexPath: (NSIndexPath *) indexPath` < / Code>  

    move, but it is not optimal because it does not behave like the button on tap / drag / release.

    If you tap the cell row and draw your finger on the cell, it will not happen when you release your finger, it is selected (but a button will start its operation in the same case ).

    Is there an easy way to create UITableViewCell to behave like a real button? Cell ?

    UIButton ,>

    You can simply create table view cells with one button in them, set the button in line so that you can work out what happens when the button button event is received. Make sure you reset the button tag when returning a reused used table view cell instead of creating a new one.

    javascript - Something strange about regular expression -


    इस सवाल का पहले से ही एक उत्तर है: < / P>

    • 4 जवाब
    • कहें कि मेरे पास निम्न नियमित अभिव्यक्ति कोड है:
        var str = "{$ (var i के लिए $)     = 0, लेन = ओ। लांघी; i & lt; len; i ++) {$} "; Var reg = /\{\$(.*?)\$\}/g; console.log (reg.test (एसटीआर)); console.log (reg.test (एसटीआर)); console.log (reg.test (एसटीआर));   

      इसका परिणाम सच्चा और गलत क्यों होता है?

      प्रति:

      जब आप जानना चाहते हैं कि कोई स्ट्रिंग स्ट्रिंग में पाई जाती है तो टेस्ट विधि का उपयोग करें (String.search विधि के समान); अधिक जानकारी के लिए (लेकिन धीमा निष्पादन) exec विधि का उपयोग करें (String.match विधि के समान) जैसा कि exec (या इसके साथ संयोजन में) के साथ, एक ही वैश्विक नियमित अभिव्यक्ति उदाहरण पर कई बार कॉल किया गया परीक्षण पिछले मैच से पहले बढ़ जाएगा।

      हो रहा है, हम उपयोग कर सकते हैं और देखें कि क्या हो रहा है। पास के क्रम में:

      1. मूल स्ट्रिंग (सच्चाई)
        पूरी स्ट्रिंग मिलान की गई है जिसे सही के रूप में मूल्यांकन किया गया है।
      2. निरर्थक (फाल्सी)
        लगातार कॉल जारी है, इसलिए जब पहले कॉल ने पूरे परिणाम वापस किया, हम null के साथ छोड़ दिया जाता है।
      3. मूल स्ट्रिंग (सच्चाई)
        और पैटर्न शुरू करने के लिए वापस आता है और चालू रहता है।

        सबूत के लिए,:

          var str = '{$ For (var i = 0, लेन = ओ। लैंघट; i & lt; len; i ++) {$}'; Var reg = /\{\$(.*?)\$\}/g; के लिए (var i = 0; i & lt; 3; i ++) {var परिणाम = reg.exec (str); console.log (परिणाम); console.log (!! परिणाम); }    

    sorting - How do I use std::sort in C++? -


    मैं & lt; algorithm & gt; में std :: sort function का उपयोग कर रहा हूं। मैंने दिए गए उदाहरणों का पालन किया। मैं उदाहरण का उपयोग करना चाहता हूं जो इस तरह दिखता है:

      // डिफ़ॉल्ट तुलना (ऑपरेटर & lt;): std :: sort (myvector.begin (), myvector.begin () + 4 का उपयोग करना );   

    मेरी कक्षाओं में लागू होता है, ऐसा लगता है:

      std :: sort (newtuples- & gt; शुरू (), newtuples- & gt; end ));   

    जहां newTuples प्रकार का है

      std :: vector & lt; tuple & gt; *   < P> इसलिए मैं  ऑपरेटर & lt;  फ़ंक्शन का  टपल  वर्ग:  
      bool const tuple :: operator & lt; (ट्यूपल * tup1) {Bool परिणाम = गलत; (Iii) - (iii) - & gt; getTokensValue पर (iii) iii & lt; tup1- & gt; आकार (); iii ++) {if (tup1- & gt; at (iii) - & gt; getTokensValue () & lt; this- & gt; ()) {परिणाम = सच; टूटना; } और अगर (टुप 1- & gt; पर (iii) - & gt; getTokensValue ()> gt; यह- & gt; पर (iii) - & gt; getTokensValue ()) तोड़; } वापसी परिणाम; }   

    समस्या यह है कि जब मैं एक्सकोड में निर्माण करने की कोशिश करता हूं, तो मुझे दिखाया गया त्रुटि:

     Xcode त्रुटि

    जो कोड स्निपेट & lt; एल्गोरिथम & gt; में है।

    यह मुझे देता है एक प्रकार की स्टैक ट्रेस, जिसमें से एक पंक्ति मुझे निम्नलिखित देता है:

    xcode त्रुटि 2

    मेरे Tuple.h फ़ाइल में कोड स्निपेट है।

    मुझे नहीं पता कि और क्या करना है! किसी भी मदद की काफी सराहना की जाती है, क्योंकि मेरे सीएस वर्ग की परियोजना अब 3 दिन देर हो चुकी है क्योंकि मैं यह आखिरी छँटाई एल्गोरिदम को समझ नहीं सकता। मैंने संबंधों और संबंधपरक कार्यों का चयन, प्रोजेक्ट, और नाम बदलने के साथ एक संबंधपरक डेटाबेस प्रबंधन प्रणाली को पहले ही कार्यान्वित किया है। मेरे पास इन ट्यूप्ले को सही ढंग से स्वरूपित किया गया है, उन्हें बस क्रमबद्ध क्रम में होना चाहिए। धन्यवाद!

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

    इसलिए मैंने जवाब में सुझाव दिए अनुसार घोषणाएं बदल दीं, लेकिन अब यह मुझे देता है:

     अभी तक एक और त्रुटि

    कोई भी मदद?

    यह एक ट्यूपल से ट्यूपल *

      bool const tuple :: operator & lt; ( Tuple * tup1)   

    आपको इसे इस पर बदला जाना चाहिए:

      bool tuple :: operator & lt; (const tuple & tup1) const    

    java - Custom string representation of a custom typed collection -


    If I need a custom string representation of custom type collection, which is the best option - the collection is sub-class and ToString override (), or just create a utility method that takes custom typed compilation and gives a custom string? What is another option?

    I would have to make a utility method. There are some reasons:

    • Logically, your custom string representation is something that you are leveraging over the original class: it is not part of the original class. So this is not within the definition of the original class.
    • Creating a subclasses is probably overkill for overriding a method
    • Creating a custom subclass makes it impossible to work with an object that overrides the original class for a different reason Used to be. If you use heritage for things like this, you can easily mismatch in succession. Always like the structure of heritage!
    • You can continue to use the original toString () for a few reasons: You probably need both string convergence or any other library depends on the original code

      You have one more option within the "Utility System" option: P>

      • Make a simple static utility method simple, quick, this may be your first choice.
      • Create a "formatter" object with a method like
        formatter.formatAsString (targetObject) . This can be useful if you have some formatting options that you can store in the formator.

    c# - Getting Windows Store Sockets to chat with Netcat? -


    Using Windows.Networking.Sockets API, trying to get a basic interface working for the Windows Store I am here. So far I have this:

      Public Axis zero test () ((var socket = new StreamSocket ()) {socket.Control.KeepAlive = false; socket. Connect Async (New hostname ("192.168.1.1"), "5555", Socket Security Lievel.PlainsSocket;); (Var using author = new data witter (socket.OutputStream)) {writer.UnicodeEncoding = UnicodeEncoding.Utf8; Writer.WriteString ("yes!"); //writer.WriteByte (0x50); // does not work either to send raw ASCII var t = writer.FlushAsync (); while (T. position! = Asynstats // maybe needing?}}}   

    So far, I see a successful connect and disconnect. However, I have never received any text.

    My NetKat Command Running under the openBSD router)

      $ nc -lv 5555   

    If I do not have NetNet, when I run the test function, then this one What is wrong with me here?

    This is the case for me Shri way makes no sense, but apparently StoreAsync is required on Data Waitr I would have thought that was flush should be said, but apparently not. Another fun part about WinRT API is using my specific code:

      (var socket = new streamsocket ()) {socket.Control.KeepAlive = false; Socket Control. Wait for the socket Connect Async (New hostname ("192.168.1.1"), "5555", Socket Security Lievel.PlainsSocket); (Using Var = new data witter (socket.OutputStream)) {writer.UnicodeEncoding = UnicodeEncoding.Utf8; Writer.WriteString ("Yes!"); Wait for the author. StereSync (); }}    

    javascript - Add variable to end of href URL onClick JQUERY -


    I think this should work, but no. Not sure what I'm doing. addURL () {$ (this) .attr ('href', function () {return.href + '& cylnders = 12';} & lt; an onclick = "AddURL ();" href = "/ search-results /? Var1 = red & amp; var2 = leather" & gt; click on & lt; / a & gt;

      function addURL () {$ (This) .attr ('href', function () {return.href + '& cylnders = 12';})}}   

    Second, in your code "this" Instead, try this:

      one onclick = "addURL (this)" href = "/ search-results /? Var1 = red and var2 = leather" & Gt;; Lt; / a & gt; Click on function addURL (element) {$ (element) .attr ('href', function () {this.href + 'and cylnders = 12';});}  / Pre>  

    ios - Getting Google Map direction issue -


    I am working on Google Maps in Google Maps, how the driving directions for the user is represented. According to the Google Map SDK, he has given an example url which I tried but I did not get Jason response.

    url:

    Error: Error domain = NSURLErrorDomain code = -1000 "bad url" UserInfo = 0x9245e00 {NSUnderlyingError = 0x8643f00 "bad url", NSLocalizedDescription = bad url}

    I think you should do the following

      NSURL * url = [NSURL URLWithString: [@ "http://maps.googleapis.com/maps/api/directions/json?origin= Boston, MA and Destination = Concorde, MA and WEPPoints = Charlestown, MA | Lexington, MA and Sensor = False" StringBaddings on Capaciles Using Encoding: A NSTF 8 string encoding]];    

    Google Map V2 disable MyLocation blue icon -


    जब मैं स्थाननियंत्रण सेट करता हूं, तो Google मानचित्र स्वतः नीले आइकन प्रदर्शित करेगा किसी को भी नीले आइकन को कैसे निकालना है ??

    धन्यवाद।

    मेरी कोडिंग है:

      निजी मार्कर myLocation = null; निजी शून्य को तैयार करना MapSetting (GoogleMap aGoogleMap) {aGoogleMap.setLocationSource (mLocationSource); aGoogleMap.setOnMyLocationChangeListener (mOnMyLocationChangeListener); aGoogleMap.setOnMapLongClickListener (mOnMapLongClickListener); aGoogleMap.setMyLocationEnabled (सही); } निजी OnMapLongClickListener mOnMapLongClickListener = नया OnMapLongClickListener () {@MapLongClick पर सार्वजनिक ओवरराइड (LatLng बिंदु) {if (null! = MOnLocationChangedListener) {if (null == myLocation) {myLocation = getMap ()। AddMarker (नया मार्कर विकल्प ()। (बिन्दु)। शीर्षक ("आप") .कॉन (बिटमैपडिस्क्रिप्टरफ़ीचर। डिफॉल्ट मार्कर (बिटमैपडिस्क्रिप्टरफ़िनेटर। HUE_GREEN))); } और {myLocation.setPosition (बिंदु); } स्थान स्थान = नया स्थान ("लोंगप्रेस लोकेशनप्रदाता"); location.setLatitude (point.latitude); location.setLongitude (point.longitude); mOnLocationChangedListener.onLocationChanged (स्थान); }}};    

    मुझे आपके प्रश्न को समझना नहीं है (मुझे आपकी छवि नहीं दिखाई दे रही है भी)।

    वास्तव में setLocationSource सिर्फ mylocation परत के स्थान स्रोत को निर्धारित करने के लिए है (यानी, नीले बिंदु ...)

    यदि आप नीले डॉट नहीं चाहते, बस डाल

      aGoogleMap.setMyLocationEnabled (गलत);   

    और locationSource का उपयोग न करें

    xml - Sql server xquery returning element name -


    मेरे पास निम्न xml है

      घोषित करें @ xml xml = '& lt; मान & gt; & lt ; एक & gt; एएए & lt; / a & gt; & lt; p & gt; बीबीबी & lt; / p & gt; & lt; / मान & gt; '; @ Xml.query चुनें ('$ के इन के लिए / मान वापसी कंसैट (", @", "=' '", $ k,' '' ')')   

    यह देता है

    , @ = 'एएएबीबीबी'

    हालांकि मुझे उम्मीद है

    , @ ए = 'एएए', @ बी = 'BBB'

    कैसे एक्सक्वीर लिखना है?

    मुझे यह पता चल गया।

      घोषित करें @ xml = '& lt; मान & gt; & lt; ए & gt; एएए & lt; / a & gt; & lt; b & gt; बीबीबी & lt; / b & gt; & lt; / मान & gt; ; @ Xml.query चुनें ('$ के इन के लिए / मान / * वापसी कंसैट (", @", fn: स्थानीय-नाम ($ k), "=' ', $ k,' '' ')') < / कोड>   

    java - How to store files in client machine? -


      फ़ाइल निर्देशिका = नया फ़ाइल (System.getProperty ("user.home") + "\\ डेस्कटॉप \\ "+ Svc); dir.mkdir (); फ़ाइल एफ; F = नया फ़ाइल (System.getProperty ("user.home") + "\\ डेस्कटॉप \\" + svc + "\\" + लॉगफ़ाइल + "_" + System.currentTimeMillis () + ".txt");   

    मैं इस कोड को उपयोगकर्ता (क्लाइंट) मशीन में फाइलों को स्टोर करने के लिए प्रयोग कर रहा हूं.लेकिन यह सर्वर मशीन में फाइलों को संग्रहित कर रहा है.क्या कोई मुझे इस पर मदद कर सकता है? मैंने अपने युद्ध फ़ाइल को यूनिक्स सर्वर में तैनात किया है।

    एक सॉफ्टवेयर को चल रहे सॉफ़्टवेयर से क्लाइंट मशीन पर सहेजा जा रहा है सर्वर उतना ही आसान नहीं है।

    सर्वरों को किसी भी क्लाइंट की फाइल सिस्टम तक सीधी पहुंच नहीं होती है - अगर यह मामला होता है तो यह बहुत असुरक्षित होगा।

    सरलतम ऐसा करने का तरीका सर्वर एक वेब पेज को एक लिंक के साथ वापस करता है जिससे उपयोगकर्ता फाइल को डाउनलोड करने के लिए क्लिक कर सकता है।

    आप कुछ और भी जटिल कर सकते हैं, उदाहरण के लिए एक ऐपलेट लिखो जो फ़ाइल को डाउनलोड करता है (कुछ फ़ाइल स्थानांतरण प्रोटोकॉल का उपयोग करके) और इसे स्थानीय फ़ाइल सिस्टम में बचाता है। ऐपलेट को उचित अनुमति होने की आवश्यकता होगी (डिफ़ॉल्ट रूप से, एपलेट स्थानीय फाइल सिस्टम तक नहीं पहुंच सकते हैं)।

    Free compiler + IDE for writing Windows App in C++ (for students) -


    I will teach middle school and high school students C ++ during this summer vacation. I went to a bookstore, browsed by thinking in some C ++ books such as C ++ Primer, C ++ programming language, C ++, and I am sure that when they read those books my students I will lose interest quickly :) It is 2 hours and for a week's program for a week, I do not have much time and the main goal is to encourage students to write an app and they will In the next session, the AP computer will be prepared to a certain degree (otherwise C + +) by using MFC itself. (I did not know anything about C ++), but Sam Thought of being able to write VC ++ MFCs and an app where I can click on a button and it pops up "Hello World", then it was very cooler then the Boring Console app. With screen and white text If I started with the console app, then maybe I will not do the software to live today.

    That is why I had to teach MFC to my students. I will not go very deep in MFC because the focus will be on C ++ and students Have to be excited about programming. Unless I realized that MFC is not included in the Visual Studio Express

    It would be great if there are C ++ compilers, IDEs and frameworks that my students can use for free and a window interface May be able to create an app. Thanks! Try the code: blocks: This is a free and open source, cross-platform IDE, which is a GCC And supports many compilers including Visual C ++.

    Code :: Block 12.11 is the latest stable version.

    Custom plugin .so library is not found for BlackBerry 10 with Cordova 2.8 -


    I have developed the custom Blackberry WebWorks native extension plugin to work with the new Cordova v2.8.

    To ensure that I have found everything, I wrote a simple "echo" plugin, as the guide described in their guide (which is quite unclear to be honest)

    Then I completely blown the execution. The C ++ project was made fine and the plugin was adding and deployed for the simulator, even without any errors. But when the plugin is implemented I get the following error "error does not require /usr/lib/webplatform/plugins/jnext/.so library can not be found".

    I used an FTP client to browse the simulator's file system and in fact the .pl plugin file is not on that directory, but when I open the app with the simple plugin (which works) If I run the plugin is still not on the directory. I can see that the plug-in is present in the folder where the app has been copied.

    Is there a way to debug this? Any thoughts ..?

    .so should be in the file / root / simulator / plugins / jnext / folder of your app, and If so, they will be copied to the right place. Make sure this is a simulator. Therefore the file (this plugin is done by the plugin via .xml)

    If the file is in the right place and the correct version and you still get the popup, then this is probably a missing dependency You will need to check your build script.

    java - Parsing nested tags through XSLT -


    मेरे पास ऐसा XML फ़ाइल है -

      & lt; item & gt; & LT; आइटम & gt; & LT; टैग & gt; मूल्य & lt; / टैग & gt; & LT; tag2 & gt; मूल्य & lt; / tag2 & gt; & Lt; / मद & gt; & Lt; / मद & gt;   

    मैं आंतरिक टैग को बाहर निकालना चाहूंगा ताकि यह इस तरह दिखता है -

      & lt; item & gt; & LT; टैग & gt; मूल्य & lt; / टैग & gt; & LT; tag2 & gt; मूल्य & lt; / tag2 & gt; & Lt; / मद & gt;   

    क्या यह XSLT के माध्यम से संभव है?

    बाहरी & lt; आइटम & gt; और & lt; / item & gt; यदि वह मदद करता है तो XML दस्तावेज़ की पहली और अंतिम पंक्तियों की गारंटी दी जाती है।

    अगर आप चाहते हैं केवल पत्ती के तत्वों को निकालते हैं (जिनके पास अपना कोई बच्चा तत्व नहीं है) फिर कुछ के रूप में सरल है

      & lt; xsl: stylesheet xmlns: xsl = "http://www.w3.org/ 1999 / एक्सएसएल / ट्रांसफॉर्म "संस्करण =" 1.0 "& gt; & Lt; xsl: टेम्पलेट मैच = "/ *" & gt; & LT; XSL: प्रतिलिपि & gt; & Lt; xsl: कॉपी-का चयन करें = "वंशज: * [[(*)]" /> gt; & Lt; / XSL: प्रतिलिपि & gt; & Lt; / XSL: टेम्पलेट & gt; & Lt; / XSL: स्टाइलशीट & gt;   

    नौकरी करेंगे।

    jquery - Check if paragraph only has child elements no text -


      & lt; p id = '1' & gt; & lt; / p & gt; & Lt; p id = '1a' & gt; & lt; br / & gt; & lt; / p & gt; & Lt; p id = '3success' & gt; & lt; b & gt; यह मैच करें & lt; / b & gt; & lt; / p & gt; & Lt; p id = '3fail' & gt; & lt; b & gt; यह मैच करें & lt; / b & gt; लेकिन अब इस परीक्षा के कारण नहीं & lt; / p & gt;   

    मेरे पास कुछ तर्क है जो निम्नलिखित तत्वों को पूरा करने वाले तत्वों को छोड़ने की आवश्यकता है

    1. कोई HTML नहीं
    2. केवल br
    3. केवल कुछ प्रकार के बच्चे तत्व हैं (बी, आई, आईएमजी)

      मैं आसानी से 1/2 को संभाल सकता हूं, लेकिन तीसरा मुझे परेशानी हो रही है। मुझे पता है कि बच्चों के हिस्से पर जोर देने के लिए, $ ('# 3fail')। बच्चों ()। लंबाई लेकिन मुझे पता नहीं कैसे पता है कि अतिरिक्त पाठ क्या है।

      कोई भी कैसे मान्य करने के लिए सुझाव 3? मैं एक सरल .each फ़ंक्शन

        $ ('p') में प्रसंस्करण कर रहा हूं। प्रत्येक (फ़ंक्शन () {var element = $ (this) अगर (मैचों कंडीशन (तत्व)) {डोलोगिक (तत्व)}});   

      नोट

      किसी ने एक उत्तर पोस्ट किया है और बहुत सारे अपवाद प्राप्त किए हैं लेकिन यह काम नहीं करता है।

      मैं @ कोलिंक के उत्तर को ठीक करने में सक्षम था

        var getNontextNodes; // coffeescript उत्पन्न getNontextNodes = समारोह (नोड्स) {var सीएनटी, एन, _i, _len; सीएनटी = 0; (_i = 0, _len = nodes.length; _i & lt; _len; _i ++) के लिए {n = नोड्स [_i]; अगर (n.textContent.trim ()) {cnt ++; }} वापसी सीएनटी; }; $ ("पी")। प्रत्येक (फ़ंक्शन () {if ((this.children.length === this.childNodes.length) || (getNontextNodes (this.childNodes) === this.children.length)) $ (यह & quot; बी शैली = 'रंग: हरा' & gt; सफलता & lt; / b & gt; "); और $ (यह) .append (" & lt; b शैली = 'रंग: लाल' & gt; विफल & lt; / B & gt; ");});    

      आप देख सकते हैं कि एक तत्व में केवल तत्व के बच्चों की जांच
      यदि (this.children.length == this.childNodes.length) , क्योंकि बच्चों [] केवल तत्व बच्चों की गणना करता है, जबकि childNodes [] में टेक्स्ट शामिल होता है नोड्स भी।

      एक बार जब आप यह चरण साफ़ कर देते हैं, तो आप बच्चों [] एरे के माध्यम से दोहरा सकते हैं और अपने tagName की जांच कर सकते हैं कि क्या वे ' अपनी सूची में फिर से।

      संपादित करें: मैंने अभी देखा है, यह किसी भी सफेद स्थान की अनुमति नहीं देगा, जैसे कि नई लाइनें, तत्वों के बीच। यदि आप सफेद स्थान की अनुमति देना चाहते हैं, लेकिन वास्तविक टेक्स्ट नहीं, तो इसके बजाय इस चेक की कोशिश करें:
      if (! (This.textcontent || this.innertext)। Match (/ \ s /))

      नहीं, वह काम नहीं करेगा यह, हालांकि होगा:

        var filter = []। फ़िलटर? [] .filter: फ़ंक्शन (सीबी) {के लिए (var i = 0, l = this.length, ret = []; i & lt; l; i ++) {यदि (सीबी (यह [i])) ret.push (यह [I]);} वापसी रिटर्न;}; $ ("पी")। प्रत्येक (कार्य () (यदि (this.children.length == this.childNodes.length || filter.call (this.childNodes, फ़ंक्शन (n) {return n.nodeType == 3 & amp; ; & Amp; n.nodeValue.match (/ \ S /);})। लंबाई == 0) $ (यह) .append ("& lt; b शैली = 'रंग: हरे' & gt; सफलता & lt; / b & gt;") Else $ (this) .append ("& lt; b शैली = 'रंग: लाल' & gt; विफल & lt; / b & gt;")});   



    regex - Regular expression to extract everything between braces in unix -


    I am trying to extract everything from a text file between the braces and write the output in the other text file. I was able to create a regular expression to match everything between {} and it works fine (I wrote a simple Java program to test it), but I am not very strong in Unix so Unix is ​​not sure about using this regular expression. \ {([^}] +) \}

    P> I have lowered the following command Tried,

      Cat Sample File | Sed -e s /.* \ {\ [[^}] + \) \}. * / / 1 / g '  

    I'm getting the following error.

      sed: -e expression # 1, four 24: invalid predecessor regular expression   

    between me to match everything between [] Regex got it and it works great is not sure where I'm going wrong Can anyone issue me my Rejox?

      cat file | Sed -e 's /.* \ [\ [[^]] * \) \].  >  cat file | Sed -e 's /.* {\ ([^}] \ + \)}. * / 1 / g '- & gt; Works    

    You have to avoid + quantifier

    How to make "git push" include tags within a branch? -


    When someone brings a branch, there is a tag in git fetch which indicates in the branch :

    When Ringspack stores results obtained in remote-tracking branches, then the tags indicated on these brands are automatically followed. This is done by fitting from the given remote, and if there are objects in the repository that are indicated by remote tags that are not yet, then get those missing tags. If there are tags on the other end which are interested in branches, then you will not get them.

    Is there a way to create git push the same way? The Man page tells you how to push any tag (default), all tags ( - tags ), or those you name on the command line. This does not give way to push all the people pointing at the branch.

    You can try, with (May 2013):

     < Code> git push --follow-tags   

    new " - follow-up tag

    This All will not push "option" to push git push "related annotated tags.

    As mentioned in "", it is not only for light tags, but only concerned.

    git tag 1.0 (lightweight) will not be pushed with - follow-up tags , this git push -tags Will be with.

    View this:

    With Git 2.4.1+ (Q2 2015), this option can be set as the default.

    View this:

    Add new configuration bits and then push.followTags configuration which - follow tag Changes by default. The document will include the following:

      push.followTags ::   

    if set to true By default, the ' - follow-tags ' option will default to this configuration as ' - no-follow-tag '

    You can override this setting by specifying, enable this setting globally, you git config --global push.followTags true . It can also be specified per repository-basis.

    mysql - Listing elements of my table -


    I doubt a table in the listing record where I use: JOIN, MAX, GROUP BY < P> I am using the following question:

      Select a CR. * Include one to CP CNNER in cliche_revisao cr on c.cliche_pk = cr.cliche_pk a WHERE cr.numero = (Select MAX (number) from cliche_revisao WHERE cliche_pk = 3) Group c.cliche_pk   

    The problem is, as there is one, for the list of all the elements, the subquiri will not have to pay literal value.

    I tried this question but it is not working

      select one Cr. *, @cliche: = c.cliche_pk one to cliché c INNER join clich_revioo CR on C.clitch_pack = cr.clitch_pac a WHERE cr.numero = (select MAX (number) fROM cliche_revisao WHERE cliche_pk = @cliche) c by a group. Cliche_pk    

    You have the right idea, but you want to use a correlated subquery Are:

      SELECT cr * Clutch C INNER to cliche_revisao cr click on c.cliche_pk = cr.cliche_pk WHERE cr.numero = (The maximum value will be found in the row. C.cliche_pk  

    < P>

    For each cliche_pk .

    Where to place the JavaScript in SharePoint Foundation 2010's list form? -


    We are new to SharePoint 2010 so that we would like to ask these questions.

    1. We are using SharePoint Designer 2010 for editing a list form (Newform, Edit and Disform) in SharePoint Foundation 2010. From the block of code behind a form, where should we place the javascript or javascript function (perhaps before or after a certain tag) at all places?

    2. I have heard that we can also include the script on a Content Editor Web Part. Will this be the same if we want to keep it on the code behind the form?

    3. How to call functions properly in the code behind the form? Call on a button click. Can you give an example code?

    4. In addition, can it call a function by creating a script in Notepad, save it to a shared document library, and write in the code you want

      thanks,

      Arnil

      If you use the script in each page, you can call it directly on the master page v4.master.

      If you use it on a particular page only on a content editor web part, you can call it in the same way

      I will give you additional JS files under csatalogs. Be sure to check in the script, make sure that you always check in the script, otherwise it will only be visible to the user who uploaded / changed it

    jquery - retrieving text from a group of textareas -


    I am trying to write text with a single name from a group of lessons.

    For some reasons, this is not working.

    Here are my text area:

        

    And here is Javascript:

      var Reply; $ (Function () {$ ('textarea [name = "tbmcq answer"]'). Map (function () {answers = "& lt; h3>" + this.value + "& lt; / h3 & gt; "}}}} Div.html (answer);    

    try it - (< Em> you will get an array of all values ​​

      var answer; $ (function () (reply = $ ('teddeta [name = "TBMCxager"]'). Map ( Function () {return "& lt; h3>" + this.value + "& lt; / h3 & gt;";}) .get (); $ ('div'). Html (answers.join ('' ));});   

    Demo ---->

    glsl - Does anyone know how to draw dotted lines in openGL SE using fragment shader -


    I tried to use this tutorial:

    But I do not know: sourcePoint, Mv and a_position

    If you have any other suggestions please help ...

    SourcePoint is the starting point of the line in the world space, this is a uniform , which means that the same value is used for the whole value.

    mv (also uniforms ) is modelView matrix, which changes a point from model space to world space, so that A_pose is using the same coordinate system as sourcePoint it is similar to u_modelViewProjectionMatrix but without launch changes

    a_position is a variation , which means that the peak shader determines a value for each top, and then the piece shader for each pixel If an interpolated value is found then the piece which gets the piece will be the position of the pixel in the world space.

    If you are still confused, then I suggest how the shaders will work. It may already be confusing.

    icons in a firefox android bootstrapped extension -


    I am working on a bootstrap extension for Firefox Android, and I have a problem showing the icon in a new menu item : MENUId = window.NativeWindow.menu.add ("Show more details", ico, function () {showToast (window);}); In the IOC, I have written the URI of the icon file in my Exchange (IONPN is next to Bootstrap.js): using data: and file: //, but the icon is not displayed as shown. I do not know how to fix the path for this. Besides, I am having the same problem with the iconURL in the installURL file, when I use Chrome: // I do not get anything, and when I use the resource I use: // I get missing image. Should I use Chrome? Chrome: // to use? And even if I do not specify the URL, to display the image as default, as if it still does not work.

      & lt; Em: iconURL & gt; Resources: // trackdetect / icon .png & lt; / Them: iconURL & gt;   

    I googled it, but, I could not fix it. Please help and thank you

    For this issue, just make sure that you have a file called icon.png XPI ( The root and image of the same folder as bootstrap.js will be used. You do not even need to enter the manifest:

    regex - program not writing to file but will write to console in c# -


    I have a C # program and it will not be written in a file, but the console, write even if file write line the first console I've tried several modifications, as well as run through debug, and it never writes to files or only

      // file read line Inserts a line in the file displayed in the line. System.IO.StreamReader File = New System. IOOStream Reader ("urltest.txt"); String myFileName = String.Format ( "{0} _ {1}", DateTime.Now.ToString ( "yyyymmddhh"), "-urlcheck .log "); While ((line = file.readline ()) = null () = Uriyyyuri = new Uri (line); Using (StreamWriter writer = new StreamWriter (myFileName) tried) {// (myUri) Web request and response has been URL that // just urltest.txt HttpWebRequest reqFP = (HttpWebRequest) read HttpWebRequest.Create file access Made on the basis of HttpWebResponse rspFP = (HttpWebResponse) reqFP.GetResponse (); If (HttpStatusCode.OK == rspFP.StatusCode) {// HTTP = 200 - Internet connection is available, the server online // Write log file URL to writer.WriteLine ( "status ========== = ================================================== ==== ========= "); Author. Rightline ("back position code: OK" + myUri + "This URL is not blocked!"); Console.light line ("back position code: ok" + myUri + "this url is not blocked!"); Var _uri = myUri.ToString (); String _catstr1 = catURL (_uri); // regex to get the last 8-9 of the line and Regex pat = New Regex (@ "& lt; / (. *?) A"); String _catstr = pat.Replace (_catstr1, "\ x20"); // Write the classification of the URL to write and continue to the author. WrightLine ("URL" + _catstr); Console.light line ("url" + _catstr); }}    

    Most should be even writes out to a file either Using a block inside or manually fade and closed.

     using  (var author = ...) {// your writing} //   

    Note: I am not a big fan of var , but I do not know what you call it Using a square, at least one valid example is code

    powershell - Python priniting strings with spaces between each characters -


    मेरे पास यह साधारण अजगर स्क्रिप्ट है:

      खुले ("records.csv" "R") के रूप में च: लाइन में f: प्रिंट लाइन   

    records.cv में निम्न की तरह कई लाइनें हैं।

    < P>, 0.055 ,,,, 109.889456433,119.043269058,128.455997141 ,,, - 0.607526459169, -1.28987216622, -1.36255539212, -0.0783128865694, -0.0745923352488, -0.0722692557059,0.325311331044,0.61140286319,0.0509661014105,0.719556483734

    हालांकि, ऊपर हमारी स्क्रिप्ट वर्णों के बीच रिक्त स्थान के साथ निम्नलिखित आउटपुट को प्रिंट करता है।

    एक एक ?? , 0 0 5 5,,,, 1 9 8 8 9 4 5 6 4 3 3, 1 9 0 4 3 2 6 9 0 5 8, 1 2 8। 4 5 5 9 9 7 1 4 1,,,, - 0 6 0 7 5 2 6 4 5 9 1 6 9, -1 2 8 9 8 7 2 1 6 6 2 2, - 1 3 6 2 5 5 5 3 9 2 1 2, - 0 0 7 8 3 1 2 8 8 6 5 6 9 4, - 0 0 7 4 5 9 2 3 3 5 2 4 8 8, - 0 0 7 2 2 6 9 2 5 5 7 0 5 9, 0 3 2 5 3 1 1 3 3 1 0 4 4, 0 6 1 1 4 0 2 8 6 3 1, 0 0 5 0 9 6 6 1 0 1 4 1 0 5, 0 7 1 9 5 5 6 4 8 3 7 3 4

    आउटपुट में रिक्त स्थान क्यों है और हम उन्हें कैसे हटा सकते हैं।

    मैं आपके परिणामों को पुन: उत्पन्न नहीं कर सकता मैंने आपके उदाहरण में कई पंक्तियों के साथ एक फ़ाइल बनाई है, लेकिन जब यह लाइनों के बीच रिक्त पंक्तियां प्रिंट करती है (एक लाइन के अंत के लिए और एक प्रिंट के लिए), कोई नहीं वर्णों के बीच रिक्त स्थान।

    ध्यान दें कि आपकी मुद्रित पंक्ति की शुरुआत में अजीब वर्ग प्रतीक है? फाइल की एन्कोडिंग में यह एक समस्या हो सकती है।

    java - Extending TreeMap to only take Integer -> Integer mappings? -


    I want to create a square that is an extension of TreeMap Is able to map to any integer no integer

    P> your class

      class Try to declare as MyTreeMap TreeMap & lt; Integer, Integer & gt; {  

    Note that there is no type parameter in MyTreeMap , because we know that we only want to deal with integer s .

    java - GridLayout wrong number of columns -


    I'm trying to make a panel with a grid-layout (7,2)

      membersPanel = new zpinal (new grid layout (7,2));   

    However, when I add components (label, Cambodia, textfield, etc.) the components are displayed in column 3, such as:

     Image

    I have tried to change the number of columns to 1 or 0, but the panel remains the same. What can i do

    Edit:

    Here's more code:

      p1 = new JPNL (); Memberspennel = new zpnell (new gridlate (7,0)); ResourcesLabel = new JLab ("resource"); MembersPanel.add (resourcesLabel); Empty label 5 = new jlab (""); MembersPanel.add (emptyLabel5); Empty label 6 = new jlabel (""); MembersPanel.add (emptyLabel6); ComboBoxResource = New JComboBox (configs.XMLreaderDOM4J.readResourceID ()); MembersPanel.add (comboBoxResource); Slider 1 = New SliderWith TextField (1,10); TextSli1 = New TextFieldFromSlider (this, Slider 1); Slider1.setTextField (textSli1); Slider1.setValue (1); MembersPanel.add (Slider1); MembersPanel.add (textSli1); Empty label 2 = new jlab (); MembersPanel.add (emptyLabel2); AddButton1 = New Pocket ("Add"); AddButton1.addActionListener (New TrataEvento ()); MembersPanel.add (addButton1); Agregator1Label = New JLABEL ("Aggetagor 1"); MembersPanel.add (agregator1Label); ComboBoxAgregator1 = New JComboBox (configs.XMLreaderDOM4J.readAgregator1ID ()); MembersPanel.add (comboBoxAgregator1); Slider 2 = new slider width textfield (1,10); TextSli2 = New TextFieldFromSlider (this, Slider 2); Slider2.setTextField (textSli2); Slider2.setValue (1); MembersPanel.add (slider2); MembersPanel.add (textSli2); AddButton2 = New Pocket ("Add"); AddButton2.addActionListener (New TrataEvento ()); MembersPanel.add (addButton2); Empty label 3 = new jlab (); MembersPanel.add (emptyLabel3); Agregator0Label = New JLABEL ("Accelerator"); MembersPanel.add (agregator0Label); ComboBoxAgregator0 = new JComboBox (configs.XMLreaderDOM4J.readAgregator0ID ()); MembersPanel.add (comboBoxAgregator0); Slider 3 = new slider width textfield (1,10); TextSli3 = New TextFieldFromSlider (this, Slider 3); Slider3.setTextField (textSli3); Slider3.setValue (1); MembersPanel.add (slider3); MembersPanel.add (textSli3); AddButton3 = New Pocket ("Add"); AddButton3.addActionListener (New TrataEvento ()); MembersPanel.add (addButton3); EmptyLabel4 = New JLab (); MembersPanel.add (emptyLabel4); P1.add (membersPanel); Number of columns used for    

    swing Grid layout if the number of components added is greater than the original number specified. Use 0 to specify an adjustable number of rows:

      memberspanel = new zpinal (new gridlate (0, 2));   

    This will make factoring easier in the future.

    c# - Entity Framework with optional parameters? -


    Using Entity Framework 5 It is possible to use a stored proc with such a preferred parameter, Do not need to add each unused parameter?

    The stored procedure I use is 87 parameters, of which only 2 are required. I really hate the idea of ​​putting 85 tap in each call.

    You can use the method ( DbContext to perform some stored procedure and list the parameters To execute, there is a wrapper on ObjectContext :

      FooEntities db = new FooEntities (); var objectContext = ((IObjectContextAdapter) DB.) ObjectConnectX; // To create the parameter you need the name var = new object peer ("name", "lazy"); Var age = new object punter ("age", 29); // Called with these two parameters. Recovery is the only var result = objectContext.ExecuteFunction & lt; result & gt; ("ProcedureName", name, age);   

    You can change your code to your DbContext For the extension method, you can wrap:

      public static result process name (this FooEntities db, name, age) {// code above}   

    Will be used as: var result = db.ProcedureName ("lazy", 29);

    windows - CMake: download and run msi -


    Access to CMake the Kitware, it is possible to automatically download a Microsoft installer (MSI) file (execute Windows To, of course)?

    "after item" itemprop = "text">

    This should generally be. However, is clearly running the installer will block the CMake process until the user completes all necessary information to the installer

    The use of 7-Zip is an example of the founder And:.

      set (DownloadedMsi $ {CMAKE_BINARY_DIR} /7z920-x64.msi) file (download http://sourceforge.net/projects/sevenzip/files/7-Zip/9.20/7z920-x64 .msi / download $ {DownloadedMsi} TIMEOUT 30 position StatusVar log LogVar EXPECTED_HASH SHA1 = 4173fea2af9a595fa0be1ef8251f412229687be1) Send ( "\ $ {StatusVar} - $ {StatusVar}") Send ( "\ $ {LogVar} - $ {LogVar} \ n \ n \ n ") execute_process (COMMAND cmd / c" $ {DownloadedMsi} "RESULT_VARIABLE ResultVar OUTPUT_VARIABLE OutputVar ERROR_VARIABLE ErrorVar) Send (" \ $ {ResultVar} - $ {ResultVar} ") Send (" \ $ {OutputVar} - $ { OutputVar} ") message (" \ $ {ErrorVar} - $ {ErrorVar} ")    

    JQuery plugin qTip2 - Click-to-show only works on the first element the first time -


    I have a page in which it has some DIV. Whenever a DIV is clicked, I want to show a qTip2 I am working with qTip due to some other things, if possible, I want to use it more than once.

    Therefore, I used the QTip2 demo as a starting point and as far as I can tell that I have repeated it properly though there is a problem here: it only shows qtip on the first element Clicked - for the first time. It will show on all the other elements several times as often as you want to click on them, but for the first time only for the first time

    Has anybody tried and followed it?

    Here is the code for a sample app that I created that demonstrates the problem:

    CSS:

      #container {border: 1px solid black; } #Container & gt; DIV {float: left; Border: 2px introduced silver; Margin: 5 px; } #Container & gt; DIV: nth-last-child (1) {float: none; Border: None; Height: 1px; Hidden flurry; Margin: -1 pixel 0 0 0;}   

    javascript:

      var container; Var container and item; $ (Document) .ready (function () {container = $ ('# container'); if (container.label == 0) {warning ("container not found!"); Return;} var addLinks = $ (' .tipTarget '); $ (' 
    test & lt; / div & gt; '). Qtip ({content:' test ', position: {goal:' mouse ', // Adjust positioning goal by using: {mouse: false, method: 'flip'}, my: 'left center', at: 'right center', effect: true // enable default 'slide' position animation}, show : {Target: addlinks, event: click ', delay: 0}, hide: {event:' someone Yes}}, event: {show: function (event, API) {// every show var tool = $ (event.originalEvent. Target); if (target.length) {api.set ('content.text', ' Looking at: '+ target.text ());}}}});});

    HTML:

      & lt; Div id = "container" & gt; & Lt; Div id = "apples" class = "tiptarget" & gt; Apple & lt; / Div & gt; & Lt; Div id = "watermelon" class = "tip target" & gt; Watermelon & lt; / Div & gt; & Lt; Div id = "pitchis" class = "tip target" & gt; Peaches & lt; / Div & gt; & Lt; Div id = "meat" class = "tiptarget" & gt; Meat & lt; / Div & gt; & Lt; Div id = "clear" style = "clear: both" & gt; & Amp; Nbsp; & Lt; / Div & gt; & Lt; / Div & gt;   

    JQuery: 1.8.3

    qTip2: 2.0.1

    There is a JSFDial with this exact setup:

    Note that if you start the apple, watermelon, then peaches, then apple, watermelon, then clicking on peaches and repeating that the apple will first show the tip. Until the cows come home they will be shown to others.

    Note that if you start with fresh and turbulan, it will only appear for the first time, but the rest will show every time.

    What have I done?

    (And I have already tried to use "every" construct - this behavior does not change at all)

    Thank you!

    I got something when editing my code. If you change your code to:

      Adjust: {mouse: true, method: 'flip'},   

    tool tip works fine

    run oracle sql code online -


    Is there any website where you can write Oracle SQL code, maybe even create a small database, run it See more an output? I tried searching online but I could not find anything besides this.

    Let you run schema objects and questions against them. It is very good to try things out, here it has become quite normal for the answer that a code sample (which is apparently included) is included to include a link for a ULL.

    It is free, but welcomes donations.

    unit testing - How can I inject a dependency on a singleton object? -


    Let's say I'm testing a method on which there is dependency on a single (imported) Singleton instance called WS (web service), which has it. One method, url (url: string) , which returns a URL and returns a request.
      def doRequest (url: string): future [feedback] = {val request = for WS.url (url) {feedback < - request.post (params)} yield {val res: JsResult [MyResult] = response.json.validate [MyResult] res.getOrElse (New NotSupportedException Throw)}}   

    I WS Dependency I would like to be able to inject as my unit tests do not require a real outbound http request, but instead can depend on a fake WS example

    This has been a challenge for me because A singleton technically does one type (class [WST] Ip]), the properties and methods of WS are lost when Singleton requires a Val that expects class [WS.type], that means that I can not just use a simple cake pattern like: < /p>

      Properties WSComponent {val: ws: class [_ & lt;: WS.type}} Object ApplicationContext WSComponent {val ws = WS} Object Test Context WSComponent {val ws = mock [ws]}   

    , and then in the context of WS methods in any context, I get a compilation error, which means that [_ & Lt;: WS.type] in no way (for example) url ().

    Looks like a similar reason (basically, there are no types in single objects - even though they do--), I can not provide an indirect parameter that is a W. Because S. again, because again, I will lose the declared methods and properties on single methods.

    What are the perspectives for single-object dependency injection? I like to enjoy cake pattern for DI, but it offers a lot of boilerplate for my code, so the ideal solution will not combine the code with more boilerplate.

    Thanks in advance for any suggestions.

    There are types of singleton objects, and you can call methods on them:

      Scala> Val I: Int.type = Int i: Int.type = Object scale. Intake Scale & gt; I.box (42) res0: integer = 42   

    I think what to do with your error

      val ws: class [_ &  

    > It can not be compiled, and in fact there is a class [...] any url () method is not just you ws From WS.type to: WSComponent {val ws: WS.type}

      Pre> 

    and Fake [WS.type] Change the joke to


    Edit : The other route below works only when you have control over the WS type (apparently this It is not the case because it comes from the game)

    If you really want to avoid the singleton type, you can use the WS

      attribute WS {DRAR URL (url: string): request} extends object singletonwaves to ws {/ code> one with singleton implementation Refer to the specialty in the specialty, and only in your cake. Def url (url: string) = ??? // real implementation}   

    and in your cake:

      Properties WSComponent {val ws: WS} object applicationContact WSComponent {val ws = SingletonWS} object Enhances TestContact extends to WSComponent {val ws = mock [ws]}    

    Explicitly free memory underlying C++ iostream -


    I am writing a C ++ application that provides large amounts of binary data (10 M +) deposits and dyes To use an iostream frequency. The stream is preferred for many reasons, but the most important of these is the ease of integration with the third-party stream-based API, without the need for any kind of memory copies.

    When I am used to digest the data, I would like to clear the iostream example the underlying memory. I am sure that when the example goes out of the scope the memory will be released, but since I am passing it in API, I'm not sure that it will be handled efficiently. If I was using a stringstream, I can call std :: stringstream.clear (); Std :: stringstream.str (std :: string ()); . Is iostream 'reset' clearly a similar way?

    Thanks in advance.

    solution is to use a std :: stringstream std :: iostream objects are summarized for temptation.

    javascript - Backbone.js events on templates -


    I am trying to allocate an event to a button by using backbone events:. I tried to do all this, but nothing has been working till now. My suspicion is that I can not add events because $ el's content has not been updated yet (I am using underscores in a template). So my question will be how can I assign events to those classes that are not initially loaded?

    My code is on Githubo in the repo

    The file I am working on is located under the UI / Script / view / UserPage.js.

      Var UserView = Backbone.View.extend ({initialize: function () {}, render: function () {var data = {}; var compiled = _.template (UserPage, data ); $ When ($ ('.main') .html (compiled)). (Function () {this. $ El = $ (". UserEdit"); console.log (this. $ El);}) ;}, Event: {"click .example"}: "OpenPreview"}, OpenPreview: Function () {Warning ("HI");}   

    This template ui / script / View / Template is located in the user page.

      
    div class = "header"> gt; & lt; h2 & gt; user Edit & lt; / h2 & gt; & lt; button & gt; & l T: / button>

    PS: I have already tried to solve this problem but I failed

    Your event after you changed this. $ El Is not being given the correct element. $ El , this will work with the delegation again for you.

    In addition, you will need to create a view variable to keep the context of this , because inside callback No reference now.

    Your render function should look like this:

      render: function () {var data = {}; Var compiled = _template (UserPage, data); Var Views = This; $ .when ($ ('main') .html (compiled)). (Function () {view.setElement ($ (". UserEdit")); console.log (see. $ El;)}); }    

    vb.net - Trying to do a selection.replace with an xlUp -


    So I'm trying to find a variable where I fill the empty space in a space for a row . Convergence where I pull down a line, all I need is to help fix my XLEF so that it works with selection.

      Sub-replacement blanks () Long set LR = Range ("A2: R" and cells (Rows number, 1) in the form of slow LR. End (XLEE) .OO range (LR). Choose. Change: = "", Replacement: = "blank", LookAt: = xlPart, _SearchOrder: = xlByRows, Match CAS: = False, Searchformat: = False, Change _Fileet: = False and Sub   

    I also forgot to add this error, its "Compilation error: Object required" I am doing a lot of work in excellence in my internship this summer, and I look forward to becoming more knowledgeable about it I am stuff I appreciate your help! RR set RR like RR = "Range" ("A2: Substituted Blank");



    java - Combining Application and Server Level logging with Log4J? -


    Is log4J / tomcat working with two different levels of logging possible? Here's my situation: I have some webapps working on the same tomecat server. Some of these applications have their own log4j property (legacy)

    Some of the things I want to add include a JDBCPaepad Is a new logger which will work in all these applications (they have to be used together, so we will be very much useful to log in to the DB who choose them. ) I like this I want (and have been tested in one of the local property files for syntax purposes) to the properties file entries are written.

    Is it possible to leave this new logger / jdcbender in the server-level log4j.properties file, and then what webapp can access it? For example, if I define logger as 'com.xxx.yyy' then there is a call in the class that grabes the 'com.xxx.yyy' package in any webpap, in which the caller to the logger: < / P>

      Private Static Logger Logger = Logger. GetLogger (MyClass.class);   

    Assuming the full declaration is com.xxx.yyy.MyClass.

    I have tried to leave the log4j.properties file in $ CATALINA_HOME / lib directory as well as necessary jar files in the same directory (as in the comments below But when I launch my server, it does not seem that one up, though it raises one above my webapp I know that the property file should be on the classpath to move to Class 4, but it A similar-square path style May be required if there is more than one log4j.properties file?

    Update: I updated the details of what I did.

    I have done some additional research and have learned that if multiple logs 4 j.properties If the files are in space, the system first finds it, such as with Java class / library files.

    Finally, the situation I am describing is not possible, the legacy property files of all my web-apps will be ignored for adding one server-level properties. It is still possible to do something like this, but my question was specifically to focus on the log4j.properties file.

    c++ - Error loading cr2 with edsdk -


    I am trying to read CR2 images using canon_edsdk-2.12

    I think the DLL is loading properly, but when I try to get the real image, I get an error.

    I tried to run a sample program, to see how it is different from me, but it does happen.

    While trying to find the problem on the web, I found the actual source code of the sample:

    My error is, at the given source, in the zero CRAWDevelopDlg :: Load image () function -

      err = EdsGetImage (m_ImageRef, source, kEdsTargetImageType_RGB, rect, size, DstStreamRef); If (err == EDS_ERR_OK) {...} else {AfxMessageBox ("There was an error with the EdsGetImage function."); }   

    The above method (on line 481 on page) is the only method I use, and I get a single error - with error code 35 (instead of 0).

    The error appears

      #define EDS_ERR_FILE_OPEN_ERROR 0x00000023L   

    So ... can there be something wrong with files? I experimented with the files taken by various editions including the latest versions ... files open in Photoshop ... and demo header shows notifications, because this gives error, so it can see something.

    Am I missing anything?

    All the required DLL systems are on the path ...

    Thanks. P>

    The old question, however, can help someone:

    A raw file To open the SDK, you need to call these functions (you should definitely check the errors):

      EdsStreamRef stream = zero; EdsImageRef imgRef = NULL; EdsCreateFileStream ("filename", KfSFile_UpdateXing, KAIDSAS_RIR, and Stream); EdsCreateImageRef (stream, & amp; imgRef); EdsRelease (stream);   

    Then you can set and get properties with imgRef.

    Use the EdsSaveImage function to save the image as jpg / tiff / rgb image.

    d3.js - D3/SVG: Why is this code slower when selection is changed? -


    I have a group selection that passed this function which I used to use this group.addend ("path") Make a call. Blah.blah It is incredibly slow, maybe 100 times the slowest can not tell this because 2V is delayed, but the SVG shown below is used immediately. Append is being used immediately. Can anyone tell me why? Although it works, I have to repeat the translation that I had already done for the group and it is preparing to order my SVG element.

    This way my node group has been declared

      var node group = svg.selectAll ("g") .data (listNodes). Enter () endend ("g") .attr ("id", function (d) {returns "group_" + trim white space (d);}). Etiquette ("Transform", "Transform (580,260)");   

    and how svg is declared

      var svg = d3.select ("# container") .append ("svg") .attr ( "Id", "svgcontainer") .attr ("viewbox", "0 1300 610") .attr ("perserve aspectratio", "xMinYMid") .attr ("width", w + margin.left + margin.right ) .attr ("height", H + margin.Top + margin.bottom) .Append ("g") .attr ("conversion", "translation (" + margin left. "," + Margin.Top + " ) ");    

    What are you trying to do? Personally, I consider it a bad form to mix loop with d3.js; D3 data binding is usually a better way of working compared to the loop.

    Go back to your question, when you change the node group with STVG, you basically repeat the loop listNodes.length times (ListNodes.length x listEdges.length executions List.Engges.length instead).

    Perhaps you should expand on what you are trying to do?