Posts

Showing posts from May, 2010

javascript - mongoose .save() hangs with 3 level of subdocuments when called from node.js -

I am currently working with Mongoose and Node.JS. I am using these schemas, this question): var gameSchema = new schema ({game id: {number:}}, round: [round. Schema]}); Var roundSchema = new schema ({roundId: {type: number}, rows: [Line.schema]}, {_id: false}); Var lineSchema = new schema ({lineId: {type: number} plays: [Play.schema]}, {_id: false}); Var playSchema = New schema ({Category: {type: string}, Score: {type: number}}, {_id: false}); For the first time, I get a goal together with one goal, and after that some characteristics are changed and the score is pushed with many plays. When I try game.save (function (err) {console.log ("save it"); if (! Mistake) {console.log ('ok') ;} And {console.log ('error:' + error);}}}); The server is just hanging and does nothing, none of the console messages print. Seeing the Mongoose Lodge, I could not find an error message or some logs helped me. The strange thing is that if I change the array wit...

redhawksdr - How to make gnuhawk component AudioSink load to redhawk? -

चल रहा है CentOS 6.5 और RedHawk 1.9.0 , और मेरे पास है ऑडियो-घटकों को $ SDRROOT में स्थापित किया गया है, और ऑडियोसिंक पैलेट में दिखाई देता है, ये सब अच्छा है हालांकि जब मैं इसे शुरू करने के लिए डबल क्लिक करता हूं तो मुझे त्रुटि मिलती है: घटक को लॉन्च करना AudioSink_1 को एक समस्या आई और लॉन्च करने में विफल: AudioSink_1 जब मैं विवरण पर क्लिक करता हूं तो मुझे मिलता है: लॉन्च करने में असफल: ऑडियोएसिंक_1 और आईडीएल: सीएफ़ / निष्पादनक्षमडिवाइस / एक्जिक्यूटफ़ाइल: 1.0 बहुत जानकारीपूर्ण नहीं है घटक ऑडिओसोर्स और ऑडियोटेस्ट सोर्स भी लॉन्च नहीं करते हैं। मुझे आपके द्वारा वर्णित वर्णों के लिए बहुत ही समान समस्या थी मैं एक्सोस-इंजीनियरिंग के आरटीएलटीपीपीएसएसओएस घटक का उपयोग करने की कोशिश कर रहा था। मेरे लिए यह समस्या क्या थी कि मैं घटक को ग़लत ढंग से स्थापित कर रहा था इसलिए मेरे लिए यह है कि मैंने रेधावाक में एक घटक स्थापित किया है। मूल स्रोत कोड डाउनलोड करें। (यदि आवश्यक हो तो खोलें) राधाक्षेत्र आईडीई (ग्रहण) खोलें फ़ाइल-> आयात करें ...-> कार्यक्षेत...

objective c - iOS drawing context NULL in gesture handler -

I am having difficulty in attracting iOS in response to gesture events, and I'm sure this is because I Perhaps some non-obvious fundamental iOS programming concepts have been lost. Anyway, it seems that when code is executed in response to an event, UIGraphicsGetCurrentContext () taps me, I do not understand why other drawing code in the view method of the view, just fine Does. I can see that the events are being removed as I am logging in. UIGraphicsGet taps the currentContext when executing inside the event handling code (even when it is in the code view function that sets event handling? Additionally, this error is logged: error>: CGContextSetFillColorWithColor: invalid reference 0x0. This is a serious error. This application, or uses a library, is using an invalid reference and System Stability And the overall level of reliability contributes to the decline. This notice is a courtesy: Please fix this problem. This will be a serious error in the upcoming update. ...

SQL: update table using create statement -

I am using the following to update the fields in my SQL table: Private string update data (handle, string user name, string name, string table) {handle.createStatement ("sql / Create.sql") .bind ("playername", name) .bind ("tablename", table). Execute (); } The create.sql file is as follows: update: tablename SET varname =: name name: name =: username {/ code> I know that this is not working because: tablename is a string variable i will type code for sql to identify the name of the table as i actually do it as hard code Typed? You can not name table as a parameter - only data can be passed to you To change and change the table name "paste" in SQL itself. Very Important Note: You have to make sure that the value of the table variable does not come from any type of user input. Otherwise, you are opening your code in SQL injection attacks. string sql = string.form ("UPDATE% s SET varname =: name of name: name =: u...

postgresql - Rails changes postgres SELECT * to SELECT COUNT -

I am working with RailsCast on token input and am trying to clear a query method for Postgres . I got to make my query db-agnostic. My method: def self.tokens (query) t = language.arel_table languages ​​= Language.where (t [: name]. March ("% # {Query}% ")) if in languages [{Id: " ", name: "new: \" # {query} \ ""}] ending returns : 001 & gt; But if language from "language" ("language" "name" ILIKE '% RU%'). I use language = instead of return , I get the right query: txt = .arel_table return language: where (t [: names] matches ("% # {query}%")) Language. ('Ru') language load (0.9 mms) Select "languages". * WHERE ("Languages". "Name" ILIKE '% RU%') from "Languages" This is probably something obvious, but I did not know why the first method should be chosen Because the 'languages' table is selecting count ...

Importing and parsing a large CSV file with go and app engine's datastore -

Locally I successfully (in action): Open the CSV Scan through each line (Scanner. Map the desired structure to the parseed CSV line Save the Stret to the datastore I think that I Will allow - but there is a limit of 32MB. I also see that there is a bulk upload tool - bulk_uploader.py - but not all data-mastered Sing what I want and I want to limit the type of bulk entry (and the cost). How would a very large (500 MB +) CSV file read and parse effectively without the benefit of reading from local storage? You have to look at the following options and see if it works for you: Looking at the larger file size, you should consider using it for a file. You can use command line utilities which GCS makes available to upload your file to your bucket. Once uploaded, you can view directly using the JSON API to work with the file and import it into your datastore layer. Take a look at the following: If it is like importing a large file once, then another option can sp...

.net - Access modifiers C# -

I have a class card and it has some features that get their value from the external API Is: Public Bull eCard {Receive. This._isCard; }} Public Balls ISSpell {Come back. This._isSpell; }} Public Bool ISMian {Receive. }} Come to the Public Bull ChristianPhone. }} Public Balls Esapower {Come back. }} Public Balls Isplelier {Come back. This._isplayer; }} Public Bull Eyesgam {Get It} }} Public Bull Ehora {get {this._isHero; }} So it will be like my master's class for all the cards, including weapons, spells and minions. (Of course there are more members in the actual category.) Then I have the Minion class which comes from card ( Minion: Card) ) The problem I face is that I obviously use those members from Minion (because they are doing public) And this also does not make sense (my password is not clearly) (my password is not), so my question is: I only send those members to the card class How to keep me and for the kids? The Personal modifier will not give...

SQL Server Express, Local DB and SQL Server CE and Windows Azure Auto-sync -

Forgive me, I'm not a developer I've seen the tone of the post about these three little monsters but still its There is confusion in using. Here's my use case: I have a WPF application that runs in the client. A place that contains a master client machine and some slave machines with the same app. The slave app writes to Master DB through the web service (IIS required). Master DB will then synchronize with the creation of Auto Sync feature with Windows Ezur. Here are my questions: Which DB should be used to do me: is being installed easily in the client, i.e. if you Will say SQL Server Express, can we package IIS, SQL Server Express and My WPF applications into a package for easy installation in the client-side? Able to use the Azure Auto Sync feature - Free licenses for local DB subscriber consumers - have heard that the SQL Server Express client has a limit of 10 GB or otherwise License fee must be paid, this is true Thank you.

javascript - Cannot Reach Deleted Array Object -

We are working on an app that will show a list of employees' shifts. If any change has already been passed, we want to remove it from the array of shifts and hence do not want to print it to the DOM. We are effectively removing the object with the delete array by doing this, we know that by removing the object from undefined Will be left in the form. However, when it prints on the screen, it is undefined (this part is understood), but when we try to catch them with the function to fix this problem (we can arrange the array without any Copying), we ' HTML : & lt; Ul & gt; & Lt; Li ng- Repeatable = "Make changes to current user. Sort = (schedule | order: time.gettingdet: incorrect)" & gt; & Lt; P & gt; Start time: {{time.macad (change start)}} {{time.maketime (change start)}} & lt; / P & gt; & Lt; P & gt; End time: {{Time.makeDate (shift.end)}} {{Time.makeTime (shift.end)}} & lt; / P & gt; & Lt; / Li ...

c# - EntityException was unhandled the underlying provider failed to open -

I am using VisualStudio2012 for development. I have created a class library EMPDAL , where I am using the employee table NorthWnd to connect with the Entity Framework and when I configured the database I To get employee details I've written the code below. Public class EmplooyeeData {public static list & lt; Employee & gt; GetEmployees (Int EmployeeId) {(DbEntities dbContext = new DbEntities ()) {return dbContext.Employees.Where (x = & gt; X. EmployeeID == EmployeeId) .toList (); }} I created a console application to use this EMPDAL , so I had given reference to my EMPDAL and Below used code for getting employee details Fixed zero main (string [] args {list & lt; EmpDAL.Employee & gt; Emp = new list & amp ;; EmpDAL.Employee & gt; (); Emp = EmpDAL.EmplooyeeData.GetEmployees (1); } But when the client calls the code GetEmployees (1) and goes into the debugger EMPDAL.EmpDataGetEmployess method, then change In this statement throws ...

javascript - Loading primefaces inside a div -

I am trying to load jsf 2 pages inside a div element of another page. The problem every time when I load the JSF page inside the div, the primary Firefox loads JavaScript resources that present the components and fails because JavaScript has already been loaded in the DOM in the previous call. It is possible Thank you in advance As far as I know that you can not include a full standalone xhtml file but you can add content to a different & lt; Ui: include & gt; can extract into the file and include it in both pages. Basic example here:

excel - Separate lines while reading a file in VBA -

I am trying to read a file with a VBA code - but when I try to read it I get all the text as a line: Open FileNum = OpenFile () OpenFileName for input as #FileNum, while not EOF (FileNum) line input #FileNum, DataLine ' Read the data at one time if the lane (dataline) & gt; 0 Then LineItems = Split (DataLine, vbTab) end if Wend In this code, I get all the text in "LineItems", such as the cell of 15 ... I "VbTab" "Instead of vbNewLine" "But then I got all the text in a cell - LineItems (0) (goes to use the same" vbCrlf ") So my question is - is anyone Thinking how to withdraw the text from the line? And if not - I had thought of separating the text into different lines, and then by tab for each line Separated from ... So what other ways, except "VbNewLine" new lines? Thank you! There is a carriage return (13 or 0x D) (used by VBSTTP and VBA codes), there is a line feed (10 or 0xa) (neglect of the carrier...

ruby on rails - RoR routing error, No route matches [POST] -

I'm starting in Rail, this is a Rail Guide blog app, after submitting the form I Do not get [POST] "/ article / new" which is strange because as you can see from the routes given below, there is no post for article / new. Controller file: def new @article = Article.new end def can be created @article = article.new (article_params) if @ article.save redirect_to @article Else 'New Render' End and Def Show 'Artical = Article PAYMENT (: Title:, Text) and Route file: Code> Rails.application.routes.draw 'Welcome / index' root 'Welcome # index' Get the resource: article route: prefix verb Welcome to URI Pattern Controller # Action welcome_index GET /welcome/index(.format) # Index Root is Received / Welcome # Index Articles / Articles (. S # Index POST / Articles (. Content) Article # Create new_article / article / new (.: Format) article # New editing_article received / article / ed / edit (Format: Articles) Articles # Get Ar...

linux - MCR (MATLAB compiler runtime) with Image processing toolbox -

I am trying to implement Java applications from MATLAB. I create my jar file from MATLAB R2011a with deploytool on Windows 7. I also installed MCR r2011a on Ubuntu, and thus have set environment variables. ## MATLAB Compiler Runtime (MCR) export LD_LIBRARY_PATH = / usr / local / MATLAB / MATLAB_Compiler_Runtime / v81 / order / glnxa64: / usr / local / MATLAB / MATLAB_Compiler_Runtime / v81 / bin / glnxa64 : / usr / local / MATLAB / MATLAB_Compiler_Runtime / v81 / sys / OS / glnxa64: / usr / local / MATLAB / MATLAB_Compiler_Runtime / v81 / sys / Java / JRE / glnxa64 / JRE / lib / amd64 / native_threads: / usr / local / MATLAB / MATLAB_Compiler_Runtime / v81 / sys / Java / JRE / glnxa64 / JRE / lib / amd64 / server: / usr / local / MATLAB / MATLAB_Compiler_Runtime / v81 / sys / Java / JRE / glnxa64 / JRE / lib / amd64: $ LD_LIBRARY_PATH export XAPPLRESDIR = / usr / local / MATLAB / MATLAB_Compiler_Runtime / v81 / X11 / application-defaults When I run my jar file on Ubuntu, I ...

vb.net - Timer does not work -

I try to run a timer with my Winform application. Called not a reason to break the timer tick ( IsTimeOffsetValid ) running on function points nor stopped, and basically does nothing Below I attach a code sample. I appreciate the help. Module Module1 Sub Main () Dim OutputForm new Forml7 ApplicationkRun (End Sub End as OutputForm) module public class Forml7 this object personal TimerServerOffset New System.Timers.Timer Private sub Form17_Load (ByVal, ByVal e as System.EventArgs) handles Me.Load as AddHandler TimerServerOffset.Elapsed, New System.Timers.ElapsedEventHandler (AddressOf IsTimeOffsetValid) TimerServerOffset.Interval = 1 TimerServerOffset.Start () end sub Private sub IsTimeOffsetValid () MsgBox ( "IsTimeOffsetValid") end sub end class posted by you Apart from the errors in the code, there are other problems with the design. Read this question: Callback is called on a worker thread (not UI thread), so displaying a message box can be a big pro...

java - Attempt to invoke virtual method. App to display Location -

I am trying to create an Android app that displays the current (or the last known location) of the device. This error, which is shown in lockback: 07-27 14: 47: 53.766: E / Android Time (28080): Reasons for: java.lang.NullPointerException: Applying the Virtual Method Attempt to 'double object' on 'Null object reference' Location '' place.Getlighttime () '' ' This is my Java code: Package Com. Examples. Atosilens; Import android App Import android.content.Context; Import android.location.Location; Import android.location.LocationManager; Importroid.os.Bundle; Import android.view.Menu; Import android.widget.TextView; Public class increases main activity activity (textview lat = (text view) searchVBIID (R.L.L); textview lawn = (text view) Find VVBID (R. deidel); Int b, c; @ Override protected zero creation ( Bundle saved instenstate) {super.naught (savedinstenstate); setContentView (R.layout.activity_main); LocationManager lm = (LocationMan...

php - IIS webpage failing to load | Fast CGI related -

Image
So I'm running Windows Server 2012 with IIS 8. I have been working on several things PHP, so I have installed PHP 5.5 through the web platform installer and before that CGI has been installed through server manager. When I try to load the page, I get this error message that I do not think is able to solve: Anyone have a solution? Check that your PHP really command line Such as the CD to the directory where PHP has been installed and then run " php -v ". If you are missing some system files, then PHP should show details of its description or performance errors. Check the Windows Event Log and search for errors while loading your webpage in IIS. I suspect that you may not need PHP 5.5. Not sure that the web platform installer installs it for you. Go to Add / Remove Programs and see if you have installed it. Errors from one of the above sources should help tell you that this is your problem.

Returning to Android app after external video player closes -

I start a video player from my Android app using the following code: Intent to intent = new intent (Intent.ACTION_VIEW); Intent.setDataAndType (Yuri, "Video / MP3"); Intent.putExtra (MediaStore.EXTRA_FINISH_ON_COMPLETION, incorrect); Activity.start activity (intent); It works fine, as long as I do not use my app back when the user returns the player using the back button: when the video player is over I come back to the launcher screen - the user is not expecting Any sign that what can be done to re-activate my app when the external player is finished? I know that I can execute playback within my app using the media player and my player, but I do not want to start this practice now. MediaStore .EXTRA_FINISH_ON_COMPLETION ensures that the external video player does not close when it does not have any effect when reaching the end of the video. Thanks, Herald

javascript - regex to validate emails which allows only these two special symbols .,- before @ symbol -

इस सवाल का पहले से ही एक उत्तर है: 65 उत्तर मैंने नीचे के लिए regex का इस्तेमाल किया है ईमेल सत्यापन। var reg = /^( ([^<>()[\]\\..;;:\s@\"]+(:.[^&lt ; & gt; () [\] \\,;:।। \ s @ \ "] +) *) | (\" + \ ")) @ ((\ [[0-9] {1,3} \ । [0-9] {1,3} \ [0-9] {1,3} \ [0-9] {1,3} \]) |।। (([a-zA-जेड \ -0 -9] \) + [a-zA-Z] {2,})) $ /। मैं निम्न दो ईमेल आईडी को कैसे मान्य कर सकता हूँ हैलो!% #% ^ World@gmail.com helloworld @ -gmail.com Vaild ईमेल आईडी: हैलो- world@gmail.com hello.world@gmail कॉम इनवैलड ईमेल आईडी: हैलो! #% # @ Gmail.com helloworld@-gmail.com विशेष वर्ण को @ gmail.com से पहले अनुमति नहीं दी जानी चाहिए नीचे मेरा जावास्क्रिप्ट कोड है var re = / ^ (([ ^ & lt; & gt; () [\] \\,;:। \ s @ \ "।] + (\ [^ & lt; & gt; () [\] \\,;:। \ s @ \"] ) *) | "। + \"।। (\)) @ ((\ [[0-9] {1,3} \ [0-9] {1,3} \ [0-9] {1, 3} \ [0-9] {1,3} \]) |। (। ([a-zA-जेड \ -0-9] \) + [a-zA-Z] {2,})) $ /; अगर ...

vba - Contains Syntax for SQL -

I'm here in my head, I'm trying to work it out Set rex2 = db.OpenRecordset ("Select Count from Events (*) where event_date & gt; = #" & format (Last_Watch_start, "mm / day / yyyy") & amp; ### and MailDate and LT; = "" & Amp;; Format (last_wec_end, "mm / dd / yyyy") and "# and in it (event_type," "1 call has been attempted") and "UNS" in work_id) / Code> where event_type is in the database The column name and work_ID is the name of the column in the database I attempted in several ways. Where in the type of incident "1 call attempted" is etc., but I have no luck. I will change my code, but in the event_type many categories have been tried in the list of calls. I left a left statement ie where (incident_type, 18) = "tried the first call" Do anything to work for Please help me. Maybe you should use the operator. You have to do something li...

mechanize create google alert in ruby on rails -

I'm trying to create a Google Alert in Ruby. I am using mechanization. @web_agent = MacNetJet New Page = @ Web_Guent.T. 'https://www.google.com/alerts' form = page.form_with: name = & gt; Form 'F1' Q = "search keyword" Getting me the zero form value. I'm getting the error: Undefined method `q = for zero: NilClass` Google changed the html That's why I need some hacks.

javascript - How to get email and profile information upon successful login to google -

मैंने स्कोप का उपयोग करके Google को सफलतापूर्वक प्रमाणित किया है: var scopes = ['email ',' प्रोफाइल ',' https: //www.googleapis.com/auth/drive ']; मैं उपयोगकर्ता का ईमेल और प्रोफ़ाइल देखने और पढ़ने के लिए इसका उपयोग करता हूं: function getEmail (resp) {var email, isFound = false; console.log (resp); के लिए (var i = 0; i & lt; resp.emails.length & amp; ;Found; i ++) {यदि (resp.emails [i] .type === 'खाता') {email = resp.emails [i] .Value; IsFound = true}} वापसी ईमेल; } समारोह getProfile (resp) {console.log (resp); Console.log ("पुनःप्राप्त प्रोफाइल" + resp.displayName); } फ़ंक्शन संभाल रिस्पांस (resp) {var email = getEmail (resp); Var प्रोफाइल = गेटप्रोफाइल (resp); } संभाल ऑथरेथ के तहत मैं कॉल करता हूं: gapi.client.load ('plus', 'v1', function () {// अनुरोध प्रोफ़ाइल जानकारी Var अनुरोध = gapi.client.plus.people.get ({'userid': 'मुझे',}); // अनुरोध अनुरोध। Execute (handleResponse);}); उप...

How to disable plesk 12.0.18 update notifications (especially for wordpress and for customers) -

Managed by plesk 12.0.18 - Everyday wordpress update notifications (theme, plugin, etc.) - Every customer - on a server - ). After upgrading to plesk 12.0.18 can I find a disabled button anywhere can someone help? Go to "Tools and Settings-> Notifications" and configure further notifications:

performance - XAML fast Printing on Bill Printer (IBM SureMark 4610) -

I have a problem, that my bill printer is printing very slowly with a line per second instead of 52 lines per second My Print Object is a WPF XAML-Fixed Page: Public Virtual Zero Print (Fixed Page Page) {PrintTicket pTicket = PrintingQueue.DefaultPrintTicket; // print without dialog printed podialog pDialog = new printDialog {PrintQueue = PrintingQueue, // Printer Printer Selected Printer PrintTicket = pTicket // Type PrintTicket}; PDialog.PrintVisual (Page, "Print It"); } XAML-objects are printed as I want but printing on a bill printer like IBM SureMark 4610 is very slow because the printer is using XML Fixed Page in graphic mode Prints a row per second and 52 lines per second. IBM writes that the printer prints in graphic mode when other fonts are used from three embedded (font A 10pt, font b12pt, font c? Pt). I have the FontFamily = font A "and the font size =" 10 " & dockpanel with the grid. Column =" 0 "grid. Line =" 3 ...

android - Closing AdMob interstitial destroys activity I called it from -

When I close the AdMob interstitial test-Aid, the activity I call it is destroyed. I will make intermediate like this: interstiad = new interstitial (this); InterstitialAd.setAdUnitId (AD_UNIT_ID); AdRequest adRequest = New AdRequest.Builder () .addTestDevice (MY_TEST_DEVICE_HASHED_ID) .build (); InterstitialAd.loadAd (adRequest); InterstitialAd.setAdListener (New AdListener) {@Override public void onAdClosed () {System.out.println ("Ed is closing");}}); Public Zero show_ad () {if (interstitialAd.isLoaded ()) interstitialAd.show (); } @ Override Protected Zero is derireau () {System.out.println (called "onDestroy (")); Super.onDestroy (); } Logcat output: 07-27 14: 39: 35.348: I / ad (5699): Opening ads 07-27 14:39: 35.438: I / Chromium (5699): [Info: async_pixel_transfer_manager_android.cc (56)] Async Pixel Transfer 07-27 Not Supported 14: 39: 35.498: I / Chromium (5699): [Info: 39: 35.498: async_pixel_transfer_manager_android.cc (56)] Async Pixel Tran...

Android App Ad Integration - Best Approach -

I'm looking at several posts about integrating ads into the Android application. No one seems to answer directly, but to choose from many options. I am looking for the advice for which the best will be used !! I want to integrate ads into my application and want to choose the best option. There are many posts that give examples of these ads (eg, AppsZoom, AdBuddiz, Admob, Adwhirl, MobFox, MobClix, etc ...) What I'm reading, Admob is the best way to have someone on this The idea will be because I do not want to waste time looking for alternative solutions, if they are not worth it. I'm just looking for a nice, clean, quick integration that could potentially cost per install, per click, or the best way. Appreciate any comments and thanks for taking the time to read. I recommend that advertising mobile, which is now known as Google Mobile Advertising Integration is very easy (see) When it is found that the advertisement is also very important, so I suggest tha...

symfony - Doctrine Associations Mapping -

For the first time, I am trying for ideological associations with Symfony2 and it is giving me a headache. I is an Admin Interface, which can upload images in addition to other things. I want to know which administrator has uploaded any image, so I have put my admin in my images table, gather data, gather data To do a simple JOIN is necessary, but with the principle, I am stuck, but it seems simple. Therefore, I have a statement in that object, that I have a administrator object that reflects the table ... @ ORM \ OneToMany (target = "ImageBundleNamespace \ ImageEntity", mapped = "admin") It's easy in my ImageEntity object (which is Images indicates table) a foreigh key column admin . In the ImageEntity object, I use this statement ... @ORM \ ManyToOne (targetEntity = "AdministratorNamespace \ Administrator", inversedBy = "imageEntity") ImageEntity and admin > ImageEntity field contains the implied Sta...

php -> operator used in cascade -

itemprop = "text"> I saw this code: public function query ($ query) {$ full_query = $ This- & gt; Link-> Query ($ query); If ($ this- & gt; link & gt; error), ($ this- & gt; link & gt; error, $ query) {$ this-> log_db_errors; return false; } And {return true; }} is included in a class definition. Please tell the meaning of this type of code: A-> B-> C I know that a-> gt is used by a method or someone Upon reaching an immediate class property But do not understand how ("read, understand, translate") a-> gt; B-> C This means that property property B is also an object, so you have the property A The object A's property is getting C. class a {public $ b; Function __ conversion () {$ this- & gt; B = new B; }} Class B {public $ c; Function __ conversion () {$ this- & gt; C = 'hello'; }} $ A = new A; Revert $ a-> gt; B-> C; // output Hello

thread safety - Is this async Rails action safe? -

I am trying to do asynchronous and non-blocking a rail action. I am using Rail 3.2 and thin web server. Is the following code safe? Class AnalyticsController & lt; ApplicationController # [...] # When displaying a XHR request, def loads a spinner in the main page while loading the load. Nue do @answer = Analytic.build_stuff_with_blocking_io # can take up to 60sec request.env ['async.callback'] .col [200, {}, render_to_string (partial: '/ analytics / dashboard', layout: incorrect)] End throw: async end end Here's an example of how to perform async rail: class ApplicationController & lt; ActionController :: Base Def async EM.defer do sleep 5 # Some tasks that take long call.env ['async.callback']. Throw the call response end: async end end Be sure that you have config.allow_concurrency = true in your environment if you tap Using: Bundle Excel Thin - Started Start / P>

javascript - Filter logic like in reports -

This type of filter argument: (1 and 2) or 3 can be implemented in Python Is Javascript, any ideas? I did not find anything Google I mean, the user will type the filter in textarea, the grammar of the filter (mb with regex) and the pars filter need to be checked. Example of valid and invalid filter: 1 or 2: valid (1 and 3) or 2: valid (1 or 2 more) 3: invalid 1 and 2 (or 3): valid 1 (2 and 3): invalid How to do any idea? AFAIK, since boolean expression can have many nested levels - this is not a regular language, and Thus it would not be possible to make a regex without inputting some obstacles for input. In Python, I will use the eval to get it if the syntax is false then the exception will be thrown. As stated in the comments, keep in mind that this is a risky safety-war, so I'll first check the input text to avoid injection. [11]: eval ('1 or 2') outside [11]: 1 in [12]: eval ('1 (2 and 3)') - See some examples: - ---------------------------...

javascript - automatic login to a website -

I have found a third party website, which my customer can access to download some data timetables from me Wants to Data is customer specific, and password is protected. I have a username / password, and I have searched for ways to login myself so that I can pull data, but no success has been done so far, this is the way I have tried to: When I look at the login page of the website that I am trying to login (see source), I do not see the entry form, but if I click on the " Observe the element ", it shows that there is an entry form hidden. Any suggestions Edit: Here is the website which requires the knowledge of my own: Unfortunately it is not in English. The first field is the user name, the second field is the password and the button is logged Edit2: taking palm advice, I was able to find the Java code when the text is being triggered to modify the boxes Now I am going to make this script as element.DomContainer.Eval (function (n, t) {function vi (n) {var t ...

.htaccess - how to completely hide the url in yii2 -

Using yii2, I am creating a page to display the result of a category, and the URL is stuck in the rules I am Now, I have a category named Training Centers and this category's ID is 5 and in this category the Education Controller will list action Need to pass along. I have to write a rule of yii2, 'training-centers' = & gt; Can How do we use it? Htacess? After enabling the beautiful URL, it does not work with ; Rev. Training centers index.php? R = Education List and ID = 5 How can we write in URLs, where can not be identified in the Controller / Action / ID URL? Try this code: 'urlManager' = & gt; ['Rule' = & gt; ['Training-Center' = & gt; 'Index.php? R = education list & amp; Id = 5 ']], or .htaccess rewrite ^ training center $ / education / list /? Id = 5

audiorecord - How to duplicate Android AudioSource.MIC? -

I want to record Android microphone inputs in two audio recordcards items simultaneously. Is Android Orders.MIC a way to duplicate or simultaneously make it accessible with two examples? If yes, how can I do this? You can not do this in Android, in fact you can not copy any record frequency, When an example is already running, it applies to the camera as well as to the mic, in the case of output, controlling multiple streams, mixes, replay, etc. (composition, rendering for display), such as audio playout (and video display) There are modules for If you have a complete Android source code tool, you can try writing the buffering mechanism, but it is not normal, scalable and it is not easy. In general, if the recording object instance is opened by another application and kept, you can do nothing other than displaying an error message (Quick Experiment - Record audio in the background And open the speech converter in your keyboard, it throws an error)

java - AsyncTask vs Thread vs Service (communicating with server) -

I'm trying to apply an Android app where I can send commands to a server that controls the robot The problem is quite "simple": I want to keep a connection to send a message to the server and communicate with thread-service-work, and to get the responses to update the user and keep the information related to the robot sensor. Want to . So, what should my decision be? I know it may have been repeated but I did not find my problem, because I want to expand this question: Whether to run a background process on an activity, change the activity and continue it Any way? (activity or piece, I would go for pieces in the future). Thanks in advance for any help! Its best solution is probably a service Either how to communicate with the background service through intents or broadcast events, a great article on services.

java.util.scanner - How to restrict user scanner input data type (java)? -

Say, I want the user to input only an integer, but nothing like "bacon" One way to restrict is to have an input for integer (or other data types), so I do not get any errors or input other than integer? Assume that your scanner name is myScanner: public Fixed int checkI input () {{myScanner return.nextInt ()} hold (InputMismatchException e) {myScanner.next (); System.out.println ("Bacon Luff"); Return 0; }} And then you can call that method.

mysql - SELECT *, FUNCTION1(), FUNCTION(2) FROM -

Is there any way i can ask all the columns in MySQL that I can simulate this query SELECT *, FUNCTION1 (), FUCTION2 () from Table 1; While not every column in the selected segment is being calculated? The query that I am trying to achieve is to add all the columns required for all the columns so I will add some more columns to include in the resultset. Probably SELECT *, "sum", CONCAT (col1, "", col3) as table2 + col5 + col7; / div> Yes, how can you do that which you show One selection can contain these words: One column one expression a wildcard ( A qualified wildcard (like table1. * ) You can use any of these or all of the same selection queries. Speaking strictly, SQL-99 does not give the standard * in the selection list with other words, but you The case may be used with appropriate wildcards. But MySQL is more acceptable, it is not as strict as the standard of this matter. The standard rule shows. The document is av...

encryption - Wix setup failing with error 1603 -

I wrote a .NET 4 desktop application and when I try to run Setup.exe, I get the following error Log File. I am using Visual Studio 2012 with Visual 3.7. [16: 51: 54: 890] Remote Custom Action DLL: C: \ windows \ Installer \ MSIFECD.tmp, Entrypoint: EncryptConfig SFXCA: MSI (s) (E8: 1c) [16: 51: 54: 890] Removing the custom action from the temporary directory: C: \ windows \ Installer \ MSIFECD.tmp- \ SFXCA: Binding the CLR version v4.0.30319 for the custom action calling SecureConfig! SecureConfig.CustomActions.EncryptConfig EncryptConfig: An error occurred in the configuration section handler for security: file or assembly 'order. Could not load one of configuration.net 'or its dependencies. The system can not find the file specified. (C: \ program files (x86) \ orbit order system \ orbit order system.execonfig line 6) Custom Action Encrypted Configuration File with True Error Code 1603 (Note that this can not be 100% correct if the translation of the sandbox Inside) ...

angularjs - How do I trigger an Angular custom filter on click and populate with the filtered data? -

I want that .prerequisites container to be shown and populated, only when .popPrereq link (which can be a button ) Is clicked on. Jason data is already available in the main controller and the filter works fine. To populate the data that clicked, I need to tell in just one way. & lt; A href = "#" data-ng-show = "course.CoursePrerequisites" class = "popPrereq" & gt; Prerequisites & lt; / A & gt; & Lt; Div class = "prerequisites" style = "background: pink" & gt; & Lt; Div class = "prerequisite" data-ng-repeat = "pre-requisites in courses | requirements received: course. Course dependency" & gt; & Lt; P & gt; {{Prerequisite.program}} & lt; Br> & Lt; B & gt; {{Prerequisite.pagetitle}} & lt; / B & gt; & Lt; / P & gt; & Lt; / Div & gt; & Lt; / Div & gt; This is my custom filter Courses SearchApp.filter ('getrerequisite...

html5 - Media queries responsiveness not working in IE8 -

The responsiveness is not working in IE8. I have both respond.js & amp; Css3-mediaqueries.js. It still does not work. Below is my code HTML Thanks. Below is my style.css file. In IE8's case, getting a horizonatal scroller. I mean it is not responsive. Media queries are also not working. CSS body {background-color: #ccc; Font-family: Calibri, Ariel, 'Trebchett MS'; Padding: 0; Margin: 0; Font-size: 16px; }. Wiper {width: 1280px; Margin: 0 auto; Limit: 1px solid # ccc; Background color: #fff; } NAV {Width: 100%; / * Status: Fixed; * /} Nav ul {background color: RGB (64,131,238); Height: 40px; Width: 100%; Padding: 0; Margin: 0; } Nav ul li {list-style-type: none; Swim left; } NAL Li Li (font-size: 1.125m; / * 18px / 16px = 1.125 Name * / Text-decoration: None; Line-height: 40px; Height: 40px; Color: #fff; Padding-right: 20px; Padding-left: 20px; Display: Inline-block; }. Banner {Width: 100%; Height: auto; }. Wrapper-heding {font-size: 1.25em; / * 20...

Send pre established post with a toggle android widget -

I am using a PII as a web server to enable it to activate and deactivate the relay connected to the light Receives a form post for the bulb. In this way I can turn it on and off from the web browser. I am trying to create a widget in my Android so that the switch can be controlled and shut down and need to send a form post with HP basic authentication. What would be the easiest way to achieve this? Since I do not have any other android programming skills, I'm looking at several online sites to create simple Android apps, but I do not need to. This is what I used for simple HTML posting: String basal = "http://yoursite.com" + yourpostdata; HTTPARPPRMART = new basic HTTPPARM (); // Set the timeout in milliseconds until the connection is established. // The default value is zero, this means that the timeout is not used. Int Timeout Connection = 4000; HttpConnectionParams.setConnectionTimeout (httpParameters, Timeout Connection); // Set the default socket timeou...

java - How do I load an image in a particular coordinate in JMapViewer? -

I am trying to load an image in a special coordinate in JMapViewer. Anyone can recommend which class I have to use or give some examples? import java .awt.Graphics; Import java.awt.Image; Import java.awt.Point; Import org.openstreetmap.gui.jmapviewer.Coordinate; Import org.openstreetmap.gui.jmapviewer.MapMarkerCircle; Import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; / ** * Author @ velentos @ @ @sureed 18/09/2014 * / Public Class IconMarker applies MapMarkerCircle MapMarker {Personal image image; Public icon manager (coordination coordination, image image) {This (coordinate, 1, image); } Public IconMarker (Coordination Coordination, Double Radius, Image Image) {Super (Coordination, Radius); This.image = image; } @ Override Public Wide Paint (Graphics G, Point Position, Int Radio) {Double R = It. Tridius (); Int width = (int) (this.image.getWidth (zero) * r); Int height = (int) (this.image.getHeight (empty) * r); Int w2 = width / 2; Int h2 = height / 2; G.drawImag...

blogs - In Pelican, how can I link an image to its fullsize version? -

मेरे पेलिकन ब्लॉग लेख में मेरे पास ऐसा कुछ है: ! [Alt text] ({Filename} /images/foo.jpg) यह ठीक काम करता है क्योंकि इसमें लेख में foo.jpg शामिल है, अर्थात, यह बनाता है & lt ; Img src = "/ images / foo.jpg" alt = "Alt पाठ" & gt; हालांकि, मैं इस छवि को क्लिक करने योग्य बनाना चाहता हूं ताकि उपयोगकर्ताओं को पूर्ण-आकार की छवि के लिए URL पर जाने के लिए छवि को लिंक कर सकें, अर्थात & Lt; a href = "/ images / foo.jpg" & gt; & lt; img src = "/ images / foo.jpg" alt = "alt पाठ" & gt; & lt; / a & gt; "पाठ"> शायद प्रयास करें: [! [Alt Text] ({filename} /images/foo.jpg)] ({filename} /images/foo.jpg) ... या: [& lt; img src = "{filename} /images/foo.jpg" & gt;] ({filename} / चित्र / foo.jpg) संबंधित:

javascript - Controlling back/forward navigation of a *child* iframe? -

I'm working on a simple JavaScript-based window "app" (not a website, just some HTML and JS files All in the same folder which will be used on the local PC). The startup page is page 1. This page has 2 buttons ("back" and "forward"), and is an iframe that displays the content of page 2.html. And Page2.html also contains an IFAM, which displays many other pages in the same folder (we call it "color" page -> red-hm, green, hm, blue html etc.). In other words, when Page1.html has been started, you are viewing the contents of an iframe inside the iframe (which will be red.html, etc.). So I need to complete this ... I have to use the rear / back buttons to navigate to the "Page" page. Html). I have found that it is easy to navigate / navigate / iframe which is in the form of JS on same page , which is controlling iframe, like Using something .. $ (document) .ready (function () {$ ("# back_button_on_page1")....

extjs - Sencha Touch 2 - How to check if an item exists in the ViewPort -

What I want to do, basically, is to dynamically load views in the viewport when needed. For, I have to find out that the scene has already been added to the ViewPort, so it is not added multiple times. While looking at the Touch Touch documentation, I could not find a proper way to see if an item is present inside ViewPort. So in summary 1 - See if the viewport is included in something I want to actively set something like this: if ( Extension.viewport.imes.us ('myviewtoactivate')) Ext.Viewport.add ([{xtype: 'myviewtoactivate'}]); 2 - Then I will set this scene as active (I already know how to do this part). Thanks for the help! You can use something inside your controller: Var main = this.getMain (), Myview = main.down ('myview'); If (! Myview) {myview = main.add ({xtype: 'myview'}); }

git - how to create a file with the cmd? -

I have a win7 machine and I use guit shell (which seems like a Windows parcel) I am trying to follow the Lab 3 tutorial of GIT IMMERSION ( http://gitimmersion.com/lab_03.html ) I do not know how A file named Hello with the content given below. puts "hello world" Any help is appreciated. thanks a lot! If this is powerhall, then set-content set-contentHello.Rbb 'puts' hello, world' "

ios - How do I interact with NSObject from JSON? -

I am working in Swift and there is a question. I have been successful in getting the data back from the API as ARI (Jossan starts with [], this is an array), but I would like to use Returned Nested Objects in a special API (Instead of JSON [] starts with [], so it is not an array structurally. Such data. As you can see, the top level is UserRestoreData, and there are two second level components inside it: Favorite Miyals, and favorite drums. They have any children representing food or drink themselves, and in turn have any number of ingredients. UserRestoreData": [{"FavoriteMeals" "{{" FoodID ":" 1 "," Title ":" Wal Marcela "," Content ": {" Federal Id ":" 1 "," Name ":" Wail "}}, {" Favorite "Drox ": This function (does not crash when I run this code: [{" PRID ":" 1 "," title ":" mint mozito "}]}]} Is) var dat...

Pair (C++) with V8 -

How do I wrap the C ++ code in V8, try to understand. It is clear how to do it, when you create smth like 'hello world': stable handle & lt; Value & gt; Hello (CantAntues & Eggs) {Handskoscope Scope; Return zone Close (String :: New ("Hello_World")); } I want to wrap the next function: void foo () {pair; Lt; String, int & gt; F ("size", 30); Pair & lt; String, int & gt; S ("number", 12); Cout & lt; & Lt; "First" & lt; & Lt; F.first & lt; & Lt; "," & Lt; & Lt; F.second & lt; & Lt; Endl; Cout & lt; & Lt; "Second" & lt; & Lt; S.first & lt; & Lt; "," & Lt; & Lt; S.second & lt; & Lt; Endl; } But the problem is this: I do not have any idea how to do this.

java - String:matchs.method something not clear[RESOLVED] -

Hello, I was made purely a code for a program, but there are some Iyyues ... I understand everything Except that this is the one, please tell me about that thing ... ". * \\ d." " It holes code public void Czech (String w) {this.w = w; {if (w.matches (". * \\ d. * ")) {System.out.println (" try to include a number, Re .... (then 2 PAC) ");} Else {System.out.println (" Alright " + "& gt;" + w + "& lt;" + to "go and fuck ..."); runL = 3;}} while (run L == 2);} And for example what I can write if I want to find: $ "% & amp; /? Please let me know the source of this topic but I have not found anything useful And if my English is bad, then tell: D The method matches a regular expression. There are many good resources describing regular expressions. In this specific case ". * \\ d. *" match anything in which there is at least 1 digit \ d anywhere in the string. ...

ruby on rails 4 - dropzone.js + paperclip uploading each image as its own post -

I am facing a strange problem. I have posted_ as many attachments: imageable and is_to imageable, polymorphic: true I am trying to upload several images related to a single post. Dropzone.js However, whenever I upload multiple files in dropzone-driven form, each image is displayed in my Post uploads as soon as I upload 4 images, I get 4 posts with each attached image. How to quantify do, which I attached to a position, which is associated with that post? here post. Looks like JS : $ (document) .ready (function () disable // // disable search automatically Dropzone.autoDiscover = false; // upload our upload form Press with id $ ("# new_post") dropzone ({// maximum size 1MB to maxFilesize image size: 1, // changed paragraph passed to one accepted by // // Our Rail App nomenclature: " Post [attachments_attributes] [] [picture] ", // show add image on each image upload link: true});}); PostController create a deaf @ post = post. Action from ...

Google maps styling in Bangkok -

I am trying to style Google Maps for Bangkok, but for some reason, I'm unable to style (skaltren) or remove them completely. Am I doing something wrong or should I report it as a bug? Playing with the visibility settings only affects the station indicator, Edit: Steps to Repeat the Problem: Open Google styling wizard: navigate to Bangkok Choose Feature transit to change a style (for example, visibility). The stations themselves disappear, but the lines remain. Ok I solved it and I thought sharing it seems that if you If you set it first, you can do the style of Bangkok Skaltran lines. {"Stylers": [{"Visibility": "Closed"}]} and then set the relevant styles, namely: { "featureType": "transit", "Stailrs": [{ "visibility": "on"}, {saturation: - 100}, {Light}: 25}]}

css - Import Yeoman/Angularjs application -

I am trying to search for answers to this but do not really know how to search. I would like to know if there is any way that I can make a "component" in AngularJS, which contains instructions, css etc. and use that component in any other project? For example, I would like to create an angular application in which the base layout of our company is defined in CSS / Less and also includes Toolbox of Customized Control / Directives. I would like to create a new application in AngularJS and then import the "Base" application. Help much appreciated. In fact, all you have to do, all instructions, controllers, services etc. should be taken, Move them to a different folder, and place them under the same name space. After that, to reuse that component in another angular application, you should normally Those JS / CSS files need to be referenced, and set the project to the corner Be sure to declare time as dependency. This is essentially - angular makes it v...

numpy - Installing Python package from source into virtualenv directory -

Newbie programmer here. This is a variation. I am running Python 2.7 on Windows 7 and using GIT Bash Shell. I am trying to install the numpy package in the virtual directory in my work directory. I can not install it due to errors due to its dependencies using the $ pip install -r requirements.txt or $ pip installed numpy commands. Here's one. Although I can download and install directly executable binary (.exe), but it has forced me to install in the c: / Python27 / Lib / site-packages directory . I have to install it in my VirtualVoice Work Directory, e.g. c: / users / myname / projects / myproject / myvirtualenv . How do I download required numpy files in a temporary directory and use PIP or other tool installed in my VirtualNew directory. I have researched that I can choose a target directory in PP using the -t option, for example, " pip installed numpy - target = c: / users / MyName / projects / MyProject / myvirtualenv ". But I still can not get ...

c++ - Cannot find include files from other .h files in eclipse CDT despite settings being correct -

Image
I have a project that contains 3 party headers in that header, in other directories other headers are included I have the properties of the project There are all these directories specified in the C / C ++ general -> paths and symbols (for all languages). The file that can not be found, in which one of the routes shown is right in the project explorer! See illustration below, how can I take it to work? Note, from my source, I can control a third party header - I can get it. It seems that these headers can not find other headers. I tried to rearrange its order, it has no advantage.

mysql - Error in SQL logic -

Image
मुझे यह एसक्यूएल क्वेरी मिल गई है: का चयन करें r.room_id as room_id, room_name , संख्या_रूम, अधिकतम_ लोक, min_rate से कमरे में ऊपरी भाग जोड़ें (SELECT b.room_id, accom_id, COALESCE (संख्या (b. room_id), 0) बुकिंग से बुकिंग के समय में बीआरएआरएआरएआर_आदेश & gt; =: इंड एंड डिप्टी_डेट और एलटी; =: आउटड ग्रुप द्वारा room_id) टी पर (टी.कॉम_आईडी = आर.कॉम_आईडी और आर.रुम_आईड = टी.रुम_आईडी) जहां आर। सीकॉम_आईडी = आईडीआईडी ​​और (टी। बुक्सिंग और एलटी; एनएम_उल्ड्स या टी.बुक्सिंग आईएस नल है) ग्रुप द्वारा रूम_नाम जो निम्न एसक्यूएल तालिका से संबंधित है: परीक्षण संबंधी उद्देश्यों के लिए बुकिंग तालिका में यह जानकारी है: समस्या है: जब मैं क्वेरी चलाता हूं: इंडस्ट्रीज़ 2014-07-27 और: आउटड 2014-07-29 मुझे कुछ भी वापस नहीं मिलता है, जो वास्तव में मुझे क्या उम्मीद है! हालांकि, यदि मैं दिनांक 2014-07-28 (: इंडस्ट्रीज़) और 2014-07-29 (: आउटड) के लिए बदलता हूं दोनों कमरे मुझे लौट आए हैं! जो गलत है Room_id 2 को मेरे पास लौटना चाहिए, क्योंकि पिछला अतिथि 28 वें स्थान पर छोड़ दिया होता है, इसल...

asp.net mvc 4 - MVC 4 || identity || How To Disable Form Submitting For an Unauthorized User? -

I have a web app based on 'MVC4 and I have a form that is for sending (one action) By posting the server), the server now enables only the authorized approach to work with authorized users. My problem is that I put [authorize] before the post action in the controller so that the file was uploaded to the first server and the message to the unauthorized user to log in (Redirect the user to the register / login page). If I am unauthorized user, then I want to stop uploading files, then I need to check that the user is an authorized user and then submit the form. Any ideas how can I do this? Will be affected so that the authoritative attribute and such other features will be evaluated only after proper action. In fact this is not a feature of MVC as it is a feature of web architecture in general. The file upload is similar to any other POST version, on which it has been sent as part of the request Now, you have an asynchronous (AZ) file upload control Maybe, but in ...

java - What is the correct way to convert a Shape to a Rectangle2D.Double? -

I need to change a rectangle2D.Double (rotate). However, I do not need to attract the shape, I need to keep the changing rectangle in the form of an object so that I can use the .intersects () and other methods. This is the current way I am changing it Personal Rectangle 2D Double Transform (Rectangle2D.Double rect) {// change a new AffineTransform transform = new AffineTransform (); // Apply conversion changes. Rotate (Math.Tudian (Theta), rect.x + rect.width / 2, rect.y + rect.height / 2); // Find the resulting size s = transform.createTransformedShape (hitbox); // Final rectangular rectangle return //? } Now, someone can think that the following will work Rectangle2D.Double newRect = new Rectangle2D.Double (); NewRect.setFrame (transform.createTransformedShape (Rect) .getBounds2D ()); However, when it is drawn, it does not seem that it can rotate in any way, rather in large quantities (140x larger). is: How can I get it size , the way in which it is dragged, c...

osx - Kext with invalid signature can load on one machine, but not the other. Why? -

I have an iMac and a MacBook Pro. I updated both of them in Yosemite Beta (public one). But my audio interface Focuser Safer works well in 24 DSP (Firewire) IMAC, but not on the MacBook Pro. When Safar is installed, there is a Safari. When connecting it with IMAC, this KEXT load is OK, nothing is uncommon, connecting to the MacBook Pro does not load the quad. I tried to manually load it, and I get an error message that it Called because it can not be loaded with an illegal signature. Now, I have checked the signature on both computers, and they both say that the signature is invalid but this is correct on IMAC, although the signature is invalid. Why is that so? What I do not understand Here's some console output that helps if: Mattiass- MacBook Pro: Extensions Mono $ codesign -dvvv Saffire.kext / Performance = /System/Library/Extensions/Saffire.kext/Contents/MacOS/Saffire Identifier = tc.tctechnologies.driver.Saffire format = Mach -O universal (i386 x86_64) CodeDirec...

C# Click HTML Button without ID on webbrowser -

I'm trying to code at c # so that a button is clicked on the web browser. Not a button ID Here is html: & lt; Button class = "btn btn-primary" data-rejected = "modal" type = "submit"> log me in & lt; / Button & gt; & Lt; / Form & gt; How can I click this button without the id? Using jQuery, which can be done by clicking on a button based on class instead of ID , For example: $ (document) .ready (function () {$ (".btn"). Click (function () {warning ("bingo"}}) )